diff -Nru modemmanager-1.6.8/ABOUT-NLS modemmanager-1.10.0/ABOUT-NLS --- modemmanager-1.6.8/ABOUT-NLS 2017-06-17 10:24:35.000000000 +0200 +++ modemmanager-1.10.0/ABOUT-NLS 2019-01-17 16:15:34.000000000 +0100 @@ -1,16 +1,16 @@ 1 Notes on the Free Translation Project *************************************** -Free software is going international! The Free Translation Project is -a way to get maintainers of free software, translators, and users all +Free software is going international! The Free Translation Project is a +way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. - If you found this `ABOUT-NLS' file inside a distribution, you may -assume that the distributed package does use GNU `gettext' internally, + If you found this 'ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU 'gettext' internally, itself available at your nearest GNU archive site. But you do _not_ -need to install GNU `gettext' prior to configuring, installing or using +need to install GNU 'gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also @@ -23,12 +23,12 @@ Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such -packages use GNU `gettext'. Other packages have their own ways to -internationalization, predating GNU `gettext'. +packages use GNU 'gettext'. Other packages have their own ways to +internationalization, predating GNU 'gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. Installers may use special +provides the GNU 'gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: @@ -36,72 +36,71 @@ will _totally_ disable translation of messages. - When you already have GNU `gettext' installed on your system and run -configure without an option for your new package, `configure' will -probably detect the previously built and installed `libintl' library -and will decide to use it. If not, you may have to to use the -`--with-libintl-prefix' option to tell `configure' where to look for it. + When you already have GNU 'gettext' installed on your system and run +configure without an option for your new package, 'configure' will +probably detect the previously built and installed 'libintl' library and +will decide to use it. If not, you may have to to use the +'--with-libintl-prefix' option to tell 'configure' where to look for it. - Internationalized packages usually have many `po/LL.po' files, where + Internationalized packages usually have many 'po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless -translations have been forbidden at `configure' time by using the -`--disable-nls' switch, all available translations are installed -together with the package. However, the environment variable `LINGUAS' +translations have been forbidden at 'configure' time by using the +'--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable 'LINGUAS' may be set, prior to configuration, to limit the installed set. -`LINGUAS' should then contain a space separated list of two-letter +'LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you -only have to set the `LANG' environment variable to the appropriate -`LL_CC' combination. If you happen to have the `LC_ALL' or some other -`LC_xxx' environment variables set, you should unset them before -setting `LANG', otherwise the setting of `LANG' will not have the -desired effect. Here `LL' is an ISO 639 two-letter language code, and -`CC' is an ISO 3166 two-letter country code. For example, let's -suppose that you speak German and live in Germany. At the shell -prompt, merely execute `setenv LANG de_DE' (in `csh'), -`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). -This can be done from your `.login' or `.profile' file, once and for -all. +only have to set the 'LANG' environment variable to the appropriate +'LL_CC' combination. If you happen to have the 'LC_ALL' or some other +'LC_xxx' environment variables set, you should unset them before setting +'LANG', otherwise the setting of 'LANG' will not have the desired +effect. Here 'LL' is an ISO 639 two-letter language code, and 'CC' is +an ISO 3166 two-letter country code. For example, let's suppose that +you speak German and live in Germany. At the shell prompt, merely +execute 'setenv LANG de_DE' (in 'csh'), 'export LANG; LANG=de_DE' (in +'sh') or 'export LANG=de_DE' (in 'bash'). This can be done from your +'.login' or '.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For -example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +example, 'de_AT' is used for Austria, and 'pt_BR' for Brazil. The country code serves to distinguish the dialects. - The locale naming convention of `LL_CC', with `LL' denoting the -language and `CC' denoting the country, is the one use on systems based -on GNU libc. On other systems, some variations of this scheme are -used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your language by running the -command `locale -a | grep '^LL''. + The locale naming convention of 'LL_CC', with 'LL' denoting the +language and 'CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are used, +such as 'LL' or 'LL_CC.ENCODING'. You can get the list of locales +supported by your system for your language by running the command +'locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called -`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' -for the purpose of message handling, but you still need to have `LANG' +'LANGUAGE'. GNU 'gettext' gives preference to 'LANGUAGE' over 'LANG' +for the purpose of message handling, but you still need to have 'LANG' set to the primary language; this is required by other parts of the -system libraries. For example, some Swedish users who would rather -read translations in German than English for when Swedish is not -available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. +system libraries. For example, some Swedish users who would rather read +translations in German than English for when Swedish is not available, +set 'LANGUAGE' to 'sv:de' while leaving 'LANG' to 'sv_SE'. Special advice for Norwegian users: The language code for Norwegian -bokma*l changed from `no' to `nb' recently (in 2003). During the +bokma*l changed from 'no' to 'nb' recently (in 2003). During the transition period, while some message catalogs for this language are -installed under `nb' and some older ones under `no', it's recommended -for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +installed under 'nb' and some older ones under 'no', it's recommended +for Norwegian users to set 'LANGUAGE' to 'nb:no' so that both newer and older translations are used. - In the `LANGUAGE' environment variable, but not in the `LANG' -environment variable, `LL_CC' combinations can be abbreviated as `LL' -to denote the language's main dialect. For example, `de' is equivalent -to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' -(Portuguese as spoken in Portugal) in this context. + In the 'LANGUAGE' environment variable, but not in the 'LANG' +environment variable, 'LL_CC' combinations can be abbreviated as 'LL' to +denote the language's main dialect. For example, 'de' is equivalent to +'de_DE' (German as spoken in Germany), and 'pt' to 'pt_PT' (Portuguese +as spoken in Portugal) in this context. 1.3 Translating Teams ===================== @@ -111,22 +110,22 @@ able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, -`http://translationproject.org/', in the "Teams" area. +'http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has -`-request' appended. For example, speakers of Swedish can send a -message to `sv-request@li.org', having this message body: +'-request' appended. For example, speakers of Swedish can send a +message to 'sv-request@li.org', having this message body: subscribe - Keep in mind that team members are expected to participate -_actively_ in translations, or at solving translational difficulties, -rather than merely lurking around. If your team does not exist yet and -you want to start one, or if you are unsure about what to do or how to -get started, please write to `coordinator@translationproject.org' to -reach the coordinator for all translator teams. + Keep in mind that team members are expected to participate _actively_ +in translations, or at solving translational difficulties, rather than +merely lurking around. If your team does not exist yet and you want to +start one, or if you are unsure about what to do or how to get started, +please write to 'coordinator@translationproject.org' to reach the +coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than @@ -136,1114 +135,1214 @@ ====================== Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of June -2010. The matrix shows, in regard of each package, for which languages -PO files have been submitted to translation coordination, with a +matrix shows the current state of internationalization, as of Jun 2014. +The matrix shows, in regard of each package, for which languages PO +files have been submitted to translation coordination, with a translation percentage of at least 50%. - Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca + Ready PO files af am an ar as ast az be bg bn bn_IN bs ca crh cs + +---------------------------------------------------+ + a2ps | [] [] [] | + aegis | | + anubis | | + aspell | [] [] [] | + bash | [] [] [] | + bfd | | + binutils | [] | + bison | | + bison-runtime | [] | + buzztrax | [] | + ccd2cue | | + ccide | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | [] | + datamash | | + denemo | [] [] | + dfarc | [] | + dialog | [] [] [] | + dico | | + diffutils | [] | + dink | [] | + direvent | | + doodle | [] | + dos2unix | | + dos2unix-man | | + e2fsprogs | [] [] | + enscript | [] | + exif | [] | + fetchmail | [] [] | + findutils | [] | + flex | [] | + freedink | [] [] | + fusionforge | | + gas | | + gawk | [] | + gcal | [] | + gcc | | + gdbm | | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gjay | | + glunarclock | [] [] [] | + gnubiff | [] | + gnubik | [] | + gnucash | () () [] | + gnuchess | | + gnulib | [] | + gnunet | | + gnunet-gtk | | + gold | | + gphoto2 | [] | + gprof | [] | + gramadoir | | + grep | [] [] [] | + grub | [] | + gsasl | | + gss | | + gst-plugins-bad | [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] | + gst-plugins-ugly | [] [] [] | + gstreamer | [] [] [] [] | + gtick | [] | + gtkam | [] [] | + gtkspell | [] [] [] [] [] | + guix | | + guix-packages | | + gutenprint | [] | + hello | [] | + help2man | | + help2man-texi | | + hylafax | | + idutils | | + iso_15924 | [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + iso_639_5 | | + jwhois | | + kbd | [] | + klavaro | [] [] [] [] [] | + ld | [] | + leafpad | [] [] [] [] | + libc | [] [] [] | + libexif | () | + libextractor | | + libgnutls | [] | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | | + libiconv | [] [] | + libidn | [] | + liferea | [] [] [] [] | + lilypond | [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] | + m4 | [] | + mailfromd | | + mailutils | | + make | [] | + man-db | [] [] | + man-db-manpages | | + midi-instruments | [] [] [] | + minicom | [] | + mkisofs | [] | + myserver | [] | + nano | [] [] [] | + opcodes | | + parted | [] | + pies | | + pnmixer | | + popt | [] | + procps-ng | | + procps-ng-man | | + psmisc | [] | + pspp | [] | + pushover | [] | + pwdutils | | + pyspread | | + radius | [] | + recode | [] [] [] | + recutils | | + rpm | | + rush | | + sarg | | + sed | [] [] [] [] | + sharutils | [] | + shishi | | + skribilo | | + solfege | [] [] | + solfege-manual | | + spotmachine | | + sudo | [] [] | + sudoers | [] [] | + sysstat | [] | + tar | [] [] [] | + texinfo | [] [] | + texinfo_document | [] [] | + tigervnc | [] | + tin | | + tin-man | | + tracgoogleappsa... | | + trader | | + util-linux | [] | + ve | | + vice | | + vmm | | + vorbis-tools | [] | + wastesedge | | + wcd | | + wcd-man | | + wdiff | [] [] | + wget | [] | + wyslij-po | | + xboard | | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + af am an ar as ast az be bg bn bn_IN bs ca crh cs + 4 0 2 5 3 11 0 8 25 3 3 1 55 4 74 + + da de el en en_GB en_ZA eo es et eu fa fi fr + +--------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] [] [] | + aegis | [] [] [] [] | + anubis | [] [] [] [] [] | + aspell | [] [] [] [] [] [] [] | + bash | [] [] [] | + bfd | [] [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] [] [] [] | + buzztrax | [] [] [] [] | + ccd2cue | [] [] [] [] | + ccide | [] [] [] [] [] [] | + cflow | [] [] [] [] [] | + clisp | [] [] [] [] [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] [] [] | + cppi | [] [] [] [] [] | + cpplib | [] [] [] [] [] [] | + cryptsetup | [] [] [] [] [] | + datamash | [] [] [] [] | + denemo | [] | + dfarc | [] [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] | + dico | [] [] [] [] | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] [] [] [] | + direvent | [] [] [] [] | + doodle | [] [] [] [] | + dos2unix | [] [] [] [] [] | + dos2unix-man | [] [] [] | + e2fsprogs | [] [] [] [] [] | + enscript | [] [] [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] () [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] | + flex | [] [] [] [] [] [] | + freedink | [] [] [] [] [] [] [] [] | + fusionforge | [] [] [] | + gas | [] [] [] | + gawk | [] [] [] [] [] | + gcal | [] [] [] [] | + gcc | [] | + gdbm | [] [] [] [] [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] | + gjay | [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | () [] [] () | + gnubik | [] [] [] [] [] | + gnucash | [] () () () () () () | + gnuchess | [] [] [] [] | + gnulib | [] [] [] [] [] [] [] | + gnunet | [] | + gnunet-gtk | [] | + gold | [] [] [] | + gphoto2 | [] () [] [] | + gprof | [] [] [] [] [] [] | + gramadoir | [] [] [] [] [] | + grep | [] [] [] [] [] [] [] | + grub | [] [] [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | [] () [] [] [] | + gtkam | [] () [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] | + guix | [] [] | + guix-packages | | + gutenprint | [] [] [] [] | + hello | [] [] [] [] [] [] [] [] | + help2man | [] [] [] [] [] [] [] | + help2man-texi | [] [] [] | + hylafax | [] [] | + idutils | [] [] [] [] [] | + iso_15924 | [] () [] [] () [] () | + iso_3166 | [] () [] [] [] [] () [] () | + iso_3166_2 | [] () () () | + iso_4217 | [] () [] [] [] () [] () | + iso_639 | [] () [] [] () [] () | + iso_639_3 | () () () | + iso_639_5 | () () () | + jwhois | [] [] [] [] [] | + kbd | [] [] [] [] [] [] | + klavaro | [] [] [] [] [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] [] () [] [] | + libextractor | [] | + libgnutls | [] [] [] [] | + libgphoto2 | [] () [] | + libgphoto2_port | [] () [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] [] [] | + libidn | [] [] [] [] [] | + liferea | [] () [] [] [] [] [] | + lilypond | [] [] [] [] [] [] | + lordsawar | [] [] | + lprng | | + lynx | [] [] [] [] [] [] | + m4 | [] [] [] [] [] [] | + mailfromd | [] | + mailutils | [] [] [] [] | + make | [] [] [] [] [] | + man-db | [] [] [] [] | + man-db-manpages | [] [] | + midi-instruments | [] [] [] [] [] [] [] [] [] | + minicom | [] [] [] [] [] | + mkisofs | [] [] [] | + myserver | [] [] [] [] | + nano | [] [] [] [] [] [] [] | + opcodes | [] [] [] [] [] | + parted | [] [] [] | + pies | [] | + pnmixer | [] [] | + popt | [] [] [] [] [] [] | + procps-ng | [] [] | + procps-ng-man | [] [] | + psmisc | [] [] [] [] [] [] [] | + pspp | [] [] [] | + pushover | () [] [] [] | + pwdutils | [] [] [] | + pyspread | [] [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + recutils | [] [] [] [] | + rpm | [] [] [] [] [] | + rush | [] [] [] | + sarg | [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] [] [] | + skribilo | [] [] [] | + solfege | [] [] [] [] [] [] [] [] | + solfege-manual | [] [] [] [] [] | + spotmachine | [] [] [] [] [] | + sudo | [] [] [] [] [] [] | + sudoers | [] [] [] [] [] [] | + sysstat | [] [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] [] | + texinfo_document | [] [] [] [] | + tigervnc | [] [] [] [] [] [] | + tin | [] [] [] [] | + tin-man | [] | + tracgoogleappsa... | [] [] [] [] [] | + trader | [] [] [] [] [] [] | + util-linux | [] [] [] [] | + ve | [] [] [] [] [] | + vice | () () () | + vmm | [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | [] | + wcd | [] [] [] [] | + wcd-man | [] | + wdiff | [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] | + wyslij-po | [] [] [] [] | + xboard | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] [] | + +--------------------------------------------------+ + da de el en en_GB en_ZA eo es et eu fa fi fr + 119 131 32 1 6 0 94 95 22 13 4 102 139 + + ga gd gl gu he hi hr hu hy ia id is it ja ka kk + +-------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] | + binutils | [] [] [] | + bison | [] | + bison-runtime | [] [] [] [] [] [] [] [] | + buzztrax | | + ccd2cue | [] | + ccide | [] [] | + cflow | [] [] [] | + clisp | | + coreutils | [] [] | + cpio | [] [] [] [] [] [] | + cppi | [] [] [] [] [] | + cpplib | [] [] | + cryptsetup | [] | + datamash | | + denemo | [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] | + dink | [] | + direvent | [] | + doodle | [] [] | + dos2unix | [] [] | + dos2unix-man | | + e2fsprogs | [] [] | + enscript | [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] | + freedink | [] [] [] [] | + fusionforge | | + gas | [] | + gawk | [] () [] | + gcal | | + gcc | | + gdbm | | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gjay | [] | + glunarclock | [] [] [] [] [] [] | + gnubiff | [] [] () | + gnubik | [] [] [] | + gnucash | () () () () () | + gnuchess | | + gnulib | [] [] [] [] [] | + gnunet | | + gnunet-gtk | | + gold | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] [] | + gramadoir | [] [] [] | + grep | [] [] [] [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] | + gst-plugins-base | [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + guix | | + guix-packages | | + gutenprint | [] [] [] | + hello | [] [] [] [] [] | + help2man | [] [] [] | + help2man-texi | | + hylafax | [] | + idutils | [] [] | + iso_15924 | [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] | + iso_4217 | [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + iso_639_5 | | + jwhois | [] [] [] [] | + kbd | [] [] [] | + klavaro | [] [] [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] () | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | | + libgnutls | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] [] [] [] [] [] | + libidn | [] [] [] [] | + liferea | [] [] [] [] [] | + lilypond | [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | | + mailutils | | + make | [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] [] | + midi-instruments | [] [] [] [] [] [] [] [] [] | + minicom | [] [] [] | + mkisofs | [] [] | + myserver | [] | + nano | [] [] [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] [] [] | + pies | | + pnmixer | [] [] | + popt | [] [] [] [] [] [] [] [] [] [] | + procps-ng | | + procps-ng-man | | + psmisc | [] [] [] [] | + pspp | [] [] | + pushover | [] | + pwdutils | [] | + pyspread | | + radius | [] | + recode | [] [] [] [] [] [] [] | + recutils | | + rpm | [] | + rush | [] | + sarg | | + sed | [] [] [] [] [] [] [] | + sharutils | | + shishi | | + skribilo | [] | + solfege | [] [] | + solfege-manual | | + spotmachine | | + sudo | [] [] [] [] | + sudoers | [] [] [] | + sysstat | [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] | + texinfo_document | [] [] [] | + tigervnc | | + tin | | + tin-man | | + tracgoogleappsa... | [] [] [] [] | + trader | [] [] | + util-linux | [] | + ve | [] | + vice | () () | + vmm | | + vorbis-tools | [] [] | + wastesedge | [] | + wcd | | + wcd-man | | + wdiff | [] [] [] | + wget | [] [] [] [] | + wyslij-po | [] [] [] | + xboard | | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + ga gd gl gu he hi hr hu hy ia id is it ja ka kk + 35 2 47 4 8 2 60 71 2 6 81 11 87 57 0 3 + + kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl +--------------------------------------------------+ - a2ps | [] [] | - aegis | | - ant-phone | | - anubis | | - aspell | [] [] | - bash | | + a2ps | [] [] | + aegis | [] | + anubis | [] [] [] | + aspell | [] [] | + bash | [] [] | bfd | | - bibshelf | [] | binutils | | - bison | | - bison-runtime | [] | - bluez-pin | [] [] | - bombono-dvd | | - buzztard | | - cflow | | - clisp | | - coreutils | [] [] | - cpio | | + bison | [] | + bison-runtime | [] [] [] [] [] [] | + buzztrax | | + ccd2cue | | + ccide | [] [] | + cflow | [] | + clisp | [] | + coreutils | [] [] | + cpio | [] | cppi | | - cpplib | [] | - cryptsetup | | - dfarc | | - dialog | [] [] | + cpplib | [] | + cryptsetup | [] | + datamash | [] [] | + denemo | | + dfarc | [] [] | + dialog | [] [] [] [] [] [] | dico | | - diffutils | [] | - dink | | - doodle | | - e2fsprogs | [] | - enscript | [] | - exif | | - fetchmail | [] | - findutils | [] | - flex | [] | - freedink | | + diffutils | [] [] [] | + dink | [] | + direvent | [] | + doodle | [] | + dos2unix | [] [] | + dos2unix-man | [] | + e2fsprogs | [] | + enscript | [] | + exif | [] [] [] | + fetchmail | [] | + findutils | [] [] | + flex | [] | + freedink | [] [] | + fusionforge | | gas | | - gawk | [] [] | - gcal | [] | + gawk | [] | + gcal | | gcc | | - gettext-examples | [] [] [] [] | - gettext-runtime | [] [] | - gettext-tools | [] [] | - gip | [] | + gdbm | | + gettext-examples | [] [] [] [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] | gjay | | - gliv | [] | - glunarclock | [] [] | - gnubiff | | - gnucash | [] | - gnuedu | | - gnulib | | + glunarclock | [] [] | + gnubiff | [] | + gnubik | [] [] | + gnucash | () () () () () () () [] | + gnuchess | [] [] | + gnulib | [] | gnunet | | gnunet-gtk | | - gnutls | | gold | | - gpe-aerial | | - gpe-beam | | - gpe-bluetooth | | - gpe-calendar | | - gpe-clock | [] | - gpe-conf | | - gpe-contacts | | - gpe-edit | | - gpe-filemanager | | - gpe-go | | - gpe-login | | - gpe-ownerinfo | [] | - gpe-package | | - gpe-sketchbook | | - gpe-su | [] | - gpe-taskmanager | [] | - gpe-timesheet | [] | - gpe-today | [] | - gpe-todo | | - gphoto2 | | - gprof | [] | - gpsdrive | | - gramadoir | | - grep | | - grub | [] [] | - gsasl | | + gphoto2 | [] | + gprof | [] [] | + gramadoir | [] | + grep | [] [] | + grub | [] [] [] | + gsasl | [] | gss | | - gst-plugins-bad | [] | - gst-plugins-base | [] | - gst-plugins-good | [] | - gst-plugins-ugly | [] | - gstreamer | [] [] [] | - gtick | | - gtkam | [] | - gtkorphan | [] | - gtkspell | [] [] [] | - gutenprint | | - hello | [] | - help2man | | - hylafax | | - idutils | | - indent | [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | | - iso_639 | [] [] [] [] | - iso_639_3 | | - jwhois | | - kbd | | - keytouch | [] | - keytouch-editor | | - keytouch-keyboa... | [] | - klavaro | [] | - latrine | | - ld | [] | - leafpad | [] [] | - libc | [] [] | - libexif | () | - libextractor | | - libgnutls | | - libgpewidget | | - libgpg-error | | - libgphoto2 | | - libgphoto2_port | | - libgsasl | | - libiconv | [] | - libidn | | - lifelines | | - liferea | [] [] | - lilypond | | - linkdr | [] | + gst-plugins-bad | [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | [] [] [] | + gtick | [] | + gtkam | [] [] | + gtkspell | [] [] [] [] [] [] [] | + guix | | + guix-packages | | + gutenprint | [] | + hello | [] [] [] | + help2man | [] | + help2man-texi | | + hylafax | [] | + idutils | [] | + iso_15924 | () [] [] | + iso_3166 | [] [] [] () [] [] [] [] [] [] | + iso_3166_2 | () [] | + iso_4217 | () [] [] [] | + iso_639 | [] [] () [] [] [] [] | + iso_639_3 | [] () [] | + iso_639_5 | () | + jwhois | [] [] | + kbd | [] | + klavaro | [] [] | + ld | | + leafpad | [] [] [] [] [] | + libc | [] [] | + libexif | [] | + libextractor | [] | + libgnutls | [] [] | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | [] | + libiconv | [] [] | + libidn | [] | + liferea | [] [] [] | + lilypond | [] | lordsawar | | lprng | | - lynx | [] | - m4 | | + lynx | [] | + m4 | [] | mailfromd | | mailutils | | - make | | - man-db | | - man-db-manpages | | - minicom | | - mkisofs | | + make | [] [] | + man-db | [] | + man-db-manpages | [] | + midi-instruments | [] [] [] [] [] [] [] | + minicom | [] | + mkisofs | [] | myserver | | - nano | [] [] | - opcodes | | - parted | | + nano | [] [] [] | + opcodes | [] | + parted | [] [] | pies | | - popt | | - psmisc | | - pspp | [] | - pwdutils | | - radius | [] | - recode | [] [] | - rosegarden | | - rpm | | - rush | | + pnmixer | [] | + popt | [] [] [] [] [] | + procps-ng | | + procps-ng-man | | + psmisc | [] | + pspp | [] [] | + pushover | | + pwdutils | [] | + pyspread | | + radius | [] | + recode | [] [] | + recutils | [] | + rpm | [] | + rush | [] | sarg | | - screem | | - scrollkeeper | [] [] [] | - sed | [] [] | - sharutils | [] [] | + sed | [] [] | + sharutils | [] | shishi | | - skencil | | - solfege | | - solfege-manual | | - soundtracker | | - sp | | - sysstat | | - tar | [] | - texinfo | | + skribilo | | + solfege | [] [] | + solfege-manual | [] | + spotmachine | [] | + sudo | [] [] [] | + sudoers | [] [] [] | + sysstat | [] [] | + tar | [] [] [] | + texinfo | [] | + texinfo_document | [] | + tigervnc | [] | tin | | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] | - vice | | - vmm | | - vorbis-tools | | - wastesedge | | - wdiff | | - wget | [] [] | - wyslij-po | | - xchat | [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] | + tin-man | | + tracgoogleappsa... | [] [] [] | + trader | [] | + util-linux | [] | + ve | [] | + vice | [] | + vmm | [] | + vorbis-tools | [] | + wastesedge | [] | + wcd | [] | + wcd-man | [] | + wdiff | [] | + wget | [] [] | + wyslij-po | [] | + xboard | [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | +--------------------------------------------------+ - af am an ar as ast az be be@latin bg bn_IN bs ca - 6 0 1 2 3 19 1 10 3 28 3 1 38 + kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl + 5 15 4 6 0 13 23 3 3 3 4 11 2 42 1 125 - crh cs da de el en en_GB en_ZA eo es et eu fa - +-------------------------------------------------+ - a2ps | [] [] [] [] [] [] [] | - aegis | [] [] [] | - ant-phone | [] () | - anubis | [] [] | - aspell | [] [] [] [] [] | - bash | [] [] [] | - bfd | [] | - bibshelf | [] [] [] | - binutils | [] | - bison | [] [] | - bison-runtime | [] [] [] [] | - bluez-pin | [] [] [] [] [] [] | - bombono-dvd | [] | - buzztard | [] [] [] | - cflow | [] [] | - clisp | [] [] [] [] | - coreutils | [] [] [] [] | - cpio | | - cppi | | - cpplib | [] [] [] | - cryptsetup | [] | - dfarc | [] [] [] | - dialog | [] [] [] [] [] | - dico | | - diffutils | [] [] [] [] [] [] | - dink | [] [] [] | - doodle | [] | - e2fsprogs | [] [] [] | - enscript | [] [] [] | - exif | () [] [] | - fetchmail | [] [] () [] [] [] | - findutils | [] [] [] | - flex | [] [] | - freedink | [] [] [] | - gas | [] | - gawk | [] [] [] | - gcal | [] | - gcc | [] [] | - gettext-examples | [] [] [] [] | - gettext-runtime | [] [] [] [] | - gettext-tools | [] [] [] | - gip | [] [] [] [] | - gjay | [] | - gliv | [] [] [] | - glunarclock | [] [] | - gnubiff | () | - gnucash | [] () () () () | - gnuedu | [] [] | - gnulib | [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gold | [] | - gpe-aerial | [] [] [] [] | - gpe-beam | [] [] [] [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] | - gpe-clock | [] [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] [] [] | - gpe-edit | [] [] | - gpe-filemanager | [] [] [] | - gpe-go | [] [] [] [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] [] | - gpe-package | [] [] [] | - gpe-sketchbook | [] [] [] [] | - gpe-su | [] [] [] [] | - gpe-taskmanager | [] [] [] [] | - gpe-timesheet | [] [] [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] [] () [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] [] | - gramadoir | [] [] [] | - grep | [] | - grub | [] [] | - gsasl | [] | - gss | | - gst-plugins-bad | [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] () [] | - gtkam | [] [] () [] [] | - gtkorphan | [] [] [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | [] [] [] | - hello | [] [] [] [] | - help2man | [] | - hylafax | [] [] | - idutils | [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | [] () [] [] | - iso_3166 | [] [] [] [] () [] [] [] () | - iso_3166_2 | () | - iso_4217 | [] [] [] () [] [] | - iso_639 | [] [] [] [] () [] [] | - iso_639_3 | [] | - jwhois | [] | - kbd | [] [] [] [] [] | - keytouch | [] [] | - keytouch-editor | [] [] | - keytouch-keyboa... | [] | - klavaro | [] [] [] [] | - latrine | [] () | - ld | [] [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] () | - libextractor | | - libgnutls | [] | - libgpewidget | [] [] | - libgpg-error | [] [] | - libgphoto2 | [] () | - libgphoto2_port | [] () [] | - libgsasl | | - libiconv | [] [] [] [] [] | - libidn | [] [] [] | - lifelines | [] () | - liferea | [] [] [] [] [] | - lilypond | [] [] [] | - linkdr | [] [] [] | - lordsawar | [] | - lprng | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] | - make | [] [] [] | - man-db | | - man-db-manpages | | - minicom | [] [] [] [] | - mkisofs | | - myserver | | - nano | [] [] [] | - opcodes | [] [] | - parted | [] [] | - pies | | - popt | [] [] [] [] [] | - psmisc | [] [] [] | - pspp | [] | - pwdutils | [] | - radius | [] | - recode | [] [] [] [] [] [] | - rosegarden | () () () | - rpm | [] [] [] | - rush | | - sarg | | - screem | | - scrollkeeper | [] [] [] [] [] | - sed | [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | | - skencil | [] () [] | - solfege | [] [] [] | - solfege-manual | [] [] | - soundtracker | [] [] [] | - sp | [] | - sysstat | [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] | - tin | [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] [] [] [] | - vice | () () | - vmm | [] | - vorbis-tools | [] [] | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] [] | - wyslij-po | | - xchat | [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] [] [] | - +-------------------------------------------------+ - crh cs da de el en en_GB en_ZA eo es et eu fa - 5 64 105 117 18 1 8 0 28 89 18 19 0 - - fi fr ga gl gu he hi hr hu hy id is it ja ka kn - +----------------------------------------------------+ - a2ps | [] [] [] [] | - aegis | [] [] | - ant-phone | [] [] | - anubis | [] [] [] [] | - aspell | [] [] [] [] | - bash | [] [] [] [] | - bfd | [] [] [] | - bibshelf | [] [] [] [] [] | - binutils | [] [] [] | - bison | [] [] [] [] | - bison-runtime | [] [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] | - bombono-dvd | [] | - buzztard | [] | - cflow | [] [] [] | - clisp | [] | - coreutils | [] [] [] [] [] | - cpio | [] [] [] [] | - cppi | [] [] | - cpplib | [] [] [] | - cryptsetup | [] [] [] | - dfarc | [] [] [] | - dialog | [] [] [] [] [] [] [] | - dico | | - diffutils | [] [] [] [] [] [] [] [] [] | - dink | [] | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - exif | [] [] [] [] [] [] | - fetchmail | [] [] [] [] | - findutils | [] [] [] [] [] [] | - flex | [] [] [] | - freedink | [] [] [] | - gas | [] [] | - gawk | [] [] [] [] () [] | - gcal | [] | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] | - gettext-tools | [] [] [] [] | - gip | [] [] [] [] [] [] | - gjay | [] | - gliv | [] () | - glunarclock | [] [] [] [] | - gnubiff | () [] () | - gnucash | () () () () () [] | - gnuedu | [] [] | - gnulib | [] [] [] [] [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gold | [] [] | - gpe-aerial | [] [] [] | - gpe-beam | [] [] [] [] | - gpe-bluetooth | [] [] [] [] | - gpe-calendar | [] [] | - gpe-clock | [] [] [] [] [] | - gpe-conf | [] [] [] [] | - gpe-contacts | [] [] [] [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] [] [] | - gpe-go | [] [] [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] [] [] | - gpe-package | [] [] [] | - gpe-sketchbook | [] [] [] [] | - gpe-su | [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] [] [] [] [] [] | - gprof | [] [] [] [] | - gpsdrive | [] [] [] | - gramadoir | [] [] [] | - grep | [] [] | - grub | [] [] [] [] | - gsasl | [] [] [] [] [] | - gss | [] [] [] [] [] | - gst-plugins-bad | [] [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] [] [] [] [] | - gtkam | [] [] [] [] [] | - gtkorphan | [] [] [] | - gtkspell | [] [] [] [] [] [] [] [] [] | - gutenprint | [] [] [] [] | - hello | [] [] [] | - help2man | [] [] | - hylafax | [] | - idutils | [] [] [] [] [] [] | - indent | [] [] [] [] [] [] [] [] | - iso_15924 | [] () [] [] | - iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | () [] [] [] | - iso_4217 | [] () [] [] [] [] | - iso_639 | [] () [] [] [] [] [] [] [] | - iso_639_3 | () [] [] | - jwhois | [] [] [] [] [] | - kbd | [] [] | - keytouch | [] [] [] [] [] [] | - keytouch-editor | [] [] [] [] [] | - keytouch-keyboa... | [] [] [] [] [] | - klavaro | [] [] | - latrine | [] [] [] | - ld | [] [] [] [] | - leafpad | [] [] [] [] [] [] [] () | - libc | [] [] [] [] [] | - libexif | [] | - libextractor | | - libgnutls | [] [] | - libgpewidget | [] [] [] [] | - libgpg-error | [] [] | - libgphoto2 | [] [] [] | - libgphoto2_port | [] [] [] | - libgsasl | [] [] [] [] [] | - libiconv | [] [] [] [] [] [] | - libidn | [] [] [] [] | - lifelines | () | - liferea | [] [] [] [] | - lilypond | [] [] | - linkdr | [] [] [] [] [] | - lordsawar | | - lprng | [] | - lynx | [] [] [] [] [] | - m4 | [] [] [] [] [] [] | - mailfromd | | - mailutils | [] [] | - make | [] [] [] [] [] [] [] [] [] | - man-db | [] [] | - man-db-manpages | [] | - minicom | [] [] [] [] [] | - mkisofs | [] [] [] [] | - myserver | | - nano | [] [] [] [] [] [] | - opcodes | [] [] [] [] | - parted | [] [] [] [] | - pies | | - popt | [] [] [] [] [] [] [] [] [] | - psmisc | [] [] [] | - pspp | | - pwdutils | [] [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] [] | - rosegarden | () () () () () | - rpm | [] [] | - rush | | - sarg | [] | - screem | [] [] | - scrollkeeper | [] [] [] [] | - sed | [] [] [] [] [] [] [] [] | - sharutils | [] [] [] [] [] [] [] | - shishi | [] | - skencil | [] | - solfege | [] [] [] [] | - solfege-manual | [] [] | - soundtracker | [] [] | - sp | [] () | - sysstat | [] [] [] [] [] | - tar | [] [] [] [] [] [] [] | - texinfo | [] [] [] [] | - tin | [] | - unicode-han-tra... | | - unicode-transla... | [] [] | - util-linux-ng | [] [] [] [] [] [] | - vice | () () () | - vmm | [] | - vorbis-tools | [] | - wastesedge | () () | - wdiff | [] | - wget | [] [] [] [] [] [] [] [] | - wyslij-po | [] [] [] | - xchat | [] [] [] [] [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] [] | - +----------------------------------------------------+ - fi fr ga gl gu he hi hr hu hy id is it ja ka kn - 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 - - ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne - +-----------------------------------------------+ - a2ps | [] | - aegis | | - ant-phone | | - anubis | [] [] | - aspell | [] | - bash | | - bfd | | - bibshelf | [] [] | - binutils | | - bison | [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] | - bombono-dvd | | - buzztard | | - cflow | | - clisp | | - coreutils | [] | - cpio | | - cppi | | - cpplib | | - cryptsetup | | - dfarc | [] | - dialog | [] [] [] [] [] | - dico | | - diffutils | [] [] | - dink | | - doodle | | - e2fsprogs | | - enscript | | - exif | [] | - fetchmail | | - findutils | | - flex | | - freedink | [] | - gas | | - gawk | | - gcal | | - gcc | | - gettext-examples | [] [] [] [] | - gettext-runtime | [] | - gettext-tools | [] | - gip | [] [] | - gjay | | - gliv | | - glunarclock | [] | - gnubiff | | - gnucash | () () () () | - gnuedu | | - gnulib | | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gold | | - gpe-aerial | [] | - gpe-beam | [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] | - gpe-clock | [] [] [] [] [] | - gpe-conf | [] [] | - gpe-contacts | [] [] | - gpe-edit | [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] | - gpe-login | [] | - gpe-ownerinfo | [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] | - gpe-timesheet | [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] [] | - gphoto2 | | - gprof | [] | - gpsdrive | | - gramadoir | | - grep | | - grub | | - gsasl | | - gss | | - gst-plugins-bad | [] [] [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] | - gst-plugins-ugly | [] [] [] [] [] | - gstreamer | | - gtick | | - gtkam | [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | | - hello | [] [] [] | - help2man | | - hylafax | | - idutils | | - indent | | - iso_15924 | [] [] | - iso_3166 | [] [] () [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] | - iso_639 | [] [] | - iso_639_3 | [] | - jwhois | [] | - kbd | | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - klavaro | [] | - latrine | [] | - ld | | - leafpad | [] [] [] | - libc | [] | - libexif | | - libextractor | | - libgnutls | [] | - libgpewidget | [] [] | - libgpg-error | | - libgphoto2 | | - libgphoto2_port | | - libgsasl | | - libiconv | | - libidn | | - lifelines | | - liferea | | - lilypond | | - linkdr | | - lordsawar | | - lprng | | - lynx | | - m4 | | - mailfromd | | - mailutils | | - make | [] | - man-db | | - man-db-manpages | | - minicom | [] | - mkisofs | | - myserver | | - nano | [] [] | - opcodes | | - parted | | - pies | | - popt | [] [] [] | - psmisc | | - pspp | | - pwdutils | | - radius | | - recode | | - rosegarden | | - rpm | | - rush | | - sarg | | - screem | | - scrollkeeper | [] [] | - sed | | - sharutils | | - shishi | | - skencil | | - solfege | [] | - solfege-manual | | - soundtracker | | - sp | | - sysstat | [] | - tar | [] | - texinfo | [] | - tin | | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | | - vice | | - vmm | | - vorbis-tools | | - wastesedge | | - wdiff | | - wget | [] | - wyslij-po | | - xchat | [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - +-----------------------------------------------+ - ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne - 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 - - nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr - +---------------------------------------------------+ - a2ps | [] [] [] [] [] [] [] [] | - aegis | [] [] [] | - ant-phone | [] [] | - anubis | [] [] [] | - aspell | [] [] [] [] [] | - bash | [] [] | - bfd | [] | - bibshelf | [] [] | - binutils | [] [] | - bison | [] [] [] | - bison-runtime | [] [] [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] | - bombono-dvd | [] () | - buzztard | [] [] | - cflow | [] | - clisp | [] [] | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - cppi | [] | - cpplib | [] | - cryptsetup | [] | - dfarc | [] | - dialog | [] [] [] [] | - dico | [] | - diffutils | [] [] [] [] [] [] | - dink | () | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] [] | - exif | [] [] [] () [] | - fetchmail | [] [] [] [] | - findutils | [] [] [] [] [] | - flex | [] [] [] [] [] | - freedink | [] [] | - gas | | - gawk | [] [] [] [] | - gcal | | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] [] [] [] | - gettext-tools | [] [] [] [] [] [] | - gip | [] [] [] [] [] | - gjay | | - gliv | [] [] [] [] [] [] | - glunarclock | [] [] [] [] [] | - gnubiff | [] () | - gnucash | [] () () () | - gnuedu | [] | - gnulib | [] [] [] [] | - gnunet | | - gnunet-gtk | | - gnutls | [] [] | - gold | | - gpe-aerial | [] [] [] [] [] [] [] | - gpe-beam | [] [] [] [] [] [] [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] [] [] [] | - gpe-clock | [] [] [] [] [] [] [] [] | - gpe-conf | [] [] [] [] [] [] [] | - gpe-contacts | [] [] [] [] [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] [] | - gpe-go | [] [] [] [] [] [] [] [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] [] [] [] [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] [] [] [] [] [] | - gpe-su | [] [] [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] [] | - gpe-todo | [] [] [] [] [] | - gphoto2 | [] [] [] [] [] [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] | - gramadoir | [] [] | - grep | [] [] [] [] | - grub | [] [] [] | - gsasl | [] [] [] [] | - gss | [] [] [] | - gst-plugins-bad | [] [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] [] [] | - gtkam | [] [] [] [] [] [] | - gtkorphan | [] | - gtkspell | [] [] [] [] [] [] [] [] [] [] | - gutenprint | [] [] | - hello | [] [] [] [] | - help2man | [] [] | - hylafax | [] | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | [] [] [] [] | - iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | - iso_3166_2 | [] [] [] | - iso_4217 | [] [] [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] [] [] [] | - iso_639_3 | [] [] | - jwhois | [] [] [] [] | - kbd | [] [] [] | - keytouch | [] [] [] | - keytouch-editor | [] [] [] | - keytouch-keyboa... | [] [] [] | - klavaro | [] [] | - latrine | [] [] | - ld | | - leafpad | [] [] [] [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] () [] | - libextractor | | - libgnutls | [] [] | - libgpewidget | [] [] [] | - libgpg-error | [] [] | - libgphoto2 | [] [] | - libgphoto2_port | [] [] [] [] [] | - libgsasl | [] [] [] [] [] | - libiconv | [] [] [] [] [] | - libidn | [] [] | - lifelines | [] [] | - liferea | [] [] [] [] [] () () [] | - lilypond | [] | - linkdr | [] [] [] | - lordsawar | | - lprng | [] | - lynx | [] [] [] | - m4 | [] [] [] [] [] | - mailfromd | [] | - mailutils | [] | - make | [] [] [] [] | - man-db | [] [] [] | - man-db-manpages | [] [] [] | - minicom | [] [] [] [] | - mkisofs | [] [] [] | - myserver | | - nano | [] [] [] [] | - opcodes | [] [] | - parted | [] [] [] [] | - pies | [] | - popt | [] [] [] [] | - psmisc | [] [] [] | - pspp | [] [] | - pwdutils | [] | - radius | [] [] [] | - recode | [] [] [] [] [] [] [] [] | - rosegarden | () () | - rpm | [] [] [] | - rush | [] [] | - sarg | | - screem | | - scrollkeeper | [] [] [] [] [] [] [] [] | - sed | [] [] [] [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | [] | - skencil | [] [] | - solfege | [] [] [] [] | - solfege-manual | [] [] [] | - soundtracker | [] | - sp | | - sysstat | [] [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] [] | - tin | [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] [] [] [] [] | - vice | [] | - vmm | [] | - vorbis-tools | [] [] | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] [] [] [] [] [] | - wyslij-po | [] [] [] | - xchat | [] [] [] [] [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - +---------------------------------------------------+ - nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr - 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 - - sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW - +---------------------------------------------------+ - a2ps | [] [] [] [] [] | 27 - aegis | [] | 9 - ant-phone | [] [] [] [] | 9 - anubis | [] [] [] [] | 15 - aspell | [] [] [] | 20 - bash | [] [] [] | 12 - bfd | [] | 6 - bibshelf | [] [] [] | 16 - binutils | [] [] | 8 - bison | [] [] | 12 - bison-runtime | [] [] [] [] [] [] | 29 - bluez-pin | [] [] [] [] [] [] [] [] | 37 - bombono-dvd | [] | 4 - buzztard | [] | 7 - cflow | [] [] [] | 9 - clisp | | 10 - coreutils | [] [] [] [] | 22 - cpio | [] [] [] [] [] [] | 13 - cppi | [] [] | 5 - cpplib | [] [] [] [] [] [] | 14 - cryptsetup | [] [] | 7 - dfarc | [] | 9 - dialog | [] [] [] [] [] [] [] | 30 - dico | [] | 2 - diffutils | [] [] [] [] [] [] | 30 - dink | | 4 - doodle | [] [] | 7 - e2fsprogs | [] [] [] | 11 - enscript | [] [] [] [] | 17 - exif | [] [] [] | 16 - fetchmail | [] [] [] | 17 - findutils | [] [] [] [] [] | 20 - flex | [] [] [] [] | 15 - freedink | [] | 10 - gas | [] | 4 - gawk | [] [] [] [] | 18 - gcal | [] [] | 5 - gcc | [] [] [] | 7 - gettext-examples | [] [] [] [] [] [] [] | 34 - gettext-runtime | [] [] [] [] [] [] [] | 29 - gettext-tools | [] [] [] [] [] [] | 22 - gip | [] [] [] [] | 22 - gjay | [] | 3 - gliv | [] [] [] | 14 - glunarclock | [] [] [] [] [] | 19 - gnubiff | [] [] | 4 - gnucash | () [] () [] () | 10 - gnuedu | [] [] | 7 - gnulib | [] [] [] [] | 16 - gnunet | [] | 1 - gnunet-gtk | [] [] [] | 5 - gnutls | [] [] [] | 10 - gold | [] | 4 - gpe-aerial | [] [] [] | 18 - gpe-beam | [] [] [] | 19 - gpe-bluetooth | [] [] [] | 13 - gpe-calendar | [] [] [] [] | 12 - gpe-clock | [] [] [] [] [] | 28 - gpe-conf | [] [] [] [] | 20 - gpe-contacts | [] [] [] | 17 - gpe-edit | [] [] [] | 12 - gpe-filemanager | [] [] [] [] | 16 - gpe-go | [] [] [] [] [] | 25 - gpe-login | [] [] [] | 11 - gpe-ownerinfo | [] [] [] [] [] | 25 - gpe-package | [] [] [] | 13 - gpe-sketchbook | [] [] [] | 20 - gpe-su | [] [] [] [] [] | 30 - gpe-taskmanager | [] [] [] [] [] | 29 - gpe-timesheet | [] [] [] [] [] | 25 - gpe-today | [] [] [] [] [] [] | 30 - gpe-todo | [] [] [] [] | 17 - gphoto2 | [] [] [] [] [] | 24 - gprof | [] [] [] | 15 - gpsdrive | [] [] [] | 11 - gramadoir | [] [] [] | 11 - grep | [] [] [] | 10 - grub | [] [] [] | 14 - gsasl | [] [] [] [] | 14 - gss | [] [] [] | 11 - gst-plugins-bad | [] [] [] [] | 26 - gst-plugins-base | [] [] [] [] [] | 24 - gst-plugins-good | [] [] [] [] | 24 - gst-plugins-ugly | [] [] [] [] [] | 29 - gstreamer | [] [] [] [] | 22 - gtick | [] [] [] | 13 - gtkam | [] [] [] | 20 - gtkorphan | [] [] [] | 14 - gtkspell | [] [] [] [] [] [] [] [] [] | 45 - gutenprint | [] | 10 - hello | [] [] [] [] [] [] | 21 - help2man | [] [] | 7 - hylafax | [] | 5 - idutils | [] [] [] [] | 17 - indent | [] [] [] [] [] [] | 30 - iso_15924 | () [] () [] [] | 16 - iso_3166 | [] [] () [] [] () [] [] [] () | 53 - iso_3166_2 | () [] () [] | 9 - iso_4217 | [] () [] [] () [] [] | 26 - iso_639 | [] [] [] () [] () [] [] [] [] | 38 - iso_639_3 | [] () | 8 - jwhois | [] [] [] [] [] | 16 - kbd | [] [] [] [] [] | 15 - keytouch | [] [] [] | 16 - keytouch-editor | [] [] [] | 14 - keytouch-keyboa... | [] [] [] | 14 - klavaro | [] | 11 - latrine | [] [] [] | 10 - ld | [] [] [] [] | 11 - leafpad | [] [] [] [] [] [] | 33 - libc | [] [] [] [] [] | 21 - libexif | [] () | 7 - libextractor | [] | 1 - libgnutls | [] [] [] | 9 - libgpewidget | [] [] [] | 14 - libgpg-error | [] [] [] | 9 - libgphoto2 | [] [] | 8 - libgphoto2_port | [] [] [] [] | 14 - libgsasl | [] [] [] | 13 - libiconv | [] [] [] [] | 21 - libidn | () [] [] | 11 - lifelines | [] | 4 - liferea | [] [] [] | 21 - lilypond | [] | 7 - linkdr | [] [] [] [] [] | 17 - lordsawar | | 1 - lprng | [] | 3 - lynx | [] [] [] [] | 17 - m4 | [] [] [] [] | 19 - mailfromd | [] [] | 3 - mailutils | [] | 5 - make | [] [] [] [] | 21 - man-db | [] [] [] | 8 - man-db-manpages | | 4 - minicom | [] [] | 16 - mkisofs | [] [] | 9 - myserver | | 0 - nano | [] [] [] [] | 21 - opcodes | [] [] [] | 11 - parted | [] [] [] [] [] | 15 - pies | [] [] | 3 - popt | [] [] [] [] [] [] | 27 - psmisc | [] [] | 11 - pspp | | 4 - pwdutils | [] [] | 6 - radius | [] [] | 9 - recode | [] [] [] [] | 28 - rosegarden | () | 0 - rpm | [] [] [] | 11 - rush | [] [] | 4 - sarg | | 1 - screem | [] | 3 - scrollkeeper | [] [] [] [] [] | 27 - sed | [] [] [] [] [] | 30 - sharutils | [] [] [] [] [] | 22 - shishi | [] | 3 - skencil | [] [] | 7 - solfege | [] [] [] [] | 16 - solfege-manual | [] | 8 - soundtracker | [] [] [] | 9 - sp | [] | 3 - sysstat | [] [] | 15 - tar | [] [] [] [] [] [] | 23 - texinfo | [] [] [] [] [] | 17 - tin | | 4 - unicode-han-tra... | | 0 - unicode-transla... | | 2 - util-linux-ng | [] [] [] [] | 20 - vice | () () | 1 - vmm | [] | 4 - vorbis-tools | [] | 6 - wastesedge | | 2 - wdiff | [] [] | 7 - wget | [] [] [] [] [] | 26 - wyslij-po | [] [] | 8 - xchat | [] [] [] [] [] [] | 36 - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 - xkeyboard-config | [] [] [] | 22 - +---------------------------------------------------+ - 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW - 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 + nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + +------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] | + aegis | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] [] [] | + bash | [] [] [] [] [] [] | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] [] | + buzztrax | [] | + ccd2cue | [] [] | + ccide | [] [] [] | + cflow | [] [] [] | + clisp | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + cppi | [] [] [] | + cpplib | [] [] [] | + cryptsetup | [] [] [] | + datamash | [] [] | + denemo | | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] | + dico | [] | + diffutils | [] [] [] | + dink | | + direvent | [] [] [] | + doodle | [] [] | + dos2unix | [] [] [] [] | + dos2unix-man | [] [] | + e2fsprogs | [] | + enscript | [] [] [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] [] [] [] | + fusionforge | | + gas | | + gawk | [] | + gcal | | + gcc | | + gdbm | [] [] [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] | + gjay | [] | + glunarclock | [] [] [] [] [] [] | + gnubiff | [] | + gnubik | [] [] [] [] | + gnucash | () () () () () [] | + gnuchess | [] [] | + gnulib | [] [] [] [] [] | + gnunet | | + gnunet-gtk | | + gold | | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + grub | [] [] [] [] [] | + gsasl | [] [] [] | + gss | [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + guix | | + guix-packages | | + gutenprint | [] [] | + hello | [] [] [] [] [] [] | + help2man | [] [] [] [] | + help2man-texi | [] | + hylafax | | + idutils | [] [] [] | + iso_15924 | [] () [] [] [] [] | + iso_3166 | [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] () [] | + iso_4217 | [] [] () [] [] [] [] [] | + iso_639 | [] [] [] () [] [] [] [] [] [] | + iso_639_3 | [] () | + iso_639_5 | () [] | + jwhois | [] [] [] [] | + kbd | [] [] | + klavaro | [] [] [] [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] | + libc | [] [] [] | + libexif | [] () [] | + libextractor | [] | + libgnutls | [] | + libgphoto2 | [] | + libgphoto2_port | [] [] [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + liferea | [] [] [] [] () [] [] | + lilypond | | + lordsawar | | + lprng | [] | + lynx | [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + midi-instruments | [] [] [] [] [] [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | [] [] | + nano | [] [] [] [] [] [] | + opcodes | | + parted | [] [] [] [] [] [] | + pies | [] | + pnmixer | [] | + popt | [] [] [] [] [] [] | + procps-ng | [] | + procps-ng-man | [] | + psmisc | [] [] [] [] | + pspp | [] [] | + pushover | | + pwdutils | [] | + pyspread | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + recutils | [] [] | + rpm | [] | + rush | [] [] [] | + sarg | [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] | + shishi | [] [] | + skribilo | [] | + solfege | [] [] [] | + solfege-manual | [] [] | + spotmachine | [] [] | + sudo | [] [] [] [] [] [] | + sudoers | [] [] [] [] | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] | + texinfo_document | [] [] | + tigervnc | [] [] [] | + tin | [] | + tin-man | | + tracgoogleappsa... | [] [] [] [] | + trader | [] [] | + util-linux | [] [] | + ve | [] [] [] | + vice | | + vmm | | + vorbis-tools | [] [] [] | + wastesedge | | + wcd | | + wcd-man | | + wdiff | [] [] [] [] [] | + wget | [] [] [] [] [] | + wyslij-po | [] [] [] [] | + xboard | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + +------------------------------------------------+ + nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 7 3 6 114 1 12 88 32 82 3 40 45 7 101 + + sv sw ta te tg th tr uk ur vi wa wo zh_CN + +----------------------------------------------+ + a2ps | [] [] [] [] [] | + aegis | [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] | + bison-runtime | [] [] [] [] [] [] | + buzztrax | [] [] [] | + ccd2cue | [] [] [] | + ccide | [] [] [] [] | + cflow | [] [] [] [] | + clisp | | + coreutils | [] [] [] | + cpio | [] [] [] [] [] | + cppi | [] [] [] [] | + cpplib | [] [] [] [] [] | + cryptsetup | [] [] [] | + datamash | [] [] [] | + denemo | [] | + dfarc | [] [] | + dialog | [] [] [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] | + dink | [] | + direvent | [] [] | + doodle | [] [] | + dos2unix | [] [] [] [] | + dos2unix-man | [] [] [] | + e2fsprogs | [] [] [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] | + freedink | [] [] [] | + fusionforge | | + gas | [] | + gawk | [] [] [] | + gcal | [] [] [] | + gcc | [] | + gdbm | [] [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] [] [] | + gjay | [] [] [] | + glunarclock | [] [] [] [] | + gnubiff | [] [] | + gnubik | [] [] [] [] | + gnucash | () () () () [] | + gnuchess | [] [] [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gold | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] [] | + gramadoir | [] [] [] | + grep | [] [] [] [] [] | + grub | [] [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + guix | | + guix-packages | | + gutenprint | [] [] [] [] | + hello | [] [] [] [] [] [] | + help2man | [] [] [] | + help2man-texi | [] | + hylafax | [] | + idutils | [] [] [] | + iso_15924 | [] () [] [] () [] | + iso_3166 | [] [] () [] [] () [] [] | + iso_3166_2 | () [] [] () [] | + iso_4217 | [] () [] [] () [] | + iso_639 | [] [] [] () [] [] () [] [] | + iso_639_3 | [] () [] [] () | + iso_639_5 | () [] () | + jwhois | [] [] [] [] | + kbd | [] [] [] [] | + klavaro | [] [] [] [] [] [] | + ld | [] [] [] [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] [] () | + libextractor | [] [] | + libgnutls | [] [] [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | () [] [] [] | + liferea | [] [] [] [] [] | + lilypond | [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] | + m4 | [] [] [] | + mailfromd | [] [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] | + midi-instruments | [] [] [] [] [] [] | + minicom | [] [] | + mkisofs | [] [] [] | + myserver | [] | + nano | [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] [] [] | + pies | [] [] | + pnmixer | [] [] [] | + popt | [] [] [] [] [] [] [] | + procps-ng | [] [] | + procps-ng-man | [] | + psmisc | [] [] [] [] | + pspp | [] [] [] | + pushover | [] | + pwdutils | [] [] | + pyspread | [] | + radius | [] [] | + recode | [] [] [] [] | + recutils | [] [] [] | + rpm | [] [] [] [] | + rush | [] [] | + sarg | | + sed | [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] [] | + skribilo | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] | + spotmachine | [] [] [] | + sudo | [] [] [] [] [] | + sudoers | [] [] [] [] | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] | + texinfo_document | [] | + tigervnc | [] [] [] | + tin | [] | + tin-man | | + tracgoogleappsa... | [] [] [] [] [] | + trader | [] | + util-linux | [] [] [] [] | + ve | [] [] [] [] | + vice | () () | + vmm | | + vorbis-tools | [] [] | + wastesedge | | + wcd | [] [] [] | + wcd-man | [] | + wdiff | [] [] [] [] | + wget | [] [] [] | + wyslij-po | [] [] | + xboard | [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + +----------------------------------------------+ + sv sw ta te tg th tr uk ur vi wa wo zh_CN + 106 1 4 3 0 13 51 115 1 125 7 1 100 + + zh_HK zh_TW + +-------------+ + a2ps | | 30 + aegis | | 9 + anubis | | 19 + aspell | | 29 + bash | [] | 23 + bfd | | 11 + binutils | | 12 + bison | [] | 18 + bison-runtime | [] | 38 + buzztrax | | 9 + ccd2cue | | 10 + ccide | | 17 + cflow | | 16 + clisp | | 10 + coreutils | | 18 + cpio | | 20 + cppi | | 17 + cpplib | [] | 19 + cryptsetup | | 14 + datamash | | 11 + denemo | | 5 + dfarc | | 17 + dialog | [] | 42 + dico | | 6 + diffutils | | 22 + dink | | 10 + direvent | | 11 + doodle | | 12 + dos2unix | [] | 18 + dos2unix-man | | 9 + e2fsprogs | | 15 + enscript | | 21 + exif | | 27 + fetchmail | | 19 + findutils | | 29 + flex | [] | 19 + freedink | | 24 + fusionforge | | 3 + gas | | 5 + gawk | | 13 + gcal | | 8 + gcc | | 2 + gdbm | | 10 + gettext-examples | [] [] | 40 + gettext-runtime | [] [] | 35 + gettext-tools | [] | 24 + gjay | | 9 + glunarclock | [] | 27 + gnubiff | | 9 + gnubik | | 19 + gnucash | () | 6 + gnuchess | | 11 + gnulib | | 23 + gnunet | | 1 + gnunet-gtk | | 1 + gold | | 7 + gphoto2 | [] | 19 + gprof | | 21 + gramadoir | | 14 + grep | [] | 31 + grub | | 21 + gsasl | [] | 19 + gss | | 17 + gst-plugins-bad | | 21 + gst-plugins-base | | 27 + gst-plugins-good | | 32 + gst-plugins-ugly | | 34 + gstreamer | [] | 32 + gtick | | 19 + gtkam | | 24 + gtkspell | [] [] | 48 + guix | | 2 + guix-packages | | 0 + gutenprint | | 15 + hello | [] | 30 + help2man | | 18 + help2man-texi | | 5 + hylafax | | 5 + idutils | | 14 + iso_15924 | [] | 23 + iso_3166 | [] [] | 58 + iso_3166_2 | | 9 + iso_4217 | [] [] | 28 + iso_639 | [] [] | 46 + iso_639_3 | | 10 + iso_639_5 | | 2 + jwhois | [] | 20 + kbd | | 17 + klavaro | | 30 + ld | [] | 15 + leafpad | [] | 39 + libc | [] | 24 + libexif | | 10 + libextractor | | 5 + libgnutls | | 13 + libgphoto2 | | 10 + libgphoto2_port | [] | 19 + libgsasl | | 18 + libiconv | [] | 29 + libidn | | 17 + liferea | | 29 + lilypond | | 11 + lordsawar | | 3 + lprng | | 3 + lynx | | 19 + m4 | [] | 22 + mailfromd | | 4 + mailutils | | 6 + make | | 19 + man-db | | 15 + man-db-manpages | | 10 + midi-instruments | [] | 43 + minicom | [] | 17 + mkisofs | | 13 + myserver | | 9 + nano | [] | 30 + opcodes | | 12 + parted | [] | 23 + pies | | 4 + pnmixer | | 9 + popt | [] | 36 + procps-ng | | 5 + procps-ng-man | | 4 + psmisc | [] | 22 + pspp | | 13 + pushover | | 6 + pwdutils | | 8 + pyspread | | 6 + radius | | 9 + recode | | 31 + recutils | | 10 + rpm | [] | 13 + rush | | 10 + sarg | | 4 + sed | [] | 35 + sharutils | | 13 + shishi | | 7 + skribilo | | 7 + solfege | | 21 + solfege-manual | | 9 + spotmachine | | 11 + sudo | | 26 + sudoers | | 22 + sysstat | | 23 + tar | [] | 30 + texinfo | | 17 + texinfo_document | | 13 + tigervnc | | 14 + tin | [] | 7 + tin-man | | 1 + tracgoogleappsa... | [] | 22 + trader | | 12 + util-linux | | 13 + ve | | 14 + vice | | 1 + vmm | | 3 + vorbis-tools | | 13 + wastesedge | | 3 + wcd | | 8 + wcd-man | | 3 + wdiff | [] | 23 + wget | | 21 + wyslij-po | | 14 + xboard | | 10 + xdg-user-dirs | [] [] | 68 + xkeyboard-config | [] | 28 + +-------------+ + 89 teams zh_HK zh_TW + 166 domains 7 42 2809 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are @@ -1251,32 +1350,30 @@ dialects. For a PO file in the matrix above to be effective, the package to -which it applies should also have been internationalized and -distributed as such by its maintainer. There might be an observable -lag between the mere existence a PO file and its wide availability in a -distribution. - - If June 2010 seems to be old, you may fetch a more recent copy of -this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date -matrix with full percentage details can be found at -`http://translationproject.org/extra/matrix.html'. +which it applies should also have been internationalized and distributed +as such by its maintainer. There might be an observable lag between the +mere existence a PO file and its wide availability in a distribution. + + If Jun 2014 seems to be old, you may fetch a more recent copy of this +'ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix +with full percentage details can be found at +'http://translationproject.org/extra/matrix.html'. -1.5 Using `gettext' in new packages +1.5 Using 'gettext' in new packages =================================== If you are writing a freely available program and want to -internationalize it you are welcome to use GNU `gettext' in your -package. Of course you have to respect the GNU Library General Public -License which covers the use of the GNU `gettext' library. This means -in particular that even non-free programs can use `libintl' as a shared -library, whereas only free software can use `libintl' as a static -library or use modified versions of `libintl'. +internationalize it you are welcome to use GNU 'gettext' in your +package. Of course you have to respect the GNU Lesser General Public +License which covers the use of the GNU 'gettext' library. This means +in particular that even non-free programs can use 'libintl' as a shared +library, whereas only free software can use 'libintl' as a static +library or use modified versions of 'libintl'. Once the sources are changed appropriately and the setup can handle -the use of `gettext' the only thing missing are the translations. The +the use of 'gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact -`coordinator@translationproject.org' to make the `.pot' files available +'coordinator@translationproject.org' to make the '.pot' files available to the translation teams. - diff -Nru modemmanager-1.6.8/aclocal.m4 modemmanager-1.10.0/aclocal.m4 --- modemmanager-1.6.8/aclocal.m4 2017-06-17 10:24:53.000000000 +0200 +++ modemmanager-1.10.0/aclocal.m4 2019-01-17 16:15:46.000000000 +0100 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,7 +21,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 12 (pkg-config-0.29.2) +# serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -63,7 +63,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.2]) +[m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -164,7 +164,7 @@ AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $2]) +AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -174,11 +174,11 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -195,7 +195,7 @@ _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -296,7 +296,75 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -308,10 +376,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -327,14 +395,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -386,7 +454,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -417,7 +485,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -608,13 +676,12 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -622,49 +689,41 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -673,18 +732,17 @@ # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -771,8 +829,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -839,7 +897,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -881,7 +939,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -902,7 +960,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -924,7 +982,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -959,7 +1017,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -967,49 +1025,42 @@ # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1048,7 +1099,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1077,7 +1128,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1124,7 +1175,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1143,7 +1194,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1224,7 +1275,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1284,7 +1335,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1312,7 +1363,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1331,7 +1382,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1468,7 +1519,6 @@ m4_include([m4/gtk-doc.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) -m4_include([m4/intltool.m4]) m4_include([m4/introspection.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) diff -Nru modemmanager-1.6.8/AUTHORS modemmanager-1.10.0/AUTHORS --- modemmanager-1.6.8/AUTHORS 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/AUTHORS 2018-11-15 09:55:53.000000000 +0100 @@ -69,3 +69,4 @@ Vitaly Gimly Yuri Chornoivan kuonirat + Matthew Stanger diff -Nru modemmanager-1.6.8/autogen.sh modemmanager-1.10.0/autogen.sh --- modemmanager-1.6.8/autogen.sh 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/autogen.sh 2018-11-15 09:55:53.000000000 +0100 @@ -14,9 +14,7 @@ } (cd $srcdir; - gtkdocize || exit 1 - autopoint --force - AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose + autoreconf --force --install --verbose ) if test -z "$NOCONFIGURE"; then diff -Nru modemmanager-1.6.8/build-aux/Makefile.in modemmanager-1.10.0/build-aux/Makefile.in --- modemmanager-1.6.8/build-aux/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/build-aux/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -131,7 +130,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -184,14 +182,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -312,8 +302,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -361,8 +349,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -386,7 +374,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/ChangeLog modemmanager-1.10.0/ChangeLog --- modemmanager-1.6.8/ChangeLog 2015-01-20 22:54:08.000000000 +0100 +++ modemmanager-1.10.0/ChangeLog 2019-01-17 16:22:29.000000000 +0100 @@ -0,0 +1,83381 @@ +commit 9268d4f9ef445ca7c9bf731fe125f432cf6385ac +Author: Aleksander Morgado +Date: Thu Jan 17 16:14:25 2019 +0100 + + release: bump version to 1.10.0 + + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit f49f325715b8bc8078bafa3339f1d77dbe35392e +Author: Aleksander Morgado +Date: Wed Jan 16 15:56:59 2019 +0100 + + libmm-glib,firmware-update-settings: skip dictionary if method is NONE + + No need to process the detailed dictionary if no explicit method is + reported as supported. Avoids unnecessary warnings: + + $ mmcli -m 1 --firmware-status + ** (mmcli:6887): WARNING **: 15:52:54.664: Invalid initial update + settings: Missing required 'device-ids' setting + error: firmware status unsupported + + libmm-glib/mm-firmware-update-settings.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6dd8876124aab1873a40abadcf40e8271dfc9f6b +Author: Aleksander Morgado +Date: Tue Jan 15 17:42:50 2019 +0100 + + NEWS: update for MM 1.10 + + NEWS | 119 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 119 insertions(+) + +commit 5123add8601e012944e7ea9e1cf28ce17b2f03bd +Author: Aleksander Morgado +Date: Tue Jan 15 15:40:10 2019 +0100 + + api,doc: add note about when each modem interface is available + + introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml | + 5 ++++- + introspection/org.freedesktop.ModemManager1.Modem.Location.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Messaging.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Oma.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Signal.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Simple.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Time.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.Voice.xml | + 5 +++++ + introspection/org.freedesktop.ModemManager1.Modem.xml | + 3 +++ + 12 files changed, 57 insertions(+), 1 deletion(-) + +commit 478a076d30b8ad44821e24652a4ebad5a8b3a6bb +Author: Aleksander Morgado +Date: Sun Jan 13 18:11:41 2019 +0100 + + libmm-glib,manager: use g_async_initable_new_finish() explicitly + + We're running g_async_initable_new_async() ourselves in + mm_manager_new(), so our finish() method should call + g_async_initable_new_finish() explicitly. + + There's no change in the logic here, as the generated + mm_gdbus_object_manager_client_new_finish() was already doing this + implicitly. + + libmm-glib/mm-manager.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 495a466aaaa3b5c42d1b22f3447cb36eb89fa7a6 +Author: Aleksander Morgado +Date: Sun Jan 13 18:02:22 2019 +0100 + + libmm-glib,manager: simplify object creation + + The G_OBJECT() casts accept NULL safely. + + libmm-glib/mm-manager.c | 27 ++++++++++----------------- + 1 file changed, 10 insertions(+), 17 deletions(-) + +commit 3eb3854fcb19529b7e82f224419d177fa56c569c +Author: Aleksander Morgado +Date: Sun Jan 13 18:01:54 2019 +0100 + + libmm-glib,manager: cleanup internal proxy on name owner updates + + The MMManager object keeps an internal proxy object for the Manager + interface, and we must make sure we cleanup this object any time + the MM + daemon is restarted. Otherwise, the MMManager may end up trying to use + a stale proxy associated to a previous run of the daemon, and e.g. not + showing properly the runtime version info. + + E.g., in this sequence with the example python tester, the runtime + version of the daemon was valid only for the first time the daemon + runs, and if the daemon is restarted, mm_manager_get_version() + would keep returning NULL. + + $ ./modem-watcher-python + [ModemWatcher] ModemManager service not available in bus + [ModemWatcher] ModemManager 1.9.990 service is available in bus + [ModemWatcher] Dell Inc. (DW5821e Snapdragon + X20 LTE) modem managed by ModemManager [None]: + /org/freedesktop/ModemManager1/Modem/0 + [ModemWatcher] ModemManager service not available in bus + [ModemWatcher] ModemManager None service is available in bus + [ModemWatcher] Dell Inc. (DW5821e Snapdragon + X20 LTE) modem managed by ModemManager [None]: + /org/freedesktop/ModemManager1/Modem/0 + [ModemWatcher] ModemManager service not available in bus + [ModemWatcher] ModemManager None service is available in bus + [ModemWatcher] Dell Inc. (DW5821e Snapdragon + X20 LTE) modem managed by ModemManager [None]: + /org/freedesktop/ModemManager1/Modem/0 + + libmm-glib/mm-manager.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit 479590412e6b746365645eb9bbc9c605c20ab8bc +Author: Aleksander Morgado +Date: Sun Jan 13 17:33:05 2019 +0100 + + examples,watcher: print runtime MM version + + examples/modem-watcher-javascript/modemWatcher.js | 2 +- + examples/modem-watcher-python/ModemWatcher.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit bb0820d012112bbf609fe56c55a74a4791687766 +Author: Aleksander Morgado +Date: Sun Jan 13 14:37:45 2019 +0100 + + port-mbim: do not clear the progress flag until really finished + opening + + When the MBIM port open involved transparently trying to open a QMI + device as well, we were clearing the progress flag before the full + operation had finished, and so the port could have been closed by + the time we really finish the open operation, leading to a crash: + + ModemManager[28824]: [1547386038.726136] + (usbmisc/cdc-wdm3): released by device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: [1547386038.728084] + (tty/ttyUSB0): released by device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: [1547386038.728738] + (tty/ttyUSB1): released by device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: [1547386038.730769] + (tty/ttyUSB2): released by device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: [1547386038.731256] + (tty/ttyUSB3): released by device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: + [1547386038.731301] Removing empty device + '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' + ModemManager[28824]: [1547386038.731445] (ttyUSB0) + forced to close port + ModemManager[28824]: [1547386038.731547] (ttyUSB1) + forced to close port + ModemManager[28824]: [1547386038.731638] (ttyUSB2) + forced to close port + ModemManager[28824]: [1547386038.731715] (ttyUSB3) + forced to close port + ModemManager[28824]: [1547386039.580136] [cdc-wdm3] + error: couldn't open QmiDevice: MBIM error: Transaction timed out + ModemManager[28824]: [1547386039.580190] [cdc-wdm3] + MBIM device is not QMI capable + ** + ERROR:mm-broadband-modem-mbim.c:2119:track_mbim_device_removed: + assertion failed: (device) + + Thread 1 "ModemManager" received signal SIGABRT, Aborted. + 0x00007ffff7390d7f in raise () from /usr/lib/libc.so.6 + + (gdb) bt + #0 0x00007ffff7390d7f in raise () at /usr/lib/libc.so.6 + #1 0x00007ffff737b672 in abort () at /usr/lib/libc.so.6 + #2 0x00007ffff7559042 in () at /usr/lib/libglib-2.0.so.0 + #3 0x00007ffff75865dc in g_assertion_message_expr () at + /usr/lib/libglib-2.0.so.0 + #4 0x00005555556407f9 in track_mbim_device_removed + (self=0x5555557a2830, mbim=0x5555557ea190) at + mm-broadband-modem-mbim.c:2119 + #5 0x000055555564093e in mbim_port_open_ready + (mbim=0x5555557ea190, res=0x55555573fcf0, task=0x5555557d29d0) + at mm-broadband-modem-mbim.c:2161 + #6 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 + #7 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 + #8 0x000055555565fcd5 in qmi_device_open_ready + (dev=0x55555578f250, res=0x55555573fb50, task=0x55555573fcf0) + at mm-port-mbim.c:191 + #9 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 + #10 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 + #11 0x00007ffff7c03fe6 in open_version_info_ready + (client_ctl=0x7fffe8010c20, res=0x555555739e80, + task=0x55555573fb50) at qmi-device.c:2050 + #12 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 + #13 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 + #14 0x00007ffff7c2034f in get_version_info_ready + (device=0x55555578f250, res=0x5555557ea2a0, task=0x555555739e80) + at qmi-ctl.c:3746 + #15 0x00007ffff778ebcf in g_simple_async_result_complete () + at /usr/lib/libgio-2.0.so.0 + #16 0x00007ffff778ec5a in () at /usr/lib/libgio-2.0.so.0 + #17 0x00007ffff75a98d1 in g_main_context_dispatch () at + /usr/lib/libglib-2.0.so.0 + #18 0x00007ffff75ab5e9 in () at /usr/lib/libglib-2.0.so.0 + #19 0x00007ffff75ac5c2 in g_main_loop_run () at + /usr/lib/libglib-2.0.so.0 + #20 0x0000555555599eb0 in main (argc=2, argv=0x7fffffffe4c8) + at main.c:181 + + src/mm-port-mbim.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0f588888080140f35bf67991af2dc20ac612d1a0 +Author: Aleksander Morgado +Date: Sat Jan 12 16:07:18 2019 +0100 + + cli,firmware: fix reporting fastboot AT command + + The update method is a bitmask, so check for the flag. + + cli/mmcli-modem-firmware.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 3ba89881cc19ff94860c12909acd3cdc01ece7fc +Author: Aleksander Morgado +Date: Sat Jan 12 16:06:23 2019 +0100 + + cli,firmware: fix reporting firmware update methods in key-value + output + + It's a bitmask, so we report a list of strings. + + cli/mmcli-modem-firmware.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 251ca4a847792262e28a3476f9a4ca99d5d5a883 +Author: Aleksander Morgado +Date: Fri Jan 11 15:57:36 2019 +0100 + + build: update copyright years to 2019 + + cli/mmcli.c | 2 +- + docs/reference/api/ModemManager-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + src/mm-context.c | 2 +- + 4 files changed, 4 insertions(+), 2 deletions(-) + +commit 5869efff7277e3154e01fec64ae4183020590033 +Author: Aleksander Morgado +Date: Fri Jan 11 15:54:14 2019 +0100 + + man,mmcli: update for MM 1.10 + + docs/man/mmcli.1 | 395 + +++++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 299 insertions(+), 96 deletions(-) + +commit 4ae62ace7f62be94b3ae2d114be33916bd11cc48 +Author: Aleksander Morgado +Date: Tue Jan 8 15:42:14 2019 +0100 + + build: bump version to 1.9.990 (1.10-rc1) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 86c0ed814aa0f1f45ee3e9f9fd03b161551acb34 +Author: Aleksander Morgado +Date: Tue Jan 8 15:48:40 2019 +0100 + + api,firmware: fix html generation + + introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml | 1 + + 1 file changed, 1 insertion(+) + +commit e826a24e440e90696e4db6dddf576f2c4c70f737 +Author: Aleksander Morgado +Date: Tue Jan 8 15:35:16 2019 +0100 + + build: require libmbim 1.18.0 and libqmi 1.22.0 + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 09c5ac061b35ed26f0cf14488c20d8bffddff8ed +Author: Aleksander Morgado +Date: Mon Dec 17 14:10:26 2018 +0100 + + mmcli,modem: new `--inhibit` action on the modem object + + Modem device inhibition is really a manager action for which we + provide the full modem device 'uid'. + + This new operation allows to perform device inhibition using the modem + object as reference, which is more handy than first looking at the + device 'uid' and then running the manager action. + + $ sudo mmcli -m 0 --inhibit + successfully inhibited device with uid + '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2' + type Ctrl+C to abort this program and remove the inhibition + ^C cancelling the operation... + successfully uninhibited device with uid + '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2' + + cli/mmcli-modem.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 60 insertions(+), 3 deletions(-) + +commit 2212d3e054fbe218c64fa76eeac8480f82d9f623 +Author: Aleksander Morgado +Date: Fri Dec 7 16:12:35 2018 +0100 + + api,manager: new InhibitDevice() method + + This new method allows users of the ModemManager API to take full + control of a given device. + + Unlike other operations in the API, the inhibition is maintained as + long as the caller exists in the bus, or until the same caller + uninhibits the device. + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/98 + + cli/mmcli-manager.c | 54 ++- + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 + + introspection/org.freedesktop.ModemManager1.xml | 21 ++ + libmm-glib/mm-manager.c | 236 +++++++++++++ + libmm-glib/mm-manager.h | 26 ++ + src/mm-base-manager.c | 383 + +++++++++++++++++++++- + src/mm-device.c | 103 ++++++ + src/mm-device.h | 13 + + 8 files changed, 829 insertions(+), 17 deletions(-) + +commit e3766aef5d93d6cfec27432c81da3548bdd18ea6 +Author: Aleksander Morgado +Date: Fri Dec 28 13:03:52 2018 +0100 + + dell,dw5821e: also report QMI PDC based update available + + include/ModemManager-enums.h | 2 ++ + plugins/dell/mm-broadband-modem-dell-dw5821e.c | 3 ++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +commit 87712c27f5868e2f05c03d4fdc2ee79f0ac1c243 +Author: Aleksander Morgado +Date: Fri Dec 28 12:59:55 2018 +0100 + + api,firmware: MMModemFirmwareUpdateMethod as flags, not enum + + Devices may require/support more than one update method, so instead of + reporting the method as a single enum value, use a set of flags + instead. + + cli/mmcli-modem-firmware.c | 8 ++--- + docs/reference/libmm-glib/libmm-glib-sections.txt | 4 +-- + include/ModemManager-enums.h | 6 ++-- + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 25 +++++++++++----- + libmm-glib/mm-firmware-update-settings.c | 34 + +++++++++------------- + plugins/quectel/mm-shared-quectel.c | 2 +- + 6 files changed, 41 insertions(+), 38 deletions(-) + +commit f35d64a8992a06e75585c774090e407ae21f24fe +Author: Aleksander Morgado +Date: Tue Dec 18 15:50:53 2018 +0100 + + api,firmware: expose firmware version + + cli/mmcli-modem-firmware.c | 5 +- + cli/mmcli-output.c | 1 + + cli/mmcli-output.h | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 + + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 10 ++++ + libmm-glib/mm-firmware-update-settings.c | 52 + +++++++++++++++++++-- + libmm-glib/mm-firmware-update-settings.h | 3 ++ + src/mm-iface-modem-firmware.c | 53 + +++++++++++++++++----- + src/mm-iface-modem.c | 18 ++++++++ + src/mm-iface-modem.h | 5 +- + 10 files changed, 133 insertions(+), 17 deletions(-) + +commit 67b3b830c87e79827a9934362e673e1a23116026 +Author: Aleksander Morgado +Date: Mon Dec 17 17:37:36 2018 +0100 + + api,firmware: expose device ids + + cli/mmcli-modem-firmware.c | 16 +++-- + cli/mmcli-output.c | 1 + + cli/mmcli-output.h | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 + + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 8 +++ + libmm-glib/mm-firmware-update-settings.c | 74 + ++++++++++++++++------ + libmm-glib/mm-firmware-update-settings.h | 7 ++ + src/mm-iface-modem-firmware.c | 56 +++++++++++++++- + 8 files changed, 139 insertions(+), 26 deletions(-) + +commit bc39201f761bd667bcd0c5eb53643a180ce53327 +Author: Aleksander Morgado +Date: Mon Dec 17 16:32:57 2018 +0100 + + kerneldevice: allow loading device revision + + src/kerneldevice/mm-kernel-device-generic.c | 34 + ++++++++++++++++++++++++++ + src/kerneldevice/mm-kernel-device-udev.c | 37 + ++++++++++++++++++++++++++--- + src/kerneldevice/mm-kernel-device.c | 10 ++++++++ + src/kerneldevice/mm-kernel-device.h | 2 ++ + 4 files changed, 80 insertions(+), 3 deletions(-) + +commit dcd49dee8899bfb4ccae7a0bbc200a0a62aeeb04 +Author: Aleksander Morgado +Date: Mon Dec 17 14:58:09 2018 +0100 + + mmcli,firmware: avoid empty output if firmware status unsupported + + cli/mmcli-modem-firmware.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit f69098819b58a6f2f7012376e34035503daa876c +Author: Aleksander Morgado +Date: Mon Dec 17 13:53:55 2018 +0100 + + iface-modem-firmware: List() and Select() are now optional + + Since the Firmware interface now contains more actions and properties + apart from List() and Select(), these two actions are now optional. + + Not all modems implementing the Firmware interface must implement + these two methods. + + src/mm-iface-modem-firmware.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +commit fc02b1320c91367be8f1b9d073fc0da473538647 +Author: Aleksander Morgado +Date: Sun Dec 9 15:54:38 2018 +0100 + + quectel: report fastboot-based firmware update method and settings + + We'll check for AT+QFASTBOOT support during runtime. + + plugins/Makefile.am | 10 +++ + plugins/quectel/mm-broadband-modem-qmi-quectel.c | 67 ++++++++++++++++ + plugins/quectel/mm-broadband-modem-qmi-quectel.h | 47 ++++++++++++ + plugins/quectel/mm-broadband-modem-quectel.c | 67 ++++++++++++++++ + plugins/quectel/mm-broadband-modem-quectel.h | 47 ++++++++++++ + plugins/quectel/mm-plugin-quectel.c | 24 +++--- + plugins/quectel/mm-shared-quectel.c | 98 + ++++++++++++++++++++++++ + plugins/quectel/mm-shared-quectel.h | 49 ++++++++++++ + 8 files changed, 397 insertions(+), 12 deletions(-) + +commit 4b21546f532991dceddab8e573ae6fbb87b28576 +Author: Aleksander Morgado +Date: Sun Dec 9 15:31:21 2018 +0100 + + dell,dw5821e: report fastboot-based firmware update method and + settings + + The DW5821e uses the AT^FASTBOOT command to reset the module in + fastboot mode, ready to download new firmware. + + Note: we cannot use AT^FASTBOOT=? to query for support, as that + command also triggers the reset :/ + + plugins/dell/mm-broadband-modem-dell-dw5821e.c | 40 + +++++++++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +commit 3c7437d791cf4e805d989ef940aa805f9ecc3848 +Author: Aleksander Morgado +Date: Sun Dec 9 15:20:12 2018 +0100 + + iface-modem-firmware: make the interface always available + + We no longer "check for support" of this interface, it will always be + available for all modem objects. + + The only implementation that used this interface was the QMI one, and + only for a very small subset of devices (those supporting the "QMI DMS + List Stored Images" operation). The logic was changed so that the list + of stored images wasn't preloaded during the support check; it will + now instead be preloaded during the first call to List(). + + src/mm-broadband-modem-qmi.c | 109 ++++++++++++++++++++++-------------- + src/mm-iface-modem-firmware.c | 126 + ++++++------------------------------------ + src/mm-iface-modem-firmware.h | 8 --- + 3 files changed, 87 insertions(+), 156 deletions(-) + +commit 8e342cf1204379a11bfe55941d4e722575cb364f +Author: Aleksander Morgado +Date: Sun Dec 9 13:54:31 2018 +0100 + + api,firmware: new UpdateSettings property + + cli/mmcli-modem-firmware.c | 49 ++- + cli/mmcli-output.c | 415 + +++++++++++---------- + cli/mmcli-output.h | 5 +- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 34 ++ + include/ModemManager-enums.h | 12 + + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 168 +++++---- + libmm-glib/Makefile.am | 3 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-firmware-update-settings.c | 259 +++++++++++++ + libmm-glib/mm-firmware-update-settings.h | 89 +++++ + libmm-glib/mm-modem-firmware.c | 145 +++++++ + libmm-glib/mm-modem-firmware.h | 8 +- + src/mm-iface-modem-firmware.c | 44 +++ + src/mm-iface-modem-firmware.h | 8 + + 16 files changed, 967 insertions(+), 275 deletions(-) + +commit edf8d349390ec5be8d35f6e7105cde483849aae0 +Author: Aleksander Morgado +Date: Sun Dec 9 11:27:33 2018 +0100 + + api,firmware: remove unimplemented Install() method details + + .../org.freedesktop.ModemManager1.Modem.Firmware.xml | 20 + -------------------- + 1 file changed, 20 deletions(-) + +commit 55c3026643ee6c75c0a68171abd884edf035b9ba +Author: Aleksander Morgado +Date: Thu Dec 13 10:46:58 2018 +0100 + + api: deprecate 'number' in bearer properties + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/99 + + cli/mmcli-bearer.c | 3 --- + libmm-glib/mm-bearer-properties.c | 44 + +++++++++++++++---------------- + libmm-glib/mm-bearer-properties.h | 11 +++++--- + libmm-glib/mm-simple-connect-properties.c | 16 ++++++++--- + libmm-glib/mm-simple-connect-properties.h | 11 +++++--- + src/mm-broadband-bearer.c | 17 ++---------- + src/mm-iface-modem-simple.c | 2 -- + 7 files changed, 53 insertions(+), 51 deletions(-) + +commit 5dc79ce6069a388db8c94a9fbe35cfee07445bb0 +Author: Aleksander Morgado +Date: Mon Dec 17 15:18:07 2018 +0100 + + libmm-glib: add autoptr cleanup functions for all types + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/100 + + libmm-glib/mm-bearer-ip-config.h | 4 ++++ + libmm-glib/mm-bearer-properties.h | 4 ++++ + libmm-glib/mm-bearer-stats.h | 4 ++++ + libmm-glib/mm-bearer.h | 4 ++++ + libmm-glib/mm-call-audio-format.h | 4 ++++ + libmm-glib/mm-call-properties.h | 4 ++++ + libmm-glib/mm-call.h | 4 ++++ + libmm-glib/mm-cdma-manual-activation-properties.h | 4 ++++ + libmm-glib/mm-firmware-properties.h | 4 ++++ + libmm-glib/mm-kernel-event-properties.h | 4 ++++ + libmm-glib/mm-location-3gpp.h | 4 ++++ + libmm-glib/mm-location-cdma-bs.h | 4 ++++ + libmm-glib/mm-location-gps-nmea.h | 4 ++++ + libmm-glib/mm-location-gps-raw.h | 4 ++++ + libmm-glib/mm-manager.h | 4 ++++ + libmm-glib/mm-modem-3gpp-ussd.h | 4 ++++ + libmm-glib/mm-modem-3gpp.h | 4 ++++ + libmm-glib/mm-modem-cdma.h | 4 ++++ + libmm-glib/mm-modem-firmware.h | 4 ++++ + libmm-glib/mm-modem-location.h | 4 ++++ + libmm-glib/mm-modem-messaging.h | 4 ++++ + libmm-glib/mm-modem-oma.h | 4 ++++ + libmm-glib/mm-modem-signal.h | 4 ++++ + libmm-glib/mm-modem-simple.h | 4 ++++ + libmm-glib/mm-modem-time.h | 4 ++++ + libmm-glib/mm-modem-voice.h | 4 ++++ + libmm-glib/mm-modem.h | 4 ++++ + libmm-glib/mm-network-timezone.h | 4 ++++ + libmm-glib/mm-object.h | 4 ++++ + libmm-glib/mm-pco.h | 3 +++ + libmm-glib/mm-signal.h | 4 ++++ + libmm-glib/mm-sim.h | 4 ++++ + libmm-glib/mm-simple-connect-properties.h | 4 ++++ + libmm-glib/mm-simple-status.h | 3 +++ + libmm-glib/mm-sms-properties.h | 4 ++++ + libmm-glib/mm-sms.h | 4 ++++ + libmm-glib/mm-unlock-retries.h | 4 ++++ + 37 files changed, 146 insertions(+) + +commit 2b18af89b4b46bdf1dc8701ba96c48a76d706336 +Author: Khem Raj +Date: Tue Dec 18 23:10:44 2018 -0800 + + Do not pass null string to %s printf formatted string + + Here the string is already decided to be NULL and passing + a null pointer to %s will not work + + Fixes + error: '%s' directive argument is null + + Signed-off-by: Khem Raj + + plugins/mtk/mm-broadband-modem-mtk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ef942ca56442ecac3a22803cc87b18ce9b8cd97c +Author: Aleksander Morgado +Date: Mon Dec 17 15:04:25 2018 +0100 + + iface-modem-firmware: fix reporting empty firmware list + + ModemManager[2804]: [1545055222.508649] No valid firmware + images listed. Assuming firmware unsupported. + ModemManager[2804]: [1545055222.508665] firmware list + loading failed: unsupported + ModemManager[2804]: [1545055222.508683] Couldn't load + firmware image list: firmware list unknown + ModemManager[2804]: [1545055222.508728] Couldn't load + current firmware image: current firmware unknown + + (ModemManager:2804): GLib-CRITICAL **: + 15:00:22.508: g_variant_builder_end: assertion + '!GVSB(builder)->uniform_item_types || + GVSB(builder)->prev_item_type != NULL || + g_variant_type_is_definite (GVSB(builder)->type)' failed + + Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint + trap. + 0x00007ffff75b39b6 in ?? () from /usr/lib/libglib-2.0.so.0 + (gdb) bt + #0 0x00007ffff75b39b6 in () at /usr/lib/libglib-2.0.so.0 + #1 0x00007ffff75b4363 in g_logv () at /usr/lib/libglib-2.0.so.0 + #2 0x00007ffff75b4560 in g_log () at /usr/lib/libglib-2.0.so.0 + #3 0x00007ffff758867d in g_variant_builder_end () at + /usr/lib/libglib-2.0.so.0 + #4 0x00005555555e4d12 in load_current_ready + (self=0x55555579c330, res=0x5555557388e0, ctx=0x5555557d6d80) + at mm-iface-modem-firmware.c:84 + #5 0x00007ffff778f194 in () at /usr/lib/libgio-2.0.so.0 + #6 0x00007ffff778f1c9 in () at /usr/lib/libgio-2.0.so.0 + #7 0x00007ffff75c4271 in g_main_context_dispatch () at + /usr/lib/libglib-2.0.so.0 + #8 0x00007ffff75c5f89 in () at /usr/lib/libglib-2.0.so.0 + #9 0x00007ffff75c6f62 in g_main_loop_run () at + /usr/lib/libglib-2.0.so.0 + #10 0x0000555555597aa0 in main (argc=2, argv=0x7fffffffe488) + at main.c:181 + + src/mm-iface-modem-firmware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 85ac6f12f5ebd54e3865d72e7c968310fabebd85 +Author: Aleksander Morgado +Date: Mon Dec 17 14:32:48 2018 +0100 + + docs,libmm-glib: update copyright + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + 1 file changed, 1 insertion(+) + +commit 1a14b687deb717ad1ea51075f0d92a0a9e35d2d8 +Author: Aleksander Morgado +Date: Sun Dec 16 09:20:35 2018 +0100 + + ublox,tests: avoid using deprecated band symbols + + plugins/ublox/tests/test-modem-helpers-ublox.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7d9c7e0bf440f7d0cc03ea06fb24d30bd0379406 +Author: Aleksander Morgado +Date: Sun Dec 16 09:20:25 2018 +0100 + + telit: avoid using deprecated band symbols + + plugins/telit/mm-modem-helpers-telit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 04720d079520e5a71a52845c9ebe156744cba894 +Author: Aleksander Morgado +Date: Thu Dec 13 15:27:28 2018 +0100 + + libmm-glib,modem-3gpp: add guards around deprecated symbols + + libmm-glib/mm-modem-3gpp.c | 4 ++++ + libmm-glib/mm-modem-3gpp.h | 5 ++++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +commit 0d6e2dc9f57888e72ee3433e702e469c58022651 +Author: Ben Chan +Date: Wed Dec 12 16:58:46 2018 -0800 + + altair-lte: use mm_autoptr instead of g_autoptr + + commit 397faef3c5ce ("mm-common-helpers: add mm_autoptr helpers for + GRegex and GMatchInfo") introduces mm_autoptr(), which implements + g_autoptr() that isn't available before glib 2.44. This patch + fixes the + code to consistently uses mm_autoptr(). + + plugins/altair/mm-modem-helpers-altair-lte.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 1cee215f83461b0d141ce68abddb093d870c2ea8 +Author: Bob Ham +Date: Wed Sep 26 06:59:42 2018 +0000 + + base-call: Increase incoming call timeout to ten seconds + + The standard says a RING or CRING should be emitted whenever the + network sends an incoming call notification, which is nation-specific: + + "Interpretation of indications from the network to determine what + constitutes a "ring" is defined by national regulations. This + result code should be repeated each time the network repeats the + incoming call indication." -- ITU-T Rec. V.250, p. 42 + + On the giffgaff (O2) network in the UK, a SIMCom SIM7100E modem emits + RING indicators every six seconds. The current timeout is only five + seconds resulting in a stream of timed-out ModemManager call objects + whenever there is an incoming call. To fix this, we increase the + timeout to ten seconds. + + src/mm-base-call.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 318d45353231c778d157ea3a4693eab0dcb51756 +Author: Bob Ham +Date: Wed Dec 12 11:13:02 2018 +0000 + + base-call: Fix in-call URC regex to match handler logic + + The handler assumes the regex sub-expressions each have the same index + so they need to be within the same set of parentheses rather than each + individually parenthesised. Without this fix, call state changes are + missed. + + src/mm-base-call.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6d273839e961734fd8e9b042205c68c738fd89f8 +Author: Aleksander Morgado +Date: Sun Dec 9 10:12:57 2018 +0100 + + docs,libmm-glib: add missing methods for the Version property + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit 26e269ec70fbd986ae2818254c6cd5131e94b985 +Author: LiuQiFeng +Date: Mon Dec 10 13:13:53 2018 +0100 + + dell: support XMM-based devices + + plugins/Makefile.am | 19 ++++++++++++++++--- + plugins/dell/mm-plugin-dell.c | 38 ++++++++++++++++++++++++++++++-------- + 2 files changed, 46 insertions(+), 11 deletions(-) + +commit e198ec7f2ada7b2b3a92a9661c3218852aa6b47a +Author: Aleksander Morgado +Date: Sat Dec 8 10:08:39 2018 +0100 + + base-manager: load subsys/name once in device_added() + + src/mm-base-manager.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit e34699cc9e3a66bd6316479f3c5ee86da4cd71e3 +Author: Bob Ham +Date: Fri Dec 7 15:19:05 2018 +0000 + + policy: Call method name should be SendDtmf rather than SendTone + + The method on MMBaseCall is send_tone but the D-Bus method call is + SendDtmf. Without this patch, calls return + org.freedesktop.DBus.Error.AccessDenied. + + data/org.freedesktop.ModemManager1.conf.polkit | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cae7377a61db232c2cc0ccc0ad6bbdd1c709712b +Author: Aleksander Morgado +Date: Thu Dec 6 14:54:19 2018 +0100 + + iface-modem: always connect all method handlers, even in failed state + + So that the returned error is much more descriptive. + + E.g. instead of this: + $ sudo mmcli -m 0 -e + error: couldn't enable the modem: + 'GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: + Method Enable is not implemented on interface + org.freedesktop.ModemManager1.Modem' + We'll get this: + $ sudo mmcli -m 0 -e + error: couldn't enable the modem: + 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: + modem in failed state' + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/96 + + src/mm-iface-modem.c | 157 + +++++++++++++++++++++++---------------------------- + 1 file changed, 72 insertions(+), 85 deletions(-) + +commit 27276bf8626894b3814791d0e170ee56c177e3f0 +Author: Aleksander Morgado +Date: Thu Dec 6 14:14:58 2018 +0100 + + iface-modem: remove redundant logic to update failed state + + When the MMIfaceModem initialization returns with the SIM_NOT_INSERTED + error, the base logic is already updating the modem failed reason to + SIM_MISSING. There is no need to do that explicitly for the case where + SIM hot swap is supported. + + src/mm-iface-modem.c | 16 +--------------- + 1 file changed, 1 insertion(+), 15 deletions(-) + +commit f4941ede665bffbf1cd25266781da6625fb09fb0 +Author: Aleksander Morgado +Date: Thu Dec 6 14:06:56 2018 +0100 + + xmm,dell: add defaults for MBIM-derived objects + + For subclasses of MMBroadbandModemMbim, also apply the same property + defaults. E.g. we want to avoid peridic signal quality polling and we + also want to report that SIM hot swap is supported. + + plugins/dell/mm-broadband-modem-dell-dw5821e.c | 4 ++++ + plugins/xmm/mm-broadband-modem-mbim-xmm.c | 3 +++ + 2 files changed, 7 insertions(+) + +commit 88e4c0492ddf89f76fb700816fe0c421601d354d +Author: Aleksander Morgado +Date: Thu Dec 6 15:11:49 2018 +0100 + + cli,modem: output should include all 3GPP EPS fields always + + Even if some fields wouldn't apply to some modem, we're always + including all in the output so that clients can assume the fields are + always given. + + Fix adding the 3GPP EPS related fields unconditionally. + + cli/mmcli-modem.c | 50 +++++++++++++++++++++++--------------------------- + 1 file changed, 23 insertions(+), 27 deletions(-) + +commit c12b5fa0271cc5a38dd437078c0c3d44ff484687 +Author: Aleksander Morgado +Date: Tue Nov 20 10:17:44 2018 +0100 + + broadband-modem-mbim: implement initial EPS bearer settings updating + + We use the "LTE attach config" extension defined by Microsoft + to update + the initial EPS bearer settings. + + https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-lte-attach-operations + + src/mm-broadband-modem-mbim.c | 171 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 171 insertions(+) + +commit 2b25673f3460821cf9294f6feda9faffcb0e85ef +Author: Aleksander Morgado +Date: Thu Dec 6 08:06:57 2018 +0100 + + broadband-modem-mbim: implement initial EPS bearer settings loading + + We use the "LTE attach config" extension defined by Microsoft to query + the initial EPS bearer settings. + + https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-lte-attach-operations + + src/mm-broadband-modem-mbim.c | 122 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +commit 1e09b586a72bf4d7ff8ea6badc65289f57ade760 +Author: Aleksander Morgado +Date: Tue Nov 20 10:17:38 2018 +0100 + + broadband-modem-mbim: implement initial EPS bearer status support + + We use the "LTE attach status" extension defined by Microsoft to query + and monitor the initial EPS bearer settings. + + https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-lte-attach-operations + + src/mm-broadband-modem-mbim.c | 181 + +++++++++++++++++++++++++++++++++++++++--- + src/mm-iface-modem-3gpp.c | 30 +++---- + 2 files changed, 185 insertions(+), 26 deletions(-) + +commit 48ba504f4e7e59cde380954fba84a790d34eaef4 +Author: Aleksander Morgado +Date: Wed Nov 14 18:00:38 2018 +0100 + + helpers-mbim: new method to convert IP type settings to/from MM + + src/mm-bearer-mbim.c | 26 +++------------------ + src/mm-modem-helpers-mbim.c | 56 + ++++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-mbim.h | 3 +++ + 3 files changed, 61 insertions(+), 24 deletions(-) + +commit d6e2c69129900f50dd8c0ed6cb9a7a17c141a85e +Author: Aleksander Morgado +Date: Wed Nov 14 17:46:38 2018 +0100 + + helpers-mbim: new method to convert auth settings to/from MM + + src/mm-bearer-mbim.c | 26 ++++------------------- + src/mm-modem-helpers-mbim.c | 50 + +++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.h | 4 ++++ + 3 files changed, 58 insertions(+), 22 deletions(-) + +commit 4cb6751dafc20a55192b61eb8a6ab97d3c95c398 +Author: Aleksander Morgado +Date: Thu Dec 6 08:04:13 2018 +0100 + + api,modem-3gpp: new 'SetInitialEpsBearerSettings' method + + This method allows users to modify the settings used during the + initial LTE attach procedure. + + cli/mmcli-modem-3gpp.c | 76 ++++++++++ + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 + + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 28 ++++ + libmm-glib/mm-modem-3gpp.c | 86 +++++++++++ + libmm-glib/mm-modem-3gpp.h | 13 ++ + src/mm-iface-modem-3gpp.c | 161 + +++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 9 ++ + 7 files changed, 380 insertions(+) + +commit 8281b5048bc002dd2b049fdad041a35b7175eca7 +Author: Aleksander Morgado +Date: Thu Dec 6 07:55:58 2018 +0100 + + api,modem-3gpp: new 'InitialEpsBearerSettings' property + + This property shows the settings stored in the device to be used + during the initial LTE attach procedure. + + cli/mmcli-modem.c | 21 ++ + cli/mmcli-output.c | 316 + +++++++++++---------- + cli/mmcli-output.h | 4 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 5 + + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 13 + + libmm-glib/mm-modem-3gpp.c | 147 ++++++++++ + libmm-glib/mm-modem-3gpp.h | 8 +- + src/mm-iface-modem-3gpp.c | 44 +++ + src/mm-iface-modem-3gpp.h | 8 + + 9 files changed, 408 insertions(+), 158 deletions(-) + +commit 9c3ac2fb6023b87d065221f845969b0f06e26363 +Author: Aleksander Morgado +Date: Tue Nov 13 12:31:47 2018 +0100 + + api,modem-3gpp: new 'InitialEpsBearer' property + + This property contains the DBus path of a Bearer object of type + MM_BEARER_TYPE_DEFAULT_ATTACH, which is automatically exposed by the + modem when registered in the LTE network. + + Unlike standard bearer objects created by the user, this bearer won't + allow any connection/disconnection request, as its status is bound to + the LTE registration exclusively. + + The bearer settings exposed by the object include the APN details that + have been used during the initial packet network attach, which may be + defined by modem settings (e.g. if previously configured in the + firmware which APN to use for the given SIM card operator) or by the + network itself (e.g. if none configured, or if a network override is + required as when roaming). + + The bearer object will be created as soon as the LTE attach status + details are known, and only while the modem is enabled. The + implementation allows modems to update the LTE attach status details + during runtime, so the bearer object with the settings may be + recreated during runtime as well. + + cli/mmcli-bearer.c | 8 +- + cli/mmcli-common.c | 129 +++++++-- + cli/mmcli-modem.c | 8 +- + cli/mmcli-output.c | 312 + +++++++++++---------- + cli/mmcli-output.h | 5 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 11 +- + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 7 + + .../org.freedesktop.ModemManager1.Modem.xml | 5 +- + libmm-glib/mm-modem-3gpp.c | 179 ++++++++++++ + libmm-glib/mm-modem-3gpp.h | 17 +- + src/mm-base-bearer.c | 28 +- + src/mm-broadband-modem.c | 37 +++ + src/mm-iface-modem-3gpp.c | 107 +++++++ + src/mm-iface-modem-3gpp.h | 16 ++ + 14 files changed, 675 insertions(+), 194 deletions(-) + +commit dc154cf005bbcb2f0bd1123093f6ac3c402c4de8 +Author: Aleksander Morgado +Date: Sun Nov 11 14:46:53 2018 +0100 + + api,bearer: new 'BearerType' property + + Until now we have only allowed to use and setup 'default bearers' (in + 4G) or 'primary contexts' (in 2G/3G). + + We can define a couple of additional bearer types, though: + + * The 'dedicated bearers' (in 4G) or 'secondary contexts' (in 2G/3G), + which are associated to a specific default/primary one, but which + provide specific QoS settings configured via traffic flow templates. + + * The 'initial default EPS bearer', which is a special case of default + bearer in LTE, which is automatically created and connected when the + modem is registered in the LTE network. + + This commit introduces a new 'MMBearerType' enumeration that will be + associated to each bearer through a 'BearerType' property in the + org.freedesktop.ModemManager1.Bearer interface, showing what kind of + bearer/context this is. + + By default, right now, all bearer objects created are 'default' + bearers. + + cli/mmcli-bearer.c | 1 + + cli/mmcli-output.c | 1 + + cli/mmcli-output.h | 1 + + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 +++++++ + include/ModemManager-enums.h | 22 + ++++++++++++++++++++++ + .../org.freedesktop.ModemManager1.Bearer.xml | 7 +++++++ + .../org.freedesktop.ModemManager1.Modem.xml | 4 +++- + libmm-glib/mm-bearer.c | 18 + ++++++++++++++++++ + libmm-glib/mm-bearer.h | 16 +++++++++------- + src/mm-base-bearer.c | 19 + ++++++++++--------- + 11 files changed, 80 insertions(+), 17 deletions(-) + +commit 46d627ff831b7d4d609060d77cd852f42cfcfa83 +Author: Aleksander Morgado +Date: Fri Dec 7 17:00:36 2018 +0100 + + libmm-glib: fix mm_manager_scan() operation + + The reporting of the operation result was reversed in the async + method. + + libmm-glib/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1ef58be792e992f0c4fee3e2f8ac274d2b832a40 +Author: Aleksander Morgado +Date: Fri Dec 7 16:58:35 2018 +0100 + + libmm-glib: fix mm_manager_set_logging() operation + + The reporting of the operation result was reversed in the async + method. + + libmm-glib/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 397faef3c5ce9eb5274adc73d31bd8002dd28c21 +Author: Dan Williams +Date: Mon Dec 3 11:40:43 2018 -0600 + + mm-common-helpers: add mm_autoptr helpers for GRegex and GMatchInfo + + Alias them to g_autoptr() on glib >= 2.44, otherwise re-implement. + + libmm-glib/mm-common-helpers.h | 23 +++++++++++++++++++++++ + plugins/altair/mm-modem-helpers-altair-lte.c | 27 + ++++++--------------------- + 2 files changed, 29 insertions(+), 21 deletions(-) + +commit 9c15579347c0e8adfafbc11aeaccdfebaa8ac626 +Author: Aleksander Morgado +Date: Tue Dec 4 14:18:23 2018 +0100 + + build: version bump to flag existence of new API (runtime version + reporting) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c7af14cc80509fd05500c747bda379f93a62582d +Author: Aleksander Morgado +Date: Mon Dec 3 15:21:29 2018 +0100 + + api,manager: new 'Version' property + + This string shows the runtime version of the ModemManager daemon. + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/94 + + cli/mmcli-manager.c | 18 ++++++++++++-- + docs/reference/libmm-glib/libmm-glib-sections.txt | 1 + + introspection/org.freedesktop.ModemManager1.xml | 7 ++++++ + libmm-glib/mm-manager.c | 29 + ++++++++++++++++++++--- + libmm-glib/mm-manager.h | 2 ++ + src/mm-base-manager.c | 2 ++ + 6 files changed, 54 insertions(+), 5 deletions(-) + +commit d0bb8d1d503f2ce01ea85625294c238aa831d298 +Author: Aleksander Morgado +Date: Tue Dec 4 09:55:58 2018 +0100 + + libmm-glib,manager: fix manager interface proxy creation + + We were re-using the GDBusObjectManagerClientFlags set in the + MMManager object as GDBusProxyFlags for the Manager1 interface proxy + object, and that was completely broken. + + Instead of setting "DO_NOT_AUTO_START" in the proxy, we were actually + setting "DO_NOT_LOAD_PROPERTIES"... + + libmm-glib/mm-manager.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 3b743dcc362c0859958d4be5a52abb453222b3c2 +Author: Aleksander Morgado +Date: Sat Dec 1 18:02:17 2018 +0100 + + helpers-qmi: fix UTRAN band 6 vs band 19 mapping + + Looks like the original band 6 mapping was ok, and the mismatch was + introduced when adding support for band 19. + + https://forum.sierrawireless.com/t/utran-19-band-configuration-in-sdk/14625 + + Fixes 518d62e731534cb4834a10e86f32ee31300de98b. + + src/mm-modem-helpers-qmi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 03fdb33e1c2e39cab2629ed3f16ddbc05b7752d8 +Author: Ben Chan +Date: Thu Nov 29 16:37:58 2018 -0800 + + cli,output: include string.h for strlen() + + This patch fixes the following compiler warning: + + mmcli-output.c:783:19: error: implicitly declaring library + function 'strlen' with type 'unsigned long (const char *)' + [-Werror,-Wimplicit-function-declaration] + aux = strlen + (section_infos[field_infos[item_l->field].section].name); + ^ + + cli/mmcli-output.c | 1 + + 1 file changed, 1 insertion(+) + +commit 9389265bababbacab0ab73388ed74db66e29cc26 +Author: Ben Chan +Date: Thu Nov 29 16:35:44 2018 -0800 + + cli,call: fix incorrect string conversion of MMCallStateReason enum + + This patch fixes the following issue with string conversion of a + MMCallStateReason enum: + + mmcli-call.c:160:88: error: implicit conversion from enumeration + type 'MMCallStateReason' to different enumeration type 'MMCallState' + [-Werror,-Wenum-conversion] + mmcli_output_string (MMC_F_CALL_PROPERTIES_STATE_REASON, + mm_call_state_get_string (mm_call_get_state_reason (call))); + ~~~~~~~~~~~~~~~~~~~~~~~~ + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + cli/mmcli-call.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7510b3355d7c1a670ab1eff373ef04bc5a8ad282 +Author: Aleksander Morgado +Date: Wed Nov 28 11:58:33 2018 +0100 + + base-modem: fix segfault when disposing modem + + If we have a modem reference around during an ongoing operation but + the modem has already been disposed after getting removed from the + system, we were trying to iterate a NULL hash table, which led to a + crash. + + https://lists.freedesktop.org/archives/modemmanager-devel/2018-November/006915.html + + Reported by Sebastien Fabre + + src/mm-base-modem.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit b0fba14b1e122522a1db2581779ffb94ee7cfa37 +Author: Aleksander Morgado +Date: Sat Oct 27 14:46:38 2018 +0200 + + cli: allow multiple output format types + + In addition to the standard human-friendly output, we now allow a + machine-friendly key-value pair output, much easier to parse and use + by programs that look at the mmcli output. + + This new key-value pair output should be treated as API from now + on, so + third-party programs can assume the output is compatible from one + release to another. + + cli/Makefile.am | 4 +- + cli/mmcli-bearer.c | 248 +++++----- + cli/mmcli-call.c | 51 +- + cli/mmcli-manager.c | 66 +-- + cli/mmcli-modem-3gpp.c | 68 +-- + cli/mmcli-modem-firmware.c | 46 +- + cli/mmcli-modem-location.c | 185 +++----- + cli/mmcli-modem-messaging.c | 63 +-- + cli/mmcli-modem-oma.c | 50 +- + cli/mmcli-modem-signal.c | 106 +++-- + cli/mmcli-modem-time.c | 36 +- + cli/mmcli-modem-voice.c | 40 +- + cli/mmcli-modem.c | 358 +++++--------- + cli/mmcli-output.c | 1099 + +++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli-output.h | 324 +++++++++++++ + cli/mmcli-sim.c | 25 +- + cli/mmcli-sms.c | 117 ++--- + cli/mmcli.c | 16 + + 18 files changed, 1994 insertions(+), 908 deletions(-) + +commit cafc40245d2007ad3a9a33875fc6b71d25e6a254 +Author: Aleksander Morgado +Date: Sat Nov 3 12:04:01 2018 +0100 + + cli,location: remove redundant --location-get-XXX actions + + The --location-get action provides full location information from all + sources, which is better than per-source actions, as those were anyway + using the same API method to load location information as the global + one. + + cli/mmcli-modem-location.c | 221 + +++++++++++++++------------------------------ + 1 file changed, 71 insertions(+), 150 deletions(-) + +commit 613aceabda4bbcfd037be746567e568339a37ed0 +Author: Aleksander Morgado +Date: Fri Nov 2 21:24:01 2018 +0100 + + cli,simple: remove redundant --simple-status action + + The Simple.GetStatus() method is useful for simple DBus clients that + don't need all the information associated to the modem, just the most + important bits. But, in our case, the information provided by this + method is already given by the standard modem info output, so it is + totally redundant. + + cli/mmcli-modem-simple.c | 168 + +---------------------------------------------- + 1 file changed, 1 insertion(+), 167 deletions(-) + +commit 72674225caf25e680003fb52fa805bf4615ad18f +Author: Aleksander Morgado +Date: Thu Nov 1 21:46:37 2018 +0100 + + api,modem: deprecate ListBearers() method + + This method is completely unnecessary as we have the readable Bearers + property already in place, so let's deprecate it. + + Worth noting that the mm_modem_list_bearers() async/sync methods in + libmm-glib were not really using the ListBearers() method anyway, they + are using the property directly. These methods are NOT deprecated, + because they allow us to get a list of MMBearer objects, instead of + just the list of DBus paths that we get when reading the Bearers + property directly. + + We also remove --list-bearers from the mmcli operation list as we have + already the same information in the standard modem output. + + cli/mmcli-modem.c | 68 + ---------------------- + .../org.freedesktop.ModemManager1.Modem.xml | 3 + + 2 files changed, 3 insertions(+), 68 deletions(-) + +commit a15193b7ca7c1b18f3aa6ee290f1c2866ab40a8c +Author: Aleksander Morgado +Date: Fri Oct 19 15:55:21 2018 +0200 + + broadband-modem: enable and handle +CGEV indications + + The +CGEV indications allow us to get notified of packet domain + events like network-initiated or ME-initiated disconnections on + specific connected contexts, as well as full PS detach events (all + contexts disconnected). If the modem supports these indications, we + will enable them with +CGEREP and will then process them when they are + emitted by the modem. + + If a full PS detach event happens, we will explicitly disconnect all + connected bearers. + + If a deactivation inidication is received for a single context, we + will look for the associated bearer by CID and explicitly disconnect + it. + + src/mm-broadband-modem.c | 548 + +++++++++++++++++++++++++++++++++-------- + src/mm-modem-helpers.c | 315 +++++++++++++++++++++++ + src/mm-modem-helpers.h | 42 ++++ + src/tests/test-modem-helpers.c | 157 ++++++++++++ + 4 files changed, 953 insertions(+), 109 deletions(-) + +commit 73df7087fd218e9d95fb72c00fbcdf0cc5ccf1ac +Author: Aleksander Morgado +Date: Mon Nov 19 13:17:29 2018 +0100 + + cli,signal: fix missing separator in GSM block + + Each group of items should have a separator. + + cli/mmcli-modem-signal.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit b98accf66022fe104d113190a54cefbe8cd29d82 +Author: Aleksander Morgado +Date: Mon Nov 19 12:11:52 2018 +0100 + + cli,signal: fix unknown value reporting + + At this point we want the values enclosed between single quotes, + e.g. so that the fields are parsed easier by scripts. + + This issue will not have any practical relevance as soon as the + key-value pair output support is merged. + + cli/mmcli-modem-signal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cc6a286cc43bc2718e287f730b30ef0bbdce87a5 +Author: Aleksander Morgado +Date: Mon Nov 12 12:25:33 2018 +0100 + + dell: don't ignore ttyUSB1 in the DW5821e + + This port was ignored because it was non-functional in early + development firmware images, and made device probing very slow. + + This has been solved in the first production images of the DW5821e + module. + + plugins/dell/77-mm-dell-port-types.rules | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ce945dc15f147e0287c40a6d84bf2553d6568738 +Author: Aleksander Morgado +Date: Sun Nov 11 14:34:40 2018 +0100 + + doc,libmm-glib: mm_pco_new() is not part of public API + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 270d3318eaa239dc594e87f9525a41f30f512736 +Author: Aleksander Morgado +Date: Sun Nov 11 14:33:15 2018 +0100 + + docs,libmm-glib: flag as private the mm_location_3gpp_reset() method + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 8b8bc0773f70961807d0208449a132b9fd673aab +Author: Aleksander Morgado +Date: Sun Nov 11 14:30:33 2018 +0100 + + libmm-glib,bearer-properties: don't document non-public API + + To avoid gtk-doc complaining about that. + + libmm-glib/mm-bearer-properties.c | 19 ------------------- + 1 file changed, 19 deletions(-) + +commit e9fd90a70c8bf9b4d58387607ab52c294efbec2e +Author: Aleksander Morgado +Date: Sun Nov 11 14:27:34 2018 +0100 + + libmm-glib,3gpp: add missing set_eps_ue_mode_operation() API docs + + libmm-glib/mm-modem-3gpp.c | 43 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit ae84e3faf48fdb235d40f59d2f449d47dd1a1967 +Author: Aleksander Morgado +Date: Sun Nov 11 14:21:50 2018 +0100 + + docs: remove duplicated mm-call-audio-format section + + docs/reference/libmm-glib/libmm-glib-sections.txt | 28 + ----------------------- + 1 file changed, 28 deletions(-) + +commit bf1b396596f2bbe9bc47c4ee5fb6176c3f14711e +Author: Ben Chan +Date: Wed Nov 7 10:26:23 2018 -0800 + + tests: use memcmp() instead of g_assert_cmpmem() for now + + g_assert_cmpmem() isn't available until glib 2.46, while the minimum + glib version required by ModemManager is 2.36. This patch replaces the + uses of g_assert_cmpmem() with memcmp() instead. + + libmm-glib/tests/test-pco.c | 3 +-- + plugins/altair/tests/test-modem-helpers-altair-lte.c | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +commit 2522efb35964154cc5607f37941a7381c3eb0d09 +Author: Ben Chan +Date: Tue Nov 6 13:40:43 2018 -0800 + + broadband-modem-mbim: update ms-basic-connect-extensions naming + + libmbim 1.17.4 (commit 3eeaa4248b98 "ms-basic-connect-extensions: + rename + service") added a MS prefix to the Basic Connectivity Extensions + service. This patch updates the MMBroadbandModemMbim code accordingly. + + configure.ac | 2 +- + src/mm-broadband-modem-mbim.c | 22 +++++++++++----------- + 2 files changed, 12 insertions(+), 12 deletions(-) + +commit 98fbc7a8b39aa84c905a7ce3c7b412ee04566f26 +Author: Sven Schwermer +Date: Wed Oct 31 08:26:11 2018 +0100 + + ublox: Add CDC-ECM support for SARA/LISA-U2xx + + The SARA-U2xx and LISA-U20x require the PDP context to be activated + via + +UCEDATA instead of +CGACT=1 when using the CDC-ECM USB profile. + Furthermore, they expect the DHCP discover packet from the TE + while the + command is running, i.e. while the modem has not replied yet. In order + to achieve that, the bearer is marked as connected as soon as the + command is issued. This makes the NetworkManager start the DHCP + process. + If the modem replies with an error, the bearer will be marked + disconnected later on. + + Signed-off-by: Sven Schwermer + + + plugins/ublox/mm-broadband-bearer-ublox.c | 106 + +++++++++++++++++++++++++++--- + 1 file changed, 96 insertions(+), 10 deletions(-) + +commit 668d6af408ef45bda75e43b269625385635ec1de +Author: Aleksander Morgado +Date: Sat Oct 27 11:18:47 2018 +0200 + + docs: add missing MMCallAudioFormat reference in docs + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + 1 file changed, 1 insertion(+) + +commit a32883d358834d2c2aea8b75fcfb46078e76a54f +Author: Aleksander Morgado +Date: Sat Oct 27 10:13:50 2018 +0200 + + doc: fix multiple missing references + + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 55 + +++++++++++++++++++++-- + 2 files changed, 52 insertions(+), 4 deletions(-) + +commit 864679543b2a858d2066b77edc53737cd96f39ec +Author: Ben Chan +Date: Fri Oct 26 21:42:11 2018 -0700 + + build: ignore generated ChangeLog + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit aa85aeae3d5659f7f14fb7facd4bfe078587c463 +Author: Ben Chan +Date: Fri Oct 26 23:00:06 2018 -0700 + + libqcdm: remove useless checks on always true condition + + result.c: In function ‘qcdm_result_add_u8_array’: + result.c:338:36: error: comparison of unsigned expression >= 0 is + always true [-Werror=type-limits] + qcdm_return_if_fail (array_len >= 0); + + result.c: In function ‘qcdm_result_add_u16_array’: + result.c:418:36: error: comparison of unsigned expression >= 0 is + always true [-Werror=type-limits] + qcdm_return_if_fail (array_len >= 0); + ^ + + libqcdm/src/result.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 737eff557dd1231db11249fcbb8106803ca86272 +Author: Ben Chan +Date: Fri Oct 26 23:00:05 2018 -0700 + + modem-helpers: remove useless checks on always true condition + + mm-modem-helpers.c:3075:31: error: comparison of unsigned expression + >= 0 is always true [-Werror=type-limits] + g_return_val_if_fail (idx >= 0, NULL); + ^ + + src/mm-modem-helpers.c | 1 - + 1 file changed, 1 deletion(-) + +commit b76db60313139126c6d932da89479a5ed1d5074f +Author: Ben Chan +Date: Fri Oct 26 10:56:57 2018 -0700 + + ublox: fix username and password passed to +UAUTHREQ + + plugins/ublox/mm-broadband-bearer-ublox.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit be81f7e5a21cd42b708ab3b5af5c56cd4fdff35c +Author: Ben Chan +Date: Thu Oct 11 11:36:00 2018 -0700 + + sim-qmi: use QMI UIM service to read IMSI if needed + + If a QMI modem doesn't support the deprecated DMS_UIM_GET_IMSI + command, + use the UIM_READ_TRANSPARENT command to read EFimsi on the SIM to + determine the IMSI. + + src/mm-sim-qmi.c | 77 + ++++++++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 70 insertions(+), 7 deletions(-) + +commit 055177fdf0b9cc461920bf0c488fab461d1ced06 +Author: Ben Chan +Date: Thu Oct 11 11:36:00 2018 -0700 + + sim-qmi: use QMI UIM service to read ICCID if needed + + If a QMI modem doesn't support the deprecated DMS_UIM_GET_ICCID + command, + use the UIM_READ_TRANSPARENT command to read EFiccid on the SIM to + determine the ICCID. + + src/mm-sim-qmi.c | 166 + ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 159 insertions(+), 7 deletions(-) + +commit 942bdeaec26eb587f39e9709dff0174bc4bfdd42 +Author: Ben Chan +Date: Sat Oct 20 20:20:54 2018 -0700 + + modem-helpers: new helper to convert binary-coded decimals + + This patch adds a mm_bcd_to_string() helper function to convert a byte + array representing a binary-coded decimal (BCD) number to a string + representing the equivalent decimal number. + + src/mm-modem-helpers.c | 20 ++++++++++++++++++++ + src/mm-modem-helpers.h | 2 ++ + src/tests/test-modem-helpers.c | 38 + ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 60 insertions(+) + +commit 025fcb7e92dde84c45085a1087375413c23d8ab7 +Author: Aleksander Morgado +Date: Sat Jul 28 22:34:00 2018 +0200 + + api: deprecate SubscriptionState property + + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 4 ++ + libmm-glib/mm-modem-3gpp.c | 12 +++- + libmm-glib/mm-modem-3gpp.h | 5 +- + src/mm-broadband-modem.c | 33 --------- + src/mm-iface-modem-3gpp.c | 80 + ---------------------- + src/mm-iface-modem-3gpp.h | 8 --- + 6 files changed, 17 insertions(+), 125 deletions(-) + +commit 408a2a9c6cef91e11a3ed5e09c140e175534822d +Author: Ben Chan +Date: Thu Oct 18 16:37:19 2018 -0700 + + altair-lte: migrate from SubscriptionState to Pco property + + In preparation of deprecating the SubscriptionState property in the + Modem3gpp interface, this CL updates the altair-lte plugin to + update the + Pco property in the Modem3gpp interface upon receiving %PCOINFO + notification. + + plugins/altair/mm-broadband-modem-altair-lte.c | 186 + +++++---------------- + plugins/altair/mm-modem-helpers-altair-lte.c | 123 +++++++------- + plugins/altair/mm-modem-helpers-altair-lte.h | 5 +- + .../altair/tests/test-modem-helpers-altair-lte.c | 109 ++++++++---- + 4 files changed, 183 insertions(+), 240 deletions(-) + +commit beb1aab17885bd2577964790986c5a79b6c120d7 +Author: Ben Chan +Date: Sat Oct 20 11:15:36 2018 -0700 + + sierra: remove unused 'self' variable in scact_periodic_query_ready() + + plugins/sierra/mm-broadband-bearer-sierra.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 55e011b5da14ee611f6ea21d89d48e429da7a1bb +Author: Ben Chan +Date: Sat Oct 20 11:15:23 2018 -0700 + + broadband-bearer: remove unused 'self' variables + + src/mm-broadband-bearer.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 14ca3efb7f1291075a55f85cd8d6df61db270d65 +Author: Ben Chan +Date: Sat Oct 20 00:47:19 2018 -0700 + + xmm: remove unused 'priv' variable in xact_query_bands_ready() + + plugins/xmm/mm-shared-xmm.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 9c03ce033c558302ec65f7a2858feb715f672682 +Author: Ben Chan +Date: Sat Oct 20 00:46:44 2018 -0700 + + base-call: remove unused 'self' variables + + src/mm-base-call.c | 9 --------- + 1 file changed, 9 deletions(-) + +commit 436f9ef7e6d5f04ef1c01e595831a7ae9a4f2cbf +Author: Ben Chan +Date: Wed Oct 17 23:06:49 2018 -0700 + + core: use g_clear_pointer() to avoid explicitly checking and + resetting pointers + + src/mm-base-sms.c | 10 ++-------- + src/mm-broadband-modem-mbim.c | 10 ++-------- + 2 files changed, 4 insertions(+), 16 deletions(-) + +commit 7de6b6f2e176ed60f1f74d0d8704f73e39585891 +Author: Ben Chan +Date: Wed Oct 17 23:06:48 2018 -0700 + + core: remove unnecessary NULL checks for g_match_info_free() + + g_match_info_free() already check if the given pointer is NULL + and does + nothing on a NULL pointer. + + plugins/cinterion/mm-modem-helpers-cinterion.c | 12 ++++-------- + plugins/huawei/mm-modem-helpers-huawei.c | 21 +++++++-------------- + plugins/mbm/mm-modem-helpers-mbm.c | 3 +-- + plugins/mtk/mm-broadband-modem-mtk.c | 13 ++++--------- + plugins/novatel/mm-broadband-modem-novatel.c | 3 +-- + plugins/sierra/mm-broadband-modem-sierra.c | 6 ++---- + plugins/sierra/mm-modem-helpers-sierra.c | 3 +-- + plugins/ublox/mm-modem-helpers-ublox.c | 24 + ++++++++---------------- + plugins/wavecom/mm-broadband-modem-wavecom.c | 3 +-- + plugins/xmm/mm-modem-helpers-xmm.c | 10 +++------- + plugins/zte/mm-broadband-modem-zte.c | 3 +-- + src/mm-modem-helpers.c | 24 + +++++++----------------- + 12 files changed, 40 insertions(+), 85 deletions(-) + +commit 749b806c30b41512dec4901808976425cdf3e56b +Author: Ben Chan +Date: Wed Oct 17 23:06:47 2018 -0700 + + core: remove unnecessary NULL checks for g_free() + + g_free() already check if the given pointer is NULL and does + nothing on + a NULL pointer. + + libmm-glib/mm-location-gps-raw.c | 3 +-- + src/mm-base-sms.c | 6 ++---- + src/mm-broadband-bearer.c | 3 +-- + 3 files changed, 4 insertions(+), 8 deletions(-) + +commit 4156fd27186a517fcae938aaf23783000f6f34aa +Author: Aleksander Morgado +Date: Wed Oct 10 15:54:23 2018 +0200 + + xmm: implement A-GPS support + + plugins/xmm/mm-broadband-modem-mbim-xmm.c | 4 + + plugins/xmm/mm-broadband-modem-xmm.c | 4 + + plugins/xmm/mm-modem-helpers-xmm.c | 85 +++++++++++++- + plugins/xmm/mm-modem-helpers-xmm.h | 7 ++ + plugins/xmm/mm-shared-xmm.c | 178 + ++++++++++++++++++++++++++--- + plugins/xmm/mm-shared-xmm.h | 13 +++ + plugins/xmm/tests/test-modem-helpers-xmm.c | 64 +++++++++-- + 7 files changed, 333 insertions(+), 22 deletions(-) + +commit fe05383fe5bfda64b873869d84a660b6d795325f +Author: Aleksander Morgado +Date: Wed Oct 10 15:54:02 2018 +0200 + + libmm-glib,gps-raw: prefer $GNGGA over $GPGGA + + The $GNGGA traces provide "combined" values when multiple satellite + constellations are used (e.g. GPS+GLONASS). Prefer these values over + the GPS-only $GPGGA traces if both are received. + + libmm-glib/mm-location-gps-raw.c | 36 + +++++++++++++++++++++++++----------- + 1 file changed, 25 insertions(+), 11 deletions(-) + +commit 2ffd0adf05616854dbd3fc49af589175a2e21650 +Author: Aleksander Morgado +Date: Wed Oct 10 15:53:55 2018 +0200 + + xmm: implement XLCSLSR based GPS management and report + + plugins/xmm/mm-broadband-modem-mbim-xmm.c | 39 +- + plugins/xmm/mm-broadband-modem-xmm.c | 37 ++ + plugins/xmm/mm-modem-helpers-xmm.c | 122 ++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 8 + + plugins/xmm/mm-shared-xmm.c | 638 + +++++++++++++++++++++++++++++ + plugins/xmm/mm-shared-xmm.h | 33 ++ + plugins/xmm/tests/test-modem-helpers-xmm.c | 57 +++ + 7 files changed, 932 insertions(+), 2 deletions(-) + +commit 04ca18c01ffde15c33f1fcbdbcd8f3a0fa556112 +Author: Ben Chan +Date: Tue Oct 16 15:42:44 2018 -0700 + + modem-helpers-qmi: include string.h for memset() + + This patch fixes the following compiler warning: + + mm-modem-helpers-qmi.c:568:5: error: implicitly declaring library + function 'memset' with type 'void *(void *, int, unsigned int)' + [-Werror,-Wimplicit-function-declaration] + memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size * + sizeof (guint64)); + ^ + + src/mm-modem-helpers-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit b1342725322aa39aab26f5a2d8613b117819ebd7 +Author: Ben Chan +Date: Wed Oct 10 22:06:46 2018 -0700 + + sim-qmi: avoid unnecessary MM_SIM_QMI() call on MMSimQmi object + + src/mm-sim-qmi.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit c9a56605cae68501b99252707e1731353567b92a +Author: Aleksander Morgado +Date: Fri Aug 10 15:03:11 2018 +0200 + + huawei,call: check for ^CVOICE support and enable audio streaming + + USB sticks only support voice if ^CVOICE returns 0. And to enable + audio + streaming on the "Application" port (whatever is returned by + AT^DDSETEX=?) + we need to send AT^DDSETEX= after starting the call. After that + the serial port will send and accept signed 16-bit 8000hz PCM + audio, or + whatever format is returned by ^CVOICE?. + + This patch is a rework of the original implementation by: + Dan Williams + + plugins/huawei/mm-broadband-modem-huawei.c | 95 ++++++++++++- + plugins/huawei/mm-call-huawei.c | 208 + +++++++++++++++++++++++++++-- + plugins/huawei/mm-call-huawei.h | 7 +- + plugins/huawei/mm-modem-helpers-huawei.c | 63 +++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 8 ++ + 5 files changed, 369 insertions(+), 12 deletions(-) + +commit e5f65d1b277cc8e26d3ba291643fa81af63381f6 +Author: Dan Williams +Date: Mon Apr 17 00:19:09 2017 -0500 + + port-serial: don't allow opens when a port is connected + + src/mm-port-serial.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 329caff84f1a3918b17f04b457afbc4a43c771c7 +Author: Aleksander Morgado +Date: Fri Aug 10 13:52:06 2018 +0200 + + base-call: implement generic audio channel setup/cleanup handlers + + Modems that require specific commands to setup or cleanup the audio + channel as soon as a call is ongoing can subclass these two new + methods. + + The setup() method is considered part of the call start/accept + process, and so if it fails, the whole operation will fail. + + The failures in the cleanup() method will be reported in the log, but + otherwise ignored, as this operation may be executed without any + user intervention (e.g. if the remote party hangs up). + + src/mm-base-call.c | 196 + +++++++++++++++++++++++++++++++++++++++++++---------- + src/mm-base-call.h | 21 ++++-- + 2 files changed, 175 insertions(+), 42 deletions(-) + +commit 17c511ec6955d07af431bf2012e274c9b3ce3d48 +Author: Aleksander Morgado +Date: Fri Aug 10 13:51:39 2018 +0200 + + api,call: new state reason to report audio setup failures + + include/ModemManager-enums.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 627303a748cce7274b05a6861a1dc0c779d9263a +Author: Dan Williams +Date: Mon Feb 6 20:53:39 2017 -0600 + + api/libmm-glib/cli: add AudioPort and AudioFormat properties to the + Call object + + cli/mmcli-call.c | 23 ++ + docs/reference/libmm-glib/libmm-glib-sections.txt | 32 +++ + .../org.freedesktop.ModemManager1.Call.xml | 39 +++ + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-call-audio-format.c | 276 + +++++++++++++++++++++ + libmm-glib/mm-call-audio-format.h | 88 +++++++ + libmm-glib/mm-call.c | 188 ++++++++++++++ + libmm-glib/mm-call.h | 10 +- + src/mm-base-call.c | 15 ++ + src/mm-base-call.h | 6 + + 10 files changed, 678 insertions(+), 2 deletions(-) + +commit 16162a5033593e017775eab640a3b9bf1b805c39 +Author: Aleksander Morgado +Date: Tue Jul 3 15:05:14 2018 +0200 + + ublox: implement detailed call state transitions with +UCALLSTAT + + Among other things, we now support: + * Dialing to Ringing Out transition. + * Ringing Out to Active transition. + + plugins/Makefile.am | 2 + + plugins/ublox/mm-broadband-modem-ublox.c | 152 +++++++++++++++++++++++- + plugins/ublox/mm-call-ublox.c | 194 + +++++++++++++++++++++++++++++++ + plugins/ublox/mm-call-ublox.h | 50 ++++++++ + 4 files changed, 396 insertions(+), 2 deletions(-) + +commit 89218a087499a6f5a39fe1a71a66241c28432357 +Author: Aleksander Morgado +Date: Tue Jul 3 15:04:32 2018 +0200 + + iface-modem-voice: remove unused declaration + + src/mm-iface-modem-voice.h | 5 ----- + 1 file changed, 5 deletions(-) + +commit 2b85d27fc00ccbe34a2dc9e2c679fa273967c7cb +Author: Aleksander Morgado +Date: Tue Jul 3 15:03:31 2018 +0200 + + iface-modem-voice: simplify reporting new incoming calls + + Allow creating a new incoming call object also when we receive +CLIP, + so that we can have the remote caller number as soon as the object is + created. + + src/mm-broadband-modem.c | 22 ++++------------------ + src/mm-iface-modem-voice.c | 44 + ++++++-------------------------------------- + src/mm-iface-modem-voice.h | 9 +++------ + 3 files changed, 13 insertions(+), 62 deletions(-) + +commit b2d859e37084099295cb96725e7e9f03b81dc84f +Author: Aleksander Morgado +Date: Tue Jul 3 15:00:14 2018 +0200 + + base-call: treat 'ringing-in' as an in-call state + + So that we setup in-call events as soon as we get the incoming call + ringing in. This allows us to have plugin-specific implementations + e.g. reporting call termination when the remote caller hangs up. + + src/mm-base-call.c | 1 + + src/mm-iface-modem-voice.c | 7 +++---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 887376fe4467da7a18b8e008537493512adb9fcb +Author: Aleksander Morgado +Date: Tue Jul 3 14:56:52 2018 +0200 + + mm-iface-mode: provide direction and number when creating calls + + Calls created from property bundles are always outgoing, while calls + created as input events from URCs during runtime are always incoming. + + This change makes it mandatory to provide at least direction of the + call when the object is created, leaving the number as an optional + property that may or may not be known in advance (e.g. it would be + optional only for incoming calls). + + plugins/huawei/mm-broadband-modem-huawei.c | 6 ++++-- + plugins/huawei/mm-call-huawei.c | 6 +++++- + plugins/huawei/mm-call-huawei.h | 4 +++- + src/mm-base-call.c | 6 +++++- + src/mm-base-call.h | 4 +++- + src/mm-broadband-modem.c | 6 ++++-- + src/mm-iface-modem-voice.c | 30 + +++++++++++------------------- + src/mm-iface-modem-voice.h | 4 +++- + 8 files changed, 38 insertions(+), 28 deletions(-) + +commit 44413308b295bd52c1b24eba69bc8e9eed6b4fb5 +Author: Aleksander Morgado +Date: Tue Jul 3 14:49:40 2018 +0200 + + iface-modem-voice: always create plugin-specified call objects + + The Voice interface logic must always use the create_call() object + from its own interface to create call objects, as that is the method + that plugins can subclass to provide plugin-specific call objects. + + This applies to both incoming and outgoing calls. + + src/mm-base-call.c | 42 + ------------------------------------------ + src/mm-base-call.h | 7 ++----- + src/mm-iface-modem-voice.c | 45 + ++++++++++++++++++++++++++++++++++++++------- + src/mm-iface-modem-voice.h | 1 - + 4 files changed, 40 insertions(+), 55 deletions(-) + +commit fc0feee65481f7edf1118e8dd74a5352901f677f +Author: Aleksander Morgado +Date: Fri Jun 15 00:04:15 2018 +0200 + + huawei,call: handle in-call URCs in the call object itself + + Instead of handling the URCs in the modem object and using the + MMIfaceModem as a bridge to report the status read from the URC to a + call obtained from the MMCallList... just handle the URCs in the call + object itself. + + plugins/huawei/mm-broadband-modem-huawei.c | 243 + +---------------------------- + plugins/huawei/mm-broadband-modem-huawei.h | 1 + + plugins/huawei/mm-call-huawei.c | 196 ++++++++++++++++++++++- + plugins/huawei/mm-call-huawei.h | 2 + + src/mm-call-list.c | 93 ----------- + src/mm-call-list.h | 7 +- + src/mm-iface-modem-voice.c | 93 ----------- + src/mm-iface-modem-voice.h | 5 - + 8 files changed, 205 insertions(+), 435 deletions(-) + +commit f71e120fb7e120c615e83a3803f20a0bd69b659e +Author: Aleksander Morgado +Date: Thu Jun 14 23:12:39 2018 +0200 + + huawei: ignore voice origination info URCs + + These are not used for anything, so just simplify code. + + plugins/huawei/mm-broadband-modem-huawei.c | 36 + ++++++------------------------ + 1 file changed, 7 insertions(+), 29 deletions(-) + +commit ae917d03fd69b36e55d1c56dcedc4d0091d01016 +Author: Aleksander Morgado +Date: Thu Jun 14 23:04:31 2018 +0200 + + huawei: if URCs fully ignored always, don't treat them as + voice-specific + + plugins/huawei/mm-broadband-modem-huawei.c | 41 + ++++++++++-------------------- + 1 file changed, 14 insertions(+), 27 deletions(-) + +commit 65ae18118e9da4fc3da24df1022febeaf6c164a0 +Author: Aleksander Morgado +Date: Thu Jun 14 22:59:32 2018 +0200 + + huawei,call: remove custom start() method + + Totally equivalent to the default one in the MMBaseCall object. + + plugins/huawei/mm-call-huawei.c | 88 + ----------------------------------------- + 1 file changed, 88 deletions(-) + +commit 638c5b49f1a93e659e6fb7a67cab3a45a7745f31 +Author: Aleksander Morgado +Date: Thu Jun 14 16:06:33 2018 +0200 + + base-call: improve logging + + src/mm-base-call.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 0478e88b4ffbcd502a07a59fc01263b5a225ba3c +Author: Aleksander Morgado +Date: Thu Jun 14 21:39:25 2018 +0200 + + base-call: listen for connection error URCs in-call + + In order to detect state changes while we're in-call, we have to + monitor the standard connection errors we're used to, but have them + processed as URCs instead of as responses to ATD requests. + + plugins/huawei/mm-call-huawei.c | 4 +- + src/mm-base-call.c | 95 + +++++++++++++++++++++++++++++++++++++---- + 2 files changed, 90 insertions(+), 9 deletions(-) + +commit bd3b5aca01a3d3102c607b7ca6fab310963ec77c +Author: Aleksander Morgado +Date: Thu Jun 14 15:36:06 2018 +0200 + + base-call: automatically terminate unanswered incoming calls + + Try to automatically detect when the caller finishes the attempt to + establish the call. + + src/mm-base-call.c | 45 ++++++++++++++++++++++++++++++++++++++- + src/mm-base-call.h | 20 ++++++++++------- + src/mm-broadband-modem.c | 4 ++-- + src/mm-call-list.c | 29 ++++++++++++------------- + src/mm-call-list.h | 12 +++++------ + src/mm-iface-modem-voice.c | 53 + ++++++++++++++++++++++++++-------------------- + src/mm-iface-modem-voice.h | 2 +- + 7 files changed, 108 insertions(+), 57 deletions(-) + +commit 0090124ec0d0d28fa78f5a0dd153e36584a0f171 +Author: Aleksander Morgado +Date: Thu Jun 14 14:58:28 2018 +0200 + + base-call: ACTIVE after start() if detailed transitions unavailable + + The most detailed call state transition flow for a new outgoing call + would be: + + UNKNOWN -> DIALING -> RINGING -> ACTIVE + + But, if the modem doesn't support reporting intermediate states + (e.g. DIALING or RINGING) then a successful start() should imply + getting into ACTIVE state right away. + + For now, only the Huawei plugin implements the detailed transition + support, so make them configurable via call object properties. + + plugins/huawei/mm-call-huawei.c | 2 ++ + src/mm-base-call.c | 47 + +++++++++++++++++++++++++++++++++++++---- + src/mm-base-call.h | 8 ++++--- + 3 files changed, 50 insertions(+), 7 deletions(-) + +commit 7c10db26c20cd39862059e08ddd237e6eeb406d0 +Author: Aleksander Morgado +Date: Thu Jun 14 14:43:10 2018 +0200 + + base-call: setup/cleanup custom events when transitioning to/from + in-call + + src/mm-base-call.c | 32 ++++++++++++++++++++++++++++---- + src/mm-base-call.h | 6 ++++++ + 2 files changed, 34 insertions(+), 4 deletions(-) + +commit cfdd6ffc95e611452281fc74bd403bdab9d2c79c +Author: Aleksander Morgado +Date: Thu Jun 14 14:34:05 2018 +0200 + + base-call: don't update state twice + + The mm_gdbus_call_set_() methods update the properties in the same way + as via g_object_set(), no need to do it twice. + + src/mm-base-call.c | 11 +---------- + src/mm-iface-modem-voice.c | 1 - + 2 files changed, 1 insertion(+), 11 deletions(-) + +commit 4409ccffccf781bf50f354b7ba193432e4cf8b73 +Author: Aleksander Morgado +Date: Thu Jun 14 14:31:02 2018 +0200 + + base-call: call state updates only in the interface logic + + Don't do any call state update on the generic implementation of the + commands, do it in the common interface logic exclusively. + + We were doing the state updates in both places. + + src/mm-base-call.c | 112 + +++++++++++++++++------------------------------------ + 1 file changed, 35 insertions(+), 77 deletions(-) + +commit 9a69e5363ab1c0200e31f6f061490cd350ce4a43 +Author: Aleksander Morgado +Date: Thu Jun 14 13:10:38 2018 +0200 + + base-call: don't notify a state change if it didn't change + + src/mm-base-call.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 60d42de68e3a359d2eb0af3d3ca01ca48f3c53c6 +Author: Aleksander Morgado +Date: Thu Jun 14 12:19:26 2018 +0200 + + base-call: no need to delete call info from the device + + Call information only lives in the ModemManager logic, there is no + associated date stored within the device itself. Therefore, simplify + everything by assuming there is nothing to remove. + + Looks like this logic was implemented because it was originally based + on the SMS management logic, but for SMS we do have to remove + them (the stored PDU parts) from the device. + + src/mm-base-call.c | 61 ------------------------------- + src/mm-base-call.h | 15 -------- + src/mm-call-list.c | 90 + ++++++++++------------------------------------ + src/mm-call-list.h | 10 ++---- + src/mm-iface-modem-voice.c | 29 +++++---------- + 5 files changed, 30 insertions(+), 175 deletions(-) + +commit 9503af95e2d22b828c3dcf89c1d63e3dd823cbc2 +Author: Aleksander Morgado +Date: Thu Jun 14 12:06:55 2018 +0200 + + base-call: fix logic when rejecting calls + + Make sure the async task is always finished, even when + mm_base_modem_at_command_finish() returns an error which is not + MM_SERIAL_ERROR_RESPONSE_TIMEOUT. + + src/mm-base-call.c | 42 +++++++++++++----------------------------- + 1 file changed, 13 insertions(+), 29 deletions(-) + +commit 0ac15f6e229a57c7ebefc9731d11bdba3f151c77 +Author: Aleksander Morgado +Date: Thu Jun 14 11:59:04 2018 +0200 + + base-call: fix logic when accepting calls + + Don't return FALSE when call is successfully accepted, otherwise the + caller will get very confused: + + ModemManager[19952]: [1528968478.344338] (ttyACM2): --> + 'ATA' + ModemManager[19952]: [1528968478.361986] (ttyACM2): <-- + 'OK' + + (ModemManager:19952): GLib-GIO-CRITICAL **: 11:27:58.387: + g_dbus_method_invocation_take_error: assertion 'error != NULL' + failed + + And also, make sure the async task is always finished, even when + mm_base_modem_at_command_finish() returns an error which is not + MM_SERIAL_ERROR_RESPONSE_TIMEOUT. + + src/mm-base-call.c | 52 + ++++++++++++++++------------------------------------ + 1 file changed, 16 insertions(+), 36 deletions(-) + +commit fa67a4f9bb014c947a9bb1c5f207ea787c8976b7 +Author: Aleksander Morgado +Date: Tue Oct 9 10:50:03 2018 +0200 + + sierra-legacy: implement connection status monitoring with !SCACT? + + Devices like the Netgear AC313U require explicit context monitoring, + otherwise the device may end up disconnected internally and MM would + still think that the connection is ongoing. + + plugins/Makefile.am | 22 ++++ + plugins/sierra/mm-broadband-bearer-sierra.c | 122 +++++++++++++++++- + plugins/sierra/mm-modem-helpers-sierra.c | 84 +++++++++++++ + plugins/sierra/mm-modem-helpers-sierra.h | 26 ++++ + plugins/sierra/tests/test-modem-helpers-sierra.c | 150 + +++++++++++++++++++++++ + src/mm-modem-helpers.c | 2 +- + src/mm-modem-helpers.h | 2 + + 7 files changed, 405 insertions(+), 3 deletions(-) + +commit c7d5902c15957d1487c83f13614b155a18b5f2b6 +Author: Aleksander Morgado +Date: Fri Oct 5 13:17:28 2018 +0200 + + shared-qmi: implement support for the 'extended' LTE band list + + This will allow us to configure via mmcli devices that support LTE + bands that would not fit in the standard TLVs (e.g. band 66 below) + or bands which aren't really reported in the standard TLVs (e.g. bands + 46 and 48 below). + + $ sudo qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities + [/dev/cdc-wdm0] Device band capabilities retrieved: + Bands: 'wcdma-2100, wcdma-pcs-1900, wcdma-1700-us, wcdma-850-us, + wcdma-800, wcdma-900, wcdma-1700-japan, wcdma-850-japan' + LTE bands: '1, 2, 3, 4, 5, 7, 8, 12, 13, 14, 17, 18, 19, 20, + 25, 38, 39, 40, 41, 42, 43' + LTE bands (extended): '1, 2, 3, 4, 5, 7, 8, 12, 13, 14, 17, + 18, 19, 20, 25, 26, 28, 29, 30, 32, 38, 39, 40, 41, 42, 43, + 46, 48, 66' + + src/mm-modem-helpers-qmi.c | 131 + +++++++++++++++++++++++++++++++++++++++------ + src/mm-modem-helpers-qmi.h | 11 ++-- + src/mm-shared-qmi.c | 58 +++++++++++++++++--- + 3 files changed, 173 insertions(+), 27 deletions(-) + +commit c906da415ced0b8bd2ca99e7624f2fe2b0dc63d5 +Author: Aleksander Morgado +Date: Tue Oct 9 14:13:15 2018 +0200 + + broadband-modem-mbim: plug leaks when using the ATDS service + + src/mm-broadband-modem-mbim.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 1ac79ccdfd82af5277c6baac7760d3a9588a0bd4 +Author: Aleksander Morgado +Date: Sat Oct 6 14:57:58 2018 +0200 + + cli,modem: print PCO as 'n/a' if not available + + cli/mmcli-modem.c | 45 +++++++++++++++++++++++++-------------------- + 1 file changed, 25 insertions(+), 20 deletions(-) + +commit 24454b2775cfcaa77429cf5d3a72ac82bd92084f +Author: Aleksander Morgado +Date: Sat Oct 6 14:52:18 2018 +0200 + + cli,bearer: normalize n/a reporting + + Use always small letters. + + cli/mmcli-bearer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f7cb84788e6b07e2c937dcf4e0512233ca48f6f2 +Author: Ben Chan +Date: Fri Oct 5 10:49:05 2018 -0700 + + base-modem: remove explicit GDestroyNotify cast on g_object_unref + + g_object_unref is in form of `void (*)(gpointer)`, which matches the + GDestroyNotify signature. An explicit GDestroyNotify cast on + g_object_unref is thus not needed. + + src/mm-base-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8bde29c9e2484d32d3a85b51b2c59d164b22d9f0 +Author: Thomas Haller +Date: Thu Oct 4 09:30:42 2018 +0200 + + libmm-glib: use helper function to convert enum/flags from string + + libmm-glib/mm-common-helpers.c | 284 + +++++++++++++---------------------------- + 1 file changed, 92 insertions(+), 192 deletions(-) + +commit d83f50794dd3525c0c3aedf565066a6ba8fd6d73 +Author: Thomas Haller +Date: Thu Oct 4 01:09:10 2018 +0200 + + libmm-glib, modem-helpers: unref enum/flags GType classes in enum + getters + + libmm-glib/mm-common-helpers.c | 60 + +++++++++++++++++++++++++++++++++++------- + src/mm-modem-helpers.c | 10 +++++-- + 2 files changed, 58 insertions(+), 12 deletions(-) + +commit a68bbbc1b98b5c2ec90969a7f70196352617c03d +Author: Ben Chan +Date: Thu Sep 27 00:27:51 2018 -0700 + + port-serial: port mm_port_serial_flash to use GTask + + src/mm-port-serial.c | 92 + +++++++++++++++++++++++++--------------------------- + 1 file changed, 44 insertions(+), 48 deletions(-) + +commit f3e1e699cfa2d0279144778f05eed6e2f0274a95 +Author: Ben Chan +Date: Thu Sep 27 00:27:50 2018 -0700 + + port-serial: port mm_port_serial_reopen to use GTask + + src/mm-port-serial.c | 84 + +++++++++++++++++++++++++--------------------------- + 1 file changed, 40 insertions(+), 44 deletions(-) + +commit 2a1a0b88fbaafbe3862e1b9130a9a484e84d752f +Author: Aleksander Morgado +Date: Thu Sep 13 11:47:10 2018 +0200 + + udev: define all generic tags as symbols + + This prevents errors due to nasty typos in the strings. + + We define all symbols in a single header file that is NOT considered + part of the API, as there is no need for MM clients to know about + these tags code-wise. These tags are only meaningful when associated + to devices in udev. + + Information of each tag is included in the general API documentation. + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/88 + + docs/reference/api/ModemManager-docs.xml | 6 + + docs/reference/api/ModemManager-sections.txt | 19 +++ + include/Makefile.am | 1 + + include/ModemManager-tags.h | 210 + +++++++++++++++++++++++++++ + src/kerneldevice/mm-kernel-device-generic.c | 4 +- + src/kerneldevice/mm-kernel-device-udev.c | 4 +- + src/mm-base-manager.c | 6 +- + src/mm-base-modem.c | 14 +- + src/mm-filter.c | 13 +- + src/mm-port-probe.c | 20 +-- + 10 files changed, 273 insertions(+), 24 deletions(-) + +commit a2705abb247f0f141d41ad8f34d99ce6133073af +Author: Aleksander Morgado +Date: Thu Sep 13 22:00:58 2018 +0200 + + iface-modem-messaging: if only one storage supported, select it + right away + + Some plugins or implementations (e.g. notably MBIM) may report a + single storage as supported and no way to update the current default + storage. In this specific case, we will initialize the default storage + to that single one supported right away, regardless of whether + selecting others is implemented or not. + + src/mm-iface-modem-messaging.c | 60 + +++++++++++++++++++++++++++++------------- + 1 file changed, 42 insertions(+), 18 deletions(-) + +commit 0ca95254ae507caddebe45f6ee6e230a99e82bfc +Author: Aleksander Morgado +Date: Tue Sep 25 16:06:38 2018 +0200 + + libmm-glib,location-3gpp: don't ignore location updates when MNC is 0 + + E.g. China Mobile (MCC 460, MNC 0). + + $ mmcli -m toby --location-get + + /org/freedesktop/ModemManager1/Modem/0 + ------------------------- + 3GPP location | Mobile country code: '460' + | Mobile network code: '0' + | Location area code: '6188' + | Cell ID: '40955' + ------------------------- + GPS NMEA traces | Not available + ------------------------- + Raw GPS | Not available + ------------------------- + CDMA BS | Not available + + libmm-glib/mm-location-3gpp.c | 38 ++++++++++++++++++++++++++++++++++++-- + libmm-glib/mm-location-3gpp.h | 1 + + src/mm-iface-modem-location.c | 9 +-------- + 3 files changed, 38 insertions(+), 10 deletions(-) + +commit 4d16eec5fbbe16e92dd25bea420fb8c503e520ec +Author: Ulrich Ölmann +Date: Fri Sep 21 12:21:05 2018 +0200 + + mmcli,location: fix doubled variable declaration + + Remove the redundant declaration of which slipped into the code + in commit + 091bf4dbd811 ("api: support location assistance data"). + + Signed-off-by: Ulrich Ölmann + + cli/mmcli-modem-location.c | 1 - + 1 file changed, 1 deletion(-) + +commit 8ef6d397c70313bdc511319c707e0ae825eacc96 +Author: Aleksander Morgado +Date: Fri Sep 21 15:02:03 2018 +0200 + + cli,signal: add generic fields in its own group + + This is just to consolidate the output w.r.t. similar fields in + e.g. the Messaging or Location interfaces. + + cli/mmcli-modem-signal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 77387cf604c8033a44d62253cf685493cc5d556d +Author: Aleksander Morgado +Date: Thu Sep 13 15:17:15 2018 +0200 + + xmm: increase AT command timeout when updating bands/modes + + Looks like sometimes it may take a bit more than 3s. + + plugins/xmm/mm-shared-xmm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e75063d80a8b18a28a89116beb78e42fe85c0d56 +Author: Aleksander Morgado +Date: Thu Sep 13 09:35:42 2018 +0200 + + po: minor updates in fr and it translation files + + po/fr.po | 17 ++++++++--------- + po/it.po | 7 +++---- + 2 files changed, 11 insertions(+), 13 deletions(-) + +commit 45a8fccb03ddcc35080f746bbe00b481bdbfb43e +Author: Milo Casagrande +Date: Tue Sep 11 11:36:38 2018 +0200 + + [l10n] Add Italian translation + + Signed-off-by: Milo Casagrande + + po/LINGUAS | 1 + + po/it.po | 108 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 109 insertions(+) + +commit 2f140123995642b5c186b1bab203b4d16380563a +Author: Aleksander Morgado +Date: Thu Sep 13 09:29:52 2018 +0200 + + xmm: minor alignment fixes + + plugins/xmm/mm-modem-helpers-xmm.c | 34 + +++++++++++++++++----------------- + plugins/xmm/mm-modem-helpers-xmm.h | 10 +++++----- + plugins/xmm/mm-shared-xmm.c | 27 ++++++++++++--------------- + 3 files changed, 34 insertions(+), 37 deletions(-) + +commit 823aa46a148725e9e1bf4f38517230f384dc0f9a +Author: Aleksander Morgado +Date: Thu Sep 13 09:26:19 2018 +0200 + + xmm: ensure outputs in load_values_finish() are always set if success + + plugins/xmm/mm-modem-helpers-xmm.c | 6 +++--- + plugins/xmm/mm-shared-xmm.c | 5 +++++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit 6b30f552a91ec0478f6a06fdc4e3d6740064bc0a +Author: Paul Bartell +Date: Mon Sep 10 15:25:15 2018 -0700 + + xmm: implement signal interface with +XCESQ polling + + plugins/xmm/mm-broadband-modem-xmm.c | 11 +++++++ + plugins/xmm/mm-shared-xmm.c | 64 + ++++++++++++++++++++++++++++++++++++ + plugins/xmm/mm-shared-xmm.h | 21 ++++++++++++ + 3 files changed, 96 insertions(+) + +commit 73045e931bd0cdef99c89ee56639850430430f41 +Author: Paul Bartell +Date: Mon Sep 10 15:17:22 2018 -0700 + + xmm: add +XCESQ parser + + plugins/xmm/mm-modem-helpers-xmm.c | 215 + +++++++++++++++++++++++++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 16 +++ + plugins/xmm/tests/test-modem-helpers-xmm.c | 144 +++++++++++++++++++ + 3 files changed, 375 insertions(+) + +commit 3dc4106f0da30a31af040cb7c38cc1df6a1a177c +Author: Paul Bartell +Date: Mon Sep 18 19:24:38 2017 -0700 + + broadband-modem: Call signal shutdown function when modem is disabled + + src/mm-broadband-modem.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit fe3665b18ed79f6de759718959154d5cbee4382a +Author: Paul Bartell +Date: Mon Sep 18 19:23:33 2017 -0700 + + iface-modem-signal: Tear down refresh context upon shutdown. + + src/mm-iface-modem-signal.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 04bf69c276ef0ced566e5d5b183c9995c5015516 +Author: Paul Bartell +Date: Thu Sep 7 09:43:58 2017 -0700 + + modem-helpers: Make 3gpp signal quality functions public + + src/mm-modem-helpers.c | 52 + +++++++++++++++++++++++++------------------------- + src/mm-modem-helpers.h | 24 +++++++++++++++++++++++ + 2 files changed, 50 insertions(+), 26 deletions(-) + +commit 6e5ea39cbab5d84dea8fe31d760bc79ac3412052 +Author: Aleksander Morgado +Date: Fri Jul 27 09:25:53 2018 +0200 + + dell: implement Unmanaged GPS support for the DW5821e + + The DW5821E module is managed in MBIM mode by default, and exposes a + NMEA capable tty in USB interface #4. + + Enabling/disabling the NMEA output via the TTY is done with AT + commands, so this implementation requires also a valid AT port in the + system. + + Given that the AT commands used to enable/disable this feature are + based on modifying non-volatile memory through AT^NV, this + implementation is very specific to the DW5821E. If we're able to do + the same on other Dell modules in the future, we'll just rename the + new object to a more generic one. + + plugins/Makefile.am | 8 + + plugins/dell/mm-broadband-modem-dell-dw5821e.c | 317 + +++++++++++++++++++++++++ + plugins/dell/mm-broadband-modem-dell-dw5821e.h | 49 ++++ + plugins/dell/mm-plugin-dell.c | 18 +- + 4 files changed, 388 insertions(+), 4 deletions(-) + +commit 02f9b5b0857af45a6726846d3e74840477be66bb +Author: Aleksander Morgado +Date: Mon Aug 27 10:56:56 2018 +0200 + + dell: port type hints for the Dell DW5821e + + Include port type hints to make probing quicker, and ignore the + secondary AT port as it may not be fully functional. + + plugins/dell/77-mm-dell-port-types.rules | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit d1744c76630b655c174e8b0f577889c9ccf73071 +Author: Aleksander Morgado +Date: Thu Jul 26 13:02:12 2018 +0200 + + shared-qmi: reuse band management logic in MBIM whenever possible + + src/mm-broadband-modem-mbim.c | 9 ++ + src/mm-broadband-modem-qmi.c | 347 + +----------------------------------------- + src/mm-shared-qmi.c | 258 +++++++++++++++++++++++++++++++ + src/mm-shared-qmi.h | 19 +++ + 4 files changed, 292 insertions(+), 341 deletions(-) + +commit 7f18a9370a11e4913db72659aa1c92b12f3f7044 +Author: Aleksander Morgado +Date: Sun Jul 15 23:07:23 2018 +0200 + + broadband-modem-mbim: use QMI-based mode/capability switching if + supported + + The implementation available in the shared QMI logic can be used + as-is, with one important note: if the QMI-based mode/capability + switching is used, we MUST also use QMI-based "3GPP network + registration" logic. This is needed because the MBIM command used to + select which 3GPP network to connect to allows specifying the mask of + access technologies desired, and that would overwrite whatever we had + previously set with QMI-based mode/capability switching commands. + + src/mm-broadband-modem-mbim.c | 411 + +++++++++++++++++++++++++++++++++++++----- + src/mm-modem-helpers-mbim.c | 22 +++ + src/mm-modem-helpers-mbim.h | 3 + + 3 files changed, 387 insertions(+), 49 deletions(-) + +commit ac69466c9da7c553c7f4c4a4197614af560abc83 +Author: Aleksander Morgado +Date: Mon Jul 16 00:04:20 2018 +0200 + + shared-qmi: implement 3GPP network registration logic + + Ported from the broadband modem QMI implementation, keeping the logic + in place. We will need this to integrate mode/capability switching in + MBIM devices, for nothing else really (as MBIM already supports this + operation). + + src/mm-broadband-modem-qmi.c | 110 + +------------------------------------------ + src/mm-shared-qmi.c | 103 + ++++++++++++++++++++++++++++++++++++++++ + src/mm-shared-qmi.h | 12 +++++ + 3 files changed, 117 insertions(+), 108 deletions(-) + +commit 692d076ba68e09bcad146d78109d4a59e1563918 +Author: Aleksander Morgado +Date: Sun Jul 15 22:54:18 2018 +0200 + + shared-qmi: implement reworked mode and capabilities management + + This commit introduces several improvements and changes in the way + modes and capabilities are managed in QMI capable devices. It is + organized into a single commit, as all changes in all 6 operations + (load current capabilities, load supported capabilities, set current + capabilities, load supported modes, load current modes, set current + modes) are related one to the other (given that the same QMI commands + are used for both capabilities and mode management). + + The primary change is related to which capabilities are reported as + supported for a given device. In the previous implementation we + allowed switching between every combination possible for GSM/UMTS+LTE, + CDMA/EVDO+LTE or GSM/UMTS+CDMA/EVDO+LTE devices. E.g. we would allow + "LTE only" and "GSM/UMTS only" capabilities for GSM/UMTS+LTE devices, + even if they would both be managed in exactly the same way. That setup + wasn't ideal, because it meant that switching to a "LTE only" + configuration would require a power cycle, as capability switching + requires a power cycle, even if no change was expected in the exposed + DBus interfaces (which is why we require the power cycle). So, instead + of allowing every possible capability combination, we use capability + switching logic exclusively for configuring GSM/UMTS+CDMA/EVDO devices + (regardless of whether it has LTE or not) to add or remove the + GSM/UMTS and CDMA/EVDO capabilities. E.g. for a GSM/UMTS+CDMA/EVDO+LTE + device we would allow 3 combinatios: "GSM/UMTS+LTE", "CDMA/EVDO+LTE" + and "GSM/UMTS+CDMA/EVDO+LTE". + + The "GSM/UMTS+CDMA/EVDO+LTE" is a special case because for this one we + allow switching to "LTE only" capabilities while we forbid switching + to "4G only" mode. As the same commands are used for mode and + capability switching, if we didn't have "LTE only" and we allowed "4G + only" mode instead and rebooted the device, we would end up not being + able to know which other capabilities (GSM/UMTS or CDMA/EVDO or both) + were also enabled. + + Now that we have capability switching confined to a very subset of + combinations, we can use the mode switching logic to e.g. allow "4G + only" configurations in all non multimode devices, as well as masks of + allowed modes with one being preferred, which we didn't allow before. + In the previous implementation all mode switching logic was disabled + for LTE capable QMI devices. In the new implementation, we use the + "Acquisition Order Preference" TLV in NAS Set System Selection + Preference to define the full list of mode preferences for all + supported modes. + + We also no longer just assume that NAS Technology Preference is always + available and NAS System Selection Preference only after NAS >= 1.1. + This logic is flawed, instead we're going to probe for those features + once when loading current capabilities, and we then just implement the + capabilities/mode switching logic based on that. + + configure.ac | 2 +- + src/mm-broadband-modem-qmi.c | 4350 + +++++++++++++++--------------------------- + src/mm-modem-helpers-qmi.c | 131 +- + src/mm-modem-helpers-qmi.h | 8 + + src/mm-shared-qmi.c | 1267 ++++++++++++ + src/mm-shared-qmi.h | 67 +- + 6 files changed, 3026 insertions(+), 2799 deletions(-) + +commit 6026c99f2ec99e2721356ee645472d8403676bf6 +Author: Aleksander Morgado +Date: Sun Jul 8 14:27:35 2018 +0200 + + shared-qmi: reuse device factory reset logic in MBIM whenever possible + + src/mm-broadband-modem-mbim.c | 2 ++ + src/mm-broadband-modem-qmi.c | 78 + ++----------------------------------------- + src/mm-shared-qmi.c | 73 + ++++++++++++++++++++++++++++++++++++++++ + src/mm-shared-qmi.h | 19 +++++++---- + 4 files changed, 90 insertions(+), 82 deletions(-) + +commit 9dc26cc44d79f18789a510e050fc899b680587ec +Author: Aleksander Morgado +Date: Sun Jul 8 14:17:34 2018 +0200 + + shared-qmi: reuse device reset logic in MBIM whenever possible + + src/mm-broadband-modem-mbim.c | 6 ++ + src/mm-broadband-modem-qmi.c | 195 + ++++++------------------------------------ + src/mm-shared-qmi.c | 99 +++++++++++++++++++++ + src/mm-shared-qmi.h | 9 ++ + 4 files changed, 142 insertions(+), 167 deletions(-) + +commit 32aa8333c62296c7c9c918b161e35355821e7615 +Author: Aleksander Morgado +Date: Fri Aug 24 18:44:36 2018 +0200 + + helpers,tests: update ICCID related unit tests + + Fix the test for invalid characters, because now I allow hex chars in + the account number. + + And add new tests with real China Mobile ICCIDs that contain hex chars + in the account number. + + src/tests/test-modem-helpers.c | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +commit 099d54a4bcaf7d71ccda1d42424d5b73ec286911 +Author: Aleksander Morgado +Date: Tue Aug 21 16:31:35 2018 +0200 + + helpers: allow [A-F] range in operator-specific ICCID account number + + There are operators (e.g. the Chinese CMCC operator) that abuse the + fact that 4 bits are used to store the BCD encoded numbers, and also + use the [A-F] range as valid characters for the ICCID in the operator + specific account number part. Haven't seen any documentation where + this format with [A-F] characters is explicitly allowed, but I have + seen multiple real cases where it happens. E.g.: + + 898602F9091830030220 + 898602C0123456789012 + + This patch also removes the 'last F' validation, used when reading + 19-digit ICCIDs with +CRSM, as it no longer applies. + + src/mm-modem-helpers.c | 41 ++++++++++++++++++++++------------------- + 1 file changed, 22 insertions(+), 19 deletions(-) + +commit eb01914bd0cada5d2ed144d5f3f45fd17722e97c +Author: Aleksander Morgado +Date: Tue Aug 21 16:26:45 2018 +0200 + + ublox: implement custom ICCID loading + + Use AT+CCID to query the SIM ICCID, and fallback to parent's +CRSM + based method otherwise. + + plugins/Makefile.am | 2 + + plugins/ublox/mm-broadband-modem-ublox.c | 25 +++++ + plugins/ublox/mm-sim-ublox.c | 162 + +++++++++++++++++++++++++++++++ + plugins/ublox/mm-sim-ublox.h | 51 ++++++++++ + 4 files changed, 240 insertions(+) + +commit 02821232878d2a12bf248b7f2594c48076593810 +Author: Aleksander Morgado +Date: Mon Jan 8 13:37:24 2018 +0100 + + helpers: allow 19-digit reported ICCIDs + + The mm_3gpp_parse_iccid() method does validation of the ICCID string + and was originally implemented to handle +CRSM reported values. The + implementation was looking for 20-digit strings, even for 19-digit + ICCIDs (those finished with a trailing 'F'). + + We now extend the logic to also validate ICCID strings reported as + 19-digit values directly, and when that happens we won't allow + swapping of the digits (a +CRSM specific requirement) or trailing 'F' + characters (as that is only required when reporting 19-digit ICCIDs + with 20-digit strings). + + This change allows us to e.g. use the u-blox specific AT+CCID command + and validate the returned ICCID with the same helper method, which + currently fails: + + (ttyACM2): --> 'AT+CCID' + (ttyACM2): <-- '+CCID: + 8934077700015848638OK' + couldn't load SIM identifier: 'Invalid ICCID response size (was 19, + expected 20)' + + src/mm-modem-helpers.c | 25 +++++++++++++++++-------- + src/tests/test-modem-helpers.c | 15 +++++++++++++++ + 2 files changed, 32 insertions(+), 8 deletions(-) + +commit 4c669d3bf46da3b4f924968e43fc2edfbfa0b5d7 +Author: Aleksander Morgado +Date: Mon Sep 10 23:36:45 2018 +0200 + + modem-helpers: reuse nicknames for the flow control tags + + And check that the string given in the tag is actually a valid one. + + src/mm-base-modem.c | 20 ++++++++++++----- + src/mm-modem-helpers.c | 30 ++++++++++++++----------- + src/mm-modem-helpers.h | 3 ++- + src/mm-port-probe.c | 60 + ++++++++++++++++++++++++++++++-------------------- + 4 files changed, 70 insertions(+), 43 deletions(-) + +commit fc1beefe927adb8d9bed3f554ddfb73a09593630 +Author: Aleksander Morgado +Date: Mon Sep 10 23:15:26 2018 +0200 + + port-serial: improve logging in mm_port_serial_set_flow_control() + + src/mm-port-serial.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +commit 727567cf581f9126b5af6aff2944f3734877d999 +Author: Aleksander Morgado +Date: Mon Sep 10 23:03:12 2018 +0200 + + broadband-bearer: no need for explicit flow control cleanup on + disconnect + + We're already configuring the flow control we expect when running + mm_port_serial_reopen(), which will keep the udev-selected flow + control or will otherwise reset to no flow control when the TTY is in + command mode. + + src/mm-broadband-bearer.c | 20 -------------------- + 1 file changed, 20 deletions(-) + +commit a19be8952f3d1587c32b63d0410530d5ae806e46 +Author: Aleksander Morgado +Date: Mon Sep 10 11:56:41 2018 +0200 + + cinterion: report selected RTS/CTS flow control to modem + + plugins/cinterion/mm-broadband-modem-cinterion.c | 1 + + 1 file changed, 1 insertion(+) + +commit 5f3c415722c26eafe3d5e02c02e3b692d9c47930 +Author: Aleksander Morgado +Date: Mon Sep 10 11:56:15 2018 +0200 + + iridium: report selected RTS/CTS flow control to modem + + plugins/iridium/mm-broadband-modem-iridium.c | 1 + + 1 file changed, 1 insertion(+) + +commit cd762addfd87e3b90c5a644f8bdaca3be01d5a3a +Author: Aleksander Morgado +Date: Mon Sep 10 13:46:03 2018 +0200 + + broadband-modem: allow subclasses to modify the flow control settings + + If a subclass implements a custom setup_flow_control() logic, e.g. to + select a very specific setting explicitly, let it also configure the + flow control settings modem-wide via the modem object property, so + that bearer objects can later on use the same settings when preparing + for a new connection. + + src/mm-broadband-modem.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit a9f871805b8e9b8c16a60b46ccdc525c78352f6c +Author: Aleksander Morgado +Date: Mon Sep 10 11:44:54 2018 +0200 + + broadband-modem: rework flow control selection logic + + Try to simplify a bit the logic that selects the flow control to be + used during connectivity: + + * We detect early if the requested flow control (via udev tags) is + actually supported by the modem (as eported by AT+IFC=?), and if it + isn't, we error out directly. + + * We try to set in a single place the AT commands to be used to setup + the flow control, once we have decided which one we're going to + use. + + * Use the string builder helpers to log the flow control values. + + src/mm-broadband-modem.c | 111 + ++++++++++++++++++++++++----------------------- + 1 file changed, 56 insertions(+), 55 deletions(-) + +commit b773e610eb68901624928b4dadb456d595a5d37c +Author: Aleksander Morgado +Date: Mon Sep 10 11:14:26 2018 +0200 + + port-serial,broadband-modem: minor coding style fixes + + src/mm-base-modem.c | 7 ++++--- + src/mm-port-serial.c | 3 ++- + 2 files changed, 6 insertions(+), 4 deletions(-) + +commit f253c15c1ffaba3767ce021e267df8ad079db6d2 +Author: Aleksander Morgado +Date: Mon Sep 10 11:06:15 2018 +0200 + + port-serial: improve logging of device-level flow control settings + + src/mm-port-serial.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 48d2fa399ac55ff5a59224b3ab5e475f1ddc394b +Author: Aleksander Morgado +Date: Mon Sep 10 10:56:52 2018 +0200 + + port-serial: Flow Control property is flags, not enum + + MMFlowControl is a flags enumeration, so change the property type to + match that, or we'll end up with nasty criticals during runtime. + + (ModemManager:30758): GLib-GObject-CRITICAL **: 10:54:26.435: + g_param_spec_enum: assertion 'G_TYPE_IS_ENUM (enum_type)' failed + + Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint + trap. + 0x00007ffff71f2a96 in ?? () from /usr/lib/libglib-2.0.so.0 + (gdb) bt + #0 0x00007ffff71f2a96 in () at /usr/lib/libglib-2.0.so.0 + #1 0x00007ffff71f3def in g_logv () at /usr/lib/libglib-2.0.so.0 + #2 0x00007ffff71f3fe0 in g_log () at /usr/lib/libglib-2.0.so.0 + #3 0x00007ffff72d90ac in g_param_spec_enum () at + /usr/lib/libgobject-2.0.so.0 + #4 0x000055555564caf2 in mm_port_serial_class_init + (klass=0x5555557607c0) at mm-port-serial.c:2101 + #5 0x000055555564759a in mm_port_serial_class_intern_init + (klass=0x5555557607c0) at mm-port-serial.c:49 + #6 0x00007ffff72ea9b4 in g_type_class_ref () at + /usr/lib/libgobject-2.0.so.0 + #7 0x00007ffff72eab5a in g_type_class_ref () at + /usr/lib/libgobject-2.0.so.0 + #8 0x00007ffff72d0f53 in g_object_new_valist () at + /usr/lib/libgobject-2.0.so.0 + #9 0x00007ffff72d103a in g_object_new () at + /usr/lib/libgobject-2.0.so.0 + #10 0x000055555564e187 in mm_port_serial_at_new + (name=0x55555576e280 "ttyUSB4", subsys=MM_PORT_SUBSYS_TTY) + at mm-port-serial-at.c:533 + #11 0x0000555555602512 in serial_open_at (self=0x555555715390) + at mm-port-probe.c:1285 + #12 0x00007ffff71ecb49 in g_main_context_dispatch () at + /usr/lib/libglib-2.0.so.0 + #13 0x00007ffff71ecf59 in () at /usr/lib/libglib-2.0.so.0 + #14 0x00007ffff71ed272 in g_main_loop_run () at + /usr/lib/libglib-2.0.so.0 + #15 0x00005555555957e0 in main (argc=3, argv=0x7fffffffe458) at + main.c:181 + + Also, rename the property to match the naming convention of other + properties in the same object. + + src/mm-port-serial.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit e3c2f0e9cccd26794e4fa54dcd8663d97e129414 +Author: Alfonso Sánchez-Beato +Date: Mon Sep 3 09:09:17 2018 +0200 + + broadband-modem: set flow control from port + + Set the flow control used in the data connection from the one + set in the port. + + src/mm-broadband-modem.c | 81 + ++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 65 insertions(+), 16 deletions(-) + +commit 94879ce1ce7c04060d74e6dcca610e2f239b5820 +Author: Alfonso Sánchez-Beato +Date: Mon Sep 3 09:06:27 2018 +0200 + + base-modem,port-probe: set serial port flow control from udev tag + + Set the serial port flow control from the udev tag + ID_MM_TTY_FLOW_CONTROL before accessing the port. + + src/mm-base-modem.c | 10 +++++++++- + src/mm-port-probe.c | 16 ++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +commit 4e69c10c2dd1409eb8e1b82051e758ff13164f35 +Author: Alfonso Sánchez-Beato +Date: Mon Sep 3 09:03:56 2018 +0200 + + port-serial: add flow control property + + Add flow control property to the MMPortSerial class, and use it when + setting the port flow control. + + src/mm-port-serial.c | 104 + +++++++++++++++++++++++++++++++++++++-------------- + src/mm-port-serial.h | 2 + + 2 files changed, 77 insertions(+), 29 deletions(-) + +commit a1c27bf89d8f238509479f7223de7bb8677c005e +Author: Alfonso Sánchez-Beato +Date: Mon Sep 3 09:01:47 2018 +0200 + + modem-helpers: add flow control udev tag parser + + Add function for parsing the content of the udev tag + ID_MM_TTY_FLOW_CONTROL. + + src/mm-modem-helpers.c | 19 +++++++++++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 21 insertions(+) + +commit bc407a38d63708298798440ce70acf7a14c4320c +Author: Aleksander Morgado +Date: Tue Aug 14 17:16:33 2018 +0200 + + mmcli,location: print LAC/TAC/CID in hex + + All these values are usually specified in hex, not in dec. + + cli/mmcli-modem-location.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 6e84f3d45934e4f1e334c4bfd0d9a43d88889039 +Author: Aleksander Morgado +Date: Tue Aug 14 15:36:44 2018 +0200 + + iface-modem-location: validate SUPL server address + + Devices will expect SUPL server given as either IP:PORT or FQDN:PORT, + so just avoid saying we require a 'URL' because it's not true. + + We will use a new helper method to parse and validate user-provided + SUPL server address. + + cli/mmcli-modem-location.c | 2 +- + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 4 +- + src/mm-iface-modem-location.c | 8 +++ + src/mm-modem-helpers.c | 58 + ++++++++++++++++++++++ + src/mm-modem-helpers.h | 6 +++ + src/mm-shared-qmi.c | 40 ++------------- + 6 files changed, 80 insertions(+), 38 deletions(-) + +commit 47ed19d5be68f139d4fbb00c997cd2805488ace7 +Author: Aleksander Morgado +Date: Sat Sep 8 10:04:58 2018 +0200 + + broadband-bearer: don't do connection checks on CDMA + + On CDMA-only connections we won't have a CID defined, so instead of + getting in a loop of warnings reporting "cid not defined", early error + out with an UNSUPPORTED error so that the connection check isn't tried + any more. + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/83 + + src/mm-broadband-bearer.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 21420e450db9c688859e7fd7fd71cd452f075f12 +Author: Ben Chan +Date: Thu Aug 30 13:11:35 2018 -0700 + + broadband-modem: port modem_cdma_register_in_network to use GTask + + src/mm-broadband-modem.c | 48 + ++++++++++++++++++++++++------------------------ + 1 file changed, 24 insertions(+), 24 deletions(-) + +commit fcec3b3355f62e0accccd8b84df8aca2b16181dd +Author: Ben Chan +Date: Thu Aug 30 13:00:38 2018 -0700 + + broadband-modem: port modem_cdma_setup_registration_checks to + use GTask + + src/mm-broadband-modem.c | 79 + ++++++++++++++++++++++++++++-------------------- + 1 file changed, 46 insertions(+), 33 deletions(-) + +commit c0607ede9b9743ef20798b34b9257fab2a48a490 +Author: Ben Chan +Date: Thu Aug 30 12:53:17 2018 -0700 + + broadband-modem: port modem_cdma_setup_cleanup_unsolicited_events + to use GTask + + src/mm-broadband-modem.c | 67 + ++++++++++++++++++++++++------------------------ + 1 file changed, 34 insertions(+), 33 deletions(-) + +commit a51a0ba23ebd098e22b3db31a59e7433ed4d1f67 +Author: Ben Chan +Date: Thu Aug 30 11:29:58 2018 -0700 + + broadband-modem: port modem_load_access_technologies to use GTask + + src/mm-broadband-modem.c | 140 + ++++++++++++++++++++++++----------------------- + 1 file changed, 73 insertions(+), 67 deletions(-) + +commit 2d7bf65093a70ee5894eb9a08d31568aec2d8ed3 +Author: Aleksander Morgado +Date: Thu Sep 6 10:40:47 2018 +0200 + + broadband-modem-qmi: avoid completing the GTask twice when loading + capabilities + + src/mm-broadband-modem-qmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e953d285c18a90f09df4b5d23b6649dbe3fafc55 +Author: Aleksander Morgado +Date: Thu Sep 6 10:40:01 2018 +0200 + + broadband-modem-qmi: add missing task unref when loading signal values + + src/mm-broadband-modem-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit 38de53b19536e8878c294ace678f43b2f6366230 +Author: Aleksander Morgado +Date: Thu Sep 6 10:38:27 2018 +0200 + + broadband-modem-qmi: make sure result values are not in context + when completing + + In order to avoid having the result values in 2 places (context and + result) when the GTask is completed, we will steal the pointer from + the context before it's set as result of the GTask. + + src/mm-broadband-modem-qmi.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 6e8aab2c4ed38d24c008ae4de36cb7c8bc8e3ca6 +Author: Paul Bartell +Date: Tue Sep 4 14:10:26 2018 -0700 + + broadband-modem-qmi: Pass signal values_result directly rather than + duplicating with g_memdup + + corrects segfault introduced in + 7d8f0600e6de32721112949b65d48108ea640b51 + + Signed-off-by: Paul Bartell + + src/mm-broadband-modem-qmi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 1b3b2e26a7ff4faf536074b8b82d6e4eec11b36c +Author: Ben Chan +Date: Tue Aug 28 13:10:24 2018 -0700 + + test,modem-helpers: remove unnecessary NULL check for g_free() + + g_free() handles a NULL pointer properly, so there is no need to + have a + NULL check before calling g_free(). + + src/tests/test-modem-helpers.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 8e98922880b54c2bad8e515be18cbc94c4544dc3 +Author: Aleksander Morgado +Date: Tue Aug 28 10:50:18 2018 +0200 + + libmm-glib,pco: add some more missing documentation for MMPco + + libmm-glib/mm-pco.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit c49f60db029624095b9b3d4f43399866211a5399 +Author: Ben Chan +Date: Mon Aug 27 12:55:24 2018 -0700 + + libmm-glib,pco: add missing documentation for MMPco + + libmm-glib/mm-modem-3gpp.c | 2 +- + libmm-glib/mm-pco.c | 25 +++++++++++++++++++++++++ + 2 files changed, 26 insertions(+), 1 deletion(-) + +commit 28c1acf2e134a395dfda28860db37e4bf9650e16 +Author: Aleksander Morgado +Date: Tue Aug 28 09:25:25 2018 +0200 + + port-probe: fix build when QMI over MBIM is unsupported + + src/mm-port-probe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f24d8279bcfac4f9945c2e47bf60e6dfc5a686f5 +Author: Guido Günther +Date: Mon Aug 27 16:51:28 2018 +0200 + + docs: mm_modem_get_sim is async + + Signed-off-by: Guido Günther + + libmm-glib/mm-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0520836afa8bf976d3f32f226c8b939e1551bb0b +Author: Ben Chan +Date: Wed Aug 22 13:26:24 2018 -0700 + + mbim: fix inconsistency in WITH_QMI guards + + src/mm-broadband-modem-mbim.c | 4 ++-- + src/mm-port-mbim.c | 4 ++-- + src/mm-port-mbim.h | 2 +- + src/mm-port-probe.c | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +commit 6530683cfb03c4dc31b1b96cfd16cf64c192a30b +Author: Ben Chan +Date: Tue Aug 21 17:38:15 2018 -0700 + + broadband-modem-mbim: add missing guard for shared_qmi_init() + + Fixes: 9e42a19742de55cf5c0ba4d68069c1845e9392e6 + + src/mm-broadband-modem-mbim.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2729b08696860ac790d8a5f726dcf8fa86fb51eb +Author: Ben Chan +Date: Tue Aug 21 17:27:48 2018 -0700 + + port-mbim: add missing guard for try_qmi_over_mbim in + mm_port_mbim_open() + + Fixes: c0cc694c67d9e71f200fb23e20473cc9b31d9ec0 + + src/mm-port-mbim.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 7c5cfa13a19c2c59d003c938283652f071e7004d +Author: Ben Chan +Date: Tue Aug 21 14:03:53 2018 -0700 + + xmm: include string.h for strlen() + + This patch fixes the following compiler warning: + + xmm/mm-modem-helpers-xmm.c:388:38: error: implicitly declaring + library function 'strlen' with type 'unsigned long (const char *)' + [-Werror,-Wimplicit-function-declaration] + g_regex_match_full (r, response, strlen (response), 0, 0, + &match_info, &inner_error); + ^ + + plugins/xmm/mm-modem-helpers-xmm.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f6c310ba82849f160b180678e6a7110aa210784b +Author: Ben Chan +Date: Tue Aug 21 14:02:20 2018 -0700 + + shared-qmi: include string.h for memset() + + This patch fixes the following compiler warning: + + mm-shared-qmi.c:447:9: error: implicitly declaring library + function 'memset' with type 'void *(void *, int, unsigned long)' + [-Werror,-Wimplicit-function-declaration] + memset (buf, 0, sizeof (buf)); + ^ + + src/mm-shared-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit 59e79c996b4863448f68a262bf8be053416a1344 +Author: Aleksander Morgado +Date: Mon Aug 13 19:14:30 2018 +0200 + + cinterion: new 'MMSharedCinterion' interface + + Implement a new interface to keep the code shared between the QMI and + non-QMI modem implementations. + + While doing that, also fix the parent interface pointer handling, so + that it isn't a static pointer applicable to all modems, and make it a + per-modem specific pointer. Without this fix, ModemManager would crash + if e.g. running with both a QMI and non-QMI Cinterion modem at the + same time. + + The new shared Cinterion logic will be in charge of managing all GPS + sources not already managed by the parent interface. E.g. if the + parent implementation already supports QMI-based GPS location (using + the LOC service for example) prefer that to the custom AT-based + logic. + + plugins/Makefile.am | 4 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 43 +- + .../cinterion/mm-broadband-modem-qmi-cinterion.c | 34 +- + ...mm-common-cinterion.c => mm-shared-cinterion.c} | 498 + +++++++++++---------- + ...mm-common-cinterion.h => mm-shared-cinterion.h} | 46 +- + 5 files changed, 343 insertions(+), 282 deletions(-) + +commit 6e9bf39ecf97aedd8474577811c147b62d37585e +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:54 2018 +0200 + + xmm: implement power management operations + + plugins/xmm/mm-broadband-modem-mbim-xmm.c | 6 ++ + plugins/xmm/mm-broadband-modem-xmm.c | 11 +++ + plugins/xmm/mm-shared-xmm.c | 152 + ++++++++++++++++++++++++++++++ + plugins/xmm/mm-shared-xmm.h | 31 ++++++ + 4 files changed, 200 insertions(+) + +commit 36e09ef44160bb9d864b9a0eebd700b1273a1a7f +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:51 2018 +0200 + + fibocom: include udev rules tests + + plugins/Makefile.am | 6 ++++-- + plugins/tests/test-udev-rules.c | 7 +++++++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit 475e1828195ab12b3e1e8be127995328575edbb4 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:48 2018 +0200 + + fibocom: support XMM-based devices + + plugins/Makefile.am | 3 ++- + plugins/fibocom/mm-plugin-fibocom.c | 21 +++++++++++++++++++++ + 2 files changed, 23 insertions(+), 1 deletion(-) + +commit da046fe566295a50b00d235843640cf403b1319f +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:46 2018 +0200 + + plugin: new properties to support Intel XMM capability probing + + src/mm-plugin.c | 77 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin.h | 3 +++ + 2 files changed, 80 insertions(+) + +commit 82262117e66fc43f88908cada5bc9d25d102ee40 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:43 2018 +0200 + + port-probe: support probing for Intel XMM capabilities + + Same thing as we do for Icera. + + src/mm-port-probe.c | 90 + ++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-port-probe.h | 14 ++++++--- + 2 files changed, 96 insertions(+), 8 deletions(-) + +commit f2c508f8b9932a11fc30552fdf3a36f2f763665a +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:40 2018 +0200 + + xmm: new 'MMBroadbandModemMbimXmm' modem object + + plugins/Makefile.am | 8 +++ + plugins/xmm/mm-broadband-modem-mbim-xmm.c | 86 + +++++++++++++++++++++++++++++++ + plugins/xmm/mm-broadband-modem-mbim-xmm.h | 47 +++++++++++++++++ + 3 files changed, 141 insertions(+) + +commit 656102633cb5ccde1d1869dd51a177c70a57f58c +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:37 2018 +0200 + + xmm: new 'MMBroadbandModemXmm' modem object + + plugins/Makefile.am | 2 + + plugins/xmm/mm-broadband-modem-xmm.c | 86 + ++++++++++++++++++++++++++++++++++++ + plugins/xmm/mm-broadband-modem-xmm.h | 47 ++++++++++++++++++++ + 3 files changed, 135 insertions(+) + +commit 917b23bbc71c22a2f9f374fa6433507c599a62b2 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:35 2018 +0200 + + xmm: new 'MMSharedXmm' modem interface + + With support for managing bands and modes. + + plugins/Makefile.am | 11 +- + plugins/xmm/mm-shared-xmm.c | 562 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/xmm/mm-shared-xmm.h | 85 +++++++ + 3 files changed, 657 insertions(+), 1 deletion(-) + +commit 2e0471fe6a51a686f870547cdb5d7c4608a1a18a +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:32 2018 +0200 + + libmm-glib: new common helpers to check band types + + libmm-glib/mm-common-helpers.c | 26 ++++++++++++++++++++++++++ + libmm-glib/mm-common-helpers.h | 5 +++++ + 2 files changed, 31 insertions(+) + +commit 6262e844f5a8cde8554f12292611118ff85cc145 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:29 2018 +0200 + + xmm: new helper to get 'any' allowed mode combination + + plugins/xmm/mm-modem-helpers-xmm.c | 31 +++++++++++++++++++++++++++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 3 +++ + 2 files changed, 34 insertions(+) + +commit d6b1c321ef75bc4dfda065231f04cfb2b2e932ed +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:26 2018 +0200 + + xmm: new common XACT=X builder for Intel XMM based devices + + plugins/xmm/mm-modem-helpers-xmm.c | 102 ++++++++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 5 + + plugins/xmm/tests/test-modem-helpers-xmm.c | 239 + +++++++++++++++++++++++++++++ + 3 files changed, 346 insertions(+) + +commit 023ba97d9cfeafb47fc4273647601e5650bfe689 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:24 2018 +0200 + + xmm: new common XACT? parser for Intel XMM based devices + + plugins/xmm/mm-modem-helpers-xmm.c | 120 + +++++++++++++++++++++++++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 6 ++ + plugins/xmm/tests/test-modem-helpers-xmm.c | 99 ++++++++++++++++++++++++ + 3 files changed, 225 insertions(+) + +commit 142f1d0360860ebecaa441b0431e37b1adf63751 +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:21 2018 +0200 + + xmm: new common XACT=? parser for Intel XMM based devices + + plugins/Makefile.am | 26 +++ + plugins/xmm/mm-modem-helpers-xmm.c | 340 + +++++++++++++++++++++++++++++ + plugins/xmm/mm-modem-helpers-xmm.h | 28 +++ + plugins/xmm/tests/test-modem-helpers-xmm.c | 210 ++++++++++++++++++ + 4 files changed, 604 insertions(+) + +commit 69ca442dd42bdc56ba664153afd630f91513c98e +Author: Aleksander Morgado +Date: Wed Aug 8 14:05:18 2018 +0200 + + api: define E-UTRAN bands 49 to 64 + + include/ModemManager-enums.h | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +commit 1b002a3584f84b8181827d19f59916d6c9897649 +Author: Aleksander Morgado +Date: Wed Jul 18 15:02:27 2018 +0200 + + fibocom: ignore intel trace port in the L850-GL + + plugins/Makefile.am | 2 ++ + plugins/fibocom/77-mm-fibocom-port-types.rules | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+) + +commit af8adcc756c7a5e456e3742ab1883908c4896c95 +Author: Aleksander Morgado +Date: Wed Jul 18 14:52:52 2018 +0200 + + fibocom: new plugin with support for MBIM devices + + plugins/Makefile.am | 12 +++++ + plugins/fibocom/mm-plugin-fibocom.c | 95 + +++++++++++++++++++++++++++++++++++++ + plugins/fibocom/mm-plugin-fibocom.h | 40 ++++++++++++++++ + 3 files changed, 147 insertions(+) + +commit 532ff24101259856887943fc3b406ccc1c08bb0d +Author: Aleksander Morgado +Date: Tue Aug 7 00:35:14 2018 +0200 + + broadband-modem-mbim: implement 3GPP USSD support + + src/mm-broadband-modem-mbim.c | 622 + +++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 617 insertions(+), 5 deletions(-) + +commit eda46d05cf9ed1a8f9aac460a55509b510b02c0b +Author: Aleksander Morgado +Date: Tue Aug 7 00:23:41 2018 +0200 + + charsets: new helper to convert binary input data to UTF-8 + + Most of all the other APIs we have are expecting binary data (e.g. + UCS-2 encoded strings) in ASCII hex format, because they were going + to be used in text AT commands. For binary protocols allowing binary + data, we need use a more generic API that provides an explicit data + size. + + src/mm-charsets.c | 25 +++++++++++++++++++++++++ + src/mm-charsets.h | 5 +++++ + 2 files changed, 30 insertions(+) + +commit e90ced5e0f5691113abb20fb5a22e312a2bc9b68 +Author: Aleksander Morgado +Date: Tue Aug 7 00:23:25 2018 +0200 + + iface-modem-3gpp-ussd: new helper to get current state + + src/mm-iface-modem-3gpp-ussd.c | 18 ++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 2 ++ + 2 files changed, 20 insertions(+) + +commit d16a1711fd9e6400f45ed7419670ef54b5cea4ed +Author: Aleksander Morgado +Date: Tue Aug 7 09:12:47 2018 +0200 + + iface-modem-3gpp-ussd: prefer 'events' naming to 'result codes' + + The 'result codes' naming is much more AT-protocol specific, 'events' + is more generic. + + src/mm-broadband-modem.c | 52 +++++++++++++-------------- + src/mm-iface-modem-3gpp-ussd.c | 80 + +++++++++++++++++++----------------------- + src/mm-iface-modem-3gpp-ussd.h | 76 + +++++++++++++++++++-------------------- + 3 files changed, 100 insertions(+), 108 deletions(-) + +commit 3bc9a2dbe2b2dd4eca1572eac5a34135d9f26cf4 +Author: Aleksander Morgado +Date: Wed Aug 8 11:29:11 2018 +0200 + + broadband-modem,ussd: explain encoding/decoding logic + + plugins/huawei/mm-broadband-modem-huawei.c | 7 ++++++- + src/mm-broadband-modem.c | 13 ++++++++++--- + 2 files changed, 16 insertions(+), 4 deletions(-) + +commit 6838a3f715279831cd8667f78996c9f6891062ea +Author: Aleksander Morgado +Date: Mon Aug 6 22:17:11 2018 +0200 + + broadband-modem,ussd: port to GTask + + src/mm-broadband-modem.c | 429 + ++++++++++++++++++++++------------------------- + 1 file changed, 203 insertions(+), 226 deletions(-) + +commit fc41c167ce018ed1ec20c0969b6bd4536113d395 +Author: Aleksander Morgado +Date: Mon Aug 6 21:58:22 2018 +0200 + + iface-modem-3gpp,ussd: let send_finish() return a newly allocated + string + + GTask integration will benefit from this change. + + src/mm-broadband-modem.c | 5 +---- + src/mm-iface-modem-3gpp-ussd.c | 14 +++++++++----- + src/mm-iface-modem-3gpp-ussd.h | 6 +++--- + 3 files changed, 13 insertions(+), 12 deletions(-) + +commit 4ef3623e6396d5e592410b0ce136a9acf559542d +Author: Aleksander Morgado +Date: Tue Aug 21 16:56:02 2018 +0200 + + shared-qmi: refactor parse_as_utf16_url() + + Let it return a GArray directly. We don't expect this method to ever + fail, as it's converting from UTF-8 to UTF-16. + + src/mm-shared-qmi.c | 23 +++++++++++------------ + 1 file changed, 11 insertions(+), 12 deletions(-) + +commit 63420884581852dda21f40ff88f81c49bae7680c +Author: Aleksander Morgado +Date: Tue Aug 21 16:53:38 2018 +0200 + + shared-qmi: fix context type in GPS operation mode timeout handler + + src/mm-shared-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c9d1d0572a6bc3dc9fda3244832ae73b197170c6 +Author: Aleksander Morgado +Date: Sat Jul 28 12:37:00 2018 +0200 + + shared-qmi: inject "xtra data" if "predicted orbits data" unsupported + + src/mm-shared-qmi.c | 170 + +++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 155 insertions(+), 15 deletions(-) + +commit efa14947b489e170ed09b3563840fe789061273f +Author: Aleksander Morgado +Date: Mon Jul 9 12:00:42 2018 +0200 + + shared-qmi,loc: setup reports every 5s may be broken + + Configuring reports every 5s may lead to GPGGA traces reported + like this: + + $GPGGA,211645.00,,,,,0,,,,,,,,*4D + $GPGGA,211646.00,4030.003988,N,00330.761876,W,1,07,1.0,691.6,M,53.0,M,,*74 + $GPGGA,211650.00,,,,,0,,,,,,,,*49 + $GPGGA,211651.00,4030.005405,N,00330.763540,W,1,07,1.0,688.9,M,53.0,M,,*71 + $GPGGA,211655.00,,,,,0,,,,,,,,*4C + $GPGGA,211656.00,4030.008074,N,00330.765338,W,1,07,0.9,679.9,M,53.0,M,,*70 + $GPGGA,211700.00,,,,,0,,,,,,,,*4D + $GPGGA,211701.00,4030.009258,N,00330.765510,W,1,07,1.0,678.3,M,53.0,M,,*71 + $GPGGA,211705.00,,,,,0,,,,,,,,*48 + + Which is totally undesirable, as the GPS location would be flapping + between set and unset. + + Use the default of 1s explicitly, which behaves properly. + + src/mm-shared-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 666622b4d4abb701cba753132302bdb31fc4c7b9 +Author: Aleksander Morgado +Date: Sun Jul 8 16:05:28 2018 +0200 + + broadband-modem-mbim: report Unsupported if QMI over MBIM not + available + + For non-Qualcomm MBIM devices, report a generic "Unsupported" error if + we try to do an operation that would otherwise be only available with + QMI-over-MBIM. + + src/mm-broadband-modem-mbim.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit d3b43bd0a6d80493703b7fa85e751981c101fe36 +Author: Aleksander Morgado +Date: Mon Jul 2 00:31:50 2018 +0200 + + shared-qmi: support for Qualcomm gpsOneXTRA assistance data + + The gpsOneXTRA assistance data provides a convenient way to inject + predicted orbit information into the module, without requiring to have + an Internet connection in the module itself. + + src/mm-broadband-modem-mbim.c | 6 + + src/mm-broadband-modem-qmi.c | 6 + + src/mm-shared-qmi.c | 463 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-shared-qmi.h | 86 +++++--- + 4 files changed, 522 insertions(+), 39 deletions(-) + +commit 091bf4dbd811a7e556613397cd0efa7b8998a2cd +Author: Aleksander Morgado +Date: Mon Jul 2 00:25:54 2018 +0200 + + api: support location assistance data + + Sometimes SUPL-server based A-GPS is not possible, e.g. if the module + doesn't have Internet connectivity. In such cases, the modem may + support injecting additional "assistance data" that may be downloaded + from the Internet using external means (e.g. WiFi), in order to keep + having a quick time to first fix. + + We now support using this location assistance data, with the following + new API elements: + + * A new mask of supported assistance data types is provided in the + SupportedAssistanceData property. + + * A new list of URLs from where the aassistance data may be + downloaded is also provided in a new AssistanceDataServers + property. + + * A new InjectAssistanceData() method is provided, to perform the + data injection in the module once it's been downloaded to the host + system. + + cli/mmcli-modem-location.c | 162 + ++++++++++++++++-- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 14 ++ + include/ModemManager-enums.h | 12 ++ + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 34 ++++ + libmm-glib/mm-modem-location.c | 153 + +++++++++++++++++ + libmm-glib/mm-modem-location.h | 20 +++ + src/mm-iface-modem-location.c | 188 + +++++++++++++++++++++ + src/mm-iface-modem-location.h | 26 +++ + 9 files changed, 596 insertions(+), 14 deletions(-) + +commit 0798f32362f0a9664e65de13c66d3767fc7ddf6d +Author: Aleksander Morgado +Date: Sat Jun 30 17:26:41 2018 +0200 + + shared-qmi: implement LOC-based GPS/A-GPS support + + src/mm-broadband-modem-mbim.c | 3 +- + src/mm-broadband-modem-qmi.c | 3 +- + src/mm-shared-qmi.c | 948 + ++++++++++++++++++++++++++++++++++++++---- + 3 files changed, 874 insertions(+), 80 deletions(-) + +commit 8bc51d3ed14bba4e1ccc6f365a2ebf4a11ac8658 +Author: Aleksander Morgado +Date: Sat Jun 30 17:25:18 2018 +0200 + + shared-qmi: decouple low-level GPS operations from source management + logic + + Just to make room for the LOC based integration. + + src/mm-shared-qmi.c | 746 + +++++++++++++++++++++++++++------------------------- + 1 file changed, 390 insertions(+), 356 deletions(-) + +commit fc520eb0732019ca310324f3ec5232021d90c64a +Author: Aleksander Morgado +Date: Sat Jun 30 17:12:50 2018 +0200 + + modem-helpers-qmi: new helper to transform QmiLocIndicationStatus + into a GError + + src/mm-modem-helpers-qmi.c | 37 ++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-qmi.h | 6 ++++++ + 2 files changed, 42 insertions(+), 1 deletion(-) + +commit 9e42a19742de55cf5c0ba4d68069c1845e9392e6 +Author: Aleksander Morgado +Date: Wed Jun 27 17:35:31 2018 +0200 + + broadband-modem-mbim: support for QMI PDS based GPS location + + src/mm-broadband-modem-mbim.c | 102 + +++++++++++++++++++++++++++++------------- + 1 file changed, 72 insertions(+), 30 deletions(-) + +commit e93b698c7b20a2c4e63abbc9d58bf3b6f891d467 +Author: Aleksander Morgado +Date: Wed Jun 27 17:18:55 2018 +0200 + + port-mbim: when opening QMI over MBIM support, request indications + + We do want to receive QMI indications, as they will be needed for + different features (e.g. LOC based GNSS support). + + src/mm-port-mbim.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 098897778bd6525e4b1b2e1aac67064136f2cae9 +Author: Aleksander Morgado +Date: Wed Jun 27 17:12:53 2018 +0200 + + shared-qmi: import PDS-based GPS location support + + src/mm-broadband-modem-qmi.c | 952 + +++----------------------------------- + src/mm-shared-qmi.c | 1045 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-shared-qmi.h | 39 ++ + 3 files changed, 1156 insertions(+), 880 deletions(-) + +commit 811a80e5ead636a933f5be1318f80e1b72059f7a +Author: Aleksander Morgado +Date: Wed Jun 27 12:41:19 2018 +0200 + + shared-qmi: new interface to handle common QMI implementations + + This new interface will include implementations that are shared + between the MMBroadbandModemQmi and the MMBroadbandModemMbim. + + For now, it just provides a way to implement the common client + allocation methods. + + src/Makefile.am | 2 + + src/mm-broadband-modem-qmi.c | 412 + ++++++++++++++++++++++--------------------- + src/mm-shared-qmi.c | 84 +++++++++ + src/mm-shared-qmi.h | 60 +++++++ + 4 files changed, 354 insertions(+), 204 deletions(-) + +commit f9cbe045e5ac50234cd608f1ffbae520b52dc525 +Author: Aleksander Morgado +Date: Tue Jun 19 17:44:17 2018 +0200 + + broadband-modem-mbim: use the preallocated DMS client for FCC Auth + + src/mm-broadband-modem-mbim.c | 271 + ++++++++++-------------------------------- + 1 file changed, 66 insertions(+), 205 deletions(-) + +commit 5e6980c7fc6216dc920e2df1f06b76cd611ce7a9 +Author: Aleksander Morgado +Date: Tue Jun 19 12:50:34 2018 +0200 + + broadband-modem-mbim: preallocate QMI clients if QMI over MBIM + supported + + src/mm-broadband-modem-mbim.c | 95 + +++++++++++++++++++++++++++++++++++-------- + 1 file changed, 78 insertions(+), 17 deletions(-) + +commit 8a364c4dfd910d5679b070b1f574539008028872 +Author: Aleksander Morgado +Date: Tue Jun 19 12:23:47 2018 +0200 + + port-mbim: implement QMI client allocation logic + + src/mm-port-mbim.c | 116 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-port-mbim.h | 22 ++++++++++ + 2 files changed, 138 insertions(+) + +commit c0cc694c67d9e71f200fb23e20473cc9b31d9ec0 +Author: Aleksander Morgado +Date: Tue Jun 19 11:55:10 2018 +0200 + + port-mbim: automatically try to open a QMI over MBIM device + + Most Qualcomm-based MBIM devices also support QMI over MBIM. We will + try to check in runtime whether the MBIM device supports QMI over + MBIM, and if so, setup a QmiDevice within the MMPortMbim. + + src/mm-broadband-modem-mbim.c | 3 + + src/mm-port-mbim.c | 158 + +++++++++++++++++++++++++++++++++++++----- + src/mm-port-mbim.h | 3 + + src/mm-port-probe.c | 3 + + 4 files changed, 150 insertions(+), 17 deletions(-) + +commit f6a2d01c7ee99204644db030a09fbd71566b7af7 +Author: Aleksander Morgado +Date: Tue Jul 10 23:12:56 2018 +0200 + + build: require libqmi 1.21.3 with QMI LOC support + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fc3ca42734ee2b608a03fecc8ad4e037f9836a6a +Author: Aleksander Morgado +Date: Mon Aug 20 16:53:49 2018 +0200 + + build: ignore test-pco built file + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit cc0c76d87564aacee774644a3422d7854f0090bb +Author: Claude Paroz +Date: Sat Aug 18 18:36:03 2018 +0200 + + Add French translation + + po/LINGUAS | 1 + + po/fr.po | 106 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 107 insertions(+) + +commit b8ab4736621db5ebc91e6fccc7195d192a01372b +Author: Ben Chan +Date: Tue Aug 14 18:12:36 2018 -0700 + + cli: print 'Pco' property in Modem3gpp interface + + cli/mmcli-modem.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +commit 930a5879d4735cf9ab934905b209a3ec158a02a2 +Author: Ben Chan +Date: Tue Aug 14 14:55:43 2018 -0700 + + broadband-modem-mbim: update 'Pco' property in Modem3gpp interface + + This patch changes MMBroadbandModemMbim to update the 'Pco' + property in + the Modem3gpp interface upon receiving a MBIM_CID_PCO notification. + + src/mm-broadband-modem-mbim.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +commit d46aa0c36a8543857e28f151e134f88462369fc4 +Author: Ben Chan +Date: Tue Aug 14 14:54:14 2018 -0700 + + modem-3gpp: add 'Pco' property to Modem3gpp interface + + This patch adds a 'Pco' property to the Modem3gpp interface for + tracking + PCOs that the modem has received from the network. + + docs/reference/libmm-glib/libmm-glib-sections.txt | 4 +++ + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 7 ++++ + libmm-glib/mm-modem-3gpp.c | 40 + ++++++++++++++++++++++ + libmm-glib/mm-modem-3gpp.h | 2 ++ + src/mm-iface-modem-3gpp.c | 29 ++++++++++++++++ + src/mm-iface-modem-3gpp.h | 2 ++ + 6 files changed, 84 insertions(+) + +commit eb327b4203601a6c09f6369927325767391b86e7 +Author: Ben Chan +Date: Tue Aug 14 14:53:04 2018 -0700 + + libmm-glib,pco: add helpers for managing a list of MMPco + + libmm-glib/mm-pco.c | 36 +++++++++++++++++ + libmm-glib/mm-pco.h | 4 ++ + libmm-glib/tests/Makefile.am | 23 +++++++---- + libmm-glib/tests/test-pco.c | 95 + ++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 150 insertions(+), 8 deletions(-) + +commit 28e64d00181c83fd6cd420c46b6040f7b1afe5fb +Author: Ben Chan +Date: Mon Aug 13 12:27:37 2018 -0700 + + libmm-glib: add MMPco for handling raw PCO data + + docs/reference/libmm-glib/libmm-glib-docs.xml | 4 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 28 +++ + libmm-glib/Makefile.am | 3 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-pco.c | 259 + ++++++++++++++++++++++ + libmm-glib/mm-pco.h | 87 ++++++++ + 6 files changed, 382 insertions(+) + +commit 89ffcbdd8db4164a4a1cbea0224b0cc14a3f57b0 +Author: Aleksander Morgado +Date: Tue Aug 14 10:59:53 2018 +0200 + + po: add Turkish translation + + From: Emin Tufan Çetin + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/80 + + po/LINGUAS | 1 + + po/tr.po | 105 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 106 insertions(+) + +commit b7e5ca62c5eca1118e0c5cbda3d769f2c756c92c +Author: Aleksander Morgado +Date: Tue Aug 14 10:33:49 2018 +0200 + + broadband-modem-mbim: explicitly ignore SMS storage initialization + + The MBIM protocol hides to the user the concept of SMS storages, so we + should explicitly ignore the initialization step so that it isn't run + with the parent AT-based implementation. + + src/mm-broadband-modem-mbim.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit d21dd6cf1fe93030baa4b8fffe9b7e84d781f186 +Author: Ben Chan +Date: Thu Aug 9 17:00:27 2018 -0700 + + broadband-modem: initialize 'tac' in registration_status_check_ready() + + mm-broadband-modem.c:4395:13: error: variable 'tac' + is used uninitialized whenever 'if' condition is false + [-Werror,-Wsometimes-uninitialized] + if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + mm-broadband-modem.c:4407:75: note: uninitialized use occurs here + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), + lac, tac, cid); + ^~~ + mm-broadband-modem.c:4395:9: note: remove the 'if' if its condition + is always true + if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + mm-broadband-modem.c:4380:9: error: variable 'tac' + is used uninitialized whenever 'if' condition is true + [-Werror,-Wsometimes-uninitialized] + if (cgreg) { + ^~~~~ + mm-broadband-modem.c:4407:75: note: uninitialized use occurs here + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), + lac, tac, cid); + ^~~ + mm-broadband-modem.c:4380:5: note: remove the 'if' if its condition + is always false + if (cgreg) { + ^~~~~~~~~~~~ + mm-broadband-modem.c:4280:15: note: initialize the variable 'tac' + to silence this warning + gulong tac; + ^ + = 0 + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit b378be0f0d0e433e423f004c5a09db64ed94bb54 +Author: Aleksander Morgado +Date: Thu Aug 9 17:07:30 2018 +0200 + + broadband-modem-mbim: fallback to trying AT+CESQ if ATDS signal + unsupported + + src/mm-broadband-modem-mbim.c | 81 + +++++++++++++++++++++++++++++++++++++------ + 1 file changed, 71 insertions(+), 10 deletions(-) + +commit ab9130682c0b529d68d4281fcf52bcf51f5dc43e +Author: Aleksander Morgado +Date: Thu Aug 9 11:59:25 2018 +0200 + + broadband-modem-mbim: implement extended signal support with ATDS + + src/mm-broadband-modem-mbim.c | 202 + ++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 197 insertions(+), 5 deletions(-) + +commit 7a941466c29342b1ebb30fbd54f41f4f7005d0b0 +Author: Aleksander Morgado +Date: Thu Aug 9 10:45:48 2018 +0200 + + broadband-modem-mbim: implement 3GPP location support with ATDS + + src/mm-broadband-modem-mbim.c | 119 + ++++++++++++++++++++++++++++++------------ + 1 file changed, 86 insertions(+), 33 deletions(-) + +commit ff6a82f5b754366db042cc602e1ffbbf46682749 +Author: Aleksander Morgado +Date: Wed Aug 8 16:32:35 2018 +0200 + + broadband-modem: check if modem implements MBIM_CID_USSD + + src/mm-broadband-modem-mbim.c | 35 ++++++++++++++++++++++++----------- + 1 file changed, 24 insertions(+), 11 deletions(-) + +commit cf500014b6db4ab9548d9f6fde35c21ab4c05697 +Author: Aleksander Morgado +Date: Fri Jul 27 12:08:27 2018 +0200 + + port-probe: no AT probing on possible QCDM port + + Ports flagged as being QCDM will not be probed for AT. QCDM probing + will be performed normally, the udev tags only give hints, we still + need to know whether the TTYs are QCDM-capable or not. + + src/mm-port-probe.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +commit 548b7f88473827954a389d96dac298fa6b6453a6 +Author: Aleksander Morgado +Date: Fri Jul 27 11:43:48 2018 +0200 + + base-modem: load AT port type hints when adding port + + We keep the pflags input in mm_base_modem_grab_port() so that plugins + can use other methods to gather port type hints (e.g. querying with AT + commands as in Huawei/Telit or looking at sysfs properties as in HSO). + + For standard udev tag port type hints, it will be the base modem + looking them up. + + Note that there is no longer any need to ignore non-flagged ports for + those modems that require primary/secondary flags. They will be + implicitly ignored when mm_base_modem_organize_ports() decides which + ports to use, as the flagged ones are preferred over the non-flagged + ones. + + plugins/haier/mm-plugin-haier.c | 27 ------------------- + plugins/huawei/mm-plugin-huawei.c | 18 +++---------- + plugins/longcheer/mm-plugin-longcheer.c | 43 + ------------------------------ + plugins/mtk/mm-plugin-mtk.c | 35 ------------------------ + plugins/nokia/mm-plugin-nokia-icera.c | 34 ------------------------ + plugins/simtech/mm-plugin-simtech.c | 47 + --------------------------------- + plugins/telit/mm-common-telit.c | 37 ++------------------------ + plugins/x22x/mm-plugin-x22x.c | 45 + ------------------------------- + plugins/zte/mm-plugin-zte.c | 18 +------------ + src/mm-base-modem.c | 14 +++++++++- + 10 files changed, 20 insertions(+), 298 deletions(-) + +commit aff633b1b002ecfecc51d589d580e963c931cb6d +Author: Aleksander Morgado +Date: Fri Jul 27 11:33:30 2018 +0200 + + port-probe: no QCDM probing on possible AT port + + Ports flagged with one of the common AT port type hints will not be + probed for QCDM. + + AT probing will be performed normally, the udev tags only give hints, + we still need to know whether the TTYs are AT-capable or not. + + src/mm-port-probe.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 6b0424cfac1c41d5aee3f734993077077f161325 +Author: Aleksander Morgado +Date: Fri Jul 27 10:55:48 2018 +0200 + + plugins: consolidate ID_MM_PORT_TYPE_AT_* flag names + + We define 3 common udev tag ids to be used by all plugins: + + * ID_MM_PORT_TYPE_AT_PRIMARY: the primary modem port. It will be used + for AT control and also as PPP if there is no other port flagged + explicitly to do PPP. + + * ID_MM_PORT_TYPE_AT_SECONDARY: the secondary modem port. It will be + used when/if the primary port gets connected to do PPP. + + * ID_MM_PORT_TYPE_PPP: the port to be used to do PPP only. This tag + makes sense only when the primary port shouldn't be used for PPP, + i.e. when there is a port dedicated to do PPP and one port + dedicated for control. + + plugins/haier/77-mm-haier-port-types.rules | 2 +- + plugins/haier/mm-plugin-haier.c | 2 +- + plugins/huawei/77-mm-huawei-net-port-types.rules | 8 +- + plugins/huawei/mm-plugin-huawei.c | 4 +- + plugins/longcheer/77-mm-longcheer-port-types.rules | 166 +++++++------- + plugins/longcheer/mm-plugin-longcheer.c | 4 +- + plugins/mtk/77-mm-mtk-port-types.rules | 28 +-- + plugins/mtk/mm-plugin-mtk.c | 4 +- + plugins/nokia/77-mm-nokia-port-types.rules | 26 +-- + plugins/nokia/mm-plugin-nokia-icera.c | 4 +- + plugins/simtech/77-mm-simtech-port-types.rules | 14 +- + plugins/simtech/mm-plugin-simtech.c | 4 +- + plugins/telit/77-mm-telit-port-types.rules | 22 +- + plugins/telit/mm-common-telit.c | 4 +- + plugins/x22x/77-mm-x22x-port-types.rules | 36 +-- + plugins/x22x/mm-plugin-x22x.c | 4 +- + plugins/zte/77-mm-zte-port-types.rules | 244 + ++++++++++----------- + plugins/zte/mm-plugin-zte.c | 4 +- + 18 files changed, 290 insertions(+), 290 deletions(-) + +commit 86f840d97bbc458adf6f2217783ca9bc6b81d5d0 +Author: Aleksander Morgado +Date: Fri Jul 27 10:20:09 2018 +0200 + + port-probe: explicitly report GPS port type if port flagged + + And remove all custom logic from all plugins that were doing just + that. + + plugins/cinterion/mm-plugin-cinterion.c | 8 -------- + plugins/huawei/mm-plugin-huawei.c | 5 ----- + plugins/mbm/mm-plugin-mbm.c | 29 + ----------------------------- + plugins/telit/mm-common-telit.c | 5 ----- + src/mm-port-probe.c | 3 +++ + 5 files changed, 3 insertions(+), 47 deletions(-) + +commit 9c0a557f918abd3e94702753ed0479494bcd2f90 +Author: Aleksander Morgado +Date: Fri Jul 27 10:19:48 2018 +0200 + + port-probe: don't do AT or QCDM probing on ports flagged as GPS + + src/mm-port-probe.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 85adbdbdd15794ab55112f8721ab5ae278f1b3bf +Author: Aleksander Morgado +Date: Fri Jul 27 10:02:54 2018 +0200 + + plugins: consolidate ID_MM_PORT_TYPE_GPS flag name + + Use the same flag name across all plugins with support for + NMEA-capable TTYs. + + plugins/cinterion/77-mm-cinterion-port-types.rules | 4 +-- + plugins/cinterion/mm-plugin-cinterion.c | 2 +- + plugins/huawei/77-mm-huawei-net-port-types.rules | 4 +-- + plugins/huawei/mm-plugin-huawei.c | 2 +- + plugins/mbm/77-mm-ericsson-mbm.rules | 38 + +++++++++++----------- + plugins/mbm/mm-plugin-mbm.c | 2 +- + plugins/telit/77-mm-telit-port-types.rules | 6 ++-- + plugins/telit/mm-common-telit.c | 2 +- + 8 files changed, 30 insertions(+), 30 deletions(-) + +commit 342abd7f6303ccd7f9a519c766ea53f3aa924b2d +Author: Aleksander Morgado +Date: Thu Aug 9 13:29:32 2018 +0200 + + cli,signal: print unset signal values as n/a + + cli/mmcli-modem-signal.c | 74 + ++++++++++++++++++++++++------------------------ + 1 file changed, 37 insertions(+), 37 deletions(-) + +commit fe66bdf65e57fa7dee3dcb8dea068fb3fc7aec34 +Author: Aleksander Morgado +Date: Thu Aug 9 11:59:40 2018 +0200 + + libmm-glib,signal: fix MM_SIGNAL_UNKNOWN symbol value + + Unfortunately, G_MINDOUBLE is basically 0.0, so MM_SIGNAL_UNKNOWN ends + up giving us a value that may fall in the range of expected values for + the signal component. + + Update the MM_SIGNAL_UNKNOWN symbol to match a value which is + definitely out any other possible valid range, so that we can easily + detect which values are set and which aren't. + + While API is maintained, this fix is introducing an ABI break. Not a + big deal anyway, as the purpose of the value is just to detect unset + fields. + + libmm-glib/mm-signal.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2773475f438e3979bcd3c597467019209a685891 +Author: Ben Chan +Date: Wed Aug 8 13:27:33 2018 -0700 + + build: require libmbim 1.17.3 + + libmbim 1.17.3 adds the support for MBIM_CID_PCO, which is used by + commit d68078b2ce0f ("broadband-modem-mbim: check if modem implements + MBIM_CID_PCO"). + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5a2f3cce95d21e565528a47e5dda17d8ec9e5dc9 +Author: Aleksander Morgado +Date: Thu Aug 9 10:45:28 2018 +0200 + + iface-modem-3gpp: fix location update when LAC=0 but TAC given + + src/mm-iface-modem-3gpp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7e6b4d7aa942dfff996a12ccdc769085058056d0 +Author: Aleksander Morgado +Date: Wed Aug 8 15:14:28 2018 +0200 + + api,location: give Tracking Area Code field in 3GPP location info + + The "location area code" field is given in GSM/UMTS networks + exclusively. LTE networks use the concept of "tracking area code" + instead. + + This patch updates the Location interface to Provide separate fields + for LAC and TAC, instead of giving TAC values in the LAC field. + + cli/mmcli-modem-location.c | 2 + + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 18 ++++++-- + libmm-glib/mm-location-3gpp.c | 45 + ++++++++++++++++-- + libmm-glib/mm-location-3gpp.h | 3 ++ + src/mm-broadband-modem-qmi.c | 53 + ++++++++++++++++------ + src/mm-broadband-modem.c | 36 ++++++++++++--- + src/mm-iface-modem-3gpp.c | 12 +++-- + src/mm-iface-modem-3gpp.h | 1 + + src/mm-iface-modem-location.c | 18 ++++---- + src/mm-iface-modem-location.h | 7 +-- + 10 files changed, 148 insertions(+), 47 deletions(-) + +commit f58a652578812809e14f0cc9fb82d6b2633a331e +Author: Aleksander Morgado +Date: Wed Aug 8 21:37:48 2018 +0200 + + broadband-modem-qmi: fix build using WITH_NEWEST_QMI_COMMANDS + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 59a5af9771b942ea6878e2f428635daae624f229 +Author: Aleksander Morgado +Date: Sat Aug 4 17:27:53 2018 +0200 + + iface-modem: reload current bands after setting + + Setting bands is a very device-specific operation. Sometimes the + device requires specific band combinations, or sometimes the 'any' + specific logic doesn't apply to all supported bands (e.g. may apply + only to the currently selected modes, as in XMM based devices). + + So, don't assume that if the set command succeeds we have set all + expected bands. Instead, do an explicit loading of the current bands + after the set operation, same thing as we do when setting modes. + + src/mm-iface-modem.c | 90 + ++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 66 insertions(+), 24 deletions(-) + +commit 518d62e731534cb4834a10e86f32ee31300de98b +Author: Aleksander Morgado +Date: Thu Jul 26 13:53:26 2018 +0200 + + helpers-qmi: fix UMTS band 6 and 19 definitions + + Also bump required libqmi version, as this change uses flags from the + latest available API. + + UMTS B19 is NTT DoCoMo's 800MHz band. + UMTS B6 is NTT DoCoMo's 850MHz band + + configure.ac | 2 +- + src/mm-modem-helpers-qmi.c | 11 +++++------ + 2 files changed, 6 insertions(+), 7 deletions(-) + +commit 24e31dc2b86ade753a0c5853ae568f2312e19072 +Author: Aleksander Morgado +Date: Tue Jul 24 00:04:13 2018 +0200 + + dell: don't ignore TTYs in QMI/MBIM modems + + When we detect that the modem is QMI-capable or MBIM-capable, we still + want to be able to use TTYs, for features unsupported by the main + protocols. + + So, don't flag all the TTYs as non-AT non-QCDM, let them probe as + usual instead. + + plugins/dell/mm-plugin-dell.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 8430b051139cc4ca5711345f6244ca5cf160c7e6 +Author: Aleksander Morgado +Date: Mon Aug 6 10:15:36 2018 +0200 + + broadband-modem: allow Enable() if disabling or initializing + + The first step in the Enable() processing is to wait for a final + state, so we can definitely wait for the ongoing disabling or + initializing states to finish before we go on with the enable + operation, there is no need to early fail if the disabling or + initializing intermediate states are detected. + + src/mm-broadband-modem.c | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +commit c4766122476b53a89c606bd0c0cbbd0ec6d9826b +Author: Aleksander Morgado +Date: Mon Aug 6 10:12:01 2018 +0200 + + base-modem: allow parallel Enable() and Disable() requests + + If additional Enable() requests are received while one is already + ongoing, we queue them and will end up completing all with the same + result once the first one finishes. + + Same logic also for Disable(). + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/8 + + src/mm-base-modem.c | 117 + +++++++++++++++++++++++++++++++++++++++-------- + src/mm-broadband-modem.c | 6 +-- + 2 files changed, 100 insertions(+), 23 deletions(-) + +commit 30eef126a1fd0dbd5ae531103c88923d8a20ca2f +Author: Ben Chan +Date: Tue Aug 7 15:16:48 2018 -0700 + + broadband-modem-mbim: subscribe to MBIM_CID_PCO notifications + + This patch changes MMBroadbandModem to subscribe to MBIM_CID_PCO + notifications if the modem supports that. + + src/mm-broadband-modem-mbim.c | 76 + ++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 71 insertions(+), 5 deletions(-) + +commit d68078b2ce0fba0074e791ddcf6fdae0d06dcd6a +Author: Ben Chan +Date: Tue Aug 7 15:16:47 2018 -0700 + + broadband-modem-mbim: check if modem implements MBIM_CID_PCO + + Being a part of a series that adds PCO support for MBIM modems that + implement the MBIM_CID_PCO extension, this patch issues a + MBIM_CID_DEVICE_SERVICES query during the modem initialization + to check + if a modem implements MBIM_CID_PCO. If the modem does, ModemManager + will + subscribe to MBIM_CID_PCO notifications to get PCO updates. + + src/mm-broadband-modem-mbim.c | 83 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 81 insertions(+), 2 deletions(-) + +commit dbfc03d9ac5f0ab78d5447b0541cb459ab15c32c +Author: Lubomir Rintel +Date: Mon Aug 6 13:48:05 2018 +0200 + + docs/ModemManager.8: document --filter-policy option + + docs/man/ModemManager.8 | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit b56cd74ab57edc024eefbcfa0bf0e5ffbabe32eb +Author: Lubomir Rintel +Date: Mon Aug 6 13:34:09 2018 +0200 + + docs: move mmcli(8) to section 1 + + Section (8) is for tools that require root privileges. + + docs/man/Makefile.am | 2 +- + docs/man/ModemManager.8 | 2 +- + docs/man/{mmcli.8 => mmcli.1} | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +commit ae9efa05c855c94122ef25ab6ee43dee13c1a64c +Author: Aleksander Morgado +Date: Sun Aug 5 14:24:25 2018 +0200 + + signal: cleanup previous extended info if no new one given + + E.g. if the modem switches from 4G to 3G while the extended signal + information is enabled, we should no longer expose LTE specific signal + quality values, only the UMTS specific ones. + + E.g. to avoid this: + + $ mmcli -m 1 --signal-get + ------------------------- + UMTS | RSSI: '0,00' dBm + | RSCP: '-92,00' dBm + | EcIo: '-13,00' dB + ------------------------- + LTE | RSSI: '0,00' dBm + | RSRQ: '-6,50' dB + | RSRP: '-96,00' dBm + | SNR: '0,00' dB + + src/mm-iface-modem-signal.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit ab0133445c67091bc494f01bfaea663d5298c568 +Author: Aleksander Morgado +Date: Fri Aug 3 17:24:27 2018 +0200 + + build: ignore all tester programs for plugin-specific modem helpers + + .gitignore | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +commit b8c7773a74f0c460ff19742a29dbf0060119e584 +Author: Aleksander Morgado +Date: Tue Jul 31 00:21:05 2018 +0200 + + cinterion: fix band related unit tests + + The sort_band() method used in the tester was totally wrong, it was + comparing the addresses of the variables instead of the MMModemBand + values. + + Use the common mm_common_bands_garray_sort() instead, which works as + expected. + + plugins/cinterion/tests/test-modem-helpers-cinterion.c | 14 + ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +commit 3a4a137de31cf1513c5fba4685b3de34eaa8713a +Author: Aleksander Morgado +Date: Mon Jul 30 23:30:43 2018 +0200 + + broadband-modem-mbim: avoid use of uninitialized variable + + src/mm-broadband-modem-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ebe9fcd57445460c3a37f7a82dc67843fb07a5cb +Author: Reinhard Speyerer +Date: Mon Jul 30 17:26:46 2018 +0200 + + mm-modem-helpers-cinterion: update band table for PLS8-J + + The default AT^SCFG="Radio/Band" value for Cinterion PLS8-J devices is + "16819472". Add UMTS band 19 and LTE band 19 entries based on the + information given in the PLS8 datasheet. + + plugins/cinterion/mm-modem-helpers-cinterion.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a160832fced9c1e944e119ffdb47ff6460abc8aa +Author: Bob Ham +Date: Wed Jul 25 09:50:41 2018 +0100 + + iface-modem-voice: fix ordering of D-Bus signals for call + addition/deletion + + To have proper ordering in the D-Bus signals, the skeleton's property + changes must be flushed before the Call{Add,Delet}ed signals are + emitted. Without this flush, the emission of the PropertiesChanged + signal is delayed until the main loop is idle. This causes problems + on the client side, for example the CallAdded signal being received + before the Calls property contains the call. + + Closes: #81 + + src/mm-iface-modem-voice.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 95cee88ccd7a87147ef8222ed575eb12c73320ee +Author: Aleksander Morgado +Date: Fri Jul 27 17:46:01 2018 +0200 + + man,mmcli: fix documentation for --set-current-bands + + Reported by: Matthew Stanger + + docs/man/mmcli.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7913fe4fafb583d517ca21ab6ea59d9a1d8c773d +Author: mstanger +Date: Wed Jul 25 14:44:27 2018 -0600 + + mm-modem-helpers-cinterion: update freq/band table + + This info comes from PLS8-X/E/J/V/US, HC25 & PHS8 references, the + last two can be found publicly via Google search. + + Swapped bit-mask locations for G850 & PCS bands as they may have + changed with FW or where accidently put in the wrong place. + + Updated many 3G & 4G bit-mask fields. + + plugins/cinterion/mm-modem-helpers-cinterion.c | 32 + ++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 10 deletions(-) + +commit 8ea8d4e7747d469e93c6a0c31a7b023e0f5633d1 +Author: Aleksander Morgado +Date: Wed Jul 18 12:54:49 2018 +0200 + + broadband-modem-mbim: show USB product attribute as model + + src/mm-broadband-modem-mbim.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 0a2060cc78150039bfd07d875016a52672dfe7bd +Author: Aleksander Morgado +Date: Wed Jul 18 12:53:44 2018 +0200 + + kerneldevice: allow loading physdev product string + + src/kerneldevice/mm-kernel-device-generic.c | 9 +++++++++ + src/kerneldevice/mm-kernel-device-udev.c | 16 ++++++++++++++++ + src/kerneldevice/mm-kernel-device.c | 10 ++++++++++ + src/kerneldevice/mm-kernel-device.h | 2 ++ + 4 files changed, 37 insertions(+) + +commit df8ead4808095fe1d0bd079234ddfd56e591fc4b +Author: Aleksander Morgado +Date: Thu Jul 19 15:56:40 2018 +0200 + + blacklist: include all devices from Prusa Research + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit d3bc04676444b26991dd08426422079f541ba8f4 +Author: Aleksander Morgado +Date: Sun Jul 8 14:25:01 2018 +0200 + + broadband-modem-qmi: plug memleak when processing a factory reset + + src/mm-broadband-modem-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit fff3f0ff7130f291cbaf530d1aa3c31168e5e5db +Author: Aleksander Morgado +Date: Fri Jun 15 17:04:39 2018 +0200 + + broadband-modem: skip concatenated AT commands + + Not all modems support AT command concatenation (e.g. u-blox TOBY-L4 + doesn't, according to a specific note about it in the AT command + reference). So just skip concatenation in the few places where it's + used. + + src/mm-broadband-modem.c | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +commit d134402efc49eb5e51ee7db33c8aef785837ef16 +Author: Aleksander Morgado +Date: Fri Jun 15 16:48:18 2018 +0200 + + ublox: always send user/pass strings, even if no authentication + requested + + The TOBY-L2 allowed to skup the user/pass string fields when no + authentication was requested, but according to the AT command + reference, all the remaining u-blox modules do require these two + fields given always (e.g. just as empty strings). + + As per this sequence in a TOBY-L4: + + (ttyACM2): --> 'AT+UAUTHREQ=?' + (ttyACM2): <-- '+UAUTHREQ: + (1-4),(0-2),,OK' + (ttyACM2): --> 'AT+UAUTHREQ=1,0' + (ttyACM2): <-- '+CME ERROR: 4' + + It should have been: AT+UAUTHREQ=1,0,"","" + + plugins/ublox/mm-broadband-bearer-ublox.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3570604bc4005e36e506c896bdb8cfc6a026df96 +Author: Aleksander Morgado +Date: Mon May 14 21:38:07 2018 +0200 + + iface-modem-simple: no need for an extra 'self' reference when + using GTask + + src/mm-iface-modem-simple.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +commit a77beaa271cad696f74579f4b409916606b16b6a +Author: Aleksander Morgado +Date: Thu Jul 5 22:53:28 2018 +0200 + + iface-modem-time: make sure timezone context is cleaned up properly + + If we're going to overwrite the timezone context, make sure everything + is cleaned up, including the signal handler. Otherwise, we may end up + running the signal handler without a context attached: + + (gdb) bt + #0 network_timezone_state_changed (self=0x6aa1e8) at + mm-iface-modem-time.c:266 + #1 0x76a8d418 in g_closure_invoke (closure=0x6c9810, + return_value=0x0, return_value@entry=0x1, n_param_values=2, + param_values=0x7edb58c0, param_values@entry=0x6cdab8, + invocation_hint=invocation_hint@entry=0x7edb585c) at + gclosure.c:804 + #2 0x76a9e674 in signal_emit_unlocked_R + (node=node@entry=0x6794d0, detail=0, detail@entry=391, + instance=instance@entry=0x6aa1e8, emission_return=0x6794a8, + emission_return@entry=0x0, + instance_and_params=instance_and_params@entry=0x7edb58c0) + at gsignal.c:3629 + #3 0x76aa31f4 in g_signal_emit_valist + (instance=instance@entry=0x6aa1e8, signal_id=signal_id@entry=1, + detail=detail@entry=6767564, var_args=..., var_args@entry=...) at + gsignal.c:3385 + #4 0x76aa34ec in g_signal_emit (instance=instance@entry=0x6aa1e8, + signal_id=signal_id@entry=1, detail=391) at gsignal.c:3441 + #5 0x76a91698 in g_object_dispatch_properties_changed + (object=0x6aa1e8, n_pspecs=1, pspecs=) at + gobject.c:1062 + #6 0x76a90e7c in g_object_notify_queue_thaw + (object=object@entry=0x6aa1e8, nqueue=nqueue@entry=0x75409418) + at gobject.c:296 + #7 0x76a9470c in g_object_set_valist + (object=object@entry=0x6aa1e8, + first_property_name=first_property_name@entry=0xad566 + "iface-modem-state", var_args=..., var_args@entry=...) at + gobject.c:2171 + #8 0x76a94b18 in g_object_set (_object=_object@entry=0x6aa1e8, + first_property_name=0xad566 "iface-modem-state") at gobject.c:2275 + #9 0x0004b8a4 in __iface_modem_update_state_internal + (self=0x6aa1e8, new_state=MM_MODEM_STATE_DISABLED, + reason=MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED, + failed_reason=MM_MODEM_STATE_FAILED_REASON_NONE) + at mm-iface-modem.c:1487 + #10 0x0007047c in disabling_context_free (ctx=0x6ba850) at + mm-broadband-modem.c:9053 + #11 0x76b4e538 in g_task_finalize (object=0x682488) at gtask.c:636 + #12 0x76a92800 in g_object_unref (_object=0x682488) at + gobject.c:3183 + #13 0x00072154 in iface_modem_disable_ready (self=0x6aa1e8, + result=0x7011b0, task=0x682488) at mm-broadband-modem.c:9101 + #14 0x76b4e6ec in g_task_return_now (task=0x7011b0) at + gtask.c:1107 + #15 0x76b4e720 in complete_in_idle_cb (task=0x7011b0) at + gtask.c:1121 + #16 0x7694d144 in g_main_dispatch (context=0x6765a8) at + gmain.c:3154 + #17 g_main_context_dispatch (context=context@entry=0x6765a8) + at gmain.c:3769 + #18 0x7694d40c in g_main_context_iterate (context=0x6765a8, + block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3840 + #19 0x7694d838 in g_main_loop_run (loop=0x6750d0) at gmain.c:4034 + #20 0x0002bec0 in main (argc=, argv=) at main.c:181 + + src/mm-iface-modem-time.c | 35 +++++++++++++++++++---------------- + 1 file changed, 19 insertions(+), 16 deletions(-) + +commit 62334b60a24c06a9e699c7b1dde56f52c30729f8 +Author: Alexander Couzens +Date: Tue Jul 10 16:03:10 2018 +0200 + + blacklist: remove OpenMoko Hubs from the blacklist + + The problem of full vendor blacklist are hubs. + Because ATTRS{} matches all devices in the tree, + a modem connected to a OpenMoko hub will be blacklisted as well. + + src/77-mm-usb-device-blacklist.rules | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f01d88bf914303257d420d66146ac10575805e83 +Author: Enrico Mioso +Date: Fri Jun 29 08:50:36 2018 +0200 + + libmm-glib: reference dup_equipment_identifier instead of dup_plugin + + Fix the comment. + + libmm-glib/mm-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 066c9c1e403a156e5d8da593cd0861646a7ae1d9 +Author: Aleksander Morgado +Date: Thu Jun 28 00:07:32 2018 +0200 + + libmm-glib,location-gps-raw: plug memleak + + ==8663== 1 bytes in 1 blocks are definitely lost in loss record + 5 of 4,864 + ==8663== at 0x4C2CEDF: malloc (vg_replace_malloc.c:299) + ==8663== by 0x669FAC9: g_malloc (in + /usr/lib/libglib-2.0.so.0.5600.1) + ==8663== by 0x66B9AEA: g_strndup (in + /usr/lib/libglib-2.0.so.0.5600.1) + ==8663== by 0x66ACE52: g_match_info_fetch (in + /usr/lib/libglib-2.0.so.0.5600.1) + ==8663== by 0x4E96DD2: mm_location_gps_raw_add_trace + (mm-location-gps-raw.c:208) + ==8663== by 0x18721E: mm_iface_modem_location_gps_update + (mm-iface-modem-location.c:264) + ==8663== by 0x1B9C7F: loc_location_nmea_indication_cb + (mm-shared-qmi.c:712) + ==8663== by 0x640C9E7: g_cclosure_marshal_VOID__BOXEDv (in + /usr/lib/libgobject-2.0.so.0.5600.1) + ==8663== by 0x6409C95: ??? (in + /usr/lib/libgobject-2.0.so.0.5600.1) + ==8663== by 0x64259E8: g_signal_emit_valist (in + /usr/lib/libgobject-2.0.so.0.5600.1) + ==8663== by 0x642612F: g_signal_emit (in + /usr/lib/libgobject-2.0.so.0.5600.1) + ==8663== by 0x54AAB2D: process_indication (qmi-loc.c:7454) + + Reported by: Thomas Weißschuh + + libmm-glib/mm-location-gps-raw.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 746cf54b112b223b9712453fe9b154c04acb8c4b +Author: Aleksander Morgado +Date: Tue Jun 26 16:36:11 2018 +0200 + + broadband-modem-qmi: fix segfault due to NULL task context + + ModemManager[18223]: [1530023432.028473] Modem has 3GPP + capabilities, enabling the Modem 3GPP interface... + + Thread 1 "ModemManager" received signal SIGSEGV, Segmentation + fault. + 0x0000555555618baa in + common_enable_disable_unsolicited_events_signal_strength + (task=0x5555558e4440) at mm-broadband-modem-qmi.c:6545 + 6545 if (ctx->enable) + (gdb) bt + #0 0x0000555555618baa in + common_enable_disable_unsolicited_events_signal_strength + (task=0x5555558e4440) at mm-broadband-modem-qmi.c:6545 + #1 0x0000555555618d70 in common_enable_disable_unsolicited_events + (self=0x55555597a3f0, enable=1, callback=0x5555555c8c20 + , user_data=0x5555559779b0) + at mm-broadband-modem-qmi.c:6719 + #2 0x0000555555618e5b in modem_3gpp_enable_unsolicited_events + (self=0x55555597a3f0, callback=0x5555555c8c20 + , user_data=0x5555559779b0) + at mm-broadband-modem-qmi.c:6749 + #3 0x00005555555c9095 in interface_enabling_step + (task=0x5555559779b0) at mm-iface-modem-3gpp.c:1907 + #4 0x00005555555c8c0a in setup_unsolicited_events_ready + (self=0x55555597a3f0, res=0x5555558efad0, task=0x5555559779b0) + at mm-iface-modem-3gpp.c:1795 + #5 0x00007ffff681e204 in () at /usr/lib/libgio-2.0.so.0 + #6 0x00007ffff681e239 in () at /usr/lib/libgio-2.0.so.0 + #7 0x00007ffff62731d6 in g_main_context_dispatch () at + /usr/lib/libglib-2.0.so.0 + #8 0x00007ffff62735b1 in () at /usr/lib/libglib-2.0.so.0 + #9 0x00007ffff62738e2 in g_main_loop_run () at + /usr/lib/libglib-2.0.so.0 + #10 0x000055555559182c in main (argc=2, argv=0x7fffffffe4a8) + at main.c:181 + + Fixes: baefe53ab9c0ea0612d2bf7da64b6f6cf9753bcd + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bb9e9a92a325b955ee839565618f13a2a0bf4cf0 +Author: Brian, Sam +Date: Fri Jun 22 01:50:20 2018 +0000 + + port-serial: don't close tty file descriptor twice + + After the tty is opened, the fd is passed off to a GIOChannel which + manages it. When the serial port is closed with _close_internal(), + g_io_channel_shutdown() is called which then calls g_io_unix_close() + which + in turn close()s the fd. + _close_internal() performs a second explicit close() after the + g_io_channel_shutdown() which *in the best case scenario* will + fail with + EBADF. + This is a race condition that can result in other file descriptors + being + closed. + + This change avoids double closing the serial port fd -- the shutdown() + call + is removed in favour of the explicit close(). + + src/mm-port-serial.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit efd57e8d5b2e0ced4ab857d72af0e86ae0bbf3f8 +Author: Aleksander Morgado +Date: Tue Jun 19 18:01:50 2018 +0200 + + po: add Friulian translation + + From: Fabio Tomat + + https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/42 + + po/LINGUAS | 1 + + po/fur.po | 108 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 109 insertions(+) + +commit 105e321951e3303ddf0c9c1df83bc673c92eb7de +Author: Baruch Siach +Date: Fri Jun 15 06:30:17 2018 +0300 + + kerneldevice: fix build with musl libc + + musl libc does not implement the canonicalize_file_name() GNU + extension. + Use the POSIX standard realpath() instead. + + src/kerneldevice/mm-kernel-device-generic.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit cf3f3ffcd0da1ef5512bf4a2dce4e0e1861acbc7 +Author: Lubomir Rintel +Date: Thu Jan 25 17:23:14 2018 +0100 + + service: set User=root so that gio doesn't have to look into + /etc/passwd + + GVfs' libgvfsdbus.so GIo module, when automatically loaded, + attempts to + discover if there's a session D-Bus instance to use. It tries + real hard + to get the socket name it would use -- in absence of XDG_RUNTIME_DIR + it + decides to make it up with user's home directory. When HOME is unset + too, it just tries to figure it out by looking into /etc/passwd. Which + upsets SELinux that would better not see us looking into it. + + We trigger the load of the GIo modules, by using the GFile API + to access + the the ports in /dev. They're utterly uesless to us, but there + doesn't + seem to be a way to disable their load. Oh well. + + For now, let's just ensure HOME is set and the problematic path + in glib + is not taken. + + data/ModemManager.service.in | 1 + + 1 file changed, 1 insertion(+) + +commit 6169d3d14fdb10b3b2537ebfd29d7f2d10965b2a +Author: Aleksander Morgado +Date: Mon Jun 11 18:09:49 2018 +0200 + + iface-modem-voice: plug memleak when creating new incoming call + + The mm_call_list_add_call() takes a full reference to the call, so we + can unref the original one safely. + + src/mm-iface-modem-voice.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit a6101a85323fb366cc95fb6e16bd0d991de1e866 +Author: Aleksander Morgado +Date: Mon Jun 11 18:06:38 2018 +0200 + + call-list: coding style fixes + + src/mm-base-call.c | 2 +- + src/mm-base-call.h | 2 +- + src/mm-call-list.c | 110 + ++++++++++++++++++++++++++--------------------------- + src/mm-call-list.h | 34 ++++++++--------- + 4 files changed, 73 insertions(+), 75 deletions(-) + +commit 588d6144a7c1da461d70abad05f4c56fd6dc667f +Author: Aleksander Morgado +Date: Sun Jun 10 14:47:39 2018 +0200 + + doc: fix explanation of MM_CALL_STATE_RINGING_{IN|OUT} + + They were reversed; ringing in applies to incoming calls, ringing out + applies to outgoing calls. + + include/ModemManager-enums.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 91757f65da40054e6912c19b5984f12cac6809ab +Author: Aleksander Morgado +Date: Sat Jun 9 11:28:09 2018 +0200 + + introspection: minor indentation fixes in SMS interface + + introspection/org.freedesktop.ModemManager1.Sms.xml | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 1990d9e9820aeffd847d4f7998c06819748a7155 +Author: Ben Chan +Date: Fri Jun 1 22:16:14 2018 -0700 + + modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError + + Commit 2a97e39cdd in libmim ("libmbim-glib: add additional cause codes + to MbimNwError") added additional cause codes to MbimNwError. This + patch maps some of those MbimNwError to MMMobileEquipmentError. + + This patch requires libmbim >= 1.17.1 + + configure.ac | 2 +- + src/mm-modem-helpers-mbim.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 1 deletion(-) + +commit cf86b6ab98f829050abf197a32d94e10c4ab75a6 +Author: Ben Chan +Date: Tue May 1 18:21:13 2018 -0700 + + broadband-modem-qmi: replace ensure_qmi_client with GTask + implementation + + assure_qmi_client() was created to help migrating MMBroadbandModemQmi + code + to use GTask. Now that all MMBroadbandModemQmi code has been + migrated to + use GTask, this patch removes the old ensure_qmi_client() and rename + assure_qmi_client() as ensure_qmi_client(). + + src/mm-broadband-modem-qmi.c | 126 + ++++++++++++++++++------------------------- + 1 file changed, 51 insertions(+), 75 deletions(-) + +commit bf4af8b82ad852c1e4a0114f1764c44ff2af620a +Author: Ben Chan +Date: Tue May 1 18:19:06 2018 -0700 + + broadband-modem-qmi: port modem_cdma_{activate,activate_manual} + to use GTask + + src/mm-broadband-modem-qmi.c | 201 + ++++++++++++++++++++++--------------------- + 1 file changed, 105 insertions(+), 96 deletions(-) + +commit 856d931a7eebcec195a8795acaa8b8fd2c9fbf72 +Author: Ben Chan +Date: Tue May 1 17:50:26 2018 -0700 + + broadband-modem-qmi: port load_initial_sms_parts to use GTask + + src/mm-broadband-modem-qmi.c | 81 + ++++++++++++++++++++++++-------------------- + 1 file changed, 45 insertions(+), 36 deletions(-) + +commit 3cd9ae6321ce853ce3cbf23d02770d21d216472b +Author: Ben Chan +Date: Tue May 1 17:42:40 2018 -0700 + + broadband-modem-qmi: port messaging_set_default_storage to use GTask + + src/mm-broadband-modem-qmi.c | 28 ++++++++++------------------ + 1 file changed, 10 insertions(+), 18 deletions(-) + +commit 216fb6bbe81059c169ae599956d7c5d3a96307dc +Author: Ben Chan +Date: Tue May 1 14:57:03 2018 -0700 + + broadband-modem-qmi: port + messaging_{enable,disable}_unsolicited_events to use GTask + + src/mm-broadband-modem-qmi.c | 69 + +++++++++++++++++--------------------------- + 1 file changed, 26 insertions(+), 43 deletions(-) + +commit 52d0f9760bc0051972b0f50387394bbc1a87a767 +Author: Ben Chan +Date: Tue May 1 14:37:56 2018 -0700 + + broadband-modem-qmi: port location_load_supl_server to use GTask + + src/mm-broadband-modem-qmi.c | 43 + +++++++++++++++---------------------------- + 1 file changed, 15 insertions(+), 28 deletions(-) + +commit 6f44554b21a28acdeb6d971d57435c85b5a0429b +Author: Ben Chan +Date: Tue May 1 14:32:39 2018 -0700 + + broadband-modem-qmi: port location_set_supl_server to use GTask + + src/mm-broadband-modem-qmi.c | 29 ++++++++++------------------- + 1 file changed, 10 insertions(+), 19 deletions(-) + +commit 44c3cceb5ee5d6b43631fe1183d74cb8be0ea905 +Author: Ben Chan +Date: Tue May 1 14:02:56 2018 -0700 + + broadband-modem-qmi: port disable_location_gathering to use GTask + + src/mm-broadband-modem-qmi.c | 117 + +++++++++++++++++++++++-------------------- + 1 file changed, 62 insertions(+), 55 deletions(-) + +commit 84a3ea766136104aec981b658058feb249ca9313 +Author: Ben Chan +Date: Tue May 1 13:09:20 2018 -0700 + + broadband-modem-qmi: port firmware_change_current to use GTask + + src/mm-broadband-modem-qmi.c | 94 + +++++++++++++++++++++----------------------- + 1 file changed, 45 insertions(+), 49 deletions(-) + +commit 65767c1c884f274dca825ce9294a18ec7001873f +Author: Ben Chan +Date: Sat Apr 28 16:20:19 2018 -0700 + + broadband-modem-qmi: port firmware_check_support to use GTask + + src/mm-broadband-modem-qmi.c | 82 + ++++++++++++++++++++++++-------------------- + 1 file changed, 45 insertions(+), 37 deletions(-) + +commit f933b967bedbdeb1ddf38f42c748c6a2cb73ac24 +Author: Ben Chan +Date: Sat Apr 28 16:12:38 2018 -0700 + + broadband-modem-qmi: port common_enable_disable_oma_unsolicited_events + to use GTask + + src/mm-broadband-modem-qmi.c | 53 + +++++++++++++++++--------------------------- + 1 file changed, 20 insertions(+), 33 deletions(-) + +commit fe46d2c7db6849eee045abcb9743afa61fb61c6f +Author: Ben Chan +Date: Sat Apr 28 15:58:55 2018 -0700 + + broadband-modem-qmi: port common_setup_cleanup_oma_unsolicited_events + to use GTask + + src/mm-broadband-modem-qmi.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +commit 456a09c6551f21a92441fcd69a48718a08f1324c +Author: Ben Chan +Date: Sat Apr 28 15:52:52 2018 -0700 + + broadband-modem-qmi: port oma_cancel_session to use GTask + + src/mm-broadband-modem-qmi.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit ce7b3a7bb0911bc51472df3302be64365939ab48 +Author: Ben Chan +Date: Sat Apr 28 16:04:02 2018 -0700 + + broadband-modem-qmi: port oma_start_client_initiated_session to + use GTask + + src/mm-broadband-modem-qmi.c | 29 ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit 311859d60f61ff157f1c6e25d31d618cef3868ed +Author: Ben Chan +Date: Sat Apr 28 15:55:05 2018 -0700 + + broadband-modem-qmi: port oma_accept_network_initiated_session to + use GTask + + src/mm-broadband-modem-qmi.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +commit 76bdaaba3e0d6e058d0d84b2c61e5581d3c143c1 +Author: Ben Chan +Date: Sat Apr 28 16:01:39 2018 -0700 + + broadband-modem-qmi: port oma_load_features to use GTask + + src/mm-broadband-modem-qmi.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit f330ffdaa993880260ed8c2d48eac5fee5dba11a +Author: Ben Chan +Date: Sat Apr 28 16:07:48 2018 -0700 + + broadband-modem-qmi: port oma_setup to use GTask + + src/mm-broadband-modem-qmi.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit 3455b01b573d51d0cba9cd4c5221bd3b597b9589 +Author: Ben Chan +Date: Tue May 1 14:25:03 2018 -0700 + + broadband-modem-qmi: port modem_cdma_load_activation_state to + use GTask + + src/mm-broadband-modem-qmi.c | 60 + +++++++++++++------------------------------- + 1 file changed, 18 insertions(+), 42 deletions(-) + +commit e09e4692dcbc4a298457b1a8e92fa8db61a863ef +Author: Ben Chan +Date: Tue May 1 14:18:02 2018 -0700 + + broadband-modem-qmi: port modem_cdma_run_registration_checks to + use GTask + + src/mm-broadband-modem-qmi.c | 53 + +++++++++++++------------------------------- + 1 file changed, 15 insertions(+), 38 deletions(-) + +commit d73f431987f6c715d6e8993988dc254458d4111d +Author: Ben Chan +Date: Tue May 1 14:13:01 2018 -0700 + + broadband-modem-qmi: port + modem_3gpp_{enable,disable}_unsolicited_registration_events to + use GTask + + src/mm-broadband-modem-qmi.c | 116 + +++++++++++++++++++++++-------------------- + 1 file changed, 61 insertions(+), 55 deletions(-) + +commit 478232dc05a4aa6404f82924a316440eaba44d03 +Author: Ben Chan +Date: Tue May 1 13:46:40 2018 -0700 + + broadband-modem-qmi: port modem_3gpp_run_registration_checks to + use GTask + + src/mm-broadband-modem-qmi.c | 76 + +++++++++++++++++--------------------------- + 1 file changed, 30 insertions(+), 46 deletions(-) + +commit b6de1ad22ef6ca341aeddd76b1a2ab1369d9d35a +Author: Ben Chan +Date: Tue May 1 13:39:27 2018 -0700 + + broadband-modem-qmi: port modem_3gpp_register_in_network to use GTask + + src/mm-broadband-modem-qmi.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +commit a3123cadd8188aba0b490c5d88d3d110a9089067 +Author: Ben Chan +Date: Sat Apr 28 15:49:43 2018 -0700 + + broadband-modem-qmi: port modem_3gpp_scan_networks to use GTask + + src/mm-broadband-modem-qmi.c | 29 ++++++++--------------------- + 1 file changed, 8 insertions(+), 21 deletions(-) + +commit f3b2deaddac8ef628fc6d7d82ee3a5aeded7fbe9 +Author: Ben Chan +Date: Tue May 1 12:46:48 2018 -0700 + + broadband-modem-qmi: port modem_3gpp_load_enabled_facility_locks to + use GTask + + src/mm-broadband-modem-qmi.c | 69 + +++++++++++++++++++++++++------------------- + 1 file changed, 39 insertions(+), 30 deletions(-) + +commit 8ad01d31accf4446c49a7edd5f1e2ca14ff37374 +Author: Ben Chan +Date: Tue May 1 17:40:14 2018 -0700 + + broadband-modem-qmi: port + common_setup_cleanup_unsolicited_registration_events to use GTask + + src/mm-broadband-modem-qmi.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +commit df0d2f955255fd7249efb68165b6e208768337af +Author: Ben Chan +Date: Tue May 1 17:35:13 2018 -0700 + + broadband-modem-qmi: port + common_setup_cleanup_messaging_unsolicited_events to use GTask + + src/mm-broadband-modem-qmi.c | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +commit 85eb5bdcbdc6bc6df1ea20b1e4e553f51fa6db73 +Author: Ben Chan +Date: Tue May 1 16:47:05 2018 -0700 + + broadband-modem-qmi: port common_setup_cleanup_unsolicited_events + to use GTask + + src/mm-broadband-modem-qmi.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +commit baefe53ab9c0ea0612d2bf7da64b6f6cf9753bcd +Author: Ben Chan +Date: Tue May 1 16:38:29 2018 -0700 + + broadband-modem-qmi: port common_enable_disable_unsolicited_events + to use GTask + + src/mm-broadband-modem-qmi.c | 82 + ++++++++++++++++++++++++-------------------- + 1 file changed, 45 insertions(+), 37 deletions(-) + +commit c0669e98ae012b7f7d6dbf06bf8c3651f8c2afdf +Author: Ben Chan +Date: Thu Apr 26 18:37:27 2018 -0700 + + broadband-modem-qmi: port set_current_capabilities to use GTask + + src/mm-broadband-modem-qmi.c | 105 + +++++++++++++++++++++++-------------------- + 1 file changed, 56 insertions(+), 49 deletions(-) + +commit bdc3729cbadf1a704ecacf8d8cb71fc8210fa607 +Author: Ben Chan +Date: Sat Apr 28 11:13:49 2018 -0700 + + broadband-modem-qmi: port set_current_bands to use GTask + + src/mm-broadband-modem-qmi.c | 35 +++++++++++++++-------------------- + 1 file changed, 15 insertions(+), 20 deletions(-) + +commit 4a53e7cc39295a3bcfd454d30e360e70147045e1 +Author: Ben Chan +Date: Tue May 1 12:41:22 2018 -0700 + + broadband-modem-qmi: port set_current_modes to use GTask + + src/mm-broadband-modem-qmi.c | 111 + ++++++++++++++++++++++--------------------- + 1 file changed, 58 insertions(+), 53 deletions(-) + +commit 7d8f0600e6de32721112949b65d48108ea640b51 +Author: Ben Chan +Date: Thu Apr 26 18:03:30 2018 -0700 + + broadband-modem-qmi: port signal_load_values to use GTask + + src/mm-broadband-modem-qmi.c | 70 + +++++++++++++++++++++++--------------------- + 1 file changed, 36 insertions(+), 34 deletions(-) + +commit 8047f54083371288c4dcf6a089d667fb2d2964d6 +Author: Ben Chan +Date: Sat Apr 28 15:25:49 2018 -0700 + + broadband-modem-qmi: port load_power_state to use GTask + + src/mm-broadband-modem-qmi.c | 48 + +++++++++++++++++++++----------------------- + 1 file changed, 23 insertions(+), 25 deletions(-) + +commit 0502fe042be105f4ed8cec211622ac3c7301625f +Author: Ben Chan +Date: Sat Apr 28 11:28:33 2018 -0700 + + broadband-modem-qmi: port load_signal_quality to use GTask + + src/mm-broadband-modem-qmi.c | 118 + ++++++++++++++++++------------------------- + 1 file changed, 50 insertions(+), 68 deletions(-) + +commit 77a875a1b0c8fef5c67a5832dcf97112ca4a42d8 +Author: Ben Chan +Date: Sat Apr 28 15:39:27 2018 -0700 + + broadband-modem-qmi: port load_current_modes to use GTask + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++---------------------- + 1 file changed, 39 insertions(+), 39 deletions(-) + +commit 51ede979bf3fd989698b044cd6c4514168fa9f96 +Author: Ben Chan +Date: Sat Apr 28 11:21:28 2018 -0700 + + broadband-modem-qmi: port modem_load_equipment_identifier to use GTask + + src/mm-broadband-modem-qmi.c | 83 + ++++++++++++++------------------------------ + 1 file changed, 26 insertions(+), 57 deletions(-) + +commit 6b14a1cf1be373b8e95151775b8e0ed1cddb1ec1 +Author: Ben Chan +Date: Sat Apr 28 11:10:37 2018 -0700 + + broadband-modem-qmi: port modem_load_current_bands to use GTask + + src/mm-broadband-modem-qmi.c | 61 + +++++++++++++++++--------------------------- + 1 file changed, 24 insertions(+), 37 deletions(-) + +commit 834674b21c8c63ae2d50a432d39bee9f190aebe9 +Author: Ben Chan +Date: Fri Apr 27 11:03:30 2018 -0700 + + broadband-modem-qmi: port modem_load_supported_bands to use GTask + + src/mm-broadband-modem-qmi.c | 52 + ++++++++++++++++++-------------------------- + 1 file changed, 21 insertions(+), 31 deletions(-) + +commit 59c8ba86428b89986464d6bad942b448b012127c +Author: Ben Chan +Date: Fri Apr 27 10:57:25 2018 -0700 + + broadband-modem-qmi: port modem_load_own_numbers to use GTask + + src/mm-broadband-modem-qmi.c | 36 +++++++++++------------------------- + 1 file changed, 11 insertions(+), 25 deletions(-) + +commit 4dc56525205d0940c5eaff2a4e317739ce97a0a9 +Author: Ben Chan +Date: Fri Apr 27 10:48:33 2018 -0700 + + broadband-modem-qmi: port modem_load_hardware_revision to use GTask + + src/mm-broadband-modem-qmi.c | 32 ++++++++------------------------ + 1 file changed, 8 insertions(+), 24 deletions(-) + +commit 2f8a041122a8f3e30f2be619cc6444c95343ab12 +Author: Ben Chan +Date: Fri Apr 27 10:46:34 2018 -0700 + + broadband-modem-qmi: port modem_load_revision to use GTask + + src/mm-broadband-modem-qmi.c | 32 ++++++++------------------------ + 1 file changed, 8 insertions(+), 24 deletions(-) + +commit 3c1706563620492bca10cf2f3263b966108ff04d +Author: Ben Chan +Date: Thu Apr 26 18:47:05 2018 -0700 + + broadband-modem-qmi: port modem_load_model to use GTask + + src/mm-broadband-modem-qmi.c | 32 ++++++++------------------------ + 1 file changed, 8 insertions(+), 24 deletions(-) + +commit 0bf2800d054a602fd5e67e969b1ab7a82ce472e9 +Author: Ben Chan +Date: Thu Apr 26 18:42:23 2018 -0700 + + broadband-modem-qmi: port modem_load_manufacturer to use GTask + + src/mm-broadband-modem-qmi.c | 32 ++++++++------------------------ + 1 file changed, 8 insertions(+), 24 deletions(-) + +commit dba870295229e55ec0971cfc66d5f0c437e50f36 +Author: Ben Chan +Date: Thu Apr 26 18:22:24 2018 -0700 + + broadband-modem-qmi: port modem_load_supported_capabilities to + use GTask + + src/mm-broadband-modem-qmi.c | 54 + +++++++++++++------------------------------- + 1 file changed, 16 insertions(+), 38 deletions(-) + +commit 3e374e228a5daa62129b1fd032b41104f3acce23 +Author: Ben Chan +Date: Thu Apr 26 18:14:28 2018 -0700 + + broadband-modem-qmi: port modem_load_current_capabilities to use GTask + + src/mm-broadband-modem-qmi.c | 79 + +++++++++++++++++++++++--------------------- + 1 file changed, 42 insertions(+), 37 deletions(-) + +commit 31c0da2825a090f8359f0955af0478d4456da021 +Author: Ben Chan +Date: Sat Apr 28 15:22:19 2018 -0700 + + broadband-modem-qmi: port common_power_up_down_off to use GTask + + src/mm-broadband-modem-qmi.c | 68 + ++++++++++++++++++++++++-------------------- + 1 file changed, 37 insertions(+), 31 deletions(-) + +commit 71d21cba02664db47c03f86ffd1d14ef39b479bd +Author: Ben Chan +Date: Thu Apr 26 18:07:26 2018 -0700 + + broadband-modem-qmi: port power_cycle to use GTask + + src/mm-broadband-modem-qmi.c | 36 +++++++++++++++--------------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit f52264d78adf9bac7b46f471d818a8423e0e4a14 +Author: Ben Chan +Date: Sat Apr 28 15:27:31 2018 -0700 + + broadband-modem-qmi: port modem_reset to use GTask + + src/mm-broadband-modem-qmi.c | 20 ++++++-------------- + 1 file changed, 6 insertions(+), 14 deletions(-) + +commit 15ffa69d72cafab8d129bd375c70c1693d3c1d26 +Author: Ben Chan +Date: Sat Apr 28 15:32:49 2018 -0700 + + broadband-modem-qmi: port modem_factory_reset to use GTask + + src/mm-broadband-modem-qmi.c | 32 +++++++++++++------------------- + 1 file changed, 13 insertions(+), 19 deletions(-) + +commit 641e1b8a43c253c0df94e1ecfbfb13e0e4af2513 +Author: Ben Chan +Date: Thu Apr 26 17:37:55 2018 -0700 + + broadband-modem-qmi: add a temporary assure_qmi_client() helper + + ensure_qmi_client() uses g_simple_async_report_take_gerror_in_idle(), + which can't be mixed with GTask. To allow migrating remaining + MMBroadbandModemQmi code to use GTask in a series of smaller patches, + this patch adds a temporary assure_qmi_client() helper, which mimics + ensure_qmi_client() but uses g_task_report_new_error(). Once all the + MMBroadbandModemQmi code is migrated to use GTask, we will drop + the old + ensure_qmi_client() and renames assure_qmi_client() back to + ensure_qmi_client(). + + src/mm-broadband-modem-qmi.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 0e770b13f8967d19f29784f72698f405f85c4d15 +Author: Aleksander Morgado +Date: Mon Apr 30 13:11:39 2018 +0200 + + base-modem: setup a maximum number of timeouts also for USB modems + + We have a maximum number of timeouts that could be enabled for TTY + modems, e.g. to detect whether the modem is available in the RS232 + port or has been unplugged. This was required because RS232 modems + aren't notified via udev, so there was no other way to check presence + of the modem. + + But, the same kind of checks may be used in order to detect failed + broken modems. If we have a modem that gets into an unstable state + where no AT port command goes through and all get timed out, we can + definitely flag the modem as invalid and get rid of it. If we don't do + this, we would end up leaving the modem exposed and available for + users of the API, but in a non-working state. + + .... + Modem /org/freedesktop/ModemManager1/Modem/0: state + changed (registered -> connecting) + Launching 3GPP connection attempt with APN 'telefonica.es' + Looking for best CID... + (ttyACM2) device open count is 2 (open) + (ttyACM2): --> 'AT+CGDCONT?' + Unexpected +CGDCONT? error: 'Serial command timed out' + (tty/ttyACM2) at port timed out 9 consecutive times + Using empty CID 1 with PDP type 'ipv4' + (ttyACM2) device open count is 3 (open) + (ttyACM2) device open count is 2 (close) + (ttyACM2): --> 'AT+CGDCONT=1,"IP","telefonica.es"' + Couldn't initialize PDP context with our APN: 'Serial + command timed out' + Couldn't connect bearer + '/org/freedesktop/ModemManager1/Bearer/0': 'Serial command + timed out' + Modem /org/freedesktop/ModemManager1/Modem/0: state + changed (connecting -> registered) + Couldn't connect bearer: 'Serial command timed out' + (ttyACM2) device open count is 1 (close) + (tty/ttyACM2) at port timed out 10 consecutive times, + marking modem '/org/freedesktop/ModemManager1/Modem/0' as invalid + Removing from DBus bearer at + '/org/freedesktop/ModemManager1/Bearer/0' + [device + /sys/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.5] unexported + modem from path '/org/freedesktop/ModemManager1/Modem/0' + Periodic signal checks disabled + (ttyACM2) device open count is 0 (close) + (ttyACM2) closing serial port... + (ttyACM2) serial port closed + (ttyACM2) forced to close port + Modem (u-blox) + '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.5' completely + disposed + + src/mm-base-modem.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit b4748ba674d014e639df83583d2e3544aabbafdf +Author: Aleksander Morgado +Date: Sat Jun 2 17:46:48 2018 +0200 + + build: post release version bump to 1.9.0 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c187c5fef5e3ffa456b73367afb8d3c888599437 +Author: Aleksander Morgado +Date: Sat Jun 2 16:59:17 2018 +0200 + + release: bump version to 1.8.0 + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 01a5d8a294c1022c99e5e82ab96460f630c6a420 +Author: Aleksander Morgado +Date: Sat Jun 2 17:30:53 2018 +0200 + + NEWS: update for 1.8 + + NEWS | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit c07382a486f53e1b3cf729b41518d2a0ba528f5a +Author: Aleksander Morgado +Date: Sun May 27 16:39:17 2018 +0200 + + udev: add tags also on bind action + + When a new USB device is hotplugged, e.g. a USB<->RS232 converter that + exposes a single ttyUSB0, these udev events happen: + + add /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device) + add /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 + (usb/usb-interface) + add /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 + (usb-serial) + add + /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0 + (tty) + bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 + (usb-serial) + bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 + (usb/usb-interface) + bind /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device) + + Our udev rules in MM only added tags in the 'add' events, and it looks + like the only ones 'persistent' after this sequence are those of the + last event happening on the specific path. + + This meant that all TTY subsystem rules (e.g. ID_MM_CANDIDATE) would + be stored for later check (e.g. if ModemManager is started after these + rules have been applied), which was ok. "udevadm info -p ..." would + show these tags correctly always. + + But this also meant that the 'bind' udev event happening for the USB + device didn't get any of our device-specific tags, and so we would be + missing them (e.g. ID_MM_DEVICE_MANUAL_SCAN_ONLY) if MM is started + after the last event has happened. "udevadm info -p ..." would + not show these tags. + + Modify all our rules to also run at the 'bind' events. + + See, for context: + https://github.com/systemd/systemd/issues/8221 + + plugins/cinterion/77-mm-cinterion-port-types.rules | 2 +- + plugins/dell/77-mm-dell-port-types.rules | 2 +- + plugins/haier/77-mm-haier-port-types.rules | 2 +- + plugins/huawei/77-mm-huawei-net-port-types.rules | 2 +- + plugins/longcheer/77-mm-longcheer-port-types.rules | 2 +- + plugins/mbm/77-mm-ericsson-mbm.rules | 2 +- + plugins/mtk/77-mm-mtk-port-types.rules | 2 +- + plugins/nokia/77-mm-nokia-port-types.rules | 2 +- + plugins/sierra/77-mm-sierra.rules | 2 +- + plugins/simtech/77-mm-simtech-port-types.rules | 2 +- + plugins/telit/77-mm-telit-port-types.rules | 2 +- + plugins/ublox/77-mm-ublox-port-types.rules | 2 +- + plugins/x22x/77-mm-x22x-port-types.rules | 2 +- + plugins/zte/77-mm-zte-port-types.rules | 2 +- + src/77-mm-pcmcia-device-blacklist.rules | 2 +- + src/77-mm-usb-device-blacklist.rules | 2 +- + src/77-mm-usb-serial-adapters-greylist.rules | 2 +- + src/80-mm-candidate.rules | 2 +- + 18 files changed, 18 insertions(+), 18 deletions(-) + +commit 4bc7d6862d3b908476e8bddd70cfc9e571dc9622 +Author: Aleksander Morgado +Date: Sat Jun 2 16:48:07 2018 +0200 + + u-blox: wait 20s before probing TOBY-L200 ports + + https://bugs.freedesktop.org/show_bug.cgi?id=106623 + + plugins/ublox/77-mm-ublox-port-types.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 6c37488d4ebbbb2afdefce193e6fb4070cde8ab3 +Author: Aleksander Morgado +Date: Sun May 27 11:23:54 2018 +0200 + + broadband-modem-mbim: minor function renames for SMS read logic + + There are two ways to report new received SMS messages: + * For class 0 (flash) messages, MBIM_CID_SMS_READ are sent. The SMS + comes in the MBIM indication itself. + * For non-class 0 (standard) messages, a + MBIM_CID_SMS_MESSAGE_STORE_STATUS notifications are sent, the SMS is + stored and must be read with an additional MBIM request specifying + storage index. + + The names of the functions we had implied the opposite, we were + assuming flash/alert messages were reported via + MBIM_CID_SMS_MESSAGE_STORE_STATUS, not via MBIM_CID_SMS_READ. + + src/mm-broadband-modem-mbim.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit fd3a4d8d8beecc8b58cd6602cc8ee7207c1bf268 +Author: Aleksander Morgado +Date: Tue May 22 12:31:04 2018 +0200 + + filter: pci and sdio ports under the platform driver filter + + Do not automatically probe serial ports under the 'pci' or 'sdio' + platform drivers unless explicitly tagged with + ID_MM_PLATFORM_DRIVER_PROBE. + + $ realpath /sys/class/tty/ttyS0/ + /sys/devices/pci0000:00/0000:00:16.3/tty/ttyS0 + $ basename $(realpath + /sys/devices/pci0000:00/0000:00:16.3/subsystem) + pci + + src/mm-filter.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 38f9510a9893b12cd6746c3daeeb2c84166746b1 +Author: Aleksander Morgado +Date: Tue May 15 11:27:42 2018 +0200 + + iface-modem-time: don't hold a ref while waiting to be registered + + The logic implementing the network timezone loading was holding a + strong reference to the modem (inside the GTask) while waiting to + be registered. + + This was triggering some possible memory leaks as the modem object + could have been left around even after the modem was disconnected. + E.g. if the modem booted without antennas plugged in, it was never + getting registered, and if we unplugged it right away in that state, + the network timezone logic would have left a modem reference around + without disposing it. + + This issue, combined with e.g. other interfaces relying on disposing + its own logic with the last object reference (e.g. Signal interface + sets up its logic in a context bound to the lifetime of the object) + would mean that a lot of different logic blocks were kept running even + after the modem device was unplugged from the system. + + We avoid this issue by making sure that no new additional reference is + taken by the logic in charge of updating the network timezone. We just + make the timezone update context be bound to the lifetime of the + object, as other interfaces do. + + While doing this, we also remove the logic in charge of "cancelling" + the context, as it isn't needed. If the logic needs to be cancelled, + we would just remove any configured timeout, which is enough. + + As part of the changes, the logic has also been improved so that the + network timezone isn't only updated the first time the modem gets + registered. If the modem gets unregistered and re-registered, we would + reload the network timezone information. + + src/mm-iface-modem-time.c | 334 + +++++++++++++++++----------------------------- + 1 file changed, 122 insertions(+), 212 deletions(-) + +commit 67ecad51e163b131a1331ffcb09af18269c39025 +Author: Dan Williams +Date: Thu May 24 09:54:42 2018 -0500 + + filter: add 'nozomi' and 'qcaux' drivers to MM_FILTER_RULE_TTY_DRIVER + + nozomi and qcaux only drive modems and thus should be included + in this filter rule. Allows nozomi/qcaux devices to work + automatically with strict filter mode. + + src/mm-filter.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit aecc3e99a029d037245d85f0e734aa997d2b06fd +Author: Dan Williams +Date: Thu May 24 09:59:47 2018 -0500 + + include: fix up whitespace + + include/ModemManager-errors.h | 160 + +++++++++++++++++++++--------------------- + 1 file changed, 80 insertions(+), 80 deletions(-) + +commit b074a2b4a421b9a468a59896c94f701456bb85d4 +Author: Dan Williams +Date: Tue May 22 12:01:30 2018 -0500 + + include: add more 3GPP errors + + From 3GPP TS 27.007 version 11.6.0 Release 11, sections 9.2.1, + 9.2.2.1, 9.2.2.2, and 9.2.2.3. + + include/ModemManager-errors.h | 50 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +commit ac5d068e377352c208b792229fe4ab96a239b4b3 +Author: Matthew Stanger +Date: Sun May 20 08:44:09 2018 +0200 + + broadband-modem: increase signal_quality_cind() poll CIND timeout + + Gemalto's PLS8 may timeout on 3 second CIND query. Debug log shows + 5 seconds should suffice. + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 051b15cca89670d943459f734e20117ca1b8afcf +Author: Ben Chan +Date: Wed May 16 12:45:57 2018 -0700 + + iface-modem-3gpp: ignore initial registration check result when + enabling + + This patch extends commit c9e85b671 ("iface-modem-3gpp: ignore initial + registration check result when appropriate") to handle the situation + where a registration check update may prematurely transition the modem + to the 'enabled' state while the modem is still being enabled. + + The issue is identified by Dan Williams . More + details + can be found in https://bugs.freedesktop.org/show_bug.cgi?id=106468 + + src/mm-iface-modem-3gpp.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 3e469e7b8055a0a11abc8304ec44c3df39e74d3d +Author: Aleksander Morgado +Date: Tue May 8 09:49:11 2018 +0200 + + u-blox: don't run quick AT procedure if READY_DELAY not configured + + The quick AT probe procedure is only meaningful to avoid waiting the + +READY URC delay. If there is no such delay configured, we shouldn't + run the quick AT probe (as a failure in the AT probe may also + trigger a +READY URC delay). + + Just read the udev tag value early and complete the task if the delay + is not configured. + + plugins/ublox/mm-plugin-ublox.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit 1a56b97061252fa4605bd0b58de491bbe43a6685 +Author: Matthew Starr +Date: Mon May 7 22:26:48 2018 +0000 + + ublox: use ID_MM_UBLOX_PORT_READY_DELAY udev flag as init delay + + Added reading the ID_MM_UBLOX_PORT_READY_DELAY udev flag value + and using + it as an init delay when a value is set. + + The 20 second delay for the TOBY-L4 +READ URC has been reimplemented + using the new ID_MM_UBLOX_PORT_READY_DELAY udev value. + + plugins/ublox/77-mm-ublox-port-types.rules | 2 ++ + plugins/ublox/mm-plugin-ublox.c | 26 + ++++++++++++++++++++------ + 2 files changed, 22 insertions(+), 6 deletions(-) + +commit 6be6aa474f238f771579adbba800ab0408c7f0d9 +Author: Aleksander Morgado +Date: Mon May 7 18:27:26 2018 +0200 + + filter: fix option1 driver name + + This was preventing TTY-only ZTE and Huawei modules from being grabbed + in STRICT mode. + + https://bugs.freedesktop.org/show_bug.cgi?id=106253 + https://bugs.freedesktop.org/show_bug.cgi?id=106234 + + src/mm-filter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4895577597f6cadb9c791ef0483a95ba85aa27f5 +Author: Matthew Starr +Date: Tue Apr 10 17:30:32 2018 +0000 + + u-blox: ignore non-AT ttyACM interfaces + + For the TOBY-R2, LISA-R2, and LARA-R2, the only valid AT ports are + ttyACM0, ttyACM1, and ttyACM2. All other ttyACM ports cause MM to + wait 20-30 seconds probing the port on startup. + + Ignoring the non-AT ttyACM ports allows MM to not wait 20-30 seconds + probing and therefore startup much faster with these modems. + + plugins/ublox/77-mm-ublox-port-types.rules | 35 + ++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +commit e17d5a51a24248d53ea5da8d16d86f2ca187a566 +Author: Aleksander Morgado +Date: Sat Apr 28 10:38:53 2018 +0200 + + broadband-bearer: allow matching empty APN when looking for PDP CID + + The PDP contexts that are found with an empty APN configured are right + now used as placeholders that can be overwritten with the user + provided APN if no direct match is found. + + We want to keep that logic in place, but for the case where we do get + an empty APN requested by the user, we need to perform the full + context match, so that the first PDP context matching the empty APN is + used. + + Right now we're overwriting with the empty APN again the last PDP + context found with an empty APN, which doesn't make much sense: + + Apr 27 08:15:21 ModemManager[4251]: Found '3' PDP contexts + Apr 27 08:15:21 ModemManager[4251]: PDP context [cid=1] + [type='ipv4'] [apn=''] + Apr 27 08:15:21 ModemManager[4251]: PDP context [cid=2] + [type='ipv4'] [apn='broadband'] + Apr 27 08:15:21 ModemManager[4251]: PDP context [cid=15] + [type='ipv4'] [apn=''] + Apr 27 08:15:21 ModemManager[4251]: Found PDP context + with CID 1 and no APN + Apr 27 08:15:21 ModemManager[4251]: Found PDP context + with CID 15 and no APN + Apr 27 08:15:21 ModemManager[4251]: (ttyUSB3) device + open count is 3 (open) + Apr 27 08:15:21 ModemManager[4251]: (ttyUSB3) device + open count is 2 (close) + Apr 27 08:15:21 ModemManager[4251]: (ttyUSB3): --> + 'AT+CGDCONT=15,"IP",""' + Apr 27 08:15:21 ModemManager[4251]: (ttyUSB3): <-- + 'OK' + + src/mm-broadband-bearer.c | 37 +++++++++++++++++++------------------ + src/mm-modem-helpers.c | 4 ++++ + src/tests/test-modem-helpers.c | 7 ++++++- + 3 files changed, 29 insertions(+), 19 deletions(-) + +commit 43d0bd0f9135512a0531b5808354e00db9d6f22a +Author: Aleksander Morgado +Date: Mon Apr 30 12:57:50 2018 +0200 + + base-modem: improve broken modem detection logic + + If the serial port timeout detection logic is enabled, warn whenever + more than one consecutive command timeout happens, not just when the + limit is reached. + + src/mm-base-modem.c | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +commit 21c9a239ecc56d941032630649ca6149296bf98d +Author: Ben Chan +Date: Sat Apr 28 11:51:28 2018 -0700 + + broadband-modem-qmi: fix memory leak in dms_set_operating_mode_ready + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f9a0b945bcc0b374a122e6cdd4ac6ce92066c7c8 +Author: Ben Chan +Date: Tue Apr 24 17:18:56 2018 -0700 + + iface-modem: allow initial signal check after the modem is re-enabled + + Commit 708b00ae3 "modem: allow periodic signal check to be disabled" + added a "iface-modem-periodic-signal-check-disabled" property in + MMIfaceModem/MMBroadbandModem to indicate if the periodic signal check + should be disabled. If the property is set to TRUE, the + signal_quality_polling_supported field of SignalCheckContext is set to + FALSE, which is sticky across modem disable/enable + operations. However, + that is undesirable as we would like to issue an initial signal + check to + refresh the signal quality value after the modem is re-enabled from a + state when the RF may have been previously turned off. + + src/mm-iface-modem.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +commit 5e5160c46ad426233123287c0505253e4ea3ff35 +Author: Ben Chan +Date: Mon Apr 23 16:24:42 2018 -0700 + + broadband-modem-mbim: implement initial signal quality loading + + ModemManager currently relies on unsolicited MBIM_CID_SIGNAL_STATE + notifications to obtain signal quality updates, and it doesn't + query the + initial signal quality. It's been observed that some MBIM modems + issue a + MBIM_CID_SIGNAL_STATE notification only when there is a notable change + in RSSI. The signal quality may remain at 0 for quite some time. It's + more noticeable when simply restarting ModemManager after the + modem has + been initialized and enabled once. + + We could simply enable periodic signal check on an MBIM modem, but + that's less ideal as it may unnecessarily wake the modem up from USB + selective suspend (unless we use a much longer polling period). + + To address the issue, this patch adds the implementation of + load_signal_quality to MMBroadbandModemMbim so that the signal quality + is initially polled via a solicited MBIM_CID_SIGNAL_STATE query. To + avoid the periodic signal check, we set the + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED property to TRUE for + MMBroadbandModemMbim. + + src/mm-broadband-modem-mbim.c | 80 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 78 insertions(+), 2 deletions(-) + +commit 708b00ae3be84e7927a2566b7ccbd9163698321e +Author: Ben Chan +Date: Mon Apr 23 16:24:41 2018 -0700 + + modem: allow periodic signal check to be disabled + + ModemManager decides to disable periodic signal check if either + load_signal_quality is not implemented or load_signal_quality + returns an + unsupported error. However, in some cases, we want to use + load_signal_quality to query the initial signal quality but rely on + unsolicited signal quality updates from the modem afterwards without + periodically polling for signal quality. To support that, this patch + introduces a property in MMIfaceModem/MMBroadbandModem to indicate if + the periodic signal check should be disabled. + + src/mm-broadband-modem.c | 14 ++++++++++++++ + src/mm-iface-modem.c | 47 + +++++++++++++++++++++++++++++++++-------------- + src/mm-iface-modem.h | 1 + + 3 files changed, 48 insertions(+), 14 deletions(-) + +commit b39dd2ec05c7db7e5eb12953eadba809aa2b3e8a +Author: Lubomir Rintel +Date: Tue Apr 24 09:42:06 2018 +0200 + + all: drop unused variables + + Keeps build with GCC 8 happy. + + mm-base-call.c:758:18: warning: variable 'response' set but not used + [-Wunused-but-set-variable] + mm-base-call.c:822:18: warning: variable 'response' set but not used + [-Wunused-but-set-variable] + mm-base-sms.c:908:18: warning: variable 'response' set but not used + [-Wunused-but-set-variable] + mm-sms-list.c:331:25: warning: variable 'ctx' set but not used + [-Wunused-but-set-variable] + mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' + set but not used [-Wunused-but-set-variable] + huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' + set but not used [-Wunused-but-set-variable] + ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set + but not used [-Wunused-but-set-variable] + ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not + used [-Wunused-but-set-variable] + icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' + set but not used [-Wunused-but-set-variable] + novatel/mm-common-novatel.c:50:18: warning: variable 'response' + set but not used [-Wunused-but-set-variable] + + plugins/huawei/mm-plugin-huawei.c | 3 +-- + plugins/icera/mm-modem-helpers-icera.c | 4 ++-- + plugins/novatel/mm-common-novatel.c | 3 +-- + plugins/ublox/mm-plugin-ublox.c | 5 +---- + src/mm-base-call.c | 6 ++---- + src/mm-base-sms.c | 3 +-- + src/mm-iface-modem-messaging.c | 2 -- + src/mm-sms-list.c | 5 ----- + 8 files changed, 8 insertions(+), 23 deletions(-) + +commit 5072db3418ce5799a75a577612b30de97ca700f0 +Author: Iain Lane +Date: Tue Apr 24 12:31:44 2018 +0100 + + m4/compiler_warnings.m4: Let -Werror be disabled + + It's annoying for distributors to build with -Werror, since it means + that compiler upgrades can break the build. Let's let them disable it, + but keep it enabled by default. + + m4/compiler_warnings.m4 | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 7e94928301a971488ea53b17dd7d5ef37f468b1d +Author: Aleksander Morgado +Date: Tue Apr 3 00:31:02 2018 +0200 + + ublox: fix 'any' mode building + + The 'any' mode refers to the mode which includes most access + technologies and where none of them is preferred. + + Fix the logic so that all combinations with one technology preferred + over the others are ignored, instead of the other way around. + + Fixes assertion with the 4G-only LARA R204. + + ModemManager[424]: [-192499452.090358] (ttyACM0): --> + 'AT+URAT=?' + ModemManager[424]: [-192499452.092150] (ttyACM0): <-- + '+URAT: (3)OK' + ** + ERROR:ublox/mm-modem-helpers-ublox.c:817:mm_ublox_get_modem_mode_any: + assertion failed: (any != MM_MODEM_MODE_NONE) + + Reported-by: Matthew Starr + + plugins/ublox/mm-modem-helpers-ublox.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c9dee2b960d6176c1d5462c5db8cd55925eafc44 +Author: Aleksander Morgado +Date: Tue Mar 27 13:27:27 2018 +0200 + + build: bump version to 1.7.991 (1.8-rc2) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b451a838a4ad66b6d4e02dff7538ce7530188c6b +Author: Aleksander Morgado +Date: Tue Mar 13 13:33:28 2018 +0100 + + docs: add missing reference to + mm_modem_3gpp_get_eps_ue_mode_operation() + + docs/reference/libmm-glib/libmm-glib-sections.txt | 1 + + 1 file changed, 1 insertion(+) + +commit bcb0175f62bea60b06d971f3cfec87f5b362ee56 +Author: Aleksander Morgado +Date: Tue Mar 13 13:26:29 2018 +0100 + + docs: always rebuild libmm-glib types + + So that we don't forget to add new types here manually... + (e.g. MMBearerStats) + + .gitignore | 1 + + docs/reference/libmm-glib/Makefile.am | 2 +- + docs/reference/libmm-glib/libmm-glib.types | 132 + ----------------------------- + 3 files changed, 2 insertions(+), 133 deletions(-) + +commit c147dfc267bfe3e9a43ab8873e285f45e66b3528 +Author: Aleksander Morgado +Date: Tue Mar 13 13:07:10 2018 +0100 + + libmm-glib: use ModemManager prefix to refer to the introspected types + + libmm-glib/mm-modem-messaging.c | 2 +- + libmm-glib/mm-modem-voice.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 5dff6ce5944d2f97522ead0914f4814dd9a939a0 +Author: Aleksander Morgado +Date: Tue Mar 13 12:53:37 2018 +0100 + + libmm-glib,modem: fix introspection annotation for bearer list + + libmm-glib/mm-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit eb6b4cac8a752674a7b8359c713ecf5ae1a1f098 +Author: Aleksander Morgado +Date: Tue Mar 13 12:53:18 2018 +0100 + + libmm-glib: add several missing headers + + libmm-glib/libmm-glib.h | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 1481dd58e2fccbd005b63f866be2b910c4724ed3 +Author: Aleksander Morgado +Date: Tue Mar 13 12:41:47 2018 +0100 + + libmm-glib,bearer-properties: minor documentation typo fix + + libmm-glib/mm-bearer-properties.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9535f4c474a33c229f5761d7a6e67fd4253bbb57 +Author: Aleksander Morgado +Date: Tue Mar 13 12:25:43 2018 +0100 + + libmm-glib,bearer: cleanup stats related mutex and object + + libmm-glib/mm-bearer.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3a7d4b12005da1e5e861b8a213814c8743e5208f +Author: Aleksander Morgado +Date: Wed Feb 21 13:38:53 2018 +0100 + + ublox: ignore ttyACM0 in the TOBY-L4 + + We used ttyACM0 as secondary port until now, just because we had an + extra AT capable TTY around in addition to the main control ttyACM2 + port. + + Turns out, using this ttyACM0 may actually break the connection setup + in the wwan interface in a bad way (e.g. not allowing DHCP setup). + + The suggestion from u-blox and Intel is to fully ignore ttyACM0; and + given that we no longer need any primary/secondary port logic, we just + remove all the associated udev tags. + + plugins/ublox/77-mm-ublox-port-types.rules | 7 +++---- + plugins/ublox/mm-plugin-ublox.c | 29 + ----------------------------- + 2 files changed, 3 insertions(+), 33 deletions(-) + +commit c9a78e12b7d6ce4369f0de6c0c41c66e0110e9ee +Author: Aleksander Morgado +Date: Sun Mar 4 17:00:48 2018 +0100 + + po: add Indonesian translation + + From: Andika Triwidada + + https://bugs.freedesktop.org/show_bug.cgi?id=105337 + + po/LINGUAS | 1 + + po/id.po | 102 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 103 insertions(+) + +commit dc678bfef292728c9dfba2e9a9f27c555644c634 +Author: Aleksander Morgado +Date: Fri Feb 23 12:43:22 2018 +0100 + + base-manager: additional indentation for the block covered by + ref/unref + + src/mm-base-manager.c | 29 +++++++++++++++-------------- + 1 file changed, 15 insertions(+), 14 deletions(-) + +commit 402559bb62bb44aa146b1c170bb86812d6d514a9 +Author: Eric Caruso +Date: Wed Feb 21 13:49:34 2018 -0800 + + mm-base-manager: ref MMDevice before releasing port + + Releasing the port on the device looks benign but because it emits + a signal, it could call device_context_port_released and unref the + MMDevice in port_context_unref. This means the MMDevice might be + disposed before we get to the g_object_ref and the subsequent call + to g_hash_table_remove will try to hash a null string, which makes + MM crash. + + src/mm-base-manager.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit d416ea491d88b2b3bb4e5cd8077e0b758bcfad2e +Author: Eric Caruso +Date: Tue Feb 20 16:04:18 2018 -0800 + + mm-base-manager: remove element from hastable by key, not value + + The hashtable is keyed on the UID of the MMDevice, and its hash + function is g_str_hash. We shouldn't be passing a GObject into + g_hash_table_remove because calling g_str_hash on an MMDevice is + wrong. + + src/mm-base-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 10cb61f399b80c9db1b3b1b570214da164c469aa +Author: Alfonso Sánchez-Beato +Date: Tue Feb 13 10:38:49 2018 +0100 + + broadband-modem-qmi: update EPS registration state for LTE qmi modems + + MM was not updating the EPS registration status for qmi modems. This + led to LTE-only modems never having 'registered' status. This was + happening for Quectel EC21-V modem. + + src/mm-broadband-modem-qmi.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +commit dce07527433aad328f2bb3c2bddaab0c91fbc6c1 +Author: Dan Williams +Date: Tue Feb 6 09:47:17 2018 -0600 + + iface-modem-3gpp: don't force auto registration if already registered + + In mm_iface_modem_3gpp_register_in_network() when deciding whether to + force automatic registration or not, check whether the modem is + already + registered in a network. Just checking whether we have a valid + operator + code is not sufficient, as some modems (ublox Toby R2xx) don't always + return an operator name/code even when registered. + + src/mm-iface-modem-3gpp.c | 52 + +++++++++++++++++------------------------------ + 1 file changed, 19 insertions(+), 33 deletions(-) + +commit 1817746f512553ab91af79f6e74e07360a77356b +Author: Aleksander Morgado +Date: Tue Feb 6 14:01:04 2018 +0100 + + broadband-modem: fix reloading of detailed signal quality status + + We should not cache the AT command response otherwise we will never + re-run the same command again. The cache is needed only for AT test + commands (e.g. AT+CESQ=?). + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 357b186134641927b1ce30c960ae95555ae7ecb5 +Author: Aleksander Morgado +Date: Tue Feb 6 13:38:39 2018 +0100 + + ublox: ignore +PBREADY URCs + + We don't want them to get in the way of our initialization phase: + + /org/freedesktop/ModemManager1/Modem/0 (device id + 'c49ed59c4a411e923307330d3e1d82582cbfac37') + ------------------------- + Hardware | manufacturer: 'u-blox' + | model: 'unknown' + | revision: 'TOBY-L4906 + | +PBREADY + | 40.19_ENG0003' + | H/W revision: 'unknown' + | supported: 'gsm-umts, lte' + | current: 'gsm-umts, lte' + + plugins/ublox/mm-broadband-modem-ublox.c | 32 + ++++++++++++++++++++++++++++---- + 1 file changed, 28 insertions(+), 4 deletions(-) + +commit b0b405858f33584a7d9f43de1625255d73183b60 +Author: Ben Chan +Date: Mon Feb 5 20:31:29 2018 -0800 + + broadband-modem: remove unused GError field in + SetupRegistrationChecksContext + + src/mm-broadband-modem.c | 64 + ++++++++++++++++++++++-------------------------- + 1 file changed, 29 insertions(+), 35 deletions(-) + +commit 0f377f943eeb81472fd73189f2c3d8fc65b8c609 +Author: Aleksander Morgado +Date: Mon Feb 5 09:45:42 2018 +0100 + + API: don't depend on GLib in ModemManager headers + + We should only depend on GLib on the libmm-glib headers. Otherwise, + packages using just the core headers (e.g. ModemManagerQt) would also + need to build-depend on GLib and we don't want to enforce that. + + cd ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src && + ~/buildroot/output/host/usr/bin/arm-cortexa9_neon-linux-gnueabihf-g++ + .... -fPIC -o + CMakeFiles/KF5ModemManagerQt_static.dir/bearer.cpp.o -c + ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/bearer.cpp + In file included from + ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager.h:41:0, + from + ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.h:27, + from + ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.cpp:23: + ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager-compat.h:23:18: + fatal error: glib.h: No such file or directory + compilation terminated. + + include/ModemManager-compat.h | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 636c245cd37bcddf6f354cbd53eb88ccf8104387 +Author: Ben Chan +Date: Wed Jan 31 21:57:09 2018 -0800 + + bearer-mbim: check if IP session is activated before deactivating it + + It may be undesirable to issue a MBIM_CID_CONNECT + (MBIMActivationCommandDeactivate) command to deactivate an IP session + when the session isn't activated. For instance, it's been observed on + Huawei ME936 that it takes more than 30s for the modem to deactivate a + not-yet-activated session. This patch modifies MMBearerMbim to + query if + a session is activated before trying to deactivate the session + during a + connection attempt. + + src/mm-bearer-mbim.c | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +commit 785dfd3edd98da26c1c1832c39ea6dfea3b1e877 +Author: Ben Chan +Date: Wed Jan 31 21:57:08 2018 -0800 + + bearer-mbim: increase timeout for deactivating IP session to 60s + + Since commit 0c7f3380a ("bearer-mbim: ensure session is disconnected + before trying to connect"), MMBearerMbim always issues a + MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command before a + MBIM_CID_CONNECT (MBIMActivationCommandActivate) command during a + connection attempt. That is to ensure that an IP session is actually + deactivated before we try to activate a new IP session. + + Unfortunately, it's been observed on Huawei ME936 that it takes more + than 30s for the modem to respond to a MBIM_CID_CONNECT + (MBIMActivationCommandDeactivate) command when trying to deactivate a + session that hasn't been activated. + + When the signal is weak, it's also possible that a modem takes + more than + 30s to deactivate an IP session during a disconnection attempt. + + This patch increases the timeout for deactivating an IP session + from 30s + to 60s in both connection and disconnection attempt. + + src/mm-bearer-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3de58d41374467d0b2cd6620a476758a44ebf697 +Author: Ben Chan +Date: Wed Jan 31 21:57:07 2018 -0800 + + bearer-mbim: remove a unnecessary MbimMessage variable + + src/mm-bearer-mbim.c | 1 - + 1 file changed, 1 deletion(-) + +commit 456e1e0d0cb8f6f49d83359bcdb65b04fdbf77ff +Author: Ben Chan +Date: Fri Jan 26 14:25:56 2018 -0800 + + huawei: handle optional 0x prefix on hex numbers in ^DHCP response + + On Huawei ME936, the hex numbers in the response to AT^DHCP contain + the 0x prefix, e.g. + + AT^DHCP? + + ^DHCP: + 0xda7d0e0a,0xff000000,0xdb7d0e0a,0xdb7d0e0a,0x01261aac,0x00000000,100000000,50000000 + + This patch updates mm_huawei_parse_dhcp_response() to handle the + optional 0x prefix. + + plugins/huawei/mm-modem-helpers-huawei.c | 2 +- + plugins/huawei/tests/test-modem-helpers-huawei.c | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +commit 90b89bb9f4d055bc5713b733503e7d39c54ca55f +Author: Ville Skyttä +Date: Wed Jan 24 20:16:44 2018 +0200 + + *: Spelling fixes + + TODO | 2 +- + .../api/ModemManager-migration-reference.xml | 2 +- + include/ModemManager.h | 2 +- + libmm-glib/mm-bearer-properties.c | 4 ++-- + libmm-glib/mm-bearer.c | 8 ++++---- + libmm-glib/mm-call.c | 16 + ++++++++-------- + libmm-glib/mm-manager.c | 12 ++++++------ + libmm-glib/mm-sim.c | 20 + ++++++++++---------- + libmm-glib/mm-sms.c | 8 ++++---- + libqcdm/src/dm-commands.h | 4 ++-- + plugins/altair/mm-modem-helpers-altair-lte.c | 2 +- + plugins/telit/mm-modem-helpers-telit.c | 6 +++--- + src/mm-base-call.h | 2 +- + src/mm-base-modem-at.c | 2 +- + src/mm-base-sms.h | 2 +- + src/mm-bearer-qmi.c | 2 +- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-iface-modem.c | 2 +- + src/mm-modem-helpers.c | 4 ++-- + src/mm-plugin-manager.c | 4 ++-- + src/mm-plugin.c | 2 +- + src/mm-sms-part-3gpp.c | 2 +- + 22 files changed, 55 insertions(+), 55 deletions(-) + +commit 223b754fccba28dbb3ce950058a81bd133c8ce86 +Author: Aleksander Morgado +Date: Sun Jan 21 22:56:53 2018 +0100 + + build: bump version to 1.7.990 (1.8-rc1) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 54dec452434834a190fb5904aabd57d1380ab044 +Author: Aleksander Morgado +Date: Sun Jan 21 10:31:07 2018 +0100 + + NEWS: update for 1.8.0 + + NEWS | 186 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 186 insertions(+) + +commit b473db334e2b9f3f4b30b703c61d85e99d4f115f +Author: Aleksander Morgado +Date: Sun Jan 21 08:36:49 2018 +0100 + + introspection: add reference to the MM_ID_PHYSDEV_UID udev tag in + Device property + + introspection/org.freedesktop.ModemManager1.Modem.xml | 3 +++ + 1 file changed, 3 insertions(+) + +commit 22ffd3f3aa4d8c1fbc1f6ab765bcfaf83f3d1c7f +Author: Aleksander Morgado +Date: Thu Dec 28 18:41:51 2017 +0100 + + broadband-modem: implement support for the +CEMODE command + + The +CEMODE command is defined in 3GPP TS 27.007 (e.g. in section + 10.1.28 in v11.0.0). This command allows querying or updating the + current UE mode, as well as checking the supported modes. + + We implement support for loading the current mode and updating it. It + is assumed that the device does any additional operation needed by the + setting update, e.g. un-registering from CS when selecting an EPS-only + mode. + + src/mm-broadband-modem.c | 66 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.c | 45 +++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 6 +++++ + 3 files changed, 117 insertions(+) + +commit d4aaa436d9679524f910b13176d4af35bd6b14f8 +Author: Aleksander Morgado +Date: Thu Dec 28 18:41:50 2017 +0100 + + modem-3gpp: allow loading and changing EPS UE mode of operation + + The UE modes of operation for LTE are defined in 3GPP TS 24.301 (e.g. + section 4.3 in v10.3.0): + * PS mode 1: EPS only, 'voice centric' + * PS mode 2: EPS only, 'data centric' + * CS/PS mode 1: EPS and non-EPS, 'voice centric' + * CS/PS mode 2: EPS and non-EPS, 'data centric' + + The mode specifies, among other things, how the UE should behave w.r.t + CS fallback depending on the capabilities reported by the network. + + cli/mmcli-modem-3gpp.c | 76 +++++++++ + cli/mmcli-modem.c | 9 +- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 13 ++ + include/ModemManager-enums.h | 18 +++ + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 19 +++ + libmm-glib/mm-common-helpers.c | 22 +++ + libmm-glib/mm-common-helpers.h | 3 + + libmm-glib/mm-modem-3gpp.c | 53 ++++++ + libmm-glib/mm-modem-3gpp.h | 14 ++ + src/mm-iface-modem-3gpp.c | 177 + ++++++++++++++++++++- + src/mm-iface-modem-3gpp.h | 17 ++ + 12 files changed, 418 insertions(+), 4 deletions(-) + +commit c5c9ab279d6362b2090010b4cad9ea49e9559423 +Author: Aleksander Morgado +Date: Sat Jan 20 15:37:23 2018 +0100 + + build: require libmbim 1.16.0 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fbd1780e60213adbcfcbd8f203c7e7974ff0df8d +Author: Aleksander Morgado +Date: Sat Jan 20 15:36:49 2018 +0100 + + build: require libqmi 1.20.0 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c4ea37fa02aaa0860f067062cbd315e3540aacce +Author: Aleksander Morgado +Date: Thu Jan 18 16:31:34 2018 +0100 + + filter: cdc-acm protocols 1 through 6 are all AT-capable + + As per USB-IF "Class definitions for Communication Devices 1.2" docs. + + Reported-by: Iván Sánchez Ortega + + src/mm-filter.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +commit c9e85b67164f81310d1a7ca0bffbb8c938a6a943 +Author: Ben Chan +Date: Thu Jan 11 23:47:28 2018 -0800 + + iface-modem-3gpp: ignore initial registration check result when + appropriate + + When a modem is being enabled, an initial registration check is + scheduled to determine the current registration state and access + technology. The initial registration check is performed asynchronously + and may not complete before the modem state is transitioned to + 'enabled'. When the modem is disabled shortly afterwards, the + registration state is transitioned to 'unknown' and the modem state is + transitioned to 'disabled'. But the completion of the initial + registration check after that can transition the registration + state and + modem state to a wrong state. This patch addresses the issue by + ignoring + a registration state update if the modem isn't already enabled + or being + enabled. + + src/mm-iface-modem-3gpp.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit d8c7251687dca8c4aca059428d374d06cbdc9e79 +Author: Aleksander Morgado +Date: Mon Jan 1 19:35:31 2018 +0100 + + telit: use parent logic to load unlock retries + + The generic broadband modem provides a common method to load unlock + retries based on CSIM queries. We modify the Telit plugin to use the + generic method but keeping the CSIM locking/unlocking logic in place. + + plugins/telit/mm-broadband-modem-telit.c | 110 + +++++-------------------------- + 1 file changed, 18 insertions(+), 92 deletions(-) + +commit 30ea91e353ae58df2407f837979af39ed3b4a49b +Author: Aleksander Morgado +Date: Sun Dec 24 08:38:33 2017 +0100 + + ublox: wait for READY URCs during port probing + + The AT control TTYs in the u-blox modems may take some time to be + usable. In order to handle this issue, we configured some longer + timeouts during AT probing, but that may not be always enough. + + The u-blox TTYs will report readiness via a "+AT: READY" URC, which + we can use during custom initialization to decide right away that the + port is AT. We use up to 20s as that is close to the worst case seen + during experimentation, happening after the module undergoes a full + NVM reset. If the timeout is reached without receiving the URC, we + still run standard AT probing afterwards. This new logic just tries + to make it sure we don't do any probing before the module is ready to + accept it. + + If the module hasn't been hotplugged (i.e. it was already there when + ModemManager started) we do a quick first AT probing and if that fails + we run the "+AT: READY" URC wait as if it was hotplugged. + + plugins/ublox/mm-plugin-ublox.c | 205 + +++++++++++++++++++++++++++++++++++++--- + 1 file changed, 191 insertions(+), 14 deletions(-) + +commit c97b9d99e3ca62ff7af3b74afe05a9d80f16b8bb +Author: Colin Helliwell +Date: Mon Jan 1 18:42:28 2018 +0100 + + broadband-modem: implement generic unlock retries loading + + src/mm-broadband-modem.c | 116 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 116 insertions(+) + +commit 8f26848ef00b343a15904bf7f8cd1a77de795b3e +Author: Colin Helliwell +Date: Mon Jan 1 18:36:11 2018 +0100 + + helpers: move generic load_unlock_retries from Telit plugin + + As a precursor to a generic load_unlock_retries method, move the + CSIM Response parser from the Telit plugin into the core code. + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + plugins/telit/mm-modem-helpers-telit.c | 85 + ----------------------- + plugins/telit/mm-modem-helpers-telit.h | 4 -- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 58 ---------------- + src/mm-modem-helpers.c | 85 + +++++++++++++++++++++++ + src/mm-modem-helpers.h | 4 ++ + src/tests/test-modem-helpers.c | 59 ++++++++++++++++ + 7 files changed, 149 insertions(+), 148 deletions(-) + +commit 850107acbfe3878326b695d4ea31f02d2321aa22 +Author: Aleksander Morgado +Date: Thu Dec 21 14:43:08 2017 +0100 + + bearer-qmi: fix logic if error setting up WDS event report indications + + If we get an error when setting up the WDS event report indications, + make sure we run connect_context_step() after having set the next step + as CONNECT_STEP_LAST. + + src/mm-bearer-qmi.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit c2b956aefce495865cbdcb9971e2b3cd99cd0e99 +Author: Aleksander Morgado +Date: Mon Dec 18 22:52:21 2017 +0100 + + blacklist: Pycom uses Microchip's vid, so blacklist also by pid + + The Microchip VID is added to the USB serial adapters greylist + instead, as it is very generic. + + https://bugs.freedesktop.org/show_bug.cgi?id=104320 + + src/77-mm-usb-device-blacklist.rules | 14 +++++++------- + src/77-mm-usb-serial-adapters-greylist.rules | 3 +++ + 2 files changed, 10 insertions(+), 7 deletions(-) + +commit 838b82b71b2ea34318e78575fabdf4484d953230 +Author: Aleksander Morgado +Date: Mon Dec 18 15:34:43 2017 +0100 + + blacklist: include all Pycom devices + + https://bugs.freedesktop.org/show_bug.cgi?id=104320 + + src/77-mm-usb-device-blacklist.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 8f6e5bfefa7b0536e772103ed5f8cbeb7d020ed4 +Author: Aleksander Morgado +Date: Mon Dec 18 10:34:05 2017 +0100 + + sms-part-3gpp: improve warnings when decoding fails + + src/mm-sms-part-3gpp.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 332cf9dc014edf612fe6745eba440e02919b1128 +Author: Aleksander Morgado +Date: Mon Dec 18 10:33:46 2017 +0100 + + libhelpers: include MMSmsEncoding in helper enums generation + + src/Makefile.am | 3 ++- + src/mm-sms-part-3gpp.h | 2 +- + src/mm-sms-part-cdma.h | 2 +- + src/mm-sms-part.h | 4 ++-- + 4 files changed, 6 insertions(+), 5 deletions(-) + +commit e8bac6cb9224083d445233baf2c1c4db1efe04ad +Author: Ben Chan +Date: Fri Dec 15 00:45:12 2017 -0800 + + sms-part-3gpp: decode Unicode SMS with non-BMP code points + + Depsite 3GPP TS 23.038 specifies that Unicode SMS messages are + encoded in + UCS-2, UTF-16 encoding is commonly used instead on many modern + platforms to + allow encoding code points that fall outside the Basic Multilingual + Plane + (BMP), such as Emoji. Most of the UCS-2 code points are identical + to their + equivalent UTF-16 code points. In UTF-16, non-BMP code points are + encoded in a + pair of surrogate code points (i.e. a high surrogate in + 0xD800..0xDBFF, + followed by a low surrogate in 0xDC00..0xDFFF). An isolated surrogate + code + point has no general interpretation in UTF-16, but could be a valid + (though + unmapped) code point in UCS-2. + + This patch modifies the 3GPP SMS decoding to first try UTF-16BE and + then fall + back to UCS-2BE on failure. If both fail, an empty string is returned + instead of a NULL pointer. + + src/mm-sms-part-3gpp.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +commit c44b928206c1147bd760b4aef48294d7dda28e24 +Author: Eric Caruso +Date: Wed Dec 13 10:17:33 2017 -0800 + + mm-iface-modem: add check_for_sim_swap method and enable steps + + When in low-power mode, some modems will not dispatch unsolicited + notifications, such as for SIM hot swapping. There is code in + MMBroadbandModemTelit to handle this by checking the SIM identifier + during modem power up against the identifier cached in the SIM + D-Bus object. If they're different, the SIM has likely been + swapped while we were powered down. + + We can move this code out to MMBroadbandModem because it doesn't + actually rely on any Telit-specific details, and invoke it from + MMIfaceModem via a new method. + + plugins/telit/mm-broadband-modem-telit.c | 128 + ++----------------------------- + src/mm-broadband-modem.c | 128 + +++++++++++++++++++++++++++++++ + src/mm-iface-modem.c | 32 ++++++++ + src/mm-iface-modem.h | 10 +++ + 4 files changed, 176 insertions(+), 122 deletions(-) + +commit 66dce6dacc440d8bfe4270562ef5a840c87e5a04 +Author: Aleksander Morgado +Date: Tue Nov 7 19:13:19 2017 +0100 + + broadband-modem: use several SIM errors to flag the modem as GSM/UMTS + + When using CPIN? to detect capabilities, use several possible +CME + errors as indication that the modem is at least GSM/UMTS. + + E.g. to avoid situations like this one where the modem doesn't even + get into Failed state as we cannot gather capabilities: + + debug_log(): (ttyMux1): --> 'AT+GCAP' + debug_log(): (ttyMux1): <-- '+CME ERROR: 100' + mm_serial_parser_v1_parse(): Got failure code 100: Unknown error + debug_log(): (ttyMux1): --> 'ATI' + debug_log(): (ttyMux1): <-- + 'CinterionEHS5-EREVISION + 03.001OK' + debug_log(): (ttyMux1): --> 'AT+CPIN?' + debug_log(): (ttyMux1): <-- '+CME ERROR: 10' + mm_serial_parser_v1_parse(): Got failure code 10: SIM not inserted + debug_log(): (ttyMux1): --> 'AT+CGMM' + debug_log(): (ttyMux1): <-- 'EHS5-E' + debug_log(): (ttyMux1): <-- 'OK' + iface_modem_initialize_ready(): Modem couldn't be initialized: + couldn't load current capabilities: Failed to determine modem + capabilities. + + src/mm-broadband-modem.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit ce8c7035746e21e09cf491be1fa1186714abd4b2 +Author: Aleksander Morgado +Date: Tue Oct 17 18:21:02 2017 +0200 + + docs: include device filter policies/rules documentation + + docs/reference/api/ModemManager-overview.xml | 283 + ++++++++++++++++++++++++++- + 1 file changed, 277 insertions(+), 6 deletions(-) + +commit 42f4e975c9a22ecde9f4971e014358238dcfe975 +Author: Aleksander Morgado +Date: Tue Oct 17 14:42:26 2017 +0200 + + docs: port probing reference in its own chapter + + docs/reference/api/ModemManager-overview.xml | 589 + +++++++++++++-------------- + 1 file changed, 294 insertions(+), 295 deletions(-) + +commit 0850fe4f6d4e4cd8c36b397d7db5313ca4188176 +Author: Aleksander Morgado +Date: Tue Oct 17 12:53:58 2017 +0200 + + filter: additional strict rules when all device ports available + + All the previous filter rules were applicable per-port independently. + But, we also want to apply rules on a port based on the existence of + other ports on the same device (e.g. allow TTY if the device also has + a NET port). In this case, we need to wait for all ports to appear and + then apply the additional rules. + + We re-use the "min wait time" timeout in the plugin-manager for this + same purpose. This timeout is setup to wait for ports to appear before + starting the probing process (e.g. so that plugin filters like the + forbidden-drivers one work). The very same timeout can therefore be + used to check whether we start the probing or not based on additional + filter rules. + + src/mm-base-manager.c | 2 +- + src/mm-filter.c | 43 ++++++++++++++++++++++++++++++++++++++++--- + src/mm-filter.h | 12 +++++++++++- + src/mm-plugin-manager.c | 45 + ++++++++++++++++++++++++++++++++++++++++----- + src/mm-plugin-manager.h | 3 +++ + 5 files changed, 95 insertions(+), 10 deletions(-) + +commit ee570d44dc117dc69f23e83313dd877f76c5e3e0 +Author: Aleksander Morgado +Date: Mon Oct 16 22:55:02 2017 +0200 + + filter: new automatic whitelisting rules and strict/paranoid policies + + The 'default' filter policy was based on blacklisting as much as + possible and otherwise allow. + + The new 'strict' filter policy will be based on whitelisting as much + as much as possible, using custom defined rules, and otherwise forbid + the ports. + + The new 'paranoid' filter policy is equivalent to the 'strict' filter + after having applied the blacklist rules from the 'default' filter. + + src/mm-base-manager.c | 4 ++- + src/mm-context.c | 12 +++++++- + src/mm-filter.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++++----- + src/mm-filter.h | 77 + +++++++++++++++++++++++++++++++++++++------------- + 4 files changed, 142 insertions(+), 29 deletions(-) + +commit 33583ca4dea8dd14e9090fc011986577b14b8ede +Author: Aleksander Morgado +Date: Mon Oct 16 23:46:41 2017 +0200 + + kerneldevice: allow getting interface class/subclass/protocol + + plugins/huawei/mm-broadband-modem-huawei.c | 4 +- + src/kerneldevice/mm-kernel-device-generic.c | 31 ++++++++++++++- + src/kerneldevice/mm-kernel-device-udev.c | 60 + ++++++++++++++++++++++++++--- + src/kerneldevice/mm-kernel-device.c | 36 +++++++++++++++-- + src/kerneldevice/mm-kernel-device.h | 18 ++++----- + src/mm-base-modem.c | 8 ++-- + src/mm-port-probe.c | 8 ---- + src/mm-port-probe.h | 1 - + 8 files changed, 130 insertions(+), 36 deletions(-) + +commit 5b3baa02d368aa2cb41420f62af712fa29837f2b +Author: Aleksander Morgado +Date: Mon Oct 16 22:00:39 2017 +0200 + + filter: explicitly allow port when ID_MM_PLATFORM_DRIVER_PROBE is set + + Don't assume that the port will be implicitly allowed afterwards. + + src/mm-filter.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit c4bf785d6771764cbee116e36c6780462223c4fa +Author: Aleksander Morgado +Date: Mon Oct 16 21:33:15 2017 +0200 + + filter: allow selection of filter policy on startup + + Added a new '--filter-policy=[POLICY]' option in the daemon, which + allows selecting between the supported filter policies. For now, only + two policies are defined: + + * default: the default policy used by ModemManager, where it tries + to probe and detect as many modem ports as possible. + + * whitelist-only: only devices explicitly tagged via udev (with the + ID_MM_DEVICE_PROCESS tag) will be probed and used. + + src/main.c | 1 + + src/mm-base-manager.c | 43 ++++++++++++++++++++++++++++++++----------- + src/mm-base-manager.h | 23 +++++++++++++---------- + src/mm-context.c | 48 + +++++++++++++++++++++++++++++++++++++++++++----- + src/mm-context.h | 5 +++++ + src/mm-filter.h | 16 ++++++++++++++++ + 6 files changed, 110 insertions(+), 26 deletions(-) + +commit 7bfd5270ef846582d97314f3e9e550129317d631 +Author: Aleksander Morgado +Date: Fri Oct 13 10:50:49 2017 +0200 + + filter: let the user tag modems explicitly + + The user can tag modems (either full devices or ports independently) + to be explicitly probed by ModemManager, using the new + "ID_MM_DEVICE_PROCESS" udev tag, e.g.: + + $ sudo vim /lib/udev/rules.d/78-mm-whitelist-internal-modem.rules + ACTION!="add|change|move", + GOTO="mm_whitelist_internal_modem_end" + ATTRS{idVendor}=="1199", ATTRS{idProduct}=="a001", + ENV{ID_MM_DEVICE_PROCESS}="1" + LABEL="mm_whitelist_internal_modem_end" + $ sudo udevadm control --reload + $ sudo udevadm trigger + + This rule runs before any other filter rule. + + This tag may be used e.g. by manufacturers building systems with + built-in modems that will always be available. + + Distributions targeting support for multiple modem devices shouldn't + use this udev tag. + + src/mm-filter.c | 11 +++++++++++ + src/mm-filter.h | 18 ++++++++++-------- + 2 files changed, 21 insertions(+), 8 deletions(-) + +commit f270a09cb2df37c134e567049a5fe09c73d7fd3c +Author: Aleksander Morgado +Date: Thu Oct 12 23:49:10 2017 +0200 + + filter: allow enabling/disabling rules via envvars + + E.g. forcing a MBIM modem to run in AT-only mode: + + # MM_FILTER_RULE_NET=0 \ + MM_FILTER_RULE_CDC_WDM=0 \ + /usr/sbin/ModemManager --debug + + This is just for quick testing for now. + + src/mm-base-manager.c | 8 +------- + src/mm-filter.c | 39 ++++++++++++++++++++++++++++++++++++++- + src/mm-filter.h | 9 +++++++++ + 3 files changed, 48 insertions(+), 8 deletions(-) + +commit 239f7ba8a285d737aa9ef2f52dbc078d2b2f5371 +Author: Aleksander Morgado +Date: Thu Oct 12 23:00:09 2017 +0200 + + filter: remove bogus TTY virtual console filter + + The more generic filter for virtual devices already covers all cases + covered by the TTY virtual console filter. + + src/mm-base-manager.c | 1 - + src/mm-filter.c | 15 +++------------ + src/mm-filter.h | 7 +++---- + 3 files changed, 6 insertions(+), 17 deletions(-) + +commit 4e26661e67c4bde6f2a5314fb4130844a32b9f54 +Author: Aleksander Morgado +Date: Thu Oct 12 22:07:38 2017 +0200 + + filter: new object to run the port/device filter logic + + This new object allows configuring the filter rules applied to the + device ports. By default, for now, it implements the same rules as the + MMKernelDevice is_candidate() method, which is obsoleted. + + src/Makefile.am | 6 +- + src/kerneldevice/mm-kernel-device.c | 67 ------------ + src/kerneldevice/mm-kernel-device.h | 3 - + src/mm-base-manager.c | 31 +++++- + src/mm-filter.c | 207 + ++++++++++++++++++++++++++++++++++++ + src/mm-filter.h | 64 +++++++++++ + 6 files changed, 306 insertions(+), 72 deletions(-) + +commit d04f98d9666c8c0031f16c05b31614ea7c179e42 +Author: Aleksander Morgado +Date: Thu Oct 12 21:43:34 2017 +0200 + + kerneldevice: consolidate candidate rules in the base device + + This patch implicitly enables in the generic device backend the + manual-only greylist (ID_MM_DEVICE_MANUAL_SCAN_ONLY tag) and the + platform TTY whitelist (ID_MM_PLATFORM_DRIVER_PROBE), which were not + being applied. + + src/kerneldevice/mm-kernel-device-generic.c | 54 -------------------- + src/kerneldevice/mm-kernel-device-udev.c | 76 + ----------------------------- + src/kerneldevice/mm-kernel-device.c | 66 + +++++++++++++++++++++++-- + src/kerneldevice/mm-kernel-device.h | 3 -- + 4 files changed, 63 insertions(+), 136 deletions(-) + +commit 345d9747a7408cc5263b425e149bf3b4ac4926a4 +Author: Aleksander Morgado +Date: Thu Oct 12 21:07:09 2017 +0200 + + kerneldevice: allow loading physdev sysfs path + + src/kerneldevice/mm-kernel-device-generic.c | 9 +++++++++ + src/kerneldevice/mm-kernel-device-udev.c | 16 ++++++++++++++++ + src/kerneldevice/mm-kernel-device.c | 10 ++++++++++ + src/kerneldevice/mm-kernel-device.h | 3 +++ + 4 files changed, 38 insertions(+) + +commit 0e4e4a6b138cccc49a8f7a4d8bacc9273f8b4cb3 +Author: Aleksander Morgado +Date: Thu Oct 12 20:47:17 2017 +0200 + + kerneldevice: allow loading physdev subsystem + + Used to filter out TTYs when not explicitly whitelisted. + + src/kerneldevice/mm-kernel-device-generic.c | 31 + +++++++++++++++++++++++++++++ + src/kerneldevice/mm-kernel-device-udev.c | 18 ++++++++++++++++- + src/kerneldevice/mm-kernel-device.c | 10 ++++++++++ + src/kerneldevice/mm-kernel-device.h | 3 +++ + 4 files changed, 61 insertions(+), 1 deletion(-) + +commit a4271d8433f1b629ac80a0bdd0876413c48712d3 +Author: Aleksander Morgado +Date: Tue Nov 21 15:38:29 2017 +0100 + + mbm: port dial_3gpp() and disconnect_3gpp() to GTask + + The two connection and disconnection methods are ported to GTask, and + are also updated so that the reception of the unsolicited message + reporting either connect/disconnection is able to right away complete + the pending connection/disconnection attempts, as done in other + plugins like the Icera or HSO ones. + + plugins/mbm/mm-broadband-bearer-mbm.c | 692 + +++++++++++++++++++--------------- + 1 file changed, 382 insertions(+), 310 deletions(-) + +commit 4c8a3d0015a7d09fbda92af36fe0e083ad236978 +Author: Aleksander Morgado +Date: Tue Nov 21 14:34:26 2017 +0100 + + icera: port dial_3gpp() to GTask + + plugins/icera/mm-broadband-bearer-icera.c | 466 + +++++++++++++----------------- + 1 file changed, 205 insertions(+), 261 deletions(-) + +commit 09d563fd346b22700f22d9d1466881ad0e3d9764 +Author: Aleksander Morgado +Date: Tue Nov 21 14:23:20 2017 +0100 + + hso: make report_connection_status() a separate logical block + + This block is a subclassed method from MMBaseBearer, which we just + happen to also use as part of the 3GPP dial logic in the connection + attempt. + + So make it a separate logical block, and call the processing of the + connection attempt if one is found. + + This change makes it similar to the same logic in the Icera plugin. + + plugins/option/mm-broadband-bearer-hso.c | 64 + ++++++++++++++++++-------------- + 1 file changed, 36 insertions(+), 28 deletions(-) + +commit b6e3cb463d2515ac9efc28346776a3ccbd7a0802 +Author: Aleksander Morgado +Date: Tue Nov 21 14:07:48 2017 +0100 + + hso: use a 60s timeout to wait for connection unsolicited messages + + Same amount of time as in the Icera plugin. + + plugins/option/mm-broadband-bearer-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 90116bf1beac765b6119885b113faa29203a33e6 +Author: Aleksander Morgado +Date: Wed Nov 8 17:48:15 2017 +0100 + + hso: port dial_3gpp() to GTask + + plugins/option/mm-broadband-bearer-hso.c | 414 + +++++++++++++------------------ + 1 file changed, 178 insertions(+), 236 deletions(-) + +commit d5684ff391d4dc39ca6e924a69df9e17ab922562 +Author: Aleksander Morgado +Date: Sat Nov 11 13:48:06 2017 +0100 + + quectel: new plugin + + For now just creating generic QMI/AT capable modems. + + plugins/Makefile.am | 12 +++++ + plugins/quectel/mm-plugin-quectel.c | 96 + +++++++++++++++++++++++++++++++++++++ + plugins/quectel/mm-plugin-quectel.h | 40 ++++++++++++++++ + 3 files changed, 148 insertions(+) + +commit 5d7b67d2709c9be6f51f7b6620bfeb247ede3a27 +Author: Aleksander Morgado +Date: Tue Dec 5 10:45:09 2017 +0100 + + po: add Swedish translation + + From: Josef Andersson + + https://bugs.freedesktop.org/show_bug.cgi?id=104086 + + po/LINGUAS | 1 + + po/sv.po | 105 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 106 insertions(+) + +commit 291300cfcb2e3f101c0f08de65fc03e0ceb2718f +Author: Aleksander Morgado +Date: Sat Sep 16 12:19:47 2017 -0700 + + sierra: enable QMI connection status polling in Netgear AC341U + + The Netgear AC341U seems to delay reporting packet service status + indications or actually not even send them. This leaves us with modems + in connected state in ModemManager but actually disconnected. We can + detect this situation by actively polling ourselves the connection + status. + + See e.g. this case where the indication is received 2.5 mins after the + first OutOfCall error detected when loading statistics. + + Aug 30 22:52:50 ModemManager[574]: Modem + /org/freedesktop/ModemManager1/Modem/0: state changed (connecting + -> connected) + Aug 30 22:52:50 ModemManager[574]: Simple connect state + (8/8): All done + Aug 30 22:52:50 ModemManager[574]: Reloading stats + failed: Couldn't get packet statistics: QMI protocol error (15): + 'OutOfCall' + Aug 30 22:53:20 ModemManager[574]: Reloading stats + failed: Couldn't get packet statistics: QMI protocol error (15): + 'OutOfCall' + Aug 30 22:53:50 ModemManager[574]: Reloading stats + failed: Couldn't get packet statistics: QMI protocol error (15): + 'OutOfCall' + Aug 30 22:54:20 ModemManager[574]: Reloading stats + failed: Couldn't get packet statistics: QMI protocol error (15): + 'OutOfCall' + Aug 30 22:56:21 ModemManager[574]: bearer call end reason + (2): 'generic-client-end' + Aug 30 22:56:21 ModemManager[574]: bearer verbose call + end reason (3,2000): [cm] client-end + Aug 30 22:56:21 ModemManager[574]: Modem + /org/freedesktop/ModemManager1/Modem/0: state changed (connected + -> registered) + + plugins/Makefile.am | 2 ++ + plugins/sierra/77-mm-sierra.rules | 12 ++++++++++++ + 2 files changed, 14 insertions(+) + +commit 7119b8ebb252ca3775a1be16f446e99b735f5b98 +Author: Aleksander Morgado +Date: Sat Sep 16 12:17:54 2017 -0700 + + bearer-qmi: new optional connection status monitoring + + This update makes it possible to request connection status polling for + QMI modems via the ID_MM_QMI_CONNECTION_STATUS_POLLING_ENABLE tag. + + If not given, the connection status polling will be disabled by + default, and the QMI modem will rely on WDS indications only. + + src/mm-bearer-qmi.c | 161 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 159 insertions(+), 2 deletions(-) + +commit d20d46a62960099164da5ef5bb7b0b93127cc6c5 +Author: Aleksander Morgado +Date: Thu Nov 23 14:10:59 2017 +0100 + + iface-modem: remove invalid modem reference count in + update_lock_info() + + The modem object is being explicitly referenced and stored in the + Context, but then never unref-ed, completely leaking a modem reference + forever. + + Fixes: 4df545884733bbc5a851ab86e0983dec057d5482 + + src/mm-iface-modem.c | 3 --- + 1 file changed, 3 deletions(-) + +commit de334b7777777e11df6c83aa7dd7cfb2b5f3b1fe +Author: Aleksander Morgado +Date: Thu Nov 23 13:02:42 2017 +0100 + + broadband-modem-qmi: plug memleak when listing stored images + + ==24602== 288 bytes in 4 blocks are definitely lost in loss record + 4,693 of 4,860 + ==24602== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==24602== by 0x67292F9: g_malloc (in + /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x670A706: g_slice_alloc (in + /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x670B849: g_slice_alloc0 (in + /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x53D3A24: + __qmi_message_dms_get_stored_image_info_response_parse + (qmi-dms.c:22779) + ==24602== by 0x53E5C61: get_stored_image_info_ready + (qmi-dms.c:32287) + ==24602== by 0x6134908: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5400.0) + ==24602== by 0x613499E: ??? (in /usr/lib/libgio-2.0.so.0.5400.0) + ==24602== by 0x67180BD: g_main_context_dispatch (in + /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x6719F68: ??? (in /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x671AF41: g_main_loop_run (in + /usr/lib/libglib-2.0.so.0.5400.0) + ==24602== by 0x14477B: main (main.c:180) + + src/mm-broadband-modem-qmi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 75933c3e8bbecaf89e56e4426a0d543db3450378 +Author: Aleksander Morgado +Date: Sun Nov 12 13:41:29 2017 +0100 + + po: update Ukrainian translation + + From: Yuri Chornoivan + + https://bugs.freedesktop.org/show_bug.cgi?id=103685 + + po/uk.po | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 17b8fcfd771a57cac099b22d1312c62d4fb51683 +Author: Aleksander Morgado +Date: Sat Nov 11 13:39:16 2017 +0100 + + build: minor build rules reordering for the udev rules tester + + Move it after all plugin build rules. + + plugins/Makefile.am | 27 +++++++++++++-------------- + 1 file changed, 13 insertions(+), 14 deletions(-) + +commit 4f0a796ece07f84790b09b13ea90a49aab1b61f1 +Author: Aleksander Morgado +Date: Wed Oct 18 23:17:25 2017 +0200 + + cli: port mmcli_get_call to GTask + + cli/mmcli-common.c | 224 + +++++++++++++++++++++++++++++------------------------ + cli/mmcli-common.h | 25 +++--- + 2 files changed, 134 insertions(+), 115 deletions(-) + +commit 6f9e2003e078022eea44a5a8dd075a96d6263fc9 +Author: Aleksander Morgado +Date: Wed Oct 18 23:04:41 2017 +0200 + + cli: port mmcli_get_sim to GTask + + cli/mmcli-common.c | 144 + +++++++++++++++++++++++++++++------------------------ + cli/mmcli-common.h | 24 ++++----- + 2 files changed, 91 insertions(+), 77 deletions(-) + +commit 050eb46f51988d3e7f51d5d2a413809435cc954d +Author: Aleksander Morgado +Date: Wed Oct 18 22:44:16 2017 +0200 + + cli: port mmcli_get_sms to GTask + + cli/mmcli-common.c | 165 + +++++++++++++++++++++++++++++------------------------ + cli/mmcli-common.h | 24 ++++---- + 2 files changed, 104 insertions(+), 85 deletions(-) + +commit f94a93d66abf47a2528ade5b1847e1b7b5071dc0 +Author: Aleksander Morgado +Date: Wed Oct 18 22:29:23 2017 +0200 + + cli: port mmcli_get_bearer to GTask + + cli/mmcli-common.c | 151 + ++++++++++++++++++++++++++++++----------------------- + cli/mmcli-common.h | 24 ++++----- + 2 files changed, 97 insertions(+), 78 deletions(-) + +commit 11e9b727b471c6cc14b121f08b778aca750b176b +Author: Aleksander Morgado +Date: Wed Sep 20 22:34:31 2017 -0700 + + cli: port mmcli_get_modem to GTask + + cli/mmcli-common.c | 71 + ++++++++++++++++++++++++++---------------------------- + cli/mmcli-common.h | 21 ++++++++-------- + 2 files changed, 44 insertions(+), 48 deletions(-) + +commit 6bf046b6fc0b0704081a8d1e7c063d422747e839 +Author: Aleksander Morgado +Date: Wed Sep 20 22:26:23 2017 -0700 + + cli: port mmcli_get_manager to GTask + + cli/mmcli-common.c | 48 +++++++++++++++++++++++------------------------- + cli/mmcli-common.h | 12 ++++++------ + 2 files changed, 29 insertions(+), 31 deletions(-) + +commit 71f0fc6821fd0c5fc67f99e2588bf4e9fd5bd396 +Author: Luis A. Lozano +Date: Wed Oct 25 19:00:47 2017 -0700 + + sms-cdma-part: fix tautological-constant-compare compiler warning + + This patch fixes the following compiler warning issued by clang: + + mm-sms-part-cdma.c:301:46: mcomparison 'guint8' (aka 'unsigned + char') <= 255 is always true + [-Werror,-Wtautological-constant-compare] + + src/mm-sms-part-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 098c4c0271e04b564da57bb5c9e4e8e067bd58c9 +Author: Eric Caruso +Date: Fri Oct 20 10:10:47 2017 -0700 + + mm-broadband-modem-qmi: reprobe on qmi-proxy death + + This allows us to reprobe the modem and respawn the + qmi-proxy in case it dies on us. This gets us access + to the modem and unsolicited notifications again. Do + this by connecting to the device-removed signal on + QmiDevice. + + --- + Rebased on top of git master by + Aleksander Morgado + + configure.ac | 2 +- + src/mm-broadband-modem-qmi.c | 70 + ++++++++++++++++++++++++++++++++++++++++---- + src/mm-port-qmi.c | 10 +++++++ + src/mm-port-qmi.h | 2 ++ + 4 files changed, 77 insertions(+), 7 deletions(-) + +commit b4278615fc273756ae5fe2b84da1e39a56d3e121 +Author: Aleksander Morgado +Date: Sun Oct 22 11:18:33 2017 +0200 + + po: add Czech translation + + From: Marek Černocký + + https://bugs.freedesktop.org/show_bug.cgi?id=103390 + + po/LINGUAS | 1 + + po/cs.po | 108 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 109 insertions(+) + +commit 965ff9304141af7389840f6e6f4ee1dafdc89e23 +Author: Ben Chan +Date: Fri Oct 20 14:43:02 2017 -0700 + + novatel: port load_supported_modes to use GTask + + plugins/novatel/mm-broadband-modem-novatel.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit adcce66dd7b676e4cc7bf71b63588e746f51dc14 +Author: Aleksander Morgado +Date: Fri Oct 20 17:47:54 2017 +0200 + + broadband-modem-qmi: avoid NULL success return in + firmware_load_current + + Instead of assuming that NULL is a valid return, make sure we return + an error instead. + + This also makes it sure that if the GTask gets cancelled, the result + we set is always a valid GObject, so that the g_object_unref passed as + GDestroyNotify can be safely called always. Not a big deal anyway, as + the GTask cannot be currently cancelled. + + src/mm-broadband-modem-qmi.c | 11 +++++++---- + src/mm-iface-modem-firmware.c | 14 +++++++++----- + 2 files changed, 16 insertions(+), 9 deletions(-) + +commit dbb4597e335d66dda7abebbab7d70b0708146350 +Author: Aleksander Morgado +Date: Fri Oct 20 17:46:40 2017 +0200 + + broadband-modem-qmi: avoid NULL success return in firmware_load_list + + Instead of assuming that NULL is a valid return, make sure we return + an error instead. + + src/mm-broadband-modem-qmi.c | 6 +++++- + src/mm-iface-modem-firmware.c | 13 +++++++++---- + 2 files changed, 14 insertions(+), 5 deletions(-) + +commit 6044118b64b11a39b54cc9a2109dbb3f6adc7995 +Author: Aleksander Morgado +Date: Fri Oct 20 17:27:38 2017 +0200 + + broadband-modem-qmi: make it explicit that the GTask is successful + + When load_supported_storages() doesn't run the parent implementation, + the GTask is always successful. Make it explicit, in case the logic + changes in the future. + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4e3bf7524d6acfd4f8fba7da920c2dceff8e8797 +Author: Ben Chan +Date: Tue Jul 11 14:35:16 2017 -0700 + + broadband-modem-qmi: port modem_cdma_load_meid to use GTask + + src/mm-broadband-modem-qmi.c | 31 +++++++++---------------------- + 1 file changed, 9 insertions(+), 22 deletions(-) + +commit f5270ac5ae088b7ab1400951cc42c1908edc59c4 +Author: Ben Chan +Date: Tue Jul 11 14:31:53 2017 -0700 + + broadband-modem-qmi: port modem_cdma_load_esn to use GTask + + src/mm-broadband-modem-qmi.c | 31 +++++++++---------------------- + 1 file changed, 9 insertions(+), 22 deletions(-) + +commit 607dee3a9553305432a3d513c8b777edee4d94dd +Author: Ben Chan +Date: Tue Jul 11 14:28:37 2017 -0700 + + broadband-modem-qmi: port modem_3gpp_load_operator_code to use GTask + + src/mm-broadband-modem-qmi.c | 38 +++++++++++++++++--------------------- + 1 file changed, 17 insertions(+), 21 deletions(-) + +commit e365cf531ccbdd4101ae5507ba439fe27875f758 +Author: Ben Chan +Date: Tue Jul 11 14:27:02 2017 -0700 + + broadband-modem-qmi: port modem_3gpp_load_operator_name to use GTask + + src/mm-broadband-modem-qmi.c | 38 +++++++++++++++++--------------------- + 1 file changed, 17 insertions(+), 21 deletions(-) + +commit 942a3565e25aa17317c528fb8a7a1832d97aa784 +Author: Ben Chan +Date: Tue Jul 11 14:20:50 2017 -0700 + + broadband-modem-qmi: port modem_3gpp_load_imei to use GTask + + src/mm-broadband-modem-qmi.c | 31 +++++++++---------------------- + 1 file changed, 9 insertions(+), 22 deletions(-) + +commit be1b3add84cfdd06f1db01fd966bfc9181131d1b +Author: Ben Chan +Date: Tue Jul 11 13:06:51 2017 -0700 + + broadband-modem-qmi: port modem_messaging_setup_sms_format to + use GTask + + src/mm-broadband-modem-qmi.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +commit 9b27a8bd9af0dca3a5a18c6d759af3e9ed134c30 +Author: Ben Chan +Date: Tue Jul 11 14:50:56 2017 -0700 + + broadband-modem-qmi: port modem_load_supported_ip_families to + use GTask + + src/mm-broadband-modem-qmi.c | 37 ++++++++++++++++--------------------- + 1 file changed, 16 insertions(+), 21 deletions(-) + +commit 0b942a6759a7ebfa2afe468ecfb02baeb653b8b5 +Author: Ben Chan +Date: Tue Jul 11 16:05:55 2017 -0700 + + broadband-modem-qmi: port modem_load_supported_ip_modes to use GTask + + src/mm-broadband-modem-qmi.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit bba2386238d3f672946a20ea69d00fb1f95cb7d9 +Author: Ben Chan +Date: Tue Jul 11 14:41:33 2017 -0700 + + broadband-modem-qmi: port modem_load_device_identifier to use GTask + + src/mm-broadband-modem-qmi.c | 24 ++++++------------------ + 1 file changed, 6 insertions(+), 18 deletions(-) + +commit 55c3e162b12c741999e8532950904ed945b0041b +Author: Ben Chan +Date: Tue Jul 11 16:14:59 2017 -0700 + + broadband-modem-qmi: port modem_load_unlock_required to use GTask + + src/mm-broadband-modem-qmi.c | 117 + ++++++++++++++++++++++--------------------- + 1 file changed, 59 insertions(+), 58 deletions(-) + +commit 2ba17be8b6a8472797b37abfbf05eecd0dd4a65a +Author: Ben Chan +Date: Tue Jul 11 14:38:44 2017 -0700 + + broadband-modem-qmi: port modem_create_bearer to use GTask + + src/mm-broadband-modem-qmi.c | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +commit 2aaac123ac971537b9a42e225eb9129e2ac05fec +Author: Ben Chan +Date: Tue Jul 11 14:14:58 2017 -0700 + + broadband-modem-qmi: port messaging_load_supported_storages to + use GTask + + src/mm-broadband-modem-qmi.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit bf9e5cdfeb73e678fbe716fc4334a9c1d9aae417 +Author: Ben Chan +Date: Tue Jul 11 14:13:14 2017 -0700 + + broadband-modem-qmi: port messaging_check_support to use GTask + + src/mm-broadband-modem-qmi.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit 30dfe3055e8e9561c8956d77c5574ad6c889c335 +Author: Ben Chan +Date: Tue Jul 11 13:09:15 2017 -0700 + + broadband-modem-qmi: port signal_check_support to use GTask + + src/mm-broadband-modem-qmi.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +commit e9ee49d583c4108022817338da7111dcd582f45a +Author: Ben Chan +Date: Tue Jul 11 13:03:36 2017 -0700 + + broadband-modem-qmi: port oma_check_support to use GTask + + src/mm-broadband-modem-qmi.c | 17 ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +commit 3e91956d0cf4161a8b0443d3863599a06781dbf8 +Author: Ben Chan +Date: Tue Jul 11 14:08:51 2017 -0700 + + broadband-modem-qmi: port location_load_capabilities to use GTask + + src/mm-broadband-modem-qmi.c | 35 ++++++++++++++++------------------- + 1 file changed, 16 insertions(+), 19 deletions(-) + +commit d99398b05519df21a9bfc84e5c3de232e892bd0f +Author: Ben Chan +Date: Tue Jul 11 12:48:13 2017 -0700 + + broadband-modem-qmi: port enable_location_gathering to use GTask + + src/mm-broadband-modem-qmi.c | 173 + ++++++++++++++++++++++++------------------- + 1 file changed, 96 insertions(+), 77 deletions(-) + +commit 07d922e250e2d8d47ebfad0ad39de23f47cc390b +Author: Ben Chan +Date: Tue Jul 11 14:01:05 2017 -0700 + + broadband-modem-qmi: port firmware_load_list to use GTask + + src/mm-broadband-modem-qmi.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +commit af2f87d2f2471f532aa4586d9243b622ee6434cf +Author: Ben Chan +Date: Tue Jul 11 14:05:39 2017 -0700 + + broadband-modem-qmi: port firmware_load_current to use GTask + + src/mm-broadband-modem-qmi.c | 20 +++++++------------- + 1 file changed, 7 insertions(+), 13 deletions(-) + +commit 02fadb6e914030a34935af3cc5d4192f35fb5a81 +Author: Ben Chan +Date: Tue Jul 11 16:23:35 2017 -0700 + + broadband-modem-qmi: port enabling_started to use GTask + + src/mm-broadband-modem-qmi.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +commit b412ddc8b91f24db3a189092ce44ae6be31d7c98 +Author: Ben Chan +Date: Tue Jul 11 16:21:20 2017 -0700 + + broadband-modem-qmi: port initialization_started to use GTask + + src/mm-broadband-modem-qmi.c | 88 + +++++++++++++++++++++++--------------------- + 1 file changed, 46 insertions(+), 42 deletions(-) + +commit a20686c24c29f0ae1c5746f2a2ae8fb418a424f9 +Author: Ben Chan +Date: Thu Oct 19 23:14:04 2017 -0700 + + via: port modem_cdma_{setup,cleanup}_unsolicited_events to use GTask + + plugins/via/mm-broadband-modem-via.c | 40 + +++++++++++------------------------- + 1 file changed, 12 insertions(+), 28 deletions(-) + +commit 47cdad55a86e1e2657f428c85d94218f36854d7f +Author: Ben Chan +Date: Thu Oct 19 23:26:43 2017 -0700 + + anydata: port get_detailed_registration_state to use GTask + + plugins/anydata/mm-broadband-modem-anydata.c | 91 + +++++++++++----------------- + 1 file changed, 35 insertions(+), 56 deletions(-) + +commit 689dad9f6e4a08c5f68a02363703d58f6d9fbadf +Author: Aleksander Morgado +Date: Thu Oct 19 11:43:50 2017 +0200 + + base-bearer: fix reporting tx/rx stats + + The numbers were actually swapped! + + src/mm-base-bearer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 25007741c8a458567998744de87bdd55128da80f +Author: Aleksander Morgado +Date: Wed Oct 18 23:02:57 2017 +0200 + + mmcli,sim: force sync operation for the info action + + cli/mmcli-sim.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit fc40c059fa1e04006651cbccc0d3f4943e94abf7 +Author: Aleksander Morgado +Date: Sun Oct 8 10:16:54 2017 +0200 + + broadband-modem-mbim: plug memleak when querying previous unlock + retries + + ==15673== 240 (40 direct, 200 indirect) bytes in 1 blocks are + definitely lost in loss record 4,341 of 4,535 + ==15673== at 0x647F014: g_type_create_instance (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==15673== by 0x6460027: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==15673== by 0x6461A54: g_object_newv (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==15673== by 0x6462213: g_object_new (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==15673== by 0x4E97C33: mm_unlock_retries_new + (mm-unlock-retries.c:217) + ==15673== by 0x4E97A6F: mm_unlock_retries_new_from_dictionary + (mm-unlock-retries.c:171) + ==15673== by 0x170B09: mm_iface_modem_get_unlock_retries + (mm-iface-modem.c:2942) + ==15673== by 0x1DB0A4: pin_query_unlock_retries_ready + (mm-broadband-modem-mbim.c:782) + ==15673== by 0x613AD52: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==15673== by 0x613B775: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==15673== by 0x57D525D: transaction_task_complete_and_free + (mbim-device.c:246) + ==15673== by 0x57D6086: process_message (mbim-device.c:666) + + src/mm-broadband-modem-mbim.c | 1 + + 1 file changed, 1 insertion(+) + +commit 58e6f652a10e57eeea1a8ccb0c440c3171a9ba33 +Author: Aleksander Morgado +Date: Sat Oct 7 14:06:06 2017 +0200 + + base-modem: plug memleaks when building port lists + + The mm_base_modem_find_ports() method builds a list of full + references, so we need to unref them in the peek() methods. + + ==10047== 14,959 (24 direct, 14,935 indirect) bytes in 1 blocks + are definitely lost in loss record 5,470 of 5,473 + ==10047== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==10047== by 0x66E3028: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==10047== by 0x66FAB25: g_slice_alloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==10047== by 0x66D9A33: g_list_append (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==10047== by 0x15F6A7: mm_base_modem_find_ports + (mm-base-modem.c:845) + ==10047== by 0x15E9F3: mm_base_modem_peek_port_qmi_for_data + (mm-base-modem.c:579) + ==10047== by 0x15E8FC: mm_base_modem_get_port_qmi_for_data + (mm-base-modem.c:555) + ==10047== by 0x1BB99F: _connect (mm-bearer-qmi.c:1391) + ==10047== by 0x1540B4: mm_base_bearer_connect + (mm-base-bearer.c:841) + ==10047== by 0x181F4F: connection_step + (mm-iface-modem-simple.c:597) + ==10047== by 0x181321: create_bearer_ready + (mm-iface-modem-simple.c:258) + ==10047== by 0x612FD52: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + + src/mm-base-modem.c | 43 +++++++++++++++++++++++++++---------------- + 1 file changed, 27 insertions(+), 16 deletions(-) + +commit 882f6b04d6562adf471576a6ca31687066a574c1 +Author: Aleksander Morgado +Date: Wed Sep 20 22:18:53 2017 -0700 + + cinterion: port modem_create_bearer to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 142 + ++++++++++------------- + 1 file changed, 60 insertions(+), 82 deletions(-) + +commit e9f56ddf153e07278232150554ed7fa54cb1cde6 +Author: Aleksander Morgado +Date: Wed Sep 20 22:08:56 2017 -0700 + + cinterion: port after_sim_unlock to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 79 + ++++++++++++------------ + 1 file changed, 38 insertions(+), 41 deletions(-) + +commit b1948f83a5134143347010df33c2513c69ebb849 +Author: Aleksander Morgado +Date: Wed Sep 20 22:01:25 2017 -0700 + + cinterion: port load_unlock_retries_context to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 72 + ++++++++++++------------ + 1 file changed, 35 insertions(+), 37 deletions(-) + +commit e1b2b88e682d68c1554f5c8014c19fe27aebc9af +Author: Aleksander Morgado +Date: Wed Sep 20 21:54:04 2017 -0700 + + cinterion: port setup_flow_control to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 39 + +++++++++++------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 926e0176fbcbc47a44b83f826492e69af3e62226 +Author: Aleksander Morgado +Date: Wed Sep 20 21:51:49 2017 -0700 + + cinterion: port set_current_bands to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 98 + +++++++++++------------- + 1 file changed, 45 insertions(+), 53 deletions(-) + +commit ea58d359473ddc4d1539e6b94b2526949436ac81 +Author: Aleksander Morgado +Date: Wed Sep 20 21:44:42 2017 -0700 + + cinterion: port load_current_bands to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 56 + ++++++++++-------------- + 1 file changed, 23 insertions(+), 33 deletions(-) + +commit c1e17b9cad8767271b7a412e12fbe2efc9bebe75 +Author: Aleksander Morgado +Date: Wed Sep 20 21:40:41 2017 -0700 + + cinterion: port load_supported_bands to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 57 + ++++++++++-------------- + 1 file changed, 23 insertions(+), 34 deletions(-) + +commit 7f2520a83d9c824b90df3418084fc18f1e374fb6 +Author: Aleksander Morgado +Date: Wed Sep 20 21:36:10 2017 -0700 + + cinterion: port register_in_network to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 68 + ++++++++---------------- + 1 file changed, 23 insertions(+), 45 deletions(-) + +commit f9e2ebf3a0588176bd0ee52672065190cdc28d98 +Author: Aleksander Morgado +Date: Wed Sep 20 19:49:37 2017 -0700 + + cinterion: port modem_power_off to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 121 + +++++++++++++---------- + 1 file changed, 69 insertions(+), 52 deletions(-) + +commit 00aa9cd09bf7b200d3c91226187242f464c3793a +Author: Aleksander Morgado +Date: Wed Sep 20 19:24:33 2017 -0700 + + cinterion: port modem_power_down to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 80 + +++++++++++------------- + 1 file changed, 37 insertions(+), 43 deletions(-) + +commit 73f748f7acc927db51def61465a2f43be9eb8edb +Author: Aleksander Morgado +Date: Wed Sep 20 17:24:21 2017 -0700 + + cinterion: port messaging_check_support to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 54 + +++++++++++------------- + 1 file changed, 24 insertions(+), 30 deletions(-) + +commit d09f9adafeaeaeebacaf951c88a203c277d56ac6 +Author: Aleksander Morgado +Date: Wed Sep 20 17:19:32 2017 -0700 + + cinterion: port messaging_enable_unsolicited_events to GTask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 129 + +++++++++++------------ + 1 file changed, 61 insertions(+), 68 deletions(-) + +commit 7e478e408d8bf49947217dc882102ecf3bac0adc +Author: Aleksander Morgado +Date: Wed Sep 20 17:11:59 2017 -0700 + + cinterion: port plugin custom_init to GTask + + plugins/cinterion/mm-plugin-cinterion.c | 74 + +++++++++++---------------------- + 1 file changed, 25 insertions(+), 49 deletions(-) + +commit 6e68f4052b17cd145bcc7883469aac57fccf76e2 +Author: Ben Chan +Date: Fri Oct 6 20:40:11 2017 -0700 + + nokia: port load_access_technologies to use GTask + + plugins/nokia/mm-broadband-modem-nokia.c | 59 + ++++++++++---------------------- + 1 file changed, 19 insertions(+), 40 deletions(-) + +commit d4abf79e9970faf3c6cc0b611caaabf98390593b +Author: Ben Chan +Date: Fri Oct 6 20:34:47 2017 -0700 + + nokia: port enabling_modem_init to use GTask + + plugins/nokia/mm-broadband-modem-nokia.c | 56 + +++++++++++++++----------------- + 1 file changed, 26 insertions(+), 30 deletions(-) + +commit 74d8a69b4ec855c84249458416be584a5be3e4c1 +Author: Aleksander Morgado +Date: Sat Oct 7 10:50:48 2017 +0200 + + iridium: simplify a bit the saved_error logic in connect + + Note that saved_error will be freed along with the context, unless + it's set to NULL. + + plugins/iridium/mm-bearer-iridium.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +commit 3c2b974bbd5d9bc6645fa6eed93504ef84739dc1 +Author: Ben Chan +Date: Fri Oct 6 16:15:41 2017 -0700 + + iridium: port connect to use GTask + + plugins/iridium/mm-bearer-iridium.c | 99 + +++++++++++++++---------------------- + 1 file changed, 41 insertions(+), 58 deletions(-) + +commit d0bbc43fa7601c395c3208b199eaa43dc24a16c4 +Author: Ben Chan +Date: Fri Oct 6 16:04:00 2017 -0700 + + iridium: port load_operator_{code,name} to use GTask + + plugins/iridium/mm-broadband-modem-iridium.c | 47 + +++++++++++++++++----------- + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 2768df24b487b82c78b0623000c51d5a0cb30367 +Author: Ben Chan +Date: Fri Oct 6 15:59:22 2017 -0700 + + iridium: port setup_flow_control to use GTask + + plugins/iridium/mm-broadband-modem-iridium.c | 20 ++++++-------------- + 1 file changed, 6 insertions(+), 14 deletions(-) + +commit aee8bcc7489836a77bfe1c7521dd3bbc55e8f8df +Author: Ben Chan +Date: Fri Oct 6 15:31:29 2017 -0700 + + iridium: port load_supported_modes to use GTask + + plugins/iridium/mm-broadband-modem-iridium.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 164ce738476e5af8a2f44fa1967eb7f821b1579c +Author: Ben Chan +Date: Fri Oct 6 15:30:07 2017 -0700 + + iridium: port create_bearer to use GTask + + plugins/iridium/mm-broadband-modem-iridium.c | 21 +++++---------------- + 1 file changed, 5 insertions(+), 16 deletions(-) + +commit 7dc46481c51b189eac9c48c2488ab8bc25290766 +Author: Ben Chan +Date: Fri Oct 6 15:19:05 2017 -0700 + + pantech: port modem_after_sim_unlock to use GTask + + plugins/pantech/mm-broadband-modem-pantech.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +commit f8a375b1fa3c9d5f8b3f0a7f39d0576baa01436c +Author: Ben Chan +Date: Tue Oct 3 22:30:49 2017 -0700 + + broadband-modem-mbim: use device manufacturer information when + available + + MBIM modems can be supported by the 'generic' plugin. Instead of + treating the plugin name (i.e. Generic) as the manufacturer, it's more + useful to use the manufacturer information reported by the underlying + USB device if that is available. + + src/mm-broadband-modem-mbim.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 3a0d658b5d8eef55fdc5ad8c07dcb2c7f2e86453 +Author: Ben Chan +Date: Tue Sep 19 22:25:34 2017 -0700 + + kerneldevice: add method to retrieve manufacturer information + + A USB device may report its manufacturer through the Manufacturer + String + Descriptor. That information can sometimes be useful, e.g. MBIM + doesn't + define a standard command to query the manufacturer. This patch adds a + method to MMKernelDevice to retrieve the manufacturer information from + the underlying physical device, which can later be used by + MMBroadbandModemMbim to report the manufacturer of a MBIM modem. + + src/kerneldevice/mm-kernel-device-generic.c | 39 + ++++++++++++++++++----------- + src/kerneldevice/mm-kernel-device-udev.c | 16 ++++++++++++ + src/kerneldevice/mm-kernel-device.c | 10 ++++++++ + src/kerneldevice/mm-kernel-device.h | 9 ++++--- + 4 files changed, 56 insertions(+), 18 deletions(-) + +commit bee3f063b44ef4e1476663a30ec673d69b47a442 +Author: Ben Chan +Date: Fri Oct 6 21:09:43 2017 -0700 + + anydata: remove unused 'port' field in + DetailedRegistrationStateContext + + The 'port' field in DetailedRegistrationStateContext is initialized to + NULL but never updated or used. + + When detailed_registration_state_context_complete_and_free() calls + g_object_unref() on the NULL 'port' field, an assertion is raised. + + plugins/anydata/mm-broadband-modem-anydata.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 1e4769257368c681cea6e109a18ed9ff113b2b57 +Author: Ben Chan +Date: Fri Oct 6 18:05:36 2017 -0700 + + simtech: fix memory leak + + plugins/simtech/mm-broadband-modem-simtech.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 25f37fd613386ab135008dfb97946710ba3674cf +Author: Ben Chan +Date: Fri Oct 6 18:05:35 2017 -0700 + + wavecom: fix memory leak + + plugins/wavecom/mm-broadband-modem-wavecom.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 6967cbfd55f4eeef6bd2990726956c5c2d07a169 +Author: Ben Chan +Date: Fri Oct 6 01:53:24 2017 -0700 + + linktop: port set_current_modes to use GTask + + plugins/linktop/mm-broadband-modem-linktop.c | 39 + ++++++++++++---------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 1e75e7e3d975c0b6f604a86c23adc18f4f51f2a9 +Author: Ben Chan +Date: Fri Oct 6 01:50:25 2017 -0700 + + linktop: port load_supported_modes to use GTask + + plugins/linktop/mm-broadband-modem-linktop.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit efaa780de20d0631f978781109900739f36126f0 +Author: Aleksander Morgado +Date: Fri Oct 6 10:51:01 2017 +0200 + + port-qmi: don't allow client allocation if port is closed + + The internal QmiDevice will be gone when the port is closed, so we + cannot really do anything. + + This avoid an issue happening when the modem goes away in the middle + of the client allocation logic performed by MMBroadbandModemQmi: + + ModemManager[24820]: [1507279407.225777] Couldn't allocate + client for service 'wms': Couldn't create client for service + 'wms': CID allocation failed in the CTL client: Transaction + timed out + ModemManager[24820]: qmi_device_allocate_client: assertion + 'QMI_IS_DEVICE (self)' failed + ==24820== + ==24820== Process terminating with default action of signal 5 + (SIGTRAP): dumping core + ==24820== at 0x66E3411: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==24820== by 0x66E46FA: g_logv (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==24820== by 0x66E484E: g_log (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==24820== by 0x538E259: qmi_device_allocate_client + (qmi-device.c:1008) + ==24820== by 0x1F5690: mm_port_qmi_allocate_client + (mm-port-qmi.c:157) + ==24820== by 0x1D20BA: allocate_next_client + (mm-broadband-modem-qmi.c:11319) + ==24820== by 0x1D2027: qmi_port_allocate_client_ready + (mm-broadband-modem-qmi.c:11306) + ==24820== by 0x612FD52: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==24820== by 0x6130775: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==24820== by 0x1F54E8: allocate_client_ready + (mm-port-qmi.c:113) + ==24820== by 0x612FD52: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==24820== by 0x6130775: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + + src/mm-port-qmi.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +commit fd2bfb7e85f1924f70c50b7e0d21ef5fe3caef38 +Author: Ben Chan +Date: Thu Oct 5 23:26:55 2017 -0700 + + novatel-lte: implement load_unlock_retries + + This patch implements load_unlock_retries() for the Novatel LTE + modem by + using the AT$NWPINR? command to query the number of retries left for + entering PIN1 or PIN2. + + Ported from the original patch by Arman Uguray + : + https://chromium-review.googlesource.com/c/58118 + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 65 + ++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit 01ba79b70b835777b90723391da4d044437ddc9c +Author: Aleksander Morgado +Date: Wed Sep 13 16:44:34 2017 +0200 + + simtech: port 3gpp_{setup|cleanup}_unsolicited_messages to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 55 + ++++++++++------------------ + 1 file changed, 19 insertions(+), 36 deletions(-) + +commit c04160817abd5681e312f9b559f01b49e867d5b9 +Author: Aleksander Morgado +Date: Wed Sep 13 16:36:08 2017 +0200 + + simtech: port 3gpp_enable_unsolicited_events to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 45 + +++++++++++----------------- + 1 file changed, 18 insertions(+), 27 deletions(-) + +commit e7fbf6fc5603ee6ebc14cde5f82d61730eb8a57c +Author: Aleksander Morgado +Date: Wed Sep 13 16:30:51 2017 +0200 + + simtech: port 3gpp_disable_unsolicited_events to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 37 + +++++++++++----------------- + 1 file changed, 14 insertions(+), 23 deletions(-) + +commit df4abdec1537e5a472138e9a4439af5eacf3947c +Author: Aleksander Morgado +Date: Wed Sep 13 16:25:29 2017 +0200 + + simtech: port load_access_technologies to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 72 + ++++++++++++---------------- + 1 file changed, 31 insertions(+), 41 deletions(-) + +commit cda7deea3d8b920353c28626399d5d3256ababc6 +Author: Aleksander Morgado +Date: Wed Sep 13 16:16:27 2017 +0200 + + simtech: port load_supported_modes to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 44 + ++++++++++++---------------- + 1 file changed, 18 insertions(+), 26 deletions(-) + +commit bf83bb75772a127b0731ac09766a7f7f54fe5e8c +Author: Aleksander Morgado +Date: Wed Sep 13 16:11:16 2017 +0200 + + simtech: port load_current_modes to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 125 + ++++++++++++--------------- + 1 file changed, 57 insertions(+), 68 deletions(-) + +commit 9c1f9023e3ab167bf35c9130eec66346ce8b3607 +Author: Aleksander Morgado +Date: Wed Sep 13 14:35:09 2017 +0200 + + simtech: port set_current_modes to GTask + + plugins/simtech/mm-broadband-modem-simtech.c | 96 + ++++++++++++---------------- + 1 file changed, 41 insertions(+), 55 deletions(-) + +commit d9de874db3a23689f82337bc889ee47bcee15de0 +Author: Aleksander Morgado +Date: Wed Sep 13 22:30:03 2017 +0200 + + thuraya: port load_supported_modes to GTask + + plugins/thuraya/mm-broadband-modem-thuraya.c | 30 + ++++++++++++---------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +commit e072f4bc7731a2a4710de7be42dadcb54508a01d +Author: Aleksander Morgado +Date: Wed Sep 13 22:28:27 2017 +0200 + + thuraya: port messaging_load_supported_storages to GTask + + plugins/thuraya/mm-broadband-modem-thuraya.c | 66 + ++++++++++++---------------- + 1 file changed, 27 insertions(+), 39 deletions(-) + +commit 0714c01d036b360c5999863fc07bdd07c4606583 +Author: Aleksander Morgado +Date: Wed Sep 13 22:20:54 2017 +0200 + + thuraya: port load_operator_{name|code} to GTask + + plugins/thuraya/mm-broadband-modem-thuraya.c | 52 + ++++++++++++++++------------ + 1 file changed, 29 insertions(+), 23 deletions(-) + +commit 23124fc6e95dd344d6920516faa4db58ffda2524 +Author: Aleksander Morgado +Date: Wed Sep 13 22:11:45 2017 +0200 + + dell: port custom_init to GTask + + plugins/dell/mm-plugin-dell.c | 201 + +++++++++++++++++++++--------------------- + 1 file changed, 101 insertions(+), 100 deletions(-) + +commit a1d355784bfbe802322c781632a1f393a93cedef +Author: Aleksander Morgado +Date: Wed Sep 13 23:00:06 2017 +0200 + + via: port get_detailed_registration_state() to GTask + + plugins/via/mm-broadband-modem-via.c | 164 + ++++++++++++++++------------------- + 1 file changed, 73 insertions(+), 91 deletions(-) + +commit 0c8842695ffd0dea5ae1213bc0bf2c73473bcb19 +Author: Aleksander Morgado +Date: Wed Sep 13 22:40:58 2017 +0200 + + via: port cdma_setup_registration_checks to GTask + + plugins/via/mm-broadband-modem-via.c | 88 + +++++++++++++++++------------------- + 1 file changed, 41 insertions(+), 47 deletions(-) + +commit d1436ac0c6ad594e25803f96e522c81d043d7e1d +Author: Aleksander Morgado +Date: Wed Sep 13 21:47:12 2017 +0200 + + altair: port 3gpp_register_in_network to GTask + + And also use mm_base_modem_at_command() instead of the full() version, + as we're anyway mm_base_modem_peek_best_at_port(). + + This commit also fixes the logic where we make sure the finish() + method completes the GTask that is created in the async method + originally. + + plugins/altair/mm-broadband-modem-altair-lte.c | 70 + +++++++++++++++----------- + 1 file changed, 42 insertions(+), 28 deletions(-) + +commit 4bd15362c569eb2814dfc449591bde7083daeecb +Author: Aleksander Morgado +Date: Thu Oct 5 23:44:30 2017 +0200 + + kerneldevice,generic: plug memleak + + ==5075== 198 bytes in 18 blocks are definitely lost in loss + record 4,486 of 4,761 + ==5075== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==5075== by 0x66E3028: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==5075== by 0x66CAD42: g_path_get_basename (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==5075== by 0x20BB7B: preload_interface_sysfs_path + (mm-kernel-device-generic.c:184) + ==5075== by 0x20C885: preload_contents + (mm-kernel-device-generic.c:383) + ==5075== by 0x20E2E1: check_preload + (mm-kernel-device-generic.c:830) + ==5075== by 0x20EA6F: set_property + (mm-kernel-device-generic.c:953) + ==5075== by 0x6455359: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==5075== by 0x6456DBC: g_object_new_valist (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==5075== by 0x6105E95: g_initable_new_valist (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==5075== by 0x6105F58: g_initable_new (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==5075== by 0x20E848: mm_kernel_device_generic_new_with_rules + (mm-kernel-device-generic.c:901) + + src/kerneldevice/mm-kernel-device-generic.c | 1 + + 1 file changed, 1 insertion(+) + +commit 8cd21e439d568fd7df4a0596b03cdb1e627b18c4 +Author: Aleksander Morgado +Date: Thu Oct 5 23:42:55 2017 +0200 + + kerneldevice,generic: plug memleak + + ==5075== 333 bytes in 37 blocks are definitely lost in loss + record 4,612 of 4,761 + ==5075== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==5075== by 0x66E3028: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==5075== by 0x66CAD42: g_path_get_basename (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==5075== by 0x20BE20: preload_driver + (mm-kernel-device-generic.c:242) + ==5075== by 0x20C8E5: preload_contents + (mm-kernel-device-generic.c:391) + ==5075== by 0x20E2E1: check_preload + (mm-kernel-device-generic.c:830) + ==5075== by 0x20EA6F: set_property + (mm-kernel-device-generic.c:953) + ==5075== by 0x6455359: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==5075== by 0x6456DBC: g_object_new_valist (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==5075== by 0x6105E95: g_initable_new_valist (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==5075== by 0x6105F58: g_initable_new (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==5075== by 0x20E848: mm_kernel_device_generic_new_with_rules + (mm-kernel-device-generic.c:901) + + src/kerneldevice/mm-kernel-device-generic.c | 1 + + 1 file changed, 1 insertion(+) + +commit 2dc13fd9643d056a83df4c3a64987b52208fd8e4 +Author: Aleksander Morgado +Date: Thu Oct 5 23:36:05 2017 +0200 + + plugin-manager: allow multiple calls to port_context_complete() + + Only the first one will work. + + src/mm-plugin-manager.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit bbe50645916c4596cf7c7b309aac267d396801b8 +Author: Aleksander Morgado +Date: Thu Oct 5 23:29:13 2017 +0200 + + plugin-manager: ensure valid reference during cancellation + + Cancelling the port_context->cancellable may end up finishing the + async task and completing the last reference of the port + context. Avoid that by making sure we hold a valid reference for as + long as we may need it. + + ==2277== Invalid read of size 4 + ==2277== at 0x14ACE2: port_context_cancel + (mm-plugin-manager.c:547) + ==2277== by 0x14C32E: device_context_port_released + (mm-plugin-manager.c:1142) + ==2277== by 0x83831C7: ffi_call_unix64 (in + /usr/lib/libffi.so.6.0.4) + ==2277== by 0x8382C29: ffi_call (in /usr/lib/libffi.so.6.0.4) + ==2277== by 0x64506A8: g_cclosure_marshal_generic (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x644FEAC: g_closure_invoke (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x64624AD: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x646AC84: g_signal_emit_valist (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x646B69E: g_signal_emit (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x1483E7: mm_device_release_port (mm-device.c:196) + ==2277== by 0x145D5D: device_removed (mm-base-manager.c:217) + ==2277== by 0x1464A9: handle_kernel_event + (mm-base-manager.c:401) + ==2277== Address 0xf677d18 is 88 bytes inside a block of size + 96 free'd + ==2277== at 0x4C2E14B: free (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==2277== by 0x14A1B7: port_context_unref + (mm-plugin-manager.c:234) + ==2277== by 0x14AB51: plugin_supports_port_ready + (mm-plugin-manager.c:492) + ==2277== by 0x612FD52: ??? (in /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== by 0x6130775: ??? (in /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== by 0x1AFDF8: port_probe_run_ready (mm-plugin.c:624) + ==2277== by 0x612FD52: ??? (in /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== by 0x6130775: ??? (in /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== by 0x6131367: g_task_return_error_if_cancelled + (in /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== by 0x1A9EDA: port_probe_task_return_error_if_cancelled + (mm-port-probe.c:109) + ==2277== by 0x1ABCD2: serial_probe_at_parse_response + (mm-port-probe.c:900) + ==2277== by 0x611E475: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==2277== Block was alloc'd at + ==2277== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==2277== by 0x66E3028: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==2277== by 0x66FAB25: g_slice_alloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==2277== by 0x66FAFB8: g_slice_alloc0 (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==2277== by 0x14B18D: port_context_new + (mm-plugin-manager.c:649) + ==2277== by 0x14C4A7: device_context_port_grabbed + (mm-plugin-manager.c:1182) + ==2277== by 0x83831C7: ffi_call_unix64 (in + /usr/lib/libffi.so.6.0.4) + ==2277== by 0x8382C29: ffi_call (in /usr/lib/libffi.so.6.0.4) + ==2277== by 0x64506A8: g_cclosure_marshal_generic (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x644FEAC: g_closure_invoke (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x64624AD: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==2277== by 0x646AC84: g_signal_emit_valist (in + /usr/lib/libgobject-2.0.so.0.5200.3) + + src/mm-plugin-manager.c | 35 +++++++++++++++++++---------------- + 1 file changed, 19 insertions(+), 16 deletions(-) + +commit 48850f21b423deee3553f24df460e45c73d049cb +Author: Aleksander Morgado +Date: Thu Oct 5 23:19:22 2017 +0200 + + port-serial: avoid invalid memory write on cancellation logic + + If the GCancellable is already cancelled when trying to connect a + signal, the callback given will be run right away, and that may end up + completing the async task and removing the last MMPortSerial + reference. + + ==30627== Invalid write of size 8 + ==30627== at 0x1ED43B: port_serial_queue_process + (mm-port-serial.c:812) + ==30627== by 0x66DE342: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DD8C4: g_main_context_dispatch (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DDC87: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DDFA1: g_main_loop_run (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x143F9B: main (main.c:180) + ==30627== Address 0xf6f0e98 is 200 bytes inside a block of size + 328 free'd + ==30627== at 0x4C2E14B: free (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==30627== by 0x64742B2: g_type_free_instance (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==30627== by 0x1ED0F2: port_serial_got_response + (mm-port-serial.c:704) + ==30627== by 0x1ED21B: port_serial_response_wait_cancelled + (mm-port-serial.c:757) + ==30627== by 0x60E1A81: g_cancellable_connect (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==30627== by 0x1ED43A: port_serial_queue_process + (mm-port-serial.c:812) + ==30627== by 0x66DE342: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DD8C4: g_main_context_dispatch (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DDC87: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DDFA1: g_main_loop_run (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x143F9B: main (main.c:180) + ==30627== Block was alloc'd at + ==30627== at 0x4C2CE5F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==30627== by 0x66E3028: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66FAB25: g_slice_alloc (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66FAFB8: g_slice_alloc0 (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x6473FB5: g_type_create_instance (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==30627== by 0x6455027: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==30627== by 0x6456DBC: g_object_new_valist (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==30627== by 0x6457200: g_object_new (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==30627== by 0x1F253A: mm_port_serial_at_new + (mm-port-serial-at.c:533) + ==30627== by 0x1AC7E7: serial_open_at (mm-port-probe.c:1210) + ==30627== by 0x66DD8C4: g_main_context_dispatch (in + /usr/lib/libglib-2.0.so.0.5200.3) + ==30627== by 0x66DDC87: ??? (in + /usr/lib/libglib-2.0.so.0.5200.3) + + src/mm-port-serial.c | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit 54b21292b1dee863075ed8074526676df2d836bf +Author: Aleksander Morgado +Date: Thu Oct 5 22:59:55 2017 +0200 + + base-manager: plug memleak + + ==28888== 622 (280 direct, 342 indirect) bytes in 7 blocks are + definitely lost in loss record 2,515 of 2,548 + ==28888== at 0x6474014: g_type_create_instance (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==28888== by 0x6455027: ??? (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==28888== by 0x6456A54: g_object_newv (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==28888== by 0x6457213: g_object_new (in + /usr/lib/libgobject-2.0.so.0.5200.3) + ==28888== by 0x4E9DD7D: mm_kernel_event_properties_new + (mm-kernel-event-properties.c:422) + ==28888== by 0x4E9D8BC: + mm_kernel_event_properties_new_from_string + (mm-kernel-event-properties.c:283) + ==28888== by 0x1465D7: process_initial_kernel_events + (mm-base-manager.c:555) + ==28888== by 0x14679E: mm_base_manager_start + (mm-base-manager.c:581) + ==28888== by 0x143CF3: name_acquired_cb (main.c:110) + ==28888== by 0x616B805: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==28888== by 0x616BA47: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + ==28888== by 0x612FD52: ??? (in + /usr/lib/libgio-2.0.so.0.5200.3) + + src/mm-base-manager.c | 1 + + 1 file changed, 1 insertion(+) + +commit 5bb205d3518ef85ad4e4ace8a3aeaefcbbb6b5d6 +Author: Aleksander Morgado +Date: Thu Oct 5 22:38:06 2017 +0200 + + kerneldevice,generic: avoid segfault when reported device doesn't + exist + + Could be a user error or a race condition. In any case, we shouldn't + crash. + + ModemManager[19677]: [1507235472.301934] Kernel event + reported: + ModemManager[19677]: [1507235472.301944] action: add + ModemManager[19677]: [1507235472.301953] subsystem: + usbmisc + ModemManager[19677]: [1507235472.301962] name: + cdc-wdm0 + ModemManager[19677]: [1507235472.301970] uid: n/a + ModemManager[19677]: [1507235472.301984] + (usbmisc/cdc-wdm0) preloading contents and properties... + ModemManager[19677]: [1507235472.302007] Invalid sysfs + path read for usbmisc/cdc-wdm0 + ModemManager[19677]: [1507235472.302017] + (usbmisc/cdc-wdm0) interface class: 0x00 + ModemManager[19677]: [1507235472.302027] + (usbmisc/cdc-wdm0) interface subclass: 0x00 + ModemManager[19677]: [1507235472.302037] + (usbmisc/cdc-wdm0) interface protocol: 0x00 + ModemManager[19677]: [1507235472.302046] + (usbmisc/cdc-wdm0) interface number (ID_USB_INTERFACE_NUM): 0x00 + ModemManager[19677]: [1507235472.302059] + (usbmisc/cdc-wdm0) manufacturer: unknown + ModemManager[19677]: [1507235472.302069] + (usbmisc/cdc-wdm0) product: unknown + ModemManager[19677]: [1507235472.302078] + (usbmisc/cdc-wdm0) vid: unknown + ModemManager[19677]: [1507235472.302088] + (usbmisc/cdc-wdm0) pid: unknown + + (ModemManager:19677): GLib-CRITICAL **: g_str_has_prefix: + assertion 'str != NULL' failed + + (ModemManager:19677): GLib-CRITICAL **: g_str_has_prefix: + assertion 'str != NULL' failed + + (ModemManager:19677): GLib-CRITICAL **: g_str_has_prefix: + assertion 'str != NULL' failed + + (ModemManager:19677): GLib-CRITICAL **: g_str_has_prefix: + assertion 'str != NULL' failed + + Thread 1 "ModemManager" received signal SIGSEGV, Segmentation + fault. + + src/kerneldevice/mm-kernel-device-generic.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 71730509ee0f84fed250cd79c9384df5fa2f0c77 +Author: Aleksander Morgado +Date: Thu Oct 5 12:32:17 2017 +0200 + + port-probe: avoid deadlock trying to disconnect cancellable + + We cannot in any way try to disconnect a GCancellable from within a + cancellation handler, or we'll deadlock. + + Thread 1 (Thread 0x7fe98bf25700 (LWP 12079)): + #0 0x00007fe98a355f36 in pthread_cond_wait@@GLIBC_2.3.2 () + from /lib/libpthread.so.0 + #1 0x00007fe98a7f5ac0 in g_cond_wait () from + /usr/lib/libglib-2.0.so.0 + #2 0x00007fe98ad14650 in g_cancellable_disconnect () from + /usr/lib/libgio-2.0.so.0 + #3 0x000000000045be5d in port_probe_run_context_free () + #4 0x00007fe98ad519ed in g_task_finalize () from + /usr/lib/libgio-2.0.so.0 + #5 0x00007fe98aaaa7b3 in g_object_unref () from + /usr/lib/libgobject-2.0.so.0 + #6 0x000000000045b5f8 in + port_probe_task_return_error_if_cancelled () + #7 0x000000000045c57d in serial_probe_at_parse_response () + #8 0x00007fe98ad42ed2 in g_simple_async_result_complete () + from /usr/lib/libgio-2.0.so.0 + #9 0x0000000000485c7d in serial_command_ready () + #10 0x00007fe98ad42ed2 in g_simple_async_result_complete () + from /usr/lib/libgio-2.0.so.0 + #11 0x0000000000482345 in command_context_complete_and_free () + #12 0x0000000000482fa5 in port_serial_got_response () + #13 0x00000000004830f5 in port_serial_response_wait_cancelled () + #14 0x00007fe98aaa70c5 in g_closure_invoke () from + /usr/lib/libgobject-2.0.so.0 + #15 0x00007fe98aab47ce in signal_emit_unlocked_R () from + /usr/lib/libgobject-2.0.so.0 + #16 0x00007fe98aabb595 in g_signal_emit_valist () from + /usr/lib/libgobject-2.0.so.0 + #17 0x00007fe98aabb662 in g_signal_emit () from + /usr/lib/libgobject-2.0.so.0 + #18 0x00007fe98ad144c5 in g_cancellable_cancel () from + /usr/lib/libgio-2.0.so.0 + #19 0x00007fe98aaa70c5 in g_closure_invoke () from + /usr/lib/libgobject-2.0.so.0 + #20 0x00007fe98aab47ce in signal_emit_unlocked_R () from + /usr/lib/libgobject-2.0.so.0 + #21 0x00007fe98aabb595 in g_signal_emit_valist () from + /usr/lib/libgobject-2.0.so.0 + #22 0x00007fe98aabb662 in g_signal_emit () from + /usr/lib/libgobject-2.0.so.0 + #23 0x00007fe98ad144c5 in g_cancellable_cancel () from + /usr/lib/libgio-2.0.so.0 + #24 0x000000000042e9f6 in port_context_cancel () + #25 0x00007fe989b99a4c in ffi_call_unix64 () at + ../src/x86/unix64.S:75 + #26 0x00007fe989b994b9 in ffi_call (cif=0x7fffc41dcdb0, + fn=0x42ea40 , rvalue=, avalue=0x7fffc41dccd0) at ../src/x86/ffi64.c:492 + #27 0x00007fe98aaa7700 in g_cclosure_marshal_generic () from + /usr/lib/libgobject-2.0.so.0 + #28 0x00007fe98aaa70c5 in g_closure_invoke () from + /usr/lib/libgobject-2.0.so.0 + #29 0x00007fe98aab47ce in signal_emit_unlocked_R () from + /usr/lib/libgobject-2.0.so.0 + #30 0x00007fe98aabb595 in g_signal_emit_valist () from + /usr/lib/libgobject-2.0.so.0 + #31 0x00007fe98aabb662 in g_signal_emit () from + /usr/lib/libgobject-2.0.so.0 + #32 0x000000000042c8f0 in mm_device_release_port () + #33 0x000000000042a6cb in device_removed () + #34 0x000000000042af94 in handle_kernel_event () + #35 0x000000000042b356 in report_kernel_event_auth_ready () + #36 0x00007fe98ad51783 in g_task_return_now () from + /usr/lib/libgio-2.0.so.0 + #37 0x00007fe98ad517b9 in complete_in_idle_cb () from + /usr/lib/libgio-2.0.so.0 + #38 0x00007fe98a7bda5e in g_main_context_dispatch () from + /usr/lib/libglib-2.0.so.0 + #39 0x00007fe98a7bddb8 in g_main_context_iterate.isra () from + /usr/lib/libglib-2.0.so.0 + #40 0x00007fe98a7be042 in g_main_loop_run () from + /usr/lib/libglib-2.0.so.0 + #41 0x0000000000428dc4 in main () + + So, just clear the cancellation id before going on with the handler + logic. + + src/mm-port-probe.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit 3e15dc15efd118a2e7af8f60727afc7fbb7db3a3 +Author: Dan Williams +Date: Mon Oct 2 10:42:33 2017 -0500 + + bearer-mbim: don't crash when modem doesn't send gateways + + When the Ericsson F5321 with firmware R3C11/R4D04 is told to make + an IPv6-only connection, it reports that it has IPv4 configuration + but then returns no actual addresses. Check both the flags and + actual data before trying to use them. + + ModemManager[25850]: [1506958721.914717] IPv4 configuration + available: 'address, gateway, dns, mtu' + ModemManager[25850]: [1506958721.914731] IP addresses (0) + ModemManager[25850]: [1506958721.914741] DNS addresses (0) + ModemManager[25850]: [1506958721.914748] MTU: '0' + ModemManager[25850]: [1506958721.914758] IPv6 configuration + available: 'address, dns, mtu' + ModemManager[25850]: [1506958721.914767] IP addresses (1) + ModemManager[25850]: [1506958721.914852] IP [0]: + 'fe80::39:f622:7d01/64' + ModemManager[25850]: [1506958721.914866] DNS addresses (2) + ModemManager[25850]: [1506958721.914883] DNS [0]: + 'fd00:976a::9' + ModemManager[25850]: [1506958721.914896] MTU: '1500' + ModemManager[25850]: [1506958721.914947] (wwp0s20u1i6): + port now connected + + src/mm-bearer-mbim.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit b252ab668f705cf23694ca693f524e2292320a56 +Author: Aleksander Morgado +Date: Thu Sep 28 21:20:33 2017 +0200 + + build,tests: make sure tests are rebuilt if helper libs are updated + + src/tests/Makefile.am | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 280b72f15efb7269613ff2d9a86bb9585241ea92 +Author: Aleksander Morgado +Date: Thu Sep 28 11:04:55 2017 +0200 + + mbm: remove unused struct member + + plugins/mbm/mm-sim-mbm.c | 1 - + 1 file changed, 1 deletion(-) + +commit 6847fb48f6067d0eda547022aa0b794e46034038 +Author: Aleksander Morgado +Date: Thu Sep 28 10:58:00 2017 +0200 + + mbm: no need to re-set self pointer + + plugins/mbm/mm-broadband-modem-mbm.c | 2 -- + 1 file changed, 2 deletions(-) + +commit e0a3eeee5dd76fc5e8f6cea01dfc9327e194ca83 +Author: Ben Chan +Date: Tue Sep 26 06:08:19 2017 -0700 + + mbm: port get_ip_config_3gpp to use GTask + + plugins/mbm/mm-broadband-bearer-mbm.c | 77 + ++++++++++++----------------------- + 1 file changed, 27 insertions(+), 50 deletions(-) + +commit a910c45c086c821e848eb6c04a5e3254c30a30b9 +Author: Ben Chan +Date: Tue Sep 26 06:00:39 2017 -0700 + + mbm: port {enable,disable}_location_gathering to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 114 + +++++++++++++++++------------------ + 1 file changed, 56 insertions(+), 58 deletions(-) + +commit 414aac95101d38526842bb6418d9543425ac188e +Author: Ben Chan +Date: Tue Sep 26 05:51:41 2017 -0700 + + mbm: port location_load_capabilities to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 39 + ++++++++++++++++-------------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit d19593d344e64f8c669207bfe7e026e350075f15 +Author: Ben Chan +Date: Tue Sep 26 05:48:31 2017 -0700 + + mbm: port modem_3gpp_disable_unsolicited_events to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit f79719c518bae0e3a62dcee1fd42023a023a4fd6 +Author: Ben Chan +Date: Tue Sep 26 05:47:09 2017 -0700 + + mbm: port modem_3gpp_enable_unsolicited_events to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit 4454f840bc483ff503fafbe95dec9058bfa0e1e5 +Author: Ben Chan +Date: Tue Sep 26 05:45:26 2017 -0700 + + mbm: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 40 + +++++++++++------------------------- + 1 file changed, 12 insertions(+), 28 deletions(-) + +commit a0e3a889b03d7d072674b1938a12880dfa500570 +Author: Ben Chan +Date: Tue Sep 26 05:42:10 2017 -0700 + + mbm: port enabling_modem_init to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 59 + ++++++++++++++---------------------- + 1 file changed, 23 insertions(+), 36 deletions(-) + +commit 0b37db42b441d036291369497644f47f59be63d4 +Author: Ben Chan +Date: Tue Sep 26 05:36:50 2017 -0700 + + mbm: port set_current_modes to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 56 + +++++++++++++++--------------------- + 1 file changed, 23 insertions(+), 33 deletions(-) + +commit 43bf7c764b44dff0eedf2a6a99a57a975f882563 +Author: Ben Chan +Date: Tue Sep 26 05:33:10 2017 -0700 + + mbm: port modem_after_sim_unlock to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 2e7aff84a62dfcedaaf22e47a42ea6bb152e8421 +Author: Ben Chan +Date: Tue Sep 26 05:31:52 2017 -0700 + + mbm: port modem_create_bearer to use GTask + + plugins/mbm/mm-broadband-modem-mbm.c | 28 +++++++--------------------- + 1 file changed, 7 insertions(+), 21 deletions(-) + +commit 9f573d3bcf8f5f28093c33a001851e80458c928a +Author: Ben Chan +Date: Tue Sep 26 05:29:45 2017 -0700 + + mbm: port common_send_pin_puk to use GTask + + plugins/mbm/mm-sim-mbm.c | 67 + +++++++++++++++++++++++++----------------------- + 1 file changed, 35 insertions(+), 32 deletions(-) + +commit 5769d52d3b35a3e026561790a53b4244a8b3e270 +Author: Ben Chan +Date: Wed Sep 27 22:08:01 2017 -0700 + + x22x: port x22x_custom_init to use GTask + + plugins/x22x/mm-plugin-x22x.c | 88 + ++++++++++++++++++++----------------------- + 1 file changed, 40 insertions(+), 48 deletions(-) + +commit 1f6e7c99315cbedc4cbb7ea9b4c143f21510de34 +Author: Ben Chan +Date: Wed Sep 27 21:59:28 2017 -0700 + + x22x: port set_current_modes to use GTask + + plugins/x22x/mm-broadband-modem-x22x.c | 39 + +++++++++++++++------------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 4e3a6b4eb53a58ea7609d90647b46d51e8c3c79e +Author: Ben Chan +Date: Wed Sep 27 21:55:58 2017 -0700 + + x22x: port load_supported_modes to use GTask + + plugins/x22x/mm-broadband-modem-x22x.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit fea6835592ddc12f4cd25c231169e4620ec756f9 +Author: Ben Chan +Date: Wed Sep 20 23:18:05 2017 -0700 + + mtk: port disable_unsolicited_events to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 44 + +++++++++++++++--------------------- + 1 file changed, 18 insertions(+), 26 deletions(-) + +commit fe58e5f498e020c376fcc757dcd0f6980a4210b7 +Author: Ben Chan +Date: Wed Sep 20 23:15:46 2017 -0700 + + mtk: port enable_unsolicited_events to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 43 + ++++++++++++++---------------------- + 1 file changed, 17 insertions(+), 26 deletions(-) + +commit bfac21fbb88f8a4b8a0a72b1b5d0b3f53f94c082 +Author: Ben Chan +Date: Wed Sep 20 22:42:23 2017 -0700 + + mtk: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 40 + +++++++++++------------------------- + 1 file changed, 12 insertions(+), 28 deletions(-) + +commit 42bde89bae1f315177f654a1186101b3d3901c07 +Author: Ben Chan +Date: Wed Sep 20 22:23:17 2017 -0700 + + mtk: port modem_after_sim_unlock to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 3b2873148c996b2782f3e55377ec30de823ba8ed +Author: Ben Chan +Date: Wed Sep 20 22:37:56 2017 -0700 + + mtk: port set_current_modes to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 39 + ++++++++++++++++-------------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 996612f8dba8958bc6ddd4f0aa6257b7267e1770 +Author: Ben Chan +Date: Wed Sep 20 22:35:12 2017 -0700 + + mtk: port load_supported_modes to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 37 + ++++++++++++------------------------ + 1 file changed, 12 insertions(+), 25 deletions(-) + +commit 2991ae0e86d99f46986c983b928629264d253fa9 +Author: Ben Chan +Date: Wed Sep 20 22:21:27 2017 -0700 + + mtk: port load_unlock_retries to use GTask + + plugins/mtk/mm-broadband-modem-mtk.c | 39 + ++++++++++++------------------------ + 1 file changed, 13 insertions(+), 26 deletions(-) + +commit 766c934f549fbc285cf17294db55bad5d00b6bfd +Author: Aleksander Morgado +Date: Wed Sep 27 21:41:28 2017 +0200 + + po: add Hungarian translation + + From: Gabor Kelemen + + https://bugs.freedesktop.org/show_bug.cgi?id=103014 + + po/LINGUAS | 1 + + po/hu.po | 104 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+) + +commit 3ee1dc5fa040ef3e092f3f5cddfa8f94c2b648a1 +Author: Aleksander Morgado +Date: Tue Sep 26 15:18:27 2017 +0200 + + libmm-glib,sms: fix get|dup_data() introspection annotations + + We need to specify explicitly that the return type is an array of + guint8 elements. + + libmm-glib/mm-sms.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit bda7b9a74a73429b9b48a259450274746ab3f44f +Author: Aleksander Morgado +Date: Tue Sep 26 13:05:03 2017 +0200 + + ublox: plug memleak when parsing UAUTHREQ test + + plugins/ublox/mm-modem-helpers-ublox.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 4c36bd42d4fcbb13f7349bd50130dbc6bbf8597a +Author: Aleksander Morgado +Date: Tue Sep 26 10:40:36 2017 +0200 + + huawei: plug memleak when listing cdc-wdm AT ports + + The returned list contains full references, so make sure we unref them + before going on. Note that it's ok to return a pointer to one object + inside this list even if we're unref-ing them all, because we're sure + that the caller knows it's peek-ing a port object. + + plugins/huawei/mm-broadband-modem-huawei.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 1e318bec54da3f37901eadb2a04a4520737eb9a0 +Author: Aleksander Morgado +Date: Tue Sep 26 09:53:05 2017 +0200 + + broadband-bearer: fix object types in connect_3gpp() steps + + All the steps in the connect_3gpp() sequence are implemented as + methods in the MMBroadbandBearer class, and therefore the objects + received in the corresponding ready() methods are all bearers, not + modems. + + This issue wasn't found before because the objects received were not + really being used after all, as we were relying on the ones kept in + the context or lately in the GTask itself. + + src/mm-broadband-bearer.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit 9f9c88a72a848603e8898f8faaf48497aa545525 +Author: Ben Chan +Date: Mon Sep 18 04:14:28 2017 -0700 + + broadband-modem-qmi: support loading hardware revision + + This patch implements hardware revision loading in MMBroadbandModemQmi + using QMI DMS 'Get Hardware Revision' command. + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit a848b6c3683eb58ce0d9a84a342251150684e5cb +Author: Ben Chan +Date: Sun Sep 17 20:12:29 2017 -0700 + + broadband-modem-mbim: support loading hardware revision + + This patch implements hardware revision loading in + MMBroadbandModemMbim + by extracting the HardwareInfo field from the response to a + MBIM_CID_DEVICE_CAPS query. + + src/mm-broadband-modem-mbim.c | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +commit 4a5a73eb1e76d1d3ca42b26c8e2f1998c106ab91 +Author: Ben Chan +Date: Sun Sep 17 20:08:42 2017 -0700 + + cli: show hardware revision property of Modem interface + + cli/mmcli-modem.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 9c6a1ebb1e9864edba2279d0a90986db684af1a4 +Author: Ben Chan +Date: Sun Sep 17 19:58:15 2017 -0700 + + libmm-glib: add helpers for loading hardware revision + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 ++ + libmm-glib/mm-modem.c | 41 + +++++++++++++++++++++++ + libmm-glib/mm-modem.h | 3 ++ + 3 files changed, 46 insertions(+) + +commit daa59aeb4ca4a3c55307eeca894f2feefed1e7c1 +Author: Ben Chan +Date: Sun Sep 17 19:45:27 2017 -0700 + + iface-modem: add hook to load hardware revision + + src/mm-iface-modem.c | 18 ++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 26 insertions(+) + +commit e32510418a5d3a10d87d6ae49cd4e1ec9b7b0e38 +Author: Ben Chan +Date: Sun Sep 17 19:58:11 2017 -0700 + + api,introspection: new 'HardwareRevision' property + + This property will let the clients know the hardware revision reported + by the modem. + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +++ + introspection/org.freedesktop.ModemManager1.Modem.xml | 7 +++++++ + 2 files changed, 10 insertions(+) + +commit 795ecad0e6e439267ea327fbddd84a06cba402e4 +Author: Ben Chan +Date: Tue Sep 19 03:46:12 2017 -0700 + + hso: port disconnect_3gpp to use GTask + + plugins/option/mm-broadband-bearer-hso.c | 26 ++++++++++---------------- + 1 file changed, 10 insertions(+), 16 deletions(-) + +commit ee80e1f6603532be9b5989a8e247043deea54fc1 +Author: Ben Chan +Date: Tue Sep 19 03:37:21 2017 -0700 + + hso: port get_ip_config_3gpp to use GTask + + plugins/option/mm-broadband-bearer-hso.c | 62 + +++++++++++++++----------------- + 1 file changed, 28 insertions(+), 34 deletions(-) + +commit 8bae1a785a9b95fb4b72081d54cf00466b114a7d +Author: Ben Chan +Date: Tue Sep 19 03:19:21 2017 -0700 + + hso: port {enable,disable}_location_gathering to use GTask + + plugins/option/mm-broadband-modem-hso.c | 115 + ++++++++++++++++---------------- + 1 file changed, 57 insertions(+), 58 deletions(-) + +commit 227eae3f31a4acc982f37f3af7110b346c6e17a4 +Author: Ben Chan +Date: Tue Sep 19 03:12:41 2017 -0700 + + hso: port location_load_capabilities to use GTask + + plugins/option/mm-broadband-modem-hso.c | 35 + +++++++++++++-------------------- + 1 file changed, 14 insertions(+), 21 deletions(-) + +commit 616cfa9959424d9d924e4b176628e50ea752e6df +Author: Ben Chan +Date: Tue Sep 19 03:22:16 2017 -0700 + + hso: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask + + plugins/option/mm-broadband-modem-hso.c | 40 + ++++++++++----------------------- + 1 file changed, 12 insertions(+), 28 deletions(-) + +commit 0131f9b0069c326c655d9102fd87935edfd0cce8 +Author: Ben Chan +Date: Tue Sep 19 03:06:47 2017 -0700 + + hso: port modem_create_bearer to use GTask + + plugins/option/mm-broadband-modem-hso.c | 44 + +++++++++++---------------------- + 1 file changed, 15 insertions(+), 29 deletions(-) + +commit d23dd2343a52b7c011f6944f8510cc3914b1c956 +Author: Ben Chan +Date: Tue Sep 19 03:09:30 2017 -0700 + + hso: port load_unlock_retries to use GTask + + plugins/option/mm-broadband-modem-hso.c | 34 + ++++++++++++--------------------- + 1 file changed, 12 insertions(+), 22 deletions(-) + +commit a62d34c35a26312a0e565e85960d12841a53fceb +Author: Ben Chan +Date: Tue Sep 19 03:31:58 2017 -0700 + + hso: port hso_custom_init to use GTask + + plugins/option/mm-plugin-hso.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +commit 4cb6f0e5aa1038e4335e062bf2a4d0bc2d8902b6 +Author: Ben Chan +Date: Mon Sep 18 09:10:57 2017 -0700 + + broadband-modem-mbim: fix preservation logic for PIN1 unlock retries + + This patches fixes commit 334273979 "broadband-modem-mbim: preserve + unlock retries for PIN1 when appropriate", which doesn't correctly + propagate the unlock retries information for PIN1 observed from + responses to MBIM_CID_PIN set operations (see commit eb9ec1b61 + "sim-mbim: update unlock retries information after PIN operations"). + + src/mm-broadband-modem-mbim.c | 29 +++++++++++++---------------- + 1 file changed, 13 insertions(+), 16 deletions(-) + +commit 4f8e9e2e1ca25c474de8472484f6eccf9834ae67 +Author: Ben Chan +Date: Mon Sep 18 09:10:56 2017 -0700 + + iface-modem: add mm_iface_modem_get_unlock_retries helper + + This patch adds a mm_iface_modem_get_unlock_retries helper for getting + the current MMUnlockRetries value of a MMIfaceModem object, + which later + allows us to partially update (e.g. a specific MMModemLock) the + MMUnlockRetries value of a MMIfaceModem object. + + src/mm-iface-modem.c | 21 +++++++++++++++++++++ + src/mm-iface-modem.h | 2 ++ + 2 files changed, 23 insertions(+) + +commit bb5cd9b4e20e4c4657e01dd2abeaf1946067e2cb +Author: Aleksander Morgado +Date: Mon Sep 18 21:23:05 2017 -0700 + + option: remove unneeded explicit casts + + plugins/option/mm-broadband-modem-option.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f710278b3dc5fb8dbbad37147eb4920ab75fcb6e +Author: Aleksander Morgado +Date: Mon Sep 18 21:21:59 2017 -0700 + + sierra: remove unneeded explicit casts + + plugins/sierra/mm-broadband-modem-sierra.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit fd508d7057da8abb0a409b02788dda5372accf8c +Author: Aleksander Morgado +Date: Mon Sep 18 20:50:45 2017 -0700 + + sierra: skip setting GError if not used + + The return status of mm_base_modem_at_command_finish() already + specifies whether an error has happened or not, so skip creating the + GError if we don't care about the actual error details. + + plugins/sierra/mm-broadband-modem-sierra.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +commit 4fbd88395d79238f19c20e35c7ba589c7d05868b +Author: Ben Chan +Date: Fri Sep 15 02:20:09 2017 -0700 + + sierra: port get_detailed_registration_state to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 71 + +++++++++++------------------- + 1 file changed, 25 insertions(+), 46 deletions(-) + +commit 7ca5e8875aa82ee47605b67cc99215f860f83891 +Author: Ben Chan +Date: Fri Sep 15 00:46:14 2017 -0700 + + sierra: port modem_time_check_support to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit 509ba7475a1f77bcfa6529c33e845994ff27b49a +Author: Ben Chan +Date: Fri Sep 15 00:42:59 2017 -0700 + + sierra: port setup_registration_checks to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 45 + ++++++++++++++---------------- + 1 file changed, 21 insertions(+), 24 deletions(-) + +commit 26be99b8a710a9ee8bf1c0c49b31c5c9e3e96cb9 +Author: Ben Chan +Date: Thu Sep 14 22:59:31 2017 -0700 + + sierra: port modem_power_down to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 22 +++++++++------------- + 1 file changed, 9 insertions(+), 13 deletions(-) + +commit 841d17596157860098c5bd328e19ded1a22f9538 +Author: Ben Chan +Date: Thu Sep 14 22:57:47 2017 -0700 + + sierra: port modem_create_bearer to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 28 + +++++++++------------------- + 1 file changed, 9 insertions(+), 19 deletions(-) + +commit 7446e411c754e95ee03a8a9e2dc1207dd7732452 +Author: Ben Chan +Date: Thu Sep 14 22:56:09 2017 -0700 + + sierra: port modem_load_own_numbers to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 38 + ++++++++++++------------------ + 1 file changed, 15 insertions(+), 23 deletions(-) + +commit 85915853e57f2495767ea264df6aee4f5ab39ab0 +Author: Ben Chan +Date: Thu Sep 14 22:40:35 2017 -0700 + + sierra: port modem_after_sim_unlock to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 228bd14a11ed3362e78db71c4d076b330f32db90 +Author: Ben Chan +Date: Fri Sep 8 17:17:11 2017 -0700 + + sierra: port set_current_modes to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 63 + +++++++++++++----------------- + 1 file changed, 28 insertions(+), 35 deletions(-) + +commit 5dbf7f77e28735581a71ea53336153c053b2d52a +Author: Ben Chan +Date: Fri Sep 8 17:13:40 2017 -0700 + + sierra: port load_current_modes to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 106 + ++++++++++++++--------------- + 1 file changed, 51 insertions(+), 55 deletions(-) + +commit abff4adf626dc67c3423629efb9941e463a7a69c +Author: Ben Chan +Date: Fri Sep 8 17:09:08 2017 -0700 + + sierra: port load_supported_modes to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 27 + +++++++++------------------ + 1 file changed, 9 insertions(+), 18 deletions(-) + +commit 8f129d64edb99338a6d9c2e4999d573caae10bc0 +Author: Ben Chan +Date: Fri Sep 8 17:06:25 2017 -0700 + + sierra: port load_access_technologies to use GTask + + plugins/sierra/mm-broadband-modem-sierra.c | 58 + +++++++++++++++--------------- + 1 file changed, 29 insertions(+), 29 deletions(-) + +commit f663022aca0fccfb439da017e6d59296e5b7cfee +Author: Ben Chan +Date: Fri Sep 8 16:59:42 2017 -0700 + + sierra: port modem_create_bearer to use GTask + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 28 + ++++++++---------------- + 1 file changed, 9 insertions(+), 19 deletions(-) + +commit d0dc8b97a7739978d05764d695d111a3379ffae8 +Author: Ben Chan +Date: Fri Sep 8 16:57:14 2017 -0700 + + sierra: port disconnect_3gpp to use GTask + + plugins/sierra/mm-broadband-bearer-sierra.c | 27 + +++++++++++---------------- + 1 file changed, 11 insertions(+), 16 deletions(-) + +commit 4c2ebaba16676976ddec53741600438375378d71 +Author: Ben Chan +Date: Fri Sep 8 13:36:42 2017 -0700 + + sierra: port dial_3gpp to use GTask + + plugins/sierra/mm-broadband-bearer-sierra.c | 126 + ++++++++++++++-------------- + 1 file changed, 64 insertions(+), 62 deletions(-) + +commit 043645ea57228078c32567d8be2da5b1e3a8f723 +Author: Ben Chan +Date: Fri Sep 8 13:26:33 2017 -0700 + + sierra: port mm_common_sierra_load_power_state to use GTask + + plugins/sierra/mm-common-sierra.c | 66 + +++++++++++++++++++-------------------- + 1 file changed, 33 insertions(+), 33 deletions(-) + +commit 1eb51d96f76803ef617a58b8279dfb8c5cec66cc +Author: Ben Chan +Date: Fri Sep 8 13:20:42 2017 -0700 + + sierra: port mm_common_sierra_modem_power_up to use GTask + + plugins/sierra/mm-common-sierra.c | 38 + ++++++++++++++++---------------------- + 1 file changed, 16 insertions(+), 22 deletions(-) + +commit c401646db86595a9783cbe61608e72d7d80c5e1c +Author: Ben Chan +Date: Fri Sep 8 13:16:28 2017 -0700 + + sierra: port mm_common_sierra_custom_init to use GTask + + plugins/sierra/mm-common-sierra.c | 79 + ++++++++++++++++++++------------------- + 1 file changed, 40 insertions(+), 39 deletions(-) + +commit 8fb6f30f49b2315c7d1d6daac23c67875834c6ba +Author: Ben Chan +Date: Fri Sep 8 13:05:39 2017 -0700 + + sierra: port load_sim_identifier to use GTask + + plugins/sierra/mm-sim-sierra.c | 44 + ++++++++++++++++-------------------------- + 1 file changed, 17 insertions(+), 27 deletions(-) + +commit 5ffc3b7a9263a07fd30ad21738afe1a7b357c08f +Author: Ben Chan +Date: Sat Sep 16 15:20:46 2017 +0800 + + option: port modem_3gpp_disable_unsolicited_events to use GTask + + plugins/option/mm-broadband-modem-option.c | 30 + +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit cb23ba7cba9fd92f6f03b635b90271fd32f77477 +Author: Ben Chan +Date: Sat Sep 16 15:17:35 2017 +0800 + + option: port modem_3gpp_enable_unsolicited_events to use GTask + + plugins/option/mm-broadband-modem-option.c | 30 + +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit 3fdfe5e3aba232f3cdb5f623e674b8a57509e663 +Author: Ben Chan +Date: Sat Sep 16 15:15:45 2017 +0800 + + option: port modem_3gpp_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/option/mm-broadband-modem-option.c | 39 + +++++++++--------------------- + 1 file changed, 12 insertions(+), 27 deletions(-) + +commit 7546b951229ad1a6d9f2ef9b86f4ec693d7d638b +Author: Ben Chan +Date: Sat Sep 16 15:07:40 2017 +0800 + + option: port modem_after_power_up to use GTask + + plugins/option/mm-broadband-modem-option.c | 32 + +++++++++++------------------- + 1 file changed, 12 insertions(+), 20 deletions(-) + +commit 6ad9ccbfa281bc6bf5d28557342ec2d36aa0db0c +Author: Ben Chan +Date: Sat Sep 16 15:05:34 2017 +0800 + + option: port set_current_modes to use GTask + + plugins/option/mm-broadband-modem-option.c | 39 + +++++++++++++----------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 78432e79102c32a6599e2fdb37021eb190f28caa +Author: Ben Chan +Date: Sat Sep 16 15:13:14 2017 +0800 + + option: port load_access_technologies to use GTask + + plugins/option/mm-broadband-modem-option.c | 82 + ++++++++++++++++-------------- + 1 file changed, 44 insertions(+), 38 deletions(-) + +commit 0c726981ca4fa02336c0e06ea2217077e686549f +Author: Ben Chan +Date: Sat Sep 16 15:02:56 2017 +0800 + + option: port load_supported_modes to use GTask + + plugins/option/mm-broadband-modem-option.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit 2ed970614885d50316f3092289583d5ace985ea1 +Author: Aleksander Morgado +Date: Fri Sep 15 11:07:58 2017 -0700 + + bearer-qmi: cleanup indication handlers on network-initiated + disconnects + + Otherwise, they'll end up queueing up and each time we get a new + indication the signal will get called multiple times: + + [/dev/cdc-wdm0] received message... + <<<<<< RAW: + <<<<<< length = 20 + <<<<<< data = + 01:13:00:80:01:09:04:00:00:01:00:07:00:20:04:00:05:00:00:00 + [/dev/cdc-wdm0] received generic indication (translated)... + <<<<<< QMUX: + <<<<<< length = 19 + <<<<<< flags = 0x80 + <<<<<< service = "wds" + <<<<<< client = 9 + <<<<<< QMI: + <<<<<< flags = "indication" + <<<<<< transaction = 0 + <<<<<< tlv_length = 7 + <<<<<< message = "Event Report" (0x0001) + <<<<<< TLV: + <<<<<< type = "Preferred Data System" (0x20) + <<<<<< length = 4 + <<<<<< value = 05:00:00:00 + <<<<<< translated = lte + [1504578559.592891] Got QMI WDS event report + [1504578559.598212] Got QMI WDS event report + [1504578559.601694] Got QMI WDS event report + + src/mm-bearer-qmi.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 2e792db2f283a8e8662fb6c93c3225e108288525 +Author: Aleksander Morgado +Date: Sat Sep 16 10:30:56 2017 -0700 + + po: add Slovak translation + + From: Dušan Kazik + + https://bugs.freedesktop.org/show_bug.cgi?id=102802 + + po/LINGUAS | 1 + + po/sk.po | 108 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 109 insertions(+) + +commit 3bfbb59beb35e01876284aa5bc9ed38ada64fbf1 +Author: Aleksander Morgado +Date: Thu Sep 14 21:24:15 2017 -0700 + + ublox: check which auth methods are supported + + Don't assume the 'auto' auth method is supported for APN + authentication, query the modem first: + + checking supported authentication methods... + (ttyACM2): --> 'AT+UAUTHREQ=?' + (ttyACM2): <-- '+UAUTHREQ: (1-4),(0-2),,' + (ttyACM2): <-- 'OK' + + Using automatic authentication method + + setting up authentication preferences in PDP context #2... + (ttyACM2): --> 'AT+UAUTHREQ=2,1,"vodafone","vodafone"' + (ttyACM2): <-- 'OK' + + plugins/ublox/mm-broadband-bearer-ublox.c | 169 + +++++++++++++++++++++++------- + 1 file changed, 130 insertions(+), 39 deletions(-) + +commit b774e58dd060a5797f80e5b92a951443cd2b4106 +Author: Aleksander Morgado +Date: Thu Sep 14 20:55:57 2017 -0700 + + ublox: new +UAUTHREQ=? tester + + plugins/ublox/mm-modem-helpers-ublox.c | 77 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 14 +++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 46 +++++++++++++++ + 3 files changed, 137 insertions(+) + +commit acda0d69f10456c90db8d27c1ceee7cfb219772a +Author: Aleksander Morgado +Date: Tue Aug 22 11:19:32 2017 +0200 + + ublox: if authentication not required, ignore +UAUTHREQ=0 errors + + Just go on with the connection attempt. + + plugins/ublox/mm-broadband-bearer-ublox.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit 0239e8769b90fae47e8e448fbfe86718b09d7fcd +Author: Aleksander Morgado +Date: Tue Aug 22 13:37:44 2017 +0200 + + ublox: try to use AT+UACT=X to set current bands + + plugins/ublox/mm-broadband-modem-ublox.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 91f4ea56899b596c7d0548ed81cef8197dbd0bca +Author: Aleksander Morgado +Date: Tue Aug 22 13:35:04 2017 +0200 + + ublox: try to use AT+UACT? to query current bands + + plugins/ublox/mm-broadband-modem-ublox.c | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +commit 2d0b7b4ae0be4710b9dee2462f3e20d95e7d6edf +Author: Aleksander Morgado +Date: Tue Aug 22 13:22:50 2017 +0200 + + ublox: try to use AT+UACT=? to query supported bands + + plugins/ublox/mm-broadband-modem-ublox.c | 98 + ++++++++++++++++++++++++++------ + 1 file changed, 81 insertions(+), 17 deletions(-) + +commit a0768a13f66a33cbad3d03b4ff067ec4c2fd88a3 +Author: Aleksander Morgado +Date: Tue Aug 22 11:12:48 2017 +0200 + + ublox: new AT+UACT=X command builder + + plugins/ublox/mm-modem-helpers-ublox.c | 49 ++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 +++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 69 + ++++++++++++++++++++++++++ + 3 files changed, 124 insertions(+) + +commit 826c5ad74a882dd8a74448c1ed8b5ea031713836 +Author: Aleksander Morgado +Date: Tue Aug 22 10:36:25 2017 +0200 + + ublox: new AT+UACT=? test parser + + plugins/ublox/mm-modem-helpers-ublox.c | 118 + +++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 9 ++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 98 ++++++++++++++++++++ + 3 files changed, 225 insertions(+) + +commit dbb8f7235dcf7a76e1e0f56891fa7c4d4e87a5d6 +Author: Aleksander Morgado +Date: Mon Aug 21 12:29:01 2017 +0200 + + ublox: new AT+UACT? response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 170 + +++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 + + plugins/ublox/tests/test-modem-helpers-ublox.c | 69 +++++++++- + 3 files changed, 242 insertions(+), 3 deletions(-) + +commit 56e71127125d7e60f674925a5a9b6bc47beda07b +Author: Aleksander Morgado +Date: Tue Aug 22 10:35:01 2017 +0200 + + ublox,tests: define common method to compare bands + + plugins/ublox/tests/test-modem-helpers-ublox.c | 46 + ++++++++++++++------------ + 1 file changed, 24 insertions(+), 22 deletions(-) + +commit ce203a1f742a273694952abb1f14737dbe701481 +Author: Aleksander Morgado +Date: Tue Aug 22 15:38:47 2017 +0200 + + ublox: define port type hints for the TOBY-L4 + + The TOBY-L4 exposes multiple TTY ports, but each of them has different + purposes: + + The TTY at interface #2 is a fully capable AT port but shouldn't be + used to start connections, so we flag it as secondary. + + The TTY at interface #4 is a non-AT debug port, so we explicitly + ignore it to make probing faster. + + The TTY at interface #6 is the fully capable AT port that must be used + as primary port. + + The TTY at interface #8 is an AT-capable port but dedicated to FOTA + update operations. + + plugins/Makefile.am | 2 ++ + plugins/ublox/77-mm-ublox-port-types.rules | 20 ++++++++++++++++++++ + plugins/ublox/mm-plugin-ublox.c | 29 + +++++++++++++++++++++++++++++ + 3 files changed, 51 insertions(+) + +commit 9a1c4f626d5cbba47922cc34ded66261b8fc7690 +Author: Aleksander Morgado +Date: Sat Aug 5 13:39:04 2017 +0200 + + ublox: fallback to router mode if networking mode unknown + + The TOBY-L4 doesn't support querying the current networking mode in + use via the AT+UBMCONF command, so we will just fallback to + MM_UBLOX_NETWORKING_MODE_ROUTER if that happens, as this is the mode + which requires less configuration commands from our side. + + plugins/ublox/mm-broadband-modem-ublox.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +commit 3dc3b52e777330805ac1d8dd739d1ff3eee1c1ad +Author: Aleksander Morgado +Date: Sat Aug 5 13:09:33 2017 +0200 + + ublox: allow creating u-blox bearers if MM_UBLOX_USB_PROFILE_UNKNOWN + + The TOBY-L4 doesn't support querying the current USB profile in use + via the AT+UUSBCONF command, so the loaded profile will always be set + as MM_UBLOX_USB_PROFILE_UNKNOWN. + + In this case, we will anyway allow creating a u-blox specific bearer, + as long as a network interface has also been found in the modem. + + plugins/ublox/mm-broadband-bearer-ublox.c | 1 - + plugins/ublox/mm-broadband-modem-ublox.c | 5 ++--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +commit 3f9417be43dfedbe3a2e662aef1a145f74e585fb +Author: Daniele Palmas +Date: Thu Sep 14 10:59:16 2017 +0200 + + blacklist: ignore Intel coredump downloader device + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit bfff4f53e61ac4251eac062ba7e53d52b51a1bec +Author: Aleksander Morgado +Date: Wed Sep 13 18:41:06 2017 +0200 + + build: generate ChangeLog from git during dist + + ChangeLog | 0 + Makefile.am | 13 +++++++++++++ + 2 files changed, 13 insertions(+) + +commit 5ee58513c749302507e1338feb79a53135c72759 +Author: Aleksander Morgado +Date: Wed Sep 13 16:33:25 2017 +0200 + + simtech: fix error reporting in 3gpp unsolicited events enabling + + plugins/simtech/mm-broadband-modem-simtech.c | 1 + + 1 file changed, 1 insertion(+) + +commit 0d2a167238798b95dadc33c9937bd4c8a56c5b29 +Author: Ben Chan +Date: Tue Sep 12 09:12:44 2017 -0700 + + novatel-lte: port disconnect_3gpp to use GTask + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 83 + ++++++++++------------- + 1 file changed, 35 insertions(+), 48 deletions(-) + +commit 71bc8c750603d00d78bfe10970a0d898b8607704 +Author: Ben Chan +Date: Tue Sep 12 09:08:18 2017 -0700 + + novatel-lte: port connect_3gpp to use GTask + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 108 + +++++++++++----------- + 1 file changed, 52 insertions(+), 56 deletions(-) + +commit c13746dad76ad8a99352251f51c09428e3639b1c +Author: Ben Chan +Date: Tue Sep 12 08:46:22 2017 -0700 + + novatel-lte: port scan_networks to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 48 + ++++++++++-------------- + 1 file changed, 19 insertions(+), 29 deletions(-) + +commit 43c4a49bc762910697c0a9a576d66e9438de4b78 +Author: Ben Chan +Date: Tue Sep 12 08:38:26 2017 -0700 + + novatel-lte: port load_access_technologies to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 35 + ++++++++++-------------- + 1 file changed, 14 insertions(+), 21 deletions(-) + +commit d8be23b606c288fe945c21d4ea7eda7d7c61a0e2 +Author: Ben Chan +Date: Tue Sep 12 08:34:41 2017 -0700 + + novatel-lte: port load_current_bands to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 29 + ++++++------------------ + 1 file changed, 7 insertions(+), 22 deletions(-) + +commit eb59cf86172991ba9ef7331c47bdc9e096317044 +Author: Ben Chan +Date: Tue Sep 12 08:32:35 2017 -0700 + + novatel-lte: port load_supported_bands to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 18 +++++------------- + 1 file changed, 5 insertions(+), 13 deletions(-) + +commit b56ea695896b5290e27b1a2d0b13fb07c005df56 +Author: Ben Chan +Date: Tue Sep 12 04:39:42 2017 -0700 + + novatel-lte: port modem_after_sim_unlock to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit ced9264a1c0c48cc5eb6ec6223bf1ef49f644a13 +Author: Ben Chan +Date: Tue Sep 12 04:37:39 2017 -0700 + + novatel-lte: port modem_create_bearer to use GTask + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 30 + +++++------------------- + 1 file changed, 6 insertions(+), 24 deletions(-) + +commit 979730247eee09e79450a5f8997c2dfd019952f5 +Author: Ben Chan +Date: Tue Sep 12 04:35:01 2017 -0700 + + novatel: port set_current_modes to use GTask + + plugins/novatel/mm-broadband-modem-novatel.c | 45 + ++++++++++++---------------- + 1 file changed, 19 insertions(+), 26 deletions(-) + +commit 7000039c8c469d4c786ab13753becdbe313297d6 +Author: Ben Chan +Date: Tue Sep 12 04:32:23 2017 -0700 + + novatel: port load_signal_quality to use GTask + + plugins/novatel/mm-broadband-modem-novatel.c | 55 + +++++++++++++--------------- + 1 file changed, 25 insertions(+), 30 deletions(-) + +commit b14a3be4f1ae26620ee9bf57c73eff9e888d917c +Author: Ben Chan +Date: Tue Sep 12 04:27:46 2017 -0700 + + novatel: port load_current_modes to use GTask + + plugins/novatel/mm-broadband-modem-novatel.c | 82 + +++++++++++++--------------- + 1 file changed, 38 insertions(+), 44 deletions(-) + +commit b25b7723ec8c2981aaf993542817c859967d72f8 +Author: Ben Chan +Date: Tue Sep 12 03:22:59 2017 -0700 + + icera: port disconnect_3gpp to use GTask + + plugins/icera/mm-broadband-bearer-icera.c | 87 + ++++++++++++------------------- + 1 file changed, 34 insertions(+), 53 deletions(-) + +commit 533a53c38d7e85df4fb0d166824672ff16535d20 +Author: Ben Chan +Date: Tue Sep 12 03:15:44 2017 -0700 + + icera: port get_ip_config_3gpp to use GTask + + plugins/icera/mm-broadband-bearer-icera.c | 94 + ++++++++++++------------------- + 1 file changed, 36 insertions(+), 58 deletions(-) + +commit f2853ac2f8760b8a2a7a6497f895f0a4efe8f70f +Author: Ben Chan +Date: Tue Sep 12 04:12:55 2017 -0700 + + icera: port modem_3gpp_{enable,disable}_unsolicited_events to + use GTask + + plugins/icera/mm-broadband-modem-icera.c | 48 + +++++++++++++------------------- + 1 file changed, 19 insertions(+), 29 deletions(-) + +commit cffe686cb139796a8621648e87957fd2d30dcd3c +Author: Ben Chan +Date: Tue Sep 12 04:10:20 2017 -0700 + + icera: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 35 + ++++++++++---------------------- + 1 file changed, 11 insertions(+), 24 deletions(-) + +commit e6128388149072acd43a5f16d7f1759f1fd43e16 +Author: Ben Chan +Date: Tue Sep 12 04:00:11 2017 -0700 + + icera: port modem_create_bearer to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 42 + ++++++++++++-------------------- + 1 file changed, 15 insertions(+), 27 deletions(-) + +commit b7bfba3e54b5b5ac34e3329f0ad6503a80568ebd +Author: Ben Chan +Date: Tue Sep 12 04:06:22 2017 -0700 + + icera: port modem_time_check_support to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 18a55f6940e068e52db8e766cccd97545f7205e3 +Author: Ben Chan +Date: Tue Sep 12 04:04:33 2017 -0700 + + icera: port modem_power_up to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 22 ++++++++-------------- + 1 file changed, 8 insertions(+), 14 deletions(-) + +commit d6bd83e5cfc0fe684cf96f254415fe7458860a24 +Author: Ben Chan +Date: Tue Sep 12 03:57:10 2017 -0700 + + icera: port modem_set_current_bands to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 56 + +++++++++++++++----------------- + 1 file changed, 26 insertions(+), 30 deletions(-) + +commit 6612ffcb8b264e83acc814fccc112f761f535ecd +Author: Ben Chan +Date: Tue Sep 12 03:38:50 2017 -0700 + + icera: port modem_set_current_modes to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 39 + ++++++++++++++------------------ + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit aa2cd2288ac45a64393c461ea9b1362e85e99cc9 +Author: Ben Chan +Date: Tue Sep 12 03:51:35 2017 -0700 + + icera: port modem_load_current_bands to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 24 ++++++------------------ + 1 file changed, 6 insertions(+), 18 deletions(-) + +commit f168ffd032747ba6900feeafe9c898ae513ef79f +Author: Ben Chan +Date: Tue Sep 12 03:48:24 2017 -0700 + + icera: port modem_load_supported_bands to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 31 + ++++++++++--------------------- + 1 file changed, 10 insertions(+), 21 deletions(-) + +commit 4ecc8a13fd80e4d23166afc6982b6f3489f755e1 +Author: Ben Chan +Date: Tue Sep 12 03:45:38 2017 -0700 + + icera: port modem_load_unlock_retries to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 34 + +++++++++++--------------------- + 1 file changed, 12 insertions(+), 22 deletions(-) + +commit ce732e568c9275d72860ceab8bb65e48dceb881f +Author: Ben Chan +Date: Tue Sep 12 03:42:38 2017 -0700 + + icera: port modem_load_access_technologies to use GTask + + plugins/icera/mm-broadband-modem-icera.c | 32 + +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +commit 0c7f3380ae96698e496abce1e55c52d21449d57a +Author: Aleksander Morgado +Date: Fri Aug 25 13:12:01 2017 +0200 + + bearer-mbim: ensure session is disconnected before trying to connect + + If a suspend/resume cycle happens or ModemManager is restarted (e.g. + after a crash) the modem may be left with a given session id + connected. With this change we're forcing a session disconnection + before we attempt a session connection. + + https://bugs.freedesktop.org/show_bug.cgi?id=102231 + + src/mm-bearer-mbim.c | 52 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 52 insertions(+) + +commit abfd8d3b08a3a8a98e961969c5e2cb9acd582656 +Author: Arto Jantunen +Date: Sun Sep 10 08:36:20 2017 +0300 + + Blacklist Garmin ANT+ sticks + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit d6d52b95c7335f864113878c7a19ef8828321145 +Author: Ben Chan +Date: Tue Aug 1 14:13:42 2017 -0700 + + huawei: port connect_3gpp to use GTask + + plugins/huawei/mm-broadband-bearer-huawei.c | 184 + ++++++++++++++-------------- + 1 file changed, 95 insertions(+), 89 deletions(-) + +commit 1ada2d23a50f5a600eb7ef6168cb9a85aa68bb82 +Author: Ben Chan +Date: Tue Aug 1 13:32:08 2017 -0700 + + huawei: port disconnect_3gpp to use GTask + + plugins/huawei/mm-broadband-bearer-huawei.c | 119 + +++++++++++++++------------- + 1 file changed, 63 insertions(+), 56 deletions(-) + +commit abf9d36183ed5f34af9ac91aa97c944f2fcf5272 +Author: Ben Chan +Date: Tue Aug 1 10:58:25 2017 -0700 + + huawei: port huawei_modem_create_bearer to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 80 + +++++++++++------------------- + 1 file changed, 29 insertions(+), 51 deletions(-) + +commit 7880a35b199000aa7b5f3cda638b2810af6fdb47 +Author: Ben Chan +Date: Tue Jul 18 00:30:24 2017 -0700 + + huawei: port huawei_custom_init to use GTask + + plugins/huawei/mm-plugin-huawei.c | 81 + ++++++++++++++++++++------------------- + 1 file changed, 41 insertions(+), 40 deletions(-) + +commit e76015ac49a1664f925ab81aa84858481a0f26e2 +Author: Ben Chan +Date: Tue Aug 1 13:05:21 2017 -0700 + + huawei: port get_detailed_registration_state to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 51 + +++++++++++++----------------- + 1 file changed, 22 insertions(+), 29 deletions(-) + +commit 9c32a96578c43f245d83ba9af6faf6831651edcd +Author: Ben Chan +Date: Tue Aug 1 11:41:18 2017 -0700 + + huawei: port setup_registration_checks to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 43 + +++++++++++++++--------------- + 1 file changed, 21 insertions(+), 22 deletions(-) + +commit 39484765f1140487dd24fc9255f8087439fc738d +Author: Ben Chan +Date: Tue Jul 18 00:40:28 2017 -0700 + + huawei: port call_start to use GTask + + plugins/huawei/mm-call-huawei.c | 62 + +++++++++++++++-------------------------- + 1 file changed, 23 insertions(+), 39 deletions(-) + +commit 8df63e385cf9e926bb1cb9bf86fe8c4b25d0198a +Author: Ben Chan +Date: Tue Aug 1 11:50:16 2017 -0700 + + huawei: port modem_voice_disable_unsolicited_events to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit 68075a23a7eb36d4bfc8ec5eb6af473aaecd66c4 +Author: Ben Chan +Date: Tue Aug 1 11:48:57 2017 -0700 + + huawei: port modem_voice_enable_unsolicited_events to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 29 + ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit 5e8a7aad76b902fb486de88506562d61b565830a +Author: Ben Chan +Date: Tue Aug 1 11:45:46 2017 -0700 + + huawei: port modem_voice_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 38 + ++++++++++++------------------ + 1 file changed, 15 insertions(+), 23 deletions(-) + +commit 46866b08bea4cbd8df6549fda57359613a1a71b1 +Author: Ben Chan +Date: Tue Aug 1 12:32:30 2017 -0700 + + huawei: port modem_cdma_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 49 + ++++++++++++------------------ + 1 file changed, 19 insertions(+), 30 deletions(-) + +commit 5f641afe07dc878129b17b0ff0e6227d22c00b1c +Author: Ben Chan +Date: Tue Aug 1 12:29:13 2017 -0700 + + huawei: port modem_3gpp_disable_unsolicited_events to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 29 + ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit 074e0f89fc8d2ced02621477efe90fb228a3734c +Author: Ben Chan +Date: Tue Aug 1 12:27:38 2017 -0700 + + huawei: port modem_3gpp_enable_unsolicited_events to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 29 + ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit 02ce611d5cbe12a3b4f627487cf8189359a5cb0b +Author: Ben Chan +Date: Tue Aug 1 11:59:31 2017 -0700 + + huawei: port modem_3gpp_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 38 + ++++++++++++------------------ + 1 file changed, 15 insertions(+), 23 deletions(-) + +commit 38bafe021ea37d85df153a199f380dfef684d393 +Author: Ben Chan +Date: Tue Aug 1 11:31:39 2017 -0700 + + huawei: port {enable,disable}_location_gathering to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 116 + ++++++++++++++--------------- + 1 file changed, 57 insertions(+), 59 deletions(-) + +commit 6ebc07f882cfbee9a1be39502a0a47d2aab33996 +Author: Ben Chan +Date: Tue Aug 1 11:17:12 2017 -0700 + + huawei: port location_load_capabilities to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 34 + ++++++++++++++---------------- + 1 file changed, 16 insertions(+), 18 deletions(-) + +commit 36d975bd4e6624e2ade0ff177632a889761849b1 +Author: Ben Chan +Date: Tue Jul 18 00:50:07 2017 -0700 + + huawei: port modem_after_sim_unlock to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 0aae6d3e35769a8af15bfe7cb3d89fb486d32f1d +Author: Ben Chan +Date: Tue Aug 1 11:10:19 2017 -0700 + + huawei: port modem_time_check_support to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 32 + +++++++++++++----------------- + 1 file changed, 14 insertions(+), 18 deletions(-) + +commit 60129a6fde5aa0df7a36b83e5364e68c4a16d6d2 +Author: Ben Chan +Date: Tue Aug 1 11:06:02 2017 -0700 + + huawei: port modem_load_signal_quality to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 60 + ++++++++++++++---------------- + 1 file changed, 28 insertions(+), 32 deletions(-) + +commit 0c468bb1a4c5b5f068871023f58c7a6e57e83e28 +Author: Ben Chan +Date: Tue Jul 18 00:34:54 2017 -0700 + + huawei: port load_sim_identifier to use GTask + + plugins/huawei/mm-sim-huawei.c | 35 +++++++++++------------------------ + 1 file changed, 11 insertions(+), 24 deletions(-) + +commit 1495fb1d1d7f9f1c80e43559a5a546a964035f15 +Author: Ben Chan +Date: Tue Aug 1 11:15:06 2017 -0700 + + huawei: port load_power_state to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 47 + ++++++++++++++---------------- + 1 file changed, 22 insertions(+), 25 deletions(-) + +commit 046f1b3301bf50f438e2ca28798f37ed4a7217b4 +Author: Ben Chan +Date: Tue Jul 18 01:01:02 2017 -0700 + + huawei: port load_supported_modes to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 60 + +++++++++++++----------------- + 1 file changed, 25 insertions(+), 35 deletions(-) + +commit c7ec2c4fbb462ae8e16941cd0cec1781475c8fe3 +Author: Ben Chan +Date: Tue Jul 18 01:10:12 2017 -0700 + + huawei: port load_current_modes to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 80 + ++++++++++++++---------------- + 1 file changed, 38 insertions(+), 42 deletions(-) + +commit bf03f1e2d71ae5b464fb0ce4fd1ecfa4def5f419 +Author: Ben Chan +Date: Tue Aug 1 10:45:40 2017 -0700 + + huawei: port set_current_modes to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 41 + +++++++++++++----------------- + 1 file changed, 18 insertions(+), 23 deletions(-) + +commit 5d9c4d70a1455f74bc11b0942535ba31a104f04b +Author: Ben Chan +Date: Tue Jul 18 00:52:43 2017 -0700 + + huawei: port set_current_bands to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 33 + +++++++++++++----------------- + 1 file changed, 14 insertions(+), 19 deletions(-) + +commit 8b9402da2b87720b7c07923bfaf488c10e506adc +Author: Ben Chan +Date: Tue Jul 18 00:48:21 2017 -0700 + + huawei: port sysinfo to use GTask + + plugins/huawei/mm-broadband-modem-huawei.c | 62 + +++++++++++++----------------- + 1 file changed, 27 insertions(+), 35 deletions(-) + +commit 833243570f75dcd6f9ae788575f7c361c8f604a5 +Author: Aleksander Morgado +Date: Thu Sep 7 19:25:17 2017 +0200 + + wavecom: port modem_after_sim_unlock to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 30 + ++++++++++++---------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +commit 288ebab106555aa378aa62347c4c1aa039929a5e +Author: Aleksander Morgado +Date: Thu Sep 7 19:24:50 2017 +0200 + + wavecom: port register_in_network to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 134 + ++++++++++++--------------- + 1 file changed, 57 insertions(+), 77 deletions(-) + +commit ea3d20e98c3049329472f913071824a232c9e376 +Author: Aleksander Morgado +Date: Thu Sep 7 19:23:52 2017 +0200 + + wavecom: port set_current_bands to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 106 + +++++++++++++-------------- + 1 file changed, 51 insertions(+), 55 deletions(-) + +commit dd4ef7dc236a0cf2e60fdc2bb2e2d0121c1da4bf +Author: Aleksander Morgado +Date: Thu Sep 7 19:23:11 2017 +0200 + + wavecom: port load_current_bands to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 91 + +++++++++++----------------- + 1 file changed, 36 insertions(+), 55 deletions(-) + +commit e2b3b87674236cf5f4e40eaeb43c766903f00909 +Author: Aleksander Morgado +Date: Thu Sep 7 19:21:22 2017 +0200 + + wavecom: port load_supported_bands to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 30 + ++++++++++------------------ + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit bb5a950102d146d8d89c3b3916c21d6471811f5c +Author: Aleksander Morgado +Date: Thu Sep 7 19:20:43 2017 +0200 + + wavecom: port set_current_modes to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 86 + +++++++++++++--------------- + 1 file changed, 39 insertions(+), 47 deletions(-) + +commit fc33fe69b4bbb91a3e31c9b674090c0052962f89 +Author: Aleksander Morgado +Date: Thu Sep 7 19:18:57 2017 +0200 + + wavecom: port load_current_modes to use GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 126 + +++++++++++++-------------- + 1 file changed, 60 insertions(+), 66 deletions(-) + +commit 02e16d42bc5753844ff5aead2673e4850051c93d +Author: Aleksander Morgado +Date: Thu Sep 7 19:13:56 2017 +0200 + + wavecom: port load_supported_modes to GTask + + plugins/wavecom/mm-broadband-modem-wavecom.c | 68 + +++++++++++++--------------- + 1 file changed, 31 insertions(+), 37 deletions(-) + +commit 33427397980a7868d32bad92524a53d4431ba718 +Author: Ben Chan +Date: Mon Aug 7 14:26:10 2017 -0700 + + broadband-modem-mbim: preserve unlock retries for PIN1 when + appropriate + + If PIN1 is disabled and we have tried to enable it with a wrong PIN, a + MBIM modem would have indicated the number of remaining attempts for + PIN1 (unless PUK1 is engaged) in the response to the failed + MBIM_CID_PIN + set operation. + + However, a MBIM_CID_PIN query may be issued (e.g. MMBaseSim calls + mm_iface_modem_update_lock_info()) after the MBIM_CID_PIN set + operation + to query the number of remaining attempts for a PIN + type. Unfortunately, + we can't specify a particular PIN type in a MBIM_CID_PIN query. The + modem may not reply with information about PIN1 if PIN1 is disabled. + When that happens, we would like to preserve our knowledge about the + number of remaining attempts for PIN1. + + This patch modifies MMBroadbandModemMbim's load_unlock_retries() + operation to carry over any previously observed information on PIN1 if + the MBIM_CID_PIN query reports something other than PIN1. + + src/mm-broadband-modem-mbim.c | 46 + ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 5 deletions(-) + +commit eb9ec1b617b27485a4f0ede472e9088f0ca52066 +Author: Ben Chan +Date: Mon Aug 7 15:34:48 2017 -0700 + + sim-mbim: update unlock retries information after PIN operations + + After MMSimMbim performs a MBIM_CID_PIN set operation, it calls + mm_iface_modem_update_lock_info() (through its base class MMBaseSim) + to + refresh the unlock retries information, which results in a + MBIM_CID_PIN + query. However, a MBIM_CID_PIN query reports only the information + of one + PIN type and the PIN type can't be specified, we need to deduce the + number of retries left for a specific PIN type from the response of a + MBIM_CID_PIN set operation for that PIN type. To allow that, + this patch + modifies MMSimMbim to update the unlock retries information after + a PIN + operation based on the response to the MBIM_CID_PIN set operation. + + src/mm-sim-mbim.c | 140 + +++++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 102 insertions(+), 38 deletions(-) + +commit d4ff05af5e5ef73abc717467f5988328c0d0319f +Author: Ben Chan +Date: Mon Aug 7 14:22:51 2017 -0700 + + iface-modem: export update_unlock_retries outside MMIfaceModem + + This patch exports the internal function update_unlock_retries() in + MMIfaceModem as mm_iface_modem_update_unlock_retries(), which later + allows us to call it from other classes. + + src/mm-iface-modem.c | 8 ++++---- + src/mm-iface-modem.h | 3 +++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit 87341acaa88400cef750c2a7463bc131b79a16d9 +Author: Aleksander Morgado +Date: Mon Aug 28 12:48:14 2017 +0200 + + build: import gtk-doc support + + Remove the need to run `gtkdocize' when building from git; this should + be an operation done by the maintainer when modernizing the gtk-doc + setup (think of e.g. gettextize), no need to do it unconditionally. + + This makes it easier for platforms without gtk-doc to build from git. + + When trying to build with documentation enabled and gtk-doc isn't + found, we get some nice warnings and errors in the configure report: + + checking for gtk-doc... no + configure: WARNING: + You will not be able to create source packages with 'make dist' + because gtk-doc >= 1.0 is not found. + checking for gtkdoc-check... no + checking for gtkdoc-check... no + checking for gtkdoc-rebase... no + checking for gtkdoc-mkpdf... no + checking whether to build gtk-doc documentation... yes + configure: error: + You must have gtk-doc >= 1.0 installed to build documentation + for + ModemManager. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to './configure'. + + Files generated with gtkdocize (gtk-doc) 1.25.1. + + .gitignore | 1 - + autogen.sh | 1 - + gtk-doc.make | 304 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + m4/gtk-doc.m4 | 88 +++++++++++++++++ + 4 files changed, 392 insertions(+), 2 deletions(-) + +commit b66aa5122519478ec29e9c33938bb7c1dc7558bd +Author: Aleksander Morgado +Date: Thu Sep 7 13:27:44 2017 +0200 + + po: add Brazilian Portuguese translation + + From: Rafael Fontenelle + + https://bugs.freedesktop.org/show_bug.cgi?id=102555 + + po/LINGUAS | 1 + + po/pt_BR.po | 104 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+) + +commit f05a2ed41e148f0f341de7e8a90c8cd5c54a2146 +Author: Piotr Drąg +Date: Wed Sep 6 19:16:08 2017 +0200 + + po: add Polish translation + + https://bugs.freedesktop.org/show_bug.cgi?id=102567 + + po/LINGUAS | 3 +- + po/pl.po | 109 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 111 insertions(+), 1 deletion(-) + +commit 984625165e09f02b4d6b8389092d5055fdbb0f03 +Author: Aleksander Morgado +Date: Fri Aug 25 21:35:18 2017 +0200 + + i18n: deprecate intltool and use only gettext 0.19.8 + + Instead of mixing both intltool and gettext, which not always work + correctly together, this patch obsoletes intltool and uses only + gettext, which includes support for translating XML files with ITS + rules. + + See migration steps for GNOME projects here: + https://wiki.gnome.org/MigratingFromIntltoolToGettext + + The gettext ITS rules for polkit policy files are imported from the + upstream polkit repository. We don't use the polkit-installed rule + files yet because there is no tagged release that contains those files + yet, so we cannot build-depend on any specific polkit version. + https://bugs.freedesktop.org/show_bug.cgi?id=96940 + + .gitignore | 5 +- + Makefile.am | 16 +---- + autogen.sh | 3 +- + configure.ac | 5 +- + data/Makefile.am | 28 ++++++--- + data/its/polkit.its | 8 +++ + data/its/polkit.loc | 6 ++ + data/org.freedesktop.ModemManager1.policy.in.in | 32 +++++----- + po/Makevars | 78 + +++++++++++++++++++++++++ + po/POTFILES.in | 1 - + po/POTFILES.skip | 2 - + po/de.po | 48 +++++++++------ + po/uk.po | 48 +++++++++------ + 13 files changed, 194 insertions(+), 86 deletions(-) + +commit f0bb6ef8564aabc51e5bd14b6486bc86068364fb +Author: Aleksander Morgado +Date: Thu Sep 7 10:36:14 2017 +0200 + + api: add MM_DISABLE_DEPRECATED guards around deprecated symbols + + When this symbol is defined, e.g. via CFLAGS, building a program that + uses the ModemManager API will fail if the program references + deprecated symbols. + + For now we just use it to keep gtk-doc-scan happy and avoid + unnecessary warnings. + + docs/reference/api/Makefile.am | 2 +- + include/ModemManager-compat.h | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit d135c56f0f1bb82f0a5e886c10932b18de149c4f +Author: Aleksander Morgado +Date: Mon Aug 21 14:31:10 2017 +0200 + + huawei: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + plugins/huawei/mm-broadband-modem-huawei.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit aae7105743765cec6ddc7c4402d296276a8b86e6 +Author: Aleksander Morgado +Date: Mon Aug 21 14:29:38 2017 +0200 + + cinterion: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + plugins/cinterion/mm-modem-helpers-cinterion.c | 18 +++++----- + .../cinterion/tests/test-modem-helpers-cinterion.c | 40 + +++++++++++----------- + 2 files changed, 29 insertions(+), 29 deletions(-) + +commit 44a850f8adf7b4c5e032f29f313b871f9a7616c1 +Author: Aleksander Morgado +Date: Mon Aug 21 14:19:01 2017 +0200 + + telit: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + Also, use explicit enums for 2G/3G bands when building internal flags, + as relying on UTRAN band 7 (MM_MODEM_BAND_U2600) being greater than + UTRAN bands 8 and 9 is a MM implementation issue. + + plugins/telit/mm-modem-helpers-telit.c | 97 + ++++++++++++++--------- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 68 ++++++++-------- + 2 files changed, 93 insertions(+), 72 deletions(-) + +commit 4c921cd584e7ceaa0629854c4e372509742d86e1 +Author: Aleksander Morgado +Date: Mon Aug 21 14:00:52 2017 +0200 + + wavecom: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 37 + ++++++++++++++-------------- + 1 file changed, 18 insertions(+), 19 deletions(-) + +commit 2c96b31590c22fbc242e09750ca1713c7b30f792 +Author: Aleksander Morgado +Date: Mon Aug 21 13:56:50 2017 +0200 + + icera: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + plugins/icera/mm-broadband-modem-icera.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit f54779732aaf9d5e5d06ca0fbb9dea4517b4809b +Author: Aleksander Morgado +Date: Mon Aug 21 13:55:01 2017 +0200 + + novatel-lte: update frequency bands support + + Several changes here: + * Updated to use the non-deprecated MMModemBand values. + * Added support for GSM 450, GSM 480 and GSM 750. + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 64 + ++++++++++++------------ + 1 file changed, 32 insertions(+), 32 deletions(-) + +commit 55316cabd490468da6158c3f08d22d49c73a6552 +Author: Aleksander Morgado +Date: Mon Aug 21 14:40:19 2017 +0200 + + ublox: update frequency bands support + + Updated to use the non-deprecated MMModemBand values. + + plugins/ublox/mm-modem-helpers-ublox.c | 17 ++--- + plugins/ublox/tests/test-modem-helpers-ublox.c | 88 + +++++++++++++------------- + 2 files changed, 54 insertions(+), 51 deletions(-) + +commit c41f7215a1b8f00cf31b47c6ef4a0bb52832489c +Author: Aleksander Morgado +Date: Mon Aug 21 13:43:25 2017 +0200 + + qmi: update frequency bands support + + Several changes here: + * Updated to use the non-deprecated MMModemBand values. + * Added support for GSM 450, GSM 480 and GSM 750. + * Added support for UMTS bands 11 and 19. + + src/mm-modem-helpers-qmi.c | 253 + +++++++++++++++++++-------------------------- + 1 file changed, 104 insertions(+), 149 deletions(-) + +commit ede5fe6ddb242be172ba782cabff7fa65abc8266 +Author: Aleksander Morgado +Date: Mon Aug 21 12:15:08 2017 +0200 + + api: define additional LTE frequency bands + + include/ModemManager-enums.h | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 84ac581f3fc19496a3e06be1fafd9473f4c8e6d1 +Author: Aleksander Morgado +Date: Sun Aug 20 16:16:39 2017 +0200 + + api: consolidate CDMA frequency enumerations + + Define new symbols with easier names, just based on the Band Class. + + docs/reference/api/ModemManager-sections.txt | 20 +++ + include/ModemManager-compat.h | 200 + +++++++++++++++++++++++++++ + include/ModemManager-enums.h | 80 +++++------ + 3 files changed, 260 insertions(+), 40 deletions(-) + +commit b4076784335126d7916075b5fc34b160c401d6b1 +Author: Aleksander Morgado +Date: Sun Aug 20 15:53:30 2017 +0200 + + api: define additional UMTS frequency bands + + include/ModemManager-enums.h | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +commit 7fb3aeacd3a15ec0e6ef71309c035910bbc01e88 +Author: Aleksander Morgado +Date: Sun Aug 20 13:46:04 2017 +0200 + + api: new MM_BAND_UTRAN_ enumerations for WCDMA bands + + Flag as deprecated the old names, and define new ones based on the + defined UTRAN band numbers, equivalent to what was done for LTE bands. + + docs/reference/api/ModemManager-sections.txt | 9 +++ + include/ModemManager-compat.h | 90 + ++++++++++++++++++++++++++++ + include/ModemManager-enums.h | 58 +++++++++--------- + 3 files changed, 128 insertions(+), 29 deletions(-) + +commit 946149016bd42bee7680fa81616b57b2f35f4813 +Author: Aleksander Morgado +Date: Sun Aug 20 12:59:29 2017 +0200 + + api: define additional GSM frequency bands + + New definitions for not so common GSM frequency bands. + + include/ModemManager-enums.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit eedd4ab445713cc862cf33821aceb39470f6a220 +Author: Aleksander Morgado +Date: Sun Aug 20 18:15:48 2017 +0200 + + api: don't use intermediate variables for deprecation warnings + + Using an intermediate constant variable breaks compilation with C + compilers, as these variables cannot be used as initializers. + + Instead, define a deprecated type and cast all deprecated symbols to + that type. We lose the information about what the new replacement + symbol is, but we don't break compilation. + + E.g.: + test.c: In function ‘main’: + test.c:8:5: warning: ‘MMModemBandDeprecated’ is deprecated + [-Wdeprecated-declarations] + printf ("band: %d\n", MM_MODEM_BAND_U2100); + ^~~~~~ + + docs/reference/api/ModemManager-sections.txt | 2 + + include/ModemManager-compat.h | 148 + ++++++++------------------- + 2 files changed, 42 insertions(+), 108 deletions(-) + +commit a29610f25da4ce4843be2df87fb644be87e6d35a +Author: Aleksander Morgado +Date: Sun Sep 3 13:01:42 2017 +0200 + + plugin,port-probe: always cast SEND_DELAY value to guint64 + + Program received signal SIGSEGV, Segmentation fault. + strchr () at ../sysdeps/arm/armv6/strchr.S:28 + 28 ../sysdeps/arm/armv6/strchr.S: No such file or directory. + (gdb) bt + #0 strchr () at ../sysdeps/arm/armv6/strchr.S:28 + #1 0x76b121c8 in g_param_spec_pool_lookup () from + ~/buildroot/output/staging/lib/libgobject-2.0.so.0 + #2 0x76b0cf44 in g_object_new_valist () from + ~/buildroot/output/staging/lib/libgobject-2.0.so.0 + #3 0x76b0d39c in g_object_new () from + ~/buildroot/output/staging/lib/libgobject-2.0.so.0 + #4 0x75f75e40 in mm_plugin_create () at + ublox/mm-plugin-ublox.c:99 + #5 0x00031550 in load_plugin (path=0xe9b68 + "/usr/lib/ModemManager/libmm-plugin-ublox.so") at + mm-plugin-manager.c:1521 + #6 load_plugins (error=0x7efffa68, self=0xdc4f0) at + mm-plugin-manager.c:1574 + #7 initable_init (initable=, + cancellable=, error=0x7efffa68) at + mm-plugin-manager.c:1679 + #8 0x76b9b278 in g_initable_new_valist () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #9 0x76b9b2e0 in g_initable_new () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #10 0x000324d0 in mm_plugin_manager_new (plugin_dir=0xe9c40 + "/usr/lib/ModemManager", error=error@entry=0x7efffa68) at + mm-plugin-manager.c:1620 + #11 0x0002da08 in initable_init (initable=0xddb40, + cancellable=, error=0x7efffa68) at + mm-base-manager.c:1113 + #12 0x76b9b278 in g_initable_new_valist () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #13 0x76b9b2e0 in g_initable_new () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #14 0x0002e81c in mm_base_manager_new + (connection=connection@entry=0xe1070, + plugin_dir=plugin_dir@entry=0x9efb0 "/usr/lib/ModemManager", + auto_scan=auto_scan@entry=1, + initial_kernel_events=initial_kernel_events@entry=0x0, + enable_test=0, error=0x7efffa68, error@entry=0x7efffa60) + at mm-base-manager.c:957 + #15 0x0002b6ec in bus_acquired_cb (connection=0xe1070, + name=, user_data=) at main.c:87 + #16 0x76c26864 in connection_get_cb () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #17 0x76bc76cc in g_task_return_now () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + #18 0x76bc7d50 in g_task_return () from + ~/buildroot/output/staging/lib/libgio-2.0.so.0 + + See similar bug in GStreamer: + https://bugzilla.gnome.org/show_bug.cgi?id=740191 + + plugins/option/mm-plugin-hso.c | 2 +- + plugins/samsung/mm-plugin-samsung.c | 2 +- + plugins/ublox/mm-plugin-ublox.c | 2 +- + src/mm-port-probe.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +commit 52aa393d4085d493eb88f146e8d44dfafd937758 +Author: Aleksander Morgado +Date: Mon Sep 4 17:34:29 2017 +0200 + + base-sim: wrap in its own GTask the SIM id loading from the subclass + + Instead of reusing the caller GTask, use a new GTask to wrap the + execution of the subclass' async method implementation. + + Also, rename the _ready() methods implemented in the GObject + initialization flow so that we can use the load_sim_identifier_ready() + function name. + + src/mm-base-sim.c | 71 + ++++++++++++++++++++++++++----------------------------- + 1 file changed, 34 insertions(+), 37 deletions(-) + +commit 530ebf90635ea2f652d68934f8d7c0656abc9e05 +Author: Aleksander Morgado +Date: Mon Sep 4 17:23:35 2017 +0200 + + telit: reorder code to keep the bottom-top flow for async methods + + plugins/telit/mm-broadband-modem-telit.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit ada9934e90cd12d84085b358758ef782ccc116a4 +Author: Aleksander Morgado +Date: Mon Sep 4 17:22:12 2017 +0200 + + telit: explicitly flag as const the constant string + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f6ae514405218e213413f06cb9411bbee9e72633 +Author: Aleksander Morgado +Date: Mon Sep 4 17:19:21 2017 +0200 + + telit: plug memleak when SIM object cannot be acquired + + The GTask wasn't being disposed. + + plugins/telit/mm-broadband-modem-telit.c | 1 + + 1 file changed, 1 insertion(+) + +commit be079381c06427f4748be245dc7c89fefed35293 +Author: Aleksander Morgado +Date: Mon Sep 4 17:15:04 2017 +0200 + + telit: avoid leaking SIM object + + We were getting the SIM object for all paths, but only using (and + disposing it) in the AFTER_POWER_UP_STEP_GET_SIM_IDENTIFIER step. + + Update the logic to only retrieve, use and dispose the SIM object in + the step that is needed, and therefore avoid leaking it in the + remaining steps. + + plugins/telit/mm-broadband-modem-telit.c | 30 + +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit 76916de31350b915c7cdd7d89fee08f03a97800f +Author: Carlo Lobrano +Date: Mon Sep 4 08:13:53 2017 +0200 + + telit-plugin: handle QSS unsolicited due to power state transitions + + When transitioning between power-low and power-on modes, Telit modems + switch the SIM off/on, which leads to the emission of #QSS unsolicited + not + related to actual SIM swaps. + + To handle this #QSS unsolicited, this patch: + + * disables reacting on #QSS unsolicited when modem_power_down + is received + * implements modem_after_power_up that: + - checks whether the SIM has been changed, matching cached SIM + Identifier with the value in the current SIM. If SIM Identifier, + is different, sim hot swap ports detected is called. + - re-enables reacting on #QSS unsolicited + + plugins/telit/mm-broadband-modem-telit.c | 181 + ++++++++++++++++++++++++++++++- + src/mm-base-sim.c | 53 +++++++++ + src/mm-base-sim.h | 77 +++++++------ + 3 files changed, 272 insertions(+), 39 deletions(-) + +commit 5014cf39767a24109de945d99c6b9f4bb1b07274 +Author: Carlo Lobrano +Date: Tue Aug 29 09:15:52 2017 +0200 + + broadband-modem: do not release SIM swap port contexts on disable + + Currently when the modem is disabled, it releases SIM hot swap + ports context, + and is not able to receive any notification about the SIM status. + + This patch keeps these ports opened when Modem is disabled and + released them + only when SIM swap is detected or when modem is released. + + src/mm-broadband-modem.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit a1210af7d5ce9986ffd8c30229ef0ca40dbf452a +Author: Aleksander Morgado +Date: Tue Aug 29 07:45:34 2017 +0200 + + wavecom: fix async operation completion + + plugins/wavecom/mm-broadband-modem-wavecom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2439900fd371d787ebe12df05150ab10687442b6 +Author: Mario Limonciello +Date: Mon Aug 28 15:07:13 2017 -0500 + + blacklist: ignore Silicon Labs USB Zigbee dongles + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 76c1a1119cdb08c710b5f8df35c31883a466a64a +Author: Ben Chan +Date: Mon Aug 21 18:42:25 2017 -0700 + + base-manager: avoid events of USB interface from removing MMDevice + + When a USB modem is switching its USB configuration, udev may deliver + the remove events of USB interfaces associated with the old USB + configuration and the add events of USB interfaces associated with + the new USB + configuration in an interleaved fashion. An interleaved remove event + of USB + interface could trigger the special case handling code in + mm-base-manager.c:device_removed() and incorrectly remove a MMDevice + under + probing. + + See + https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005626.html + for more details. + + This patch adds a check to ensure that only remove events of USB + device (i.e. not interface) can trigger the special handling code. + + src/mm-base-manager.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 5a01e5406660bc4f5a3cf68254510e867f89a457 +Author: Aleksander Morgado +Date: Tue Aug 15 23:21:05 2017 +0200 + + charsets: simplify check to see if conversion to charset possible + + Instead of having a method that returns the expected length after the + conversion and the amount of input UTF-8 characters that couldn't be + converted to the given charset, simplify the logic and just define a + method that returns a boolean specifying whether the conversion is + possible or not. + + Also, include unit tests. + + src/mm-charsets.c | 66 + +++++++++++++++++---------------------------- + src/mm-charsets.h | 7 +++-- + src/mm-sms-part-3gpp.c | 6 +---- + src/mm-sms-part-cdma.c | 6 +---- + src/tests/test-charsets.c | 68 + +++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 97 insertions(+), 56 deletions(-) + +commit 1f2bb640284ef75e411658a3ff67f844bea8b260 +Author: Aleksander Morgado +Date: Wed Aug 16 15:43:34 2017 +0200 + + charsets: ensure all methods are prefixed with 'mm_' + + plugins/huawei/mm-broadband-modem-huawei.c | 4 ++-- + src/mm-charsets.c | 16 ++++++++-------- + src/mm-charsets.h | 18 +++++++++--------- + src/mm-sms-part-3gpp.c | 6 +++--- + src/tests/test-charsets.c | 18 +++++++++--------- + 5 files changed, 31 insertions(+), 31 deletions(-) + +commit 06fef77cc03f700c6570bda6728b8caeef0356a7 +Author: Aleksander Morgado +Date: Wed Aug 16 15:39:49 2017 +0200 + + charsets,test: refactor unit tests + + These tests don't need fixtures, so use the simpler g_test_add_func() + methods to add tests associated to a test path. + + src/tests/test-charsets.c | 100 + ++++++++++++++++------------------------------ + 1 file changed, 35 insertions(+), 65 deletions(-) + +commit 439d58a55c9bb1c02cd1b9be3775311a4f63561c +Author: Eric Caruso +Date: Tue Aug 15 10:52:03 2017 -0700 + + mm-broadband-modem-mbim: reprobe on mbim-proxy death + + In case mbim-proxy crashes, ModemManager needs to be able to + recognize this and respawn the proxy so we don't lose access + to the modem. Do this by subscribing to the device removal + signal on MbimDevice and reprobing the modem when we lose the + connection to mbim-proxy. + + We can't just restart mbim-proxy because the reopened mbim-proxy + will give us a different client ID, and so unsolicitied + notifications will fail and MM gets very confused otherwise. + + src/mm-broadband-modem-mbim.c | 66 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 64 insertions(+), 2 deletions(-) + +commit eb64d39e52ea651f1aa418f780d15d82f74f8af1 +Author: Aleksander Morgado +Date: Tue Aug 15 18:18:43 2017 +0200 + + kernel-device: assert 'vendor' and 'product' in get_device_ids() + + These two parameters must always be given. + + src/kerneldevice/mm-kernel-device-udev.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 7e22696b34f8cade709937cca81641e3ca54ef9c +Author: Ben Chan +Date: Tue Aug 15 09:10:44 2017 -0700 + + kernel-device: expect non-NULL 'vendor' and 'product' argument in + get_device_ids() + + get_device_ids() in mm-kernel-device-udev.c accepts a NULL 'vendor' or + 'product' argument, but the current implementation could result in a + potential NULL dereferences of the 'vendor' argument. Given that + get_device_ids() is a local helper and its only caller provides a + non-NULL 'vendor' and 'product' argument, this patch removes the NULL + checks (i.e. get_device_ids() expects non-NULL 'vendor' and + 'product'). + + This patch also rearranges the code such that the 'vendor' argument is + updated only when the function returns TRUE, just like how the + 'product' + argument is handled. + + src/kerneldevice/mm-kernel-device-udev.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit 7ae32d6c61b7bd611b5b18626204f51d178b4b11 +Author: Ben Chan +Date: Fri Aug 11 15:17:30 2017 -0700 + + charset: fix mm_charset_get_encoded_len + + The while loop in mm_charset_get_encoded_len() iterates through each + valid UTF-8 encoded character in the given NULL-terminated UTF-8 + string. + It uses g_utf8_find_next_char() to find the position of the next + character. In case, g_utf8_find_next_char() returns NULL, it tries to + find the end (i.e. the NULL character) of the string. + + This patch fixes the following issues in the while loop: + + 1. The loop uses both 'next' and 'end' to track the position of + the next + character in the string. + + When g_utf8_find_next_char() returns a non-NULL value, 'next' is + essentially the same as 'end'. + + When g_utf8_find_next_char() returns NULL, 'next' remains NULL + while + 'end' is adjusted to track the end of the string (but is done + incorrectly as described in #2). After the 'p = next' assignment, + the + 'while (*p)' check results in a NULL dereference. 'p' should + thus be + set to 'end' instead of 'next'. + + 'next' is thus redundant and can be removed. + + 2. When g_utf8_find_next_char() returns NULL and 'end' is adjusted to + track the end of string, the 'while (*end++)' loop stops when + finding + the NULL character, but 'end' is advanced past the NULL character. + After the 'p = end' assignment, the 'while (*p)' check results in a + dereference of out-of-bounds pointer. + + 'while (*++end)' should be used instead given that 'p' doesn't + point + to a NULL character when 'end = p' happens. 'end' will be + updated to + point to the NULL character. After the 'p = end' assignment + (fixed in + #1), the 'while (*p)' check will properly stop the loop. + + src/mm-charsets.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit d639359320736dd582a2dbb5c50039a8a1b878da +Author: Aleksander Morgado +Date: Sat Aug 12 19:38:35 2017 +0200 + + polkit: add missing Location interface method rules + + https://bugs.freedesktop.org/show_bug.cgi?id=102182 + + data/org.freedesktop.ModemManager1.conf.polkit | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit d7d2c320d3cf67ff7c5e1a72b6350e4f8455df55 +Author: Aleksander Morgado +Date: Fri Aug 11 16:51:50 2017 +0200 + + broadband-modem-mbim: explicitly remove notification handler on unref + + When we remove the last object reference, make sure the notification + handler is also removed, or we may end up using an already freed + object. + + https://retrace.fedoraproject.org/faf/reports/1815001/ + + src/mm-broadband-modem-mbim.c | 61 + +++++++++++++++++++++++++++---------------- + 1 file changed, 38 insertions(+), 23 deletions(-) + +commit 36e7cd50cec29e3ef0d61646ebf072b20dab06f5 +Author: Ben Chan +Date: Fri Aug 11 11:23:22 2017 -0700 + + plugin: fix forbidden_product_strings check in + apply_post_probing_filters + + This patch fixes a bug in apply_post_probing_filters() where it + iterates + through `self->priv->forbidden_product_strings' but incorrectly + accesses + `self->priv->product_strings[i]' inside the loop. + `self->priv->forbidden_product_strings[i]' should be accessed instead. + + src/mm-plugin.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2b08a66645740df2e1e490df5ec44a7b5c537cc5 +Author: Ben Chan +Date: Fri Aug 11 14:19:35 2017 -0700 + + libmm-glib,cdma: fix potential NULL dereference + + This patch fixes a potential NULL referenece issue in + mm_cdma_manual_activation_properties_get_prl() where it accesses + `self->priv->prl->data' when `self->priv->prl' could be potentially + NULL. + + libmm-glib/mm-cdma-manual-activation-properties.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit c02dcd397ab6ccbc3c021bf6d96d76de7bce8b91 +Author: Ben Chan +Date: Fri Aug 11 14:16:47 2017 -0700 + + libmm-glib,sms-properties: fix potential NULL dereference + + This patch fixes a potential NULL referenece issue in + mm_sms_properties_get_data() where it accesses + `self->priv->data->data' + when `self->priv->data' could be potentially NULL. + + libmm-glib/mm-sms-properties.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit dec53d6ef65d1e0ebd10e278fe11762edd14e5bf +Author: Aleksander Morgado +Date: Wed Aug 9 12:02:36 2017 +0200 + + modem-helpers: allow unquoted strings in +CCLK responses + + Also: + * define the leading '+' as a escaped value + * allow any number of spaces between '+CCLK' and the string value. + + src/mm-modem-helpers.c | 7 +++++-- + src/tests/test-modem-helpers.c | 21 +++++++++++++++++++++ + 2 files changed, 26 insertions(+), 2 deletions(-) + +commit 9528450684bb7b3e28b7d8f3b61b6bf191ef2aca +Author: Aleksander Morgado +Date: Sun Aug 6 13:21:16 2017 +0200 + + bearer-mbim: stop trying to reload stats on OperationNotAllowed + + The Sierra Wireless EM7345 reports OperationNotAllowed when trying to + load stats, just cancel stats reloading if so. + + ModemManager[8318]: [/dev/cdc-wdm1] Received message + (translated)... + >>>>>> Header: + >>>>>> length = 48 + >>>>>> type = command-done (0x80000003) + >>>>>> transaction = 24 + >>>>>> Fragment header: + >>>>>> total = 1 + >>>>>> current = 0 + >>>>>> Contents: + >>>>>> status error = 'OperationNotAllowed' (0x0000001c) + >>>>>> service = 'basic-connect' + (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df) + >>>>>> cid = 'packet-statistics' (0x00000014) + + src/mm-bearer-mbim.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 05a1097a27ff7c7349e6d9730a7009c3b6d9670b +Author: Ben Chan +Date: Mon Aug 7 14:05:03 2017 -0700 + + iface-modem: remove unnecessary error check + + This patch removes an unnecessary error check in the + update_unlock_retries() where the error is never set. + + src/mm-iface-modem.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +commit 75036a46580bb38d0957e64cd4a59539df16c6f8 +Author: Aleksander Morgado +Date: Fri Aug 4 14:00:53 2017 +0200 + + bearer-mbim: refactor disconnect_set_ready() + + Try to make it more clear which are the different branches in the + logic, and jump out as soon as the branch is finished. + + src/mm-bearer-mbim.c | 96 + +++++++++++++++++++++++++++++----------------------- + 1 file changed, 53 insertions(+), 43 deletions(-) + +commit e51ee31d503ee8c79255f438f10a541448146a3a +Author: Aleksander Morgado +Date: Tue Jul 25 14:44:14 2017 +0200 + + broadband-bearer: run init sequence after flashing in disconnection + + The init-sequence configured for the TTY that is being used as data + port must not be launched during the port reopen() sequence; instead + we must run it manually after the port flashing has finished. + + src/mm-broadband-bearer.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit f455ce33b4fc41b055ec706aac7f33c09e76b131 +Author: Aleksander Morgado +Date: Fri Aug 4 17:10:41 2017 +0200 + + mbm: set GPS data port for DellDW5560 + + See + https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005506.html + + plugins/mbm/77-mm-ericsson-mbm.rules | 1 + + 1 file changed, 1 insertion(+) + +commit fbf397cd6f86fe99194df9bd7b274088178a5625 +Author: Ben Chan +Date: Fri Aug 4 00:44:07 2017 -0700 + + altair-lte: don't use send-delay=0 + + On the modem with firmware revision ALT3100_04_05_06_10_A8_TF + (LTEUSB_02_04_05_10_53), it's observed that port probing doesn't + complete successfully when send-delay=0 is used. + + plugins/altair/mm-plugin-altair-lte.c | 1 - + 1 file changed, 1 deletion(-) + +commit 5828435b464f0df888d18a924cf1650c238610e4 +Author: Ben Chan +Date: Thu Aug 3 15:55:11 2017 -0700 + + port-probe: remove unused variable + + src/mm-port-probe.c | 2 -- + 1 file changed, 2 deletions(-) + +commit f7eca732f9695709de4f7e14622d5a3c42ad6b83 +Author: Ben Chan +Date: Thu Aug 3 15:55:10 2017 -0700 + + sim-qmi: remove unused variables + + src/mm-sim-qmi.c | 12 ------------ + 1 file changed, 12 deletions(-) + +commit 941a41d30f1a468e7d689962a6658b39e9acede1 +Author: Ben Chan +Date: Thu Aug 3 15:54:38 2017 -0700 + + broadband-modem: ensure `match_info' is always initialized + + This patch initializes `match_info' in + registration_status_check_ready() + to NULL by default, such that `match_info' is always initialized + even if + `self->priv->modem_3gpp_registration_regex' contains no elements. + Though `self->priv->modem_3gpp_registration_regex' always contains + some + elements in the current implementation, it's better not to rely + on that. + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e33aa01963172a138833fbf84e54ef6b537c93bd +Author: Ben Chan +Date: Thu Aug 3 14:49:59 2017 -0700 + + location-gps-nmea: fix memory leaks + + There are potential memory leaks in MMLocationGpsNmea: + + - When the `trace' string provided to location_gps_nmea_take_trace() + isn't + added to the hash table, its ownership is still considered + transferred. + It should thus be freed. Similarly, the `trace_type' string isn't + added the hash table and should thus be freed. + + - mm_location_gps_nmea_add_trace() duplicates a given trace string and + then passes the trace copy to location_gps_nmea_take_trace(). When + location_gps_nmea_take_trace() returns FALSE, the ownership of the + copy isn't transferred. mm_location_gps_nmea_add_trace() should thus + free the copy. + + This patch fixes the above memory leaks by having + location_gps_nmea_take_trace() always take the ownership of the + `trace' + string and internally free `trace' and `trace_type' when necessary. + + libmm-glib/mm-location-gps-nmea.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 24ed8d3e997cb6dd30335a534e24dab467752b53 +Author: Ben Chan +Date: Thu Aug 3 14:41:11 2017 -0700 + + broadband-modem: fix an ineffective `g_assert (equip_id)' + + This patch fixes an ineffective `g_assert (equip_id)' in + modem_load_equipment_identifier_finish(). After mm_parse_gsn() + succeeds, + `equip_id' is freed but not reset to NULL, so `g_assert (equip_id)' + will + never assert even if `imei', `meid', and `esn' are all NULL + (though that + shouldn't happen when mm_parse_gsn() succeeds). + + src/mm-broadband-modem.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 0d3cca2c6f545cf9a91c75aed451df6d16ae5511 +Author: Ben Chan +Date: Thu Aug 3 14:25:33 2017 -0700 + + broadband-modem-qmi: fix potential use-after-freed issues + + This patch fixes some potential use-after-freed issues in + dms_get_ids_ready(). When an invalid ESN / MEID is retrieved, + `ctx->self->priv->esn' / `ctx->self->priv->meid' is freed but + not reset + to NULL. If no IMEI is retrieved, `str' can be set to the already + freed + `ctx->self->priv->esn' / `ctx->self->priv->meid' and then propagated + to + a GSimpleAsyncResult object. + + src/mm-broadband-modem-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 625c204761592ac41f23de1680b32bc78365c144 +Author: Ben Chan +Date: Thu Aug 3 13:25:09 2017 -0700 + + huawei: remove redundant call to huawei_parse_auth_type() + + This patch removes a redundant `encoded_auth = huawei_parse_auth_type + (auth)` + in connect_3gpp_context_step(). + + plugins/huawei/mm-broadband-bearer-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f81a518515cdd213f53527025a12f7d40b5cfbbc +Author: Aleksander Morgado +Date: Fri Aug 4 13:49:32 2017 +0200 + + bearer-mbim: minor update in debug log messages + + src/mm-bearer-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d58305bf1fc89dd44e3d3f267dd4ed7579e7fd61 +Author: Ben Chan +Date: Thu Aug 3 13:24:49 2017 -0700 + + bearer-mbim: avoid accessing invalid session_id and nw_error + + This patch fixes an issue in disconnect_set_ready(). If + mbim_message_connect_response_parse(), `session_id' and `nw_error' are + not set to a valid value, and thus shouldn't be used. + + src/mm-bearer-mbim.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit e1823e605e69121fae50e6ca3c097ad7a94156f4 +Author: Ben Chan +Date: Tue Aug 1 17:01:04 2017 -0700 + + huawei: ensure MMBearerConnectResult populated into GSimpleAsyncResult + + During the CONNECT_3GPP_CONTEXT_STEP_LAST step, + connect_3gpp_context_step() conditionally creates and populates a + MMBearerConnectResult object into the GSimpleAsyncResult object + when the + ipv4_config field of the Connect3gppContext struct is set. That + assumes + the ipv4_config field is always initialized in + connect_dhcp_check_ready() during the + CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG step. Instead of having such an + assumption, this patch modifies connect_3gpp to always initialize + the ipv4_config field, such that connect_3gpp_context_step() always + populates a MMBearerConnectResult object into the GSimpleAsyncResult + object. + + plugins/huawei/mm-broadband-bearer-huawei.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit 0bb01ab68d36e63d08f9ed827524a24829c26835 +Author: Ben Chan +Date: Wed Aug 2 21:53:32 2017 -0700 + + sms-part-cdma: add missing break statements in + cause_code_to_delivery_state + + This patch fixes cause_code_to_delivery_state() by adding two missing + break statements for the case ERROR_CLASS_TEMPORARY and + ERROR_CLASS_PERMANENT in the `switch (error_class)` statement. Without + the break statements, the switch always falls through to the + default and + returns MM_SMS_DELIVERY_STATE_UNKNOWN for an `error_class' of value + ERROR_CLASS_TEMPORARY or ERROR_CLASS_PERMANENT. + + src/mm-sms-part-cdma.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 6132a4d2ae92e99746f6840bb7330c56c0d8fcbf +Author: Ben Chan +Date: Wed Aug 2 21:53:22 2017 -0700 + + novatel: avoid calling qcdm_result_unref on NULL QcdmResult + + plugins/novatel/mm-broadband-modem-novatel.c | 1 - + 1 file changed, 1 deletion(-) + +commit bae4590784e9c4ca9b902b9fc69606cffe0ddb14 +Author: Ben Chan +Date: Wed Aug 2 21:53:14 2017 -0700 + + libmm-glib,firmware: fix unique_id checks + + The following checks in mm_modem_firmware_select() and + mm_modem_firmware_select_sync() could result in a NULL pointer + dereference if `unique_id' is NULL: + + g_return_if_fail (unique_id != NULL || unique_id[0] == '\0') + g_return_val_if_fail (unique_id != NULL || unique_id[0] == + '\0', FALSE) + + This patch fixes the checks to properly verify that `unique_id' is + neither NULL nor an empty string. + + libmm-glib/mm-modem-firmware.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 5accaf504f92b93b66058ac856a7d0b150b1c410 +Author: Ben Chan +Date: Wed Aug 2 21:53:44 2017 -0700 + + ublox: remove unused variable + + plugins/ublox/mm-broadband-bearer-ublox.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 03bf0479ae516862e0c1972654d31acc83a05fbb +Author: Ben Chan +Date: Wed Aug 2 21:53:43 2017 -0700 + + plugin-manager: remove unused variable + + src/mm-plugin-manager.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 838173d50f273bc2498e62315723d0f0a5312f44 +Author: Ben Chan +Date: Wed Aug 2 21:53:42 2017 -0700 + + call-list: remove unused variables + + src/mm-call-list.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 06bbe6700040fba939538de6fea5ff01de9da963 +Author: Ben Chan +Date: Wed Aug 2 21:53:41 2017 -0700 + + broadband-modem: remove unused variables + + src/mm-broadband-modem.c | 12 ------------ + 1 file changed, 12 deletions(-) + +commit 8e645485e35b50ee9bdfb79cc4983b7ad1d64c34 +Author: Ben Chan +Date: Wed Aug 2 21:53:40 2017 -0700 + + broadband-bearer: remove unused variable + + src/mm-broadband-bearer.c | 2 -- + 1 file changed, 2 deletions(-) + +commit ae82e7d58cb37184e52e486fbae6f4f6fe751a71 +Author: Ben Chan +Date: Thu Aug 3 00:58:20 2017 -0700 + + broadband-modem-mbim: remove unused variable + + src/mm-broadband-modem-mbim.c | 2 -- + 1 file changed, 2 deletions(-) + +commit b5dba9ad1c867859912c16ea4030852917fb9bc1 +Author: Carlo Lobrano +Date: Fri Jul 28 15:57:55 2017 +0200 + + telit-plugin: ignore QSS when SIM-ME interface is locked + + With some modems, the lock/unlock of the SIM-ME interface with + +CSIM=1/0 + command is followed by #QSS unsolicited messages. With the current + implementation, this messages are mistaken for SIM swap events and + so the + modem is first dropped and then re-probed. + + With this patch, the plugin takes into account the SIM-ME lock + state when + parsing #QSS unsolicited, so that the QSS handler can correctly + elaborate the messages that are not related to SIM swap events. + + plugins/telit/mm-broadband-modem-telit.c | 85 + ++++++++++++++++++++++++++++---- + plugins/telit/mm-modem-helpers-telit.h | 9 ++++ + 2 files changed, 85 insertions(+), 9 deletions(-) + +commit 60092ed7ea717c24495ddc00119b0dce982912b1 +Author: Aleksander Morgado +Date: Tue Aug 1 10:11:02 2017 +0200 + + broadband-modem: single g_object_get() call to read multiple + properties + + src/mm-broadband-modem.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +commit 9cdc237241ef7129c422ce33eca181ad8c837f8b +Author: Carlo Lobrano +Date: Tue Jul 25 09:03:05 2017 +0200 + + sim hot swap: improved error management + + Currently, when SIM hot swap fails in either mm-iface or plugin, the + ModemManager still opens ports context and prints a message saying + that + SIM hot swap is supported and that it's waiting for SIM insertion, + instead of clearly saying that SIM hot swap is not working. + + This patch: + + 1. introduces a new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED + which is FALSE by default and set to TRUE only when + setup_sim_hot_swap_finish() succeded. + 2. subordinates the completion of SIM hot swap setup (in + mm-broadband-modem) and the related messages to the the value of + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED + + Finally, this patch replaces the MBIM's sim_hot_swap_on private + property + with the new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, since + they have the + same meaning. + + plugins/telit/mm-broadband-modem-telit.c | 1 + + src/mm-broadband-modem-mbim.c | 21 ++++--- + src/mm-broadband-modem.c | 94 + ++++++++++++++++++++++---------- + src/mm-iface-modem.c | 14 ++++- + src/mm-iface-modem.h | 1 + + 5 files changed, 93 insertions(+), 38 deletions(-) + +commit b2c7244b6c73dc615e67cf2f90f30ad671b43a84 +Author: Valentin Blot +Date: Mon Jul 31 00:41:08 2017 +0200 + + mmcli: description of the location-set-gps-refresh-rate option + + Commit 6c35878f12ab37604d85cb3a864e3859973bd195 introduced a new + option for + setting the refresh rate of location on DBus. This patch describes + the option + in the man page. + + https://bugs.freedesktop.org/show_bug.cgi?id=89924 + + docs/man/mmcli.8 | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 4e468d04acd1e17c91ab5e66f3032db1b7e51c39 +Author: Ben Chan +Date: Wed Jul 26 18:25:38 2017 -0700 + + bearer-mbim: avoid calling mbim_message_unref on NULL MbimMessage + + src/mm-bearer-mbim.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 08f5b86c5d10026a14654df1bc8c6195748dd07a +Author: Ben Chan +Date: Thu Jul 20 01:29:17 2017 -0700 + + longcheer: port longcheer_custom_init to use GTask + + plugins/longcheer/mm-plugin-longcheer.c | 88 + ++++++++++++++++----------------- + 1 file changed, 42 insertions(+), 46 deletions(-) + +commit 0dc719ed1922612e87bf882d69501eaa288cfc0c +Author: Ben Chan +Date: Thu Jul 20 01:06:07 2017 -0700 + + longcheer: port set_current_modes to use GTask + + plugins/longcheer/mm-broadband-modem-longcheer.c | 39 + +++++++++++------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit bf8e75b8bdc82c7275d957e26bcf70bc3f449467 +Author: Ben Chan +Date: Thu Jul 20 01:08:25 2017 -0700 + + longcheer: port load_unlock_retries to use GTask + + plugins/longcheer/mm-broadband-modem-longcheer.c | 34 + +++++++++--------------- + 1 file changed, 12 insertions(+), 22 deletions(-) + +commit 4cb2232f0f8cbeb1a0e5b48229d4efc7401f3fd9 +Author: Ben Chan +Date: Thu Jul 20 01:03:04 2017 -0700 + + longcheer: port load_supported_modes to use GTask + + plugins/longcheer/mm-broadband-modem-longcheer.c | 22 + +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit aa0a6bed363419659101084b3861a51144eee859 +Author: Ben Chan +Date: Wed Jul 19 11:23:38 2017 -0700 + + zte,icera: port modem_3gpp_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/zte/mm-broadband-modem-zte-icera.c | 39 + ++++++++++++------------------ + 1 file changed, 15 insertions(+), 24 deletions(-) + +commit e8599340b477e009d1e4b1be0c68aa99661aafc2 +Author: Ben Chan +Date: Wed Jul 19 11:19:41 2017 -0700 + + zte: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask + + plugins/zte/mm-broadband-modem-zte.c | 39 + ++++++++++++++---------------------- + 1 file changed, 15 insertions(+), 24 deletions(-) + +commit 8370556318d1cf30620faa0a13dbbf79ff4e86a0 +Author: Ben Chan +Date: Wed Jul 19 11:11:40 2017 -0700 + + zte: port modem_after_sim_unlock to use GTask + + plugins/zte/mm-broadband-modem-zte.c | 61 + +++++++++++++++++------------------- + 1 file changed, 29 insertions(+), 32 deletions(-) + +commit 9f67e229517cd93734a1ab8cfd6303e85223cecd +Author: Ben Chan +Date: Wed Jul 19 11:16:10 2017 -0700 + + zte: port set_current_modes to use GTask + + plugins/zte/mm-broadband-modem-zte.c | 39 + ++++++++++++++++-------------------- + 1 file changed, 17 insertions(+), 22 deletions(-) + +commit 289ab66fafe4e9124a7bd5958ed4ec2006704dd2 +Author: Ben Chan +Date: Wed Jul 19 11:05:20 2017 -0700 + + zte: port load_supported_modes to use GTask + + plugins/zte/mm-broadband-modem-zte.c | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit c609c2bc46f07d1bb14993ef3c0268f5541114d6 +Author: Ben Chan +Date: Wed Jul 19 11:03:37 2017 -0700 + + zte: port load_unlock_retries to use GTask + + plugins/zte/mm-broadband-modem-zte.c | 33 + ++++++++++++--------------------- + 1 file changed, 12 insertions(+), 21 deletions(-) + +commit 03d96197598c08bb3c8faf7b4b795865c80315fb +Author: Ben Chan +Date: Tue Jul 18 22:33:36 2017 -0700 + + altair-lte: port modem_3gpp_load_subscription_state, + altair_pco_info_changed to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 71 + ++++++++++++++------------ + 1 file changed, 39 insertions(+), 32 deletions(-) + +commit de4432da210a94c11acb2ed73ae72a60dde40aa2 +Author: Ben Chan +Date: Tue Jul 18 22:33:31 2017 -0700 + + altair-lte: port modem_3gpp_disable_unsolicited_events to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 29 + +++++++++++--------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit e2b161c68434f58700981365a8e3d9bb5f16d5b9 +Author: Ben Chan +Date: Tue Jul 18 22:33:30 2017 -0700 + + altair-lte: port modem_3gpp_enable_unsolicited_events to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 29 + +++++++++++--------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit 00aaa1864a72b9c59394eb44ed2f4ade31214715 +Author: Ben Chan +Date: Tue Jul 18 22:33:27 2017 -0700 + + altair-lte: port modem_3gpp_{setup,cleanup}_unsolicited_events to + use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 39 + ++++++++++---------------- + 1 file changed, 15 insertions(+), 24 deletions(-) + +commit 282ed056a6a0c3e67787809715ec7d413e5f0b2a +Author: Ben Chan +Date: Tue Jul 18 22:33:25 2017 -0700 + + altair-lte: port load_current_bands to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 36 + +++++++++----------------- + 1 file changed, 12 insertions(+), 24 deletions(-) + +commit 2d82c505e465064a0f990c28188ab8b8aa14fc0c +Author: Ben Chan +Date: Tue Jul 18 22:33:23 2017 -0700 + + altair-lte: port load_supported_bands to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 36 + +++++++++----------------- + 1 file changed, 12 insertions(+), 24 deletions(-) + +commit 4ea38c26e068644a364b307b3951ac71f4618321 +Author: Ben Chan +Date: Tue Jul 18 22:33:21 2017 -0700 + + altair-lte: port load_unlock_retries to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 49 + +++++++++++--------------- + 1 file changed, 21 insertions(+), 28 deletions(-) + +commit e2e7121e44a3da41af86e591fc710a9b373c34be +Author: Ben Chan +Date: Tue Jul 18 22:33:20 2017 -0700 + + altair-lte: port load_current_capabilities to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 28 + ++++++++++++-------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +commit a96e8f824bc8847f53f7e647f233fa8ca8cf4e1f +Author: Ben Chan +Date: Tue Jul 18 22:33:18 2017 -0700 + + altair-lte: port modem_create_bearer to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 30 + +++++++------------------- + 1 file changed, 8 insertions(+), 22 deletions(-) + +commit 555883d10729415896b24d1f0547fbf8d21eeeb3 +Author: Ben Chan +Date: Tue Jul 18 22:33:16 2017 -0700 + + altair-lte: port modem_3gpp_run_registration_checks to use GTask + + plugins/altair/mm-broadband-modem-altair-lte.c | 36 + +++++++++++--------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit 15109a8513eb666c161f37bbf43ceb46d0470279 +Author: Ben Chan +Date: Tue Jul 18 22:33:15 2017 -0700 + + altair-lte: port disconnect_3gpp to use GTask + + plugins/altair/mm-broadband-bearer-altair-lte.c | 61 + +++++++++---------------- + 1 file changed, 22 insertions(+), 39 deletions(-) + +commit 710d5c036bf03a466eb113f99ffc5611ff50e22a +Author: Ben Chan +Date: Tue Jul 18 22:33:13 2017 -0700 + + altair-lte: port connect_3gpp to use GTask + + plugins/altair/mm-broadband-bearer-altair-lte.c | 134 + +++++++++--------------- + 1 file changed, 52 insertions(+), 82 deletions(-) + +commit 3f273429a535f7e32b7acd6b6b936183d3187a70 +Author: Ben Chan +Date: Tue Jul 18 22:32:20 2017 -0700 + + broadband-bearer: port initable_init_async to use GTask + + src/mm-broadband-bearer.c | 87 + ++++++++++++++++++++++------------------------- + 1 file changed, 41 insertions(+), 46 deletions(-) + +commit 6dc2f23d8f9279042aafc6389ede74a894f33fc8 +Author: Ben Chan +Date: Tue Jul 18 22:32:17 2017 -0700 + + broadband-bearer: port disconnect_{3gpp,cdma} to use GTask + + src/mm-broadband-bearer.c | 133 + ++++++++++++++++++++++++---------------------- + 1 file changed, 70 insertions(+), 63 deletions(-) + +commit fd34814b367c2612da84d0964d32165e0609b66f +Author: Ben Chan +Date: Tue Jul 18 22:32:12 2017 -0700 + + broadband-bearer: port disconnect to use GTask + + src/mm-broadband-bearer.c | 90 + ++++++++++++++++------------------------------- + 1 file changed, 30 insertions(+), 60 deletions(-) + +commit 903e2287829dba44ea536da469e4aaf48b10dab8 +Author: Ben Chan +Date: Tue Jul 18 22:32:07 2017 -0700 + + broadband-bearer: port connect_{3gpp,cdma} to use GTask + + src/mm-broadband-bearer.c | 265 + +++++++++++++++++++++------------------------- + 1 file changed, 121 insertions(+), 144 deletions(-) + +commit be2ac3f25674d0ba4035f42d920b5f6396b24ab3 +Author: Ben Chan +Date: Tue Jul 18 22:32:03 2017 -0700 + + broadband-bearer: port connect to use GTask + + src/mm-broadband-bearer.c | 93 + ++++++++++++++++++++--------------------------- + 1 file changed, 40 insertions(+), 53 deletions(-) + +commit e3561374846724006dfaa93a8259ff649ebc4c8b +Author: Ben Chan +Date: Tue Jul 18 22:31:58 2017 -0700 + + broadband-bearer: port dial_3gpp to use GTask + + src/mm-broadband-bearer.c | 107 + +++++++++++++++++----------------------------- + 1 file changed, 39 insertions(+), 68 deletions(-) + +commit 8af44d3589615b054221a34e39c0525dd0a2e491 +Author: Ben Chan +Date: Tue Jul 18 15:28:51 2017 -0700 + + broadband-bearer: fix crm_range_ready + + crm_range_ready() misses a return statement after it invokes + interface_initialization_step(), which will lead to an invalid + access of + the already freed InitAsyncContext. + + src/mm-broadband-bearer.c | 1 + + 1 file changed, 1 insertion(+) + +commit 4db3ccf2af1f00f848af105910e75581383f0db4 +Author: Aleksander Morgado +Date: Wed Jul 19 11:21:27 2017 +0200 + + helpers: +CNUM parser doesn't return any error + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 +- + src/mm-broadband-modem.c | 2 +- + src/mm-modem-helpers.c | 3 +-- + src/mm-modem-helpers.h | 3 +-- + src/tests/test-modem-helpers.c | 4 +--- + 5 files changed, 5 insertions(+), 9 deletions(-) + +commit 7ff5e30dce22bbe636d8f9dfafaad477bf844003 +Author: Aleksander Morgado +Date: Wed Jul 19 11:02:49 2017 +0200 + + broadband-modem: if no own numbers returned, complete task with NULL + + Fixes: 738deebfb4586ffff560d538f7809cf2fdee7132 + + Reported-by: Colin Helliwell + + src/mm-broadband-modem.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +commit 14dbbad1ad0e18be3e9623b357fc9a0daf02d6da +Author: Aleksander Morgado +Date: Tue Jul 18 11:31:36 2017 +0200 + + broadband-modem: plug memleak in init_current_storages() + + ==28664== 4 bytes in 1 blocks are definitely lost in loss record + 33 of 4,317 + ==28664== at 0x4C2BE1F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==28664== by 0x4C2E164: realloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==28664== by 0x644E0CF: g_realloc (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6469C06: ??? (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6469C61: g_string_sized_new (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x4E8514A: mm_common_build_sms_storages_string + (mm-common-helpers.c:116) + ==28664== by 0x489035: cpms_query_ready + (mm-broadband-modem.c:5428) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + ==28664== by 0x44EADF: at_command_ready + (mm-base-modem-at.c:503) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + ==28664== by 0x4D8122: serial_command_ready + (mm-port-serial-at.c:392) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + ==28664== + ==28664== 4 bytes in 1 blocks are definitely lost in loss record + 34 of 4,317 + ==28664== at 0x4C2BE1F: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==28664== by 0x4C2E164: realloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==28664== by 0x644E0CF: g_realloc (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6469C06: ??? (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6469C61: g_string_sized_new (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x4E8514A: mm_common_build_sms_storages_string + (mm-common-helpers.c:116) + ==28664== by 0x489067: cpms_query_ready + (mm-broadband-modem.c:5430) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + ==28664== by 0x44EADF: at_command_ready + (mm-base-modem-at.c:503) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + ==28664== by 0x4D8122: serial_command_ready + (mm-port-serial-at.c:392) + ==28664== by 0x5E8E335: g_simple_async_result_complete (in + /usr/lib/libgio-2.0.so.0.5200.2) + + src/mm-broadband-modem.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit bad79cb5e1063fcb269543c07a7be5b32762b3cb +Author: Aleksander Morgado +Date: Tue Jul 18 11:28:33 2017 +0200 + + port-serial: plug memleak on error processing + + ==28664== 216 (120 direct, 96 indirect) bytes in 5 blocks are + definitely lost in loss record 4,109 of 4,317 + ==28664== at 0x4C2BEEF: malloc (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==28664== by 0x644E018: g_malloc (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6465B05: g_slice_alloc (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6469C32: g_string_sized_new (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x4D7861: parse_response (mm-port-serial-at.c:142) + ==28664== by 0x4D3B52: parse_response_buffer + (mm-port-serial.c:857) + ==28664== by 0x4D40F2: common_input_available + (mm-port-serial.c:981) + ==28664== by 0x4D41B4: iochannel_input_available + (mm-port-serial.c:1004) + ==28664== by 0x64488B4: g_main_context_dispatch (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6448C77: ??? (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x6448F91: g_main_loop_run (in + /usr/lib/libglib-2.0.so.0.5200.2) + ==28664== by 0x438035: main (main.c:180) + + src/mm-port-serial-at.c | 1 + + 1 file changed, 1 insertion(+) + +commit fa31b699ece5dbc64600b7a41364d5167f98ef5e +Author: Aleksander Morgado +Date: Tue Jul 18 10:47:47 2017 +0200 + + broadband-modem: remove unneeded InitializationStartedContext struct + + src/mm-broadband-modem.c | 29 +++++++---------------------- + 1 file changed, 7 insertions(+), 22 deletions(-) + +commit 6515c81f44cc644b45232ddacd2107c9c552b077 +Author: Ben Chan +Date: Thu Jul 6 18:38:07 2017 -0700 + + broadband-modem: port modem_3gpp_cleanup_unsolicited_events to + use GTask + + src/mm-broadband-modem.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit 81d2d572b43cacb402b2397e8b7335e6eddd147c +Author: Ben Chan +Date: Thu Jul 6 18:37:21 2017 -0700 + + broadband-modem: port modem_3gpp_setup_unsolicited_events to use GTask + + src/mm-broadband-modem.c | 37 +++++++++++++++---------------------- + 1 file changed, 15 insertions(+), 22 deletions(-) + +commit 0c49fb3e2fdb3bd317b71195bc869be214ffc904 +Author: Ben Chan +Date: Wed Jul 12 13:29:36 2017 -0700 + + broadband-modem: port modem_voice_{setup,cleanup}_unsolicited_events + to use GTask + + src/mm-broadband-modem.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +commit 4a2cc7b731456c2d68ac8873ae3db1c4211dbac0 +Author: Ben Chan +Date: Wed Jul 12 17:24:58 2017 -0700 + + broadband-modem: port + modem_messaging_{setup,cleanup}_unsolicited_events to use GTask + + src/mm-broadband-modem.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +commit c7e47b97e8abeb553e6ae2041fa0813ecd776267 +Author: Ben Chan +Date: Wed Jul 12 23:26:59 2017 -0700 + + broadband-modem: port modem_cdma_get_detailed_registration_state to + use GTask + + src/mm-broadband-modem.c | 107 + +++++++++++++++++++++++++++-------------------- + 1 file changed, 62 insertions(+), 45 deletions(-) + +commit e040ee27a0b418926cc99a6846c86ff6397ee560 +Author: Ben Chan +Date: Wed Jul 12 14:57:02 2017 -0700 + + broadband-modem: port modem_cdma_get_service_status to use GTask + + src/mm-broadband-modem.c | 39 ++++++++++++++++++++------------------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +commit 610a6299e1b68dd161e9a8f33aca577756191477 +Author: Ben Chan +Date: Wed Jul 12 18:20:03 2017 -0700 + + broadband-modem: port modem_3gpp_run_registration_checks to use GTask + + src/mm-broadband-modem.c | 73 + ++++++++++++++++++++++++++---------------------- + 1 file changed, 40 insertions(+), 33 deletions(-) + +commit a93add611f607f3332f1b3b1f277ab2b07c441fc +Author: Ben Chan +Date: Wed Jul 12 18:08:17 2017 -0700 + + broadband-modem: port modem_3gpp_load_enabled_facility_locks to + use GTask + + src/mm-broadband-modem.c | 83 + ++++++++++++++++++++++++------------------------ + 1 file changed, 42 insertions(+), 41 deletions(-) + +commit 1fe33d34e8c7ef1d6baf21c0517ceb15f2898d0a +Author: Ben Chan +Date: Wed Jul 12 13:07:37 2017 -0700 + + broadband-modem: port modem_3gpp_load_subscription_state to use GTask + + src/mm-broadband-modem.c | 29 ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) + +commit c812101a128529ae4240c69347031c335f0cacf1 +Author: Ben Chan +Date: Wed Jul 12 18:30:22 2017 -0700 + + broadband-modem: port + modem_3gpp_{enable,disable}_unsolicited_registration_events to + use GTask + + src/mm-broadband-modem.c | 123 + +++++++++++++++++++++++++---------------------- + 1 file changed, 66 insertions(+), 57 deletions(-) + +commit ece9b87a67f9d61d2837d68f4879e91dac04ac02 +Author: Ben Chan +Date: Wed Jul 12 13:10:17 2017 -0700 + + broadband-modem: port modem_3gpp_setup_unsolicited_registration_events + to use GTask + + src/mm-broadband-modem.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 7ee52bb99aacbce01b5a9998477a4946affb0963 +Author: Ben Chan +Date: Wed Jul 12 13:11:41 2017 -0700 + + broadband-modem: port + modem_3gpp_cleanup_unsolicited_registration_events to use GTask + + src/mm-broadband-modem.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit dad7c8c403b074e6f93f77434abec1788614c792 +Author: Ben Chan +Date: Thu Jul 6 18:43:52 2017 -0700 + + broadband-modem: port modem_3gpp_{enable,disable}_unsolicited_events + to use GTask + + src/mm-broadband-modem.c | 79 + +++++++++++++++++++++++------------------------- + 1 file changed, 38 insertions(+), 41 deletions(-) + +commit 5ccefe30c36cfbbf7856ac5395102b585d3fc782 +Author: Ben Chan +Date: Wed Jul 12 13:14:54 2017 -0700 + + broadband-modem: port modem_3gpp_ussd_cancel to use GTask + + src/mm-broadband-modem.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit 17dff1f6696fe50a4a6cc99c4e5f73ad667b8d42 +Author: Ben Chan +Date: Wed Jul 12 13:21:28 2017 -0700 + + broadband-modem: port modem_3gpp_ussd_check_support to use GTask + + src/mm-broadband-modem.c | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +commit 03977eb501aa05cb5e3fc410a50aa7be2741f048 +Author: Ben Chan +Date: Wed Jul 12 13:20:12 2017 -0700 + + broadband-modem: port + modem_3gpp_ussd_{enable,disable}_unsolicited_result_codes to use GTask + + src/mm-broadband-modem.c | 32 ++++++++++++-------------------- + 1 file changed, 12 insertions(+), 20 deletions(-) + +commit 249f880c3c8ee71983b776c4453b1527cdab39ec +Author: Ben Chan +Date: Wed Jul 12 13:17:57 2017 -0700 + + broadband-modem: port + modem_3gpp_ussd_{setup,cleanup}_unsolicited_result_codes to use GTask + + src/mm-broadband-modem.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +commit 8b5aa2a41cff47ac49b24f1264bee359b8122a12 +Author: Ben Chan +Date: Wed Jul 12 22:35:07 2017 -0700 + + broadband-modem: port cmti_received to use GTask + + src/mm-broadband-modem.c | 52 + ++++++++++++++++++++++-------------------------- + 1 file changed, 24 insertions(+), 28 deletions(-) + +commit 511a08c33c9aef4dbfe06bde3de6fc9ad42558e5 +Author: Ben Chan +Date: Wed Jul 12 18:52:02 2017 -0700 + + broadband-modem: port mm_broadband_modem_lock_sms_storages to + use GTask + + src/mm-broadband-modem.c | 65 + +++++++++++++++++++++--------------------------- + 1 file changed, 29 insertions(+), 36 deletions(-) + +commit 2ec660024de56d6df45c17c15ee6b86acca5d027 +Author: Ben Chan +Date: Wed Jul 12 22:49:22 2017 -0700 + + broadband-modem: port modem_messaging_load_initial_sms_parts to + use GTask + + src/mm-broadband-modem.c | 79 + +++++++++++++++++++++++------------------------- + 1 file changed, 38 insertions(+), 41 deletions(-) + +commit 78c0bbf41dd63e77c271dafadc627270c571d8a1 +Author: Ben Chan +Date: Wed Jul 12 17:21:00 2017 -0700 + + broadband-modem: port modem_messaging_setup_sms_format to use GTask + + src/mm-broadband-modem.c | 28 ++++++++++++---------------- + 1 file changed, 12 insertions(+), 16 deletions(-) + +commit de6ba7a7aa5710189b51ef3e7580976fb0f4ecef +Author: Ben Chan +Date: Wed Jul 12 13:40:52 2017 -0700 + + broadband-modem: port modem_messaging_set_default_storage to use GTask + + src/mm-broadband-modem.c | 33 +++++++++++++++------------------ + 1 file changed, 15 insertions(+), 18 deletions(-) + +commit 101c646cf93feb7d843895ff3456a6627c20b302 +Author: Ben Chan +Date: Wed Jul 12 13:33:25 2017 -0700 + + broadband-modem: port modem_messaging_load_supported_storages to + use GTask + + src/mm-broadband-modem.c | 44 + +++++++++++++++++++------------------------- + 1 file changed, 19 insertions(+), 25 deletions(-) + +commit 1d72695df93bdb22e1788375b2f962f41a655925 +Author: Ben Chan +Date: Wed Jul 12 13:37:57 2017 -0700 + + broadband-modem: port modem_messaging_init_current_storages to + use GTask + + src/mm-broadband-modem.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit c29cd5eb4e027c5052160be6111be9bae93a98df +Author: Ben Chan +Date: Wed Jul 12 13:25:32 2017 -0700 + + broadband-modem: port modem_messaging_check_support to use GTask + + src/mm-broadband-modem.c | 30 ++++++++++++------------------ + 1 file changed, 12 insertions(+), 18 deletions(-) + +commit ed0c91b71b27c78caaeaff1a0a4daff2c2b94d1f +Author: Ben Chan +Date: Wed Jul 12 14:51:11 2017 -0700 + + broadband-modem: port modem_messaging_enable_unsolicited_events to + use GTask + + src/mm-broadband-modem.c | 31 +++++++++++++------------------ + 1 file changed, 13 insertions(+), 18 deletions(-) + +commit c270720e9405fc18158bde847a7f81e885587abf +Author: Ben Chan +Date: Wed Jul 12 13:27:49 2017 -0700 + + broadband-modem: port modem_voice_check_support to use GTask + + src/mm-broadband-modem.c | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +commit 4249792c4e7e83a055ea22da1dc8d14c3afce08b +Author: Ben Chan +Date: Thu Jul 6 18:55:19 2017 -0700 + + broadband-modem: port modem_setup_charset to use GTask + + src/mm-broadband-modem.c | 63 + +++++++++++++++++++++++------------------------- + 1 file changed, 30 insertions(+), 33 deletions(-) + +commit d638da86bd7359a882180cdaf2160aaad39228ac +Author: Ben Chan +Date: Thu Jul 6 14:48:51 2017 -0700 + + broadband-modem: port modem_power_up to use GTask + + src/mm-broadband-modem.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit 16a14e768feba78f95b508d0f7e8fb2a17b4a204 +Author: Ben Chan +Date: Thu Jul 6 14:47:14 2017 -0700 + + broadband-modem: port modem_load_power_state to use GTask + + src/mm-broadband-modem.c | 35 ++++++++++++++++++----------------- + 1 file changed, 18 insertions(+), 17 deletions(-) + +commit 49366f7f0068be8f9b9c650a70aeaab012288549 +Author: Ben Chan +Date: Thu Jul 6 18:29:51 2017 -0700 + + broadband-modem: port modem_load_signal_quality to use GTask + + src/mm-broadband-modem.c | 146 + +++++++++++++++++++++++++---------------------- + 1 file changed, 79 insertions(+), 67 deletions(-) + +commit 4da7cf96ac80c1775bf2dba53f49825b9d41025a +Author: Ben Chan +Date: Thu Jul 6 15:22:16 2017 -0700 + + broadband-modem: port modem_load_supported_ip_families to use GTask + + src/mm-broadband-modem.c | 38 +++++++++++++++++--------------------- + 1 file changed, 17 insertions(+), 21 deletions(-) + +commit 8c9bcd76c26247228767af8a601d06815241766b +Author: Ben Chan +Date: Thu Jul 6 15:15:21 2017 -0700 + + broadband-modem: port modem_load_supported_modes to use GTask + + src/mm-broadband-modem.c | 113 + +++++++++++++++++++++++++---------------------- + 1 file changed, 60 insertions(+), 53 deletions(-) + +commit 738deebfb4586ffff560d538f7809cf2fdee7132 +Author: Ben Chan +Date: Thu Jul 6 15:05:52 2017 -0700 + + broadband-modem: port modem_load_own_numbers to use GTask + + src/mm-broadband-modem.c | 82 + ++++++++++++++++++++++-------------------------- + 1 file changed, 38 insertions(+), 44 deletions(-) + +commit a24a99e70241afea5302772b6d6a90429a5140a3 +Author: Ben Chan +Date: Wed Jul 12 17:37:36 2017 -0700 + + broadband-modem: port modem_load_current_capabilities to use GTask + + src/mm-broadband-modem.c | 118 + +++++++++++++++++++++++------------------------ + 1 file changed, 59 insertions(+), 59 deletions(-) + +commit 6abd626a0b800a0259606d74d0a4ee5dabe2fc45 +Author: Ben Chan +Date: Thu Jul 6 14:44:15 2017 -0700 + + broadband-modem: port modem_load_supported_charsets to use GTask + + src/mm-broadband-modem.c | 47 + +++++++++++++++++++++-------------------------- + 1 file changed, 21 insertions(+), 26 deletions(-) + +commit 524ecfb03e4d6476288f4efac947f010494c4e9f +Author: Ben Chan +Date: Thu Jul 6 14:38:14 2017 -0700 + + broadband-modem: port modem_load_unlock_required to use GTask + + src/mm-broadband-modem.c | 42 ++++++++++++++++++------------------------ + 1 file changed, 18 insertions(+), 24 deletions(-) + +commit f7db91616935f9ccd740415cb0bead63f2fde426 +Author: Ben Chan +Date: Thu Jul 6 13:50:26 2017 -0700 + + broadband-modem: port modem_create_bearer to use GTask + + src/mm-broadband-modem.c | 31 ++++++++----------------------- + 1 file changed, 8 insertions(+), 23 deletions(-) + +commit a7dee00e5c9377ac5f80c632f6cc9f67aac1eea5 +Author: Ben Chan +Date: Wed Jul 5 17:40:09 2017 -0700 + + broadband-modem: port modem_location_load_capabilities to use GTask + + src/mm-broadband-modem.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +commit ceb13f525194d9fa70a9f6d71f5825034a8d96c1 +Author: Ben Chan +Date: Wed Jul 5 17:32:50 2017 -0700 + + broadband-modem: port enable_location_gathering to use GTask + + src/mm-broadband-modem.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 53c34494b695bf808bfbdf8c1adf5a4eb8b6ef69 +Author: Ben Chan +Date: Wed Jul 5 17:30:28 2017 -0700 + + broadband-modem: port initialization_started to use GTask + + src/mm-broadband-modem.c | 34 +++++++++++----------------------- + 1 file changed, 11 insertions(+), 23 deletions(-) + +commit 034353e38bd0bcf7551d73e1c7437bad5ffe6273 +Author: Ben Chan +Date: Wed Jul 5 17:27:17 2017 -0700 + + broadband-modem: port enabling_started to use GTask + + src/mm-broadband-modem.c | 86 + ++++++++++++++++++++++++++---------------------- + 1 file changed, 47 insertions(+), 39 deletions(-) + +commit 77bb31e5cf47c3d3b6fe15f66825c1669db676f3 +Author: Ben Chan +Date: Wed Jul 5 17:14:56 2017 -0700 + + broadband-modem: port disable to use GTask + + src/mm-broadband-modem.c | 107 + ++++++++++++++++++++++------------------------- + 1 file changed, 50 insertions(+), 57 deletions(-) + +commit ba162ce1f38925cd4ef10db0857d0cd831ba6284 +Author: Ben Chan +Date: Wed Jul 5 17:06:52 2017 -0700 + + broadband-modem: port enable to use GTask + + src/mm-broadband-modem.c | 176 + ++++++++++++++++++++++------------------------- + 1 file changed, 83 insertions(+), 93 deletions(-) + +commit 04532ea54ebec81b2f546e5440771ca3fc1f461f +Author: Ben Chan +Date: Wed Jul 5 16:57:43 2017 -0700 + + broadband-modem: port initialize to use GTask + + src/mm-broadband-modem.c | 200 + ++++++++++++++++++++++------------------------- + 1 file changed, 95 insertions(+), 105 deletions(-) + +commit ce664a6264271ec4a50f56118028829cbc2f09ee +Author: Ben Chan +Date: Mon Jul 17 18:11:01 2017 -0700 + + sms-mbim: fix peek_device to use g_task_report_new_error + + When porting MMSmsMbim to use GTask, peek_device wasn't modified + to use + g_task_report_new_error, which could potentially lead to an incorrect + G_TASK cast. + + src/mm-sms-mbim.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit d25e6bdfaa9d4116db91a6b134a13d6319192954 +Author: Ben Chan +Date: Mon Jul 17 18:11:00 2017 -0700 + + iface-modem-time: fix update_network_timezone to use + g_task_report_new_error + + Commit 7c5f308af ("iface-modem-time: port update_network_timezone + to use + GTask") ported most of the update_network_timezone code to use GTask, + but missed a g_simple_async_report_error_in_idle call, which could + potentially lead to an incorrect G_TASK cast. + + src/mm-iface-modem-time.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 0657914ebbe387a4bb356303086fe0f354d88756 +Author: Ben Chan +Date: Mon Jul 17 18:10:59 2017 -0700 + + call-list: fix mm_call_list_delete_call to use g_task_report_new_error + + Commit a08064492 ("call-list: port mm_call_list_delete_call to + use GTask") + ported most of the mm_call_list_delete_call code to use GTask, + but missed a + g_simple_async_report_error_in_idle calls, which can potentially + lead to + an incorrect G_TASK cast in mm_call_list_delete_call_finish. + + src/mm-call-list.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 4901a676600809fba9a8805fc524c4c1710f539a +Author: Aleksander Morgado +Date: Tue Jul 18 10:32:13 2017 +0200 + + telit: add missing source_tag in g_task_report_new_error() call + + Fixes: 1bd9935b5aece6c5999c96df1acec86cfc00e6b1 + + plugins/telit/mm-broadband-modem-telit.c | 1 + + 1 file changed, 1 insertion(+) + +commit 1317a728dad7925f87de2101801889d1864ca12e +Author: Aleksander Morgado +Date: Tue Jul 18 10:26:45 2017 +0200 + + telit: fix minor typo + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1bd9935b5aece6c5999c96df1acec86cfc00e6b1 +Author: Ben Chan +Date: Mon Jul 17 17:04:56 2017 -0700 + + telit: fix modem_set_current_bands to use g_task_report_new_error + + Commit acf101335 ("telit: port mm-broadband-modem-telit to use GTask") + ported most of the modem_set_current_bands code to use GTask, + but missed + a few g_simple_async_report_error_in_idle calls, which potentially + leads + to an incorrect G_TASK cast in modem_set_current_bands_finish. + + plugins/telit/mm-broadband-modem-telit.c | 51 + +++++++++++++++++--------------- + 1 file changed, 27 insertions(+), 24 deletions(-) + +commit 38c53ed81405167e0632fb4ce36d787fb0c29c72 +Author: Ben Chan +Date: Mon Jul 17 10:09:04 2017 -0700 + + base-modem: minor coding style fixes + + src/mm-base-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cdff53d0a4af14c2cef74dd2a9df4e313b26638d +Author: Ben Chan +Date: Mon Jul 17 10:09:03 2017 -0700 + + iface-modem: minor coding style fixes + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5263ec650f4479863b8472f7844eef601eea6368 +Author: Ben Chan +Date: Mon Jul 17 10:09:02 2017 -0700 + + log: minor coding style fixes + + src/mm-log.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 024825042e862e2a0cc8cd256b56ac23b9ce005b +Author: Ben Chan +Date: Mon Jul 17 10:09:01 2017 -0700 + + plugin-manager: minor coding style fixes + + src/mm-plugin-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5ee0b32298b0d3d1ce1199d0e3addf394df005d5 +Author: Aleksander Morgado +Date: Mon Jul 17 10:17:35 2017 +0200 + + zte,icera: fix async completion in 3gpp event handlers setting + + plugins/zte/mm-broadband-modem-zte-icera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7b392398e4c0a0e2084b49e50bb6566357db3699 +Author: Aleksander Morgado +Date: Mon Jul 17 10:17:04 2017 +0200 + + zte: fix async completion in 3gpp event handlers setting + + plugins/zte/mm-broadband-modem-zte.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ef274b5fa2f9911caa55103282088c35ec66f8ec +Author: Aleksander Morgado +Date: Mon Jul 17 10:16:19 2017 +0200 + + simtech: fix async completion in 3gpp event handlers setting + + plugins/simtech/mm-broadband-modem-simtech.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a3c980c78b32ba53d1373e07e2535a7e15b03ebb +Author: Aleksander Morgado +Date: Mon Jul 17 10:15:36 2017 +0200 + + option,hso: fix async completion in 3gpp event handlers setting + + plugins/option/mm-broadband-modem-hso.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f3a301db3c62ebe1ed1a89aa2d98765ac66759fc +Author: Aleksander Morgado +Date: Mon Jul 17 10:13:18 2017 +0200 + + option: fix async completion in 3gpp event handlers setting + + plugins/option/mm-broadband-modem-option.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e2246da507c4f93ec2f0f885586e6e5748cb829d +Author: Aleksander Morgado +Date: Mon Jul 17 10:11:45 2017 +0200 + + mtk: fix async completion in 3gpp event handlers setting + + plugins/mtk/mm-broadband-modem-mtk.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 15a221e88d57be200fcc45599c994b14f5376e4c +Author: Aleksander Morgado +Date: Mon Jul 17 10:09:17 2017 +0200 + + mbm: fix async completion in 3gpp event handlers setting + + plugins/mbm/mm-broadband-modem-mbm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0be6e7d2ea41b97caeb086040e2d50d11fb28a91 +Author: Aleksander Morgado +Date: Mon Jul 17 10:06:40 2017 +0200 + + altair-lte: fix async completion in 3gpp event handlers setting + + plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c44fa6c681a6417f174b947076085224b2dc97dd +Author: Aleksander Morgado +Date: Mon Jul 17 10:05:45 2017 +0200 + + icera: fix async completion in 3gpp event handlers setting + + plugins/icera/mm-broadband-modem-icera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f1f313c214ccc3e5b62ec17cf039b6a4a693c9d0 +Author: Aleksander Morgado +Date: Mon Jul 17 10:08:08 2017 +0200 + + huawei: skip unrequired explicit casts to GSimpleAsyncResult + + plugins/huawei/mm-broadband-modem-huawei.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 91bbcb5c5f708628688c2a429b81b3f035c1c567 +Author: Aleksander Morgado +Date: Mon Jul 17 10:03:41 2017 +0200 + + huawei: fix async completion in 3gpp event handlers setting + + plugins/huawei/mm-broadband-modem-huawei.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit c0c2e8aae8de4d72dd483c742462032ffc2f7d30 +Author: Aleksander Morgado +Date: Mon Jul 17 09:59:20 2017 +0200 + + huawei: fix async completion in voice event handlers setting + + plugins/huawei/mm-broadband-modem-huawei.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 7b0c0bc96bf501a261de2a30bf0095c61ea3ef16 +Author: Aleksander Morgado +Date: Mon Jul 17 09:54:58 2017 +0200 + + huawei: fix async completion in cdma event handlers setting + + plugins/huawei/mm-broadband-modem-huawei.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 24e8785a83eb9ac88a36b58c0c5ba83a4689800b +Author: Aleksander Morgado +Date: Mon Jul 17 09:57:21 2017 +0200 + + via: fix async completion in cdma event handlers setting + + plugins/via/mm-broadband-modem-via.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 94a289a1b35b0565b1c78da1d04a0c6b752f2155 +Author: Ben Chan +Date: Fri Jul 14 01:06:39 2017 -0700 + + modem-helpers: minor coding style fixes + + src/mm-modem-helpers.c | 6 +++--- + src/mm-modem-helpers.h | 6 +++--- + src/tests/test-modem-helpers.c | 4 ++-- + 3 files changed, 8 insertions(+), 8 deletions(-) + +commit 45682aa7ee5fa52ee50ed73fc153035910723b13 +Author: Ben Chan +Date: Fri Jul 14 01:06:38 2017 -0700 + + sms-part-3gpp: minor coding style fixes + + src/mm-sms-part-3gpp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 057732663bb8524271f6e3ba225f597381a12cc2 +Author: Ben Chan +Date: Fri Jul 14 01:06:37 2017 -0700 + + broadband-modem-mbim: minor coding style fixes + + src/mm-broadband-modem-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit da20697e187fbc27e82f2aea67ff86ddecfd8c7d +Author: Ben Chan +Date: Fri Jul 14 01:06:36 2017 -0700 + + base-call: minor coding style fixes + + src/mm-base-call.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit cb6efd8eda491f0ed12b57fca1105fa888682398 +Author: Ben Chan +Date: Fri Jul 14 01:06:35 2017 -0700 + + base-manager: minor coding style fixes + + src/mm-base-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1158c2c6e9da01073284e63050d08188deff65ba +Author: Ben Chan +Date: Fri Jul 14 00:36:13 2017 -0700 + + broadband-modem: rename load_power_state for consistency + + All MMIfaceModem functions implemented by MMBroadbandModem, except + load_power_state, are prefixed with 'modem_'. For consistency, this + patch renames load_power_state{,_finish} to + modem_load_power_state{,_finish}. + + src/mm-broadband-modem.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit aafd21ac31b787a01d4ce08f732f27575c2883e9 +Author: Aleksander Morgado +Date: Wed Jul 12 11:21:41 2017 +0200 + + broadband-modem-mbim: avoid multiple MM_BROADBAND_MODEM_MBIM() casts + + src/mm-broadband-modem-mbim.c | 140 + +++++++++++++++++++++++++----------------- + 1 file changed, 83 insertions(+), 57 deletions(-) + +commit 3d9510b4fd5f4dc46df1476c067787f1dd3431a6 +Author: Eric Caruso +Date: Tue Jul 11 10:58:23 2017 -0700 + + mm-broadband-modem-mbim: support SIM hot swapping + + If an MBIM modem supports unsolicited notifications for + subscriber ready status, we can use it to detect when SIM cards + have been removed and reinserted. Upon detection we should re- + probe the modem so that we can configure it for the new SIM. + + src/mm-broadband-modem-mbim.c | 96 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 93 insertions(+), 3 deletions(-) + +commit fe384625aa59c117ec99b943c6e0b09deea48a0d +Author: Ben Chan +Date: Wed Jul 12 01:03:40 2017 -0700 + + telit: fix memory leaks in unit tests + + plugins/telit/tests/test-mm-modem-helpers-telit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 4fbdee1e6d0138e19e836bdf8531cd85b9338ffd +Author: Ben Chan +Date: Wed Jul 12 01:03:39 2017 -0700 + + telit: minor coding style fixes + + plugins/telit/mm-modem-helpers-telit.c | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 39ddd34898d458d1105ac6fa168166b23229ab8e +Author: Ben Chan +Date: Wed Jul 12 01:03:38 2017 -0700 + + telit: remove unnecessary NULL checks for g_free / g_match_info_free + + g_free() and g_match_info_free() already check if the given pointer is + NULL and does nothing on a NULL pointer. + + plugins/telit/mm-modem-helpers-telit.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +commit 4a7190f64b86b47076e91b6ebfeb59e27baa2707 +Author: Ben Chan +Date: Wed Jul 12 01:03:37 2017 -0700 + + telit: fix memory leak in mm_telit_get_4g_mm_bands + + plugins/telit/mm-modem-helpers-telit.c | 1 + + 1 file changed, 1 insertion(+) + +commit b6f40de1e15bcb2d324157a5c24028f8a9089f74 +Author: Ben Chan +Date: Wed Jul 12 01:03:36 2017 -0700 + + telit: remove unused 'flags' variable in mm_telit_get_4g_mm_bands + + plugins/telit/mm-modem-helpers-telit.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 99dd037a68654cf611caab82741a1db969c68242 +Author: Ben Chan +Date: Wed Jul 12 01:14:54 2017 -0700 + + iface-modem: fix mm_iface_modem_initialize_finish + + This fixes commit 66f10d61a20e6c661cb04225835ec7a343f4fe36 + ("iface-modem: port mm_iface_modem_initialize to use GTask"), which + didn't update mm_iface_modem_initialize_finish to use + g_task_propagate_boolean. + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4e99ca7fd527a91bbec50e64d1b70b797c926180 +Author: Ben Chan +Date: Wed Jul 12 01:02:36 2017 -0700 + + ublox: fix memory leaks in unit tests + + plugins/ublox/tests/test-modem-helpers-ublox.c | 1 + + 1 file changed, 1 insertion(+) + +commit 247890739b940b448d76a2d83bbc34ba91a83d33 +Author: Aleksander Morgado +Date: Wed Jul 12 10:58:49 2017 +0200 + + broadband-modem-mbim: remove unused variable + + CC ModemManager-mm-broadband-modem-mbim.o + mm-broadband-modem-mbim.c: In function ‘mbim_port_open_ready’: + mm-broadband-modem-mbim.c:1581:35: error: unused variable + ‘ctx’ [-Werror=unused-variable] + InitializationStartedContext *ctx; + ^~~ + cc1: all warnings being treated as errors + + src/mm-broadband-modem-mbim.c | 1 - + 1 file changed, 1 deletion(-) + +commit 350aa6a4618468de62c0ef6ab943a7adf6e92236 +Author: Ben Chan +Date: Mon Jul 10 15:32:29 2017 -0700 + + broadband-modem-mbim: port remaining code to use GTask + + This patch ports the following functions in MMBroadbandModemMbim to + use GTask: + - common_enable_disable_unsolicited_events + - common_setup_cleanup_unsolicited_events + - load_initial_sms_parts + - modem_3gpp_load_enabled_facility_locks + - modem_3gpp_register_in_network + - modem_3gpp_run_registration_checks + - modem_3gpp_scan_networks + - modem_load_current_capabilities + - modem_load_own_numbers + - modem_load_power_state + - modem_load_unlock_required + - modem_load_unlock_retries + - modem_power_down + - modem_power_up + + src/mm-broadband-modem-mbim.c | 669 + ++++++++++++++++++++---------------------- + 1 file changed, 311 insertions(+), 358 deletions(-) + +commit 20b3675adf373c6f2463c4ecf25400fddd560452 +Author: Ben Chan +Date: Mon Jul 10 17:07:32 2017 -0700 + + broadband-modem-mbim: port initialization_started to use GTask + + src/mm-broadband-modem-mbim.c | 63 + +++++++++++++++++++++---------------------- + 1 file changed, 30 insertions(+), 33 deletions(-) + +commit e8ffefaf6ff483fb3724faaaa1cae99f87ca64c8 +Author: Ben Chan +Date: Mon Jul 10 16:20:23 2017 -0700 + + broadband-modem-mbim: port enabling_started to use GTask + + src/mm-broadband-modem-mbim.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit e0eb23d9a6ed801a0d19b55df5474d32791dabf0 +Author: Ben Chan +Date: Mon Jul 10 16:32:13 2017 -0700 + + broadband-modem-mbim: port modem_create_bearer to use GTask + + src/mm-broadband-modem-mbim.c | 33 ++++++++++----------------------- + 1 file changed, 10 insertions(+), 23 deletions(-) + +commit ec14a26a7d20c4c7a79f4887de6d925a7438adaf +Author: Ben Chan +Date: Mon Jul 10 16:38:00 2017 -0700 + + broadband-modem-mbim: port messaging_load_supported_storages to + use GTask + + src/mm-broadband-modem-mbim.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit 5bf0af7a83d87a7239c2bee1ba7a1b06da6b1aef +Author: Ben Chan +Date: Mon Jul 10 16:21:41 2017 -0700 + + broadband-modem-mbim: port messaging_check_support to use GTask + + src/mm-broadband-modem-mbim.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +commit cc71743e26131355c148a0848449edf5b5617714 +Author: Ben Chan +Date: Mon Jul 10 16:16:49 2017 -0700 + + broadband-modem-mbim: port modem_3gpp_load_imei to use GTask + + src/mm-broadband-modem-mbim.c | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit 5b0b3f326e363ed4a058427896950ba5b70225b6 +Author: Ben Chan +Date: Mon Jul 10 16:13:13 2017 -0700 + + broadband-modem-mbim: port modem_3gpp_load_operator_code to use GTask + + src/mm-broadband-modem-mbim.c | 37 ++++++++++++++++--------------------- + 1 file changed, 16 insertions(+), 21 deletions(-) + +commit 9401aa70e52f14d3aba13798154f49b09c8ee38f +Author: Ben Chan +Date: Mon Jul 10 16:10:40 2017 -0700 + + broadband-modem-mbim: port modem_3gpp_load_operator_name to use GTask + + src/mm-broadband-modem-mbim.c | 37 ++++++++++++++++--------------------- + 1 file changed, 16 insertions(+), 21 deletions(-) + +commit fb38601ef4b388506008067f375a25330392c07d +Author: Ben Chan +Date: Mon Jul 10 16:06:20 2017 -0700 + + broadband-modem-mbim: port modem_load_supported_ip_families to + use GTask + + src/mm-broadband-modem-mbim.c | 33 +++++++++++++++------------------ + 1 file changed, 15 insertions(+), 18 deletions(-) + +commit 99bb49d814172f555caeb59ced445f3118bac625 +Author: Ben Chan +Date: Mon Jul 10 16:03:02 2017 -0700 + + broadband-modem-mbim: port modem_load_supported_modes to use GTask + + src/mm-broadband-modem-mbim.c | 27 ++++++++++----------------- + 1 file changed, 10 insertions(+), 17 deletions(-) + +commit df0049d1c2d8643a148e8b1f005bb3b92aff16e5 +Author: Ben Chan +Date: Mon Jul 10 15:59:34 2017 -0700 + + broadband-modem-mbim: port modem_load_device_identifier to use GTask + + src/mm-broadband-modem-mbim.c | 24 ++++++------------------ + 1 file changed, 6 insertions(+), 18 deletions(-) + +commit 43aaa92ee1959dadd150ceb01624655d87876628 +Author: Ben Chan +Date: Mon Jul 10 15:57:44 2017 -0700 + + broadband-modem-mbim: port modem_load_equipment_identifier to + use GTask + + src/mm-broadband-modem-mbim.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +commit fb9c758f050ab004f993aee48f9f5395d8699b46 +Author: Ben Chan +Date: Mon Jul 10 15:55:34 2017 -0700 + + broadband-modem-mbim: port modem_load_revision to use GTask + + src/mm-broadband-modem-mbim.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +commit 234d7810f54acf1788993b81d35d5e309db4aaa8 +Author: Ben Chan +Date: Mon Jul 10 15:51:14 2017 -0700 + + broadband-modem-mbim: port modem_load_model to use GTask + + src/mm-broadband-modem-mbim.c | 21 ++++++++++----------- + 1 file changed, 10 insertions(+), 11 deletions(-) + +commit 6cf6eeb0aad71874746674b3dd23c67b00222cca +Author: Ben Chan +Date: Mon Jul 10 15:49:03 2017 -0700 + + broadband-modem-mbim: port modem_load_manufacturer to use GTask + + src/mm-broadband-modem-mbim.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 3a789c0de785133ed2acf9e37f4eab8ef193f44f +Author: Ben Chan +Date: Mon Jul 10 11:20:57 2017 -0700 + + bearer-qmi: replace g_new + memcpy with g_memdup + + src/mm-bearer-qmi.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 627ef274dff34f8e47425529cb3a7534dd47563f +Author: Ben Chan +Date: Thu Jul 6 11:30:21 2017 -0700 + + plugin: check error returned by g_task_propagate_error instead + + mm_plugin_supports_port_finish directly casts the value returned by + g_task_propagate_int to MMPluginSupportsResult enum value, which + implicitly assumes MM_PLUGIN_SUPPORTS_PORT_UNKNOWN equals to -1. + Instead of relying on such an implicit assumption, this patch modifies + the code to check if the GError argument to g_task_propagate_error is + populated instead. + + src/mm-plugin.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit a36347eff794bb5d8c1b4e641a56aa70d7a0ef8c +Author: Ben Chan +Date: Thu Jul 6 11:30:20 2017 -0700 + + broadband-bearer: check error returned by g_task_propagate_error + instead + + When returning an enum value via g_task_return_int, some code assumes + the enum value is always non-negative and thus considers that + a negative + value implies an error. This assumption could be invalidated if a + negative value is later added to the enum. To make it less error prone + to future changes, this patch modifies the code to check if the GError + argument to g_task_propagate_error is populated instead. + + src/mm-broadband-bearer.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 22e5b216cb312f35a51939bf6922a23e488f9a32 +Author: Ben Chan +Date: Fri Jul 7 00:09:57 2017 -0700 + + broadband-modem: remove unnecessary G_TYPE_CHECK_INSTANCE_CAST calls + + This patch removes unnecessary G_TYPE_CHECK_INSTANCE_CAST calls on any + instance that is already of the type being casted to. + + src/mm-broadband-modem.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit d308bbf4c6d9cfbf59c257e5a4c802cba9065906 +Author: Ben Chan +Date: Thu Jul 6 12:34:53 2017 -0700 + + novatel-lte: check error returned by g_task_propagate_error instead + + When returning an enum value via g_task_return_int, some code assumes + the enum value is always non-negative and thus considers that + a negative + value implies an error. This assumption could be invalidated if a + negative value is later added to the enum. To make it less error prone + to future changes, this patch modifies the code to check if the GError + argument to g_task_propagate_error is populated instead. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 344d96af44f0c2aa4b31e39fb29c3e76d17b4e4b +Author: Ben Chan +Date: Thu Jul 6 15:18:18 2017 -0700 + + cinterion: check error returned by g_task_propagate_error instead + + When returning an enum value via g_task_return_int, some code assumes + the enum value is always non-negative and thus considers that + a negative + value implies an error. This assumption could be invalidated if a + negative value is later added to the enum. To make it less error prone + to future changes, this patch modifies the code to check if the GError + argument to g_task_propagate_error is populated instead. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 9 +++++++-- + plugins/cinterion/mm-broadband-modem-cinterion.c | 6 +++++- + plugins/cinterion/mm-common-cinterion.c | 7 +++++-- + 3 files changed, 17 insertions(+), 5 deletions(-) + +commit b44f1b6da07580ec1c9704125b00d7711b4dea5e +Author: Aleksander Morgado +Date: Thu Jul 6 11:16:37 2017 +0200 + + base-call: port mm_base_call_delete to use GTask + + src/mm-base-call.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +commit da45d0c5b2d90aac9dbb3c56f9a3270470b3e8a4 +Author: Aleksander Morgado +Date: Thu Jul 6 11:11:20 2017 +0200 + + base-call: minor coding style fixes + + src/mm-base-call.c | 106 + +++++++++++++++++++++++++++-------------------------- + 1 file changed, 54 insertions(+), 52 deletions(-) + +commit 4e5ad5585a56a6973003a621c92415e7c9b9014c +Author: Aleksander Morgado +Date: Thu Jul 6 10:59:09 2017 +0200 + + base-call: no need to keep a modem reference around + + The mm_base_modem_at_command() async calls keep a modem reference + valid for as long as the operation and its completion handler are run, + so there really is no need for the caller (the call operation) to keep + a reference to the modem object itself. + + src/mm-base-call.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 2ffcd93ebbbb442fa088f86322aaa6e3b9aef97e +Author: Ben Chan +Date: Wed Jul 5 15:12:51 2017 -0700 + + base-call: port call_delete to use GTask + + src/mm-base-call.c | 27 ++++++--------------------- + 1 file changed, 6 insertions(+), 21 deletions(-) + +commit f9ddfd7aa4a560dfde1d412750f8f273dca4bcc1 +Author: Ben Chan +Date: Wed Jul 5 15:12:50 2017 -0700 + + base-call: port call_send_dtmf_ready to use GTask + + src/mm-base-call.c | 44 +++++++++++--------------------------------- + 1 file changed, 11 insertions(+), 33 deletions(-) + +commit 3659ada7d947ce64e3d91cad3de561410e08d9b6 +Author: Ben Chan +Date: Wed Jul 5 15:12:49 2017 -0700 + + base-call: port call_hangup to use GTask + + src/mm-base-call.c | 53 + +++++++++++++++++------------------------------------ + 1 file changed, 17 insertions(+), 36 deletions(-) + +commit c5232ffe410838f6c32ec0daab9074828ac4db83 +Author: Ben Chan +Date: Wed Jul 5 15:12:48 2017 -0700 + + base-call: port call_accept to use GTask + + src/mm-base-call.c | 55 + ++++++++++++++++++------------------------------------ + 1 file changed, 18 insertions(+), 37 deletions(-) + +commit 76b3ad41fe7802dac63f62e16bba15a98d48726c +Author: Ben Chan +Date: Wed Jul 5 15:12:47 2017 -0700 + + base-call: port call_start to use GTask + + src/mm-base-call.c | 59 + ++++++++++++++++++------------------------------------ + 1 file changed, 20 insertions(+), 39 deletions(-) + +commit d56621b9a1343fdda784730846f23c805d2145c4 +Author: Ben Chan +Date: Wed Jul 5 22:20:09 2017 -0700 + + iface-modem: check error returned by g_task_propagate_error instead + + When returning an enum value via g_task_return_int, some code assumes + the enum value is always non-negative and thus considers that + a negative + value implies an error. This assumption could be invalidated if a + negative value is later added to the enum. To make it less error prone + to future changes, this patch modifies the code to check if the GError + argument to g_task_propagate_error is populated instead. + + src/mm-iface-modem.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +commit ba3a7f0c69e067f383b459d53507dd77a5d644af +Author: Ben Chan +Date: Tue Jul 4 11:40:22 2017 -0700 + + port-serial-qcdm: port mm_port_serial_qcdm_command to use GTask + + src/mm-port-serial-qcdm.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit 75aebc71c7941c38c86c7e03bc1aeb0e4dc976d5 +Author: Ben Chan +Date: Tue Jul 4 11:40:09 2017 -0700 + + base-sim: port mm_base_sim_send_{pin,puk} to use GTask + + src/mm-base-sim.c | 107 + +++++++++++++++++++++++++++--------------------------- + 1 file changed, 54 insertions(+), 53 deletions(-) + +commit bc51c8c474c05dcb5126ad51b2672ba3b7a32d6a +Author: Ben Chan +Date: Tue Jul 4 11:40:08 2017 -0700 + + base-sim: port load_* to use GTask + + This patch ports the following functions to use GTask: + - load_imsi + - load_operator_identifier + - load_operator_name + - load_sim_identifier + + src/mm-base-sim.c | 75 + ++++++++++++++++++++++++------------------------------- + 1 file changed, 33 insertions(+), 42 deletions(-) + +commit b99f9e3b0c196889aefd7f34024fe9248b4c57e8 +Author: Ben Chan +Date: Tue Jul 4 11:40:07 2017 -0700 + + base-sim: port mm_base_sim_initialize to use GTask + + src/mm-base-sim.c | 127 + +++++++++++++++++++++++++----------------------------- + 1 file changed, 58 insertions(+), 69 deletions(-) + +commit d085cb2b968fe0641e029f1b13fe0e5fccd01b47 +Author: Ben Chan +Date: Tue Jul 4 11:40:06 2017 -0700 + + base-sim: port send_pin and send_puk to use GTask + + src/mm-base-sim.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 650d2713501fc01bfd3f56e7cb516b72dd15937a +Author: Ben Chan +Date: Tue Jul 4 11:40:05 2017 -0700 + + base-sim: port enable_pin to use GTask + + src/mm-base-sim.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 12d578ff8510c90d4f3214124bcd3f8505d357ac +Author: Ben Chan +Date: Tue Jul 4 11:40:04 2017 -0700 + + base-sim: port change_pin to use GTask + + src/mm-base-sim.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 87176cf52c1ab5ae1c0800b5f18070bdb03150f9 +Author: Ben Chan +Date: Sat Jul 1 00:35:06 2017 -0700 + + base-sms: port mm_base_sms_delete to use GTask + + src/mm-base-sms.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 03c86a9db82dbd4337379dcd945990ee8a505e8d +Author: Ben Chan +Date: Sat Jul 1 00:35:05 2017 -0700 + + base-sms: port sms_delete to use GTask + + src/mm-base-sms.c | 69 + +++++++++++++++++++++++++++++-------------------------- + 1 file changed, 37 insertions(+), 32 deletions(-) + +commit c5be9aad9706f2d4c909f80eb28238ff8b09171d +Author: Ben Chan +Date: Sat Jul 1 00:35:04 2017 -0700 + + base-sms: port sms_send to use GTask + + src/mm-base-sms.c | 99 + ++++++++++++++++++++++++++++++------------------------- + 1 file changed, 55 insertions(+), 44 deletions(-) + +commit 4902d9d7597325aeb457635c663b2d9b83f9b4e0 +Author: Ben Chan +Date: Sat Jul 1 00:35:03 2017 -0700 + + base-sms: port sms_store to use GTask + + src/mm-base-sms.c | 88 + ++++++++++++++++++++++++++++++------------------------- + 1 file changed, 48 insertions(+), 40 deletions(-) + +commit 1f4cd9ac9192f375f1a92b3c87dc4c32a7c856f0 +Author: Ben Chan +Date: Sat Jul 1 00:33:26 2017 -0700 + + base-bearer: port mm_base_bearer_disconnect to use GTask + + src/mm-base-bearer.c | 41 +++++++++++++++++------------------------ + 1 file changed, 17 insertions(+), 24 deletions(-) + +commit 98f4fe2f85bfb211625ef60dd525dc8016125dec +Author: Ben Chan +Date: Sat Jul 1 00:33:25 2017 -0700 + + base-bearer: port mm_base_bearer_connect to use GTask + + src/mm-base-bearer.c | 55 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 28 insertions(+), 27 deletions(-) + +commit 0efc3cf90876cde2606b1844730b17ad4780f638 +Author: Ben Chan +Date: Sat Jul 1 00:16:20 2017 -0700 + + bearer-qmi: port reload_stats to use GTask + + src/mm-bearer-qmi.c | 68 + ++++++++++++++++++++++++++++++----------------------- + 1 file changed, 38 insertions(+), 30 deletions(-) + +commit 9efc2f705020766c8379cb434b67e6660dee9274 +Author: Ben Chan +Date: Sat Jul 1 00:16:19 2017 -0700 + + bearer-qmi: port disconnect to use GTask + + src/mm-bearer-qmi.c | 72 + +++++++++++++++++++++++++++++------------------------ + 1 file changed, 39 insertions(+), 33 deletions(-) + +commit a6547642ede2b3adf28f9ddbb2ca16fd60fb9c02 +Author: Ben Chan +Date: Sat Jul 1 00:16:18 2017 -0700 + + bearer-qmi: port _connect to use GTask + + src/mm-bearer-qmi.c | 185 + ++++++++++++++++++++++++++++------------------------ + 1 file changed, 100 insertions(+), 85 deletions(-) + +commit dfcffbae04e0f9147c874f1df616a7b6287397ac +Author: Ben Chan +Date: Fri Jun 30 20:00:34 2017 -0700 + + base-sim: remove unused wait_for_unlock_id in SendPinPukContext + + Commit d27e40ae9 ("core: new `Initializing' state in the global modem + state machine") added a 'wait_for_unlock_id' field to + SendPinPukContext, + but never actually set it up. + + src/mm-base-sim.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 524acd75966d283dda0ba7d748b16ce6902a2868 +Author: Ben Chan +Date: Fri Jun 30 06:27:07 2017 -0700 + + iface-modem: use g_new0 instead of g_slice_new0 to allocate context + + By using g_new0 instead of g_slice_new0 to allocate certain context + structs, we can simply use g_free as GDestroyNotify in + g_task_set_task_data and get rid of those functions that solely + wrap the + g_slice_free call. + + src/mm-iface-modem.c | 20 ++++---------------- + 1 file changed, 4 insertions(+), 16 deletions(-) + +commit d49cf585dd1f3e6f06b4ee23bbd3ca5278f2739c +Author: Ben Chan +Date: Fri Jun 30 05:59:40 2017 -0700 + + bearer-mbim: port MMBearerMbim to use GTask + + src/mm-bearer-mbim.c | 270 + +++++++++++++++++++++++++-------------------------- + 1 file changed, 131 insertions(+), 139 deletions(-) + +commit bdfd6d92eece28a7376deff61ec35dbcd36a67a2 +Author: Aleksander Morgado +Date: Fri Jun 30 14:29:34 2017 +0200 + + telit: minor coding style fixes + + Always name 'self' the object being implemented. + + plugins/telit/mm-broadband-modem-telit.c | 98 + +++++++++++++++----------------- + 1 file changed, 46 insertions(+), 52 deletions(-) + +commit acf1013356ba77518e6ad1acc98a36c5a763c184 +Author: Daniele Palmas +Date: Fri Jun 30 13:02:26 2017 +0200 + + telit: port mm-broadband-modem-telit to use GTask + + plugins/telit/mm-broadband-modem-telit.c | 285 + ++++++++++++++----------------- + 1 file changed, 131 insertions(+), 154 deletions(-) + +commit 347610a63d82ad7c101e0d9a3bdf93c5a3d50a7b +Author: Ben Chan +Date: Fri Jun 30 03:52:13 2017 -0700 + + iface-modem: port mm_iface_modem_wait_for_final_state to use GTask + + src/mm-iface-modem.c | 103 + ++++++++++++++++++++++++++++++++------------------- + 1 file changed, 64 insertions(+), 39 deletions(-) + +commit 7d197d10bde78088cfca6f2a1227b7acb9b31c56 +Author: Ben Chan +Date: Fri Jun 30 02:23:46 2017 -0700 + + iface-modem: port internal_load_unlock_required to use GTask + + src/mm-iface-modem.c | 85 + +++++++++++++++++++++++++++------------------------- + 1 file changed, 45 insertions(+), 40 deletions(-) + +commit 4df545884733bbc5a851ab86e0983dec057d5482 +Author: Ben Chan +Date: Fri Jun 30 02:23:45 2017 -0700 + + iface-modem: port mm_iface_modem_update_lock_info to use GTask + + src/mm-iface-modem.c | 95 + ++++++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 44 deletions(-) + +commit ebc20e7948e43b37c477581312e095725e318e8b +Author: Ben Chan +Date: Fri Jun 30 02:23:44 2017 -0700 + + iface-modem: port mm_iface_modem_set_power_state to use GTask + + src/mm-iface-modem.c | 169 + +++++++++++++++++++++++++++------------------------ + 1 file changed, 91 insertions(+), 78 deletions(-) + +commit 25f0d420896e397eb5f90187fa2bbcf48de3e275 +Author: Ben Chan +Date: Fri Jun 30 02:23:43 2017 -0700 + + iface-modem: port mm_iface_modem_set_current_modes to use GTask + + src/mm-iface-modem.c | 115 + ++++++++++++++++++++++++++------------------------- + 1 file changed, 58 insertions(+), 57 deletions(-) + +commit 71dd152dbeb87e834057049aa428b9d54a91b328 +Author: Ben Chan +Date: Fri Jun 30 02:23:42 2017 -0700 + + iface-modem: port mm_iface_modem_set_current_bands to use GTask + + src/mm-iface-modem.c | 64 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 32 insertions(+), 32 deletions(-) + +commit 0bc40c8c95af9c366b84ef2f9d35a9ff36845d9e +Author: Ben Chan +Date: Fri Jun 30 02:23:41 2017 -0700 + + iface-modem: port mm_iface_modem_create_bearer to use GTask + + src/mm-iface-modem.c | 53 + ++++++++++++++++++++++++---------------------------- + 1 file changed, 24 insertions(+), 29 deletions(-) + +commit c09b3b9426145b615dd47ce507eda396dc8121a6 +Author: Ben Chan +Date: Fri Jun 30 02:23:40 2017 -0700 + + iface-modem: port mm_iface_modem_disable to use GTask + + src/mm-iface-modem.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit 00a092db2ede36bb919f7db5da54135caba39783 +Author: Ben Chan +Date: Fri Jun 30 02:23:39 2017 -0700 + + iface-modem: port mm_iface_modem_enable to use GTask + + src/mm-iface-modem.c | 146 + +++++++++++++++++++++++++-------------------------- + 1 file changed, 71 insertions(+), 75 deletions(-) + +commit 66f10d61a20e6c661cb04225835ec7a343f4fe36 +Author: Ben Chan +Date: Fri Jun 30 02:23:38 2017 -0700 + + iface-modem: port mm_iface_modem_initialize to use GTask + + src/mm-iface-modem.c | 426 + ++++++++++++++++++++++++++++----------------------- + 1 file changed, 231 insertions(+), 195 deletions(-) + +commit 6e9334e31779be51f1ea03bcf5c18aa3a5acfc1e +Author: Ben Chan +Date: Fri Jun 30 02:57:16 2017 -0700 + + sms-qmi: port MMSmsQmi to use GTask + + src/mm-sms-qmi.c | 266 + +++++++++++++++++++++++++++++-------------------------- + 1 file changed, 142 insertions(+), 124 deletions(-) + +commit b9345bb41a20a8283021f5a482c6f321120dee4b +Author: Ben Chan +Date: Fri Jun 30 02:16:27 2017 -0700 + + sim-mbim: port MMSimMbim to use GTask + + src/mm-sim-mbim.c | 201 + ++++++++++++++++++++++++------------------------------ + 1 file changed, 89 insertions(+), 112 deletions(-) + +commit 7ac30db4b7e5c492b81a92499355b27c8ac6df5f +Author: Ben Chan +Date: Fri Jun 30 02:21:18 2017 -0700 + + iface-modem-3gpp: port mm_iface_modem_3gpp_register_in_network to + use GTask + + src/mm-iface-modem-3gpp.c | 93 + +++++++++++++++++++++++++---------------------- + 1 file changed, 49 insertions(+), 44 deletions(-) + +commit 48b154f2655629d39e9aeabe1c3f2f91bf652e0b +Author: Ben Chan +Date: Thu Jun 29 04:46:04 2017 -0700 + + iface-modem-cdma: port mm_iface_modem_cdma_run_registration_checks + to use GTask + + src/mm-iface-modem-cdma.c | 207 + +++++++++++++++++++++++++--------------------- + 1 file changed, 112 insertions(+), 95 deletions(-) + +commit 0d2fb2fe45d85fd57d7a335d9bf591c7d15b64d4 +Author: Ben Chan +Date: Thu Jun 29 04:46:03 2017 -0700 + + iface-modem-cdma: port mm_iface_modem_cdma_register_in_network to + use GTask + + src/mm-iface-modem-cdma.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 3cf23b6c44195d317246157c51b134da6db1b8a0 +Author: Ben Chan +Date: Thu Jun 29 04:46:02 2017 -0700 + + iface-modem-cdma: port mm_iface_modem_cdma_disable to use GTask + + src/mm-iface-modem-cdma.c | 82 + +++++++++++++++++++++++++---------------------- + 1 file changed, 44 insertions(+), 38 deletions(-) + +commit b94ed662f7fd76de0752bc343baa7351085eac57 +Author: Ben Chan +Date: Thu Jun 29 04:46:01 2017 -0700 + + iface-modem-cdma: port mm_iface_modem_cdma_enable to use GTask + + src/mm-iface-modem-cdma.c | 102 + +++++++++++++++++++++------------------------- + 1 file changed, 46 insertions(+), 56 deletions(-) + +commit d9918afa99e08e0717d013e0ea6da609615b16ba +Author: Ben Chan +Date: Thu Jun 29 04:46:00 2017 -0700 + + iface-modem-cdma: port mm_iface_modem_cdma_initialize to use GTask + + src/mm-iface-modem-cdma.c | 105 + +++++++++++++++++++++------------------------- + 1 file changed, 48 insertions(+), 57 deletions(-) + +commit 1bfe5434bb8ad9542373a2227492231f8bbb14b4 +Author: Ben Chan +Date: Thu Jun 29 04:46:21 2017 -0700 + + iface-modem-3gpp: port + mm_iface_modem_3gpp_reload_current_registration_info to use GTask + + src/mm-iface-modem-3gpp.c | 83 + ++++++++++++++++++++++++++--------------------- + 1 file changed, 46 insertions(+), 37 deletions(-) + +commit c973eb41b246f4e4080b3914936e618bed0dea8e +Author: Ben Chan +Date: Thu Jun 29 04:46:20 2017 -0700 + + iface-modem-3gpp: port mm_iface_modem_3gpp_disable to use GTask + + src/mm-iface-modem-3gpp.c | 103 + ++++++++++++++++++++++++---------------------- + 1 file changed, 53 insertions(+), 50 deletions(-) + +commit da8b069f803235075de3edfc5f4d78d218bf2b66 +Author: Ben Chan +Date: Thu Jun 29 04:46:19 2017 -0700 + + iface-modem-3gpp: port mm_iface_modem_3gpp_enable to use GTask + + src/mm-iface-modem-3gpp.c | 144 + ++++++++++++++++++++++------------------------ + 1 file changed, 70 insertions(+), 74 deletions(-) + +commit c08de5866829bc394e6954e335e49b2663630a48 +Author: Ben Chan +Date: Thu Jun 29 04:46:18 2017 -0700 + + iface-modem-3gpp: port mm_iface_modem_3gpp_initialize to use GTask + + src/mm-iface-modem-3gpp.c | 95 + +++++++++++++++++++++-------------------------- + 1 file changed, 43 insertions(+), 52 deletions(-) + +commit 35837208df22037f3dd3167d56b752f1343d4429 +Author: Daniele Palmas +Date: Thu Jun 29 11:09:51 2017 +0200 + + telit: port mm-common-telit to use GTask + + plugins/telit/mm-common-telit.c | 65 + +++++++++++++++++++---------------------- + 1 file changed, 30 insertions(+), 35 deletions(-) + +commit 7c5f308af2f5595f2d3656013c6a36c0e397c84a +Author: Ben Chan +Date: Wed Jun 28 21:44:22 2017 -0700 + + iface-modem-time: port update_network_timezone to use GTask + + src/mm-iface-modem-time.c | 120 + +++++++++++++++++++++++----------------------- + 1 file changed, 61 insertions(+), 59 deletions(-) + +commit 3e925d3b2d427ded5021b0c1c083aecc711d49a4 +Author: Ben Chan +Date: Wed Jun 28 21:44:21 2017 -0700 + + iface-modem-time: port mm_iface_modem_time_disable to use GTask + + src/mm-iface-modem-time.c | 91 + +++++++++++++++++++++++++---------------------- + 1 file changed, 48 insertions(+), 43 deletions(-) + +commit fe85ded3e1590f8645cab21fbbf36a6949be0ede +Author: Ben Chan +Date: Wed Jun 28 21:44:20 2017 -0700 + + iface-modem-time: port mm_iface_modem_time_enable to use GTask + + src/mm-iface-modem-time.c | 108 + +++++++++++++++++++++------------------------- + 1 file changed, 49 insertions(+), 59 deletions(-) + +commit 07c5d78e13f20ab8701d6aa212694ff9ed0575ae +Author: Ben Chan +Date: Wed Jun 28 21:44:19 2017 -0700 + + iface-modem-time: port mm_iface_modem_time_initialize to use GTask + + src/mm-iface-modem-time.c | 93 + ++++++++++++++++++++--------------------------- + 1 file changed, 40 insertions(+), 53 deletions(-) + +commit d34cb65828fe8bceafff97b64bebb108cbd743ed +Author: Ben Chan +Date: Wed Jun 28 21:44:04 2017 -0700 + + iface-modem-voice: port mm_iface_modem_voice_disable to use GTask + + src/mm-iface-modem-voice.c | 89 + ++++++++++++++++++++++++---------------------- + 1 file changed, 47 insertions(+), 42 deletions(-) + +commit 121d43fcc69ee985155979ebe549a20e933f7d12 +Author: Ben Chan +Date: Wed Jun 28 21:44:03 2017 -0700 + + iface-modem-voice: port mm_iface_modem_voice_enable to use GTask + + src/mm-iface-modem-voice.c | 108 + ++++++++++++++++++++------------------------- + 1 file changed, 49 insertions(+), 59 deletions(-) + +commit 1ff9fe6ac2309675b2574513d956ed50a1826b59 +Author: Ben Chan +Date: Wed Jun 28 21:44:02 2017 -0700 + + iface-modem-voice: port mm_iface_modem_voice_initialize to use GTask + + src/mm-iface-modem-voice.c | 97 + ++++++++++++++++++++-------------------------- + 1 file changed, 42 insertions(+), 55 deletions(-) + +commit b7a0afaf954192aeeea376fb8fb987d0aa7f6e88 +Author: Ben Chan +Date: Wed Jun 28 21:43:50 2017 -0700 + + iface-modem-oma: port mm_iface_modem_oma_disable to use GTask + + src/mm-iface-modem-oma.c | 87 + +++++++++++++++++++++++++----------------------- + 1 file changed, 46 insertions(+), 41 deletions(-) + +commit 193784ebf8993fd6e8c11430fe70934df0ec94ce +Author: Ben Chan +Date: Wed Jun 28 21:43:49 2017 -0700 + + iface-modem-oma: port mm_iface_modem_oma_enable to use GTask + + src/mm-iface-modem-oma.c | 125 + ++++++++++++++++++++++------------------------- + 1 file changed, 59 insertions(+), 66 deletions(-) + +commit f23f3f2c3f87d9451aa8701cd5be50cb0f2838a2 +Author: Ben Chan +Date: Wed Jun 28 21:43:48 2017 -0700 + + iface-modem-oma: port mm_iface_modem_oma_initialize to use GTask + + src/mm-iface-modem-oma.c | 99 + +++++++++++++++++++++--------------------------- + 1 file changed, 43 insertions(+), 56 deletions(-) + +commit 04425e8ee0db6b416fc70596d9938f9d166db0b4 +Author: Ben Chan +Date: Wed Jun 28 09:30:03 2017 -0700 + + iface-modem-3gpp-ussd: port mm_iface_modem_3gpp_ussd_disable to + use GTask + + src/mm-iface-modem-3gpp-ussd.c | 73 + ++++++++++++++++++++++-------------------- + 1 file changed, 39 insertions(+), 34 deletions(-) + +commit bee90dc1037717f81307090bf52ead2b3dc58623 +Author: Ben Chan +Date: Wed Jun 28 09:30:02 2017 -0700 + + iface-modem-3gpp-ussd: port mm_iface_modem_3gpp_ussd_enable to + use GTask + + src/mm-iface-modem-3gpp-ussd.c | 73 + ++++++++++++++++++++++-------------------- + 1 file changed, 39 insertions(+), 34 deletions(-) + +commit e8a647ddee33494cf3a20a05701a6a4ad5b26af4 +Author: Ben Chan +Date: Wed Jun 28 09:30:01 2017 -0700 + + iface-modem-3gpp-ussd: port mm_iface_modem_3gpp_ussd_initialize to + use GTask + + src/mm-iface-modem-3gpp-ussd.c | 76 + ++++++++++++++++++++++-------------------- + 1 file changed, 39 insertions(+), 37 deletions(-) + +commit 3d800c2f496480d2979c4a1d70b3887ec2934b59 +Author: Ben Chan +Date: Wed Jun 28 08:30:21 2017 -0700 + + compat: add compatibility definitions for old MM_MODEM_BAND_EUTRAN_* + values + + Those Roman numeral suffixes in MM_MODEM_BAND_EUTRAN_* were replaced + with 1, 2, 3, ..., etc. This patch adds a compatibility header, + ModemManager-compat.h, to alias the old MM_MODEM_BAND_EUTRAN_* + values to + the new values. + + docs/reference/api/ModemManager-docs.xml | 5 + + docs/reference/api/ModemManager-sections.txt | 40 +++ + include/Makefile.am | 1 + + include/ModemManager-compat.h | 468 + +++++++++++++++++++++++++++ + include/ModemManager.h | 3 + + libmm-glib/Makefile.am | 1 + + 6 files changed, 518 insertions(+) + +commit 989ade7b8c2f8add2b670294453d2a93463b42f2 +Author: Ben Chan +Date: Wed Jun 28 00:13:22 2017 -0700 + + enums: replace Roman numeral suffixes in MM_MODEM_BAND_EUTRAN_* + + 3GPP TS 36.101 Table 5.5-1 refers the E-UTRA operating bands as 1, + 2, 3, + ..., etc. + + include/ModemManager-enums.h | 144 +++++++------- + plugins/altair/mm-modem-helpers-altair-lte.c | 4 +- + .../altair/tests/test-modem-helpers-altair-lte.c | 8 +- + plugins/telit/mm-modem-helpers-telit.c | 6 +- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 24 +-- + plugins/ublox/mm-modem-helpers-ublox.c | 20 +- + plugins/ublox/tests/test-modem-helpers-ublox.c | 62 +++--- + src/mm-modem-helpers-qmi.c | 211 + ++++++++++----------- + 8 files changed, 239 insertions(+), 240 deletions(-) + +commit 0fb0184a2f2c11927ef095fba71e0725e5a6e5e2 +Author: Ben Chan +Date: Tue Jun 27 08:54:08 2017 -0700 + + iface-modem-messaging: port mm_iface_modem_messaging_disable to + use GTask + + src/mm-iface-modem-messaging.c | 89 + ++++++++++++++++++++++-------------------- + 1 file changed, 47 insertions(+), 42 deletions(-) + +commit 1603e6e4bd89d4a00df668831cd29317bb9dfaca +Author: Ben Chan +Date: Tue Jun 27 08:54:07 2017 -0700 + + iface-modem-messaging: port mm_iface_modem_messaging_enable to + use GTask + + src/mm-iface-modem-messaging.c | 182 + ++++++++++++++++++++--------------------- + 1 file changed, 91 insertions(+), 91 deletions(-) + +commit 6aa4e051087be3408c3b0bc897d2b8321b4844ef +Author: Ben Chan +Date: Tue Jun 27 08:54:06 2017 -0700 + + iface-modem-messaging: port mm_iface_modem_messaging_initialize to + use GTask + + src/mm-iface-modem-messaging.c | 129 + +++++++++++++++++++---------------------- + 1 file changed, 60 insertions(+), 69 deletions(-) + +commit 24420586672c9880a64b2eef72661a593ba26807 +Author: Ben Chan +Date: Tue Jun 27 07:31:49 2017 -0700 + + iface-modem-firmware: port mm_iface_modem_firmware_initialize to + use GTask + + src/mm-iface-modem-firmware.c | 95 + +++++++++++++++++++------------------------ + 1 file changed, 41 insertions(+), 54 deletions(-) + +commit 8101ce3f15eb45912cc01ad5ba0307adcb0426d0 +Author: Ben Chan +Date: Tue Jun 27 01:42:28 2017 -0700 + + iface-modem-location: port mm_iface_modem_location_enable to use GTask + + src/mm-iface-modem-location.c | 82 + ++++++++++++++++++------------------------- + 1 file changed, 35 insertions(+), 47 deletions(-) + +commit 7c2c7bc7630a16de2f273b2a5d11819a06508e72 +Author: Ben Chan +Date: Tue Jun 27 01:41:45 2017 -0700 + + iface-modem-location: port mm_iface_modem_location_initialize to + use GTask + + src/mm-iface-modem-location.c | 109 + +++++++++++++++++++----------------------- + 1 file changed, 50 insertions(+), 59 deletions(-) + +commit adc30c7073af2824dfa6fc889e0d705e0cb0a8ff +Author: Ben Chan +Date: Mon Jun 26 22:54:00 2017 -0700 + + iface-modem-location: port setup_gathering to use GTask + + src/mm-iface-modem-location.c | 107 + ++++++++++++++++++++++-------------------- + 1 file changed, 57 insertions(+), 50 deletions(-) + +commit ed8cc03f970d0ffb7b0082060b6566e424067b0a +Author: Ben Chan +Date: Mon Jun 26 22:53:59 2017 -0700 + + iface-modem-location: port mm_iface_modem_location_disable to + use GTask + + src/mm-iface-modem-location.c | 63 + ++++++++++++++++++++++--------------------- + 1 file changed, 33 insertions(+), 30 deletions(-) + +commit 292f2402d09015e7a44bd02630961845063b6a7d +Author: Ben Chan +Date: Fri Jun 23 20:00:53 2017 -0700 + + libmm-glib,voice: port mm_modem_voice_list_calls to use GTask + + libmm-glib/mm-modem-voice.c | 77 + +++++++++++++++++++-------------------------- + 1 file changed, 32 insertions(+), 45 deletions(-) + +commit 9bf9d036eca7b266aec61f271b5058fc46ebf7d8 +Author: Ben Chan +Date: Fri Jun 23 20:00:52 2017 -0700 + + libmm-glib,voice: port mm_modem_voice_create_call to use GTask + + libmm-glib/mm-modem-voice.c | 61 + +++++++++++++-------------------------------- + 1 file changed, 17 insertions(+), 44 deletions(-) + +commit 135fc84cf1750153a8d80541b5561132ed939caa +Author: Ben Chan +Date: Fri Jun 23 20:00:51 2017 -0700 + + libmm-glib,messaging: port mm_modem_messaging_list to use GTask + + libmm-glib/mm-modem-messaging.c | 77 + +++++++++++++++++------------------------ + 1 file changed, 32 insertions(+), 45 deletions(-) + +commit 498400d94340708c93777ccbe9d543a40b0e2e50 +Author: Ben Chan +Date: Fri Jun 23 20:00:50 2017 -0700 + + libmm-glib,messaging: port mm_modem_messaging_create to use GTask + + libmm-glib/mm-modem-messaging.c | 53 + ++++++++++------------------------------- + 1 file changed, 13 insertions(+), 40 deletions(-) + +commit aebc1f3f6c8df7a3a3a710fb2626e6003889de29 +Author: Ben Chan +Date: Fri Jun 23 16:31:38 2017 -0700 + + libmm-glib,modem: port mm_modem_list_bearers to use GTask + + libmm-glib/mm-modem.c | 80 + +++++++++++++++++++++++---------------------------- + 1 file changed, 36 insertions(+), 44 deletions(-) + +commit 23206d794a686248cec6307dbd0d943432d473da +Author: Ben Chan +Date: Fri Jun 23 09:11:07 2017 -0700 + + libmm-glib,modem: port mm_modem_create_bearer to use GTask + + libmm-glib/mm-modem.c | 52 + +++++++++++++-------------------------------------- + 1 file changed, 13 insertions(+), 39 deletions(-) + +commit d84bb54e77bdbde1d69d28f9bb161e6ff1c8c138 +Author: Ben Chan +Date: Fri Jun 23 09:11:06 2017 -0700 + + libmm-glib,modem: port mm_modem_get_sim to use GTask + + libmm-glib/mm-modem.c | 41 +++++++++++++---------------------------- + 1 file changed, 13 insertions(+), 28 deletions(-) + +commit 2327ebddf1828911830edf1d3d1b98b04256a341 +Author: Ben Chan +Date: Fri Jun 23 09:11:05 2017 -0700 + + libmm-glib: use g_list_copy_deep for deep copying a GList + + libmm-glib/mm-modem-messaging.c | 3 +-- + libmm-glib/mm-modem-voice.c | 3 +-- + libmm-glib/mm-modem.c | 3 +-- + 3 files changed, 3 insertions(+), 6 deletions(-) + +commit 8ad785925a778ddd595337ae012b58bd387f7a7e +Author: Ben Chan +Date: Fri Jun 23 09:11:04 2017 -0700 + + core: use g_list_copy_deep for deep copying a GList + + src/mm-base-modem.c | 6 +----- + src/mm-bearer-list.c | 5 +++-- + src/mm-broadband-modem-qmi.c | 3 +-- + src/mm-device.c | 8 +++----- + 4 files changed, 8 insertions(+), 14 deletions(-) + +commit 19794d08467ed9dcaae0de2a62a68f6299d4ab7b +Author: Ben Chan +Date: Fri Jun 23 01:12:19 2017 -0700 + + libmm-glib,manager: port mm_manager_scan_devices to use GTask + + libmm-glib/mm-manager.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit 2f3d9642f64fc5cff7d40a9c3d53b87c8c592ad0 +Author: Ben Chan +Date: Fri Jun 23 01:12:18 2017 -0700 + + libmm-glib,manager: port mm_manager_set_logging to use GTask + + libmm-glib/mm-manager.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit 56ec6726692c5da5334519a20f58d0ad55f14f44 +Author: Ben Chan +Date: Fri Jun 23 01:12:17 2017 -0700 + + libmm-glib,simple: port mm_modem_simple_connect to use GTask + + libmm-glib/mm-modem-simple.c | 52 + +++++++++++--------------------------------- + 1 file changed, 13 insertions(+), 39 deletions(-) + +commit 9920f868ebb4d3a1b645cccf2f473d5d51b4c29e +Author: Ben Chan +Date: Fri Jun 23 00:14:57 2017 -0700 + + libmm-glib,voice: fix object unref in + list_call_context_complete_and_free + + libmm-glib/mm-modem-voice.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c927c0236e5762ef9244c8e3369acd2cf1cf21a3 +Author: Ben Chan +Date: Fri Jun 23 00:04:34 2017 -0700 + + libmm-glib,modem: fix object unref in + list_bearers_context_complete_and_free + + libmm-glib/mm-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8c1bc84af8f52ebdef25d464c28146987cf80c00 +Author: Ben Chan +Date: Fri Jun 23 00:14:31 2017 -0700 + + libmm-glib,messaging: fix object unref in + list_sms_context_complete_and_free + + libmm-glib/mm-modem-messaging.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4d6896f0d919cc0e474a575f6a809ad5f7a121e1 +Author: Aleksander Morgado +Date: Thu Jun 22 10:51:40 2017 +0200 + + build: rename --with-suspend-resume to --with-systemd-suspend-resume + + And only define WITH_SYSTEMD_SUSPEND_RESUME when enabled. + + We already have other systemd specific features under the + --with-systemd-* name scheme, so consolidate that, given that we don't + have any other method to support suspend/resume notifications. + + configure.ac | 39 ++++++++++++++++++--------------------- + src/Makefile.am | 2 +- + src/main.c | 6 +++--- + 3 files changed, 22 insertions(+), 25 deletions(-) + +commit b2a859a78292175f70dac46d3999c92901fbc264 +Author: Aleksander Morgado +Date: Thu Jun 22 10:43:43 2017 +0200 + + build: WITH_UDEV is only defined when enabled + + Looks like the preprocessor doesn't choke when using #if WITH_UDEV and + it isn't defined to any value, but anyway, better explicitly say that + we're checking if it's defined or not. + + cli/mmcli-manager.c | 20 ++++++++++---------- + src/mm-base-manager.c | 20 ++++++++++---------- + src/mm-context.c | 4 ++-- + 3 files changed, 22 insertions(+), 22 deletions(-) + +commit 341555504e739f7ccac11501ca874ef6b1989961 +Author: Aleksander Morgado +Date: Thu Jun 22 10:30:48 2017 +0200 + + build: only define WITH_SYSTEMD_JOURNAL if enabled + + configure.ac | 7 ++----- + src/mm-context.c | 2 +- + 2 files changed, 3 insertions(+), 6 deletions(-) + +commit acf36f2ae0a10f8aeee7a1f8495d3febfba52456 +Author: Aleksander Morgado +Date: Thu Jun 22 10:26:12 2017 +0200 + + build: only define WITH_POLKIT if enabled + + configure.ac | 4 +--- + src/mm-auth.c | 6 +++--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +commit fd0bed1df9e306d8f0d2498afb8df316ca8b3f9e +Author: Torsten Hilbrich +Date: Wed Jun 21 12:59:35 2017 +0200 + + log: Add support for journal logging + + This logging is available if the software was build with the configure + option --with-systemd-journal. + + It will be enabled by default if libsystemd is found. + + The runtime parameter --log-journal enables to output of log messages + to the systemd journal. + + Please note that the journal priority field has the same value as the + syslog level so no conversion is required here. + + configure.ac | 35 +++++++++++++++++++++++++++++++++++ + docs/man/ModemManager.8 | 3 +++ + src/Makefile.am | 5 +++++ + src/main.c | 1 + + src/mm-context.c | 14 ++++++++++++++ + src/mm-context.h | 1 + + src/mm-log.c | 49 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-log.h | 1 + + 8 files changed, 109 insertions(+) + +commit 13592c5d2d6fdf74a5525f1f15d4e7477c73c986 +Author: Torsten Hilbrich +Date: Wed Jun 21 12:58:48 2017 +0200 + + log: Introduce function pointer to handle different log backends + + This allows for easier additions of other logging mechanism. + + Using the syslog loglevel as parameter because we need to be able to + map the MMLogLevel and the GLogLevelFlags to a common representation + when using the log_backend in _mm_log and log_handler. + + The syslog level is more suitable because it supports more values than + the MMLogLevel. + + src/mm-log.c | 55 ++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 36 insertions(+), 19 deletions(-) + +commit 7917c85c6bef78c3ec2973ad567f76f87e1eac4b +Author: Torsten Hilbrich +Date: Wed Jun 21 12:54:37 2017 +0200 + + log: Add mapping from glib loglevel to syslog priority + + Improves readability of log_handler function. + + src/mm-log.c | 44 ++++++++++++++++++++------------------------ + 1 file changed, 20 insertions(+), 24 deletions(-) + +commit 9160f4e35096fcb99fd6f713861f8f433ef6fbf2 +Author: Torsten Hilbrich +Date: Wed Jun 21 12:54:36 2017 +0200 + + log: Refactor log level text output + + Adding a helper function to turn the log level into the text. Also + add an internal flag to disable this output. This flag will become + useful when adding systemd journal support. + + src/mm-log.c | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +commit b4ad1e8a21c1b175eb2459939120c5fb1fef2c08 +Author: Torsten Hilbrich +Date: Wed Jun 21 12:54:35 2017 +0200 + + log: Refactor evaluation of log level + + Starting with adding a typed enum type for the log level named + MMLogLevel. + + Suggested-By: Aleksander Morgado + + The level was checked twice in _mm_log. Once at the beginning and + again when turning the level into both the syslog priority and some + descriptive text which was added to the log level. Removing the check + at the second location as it was redundant. + + Also adding a helper function to turn the MMLogLevel into the syslog + equivalent. This will become handy when adding support for systemd + journal. + + src/mm-log.c | 54 ++++++++++++++++++++++++++++++++++++------------------ + src/mm-log.h | 22 +++++++++++----------- + 2 files changed, 47 insertions(+), 29 deletions(-) + +commit 0e854644dbd896577eaa8f9b05c10aa6283b9533 +Author: Aleksander Morgado +Date: Sun Jun 18 10:01:06 2017 +0200 + + systemd: drop After=syslog.target rule + + syslog implementations are using socket activation nowadays, so an + explicit ordering is not necessary anymore. Plus, syslog.target was + already dropped from systemd in v198. + + Reported-by: Michael Biebl + + data/ModemManager.service.in | 1 - + 1 file changed, 1 deletion(-) + +commit 4dbea97e1bb74ddf1a1cee15892d18a2bdafa003 +Author: Daniele Palmas +Date: Fri Jun 16 16:12:39 2017 +0200 + + telit: fix #PSNT values interpretation for HSDPA and LTE modems + + Telit LTE modems use #PSNT: 4 for LTE access technology, + and #PSNT: 5 for unknown access technology, while HSDPA + modems use #PSNT: 4 for unknown access technology. + + This patch fixes those #PSNT values interpretation according + to the modem capabilities. + + plugins/telit/mm-broadband-modem-telit.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 58206664959a73deb8008b82b5070edb4ef87df2 +Author: Daniele Palmas +Date: Fri Jun 16 14:57:18 2017 +0200 + + helpers: extend +WS46=? response parser to support ranges + + Telit LTE modems could reply to +WS46=? with: + + +WS46: (12,22,25,28-31) + + This patch extends +WS46=? response parser to support ranges. + + src/mm-modem-helpers.c | 25 ++++++++++++------------- + src/tests/test-modem-helpers.c | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 13 deletions(-) + +commit e37e81c2e40b0ddfaa0b8d0075aa83b962d7c32e +Author: Dan Williams +Date: Wed Jun 14 15:07:51 2017 -0500 + + broadband-modem-qmi: allow prefix match for Modem images ending with + '?' + + Assume that a modem image build_id "02.08.02.00_?" matches a pri + build_id + of "02.08.02.00_ATT" or "02.08.02.00_GENERIC". + + src/mm-broadband-modem-qmi.c | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +commit 75e8527987c1e225c1861a659206630305b2f31b +Author: Ben Chan +Date: Tue Jun 6 15:10:49 2017 -0700 + + helpers: remove unnecessary `>= 0' checks on guint value + + This CL removes the unnecessary `>= 0' check on `mode_val' and + `ind_val', which are both guint values extracted from a GArray with + guint values, in mm_3gpp_parse_cmer_test_response to address the + following compiler warnings: + + mm-modem-helpers.c:2933:22: error: comparison of unsigned expression + >= + 0 is always true [-Werror,-Wtautological-compare] + if (mode_val >= 0 && mode_val <= 3) + ~~~~~~~~ ^ ~ + mm-modem-helpers.c:2943:21: error: comparison of unsigned expression + >= + 0 is always true [-Werror,-Wtautological-compare] + if (ind_val >= 0 && ind_val <= 2) + ~~~~~~~ ^ ~ + + src/mm-modem-helpers.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f4c4e364612adcb279ff8bb78a9eab127ef79e82 +Author: Aleksander Morgado +Date: Tue May 30 20:09:58 2017 +0200 + + cinterion: use ^SIND unsolicited messages for access tech reporting + + If the modem supports ^SIND psinfo reporting, we enable the URC and + flag the access technology polling unsupported, so that we only update + access technology via the +CIEV URCs. + + E.g.: + + (ttyACM1): --> 'AT^SIND="psinfo",1' + (ttyACM1): <-- '^SIND: + psinfo,1,10OK' + Reporting initial access technologies... + Modem /org/freedesktop/ModemManager1/Modem/0: access technology + changed (unknown -> hsdpa, hsupa) + ... + (ttyACM1): <-- '+CIEV: psinfo,4' + Modem /org/freedesktop/ModemManager1/Modem/0: access technology + changed (hsdpa, hsupa -> edge) + ... + + plugins/cinterion/mm-broadband-modem-cinterion.c | 470 + ++++++++++++++++------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 33 ++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 5 + + 3 files changed, 366 insertions(+), 142 deletions(-) + +commit fbfb3d182d9852be1d01004ab31721538d6594d1 +Author: Aleksander Morgado +Date: Tue May 30 20:09:57 2017 +0200 + + port-serial-at: always prepend unsolicited message handlers + + The generic modem has several URC handlers for generic messages, like + +CIEV. But, there may be cases where the plugins themselves want to + provide their own URC handlers to be run before the generic one. + + This patch enables this setup by always prepending the new URC + handlers, so that the last ones added are processed before the ones + already in the list. So if a plugin does its own unsolicited + messages setup, they can run first the parent setup and then their + own. + + The only thing to consider is that the regex provided by the plugin + must be specific enough not to match the specific messages required + by the parent implementation. + + src/mm-port-serial-at.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 2c19b1f778af9b0e4200b063d3d0ed064c17b6b1 +Author: Aleksander Morgado +Date: Tue May 30 20:09:56 2017 +0200 + + iface-modem: if bands, capabilities or modes change, refresh signal + + We also remove the explicit refresh request from the Cinterion plugin, + as this is a generic action applicable to all modems that require + polling for signal quality and/or access technology. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 10 ++-------- + src/mm-iface-modem.c | 16 +++++++++++++--- + 2 files changed, 15 insertions(+), 11 deletions(-) + +commit 8ad868cea27f2ab043e5dfb544d5d70de34f60c2 +Author: Aleksander Morgado +Date: Tue May 30 20:09:55 2017 +0200 + + iface-modem: consolidate signal quality and access tech polling + + Plugins have two ways to update signal quality and access technology + values: via unsolicited messages or via polling periodically. + + Instead of keeping separate contexts for polling signal quality and + access technology values, we setup a common timeout to trigger + both. This allows us to simplify in which case the explicit update is + required, whenever one is needed to be explicitly updated, the other + one should also be. + + The logic now also allows plugins to return an UNSUPPORTED error in + either load_signal_quality() and/or load_access_technologies() to tell + the interface logic that the polling of the specific item shouldn't be + performed (e.g. if the updates are expected via unsolicited messages). + + If both signal quality and access technology polling is flagged as + disabled, we totally disable the polling logic internally. + + The new SignalCheckContext is bound to the lifetime of the object so + that we can keep the value of the supported flags until the object is + destroyed. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 8 +- + src/mm-iface-modem-3gpp.c | 7 +- + src/mm-iface-modem.c | 589 + ++++++++++++----------- + src/mm-iface-modem.h | 6 +- + 4 files changed, 312 insertions(+), 298 deletions(-) + +commit 34ac81071b90e4e15c209b2540d62cc8ca55f9da +Author: Aleksander Morgado +Date: Fri Jun 2 12:16:21 2017 +0200 + + base-bearer: use an initial longer timeout for connectivity check + + If we ask too quick for the PDP context status after a successful + connection attempt reported by the modem, we may find it still flagged + as inactive if the modem is still busy setting up the PPP session. + + Do an explicit longer initial timeout before we run the first check, + and after that one setup the additional checks at a higher rate. + + Reported-by: Colin Helliwell + + src/mm-base-bearer.c | 33 ++++++++++++++++++++++++++------- + 1 file changed, 26 insertions(+), 7 deletions(-) + +commit db5619b3eb9bac980f8f1f67c1589b5d73761917 +Author: Aleksander Morgado +Date: Mon Jun 5 15:05:45 2017 +0200 + + build,dell: reorder rules last + + Dell plugin is a compilation of other plugins, move last. + + plugins/Makefile.am | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit d6d7b837b80b2248358db2abebf836ce5bfe9c49 +Author: Aleksander Morgado +Date: Mon Jun 5 14:24:24 2017 +0200 + + build,telit: fix distcheck + + plugins/Makefile.am | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit 08782995e2db3e3e86f5cad54825d79eec68d0f2 +Author: Aleksander Morgado +Date: Fri Jun 2 11:04:35 2017 +0200 + + telit: rework QSS unsolicited handler enabling logic + + When the async method starts we store already the primary and the + optional secondary port objects in the method context, keeping a full + reference for each. + + When we parse the response for the enabling command, we just reuse the + stored port objects, instead of re-querying the modem to get them, and + this makes sure that the port objects where we want to set the + unsolicited message handlers are still valid. If the ports are gone + in the middle of the enabling operation, the handlers will be set + without errors, even if the ports may likely get completely disposed + when this async method context is disposed. + + Additionally, we make sure that we return an error also for the case + where there is no secondary port and the enabling on the primary port + failed. + + This patch also fixes the use of the at_command_full_finish() + method to + complete the at_command_full() async operation, to keep consistency. + + plugins/telit/mm-broadband-modem-telit.c | 102 + +++++++++++++------------------ + 1 file changed, 41 insertions(+), 61 deletions(-) + +commit d6779b91b23e207beb9591461b25c2201f3831b9 +Author: Aleksander Morgado +Date: Fri Jun 2 10:53:43 2017 +0200 + + telit: make sure QSS status values read are always known + + Given that the MMTelitQssStatus enums are mapped directly to the + values read from the #QSS response, we need to make sure that we never + return a value for which we don't have an enum defined. + + Also, use set_error() instead of the propagate_error() + error_new() + combo. + + plugins/telit/mm-modem-helpers-telit.c | 20 + +++++++++++++++----- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 1 + + 2 files changed, 16 insertions(+), 5 deletions(-) + +commit 4cd5044bfd5d2394b5001c4c6de63b181b0051bf +Author: Carlo Lobrano +Date: Thu Jun 1 11:04:04 2017 +0200 + + telit: manage QSS transitions + + Currently, Telit's SIM swap implementation is stateless and + based on #QSS unsolicited messages 0/1 (SIM_REMOVED/SIM_INSERTED). + + However, the user might have configured the modem in order to + provide a + more detailed information, with #QSS values 2/3 (SIM UNLOCKED/SIM + READY). + + In this case and with current implementation, even receiving "#QSS: + 3" will + trigger the "SIM swap" logic. The same issue might occur in other + use cases + too, i.e. with SIM locked or when the message is received from + both USB + ports. + + This patch makes SIM swap implementation stateful, and it considers + as an + actual SIM swap, only transitions from #QSS: 0 to #QSS: 1/2/3 and vice + versa. + + .gitignore | 2 + + plugins/Makefile.am | 107 +++++---- + plugins/telit/mm-broadband-modem-telit.c | 266 + +++++++++++++++------- + plugins/telit/mm-modem-helpers-telit.c | 20 ++ + plugins/telit/mm-modem-helpers-telit.h | 12 + + plugins/telit/tests/test-mm-modem-helpers-telit.c | 38 ++++ + 6 files changed, 329 insertions(+), 116 deletions(-) + +commit b5e94185bb487d39f75537755c1ea03b40737ca8 +Author: Aleksander Morgado +Date: Thu Mar 16 13:25:30 2017 +0100 + + huawei: let the E3372 run NDISDUP via TTY + + This modem ends up exposing a cdc-wdm port and a WWAN network + interface, but the cdc-wdm port is totally unusable, it won't reply to + any AT command or anything. + + Instead this modem can do NDISDUP via TTY, which is what the Windows + drivers are also doing. + + plugins/huawei/77-mm-huawei-net-port-types.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit e2e2c3e0191175eb4e3ce781b17c015cd44dfd66 +Author: Aleksander Morgado +Date: Wed May 17 15:15:07 2017 +0200 + + cinterion: retry GPS Engine activation up to 3 times + + The default setup with 100ms between GPS commands doesn't seem to be + always enough for the Engine activation step: + + [1495016625.392972] (ttyACM1): --> + 'AT^SGPSC="NMEA/Output","on"' + [1495016625.503885] (ttyACM1): <-- '^SGPSC: + "Nmea/Output","on"OK' + [1495016625.607650] (ttyACM1): --> + 'AT^SGPSC="Power/Antenna","on"' + [1495016625.697862] (ttyACM1): <-- '^SGPSC: + "Power/Antenna","on"OK' + [1495016625.809393] (ttyACM1): --> 'AT^SGPSC="Engine","1"' + [1495016625.895970] (ttyACM1): <-- '+CME ERROR: + 767' + + We now setup up to 3 retries for the Engine activation step before + returning an error, and we also update to 2000ms the wait time before + the Engine activation command is run. + + plugins/cinterion/mm-common-cinterion.c | 43 + ++++++++++++++++++++++++--------- + 1 file changed, 32 insertions(+), 11 deletions(-) + +commit aa8ac416f8ac2f81c0d157c707f44d728608c2a6 +Author: Aleksander Morgado +Date: Sun May 14 22:50:26 2017 +0200 + + cinterion: support AT^SGPSC capable modems + + The AT^SGPSS command provides an easy way to just start/stop GPS, but + unfortunately it isn't supported by all Cinterion modems. + + The AT^SGPSC command instead is more widely available but it requires + several steps to start and stop the different elements of the GPS + receiver. + + Implement support for both, preferring AT^SGPSSS if available and + falling back to AT^SGPSC otherwise. + + plugins/cinterion/mm-common-cinterion.c | 209 + +++++++++++++++++++++++++++----- + 1 file changed, 182 insertions(+), 27 deletions(-) + +commit d772301cd4618e792053868aec60b39d9b8dbae5 +Author: Aleksander Morgado +Date: Sun May 14 21:47:54 2017 +0200 + + cinterion: setup GPS port only if GPS support detected + + i.e. if AT^SGPSS not supported, we don't even add traces handler to + the GPS data port. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 14 --- + .../cinterion/mm-broadband-modem-qmi-cinterion.c | 16 ---- + plugins/cinterion/mm-common-cinterion.c | 103 + ++++++++++----------- + plugins/cinterion/mm-common-cinterion.h | 2 - + 4 files changed, 47 insertions(+), 88 deletions(-) + +commit 1857e9b36e3540404fc864a30ce371635e476aec +Author: Aleksander Morgado +Date: Sun May 14 21:30:54 2017 +0200 + + cinterion: flag PLS8 GPS data port + + plugins/cinterion/77-mm-cinterion-port-types.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit bf549d1bca405d14dcff6e37ab3fd85c930b2b17 +Author: Aleksander Morgado +Date: Sun May 14 21:22:48 2017 +0200 + + cinterion,location: refactor enable/disable and capabilities checks + + When checking for location capabilities, we will make sure AT^SGPSS is + supported and if it isn't we won't report GPS capabilities. + + The location enable and disable paths are refactored to make it easier + to add possible new GPS commands to use instead of AT^SGPSS, if this + isn't supported (e.g. in the PLS8 devices). + + plugins/cinterion/mm-common-cinterion.c | 534 + +++++++++++++++++++++----------- + 1 file changed, 350 insertions(+), 184 deletions(-) + +commit 2eb55d32249100fa1f501f936d2bda04ca6fcb9a +Author: Aleksander Morgado +Date: Tue May 30 17:28:23 2017 +0200 + + plugins: use G_N_ELEMENTS when iterating ports array + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + plugins/anydata/mm-broadband-modem-anydata.c | 2 +- + plugins/icera/mm-broadband-modem-icera.c | 2 +- + plugins/mbm/mm-broadband-modem-mbm.c | 4 ++-- + plugins/mtk/mm-broadband-modem-mtk.c | 2 +- + plugins/option/mm-broadband-modem-option.c | 2 +- + plugins/samsung/mm-broadband-modem-samsung.c | 2 +- + plugins/sierra/mm-common-sierra.c | 2 +- + plugins/simtech/mm-broadband-modem-simtech.c | 2 +- + plugins/via/mm-broadband-modem-via.c | 4 ++-- + plugins/zte/mm-common-zte.c | 2 +- + 11 files changed, 13 insertions(+), 13 deletions(-) + +commit b874fba0e68414b61625e4bbd2ea6584f4ebaf51 +Author: Aleksander Morgado +Date: Tue May 23 18:33:23 2017 +0200 + + ublox: use send-delay=0 by default + + Looks like the u-blox SARA-U260 requires this, see: + https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004670.html + + plugins/ublox/mm-broadband-modem-ublox.c | 31 + ++++++++++++++++++++++++++++++- + plugins/ublox/mm-plugin-ublox.c | 1 + + 2 files changed, 31 insertions(+), 1 deletion(-) + +commit fcd4a8c5dc6be8e72cfa7378829fef5c27c892a7 +Author: Aleksander Morgado +Date: Tue May 23 18:24:58 2017 +0200 + + altair,hso,samsung: setup send-delay=0 for probing + + The Altair, Option HSO and Samsung plugins all use the send-delay=0 + setting once the modem object has been created. For consistency, use + the same setting during port probing. + + plugins/altair/mm-plugin-altair-lte.c | 1 + + plugins/option/mm-plugin-hso.c | 1 + + plugins/samsung/mm-plugin-samsung.c | 1 + + 3 files changed, 3 insertions(+) + +commit 2b8a7e4c165f6f39d480b17be48c83efe6698816 +Author: Aleksander Morgado +Date: Sun May 21 14:54:41 2017 +0200 + + telit: remove custom +CMER enabling + + This is now managed directly in the generic plugin. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 + + plugins/telit/mm-broadband-modem-telit.c | 84 + ++++++++++++++++-------- + 2 files changed, 60 insertions(+), 26 deletions(-) + +commit ec98b9e95679a611abc99ecf91a2dfe62ed28b70 +Author: Aleksander Morgado +Date: Sun May 21 14:54:40 2017 +0200 + + cinterion: remove custom +CMER enabling + + This is now managed directly in the generic plugin. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 30 + ------------------------ + 1 file changed, 30 deletions(-) + +commit 024c7a1a8fd359c0c67fa87564a31f9c395e3903 +Author: Aleksander Morgado +Date: Mon May 22 19:21:02 2017 +0200 + + broadband-modem: query +CMER format before enabling/disabling + + Don't blindly try '+CMER=3,0,0,1' to enable and '+CMER=0' to disable + Mobile Equipment Event Reporting. We now query the device for the + supported formats and use that info to build commands that will work. + + src/mm-broadband-modem.c | 137 + +++++++++++++++++++++++++++++++++-------- + src/tests/test-modem-helpers.c | 12 ++++ + 2 files changed, 124 insertions(+), 25 deletions(-) + +commit e753911a4e9dad801b0cf0518b1abbe317598dee +Author: Aleksander Morgado +Date: Mon May 22 14:43:40 2017 +0200 + + helpers: new 'AT+CMER=?' parser + + src/mm-modem-helpers.c | 123 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 25 +++++++++ + src/tests/test-modem-helpers.c | 68 +++++++++++++++++++++++ + 3 files changed, 216 insertions(+) + +commit 7f3b552804d96554a039430d86e8cac6268198b1 +Author: Aleksander Morgado +Date: Sun May 21 19:17:55 2017 +0200 + + cinterion: support changing modes in LTE capable devices + + plugins/cinterion/mm-broadband-modem-cinterion.c | 164 + +++++++++++------------ + 1 file changed, 78 insertions(+), 86 deletions(-) + +commit e6f245c6dfe48be33e1099e842dec1c0e30a1508 +Author: Aleksander Morgado +Date: Thu May 18 09:57:37 2017 +0200 + + udev: remove default ID_MM_PLATFORM_DRIVER_PROBE whitelist + + The whitelist made all platform TTYs managed by the 'atmel_usart' + kernel driver probed by ModemManager, which isn't something we want, + as most of these aren't broadband modems. + + We leave the logic supporting the ID_MM_PLATFORM_DRIVER_PROBE udev tag + as there may be a case where the user does need ModemManager to probe + a given platform TTY. + + src/77-mm-platform-serial-whitelist.rules | 13 ------------- + src/Makefile.am | 1 - + 2 files changed, 14 deletions(-) + +commit 57f193bd040575642cacfd2a53de0b05d4258a6c +Author: Aleksander Morgado +Date: Mon May 29 13:42:23 2017 +0200 + + log: remove func loc info unless MM_LOG_FUNC_LOC is defined + + The user can build the project passing custom CFLAGS to enable the + function location information, e.g.: + + $ ./configure --prefix=/usr CFLAGS="-DMM_LOG_FUNC_LOC" + + src/main.c | 1 - + src/mm-log.c | 9 +++------ + src/mm-log.h | 1 - + 3 files changed, 3 insertions(+), 8 deletions(-) + +commit 3bb0f7e66d8203a1dc78eb6d404e29aefef6a88c +Author: Aleksander Morgado +Date: Thu May 18 12:43:49 2017 +0200 + + context: rework application options and help output + + Group together all options that allow configuring the logging output, + and make them have the same --log-[XXX] prefix. + + Also rework the --help output so that all option groups are printed by + default (i.e. there is no longer a --help-all option). + + docs/man/ModemManager.8 | 26 +++---- + src/main.c | 4 +- + src/mm-context.c | 196 + +++++++++++++++++++++++++++++++++++------------- + src/mm-context.h | 12 +-- + 4 files changed, 162 insertions(+), 76 deletions(-) + +commit 51bb354624865414e8a036e3502c1b713999ec1f +Author: Carlo Lobrano +Date: Mon May 29 09:48:20 2017 +0200 + + dell: speed probing time up and reduce udev dependency + + Currently Dell plugin implements a retry logic of three commands + (AT+GMI, AT+CGMI, ATI1I2I3) to detect modem's vendor string. + Moreover, since Telit modems always reply to the first command, + to speed + the probing time up, those modem are tagged with an Udev rule so + that we + can avoid sending the other two commands at all. + + However, the retry logic is in case a port needs some time to + reply, so + it makes sense to apply it only to the first command. Then if the + port still + does not respond with any kind of reply, that probably means that + it is not + AT capable and we can skip the other AT commands as well. + + Then, this patch: + - sets a maximum number of timeouts for AT+GMI to 3. After this + timeouts, the port is considered not AT-capable. + - sets AT+CGMI and ATI1I2I3 to be sent only once. + - removes Dell udev rule for tagging Telit Modems. + + plugins/dell/77-mm-dell-port-types.rules | 4 ---- + plugins/dell/mm-plugin-dell.c | 29 + ++++++++++++++++++----------- + 2 files changed, 18 insertions(+), 15 deletions(-) + +commit d986277f13db31cd91de2f6a8bf3b812d9f3fc04 +Author: Carlo Lobrano +Date: Fri May 5 16:49:38 2017 +0200 + + telit: removed ID_MM_TELIT_PORTS_TAGGED dependency + + Currently, Telit plugin depends on ID_MM_TELIT_PORTS_TAGGED + environment variable, set by udev, for tagging modems that + support dynamic port config (#PORTCFG) + + To remove this dependency from udev, Telit plugin now relies + only on the error management of the command AT#PORTCFG? itself + in order to see whether the modem supports it or not. + + plugins/telit/77-mm-telit-port-types.rules | 9 --------- + plugins/telit/mm-common-telit.c | 9 +-------- + 2 files changed, 1 insertion(+), 17 deletions(-) + +commit 8387dc7a7c6b21b28783c7db6d94a111ce7b7485 +Author: Aleksander Morgado +Date: Mon May 22 13:18:19 2017 +0200 + + broadband-modem: don't create sim hot swap ports context multiple + times + + src/mm-broadband-modem.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 0f99328af635979a91c4c4e31e2d6692d2b78181 +Author: Aleksander Morgado +Date: Sun May 21 18:55:35 2017 +0200 + + cinterion: don't enable simstatus URCs + + When polling for the SIM status, we want to read the value (mode 2) + without enabling indications (mode 1). + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a6909379024fcdd48275aa89372b574b867a40d6 +Author: Aleksander Morgado +Date: Sun May 21 14:32:48 2017 +0200 + + mbm: fix async method completion enabling unsolicited events + + plugins/mbm/mm-broadband-modem-mbm.c | 1 + + 1 file changed, 1 insertion(+) + +commit bf579da074ec8485acf12580c89cdbc6cee5d10b +Author: Aleksander Morgado +Date: Sat May 20 20:27:26 2017 +0200 + + iface-modem: always complete async context with a value + + Just for consistency, this is not a bug per se. + + src/mm-iface-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit cab81f679f08beefc85a7582990cce2f276b6190 +Author: Aleksander Morgado +Date: Thu May 18 12:54:37 2017 +0200 + + blacklist: ignore default Linux USB Serial Gadget + + Blacklist the default VID:PID for the Linux USB Serial Gadget in ACM + mode: + + {LINUX}/drivers/usb/gadget/legacy/serial.c + #define GS_VENDOR_ID 0x0525 /* NetChip */ + #define GS_CDC_PRODUCT_ID 0xa4a7 /* ... as CDC-ACM */ + + This should never be reused for real products by hardware + manufacturers, but anyway... + + Patch actually ported from downstream Ubuntu: + https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1105352 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 5947cda9f49aad2f3c05dbe44c47fcc575156ac6 +Author: Aleksander Morgado +Date: Thu May 18 12:32:06 2017 +0200 + + man: include missing --no-auto-scan and --initial-kernel-events + + And remove --test-no-auto-scan, as the 'no auto scan' feature isn't + only a test feature now. + + docs/man/ModemManager.8 | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit e8acfe0296d2883f6f337cb71fd809cc2c90f564 +Author: Aleksander Morgado +Date: Mon May 15 12:26:57 2017 +0200 + + iface-modem: fix setting up signal quality retrieval logic + + If going directly e.g. from "Searching" to "Connecting", just setup + the signal quality retrieval logic right away, don't assume we always + go through "Registered" state before starting a connection. + + Reported-by: + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit d41d717112e6a183a0df510c210e80a86fc11060 +Author: Aleksander Morgado +Date: Wed May 10 14:36:28 2017 +0200 + + ublox: align property values in g_object_new() + + plugins/ublox/mm-plugin-ublox.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 1ab98b9e8cd327f55529ec43be3cfb0fe21d11a0 +Author: Javier Viguera +Date: Mon May 8 10:45:46 2017 +0200 + + ublox: support modems connected to serial port + + Add the vendor string, so it can be probed via AT commands. This + allows + to support modems that are connected to a serial port. + + Signed-off-by: Javier Viguera + + plugins/ublox/mm-plugin-ublox.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit fa2e532d2c362e17140408c5917d47d6dac64aea +Author: Javier Viguera +Date: Mon May 8 10:45:45 2017 +0200 + + port-serial: add B230400 and B921600 missing baudrates + + So MM can use them when opening a specific serial port. + + Signed-off-by: Javier Viguera + + src/mm-port-serial.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 650d2304259d767e8925d74221c262c020e1bfb0 +Author: Aleksander Morgado +Date: Wed May 10 14:26:28 2017 +0200 + + blacklist: add keyboard.io devices + + See https://bugs.freedesktop.org/show_bug.cgi?id=85007#c5 + + Reported-by: Jesse Vincent + + src/77-mm-usb-device-blacklist.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2373a4b65843847e3dacca958f0bab833032b796 +Author: Aleksander Morgado +Date: Fri May 5 11:33:11 2017 +0200 + + port-qmi: fix QMI client allocation procedure + + Commit 26ee94ec28b6f68 introduced a bug, where we would be completing + the client allocation task *before* tracking the new client allocation + info in the private tracking list. + + This meant that if mm_port_qmi_peek_client() was called in the task + completion handler, the client object wouldn't be returned, as it + wasn't found in the private tracking list. + + The fix is just to defer the task completion until after the private + tracking list is updated. + + Reported-by: Salvador Penalva + + src/mm-port-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f3cc78ef02c8c85afc2b7c36bbc17580bff62a34 +Author: Dan Williams +Date: Mon Apr 24 22:37:46 2017 -0500 + + broadband-modem-qmi: ensure PLMN name is UTF-8 + + Some Telit modems apparently sometimes report non-UTF8 characters. + + src/mm-broadband-modem-qmi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit d4e149c52851439c5a0579653fceff1821ce946b +Author: Maksim Salau +Date: Sun Apr 23 20:39:01 2017 +0300 + + blacklist: add Analog Devices EVAL-ADXL362Z-DB + + Signed-off-by: Maksim Salau + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7a68d457742d827b5ce744a7cec14e7862497002 +Author: Carlo Lobrano +Date: Wed Apr 19 17:02:20 2017 +0200 + + telit: give load lock retries steps a descriptive name + + In order to make debug logging more clear, I replaced the step ID + with a + descriptive step name. + + plugins/telit/mm-broadband-modem-telit.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit d09bc8baaa9fe93a72bb715530b1403a7a81c891 +Author: Aleksander Morgado +Date: Wed Apr 19 10:42:20 2017 +0200 + + telit: use mm_get_uint_from_hex_str() to parse CSIM hex response + + The regex is already limiting the string to 4 hex chars, so we can + definitely fit the number in a guint, no need a guint64. + + plugins/telit/mm-modem-helpers-telit.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 44daf791bbf0c251882f723e9fcc9c89606d69fc +Author: Carlo Lobrano +Date: Wed Apr 19 10:00:19 2017 +0200 + + telit: add error_code recognition to +CSIM parser + + - Refactored mm_telit_parse_csim_response in order to correctly + recognize the following +CSIM error codes: + * 6300 - Verification failed + * 6983 - Authentication method blocked + * 6984 - Reference data invalidated + * 6A86 - Incorrect parameters + * 6A88 - Reference data not found + + - Updated correspondent tests. + - Finally, some minor changes in other files for better error logging + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100374 + + plugins/telit/mm-broadband-modem-telit.c | 6 +- + plugins/telit/mm-modem-helpers-telit.c | 98 + ++++++++++++++++------- + plugins/telit/mm-modem-helpers-telit.h | 3 +- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 73 ++++++++--------- + 4 files changed, 104 insertions(+), 76 deletions(-) + +commit 4fe464f5f75bb25da5d05a9b976550732b7620b7 +Author: Aleksander Morgado +Date: Sat Apr 15 23:26:32 2017 +0200 + + core: prefer g_task_return_error_if_cancelled() than custom errors + + When the GCancellable is added to the GTask, we can use a single + method call to check for the task being cancelled, and complete it + right away if so. + + This patch also clears up the logic in the Novatel plugin, where the + code was trying to return "TRUE" when the task was cancelled, but + wouldn't work as the check-cancellable flag in the GTask is TRUE by + default (i.e. when completing the GTask, if it was cancelled, a + G_IO_ERROR_CANCELLED would be returned by default, regardless of any + other return value set). + + This patch also introduces a small variation of the logic in the + Cinterion plugin: instead of running SWWAN=0 before completing the + async action, the command is now sent just after completion of the + async action. This shouldn't be an issue, as the SWWAN result itself + is ignored. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 7 ++----- + plugins/novatel/mm-common-novatel.c | 3 +-- + src/mm-auth-provider-polkit.c | 6 +----- + src/mm-iface-modem-signal.c | 6 +----- + 4 files changed, 5 insertions(+), 17 deletions(-) + +commit 6312753a6bfc09922cd3d2d582f7c3a1ae5f5585 +Author: Aleksander Morgado +Date: Sat Mar 25 18:30:02 2017 +0100 + + broadband-bearer: once connected, set flow control settings + + During modem initialization we detected the flow control settings + supported by the modem, and selected the best one to use from them, + notifying it to the device via AT+IFC. The device was therefore + instructed to use that flow control setting for data transmission in + the TTY (i.e. not during AT control commands). + + The missing thing was to also configure ourselves our end of the + serial port with the same flow control settings when getting into data + mode. By doing it ourselves, we avoid requiring any explicit setting + in pppd for flow control; pppd can assume the flow control settings + are already the expected ones. + + Worth noting that all this setup is completely ignored for TTYs + exposed directly via USB. + + https://bugs.freedesktop.org/show_bug.cgi?id=100394 + + .gitignore | 2 + + src/Makefile.am | 28 +++++++++++ + src/mm-broadband-bearer.c | 125 + ++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-broadband-bearer.h | 3 ++ + src/mm-broadband-modem.c | 49 ++++++++++++++---- + src/mm-broadband-modem.h | 3 ++ + src/mm-modem-helpers.h | 2 +- + 7 files changed, 196 insertions(+), 16 deletions(-) + +commit 595bd5dbe330009a04f7840d3aef2d180e848b4e +Author: Aleksander Morgado +Date: Sat Mar 25 18:27:09 2017 +0100 + + port-serial: remove all default flow control settings + + We won't set XON/XOFF by default and we won't allow setting RTS/CTS + via a property. The serial port by default starts with no flow control + configured. + + src/mm-port-serial.c | 34 ++++++---------------------------- + src/mm-port-serial.h | 1 - + 2 files changed, 6 insertions(+), 29 deletions(-) + +commit 580c113c5a4c9c8b74edce3808f0c6f0b43e2025 +Author: Aleksander Morgado +Date: Sat Mar 25 18:18:46 2017 +0100 + + port-serial: new method to explicitly set flow control settings + + src/mm-port-serial.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-port-serial.h | 5 +++++ + 2 files changed, 55 insertions(+) + +commit 3223b56ba9f61c4339d74829748ae6937cffc196 +Author: Aleksander Morgado +Date: Sat Mar 25 18:17:41 2017 +0100 + + port-serial: new internal method to run tcsetattr() + + The method takes care of looping if EAGAIN errors happen, as well as + checking whether all attributes were set or not. + + src/mm-port-serial.c | 119 + ++++++++++++++++++++++++--------------------------- + 1 file changed, 57 insertions(+), 62 deletions(-) + +commit ff6726df11532cbb066bebb1b665faa15a3e25af +Author: Aleksander Morgado +Date: Sat Mar 25 01:16:25 2017 +0100 + + telit: ignore custom flow control handling + + The generic modem object already supports querying for the supported + methods and setting the best one found. + + plugins/telit/mm-broadband-modem-telit.c | 48 + -------------------------------- + 1 file changed, 48 deletions(-) + +commit 1d2a67ab209c6dcc99adc2733fabace6ea4de96c +Author: Aleksander Morgado +Date: Sat Mar 25 01:14:45 2017 +0100 + + wavecom: ignore custom flow control handling + + The generic modem object already supports querying for the supported + methods and setting the best one found. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 27 + --------------------------- + 1 file changed, 27 deletions(-) + +commit 91391eb460645cc9407b16e1b516cb4c2cf723f7 +Author: Aleksander Morgado +Date: Sat Mar 25 01:11:45 2017 +0100 + + broadband-modem: query supported flow control modes before setting + + Instead of assuming XON/XOFF is supported, we query the supported flow + control modes, and then we set the best one based on that, preferring + hardware flow control over software flow control. + + src/mm-broadband-modem.c | 79 + ++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 60 insertions(+), 19 deletions(-) + +commit 973c7d0970d5151f1b5d40b01ce0f2334c226b7c +Author: Aleksander Morgado +Date: Sat Mar 25 00:47:50 2017 +0100 + + helpers: new parser for AT+IFC=? + + Instead of having the parser return separate list of supported flow + controls for TE and TA, we simplify it by only returning those + settings that apply to both TE and TA. + + This logic isn't perfect either, though, as some settings (e.g. '3' in + TE in some modems, specifying a different XON/XOFF behavior) may not + have a corresponding setting in the other end. + + The most common cases we care about (i.e. standard XON/XOFF, RTS/CTS) + should be properly reported with this logic. + + src/mm-modem-helpers.c | 113 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 17 +++++++ + src/tests/test-modem-helpers.c | 100 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 230 insertions(+) + +commit 75d9c0bc9542e04887e8b73fd0238d97d7ad263a +Author: Dan Williams +Date: Mon Mar 6 09:05:53 2017 -0600 + + broadband-modem: open QCDM port for CDMA Serving System checking + when needed + + src/mm-broadband-modem.c | 201 + ++++++++++++++++++++++++----------------------- + 1 file changed, 102 insertions(+), 99 deletions(-) + +commit 5c94c8cc6dce58b7c3a88c53e4ab37022ba13185 +Author: Dan Williams +Date: Mon Mar 6 09:04:33 2017 -0600 + + broadband-modem: open QCDM port for Call Manager state checking + when needed + + src/mm-broadband-modem.c | 80 + +++++++++++++++++++++++++----------------------- + 1 file changed, 41 insertions(+), 39 deletions(-) + +commit 3901ceade1c8d9b2199c2f7c620099f70f5545d4 +Author: Dan Williams +Date: Mon Mar 6 09:03:29 2017 -0600 + + broadband-modem: open QCDM port for HDR state checking when needed + + src/mm-broadband-modem.c | 80 + +++++++++++++++++++++++------------------------- + 1 file changed, 38 insertions(+), 42 deletions(-) + +commit 355a5942232860442f656a94a7fa76a5f8dbfed7 +Author: Dan Williams +Date: Mon Mar 6 08:58:44 2017 -0600 + + broadband-modem: open QCDM port for access tech checking when needed + + src/mm-broadband-modem.c | 103 + ++++++++++++++++++++++++++--------------------- + 1 file changed, 57 insertions(+), 46 deletions(-) + +commit aa87775a811074163b8f1889a8186b69bab189ef +Author: Dan Williams +Date: Mon Mar 6 08:57:40 2017 -0600 + + broadband-modem: open QCDM port for signal checking when needed + + src/mm-broadband-modem.c | 42 +++++++++++++++++++++++++++--------------- + 1 file changed, 27 insertions(+), 15 deletions(-) + +commit 977d5ac6cef77893d81b9a6326d09e2c00d2a875 +Author: Dan Williams +Date: Wed Aug 24 10:56:19 2016 -0500 + + broadband-modem-novatel: $NWRSSI can report lower values than -115 + + My E725 reported 125 once; that's a valid dBm and MM shouldn't report + an error when parsing it. + + plugins/novatel/mm-broadband-modem-novatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dedc1f15c78e64002827581aef7df72a98c55759 +Author: Dan Williams +Date: Wed Aug 10 10:06:58 2016 -0500 + + broadband-modem-novatel: clean up detailed registration state handling + + Allocate the results instead of passing them back on the stack, + which removes + the "can't complete in idle" restriction. Also always open the + QCDM port + since we can't assume it will be open already at this point. + + plugins/novatel/mm-broadband-modem-novatel.c | 165 + +++++++++++++++------------ + 1 file changed, 93 insertions(+), 72 deletions(-) + +commit 77fbcf534b8f787f55db549a9e651cc9e8959198 +Author: Dan Williams +Date: Wed Aug 10 09:45:29 2016 -0500 + + broadband-modem-novatel: clean up access technology reporting + + Instead of mixing the QCDM Novatel Snapshot code directly into the + access technology checking code, split it out with its own async + result. At the same time, make sure to open the QCDM port when + it's needed, instead of assuming its already open. Since it won't + always be. + + plugins/novatel/mm-broadband-modem-novatel.c | 286 + ++++++++++++++------------- + 1 file changed, 145 insertions(+), 141 deletions(-) + +commit 01cba808e4c333744fcf5d27d2d58ef1b5cdc812 +Author: Ben Chan +Date: Wed Apr 12 18:52:49 2017 -0700 + + iface-modem-signal: port mm_iface_modem_signal_initialize to use GTask + + src/mm-iface-modem-signal.c | 98 + ++++++++++++++++++++------------------------- + 1 file changed, 44 insertions(+), 54 deletions(-) + +commit ed8bea8a3c0cc37243137cb7dc671834c5ee1a5f +Author: Ben Chan +Date: Wed Apr 12 18:52:48 2017 -0700 + + iface-modem-signal: port mm_iface_modem_signal_enable to use GTask + + src/mm-iface-modem-signal.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +commit ca89a4c038880a0e96434ccf682de98943d02357 +Author: Ben Chan +Date: Wed Apr 12 18:52:47 2017 -0700 + + iface-modem-signal: port mm_modem_iface_signal_disable to use GTask + + src/mm-iface-modem-signal.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit a902199772ce3d9155919d5d8ef3df81e7f776a6 +Author: Carlo Lobrano +Date: Thu Apr 13 11:53:53 2017 +0200 + + telit: unsupported CSIM lock should not skip loading unlock retries + + Some modems do not support CSIM lock/unlock, but they do support + querying SIM unlock retries through +CSIM command. + + If CSIM lock returns with "unsupported command" do not propagate + the error and continue with the other CSIM queries instead, + moreover the + CSIM lock feature is signed as FEATURE_UNSUPPORTED in Telit modem + private structure to prevent being sent again (e.g. calling CSIM + unlock AT command). + + plugins/telit/mm-broadband-modem-telit.c | 94 + ++++++++++++++++++++++++++------ + plugins/telit/mm-broadband-modem-telit.h | 2 + + 2 files changed, 80 insertions(+), 16 deletions(-) + +commit 23b67db7c98a3f2fafd7d32a4c26fe02d81624ec +Author: Ben Chan +Date: Fri Apr 7 18:16:12 2017 -0700 + + base-call: remove unnecessary string duplications + + src/mm-base-call.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +commit b65819e6ad66688c8d6633f910e1519a35d3571d +Author: Ben Chan +Date: Fri Apr 7 11:23:01 2017 -0700 + + port-mbim: port mm_port_mbim_{open,close} to use GTask + + src/mm-port-mbim.c | 132 + +++++++++++++++++++++-------------------------------- + 1 file changed, 51 insertions(+), 81 deletions(-) + +commit 26ee94ec28b6f686cf4223435986dbeb48e833c1 +Author: Ben Chan +Date: Thu Apr 6 13:41:16 2017 -0700 + + port-qmi: port mm_port_qmi_allocate_client to use GTask + + src/mm-port-qmi.c | 51 + ++++++++++++++++++++++++++------------------------- + 1 file changed, 26 insertions(+), 25 deletions(-) + +commit 031c753a00f3d4b491120df9d327459b4e7d9145 +Author: Ben Chan +Date: Thu Apr 6 12:35:53 2017 -0700 + + novatel: obtain MMPortProbe from GTask source object + + The MMPortProbe object is already referenced by the GTask object for + custom init. Instead of keeping another reference of MMPortProbe + in the + CustomInitContext, this patch changes the code to simply obtain + it from + the source object of GTask. + + See + https://lists.freedesktop.org/archives/modemmanager-devel/2017-April/004420.html + + plugins/novatel/mm-common-novatel.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 9667d037fdd5d1cb07b1ff27d868e7398bb31ce0 +Author: Aleksander Morgado +Date: Fri Apr 7 11:13:24 2017 +0200 + + polkit: fix build when polkit enabled + + This fixes the build after commit + 740ce1fb26dd83459075f2d069a9da25e449dd89. + + CC ModemManager-mm-auth-provider-polkit.o + ../../src/mm-auth-provider-polkit.c: In function ‘authorize’: + ../../src/mm-auth-provider-polkit.c:155:46: error: + ‘AuthorizeContext’ has no member named ‘cancellable’ + ctx->cancellable, + ^ + Makefile:1533: recipe for target + 'ModemManager-mm-auth-provider-polkit.o' failed + + src/mm-auth-provider-polkit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 374c65a5202f983073bb8918a33316e19186df87 +Author: Ben Chan +Date: Thu Apr 6 12:57:45 2017 -0700 + + sms-mbim: port sms_delete to use GTask + + src/mm-sms-mbim.c | 48 +++++++++++++++++++++++------------------------- + 1 file changed, 23 insertions(+), 25 deletions(-) + +commit 59a6bcbb1b1dac2e7ea1a9e3b98b562ce54782b5 +Author: Ben Chan +Date: Thu Apr 6 12:57:44 2017 -0700 + + sms-mbim: port sms_send to use GTask + + src/mm-sms-mbim.c | 46 ++++++++++++++++++++++------------------------ + 1 file changed, 22 insertions(+), 24 deletions(-) + +commit e661ba077fb440668d5986595e5d6406048eaf77 +Author: Ben Chan +Date: Thu Apr 6 13:41:15 2017 -0700 + + port-qmi: port mm_port_qmi_open to use GTask + + src/mm-port-qmi.c | 142 + +++++++++++++++++++++++++++++------------------------- + 1 file changed, 76 insertions(+), 66 deletions(-) + +commit a0806449245dd23bda631b9addb13761cc5999ae +Author: Ben Chan +Date: Thu Apr 6 12:54:30 2017 -0700 + + call-list: port mm_call_list_delete_call to use GTask + + src/mm-call-list.c | 55 + +++++++++++++++++++----------------------------------- + 1 file changed, 19 insertions(+), 36 deletions(-) + +commit 21195f8e540e08d86ff29e495ef73d5c80ab9959 +Author: Ben Chan +Date: Thu Apr 6 12:42:32 2017 -0700 + + sms-list: port mm_sms_list_delete_sms to use GTask + + src/mm-sms-list.c | 70 + +++++++++++++++++++++---------------------------------- + 1 file changed, 27 insertions(+), 43 deletions(-) + +commit 740ce1fb26dd83459075f2d069a9da25e449dd89 +Author: Ben Chan +Date: Thu Apr 6 12:38:44 2017 -0700 + + polkit: port authorize to use GTask + + src/mm-auth-provider-polkit.c | 89 + ++++++++++++++++++++----------------------- + 1 file changed, 41 insertions(+), 48 deletions(-) + +commit 1755d1a5c33b2e3f3b79c88ecd1f4a8e43238b40 +Author: Ben Chan +Date: Thu Apr 6 12:38:43 2017 -0700 + + auth: port authorize to use GTask + + src/mm-auth-provider.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +commit 8c04cc036782dab0e80c1f2314baa3376eecad02 +Author: Dan Williams +Date: Mon Apr 3 14:50:01 2017 -0500 + + telit: fix AT+SERVICE 3GPP2 access technology reporting + + Looks like a C&P error from the AT#PSNT codepath; all the docs + I can find indicate that AT+SERVICE returns only an integer and + no commas: + + (ttyUSB2): --> 'AT+SERVICE?' + (ttyUSB2): <-- '+SERVICE: 3OK' + Couldn't refresh access technologies: 'Failed to parse + +SERVICE response: '+SERVICE: 3'' + + plugins/telit/mm-broadband-modem-telit.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 665e22791818b51ce48d93febf7ced7302e7a2d3 +Author: Ben Chan +Date: Mon Apr 3 23:37:49 2017 -0700 + + iface-modem-simple: port register_in_3gpp_or_cdma_network to use GTask + + src/mm-iface-modem-simple.c | 59 + ++++++++++++++++++++++++++------------------- + 1 file changed, 34 insertions(+), 25 deletions(-) + +commit e0bca5509ef9bb006602efdbab67c7a189031879 +Author: Ben Chan +Date: Mon Apr 3 23:37:38 2017 -0700 + + bearer-list: port mm_bearer_list_disconnect_all_bearers to use GTask + + src/mm-bearer-list.c | 40 +++++++++++++++++++++------------------- + 1 file changed, 21 insertions(+), 19 deletions(-) + +commit 6542430588432b1c4c82ffc1f61e1711ff137b04 +Author: Ben Chan +Date: Mon Apr 3 12:37:56 2017 -0700 + + novatel: port IMSI loading to use GTask + + plugins/novatel/mm-sim-novatel-lte.c | 89 + +++++++++++++++--------------------- + 1 file changed, 36 insertions(+), 53 deletions(-) + +commit 1e05fd4df677fc4d8bbd2fcc42dc0340d910f8fc +Author: Ben Chan +Date: Mon Apr 3 12:37:55 2017 -0700 + + novatel: port custom init to use GTask + + plugins/novatel/mm-common-novatel.c | 62 + +++++++++++++++++-------------------- + 1 file changed, 29 insertions(+), 33 deletions(-) + +commit 6ced121ce18ffd1612d294d02bf196694d0d25e1 +Author: Ben Chan +Date: Mon Apr 3 23:37:25 2017 -0700 + + base-modem: port mm_base_modem_authorize to use GTask + + src/mm-base-modem.c | 25 ++++++++++--------------- + 1 file changed, 10 insertions(+), 15 deletions(-) + +commit 2c4b061dda120391b6d31ab5e5e1fa7e01285974 +Author: Ben Chan +Date: Mon Apr 3 13:05:16 2017 -0700 + + novatel-lte: revert to original plugin library name + + Commit f9c63bfa0 "build,plugins: update build rules" accidentally + changed the Novatel LTE plugin from 'libmm-plugins-novatel-lte.so' to + 'libmm-plugins-novatel_lte.so'. The name becomes inconsistent + with other + plugin names. + + plugins/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 34443289d97da5c95270c6071d140f4567047624 +Author: Thomas Voß +Date: Sat Apr 1 22:11:42 2017 +0200 + + mbim-modem: disable location interface + + MBIM does not support 3gpp location data right now. For that, + we make sure that the location interface is not reported as + supported by MBIM modems. + + src/mm-broadband-modem-mbim.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit fba49d8d005dd65affac56975bc7fd95250d530c +Author: Aleksander Morgado +Date: Sat Mar 25 21:39:45 2017 +0100 + + broadband-modem: normalize also operator code + + The operator code (MCCMNC) may also be given encoded in the current + charset (e.g. UCS2). + + Based on a patch from Colin Helliwell + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + src/mm-broadband-modem.c | 6 ++++-- + src/mm-modem-helpers.c | 4 ++-- + src/mm-modem-helpers.h | 4 ++-- + src/tests/test-modem-helpers.c | 7 ++++++- + 5 files changed, 15 insertions(+), 8 deletions(-) + +commit f824602bdd922cdc9e15aa83fda545534c0b0542 +Author: Aleksander Morgado +Date: Sat Mar 25 21:39:44 2017 +0100 + + modem-helpers: if operator not in UCS2, see if already valid UTF-8 + + The method doing the operator name normalization takes as input the + current configured modem charset. If this is UCS2, we will now just + assume this is a hint: the string may or may not come in hex/UCS2. + + This logic makes the custom operator name loading in Huawei unneeded, + if the modem is configured in UCS2, we still properly process operator + names coming in plain ASCII. + + plugins/huawei/mm-broadband-modem-huawei.c | 51 + ------------------------------ + src/mm-modem-helpers.c | 26 +++++++++------ + src/tests/test-modem-helpers.c | 45 + ++++++++++++++++++++++++++ + 3 files changed, 62 insertions(+), 60 deletions(-) + +commit 822bfa4ca163ef17a0fc60d03bfae462091885bf +Author: Aleksander Morgado +Date: Thu Mar 30 21:14:46 2017 +0200 + + base-manager: fix segfault when using already disposed MMDevice + + Since commit e9d0989ed069, the MMDevice may be removed from the + tracking hash table when the support check operation fails to create a + modem object. + + If this failure happens due to the port probe cancellations requested + during the udev removal event for a given device port, we would end up + using an already disposed object and triggering a segfault. + + This fix just makes sure a full valid reference to the MMDevice object + is kept around until we're done using it. + + [mm-base-manager.c:216] device_removed(): + (usbmisc/cdc-wdm1): released by device + '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.4' + [mm-plugin-manager.c:1131] device_context_port_released(): + [plugin manager] task 5: port released: cdc-wdm1 + [mm-base-manager.c:216] device_removed(): (tty/ttyACM0): released + by device '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.4' + [mm-plugin-manager.c:1131] device_context_port_released(): + [plugin manager] task 5: port released: ttyACM0 + [mm-base-manager.c:221] device_removed(): Removing empty device + '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.4' + [mm-plugin-manager.c:1219] device_context_cancel(): [plugin + manager) task 5: cancellation requested + [mm-plugin-manager.c:979] device_context_continue(): [plugin + manager] task 5: no more ports to probe + [mm-plugin-manager.c:813] device_context_complete(): [plugin + manager] task 5: finished in '0.090510' seconds + [mm-base-manager.c:172] device_support_check_ready(): + Couldn't check support for device + '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.4': Operation + was cancelled + [mm-base-manager.c:223] device_removed(): Device support check + has been cancelled + + Thread 1 "ModemManager" received signal SIGSEGV, Segmentation + fault. + 0x00007ffff6543c50 in g_str_hash () from /usr/lib/libglib-2.0.so.0 + (gdb) bt + #0 0x00007ffff6543c50 in g_str_hash () at + /usr/lib/libglib-2.0.so.0 + #1 0x00007ffff6542b2d in () at /usr/lib/libglib-2.0.so.0 + #2 0x0000000000439675 in device_removed (self=0x770900, + kernel_device=0x763e60) at mm-base-manager.c:225 + #3 0x0000000000439e70 in handle_uevent (client=0x769c20, + action=0x81d910 "remove", device=0x7fffe4001c40, + user_data=0x770900) at mm-base-manager.c:415 + #4 0x00007ffff54c61c8 in ffi_call_unix64 () at + /usr/lib/libffi.so.6 + #5 0x00007ffff54c5c2a in ffi_call () at /usr/lib/libffi.so.6 + #6 0x00007ffff682d7ae in g_cclosure_marshal_generic () + at /usr/lib/libgobject-2.0.so.0 + #7 0x00007ffff682cf75 in g_closure_invoke () at + /usr/lib/libgobject-2.0.so.0 + #8 0x00007ffff683ef82 in () at /usr/lib/libgobject-2.0.so.0 + #9 0x00007ffff6847bcc in g_signal_emit_valist () + at /usr/lib/libgobject-2.0.so.0 + #10 0x00007ffff6847faf in g_signal_emit () at + /usr/lib/libgobject-2.0.so.0 + #11 0x00007ffff7023c74 in () at /usr/lib/libgudev-1.0.so.0 + #12 0x00007ffff655445a in g_main_context_dispatch () + at /usr/lib/libglib-2.0.so.0 + #13 0x00007ffff6554810 in () at /usr/lib/libglib-2.0.so.0 + #14 0x00007ffff6554b32 in g_main_loop_run () at + /usr/lib/libglib-2.0.so.0 + #15 0x0000000000437bf5 in main (argc=2, argv=0x7fffffffeb28) at + main.c:180 + + (gdb) fr 2 + #2 0x0000000000439675 in device_removed (self=0x770900, + kernel_device=0x763e60) at mm-base-manager.c:225 + 225 g_hash_table_remove (self->priv->devices, + mm_device_get_uid (device)); + + (gdb) p mm_device_get_uid (device) + $1 = (const gchar *) 0x0 + + (gdb) p *device + $3 = {parent = {g_type_instance = {g_class = 0x0}, ref_count = + 0, qdata = 0x0}, priv = 0x7feb20} + + src/mm-base-manager.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit 27e4c74c6007ceac5611f2fc4e314217ebf8d25a +Author: Ben Chan +Date: Tue Mar 28 23:23:14 2017 -0700 + + core: reset GList pointers to NULL when necessary + + When calling g_list_free_full() to free a GList in dispose(), it is + necessary to reset the GList pointer to NULL as dispose() may + be called + more than once. + + src/mm-call-list.c | 1 + + src/mm-device.c | 2 ++ + src/mm-sms-list.c | 1 + + 3 files changed, 4 insertions(+) + +commit 78e6ba5688f80ee30466ef59ed78c78e083c4c55 +Author: Ben Chan +Date: Tue Mar 28 18:35:57 2017 -0700 + + libmm-glib: remove explicit GDestroyNotify cast on g_object_unref + + g_object_unref is in form of `void (*)(gpointer)`, which matches the + GDestroyNotify signature. An explicit GDestroyNotify cast on + g_object_unref is thus not needed. + + libmm-glib/mm-modem-messaging.c | 4 ++-- + libmm-glib/mm-modem-simple.c | 2 +- + libmm-glib/mm-modem-voice.c | 4 ++-- + libmm-glib/mm-modem.c | 6 +++--- + 4 files changed, 8 insertions(+), 8 deletions(-) + +commit b225b7a2673d53b6e8dbf6a96e6459592ada6d37 +Author: Ben Chan +Date: Tue Mar 28 18:35:56 2017 -0700 + + cli: remove explicit GDestroyNotify cast on g_object_unref + + g_object_unref is in form of `void (*)(gpointer)`, which matches the + GDestroyNotify signature. An explicit GDestroyNotify cast on + g_object_unref is thus not needed. + + cli/mmcli-common.c | 30 +++++++++++++++--------------- + cli/mmcli-manager.c | 4 ++-- + 2 files changed, 17 insertions(+), 17 deletions(-) + +commit 254f2e3412ac05833cdc095558c8143ad2fbddfc +Author: Ben Chan +Date: Tue Mar 28 18:35:55 2017 -0700 + + plugins: remove explicit GDestroyNotify cast on g_free / + g_object_unref + + g_free and g_object_unref are in form of `void (*)(gpointer)`, which + matches the GDestroyNotify signature. An explicit GDestroyNotify + cast on + g_free and g_object_unref is thus not needed. + + plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++-- + plugins/cinterion/mm-broadband-modem-cinterion.c | 6 +++--- + plugins/huawei/mm-broadband-modem-huawei.c | 14 +++++++------- + plugins/icera/mm-broadband-bearer-icera.c | 2 +- + plugins/icera/mm-broadband-modem-icera.c | 6 +++--- + plugins/iridium/mm-broadband-modem-iridium.c | 2 +- + plugins/longcheer/mm-broadband-modem-longcheer.c | 2 +- + plugins/mbm/mm-broadband-bearer-mbm.c | 4 ++-- + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + plugins/mtk/mm-broadband-modem-mtk.c | 2 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 +- + plugins/option/mm-broadband-bearer-hso.c | 4 ++-- + plugins/option/mm-broadband-modem-hso.c | 6 +++--- + plugins/sierra/mm-broadband-bearer-sierra.c | 2 +- + plugins/sierra/mm-broadband-modem-sierra-icera.c | 2 +- + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + plugins/telit/mm-broadband-modem-telit.c | 2 +- + plugins/tests/test-fixture.c | 2 +- + plugins/ublox/mm-broadband-bearer-ublox.c | 4 ++-- + plugins/ublox/mm-broadband-modem-ublox.c | 2 +- + plugins/zte/mm-broadband-modem-zte.c | 2 +- + 21 files changed, 37 insertions(+), 37 deletions(-) + +commit 9823d9d6f613d33e868352328a7056809996e790 +Author: Ben Chan +Date: Tue Mar 28 18:35:54 2017 -0700 + + core: remove explicit GDestroyNotify cast on g_free / g_object_unref + + g_free and g_object_unref are in form of `void (*)(gpointer)`, which + matches the GDestroyNotify signature. An explicit GDestroyNotify + cast on + g_free and g_object_unref is thus not needed. + + src/kerneldevice/mm-kernel-device-generic-rules.c | 2 +- + src/mm-bearer-list.c | 4 ++-- + src/mm-broadband-bearer.c | 2 +- + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-qmi.c | 18 +++++++++--------- + src/mm-broadband-modem.c | 10 +++++----- + src/mm-call-list.c | 2 +- + src/mm-device.c | 4 ++-- + src/mm-iface-modem-firmware.c | 2 +- + src/mm-iface-modem-simple.c | 2 +- + src/mm-iface-modem-time.c | 2 +- + src/mm-plugin-manager.c | 10 +++++----- + src/mm-port-probe.c | 2 +- + src/mm-port-qmi.c | 4 ++-- + src/mm-sim-mbim.c | 4 ++-- + src/mm-sim-qmi.c | 10 +++++----- + src/mm-sms-list.c | 2 +- + 17 files changed, 41 insertions(+), 41 deletions(-) + +commit 3c4c983642c0d03aa6e509221930179c59aac9b6 +Author: Ben Chan +Date: Tue Mar 28 11:24:39 2017 -0700 + + base-bearer: fix typo in 'bearer-default-ip-family' property name + + src/mm-base-bearer.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6de2d84af17a88cbef509187c96d2d91a06c6914 +Author: Daniele Palmas +Date: Mon Mar 27 15:54:46 2017 +0200 + + telit: support QMI and MBIM modems + + Vendor specific plugins that support QMI or MBIM based devices need to + handle the creation of these modems themselves. + + https://bugs.freedesktop.org/show_bug.cgi?id=100372 + + Original patch by Aleksander Morgado. + + plugins/telit/77-mm-telit-port-types.rules | 3 --- + plugins/telit/mm-common-telit.c | 7 ++++++ + plugins/telit/mm-plugin-telit.c | 35 + +++++++++++++++++++++++++++++- + 3 files changed, 41 insertions(+), 4 deletions(-) + +commit eee6896648fc39922f3d3eff7190a94bd536b40d +Author: Carlo Lobrano +Date: Mon Mar 27 17:50:29 2017 +0200 + + broadband-modem: fixed wrong MEM1 value passed to +CPMS + + In functions + + - mm_broadband_modem_lock_sms_storages + - modem_messaging_set_default_storage + + return with error when using current_sms_mem1_storage as +CPMS + value, but + current_sms_mem1_storage value is UNKNOWN. + + src/mm-broadband-modem.c | 77 + +++++++++++++++++++++++++----------------- + src/mm-iface-modem-messaging.c | 2 +- + 2 files changed, 47 insertions(+), 32 deletions(-) + +commit 4c164287eba1e0655c4090e4c72b2f0f1bf4a2ac +Author: Aleksander Morgado +Date: Fri Mar 24 14:51:08 2017 +0100 + + telit: don't require udev tags to bind devices + + The vendor id/string based rules should already be enough to get the + telit plugin bind telit devices. + + This simplifies support for future Telit devices, as we wouldn't need + any additional change in the plugin. It also helps when working with + RS232 devices as the user wouldn't need to add the explicit tag to get + the devices bound to this plugin. + + https://bugs.freedesktop.org/show_bug.cgi?id=100373 + + plugins/dell/77-mm-dell-port-types.rules | 3 +-- + plugins/telit/77-mm-telit-port-types.rules | 9 --------- + plugins/telit/mm-plugin-telit.c | 6 ------ + 3 files changed, 1 insertion(+), 17 deletions(-) + +commit 15d135b9c47a0878e3c62906d33c2a5f08546ac1 +Author: Aleksander Morgado +Date: Fri Mar 24 14:55:36 2017 +0100 + + base-bearer: stop connection status monitoring if no TTY available + + On modems with a single TTY for both control and data, we cannot use + the TTY to load connection status once we're in connected mode: + + Connection through a plain serial AT port (ttyUSB2) + (ttyUSB2): --> 'ATD*99***2#' + (ttyUSB2): <-- 'CONNECT 100000000' + (ttyUSB2): port now connected + Connected bearer '/org/freedesktop/ModemManager1/Bearer/0' + Modem /org/freedesktop/ModemManager1/Modem/0: state changed + (connecting -> connected) + Simple connect state (8/8): All done + checking if connected failed: Couldn't check current list of + active PDP contexts: No AT port available to run command + checking if connected failed: Couldn't check current list of + active PDP contexts: No AT port available to run command + checking if connected failed: Couldn't check current list of + active PDP contexts: No AT port available to run command + ... + + So, disable connection monitoring right away if that situation is + detected: + + Connection through a plain serial AT port (ttyUSB2) + (ttyUSB2): --> 'ATD*99***2#' + (ttyUSB2): <-- 'CONNECT 100000000' + (ttyUSB2): port now connected + Connected bearer '/org/freedesktop/ModemManager1/Bearer/0' + Modem /org/freedesktop/ModemManager1/Modem/0: state changed + (connecting -> connected) + Simple connect state (8/8): All done + Connection monitoring is unsupported by the device + ... + + https://bugs.freedesktop.org/show_bug.cgi?id=100376 + + src/mm-base-bearer.c | 20 ++++++++++++++++++-- + src/mm-broadband-bearer.c | 41 ++++++++++++++++++++++++++++------------- + 2 files changed, 46 insertions(+), 15 deletions(-) + +commit dd1e281e82726bcf3349a776da53c4158b088724 +Author: Aleksander Morgado +Date: Fri Mar 24 15:03:08 2017 +0100 + + broadband-bearer: set TTY as connected as soon as ATD replies + + When the connection request is done via ATD, flag the port as + connected as soon as the successful response is received, so that we + remove our polling on the device right away. + + https://bugs.freedesktop.org/show_bug.cgi?id=99541 + + src/mm-broadband-bearer.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +commit bc4cbbe6cfda7b884084d888cf271759816e931f +Author: Aleksander Morgado +Date: Wed Mar 8 12:18:23 2017 +0100 + + broadband-modem: fix capabilities in 4G-only devices + + The +CGSM capability is saying that the modem is a 3GPP modem, but + that doesn't necessarily mean it's a GSM/UMTS modem, it could be a + LTE-only device. + + We did add the GSM_UMTS capability when +CGSM was found, so now we'll + check if the device only reports 4G-only mode, and remove the + capability if so. + + https://bugs.freedesktop.org/show_bug.cgi?id=100155 + + src/mm-broadband-modem.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit 16009114397a75d6e511942a6bd9fc74ea8a0d3f +Author: Aleksander Morgado +Date: Wed Mar 8 12:17:55 2017 +0100 + + broadband-modem,helpers: implement AT+WS46=? response parser + + We want a parser that returns the full list of combinations found. + + src/mm-broadband-modem.c | 111 ++++++++++++-------------------- + src/mm-modem-helpers.c | 143 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 3 + + src/tests/test-modem-helpers.c | 102 +++++++++++++++++++++++++++++ + 4 files changed, 290 insertions(+), 69 deletions(-) + +commit dc01a30c2f87e41780a0b4098f535822462999a7 +Author: Riccardo Vangelisti +Date: Fri Mar 24 15:35:25 2017 +0100 + + huawei: ignore unsolicited message ^EONS + + plugins/huawei/mm-broadband-modem-huawei.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 11a26f10668659fb0c043ec9bc88debacce8cab1 +Author: Aleksander Morgado +Date: Fri Mar 3 23:28:46 2017 +0100 + + serial: allow specifying baudrate to use via udev tags + + A new 'ID_MM_TTY_BAUDRATE' per-port udev tag is introduced, which + allows specifying the baudrate that will be used when opening a + specific serial port. + + E.g.: + + ACTION!="add|change|move", GOTO="mm_my_modem_end" + DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/*", + ENV{ID_MM_TTY_BAUDRATE}="115200" + LABEL="mm_my_modem_end" + + https://bugs.freedesktop.org/show_bug.cgi?id=100158 + + src/mm-base-modem.c | 6 +++ + src/mm-port-probe.c | 10 +++++ + src/mm-port-serial.c | 118 + ++++++++++----------------------------------------- + 3 files changed, 39 insertions(+), 95 deletions(-) + +commit 00fb9e98f6003f6b167f7d12a895ec3d1402b027 +Author: Aleksander Morgado +Date: Mon Mar 6 12:01:56 2017 +0100 + + kernel-device: device-specific properties in either port or physdev + + There are 2 main types of udev properties: device-specific and + port-specific. + + The port-specific properties are set independently per port (e.g. port + type hints set per interface number for a given vid:pid). + + The device-specific properties apply to all ports in the device. Some + of these properties are currently expected in the physical device + (e.g. ID_MM_PLATFORM_DRIVER_PROBE) while some others are expected in + each port (e.g. the plugin udev tag filters). + + This patch tries to simplify the logic and just assume that the device + specific tags may be given in either the physical device or the port + device, by providing separate APIs to retrieve port-specific or + device-specific (global) properties. If the same tag is given in both + the device and the port, the one in the device takes preference. + + For the generic backend, these new APIs are really useless, as all + device-specific and port-specific properties are always stored in the + port object themselves (there is no 'tree' of devices in the generic + backend, no 'physdev' device). + + For the udev backend, though, there really is a difference, as the + tags may be set in port or device. + + https://bugs.freedesktop.org/show_bug.cgi?id=100156 + + plugins/dell/mm-plugin-dell.c | 2 +- + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + plugins/huawei/mm-plugin-huawei.c | 2 +- + plugins/simtech/mm-plugin-simtech.c | 2 +- + plugins/telit/mm-common-telit.c | 2 +- + plugins/zte/mm-plugin-zte.c | 2 +- + src/kerneldevice/mm-kernel-device-generic.c | 7 ++ + src/kerneldevice/mm-kernel-device-udev.c | 160 + ++++++++++++++++++++++------ + src/kerneldevice/mm-kernel-device.c | 55 ++++++++++ + src/kerneldevice/mm-kernel-device.h | 14 +++ + src/mm-plugin.c | 4 +- + 11 files changed, 213 insertions(+), 39 deletions(-) + +commit 230e732a24e0e925f535839caecc4a69d89ab89e +Author: Dan Williams +Date: Fri Mar 17 13:02:57 2017 -0500 + + iface-modem-3gpp: use mm_3gpp_parse_operator_id() instead of + custom code + + src/mm-iface-modem-3gpp.c | 43 + ++++++++----------------------------------- + 1 file changed, 8 insertions(+), 35 deletions(-) + +commit 9384817a14c8706909f619e773a76edd65a0fdef +Author: Aleksander Morgado +Date: Wed Mar 15 00:03:35 2017 +0100 + + telit: lock/unlock CSIM operations by default + + Wrap the AT+CSIM=XX commands between lock (CSIM=1) and + unlock (CSIM=0) operations. + + This seems to avoid the TTY lockup seen in several different Telit + modules. + + https://bugs.freedesktop.org/show_bug.cgi?id=100205 + + Reported-by: Penalva, Salvador + + plugins/telit/mm-broadband-modem-telit.c | 69 + +++++++++++++++++++++++++++++++- + 1 file changed, 68 insertions(+), 1 deletion(-) + +commit 8664b2a38ac71428a5bbc3d89fbef3f68aea6430 +Author: Aleksander Morgado +Date: Tue Mar 7 12:37:42 2017 +0100 + + telit: support RS232 modems + + Adding the vendor string match allows us to support RS232 devices in + the Telit plugin: the USB vendor id check may now be ignored and + instead we probe for the vendor string via AT commands, which works + even if the device is behind a USB<->RS232 adapter. + + https://bugs.freedesktop.org/show_bug.cgi?id=100171 + + plugins/telit/mm-plugin-telit.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 60be293fa57a3d3f6db1d1ae064d42af320f84e0 +Author: Aleksander Morgado +Date: Mon Mar 6 13:56:19 2017 +0100 + + telit: don't ignore AT ports without an explicit port type hint tag + + The telit plugin is based on two main ways of checking the purpose of + each port: udev tags flagging specific interfaces (with info taken + from Windows .inf drivers), or otherwise using AT#PORTCFG? to query + the modem about that information. If none of those applies, the port + is ignored by default. + + In order to support devices that are not explicitly tagged, the plugin + shouldn't flag as ignored the AT-capable TTYs, instead they are now + grabbed as 'secondary': ports grabbed as secondary will never be used + for either primary/data IF there is another port flagged explicitly + for primary/data. + + This fixes the support for modems with a single TTY and no explicit + port type hint tag, e.g. RS232 modems with just one single TTY where + there's no point in specifying port type hints: the port will be + grabbed as secondary, and then automatically promoted to primary/data + as there is no other port grabbed. + + https://bugs.freedesktop.org/show_bug.cgi?id=100159 + + plugins/telit/mm-common-telit.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit 875ade3e41b61528bbd2b018a5d34c1a1cda9b99 +Author: Aleksander Morgado +Date: Tue Mar 7 11:12:51 2017 +0100 + + iface-modem: improve network registration checks for LTE devices + + If a device reports "LTE" in the list of current capabilities, we'll + set EPS network supported by default. This will enable CEREG + registration checks for AT based devices. + + If a device reports only "LTE" in the list of current capabilities, we + disable all the other network support flags (e.g. will disable CREG + and CGREG checks among others). + + https://bugs.freedesktop.org/show_bug.cgi?id=100170 + + src/mm-iface-modem.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 957195469ed1eaf6f48b3a70c5d386c5310ec06e +Author: Aleksander Morgado +Date: Mon Mar 13 09:55:04 2017 +0100 + + build: bump libqmi required version to 1.17.900 + + Since we process the WDS Event Report Indication messages, we need + libqmi from git master, so we bump the required version to the first + tag that contains those QMI messages. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e9d0989ed069b2b6f3deea438ef390998286601f +Author: Aleksander Morgado +Date: Mon Mar 6 15:01:21 2017 +0100 + + base-manager: remove MMDevice if support check fails + + If the device support check fails, either with an error, or afterwards + when trying to create a modem object, we must remove the MMDevice from + the tracking table of devices, so that a manual scan request + afterwards re-scans all ports. + + https://bugs.freedesktop.org/show_bug.cgi?id=100157 + + src/mm-base-manager.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 355633f8d6eceb6ef2de9fbca21f0eb2010fc047 +Author: Aleksander Morgado +Date: Wed Mar 8 14:09:50 2017 +0100 + + docs: update copyright year to 2017 + + docs/reference/api/ModemManager-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + 2 files changed, 2 insertions(+) + +commit c1d04f4cc03710cd213aa8ebc85f05ecc6ba62ea +Author: Aleksander Morgado +Date: Tue Mar 7 17:39:42 2017 +0100 + + cinterion: improve ^SCFG=? response parser to handle EHS5 format + + Two main changes in the regex: + * Ignore double quotes around interval numbers. + * Ignore second set of values (i.e. the one after the comma), as it + may not even be given). + + We now support at least these two formats: + ^SCFG: "Radio/Band",("1-511","0-1") + ^SCFG: "Radio/Band\",("1"-"147") + + Reported-by: Colin Helliwell + + plugins/cinterion/mm-modem-helpers-cinterion.c | 3 +- + .../cinterion/tests/test-modem-helpers-cinterion.c | 69 + ++++++++++++++++++++++ + 2 files changed, 71 insertions(+), 1 deletion(-) + +commit 73bfe94643eab39ef43a5023c482340ac9b882dc +Author: Ben Chan +Date: Fri Mar 3 10:29:50 2017 -0800 + + device: add null check on `self->priv->modem' in clear_modem + + clear_modem() can be invoked from set_property() and dispose(), where + `self->priv->modem' may be NULL. This patch adds a null check on the + modem object to make sure we don't run g_object_run_dispose() on + a null + modem object. + + src/mm-device.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit f0cda2093078d630ca164b3872f742609e091a20 +Author: Ben Chan +Date: Thu Mar 2 18:57:14 2017 -0800 + + kernel-device: use device sysfs if physdev sysfs isn't available + + find_device_by_physdev_uid() expects a non-NULL UID of the physical + device. However, mm_kernel_device_get_physdev_uid() could potentially + return NULL on MMKernelDeviceUdev if find_physical_gudevdevice() in + mm-kernel-device-udev.c fails to find the physical device. When a NULL + physical device UID is passed to find_device_by_physdev_uid() and used + in g_hash_table_lookup(), it leads to a crash in g_str_hash(), + which is + a bit obscure. + + This patch updates kernel_device_get_physdev_uid() in + mm-kernel-device-udev.c to fall back to use the device sysfs if the + physical device sysfs isn't available, which is similar to how + kernel_device_get_physdev_uid() mm-kernel-device-generic.c is + implemented. + + src/kerneldevice/mm-kernel-device-udev.c | 27 ++++++++++++++++----------- + 1 file changed, 16 insertions(+), 11 deletions(-) + +commit 8c3312918adf8ba49bb242cd21b306d3a7ff3a09 +Author: Dan Williams +Date: Tue Oct 4 07:23:43 2016 -0500 + + bearer-qmi: add WDS event reporting support + + Don't do anything with the events yet, but at least turn them on + and capture them in debug logging. + + src/mm-bearer-qmi.c | 252 + ++++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 216 insertions(+), 36 deletions(-) + +commit 7a048acd4496adc5a973ba40b35dff635b832e4f +Author: Aleksander Morgado +Date: Wed Mar 1 18:43:45 2017 +0100 + + broadband-modem-mbim: disable parent access tech loading + + The parent method would use QCDM to load access tech, but we already + have the access tech reported in MBIM via indications, so no real need + to mix that. + + For context, see: + https://bugs.freedesktop.org/show_bug.cgi?id=100000 + + src/mm-broadband-modem-mbim.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f10065d03c3b9e8543244f1f35e71044795a8a2c +Author: Ben Chan +Date: Thu Feb 23 11:45:29 2017 -0800 + + kernel-device: simplify handling of platform/pci/pnp/sdio parent + + This patch simplifies the handling of platform/pci/pnp/sdio device in + find_physical_gudevdevice(). When the code finds the first parent + device + under the subsystem 'platform', 'pci', 'pnp', or 'sdio', it stops + traversing up the device tree, so there is no need to keep track of + whether a platform / pci / pnp / sdio device has previously been + visited + via those is_platform/is_pci/is_pnp/is_sdio Boolean variables. + + src/kerneldevice/mm-kernel-device-udev.c | 23 ++++++----------------- + 1 file changed, 6 insertions(+), 17 deletions(-) + +commit 66b3367cf87e636f49f1e89c3f7645c7826d5eb2 +Author: Ben Chan +Date: Tue Feb 28 18:49:13 2017 -0800 + + kernel-device: handle SDIO device in find_physical_gudevdevice + + A few crashes have been observed in the field with the following + signature: + + Thread 0 CRASHED [SIGSEGV @ 0x00000000 ] MAGIC SIGNATURE THREAD + 0xf53ff5e8 (libglib-2.0.so.0.3600.4 -ghash.c:1732 ) g_str_hash + 0xf53fe8c7 (libglib-2.0.so.0.3600.4 -ghash.c:365 ) + g_hash_table_lookup + 0xb953c3bd (ModemManager -mm-base-manager.c:130 ) device_removed + 0xb953cc9f (ModemManager -mm-base-manager.c:408 ) handle_uevent + 0xf54c535f (libgobject-2.0.so.0.3600.4 -gclosure.c:777 ) + g_closure_invoke + 0xf54d6fc7 (libgobject-2.0.so.0.3600.4 -gsignal.c:3584 ) + signal_emit_unlocked_R + 0xf54d7baf (libgobject-2.0.so.0.3600.4 -gsignal.c:3328 ) + g_signal_emit_valist + 0xf54d7fa5 (libgobject-2.0.so.0.3600.4 -gsignal.c:3384 ) + g_signal_emit + 0xf5623819 (libgudev-1.0.so.0.2.0 -gudevclient.c:104 ) + monitor_event + 0xf540cc51 (libglib-2.0.so.0.3600.4 -gmain.c:3054 ) + g_main_context_dispatch + 0xf540cfa5 (libglib-2.0.so.0.3600.4 -gmain.c:3701 ) + g_main_context_iterate + 0xf540d2c5 (libglib-2.0.so.0.3600.4 -gmain.c:3895 ) + g_main_loop_run + 0xb9539dad (ModemManager -main.c:180 ) main + 0xf52d687d (libc-2.23.so -libc-start.c:289 ) __libc_start_main + 0xb9539bf3 (ModemManager + 0x0001cbf3 ) _start + 0xb95b0fbf (ModemManager -elf-init.c:87 ) __libc_csu_init + 0xf56dbe43 (ld-2.23.so + 0x0000be43 ) _dl_sort_fini + 0xb9539bbf (ModemManager + 0x0001cbbf ) _init + + The crash happens when + mm-kernel-device-udev.c:find_physical_gudevdevice() + fails to find the physical device, which eventually leads to a NULL + `physdev_uid' being passed to g_hash_table_lookup() in + mm-base-manager.cc:find_device_by_physdev_uid(). + + There isn't much information about the actual device that triggered + the + udev event, but it's suspected to be a tty or net device on a SDIO bus + and thus associated with a physical device on the 'sdio' + subsystem. This + patch updates find_physical_gudevdevice() in mm-kernel-device-udev.c + to + handle this particular scenario. + + src/kerneldevice/mm-kernel-device-udev.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit bf27e44caf7c7868e139e58e510c307770074171 +Author: Dan Williams +Date: Tue Feb 28 13:38:16 2017 -0600 + + broadband-modem: fix QCDM access tech reporting for WCDMA system modes + + Two issues here: + + 1) PCH_SLEEP wasn't considered a "wcdma_open" state, but it should be + since the modem is still registered and can be attached in this state + + 2) If the system mode is WCDMA (eg, not GSM and not GSM/WCDMA) then + MM shouldn't assume GPRS if WCDMA isn't "open", since GPRS isn't + enabled in WCDMA-only mode + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100000 + + src/mm-broadband-modem.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit cec01fdaf67a7973a4bb1691baeb31fb0cf7ec2f +Author: Dan Williams +Date: Tue Feb 28 13:30:56 2017 -0600 + + libqcdm: fix WCDMA L1 Manager states + + The enum was wrong. There isn't actually an L1M_INIT state; the + enum should start with L1M_IDLE. There should also be a + L1M_PCH_SLEEP state between DEACTIVATE and DEEP_SLEEP. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100000 + + libqcdm/src/commands.h | 20 +++++++++++--------- + libqcdm/tests/test-qcdm-com.c | 12 +++++++++--- + 2 files changed, 20 insertions(+), 12 deletions(-) + +commit 21f315f6d554b93e4f098cfd0e94c484a8a0c5dc +Author: Aleksander Morgado +Date: Tue Feb 28 11:13:04 2017 +0100 + + broadband-modem-qmi: FCC auth if InvalidTransition when going online + + https://bugs.freedesktop.org/show_bug.cgi?id=100001 + + src/mm-broadband-modem-qmi.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +commit 40e6fa48c4d43069ced8cd9bc7206d3554b6e72a +Author: Aleksander Morgado +Date: Wed Feb 15 10:10:51 2017 +0100 + + build: make sure subdir exists before running glib-mkenums + + Reported-by: Colin Helliwell + + configure.ac | 1 + + plugins/Makefile.am | 22 +++++++++++++--------- + 2 files changed, 14 insertions(+), 9 deletions(-) + +commit 37df2643d2334a8ed8b9774396fcd2567a68a6de +Author: Aleksander Morgado +Date: Tue Feb 14 19:46:26 2017 +0100 + + cinterion: improve ^SMONG response parser: + + * Allow whitespaces prefixing the values row. + * Allow more than one \r\n between the title and the table header. + + Reported-by: Colin Helliwell + + plugins/cinterion/mm-broadband-modem-cinterion.c | 87 + +++------------------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 77 + +++++++++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 8 ++ + .../cinterion/tests/test-modem-helpers-cinterion.c | 43 +++++++++++ + 4 files changed, 137 insertions(+), 78 deletions(-) + +commit 97eb23a964046abd0724d6fff6d3816f4ab3e220 +Author: Aleksander Morgado +Date: Tue Feb 14 09:44:21 2017 +0100 + + cinterion: fix 'ds' setting in CNMI command builder + + Reported-by: Colin Helliwell + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1d41685f487a7d84846826d99fc99e3461ffce37 +Author: Aleksander Morgado +Date: Mon Feb 13 15:03:20 2017 +0100 + + device: disconnect signal handlers when modem object removed + + Don't rely on the automatic disconnection of the signal as the last + reference of the modem object may outlive the device object. + + Also, setup a common clear_modem() function to dispose the internal + reference of the modem object, which will take care of the signal + disconnection when required. + + https://lists.freedesktop.org/archives/modemmanager-devel/2017-February/003907.html + + src/mm-device.c | 34 +++++++++++++++++++++++----------- + 1 file changed, 23 insertions(+), 11 deletions(-) + +commit 421713208bc3212d153906ad231a2e4b6b5ce6de +Author: Aleksander Morgado +Date: Mon Feb 13 10:42:06 2017 +0100 + + cinterion: support number ranges in CNMI=? parser + + https://lists.freedesktop.org/archives/modemmanager-devel/2017-February/003911.html + + plugins/cinterion/mm-modem-helpers-cinterion.c | 109 + +++++++-------------- + .../cinterion/tests/test-modem-helpers-cinterion.c | 50 ++++++++++ + 2 files changed, 88 insertions(+), 71 deletions(-) + +commit 91613543d595f8d345a8725746b6f77a821173a8 +Author: Aleksander Morgado +Date: Wed Feb 8 18:27:54 2017 +0100 + + libmm-glib: set clear func by default in the MMModemPortInfo array + + So that we don't leak the port names allocated within each + MMModemPortInfo. + + ==261== 672 bytes in 84 blocks are definitely lost in loss record + 7,314 of 7,383 + ==261== at 0x402C51E: malloc (vg_replace_malloc.c:299) + ==261== by 0x4484878: g_malloc (gmem.c:94) + ==261== by 0x449D51D: g_strdup (gstrfuncs.c:363) + ==261== by 0x44B5B73: g_variant_dup_string (gvariant.c:1529) + ==261== by 0x44B945E: g_variant_valist_get_nnp (gvariant.c:4775) + ==261== by 0x44B945E: g_variant_valist_get_leaf (gvariant.c:4945) + ==261== by 0x44B945E: g_variant_valist_get (gvariant.c:5126) + ==261== by 0x44B922C: g_variant_valist_get (gvariant.c:5161) + ==261== by 0x44B9FC9: g_variant_get_va (gvariant.c:5388) + ==261== by 0x44BA3C5: g_variant_get_child (gvariant.c:5486) + ==261== by 0x6613FA8: mm_common_ports_variant_to_garray + (mm-common-helpers.c:238) + ==261== by 0x6601AB9: ensure_internal_ports (mm-modem.c:766) + ==261== by 0x6603E42: mm_modem_peek_ports (mm-modem.c:825) + ==261== by 0x65CD94D: owns_port (nm-modem-broadband.c:196) + + Reported-by: Piotr Figiel + + libmm-glib/mm-common-helpers.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 5a8620d984eb3ca9632b6d63f625ffb5c522716e +Author: Aleksander Morgado +Date: Wed Feb 8 18:26:39 2017 +0100 + + cli: minor indentation fix + + cli/mmcli.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 255e4c769bb4c807f64ce0ed699d62bc88b5b670 +Author: Piotr Figiel +Date: Wed Feb 8 18:18:46 2017 +0100 + + libmm-glib: fix leaking bearer_path string + + ==261== 482 bytes in 12 blocks are definitely lost in loss record + 7,290 of 7,383 + ==261== at 0x402C51E: malloc (vg_replace_malloc.c:299) + ==261== by 0x4484878: g_malloc (gmem.c:94) + ==261== by 0x449D51D: g_strdup (gstrfuncs.c:363) + ==261== by 0x44B5B73: g_variant_dup_string (gvariant.c:1529) + ==261== by 0x44B945E: g_variant_valist_get_nnp (gvariant.c:4775) + ==261== by 0x44B945E: g_variant_valist_get_leaf (gvariant.c:4945) + ==261== by 0x44B945E: g_variant_valist_get (gvariant.c:5126) + ==261== by 0x44B922C: g_variant_valist_get (gvariant.c:5161) + ==261== by 0x44B9FC9: g_variant_get_va (gvariant.c:5388) + ==261== by 0x44BA1DB: g_variant_get (gvariant.c:5335) + ==261== by 0x664E2EF: mm_gdbus_modem_simple_call_connect_finish + (mm-gdbus-modem.c:22451) + ==261== by 0x6608A08: simple_connect_ready (mm-modem-simple.c:154) + ==261== by 0x429136F: g_task_return_now (gtask.c:1107) + ==261== by 0x4291A69: g_task_return (gtask.c:1165) + + libmm-glib/mm-modem-simple.c | 1 + + 1 file changed, 1 insertion(+) + +commit 0ea4b09fd64b7c50bf86b94a5ff5114b04ebc766 +Author: Maksim Salau +Date: Sat Feb 4 23:23:15 2017 +0300 + + blacklist: add promotion boards from Renesas + + Signed-off-by: Maksim Salau + + src/77-mm-usb-device-blacklist.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 31655bb5a5e2c806cee23b9ee41c2e663c5decbd +Author: Ben Chan +Date: Thu Feb 2 16:45:01 2017 -0800 + + glib: remove invocations of g_type_init() + + g_type_init() has been deprecated (and also marked with the attribute + 'deprecated') since glib 2.36 as the type system is automatically + initialized. Since the minimum version of glib required by + ModemManager + is 2.36, calling g_type_init() isn't necessarily in the ModemManager + code. + + cli/mmcli.c | 2 -- + libmm-glib/tests/test-common-helpers.c | 1 - + plugins/altair/tests/test-modem-helpers-altair-lte.c | 1 - + plugins/cinterion/tests/test-modem-helpers-cinterion.c | 1 - + plugins/generic/tests/test-service-generic.c | 1 - + plugins/huawei/tests/test-modem-helpers-huawei.c | 1 - + plugins/icera/tests/test-modem-helpers-icera.c | 1 - + plugins/linktop/tests/test-modem-helpers-linktop.c | 1 - + plugins/mbm/tests/test-modem-helpers-mbm.c | 1 - + plugins/telit/tests/test-mm-modem-helpers-telit.c | 1 - + plugins/tests/test-udev-rules.c | 1 - + plugins/thuraya/tests/test-mm-modem-helpers-thuraya.c | 1 - + plugins/ublox/tests/test-modem-helpers-ublox.c | 1 - + src/main.c | 2 -- + src/tests/test-at-serial-port.c | 1 - + src/tests/test-modem-helpers-qmi.c | 1 - + src/tests/test-modem-helpers.c | 1 - + src/tests/test-qcdm-serial-port.c | 3 --- + src/tests/test-sms-part-3gpp.c | 1 - + src/tests/test-sms-part-cdma.c | 1 - + src/tests/test-udev-rules.c | 1 - + test/lsudev.c | 2 -- + test/mmrules.c | 2 -- + test/mmtty.c | 2 -- + 24 files changed, 31 deletions(-) + +commit f20f2d04282f673cebc2ce9262c5b10adab82fa2 +Author: Aleksander Morgado +Date: Tue Jan 31 00:43:22 2017 +0100 + + blacklist: add Analog PlutoSDR + + Reported-by: Robin Getz + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit ab48dc5b17f90f12e82ccdd58a40d137858e1490 +Author: Dan Williams +Date: Sat Jan 28 21:54:13 2017 -0600 + + telit: add LTE access technology reporting + + plugins/telit/mm-broadband-modem-telit.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit ef8cc2912499ac82b9875f4d6f8b90cfe4b23cd5 +Author: Aleksander Morgado +Date: Thu Jan 26 17:29:43 2017 +0100 + + serial: minor indentation fix + + src/mm-port-serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3de34e94ccd066aa7540dc4f32a17776a110b579 +Author: Aleksander Morgado +Date: Thu Jan 26 14:36:02 2017 +0100 + + serial: fix handling errors in virtual serial ports + + The g_socket_receive() method returns a signed size variable, so don't + use an unsigned variable to hold the result. + + src/mm-port-serial.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +commit c8ec731043d6dc8429597062254dc669cae4ff5c +Author: Ben Chan +Date: Mon Jan 23 23:08:15 2017 -0800 + + ublox: fix uninitialized variable issue + + This patch fixes an uninitialized variable issue in + mm_ublox_parse_ugcntrd_response_for_cid(), which uses an uninitialized + `match_info' when `in_cid' is invalid. + + plugins/ublox/mm-modem-helpers-ublox.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4e5d8d7e8c0ce16e31d3c98710361eed1cf9f87c +Author: Ben Chan +Date: Mon Jan 23 23:07:57 2017 -0800 + + bearer-qmi: fix incorrect use of mm_base_bearer_get_status + + This patch fixes a bug in packet_service_status_indication_cb(), which + incorrectly treats the MMBearerStatus enum value returned by + mm_base_bearer_get_status() as a MMBearerConnectionStatus enum value. + MMBearerStatus and MMBearerConnectionStatus can't be used + interchangeably as they have different enum values for the + 'disconnected' and 'disconnecting' state. + + src/mm-bearer-qmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4a80c2416962626750696cb744da3a51e7b8f831 +Author: Ben Chan +Date: Wed Jan 11 22:29:08 2017 -0800 + + telit: use g_assert instead of g_assert_true / g_assert_false + + `g_assert_true' and `g_assert_false' are defined in glib 2.38 + or later. + The minimum glib version currently required by ModemMamanger is 2.36. + While `g_assert_true' and `g_assert_false' may be preferred over the + more generic `g_assert', it seems like overkill to bump the minimum + glib + version requirement just for that. When more code in ModemManager + later + requires newer versions of glib, we can migrate all existing code + to use + `g_assert_true' and `g_assert_false' when appropriate. + + plugins/telit/tests/test-mm-modem-helpers-telit.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 11297bcc7914f49ae79b450e6582f0cc61fd178f +Author: Aleksander Morgado +Date: Wed Dec 14 13:54:47 2016 +0100 + + cinterion: implement connection status monitoring via ^SWWAN? + + And consolidate the connection status checks done during connection + and + disconnection so that we re-use the same logic. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 179 + ++++++++++++++------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 36 +++-- + plugins/cinterion/mm-modem-helpers-cinterion.h | 16 +- + .../cinterion/tests/test-modem-helpers-cinterion.c | 60 +++---- + 4 files changed, 181 insertions(+), 110 deletions(-) + +commit 9f725bc96a0e0aa67440694799371f05c11bd74d +Author: Aleksander Morgado +Date: Wed Dec 14 13:54:04 2016 +0100 + + cinterion: default to PAP if no auth explicitly given + + This is the same logic used in other implementations (e.g. QMI). + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 41 + +++++++++++++---------- + 1 file changed, 23 insertions(+), 18 deletions(-) + +commit af2d6c1c4b7f815862313bf0f84b1ff0e91ccd60 +Author: Aleksander Morgado +Date: Tue Dec 13 12:29:21 2016 +0100 + + cinterion: don't use predefined CIDs + + The suggestion to use specific PDP context CIDs was given by Cinterion + for the special case of the Verizon operator, which 'reserves' + specific + CIDs for specific purposes. + + We don't want to impose that at the Cinterion plugin level, so remove + the PDP context mapping we had. + + Therefore, simplify the connection procedure by just overriding the + 'dialing' step of the default 3GPP connection sequence, instead of + overriding the whole connection sequence. + + Also, we don't need to override the step to gather IP config because + this is already handled by the generic plugin (for DHCP over a network + interface). + + We port to GTask for both 3GPP dial and 3GPP disconnect at the + same time. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 457 + ++++++++++------------ + 1 file changed, 196 insertions(+), 261 deletions(-) + +commit 7d576a084ca5ee53f163f87e18b0b1ab021c4075 +Author: Aleksander Morgado +Date: Mon Nov 28 17:24:38 2016 +0100 + + cinterion: fix typo in comment + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1919138c68d5f91c1fe49daf3eddce653f6d4aa8 +Author: Aleksander Morgado +Date: Thu Nov 24 11:37:10 2016 +0100 + + cinterion: don't check for ^SWWAN support during enabling + + Better check for ^SWWAN support during the first time a bearer + is going + to be created. + + The enabling phase isn't the correct one because this logic is + only run + whenever a modem is detected but not hotplugged (i.e. this step is to + 'reset' the modem to generic runtime settings). + + plugins/cinterion/mm-broadband-modem-cinterion.c | 150 + ++++++++--------------- + 1 file changed, 49 insertions(+), 101 deletions(-) + +commit 9ca3fde06bc920e2fc15127888dbbfe731a73a56 +Author: Aleksander Morgado +Date: Thu Nov 24 11:25:02 2016 +0100 + + cinterion: minor coding style fixes + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 18 ++++++------- + plugins/cinterion/mm-broadband-bearer-cinterion.h | 17 ++++++------ + plugins/cinterion/mm-broadband-modem-cinterion.c | 33 + +++++++++++------------ + 3 files changed, 33 insertions(+), 35 deletions(-) + +commit 37521ed2b611bdccd288cabc5fc4e48c51a32e49 +Author: Aleksander Morgado +Date: Thu Nov 24 01:53:11 2016 +0100 + + cinterion: simplify ^SWWAN response parsing + + We get as input the ^SWWAN index we're interested in, and we loop + through the list of ^SWWAN lines looking for the one we need. + + This updated helper method allows working with multi-line ^SWWAN + responses, e.g. given when more than one PDP context is active. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 98 +++----- + plugins/cinterion/mm-modem-helpers-cinterion.c | 134 +++++----- + plugins/cinterion/mm-modem-helpers-cinterion.h | 14 +- + .../cinterion/tests/test-modem-helpers-cinterion.c | 270 + +++++++++++---------- + 4 files changed, 254 insertions(+), 262 deletions(-) + +commit dc96829bb5a49216e45e770f249f29e725ce97ad +Author: Aleksander Morgado +Date: Thu Nov 24 01:15:39 2016 +0100 + + cinterion: no need for private struct + + The only member in the private network isn't even used. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 34 + ----------------------- + plugins/cinterion/mm-broadband-bearer-cinterion.h | 2 -- + 2 files changed, 36 deletions(-) + +commit f7ca0124b0a1d5013c1f0fd6f9e5b182d6cdef60 +Author: Aleksander Morgado +Date: Thu Nov 24 10:31:15 2016 +0100 + + cinterion: rework 3GPP connection sequence + + Group together all connection related logic (e.g. context) and define + the context steps directly within the connection sequence processing. + + Also, don't initially run a disconnection before the connection; + if that + logic is ever needed we should likely have it in the generic modem, + not + done per plugin. + + And error out early if not asking for IPv4. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 521 + ++++++++++------------ + 1 file changed, 227 insertions(+), 294 deletions(-) + +commit 955b46daf96c841a6ffbccc80f73e7d852c430d7 +Author: Aleksander Morgado +Date: Thu Nov 24 00:23:48 2016 +0100 + + cinterion: rework 3GPP disconnection sequence + + Group together all disconnection related logic (e.g. context) + and define + the context steps directly within the disconnection sequence + processing. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 237 + ++++++++++------------ + 1 file changed, 111 insertions(+), 126 deletions(-) + +commit 6721c83d073d1a3ae8c0037d69211cf02388bb49 +Author: Aleksander Morgado +Date: Wed Nov 23 23:54:41 2016 +0100 + + cinterion: use BearerCinterionAuthType when possible + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit d50059ead40d9e6c18d4ff5cd8daaf2cea965d74 +Author: Aleksander Morgado +Date: Wed Nov 23 23:42:46 2016 +0100 + + cinterion: setup per-interface configuration settings + + Define the relationship between PDP context, SWWAN index and USB + interface number in one single place. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 196 + ++++++++++++---------- + 1 file changed, 103 insertions(+), 93 deletions(-) + +commit 938a53e7c64751d045e9fe1b11f9de774f3878f3 +Author: Aleksander Morgado +Date: Wed Nov 23 23:02:29 2016 +0100 + + cinterion: fix coding style for enum values + + The enum values are given in UPPER_CASE format, not in CamelCase. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 74 + +++++++++++------------ + plugins/cinterion/mm-broadband-modem-cinterion.c | 16 ++--- + 2 files changed, 45 insertions(+), 45 deletions(-) + +commit ef50c085f9a96db3297de982e24015e574b3b0e6 +Author: Aleksander Morgado +Date: Wed Nov 23 22:53:59 2016 +0100 + + base-modem,cinterion: no need for a peek_current_data_port() method + + We already get the data port given as input parameter in + disconnect_3gpp(), so there is no point in trying to find out + which the + data port is. + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 19 + ++----------------- + src/mm-base-modem.c | 20 + -------------------- + src/mm-base-modem.h | 1 - + 3 files changed, 2 insertions(+), 38 deletions(-) + +commit 1ffcb163493edf82bc7102b028450fca40b4dddd +Author: Matthew Stanger +Date: Sun Oct 23 19:28:19 2016 -0600 + + cinterion: implement support for the new SWWAN interface + + AUTHORS | 1 + + plugins/Makefile.am | 2 + + plugins/cinterion/mm-broadband-bearer-cinterion.c | 902 + +++++++++++++++++++++ + plugins/cinterion/mm-broadband-bearer-cinterion.h | 57 ++ + plugins/cinterion/mm-broadband-modem-cinterion.c | 229 +++++- + plugins/cinterion/mm-modem-helpers-cinterion.c | 81 ++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 7 + + .../cinterion/tests/test-modem-helpers-cinterion.c | 135 +++ + src/mm-base-modem.c | 20 + + src/mm-base-modem.h | 1 + + 10 files changed, 1434 insertions(+), 1 deletion(-) + +commit 2f12d96fe44f867eb7f9f1941dfe362837ccd351 +Author: Aleksander Morgado +Date: Wed Jan 4 13:44:12 2017 +0100 + + libmm-glib,modem: init/clear ports mutex + + libmm-glib/mm-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 094fea5392c21beeaf7c06b43e19eccde6af35f5 +Author: Thomas Haller +Date: Wed Jan 4 13:15:31 2017 +0100 + + libmm-glib: fix memleak of MMModem's ports + + Fixes: 3206e9566392e8a9678bbd49e0de9bb21ed75291 + + libmm-glib/mm-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 61dc32a72ce5bb17de5ca7fc6d76323c49963f08 +Author: Carlo Lobrano +Date: Tue Dec 20 16:22:41 2016 +0100 + + telit: wrong port peek in telit_qss_toggle_ready + + qss unsolicited handler should be assigned to primary port first, + while secondary port was peeked. + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9a92034cd3c47349a0c1d3c95de8672275352240 +Author: Carlo Lobrano +Date: Tue Dec 20 12:34:01 2016 +0100 + + device: fixed crash in SIM hot swap when removing the SIM + + mm_device_create_modem needs a valid object_manager instance to + create the new + modem, while the one provided before was cleared out by a call to + mm_device_remove_modem few lines before. + + Since the newly created modem refers to the same HW device, we can use + the same object_manager also. + + https://bugs.freedesktop.org/show_bug.cgi?id=99160 + + src/mm-device.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 0bf4db6561de9be61028eb6bc1792a3b7cc410b5 +Author: Carlo Lobrano +Date: Mon Dec 12 10:28:33 2016 +0100 + + telit: blacklist LE866 flashing device + + Moved blacklist code to 77-mm-usb-device-blacklist.rules as per + code review + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 4197dd2e70bd9b13500fb700a841e8cfe478ed5b +Author: Aleksander Morgado +Date: Sun Dec 11 12:43:51 2016 +0100 + + bearer-qmi: signal id may be 0 even if enable == FALSE + + E.g. if the connection attempt fails, + connect_context_complete_and_free() may + be called before the signals are connected to the QmiClients. + + https://bugs.freedesktop.org/show_bug.cgi?id=99047 + + src/mm-bearer-qmi.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 905c8a48e96350af002536b627b46fbf517f727c +Author: Aleksander Morgado +Date: Wed Nov 23 16:19:57 2016 +0100 + + libqcdm,libwmc: use C99 sized types from stdint.h + + libqcdm/src/commands.c | 203 ++++++++++--------- + libqcdm/src/commands.h | 54 ++--- + libqcdm/src/dm-commands.h | 377 + ++++++++++++++++++----------------- + libqcdm/src/log-items.h | 152 +++++++------- + libqcdm/src/logs.c | 29 ++- + libqcdm/src/logs.h | 12 +- + libqcdm/src/nv-items.h | 19 +- + libqcdm/src/result-private.h | 11 +- + libqcdm/src/result.c | 41 ++-- + libqcdm/src/result.h | 9 +- + libqcdm/src/utils.c | 13 +- + libqcdm/src/utils.h | 11 +- + libqcdm/tests/ipv6pref.c | 7 +- + libqcdm/tests/modepref.c | 21 +- + libqcdm/tests/reset.c | 4 +- + libqcdm/tests/test-qcdm-com.c | 21 +- + libqcdm/tests/test-qcdm-result.c | 5 +- + libwmc/src/commands.c | 33 ++-- + libwmc/src/commands.h | 2 +- + libwmc/src/protocol.h | 416 + +++++++++++++++++++-------------------- + libwmc/src/result-private.h | 5 +- + libwmc/src/result.c | 19 +- + libwmc/src/result.h | 7 +- + libwmc/src/utils.c | 21 +- + libwmc/src/utils.h | 15 +- + libwmc/tests/test-wmc-com.c | 9 +- + src/mm-broadband-modem.c | 10 +- + uml290/uml290mode.c | 21 +- + 28 files changed, 764 insertions(+), 783 deletions(-) + +commit 944e34ecdb9028b68b2144dd2c6d698d508f1808 +Author: Aleksander Morgado +Date: Wed Nov 23 10:53:56 2016 +0100 + + tests,dbus: append pid to abstract socket name + + So that different concurrent runs of this same test don't clash with + each other: + + TEST: test-service-generic... (pid=11124) + /MM/Service/Generic/enable-disable: + Activating service name='org.freedesktop.ModemManager1' + Successfully activated service 'org.freedesktop.ModemManager1' + ** (plugins/.libs/lt-test-service-generic>:11124): ERROR **: + Cannot bind socket: Error binding to address: Address already + in use + cleaning up pid 11144 + FAIL + + plugins/generic/tests/test-service-generic.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 20074c55746f4f87c38470b5da5105eef77f6cd3 +Author: Aleksander Morgado +Date: Wed Nov 23 10:44:34 2016 +0100 + + tests,dbus: check if we're asked to use an abstract socket + + plugins/tests/test-port-context.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit c1e62794aef2e26553bf6c90aace5e18c97851d1 +Author: Aleksander Morgado +Date: Mon Nov 21 20:20:12 2016 +0100 + + introspection: expand list of XMLs to install + + And avoid including the wip-* XMLs in the dist tarball. + + introspection/Makefile.am | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +commit 3b38ecb01e9d208f3f4c4bce05986100bfc8b0cb +Author: Aleksander Morgado +Date: Mon Nov 21 13:55:49 2016 +0100 + + introspection: avoid white lines within + + Looks like gdbus-codegen ends up making paragraphs and that breaks the + XML parsing: + + DOC Building HTML + ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml:60: + parser error : Opening and ending tag mismatch: variablelist + line 59 and para + + action + ^ + ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml:110: + parser error : Opening and ending tag mismatch: para line 110 + and variablelist + + ^ + ../xml/ModemManager-dbus-reference.xml:93: + element include: XInclude error : could not load + ../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml, + and no fallback was found + + introspection/org.freedesktop.ModemManager1.xml | 5 ----- + 1 file changed, 5 deletions(-) + +commit 30c2790aa4a712e4cc834d43408d75803db47861 +Author: Aleksander Morgado +Date: Mon Nov 21 13:44:08 2016 +0100 + + kerneldevice,generic: load virtual devices without default rules + + This is so that "make check" doesn't depend on having the rule files + installed in the default udev rules directory, which currently would + break the build: + + TEST: test-service-generic... (pid=2601) + /MM/Service/Generic/enable-disable: + Activating service name='org.freedesktop.ModemManager1' + Successfully activated service 'org.freedesktop.ModemManager1' + + ** + (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:2601): + ERROR **: Error setting test profile: + GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: + Failed to find primary AT port + FAIL + GTester: last random seed: R02S3897abaae9df36f8d2eeb679406ab675 + make[3]: *** [Makefile:3804: test-nonrecursive] Terminated + + src/kerneldevice/mm-kernel-device-generic.c | 3 ++- + src/mm-plugin.c | 5 ++++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +commit 51e3d3d8372e615e9c9a62408638cd8a480f5a14 +Author: Aleksander Morgado +Date: Thu Nov 17 12:09:11 2016 +0100 + + modem-helpers: improve +CCLK parsing + + Added support for 4-digit format years (i.e. YYYY), and also made the + timezone information optional, as per +CSDF in 3GPP TS 27.007. + + https://bugs.freedesktop.org/show_bug.cgi?id=95319 + + src/mm-modem-helpers.c | 96 + ++++++++++++++++++++++++++---------------- + src/tests/test-modem-helpers.c | 7 +++ + 2 files changed, 66 insertions(+), 37 deletions(-) + +commit 64b4afa960e7440505dfb1f18ca9c20506d7e16e +Author: Aleksander Morgado +Date: Mon Nov 7 19:46:40 2016 +0100 + + kernel-device: return G_MAXUINT when get_property_as_int_hex() fails + + src/kerneldevice/mm-kernel-device-generic.c | 2 +- + src/kerneldevice/mm-kernel-device-udev.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 820ab01ddfdf3ddee150f9e84fbee71bae884dea +Author: Aleksander Morgado +Date: Mon Nov 7 19:36:26 2016 +0100 + + kernel-device: ID_USB_INTERFACE_NUM should be read as an hex string + + The original g_udev_device_get_property_as_int() uses strtol() without + an explicit base (i.e. 0) so that the base is autodetected from the + string whenever possible (e.g. if prefixes with '0x' it is treated + as a + hexadecimal string). + + But, for ID_USB_INTERFACE_NUM, we explicitly require reading the + number + as an hex string, even if we don't have any '0x' prefix. + + Reported-by: Matthew Stanger + + plugins/huawei/mm-plugin-huawei.c | 12 ++++++------ + plugins/option/mm-plugin-option.c | 4 ++-- + src/kerneldevice/mm-kernel-device-generic.c | 14 ++++++++++++++ + src/kerneldevice/mm-kernel-device-udev.c | 20 ++++++++++++++++++++ + src/kerneldevice/mm-kernel-device.c | 11 +++++++++++ + src/kerneldevice/mm-kernel-device.h | 2 ++ + 6 files changed, 55 insertions(+), 8 deletions(-) + +commit 4f748144b05375db436364e13186936eae6bcfd2 +Author: Aleksander Morgado +Date: Mon Nov 7 17:47:55 2016 +0100 + + port-probe: don't probe ignored ports + + If a port has been flagged as ignored with the ID_MM_PORT_IGNORE + udev property, + we shouldn't open and probe the ports in any way, just flag them as + ignored. We + still report them in the list of modem ports, but just with "unknown" + type and + therefore not using them for anything. + + src/mm-port-probe.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit a0b95db2b98c46520adced4263dc9982d8a1c8fd +Author: Sam Spilsbury +Date: Tue Jul 21 13:12:44 2015 +0800 + + Makefile: Move to AM_DISTCHECK_CONFIGURE_FLAGS + + Since automake 1.11.2 it is recommended that packages + use AM_DISTCHECK_CONFIGURE_FLAGS instead of + DISTCHECK_CONFIGURE_FLAGS as the latter is intended + to be a user variable. + + https://bugs.freedesktop.org/show_bug.cgi?id=95826 + + Makefile.am | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 9583ec98fd0d8ec53e5cdf048461166ea329b4ce +Author: Daniele Palmas +Date: Tue Oct 25 14:50:05 2016 +0200 + + broadband-modem-qmi: add QMI_PROTOCOL_ERROR_NOT_SUPPORTED case for + pin status checking + + Telit LE922A does not like the legacy way for checking pin status, but + instead of returning QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND, + it returns + QMI_PROTOCOL_ERROR_NOT_SUPPORTED, making the modem not to be fully + initialized. + + This patch adds QMI_PROTOCOL_ERROR_NOT_SUPPORTED as another error for + which the new pin checking status way is tried. + + src/mm-broadband-modem-qmi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 2c5af4f0bcd150b950462b2640dcd78dcbb522d6 +Author: Aleksander Morgado +Date: Mon Oct 24 13:32:59 2016 +0200 + + core: use a default timeout of 300s for the scan networks operation + + This is the value which we actually suggest in the manpage for + the mmcli + operation, so just use the same one. + + Scanning for 3GPP networks may really take a long time, so a + specific timeout must be given: + $ mmcli -m 0 --3gpp-scan --timeout=300 + + Found 4 networks: + 21404 - Yoigo (umts, available) + 21407 - Movistar (umts, current) + 21401 - vodafone ES (umts, forbidden) + 21403 - Orange (umts, forbidden) + + https://bugs.freedesktop.org/show_bug.cgi?id=98235 + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 +- + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-broadband-modem.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +commit ccea14ac476737535124b6e9e553fcdc57b67529 +Author: Lubomir Rintel +Date: Mon Oct 17 18:25:08 2016 +0200 + + systemd: tighten the service security a bit + + What's left enabled: + + * Access to /dev -- obviously + * CAP_SYS_ADMIN -- this is needed by TIOCSSERIAL only. Too bad + this also + allows TIOCSTI, which allows for code injection unless something + else + (SELinux) disallows access to ttys with shells. + Maybe kernel should use CAP_SYS_TTY_CONFIG for this. + * socket(AF_NETLINK) -- udev & kernel device changes + * socket(AF_UNIX) -- D-Bus + + data/ModemManager.service.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit da2b0064eec3ff7710ef2efd79df53b426d6ef7a +Author: Sławomir Bocheński +Date: Tue Jun 7 22:07:22 2016 +0200 + + blacklist: ignore Sigma Sport docking stations + + These CDC ACM class devices are docking stations for Sigma Sport bike + computers. As they are sensitive to single byte commands, ModemManager + probing mechanism actually caused training data on attached bike + computer to be zeroed. + + https://bugs.freedesktop.org/show_bug.cgi?id=96430 + + src/77-mm-usb-device-blacklist.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 7078587f58b2fbf8356931cc2425d78c8bee0136 +Author: Carlo Lobrano +Date: Thu Oct 20 11:33:58 2016 +0200 + + telit: optimized supported and current band code + + In place of two slightly different regexes for 2g/3g and 2g/3g/4g + modems + we now use only one regex with conditional patterns for both supported + and current Bands detection. + + Adding also minor fix in test code + + plugins/telit/mm-modem-helpers-telit.c | 18 ++++-------------- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 2 +- + 2 files changed, 5 insertions(+), 15 deletions(-) + +commit 0bd3ca202bd1df9c9a2cd70f12bde157bd14bd81 +Author: Aleksander Morgado +Date: Tue Oct 18 10:28:50 2016 +0200 + + broadband-modem-qmi: don't use PIN2 lock state if unknown + + src/mm-broadband-modem-qmi.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 17a90b8fa64ebaef1422b972000f321107977e81 +Author: Aleksander Morgado +Date: Thu Oct 13 12:08:21 2016 +0200 + + libmm-glib,call-properties: fix wrong enum returned + + https://bugs.freedesktop.org/show_bug.cgi?id=98220 + + libmm-glib/mm-call-properties.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit af90506da4c1b7f65242a99aff96a59760c054dc +Author: Aleksander Morgado +Date: Thu Oct 13 12:00:26 2016 +0200 + + build: disable GLib deprecation warnings until fully ported to GTask + + Otherwise the build log is very very dense... + + ../../src/mm-broadband-modem-qmi.c: In function + 'modem_load_own_numbers': + ../../src/mm-broadband-modem-qmi.c:1406:5: warning: + 'g_simple_async_result_new' is deprecated (declared at + /usr/include/glib-2.0/gio/gsimpleasyncresult.h:51): Use + 'g_task_new' instead [-Wdeprecated-declarations] + result = g_simple_async_result_new (G_OBJECT (self), + ^ + ../../src/mm-broadband-modem.c: In function + 'signal_quality_qcdm_ready': + ../../src/mm-broadband-modem-mbim.c: In function + 'modem_3gpp_scan_networks_finish': + ../../src/mm-broadband-modem.c:1986:9: warning: + 'g_simple_async_result_take_error' is deprecated (declared + at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:116) + [-Wdeprecated-declarations] + g_simple_async_result_take_error (ctx->result, error); + ^ + ../../src/mm-broadband-modem-mbim.c:2824:5: warning: + 'g_simple_async_result_propagate_error' is deprecated (declared + at /usr/include/glib-2.0/gio/gsimpleasyncresult.h:119) + [-Wdeprecated-declarations] + if (g_simple_async_result_propagate_error + (G_SIMPLE_ASYNC_RESULT (res), error)) + ^ + + configure.ac | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 33e563fe489ea36493c2f00aaac1534906e1dade +Author: Aleksander Morgado +Date: Thu Oct 13 11:49:30 2016 +0200 + + ublox: fix VPATH builds and distcheck + + https://bugs.freedesktop.org/show_bug.cgi?id=98216 + + plugins/Makefile.am | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit e3e803998c4c0bc65bfd5912928f70e932d80146 +Author: Aleksander Morgado +Date: Wed Aug 31 18:27:01 2016 +0200 + + ublox: add README explaining all details of the plugin + + plugins/ublox/README | 162 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 162 insertions(+) + +commit 38bf567536d2a3f968dec661f914b4a0f9261eb8 +Author: Aleksander Morgado +Date: Wed Aug 31 18:33:25 2016 +0200 + + ublox: longer timeout needed for AT probing + + When the device is reset, it needs some time before the newly exposed + TTYs are + able to reply to our AT commands. We increase the default timeout + of the AT + probing commands in order to cope with that, or we'll end up with + TTYs of + 'unknown' type that aren't used for anything. + + plugins/ublox/mm-plugin-ublox.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 5a9f093839029c10791fbc67047c3b4843a53063 +Author: Aleksander Morgado +Date: Mon Aug 22 23:34:53 2016 +0200 + + modem-helpers: implement less strict APN comparison + + u-blox modems will append a string showing the MCC and MNC info to + the access + point name listed in AT+CGDCONT? responses. We will try to detect + when that + happens, and we just accept the match. + + The logic doesn't just look for a string prefix; it also looks for + the special + MCC + MNC suffix, which is much more restrictive, to try to avoid + false + positives. + + src/mm-broadband-bearer.c | 7 ++++--- + src/mm-modem-helpers.c | 44 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 4 ++++ + src/tests/test-modem-helpers.c | 39 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 91 insertions(+), 3 deletions(-) + +commit 75ad9bf98be802bec12b0c8ba0ed9fd95ce8902f +Author: Aleksander Morgado +Date: Mon Aug 22 22:17:21 2016 +0200 + + broadband-bearer: more detailed logging of why a given CID is chosen + + src/mm-broadband-bearer.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit e64b964e8e2eb43b5555088a53890640865edbe8 +Author: Aleksander Morgado +Date: Mon Aug 15 12:35:57 2016 +0200 + + ublox: implement connection statistics loading + + The implementation uses +UGCNTRD=? to query whether the per-PDP + context + statistics are supported by the device, and if they are, +UGCNTRD + is used to + query them. + + We only process the statistics for the specific CID we're using. + + plugins/ublox/mm-broadband-bearer-ublox.c | 163 + +++++++++++++++++++++++++++++- + plugins/ublox/mm-modem-helpers-ublox.c | 6 ++ + 2 files changed, 166 insertions(+), 3 deletions(-) + +commit e6e53467ee738b493cc89c750818ccb688fb5d5f +Author: Aleksander Morgado +Date: Mon Aug 15 12:14:19 2016 +0200 + + ublox: new +UGCNTRD? response parser + + The parser returns only the results for the CID being specified as + input. This + is so that we can just query the statistics of the CID currently in + use by the + bearer. + + plugins/ublox/mm-modem-helpers-ublox.c | 90 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 11 ++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 80 + +++++++++++++++++++++++ + 3 files changed, 181 insertions(+) + +commit 1775544dbc737c40aae31516f8ecc4d1822aac22 +Author: Aleksander Morgado +Date: Mon Aug 15 13:24:45 2016 +0200 + + base-bearer: allow deactivating stats loading if device says + unsupported + + src/mm-base-bearer.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +commit 79aebb9ba4e074f2378d0580d2bd00269b4b026c +Author: Aleksander Morgado +Date: Fri Aug 12 18:20:32 2016 +0200 + + ublox: implement current bands setting + + Reuse the logic and context used to update current modes, as we need + the same + steps (check current power state, go into low power, config update, + and recover + previous power state). + + plugins/ublox/mm-broadband-modem-ublox.c | 196 + ++++++++++++++++++------------- + 1 file changed, 115 insertions(+), 81 deletions(-) + +commit 1c69a847ae0ac2435d48525714bccdc699fab72b +Author: Aleksander Morgado +Date: Fri Aug 12 18:03:32 2016 +0200 + + ublox: new +UBANDSEL=X command builder + + plugins/ublox/mm-modem-helpers-ublox.c | 55 + ++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 +++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 59 + ++++++++++++++++++++++++++ + 3 files changed, 120 insertions(+) + +commit c165f24514e1d5ab05c08dd7480241955006b2fa +Author: Aleksander Morgado +Date: Fri Aug 12 12:54:53 2016 +0200 + + ublox: implement current bands loading + + plugins/ublox/mm-broadband-modem-ublox.c | 33 + ++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +commit 09c9ca5749f2fc59e5d1adf84eb3a0e0c9a58cff +Author: Aleksander Morgado +Date: Fri Aug 12 11:36:48 2016 +0200 + + ublox: new +UBANDSEL? response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 87 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 ++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 83 + ++++++++++++++++++++++++ + 3 files changed, 176 insertions(+) + +commit 4632836d40af6831835ecea2561be53676c578bd +Author: Aleksander Morgado +Date: Thu Aug 11 13:12:48 2016 +0200 + + ublox: implement supported bands loading + + plugins/ublox/mm-broadband-modem-ublox.c | 40 +++++++++ + plugins/ublox/mm-modem-helpers-ublox.c | 105 + +++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 ++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 112 + +++++++++++++++++++++++++ + 4 files changed, 263 insertions(+) + +commit 292914cf65df5e5f87d95fb948a113b56635d1be +Author: Aleksander Morgado +Date: Thu Aug 11 14:03:45 2016 +0200 + + iface-modem: always sort supported and current bands before exposing + them + + libmm-glib/mm-common-helpers.c | 6 ++++++ + libmm-glib/mm-common-helpers.h | 3 ++- + src/mm-iface-modem.c | 7 ++++++- + 3 files changed, 14 insertions(+), 2 deletions(-) + +commit ca1b9cb686bcf634701d4a6421d60e4e82b6784c +Author: Aleksander Morgado +Date: Wed Aug 10 11:17:39 2016 +0200 + + ublox: use +UAUTHREQ to setup PDP context authentication + + plugins/ublox/mm-broadband-bearer-ublox.c | 115 + +++++++++++++++++++++++++++--- + 1 file changed, 105 insertions(+), 10 deletions(-) + +commit 90943177ed7913ee506fb9e5d37bb693d38b54f6 +Author: Aleksander Morgado +Date: Wed Oct 5 13:59:37 2016 +0200 + + broadband-modem: implement the Signal interface + + Provide a generic +CESQ based implementation for the extended Signal + interface, + applicable to all AT-based modems. + + We explicitly disable this check in MBIM modems. + + src/mm-broadband-modem-mbim.c | 18 +++++++++-- + src/mm-broadband-modem.c | 69 + +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 84 insertions(+), 3 deletions(-) + +commit 7ab3d3e727cdc03fa7e058416e57c7d6c83aeab7 +Author: Aleksander Morgado +Date: Wed Oct 5 13:51:35 2016 +0200 + + modem-helpers: new helper to parse +CESQ response into MMSignal + objects + + src/mm-modem-helpers.c | 217 + ++++++++++++++++++++++++++++++++++------- + src/mm-modem-helpers.h | 6 ++ + src/tests/test-modem-helpers.c | 123 ++++++++++++++++------- + 3 files changed, 276 insertions(+), 70 deletions(-) + +commit df6f6d1f37dfeb27c27cf54e6181df9eaf162322 +Author: Aleksander Morgado +Date: Wed Oct 5 13:45:41 2016 +0200 + + modem-helpers: new +CESQ response parser + + src/mm-modem-helpers.c | 92 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 10 +++++ + src/tests/test-modem-helpers.c | 76 ++++++++++++++++++++++++++++++++++ + 3 files changed, 178 insertions(+) + +commit 9b3549e375af5d80fa9986cdbddfa51fe16dfe3e +Author: Aleksander Morgado +Date: Wed Aug 10 08:00:24 2016 +0200 + + api,signal: new RSCP item + + cli/mmcli-modem-signal.c | 4 ++- + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 ++ + .../org.freedesktop.ModemManager1.Modem.Signal.xml | 8 +++++ + libmm-glib/mm-signal.c | 38 + ++++++++++++++++++++++ + libmm-glib/mm-signal.h | 2 ++ + 5 files changed, 53 insertions(+), 1 deletion(-) + +commit 4c02fba819d492c75ad4f79914663b43d8972518 +Author: Aleksander Morgado +Date: Tue Oct 11 17:58:30 2016 +0200 + + ublox: implement PIN retry count loading + + plugins/ublox/mm-broadband-modem-ublox.c | 46 + ++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 29517c99ba9fee164b788a1f7cff43773e0b58be +Author: Aleksander Morgado +Date: Tue Aug 9 17:31:04 2016 +0200 + + ublox: new +UPINCNT response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 80 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 10 ++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 60 ++++++++++++++++++- + 3 files changed, 149 insertions(+), 1 deletion(-) + +commit fe460b2f54b6a035a207815252fe87ee3a06351c +Author: Aleksander Morgado +Date: Wed Oct 5 13:32:41 2016 +0200 + + 3gpp: update registration state enumeration with CSFB related states + + Introduce "sms only" and "CSFB not preferred" home/roaming states + to be reported + for the CS context, while already registered on LTE. + + Based on 3GPP TS 27.007 v13.5.0. + + cli/mmcli-modem-simple.c | 14 +++++--- + include/ModemManager-enums.h | 24 ++++++++++---- + src/mm-base-bearer.c | 19 ++++++++++- + src/mm-iface-modem-3gpp.c | 75 + +++++++++++++++++++++++++++++++++++------- + src/mm-modem-helpers.c | 14 ++++---- + src/tests/test-modem-helpers.c | 24 ++++++++++++++ + 6 files changed, 140 insertions(+), 30 deletions(-) + +commit a561f6edf0317ee4eb86e6811cd8cd5a7fbf5e60 +Author: Aleksander Morgado +Date: Tue Aug 9 12:35:29 2016 +0200 + + ublox: use +CEREG if LTE supported + + plugins/ublox/mm-broadband-modem-ublox.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 7cb11f72cd3dcd460feee205d3faad267c5471c9 +Author: Aleksander Morgado +Date: Tue Aug 9 12:09:57 2016 +0200 + + ublox: implement current modes setting and modem power + up/down/off/reset + + Changing current allowed/preferred modes requires the device to be + in low-power + mode, so we will make sure we return an error if any power operation + is already + ongoing when a new one is requested. + + plugins/ublox/mm-broadband-modem-ublox.c | 369 + +++++++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.c | 31 +++ + plugins/ublox/mm-modem-helpers-ublox.h | 5 + + 3 files changed, 405 insertions(+) + +commit 9d78f05cbd437169a6f4ca406166edbcc4042316 +Author: Aleksander Morgado +Date: Tue Aug 9 09:56:56 2016 +0200 + + ublox: new +URAT=X command builder + + plugins/ublox/mm-modem-helpers-ublox.c | 46 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 ++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 45 + ++++++++++++++++++------- + 3 files changed, 85 insertions(+), 12 deletions(-) + +commit 5d2e89e7129fadc92474fc55a87a84f7e6c98e12 +Author: Aleksander Morgado +Date: Tue Aug 9 10:35:05 2016 +0200 + + ublox: implement power state loading + + plugins/ublox/mm-broadband-modem-ublox.c | 32 + ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +commit 151d608eec4c7728551e03c9b375306c147042b4 +Author: Aleksander Morgado +Date: Tue Oct 11 16:28:17 2016 +0200 + + ublox: new u-blox specific +CFUN? response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 32 + ++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 7 +++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 38 + ++++++++++++++++++++++++++ + 3 files changed, 77 insertions(+) + +commit d7fdda224765e8ea9c1b4713dfa3708f2251b8c3 +Author: Aleksander Morgado +Date: Tue Oct 11 17:49:43 2016 +0200 + + linktop: new Linktop specific +CFUN? response parser + + We handle all known CFUN? response values in the new parser, and + report an error + if an unknown value is found. + + .gitignore | 1 + + plugins/Makefile.am | 20 +++++ + plugins/linktop/mm-broadband-modem-linktop.c | 42 +--------- + plugins/linktop/mm-modem-helpers-linktop.c | 55 +++++++++++++ + plugins/linktop/mm-modem-helpers-linktop.h | 40 +++++++++ + plugins/linktop/tests/test-modem-helpers-linktop.c | 94 + ++++++++++++++++++++++ + 6 files changed, 214 insertions(+), 38 deletions(-) + +commit 74fd7da774c3a4c644106618499d68eb92a95baf +Author: Aleksander Morgado +Date: Tue Oct 11 17:24:08 2016 +0200 + + mbm: new MBM specific +CFUN? response parsers + + plugins/mbm/mm-broadband-modem-mbm.c | 75 + ++++++------------------------ + plugins/mbm/mm-modem-helpers-mbm.c | 71 + ++++++++++++++++++++++++++++ + plugins/mbm/mm-modem-helpers-mbm.h | 9 ++++ + plugins/mbm/tests/test-modem-helpers-mbm.c | 73 + +++++++++++++++++++++++++++-- + 4 files changed, 165 insertions(+), 63 deletions(-) + +commit aca6bb1c02ddc16d88fb8c9fd934466eb7debf5c +Author: Aleksander Morgado +Date: Tue Oct 11 16:27:51 2016 +0200 + + modem-helpers: new +CFUN? response parser + + src/mm-broadband-modem.c | 40 +++------------------ + src/mm-modem-helpers.c | 79 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 11 ++++++ + src/tests/test-modem-helpers.c | 68 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 162 insertions(+), 36 deletions(-) + +commit b34f147ba27b9d328a17bee092d0d21bd20eb200 +Author: Aleksander Morgado +Date: Tue Aug 9 08:44:05 2016 +0200 + + ublox: implement current modes loading + + plugins/ublox/mm-broadband-modem-ublox.c | 34 + ++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit bde9c4795a0680549f99bac2509f8520e1b2a738 +Author: Aleksander Morgado +Date: Tue Aug 9 08:43:56 2016 +0200 + + ublox: new +URAT? response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 94 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 9 +++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 53 +++++++++++++++ + 3 files changed, 156 insertions(+) + +commit 29ace8b12076fc6b8e95dbb32230334c9768c82e +Author: Aleksander Morgado +Date: Mon Aug 8 16:46:51 2016 +0200 + + ublox: implement supported modes loading + + AT+URAT=? provides the format expected, but looks like it isn't + implemented + differently for the different u-blox devices seen, so we need an + additional + level of filtering which currently is applied per device model string. + + plugins/ublox/mm-broadband-modem-ublox.c | 40 +++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.c | 63 ++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 8 +++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 79 + +++++++++++++++++++------- + 4 files changed, 171 insertions(+), 19 deletions(-) + +commit a4466e83b71effb49d31d7fcbfe1f34c528fb547 +Author: Aleksander Morgado +Date: Mon Aug 8 10:57:34 2016 +0200 + + ublox: new +URAT=? response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 124 + +++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 6 ++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 101 ++++++++++++++++++++ + 3 files changed, 231 insertions(+) + +commit 3a886d848dadd98eda8dff354c1d10450d7613fe +Author: Aleksander Morgado +Date: Mon Aug 8 09:40:17 2016 +0200 + + modem-helpers: new uint list parser, including interval support + + src/mm-modem-helpers.c | 99 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 3 ++ + src/tests/test-modem-helpers.c | 45 +++++++++++++++++++ + 3 files changed, 147 insertions(+) + +commit 37bd61421245de87d2c04852109d2a1b14d338cb +Author: Aleksander Morgado +Date: Wed Oct 5 08:21:08 2016 +0200 + + broadband-modem: implement default connection monitoring logic + + A default implementation to monitor the ongoing connection is provided + in the + generic MMBroadbandModem, based on AT+CGACT? to check whether the + PDP context + of the connection (identified by the cached cid) is active or not. + + This commit also disables the connection monitoring logic in those + plugins that + have custom connection methods. + + plugins/altair/mm-broadband-bearer-altair-lte.c | 4 ++ + plugins/huawei/mm-broadband-bearer-huawei.c | 4 ++ + plugins/icera/mm-broadband-bearer-icera.c | 4 ++ + plugins/iridium/mm-bearer-iridium.c | 2 + + plugins/mbm/mm-broadband-bearer-mbm.c | 3 + + plugins/option/mm-broadband-bearer-hso.c | 3 + + plugins/sierra/mm-broadband-bearer-sierra.c | 7 +- + plugins/ublox/mm-broadband-bearer-ublox.c | 3 + + src/mm-bearer-mbim.c | 2 + + src/mm-bearer-qmi.c | 2 + + src/mm-broadband-bearer.c | 95 + +++++++++++++++++++++++++ + 11 files changed, 128 insertions(+), 1 deletion(-) + +commit 61fbab286c3ab231f7fd16c345cc7e352f33bae4 +Author: Aleksander Morgado +Date: Sat Aug 6 19:01:27 2016 +0200 + + modem-helpers: new CGACT? response parser + + src/mm-modem-helpers.c | 84 + ++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 9 +++++ + src/tests/test-modem-helpers.c | 92 + ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 185 insertions(+) + +commit f2c2a6a05f82450383667eb32dca4fd63488ae4f +Author: Aleksander Morgado +Date: Sun Aug 7 14:09:41 2016 +0200 + + novatel: subclass the connection monitoring logic + + Instead of setting up a custom timeout source to poll the connection + status, use + the generic logic in the base bearer object, and just re-implement + the command + used to check the status. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 172 + ++++++++++------------ + plugins/novatel/mm-broadband-bearer-novatel-lte.h | 2 - + 2 files changed, 79 insertions(+), 95 deletions(-) + +commit 26d0d718f7834348146ab9e040051f7a538f04f0 +Author: Aleksander Morgado +Date: Sun Aug 7 13:31:41 2016 +0200 + + base-bearer: new periodic monitoring of connection status + + src/mm-base-bearer.c | 80 + ++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-base-bearer.h | 11 ++++++++ + 2 files changed, 85 insertions(+), 6 deletions(-) + +commit 467b3c57f01b37dbcec8d32a449654aac40f90d0 +Author: Aleksander Morgado +Date: Wed Aug 3 11:10:04 2016 +0200 + + modem-helpers: new COPS? response parser + + Split into two different actions the actual COPS? response parsing + and the + operator name normalization process. + + Also, allow parsing not only the operator string, but also the + format, mode + and the optional access technology value. + + plugins/altair/mm-broadband-modem-altair-lte.c | 26 +++-- + plugins/huawei/mm-broadband-modem-huawei.c | 12 +- + src/mm-broadband-modem.c | 26 +++-- + src/mm-modem-helpers.c | 152 + +++++++++++++++++-------- + src/mm-modem-helpers.h | 12 +- + src/tests/test-modem-helpers.c | 79 +++++++++++++ + 6 files changed, 243 insertions(+), 64 deletions(-) + +commit b117321980c39c2dcc50789058017fa3201e7003 +Author: Aleksander Morgado +Date: Sun Aug 7 11:45:25 2016 +0200 + + broadband-bearer: allow subclassing the CID selection step in the + 3GPP sequence + + Instead of relying always on CGDCONT to look for a matching PDP + context or + creating a new one, we allow plugins to apply their own logic. + + src/mm-broadband-bearer.c | 545 + ++++++++++++++++++++++++++-------------------- + src/mm-broadband-bearer.h | 13 +- + 2 files changed, 326 insertions(+), 232 deletions(-) + +commit 30772ffc2609e070306f6fd75c0d787d3ea0153a +Author: Aleksander Morgado +Date: Sat Aug 6 17:29:12 2016 +0200 + + ublox: implement connection using the 2G/3G logic in router or + bridge mode + + plugins/ublox/mm-broadband-bearer-ublox.c | 394 + ++++++++++++++++++++++++++++++ + 1 file changed, 394 insertions(+) + +commit 654f718b062b01083786d3a2c19740d204b128c9 +Author: Aleksander Morgado +Date: Sat Aug 6 08:57:59 2016 +0200 + + modem-helpers: new +CGCONTRDP=N response parser + + src/mm-modem-helpers.c | 198 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 12 +++ + src/tests/test-modem-helpers.c | 164 ++++++++++++++++++++++++++++++++++ + 3 files changed, 374 insertions(+) + +commit 81715ee591599d0774b43006691998bb461f8fa9 +Author: Aleksander Morgado +Date: Thu Aug 4 10:38:40 2016 +0200 + + ublox: new +UIPADDR=N response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 97 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 12 ++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 80 +++++++++++++++++++++ + 3 files changed, 189 insertions(+) + +commit bc07ec0835a524970e1c35b055788b35da9b0d23 +Author: Aleksander Morgado +Date: Tue Aug 2 13:40:39 2016 +0200 + + ublox: new broadband bearer object + + plugins/Makefile.am | 2 + + plugins/ublox/mm-broadband-bearer-ublox.c | 177 + ++++++++++++++++++++++++++++++ + plugins/ublox/mm-broadband-bearer-ublox.h | 63 +++++++++++ + plugins/ublox/mm-broadband-modem-ublox.c | 49 ++++++++- + 4 files changed, 289 insertions(+), 2 deletions(-) + +commit eade066d8a1f4ac94a1176a19002d244f63ad7dd +Author: Aleksander Morgado +Date: Tue Aug 2 13:26:49 2016 +0200 + + ublox: generate enum types for usb profile and networking mode + + .gitignore | 2 ++ + plugins/Makefile.am | 34 + ++++++++++++++++++++++++++++++++ + plugins/ublox/mm-broadband-modem-ublox.c | 28 +++++--------------------- + plugins/ublox/mm-modem-helpers-ublox.h | 4 ++-- + 4 files changed, 43 insertions(+), 25 deletions(-) + +commit 3b0ceabc5d87a30fc1da5c96174dc4616f06e066 +Author: Aleksander Morgado +Date: Tue Aug 30 20:29:54 2016 +0200 + + ublox: preload networking mode and usb profile when creating a + new bearer + + plugins/ublox/mm-broadband-modem-ublox.c | 261 + +++++++++++++++++++++++++++++-- + 1 file changed, 251 insertions(+), 10 deletions(-) + +commit 9d2c2a75cc23a878ff48a1c70377dd49a488cd1a +Author: Aleksander Morgado +Date: Tue Aug 2 11:28:43 2016 +0200 + + ublox: new 'AT+UBMCONF?' response parser + + plugins/ublox/mm-modem-helpers-ublox.c | 61 + ++++++++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 13 ++++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 37 ++++++++++++++++ + 3 files changed, 111 insertions(+) + +commit 241b63304be4ca8a2532401458636ad46b776e45 +Author: Aleksander Morgado +Date: Tue Aug 2 09:19:05 2016 +0200 + + ublox: new 'AT+UUSBCONF?' response parser + + .gitignore | 1 + + plugins/Makefile.am | 20 +++++ + plugins/ublox/mm-modem-helpers-ublox.c | 83 ++++++++++++++++++++ + plugins/ublox/mm-modem-helpers-ublox.h | 35 +++++++++ + plugins/ublox/tests/test-modem-helpers-ublox.c | 101 + +++++++++++++++++++++++++ + 5 files changed, 240 insertions(+) + +commit 40f3725ef9f5914b89279f270f2b50fe5ada3847 +Author: Aleksander Morgado +Date: Mon Aug 1 19:28:26 2016 +0200 + + ublox: new broadband modem object + + plugins/Makefile.am | 2 + + plugins/ublox/mm-broadband-modem-ublox.c | 67 + ++++++++++++++++++++++++++++++++ + plugins/ublox/mm-broadband-modem-ublox.h | 49 +++++++++++++++++++++++ + plugins/ublox/mm-plugin-ublox.c | 24 ++++++------ + 4 files changed, 130 insertions(+), 12 deletions(-) + +commit f22c088cee9489af0e97c3dad0cfe0a2d897f434 +Author: Aleksander Morgado +Date: Mon Aug 1 19:13:53 2016 +0200 + + ublox: new plugin skeleton + + plugins/Makefile.am | 12 +++++++ + plugins/ublox/mm-plugin-ublox.c | 76 + +++++++++++++++++++++++++++++++++++++++++ + plugins/ublox/mm-plugin-ublox.h | 40 ++++++++++++++++++++++ + 3 files changed, 128 insertions(+) + +commit d91752529307ce9ebd73a73ebddb477660342e11 +Author: Aleksander Morgado +Date: Wed Oct 12 11:10:56 2016 +0200 + + build: include telit helpers in TELIT_COMMON_LIBADD_FLAGS + + The dell plugin needs them. + + ModemManager[727]: [1476194360.614829] + [mm-plugin-manager.c:1494] load_plugin(): + [plugin manager] could not load plugin + '/usr/lib64/ModemManager/libmm-plugin-dell.so': + /usr/lib64/ModemManager/libmm-plugin-dell.so: undefined symbol: + mm_telit_get_band_flag + + https://bugs.freedesktop.org/show_bug.cgi?id=98207 + + Reported-by: Lubomir Rintel + + plugins/Makefile.am | 46 +++++++++++++++++++++++++--------------------- + 1 file changed, 25 insertions(+), 21 deletions(-) + +commit 5a43f90a48d3b1494dcd338b2363eda783063e31 +Author: Lubomir Rintel +Date: Tue Oct 11 16:29:51 2016 +0200 + + plugins: only export useful symbols + + This should avoid poluting the name space and also make module loading + faster. + + plugins/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 6dc08a69adc4294e2b22f14b754b541c64109fba +Author: Lubomir Rintel +Date: Tue Oct 11 16:41:52 2016 +0200 + + build: limit the available glib functionality to the version we + support + + Otherwise we can accidentally use something that we ought not. Also, + there's deprecation warnings for stuff that's not deprecated in the + version we support yet: + + mm-modem-simple.c: In function 'mm_modem_simple_connect_finish': + mm-modem-simple.c:117:5: warning: + 'g_simple_async_result_propagate_error' is deprecated + [-Wdeprecated-declarations] + if (g_simple_async_result_propagate_error + (G_SIMPLE_ASYNC_RESULT (res), error)) + ^~ + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6f11ff10cd8da2d431eb9596185ccb577356c6ab +Author: Daniele Palmas +Date: Mon Oct 10 14:42:45 2016 +0200 + + telit: fix supported and current bands query with GE910 + + GE910 is a 2g only modem and when queried for bands it returns + only a 2g set of bands: + + --> 'AT#BND=?' + <-- '#BND: (0-3)OK' + + Current regex fails, since it considers the 3g bands block mandatory. + + A similar problem happens for current bands. + + This patch modifies the regular expressions for properly + supporting GE910 and updates tests. + + plugins/telit/mm-modem-helpers-telit.c | 4 ++-- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 8 ++++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +commit d5cfad49d879a21f5f05eaa14fa5d19f12241dda +Author: Daniele Palmas +Date: Wed Oct 5 16:43:37 2016 +0200 + + telit: add GE910 #PORTCFG layouts + + GE910 family supports #PORTCFG layouts different than HE910 + family ones. + + This patch properly tags GE910 ports according to Telit document + "GE910 Family Ports Arrangements, 1vv0301049" + + plugins/telit/mm-common-telit.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +commit 30bcf5605cf661cdc884fcc83adf7c2304bd072d +Author: Daniele Palmas +Date: Wed Oct 5 16:43:36 2016 +0200 + + telit: add udev rules for supporting GE910 + + This patch adds the udev rules for supporting GE910 (PID 0x22) + + plugins/telit/77-mm-telit-port-types.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 14ccde2b5f7f1770950c70b03a0b9ccecc54d692 +Author: Dan Williams +Date: Tue Oct 4 15:43:55 2016 -0500 + + huawei: handle some weird SYSCFG acquisition orders + + (ttyUSB2): --> 'AT^SYSCFG?' + (ttyUSB2): <-- + '^SYSCFG:14,2,400380,1,2OK' + couldn't load current allowed/preferred modes: 'No SYSCFG + combination found matching the current one (14,2)' + + 14,2 means "WCDMA-only; acquire WCDMA then GSM" which is somewhat + non-sensical. The supported modes parsing doesn't generate this + combination because it doesn't really make sense, so current mode + matching failed. Just fix up the non-sensical acquisition order + to 0 (automatic). + + plugins/huawei/mm-modem-helpers-huawei.c | 6 ++++++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 14 ++++++++++++++ + 2 files changed, 20 insertions(+) + +commit 9548192985ad68601b069a1f267fcbdc652a5ba2 +Author: Aleksander Morgado +Date: Tue Oct 4 12:53:13 2016 +0200 + + kerneldevice,generic: support ID_USB_INTERFACE_NUM and some other + udev properties + + We need at least ID_USB_INTERFACE_NUM, as some plugins (Huawei, + Telit, Option) + require this property when gathering port type hints. + + We also add support for other properties (ID_VENDOR_ID, + ID_MODEL_ID...) as we + already have those values preloaded. + + src/kerneldevice/mm-kernel-device-generic.c | 55 + ++++++++++++++++++++--------- + 1 file changed, 39 insertions(+), 16 deletions(-) + +commit 58c955f5f23e874e4f8c2a4b389e46c0775e7f07 +Author: Aleksander Morgado +Date: Wed Sep 28 19:46:12 2016 +0200 + + core: allow building and running without udev + + Instead of relying on the udev daemon and GUDev to manage the + devices reported + by the kernel, we can now run ModemManager relying solely on the + kernel events + reported via the new ReportKernelEvent() API. Therefore, the + '--no-auto-scan' + option is implicit for the ModemManager daemon when udev is disabled + in the + build. + + Additionally, a new custom implementation of the kernel device + object is + provided, which uses sysfs to load the properties and attributes + required in + each kernel device, instead of using a GUdevDevice. + + The udev rule files are kept in place, and a simple custom parser + is provided + which preloads all rules in memory once and then applies them to + the different + kernel objects reported via ReportKernelEvent(), e.g. to set port + type hints. + A simple unit test setup is prepared to validate the udev rules + during the + `check' Makefile target. + + .gitignore | 3 + + cli/Makefile.am | 7 +- + cli/mmcli-manager.c | 31 +- + configure.ac | 30 +- + libmm-glib/mm-common-helpers.c | 43 ++ + libmm-glib/mm-common-helpers.h | 2 + + plugins/Makefile.am | 38 ++ + plugins/tests/test-udev-rules.c | 164 +++++ + src/Makefile.am | 15 + + src/kerneldevice/mm-kernel-device-generic-rules.c | 446 +++++++++++++ + src/kerneldevice/mm-kernel-device-generic-rules.h | 62 ++ + src/kerneldevice/mm-kernel-device-generic.c | 772 + +++++++++++++++++++++- + src/kerneldevice/mm-kernel-device-generic.h | 9 +- + src/mm-base-manager.c | 50 +- + src/mm-context.c | 27 +- + src/tests/Makefile.am | 5 +- + src/tests/test-udev-rules.c | 79 +++ + test/Makefile.am | 29 + + test/mmrules.c | 173 +++++ + 19 files changed, 1942 insertions(+), 43 deletions(-) + +commit ae9ede926a1747216b54e22398edde203ec9a03c +Author: Aleksander Morgado +Date: Wed Sep 28 20:34:48 2016 +0200 + + core: use the kernel device object in the port object and the plugin + interface + + The mm_base_modem_grab_port() now receives a MMKernelDevice directly + from the + plugin, which is then stored in the MMPort corresponding to the port. + + This means that we have direct access to e.g. all properties set by + udev rules + everywhere, and we don't need additional GUdevClient objects + (e.g. like the one + used in the Huawei plugin to detect NDISDUP support during runtime). + + For virtual ports (e.g. generated during unit tests), we have a new + 'generic' + kernel device object which just provides the values from the kernel + device + properties given during its creation. + + plugins/cinterion/mm-plugin-cinterion.c | 4 +- + plugins/dell/mm-plugin-dell.c | 4 +- + plugins/haier/mm-plugin-haier.c | 4 +- + plugins/huawei/mm-broadband-modem-huawei.c | 29 +-- + plugins/huawei/mm-plugin-huawei.c | 4 +- + plugins/longcheer/mm-plugin-longcheer.c | 4 +- + plugins/mbm/mm-plugin-mbm.c | 4 +- + plugins/mtk/mm-plugin-mtk.c | 4 +- + plugins/nokia/mm-plugin-nokia-icera.c | 4 +- + plugins/option/mm-plugin-hso.c | 4 +- + plugins/option/mm-plugin-option.c | 4 +- + plugins/pantech/mm-plugin-pantech.c | 4 +- + plugins/sierra/mm-common-sierra.c | 4 +- + plugins/simtech/mm-plugin-simtech.c | 4 +- + plugins/telit/mm-common-telit.c | 4 +- + plugins/x22x/mm-plugin-x22x.c | 4 +- + plugins/zte/mm-plugin-zte.c | 4 +- + src/Makefile.am | 5 +- + src/kerneldevice/mm-kernel-device-generic.c | 309 + ++++++++++++++++++++++++++++ + src/kerneldevice/mm-kernel-device-generic.h | 51 +++++ + src/mm-base-modem.c | 36 ++-- + src/mm-base-modem.h | 13 +- + src/mm-plugin.c | 48 +++-- + src/mm-port.c | 44 ++-- + src/mm-port.h | 24 ++- + src/tests/Makefile.am | 1 + + test/Makefile.am | 2 +- + 27 files changed, 482 insertions(+), 144 deletions(-) + +commit c4a584416ab4af81b6cae653625c78f9158de1e6 +Author: Aleksander Morgado +Date: Wed Sep 28 18:49:08 2016 +0200 + + core: allow disabling auto-scan and notifying ports one by one via API + + This commit enables a new core ModemManager daemon option, so that + automatic + detection of available modems is totally disabled: + '--no-auto-scan'. Note that + this option also replaces the previously used '--test-no-auto-scan' + option, + which was only used during tests. + + Along with the new ModemManager option, a new ReportKernelEvent() + method in + the API is defined, which allows notifying the daemon of which + interfaces it + should be accessing, as well as the main details of each + interface. The only + mandatory parameters in the new method are 'action' (add/remove), + 'name' (the + name of the interface) and 'subsystem' (the subsystem of the + interface). + + The mmcli tool has support for using the new api method via several + new options: + + * The '--report-kernel-event' option allows specifying device ports + one by + one, and is a direct mapping of the ReportKernelEvent() method: + $ sudo mmcli + --report-kernel-event="action=add,name=wwan0,subsystem=net" + $ sudo mmcli + --report-kernel-event="action=add,name=cdc-wdm0,subsystem=usbmisc" + + * The '--report-kernel-event-auto-scan' option uses udev monitoring + to notify + events automatically to the daemon. This allows to operate in a way + equivalent to the default daemon operation (with implicit + auto-scan). + + Worth noting that the ReportKernelEvent() method is only usable when + '--no-auto-scan' is explicitly used in the daemon. An error will be + reported if + the method is tried while standard udev monitoring is enabled + (implicit if + auto scan isn't explicitly disabled in the daemon). + + If mmcli is going to be used only to report 'real time' events, + an optional + '--initial-kernel-events=[PATH]' may be given in the ModemManager + call to + automatically process a set of port kernel events one by one on + boot. The file + may e.g. contain: + action=add,name=wwan0,subsystem=net + action=add,name=cdc-wdm0,subsystem=usbmisc + + cli/Makefile.am | 2 + + cli/mmcli-manager.c | 148 ++++++- + .../tests/org.freedesktop.ModemManager1.service.in | 2 +- + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 38 ++ + introspection/org.freedesktop.ModemManager1.xml | 74 ++++ + libmm-glib/Makefile.am | 3 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-kernel-event-properties.c | 454 + +++++++++++++++++++++ + libmm-glib/mm-kernel-event-properties.h | 97 +++++ + libmm-glib/mm-manager.c | 124 ++++++ + libmm-glib/mm-manager.h | 14 + + src/kerneldevice/mm-kernel-device-udev.c | 221 ++++++++-- + src/kerneldevice/mm-kernel-device-udev.h | 9 +- + src/main.c | 3 +- + src/mm-base-manager.c | 266 +++++++++++- + src/mm-base-manager.h | 2 + + src/mm-context.c | 32 +- + src/mm-context.h | 19 +- + 19 files changed, 1437 insertions(+), 73 deletions(-) + +commit aa4577dfb9b5a7863a4939ec2409eae392e2fc0c +Author: Aleksander Morgado +Date: Sun Mar 27 19:40:03 2016 +0200 + + core: new kernel device object instead of an explicit GUdevDevice + + Instead of relying constantly on GUdevDevice objects reported by + GUdev, we now + use a new generic object (MMKernelDevice) for which we provide an + initial GUdev + based backend. + + plugins/Makefile.am | 1 + + plugins/cinterion/mm-plugin-cinterion.c | 4 +- + plugins/dell/mm-plugin-dell.c | 6 +- + plugins/haier/mm-plugin-haier.c | 4 +- + plugins/huawei/mm-plugin-huawei.c | 20 +- + plugins/longcheer/mm-plugin-longcheer.c | 6 +- + plugins/mbm/mm-plugin-mbm.c | 4 +- + plugins/mtk/mm-plugin-mtk.c | 6 +- + plugins/nokia/mm-plugin-nokia-icera.c | 6 +- + plugins/option/mm-plugin-hso.c | 6 +- + plugins/option/mm-plugin-option.c | 4 +- + plugins/simtech/mm-plugin-simtech.c | 8 +- + plugins/telit/mm-common-telit.c | 24 +- + plugins/x22x/mm-plugin-x22x.c | 6 +- + plugins/zte/mm-plugin-zte.c | 8 +- + src/Makefile.am | 15 + + src/kerneldevice/mm-kernel-device-udev.c | 623 + +++++++++++++++++++++++++++++++ + src/kerneldevice/mm-kernel-device-udev.h | 48 +++ + src/kerneldevice/mm-kernel-device.c | 179 +++++++++ + src/kerneldevice/mm-kernel-device.h | 89 +++++ + src/mm-base-manager.c | 231 +++--------- + src/mm-device.c | 347 ++++------------- + src/mm-device.h | 96 +++-- + src/mm-plugin-manager.c | 38 +- + src/mm-plugin.c | 78 ++-- + src/mm-plugin.h | 10 +- + src/mm-port-probe.c | 205 +++++----- + src/mm-port-probe.h | 20 +- + 28 files changed, 1344 insertions(+), 748 deletions(-) + +commit 1f813c4e9691f22017802278ab6f5b1475185113 +Author: Aleksander Morgado +Date: Sun Mar 27 14:41:35 2016 +0200 + + core: allow identifying devices by a user-provided 'uid' + + All ports of the same modem reported by the kernel will all be + associated with + a common 'uid' (unique id), which uniquely identifies the physical + device. This + logic was already in place, what we do now is avoid calling it the + 'sysfs + path' of the physical device, because we may not want to use that + to identify + a device. + + This logic now also enables the possibility of "naming" the modems + in a unique + way by setting the "ID_MM_PHYSDEV_UID" property in the "usb_device" + that owns + all the ports. + + E.g. a custom device has 4 modems in 4 different USB ports. The + device path of + each USB device will always be the same, so the naming rules could + go like this: + + $ vim /usr/lib/udev/rules.d/78-mm-naming.rules + + ACTION!="add|change|move", GOTO="mm_naming_rules_end" + DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.1", + ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-1" + DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.2", + ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-2" + DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.3", + ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-3" + DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.4", + ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-4" + LABEL="mm_naming_rules_end" + + Each of the modems found will have a unique UID retrieved from the + previous list + of rules. Then, "mmcli" has also been updated to allow using the + UID instead of + the modem DBus path or index, e.g.: + + $ sudo mmcli -m USB-MODEM-1 + /org/freedesktop/ModemManager1/Modem/0 (device id + '988d83252c0598f670c2d69d5f41e077204a92fd') + ------------------------- + Hardware | manufacturer: 'ZTE CORPORATION' + | model: 'MF637' + | revision: 'BD_W7P673A3F3V1.0.0B04' + | supported: 'gsm-umts' + | current: 'gsm-umts' + | equipment id: '356516027657837' + ------------------------- + System | device: 'USB-MODEM-1' + | drivers: 'option' + | plugin: 'ZTE' + | primary port: 'ttyUSB5' + | ports: 'ttyUSB5 (at)' + ... + + $ sudo mmcli -m USB-MODEM-1 --enable + ... + + cli/mmcli-common.c | 98 + +++++++++++++++++++++++--------- + cli/mmcli-common.h | 4 +- + plugins/altair/mm-plugin-altair-lte.c | 4 +- + plugins/anydata/mm-plugin-anydata.c | 6 +- + plugins/cinterion/mm-plugin-cinterion.c | 6 +- + plugins/dell/mm-plugin-dell.c | 14 ++--- + plugins/generic/mm-plugin-generic.c | 8 +-- + plugins/haier/mm-plugin-haier.c | 4 +- + plugins/huawei/mm-plugin-huawei.c | 8 +-- + plugins/iridium/mm-plugin-iridium.c | 4 +- + plugins/linktop/mm-plugin-linktop.c | 4 +- + plugins/longcheer/mm-plugin-longcheer.c | 4 +- + plugins/mbm/mm-plugin-mbm.c | 6 +- + plugins/motorola/mm-plugin-motorola.c | 4 +- + plugins/mtk/mm-plugin-mtk.c | 4 +- + plugins/nokia/mm-plugin-nokia-icera.c | 4 +- + plugins/nokia/mm-plugin-nokia.c | 4 +- + plugins/novatel/mm-plugin-novatel-lte.c | 4 +- + plugins/novatel/mm-plugin-novatel.c | 6 +- + plugins/option/mm-plugin-hso.c | 4 +- + plugins/option/mm-plugin-option.c | 4 +- + plugins/pantech/mm-plugin-pantech.c | 6 +- + plugins/samsung/mm-plugin-samsung.c | 4 +- + plugins/sierra/mm-plugin-sierra-legacy.c | 6 +- + plugins/sierra/mm-plugin-sierra.c | 8 +-- + plugins/simtech/mm-plugin-simtech.c | 6 +- + plugins/telit/mm-plugin-telit.c | 4 +- + plugins/thuraya/mm-plugin-thuraya.c | 4 +- + plugins/via/mm-plugin-via.c | 4 +- + plugins/wavecom/mm-plugin-wavecom.c | 4 +- + plugins/x22x/mm-plugin-x22x.c | 6 +- + plugins/zte/mm-plugin-zte.c | 10 ++-- + src/mm-base-manager.c | 66 ++++++++++----------- + src/mm-device.c | 55 ++++++++++-------- + src/mm-device.h | 6 +- + src/mm-plugin-manager.c | 6 +- + src/mm-plugin.c | 2 +- + src/mm-plugin.h | 2 +- + 38 files changed, 225 insertions(+), 178 deletions(-) + +commit e5fa0233bb73a8374cf35e9170c66c580255815a +Author: Aleksander Morgado +Date: Wed Sep 28 09:26:47 2016 +0200 + + mmcli,ussd: don't rely on lock status to allow actions + + Commit 001f35234e16d7aeb2ed1282ba3b57aea73c5a9e fixed this very same + thing in + all the other interface actions, but 3GPP USSD actions were not fixed. + + https://bugs.freedesktop.org/show_bug.cgi?id=97954 + + cli/mmcli-modem-3gpp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit dd98454a7ddeac98011cb1ed82be4cff588044a3 +Author: Aleksander Morgado +Date: Thu Sep 22 19:58:08 2016 +0200 + + base-modem: add missing 'reprobe' property setup + + The sim hotswap logic likely just uses the getter/setter methods, + but we should + anyway fix the property definition bits. + + src/mm-base-modem.c | 8 ++++++++ + src/mm-base-modem.h | 1 + + 2 files changed, 9 insertions(+) + +commit 2a499f5557fbc1726d4e8d5b39c7c59edf00bdbe +Author: Daniele Palmas +Date: Thu Sep 22 16:24:23 2016 +0200 + + blacklist: add another Infineon flashloader device + + This patch adds another Infineon flashloader device 0x8087/0x0801 + to the blacklist + + Reference to the kernel commit: + github.com/torvalds/linux/commit/f190fd92458da3e869b4e2c6289e2c617490ae53 + + src/77-mm-usb-device-blacklist.rules | 1 + + 1 file changed, 1 insertion(+) + +commit fe6f374af6650e58acb8de312fa87afaab2aec92 +Author: Aleksander Morgado +Date: Sun Sep 18 16:36:24 2016 +0200 + + huawei: fix interface class/subclass/protocol matching + + Commit a66871a2876be2236f634ff6b5e59d20de1ce5df introduced an + additional + ATTRS{idVendor} match condition in the same rules matching by + interface class, + subclass and protocol. We shouldn't be doing that because we cannot + mix parent + attribute matchings from different parents. + + plugins/huawei/77-mm-huawei-net-port-types.rules | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 07858461b87ed8356b48fb084c2ed2d2aa78fee9 +Author: Aleksander Morgado +Date: Sun Sep 18 15:51:32 2016 +0200 + + dell,telit: set one tag per rule match + + plugins/dell/77-mm-dell-port-types.rules | 5 +++-- + plugins/telit/77-mm-telit-port-types.rules | 6 ++++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit c7d8ac622a56142325af1e9b51d0cce1f06eaa3d +Author: Aleksander Morgado +Date: Sun Sep 18 15:43:30 2016 +0200 + + udev: fix tagging per interface number + + Commit 7ff57f9808f35d434b638a67b84481271c67c90e introduced a change + to try to + use ATTRS{bInterfaceNumber} as a common way to match by interface + number, but + this logic is broken because all the rules that we use to match + by interface + number (attribute in the interface device) also require matching + by idVendor + and idProduct (attributes in the physdev device), and udev rules + forbid matches + from more than one parent device at a time. + + We could use ATTR{bInterfaceNumber} (instead of ATTRS) to tag the + actual USB + interface device, but that would require a change in all the plugins + to look for + the tag not in the TTY device, but in its parent. + + So, recover the original behavior, where a hidden property is + created containing + the first bInterfaceNumber found in the list of parent devices, + and then run + the matches against idVendor and idProduct only if the hidden property + is found + with the expected value. + + plugins/cinterion/77-mm-cinterion-port-types.rules | 3 +- + plugins/haier/77-mm-haier-port-types.rules | 3 +- + plugins/longcheer/77-mm-longcheer-port-types.rules | 168 +++++++------- + plugins/mbm/77-mm-ericsson-mbm.rules | 40 ++-- + plugins/mtk/77-mm-mtk-port-types.rules | 26 ++- + plugins/nokia/77-mm-nokia-port-types.rules | 27 +-- + plugins/simtech/77-mm-simtech-port-types.rules | 15 +- + plugins/telit/77-mm-telit-port-types.rules | 29 +-- + plugins/x22x/77-mm-x22x-port-types.rules | 42 ++-- + plugins/zte/77-mm-zte-port-types.rules | 245 + +++++++++++---------- + 10 files changed, 307 insertions(+), 291 deletions(-) + +commit aa0e1081070b1062c696d31ed3c68e9511733ad1 +Author: Aleksander Morgado +Date: Sun Sep 18 14:08:20 2016 +0200 + + udev: fix SUBSYSTEMS and ATTRS{idVendor} checks + + Rules with a single condition where a parent property is checked + with != don't + work properly. E.g.: + SUBSYSTEMS!="usb", GOTO="end" + or: + ATTRS{idVendor}!="abcd", GOTO="end" + + Instead, we can mix both those previous parent rules and match them: + SUBSYSTEMS=="usb",ATTRS{idVendor}=="abcd", GOTO="next" + GOTO="end" + LABEL="next" + # Apply rules here + LABEL="end" + + In this case both SUBSYSTEMS and ATTRS conditions apply to the + parent usb_device + (idVendor attribute is only available in the usb_device), so they + apply to all + ports of the same device. + + plugins/cinterion/77-mm-cinterion-port-types.rules | 7 ++++--- + plugins/haier/77-mm-haier-port-types.rules | 7 ++++--- + plugins/huawei/77-mm-huawei-net-port-types.rules | 6 ++++-- + plugins/longcheer/77-mm-longcheer-port-types.rules | 8 ++------ + plugins/mbm/77-mm-ericsson-mbm.rules | 12 +++++------- + plugins/mtk/77-mm-mtk-port-types.rules | 8 +++----- + plugins/nokia/77-mm-nokia-port-types.rules | 7 ++++--- + plugins/simtech/77-mm-simtech-port-types.rules | 7 ++++--- + plugins/telit/77-mm-telit-port-types.rules | 7 ++++--- + plugins/x22x/77-mm-x22x-port-types.rules | 7 ++----- + plugins/zte/77-mm-zte-port-types.rules | 6 ++++-- + 11 files changed, 40 insertions(+), 42 deletions(-) + +commit 546d33db6c8faa9a6ab48ae3e00a0c8339a576a8 +Author: Dan Williams +Date: Thu Sep 8 11:11:58 2016 -0500 + + broadband-modem-huawei: fix missing return in unsolicited voice + message enable + + plugins/huawei/mm-broadband-modem-huawei.c | 1 + + 1 file changed, 1 insertion(+) + +commit 03a6d969ab594dab9124ef680cf3944e56870a85 +Author: Dan Williams +Date: Thu Aug 18 11:39:11 2016 -0500 + + broadband-modem-huawei: implement Modem.Signal extended signal + info interface + + Implement the detailed signal info interface for some Huawei 3GPP + modems + including those based on HiSilicon chipsets like the E3276. + Known not to + work on many Qualcomm-based Huawei modems like E392, E397, and E367 as + they don't support the ^HCSQ command, but they do support QMI and so + have access to the extended signal interface via QMI. + + plugins/huawei/mm-broadband-modem-huawei.c | 314 + ++++++++++++++++++++++- + plugins/huawei/mm-modem-helpers-huawei.c | 71 +++++ + plugins/huawei/mm-modem-helpers-huawei.h | 12 + + plugins/huawei/tests/test-modem-helpers-huawei.c | 61 +++++ + src/mm-modem-helpers.c | 17 +- + 5 files changed, 467 insertions(+), 8 deletions(-) + +commit 3d95a9863bd9ee3c150d4039fe42e47980a9247a +Author: Tabor Kelly +Date: Fri Aug 19 12:44:29 2016 -0700 + + blacklist: add blacklist udev rule for U-blox7 GPS/GLOSNASS USB + dongle. + + Signed-off-by: Tabor Kelly + + src/77-mm-usb-device-blacklist.rules | 1 + + 1 file changed, 1 insertion(+) + +commit 7fb366c41a7b62723df6ab67b611510216c14b0a +Author: Aleksander Morgado +Date: Mon Aug 15 13:11:22 2016 +0200 + + core: use MM-specific logging methods always instead of the generic + GLib ones + + plugins/huawei/mm-broadband-modem-huawei.c | 8 +++---- + plugins/mbm/mm-modem-helpers-mbm.c | 11 ++++----- + src/mm-base-bearer.c | 2 +- + src/mm-broadband-modem-mbim.c | 12 +++++----- + src/mm-broadband-modem-qmi.c | 36 + +++++++++++++++--------------- + src/mm-charsets.c | 6 ++--- + src/mm-error-helpers.c | 13 +++++------ + src/mm-iface-modem.c | 2 +- + src/tests/test-charsets.c | 20 +++++++++++++++++ + 9 files changed, 65 insertions(+), 45 deletions(-) + +commit 2306a466c8a9bf39d0035538a2b73c5e96c73111 +Author: Dan Williams +Date: Fri Aug 12 12:05:51 2016 -0500 + + api,signal: fix LTE signal dictionary docstring + + introspection/org.freedesktop.ModemManager1.Modem.Signal.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 048667ffc2e137672fb78037342283997f732250 +Author: Aleksander Morgado +Date: Wed Aug 10 09:49:40 2016 +0200 + + core: minor coding style changes + + src/mm-base-modem.c | 1 - + src/mm-broadband-modem.c | 11 +++-------- + src/mm-broadband-modem.h | 2 -- + src/mm-device.c | 4 +--- + src/mm-iface-modem.c | 9 +++------ + 5 files changed, 7 insertions(+), 20 deletions(-) + +commit f6708619393893507396f0a3314c3cc3e4b93791 +Author: Carlo Lobrano +Date: Mon Aug 8 15:47:19 2016 +0200 + + telit: add support to SIM hot swap + + MMBroadbandModemTelit: + * added logic to set MMBroadbandModem's SIM_HOT_SWAP property to TRUE + * added function to enable QSS unsolicited + * added QSS unsolicited handler + + plugins/telit/mm-broadband-modem-telit.c | 141 + ++++++++++++++++++++++++++++++- + 1 file changed, 140 insertions(+), 1 deletion(-) + +commit 60f4f9e57df90cf094fffb6896ffce8dba15d244 +Author: Carlo Lobrano +Date: Mon Aug 8 15:47:18 2016 +0200 + + modem: support SIM hot swap + + BaseModem + added reprobe property. + + MMDevice + added logic to recreate the modem if it is set invalid and + "to reprobe" + + MMBroadbandModem + * added initialization step for SIM hot swap: + 1. keep dedicated ports open to listen to modem's unsolicited + 2. dedicated error management in case of initialization failure + due to SIM missing + * added function to be called in order to act upon SIM + insertion/removal: + 1. close dedicated ports + 2. set the modem to be reprobed + 3. disable modem + * added SIM HOT SWAP boolean property + + MMIfaceModem + * added initialization step for SIM hot swap, if supported by + the plugin + * dedicated error management in case of initialization failure due + to SIM missing + + src/mm-base-modem.c | 26 ++++++++++ + src/mm-base-modem.h | 4 ++ + src/mm-broadband-modem.c | 120 + +++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-broadband-modem.h | 4 ++ + src/mm-device.c | 15 ++++++ + src/mm-iface-modem.c | 56 ++++++++++++++++++++++ + src/mm-iface-modem.h | 17 +++++-- + 7 files changed, 233 insertions(+), 9 deletions(-) + +commit 3047522b2e494776d9aced64180e54c46e861de1 +Author: Aleksander Morgado +Date: Wed Aug 10 07:46:34 2016 +0200 + + api,signal: Ec/Io is in dB, not dBm + + introspection/org.freedesktop.ModemManager1.Modem.Signal.xml | 2 +- + libmm-glib/mm-signal.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7460793caafe86af21c73b96b709253ae79346b5 +Author: Aleksander Morgado +Date: Tue Aug 9 08:40:05 2016 +0200 + + libmm-glib,helpers: don't warn when trying to read invalid match + info index + + We may want to use the mm_get_()_from_match_info() calls to read + optional items, + so that the method returns FALSE if the item index doesn't apply. So, + avoid the + implicit warning issued by g_return_val_if_fail(). + + libmm-glib/mm-common-helpers.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit f9e4e6b8f12ef345117dff9dd8adc28cf5154383 +Author: Aleksander Morgado +Date: Sat Aug 6 13:02:19 2016 +0200 + + device: ignored ports are also owned by the device, so include them + in lookup + + src/mm-device.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 764bfbce9d3b473fa3106e35bc11dc458d8f1429 +Author: Aleksander Morgado +Date: Wed Mar 30 12:50:43 2016 +0200 + + mtk,udev: single 'usb' subsystems check + + plugins/mtk/77-mm-mtk-port-types.rules | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit c7c65e2d572793373b8105e2a78e94bc3b10fce6 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:08 2016 +0200 + + udev: simpler check for rfcomm device names + + Just the same kind of match we use for cdc-wdm devices. + + src/80-mm-candidate.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1ca47e4b52b04ef4c7b652f39097c9469dde6429 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:07 2016 +0200 + + zte,udev: avoid making the rules tty-only, and simplify single + vendor check + + The rules were matched only against devices with an exact 'tty' + subsystem, and + that means that we were not properly adding additional tags on + e.g. wwan or + cdc-wdm devices. + + plugins/zte/77-mm-zte-port-types.rules | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit e47e654d335a5bd8311090fddef53b621c3a1496 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:06 2016 +0200 + + simtech,udev: simplify single vendor check + + plugins/simtech/77-mm-simtech-port-types.rules | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +commit d9ff08749cd7482b2a2355a14ce72f3e6d6ba1a0 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:05 2016 +0200 + + nokia,udev: simplify single vendor check + + plugins/nokia/77-mm-nokia-port-types.rules | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +commit a5f33f0070992ed836cdfdbc8e82f19c779b42d2 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:04 2016 +0200 + + telit,udev: single 'usb' subsystems check and simplified single + vendor check + + plugins/telit/77-mm-telit-port-types.rules | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit 4d53e2eb98b394c49ad2800786fd624ff36ac26e +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:03 2016 +0200 + + mbm,udev: additional per-vendor conditions for quicker processing + + plugins/mbm/77-mm-ericsson-mbm.rules | 32 + ++++++++++++++++++++++++++++---- + 1 file changed, 28 insertions(+), 4 deletions(-) + +commit a66871a2876be2236f634ff6b5e59d20de1ce5df +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:02 2016 +0200 + + huawei,udev: single 'usb' systems check, and per-rule vendor-specific + conditions + + plugins/huawei/77-mm-huawei-net-port-types.rules | 20 + ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 55dbb9fdb99a3e59f8d4fbae05b97b246ce21f38 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:01 2016 +0200 + + longcheer,udev: single 'usb' subsystems check + + plugins/longcheer/77-mm-longcheer-port-types.rules | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 2a171b49519e9ac948e7ed1e9a72a56e89982fb7 +Author: Aleksander Morgado +Date: Thu Jul 28 00:14:00 2016 +0200 + + cinterion,udev: ensure 'usb' subsystems before idVendor/idProduct + rules + + plugins/cinterion/77-mm-cinterion-port-types.rules | 1 + + 1 file changed, 1 insertion(+) + +commit 840143aa3df2edf541d55dea91c3bfa86a1f7c3b +Author: Aleksander Morgado +Date: Thu Jul 28 00:13:59 2016 +0200 + + haier,udev: simplify single vendor check + + plugins/haier/77-mm-haier-port-types.rules | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +commit 6e999584bec213fe2176764cb42b821bd891ab4e +Author: Aleksander Morgado +Date: Thu Jul 28 00:13:58 2016 +0200 + + x22x,udev: single 'usb' subsystems check + + plugins/x22x/77-mm-x22x-port-types.rules | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 7ff57f9808f35d434b638a67b84481271c67c90e +Author: Aleksander Morgado +Date: Thu Jul 28 00:13:57 2016 +0200 + + udev: replace ENV{.MM_USBIFNUM} conditions with + ATTRS{bInterfaceNumber} + + plugins/cinterion/77-mm-cinterion-port-types.rules | 4 +- + plugins/haier/77-mm-haier-port-types.rules | 3 +- + plugins/longcheer/77-mm-longcheer-port-types.rules | 170 +++++++------- + plugins/mbm/77-mm-ericsson-mbm.rules | 37 ++-- + plugins/mtk/77-mm-mtk-port-types.rules | 26 +-- + plugins/nokia/77-mm-nokia-port-types.rules | 27 ++- + plugins/simtech/77-mm-simtech-port-types.rules | 15 +- + plugins/telit/77-mm-telit-port-types.rules | 29 ++- + plugins/x22x/77-mm-x22x-port-types.rules | 42 ++-- + plugins/zte/77-mm-zte-port-types.rules | 245 + ++++++++++----------- + 10 files changed, 291 insertions(+), 307 deletions(-) + +commit 0b35e71d464fd8e422ddb8b7260d44969e1812f4 +Author: Aleksander Morgado +Date: Thu Jul 28 00:13:56 2016 +0200 + + udev: replace ENV{ID_VENDOR_ID} conditions with ATTRS{idVendor} + + plugins/cinterion/77-mm-cinterion-port-types.rules | 2 +- + plugins/huawei/77-mm-huawei-net-port-types.rules | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 1a213e3b62abd8e8afee3741ef88bfc6d4b913f0 +Author: Aleksander Morgado +Date: Thu Jul 28 00:13:55 2016 +0200 + + udev: remove ENV{DEVTYPE}!="usb_device" rules + + They're actually a subcase of SUBSYSTEM!="usb", which we apply + just before. + + src/77-mm-usb-device-blacklist.rules | 1 - + src/77-mm-usb-serial-adapters-greylist.rules | 1 - + 2 files changed, 2 deletions(-) + +commit f33ea91ccf53be6f7177711f3560f806644ccf01 +Author: Dan Williams +Date: Tue Aug 2 16:27:56 2016 -0500 + + base-call: formatting cleanups + + src/mm-base-call.c | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +commit 5350b9f568dc4375c874a3e3912458d512a3cbe4 +Author: Dan Williams +Date: Mon Jul 25 23:07:03 2016 -0500 + + broadband-modem/libqcdm: add signal strength from QCDM EVDO Pilot + Sets log messages + + When a CDMA-only modem is registered with the EVDO network, its not + possible to + read signal strength in the following cases: + + 1) while a data connection is active on single-AT-port modems, + because the AT + port is used for PPP and not available for AT+CSQ, AT+CIND or + vendor-specific + signal strength commands + + 2) when the modem reports only CDMA 1x signal strength with AT+CSQ + + Now that we have a reasonable interpretation of RSSI from the QCDM + EVDO Pilot Sets V2 log messgae, use that when other means of getting + signal strength aren't available. + + libqcdm/src/Makefile.am | 2 + + libqcdm/src/log-items.h | 34 +++---- + libqcdm/src/logs.c | 184 +++++++++++++++++++++++++++++++++++ + libqcdm/src/logs.h | 50 ++++++++++ + src/mm-broadband-modem.c | 240 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-port-serial-qcdm.c | 160 ++++++++++++++++++++++++++++++- + src/mm-port-serial-qcdm.h | 16 ++++ + 7 files changed, 663 insertions(+), 23 deletions(-) + +commit 30f60de7d3f4d61a100ce1e6a01a746bd2409b81 +Author: Lubomir Rintel +Date: Wed Jul 27 09:26:20 2016 +0200 + + blacklist: include some more Arduinos + + All "2a03 dog hunter AG" devices seem to be Arduinos. + + https://bugzilla.redhat.com/show_bug.cgi?id=1261040 + + src/77-mm-usb-device-blacklist.rules | 1 + + 1 file changed, 1 insertion(+) + +commit bff43b26bf1fb678e0e13284a581b41fd2af7ec9 +Author: Carlo Lobrano +Date: Fri May 13 17:15:21 2016 +0200 + + telit: adding a short delay after SIM unlock + + A short delay is necessary with some SIMs when + they have just been unlocked. Using 1 second as secure margin. + + plugins/telit/mm-broadband-modem-telit.c | 38 + ++++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +commit 43d97a46233e65eb5d13a38b4fe4d70b6725e904 +Author: Carlo Lobrano +Date: Fri May 13 17:15:20 2016 +0200 + + iface-modem: inverted steps in update_lock_info_context_step + + Inverted steps UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES and + UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK. + + Soon after the unlock, the SIM can be busy and + loading unlock retries might fail. + + When implemented, let run "after unlock" logic before any other + step in + update lock info, when SIM is not locked this change does not have any + effect since "after unlock" is not executed. + + src/mm-iface-modem.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit dce9f056738d151e81070188f4312f11758411be +Author: Aleksander Morgado +Date: Tue Jul 26 13:27:37 2016 +0200 + + build: post release version bump to 1.7.0 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 397761c9758c3a8c2d130afaf36dab645d6e0ecf +Author: Aleksander Morgado +Date: Tue Jul 26 12:53:04 2016 +0200 + + release: bump version to 1.6.0 + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7b4bd888f0e3cc095e566085b99c0061eb7c39a5 +Author: Aleksander Morgado +Date: Tue Jul 26 13:07:37 2016 +0200 + + build: updated copyright years up to 2016 + + cli/mmcli.c | 2 +- + docs/reference/api/ModemManager-docs.xml | 3 +++ + docs/reference/libmm-glib/libmm-glib-docs.xml | 4 ++++ + src/mm-context.c | 2 +- + 4 files changed, 9 insertions(+), 2 deletions(-) + +commit dbb05afba8b2f92cf61d6ea71a4ea14ce34835d6 +Author: Aleksander Morgado +Date: Mon Jul 25 13:17:44 2016 +0200 + + examples: avoid warning in modem-watcher-python example + + PyGIWarning: ModemManager was imported without specifying a + version first. Use gi.require_version('ModemManager', '1.0') + before import to ensure that the right version gets loaded. + + examples/modem-watcher-python/ModemWatcher.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 24fd3ef5fb2b4795e7f3bad96d16ee36758e9e8d +Author: Aleksander Morgado +Date: Mon Jul 25 10:36:42 2016 +0200 + + examples: add SMS sender in python + + configure.ac | 1 + + examples/Makefile.am | 2 +- + examples/sms-python/Makefile.am | 4 ++++ + examples/sms-python/README | 20 ++++++++++++++++ + examples/sms-python/sms-python | 51 + +++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 77 insertions(+), 1 deletion(-) + +commit a7942177c9f969faec1d767c67d4019a61dc7e16 +Author: Lubomir Rintel +Date: Wed Jul 20 19:55:20 2016 +0200 + + build: don't disable the aliasing checks + + We now don't break the strict aliasing rules. + + Also, having a compiler flag that disables a warning among the flags + that are + meant to add extra sanity checking is not correct either: + --enable-extra-warnings=no would generate a bad aliasin warning while + the --enable-extra-warnings=yes would not. + + m4/compiler_warnings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 488992b0109e2a3fb55a1ebd9180b7fa208a8ff6 +Author: Lubomir Rintel +Date: Wed Jul 20 19:53:00 2016 +0200 + + qcdm: avoid upsetting the compiler with wrong aliasing + + We shouldn't be accessiing u_int8_t * as u_int16_t *. Let's construct + the 16-bit value by or-ing the 8-bit halves directly; avoiding the + endianness conversion too. + + libqcdm/src/commands.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 803caab80a8aea7bcdb846aa2b61cdd0bf794360 +Author: Dan Williams +Date: Wed Jul 20 11:37:45 2016 -0500 + + libqcdm: add HDR Pilot Sets V2 log item structures + + Apparently I was looking at this in 2012: + https://blogs.gnome.org/dcbw/2012/11/14/got-evdo-help-me-out/ + + So why not at least get the structures into libqcdm and figure + out a rough correlation between pilot energy and EC/IO. + + libqcdm/src/log-items.h | 50 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +commit f137268ce12daaf56b79e508d6cba5e543feac36 +Author: Aleksander Morgado +Date: Wed Jul 20 07:51:54 2016 +0200 + + iface-modem: fix checking for single capabilities + + The mm_iface_modem_is_*_only() checks were validating that all + the other + capabilities except for the ones being queried were unset, but the + check wasn't + explicitly checking that the actual capabilities being queried + were set. + + This was making the check fail when capabilities == + MM_MODEM_CAPABILITY_NONE. + + Reported-by: Matthew Stanger + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit ddbc2195687bf4f5c94d7e60d808ddb695052f7f +Author: Aleksander Morgado +Date: Fri Jul 15 12:23:01 2016 +0200 + + bearer-qmi: decide IP method during connection attempt + + Deciding the IP method to use based on the underlying QMI port LLP + should not be + done when the bearer object is created, because the QMI port in use + may not + actually be open or have been opened at that time. During the + connection attempt + we do make sure the QMI port is open, so we should check the LLP to + use just + after that step. + + src/mm-bearer-qmi.c | 97 + ++++++++++++-------------------------------- + src/mm-bearer-qmi.h | 5 +-- + src/mm-broadband-modem-qmi.c | 11 +---- + 3 files changed, 28 insertions(+), 85 deletions(-) + +commit 46b17908ce18e89280db3cb7fa0981ee4fec5a23 +Author: Aleksander Morgado +Date: Thu Jul 14 14:59:17 2016 +0200 + + broadband-modem-qmi: fix dhcp/static IP setting when kernel data + format updated + + When the logic decided that we had to update the kernel data format + to match the + one configured in the WWAN network interface, we were not flagging + the port LLP + with the correct value, what resulted in NetworkManager trying to + use dhclient + on the raw-ip interface: + + dhclient[3257]: Unsupported device type 65534 for "wwan1" + dhclient[3257]: + dhclient[3257]: If you think you have received this message due + to a bug rather + dhclient[3257]: than a configuration issue please read the + section on submitting + dhclient[3257]: bugs on either our web page at www.isc.org or + in the README file + dhclient[3257]: before submitting a bug. These pages explain + the proper + dhclient[3257]: process and the information we find helpful + for debugging.. + dhclient[3257]: + dhclient[3257]: exiting. + + Fix the internal LLP flag, so that Static IP addressing is requested + for all raw-ip + based interfaces. + + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-port-qmi.c | 8 +++++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +commit 48f02107395986c31b95067b5f08de256dab3c18 +Author: Dan Williams +Date: Fri Jun 17 10:39:02 2016 -0500 + + bearer-mbim: use the context IP type MM asked to be activated instead + of modem response + + MM never passes MBIM_CONTEXT_IP_TYPE_DEFAULT which would require + paying + attention to the ip_type in the reply to figure out what type + the modem + activated. Instead, MM always specifies the ip_type it wants to + activate, + and some modems (K5160) return a different type in the response. + The modem + is required to activate the type MM asks for or return an error, so if + the activation was successful we can safely assume the modem activated + the ip_type we want, and we can ignore the ip_type in the response. + + src/mm-bearer-mbim.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +commit d757c32b945da7eafcd95080b30116c98f4e665d +Author: Aleksander Morgado +Date: Thu Jul 7 20:22:31 2016 +0200 + + release: bump version to 1.5.993 (1.6-rc4) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b09b7dfc2d0ab2fde2c8b9557e494381a90ce327 +Author: Aleksander Morgado +Date: Thu Jul 7 20:22:00 2016 +0200 + + NEWS: update for 1.6-rc4 + + NEWS | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit f5cd7476f4bcd3961d408b603344ad5fff03e40d +Author: Aleksander Morgado +Date: Mon Jun 6 22:15:55 2016 +0200 + + broadband-modem-mbim: try to use FCC Auth through QMI-over-MBIM if + power up fails + + configure.ac | 4 +- + src/mm-broadband-modem-mbim.c | 445 + ++++++++++++++++++++++++++++++++++++------ + 2 files changed, 382 insertions(+), 67 deletions(-) + +commit 8080be8209c406169f24d52b69ddda4dd8485c8c +Author: Dan Williams +Date: Wed Jun 15 14:16:52 2016 -0500 + + broadband-bearer-mbim: log context IP type when connecting + + src/mm-bearer-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 182cf1fa891797438fc79e9cb01bd1cb1b4a3fd8 +Author: Dan Williams +Date: Wed Jun 1 12:12:21 2016 -0500 + + iface-modem-firmware: clarify log message about unsupported firmware + interface + + src/mm-iface-modem-firmware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f232afffe92e61b0c0471608ec55fa8e748196a2 +Author: Dan Williams +Date: Wed Jun 1 11:33:33 2016 -0500 + + broadband-modem: document why firmware/OMA interfaces are left + enabled in FAILURE state + + src/mm-broadband-modem.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit a5baec65be1b20e0d3a223c54ed79230b6d9509e +Author: Aleksander Morgado +Date: Tue May 31 11:22:13 2016 +0200 + + simtech: support QMI devices + + plugins/simtech/mm-plugin-simtech.c | 79 + ++++++++++++++++++++----------------- + 1 file changed, 43 insertions(+), 36 deletions(-) + +commit 969189d42cc88bce9bdd6fb5e387352a02f81f2a +Author: Ting-Yuan Huang +Date: Sat May 14 15:25:32 2016 +0800 + + plugin-manager: protect mm_plugin_{major,minor}_version + + This patch makes declarations bind to definitions within the same + module + to prevent the potential ambiguity if referenced directly. + + AddressSanitizer think they violated one definition rule, although + those symbols are accessed by address through their modules and do + not depend on the order of the libararies loaded. + + plugins/altair/mm-plugin-altair-lte.c | 4 ++-- + plugins/anydata/mm-plugin-anydata.c | 4 ++-- + plugins/cinterion/mm-plugin-cinterion.c | 4 ++-- + plugins/dell/mm-plugin-dell.c | 4 ++-- + plugins/generic/mm-plugin-generic.c | 4 ++-- + plugins/haier/mm-plugin-haier.c | 4 ++-- + plugins/huawei/mm-plugin-huawei.c | 4 ++-- + plugins/iridium/mm-plugin-iridium.c | 4 ++-- + plugins/linktop/mm-plugin-linktop.c | 4 ++-- + plugins/longcheer/mm-plugin-longcheer.c | 4 ++-- + plugins/mbm/mm-plugin-mbm.c | 4 ++-- + plugins/motorola/mm-plugin-motorola.c | 4 ++-- + plugins/mtk/mm-plugin-mtk.c | 4 ++-- + plugins/nokia/mm-plugin-nokia-icera.c | 4 ++-- + plugins/nokia/mm-plugin-nokia.c | 4 ++-- + plugins/novatel/mm-plugin-novatel-lte.c | 4 ++-- + plugins/novatel/mm-plugin-novatel.c | 4 ++-- + plugins/option/mm-plugin-hso.c | 4 ++-- + plugins/option/mm-plugin-option.c | 4 ++-- + plugins/pantech/mm-plugin-pantech.c | 4 ++-- + plugins/samsung/mm-plugin-samsung.c | 4 ++-- + plugins/sierra/mm-plugin-sierra-legacy.c | 4 ++-- + plugins/sierra/mm-plugin-sierra.c | 4 ++-- + plugins/simtech/mm-plugin-simtech.c | 4 ++-- + plugins/telit/mm-plugin-telit.c | 4 ++-- + plugins/thuraya/mm-plugin-thuraya.c | 4 ++-- + plugins/via/mm-plugin-via.c | 4 ++-- + plugins/wavecom/mm-plugin-wavecom.c | 4 ++-- + plugins/x22x/mm-plugin-x22x.c | 4 ++-- + plugins/zte/mm-plugin-zte.c | 4 ++-- + src/mm-plugin.h | 9 +++++++++ + 31 files changed, 69 insertions(+), 60 deletions(-) + +commit 55f3ab80835114342618083664c4fa585455b9e0 +Merge: 830b6ebc ba097f1a +Author: Dan Williams +Date: Fri May 27 12:39:56 2016 -0500 + + merge: fix various mbm-related connect/disconnect issues (fdo #95302) + (fdo #95304) + + https://bugs.freedesktop.org/show_bug.cgi?id=95302 + https://bugs.freedesktop.org/show_bug.cgi?id=95304 + +commit ba097f1a434761a5129c07b5e4533e57bda43f3e +Author: Dan Williams +Date: Wed May 11 13:18:12 2016 -0500 + + broadband-bearer-mbm: connect errors should trigger a disconnect + + Otherwise we may leave a bearer connected when ModemManager doesn't + think it's connected. Prevents a CME ERROR 277 loop on connect when + the bearer hasn't been torn down correctly. + + plugins/mbm/mm-broadband-bearer-mbm.c | 38 + +++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +commit 5c3461ff9c01583ee97a76cbed544144c44627db +Author: Dan Williams +Date: Wed May 11 12:27:56 2016 -0500 + + broadband-bearer-mbm: wait for disconnect to complete + + Wait for either an E2NAP unsolicited disconnect status or (for older + devices) an ENAP poll response before completing the disconnect. + Otherwise the client may start connecting again (such as + NetworkManager autoconnect retry) and the unsolicited E2NAP may + abort it, or the modem may return CME ERROR 277 ("not disconnected + yet") for the next connection attempt. + + https://bugs.freedesktop.org/attachment.cgi?id=123525 + + plugins/mbm/mm-broadband-bearer-mbm.c | 143 + ++++++++++++++++++++++++++++++---- + 1 file changed, 130 insertions(+), 13 deletions(-) + +commit 9cc851954d6c0525ae97b8b0be7661870aa17224 +Author: Dan Williams +Date: Wed May 11 11:24:59 2016 -0500 + + broadband-bearer-mbm: simplify dial_3gpp connection setup flow + + There are a few key parts to this patch: + + 1) move the poll id into the Dial3gppContext structure as it is + conceptually part of the connection context data. This simplifies + context cleanup by keeping the poll id cleanup in one place. + + 2) move unsolicited connection status (E2NAP) handling into the + normal connection codepath, instead of completing the connection + context from the report_connection_status() E2NAP handler. This + simplifies connect code by not requiring checks for a NULL context + everywhere, and allows us to pass the Dial3gppContext structure + around instead of the Bearer object, since the Dial3gppContext + will never be comleted/freed outside the normal connection flow + codepaths like GLib idles and AT command requests. + + 3) use the connect context cancellable for all AT command requests + in the connect path. This lets us use the error return from + mm_base_modem_at_command_full_finish() to handle cancellation and + also not bother listening to the 'cancelled' signal of the + cancellable, since we can just check for cancellation the next time + the ENAP poll function runs. + + https://bugs.freedesktop.org/show_bug.cgi?id=95304 + + plugins/mbm/mm-broadband-bearer-mbm.c | 297 + +++++++++++++--------------------- + 1 file changed, 112 insertions(+), 185 deletions(-) + +commit 830b6ebca8e218efeecd211b7a058366ef26272e +Author: Dan Williams +Date: Wed May 11 16:25:59 2016 -0500 + + broadband-bearer-icera: deactivate context before authentication + + If the modem thinks a PDP context is already active it'll return + 583 errors from IPDPCFG and IPDPACT until the context is + deactivated. Deactivation was previously done after authentication, + but needs to be done before any part of the connect process to + ensure the PDP context is inactive. + + The previous approach worked only if the context was being + deactivated already (which can take a bit of time) because it would + be deactivated after a few seconds and the connect could continue. + This approach works for more cases (like a MM crash and restart + while the modem is connected). + + plugins/icera/mm-broadband-bearer-icera.c | 99 + ++++++++++++++++--------------- + 1 file changed, 52 insertions(+), 47 deletions(-) + +commit e27f4a6226cc7c3293d16e9f57ea37a8aec6b60a +Author: Lubomir Rintel +Date: Thu May 5 19:34:19 2016 +0200 + + mbm: clean up the context on activate_ready + + Otherwise the dangling pointer to the context that's being deallocated + causes a + crash on spontaneous E2NAP receipt: + + ModemManager[1567]: [1462468083.031326] + [mm-iface-modem.c:1431] __iface_modem_update_state_internal(): + Modem /org/freedesktop/ModemManager1/Modem/0: state changed + (connecting -> registered) + ModemManager[1567]: [1462468083.053745] + [mm-port-serial-at.c:459] debug_log(): (ttyACM0): <-- + '*E2NAP: 0,36' + ModemManager[1567]: [1462468083.053857] + [mbm/mm-broadband-modem-mbm.c:824] e2nap_received(): disconnected + + (ModemManager:1567): GLib-GIO-CRITICAL **: + g_simple_async_result_set_error: assertion 'G_IS_SIMPLE_ASYNC_RESULT + (simple)' failed + + Program received signal SIGTRAP, Trace/breakpoint trap. + g_logv (log_domain=0x7ffff7086798 "GLib-GIO", + log_level=G_LOG_LEVEL_CRITICAL, format=, + args=args@entry=0x7fffffffcda0) at gmessages.c:1046 + 1046 g_private_set (&g_log_depth, GUINT_TO_POINTER + (depth)); + Missing separate debuginfos, use: debuginfo-install + libmbim-1.12.4-2.el7.centos.x86_64 libqmi-1.14.2-1.el7.centos.x86_64 + (gdb) bt + #0 0x00007ffff6a508c3 in g_logv (log_domain=0x7ffff7086798 + "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=, + args=args@entry=0x7fffffffcda0) at gmessages.c:1046 + #1 0x00007ffff6a50a3f in g_log + (log_domain=log_domain@entry=0x7ffff7086798 "GLib-GIO", + log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, + format=format@entry=0x7ffff6abe73d "%s: assertion '%s' failed") + at gmessages.c:1079 + #2 0x00007ffff6a50a79 in g_return_if_fail_warning + (log_domain=log_domain@entry=0x7ffff7086798 "GLib-GIO", + pretty_function=pretty_function@entry=0x7ffff7092ce0 + <__FUNCTION__.13394> "g_simple_async_result_set_error", + expression=expression@entry=0x7ffff7092a40 "G_IS_SIMPLE_ASYNC_RESULT + (simple)") at gmessages.c:1088 + #3 0x00007ffff6ff9d3d in g_simple_async_result_set_error + (simple=0x7fffe8006e40, domain=297, code=0, format=0x7ffff175b53f + "Call setup failed") at gsimpleasyncresult.c:719 + #4 0x00007ffff17569ea in report_connection_status + (bearer=0x7fffe4008a40 [MMBroadbandBearerMbm], + status=MM_BEARER_CONNECTION_STATUS_DISCONNECTED) at + mbm/mm-broadband-bearer-mbm.c:174 + #5 0x000055555559c9f1 in mm_base_bearer_report_connection_status + (self=0x7fffe4008a40 [MMBroadbandBearerMbm], + status=MM_BEARER_CONNECTION_STATUS_DISCONNECTED) at + mm-base-bearer.c:1118 + #6 0x00007ffff17548ed in bearer_list_report_status_foreach + (bearer=0x7fffe4008a40 [MMBroadbandBearerMbm], ctx=0x7fffffffd060) + at mbm/mm-broadband-modem-mbm.c:805 + #7 0x00007ffff6a45f18 in g_list_foreach (list=, func=0x7ffff17548c9 , + user_data=0x7fffffffd060) at glist.c:994 + #8 0x00005555555a224b in mm_bearer_list_foreach + (self=0x5555558e0680 [MMBearerList], func=0x7ffff17548c9 + , user_data=0x7fffffffd060) + at mm-bearer-list.c:146 + #9 0x00007ffff1754a3d in e2nap_received (port=0x5555558e24c0 + [MMPortSerialAt], info=0x555555935730, self=0x555555900330 + [MMBroadbandModemMbm]) at mbm/mm-broadband-modem-mbm.c:850 + #10 0x000055555563d9fd in parse_unsolicited (port=0x5555558e24c0 + [MMPortSerialAt], response=0x7fffe80054f0) at + mm-port-serial-at.c:280 + #11 0x0000555555639915 in parse_response_buffer (self=0x5555558e24c0 + [MMPortSerialAt]) at mm-port-serial.c:889 + #12 0x0000555555639f0b in common_input_available + (self=0x5555558e24c0 [MMPortSerialAt], condition=G_IO_IN) at + mm-port-serial.c:1019 + #13 0x0000555555639fc7 in iochannel_input_available + (iochannel=0x555555926df0, condition=G_IO_IN, data=0x5555558e24c0) + at mm-port-serial.c:1042 + #14 0x00007ffff6a4979a in g_main_context_dispatch + (context=0x5555558a4a00) at gmain.c:3109 + #15 0x00007ffff6a4979a in g_main_context_dispatch + (context=context@entry=0x5555558a4a00) at gmain.c:3708 + #16 0x00007ffff6a49ae8 in g_main_context_iterate + (context=0x5555558a4a00, block=block@entry=1, + dispatch=dispatch@entry=1, self=) at gmain.c:3779 + #17 0x00007ffff6a49dba in g_main_loop_run (loop=0x5555558acf10) + at gmain.c:3973 + #18 0x000055555558d068 in main (argc=2, argv=0x7fffffffdc38) + at main.c:181 + (gdb) + + https://bugzilla.redhat.com/show_bug.cgi?id=1333293 + https://bugs.freedesktop.org/show_bug.cgi?id=95303 + + plugins/mbm/mm-broadband-bearer-mbm.c | 1 + + 1 file changed, 1 insertion(+) + +commit ff8f030d2422d20bf5f7f74afb8c135610fba4c5 +Author: Lubomir Rintel +Date: Wed May 4 16:11:44 2016 +0200 + + mtk: add D-Link DWM-156 A3 + + plugins/mtk/77-mm-mtk-port-types.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 1af8304a8f4916431d081a2dc34316dc7bdf717d +Author: Daniele Palmas +Date: Fri Apr 29 12:50:11 2016 +0200 + + build: modified Telit and Dell sections + + This patch adds section for building Telit common code and modifies + Dell section for using Telit library + + plugins/Makefile.am | 28 ++++++++++++++++++++++------ + 1 file changed, 22 insertions(+), 6 deletions(-) + +commit ed97ebf6bfac937501d4cee8fe97919f30b627c4 +Author: Daniele Palmas +Date: Fri Apr 29 12:50:10 2016 +0200 + + dell: add udev rules for 413c/81ba + + udev rules for Dell-branded 413c/81ba Telit modem are used for dynamic + port configuration in Telit plugin custom init + + plugins/dell/77-mm-dell-port-types.rules | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 4403bb7764268a3924ed0ed7d14c510751fdbb4d +Author: Daniele Palmas +Date: Fri Apr 29 12:50:09 2016 +0200 + + dell: add Telit manufacturer + + Dell-branded AT based Telit modems should use Telit plugin functions + + plugins/dell/mm-plugin-dell.c | 53 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 51 insertions(+), 2 deletions(-) + +commit 850318fd965d992994412688955f1e3ce8a9c97e +Author: Daniele Palmas +Date: Fri Apr 29 12:50:08 2016 +0200 + + telit: code refactoring + + This patch moves init and port grabbing functions to a separate file + to allow functions call from Dell plugin + + plugins/telit/mm-common-telit.c | 318 + ++++++++++++++++++++++++++++++++++++++++ + plugins/telit/mm-common-telit.h | 40 +++++ + plugins/telit/mm-plugin-telit.c | 300 + +------------------------------------ + 3 files changed, 360 insertions(+), 298 deletions(-) + +commit f5a061efbf29642521e3da6f5f6ff98129643143 +Author: Dan Williams +Date: Wed Apr 20 11:09:13 2016 -0500 + + bearer-mbim: fine-tune bearer IP method reporting + + v4: modems/providers may not return DNS servers and not all modems + support DHCP, so lack of DNS servers should not indicate a bearer + IP method of "DHCP". IP config daemon/scripts already have to handle + missing DNS anyway. + + v6: IPv6 requires SLAAC or DHCPv6 as part of the specification, so for + now we assume modems will support it. Provide all the info the modem + sent, but if there is any missing information use an IP method of + "DHCP" to indicate that info should be obtained via SLAAC/DHCPv6. + Only + use an IP method of "STATIC" when all basic properties are given by + the modem. + + include/ModemManager-enums.h | 16 +++++++---- + src/mm-bearer-mbim.c | 66 + +++++++++++++++++++++++++++++--------------- + 2 files changed, 54 insertions(+), 28 deletions(-) + +commit ccc148fe9bc24a687ba868070014028d7ad0bb22 +Author: Aleksander Morgado +Date: Tue Apr 19 13:14:00 2016 +0200 + + libmm-glib,common-helpers: fix reading boolean from string + + The "0" case wasn't being handled properly: + $ sudo mmcli -m 0 --create-bearer="apn=,allow-roaming=0" + Error parsing properties string: 'Cannot get boolean from string + '0'' + + libmm-glib/mm-common-helpers.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 59f57befa4be81b562f9adfbac39fbe19d88c111 +Author: Aleksander Morgado +Date: Mon Apr 18 08:11:45 2016 +0200 + + release: bump version to 1.5.992 (1.6-rc3) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5286eaca51b8a871e9b6a2d0825967414aa93249 +Author: Aleksander Morgado +Date: Mon Apr 18 08:11:00 2016 +0200 + + NEWS: include QMI network disconnections + + NEWS | 1 + + 1 file changed, 1 insertion(+) + +commit 80ce59385fb0bc24f9167f339d5673ede735e1c3 +Author: Dan Williams +Date: Wed Apr 13 12:16:57 2016 -0500 + + bearer-qmi: listen for Packet Service Status indication and handle + disconnection + + Hook up to the WDS Packet Service Status indication, listen for + disconnection events, and disconnect the bearer when we get one. + + src/mm-bearer-qmi.c | 139 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 139 insertions(+) + +commit 650f4a2e911e5d626e1c9d365437c7e1b2191fcc +Author: Aleksander Morgado +Date: Wed Apr 13 11:39:21 2016 +0200 + + huawei: fix reading IPv4 address in BE systems + + Tested by: + + https://bugs.freedesktop.org/show_bug.cgi?id=94777 + + plugins/huawei/mm-modem-helpers-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 62805a11f1cfbd92c36cb8215f2451f5018873c1 +Author: Aleksander Morgado +Date: Wed Apr 13 09:45:02 2016 +0200 + + port-probe: fix missing task disposals + + src/mm-port-probe.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 276e28fe81e7aeef8a4270fb7be3b542688c27e9 +Author: Aleksander Morgado +Date: Fri Apr 8 16:38:00 2016 +0200 + + port-probe: make sure stored task pointer is set to NULL before + completing + + When we were completing tasks in idle, the logic was like this: + + * Schedule task completion in idle + * self->priv->task = NULL + * (idle) Task completion callback called + + This meant that the self->priv->task was always set to NULL before the + completion callback was called, which is what we wanted as a new + task may be + scheduled in the callback itself. + + Now, without completing in idle, we were wrongly doing: + + * Task completion callback called + * self->priv->task = NULL + + This commit fixes the logic by making sure self->priv->task = NULL + before any + task completion. + + src/mm-port-probe.c | 184 + ++++++++++++++++++++++++++++------------------------ + 1 file changed, 100 insertions(+), 84 deletions(-) + +commit 8a386218690aeff7e2c923a14f91da7bbc046ed2 +Author: Carlo Lobrano +Date: Tue Apr 5 08:18:57 2016 +0200 + + dell: fixed cgmi_retries in dell_custom_init + + Initialized "cgmi_retries" variable from CustomInitContext with the + same value as the other retries, moreover the context is now allocated + with g_slice_new0. + + Before this changes, when cgmi_retries assumed big values during the + probing of no AT-capable ports, the command AT+CGMI + (mm-plugin-dell.c:custom_init_step) + was sent a semi-infinite number of times, blocking the plugin's + initialization. + + plugins/dell/mm-plugin-dell.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 1f13909d9b59176afd9cec32cfbd623b44ec8d80 +Author: Aleksander Morgado +Date: Fri Apr 1 13:06:55 2016 +0200 + + build: make '--with-suspend-resume' auto by default + + If systemd is found, enable suspend resume support. + + configure.ac | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit ae2988da933f39d8983c94aaeef3c1b6f98f3e4e +Author: Aleksander Morgado +Date: Fri Apr 1 12:59:25 2016 +0200 + + build: use 'no' to disable suspend/resume support, instead of 'none' + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0e5fdadcd39c0a51a62be29b42752415d4892a71 +Author: Aleksander Morgado +Date: Fri Apr 1 12:58:55 2016 +0200 + + build: use 'no' to disable polkit, instead of 'none' + + configure.ac | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 55408e8b946b4db77096d1ad403102823e1e6e25 +Author: Aleksander Morgado +Date: Sun Mar 27 21:52:46 2016 +0200 + + device: port probe may be in the ignored list + + src/mm-device.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit f156ec06fb74d2401ab7147c0977e4fdff20eb52 +Author: Aleksander Morgado +Date: Sun Mar 27 21:39:11 2016 +0200 + + context: use G_OPTION_ARG_FILENAME when a file path is expected + + cli/mmcli-modem-messaging.c | 2 +- + src/mm-context.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 0f9377686d08f4ac360c9f1df3366c91af44209f +Author: Aleksander Morgado +Date: Sun Mar 27 21:35:44 2016 +0200 + + context: fix --help output + + The options that require an argument should explicitly specify so. + + Before: + --log-level=INFO Log level: one of [ERR, WARN, INFO, + DEBUG] + --log-file Path to log file + + After: + --log-level=[LEVEL] Log level: one of ERR, WARN, INFO, + DEBUG + --log-file=[PATH] Path to log file + + src/mm-context.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6ba37aa041627d7246303cd7e46c8ff88f5634cc +Author: Aleksander Morgado +Date: Sun Mar 27 18:15:55 2016 +0200 + + base-modem: remove unused 'mm_base_modem_get_port()' method + + src/mm-base-modem.c | 24 ------------------------ + src/mm-base-modem.h | 3 --- + 2 files changed, 27 deletions(-) + +commit 1583452554385f0f714764467052d70dd1f384c4 +Author: Aleksander Morgado +Date: Sun Mar 27 18:14:20 2016 +0200 + + base-modem: remove unused 'mm_base_modem_owns_port()' method + + src/mm-base-modem.c | 8 -------- + src/mm-base-modem.h | 3 --- + 2 files changed, 11 deletions(-) + +commit 547b9b9d87963a3dcc827df65d835bbeb2e44dc7 +Author: Aleksander Morgado +Date: Sun Mar 27 18:11:24 2016 +0200 + + base-modem: remove unused 'mm_base_modem_release_port()' method + + src/mm-base-modem.c | 82 + ----------------------------------------------------- + src/mm-base-modem.h | 3 -- + 2 files changed, 85 deletions(-) + +commit ad03445bf7edc2a4e294b4179a03b42f1c759a1a +Author: Tomas Jura +Date: Sat Mar 26 15:43:13 2016 +0100 + + serial: do not restore termios on port close + + src/mm-port-serial.c | 10 ---------- + 1 file changed, 10 deletions(-) + +commit d6cee7782b550f0664a70080c38a3dad1f657723 +Author: Aleksander Morgado +Date: Fri Mar 25 11:15:14 2016 +0100 + + release: bump version to 1.5.991 (1.6-rc2) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 34961f20a6a7fc892983841eec6eee4796ce7450 +Author: Brian Norris +Date: Thu Mar 24 13:58:35 2016 -0700 + + libmm-glib: fix enum conversion warning/error + + mm-modem-oma.c:400:51: error: implicit conversion from enumeration + type 'MMOmaSessionType' to different enumeration type 'MMOmaFeature' + [-Werror,-Wenum-conversion] + g_return_val_if_fail (MM_IS_MODEM_OMA (self), + MM_OMA_SESSION_TYPE_UNKNOWN); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /usr/include/glib-2.0/glib/gmessages.h:382:11: note: expanded from + macro 'g_return_val_if_fail' + return (val); + \ + ~~~~~~ ^~~ + + This should be MMOmaFeature, not MMOmaSessionType. The end result + is the same, + as both are 0. + + libmm-glib/mm-modem-oma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2c1230ba7ba9d70f26bc2f76198a458321283a58 +Author: Aleksander Morgado +Date: Wed Mar 23 22:50:34 2016 +0100 + + po: sleep monitor source file was renamed + + Reported by: Michael Biebl + + po/POTFILES.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8fee9a99f065b845bd0a9915c8777e6ac60a67b2 +Author: Lubomir Rintel +Date: Tue Mar 22 21:00:31 2016 +0100 + + port-probe: unlink the task from probe before completing it + + The task completion may try to enqueue a next probe task and in + mm_port_probe_run() it asserts there's no task linked. + + https://bugs.freedesktop.org/show_bug.cgi?id=94664 + + Fixes: 1939c5ace50240127276efacec5c7f166483bb79 + + src/mm-port-probe.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit a0e8505156a31fc6fa119e4f4aefa3f1670588a6 +Author: Aleksander Morgado +Date: Mon Mar 21 23:48:46 2016 +0100 + + build: rename sleep monitor source file, only one implementation + available + + src/Makefile.am | 2 +- + src/{mm-sleep-monitor-systemd.c => mm-sleep-monitor.c} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 6197a06931ffd197b4f66b92c4d729b5911e0e36 +Author: poma +Date: Sun Mar 20 20:39:16 2016 +0100 + + UPower signaling obsolescence + + "Newer upower versions no longer emit that signal since this handled + by systemd." + by Michael Biebl + https://lists.freedesktop.org/archives/devkit-devel/2014-March/001575.html + + See also "Plans for UPower 1.0" + by Richard Hughes + https://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html + + Signed-off-by: poma + + configure.ac | 8 +-- + src/Makefile.am | 5 -- + src/mm-sleep-monitor-upower.c | 150 + ------------------------------------------ + 3 files changed, 2 insertions(+), 161 deletions(-) + +commit 342ea24e346f855f57c69a7fc1fccbbf4e12277d +Author: Lubomir Rintel +Date: Mon Mar 21 14:58:41 2016 +0100 + + cinterion: drop unused constants + + GCC 6 doesn't like this. Unused since f2024b7. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 24 + ------------------------ + 1 file changed, 24 deletions(-) + +commit 2a5909af17324442e052d3833ac7d4ff0ab689ba +Author: Lubomir Rintel +Date: Mon Mar 21 14:58:40 2016 +0100 + + wmc: fix a typo in the test + + GCC 6 notices an unused constant and errors out. + + libwmc/tests/test-wmc-utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6512fde74da33861591a089390201f2522978db2 +Author: Aleksander Morgado +Date: Sun Mar 20 17:38:38 2016 +0100 + + build: fix missing MMCLI_LIBS variable + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 021e57a28306115c315f8686c30a122f692f394b +Author: Aleksander Morgado +Date: Mon Mar 21 10:45:25 2016 +0100 + + build: run configure script from builddir rather than srcdir + + Based on an equivalent patch from Philip Withnall + + for libmbim; see: + + https://bugs.freedesktop.org/show_bug.cgi?id=94639 + + autogen.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 07f899a9d3a1b688a06b858db36d8eea163e1d13 +Author: Aleksander Morgado +Date: Fri Mar 18 12:55:58 2016 +0100 + + release: bump version to 1.5.900 (1.6-rc1) + + Also bump soname of libmm-glib, as the interface has grown since + the last tag. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0c2f98d2a7ad96c7144f3ef0e8e6c2fad1b56d2c +Author: Aleksander Morgado +Date: Fri Mar 18 12:49:39 2016 +0100 + + NEWS: update for 1.6.0 + + NEWS | 101 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 101 insertions(+) + +commit c6dda5e502d40cdb6599b8b6f64f5e5a893e2a0a +Author: Aleksander Morgado +Date: Fri Mar 18 11:36:52 2016 +0100 + + build: require libmbim 1.12 and libqmi 1.14 + + Preparing for the new ModemManager stable release, we now require + the latest + stable series of both libmbim and libqmi. + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d7a643b16ac538be5fb6b82da9855420ad9f1a0e +Author: Aleksander Morgado +Date: Wed Mar 16 18:26:33 2016 +0100 + + libmm-glib,modem-voice: fix unknown methods in documentation + + html/MMCallProperties.html:141: warning: no + link for: 'mm-modem-voice-create' -> (mm_modem_voice_create()). + html/MMCallProperties.html:141: warning: no + link for: 'mm-modem-voice-create-sync' -> (mm_modem_voice_create_sync()). + html/MMModemVoice.html:379: warning: no link + for: 'mm-modem-voice-delete-finish' -> (mm_modem_voice_delete_finish()). + html/MMModemVoice.html:380: warning: no link + for: 'mm-modem-voice-delete-sync' -> (mm_modem_voice_delete_sync()). + + libmm-glib/mm-call-properties.c | 2 +- + libmm-glib/mm-modem-voice.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 4055488fd0ab7522a8d967086c55c7e706de5173 +Author: Aleksander Morgado +Date: Wed Mar 16 18:13:18 2016 +0100 + + libmm-glib,modem-location: fix unknown method in documentation + + html/MMModemLocation.html:516: warning: no + link for: 'mm-modem-dup-supl-server' -> (mm_modem_dup_supl_server()). + + libmm-glib/mm-modem-location.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1ae6a7be8abab4b13520679f42c6cc8e2fb57d05 +Author: Dan Williams +Date: Tue Mar 15 16:17:42 2016 -0500 + + build: work around automake-1.15 & intltool complaining about + translations in build dir + + make distcheck runs a build in dist directory subtirs and then runs + intltool -m + which in turn complains about translations in a built file: + + The following files contain translations and are currently not in + use. Please + consider adding these to the POTFILES.in file, located in the po/ + directory. + + sub/data/org.freedesktop.ModemManager.policy.in + + The issue is reported to intltool upstream already: + https://bugs.launchpad.net/intltool/+bug/1117944 + + po/POTFILES.skip | 2 ++ + 1 file changed, 2 insertions(+) + +commit 93bf189fa245078aa3e8791e8ba89a63da5f3530 +Author: Aleksander Morgado +Date: Tue Mar 15 15:56:06 2016 +0100 + + build,libmm-glib: built headers shouldn't be included in dist + + libmm-glib/generated/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eeb9e2bdcc8001d77d2b81ad6e2275fe634c4469 +Author: Aleksander Morgado +Date: Tue Mar 15 12:28:56 2016 +0100 + + build: end all multiline list variables with $(NULL) + + So that appending a new item in the list only inserts one new line + (i.e. the + last $(NULL) is the last item always). + + Makefile.am | 32 +++++++++++++++++++++++++++----- + cli/Makefile.am | 10 ++++++---- + libmm-glib/Makefile.am | 32 +++++++++++++++++++++----------- + libmm-glib/generated/Makefile.am | 24 +++++++++++++----------- + src/Makefile.am | 30 ++++++++++++++++++++---------- + 5 files changed, 87 insertions(+), 41 deletions(-) + +commit f9c63bfa058bdab29e00f13a0bedf4b4af39797e +Author: Aleksander Morgado +Date: Tue Mar 15 12:57:01 2016 +0100 + + build,plugins: update build rules + + We try to combine in common envvars the compiler and linker flags + shared by the + different components, and where possible, also re-using the implicit + AM_CFLAGS + and AM_LDFLAGS variables that automake provides, and which apply to + all objects + being built in the same Makefile.am. + + The plugins build rules are also updated so that whenever a plugin + has some + testable 'helpers', these are compiled into a noinst library and + then the new + library included by both the plugin and the tester program. This + avoids multiple + recompilations of the same sources for different objects. + + plugins/Makefile.am | 847 + +++++++++++++++++++++++++++++++--------------------- + 1 file changed, 514 insertions(+), 333 deletions(-) + +commit 3b8361eb0635e2a56f8db11823d0b5837f1bb6de +Author: Aleksander Morgado +Date: Tue Mar 15 12:47:13 2016 +0100 + + build,core: update build rules + + We try to combine in common envvars the compiler and linker flags + shared by the + different components, and where possible, also re-using the implicit + AM_CFLAGS + and AM_LDFLAGS variables that automake provides, and which apply to + all objects + being built in the same Makefile.am. + + The internal libmodem-helpers.la library is also renamed to + libhelpers.la + + plugins/Makefile.am | 12 +-- + src/Makefile.am | 211 + ++++++++++++++++++++++++++++---------------------- + src/tests/Makefile.am | 203 + +++++++++--------------------------------------- + test/Makefile.am | 32 ++++++-- + 4 files changed, 184 insertions(+), 274 deletions(-) + +commit 3bac0a17f5187aa22d433470146875cac15944bf +Author: Aleksander Morgado +Date: Tue Mar 15 12:27:20 2016 +0100 + + build,libmm-glib: fix gdbus-codegen rules + + The rule with multiple targets means that for each of the target + the command + specified is run; not that a single run of the command generates + all the targets + specified. + + So, generate the .c file with the command, and make the .h and the + .xml files + a side-effect of the .c generation. + + libmm-glib/generated/Makefile.am | 57 + +++++++++++++++++++++++++++++++--------- + 1 file changed, 45 insertions(+), 12 deletions(-) + +commit 0a9cbf65ea285ebe58b27e1bf40d078504351a80 +Author: Dan Williams +Date: Tue Mar 15 10:33:30 2016 -0500 + + modem-helpers: fix handling split PDP context ID reporting in + CGDCONT=? response + + Cinterion PHS8-US devices send split PDP context ID like + "(1-17,101-112)" and + that caused the modem-helpers to choke. + + src/mm-modem-helpers.c | 2 +- + src/tests/test-modem-helpers.c | 16 ++++++++++++++++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +commit 8ac075d768cf36b6de19032a2ba208bf3e029cc5 +Author: Aleksander Morgado +Date: Sun Mar 13 18:01:03 2016 +0100 + + build: ignore thuraya helpers test + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit e00fd54a200f97aa5ae44e981da152669521f83c +Author: Aleksander Morgado +Date: Sun Mar 13 17:38:26 2016 +0100 + + build: bump required gettext version to 0.19.3 + + Otherwise: + configure.ac:86: warning: The 'AM_PROG_MKDIR_P' macro is + deprecated, and its use is discouraged. + configure.ac:86: You should use the Autoconf-provided + 'AC_PROG_MKDIR_P' macro instead, + configure.ac:86: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in + your Makefile.am files. + + .gitignore | 3 +++ + configure.ac | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +commit a9b69d210d12acc458d2d8ba4e79554f818e8337 +Author: Dan Williams +Date: Wed Aug 19 12:44:02 2015 -0500 + + huawei: use AT^DHCP response if available for NDISDUP-capable devices + + For non-QMI/non-MBIM Huawei devices that use HiSense chipsets, + the recommended way to create the connection is to use NDISDUP + and either DHCP on the net interface, or the ^DHCP command. + There are some reports of devices that connect successfully, but + don't respond to DHCP requests on the interface. Try to get + IP addressing info from the device via ^DHCP and fall back to + telling clients to use actual DHCP if that fails. + + https://bugzilla.redhat.com/show_bug.cgi?id=1254886 + + plugins/huawei/mm-broadband-bearer-huawei.c | 112 + +++++++++++++++++++++-- + plugins/huawei/mm-modem-helpers-huawei.c | 112 + +++++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 10 ++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 51 +++++++++++ + 4 files changed, 276 insertions(+), 9 deletions(-) + +commit 91d343520fec5c5905a4cc3ce898f75025f3f2a8 +Author: Aleksander Morgado +Date: Sun Mar 13 13:21:05 2016 +0100 + + huawei: ignore ^LTERSRP unsolicited message + + Based on a previous patch from Dan Williams + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 1939c5ace50240127276efacec5c7f166483bb79 +Author: Aleksander Morgado +Date: Thu Mar 10 00:24:54 2016 +0100 + + port-probe: simplify task completion + + We no longer need to complete in idle, because the limitation imposed + by the + serial port methods no longer exists. + + src/mm-port-probe.c | 230 + ++++++++++++++++++---------------------------------- + 1 file changed, 81 insertions(+), 149 deletions(-) + +commit d9596587e294ffde715fb2a7ef877da9f903558a +Author: Aleksander Morgado +Date: Thu Mar 10 00:34:59 2016 +0100 + + port-serial: allow completions not in idle + + Port serial command completions may be performed in several different + places: + * When a cached response is set during command sending. + * When errors happen during command sending. + * When we process a response (i.e. common_input_available()) + * When we process a timeout (i.e. port_serial_timed_out()) + * When cancelled (i.e. port_serial_response_wait_cancelled()) + + We're currently safe with the previous logic only because the users + of the + serial port explicitly complete operations in idle, which means + that whenever + we're processing in a internal callback (e.g. during response + or timeout + processing) the serial port object is valid for as long as the + callback runs. + + But, if we ever end up using the serial port with a not-in-idle + completion, + it may happen that if the command is completed within a internal + signal callback + the serial port object may get fully closed and unref-ed before + exiting the + callback. + + We could force a valid port reference to exist as long as the + internal signal + is scheduled, but then we may lose the ability to automatically + close the port + during a full unref(), as the internal signals are set as long as + the port is + open. + + So, to cope with this possibility of not-in-idle completion, we + instead force + references to be valid whenever we see that a command completion + may happen, + which is basically whenever port_serial_got_response() is called; + but we only + do that if we're going to use the port object after that, otherwise, + we ignore + the problem. + + In addition to the problems with the references, we also update the + common_input_available() method so that the source isn't kept if + the last + response buffer processing ended up closing the port. + + src/mm-port-serial.c | 137 + ++++++++++++++++++++++++++++++++------------------- + 1 file changed, 87 insertions(+), 50 deletions(-) + +commit 1322201a43fa4731b0a79dd892bc4a988ae4a428 +Author: Carlo Lobrano +Date: Thu Mar 10 15:02:51 2016 +0100 + + telit: implemented set current bands + + plugins/telit/mm-broadband-modem-telit.c | 117 +++++++++++++ + plugins/telit/mm-modem-helpers-telit.c | 85 ++++++++++ + plugins/telit/mm-modem-helpers-telit.h | 2 + + plugins/telit/tests/test-mm-modem-helpers-telit.c | 191 + ++++++++++++++++++++++ + 4 files changed, 395 insertions(+) + +commit 93056fe3f2038a4144f6f652726831458e849cf2 +Author: Aleksander Morgado +Date: Sat Jan 16 18:57:25 2016 +0100 + + plugin-manager: allow early cancel of port tasks when they haven't + been run yet + + src/mm-plugin-manager.c | 59 + ++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 48 insertions(+), 11 deletions(-) + +commit c605b0bc468429f6f9421b964eea97c62f32056a +Author: Aleksander Morgado +Date: Sat Jan 16 01:41:51 2016 +0100 + + port-probe: allow cancellation + + src/mm-plugin.c | 1 + + src/mm-port-probe.c | 1006 + +++++++++++++++++++++++++++------------------------ + src/mm-port-probe.h | 2 +- + 3 files changed, 533 insertions(+), 476 deletions(-) + +commit d3bf07e7a87bac85778750a87463b95f2180c55c +Author: Aleksander Morgado +Date: Fri Jan 15 17:54:51 2016 +0100 + + plugin: allow cancellation of the port probe operation + + src/mm-plugin-manager.c | 3 + + src/mm-plugin.c | 224 + ++++++++++++++++++++++-------------------------- + src/mm-plugin.h | 20 +++-- + 3 files changed, 117 insertions(+), 130 deletions(-) + +commit fd4fdbf21b20983cdd46fc925389dd96ca3a99d3 +Author: Aleksander Morgado +Date: Mon Jan 11 19:46:25 2016 +0100 + + plugin-manager: refactor device/port support checks and allow + cancellations + + src/mm-base-manager.c | 45 +- + src/mm-plugin-manager.c | 1732 + ++++++++++++++++++++++++++++++++--------------- + src/mm-plugin-manager.h | 32 +- + 3 files changed, 1222 insertions(+), 587 deletions(-) + +commit be9b5e0141bbebdff0694a6a664e1074448c3618 +Author: Aleksander Morgado +Date: Mon Jan 11 20:08:30 2016 +0100 + + plugin-manager: improve logging when loading plugins + + src/mm-plugin-manager.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit be317e8b80cd984149ea152c9d00c6bb814e7c88 +Author: Carlo Lobrano +Date: Wed Mar 9 11:27:43 2016 +0100 + + broadband-modem: fix +CPMS empty parameter support + + * Add new async virtual method init_current_storages to + MMIfaceModemMessaging + * Add logic of init_current_storages to MMBroadbandModem + * Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging + initialization in order to load and store current SMS + storages for mem1 and mem2. + * Add usage of current sms storage value for mem1 in place + of an empty string parameter when the command AT+CPMS + is used. + + https://bugs.freedesktop.org/show_bug.cgi?id=93135 + + src/mm-broadband-modem.c | 92 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-messaging.c | 37 +++++++++++++++++ + src/mm-iface-modem-messaging.h | 7 ++++ + src/mm-modem-helpers.c | 76 ++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 10 +++++ + src/tests/test-modem-helpers.c | 35 ++++++++++++++++ + 6 files changed, 256 insertions(+), 1 deletion(-) + +commit 7c2d5b1aa358c4edb94203d7de586d489b656576 +Author: Aleksander Morgado +Date: Wed Mar 2 17:09:33 2016 +0100 + + helpers: fix check for pid when creating device identifier + + https://bugs.freedesktop.org/show_bug.cgi?id=94364 + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c8a26e472e05e8a02be881ad97cd9d15cd636f94 +Author: Daniele Palmas +Date: Mon Feb 22 13:32:22 2016 +0100 + + telit: add current modes setting + + This patch adds current modes setting in Telit plugin + + plugins/telit/mm-broadband-modem-telit.c | 98 + ++++++++++++++++++++++++++++++++ + 1 file changed, 98 insertions(+) + +commit 6e7ff47109058e553beb4d9044a302d78e17944c +Author: Michael Farrell +Date: Sat Feb 20 16:29:11 2016 +0100 + + proxmark3 is not a modem, blacklist it. + + ModemManager locks the proxmark3 when it is connected. As it is not + a modem, + ModemManager shouldn't be talking to it. + + At present, the recommended action in the proxmark3 documentation + is to + purge ModemManager to fix this issue. + + Note that this vendor uses an unregistered USB device ID, so it is + instead matched by the manufacturer string. + + References: + - http://store.ryscc.com/blogs/news/45802433 + - http://www.proxmark.org/forum/viewtopic.php?id=1759 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7652486433cbfaf14c1c3fe35aeb69622ca97b79 +Author: Aleksander Morgado +Date: Thu Feb 4 22:11:28 2016 -0800 + + build: ignore telit unit test + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit beeabdea2fd4f9b0719cf2d2605ed429a59aa5b5 +Author: Carlo Lobrano +Date: Mon Feb 15 12:10:57 2016 +0100 + + telit: add load_current_bands interface + + plugins/telit/mm-broadband-modem-telit.c | 80 + ++++++++++++++----- + plugins/telit/mm-modem-helpers-telit.c | 97 + +++++++++++++++-------- + plugins/telit/mm-modem-helpers-telit.h | 21 +++-- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 89 + +++++++++++++++++++-- + 4 files changed, 221 insertions(+), 66 deletions(-) + +commit c533e56e1e9fd2c2c52093369f8a21ebd3f932ea +Author: Michael Biebl +Date: Fri Jan 22 23:40:10 2016 +0100 + + tests: white space / indentation fixes + + Fixes problems with GCC 6 + + Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811583 + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94149 + + libwmc/tests/test-wmc-com.c | 10 +++++----- + libwmc/tests/test-wmc.c | 16 ++++++++-------- + 2 files changed, 13 insertions(+), 13 deletions(-) + +commit a08708c10ded19c5a0d369905f13beb8ee7cdc49 +Author: Aleksander Morgado +Date: Mon Feb 15 00:31:27 2016 +0100 + + huawei: avoid trying to disable parent voice unsolicited events + + Which actually segfaults, as MMBroadbandModem doesn't implement the + disable_unsolicited_events() method in the voice interface. + + plugins/huawei/mm-broadband-modem-huawei.c | 39 + ++++++++---------------------- + 1 file changed, 10 insertions(+), 29 deletions(-) + +commit 5d8b26eeeb9d18ff6022998edd200aa480203d93 +Author: Aleksander Morgado +Date: Mon Feb 15 00:12:11 2016 +0100 + + huawei: ignore ^ECCLIST unsolicited messages + + These messages list the emergency numbers reported by the network, + we don't use + them yet. + + E.g.: + + ^ECCLIST: 112,911\r\n + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit eeb23637bd5a637e67955281a97223809023f23b +Author: Thomas Sailer +Date: Sat Feb 13 17:37:15 2016 +0100 + + thuraya: filter by vendor ID instead of vendor string + + Probe the Thuraya XT modem by USB vendor ID; there are no RS232 + versions + to my knowledge. + + One of my computers exhibiting the probing issue (VID/PID of the PCI + host controller instead of the USB device) fixed itself after + a reboot. + + Signed-off-by: Thomas Sailer + + plugins/thuraya/mm-plugin-thuraya.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cffba7e0ee512800329476d7da13046171c99067 +Author: Aleksander Morgado +Date: Sat Feb 13 14:33:12 2016 +0100 + + modem-helpers: regex creation should never fail + + We should really consider errors if we expect that the regex string + may not + compile; but in this case the pattern is fixed, so should never + happen. + + src/mm-modem-helpers.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 95876c6f576875503f20f7e3ad27440bffd9067c +Author: Thomas Sailer +Date: Sat Feb 13 14:19:13 2016 +0100 + + helpers: move +CRSM parsing to mm_3gpp_parse_crsm_response + + Also added test cases. + + Signed-off-by: Thomas Sailer + + src/mm-base-sim.c | 117 + +++++++++++++---------------------------- + src/mm-modem-helpers.c | 51 ++++++++++++++++++ + src/mm-modem-helpers.h | 8 +++ + src/tests/test-modem-helpers.c | 54 +++++++++++++++++++ + 4 files changed, 151 insertions(+), 79 deletions(-) + +commit a33615d6cb087c646de3b1899fbed0f7284f9340 +Author: Thomas Sailer +Date: Sat Feb 13 14:19:12 2016 +0100 + + helpers: allow optional quotes in +CREG: ,"","" + + GSM 07.07 CREG=2 unsolicited pattern. + + Added testcase for Thuraya XT. + + Signed-off-by: Thomas Sailer + + src/mm-modem-helpers.c | 11 ++++++++++- + src/tests/test-modem-helpers.c | 26 ++++++++++++++++++++++++-- + 2 files changed, 34 insertions(+), 3 deletions(-) + +commit 9cb0b22f915777a92ac4aa6442edfcf51a1f5601 +Author: Dan Williams +Date: Thu Feb 11 11:07:38 2016 -0600 + + broadband-modem-qmi: fix compile errors with newest QMI commands + enabled + + src/mm-broadband-modem-qmi.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +commit 232d4d4aaed69d7e0cdb75c19d0af2fd86c9469a +Author: Dan Williams +Date: Tue Jan 26 12:46:09 2016 -0600 + + broadband-bearer: don't send disconnect CGACT on data port for + multi-port modems + + A Huawei E173 (with FW 11.126.15.00.445) seems to stop responding + on the + primary port (ttyUSB2) when the CGACT is resent on the data port + (ttyUSB0). + The CGACT-on-data-port was originally added as a fallback attempt + to get + single-port modems to disconnect when all other methods failed. + + For single-port modems, the primary port is also the data port so this + patch will have no effect. + + For multi-port modems, this patch will retry the CGACT on the primary + port which has a higher chance of success because we already know + the primary port is talking to us, while the data port may still + be stuck in PPP mode. + + src/mm-broadband-bearer.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 504f422ddd99848adba2a85055f2ce33c0fbb612 +Author: Thomas Sailer +Date: Thu Feb 11 13:45:12 2016 +0100 + + thuraya: add plugin for the Thuraya XT satellite phone modem + + Signed-off-by: Thomas Sailer + + plugins/Makefile.am | 25 ++ + plugins/thuraya/mm-broadband-modem-thuraya.c | 295 + +++++++++++++++++++++ + plugins/thuraya/mm-broadband-modem-thuraya.h | 50 ++++ + plugins/thuraya/mm-modem-helpers-thuraya.c | 156 +++++++++++ + plugins/thuraya/mm-modem-helpers-thuraya.h | 27 ++ + plugins/thuraya/mm-plugin-thuraya.c | 85 ++++++ + plugins/thuraya/mm-plugin-thuraya.h | 48 ++++ + .../thuraya/tests/test-mm-modem-helpers-thuraya.c | 131 +++++++++ + 8 files changed, 817 insertions(+) + +commit 4442173dcff34fb6f2ce0d07b10c95a06a31a8f5 +Author: Thomas Sailer +Date: Thu Feb 11 13:45:09 2016 +0100 + + modem-helpers: allow optional whitespace in +CGDCONT response + + Add testcase for Thuraya XT. + + Signed-off-by: Thomas Sailer + + src/mm-modem-helpers.c | 4 ++-- + src/tests/test-modem-helpers.c | 14 ++++++++++++++ + 2 files changed, 16 insertions(+), 2 deletions(-) + +commit 18c8dd60a7ffec58fc1846f0a3894c951018e260 +Author: Aleksander Morgado +Date: Sat Jan 30 20:14:25 2016 -0800 + + qmi: just one InvalidCommand error is enough to avoid all DMS UIM + commands + + The MMBroadbandModemQmi will not create a MMSimQmi until the unlock + status has + been checked, and therefore this means that when the SIM object is + being created + we already know whether the modem supports DMS UIM commands or not, + so avoid + further fallbacks in the SIM object. + + src/mm-broadband-modem-qmi.c | 16 +++---- + src/mm-sim-qmi.c | 109 + ++++++++++++++++++++++++------------------- + src/mm-sim-qmi.h | 15 +++--- + 3 files changed, 77 insertions(+), 63 deletions(-) + +commit 9cbd0c61b0562b2f2370d5c192d06fe8694bb021 +Author: Aleksander Morgado +Date: Sat Jan 30 20:14:24 2016 -0800 + + sim-qmi: implement SIM verify/unblock/change/enable with UIM service + + Newer modems like the MC7455 don't implement the "DMS UIM" commands + in the + DMS service, and therefore these modems need to use the UIM service + directly. + + We include a new flag to detect whether any of the DMS UIM commands + is flagged + as invalid, and if so, we'll fallback to the UIM specific + implementations for + all. + + libqmi version bump to 1.13.7, which includes the new required + methods. + + configure.ac | 2 +- + src/mm-sim-qmi.c | 552 + +++++++++++++++++++++++++++++++++++++++++++++++++------ + src/mm-sim-qmi.h | 2 + + 3 files changed, 500 insertions(+), 56 deletions(-) + +commit 7ded4f3c3be0a437d39777f38dfd58df4b570c07 +Author: Aleksander Morgado +Date: Sat Jan 30 20:14:23 2016 -0800 + + broadband-modem-qmi: implement unlock retries loading with UIM service + + Newer modems like the MC7455 don't implement the "DMS UIM" commands + in the + DMS service, and therefore these modems need to use the UIM service + directly. + + src/mm-broadband-modem-qmi.c | 357 + ++++++++++++++++++++++++++++--------------- + 1 file changed, 236 insertions(+), 121 deletions(-) + +commit 6a675536d678d1855859b5d5dd07fe22e0ceef88 +Author: Tomas Jura +Date: Tue Feb 2 15:30:23 2016 +0100 + + serial: remove duplicated ECHO & ECHOE + + src/mm-port-serial.c | 1 - + 1 file changed, 1 deletion(-) + +commit 0ccbd5d85d65f932524ca851f2ffa7c18f284f07 +Author: Tomas Jura +Date: Tue Feb 2 15:30:21 2016 +0100 + + mbm: stop echos on gps port + + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7f173dfd151708369b53083c996d0b98b0a07c2f +Author: Daniele Palmas +Date: Mon Feb 1 14:53:34 2016 +0100 + + plugin: telit: add current mode loading + + This patch adds current mode loading in Telit plugin + + plugins/telit/mm-broadband-modem-telit.c | 82 + ++++++++++++++++++++++++++++++++ + 1 file changed, 82 insertions(+) + +commit 85e6c5b915b242f46a528e6415b3e735599ee0c0 +Author: Daniele Palmas +Date: Mon Feb 1 14:53:33 2016 +0100 + + plugin: telit: add supported modes loading + + This patch add supported modes loading in Telit plugin. + + plugins/telit/mm-broadband-modem-telit.c | 104 + +++++++++++++++++++++++++++++++ + 1 file changed, 104 insertions(+) + +commit aeb63621723fd3d7e39870466d2cffcf56fc6570 +Author: Aleksander Morgado +Date: Sat Jan 30 11:05:30 2016 -0800 + + sim-qmi: port to GTask + + src/mm-sim-qmi.c | 451 + ++++++++++++++++++++++--------------------------------- + 1 file changed, 176 insertions(+), 275 deletions(-) + +commit b23dace6dd165b4043c54a11521b2cb75eca5a23 +Author: Aleksander Morgado +Date: Sat Jan 30 16:27:42 2016 -0800 + + broadband-modem-qmi: plug memleak when listing SMS messages + + src/mm-broadband-modem-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit 8c905383b7f8f59e7b78c054ace828096a7fe6ba +Author: Aleksander Morgado +Date: Sat Jan 30 16:25:20 2016 -0800 + + broadband-modem-qmi: locked states also indicate readiness of the + SIM card + + When the card application is flagged as needing PIN or PUK, then + the card can be + considered as being ready. + + src/mm-broadband-modem-qmi.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 3911ea5a0f6b26e12a3586c75d72bb2c5820e3c1 +Author: Aleksander Morgado +Date: Mon Jan 25 13:58:57 2016 +0100 + + telit: minor coding style fixes + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + plugins/telit/mm-modem-helpers-telit.c | 37 + +++++++++++------------ + plugins/telit/tests/test-mm-modem-helpers-telit.c | 18 +++++++---- + 3 files changed, 30 insertions(+), 27 deletions(-) + +commit 70b8ec1a88477eea3a2f569a83fc270ccaff9504 +Author: Carlo Lobrano +Date: Mon Jan 25 11:02:17 2016 +0100 + + telit: add load_supported_bands interface + + plugins/telit/mm-broadband-modem-telit.c | 86 +++++ + plugins/telit/mm-modem-helpers-telit.c | 372 + +++++++++++++++++++++- + plugins/telit/mm-modem-helpers-telit.h | 67 ++++ + plugins/telit/tests/test-mm-modem-helpers-telit.c | 150 ++++++++- + 4 files changed, 671 insertions(+), 4 deletions(-) + +commit 81019ca5b519d505da90f119b0037d9cc9916fe4 +Author: Carlo Lobrano +Date: Mon Jan 25 09:54:39 2016 +0100 + + telit: add udev rule for Telit LE910 V2 modem + + plugins/telit/77-mm-telit-port-types.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 83868c61b10146795a7369a8db452143363a6edb +Author: Aleksander Morgado +Date: Tue Dec 29 01:25:59 2015 +0100 + + broadband-modem-qmi: use "UIM Get Card Status" if "DMS UIM" command + unavailable + + The newer modules like the MC7455 which support multiple SIM cards + won't + implement the legacy "DMS UIM" commands. + + src/mm-broadband-modem-qmi.c | 452 + +++++++++++++++++++++++++++++++++++++------ + 1 file changed, 390 insertions(+), 62 deletions(-) + +commit cf66d1bcbfa3c124a30302c9bb9a76957c9e4b75 +Author: Aleksander Morgado +Date: Tue Dec 29 01:25:00 2015 +0100 + + bearer-qmi: use static IP if LLP is raw-ip + + When using raw-ip we'll default to request static IP setup for now, + so that we + don't rely on the DHCP client supporting raw-ip interfaces. + + src/mm-broadband-modem-qmi.c | 9 ++++++++- + src/mm-port-qmi.c | 25 +++++++++++++++++++++---- + src/mm-port-qmi.h | 2 ++ + 3 files changed, 31 insertions(+), 5 deletions(-) + +commit f8ba106a20d678e50619c5bf3f1a9e3c61b3463f +Author: Aleksander Morgado +Date: Mon Dec 28 23:28:45 2015 +0100 + + port-qmi: support new Qualcomm chipsets working always in raw-ip + + The port opening logic is changed completely. + + Before this change, the logic would only try 802.3 setting via CTL + when the + QmiDevice was being open. + + With this new change, instead, we'll use WDA and the new libqmi APIs + to query + the link layer protocol expected by both the device and the kernel. If + the LLP + matches in both, we assume we're done; if they differ we'll try to + update the + LLP expected by the kernel to the one setup in WDA. This change will + allow us + to run with the modem using raw-ip if that is what WDA reports + by default. + + Also bumped the libqmi version to 1.13.6, which has support for the + new required + APIs. + + configure.ac | 2 +- + src/mm-port-qmi.c | 351 + +++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 295 insertions(+), 58 deletions(-) + +commit 1bdb1a558a05970e436e562cc3f8d3f43640933a +Author: Aleksander Morgado +Date: Sun Jan 24 15:26:12 2016 +0100 + + build: require GLib 2.36 + + We now need it for GTask support. + + configure.ac | 15 +++++++-------- + plugins/Makefile.am | 8 -------- + 2 files changed, 7 insertions(+), 16 deletions(-) + +commit 97962bb65caaabc4133740a2698dae2406be319e +Author: Aleksander Morgado +Date: Mon Jan 18 18:23:40 2016 +0100 + + port-serial: rework response parsing + + Response parsing was being done in different places for AT and + QCDM subclasses; + in the case of AT it was being done early, before returning the byte + array in + the mm_serial_port_command_finish() response. In the case of QCDM, + it was being + done after mm_serial_port_command_finish(), and that was forcing + every caller to + cleanup the response buffer once the response was processed. + + With the new logic in this patch, the response is always parsed + (i.e. looked for + a valid response or an error detected) before + mm_serial_port_command_finish() + returns, and actually this method now returns a totally different + GByteArray, + not the internal response buffer GByteArray, so there's no longer + any need for + the caller to explicitly clean it up. The one doing the cleanup is + the parser + method itself in every case. + + This change also allows us to return serial port responses in idle, + but that's + not changed for now as there's no immediate need. + + src/mm-port-serial-at.c | 45 +++++++++++----- + src/mm-port-serial-gps.c | 11 ++-- + src/mm-port-serial-qcdm.c | 134 + +++++++++++++++++++++++----------------------- + src/mm-port-serial.c | 118 +++++++++++++++++++++------------------- + src/mm-port-serial.h | 34 ++++++++---- + 5 files changed, 194 insertions(+), 148 deletions(-) + +commit ede17bd41c044af1d59b347f8859a9894272d27e +Author: Aleksander Morgado +Date: Sun Jan 17 00:55:12 2016 +0100 + + port-serial: remove response buffer when an error is returned + + When valid responses were returned to the caller of the serial + command, the + caller itself was responsible for removing from the GByteArray the + data that + it was successfully processed (all the data in AT, just 1 message + in QCDM). But, + the same logic was missing for the case of errors; we were not + explicitly + removing the response and therefore in some cases we would see + it propagated + into the next command response. It was common to see this issue when + the echo + removal was disabled in the serial port, as in Option/HSO modems: + + (ttyHS3): --> 'AT+CNUM' + (ttyHS3): <-- '+CME ERROR: 14' + Got failure code 14: SIM busy + (ttyHS3) device open count is 1 (close) + couldn't load list of Own Numbers: 'Failed to parse NV + MDN command result: -17' + (ttyHS3) device open count is 2 (open) + (ttyHS3): --> 'AT_OPSYS?' + (ttyHS3): <-- '_OPSYS: + 1,2OK' + couldn't load current allowed/preferred modes: 'Couldn't + parse OPSYS response: '+CME ERROR: 14 + _OPSYS: 1,2'' + + src/mm-port-serial.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +commit 0512a820cda8e0934ce11339726e66c6dea85d3f +Author: Dan Williams +Date: Wed Jan 20 17:06:07 2016 -0600 + + libmm-glib: make C++ happy by not using 'class' + + libmm-glib/mm-sms-properties.c | 8 ++++---- + libmm-glib/mm-sms-properties.h | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 98c58ca64b7fa80ebe7cf96bcee77c7e9ef02f99 +Author: Dan Williams +Date: Tue Jan 19 17:19:22 2016 -0600 + + bearer-qmi: print IP details at 'info' log level + + src/mm-bearer-qmi.c | 42 +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +commit 3b97d7e3d7f126ded63393af932d0e147b302fac +Author: Aleksander Morgado +Date: Sat Jan 16 19:19:15 2016 +0100 + + broadband-modem: plug memleaks when processing QCDM responses + + src/mm-broadband-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 884d7bee1b25697a4fa378f43801e0cafd0a8c5e +Author: Aleksander Morgado +Date: Fri Jan 15 20:02:04 2016 +0100 + + broadband-modem,time: make sure that error is set when operation fails + + src/mm-broadband-modem.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit 6d4597694268f7feab339aa5b903d9b6c6bda829 +Author: Aleksander Morgado +Date: Sat Jan 16 17:36:08 2016 +0100 + + tests,generic: rename basic DBus test + + plugins/generic/tests/test-service-generic.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7136c0b32103eda1d62a16a47dfdb37b166fa610 +Author: Aleksander Morgado +Date: Sat Jan 16 17:32:13 2016 +0100 + + tests,port-context: explicitly close the socket that is added to + the listener + + Since GLib 2.42, the sockets that are added to socket listeners may + no longer + be closed automatically when the listener is finalized. In order to + avoid that, + we will keep our own socket reference and close/unref it ourselves. + + This issue was preventing adding new test cases with the same + port names. + + $ ./test-service-generic --verbose + GTest: random seed: R02S889153ee0f2e59c570f4edff9caa4176 + GTest: run: /MM/Service/Generic/enable-disable + Activating service name='org.freedesktop.ModemManager1' + Successfully activated service 'org.freedesktop.ModemManager1' + (MSG: DEBUG: client connection closed) + (MSG: MESSAGE: Found modem at + '/org/freedesktop/ModemManager1/Modem/0') + ** Message: Found modem at + '/org/freedesktop/ModemManager1/Modem/0' + (MSG: DEBUG: client connection closed) + GTest: result: OK + GTest: run: /MM/Service/Generic/cme-error-detected + Activating service name='org.freedesktop.ModemManager1' + Successfully activated service 'org.freedesktop.ModemManager1' + (MSG: FATAL-ERROR: Cannot bind socket: Error binding to address: + Address already in use) + + ** + (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:32043): + ERROR **: Cannot bind socket: Error binding to address: Address + already in use + + plugins/tests/test-port-context.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +commit dfd111f29112918d7f2046297670a7481a883354 +Author: Aleksander Morgado +Date: Sat Jan 16 17:30:01 2016 +0100 + + tests,test-fixture: don't rely on other threads to update dbus + properties + + We were wrongly using a main loop in the port context thread to + manage the + global main context. That was silently making the DBus property + notifications + kind of work, as they were being updated via another thread, so here + we could + just sleep() and recheck the property values. + + Given that having that unrelated thread updating the dbus properties + of our + MMManager object is not a good thing, we'll instead totally ignore + that and + fully re-create the MMManager in each iteration with the sync() + method, which + has its own internal thread. + + plugins/tests/test-fixture.c | 109 + +++++++++++++++++-------------------------- + 1 file changed, 43 insertions(+), 66 deletions(-) + +commit 87bafa33dc6b1d58a67147a802bd498f9a2f80d6 +Author: Aleksander Morgado +Date: Sat Jan 16 17:25:59 2016 +0100 + + tests,port-context: properly setup per-thread main context + + Instead of creating a new main context to be used in the thread, + we were using + the global context. So, fix that, and create a totally new pair of + main context + and main loop to be used within the thread. + + plugins/tests/test-port-context.c | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +commit 99ae6777893d0b149cbefac3f290c63c47e29f42 +Author: Dan Williams +Date: Wed Jan 13 15:29:50 2016 -0600 + + libqcdm: fix mixed whitespace in test-qcdm.c + + libqcdm/tests/test-qcdm.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 6a60090d681df313b9416597325d60effed006cf +Author: Aleksander Morgado +Date: Tue Jan 12 16:37:28 2016 +0100 + + broadband-modem,voice: fix regex leak + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit 0ebf6d5da5b013faceb8d635d0896e9794c35fae +Author: Aleksander Morgado +Date: Mon Dec 21 17:08:53 2015 +0100 + + mbm: query supported modes to the modem with +CFUN=? + + We were trying to load the generic modes supported reported by either + *CNTI=2 or + AT+WS46=?, so that then we could filter out the MBM-specific modes + unsupported. + + But, this may not be ideal, as both these two commands may fail: + + [mm-broadband-modem.c:1612] modem_load_supported_modes(): + loading supported modes... + [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device + open count is 3 (open) + [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open + count is 2 (close) + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> + 'AT*CNTI=2' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- + 'ERROR' + [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got + failure code 100: Unknown error + [mm-broadband-modem.c:1546] supported_modes_cnti_ready(): + Generic query of supported 3GPP networks with *CNTI failed: + 'Unknown error' + [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device + open count is 3 (open) + [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open + count is 2 (close) + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> + 'AT+WS46=?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- + 'ERROR' + [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got + failure code 100: Unknown error + [mm-broadband-modem.c:1494] supported_modes_ws46_test_ready(): + Generic query of supported 3GPP networks with WS46=? failed: + 'Unknown error' + [mm-iface-modem.c:3974] load_supported_modes_ready(): couldn't + load Supported Modes: 'Couldn't retrieve supported modes' + + Instead, we'll ask the modem for the list of modes supported, and + return that + directly. + + plugins/mbm/mm-broadband-modem-mbm.c | 93 ++++++++++----------- + plugins/mbm/mm-modem-helpers-mbm.c | 100 ++++++++++++++++++++++- + plugins/mbm/mm-modem-helpers-mbm.h | 14 ++++ + plugins/mbm/tests/test-modem-helpers-mbm.c | 62 +++++++++++++- + src/mm-modem-helpers.c | 126 + +++++++++++++++-------------- + src/mm-modem-helpers.h | 2 + + 6 files changed, 281 insertions(+), 116 deletions(-) + +commit 138b3dabc23f7e56adccbd76c42d9136af5b4329 +Author: Aleksander Morgado +Date: Sat Dec 19 14:07:10 2015 +0100 + + cli: validate SUPL server before showing it + + cli/mmcli-modem-location.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 9123c7bd93c8ca4f8fc3cc45d105946c4517dbb2 +Author: Aleksander Morgado +Date: Sat Dec 19 14:06:55 2015 +0100 + + cli: allow enabling/disabling location signaling via DBus + + Not making them '--location-enable|disable-signal' because that's + the pattern + used to enable/disable location sources. Instead, use the + '--location-set-*' + pattern, as that is what we're already using for the other location + setup + update. + + cli/mmcli-modem-location.c | 41 ++++++++++++++++++++++++++++++++++++----- + 1 file changed, 36 insertions(+), 5 deletions(-) + +commit 6c35878f12ab37604d85cb3a864e3859973bd195 +Author: Aleksander Morgado +Date: Thu Dec 3 17:06:16 2015 +0100 + + location: support updating the GPS refresh time + + The default setup uses a refresh time of 30s, which means that even + if the GPS + location updates are received at a higher frequency, the DBus + interface will + still expose at most one update every 30s. + + This patch includes a new "SetGpsRefreshTime()" method in the Location + interface, which takes a single 'u' parameter, specifying the refresh + rate to + use, in seconds. This method also allows 0 being passed, which will + make the + implementation to publish the GPS location updates are soon as + ModemManager + detects them. + + Along with the new method, a "GpsRefreshTime" read-only property + is exposed + to specify the refresh time in effect. + + The new method and property will only be applicable if the device + has GPS + capabilities. + + https://bugs.freedesktop.org/show_bug.cgi?id=89924 + + cli/mmcli-modem-location.c | 93 + +++++++++++++++++- + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 ++ + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 21 +++++ + libmm-glib/mm-modem-location.c | 103 + ++++++++++++++++++++ + libmm-glib/mm-modem-location.h | 15 +++ + src/mm-iface-modem-location.c | 104 + ++++++++++++++++++++- + 6 files changed, 339 insertions(+), 7 deletions(-) + +commit aae96778c54a59dcf3955c2d81bee393c0348077 +Author: Aleksander Morgado +Date: Sat Dec 19 11:54:26 2015 +0100 + + build: don't redefine test_modem_helpers_telit_LDADD + + plugins/Makefile.am | 1 - + 1 file changed, 1 deletion(-) + +commit 0a88ae2d6d87967c0d951cc95de0c1917c78b0ed +Author: Aleksander Morgado +Date: Sat Dec 19 11:51:11 2015 +0100 + + telit: use explicit FIRST step name + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 46f601edf6046c6d6459f7aee45fca68bc93cee3 +Author: Aleksander Morgado +Date: Sat Dec 19 11:50:09 2015 +0100 + + telit: don't talk to the user in a GError + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a74edab57f53ee8c920e681145070b252f5e656e +Author: Aleksander Morgado +Date: Sat Dec 19 11:45:32 2015 +0100 + + telit: prefix helper methods with 'mm_telit' + + plugins/telit/mm-broadband-modem-telit.c | 2 +- + plugins/telit/mm-modem-helpers-telit.c | 5 ++++- + plugins/telit/mm-modem-helpers-telit.h | 4 +++- + plugins/telit/tests/test-mm-modem-helpers-telit.c | 4 ++-- + 4 files changed, 10 insertions(+), 5 deletions(-) + +commit 740e1b5461bda9ff28f3ad2210ecf7238c38e785 +Author: Aleksander Morgado +Date: Sat Dec 19 11:43:17 2015 +0100 + + telit: fix minor coding style issues + + plugins/telit/mm-broadband-modem-telit.c | 18 +++++++++--------- + plugins/telit/mm-modem-helpers-telit.c | 2 +- + plugins/telit/mm-modem-helpers-telit.h | 3 +-- + 3 files changed, 11 insertions(+), 12 deletions(-) + +commit c4ffe572aeeefac240f16822ca1d2d258f78ad8d +Author: Carlo Lobrano +Date: Wed Dec 16 15:38:58 2015 +0100 + + telit: add load_unlock_retries interface + + plugins/Makefile.am | 18 ++- + plugins/telit/mm-broadband-modem-telit.c | 183 + ++++++++++++++++++++++ + plugins/telit/mm-modem-helpers-telit.c | 75 +++++++++ + plugins/telit/mm-modem-helpers-telit.h | 25 +++ + plugins/telit/tests/test-mm-modem-helpers-telit.c | 104 ++++++++++++ + 5 files changed, 404 insertions(+), 1 deletion(-) + +commit 7978225934dc87bc74fac4d79a1080bc0501e581 +Author: Carlo Lobrano +Date: Wed Dec 9 18:06:41 2015 +0100 + + telit: add modem_reset to telit plugin + + plugins/telit/mm-broadband-modem-telit.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit ae04c4179f423883545e9e6de8b6347c17723029 +Author: Aleksander Morgado +Date: Wed Dec 2 16:18:34 2015 +0100 + + bearer-mbim: implement stats loading + + src/mm-bearer-mbim.c | 109 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 109 insertions(+) + +commit cb59c6d93edba6f3ddc9db92e03588913b192059 +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + bearer-qmi: implement stats loading + + Use the "WDS Get Packet Statistics" method to query for the ongoing + number + of bytes transmitted or received. The QMI implementation uses + different WDS + clients for IPv4 and IPv6; the stats reported are a combination of + the values + retrieved from both WDS clients. + + src/mm-bearer-qmi.c | 158 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 158 insertions(+) + +commit 3bf118d01a90ac486ebe4ab9ed9c043930feac26 +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + base-bearer: setup periodic stats loading + + If the bearer implementation supports it, load stats periodically. By + default + every 30s for now. + + src/mm-base-bearer.c | 123 + +++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-base-bearer.h | 16 +++++-- + 2 files changed, 133 insertions(+), 6 deletions(-) + +commit 810e52c6dbdc876c43899f4dfdf7c753a285536f +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + cli: print stats if bearer reports them + + cli/mmcli-bearer.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 730123598a22fd176986bb0da455f762be1bcba8 +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + libmm-glib: retrieve stats from the bearer + + The MMBearer object is updated to provide getter methods to retrieve + the new + MMBearerStats object. + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 + + libmm-glib/mm-bearer.c | 116 + ++++++++++++++++++++++ + libmm-glib/mm-bearer.h | 4 + + 3 files changed, 122 insertions(+) + +commit 27c6f15873e3fbfb151f4948a65f214453fe17b0 +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + libmm-glib: new helper object to handle bearer stats + + The new MMBearerStats object provides a simple API to interact with + the new + dictionary containing the bearer connection stats. + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 30 +++ + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-bearer-stats.c | 222 + ++++++++++++++++++++++ + libmm-glib/mm-bearer-stats.h | 85 +++++++++ + 5 files changed, 341 insertions(+) + +commit 03ead02686544c6daee48d8a0b0d51ab8cf255b4 +Author: Aleksander Morgado +Date: Fri Nov 27 14:30:00 2015 +0100 + + introspection: new 'Stats' property in the bearer object + + The new property is a dictionary which may include different + parameters, + depending on what is actually supported by the underlying modem. For + now, + just bytes RX/TX. + + Note that this object will expose the stats *as reported by the + modem*. These + values may differ from e.g. what is seen in the network interface + stats. + + .../org.freedesktop.ModemManager1.Bearer.xml | 31 + ++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +commit ee85a463cf806cd01a61587520245a4818ab1fbb +Author: Aleksander Morgado +Date: Mon Dec 7 13:10:21 2015 +0100 + + license: mmcli is GPLv2+, not GPLv3+ + + mmcli is GPLv2+; that's what --version has always said and that's + what the + README in ModemManager sources specifies: + License. + The ModemManager and mmcli binaries are both GPLv2+. + The libmm-glib library is LGPLv2+. + + cli/mmcli-bearer.c | 2 +- + cli/mmcli-call.c | 2 +- + cli/mmcli-common.c | 2 +- + cli/mmcli-common.h | 11 ++++++++--- + cli/mmcli-manager.c | 2 +- + cli/mmcli-modem-3gpp.c | 2 +- + cli/mmcli-modem-cdma.c | 2 +- + cli/mmcli-modem-firmware.c | 2 +- + cli/mmcli-modem-location.c | 2 +- + cli/mmcli-modem-messaging.c | 2 +- + cli/mmcli-modem-oma.c | 2 +- + cli/mmcli-modem-signal.c | 2 +- + cli/mmcli-modem-simple.c | 2 +- + cli/mmcli-modem-time.c | 2 +- + cli/mmcli-modem-voice.c | 2 +- + cli/mmcli-modem.c | 2 +- + cli/mmcli-sim.c | 2 +- + cli/mmcli-sms.c | 2 +- + cli/mmcli.c | 2 +- + cli/mmcli.h | 2 +- + 20 files changed, 27 insertions(+), 22 deletions(-) + +commit 14e47710561b2021b79814afa5ecd6b2abc4fad0 +Author: Carlo Lobrano +Date: Fri Dec 4 09:06:40 2015 +0100 + + telit: add modem_power_down to telit plugin + + plugins/telit/mm-broadband-modem-telit.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit 4c036eb8f96cae06da1f968fb9eb48f6faa12796 +Author: Aleksander Morgado +Date: Thu Dec 3 12:01:00 2015 +0100 + + iface-modem: explicitly disconnect bearer before removing it + + https://bugs.freedesktop.org/show_bug.cgi?id=90408 + + src/mm-bearer-list.c | 23 ++++++++++++++--------- + src/mm-bearer-list.h | 2 ++ + src/mm-iface-modem.c | 53 + +++++++++++++++++++++++++++++++++++++++++++++------- + 3 files changed, 62 insertions(+), 16 deletions(-) + +commit ea3cb005b8e276178187654bd1aadbe8b33abf63 +Author: Aleksander Morgado +Date: Thu Dec 3 12:00:22 2015 +0100 + + bearer-list: rename bearer find method to specify properties are + compared + + src/mm-bearer-list.c | 4 ++-- + src/mm-bearer-list.h | 4 ++-- + src/mm-iface-modem-simple.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 75c23479902fd63a9b3bd81e25598ac8c6f22c2a +Author: Aleksander Morgado +Date: Thu Dec 3 11:43:21 2015 +0100 + + bearer-list: no need for the method to remove all bearers + + src/mm-bearer-list.c | 16 ++++------------ + src/mm-bearer-list.h | 1 - + 2 files changed, 4 insertions(+), 13 deletions(-) + +commit 508a37a8916a70831cc74cba1d8b977cf95e4a27 +Author: Aleksander Morgado +Date: Wed Dec 2 21:38:06 2015 +0100 + + modem-helpers: fix parsing CPMS=? responses without groups + + The CPMS test parser was expecting 3 groups (parenthesis enclosed + lists) of + memory IDs, e.g.: + + +CPMS: ("SM","ME"),("SM","ME"),("SM","ME") + + But some modems like the Huawei MU609 may just report single + elements, not + groups, e.g.: + + +CPMS: "SM","SM","SM" + + This patch avoids using g_strsplit() to split the groups, as that + is unaware + of the possible replies without groups. Instead, a new helper + method is + implemented which does the group/item split itself, considering + also the + possibility of a reply with mixed groups and non-groups, like e.g.: + + +CPMS: ("SM","ME"),"SM","SM" + + Additionally, we also now support the case where the groups are + empty, e.g.: + + +CPMS: (),(),() + + https://bugs.freedesktop.org/show_bug.cgi?id=92243 + + src/mm-modem-helpers.c | 108 +++++++++++++++++++++++++------- + src/tests/test-modem-helpers.c | 137 + +++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 220 insertions(+), 25 deletions(-) + +commit ffde4298435bf1e3232042c6ac7cb61ddfc1a183 +Author: Aleksander Morgado +Date: Wed Dec 2 17:07:11 2015 +0100 + + core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 4 ++-- + plugins/huawei/mm-broadband-bearer-huawei.c | 6 +++--- + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + plugins/huawei/mm-plugin-huawei.c | 2 +- + plugins/icera/mm-broadband-bearer-icera.c | 6 +++--- + plugins/mbm/mm-broadband-bearer-mbm.c | 4 ++-- + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + plugins/mbm/mm-sim-mbm.c | 2 +- + plugins/mtk/mm-broadband-modem-mtk.c | 2 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 6 +++--- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 +- + plugins/novatel/mm-common-novatel.c | 2 +- + plugins/option/mm-broadband-bearer-hso.c | 2 +- + plugins/option/mm-broadband-modem-option.c | 2 +- + plugins/pantech/mm-broadband-modem-pantech.c | 2 +- + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + plugins/sierra/mm-common-sierra.c | 2 +- + plugins/wavecom/mm-broadband-modem-wavecom.c | 2 +- + plugins/zte/mm-broadband-modem-zte.c | 2 +- + src/mm-base-bearer.c | 4 ++-- + src/mm-base-manager.c | 2 +- + src/mm-base-modem.c | 2 +- + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-broadband-modem.c | 6 +++--- + src/mm-iface-modem-3gpp.c | 4 ++-- + src/mm-iface-modem-cdma.c | 2 +- + src/mm-iface-modem-signal.c | 2 +- + src/mm-iface-modem-time.c | 2 +- + src/mm-iface-modem.c | 12 +++++------ + src/mm-plugin-manager.c | 4 ++-- + src/mm-port-probe.c | 26 + +++++++++++------------ + src/mm-port-serial.c | 18 ++++++++-------- + test/mmtty.c | 2 +- + 35 files changed, 73 insertions(+), 73 deletions(-) + +commit 2a99bdfa00c8b26266049e2c760ec7705c0ae739 +Author: Felix Janda +Date: Sat Oct 17 16:53:58 2015 +0200 + + Do not use obsolete XCASE terminal mode flag + + The XCASE terminal mode flag because is no longer specified by POSIX + and has no effect on linux. Because of the latter fact we can remove + it. This fixes a compilation error with musl libc. + + libqcdm/src/com.c | 2 +- + libwmc/src/com.c | 2 +- + src/mm-port-serial.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 3129516736bb6eb49458ece7df86f57fce51200e +Author: Dan Williams +Date: Wed Nov 11 12:38:49 2015 -0600 + + broadband-modem-qmi: implement power-cycle reset functionality + + src/mm-broadband-modem-qmi.c | 49 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + +commit 4e00558fcbdcfc9232f1007e718b9e2afae6520a +Author: Yunlian Jiang +Date: Wed Oct 28 14:16:24 2015 -0700 + + broadband-modem: fix a undifined behavior + + . A shift has undefined behaviour if the mathematical result + (lhs * 2^{rhs}) doesn't fit in the range of the resulting type. + In other words, you can't left shift into the sign bit of a + signed integer type. + The error message is: + + mm-broadband-modem.c:3308:15: runtime error: left shift of 1 by 31 + places cannot be represented in type 'int' + SUMMARY: AddressSanitizer: undefined-behavior + mm-broadband-modem.c:3308:15 in + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 30cbf7202c6b5c721ac59ac93052d678428d99d6 +Author: Aleksander Morgado +Date: Sun Oct 25 15:41:08 2015 +0100 + + build: on configure errors, show the specific libqmi or libmbim + version required + + configure.ac | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 35ab3dedd6fde556536feafe21a3e3fbb33ae942 +Author: Aleksander Morgado +Date: Sun Oct 25 15:36:14 2015 +0100 + + sim-qmi: try to gather from the optional TLV whether MNC is 2 or + 3 digits + + We bump libqmi requiremetn to 1.13.5, which is the one with support + for the new TLV. + + configure.ac | 2 +- + src/mm-sim-qmi.c | 28 +++++++++++++++++++++++++--- + 2 files changed, 26 insertions(+), 4 deletions(-) + +commit 77b6b02fd37cd8d89961dc32814b186639d1bafa +Author: Aleksander Morgado +Date: Sun Oct 25 15:15:25 2015 +0100 + + sim-qmi: fix building MCCMNC string + + For now, use 2 digits for MNC if < 100 and 3 digits otherwise. + + src/mm-sim-qmi.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit 3f3ad507e264ec23342269171df57db7a92618df +Author: Dan Williams +Date: Thu Oct 22 15:16:37 2015 -0500 + + sim-qmi: load operator identifier and name from NAS home network + + src/mm-sim-qmi.c | 177 + +++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 173 insertions(+), 4 deletions(-) + +commit 267b13c231003bddb51afdc91ea85637b7e678bb +Author: Dan Williams +Date: Thu Oct 22 17:13:31 2015 -0500 + + api: correct description of SimIdentifier property + + In MM 0.6 days it used to be obfuscated, but that was pointless. Now + it's just the ICCID. + + introspection/org.freedesktop.ModemManager1.Sim.xml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit a89dadcbc630099fce11a9fc0088d5269e34aee8 +Author: Aleksander Morgado +Date: Tue Oct 20 10:37:48 2015 +0200 + + bearer-qmi: don't add auth settings if no user/pass/auth given + + Auth settings will be added in a QMI message only if at least one + of these is + requested: + * An explicit auth preference is requested. + * User string is given and isn't empty. + * Password string is given and isn't empty. + + src/mm-bearer-qmi.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 5b568e97f8126879099c349486465cc9f14f64e5 +Author: Aleksander Morgado +Date: Thu Oct 15 10:07:08 2015 +0200 + + iface-modem-3gpp: allow LAC/CID updates reported while registering + + When changing from idle to registered we'll load registration info + before really + reporting that we're registered (so that clients can get the new + registration + info directly). During this time, we should also allow LAC/CID + updates triggered + in the location interface. + + E.g. when receiving this QMI message, we're not processing LAC/CID + because when + they get reported, the registration state was not yet 'registered': + + [/dev/cdc-wdm0] Received message (translated)... + >>>>>> QMUX: + >>>>>> length = 67 + >>>>>> flags = 0x80 + >>>>>> service = "nas" + >>>>>> client = 1 + >>>>>> QMI: + >>>>>> flags = "indication" + >>>>>> transaction = 0 + >>>>>> tlv_length = 55 + >>>>>> message = "Serving System" (0x0024) + >>>>>> TLV: + >>>>>> type = "MNC PCS Digit Include Status" (0x29) + >>>>>> length = 5 + >>>>>> value = D6:00:01:00:00 + >>>>>> translated = [ mcc = '214' mnc = '1' includes_pcs_digit = + 'no' ] + >>>>>> TLV: + >>>>>> type = "LTE TAC" (0x25) + >>>>>> length = 2 + >>>>>> value = 08:01 + >>>>>> translated = 264 + >>>>>> TLV: + >>>>>> type = "Detailed Service Status" (0x22) + >>>>>> length = 5 + >>>>>> value = 02:03:00:01:00 + >>>>>> translated = [ status = 'available' capability = + 'cs-ps' hdr_status = 'none' hdr_hybrid = 'yes' forbidden = 'no' ] + >>>>>> TLV: + >>>>>> type = "CID 3GPP" (0x1e) + >>>>>> length = 4 + >>>>>> value = 01:A1:4D:04 + >>>>>> translated = 72196353 + >>>>>> TLV: + >>>>>> type = "LAC 3GPP" (0x1d) + >>>>>> length = 2 + >>>>>> value = FE:FF + >>>>>> translated = 65534 + >>>>>> TLV: + >>>>>> type = "Current PLMN" (0x12) + >>>>>> length = 5 + >>>>>> value = D6:00:01:00:00 + >>>>>> translated = [ mcc = '214' mnc = '1' description = '' ] + >>>>>> TLV: + >>>>>> type = "Data Service Capability" (0x11) + >>>>>> length = 2 + >>>>>> value = 01:0B + >>>>>> translated = { [0] = 'lte '} + >>>>>> TLV: + >>>>>> type = "Serving System" (0x01) + >>>>>> length = 6 + >>>>>> value = 01:01:01:02:01:08 + >>>>>> translated = [ registration_state = 'registered' + cs_attach_state = 'attached' ps_attach_state = 'attached' + selected_network = '3gpp' radio_interfaces = '{ [0] = 'lte '}' ] + [1444895382.427216] Processing 3GPP info... + [1444895382.433423] Modem + /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state + changed (idle -> registering) + + [ Here we tried to update LAC/CID ] + + [1444895382.439668] Modem + /org/freedesktop/ModemManager1/Modem/3: 3GPP location updated + (MCC: '214', MNC: '1', Location area code: '0', Cell ID: '0') + [1444895382.446788] Modem + /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state + changed (registering -> home) + [1444895382.452383] Modem + /org/freedesktop/ModemManager1/Modem/3: state changed (enabled + -> registered) + + src/mm-iface-modem-3gpp.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit 0579ac076a073f2847c5171c5e72c0db5e3a8e51 +Author: Aleksander Morgado +Date: Wed Oct 14 19:24:37 2015 +0200 + + mm-broadband-modem: trigger registration checks only after enabling + all ifaces + + Given that the Location interface requires 3GPP info reported by + the 3GPP + interface, we should only trigger registration checks once the + Location + interface has been already enabled and ready to be used. If we don't + do this, + we'll end up e.g. getting initial MCCMNC values but never reaching + the Location + interface properly. + + So, fix this by triggering all registration checks (CDMA and 3GPP) + only after + having enabled all interfaces. + + src/mm-broadband-modem.c | 63 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.c | 27 -------------------- + src/mm-iface-modem-cdma.c | 25 ------------------- + 3 files changed, 63 insertions(+), 52 deletions(-) + +commit 1cb68c810e9e3f3589bdd121f0c383da1556cdeb +Author: Aleksander Morgado +Date: Tue Oct 13 10:41:10 2015 +0200 + + broadband-modem-qmi: LAC/CID not given in all serving system + indications + + LAC/CID may only be given in the serving system indications when + the values + change, and therefore we shouldn't reset the values to 0 whenever + they're not + reported. + + This seems to happen in newer devices; older devices like the MC7710 + did always + report the values in the indications. + + src/mm-broadband-modem-qmi.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +commit 2c0da9431918ea2aea6f871ab522425b8466b942 +Author: Aleksander Morgado +Date: Tue Oct 6 19:44:51 2015 +0200 + + build: diagrams and logos are no longer generated during build, + so don't remove them + + docs/reference/api/Makefile.am | 6 ------ + docs/reference/libmm-glib/Makefile.am | 5 ----- + 2 files changed, 11 deletions(-) + +commit b58ff7cdf01d24e6409440d7e278ec6c6fad83b3 +Author: Aleksander Morgado +Date: Tue Oct 6 19:44:08 2015 +0200 + + build: don't add PNGs in content_files, no longer needed + + docs/reference/api/Makefile.am | 7 +------ + docs/reference/libmm-glib/Makefile.am | 1 - + 2 files changed, 1 insertion(+), 7 deletions(-) + +commit b35de2b15f7e3a5b6e58505829cf097d84e51820 +Author: Aleksander Morgado +Date: Fri Sep 25 22:41:06 2015 +0200 + + modem-helpers-qmi: remove wrong check warning + + This check makes no sense. We're converting from a ModemManager enum + to a QMI + enum, nothing else; i.e. 'caps' is *not* the current capabilities + of the modem. + + src/mm-modem-helpers-qmi.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 7cb3b3faad7043374b01c96e875ba10694b40517 +Author: Dan Williams +Date: Thu Sep 24 14:54:45 2015 -0500 + + broadband-modem-qmi: update access technology from signal info for + newest QMI commands + + src/mm-broadband-modem-qmi.c | 171 + ++++++++++++++++++++++++------------------- + 1 file changed, 96 insertions(+), 75 deletions(-) + +commit a8666bd98f4cdd4c4cad7e40ef48e9980717705f +Author: Dan Williams +Date: Thu Sep 24 14:17:03 2015 -0500 + + sierra: fix build error when MBIM and QMI are disabled + + Found by Jean-Christian de Rivaz + + plugins/sierra/mm-plugin-sierra.c | 1 + + 1 file changed, 1 insertion(+) + +commit d281b9bddb6440ae00d7e8ec507b27e7a6cfabb3 +Author: Aleksander Morgado +Date: Thu Sep 24 21:13:26 2015 +0200 + + broadband-modem-qmi: fix invalid read + + Breakpoint 2, g_log (log_domain=log_domain@entry=0x7ffff6ad744e + "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, + format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed") + at gmessages.c:1075 + 1075 { + (gdb) bt + #0 0x00007ffff6a71b20 in g_log + (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", + log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, + format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed") + at gmessages.c:1075 + #1 0x00007ffff6a71be9 in g_return_if_fail_warning + (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", + pretty_function=pretty_function@entry=0x7ffff6b316a0 + <__FUNCTION__.5266> "g_variant_new_string", + expression=expression@entry=0x7ffff6b2f1e8 "g_utf8_validate + (string, -1, NULL)") at gmessages.c:1088 + #2 0x00007ffff6a9e925 in g_variant_new_string (string=0x7cf850 + "260\366\377\177") at gvariant.c:1230 + #3 0x00007ffff7068cfe in g_dbus_gvalue_to_gvariant + (gvalue=gvalue@entry=0x7fffffffdec0, type=0x7ffff7b9df91) + at gdbusutils.c:604 + #4 0x00007ffff7b8f1eb in + _mm_gdbus_modem3gpp_skeleton_handle_get_property + (connection=, sender=sender@entry=0x0, + object_path=object_path@entry=0x7bd340 + "/org/freedesktop/ModemManager1/Modem/1", + interface_name=interface_name@entry=0x7ffff7b97320 + "org.freedesktop.ModemManager1.Modem.Modem3gpp", + property_name=property_name@entry=0x7ffff7baa0a4 "OperatorCode", + error=error@entry=0x0, user_data=0x799ab0) + at mm-gdbus-modem.c:19680 + #5 0x00007ffff7b8f894 in + mm_gdbus_modem3gpp_skeleton_dbus_interface_get_properties + (_skeleton=) at mm-gdbus-modem.c:19759 + #6 0x00007ffff708e791 in g_dbus_interface_skeleton_get_properties + (interface_=0x799ab0 [MmGdbusModem3gppSkeleton]) at + gdbusinterfaceskeleton.c:371 + #7 0x00007ffff70937a2 in manager_method_call + (connection=, sender=sender@entry=0x7fffe0005200 + ":1.270", object_path=object_path@entry=0x7fffe0002fd0 + "/org/freedesktop/ModemManager1", + interface_name=interface_name@entry=0x7fffe0002dd0 + "org.freedesktop.DBus.ObjectManager", + method_name=method_name@entry=0x7fffe00059e0 "GetManagedObjects", + parameters=parameters@entry=0x7c1e70, invocation=0x7fffe0003260 + [GDBusMethodInvocation], user_data=0x713cd0) at + gdbusobjectmanagerserver.c:845 + #8 0x00007ffff7076aac in call_in_idle_cb + (user_data=0x7fffe0003260) at gdbusconnection.c:4884 + #9 0x00007ffff6a6a7fb in g_main_context_dispatch + (context=0x713a00) at gmain.c:3111 + #10 0x00007ffff6a6a7fb in g_main_context_dispatch + (context=context@entry=0x713a00) at gmain.c:3710 + #11 0x00007ffff6a6ab98 in g_main_context_iterate + (context=0x713a00, block=block@entry=1, dispatch=dispatch@entry=1, + self=) at gmain.c:3781 + #12 0x00007ffff6a6aec2 in g_main_loop_run (loop=0x71bf50) + at gmain.c:3975 + #13 0x0000000000430e57 in main (argc=, + argv=) at main.c:150 + + src/mm-broadband-modem-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 51447bd06bc8e06667843a3921a95a299ce2333d +Author: Aleksander Morgado +Date: Thu Sep 24 19:58:02 2015 +0200 + + libmm-glib: don't create a SIM object if empty path (/) given + + Instead, we'll return NULL and an error set. + + libmm-glib/mm-modem.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit b8245b55025e93ef09dfb9a213c7b8933e93e89d +Author: Aleksander Morgado +Date: Wed Sep 23 21:24:04 2015 +0200 + + broadband-modem-qmi: don't warn on invalid ESN/MEIDs reported + + The MC7304, which is a 3GPP only device, reports a ESN with value 0 in + "DMS Get IDs": + + ModemManager[10121]: [/dev/cdc-wdm0] Received message + (translated)... + >>>>>> QMUX: + >>>>>> length = 45 + >>>>>> flags = 0x80 + >>>>>> service = "dms" + >>>>>> client = 2 + >>>>>> QMI: + >>>>>> flags = "response" + >>>>>> transaction = 6 + >>>>>> tlv_length = 33 + >>>>>> message = "Get IDs" (0x0025) + >>>>>> TLV: + >>>>>> type = "Result" (0x02) + >>>>>> length = 4 + >>>>>> value = 00:00:00:00 + >>>>>> translated = SUCCESS + >>>>>> TLV: + >>>>>> type = 0x13 + >>>>>> length = 1 + >>>>>> value = 42 + >>>>>> TLV: + >>>>>> type = "Esn" (0x10) + >>>>>> length = 1 + >>>>>> value = 30 + >>>>>> translated = 0 + >>>>>> TLV: + >>>>>> type = "Imei" (0x11) + >>>>>> length = 15 + >>>>>> value = + >>>>>> translated = + + src/mm-broadband-modem-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 585320e0b4cf4e4e7ec9616c4d5bac43e4781000 +Author: Aleksander Morgado +Date: Tue Sep 22 09:34:22 2015 +0200 + + tests: plug memleak in +CMGR response parser + + src/tests/test-modem-helpers.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit eaf65ed98dd7e04b985be6b4241e9adab66750aa +Author: Nick Stevens +Date: Thu Sep 17 21:31:28 2015 +0000 + + core: process SMS +CGMR response with regex + + Variability in the response style from certain modems causes the + parsing + of the +CGMR response to fail. For example, the Telit HE910 inserts an + empty string ("") in the second field of the response, causing the + sscanf implementation to fail. + + This patch converts the parsing of the CGMR response to a regex that + allows for more flexibility and robustness, and adds unit tests around + the parsing call. + + Signed-off-by: Nick Stevens + + src/mm-broadband-modem.c | 17 ++++------ + src/mm-modem-helpers.c | 73 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers.h | 5 +++ + src/mm-sms-part-3gpp.h | 2 -- + src/tests/test-modem-helpers.c | 64 ++++++++++++++++++++++++++++++++++++ + 5 files changed, 148 insertions(+), 13 deletions(-) + +commit 0ca68657fbcd5bace3d303a0babe2da292784385 +Author: Krzysztof Kotlenga +Date: Wed Sep 16 15:46:12 2015 +0200 + + libmm-glib, simple: add missing introspection annotations to + disconnect() + + libmm-glib/mm-modem-simple.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8df7f83278e88402ce463c241e72de42b30103f0 +Author: Aleksander Morgado +Date: Tue Sep 15 16:34:50 2015 +0200 + + broadband-modem: minor coding style fixes + + src/mm-broadband-modem.c | 36 +++++++++++++++++++++++------------- + 1 file changed, 23 insertions(+), 13 deletions(-) + +commit 7f47f136737007876df190767331b28e3ec32764 +Author: Aleksander Morgado +Date: Tue Sep 15 16:33:48 2015 +0200 + + broadband-modem: don't issue failure setting up messaging in secondary + port as a warning + + src/mm-broadband-modem.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 48cd903189c2bc664da0f26ba7e6845e1950091e +Author: Nick Stevens +Date: Mon Sep 14 18:06:48 2015 +0000 + + core: enable unsolicited messages on secondary + + Previously the enable unsolicited messages command (+CNMI) was only + being sent on the primary. This patch adds support for sending the + enable on the secondary as well. If the secondary doesn't exist, or if + setting the enable causes an error, a warning is logged but no + error is + propagated up. + + This change is needed for proper SMS operation on the Telit HE910, + which + requires that +CNMI be sent to both primary and secondary. Since a + failure to send the +CNMI command on the secondary is a non-fatal + error, + it is unlikely that this will cause issues with other modems. + + Signed-off-by: Nick Stevens + + src/mm-broadband-modem.c | 91 + +++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 78 insertions(+), 13 deletions(-) + +commit 2034918d7b015f1176ec135cc023d4d161db56f7 +Author: Dan Williams +Date: Thu Aug 20 11:43:39 2015 -0500 + + broadband-modem-mbim: disable CDMA capabilities until we actually + support MBIM+CDMA + + CDMA-capable modems (like a Sierra EM7355) will fail to even enable, + because the internal CDMA code tries to initialize using AT + commands and + that fails because many MBIM modems don't have an AT port. We should + figure out how to support minimal MBIM + CDMA using MBIM instead of + AT-anything. + + [mm-broadband-modem.c:9000] enabling_step(): Modem has CDMA + capabilities, enabling the Modem CDMA interface... + [mm-iface-modem-cdma.c:946] + mm_iface_modem_cdma_run_registration_checks(): Running registration + checks (CDMA1x: 'yes', EV-DO: 'yes') + [mm-broadband-modem.c:7397] + setup_registration_checks_context_complete_and_free(): Will skip + all QCDM-based registration checks + [mm-broadband-modem.c:7418] + setup_registration_checks_context_complete_and_free(): Will skip + generic detailed registration check, we don't have Sprint commands + [mm-iface-modem-cdma.c:768] registration_check_step(): Starting + QCDM-based registration checks + [mm-iface-modem-cdma.c:780] registration_check_step(): Skipping + all QCDM-based checks and falling back to AT-based checks + [mm-iface-modem-cdma.c:823] registration_check_step(): Starting + AT-based registration checks + [mm-iface-modem-cdma.c:641] get_service_status_ready(): Could not + get service status: No AT port available to run command + [mm-iface-modem.c:1392] __iface_modem_update_state_internal(): Modem + /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> + disabled) + + src/mm-broadband-modem-mbim.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 0e7fc1dff9b3b8f72f6537f7f2b68e5c94a4c751 +Author: Aleksander Morgado +Date: Tue Aug 25 18:53:30 2015 +0200 + + blacklist: include MediaTek preloader + + https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1473246 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 707a2ef417b138540d5cc8d1f5c8fe1479845fb0 +Author: Aleksander Morgado +Date: Sun Aug 2 12:05:51 2015 +0200 + + libmm-glib,docs: fix missing documentations + + libmm-glib/mm-bearer-properties.c | 8 ++++---- + libmm-glib/mm-modem-messaging.c | 2 +- + libmm-glib/mm-modem.c | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit 7a7fddc931337ecfceb2be5497b3feed9c4c6fcc +Author: Aleksander Morgado +Date: Sun Aug 2 11:50:51 2015 +0200 + + libmm-glib,docs: update types + + # Extra options to supply to gtkdoc-scan + SCAN_OPTIONS = --rebuild-types + + docs/reference/libmm-glib/libmm-glib.types | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +commit 4043edfd173e1807b95d98dd54bad4179dce9c65 +Author: Aleksander Morgado +Date: Sun Aug 2 11:40:05 2015 +0200 + + libmm-glib,docs: avoid already defined id + + DOC Building HTML + ../libmm-glib-docs.xml:6: element indexdiv: validity error : ID + api-index-full already defined + DOC Fixing cross-references + + docs/reference/libmm-glib/libmm-glib-docs.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c4c3afa865b3bfc6319cf1a6649144b63f2a81fd +Author: Aleksander Morgado +Date: Sun Aug 2 11:31:41 2015 +0200 + + libmm-glib,call: add missing 'dtmf' variable description + + libmm-glib/mm-call.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 6fbed014dbe6d963a7b5f2a56368430bdd952be7 +Author: Aleksander Morgado +Date: Sun Aug 2 11:28:39 2015 +0200 + + docs,libmm-glib: add missing voice/call documentation + + docs/reference/libmm-glib/libmm-glib-docs.xml | 17 ++ + docs/reference/libmm-glib/libmm-glib-sections.txt | 277 + ++++++++++++++++++++++ + 2 files changed, 294 insertions(+) + +commit d0b0c3c3e575de1259a5b7f58a95737f54f91208 +Author: Aleksander Morgado +Date: Sun Aug 2 11:06:01 2015 +0200 + + api,call: fix Hangup() description + + There's no MM_CALL_DIRECTION_TERMINATED enum; plus, anyway, hangup() + should be + allowed regardless the direction. + + introspection/org.freedesktop.ModemManager1.Call.xml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit fcf54bd8b27e4b19837b496019a145011b03f550 +Author: Aleksander Morgado +Date: Sun Aug 2 10:49:14 2015 +0200 + + huawei: plug memleak + + plugins/huawei/mm-broadband-modem-huawei.c | 1 + + 1 file changed, 1 insertion(+) + +commit d1dab38a0689918a772dea53d71623df5e7e5bc0 +Author: Aleksander Morgado +Date: Sun Aug 2 10:46:37 2015 +0200 + + api,call: minor documentation fix + + introspection/org.freedesktop.ModemManager1.Call.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c55fcab3b3d3b9386e40b1578df588232edb945b +Author: Aleksander Morgado +Date: Sun Aug 2 10:45:17 2015 +0200 + + mmcli,call: minor alignment and message fixes + + cli/mmcli-call.c | 40 ++++++++++++++++++++-------------------- + 1 file changed, 20 insertions(+), 20 deletions(-) + +commit f6779d60fef803cef3e508249c29b2092cfc70c3 +Author: Marco Bascetta +Date: Thu Jul 23 18:23:26 2015 +0200 + + huawei,voice: ignore undocumented ^CSCHANNELINFO unsolicited command + + This command is sent by Huawei ME909s-120 with firmware + 23.613.61.00.00 + + plugins/huawei/mm-broadband-modem-huawei.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 74325b547add635b9e3916091d01e0b506bc4eb2 +Author: Marco Bascetta +Date: Thu Jun 4 09:24:36 2015 +0200 + + core,libmm-glib,cli,voice: Replaced 'SendTone' method and + 'ToneReceived' signal with 'SendDtmf' and 'DtmfReceived' + + cli/mmcli-call.c | 38 ++++----- + .../org.freedesktop.ModemManager1.Call.xml | 16 ++-- + libmm-glib/mm-call.c | 40 ++++----- + libmm-glib/mm-call.h | 10 +-- + src/mm-base-call.c | 98 + +++++++++++----------- + src/mm-base-call.h | 8 +- + src/mm-call-list.c | 4 +- + src/mm-call-list.h | 2 +- + src/mm-iface-modem-voice.c | 4 +- + src/mm-iface-modem-voice.h | 2 +- + 10 files changed, 111 insertions(+), 111 deletions(-) + +commit 2ac5d620c458ddc8771ae6c8789608b87d58f56b +Author: Marco Bascetta +Date: Wed Jun 3 09:37:39 2015 +0200 + + libmm-glib,cli: Replaced 'list call' with 'list calls' + + cli/mmcli-common.c | 12 +++++----- + cli/mmcli-modem-voice.c | 18 +++++++------- + libmm-glib/mm-modem-voice.c | 58 + ++++++++++++++++++++++----------------------- + libmm-glib/mm-modem-voice.h | 6 ++--- + 4 files changed, 47 insertions(+), 47 deletions(-) + +commit 9f3801df3f1ee8f5b8d9dfbf7e7a1968fdf85f0b +Author: Aleksander Morgado +Date: Sat May 23 18:17:12 2015 +0200 + + core,voice: remove explicit "NO CARRIER" response matching + + This response is already managed by the generic AT serial port + and translates + it into a proper error. This change also avoids the Call.Start() + call to report + a timeout in the serial port, instead we get a proper no-carrier + error. + + Before: + + $ sudo mmcli -m 0 --voice-create-call="number=12345678" + Successfully created new call: + /org/freedesktop/ModemManager1/Call/1 outgoing (unknown) + $ sudo mmcli -o 1 --start + error: couldn't start the call: + 'GDBus.Error:org.freedesktop.ModemManager1.Error.Serial.ResponseTimeout: + Serial command timed out' + + After: + + $ sudo mmcli -m 0 --voice-create-call="number=12345678" + Successfully created new call: + /org/freedesktop/ModemManager1/Call/1 outgoing (unknown) + $ sudo mmcli -o 1 --start + error: couldn't start the call: + 'GDBus.Error:org.freedesktop.ModemManager1.Error.Connection.NoCarrier: + No carrier' + + src/mm-broadband-modem.c | 17 ----------------- + src/mm-modem-helpers.c | 12 ------------ + src/mm-modem-helpers.h | 1 - + 3 files changed, 30 deletions(-) + +commit b600e6c9ce1552d95652e1e9623a1880941036d9 +Author: Aleksander Morgado +Date: Sat May 23 18:06:20 2015 +0200 + + mmcli,voice: align values of printed Call parameters + + cli/mmcli-call.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d5bc19f7db1bbbe8c54c2dc7d31bbc7a68c28d66 +Author: Aleksander Morgado +Date: Sat May 23 18:03:49 2015 +0200 + + policy: fix minor typo + + data/org.freedesktop.ModemManager1.policy.in.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 69585b1374877a97c7dfb15d366cab284cc8f0d2 +Author: Aleksander Morgado +Date: Sat May 23 18:01:35 2015 +0200 + + polkit: added Voice policy rule + + data/org.freedesktop.ModemManager1.conf.polkit | 35 + +++++++++++++++++++++++++ + data/org.freedesktop.ModemManager1.policy.in.in | 9 +++++++ + 2 files changed, 44 insertions(+) + +commit 6ca7c49d802f3e3c87dc5f2532e6d2064a3e6bf6 +Author: Aleksander Morgado +Date: Sat May 23 17:54:44 2015 +0200 + + docs,api: add missing links to the new Voice interface and Call object + + docs/reference/api/ModemManager-dbus-reference.xml | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 394bf91032e7544d323fe861ac13113e9bcfa26d +Author: Aleksander Morgado +Date: Sat May 23 17:49:52 2015 +0200 + + mmcli,voice: fix minor typo + + cli/mmcli-modem-voice.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a6adf041022ce54e3114c61ec387383a56838707 +Author: Aleksander Morgado +Date: Sat May 23 17:36:56 2015 +0200 + + docs,voice: add missing voice related enum values + + docs/reference/api/ModemManager-sections.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit e75d888b512c31847c757e0f62df5241602cb1fe +Author: Aleksander Morgado +Date: Sat May 23 17:31:19 2015 +0200 + + core,voice: minor coding style fixes + + src/mm-base-call.c | 148 + ++++++++++++++++++++---------------------- + src/mm-base-call.h | 77 +++++++++++----------- + src/mm-broadband-modem.c | 44 ++++++------- + src/mm-iface-modem-voice.c | 156 + +++++++++++++++++++++++---------------------- + src/mm-modem-helpers.h | 8 +-- + 5 files changed, 216 insertions(+), 217 deletions(-) + +commit 61562fbe8b48e747442f5302cc434f8bfb63ba2a +Author: Aleksander Morgado +Date: Sat May 23 17:31:06 2015 +0200 + + huawei,voice: minor coding style fixes + + plugins/huawei/mm-broadband-modem-huawei.c | 104 + +++++++++++++++-------------- + plugins/huawei/mm-call-huawei.c | 42 ++++++------ + plugins/huawei/mm-call-huawei.h | 2 +- + 3 files changed, 77 insertions(+), 71 deletions(-) + +commit d00fe0d628eb53047963330da1b7c148a4c8209f +Author: Aleksander Morgado +Date: Sat May 23 17:30:57 2015 +0200 + + libmm-glib,voice: minor coding style fixes + + libmm-glib/mm-call-properties.c | 32 +++++------ + libmm-glib/mm-call-properties.h | 32 +++++------ + libmm-glib/mm-call.c | 76 ++++++++++++------------- + libmm-glib/mm-call.h | 98 ++++++++++++++++---------------- + libmm-glib/mm-modem-voice.c | 121 + ++++++++++++++++++---------------------- + libmm-glib/mm-modem-voice.h | 50 ++++++++--------- + 6 files changed, 197 insertions(+), 212 deletions(-) + +commit ca88d6333fecc5a06f433c9e9135c70fe29abe95 +Author: Aleksander Morgado +Date: Sat May 23 17:30:42 2015 +0200 + + api,voice: minor coding style fixes + + include/ModemManager-enums.h | 2 +- + introspection/org.freedesktop.ModemManager1.Call.xml | 17 + ++++++++++++----- + .../org.freedesktop.ModemManager1.Modem.Voice.xml | 5 +++-- + 3 files changed, 16 insertions(+), 8 deletions(-) + +commit c0e05dbd43bf6b6752ff69b1c27071f88a123923 +Author: Aleksander Morgado +Date: Sat May 23 17:30:16 2015 +0200 + + cli,voice: minor coding style fixes + + cli/mmcli-call.c | 62 + ++++++++++++++++++++++++------------------------- + cli/mmcli-common.c | 45 +++++++++++++++++------------------ + cli/mmcli-common.h | 20 ++++++++-------- + cli/mmcli-modem-voice.c | 32 ++++++++++++------------- + 4 files changed, 80 insertions(+), 79 deletions(-) + +commit f67cc379563928ec09e859301d89d7408befcd1c +Author: Marco Bascetta +Date: Mon May 11 16:24:00 2015 +0200 + + iface-modem-voice: cleaned error debug messages + + src/mm-iface-modem-voice.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8242a991dc59296ca94109f4592ab86e34b44ece +Author: Marco Bascetta +Date: Mon May 11 11:24:54 2015 +0200 + + huawei: fixed status_change reason on new outgoing call + + plugins/huawei/mm-call-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 915e0e74222573f30cec73ba34e32fe5f1dbced1 +Author: Marco Bascetta +Date: Fri May 8 13:55:37 2015 +0200 + + huawei: signal incoming DTMF to DBus + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4a13bc8fec66efc6f74055c4778e569cf830ac5b +Author: Marco Bascetta +Date: Fri May 8 13:54:40 2015 +0200 + + mmcli: added --send-tone option + + cli/mmcli-call.c | 59 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 58 insertions(+), 1 deletion(-) + +commit 9874f10e1f27509219b6fe6b0a5374d04d1a3e3b +Author: Marco Bascetta +Date: Mon May 11 13:40:46 2015 +0200 + + base-call,iface-modem-voice:: handle DTMF + + src/mm-base-call.c | 194 + ++++++++++++++++++++++++++++++++++++++++++++- + src/mm-base-call.h | 20 +++-- + src/mm-call-list.c | 23 ++++++ + src/mm-call-list.h | 2 + + src/mm-iface-modem-voice.c | 18 ++++- + src/mm-iface-modem-voice.h | 2 + + 6 files changed, 252 insertions(+), 7 deletions(-) + +commit 8edead919343809d7c4bd7732a15c1a6c3912cba +Author: Marco Bascetta +Date: Fri May 8 13:51:17 2015 +0200 + + api,voice: added DTMF interface specification + + .../org.freedesktop.ModemManager1.Call.xml | 25 +++++- + libmm-glib/mm-call.c | 88 + +++++++++++++++++++++- + libmm-glib/mm-call.h | 17 +++++ + 3 files changed, 126 insertions(+), 4 deletions(-) + +commit 40fae5fcbae32a37ae974245008359435e70a91f +Author: Riccardo Vangelisti +Date: Thu May 7 17:16:29 2015 +0200 + + base-call: refactoring of error handling when call starts + + plugins/huawei/mm-call-huawei.c | 20 ++++++++++++++++---- + src/mm-base-call.c | 24 +++++++++++++++++------- + 2 files changed, 33 insertions(+), 11 deletions(-) + +commit bf416045dfda22f91e066640d1202e8241a21c0a +Author: Marco Bascetta +Date: Thu May 7 12:39:43 2015 +0200 + + huawei: acquire incoming DTMF on active call + + plugins/huawei/mm-broadband-modem-huawei.c | 189 + +++++++++++++++++++++++++++++ + src/mm-broadband-modem.c | 42 ------- + src/mm-modem-helpers.c | 12 -- + src/mm-modem-helpers.h | 1 - + 4 files changed, 189 insertions(+), 55 deletions(-) + +commit be09f500bd2ad1c22040c91e5cc6dbad0dcb6745 +Author: Riccardo Vangelisti +Date: Thu May 7 09:43:53 2015 +0200 + + huawei: added proprietary Huawei call handling + + plugins/Makefile.am | 2 + + plugins/huawei/mm-broadband-modem-huawei.c | 7 ++ + plugins/huawei/mm-call-huawei.c | 143 + +++++++++++++++++++++++++++++ + plugins/huawei/mm-call-huawei.h | 46 ++++++++++ + 4 files changed, 198 insertions(+) + +commit 3b5e43324180c0f46f0e891f94ae41a9ea241c9b +Author: Marco Bascetta +Date: Wed May 6 16:22:03 2015 +0200 + + mmcli: set call-start timeout to 2 minutes + + cli/mmcli-call.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 55ae2c7f2f5729346e28425f84a28b810b33efed +Author: Marco Bascetta +Date: Wed May 6 16:21:17 2015 +0200 + + huawei: handle voice call state changes + + plugins/huawei/mm-broadband-modem-huawei.c | 15 +++----- + src/mm-call-list.c | 54 + ++++++++++++++++++++++++-- + src/mm-call-list.h | 2 + + src/mm-iface-modem-voice.c | 62 + +++++++++++++++++++++++++----- + src/mm-iface-modem-voice.h | 2 + + 5 files changed, 113 insertions(+), 22 deletions(-) + +commit 5a281dbd34eaebef88299d60d014fa2e82eb6328 +Author: Riccardo Vangelisti +Date: Wed May 6 13:29:17 2015 +0200 + + base-call: created an unique function to switch call's state and + reason + + src/mm-base-call.c | 83 + ++++++++++++++++++++++++++++-------------------------- + src/mm-base-call.h | 1 + + 2 files changed, 44 insertions(+), 40 deletions(-) + +commit 65a64c924860eb41fa10c1eba5baf309f0ea2447 +Author: Marco Bascetta +Date: Wed May 6 12:36:54 2015 +0200 + + core: set number of incoming call + + src/mm-broadband-modem.c | 2 +- + src/mm-modem-helpers.c | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +commit ae7292203105de918b979c88dbceb169ae11913d +Author: Marco Bascetta +Date: Wed May 6 12:09:57 2015 +0200 + + huawei: handle custom voice unsolicited events + + plugins/huawei/mm-broadband-modem-huawei.c | 257 + ++++++++++++++++++++++++++++- + 1 file changed, 256 insertions(+), 1 deletion(-) + +commit 94c83710760ca2998af0593644172fad0bc02423 +Author: Riccardo Vangelisti +Date: Wed May 6 10:00:20 2015 +0200 + + base-call: fixed bug when hangup call. + + Ok, busy and no carrier messages are handled by serial-parser. + + src/mm-base-call.c | 87 + +++++++++++++++++++++--------------------------------- + 1 file changed, 34 insertions(+), 53 deletions(-) + +commit 6d85146bba3edceeaf9f23e0e7a5281fda527d59 +Author: Marco Bascetta +Date: Tue May 5 18:00:09 2015 +0200 + + core: handle incoming calls (RING/CRING, CLIP, NO CARRIER). + + src/mm-broadband-modem.c | 59 ++++++++++++++++++++++--- + src/mm-call-list.c | 59 +++++++++++++++++++++++++ + src/mm-call-list.h | 3 ++ + src/mm-iface-modem-voice.c | 104 + +++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-voice.h | 8 +++- + src/mm-modem-helpers.c | 26 ++++++++++++ + src/mm-modem-helpers.h | 8 ++-- + 7 files changed, 258 insertions(+), 9 deletions(-) + +commit c53bc10092563eb361b4980afb00080009067661 +Author: Riccardo Vangelisti +Date: Mon May 4 16:03:34 2015 +0200 + + base-call: added deletion of a specified call + + src/mm-base-call.c | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +commit ecbd146d5aca225c4873f08cc01e069cc284d38e +Author: Riccardo Vangelisti +Date: Mon May 4 14:51:46 2015 +0200 + + fixes: added voice support in libmm-glib MMManager, also fixed wrong + number of parameters in mm-call-list class init + + libmm-glib/mm-manager.c | 1 + + src/mm-call-list.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit 5c9e2488bff45dca2a762d666bb883a90870530c +Author: Riccardo Vangelisti +Date: Mon May 4 11:14:09 2015 +0200 + + build: added voice call include in libmm-glib and modified Makefile.am + + libmm-glib/libmm-glib.h | 2 ++ + src/Makefile.am | 6 ++++++ + src/mm-auth-provider.h | 1 + + 3 files changed, 9 insertions(+) + +commit 5c446c3f4364ad2bf4fc2a581e664ba90d3474ba +Author: Riccardo Vangelisti +Date: Mon May 4 11:13:19 2015 +0200 + + broadband-modem: added voice call support + + src/mm-broadband-modem.c | 370 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-modem.h | 1 + + src/mm-modem-helpers.c | 39 +++++ + src/mm-modem-helpers.h | 7 + + 4 files changed, 417 insertions(+) + +commit 886e2963df8951fa163c27527352ebd10321d3e3 +Author: Riccardo Vangelisti +Date: Mon May 4 11:12:18 2015 +0200 + + core: implemented MMIfaceModemVoice interface + + src/mm-iface-modem-voice.c | 959 + +++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-voice.h | 127 ++++++ + 2 files changed, 1086 insertions(+) + +commit ec5c539f553fdb6d1474aa9216b6944aa61e5bb0 +Author: Riccardo Vangelisti +Date: Mon May 4 11:11:43 2015 +0200 + + core: implemented new MMBaseCall object + + src/mm-base-call.c | 1030 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-call.h | 102 ++++++ + src/mm-call-list.c | 311 ++++++++++++++++ + src/mm-call-list.h | 75 ++++ + 4 files changed, 1518 insertions(+) + +commit c3bec1537b96b3b3071c2de787126ba11479ed88 +Author: Riccardo Vangelisti +Date: Mon Apr 27 11:41:59 2015 +0200 + + mmcli: added Modem.Voice and Call support + + cli/Makefile.am | 4 +- + cli/mmcli-call.c | 357 +++++++++++++++++++++++++++++++++++++++ + cli/mmcli-common.c | 281 +++++++++++++++++++++++++++++++ + cli/mmcli-common.h | 15 ++ + cli/mmcli-modem-voice.c | 438 + ++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 22 +++ + cli/mmcli.h | 16 ++ + 7 files changed, 1132 insertions(+), 1 deletion(-) + +commit 0bf4ad6b66b1ea7626df28dc2417686b9e2d03f7 +Author: Riccardo Vangelisti +Date: Mon Apr 27 11:38:57 2015 +0200 + + libmm-glib: added support for Modem.Voice and Call interfaces + + build-aux/header-generator.xsl | 3 + + libmm-glib/Makefile.am | 9 + + libmm-glib/generated/Makefile.am | 20 ++ + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-call-properties.c | 478 +++++++++++++++++++++++++++++++ + libmm-glib/mm-call-properties.h | 94 ++++++ + libmm-glib/mm-call.c | 422 +++++++++++++++++++++++++++ + libmm-glib/mm-call.h | 118 ++++++++ + libmm-glib/mm-common-helpers.c | 66 +++++ + libmm-glib/mm-common-helpers.h | 8 + + libmm-glib/mm-modem-voice.c | 599 + +++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-voice.h | 111 ++++++++ + libmm-glib/mm-object.c | 36 +++ + libmm-glib/mm-object.h | 3 + + 14 files changed, 1968 insertions(+) + +commit 0feb4acef4d47bc3c22bb1b8f121e5959fb55901 +Author: Riccardo Vangelisti +Date: Mon Apr 27 11:37:18 2015 +0200 + + api: added Modem.Voice and Call interfaces for voice call handling + + include/ModemManager-enums.h | 56 ++++++++++++++ + introspection/all.xml | 2 + + .../org.freedesktop.ModemManager1.Call.xml | 88 + ++++++++++++++++++++++ + .../org.freedesktop.ModemManager1.Modem.Voice.xml | 88 + ++++++++++++++++++++++ + 4 files changed, 234 insertions(+) + +commit 0337781ba746fb869198cff9705e521a2722b26d +Author: Aleksander Morgado +Date: Sun Aug 2 09:03:06 2015 +0200 + + base-manager: plug memleak + + Don't g_strdup() the physdev string to store it in the hash table; + instead store + the original string right away as it is already created with + g_strdup_printf(). + + Reported by: Yunlian Jiang + + https://code.google.com/p/chromium/issues/detail?id=515929 + + src/mm-base-manager.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 9b051b14ed33b5eca2e7d1b384d6a9f60d08e482 +Author: Dan Williams +Date: Mon Jul 20 12:17:12 2015 -0500 + + iface-modem: don't check the cache when asking for required unlocks + + When passing known_lock=UNKNOWN to mm_iface_modem_update_lock_info() + we actually do want to ask the modem itself for locks instead of + checking the cache. For example, when an unknown error is returned + after performing PIN/PUK operations, the cache value may well be + NONE if that was the prior lock state, and that bypasses the modem + which might now be locked. Thus the state gets messed up. + + Reproducer is to send 'ChangePin' with the wrong "old" PIN 3 times, + then send a wrong PUK. No error was returned from mmcli and + the modem's lock state was shown as 'none'. + + src/mm-iface-modem.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 99da30059f136600e4bf5ac2faec8b42def17d65 +Author: David Herrmann +Date: Wed Jul 15 13:49:49 2015 +0200 + + policy: don't prevent us from receiving signals + + By using: + + + ..we prevent anyone on the system from sending us signals, even if we + subscribed to them. This is clearly not what this line intended. More + importantly, we silently break mm-auth-provider-polkit, as we never + receiver 'changed' signals via PolkitAuthority. Right now, this is not + required by the implementation of PolkitAuthority, but ModemManager + should not place restrictions on the implementation of external + libraries. + + So make sure we only prevent Method-Calls to be sent to us. Any other + message that we didn't expect is automatically discarded by gdbus, + anyway. + + Without this change, debugging dbus policies constantly shows messages + that Polkit couldn't send the 'changed' signal to ModemManager. This + is + suppressed in non-debugging mode. But it would make debugging a lot + easier, if we'd avoid force-dropping those events and not clutter the + debug-log. + + data/org.freedesktop.ModemManager1.conf.polkit | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ad2c2ad14cbf894fa755a56536fa72b0db83e3d3 +Author: Dan Williams +Date: Thu Jul 2 10:30:58 2015 -0500 + + blacklist: ignore POSNET POLSKA S.A. devices + + src/77-mm-usb-device-blacklist.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e09463dfb28e2024767184cb7f3489618a4839ac +Author: Aleksander Morgado +Date: Fri Jun 19 12:20:03 2015 -0700 + + blacklist: ignore Palm M5xx devices + + https://bugs.freedesktop.org/show_bug.cgi?id=91032 + + src/77-mm-usb-device-blacklist.rules | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 1f270c09d03b6c2c4c57fb9b8ca539243035992b +Author: Marc Murphy +Date: Thu Jun 18 08:28:28 2015 +0100 + + huawei: update to correct secondary port request and regex masking + for ^POSITION + + plugins/huawei/mm-broadband-modem-huawei.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +commit 0ac7feb79720715a4a4f91e5e3f6c0775a092e0e +Author: Aleksander Morgado +Date: Fri Jun 5 17:42:18 2015 +0200 + + broadband-modem-qmi: retry unlock checks on 'UimUninitialized' errors + + The Pantech UML290 takes a horribly great time to initialize the + SIM, and + therefore we may even be losing the 3GPP capabilities as the SIM + is not + detected during the initial checks: + + load_unlock_required_ready(): Couldn't check if unlock required: + 'SIM failure: QMI protocol error (37): 'UimUninitialized'' + current_capabilities_internal_load_unlock_required_ready(): + Multimode device without SIM, no 3GPP capabilities + + To avoid this, let 'UimUninitialized' be a retriable error. + + src/mm-broadband-modem-qmi.c | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +commit d5fb4284e13b534b57660282cf80c33bf981929e +Author: David McCullough +Date: Thu May 28 11:23:45 2015 +1000 + + qmi: fix '0' prefixed IMEI/ESN/MEID on QMI modems + + QMI modems are incorrectly ignoring IMEI/ESN/MEID numbers that start + with a + '0'. Fix this up. Seen on an AT&T Beam (340u) + + Signed-off-by: David McCullough + + src/mm-broadband-modem-qmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4fcae938fc93415857fd1eb6dfdbcac34848ec5e +Author: Aleksander Morgado +Date: Mon May 4 09:27:33 2015 +0200 + + build: request to generate the enum types support files before + building + + Instead of providing explicit dependency rules to generate the + enum types + support files before they're first used, just pre-generate them + before building + anything. Maintaining the explicit dependency rules is not really + worth it. + + src/Makefile.am | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit d5adce08f5c17d25da782e611b377a8e1a815638 +Author: Aleksander Morgado +Date: Fri Apr 17 09:57:57 2015 +0200 + + build: only compile dbus tests if GIO >= 2.34 is available + + configure.ac | 4 ++++ + plugins/Makefile.am | 7 +++++++ + 2 files changed, 11 insertions(+) + +commit cc5f7311027b4062e2566d3b03e6dad65daf3b6e +Author: Aleksander Morgado +Date: Fri Apr 10 12:45:33 2015 +0200 + + blacklist: ignore all devices from Access Interface Solutions + + src/77-mm-usb-device-blacklist.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f60b0551429bbb767d0154f9c1335146641d340a +Author: Aleksander Morgado +Date: Fri Apr 10 08:23:28 2015 +0200 + + mbm: enable GPS port for HS2350 + + https://bugs.freedesktop.org/show_bug.cgi?id=85008 + + As reported by Dan Williams . + + plugins/mbm/77-mm-ericsson-mbm.rules | 1 + + 1 file changed, 1 insertion(+) + +commit 5fb8e87abd82d4eb463fdb601ca33ead153f5fc2 +Author: Aleksander Morgado +Date: Fri Apr 10 08:22:24 2015 +0200 + + mbm: enable GPS port for H5321gw + + https://bugs.freedesktop.org/show_bug.cgi?id=85008 + + As reported by Sven Arvidsson . + + plugins/mbm/77-mm-ericsson-mbm.rules | 2 ++ + 1 file changed, 2 insertions(+) + +commit 534eea345dd8dda96a88559b621ab1a55028cee8 +Author: Fabrice Bellet +Date: Wed Apr 8 16:48:29 2015 +0200 + + mbm: add GPS location gathering support + + The udev rules file is updated according to the list of devices + supporting gps features provided by the udev rules file from the + mbm-gpsd project. + + https://bugs.freedesktop.org/show_bug.cgi?id=85008 + + plugins/mbm/77-mm-ericsson-mbm.rules | 16 ++ + plugins/mbm/mm-broadband-modem-mbm.c | 346 + ++++++++++++++++++++++++++++++++++- + plugins/mbm/mm-plugin-mbm.c | 31 ++++ + 3 files changed, 392 insertions(+), 1 deletion(-) + +commit 9293fd2bca31a09fe79334d20aa33fa91eecd044 +Author: Dan Williams +Date: Mon Mar 9 11:38:39 2015 -0500 + + base-manager: quiet message about unsupported ports + + This message gets printed for all netdevs and ttys, including most + machines normal ethernet/Wi-Fi interfaces. It seems a bit less + critical + than 'warning' level would indicate. + + ModemManager[32097]: Couldn't find support for device at + '/sys/devices/pci0000:00/0000:00:19.0': not supported by any plugin + ModemManager[32097]: Couldn't find support for device at + '/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0': not supported + by any plugin + + src/mm-base-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8009f16ecb4408024e1d793d7aac5d08a31e2399 +Author: Aleksander Morgado +Date: Sat Mar 28 19:03:19 2015 +0100 + + huawei: allow responses like ^NDISSTATQry (e.g. Huawei E353) + + plugins/huawei/mm-modem-helpers-huawei.c | 91 + ++++++++++++++++-------- + plugins/huawei/tests/test-modem-helpers-huawei.c | 4 ++ + 2 files changed, 66 insertions(+), 29 deletions(-) + +commit 977cf658a6bf92a764632f69e99fe39a39e0ee4d +Author: Yunlian Jiang +Date: Fri Mar 27 20:30:18 2015 +0100 + + tests: fix memory leaks + + plugins/huawei/tests/test-modem-helpers-huawei.c | 14 +++++++++----- + plugins/icera/tests/test-modem-helpers-icera.c | 2 ++ + plugins/mbm/tests/test-modem-helpers-mbm.c | 2 ++ + 3 files changed, 13 insertions(+), 5 deletions(-) + +commit 948be2343a592d35403a8e7319fbe21952e56256 +Author: Aleksander Morgado +Date: Fri Mar 27 19:06:43 2015 +0100 + + telit: minor coding style fixes + + plugins/telit/mm-plugin-telit.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 12318970a7df2e0dd83b8284762e4cf7294fe0d3 +Author: Daniele Palmas +Date: Tue Mar 24 14:17:34 2015 +0100 + + telit: changing udev rules for HE910/UE910/UL865 + + Changing udev rules for HE910/UE910/UL865 in order to use dynamic port + identification through #PORTCFG (tag ID_MM_TELIT_PORTS_TAGGED) + + plugins/telit/77-mm-telit-port-types.rules | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit ad6d15b535e80392ee04581f5d638cb73367170c +Author: Daniele Palmas +Date: Tue Mar 24 14:17:33 2015 +0100 + + telit: implementing dynamic port identification with #PORTCFG + + Adding dynamic port identification for Telit modems that support + AT#PORTCFG + command. Port configurations for HE910/UE910/UL865 taken from document + "HE910/UE910/UL865 Families Ports Arrangements User Guide" + + plugins/telit/mm-plugin-telit.c | 260 + +++++++++++++++++++++++++++++++++++++++- + 1 file changed, 257 insertions(+), 3 deletions(-) + +commit 0e97dc3a7aaf5c2d1291eb5f2baf216e2ad4d9a5 +Author: Aleksander Morgado +Date: Wed Mar 25 08:38:42 2015 +0100 + + zte: add support for ZTE MF700 + + Fix suggested by Pablo Nazar + + https://bugs.freedesktop.org/show_bug.cgi?id=89721 + + plugins/zte/77-mm-zte-port-types.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3ad64c8f5aed43697bf289fce277bde48f208051 +Author: Jason Simmons +Date: Fri Mar 13 15:30:58 2015 -0700 + + broadband-modem: default implementation of the network time interface + + Add a default implementation that queries the real-time clock + using the + AT+CCLK? command. Also set AT+CTZU=1 in case a modem requires it. + + src/mm-broadband-modem.c | 96 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.c | 75 +++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 9 ++++ + src/tests/test-modem-helpers.c | 73 ++++++++++++++++++++++++++++++++ + 4 files changed, 253 insertions(+) + +commit a92566ec0e01bc606fd3673276eb5f7ece3b8291 +Author: Daniele Palmas +Date: Fri Mar 13 16:25:48 2015 +0100 + + telit: adding 3gpp unsolicited events support for Telit modems + + Mobile Equipment Event Reporting command for Telit modems (+CMER) + does not support =1. Changing to =2 + + plugins/telit/mm-broadband-modem-telit.c | 52 + +++++++++++++++++++++++++++++++- + 1 file changed, 51 insertions(+), 1 deletion(-) + +commit f9a5848d71972797a2871c6ccceaa6d9123eb8de +Author: Daniele Palmas +Date: Thu Mar 12 11:33:39 2015 +0100 + + telit: add custom flow control settings for Telit HE910, UE910, UL865 + + Telit HE910, UE910 and UL865 do not support XON/XOFF; defaulting + to RTS/CTS + + plugins/telit/mm-broadband-modem-telit.c | 48 + ++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +commit 00b5ae3e5b61eaf2757d7d34044842299181d80e +Author: Daniele Palmas +Date: Thu Mar 12 09:15:37 2015 +0100 + + telit: Adding udev rules for Telit HE910, UE910 and UL865 + + Adding udev rules for proper modem identification. + + plugins/telit/77-mm-telit-port-types.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 46b2aeae531ea47d3cf3d455305c40694d4f60b7 +Author: Aleksander Morgado +Date: Wed Mar 11 19:37:07 2015 +0100 + + novatel: fix checking for time support + + plugins/novatel/mm-broadband-modem-novatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 61ced36f8341ecedc403818c378f78f17f55ca9a +Author: Daniele Palmas +Date: Fri Mar 6 16:12:34 2015 +0100 + + Adding IMC flashing device in blacklist + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6a8fbf917a220416913a5e64a40bd4d26c6448f5 +Author: Aleksander Morgado +Date: Mon Mar 2 14:37:25 2015 +0100 + + iface-modem: don't artificially forbid power updates when in OFF state + + If for any reason the modem is in OFF state and still can talk to + the modem, + allow running the remaining transition requests to LOW or ON. This + can happen + for example for modems that use CFUN:0, i.e. which can still go + online with + CFUN=1. + + https://bugs.freedesktop.org/show_bug.cgi?id=89368 + + src/mm-iface-modem.c | 16 ---------------- + 1 file changed, 16 deletions(-) + +commit 28d4bb932cfdbf7a4320382d17312b3d1f2d1be0 +Author: Aleksander Morgado +Date: Fri Feb 27 17:30:43 2015 +0100 + + greylist: add Cypress USB<->RS232 adapters + + https://bugs.freedesktop.org/show_bug.cgi?id=89362 + + src/77-mm-usb-serial-adapters-greylist.rules | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 0a31a466cbeb42c613a80def224c94bba14431c3 +Author: Aleksander Morgado +Date: Thu Feb 26 12:37:20 2015 +0100 + + bearer,qmi: also print IPv6 gateway prefix + + src/mm-bearer-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dbebbd0bf0fcc9d1080b96f899d4e57332839db +Author: Aleksander Morgado +Date: Thu Feb 26 10:36:20 2015 +0100 + + bearer-qmi: avoid unref-ing arrays owned by the output bundles + + When we get an array from a libqmi output or input bundle, the array + is always + owned by the bundle (i.e. transfer-none). + + src/mm-bearer-qmi.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit de9446e13b7849ef4aad2664bc500c2fa2bb6d9c +Author: Aleksander Morgado +Date: Fri Feb 20 10:14:58 2015 +0100 + + build: refactor and cleanup configure.ac + + configure.ac | 137 + +++++++++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 92 insertions(+), 45 deletions(-) + +commit 9f7006616c8ee4d5e5381fa3637eff21d1d9c4fc +Author: Aleksander Morgado +Date: Fri Feb 20 09:40:09 2015 +0100 + + build: disable static libraries by default + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ee41e57507eb890d4e320a0e3fdf53d48925bf31 +Author: Aleksander Morgado +Date: Fri Feb 20 09:39:10 2015 +0100 + + build: setup silent-rules + + And bump automake requirement to 1.11. + + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 9186e2aa39668c0d071f52d47d6a1aea087bc8a7 +Author: Dan Williams +Date: Mon Feb 23 10:25:14 2015 -0600 + + iface-modem-3gpp: used DENIED registration state if others are UNKNOWN + + If all other registration states are UNKNOWN, use a registration state + of DENIED as the global modem state. + + src/mm-iface-modem-3gpp.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit 37bda21a370bfd5c125a7093bec55dca3914af9b +Author: Aleksander Morgado +Date: Tue Feb 17 10:57:22 2015 +0100 + + plugin: add implicit QMI and MBIM forbidden drivers check + + src/mm-plugin.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 43 insertions(+), 2 deletions(-) + +commit 57b5ffa8c4a7fdd48a8ae944010422a4754654d2 +Author: Aleksander Morgado +Date: Mon Feb 16 17:36:12 2015 +0100 + + gobi: remove plugin + + There's no real need for a custom Gobi plugin any more. All the + vendor-specific + Gobi-powered modems should be handled by vendor-provided plugins + supporting QMI + modems; or otherwise, as a last resort, by the generic plugin. + + plugins/Makefile.am | 10 --- + plugins/gobi/mm-broadband-modem-gobi.c | 124 + --------------------------------- + plugins/gobi/mm-broadband-modem-gobi.h | 49 ------------- + plugins/gobi/mm-plugin-gobi.c | 95 ------------------------- + plugins/gobi/mm-plugin-gobi.h | 41 ----------- + 5 files changed, 319 deletions(-) + +commit 93d6e4f102da51e72ecd2fbfcfa096cd2fd2e02e +Author: Aleksander Morgado +Date: Fri Feb 6 16:35:52 2015 +0100 + + dell: new Dell plugin + + For Dell-branded Novatel, Sierra and Ericsson modems. + + The Novatel plugin will no longer accept every Dell-branded modem, + which was + the current situation. Instead, a new Dell plugin will take care of + probing for + the correct vendor string, and based on the results create a specific + Novatel, + Sierra or Ericsson modem. + + In order to properly support this, the Novatel, Sierra and MBM + plugins now + export their implementations into non-inst libraries that the Dell + plugin will + import. + + Also, for now, the Dell plugin doesn't make any difference between + e.g. Sierra + or Ericsson MBIM implementations, just a generic MBIM modem is + created in both + cases, as that is anyway what the Ericsson MBM and Sierra plugins + do already. + + https://bugs.freedesktop.org/show_bug.cgi?id=86713 + + plugins/Makefile.am | 9 + + plugins/dell/mm-plugin-dell.c | 448 + ++++++++++++++++++++++++++++++++++++ + plugins/dell/mm-plugin-dell.h | 46 ++++ + plugins/novatel/mm-plugin-novatel.c | 4 +- + 4 files changed, 504 insertions(+), 3 deletions(-) + +commit 6bbc4c1746c9e7c48e12dcb1e1986f1e16327161 +Author: Aleksander Morgado +Date: Fri Feb 6 20:02:20 2015 +0100 + + sierra: move all the legacy Sierra support to a new 'sierra-legacy' + plugin + + In short: + + * The 'sierra-legacy' plugin will handle all the old AT based + modems, + including the DirectIP ones. This plugin is filtered by driver + ('sierra' or + 'sierra_net') and forbidden-drivers ('qmi_wwan' and + 'cdc_mbim'). This plugin + should also grab HP and AT&T branded models if they are handled + by the + proper kernel driver. + + * The 'sierra' plugin will only handle QMI or MBIM based Sierra + modems, which + are really all the new ones. This plugin is filtered by VID + (0x1199) and + driver (qmi_wwan and cdc_mbim). + + For this separation to work, the 'sierra' and 'sierra_net' plugins + need to be + complementary to each other. + + plugins/Makefile.am | 18 ++++-- + plugins/sierra/mm-plugin-sierra-legacy.c | 99 + ++++++++++++++++++++++++++++++++ + plugins/sierra/mm-plugin-sierra-legacy.h | 40 +++++++++++++ + plugins/sierra/mm-plugin-sierra.c | 34 ++++------- + 4 files changed, 162 insertions(+), 29 deletions(-) + +commit 3c6a7ed3f344e565271f26390da8d6db43fa0f70 +Author: Aleksander Morgado +Date: Fri Feb 6 21:05:05 2015 +0100 + + plugin-manager: make sure there is some wait time before probing + the first port + + We really do need a wait time to make sure most ports are exposed + by the + kernel, so that plugin filters based on "forbidden-drivers" work + correctly. E.g. + the "gobi" plugin now flags as forbidden the "qmi_wwan" driver, + which means that + modems exposing both TTYs and QMI/WWAN ports should never be handled + by the Gobi + plugin. + + src/mm-plugin-manager.c | 95 + +++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 68 insertions(+), 27 deletions(-) + +commit 07fcb807dd002be829b1462c131ca2f2dfb56b36 +Author: Aleksander Morgado +Date: Fri Feb 6 21:13:56 2015 +0100 + + plugin: allow having both 'drivers' and 'forbidden drivers' filters + + src/mm-plugin.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 51ab292802e21d1031c54bcab8c449d18b97ceaa +Author: Aleksander Morgado +Date: Fri Feb 6 18:38:32 2015 +0100 + + plugin: let vendor/product filter be complementary + + So that a plugin can specify a full VID and a specific PID subset + of another VID + as supported. + + src/mm-plugin.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit b1159453998e6dc89ba31a803c4c3886c8da0605 +Author: Aleksander Morgado +Date: Fri Feb 6 17:29:56 2015 +0100 + + sierra: move custom init and port grabbing methods to separate + source files + + plugins/sierra/mm-common-sierra.c | 217 + ++++++++++++++++++++++++++++++++++++ + plugins/sierra/mm-common-sierra.h | 17 +++ + plugins/sierra/mm-plugin-sierra.c | 224 + +------------------------------------- + 3 files changed, 239 insertions(+), 219 deletions(-) + +commit 5a268430c4c89e21d977403ec764c59b86498af8 +Author: Aleksander Morgado +Date: Fri Feb 6 17:11:52 2015 +0100 + + mbm: build a common non-inst library with the core Ericsson modem + support + + plugins/Makefile.am | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +commit 299280166301d00c2b0e2b8868a96013388b2a3f +Author: Aleksander Morgado +Date: Fri Feb 6 16:51:13 2015 +0100 + + sierra: build a common non-inst library with the core Sierra modem + support + + plugins/Makefile.am | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +commit 60a17df4c78d7bd9f27ca1425dba6c53298fd3d3 +Author: Aleksander Morgado +Date: Fri Feb 6 15:55:18 2015 +0100 + + novatel: build a common non-inst library with the core Novatel + modem support + + plugins/Makefile.am | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 7c929b5cf19ca6fd3ed8c5667efc026df13046a1 +Author: Aleksander Morgado +Date: Fri Feb 6 15:30:50 2015 +0100 + + novatel: move custom init method to separate source files + + plugins/Makefile.am | 2 + + plugins/novatel/mm-common-novatel.c | 158 + ++++++++++++++++++++++++++++++++++++ + plugins/novatel/mm-common-novatel.h | 31 +++++++ + plugins/novatel/mm-plugin-novatel.c | 146 + +-------------------------------- + 4 files changed, 194 insertions(+), 143 deletions(-) + +commit 553666d63a8a13baccfffa236f38f7f26dc1df9f +Author: Aleksander Morgado +Date: Mon Feb 16 16:48:57 2015 +0100 + + build: use absolute paths when ignoring specific files in subdirs + + If paths are not prefixed with '/' they are taken as filename-ignores + that apply + to the whole tree. + + .gitignore | 320 + ++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 159 insertions(+), 161 deletions(-) + +commit 8b985af3b6c3ac1aa40227a2116f107949b3b39d +Author: Aleksander Morgado +Date: Wed Feb 11 19:26:36 2015 +0100 + + build: remove obsolete ignored files + + .gitignore | 3 --- + 1 file changed, 3 deletions(-) + +commit f4ec32e6335b20c22db5b964ec5e667bbb8f8c39 +Author: Aleksander Morgado +Date: Wed Feb 11 18:24:50 2015 +0100 + + test: new 'mmtty' utility + + The new tester allows to play with the AT-capable TTY using the same + code as + ModemManager itself. + + $ sudo ./test/mmtty -d /dev/ttyHS0 --verbose + opening serial port '/dev/ttyHS0'... + (ttyHS0) opening serial port... + (ttyHS0): port attributes not fully set + (ttyHS0) device open count is 1 (open) + flashing serial port '/dev/ttyHS0'... + ready + > AT+GCAP + (ttyHS0): --> 'AT+GCAP' + (ttyHS0): <-- '+GCAP: + +CGSM,+DS,+ESOK' + +GCAP: +CGSM,+DS,+ES + > AT+GMI + (ttyHS0): --> 'AT+GMI' + (ttyHS0): <-- 'Option N.V.OK' + Option N.V. + > ^C + + cancelling the main loop... + + (ttyHS0) device open count is 0 (close) + (ttyHS0) closing serial port... + (ttyHS0) serial port closed + (ttyHS0) forced to close port + + .gitignore | 4 +- + test/Makefile.am | 17 +++- + test/mmtty.c | 299 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 318 insertions(+), 2 deletions(-) + +commit 7133d72f698c551d01cbc8f35102dc4d61148e20 +Author: Aleksander Morgado +Date: Wed Feb 11 19:24:46 2015 +0100 + + ports: move serial parsers to the internal libports + + src/Makefile.am | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit b7ed2c6b0ed163dcf67bdfd43c3fb73d5e51d069 +Author: Aleksander Morgado +Date: Wed Feb 11 19:32:49 2015 +0100 + + po: added systemd sleep management file to the list of translatable + files + + po/POTFILES.in | 1 + + 1 file changed, 1 insertion(+) + +commit 9b2b46e2be90553f0389a5395d5312d232ffa018 +Author: Aleksander Morgado +Date: Tue Feb 10 18:17:37 2015 +0100 + + broadband-modem-qmi: don't try FCC auth if the first Set Operating + Mode succeeds + + src/mm-broadband-modem-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a83d1c70b1f433bcb9a33b4cb1b5e3032050a104 +Author: Aleksander Morgado +Date: Sat Feb 7 21:39:00 2015 +0100 + + broadband-modem-qmi: use 'DMS Set FCC Authentication' if online + mode fails + + Some new devices, like the Dell DW5770, will return an internal + error when + trying to bring the power mode to online. We can avoid this by + sending the + magic "DMS Set FCC Auth" message before retrying. + + Bumping libqmi version to 1.13.4, which is the one that supports + this new + message. + + https://bugzilla.kernel.org/show_bug.cgi?id=92101 + + configure.ac | 2 +- + src/mm-broadband-modem-qmi.c | 185 + +++++++++++++++++++++++++++++++++---------- + 2 files changed, 143 insertions(+), 44 deletions(-) + +commit b6f8e5f08de8860b4c54609a3648cb86a04244ea +Author: Aleksander Morgado +Date: Fri Jan 16 09:52:05 2015 +0100 + + suspend: invalidate and remove modems on suspend, reprobe on resume + + configure.ac | 9 +++++++-- + src/main.c | 33 ++++++++++++++++++++++++++++++++- + src/mm-base-manager.c | 34 ++++++++++++++++++++++++++++------ + src/mm-base-manager.h | 3 ++- + 4 files changed, 69 insertions(+), 10 deletions(-) + +commit 132fbb0a7f51d01f11094367ee1f76cdafca350b +Author: Aleksander Morgado +Date: Thu Jan 15 12:51:26 2015 +0100 + + suspend: port upower backend to GDBus + + src/mm-sleep-monitor-upower.c | 69 + +++++++++++++++++++++++++------------------ + 1 file changed, 41 insertions(+), 28 deletions(-) + +commit a92b6f286bc8a9cd487a88e841e78c627ed98f85 +Author: Aleksander Morgado +Date: Thu Jan 15 11:53:03 2015 +0100 + + suspend: imported suspend/resume support from NetworkManager + + We're going to make this optional during build, not mandatory as + was the case + in NM. + + configure.ac | 22 ++++ + src/Makefile.am | 10 ++ + src/mm-sleep-monitor-systemd.c | 247 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-sleep-monitor-upower.c | 137 +++++++++++++++++++++++ + src/mm-sleep-monitor.h | 43 +++++++ + 5 files changed, 459 insertions(+) + +commit c6ba09403a404d191e388db3b54d0145f057075c +Author: Aleksander Morgado +Date: Thu Jan 15 11:33:51 2015 +0100 + + utils: imported singleton setup from NetworkManager + + src/Makefile.am | 1 + + src/mm-utils.h | 83 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 84 insertions(+) + +commit 6fb83b5e029134ab9844f05517a444f2df501773 +Author: Aleksander Morgado +Date: Fri Feb 6 15:29:52 2015 +0100 + + novatel: remove unused custom AT probe array + + plugins/novatel/mm-plugin-novatel.c | 13 ------------- + 1 file changed, 13 deletions(-) + +commit 60cd66b4fa77fe470772aa4957b43ce060555c2c +Author: Aleksander Morgado +Date: Thu Jan 29 21:28:52 2015 +0100 + + helpers: avoid segfault when empty pdp type string is given + + https://bugzilla.redhat.com/show_bug.cgi?id=1183250 + + src/mm-modem-helpers.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit dc38332224f804be1f0557789c95442898827d72 +Author: Aleksander Morgado +Date: Thu Jan 29 12:07:43 2015 +0100 + + plugin: avoid segfault when port driver is unknown + + Based on a patch from Bastiaan Jacques + + https://bugzilla.redhat.com/show_bug.cgi?id=1177799 + https://bugs.freedesktop.org/show_bug.cgi?id=88864 + + src/mm-device.c | 1 + + src/mm-plugin.c | 10 ++++------ + 2 files changed, 5 insertions(+), 6 deletions(-) + +commit 086a10ede07bc37c3603d70d7d5b4880e75b7df7 +Author: Dan Williams +Date: Mon Jan 26 17:02:13 2015 -0600 + + blacklist: ignore PalmOS devices driven by 'visor' + + MM probing appears to make 'visor' module die; and anyway + most of the devices driven by 'visor' are not phones, and + of the 3 that are phones they are so old (2002 - 2005 era) + that nobody is likely using them for dialup anymore. + + http://www.spinics.net/lists/linux-usb/msg120483.html + + src/77-mm-usb-device-blacklist.rules | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit f9489a06bed0c410d9bba694af6d681a143be09d +Author: Aleksander Morgado +Date: Sun Jan 25 21:49:01 2015 +0100 + + mmcli: add command completion + + cli/Makefile.am | 12 ++++ + cli/mmcli-completion | 171 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 183 insertions(+) + +commit 1e62589cb160607afa490b716f253de357b95802 +Author: Aleksander Morgado +Date: Sat Jan 24 18:05:41 2015 +0100 + + bearer-qmi: even if we request DHCP in the bearer, expose available + IPv4 config + + Same as we do in IPv6. Note that NM won't use it if DHCP is requested. + + src/mm-bearer-qmi.c | 74 + ++++++++++++++++++++++++++--------------------------- + 1 file changed, 37 insertions(+), 37 deletions(-) + +commit 67392272271c9ea455f1f333289491c9b726b209 +Author: Aleksander Morgado +Date: Thu Dec 25 12:51:38 2014 +0100 + + nokia: 20s for CSCS=? test command + + Nokia N9 via Bluetooth DUN may require up to 20s for the supported + charsets + query; so update the timeout in the Nokia plugin. + + https://bugs.freedesktop.org/show_bug.cgi?id=87635 + https://bugzilla.gnome.org/show_bug.cgi?id=741813 + + plugins/nokia/mm-broadband-modem-nokia.c | 39 + ++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 4a0a10c795d81576bff5a2019b51f301ad72b301 +Author: Aleksander Morgado +Date: Tue Oct 14 16:34:20 2014 +0200 + + haier: new Haier plugin to handle port type hints in the CE81B + + https://bugzilla.gnome.org/show_bug.cgi?id=685011 + https://bugs.freedesktop.org/show_bug.cgi?id=85001 + + plugins/Makefile.am | 11 ++- + plugins/haier/77-mm-haier-port-types.rules | 15 +++++ + plugins/haier/mm-plugin-haier.c | 105 + +++++++++++++++++++++++++++++ + plugins/haier/mm-plugin-haier.h | 40 +++++++++++ + 4 files changed, 170 insertions(+), 1 deletion(-) + +commit fcfd52df10c176dbc930c63011bfe8a48a0347dd +Author: Jakub Sitnicki +Date: Sun Jan 11 15:07:23 2015 +0100 + + core: perform clean-up when terminating due to a Unix signal + + Since commit 2d700043abc5 ("core: use g_unix_signal_add() for more + reliable Unix signal handling") we no longer have to stick to + signal-safe functions in the SIGTERM/SIGINT handler. + + Use exit() to terminate so that the clean-up functions are ran + and code + coverage data gets written into files. + + src/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7552030ef90004857b4535f835e19fe734b22a39 +Author: Jakub Sitnicki +Date: Sun Jan 11 15:07:22 2015 +0100 + + build: add code coverage support + + Build all targets, except for CLI tools (mmcli, uml290), with special + flags needed for collecting code coverage information when the + build has + been configured with --enable-code-coverage. + + Three new targets are available in the top build directory: + + - `check-code-coverage' runs the test suite and generates a code + coverage report, + + - `code-coverage-capture' generates a code coverage report from + already + collected data, which can come in handy when one wants to see code + paths touched by a particular test, + + - `code-coverage-clean' removes the collected coverage data and the + generated reports. + + .gitignore | 5 +++++ + Makefile.am | 7 +++++++ + configure.ac | 9 +++++++++ + libmm-glib/Makefile.am | 6 +++++- + libmm-glib/generated/Makefile.am | 3 +++ + libmm-glib/generated/tests/Makefile.am | 3 ++- + libmm-glib/tests/Makefile.am | 3 +++ + libqcdm/src/Makefile.am | 4 +++- + libqcdm/tests/Makefile.am | 3 +++ + libwmc/src/Makefile.am | 4 +++- + libwmc/tests/Makefile.am | 3 +++ + plugins/Makefile.am | 9 +++++++-- + src/Makefile.am | 3 +++ + src/tests/Makefile.am | 3 +++ + 14 files changed, 59 insertions(+), 6 deletions(-) + +commit ffe2106d4e556526119b89eedb62047fd8eab7de +Author: Jakub Sitnicki +Date: Sun Jan 11 15:07:21 2015 +0100 + + build: include ax_code_coverage.m4 serial 5 + + So that we don't require a fairly recent version of + autoconf-archive (v2014.10.15 or newer) to build. + + m4/ax_code_coverage.m4 | 229 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 229 insertions(+) + +commit ebf516c074e39ce81f7681e0c285e22751534047 +Author: Jakub Sitnicki +Date: Sun Jan 11 15:07:20 2015 +0100 + + build: remove incomplete support for code coverage + + Looks like make targets for generating code coverage reports with LCOV + were copied from GLib but corresponding changes to configure.ac + were not + made. Clean it up. + + gtester.make | 20 -------------------- + 1 file changed, 20 deletions(-) + +commit 470b02e8c8ee97277a2cfbb7e79853c03340b09b +Author: Roshan Pius +Date: Tue Dec 9 09:55:56 2014 -0800 + + port-probe: Increase AT probe command timeout to 7 seconds for altair. + + This patch increases the response timeout for the probe AT commands + for + altair modems. + + We've been noticing some altair modems taking upto 6 seconds to + respond to the + initial probe command after a reset which results in modem-manager + timing out and sending a second probe command. The modem sends + a response + after about 6 seconds for the initial probe command which + modem-manager + treats as response to second probe command and this results in the + modem-manager and modem going out of sync because the modem's second + probe response is treated as response to the next initialization + AT command + sent by modem-manager and so on. + + Change-Id: Iad8b0786327b153fd95c8ee4516f352325a42cf7 + + plugins/altair/mm-plugin-altair-lte.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 2edb00cbcb0ab7ad0bef82f4d7f4111f2edb75a6 +Author: Aleksander Morgado +Date: Fri Jan 9 12:47:54 2015 +0100 + + broadband-modem-qmi: fix memleak when listing SMS + + If we get multiple message lists, we need to make sure the previous + one is + cleared out before going to the next one. + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 46b707f8477c2dfbf6e6b4f48c73c2d3cbf5cd12 +Author: Aleksander Morgado +Date: Sun Dec 28 17:55:50 2014 +0100 + + mbim: use the new response checker helper method + + mbim_message_response_get_result() is available in libmbim-glib + 1.11.1. + + configure.ac | 2 +- + src/mm-bearer-mbim.c | 10 +++++----- + src/mm-broadband-modem-mbim.c | 30 +++++++++++++++--------------- + src/mm-sim-mbim.c | 16 ++++++++-------- + src/mm-sms-mbim.c | 4 ++-- + 5 files changed, 31 insertions(+), 31 deletions(-) + +commit 35575ccc158651d56f7cf39031d559d0974cf837 +Author: Aleksander Morgado +Date: Sun Dec 28 18:00:36 2014 +0100 + + port-qmi: always use QMI proxy + + We already require libqmi > 1.7.0 in the build. + + src/mm-port-qmi.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +commit 0dd707a2793c28369991377a0e09e00d3a09636f +Author: Aleksander Morgado +Date: Fri Dec 26 16:36:32 2014 +0100 + + iface-modem-location: don't print location info to syslog with + info level + + Use debug level, which has to be explicitly requested by the user. + + https://bugs.freedesktop.org/show_bug.cgi?id=87498 + + src/mm-iface-modem-location.c | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 3b2ed15abdb12a1a55404897dcffb447ac035d87 +Author: Aleksander Morgado +Date: Wed Dec 3 19:25:26 2014 +0100 + + port-probe: retry icera probing up to 3 times, with some time in + between cmds + + Icera-based modems need to return a correct response to the + AT%IPSYS? command, + so that they are properly detected as being Icera-based. + + Now, some modems, like the Nokia 21M-02, don't seem to return a + correct response + to AT%IPSYS just after being plugged in. So, setup a retry mechanism + (3 retries, + with 2 seconds between retries) to try to cope with this issue. + + https://bugs.freedesktop.org/show_bug.cgi?id=85012 + + Logs from the error situation: + + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'ATE1 E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'ATE1 E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'ATE1 E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- + 'ERROR' + [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure + code 100: Unknown error + [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): + Parsing AT got: 'Unknown error' + [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM0) + port is AT-capable + [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- 'ATE1 E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- ' E0' + [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- '' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- + 'ERROR' + [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure + code 100: Unknown error + [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): + Parsing AT got: 'Unknown error' + [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM1) + port is AT-capable + [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- + 'OK' + [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM2) + port is AT-capable + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'AT%IPSYS?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT%IPSYS?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'AT%IPSYS?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'AT%IPSYS?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- 'AT%IPSYS?' + [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- + 'ERROR' + + src/mm-port-probe.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit fd28a4d5cd6139f19f814328bfe860f69c418a25 +Author: Aleksander Morgado +Date: Fri Nov 14 12:32:10 2014 +0100 + + icera: IPv6 '::' is a placeholder for 'no IPv6', so don't error out + if found + + Also, allow IPDPADDR returns where only DNS IPv6 is given (i.e. no + IPv6 address + to set), and in that case default to DHCP method in the bearer. + + https://bugs.freedesktop.org/show_bug.cgi?id=85012 + + plugins/icera/mm-modem-helpers-icera.c | 67 + +++++++++++++++----------- + plugins/icera/tests/test-modem-helpers-icera.c | 31 +++++++++--- + 2 files changed, 61 insertions(+), 37 deletions(-) + +commit 71a1b64b3b60527a15dea72d0cc9a2bb31adcf9f +Author: Aleksander Morgado +Date: Mon Nov 24 20:53:23 2014 +0100 + + huawei: expect 'modem' and 'pcui' in ^GETPORTMODE responses + + Newer huawei modems, like the E3372, use the following ^GETPORTMODE + response + format: + ^GETPORTMODE: TYPE: WCDMA: ,pcui:1,modem:2,ncm:3,mass:4,mass_two:5, + + This patch updates the parser that looks for the control TTY (pcui) + and data TTY + (modem). + + https://bugs.freedesktop.org/show_bug.cgi?id=86658 + + plugins/huawei/mm-plugin-huawei.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit b51f701524778acde8ed33d3e4f1a2ac0f694f81 +Author: Tyler +Date: Fri Nov 14 12:11:14 2014 +0100 + + bearer: PDP context APN scan should be case insensitive + + src/mm-broadband-bearer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 692e6d344a6b2b9d943a577cfe3df1994e6d42a4 +Author: Aleksander Morgado +Date: Sun Nov 9 16:53:33 2014 +0100 + + tests,port-context: joining thread takes the reference already + + plugins/tests/test-port-context.c | 1 - + 1 file changed, 1 deletion(-) + +commit bc410ce03f6bfbfc970a89d79f200cece4c582de +Author: Torsten Hilbrich +Date: Wed Nov 12 12:45:38 2014 +0100 + + qmi: retrieve MM_MODEM_3GPP_FACILITY_SIM + + This facility cannot be retrieved via 'DMS UIM Get CK Status' + and seems + currently unimplemented for mm-broadband-modem-qmi. The SIM enabled + status is however available via 'DMS UIM Get PIN Status'. + + Using this message to add the retrieval of PIN status just after the + other facilities were queried. + + Succesfully tested with Gobi2000 (05c6:9205), both retrieval of 3gpp + SIM lock status and enabling/disabling the PIN. + + src/mm-broadband-modem-qmi.c | 68 + ++++++++++++++++++++++++++++++++++++++++---- + src/mm-modem-helpers-qmi.c | 26 +++++++++++++++++ + src/mm-modem-helpers-qmi.h | 1 + + 3 files changed, 90 insertions(+), 5 deletions(-) + +commit d44690489b57969bfdc44ebfcbfefce6cf3c5b42 +Author: Lubomir Rintel +Date: Wed Oct 1 12:00:14 2014 +0200 + + udev: Don't mark disconnected RFCOMM ttys as candidates + + Bluetooth serial devices are weird. They begin life being bound with + RFCOMMCREATEDEV ioctl() and then move around the sysfs tree when + they are + connected and disconnected. The connection is estabilished upon + the first + open() and torn down upon last close(), their first user virtually + being + "owner" of the connection. We don't want to be that process, + we're only + interested in actually connected modems. However, currently we have no + knowledge of that and therefore we connect and disconnect multiple + times while + probing. + + This patch marks unconnected RFCOMM devices as uninteresting to us. + The actual connection and disconnection will be handled by + NetworkManager. + + src/80-mm-candidate.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f79ec9bf4d94a6ae204e24647bf844d6af2ecb96 +Author: Lubomir Rintel +Date: Wed Oct 1 12:00:14 2014 +0200 + + manager: Remove devices which are deemed unfit during addition attempt + + device_added() might be called in response to a "change" or "move" + attempt that + might have changed a candidate device to a non-candidate one. + + src/mm-base-manager.c | 118 + ++++++++++++++++++++++++++------------------------ + 1 file changed, 62 insertions(+), 56 deletions(-) + +commit b8cd5ae838b1a17ce1bb6f01e6491c7b887e8474 +Author: Lubomir Rintel +Date: Wed Oct 1 12:02:36 2014 +0200 + + device: Keep track of devices as they are move across sysfs + + For certain devices the name changes with their status. Notably, + RFCOMM + devices move from /devices/virtual/ to underneath the HCI that is used + for the connection as the session is estabilished, and return + back when + it's torn down. + + src/mm-device.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 98f21ec195a090618139c601870bcc4b1883c33f +Author: Aleksander Morgado +Date: Thu Oct 30 00:05:35 2014 +0100 + + modem-helpers: fix IP4 -> IPV4 + + Stupid me, introduced a bug when manually writing the previous patch. + + :/ + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 01bd5006f5b0fb322fde03e3faa6ead5a80fe40a +Author: Oskar Enoksson +Date: Wed Oct 29 23:12:26 2014 +0100 + + modem-helpers: handle "IPV4" pdp type response + + My modem (Samsung GI B3740) responded "IPV4" to "CGDCONT=?". This was + not handled in mm-modem-helpers.c. The obvious fix was to return + MM_BEARER_IP_FAMILY_IPV4. + + src/mm-modem-helpers.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 555ec15a16414414dae1e71b889f38fa159e49fd +Author: Aleksander Morgado +Date: Wed Oct 29 22:35:52 2014 +0100 + + mm-broadband-modem-qmi: avoid using NULL pointer coming from an + empty GArray + + src/mm-broadband-modem-qmi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 3a76c0df5790dc4cd2019bd67b1e36c7f4114b32 +Author: Greg Suarez +Date: Thu Oct 23 13:15:17 2014 -0700 + + bearer-mbim: Implement report_connection_status() to set the port + as disconnected + + When the MBIM modem unexpectedly loses connection the port state never + gets set as disconnected thus when trying to reestablish a new + connection the bearer cannot find a port in the disconnected state. + + Signed-off-by: Greg Suarez + + src/mm-bearer-mbim.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +commit 046d9141c4277ac4b66c227a6e4649b1276f6a71 +Author: Dan Williams +Date: Tue Oct 28 11:46:51 2014 -0500 + + blacklist: ignore GW Instek AFG-2225 arbitrary waveform generator + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit a72b120798e7298e039acbf1144272ec5f54dc0e +Author: Aleksander Morgado +Date: Fri Oct 17 15:55:12 2014 +0200 + + tests,fixture: fix comment + + plugins/tests/test-fixture.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f2fa7a7fbf739ad38e0c10338bbcc59818c7670e +Author: Aleksander Morgado +Date: Wed Oct 15 18:29:18 2014 +0200 + + qcdm: don't retry probing if QCDM unescaping fails + + But keep the retries when the frame marker isn't found. + + https://bugzilla.gnome.org/show_bug.cgi?id=708861 + + include/ModemManager-errors.h | 2 ++ + src/mm-port-probe.c | 3 +++ + src/mm-port-serial-qcdm.c | 10 +++++----- + src/tests/test-qcdm-serial-port.c | 3 ++- + 4 files changed, 12 insertions(+), 6 deletions(-) + +commit 41b7e7b048e67a0b329c820c81beccf42bf0957e +Author: Dan Williams +Date: Tue Oct 7 15:53:53 2014 -0500 + + port-serial: fix forced closing after b28230411 + + b28230411 moved up the self->priv->forced_close = TRUE, which + caused mm_port_serial_close() to just return without actually + closing the port and cleaning up. + + Also, cancel the reopen separately from closing the port since + the two operations are actually independent of each other. + + src/mm-port-serial.c | 43 +++++++++++++++++++++++-------------------- + 1 file changed, 23 insertions(+), 20 deletions(-) + +commit 1e5ec7e1b147fc6dd2227d7ebf7510a96eb0503e +Author: Ben Chan +Date: Fri Oct 3 13:42:49 2014 -0700 + + tests: increase timeout for starting ModemManager on test bus + + The timeout for starting ModemManager on the test bus was 3s, which is + sufficient under normal conditions. However, when running ModemManager + tests on a build infrastructure under a heavy load, we've observed + that + the timeout isn't always sufficient and that becomes the source + of false + test failures. This patch increases the timeout to 30s, which + shouldn't + introduce any unexpected behavior under normnal conditions while + addressing the timeout issue on heavily loaded systems. + + plugins/tests/test-fixture.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8718ed53bee53519fb11f313dfbe55be527f6d76 +Author: Aleksander Morgado +Date: Mon Sep 15 10:56:36 2014 +0200 + + build: remove --with-newest-qmi-commands configure option + + We don't want people to use the logic enabled by this switch, so + remove it from + configure to avoid confusions. Developers can still enable the + related code by + defining WITH_NEWEST_QMI_COMMANDS via CFLAGS; e.g.: + + $ NOCONFIGURE=1 ./autogen.sh + $ ./configure CFLAGS="-DWITH_NEWEST_QMI_COMMANDS" + + configure.ac | 20 -------------------- + 1 file changed, 20 deletions(-) + +commit 340ff7dce3517b2b476a408572794e5206f43bac +Author: David McCullough +Date: Thu Sep 11 12:00:33 2014 +1000 + + broadband-modem-qmi: fix registration state when built with + --with-newest-qmi-commands + + This patch fixes the registration reporting/checking when ModemManager + is + built with --with-newest-qmi-commands. apply_cs and apply_ps were not + properly initialised and may never be true. Also fixes a CnP error for + mm_ps_registration_state. + + Signed-off-by: David McCullough + + src/mm-broadband-modem-qmi.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 84db93956591947843f640d11ab474c77486f6b5 +Author: David McCullough +Date: Thu Sep 11 11:55:01 2014 +1000 + + broadband-modem-qmi: fix signal strength when built with + --with-newest-qmi-commands + + This patch fixes the signal strength values when using ModemManager + built + with --with-newest-qmi-commands. + + It was never getting a valid signal strength because the default + (0) is + always greater than a valid signal strength, and the rssi_max handling + was completely wrong. + + Signed-off-by: David McCullough + + src/mm-broadband-modem-qmi.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit fd7d0a08f73cb0f8e7166dd34bc713ec0089f62f +Author: Aleksander Morgado +Date: Thu Feb 6 19:07:53 2014 +0100 + + broadband-modem-qmi: implement A-GPS enabling/disabling + + src/mm-broadband-modem-qmi.c | 371 + ++++++++++++++++++++++++++++++++++++------- + 1 file changed, 310 insertions(+), 61 deletions(-) + +commit 75f35cdb9edd0a9822b8af62cd3c36e8de95c655 +Author: Aleksander Morgado +Date: Thu Feb 6 17:58:09 2014 +0100 + + broadband-modem-qmi: implement SUPL server setting + + src/mm-broadband-modem-qmi.c | 139 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 139 insertions(+) + +commit 8d2b4fa5f9fb5e926cfa49231051ce09b8426bb3 +Author: Aleksander Morgado +Date: Thu Feb 6 15:32:15 2014 +0100 + + broadband-modem-qmi: implement SUPL server loading + + src/mm-broadband-modem-qmi.c | 129 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 129 insertions(+) + +commit 836892902e73c7046f2f2352d711e44d05675afb +Author: Aleksander Morgado +Date: Thu Feb 6 15:31:54 2014 +0100 + + broadband-modem-qmi: A-GPS available by default + + Also bump libqmi requirement to 1.11.1, which is the one exposing + the new A-GPS + related commands. + + configure.ac | 2 +- + src/mm-broadband-modem-qmi.c | 7 +++++-- + 2 files changed, 6 insertions(+), 3 deletions(-) + +commit 63f2e72c6c14ecef88d0a89b48729876b3cec931 +Author: Aleksander Morgado +Date: Thu Feb 6 12:20:56 2014 +0100 + + iface-modem-location: load SUPL server setup when initializing + interface + + src/mm-iface-modem-location.c | 41 + ++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-location.h | 8 ++++++++ + 2 files changed, 48 insertions(+), 1 deletion(-) + +commit d20f3e5d6002cb64d5e0f55fc1085b889da75c3f +Author: Aleksander Morgado +Date: Thu Feb 6 12:15:32 2014 +0100 + + iface-modem-location: handle setting SUPL server + + src/mm-iface-modem-location.c | 116 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-location.h | 9 ++++ + 2 files changed, 125 insertions(+) + +commit 72f4aa75d79b22cdcfec4612d7ab9916c4660181 +Author: Aleksander Morgado +Date: Thu Feb 6 12:04:35 2014 +0100 + + cli,location: allow enabling/disabling A-GPS + + cli/mmcli-modem-location.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 9dc5cdf78e528603f52c56cd9da9bfe0dd41d746 +Author: Aleksander Morgado +Date: Thu Feb 6 11:58:48 2014 +0100 + + cli,location: allow getting/setting SUPL server address + + cli/mmcli-modem-location.c | 65 + +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 64 insertions(+), 1 deletion(-) + +commit cd5ca169f1a4d9de1fd6802a4c735ffec634a245 +Author: Aleksander Morgado +Date: Thu Feb 6 11:51:03 2014 +0100 + + libmm-glib,location: add helpers to get/set the SUPL server address + + docs/reference/libmm-glib/libmm-glib-sections.txt | 5 + + libmm-glib/mm-modem-location.c | 122 + ++++++++++++++++++++++ + libmm-glib/mm-modem-location.h | 16 +++ + 3 files changed, 143 insertions(+) + +commit fbeee20d5b7789bd0bcd4e4ab1dce784390e5ebd +Author: Aleksander Morgado +Date: Thu Feb 6 11:10:53 2014 +0100 + + introspection,api: add SUPL server configuration in the Location + interface + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 ++++++ + include/ModemManager-enums.h | 2 ++ + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 25 + ++++++++++++++++++++++ + src/mm-iface-modem-location.c | 10 ++++++--- + 4 files changed, 41 insertions(+), 3 deletions(-) + +commit 02961c388b54fe3a00419004d2e9f1ce6025751c +Author: Aleksander Morgado +Date: Fri Sep 5 11:19:05 2014 +0200 + + docs,man: renew the ModemManager man page and add several missing + commands + + docs/man/ModemManager.8 | 70 + +++++++++++++++++++++++++++++++++---------------- + 1 file changed, 47 insertions(+), 23 deletions(-) + +commit c4e7fdf02530f13c037945d6abe70c3e11277df5 +Author: Aleksander Morgado +Date: Fri Sep 5 11:18:01 2014 +0200 + + core: add --version option to the ModemManager daemon + + It was actually included in the man page of the daemon, but we didn't + have it. + + src/main.c | 4 ---- + src/mm-context.c | 19 +++++++++++++++++++ + src/mm-context.h | 5 +++++ + 3 files changed, 24 insertions(+), 4 deletions(-) + +commit 50ec0907de15cb6311088b81d0181b10943772bc +Author: Aleksander Morgado +Date: Mon Apr 7 14:10:50 2014 +0200 + + zte: blacklist QMI and net interface in the MF60 + + The MF60 exposes a QMI+net pair, but they are unusable as the + WDS service + returns error when e.g. launching a connection. + + So, fallback to AT+PPP in this device. + + plugins/zte/77-mm-zte-port-types.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 31f81725e628fd94233e62752ec386215d2b9e13 +Author: Aleksander Morgado +Date: Fri Sep 5 09:33:38 2014 +0200 + + plugin: allow to explicitly ignore any kind of port via udev + + The new 'ID_MM_PORT_IGNORE' tag will tell ModemManager to fully + avoid using a + given port. + + Note that it is key to not only flag the port probe as ignored, + but also to + fully ignore the ports in e.g. mm_port_probe_list_has_qmi_port() + as those + methods will be used to decide which kind of modem object to + create. We don't + want to create a QMI-based modem which may have all QMI ports + blacklisted. + + src/mm-plugin.c | 13 +++++++++++++ + src/mm-port-probe.c | 26 +++++++++++++++++++++++--- + src/mm-port-probe.h | 1 + + 3 files changed, 37 insertions(+), 3 deletions(-) + +commit 8450e563bb79bd1e300bba1d2e89c6d39a173694 +Author: Aleksander Morgado +Date: Fri Sep 5 08:52:22 2014 +0200 + + plugin: if no QMI or no MBIM still grab the WWAN ports, flagged + as ignored + + E.g. this would be the result when having ModemManager compiled + without QMI + support, and a modem with 2 QMI/WWAN pairs: + + $ mmcli -m 2 + + /org/freedesktop/ModemManager1/Modem/2 (device id + '417e4dcff7f232b62cfe6c972e2099701848fd7f') + ------------------------- + Hardware | manufacturer: 'Sierra Wireless, Incorporated' + | model: 'MC7304' + | revision: 'SWI9X15C_05.05.02.00 r19147 + carmd-fwbuild1 2013/11/15 13:54:28' + | supported: 'gsm-umts' + | current: 'gsm-umts' + | equipment id: 'unknown' + ------------------------- + System | device: + '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7' + | drivers: 'qcserial, qmi_wwan' + | plugin: 'Gobi' + | primary port: 'ttyUSB8' + | ports: 'ttyUSB8 (at), wwp0s29u1u7i8 + (unknown), ttyUSB6 (qcdm), wwp0s29u1u7i10 (unknown)' + + The /dev/cdc-wdm ports don't even appear (as they were not even + probed), but the + newly ignored WWAN ports do appear in the list, but flagged as + UNKNOWN type + (instead of NET). + + src/mm-plugin.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +commit d2544ac044aea6b24e2f60e71fb3c1291552a2f9 +Author: Aleksander Morgado +Date: Fri Sep 5 08:47:30 2014 +0200 + + base-modem: always grab ports marked as ignored + + Modems may expose ports that are either just not used (e.g. modems + exposing more + than 2 functional AT ports) or explicitly avoided (e.g. WWAN ports + when we don't + know how to use them). + + Those kind of ports are part of the modem, but not used by + ModemManager. Still, + ModemManager should list them in the list of ports available for + the modem, with + IGNORED type. + + src/mm-base-modem.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit a22681ba99f8249a5d516dca773b125c0bdf0912 +Author: Aleksander Morgado +Date: Sun Jul 27 13:45:10 2014 +0200 + + port-mbim: use the mbim-proxy by default + + src/mm-port-mbim.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 1acfb0ad2f37df03c4d76627792a247750ae0278 +Author: Aleksander Morgado +Date: Fri Aug 22 18:11:27 2014 +0200 + + build: post release version bump to 1.5.0 (development) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a2a71317015e6bcf600bbf131c629e62c5859b1c +Author: Aleksander Morgado +Date: Fri Aug 22 16:56:05 2014 +0200 + + release: bump version to 1.4.0 + + NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 6 +++--- + 2 files changed, 46 insertions(+), 3 deletions(-) + +commit 8fcfae43e0316dab0086a7ae535b4f383b31fed8 +Author: Aleksander Morgado +Date: Fri Aug 22 16:52:31 2014 +0200 + + AUTHORS: update from git log + + $ git shortlog -s -n + + AUTHORS | 74 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 71 insertions(+), 3 deletions(-) + +commit 0c6f1ae6c4bae4b4d82d015f6940e0448749aee3 +Author: Dan Williams +Date: Mon Aug 18 09:47:59 2014 -0500 + + qmi: always use DHCP for IPv4 configuration instead of STATIC + + Some newer modems (Huawei E1750, Sierra 73xx) provide what looks like + legitimate static IPv4 configuration through the WDSGetCurrentSettings + call, but when configured the interface does not pass traffic. + Running + DHCP on the same interface provides a slightly different IPv4 + configuration but does allow traffic to pass. + + Since QMI was switched to static originally for consistency with IPv6 + and for speed of IP configuration (since DHCP takes a bit of time), + but + not for any known problems with modems, let's switch back to DHCP + until + we have time to figure out what's actually going on. + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b03e1cfd582d433694ac9b4f13e9e2757da61348 +Author: Aleksander Morgado +Date: Wed Aug 13 20:04:03 2014 +0200 + + bearer-qmi: allow forcing DHCP instead of static IP config + + src/mm-bearer-qmi.c | 154 + +++++++++++++++++++++++++++++++------------ + src/mm-bearer-qmi.h | 5 +- + src/mm-broadband-modem-qmi.c | 2 +- + 3 files changed, 117 insertions(+), 44 deletions(-) + +commit 46696114124d1a69cd3d90ba83abff36014a7326 +Author: Ben Chan +Date: Mon Aug 11 12:42:38 2014 -0700 + + broadband-modem,plugins: fix GMatchInfo leaks + + plugins/huawei/mm-broadband-modem-huawei.c | 2 ++ + plugins/mtk/mm-broadband-modem-mtk.c | 5 +++-- + plugins/novatel/mm-broadband-modem-novatel.c | 1 + + plugins/x22x/mm-broadband-modem-x22x.c | 1 + + src/mm-broadband-modem.c | 1 + + 5 files changed, 8 insertions(+), 2 deletions(-) + +commit da933468c81d45fa1eb8a80b926b5fe06876ebef +Author: Aleksander Morgado +Date: Mon Aug 11 18:31:27 2014 +0200 + + huawei: minor style fixes + + plugins/huawei/mm-broadband-modem-huawei.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit bd0ffd24f1c95a1974176a1cc0eb6f3444f45e8e +Author: David McCullough +Date: Wed Aug 6 17:30:22 2014 +1000 + + huawei: improve support for network time on Huawei modules + + Third revision of Huawei nwtime support. Takes on feedback from the + mailing list including helpers, some basic tests and use of the ^NTCT + command to determine network time support (^NWTIME). Expanded test + cases, + more use of g_assert and more logical helper return values/errors. + + Signed-off-by: David McCullough + + plugins/huawei/mm-broadband-modem-huawei.c | 168 + ++++++++++++++--------- + plugins/huawei/mm-modem-helpers-huawei.c | 151 + ++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 16 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 134 ++++++++++++++++++ + 4 files changed, 404 insertions(+), 65 deletions(-) + +commit 8c4318d87a5cc604d04913c66ac3e4ebda10bc18 +Author: Dan Williams +Date: Mon Aug 11 10:45:41 2014 -0500 + + iface-mode: downgrade "access technology changed" message to debug + + We have a report of a modem that switches access technologies + frequently, + in this case almost every 10 seconds. While that's unusual, it's not + unexpected depending on the RF environment. We shouldn't spam syslog + with that info; if we need it we can get it with mmcli. + + src/mm-iface-modem.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 31695a3912ee396836b6af017f9eb9a0b2d46073 +Author: Dan Williams +Date: Tue Aug 5 09:52:20 2014 -0500 + + build: INCLUDES -> AM_CPPFLAGS to quiet automake warning + + docs/reference/api/Makefile.am | 2 +- + docs/reference/libmm-glib/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 3dd6f931330e75a644d92e8f96f3268fc39938ae +Author: Aleksander Morgado +Date: Mon Aug 4 15:20:57 2014 +0200 + + build: require libmbim 1.10.0 + + We were depending on some new MbimNwError values defined at some + point in the + 1.9 development series. Depend on the new stable 1.10 version now + that it's been + released. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b8138d93f5b56ea5681a6f5dd3629a4ec1a78879 +Author: David McCullough +Date: Tue Jul 29 09:34:44 2014 +1000 + + libmbim-glib: handle explicit '+' on positive numbers + + libmm-glib/mm-common-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f203b1bf00f6dbf37d6fb11be869ecdfcd4f7397 +Author: Aleksander Morgado +Date: Sun Jul 27 13:55:10 2014 +0200 + + plugin: improve probing decision logic for QMI and MBIM + + So, we may have modems with multiple /dev/cdc-wdm ports, like + Ericsson modems, + where only 1 of them is MBIM. With the previous logic, we would + probe all + /dev/cdc-wdm ports for MBIM as soon as one of the ports was handled + by the + cdc_mbim driver. That is totally not optimal, as we are already know + that they + are not MBIM (not handled by cdc_mbim). + + Instead, fix the logic to just probe for MBIM or QMI if the actual + driver + managing the port is MBIM or QMI. + + src/mm-plugin.c | 19 ++----------------- + 1 file changed, 2 insertions(+), 17 deletions(-) + +commit 0284daf87e8f0ba780a4dcbe4741713cb3c779eb +Author: Ben Chan +Date: Thu Jul 17 00:19:41 2014 -0700 + + broadband-modem-mbim: increase timeout for powering modem up and down + + It's been observed that some modems occasionally take a long time to + power down (which may be due to some shutdown sequence that involves + communicating with network). This patch increases the timeout for + powering modem up and down from 10s to 20s. + + src/mm-broadband-modem-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8a56cd4c2a0578ee2a191c89926bb36bb55da80e +Author: Ben Chan +Date: Thu Jul 17 00:19:42 2014 -0700 + + bearer-mbim: increase disconnect timeout + + It's been observed that modems may take a long time to disconnect from + the network under certain network conditions. This patch increases the + timeout for the MBIM_CID_CONNECT set command in the disconnect + sequence + from 10s to 30s. + + src/mm-bearer-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c8572c8098d02dfb8102028e055f29d35c878719 +Author: Aleksander Morgado +Date: Fri Jul 11 18:56:37 2014 +0200 + + polkit: fix Location.Setup() authorization rules + + data/org.freedesktop.ModemManager1.conf.polkit | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e5920efe092ea41965ecf11fc98193e18bd502b3 +Author: Aleksander Morgado +Date: Fri Jul 11 11:51:38 2014 +0200 + + broadband-modem-mbim: VZ20M returns ERROR_PIN_REQUIRED in PIN query + response + + VID/PID: 258d:e000 + + Instead of returning success and the PIN type + PIN status + + Remaining attempts, + this modem returns a plain ERROR_PIN_REQUIRED error, so try to + handle that... + + src/mm-broadband-modem-mbim.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 6062462dcb8f68aff25607b742e05a4a53148c79 +Author: Aleksander Morgado +Date: Wed Jul 9 11:58:46 2014 +0200 + + broadband-modem-mbim: reset strings to NULL, not 0 + + src/mm-broadband-modem-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0be8808cbd6cd490d842876cefd249796838b377 +Author: kuonirat +Date: Tue Jul 8 16:15:18 2014 +0200 + + broadband-modem-mbim: update_registration_info immune to null + pointers passed + + src/mm-broadband-modem-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 5358d6fea0b27ae4c71de6ce0b4d71060906216e +Author: Aleksander Morgado +Date: Sun Jul 6 16:50:30 2014 +0200 + + sim: rename 'MMSim' to 'MMBaseSim' + + Just so that we don't have same header names in src/ and /libmm-glib. + + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + plugins/huawei/mm-sim-huawei.c | 34 +-- + plugins/huawei/mm-sim-huawei.h | 18 +- + plugins/iridium/mm-broadband-modem-iridium.c | 2 +- + plugins/iridium/mm-sim-iridium.c | 28 +-- + plugins/iridium/mm-sim-iridium.h | 18 +- + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + plugins/mbm/mm-sim-mbm.c | 30 +-- + plugins/mbm/mm-sim-mbm.h | 18 +- + plugins/nokia/mm-broadband-modem-nokia.c | 2 +- + plugins/nokia/mm-sim-nokia.c | 24 +- + plugins/nokia/mm-sim-nokia.h | 18 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 +- + plugins/novatel/mm-sim-novatel-lte.c | 22 +- + plugins/novatel/mm-sim-novatel-lte.h | 18 +- + plugins/pantech/mm-broadband-modem-pantech.c | 2 +- + plugins/pantech/mm-sim-pantech.c | 30 +-- + plugins/pantech/mm-sim-pantech.h | 18 +- + plugins/sierra/mm-common-sierra.c | 2 +- + plugins/sierra/mm-common-sierra.h | 13 +- + plugins/sierra/mm-sim-sierra.c | 22 +- + plugins/sierra/mm-sim-sierra.h | 18 +- + src/Makefile.am | 4 +- + src/{mm-sim.c => mm-base-sim.c} | 282 + +++++++++++------------ + src/mm-base-sim.h | 168 ++++++++++++++ + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-broadband-modem.c | 20 +- + src/mm-iface-modem-3gpp.c | 6 +- + src/mm-iface-modem-simple.c | 16 +- + src/mm-iface-modem.c | 22 +- + src/mm-iface-modem.h | 8 +- + src/mm-sim-mbim.c | 80 +++---- + src/mm-sim-mbim.h | 18 +- + src/mm-sim-qmi.c | 72 +++--- + src/mm-sim-qmi.h | 18 +- + src/mm-sim.h | 168 -------------- + 37 files changed, 614 insertions(+), 615 deletions(-) + +commit a29382be70ead81b31a1e7f14ad6fc0984082536 +Author: Aleksander Morgado +Date: Sun Jul 6 16:20:47 2014 +0200 + + sms: rename 'MMSms' to 'MMBaseSms' + + Just so that we don't have same header names in src/ and /libmm-glib. + + src/Makefile.am | 4 +- + src/{mm-sms.c => mm-base-sms.c} | 276 + ++++++++++++++++++++-------------------- + src/mm-base-sms.h | 126 ++++++++++++++++++ + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-broadband-modem.c | 4 +- + src/mm-iface-modem-messaging.c | 12 +- + src/mm-iface-modem-messaging.h | 6 +- + src/mm-sms-list.c | 80 ++++++------ + src/mm-sms-list.h | 2 +- + src/mm-sms-mbim.c | 48 +++---- + src/mm-sms-mbim.h | 8 +- + src/mm-sms-qmi.c | 66 +++++----- + src/mm-sms-qmi.h | 8 +- + src/mm-sms.h | 129 ------------------- + 15 files changed, 384 insertions(+), 389 deletions(-) + +commit 3ca267b01f5496e1d03f31801a14a383acbd33a2 +Author: Aleksander Morgado +Date: Sun Jul 6 15:55:34 2014 +0200 + + bearer: rename 'MMBearer' to 'MMBaseBearer' + + Just so that we don't have same header names in src/ and /libmm-glib. + + plugins/altair/mm-broadband-bearer-altair-lte.c | 12 +- + plugins/altair/mm-broadband-bearer-altair-lte.h | 16 +- + plugins/altair/mm-broadband-modem-altair-lte.c | 12 +- + plugins/huawei/mm-broadband-bearer-huawei.c | 40 ++-- + plugins/huawei/mm-broadband-bearer-huawei.h | 14 +- + plugins/huawei/mm-broadband-modem-huawei.c | 20 +- + plugins/icera/mm-broadband-bearer-icera.c | 28 +-- + plugins/icera/mm-broadband-bearer-icera.h | 16 +- + plugins/icera/mm-broadband-modem-icera.c | 16 +- + plugins/iridium/mm-bearer-iridium.c | 30 +-- + plugins/iridium/mm-bearer-iridium.h | 10 +- + plugins/iridium/mm-broadband-modem-iridium.c | 8 +- + plugins/mbm/mm-broadband-bearer-mbm.c | 22 +-- + plugins/mbm/mm-broadband-bearer-mbm.h | 14 +- + plugins/mbm/mm-broadband-modem-mbm.c | 12 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 20 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.h | 14 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 6 +- + plugins/option/mm-broadband-bearer-hso.c | 28 +-- + plugins/option/mm-broadband-bearer-hso.h | 14 +- + plugins/option/mm-broadband-modem-hso.c | 14 +- + plugins/sierra/mm-broadband-bearer-sierra.c | 16 +- + plugins/sierra/mm-broadband-bearer-sierra.h | 16 +- + plugins/sierra/mm-broadband-modem-sierra-icera.c | 8 +- + plugins/sierra/mm-broadband-modem-sierra.c | 8 +- + src/Makefile.am | 10 +- + src/{mm-bearer.c => mm-base-bearer.c} | 227 + +++++++++++----------- + src/{mm-bearer.h => mm-base-bearer.h} | 97 ++++----- + src/mm-bearer-list.c | 24 +-- + src/mm-bearer-list.h | 10 +- + src/mm-bearer-mbim.c | 42 ++-- + src/mm-bearer-mbim.h | 12 +- + src/mm-bearer-qmi.c | 46 ++--- + src/mm-bearer-qmi.h | 10 +- + src/mm-broadband-bearer.c | 64 +++--- + src/mm-broadband-bearer.h | 24 +-- + src/mm-broadband-modem-mbim.c | 16 +- + src/mm-broadband-modem-qmi.c | 12 +- + src/mm-broadband-modem.c | 8 +- + src/mm-iface-modem-simple.c | 50 ++--- + src/mm-iface-modem.c | 24 +-- + src/mm-iface-modem.h | 22 +-- + 42 files changed, 554 insertions(+), 558 deletions(-) + +commit ff478e301ea82b0c41776b80c478312bc52a721e +Author: Aleksander Morgado +Date: Sun Jul 6 13:23:37 2014 +0200 + + manager: rename 'MMManager' to 'MMBaseManager' + + Just so that we don't have same header names in src/ and /libmm-glib. + + src/Makefile.am | 4 +- + src/main.c | 28 ++++----- + src/{mm-manager.c => mm-base-manager.c} | 104 + ++++++++++++++++---------------- + src/mm-base-manager.h | 64 ++++++++++++++++++++ + src/mm-manager.h | 64 -------------------- + 5 files changed, 132 insertions(+), 132 deletions(-) + +commit 07fd7faea5a24fb1a17e60820cdbd4ee7c8788cc +Author: David McCullough +Date: Sat Jul 5 01:44:51 2014 +1000 + + huawei: enable GPS_UNMANAGED for Huawei modems + + Signed-off-by: David McCullough + + plugins/huawei/mm-broadband-modem-huawei.c | 137 + ++++++++++++++++------------- + 1 file changed, 78 insertions(+), 59 deletions(-) + +commit 054c77224d6d97de03c864d64695b5330991e36e +Author: Aleksander Morgado +Date: Fri Jul 4 09:52:19 2014 +0200 + + option,hso: add missing GPS unamanged capability + + plugins/option/mm-broadband-modem-hso.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit b7cf21dc24d56ec7e5617082480c95fde2cd1525 +Author: Aleksander Morgado +Date: Fri Jul 4 09:47:49 2014 +0200 + + huawei: close GPS port once GPS has been disabled + + plugins/huawei/mm-broadband-modem-huawei.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f6b0fd3f7bc75bceb6c09e0f1c7fadaa82b53d9c +Author: Aleksander Morgado +Date: Tue May 13 19:05:07 2014 +0200 + + libqcdm: new 'reset' tester + + Just like 'modepref', but not doing any mode changes, just + OFFLINE+RESET. + + .gitignore | 2 + + libqcdm/tests/Makefile.am | 11 +- + libqcdm/tests/reset.c | 260 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 272 insertions(+), 1 deletion(-) + +commit d73b633639d1549b8543282a4af5a8906e645233 +Author: David McCullough +Date: Wed Jul 2 21:26:16 2014 +1000 + + huawei: GPS support for MU609/MU909 + + Implement GPS support on the MU609 and MU090 Huawei modules. + Its highly likely the commands are the same for other Huawei modems + and it just needs to be activated via udev rules that flag the + GPS port + with ID_MM_HUAWEI_GPS_PORT=1. + + There are a lot of options that can be tweaked on the Huawei GPS + setup, + this code just chooses a simple default for unassisted, standalone GPS + operation. + + Signed-off-by: David McCullough + + plugins/huawei/77-mm-huawei-net-port-types.rules | 5 + + plugins/huawei/mm-broadband-modem-huawei.c | 322 + +++++++++++++++++++++++ + plugins/huawei/mm-plugin-huawei.c | 12 +- + 3 files changed, 337 insertions(+), 2 deletions(-) + +commit 09eb87f8994551e11ab3844101a4302fa0a3cb99 +Author: Aleksander Morgado +Date: Wed Jul 2 12:21:01 2014 +0200 + + cinterion: allow 'unmanaged' GPS setup + + plugins/cinterion/mm-common-cinterion.c | 67 + ++++++++++++++++++++++----------- + 1 file changed, 44 insertions(+), 23 deletions(-) + +commit 40cdf3bac4e21f20d881f16de38141f66a4b32a1 +Author: Aleksander Morgado +Date: Wed Jul 2 12:12:03 2014 +0200 + + option,hso: print port type before parsing + + plugins/option/mm-plugin-hso.c | 1 + + 1 file changed, 1 insertion(+) + +commit d43363ef14de14bb944c531ad7a00894f650bcb3 +Author: Aleksander Morgado +Date: Fri Jun 27 10:41:26 2014 +0200 + + option,hso: allow 'unmanaged' GPS setup + + plugins/option/mm-broadband-modem-hso.c | 145 + ++++++++++++++++++-------------- + 1 file changed, 83 insertions(+), 62 deletions(-) + +commit ad67d68179263355510306c500f31a4d7f8cd87d +Author: Aleksander Morgado +Date: Fri Jun 27 10:28:16 2014 +0200 + + location: new 'unmanaged' GPS setup + + Standard GPS setup (raw/nmea) will both enable the GPS module and + take full + control of the GPS port. This prevents other processes from reading + the NMEA + traces from e.g. a tty. In order to handle this, a new 'unmanaged' + GPS location + source is introduced, which will just enable/disable the GPS module, + without + reading anything from the GPS port. Of course, both raw/nmea and + unmanaged + setups cannot be enabled at the same time. + + cli/mmcli-modem-location.c | 28 +++++++++++++++++++++++++--- + docs/man/mmcli.8 | 7 +++++++ + include/ModemManager-enums.h | 12 +++++++----- + src/mm-iface-modem-location.c | 28 +++++++++++++++++++++++++--- + 4 files changed, 64 insertions(+), 11 deletions(-) + +commit 915a5beac0e10b0246adc9eefdb2dc29eb2c071e +Author: Dan Williams +Date: Tue Jul 1 16:30:18 2014 -0500 + + bearer-mbim: ignore empty DNS server addresses + + src/mm-bearer-mbim.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +commit 15a3ebbd354017347d3d296980c7a7460c916bae +Author: Aleksander Morgado +Date: Tue Jul 1 15:46:12 2014 +0200 + + cinterion: enable GPS location reporting for the PHS8 in QMI-mode + + The PHS8 in QMI-mode doesn't support GPS location retrieval via QMI, + so we will + fallback to use the AT-based setup and the TTY for reading NMEA + traces. + + plugins/Makefile.am | 9 + + plugins/cinterion/mm-broadband-modem-cinterion.c | 344 +--------------- + .../cinterion/mm-broadband-modem-qmi-cinterion.c | 92 +++++ + .../cinterion/mm-broadband-modem-qmi-cinterion.h | 48 +++ + plugins/cinterion/mm-common-cinterion.c | 445 + +++++++++++++++++++++ + plugins/cinterion/mm-common-cinterion.h | 51 +++ + plugins/cinterion/mm-plugin-cinterion.c | 12 +- + 7 files changed, 666 insertions(+), 335 deletions(-) + +commit ce5c3f5af6bac03421e329900f0a1eaa1f775eb0 +Author: Aleksander Morgado +Date: Fri Jun 27 14:17:57 2014 +0200 + + ifaces: always include + + As they all use the 'MMSimpleStatus' type. + + src/mm-iface-modem-firmware.h | 3 +++ + src/mm-iface-modem-location.h | 3 +++ + src/mm-iface-modem-messaging.h | 3 +++ + src/mm-iface-modem-oma.h | 3 +++ + src/mm-iface-modem-time.h | 3 +++ + 5 files changed, 15 insertions(+) + +commit 83c8db88193e910981c06ea0d35c3b182dddb49d +Author: David McCullough +Date: Mon Jun 30 17:10:01 2014 +1000 + + huawei: avoid AT^GETPORTMODE in Huawei MU609 + + The MU609 modems from Huawei have a bug (confirmed by Huawei) + that causes + the modem to reset if AT^GETPORTMODE is issued. + + I have provided and example udev rule I use to disable this command + as a + patch, feel free to drop that if its not acceptable. Since I + cannot tell + the modem type from within the udev rules this is less specific + than my + previous code based patch, but much simpler ;-) + + I have two modems that share the same USB ID, however, neither + supports the + ^GETPORTMODE command (and one of them crashes when it is issued). + Perhaps + someone with a Huawei that supports ^GETPORTMODE can check their + USB ID's + and see if they clash. + + Here is a comment from the Huawei devs: + > We confirmed this is a issue. This is Qualcomm baseband command + at Data + > Card. We didn’t delete and block it. We will fix this issue in + next FW. + > Thank you very much. + + Sign-off-by: David McCullough + + plugins/huawei/77-mm-huawei-net-port-types.rules | 3 +++ + plugins/huawei/mm-plugin-huawei.c | 4 +++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit 8f837b830d5f636a113bacc8c552f990766694fa +Author: Aleksander Morgado +Date: Fri Jun 27 12:58:50 2014 +0200 + + cinterion: enable GPS location reporting for the PHS8 in AT-mode + + This enables support for GPS location reporting when the PHS8 is + NOT used in QMI + mode. + + plugins/Makefile.am | 2 + + plugins/cinterion/77-mm-cinterion-port-types.rules | 11 + + plugins/cinterion/mm-broadband-modem-cinterion.c | 347 + ++++++++++++++++++++- + plugins/cinterion/mm-plugin-cinterion.c | 19 +- + 4 files changed, 376 insertions(+), 3 deletions(-) + +commit e0f3716d2627dead7c8cb5f8f59fa2c126a86d72 +Author: Aleksander Morgado +Date: Fri Jun 27 09:08:42 2014 +0200 + + modem-helpers: don't return any result if an error happens when + parsing CPMS=? + + We shouldn't rely on the caller to cleanup intermediate results + when returning + an error. + + src/mm-modem-helpers.c | 42 + ++++++++++++++++++++++++++++++------------ + src/tests/test-modem-helpers.c | 6 +++--- + 2 files changed, 33 insertions(+), 15 deletions(-) + +commit 4406b1e6ece6507518362cf5fdb53d09243ddfb8 +Author: Aleksander Morgado +Date: Wed Jun 25 17:40:06 2014 +0200 + + modem-helpers: improve +CMTI indication regex + + Allow whitespaces added in several places, like between the comma + and the index, + which is what the Cinterion PHS8 does: + +CMTI: "MT", 5 + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9637c1ed3825673103fbbf10005f4547682fbf56 +Author: Aleksander Morgado +Date: Wed Jun 25 15:39:45 2014 +0200 + + cinterion: update default setting for new SMS indications + + The setup in Cinterion modems goes as follows: + AT+CNMI=[, [, [, [, ]]]] + + For each field, several setups are available, so we could use a + default value, + as we were doing until now (+CNMI=2,1,2,2,1). + + BUT, not every Cinterion modem allows the same set of settings. For + example, the + new PHS8 only allows '0' for the value: + AT+CNMI=? + +CNMI: (0,1,2),(0,1),(0,2),(0),(1) + + So, instead of hardcoding the setup, try to find the best suitable + one for each + modem. We'll parse the +CNMI=? test response to know which values + are supported + during the messaging support check, which is run once during + initialization. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 224 + ++++++++++++++++++++++- + 1 file changed, 215 insertions(+), 9 deletions(-) + +commit 58d2806f4cceba6adde76d5df8f0781129bc7e1f +Author: Aleksander Morgado +Date: Wed Jun 25 15:04:09 2014 +0200 + + cinterion: new 'AT+CNMI=?' parser helper + + plugins/cinterion/mm-modem-helpers-cinterion.c | 149 + +++++++++++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 11 ++ + .../cinterion/tests/test-modem-helpers-cinterion.c | 118 ++++++++++++++++ + 3 files changed, 278 insertions(+) + +commit 08ecc147221b6f02c6db83d16b7c241efdfbc91e +Author: Aleksander Morgado +Date: Sun Jun 22 17:54:33 2014 +0200 + + base-modem: quicker find matching cdc-wdm QMI or MBIM ports + + src/mm-base-modem.c | 250 + ++++++++++------------------------------------------ + 1 file changed, 48 insertions(+), 202 deletions(-) + +commit b520503686ced256146335d6e51bab5c150188d1 +Author: Aleksander Morgado +Date: Sun Jun 22 17:41:04 2014 +0200 + + huawei: quicker find matching cdc-wdm AT port + + Without using a new GUdevClient. + + Based on a patch from Dan Williams + + plugins/huawei/mm-broadband-modem-huawei.c | 83 + ++++++------------------------ + 1 file changed, 15 insertions(+), 68 deletions(-) + +commit 7c347aa3ec1d5540c23c20dcb5edd3c6ccb28c24 +Author: Aleksander Morgado +Date: Sun Jun 22 17:29:50 2014 +0200 + + port: store parent sysfs path in each MMPort + + plugins/cinterion/mm-plugin-cinterion.c | 1 + + plugins/huawei/mm-plugin-huawei.c | 1 + + plugins/longcheer/mm-plugin-longcheer.c | 1 + + plugins/mtk/mm-plugin-mtk.c | 3 ++- + plugins/nokia/mm-plugin-nokia-icera.c | 1 + + plugins/option/mm-plugin-hso.c | 6 +++--- + plugins/option/mm-plugin-option.c | 1 + + plugins/pantech/mm-plugin-pantech.c | 1 + + plugins/sierra/mm-plugin-sierra.c | 1 + + plugins/simtech/mm-plugin-simtech.c | 1 + + plugins/telit/mm-plugin-telit.c | 1 + + plugins/x22x/mm-plugin-x22x.c | 1 + + plugins/zte/mm-plugin-zte.c | 1 + + src/mm-base-modem.c | 6 ++++++ + src/mm-base-modem.h | 1 + + src/mm-plugin.c | 2 ++ + src/mm-port-probe.c | 11 +++++++++++ + src/mm-port-probe.h | 1 + + src/mm-port.c | 28 +++++++++++++++++++++++++++- + src/mm-port.h | 24 +++++++++++------------- + 20 files changed, 75 insertions(+), 18 deletions(-) + +commit 7752c9920d83059836d010a61e44daa4232c4c65 +Author: Aleksander Morgado +Date: Sun Mar 16 13:55:46 2014 +0100 + + huawei: flag /dev/cdc-wdm as primary if no primary found already + + plugins/huawei/mm-plugin-huawei.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +commit e9d016f0886de3946bb5eaa6889f28c44b5b93bf +Author: Aleksander Morgado +Date: Wed Nov 20 18:25:48 2013 +0100 + + huawei: setup unsolicited message handlers also in the AT cdc-wdm + ports + + plugins/huawei/mm-broadband-modem-huawei.c | 131 + +++++++++++++++++------------ + 1 file changed, 79 insertions(+), 52 deletions(-) + +commit 75a5c48345351585ad176b1a56c76309720248e2 +Author: Aleksander Morgado +Date: Wed Nov 20 00:02:13 2013 +0100 + + huawei: use the cdc-wdm port dialing if available + + With the new 'huawei-cdc-ncm' driver in the kernel, we now may get a + /dev/cdc-wdm AT-capable port exposed by the Huawei device. If so, + we must use + this port for NDISDUP dialling in order to get the network interface + connected. + + plugins/huawei/mm-broadband-bearer-huawei.c | 34 +++++- + plugins/huawei/mm-broadband-modem-huawei.c | 167 + ++++++++++++++++++++++++---- + plugins/huawei/mm-broadband-modem-huawei.h | 3 + + 3 files changed, 177 insertions(+), 27 deletions(-) + +commit 293b032149d387109eab2164da6a7139c068c9bb +Author: Aleksander Morgado +Date: Sun Jun 22 18:18:33 2014 +0200 + + build: ignore test files + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit a691eec6ca6b942152e11edb878a8c338c8b295b +Author: Aleksander Morgado +Date: Sun Jun 22 17:56:56 2014 +0200 + + build: avoid using 'INCLUDES' in Makefile.am + + Avoids warnings during build; e.g.: + warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or + '*_CPPFLAGS') + + libqcdm/tests/Makefile.am | 19 ++++++++++++------- + libwmc/tests/Makefile.am | 11 ++++++----- + 2 files changed, 18 insertions(+), 12 deletions(-) + +commit 9e93e22482a0f418d48d7c3ecdaf38b75df0a775 +Author: Prathmesh Prabhu +Date: Thu Jun 19 11:20:02 2014 -0700 + + bearer-mbim: fix disconnect error handling case split + + The first case, with no error, needs to check that there was no + original error. + Currently, if an error occurs and the resulting NwError is parsed + correctly, the + case split treats it as a no-error case. + + src/mm-bearer-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 699a25b802f6e18c5c00e4573ac5e3febe9b0093 +Author: Prathmesh Prabhu +Date: Thu Jun 19 09:01:28 2014 -0700 + + modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError + + Commit 55e40ea b1ae81a in libmbim ("libmbim-glib: add additional GMM + cause codes to MbimNwError") added one more GMM cause code to + MbimNwError. This patch maps that to MMMobileEquipmentError. + + This patch requires libmbim >= 1.9.0 + + src/mm-modem-helpers-mbim.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6491d82655ac0ac9dacc6abd4c24f51e3e93443b +Author: Prathmesh Prabhu +Date: Wed Jun 18 07:24:57 2014 -0700 + + bearer-mbim: disconnect attempt should succeed if bearer is already + disconnected + + When trying to disconnect bearer, if the modem responds with + MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED, take it to mean that the + bearer has + already been disconnected. + + src/mm-bearer-mbim.c | 64 + ++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 39 insertions(+), 25 deletions(-) + +commit 9e5020901977456987430e74a18be83fa56cbc4d +Author: Ben Chan +Date: Tue Jun 17 23:56:45 2014 -0700 + + icera: fix 'sometimes-uninitialized' variable issues + + plugins/icera/mm-broadband-bearer-icera.c | 2 +- + plugins/icera/mm-modem-helpers-icera.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit ed623f662849a9b784280bcb7e6500b962a7e041 +Author: Aleksander Morgado +Date: Mon Jun 16 16:22:51 2014 +0200 + + iface-modem-messaging: don't skip MT storage when reading if it's + the only one + + src/mm-iface-modem-messaging.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 6e490944d07061ca15837963552d023807958feb +Merge: ff4e4579 02f9b926 +Author: Dan Williams +Date: Fri Jun 13 14:57:08 2014 -0500 + + merge: fix IPv6 support and operation + + Notable changes include reporting all available IP configruation + information in the bearer IP details, even if the method is DHCP, + in which case the client should apply the given configuration and + then proceed with DHCP/PPP/SLAAC/etc addressing mechanisms. + + QMI, MBIM, and some other plugins have been switched to the "STATIC" + configuration method from DHCP when the firmware supplies all the + necessary details. + +commit 02f9b926cd5776835bcd7c2b77c452e2ff8169d9 +Author: Dan Williams +Date: Tue Jun 10 01:18:41 2014 -0500 + + broadband-bearer-mbm: support IPv6 DNS and use static IPv4 + configuration + + plugins/Makefile.am | 16 +++ + plugins/mbm/mm-broadband-bearer-mbm.c | 161 + ++++++++++++++++++++++++++++ + plugins/mbm/mm-modem-helpers-mbm.c | 166 + +++++++++++++++++++++++++++++ + plugins/mbm/mm-modem-helpers-mbm.h | 27 +++++ + plugins/mbm/tests/test-modem-helpers-mbm.c | 162 + ++++++++++++++++++++++++++++ + 5 files changed, 532 insertions(+) + +commit ca0a567f74f30a719f11b749165731630528834a +Author: Dan Williams +Date: Tue Apr 15 15:22:11 2014 -0500 + + broadband-bearer-qmi: support IPv6 configuration and use static + for IPv4 + + src/mm-bearer-qmi.c | 306 + +++++++++++++++++++++++++++++++++------------------- + 1 file changed, 195 insertions(+), 111 deletions(-) + +commit 801762835309bdaeb6c6a9758b41c58e03cbdf38 +Author: Dan Williams +Date: Tue Mar 4 09:26:03 2014 -0600 + + cli: print IP details for all valid bearer types + + Even DHCP or PPP may have some IP details, like the link-local + address for IPv6 bearers. + + cli/mmcli-bearer.c | 72 + ++++++++++++++++++++++++++++-------------------------- + 1 file changed, 38 insertions(+), 34 deletions(-) + +commit 7673a1d3a35c3e0a26301b5c605b2f68d4b58de1 +Author: Dan Williams +Date: Fri Feb 28 10:22:28 2014 -0600 + + bearer-mbim: use DHCP method when only an IPv6 link-local address + is found + + When only given a link-local address, then SLAAC must be used to + retrieve the real prefix. + + src/mm-bearer-mbim.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 33eba0393d259b6dc97e991be6c1dc4585e15f5d +Author: Dan Williams +Date: Thu Feb 27 13:01:38 2014 -0600 + + api: update documentation about IPv6 bearer methods + + Even if the IPv6 bearer method is DHCP, the client should use SLAAC + (eg, IPv6 Router Solicitations, Router Adverisements, and possibly + DHCPv6) to determine the correct prefix and DNS information. In + some cases, even with the DHCP method, and IPv6 "address" will be + given which should be assigned to the data port before beginning + an IP addressing as the mobile network may expect this address + to be used. + + include/ModemManager-enums.h | 8 ++++++-- + introspection/org.freedesktop.ModemManager1.Bearer.xml | 13 +++++++++---- + 2 files changed, 15 insertions(+), 6 deletions(-) + +commit 6e5d013eb12d6ee134a59d4131128374af139fb3 +Author: Dan Williams +Date: Tue Feb 18 12:16:54 2014 -0600 + + broadband-bearer-sierra: use Icera authentication for Icera devices + + Devices with Icera chipsets (USB305) don't support the Qualcomm + proprietary $QCPDPP command, and we must use the Icera command + instead. Otherwise authenticated bearer creation will fail. + + plugins/sierra/mm-broadband-bearer-sierra.c | 90 + ++++++++++++++++++++++-- + plugins/sierra/mm-broadband-bearer-sierra.h | 3 + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 1 + + plugins/sierra/mm-broadband-modem-sierra.c | 1 + + 4 files changed, 89 insertions(+), 6 deletions(-) + +commit a416d8056c9f9bbc8b926ffbe8f066859054a990 +Author: Dan Williams +Date: Mon Feb 17 12:32:02 2014 -0600 + + broadband-bearer-icera: add IPv6 support + + Split out the %IPDPADDR parsing into a helper and add testcases + for it, + and add support for IPv6 handling. If the returned IPv6 is + link-local, + the address should be assigned to the interface and SLAAC performed to + retrieve the actual IPv6 prefix and RDNSS/DNSSD information. + + plugins/Makefile.am | 17 +- + plugins/icera/mm-broadband-bearer-icera.c | 187 ++++++----------- + plugins/icera/mm-modem-helpers-icera.c | 277 + +++++++++++++++++++++++++ + plugins/icera/mm-modem-helpers-icera.h | 28 +++ + plugins/icera/tests/test-modem-helpers-icera.c | 191 +++++++++++++++++ + 5 files changed, 571 insertions(+), 129 deletions(-) + +commit e68d51f439190eb5434581c8db072687028f0b55 +Author: Dan Williams +Date: Wed Feb 19 12:06:55 2014 -0600 + + broadband-bearer: also return IPv6 config if IPv6 context is used + + If the subclass doesn't override IP config retrieval, and IPv6 was + used when connecting the bearer, return IPv6 config too. + + src/mm-broadband-bearer.c | 29 +++++++++++++++++++++-------- + 1 file changed, 21 insertions(+), 8 deletions(-) + +commit e9395d83e388aba8b46f2fbe371c247c42bd6452 +Author: Dan Williams +Date: Thu Feb 20 12:29:27 2014 -0600 + + broadband-bearer: pass the IP family to subclasses when getting + IP config + + Subclasses may need to know which IP families were used for the setup + so they can return the correct IP configuration. We can't just use + the MMBearer default_ip_family becuase that isn't the family that + was actually used during the connection. + + plugins/icera/mm-broadband-bearer-icera.c | 1 + + plugins/option/mm-broadband-bearer-hso.c | 1 + + src/mm-broadband-bearer.c | 1 + + src/mm-broadband-bearer.h | 1 + + 4 files changed, 4 insertions(+) + +commit 502a5dbaf5555515cf6a81d69403aaf6aa6ea656 +Author: Dan Williams +Date: Tue Feb 18 12:19:25 2014 -0600 + + broadband-bearer-sierra: use correct modem type when creating bearer + + MMBroadbandModemSierraIcera is not a subclass of + MMBroadbandModemSierra, so we cannot cast it to that type when + passing it to bearer creation. Luckily the bearer doesn't + care, so just downgrade the type to MMBroadbandModem. + + plugins/sierra/mm-broadband-bearer-sierra.c | 2 +- + plugins/sierra/mm-broadband-bearer-sierra.h | 2 +- + plugins/sierra/mm-broadband-modem-sierra-icera.c | 2 +- + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +commit 1e30bad1741a7322142e7cf129f92cdfff4f9216 +Author: Dan Williams +Date: Thu Apr 10 18:31:39 2014 -0500 + + libmm-glib: always return all bearer properties + + IPv6 may have addresses and other information even if the bearer's + method is DHCP. + + libmm-glib/mm-bearer-ip-config.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit ff4e45791ddac7086c6b45b9b732c67d54dc6c1a +Author: Aleksander Morgado +Date: Fri Jun 13 16:54:06 2014 +0200 + + build: use the correct pkg-config in checks + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6313f5707e7ff69f81fcb80784196f35ddd7c56f +Author: Aleksander Morgado +Date: Wed Jun 11 17:14:18 2014 +0200 + + build: look for gdbus-codegen through pkg-config + + configure.ac | 2 ++ + libmm-glib/generated/Makefile.am | 10 +++++----- + libmm-glib/generated/tests/Makefile.am | 2 +- + 3 files changed, 8 insertions(+), 6 deletions(-) + +commit 8ca6c6cbad0d56cdda99b95795ab308c6fe3c493 +Author: Aleksander Morgado +Date: Wed Jun 11 17:12:52 2014 +0200 + + build: glib-genmarshal no longer needed + + configure.ac | 2 -- + 1 file changed, 2 deletions(-) + +commit 235fb874c993d95bd128f28d75beabad4d83baf7 +Author: Ben Chan +Date: Mon Jun 9 14:15:05 2014 -0700 + + modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError + + Commit b1ae81a in libmim ("libmbim-glib: add additional GMM cause + codes + to MbimNwError") added additional GMM cause codes to MbimNwError. This + patch maps some of those MbimNwError to MMMobileEquipmentError. + + This patch requires libmbim >= 1.9.0 + + configure.ac | 2 +- + src/mm-modem-helpers-mbim.c | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +commit 0b975f226627b4a3197a46734c11c8d83fbff884 +Author: Thieu Le +Date: Fri Jun 6 12:35:42 2014 -0700 + + altair-lte: update PCO to handle latest VZW deployment + + Update PCO handling code such that it conforms to the latest VZW + network + behavior. This includes updating the way we mark a SIM as provisioned. + In the old network, only provisioned SIMs can attach to the network. + Now, unprovisioned SIMs can attach and connect to the network. + + Change-Id: Ie454f6fb6d8764161f167e93a4235bb93fbde59a + + plugins/altair/mm-broadband-modem-altair-lte.c | 51 + +++------------------- + plugins/altair/mm-modem-helpers-altair-lte.c | 28 ++++++++---- + plugins/altair/mm-modem-helpers-altair-lte.h | 4 +- + .../altair/tests/test-modem-helpers-altair-lte.c | 30 +++++++++---- + src/mm-broadband-modem.c | 9 +--- + 5 files changed, 48 insertions(+), 74 deletions(-) + +commit af810a0a87642a0947ec1692b4952105e893bdbf +Author: Ben Chan +Date: Thu Jun 5 23:20:45 2014 -0700 + + bearer-mbim: pass the right GError pointer to response parsers + + src/mm-bearer-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit aedcb376a85c059ffe667ef2a10c7577bfcf3ad4 +Author: Dan Williams +Date: Wed Jun 4 14:10:22 2014 -0500 + + iface-modem: make "signal quality updated" log message debug not info + + Otherwise your logs fill up if the signal quality changes, which is + pretty frequently for many devices. + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit dcb627a61f33076169ef01374e9f2bb05327eb29 +Author: Yegor Yefremov +Date: Wed May 28 16:46:19 2014 +0200 + + trivial: resolve maybe-uninitialized warnings + + Signed-off-by: Yegor Yefremov + + src/mm-port-serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a038ff172b086181ba656a42529992e248ce940c +Author: Thieu Le +Date: Mon Jun 2 18:48:09 2014 -0700 + + altair-lte: handle optional quotes around sim refresh + + Some firmware version sends quotes around SIMREFRESH, this patch + adds support + for those versions. + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8680e066b5530fedcbb1dc14c446443cbc11db9a +Author: Ben Chan +Date: Mon Jun 2 14:27:07 2014 -0700 + + cinterion: fix memory leaks in tests + + plugins/cinterion/tests/test-modem-helpers-cinterion.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 7c389511d8d1f86facf93f8884526386457fac85 +Author: Ben Chan +Date: Mon Jun 2 14:26:59 2014 -0700 + + tests: fix more memory leaks + + src/tests/test-modem-helpers.c | 16 ++++++++++++---- + src/tests/test-sms-part-3gpp.c | 1 + + src/tests/test-sms-part-cdma.c | 1 + + 3 files changed, 14 insertions(+), 4 deletions(-) + +commit 830ef27bac5e3ba54bb3f273b7e3f8b98f572a87 +Author: Ben Chan +Date: Mon Jun 2 13:35:43 2014 -0700 + + libmm-glib: fix a memory leak of GMutex + + libmm-glib/mm-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit c9dc702eaa50ea54981b1bcfb9e2f2492a2f9b33 +Author: Aleksander Morgado +Date: Mon Jun 2 09:25:36 2014 +0200 + + plugin-manager: fix defer-until-suggested probing tasks + + If a task is marked as defer-until-suggested (e.g. a wwan port) + and there was + already a 'best' plugin set in the parent device, use it to + complete the + deferred task. + + This may happen in e.g. MBIM devices if the WWAN port arrives later + than the + already probed /dev/cdc-wdm character device. + + src/mm-plugin-manager.c | 165 + +++++++++++++++++++++++++++++------------------- + 1 file changed, 99 insertions(+), 66 deletions(-) + +commit 239ab6ca6b6e8af45a25a32692cdc10e5f0071f1 +Author: Bjørn Mork +Date: Mon Jun 2 15:33:52 2014 +0200 + + blacklist: ignore Infineon flashloader device + + A device like this shows up briefly while the Sierra EM7345 is + booting: + + P: Vendor=8087 ProdID=0716 Rev= 0.00 + C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA + I:* If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none) + E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms + E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + + We do have a driver identifying this as an "Infineon Flashloader" + device. It is not a modem in any case, and should be ignored. + + Signed-off-by: Bjørn Mork + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 4213d2fe69ed66b2541f8245ad4e2f2d1a3ea61f +Author: Ben Chan +Date: Sat May 31 18:03:30 2014 -0700 + + broadband-modem: report an error when enabling a modem in FAILED state + + If the initialization of the Modem3gpp / ModemCdma interface fails, + the + modem transitions to the FAILED state. But since the Modem interface + is + already initialized and exported over DBus, it is possible to + invoke the + Enable method on the Modem interface. This patch changes + MMBroadbandModem to report an error if one tries to enable the + modem in + the FAILED state instead of raising an assertion. + + src/mm-broadband-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cdb334649dcf317672b50943466ba9296e41924b +Author: Thieu Le +Date: Fri May 30 13:53:39 2014 -0700 + + altair-lte: fix memory leak in PCO parsing code + + This patch fixes memory leaks in PCO parsing code detected by + LeakSanitizer. + + plugins/altair/mm-modem-helpers-altair-lte.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit 6e7bae9dc5be47b0a41ad3cee0212e1793beb073 +Author: Ben Chan +Date: Thu May 29 23:19:38 2014 -0700 + + tests: fix memory leaks + + This patch fixes memory leaks in unit tests detected by LeakSanitizer. + + src/tests/test-modem-helpers.c | 10 ++++++++++ + src/tests/test-qcdm-serial-port.c | 1 + + src/tests/test-sms-part-3gpp.c | 7 ++++++- + 3 files changed, 17 insertions(+), 1 deletion(-) + +commit c2d3704aa5ca67a7b5836717c6f98567a6e80390 +Author: Aleksander Morgado +Date: Thu May 29 10:10:16 2014 +0200 + + api,doc: add missing documentation for the new GPRS errors + + include/ModemManager-errors.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit c8f62fb4de0420a1c0876b3076a1a1a903bd8bff +Author: Ben Chan +Date: Wed May 28 23:13:15 2014 -0700 + + altair-lte: ignore invalid bands in %BANDCAP / %GETCFG="BAND" + responses + + Due to a firmware issue, the modem may reply an invalid band value, + such + as 0, for the %BANDCAP or %GETCFG="BAND" command. This patch moves + parse_bands_response() to mm-modem-helpers-altair-lte.c, modifies the + function to ignore any invalid band outside the range of E-UTRAN + operating bands, and add unit tests for the function. + + plugins/altair/mm-broadband-modem-altair-lte.c | 35 + ++----------------- + plugins/altair/mm-modem-helpers-altair-lte.c | 39 + ++++++++++++++++++++++ + plugins/altair/mm-modem-helpers-altair-lte.h | 3 ++ + .../altair/tests/test-modem-helpers-altair-lte.c | 29 ++++++++++++++++ + 4 files changed, 73 insertions(+), 33 deletions(-) + +commit 8cdf45c66c3c2660ed7e49e1edf241b30f7c037c +Author: Ben Chan +Date: Wed May 28 23:13:14 2014 -0700 + + core: add E-UTRAN operating band 44 + + E-UTRAN operating band 44 is specified in 3GPP release 11 (see Table + 5.5-1 "E-UTRA operating bands" in 3GPP TS 36.101 version 11.2.0 + Release + 11). + + include/ModemManager-enums.h | 2 ++ + src/mm-modem-helpers-qmi.c | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 54b75e3bcd87f026fe449349691fbc096932749e +Author: Ben Chan +Date: Wed May 28 23:12:43 2014 -0700 + + qcdm: fix memory leaks in tests + + libqcdm/tests/test-qcdm-result.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f0542aa8092ed6a8f91bbc406b6c76bd6fd4c734 +Author: Ben Chan +Date: Wed May 28 23:12:30 2014 -0700 + + cli: show a nicer modem description if manufacturer or model is + unknown + + cli/mmcli-manager.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 08d8524b17fb52b08657cec287f2bf3e20f3e42f +Author: Thieu Le +Date: Tue May 27 14:27:51 2014 -0700 + + altair-lte: prevent connect while processing sim refresh + + This patch modifies the Altair LTE plugin to fail connect requests + while the + modem has detached from the network when processing sim refresh. + + plugins/altair/mm-broadband-bearer-altair-lte.c | 14 ++++++++++++++ + plugins/altair/mm-broadband-modem-altair-lte.c | 19 ++++++++++++++++++- + plugins/altair/mm-broadband-modem-altair-lte.h | 2 ++ + 3 files changed, 34 insertions(+), 1 deletion(-) + +commit 551197b4e51a6caf096cf0957d8bb69583b52c09 +Author: Ben Chan +Date: Tue May 20 09:56:50 2014 -0700 + + plugins: remove unnecessary MM_BASE_MODEM() casts + + plugins/huawei/mm-sim-huawei.c | 2 +- + plugins/icera/mm-broadband-bearer-icera.c | 4 ++-- + plugins/mbm/mm-broadband-bearer-mbm.c | 2 +- + plugins/option/mm-broadband-bearer-hso.c | 4 ++-- + plugins/sierra/mm-broadband-bearer-sierra.c | 10 +++++----- + plugins/sierra/mm-sim-sierra.c | 2 +- + 6 files changed, 12 insertions(+), 12 deletions(-) + +commit c8ad177db9e215d46069b7488af660f8e0c7547a +Author: Ben Chan +Date: Tue May 20 09:54:18 2014 -0700 + + sms: remove unnecessary MM_BASE_MODEM() casts + + src/mm-sms.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit d375224ffebd721c08c609a097ebebe86a258a3e +Author: Ben Chan +Date: Tue May 20 09:54:12 2014 -0700 + + broadband-bearer: remove unnecessary MM_BASE_MODEM() casts + + src/mm-broadband-bearer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3d378bef5dbe483c8a1aeec776ed0382b28e9664 +Author: Ben Chan +Date: Tue May 20 09:53:47 2014 -0700 + + tests: consistently use spaces for indentation + + plugins/tests/test-fixture.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 37b0402ee52ee98271d75681fee5dd4de0bebb8f +Author: Ben Chan +Date: Mon May 19 23:46:55 2014 -0700 + + core: minor coding style fixes + + src/main.c | 2 +- + src/mm-auth-provider-polkit.c | 8 ++-- + src/mm-base-modem.c | 2 +- + src/mm-bearer-list.c | 2 +- + src/mm-bearer-mbim.c | 2 +- + src/mm-bearer-qmi.c | 2 +- + src/mm-bearer-qmi.h | 2 +- + src/mm-bearer.c | 2 +- + src/mm-broadband-bearer.c | 2 +- + src/mm-broadband-modem-mbim.c | 2 +- + src/mm-broadband-modem-mbim.h | 8 ++-- + src/mm-broadband-modem-qmi.c | 2 +- + src/mm-broadband-modem.c | 2 +- + src/mm-charsets.c | 86 + +++++++++++++++++++-------------------- + src/mm-device.c | 2 +- + src/mm-log.h | 18 ++++---- + src/mm-manager.c | 6 +-- + src/mm-modem-helpers.c | 18 ++++---- + src/mm-plugin-manager.c | 6 +-- + src/mm-port-probe.c | 4 +- + src/mm-port-serial-gps.c | 2 +- + src/mm-port-serial.c | 2 +- + src/mm-sim.c | 2 +- + src/mm-sms-list.c | 2 +- + src/mm-sms-part-cdma.c | 16 ++++---- + src/mm-sms.c | 2 +- + src/tests/test-modem-helpers.c | 66 +++++++++++++++--------------- + src/tests/test-qcdm-serial-port.c | 12 +++--- + 28 files changed, 141 insertions(+), 141 deletions(-) + +commit d4177f554bab5e596aeb8a2f80ad8466d837e799 +Author: Ben Chan +Date: Mon May 19 23:46:27 2014 -0700 + + cli: consistently use spaces for indentation + + cli/mmcli-bearer.c | 18 ++++----- + cli/mmcli-common.c | 18 ++++----- + cli/mmcli-manager.c | 18 ++++----- + cli/mmcli-modem-3gpp.c | 16 ++++---- + cli/mmcli-modem-cdma.c | 16 ++++---- + cli/mmcli-modem-firmware.c | 16 ++++---- + cli/mmcli-modem-location.c | 16 ++++---- + cli/mmcli-modem-messaging.c | 16 ++++---- + cli/mmcli-modem-oma.c | 16 ++++---- + cli/mmcli-modem-signal.c | 16 ++++---- + cli/mmcli-modem-simple.c | 16 ++++---- + cli/mmcli-modem-time.c | 16 ++++---- + cli/mmcli-modem.c | 18 ++++----- + cli/mmcli-sim.c | 18 ++++----- + cli/mmcli-sms.c | 18 ++++----- + cli/mmcli.c | 96 + ++++++++++++++++++++++----------------------- + 16 files changed, 174 insertions(+), 174 deletions(-) + +commit 5d47478d06944cb420a78982604a0eded5d1c9e2 +Author: Ben Chan +Date: Mon May 19 23:46:12 2014 -0700 + + libmbim-glib: consistently use spaces for indentation + + libmm-glib/mm-common-helpers.c | 84 + +++++++++++++++++++++--------------------- + 1 file changed, 42 insertions(+), 42 deletions(-) + +commit 7c656cce47cb99099b0bef3ecbea932798d0ceb4 +Author: Ben Chan +Date: Mon May 19 23:45:55 2014 -0700 + + mbm: minor coding style fixes + + plugins/mbm/mm-broadband-bearer-mbm.c | 4 ++-- + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit bdab75d0b8e7bbdd1a6a561c819a801f5498406a +Author: Ben Chan +Date: Mon May 19 23:45:48 2014 -0700 + + option,hso: minor coding style fixes + + plugins/option/mm-broadband-bearer-hso.c | 16 ++++++++-------- + plugins/option/mm-broadband-modem-hso.c | 2 +- + plugins/option/mm-broadband-modem-option.c | 2 +- + 3 files changed, 10 insertions(+), 10 deletions(-) + +commit f5d7213a3cd5f1026d131c70e97c8158d4c92a42 +Author: Ben Chan +Date: Mon May 19 23:45:35 2014 -0700 + + icera: minor coding style fixes + + plugins/icera/mm-broadband-bearer-icera.c | 4 ++-- + plugins/icera/mm-broadband-modem-icera.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit a0d15f23c9c1ec719f4cba23574203d3da38dada +Author: Ben Chan +Date: Sat May 17 00:10:17 2014 -0700 + + huawei: minor coding style fixes + + plugins/huawei/mm-broadband-bearer-huawei.c | 24 ++++++++++++------------ + plugins/huawei/mm-broadband-bearer-huawei.h | 12 ++++++------ + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + 3 files changed, 19 insertions(+), 19 deletions(-) + +commit adcda0a544b5e70ab63c4e032e59d6f8585ce53c +Author: Ben Chan +Date: Mon May 12 23:24:05 2014 -0700 + + broadband-modem-mbim: refine access technology updates + + This patch refines the access technology updates on a MBIM modem by + observing the MBIM_CID_PACKET_SERVICE notifications in addition to the + MBIM_CID_REGISTER_STATE notifications. If a MBIM_CID_PACKET_SERVICE + notification indicates the highest available data class, the current + access technology is updated to reflect that. Otherwise, the access + technology is updated according to the available data classes + indicated + by a MBIM_CID_REGISTER_STATE notification. + + src/mm-broadband-modem-mbim.c | 82 + +++++++++++++++++++++++++++++++++++++------ + 1 file changed, 71 insertions(+), 11 deletions(-) + +commit 66e4b0d6034c3c6b29ba3321ae45cab5b9d7b078 +Author: Dan Williams +Date: Wed May 7 16:11:50 2014 -0500 + + api,errors: define new EPS-related errors + + We can use these to return better error messages if an operator + does not support the default subscription APN functionality, + and the user does not give us an APN. + + include/ModemManager-errors.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8e3b67bf44bf339a9b341ab02d67af92d6d185e2 +Author: Dan Williams +Date: Wed May 7 13:46:38 2014 -0500 + + broadband-bearer-qmi: don't set APN if it isn't given + + If the APN was empty (implying that the modem/network should choose + the default APN) this caused an assertion in libqmi. Just don't + set an APN if we aren't given one. + + src/mm-bearer-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 828e2e00eb8e4ced54ec51fb61bfdb37df526935 +Author: Martin Pitt +Date: Wed Apr 30 15:57:30 2014 +0200 + + libmm-glib: Initialize result array + + In mm_modem_messaging_get_supported_storages(), initialize array to + avoid a + potential crash with an uninitialized value, and a build failure + due to + + mm-modem-messaging.c:168:24: error: 'array' may be used uninitialized + in this + function [-Werror=maybe-uninitialized] + *n_storages = array->len; + + https://bugzilla.gnome.org/show_bug.cgi?id=729267 + + libmm-glib/mm-modem-messaging.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0126eb63114ddd5099a4f63dac67e190ccd00706 +Author: Aleksander Morgado +Date: Mon May 5 20:25:31 2014 +0200 + + sierra: PCSTATE=0 needs to be treated as low-power mode + + OFF only applies to a real shutdown, where the modem no longer + replies. + + plugins/sierra/mm-common-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 771c83a73a3bd4ddf5045b86bb3d64d71f9d02c1 +Author: Ben Chan +Date: Wed Apr 30 00:59:21 2014 -0700 + + huawei: treat CFUN 0 as low power state + + The Huawei plugin uses +CFUN=0 to put the modem in low power mode as + +CFUN=4 isn't supported by all Huawei modems. This patch modifies the + plugin to treat CFUN 0 as the 'LOW' power state, which is necessary as + otherwise ModemManager would prevent the modem from transitioning + to the + 'ON' power state. + + plugins/huawei/mm-broadband-modem-huawei.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit ae99c452eb46d0f0c36a8e44e627994ce261a726 +Author: Aleksander Morgado +Date: Fri Apr 11 09:27:51 2014 +0200 + + examples: add modem watcher example in JS + + configure.ac | 1 + + examples/Makefile.am | 2 +- + examples/modem-watcher-javascript/Makefile.am | 5 ++ + examples/modem-watcher-javascript/README | 22 ++++++ + examples/modem-watcher-javascript/main.js | 11 +++ + .../modem-watcher-javascript | 20 +++++ + examples/modem-watcher-javascript/modemWatcher.js | 89 + ++++++++++++++++++++++ + 7 files changed, 149 insertions(+), 1 deletion(-) + +commit ebff76cfaa0e5809ef5883d7588f55dc3e11f828 +Author: Aleksander Morgado +Date: Thu Apr 10 19:05:13 2014 +0200 + + examples: add modem watcher example in python + + Makefile.am | 2 +- + configure.ac | 2 + + examples/Makefile.am | 1 + + examples/modem-watcher-python/Makefile.am | 4 + + examples/modem-watcher-python/ModemWatcher.py | 108 + +++++++++++++++++++++ + examples/modem-watcher-python/README | 22 +++++ + examples/modem-watcher-python/modem-watcher-python | 42 ++++++++ + 7 files changed, 180 insertions(+), 1 deletion(-) + +commit 79b34b77b4703eaaf7e007c294325a660a51bc9e +Author: Ben Chan +Date: Wed Apr 2 23:34:42 2014 -0700 + + port-probe: remove the 3s wait before opening a MBIM port + + The 3s wait before opening a MBIM port is not necessary for handling a + delayed response to the MBIM OPEN messages. mbim_device_open() already + retries the MBIM OPEN message when the MBIM device does not respond. + + src/mm-port-probe.c | 23 ++++++----------------- + 1 file changed, 6 insertions(+), 17 deletions(-) + +commit 09d92ef3338effa85eff7f4efa416afe11f780a0 +Author: David (Pololu) +Date: Tue Apr 1 16:26:26 2014 -0700 + + blacklist: All devices from Pololu Corporation except some possible + future products. + + We make many USB virtual COM port devices, none of which are modems. + ModemManager's automatic attempts to access those devices can cause + problems. + + That might change in the future, so we have left two potential + future product IDs off of the blacklist. + + src/77-mm-usb-device-blacklist.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 1af1d1fb780f9f53f4c924818d261dc3107c2471 +Author: Aleksander Morgado +Date: Tue Apr 1 18:29:25 2014 +0200 + + novatel: read HDR signal quality + + (ttyUSB0): --> 'AT$NWRSSI' + (ttyUSB0): <-- ' HDR RSSI= + 93OK + + plugins/novatel/mm-broadband-modem-novatel.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 2a5230c93e054a96902626740f2e364421f4565e +Author: Aleksander Morgado +Date: Tue Mar 25 17:13:59 2014 +0100 + + docs,libmm-glib: add methods to manage the MTU in the MMBearerIpConfig + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit a0ddcaa7a485580f3bcb88cff819f002a30fb4d0 +Author: Ben Chan +Date: Tue Mar 25 00:18:34 2014 -0700 + + bearer-mbim: update MTU in bearer IP config properties + + This patch modifies MMBearerMbim to update the MTU value in the bearer + IPv4 and IPv6 config property when such information is available + in the + MBIM_CID_IP_CONFIGURATION response. + + src/mm-bearer-mbim.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit c184c2f1be65fa0af966771fe2d6d0509bb057f3 +Author: Ben Chan +Date: Tue Mar 25 00:18:33 2014 -0700 + + cli: print MTU in bearer IP config properties + + cli/mmcli-bearer.c | 86 + +++++++++++++++++++++++++++++++----------------------- + 1 file changed, 50 insertions(+), 36 deletions(-) + +commit e4db8c5302e61b84d796e9a84f57fa51cfce2577 +Author: Ben Chan +Date: Tue Mar 25 00:18:32 2014 -0700 + + api: add MTU to bearer IP config properties + + This patch adds a 'mtu' value to the Ip4Config and Ip6Config + property of + a Bearer object, which indicates the value of the maximum transmission + unit for the established connection when such information is available + (e.g. via QMI_WDS_GET_RUNTIME_SETTINGS on a QMI modem or + MBIM_CID_IP_CONFIGURATION on a MBIM modem). + + .../org.freedesktop.ModemManager1.Bearer.xml | 18 ++++++++++ + libmm-glib/mm-bearer-ip-config.c | 39 + ++++++++++++++++++++++ + libmm-glib/mm-bearer-ip-config.h | 3 ++ + 3 files changed, 60 insertions(+) + +commit 4de728447a1b5825e5a9bd29cc54f196540fb6c1 +Author: Ben Chan +Date: Tue Mar 25 00:17:50 2014 -0700 + + bearer-mbim: fix a misleading comment + + src/mm-bearer-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit aa9af0ba68aaae7dae4c28d6a76f7b829360f40a +Author: Ben Chan +Date: Mon Mar 24 22:37:53 2014 -0700 + + introspection: fix typos + + introspection/org.freedesktop.ModemManager1.Bearer.xml | + 6 +++--- + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit e9cae166cc1e67d93e2497ab2ec381980669808f +Author: Aleksander Morgado +Date: Mon Mar 24 16:24:48 2014 +0100 + + blacklist: ignore empiriKit science lab controller device + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 4827933f0c4a85febb39bfed05329389f5bc64dd +Author: Ben Chan +Date: Tue Mar 18 00:06:58 2014 -0700 + + port-serial: fix command context completion when clearing command + queue + + This patch removes an extra invocation of + g_simple_async_result_complete + on the result associated with each command context in the command + queue + when mm_port_serial_close clears the queue. It also changes the + code to + complete the results in idle, which avoids a nested invocation of + mm_port_serial_close. That could happen if the completion of the + result + calls mm_port_serial_close again (e.g. via at_command_context_free, + at_sequence_context_free in mm-base-modem-at.c). The nested invocation + of mm_port_serial_close could create undesirable effects (e.g. the + assertion on open_count > 0 fails in case of a forced close). + + src/mm-port-serial.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 31a19c2299b10c51475a778880be2d0ef863f6b6 +Author: Ben Chan +Date: Thu Mar 13 15:45:08 2014 -0700 + + broadband-modem,modem-helpers: improve +CGDCONT? error handling + + This patch fixes the following crash, which happens when + MMBroadbandBearer tries to parse the NULL response of a failed + +CGDCONT? + query. It also fixes a leak in parse_pdp_list where it fails to + free the + GError object return by mm_3gpp_parse_cgdcont_read_response. + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7feb15564c11 [ModemManager] - mm-modem-helpers.c:850 + mm_3gpp_parse_cgdcont_read_response + 0x7feb15518e51 [ModemManager] - mm-broadband-bearer.c:927 + parse_pdp_list + 0x7feb1551ada2 [ModemManager] - mm-base-modem-at.c:189 + at_sequence_parse_response + 0x7feb151d4b86 [libgio-2.0.so.0.3400.3] - gsimpleasyncresult.c:775 + g_simple_async_result_complete + 0x7feb1556e223 [ModemManager] - mm-port-serial-at.c:355 + serial_command_ready + 0x7feb151d4b86 [libgio-2.0.so.0.3400.3] - gsimpleasyncresult.c:775 + g_simple_async_result_complete + 0x7feb1556a834 [ModemManager] - mm-port-serial.c:141 + command_context_complete_and_free + 0x7feb1556bc26 [ModemManager] - mm-port-serial.c:734 + port_serial_got_response + 0x7feb1556c51a [ModemManager] - mm-port-serial.c:758 + port_serial_timed_out + 0x7feb1508cc33 [libglib-2.0.so.0.3400.3] - gmain.c:4026 + g_timeout_dispatch + 0x7feb1508c087 [libglib-2.0.so.0.3400.3] - gmain.c:2715 + g_main_context_dispatch + 0x7feb1508c437 [libglib-2.0.so.0.3400.3] - gmain.c:3290 + g_main_context_iterate + 0x7feb1508c891 [libglib-2.0.so.0.3400.3] - gmain.c:3484 + g_main_loop_run + 0x7feb1550ad16 [ModemManager] - main.c:154 + main + 0x7feb14a9e9c6 [libc-2.15.so] - libc-start.c:234 + __libc_start_main + 0x7feb1550a808 [ModemManager + 0x00023808 + + src/mm-broadband-bearer.c | 14 ++++++++++++-- + src/mm-modem-helpers.c | 2 +- + 2 files changed, 13 insertions(+), 3 deletions(-) + +commit 6bdcd7cb226c75e72a4ef351adb257ef92e74578 +Author: Aleksander Morgado +Date: Sun Mar 9 22:15:16 2014 +0100 + + data: add icon + + data/ModemManager-icon.svg | 197 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 197 insertions(+) + +commit 4eb733c07c68da40c492d44b46d05e222b5ac6f1 +Author: Aleksander Morgado +Date: Fri Mar 7 12:29:56 2014 +0100 + + wavecom: avoid +COPS=0 if already in automatic registration mode + + AT+COPS=0 in a FXT009 may end up making the device stuck in a + weird state + in which it only replies "+CME ERROR: 515" to every AT command. So + try to + avoid this command whenever possible. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 174 + ++++++++++++++++++++++++++- + 1 file changed, 170 insertions(+), 4 deletions(-) + +commit f14a2ea14eec298e023225f48fa8082ff0570f27 +Author: Ben Chan +Date: Tue Mar 4 00:29:20 2014 -0800 + + broadband-modem-mbim: handle subscriber info updates + + Subscriber information like MSISDNs / MDNs may not be readily + available + when MMIfaceModem queries for it during modem initialization. + + This patch modifies MMBroadbandModemMbim to subscribe to the + MBIM_CID_SUBSCRIBER_READY_STATUS notification and update the + 'OwnNumbers' property of the Modem interface when the information + becomes available. + + src/mm-broadband-modem-mbim.c | 53 + ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 47 insertions(+), 6 deletions(-) + +commit a7da3fc387749182bfdd680b8b4c6526ea65e021 +Author: Ben Chan +Date: Tue Feb 18 12:43:26 2014 -0800 + + broadband-modem-mbim: update to use + mbim_message_device_service_subscribe_list + + libmbim renames 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBER_LIST' to + 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST' to be consistent with + the MBIM + specification. This patch updates MMBroadbandModemMbim accordingly. + + src/mm-broadband-modem-mbim.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit a2ef167ccd476e2574b598df8786582664f6c570 +Author: Aleksander Morgado +Date: Thu Mar 6 14:30:56 2014 +0100 + + build: require libmbim 1.8 + + We're going to add support for some features only available in + that version. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 70fb7c2ede2668013eb1cc1c7319d70d2be62f9f +Author: Ben Chan +Date: Wed Mar 5 19:30:57 2014 -0800 + + broadband-modem: fix hdr_subsys_state_info_ready + + hdr_subsys_state_info_ready() did not implement the + GAsyncReadyCallback + function signature, which led to a crash. This patch fixes + hdr_subsys_state_info_ready() to properly extract the QCDM response + from + the GAsyncResult object. + + src/mm-broadband-modem.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 22193e2f3aafe5a314d7a891bf0b1e713cfd34c5 +Author: Aleksander Morgado +Date: Wed Mar 5 11:47:15 2014 +0100 + + license: add LGPLv2+ license in addition to the GPLv2+ one + + This is not a license change; the daemon and command line tool are + still GPLv2+, + and the libmm-glib library LGPLv2+. + + For reference, see libqmi bug: + https://bugs.freedesktop.org/show_bug.cgi?id=74220 + + COPYING.LIB | 502 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Makefile.am | 3 +- + README | 4 + + 3 files changed, 508 insertions(+), 1 deletion(-) + +commit 4a5a0197b5ae170575bc816ecaefc77ea6c057b4 +Author: Ben Chan +Date: Tue Mar 4 00:17:34 2014 -0800 + + port-mbim: increase timeout of device open operation + + A MBIM device typically delays its response to an 'Open' command + when it + has not completed the initialization process. This patch increases the + timeout of the MBIM device open operation from 10s to 30s to handle + situations where the device takes much longer to initialize. + + src/mm-port-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f3ded99af1c296781a564c4539b351db93ad0a59 +Author: Aleksander Morgado +Date: Mon Mar 3 16:33:51 2014 +0100 + + cinterion: implement unlock retries loading + + plugins/cinterion/mm-broadband-modem-cinterion.c | 120 + +++++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +commit 191168e3ef2796eb9d06414c384482d88c3bb5ee +Author: Aleksander Morgado +Date: Mon Mar 3 14:33:12 2014 +0100 + + cinterion: after SIM unlock, query SIM status until ready + + plugins/cinterion/mm-broadband-modem-cinterion.c | 116 + +++++++++++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.c | 47 +++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 9 ++ + .../cinterion/tests/test-modem-helpers-cinterion.c | 45 +++++++- + 4 files changed, 213 insertions(+), 4 deletions(-) + +commit f20724ec3f5bb4ad9821059021a5d4ee1d74528c +Author: Ben Chan +Date: Fri Feb 28 12:30:18 2014 -0800 + + iface-modem: allow setting power state to OFF when modem is in + FAILED state + + src/mm-iface-modem.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 17bf3f8578c2e4a43d81630071daf15a5f374254 +Author: Aleksander Morgado +Date: Thu Feb 27 22:15:01 2014 +0100 + + cinterion: request to force refresh access tech after current + bands update + + plugins/cinterion/mm-broadband-modem-cinterion.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 019d038c17f9d633379ab29b9fb7ea15bc0f3fab +Author: Aleksander Morgado +Date: Thu Feb 27 16:23:12 2014 +0100 + + cinterion: force band preference update to be applied immediately + + plugins/cinterion/mm-broadband-modem-cinterion.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit f2024b78b297079c61f51d1a7f6cd73611bc7de2 +Author: Aleksander Morgado +Date: Thu Feb 27 11:32:05 2014 +0100 + + cinterion: consolidate setting current bands in 2G and 3G devices + + plugins/cinterion/mm-broadband-modem-cinterion.c | 95 + +++++++----------------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 19 +++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 1 + + 3 files changed, 46 insertions(+), 69 deletions(-) + +commit c1e2a3a5bc686f310a705724e806d058f3cee68c +Author: Aleksander Morgado +Date: Wed Feb 26 20:42:15 2014 +0100 + + cinterion: consolidate current bands loading for 2G and 3G devices + + plugins/cinterion/mm-broadband-modem-cinterion.c | 101 + ++------------------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 53 +++++++---- + plugins/cinterion/mm-modem-helpers-cinterion.h | 7 +- + .../cinterion/tests/test-modem-helpers-cinterion.c | 48 +++++++++- + 4 files changed, 92 insertions(+), 117 deletions(-) + +commit 0877f68a8481c5d011652831cfe523f7a629604e +Author: Aleksander Morgado +Date: Wed Feb 26 17:11:25 2014 +0100 + + cinterion: consolidate supported bands loading for 2G and 3G devices + + plugins/cinterion/mm-broadband-modem-cinterion.c | 32 ++++----------- + plugins/cinterion/mm-modem-helpers-cinterion.c | 46 + ++++++++++++++-------- + plugins/cinterion/mm-modem-helpers-cinterion.h | 7 ++-- + .../cinterion/tests/test-modem-helpers-cinterion.c | 5 ++- + 4 files changed, 45 insertions(+), 45 deletions(-) + +commit 65eda92ceb411982331f8ee2922852c9587456d6 +Author: Aleksander Morgado +Date: Wed Feb 26 17:09:54 2014 +0100 + + broadband-modem: allow querying current charset + + So that plugins can use it. + + src/mm-broadband-modem.c | 6 ++++++ + src/mm-broadband-modem.h | 3 +++ + 2 files changed, 9 insertions(+) + +commit 87d867c8aedf59a55fdbed358e252592fc86fc35 +Author: Aleksander Morgado +Date: Wed Feb 26 16:23:27 2014 +0100 + + cinterion: add helper to build Cinterion band mask + + plugins/cinterion/mm-broadband-modem-cinterion.c | 96 + ++++++------------------ + plugins/cinterion/mm-modem-helpers-cinterion.c | 46 ++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 8 ++ + 3 files changed, 78 insertions(+), 72 deletions(-) + +commit e6430acaaaa56eae95206a564109e2a04c99e7c5 +Author: Aleksander Morgado +Date: Wed Feb 26 15:51:11 2014 +0100 + + cinterion: add helper to parse AT^SCFG="Radio/Band" response in + 3G devices + + plugins/cinterion/mm-broadband-modem-cinterion.c | 68 + +++------------------ + plugins/cinterion/mm-modem-helpers-cinterion.c | 71 + ++++++++++++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 7 +++ + .../cinterion/tests/test-modem-helpers-cinterion.c | 60 + +++++++++++++++++- + 4 files changed, 146 insertions(+), 60 deletions(-) + +commit 82067915d16a5e367346a3b62489b6efcb19f834 +Author: Aleksander Morgado +Date: Wed Feb 26 15:12:43 2014 +0100 + + cinterion: use AT^SCFG=? to parse supported bands in 3G devices + + .gitignore | 1 + + plugins/Makefile.am | 15 +++ + plugins/cinterion/mm-broadband-modem-cinterion.c | 77 +++++++---- + plugins/cinterion/mm-modem-helpers-cinterion.c | 121 + +++++++++++++++++ + plugins/cinterion/mm-modem-helpers-cinterion.h | 28 ++++ + .../cinterion/tests/test-modem-helpers-cinterion.c | 149 + +++++++++++++++++++++ + 6 files changed, 363 insertions(+), 28 deletions(-) + +commit e6cfa57c608a4097c9d63067f8dba261b3cddfe4 +Author: Aleksander Morgado +Date: Wed Feb 26 13:06:30 2014 +0100 + + cinterion: request access tech update after allowed mode change + + plugins/cinterion/mm-broadband-modem-cinterion.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 8a47dce5fb19c8b183ef47cb9ab90f6183a5508b +Author: Aleksander Morgado +Date: Wed Feb 26 13:01:44 2014 +0100 + + iface-modem-3gpp: request access tech update after registration + attempt + + src/mm-iface-modem-3gpp.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 73dad3d899316352ab4f058f526069a8724b2b13 +Author: Aleksander Morgado +Date: Wed Feb 26 12:59:05 2014 +0100 + + iface-modem: allow requesting the refresh of the access tech + + For periodic updates, we may want to request an explicit re-check + at some point, + instead of waiting for the next scheduled update. + + src/mm-iface-modem.c | 31 ++++++++++++++++++++++++++----- + src/mm-iface-modem.h | 3 +++ + 2 files changed, 29 insertions(+), 5 deletions(-) + +commit 82340cd5f7e1c464eda820632b07cf55e78cc90f +Author: Aleksander Morgado +Date: Wed Feb 26 12:45:04 2014 +0100 + + cinterion: add support for HSUPA+HSDPA reported access tech + + plugins/cinterion/mm-broadband-modem-cinterion.c | 27 + ++++++++++++++---------- + 1 file changed, 16 insertions(+), 11 deletions(-) + +commit a9a4a2a337d14baecbcc6a76670ed48ce6b91259 +Author: Aleksander Morgado +Date: Wed Feb 26 12:37:01 2014 +0100 + + cinterion: allow recovering automatic mode + + When automatic mode (i.e. 2G+3G+none preferred) is selected, we + need to + explicitly request it by giving the AT+COPS write command with values + (i.e. not + just empty fields). + + plugins/cinterion/mm-broadband-modem-cinterion.c | 34 + +++++++++++++++--------- + 1 file changed, 21 insertions(+), 13 deletions(-) + +commit 177f15f295810614d1ee8f845745b9b40a02dac7 +Author: Aleksander Morgado +Date: Wed Feb 26 12:30:04 2014 +0100 + + cinterion: cache operator id if manual selection attempted + + We'll need it afterwards for proper mode switching + + plugins/cinterion/mm-broadband-modem-cinterion.c | 87 + +++++++++++++++++++++++- + 1 file changed, 86 insertions(+), 1 deletion(-) + +commit 914caf0f3b2da220388aae56ba35f56cbc76b117 +Author: Aleksander Morgado +Date: Wed Feb 26 12:28:00 2014 +0100 + + cinterion: unsupported modes are already filtered out + + So no need to try to handle error cases or fallbacks to support them. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 45 + +++++------------------- + 1 file changed, 8 insertions(+), 37 deletions(-) + +commit ece4f0f0144ad8fc34a93aa2add0a933edbc4ab1 +Author: Aleksander Morgado +Date: Wed Feb 26 11:55:45 2014 +0100 + + cinterion: increase AT command timeout when changing modes + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e3bebc85c44f4d7826a2c4cdef937b33aeceb329 +Author: Dan Williams +Date: Thu Feb 27 13:03:04 2014 -0600 + + libmm-glib: deep-copy ports array in ensure_internal_ports() + (bgo #724900) + + ensure_internal_ports() didn't deep-copy the ports array, which + meant that anything calling mm_modem_port_info_array_free() was + freeing the internal memory owned by MMModem if it retrieved + the array with mm_modem_get_ports(). + + https://bugzilla.gnome.org/show_bug.cgi?id=724900 + + libmm-glib/mm-modem.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +commit 5d88c2ff8f6bb3a59fa12f35d354eea0e7c26324 +Author: Ben Chan +Date: Wed Feb 26 14:56:34 2014 -0800 + + broadband-modem-mbim: handle if unlock retries info is not available + + By setting the 'RemainingAttempts' field of a MBIM_CID_PIN response to + 0xffffffff, a MBIM modem indicates that it does not support the + information on the number of remaining attempts for pin-related + operations. This patch modifies MMBroadbandModemMbim to handle + this case + properly, instead of reporting a very large unlock retries count. + + src/mm-broadband-modem-mbim.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit accb611e1f7ec648c6a7a6080c89b41fa5f9fd5c +Author: Aleksander Morgado +Date: Wed Feb 26 11:52:33 2014 +0100 + + base-modem: if no AT primary given, try to use data port + + The Cinterion PHS8 reports a single AT port to be used as data port, + and no + other port as primary. In this case, recover the tty as primary AT + port, instead + of failing with an error. + + src/mm-base-modem.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit e3c4dec3d7db6cb61fd68f5b82452c236ed91843 +Author: Aleksander Morgado +Date: Tue Feb 18 11:33:28 2014 +0100 + + wavecom: implement power off + + Powering off Wavecom devices is done via the AT^CPOF=1 command. These + devices + seem to not only power-off, but also power-cycle when this command + is received, + which means that the user needs to make sure to fully cut the power + to the + device when the SetPowerState() method replies. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 28 + ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit f9b9f25cd1bee4996d918e6976c53e74edfa364a +Author: Aleksander Morgado +Date: Tue Feb 18 11:03:33 2014 +0100 + + cinterion: implement power off + + Powering off Cinterion modems is done with the AT^SMSO command. Once + this + command is sent to the device, ModemManager still needs to wait to + get an + unsolicited ^SHUTDOWN message from the modem, which is when the + shutdown + is considered complete. + + Newer Cinterion devices, though, don't seem to follow this rule + and just + reply OK to AT^SMSO (i.e. no ^SHUTDOWN), but instead, they will + remove the + tty ports. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 154 + +++++++++++++++++++++++ + 1 file changed, 154 insertions(+) + +commit 00a924617c407f5e3144992eaca4ed6eb8460ada +Author: Aleksander Morgado +Date: Tue Feb 18 10:47:58 2014 +0100 + + broadband-modem-qmi: implement full power off + + The power off command will transition the device to the OFFLINE + state. After + this, the modem will not be able to go online again unless it is + power-cycled, + either externally (cut power and re-establish power) or through + another + transition to QMI_DMES_OPERATING_MODE_RESET (which ModemManager + will not + implement for this case). + + src/mm-broadband-modem-qmi.c | 51 + +++++++++++++++++++++++++++----------------- + 1 file changed, 32 insertions(+), 19 deletions(-) + +commit fe9f3a65531a4f02771a20290498dc033544c67b +Author: Aleksander Morgado +Date: Tue Feb 18 10:45:31 2014 +0100 + + cli: new '--set-power-state-off' command + + cli/mmcli-modem.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 9239fbcd7a137f2bb349592d649fc80847e6e731 +Author: Aleksander Morgado +Date: Tue Feb 18 10:35:58 2014 +0100 + + iface-modem: allow transitioning to the OFF power state + + There are systems in which the modem power source can be controlled + externally, + e.g. to switch it on or off. In these cases, it is sometimes advisable + to be + able to tell the modem to cleanly shut off completely before the + power is cut. + So, allow transitioning to the OFF power state if the modem supports + it, even if + afterwards the modem could be completely unreachable. + + src/mm-iface-modem.c | 88 + ++++++++++++++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem.h | 7 +++++ + 2 files changed, 86 insertions(+), 9 deletions(-) + +commit 705dd0133d8a02c0bf2a2cfa3d8920030dc1392d +Author: Ben Chan +Date: Wed Feb 19 21:44:23 2014 -0800 + + broadband-modem-mbim: handle network initiated disconnect + + Observing registration updates via the MBIM_CID_REGISTER_STATE + notification alone is not always sufficient to detect if the modem is + disconnected from the network. In case of a network-initiated + disconnect, it is possible that the modem is disconnected from the + network but remains registered. + + This patch modifies MMBroadbandModemMbim to subscribe to the + MBIM_CID_CONNECT notification. Upon receiving a notification of a + deactivated session ID, the corresponding bearer is reported as + disconnected. + + src/mm-broadband-modem-mbim.c | 85 + ++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 79 insertions(+), 6 deletions(-) + +commit 1866aad9d3a628572fb8c22e5a7ae1ad1c7ad9d2 +Author: Ben Chan +Date: Wed Feb 19 22:32:05 2014 -0800 + + bearer: remove unnecessary MM_BEARER() casts + + src/mm-bearer.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit acc7b4b8b91cb5428cf2dcd16328febaeece680b +Author: Dan Williams +Date: Wed Feb 19 18:59:24 2014 -0600 + + Revert "broadband-modem-mbim: update to use + mbim_message_device_service_subscribe_list" + + This reverts commit 8327db70b9b5b08481ce1666d7a0192f306ff5ee. + + libmbim change not committed yet... + + configure.ac | 4 ++-- + src/mm-broadband-modem-mbim.c | 10 +++++----- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 8327db70b9b5b08481ce1666d7a0192f306ff5ee +Author: Ben Chan +Date: Tue Feb 18 12:43:26 2014 -0800 + + broadband-modem-mbim: update to use + mbim_message_device_service_subscribe_list + + libmbim renames 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBER_LIST' to + 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST' to be consistent with + the MBIM + specification. This patch updates MMBroadbandModemMbim accordingly. + + configure.ac | 4 ++-- + src/mm-broadband-modem-mbim.c | 10 +++++----- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 1bd939d4b8e6e5d28ffdb9cd63e7b9c560469b1d +Author: Ben Chan +Date: Wed Feb 19 12:08:24 2014 -0800 + + huawei: fix a debug message + + This patch simply fixes the following debug message: + + from: + (Huawei) couldn't turn off unsolicited messages insecondary + ports: 'Unknown error' + + to: + (Huawei) couldn't turn off unsolicited messages in secondary + ports: 'Unknown error' + + plugins/huawei/mm-plugin-huawei.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 9e1472d5ecb04e30c4b1259ab84510c601aa5f37 +Author: Dan Williams +Date: Mon Feb 17 12:33:51 2014 -0600 + + trivial: fix dist of gsm-port.conf + + plugins/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 759f13f693a149b3a10d11b402d174d97e9bc5f8 +Author: Ben Chan +Date: Fri Feb 14 19:09:53 2014 -0800 + + cli: align printout of bearer IPv6 configuration properties + + cli/mmcli-bearer.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit ccbd5a2e2da263de35917d841fdf3bc44a776e52 +Author: Ben Chan +Date: Thu Feb 13 12:42:11 2014 -0800 + + port-serial: fix gsize/gssize type mismatch + + This patch fixes the following type mismatch in + MMPortSerial::port_serial_process_command(): + + mm-port-serial.c:612:21: error: comparison of unsigned expression < + 0 is always false [-Werror,-Wtautological-compare] + if (written < 0) { + ~~~~~~~ ^ ~ + + src/mm-port-serial.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit d278f381d28f6a4ebc82f4f7ea838961ebb466a3 +Author: Ben Chan +Date: Thu Feb 13 13:10:17 2014 -0800 + + tests: fix array bound checks in process_next_command + + This patch fixes the out-of-bounds array accesses in + test-port-context.c, + which is detected by AddressSanitizer, by checking the index + against the + array length before accessing the array. + + plugins/tests/test-port-context.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0ce424451789a5ffacde7ff3cce038c2fbda97eb +Author: Ben Chan +Date: Thu Feb 13 12:42:19 2014 -0800 + + tests: add missing call to g_type_init() + + This patches fixes the following error when testing ModemManager with + glib < 2.36, which still requires g_type_init() to be called: + + TEST: test-service-generic... (pid=20166) + /MM/Service/Generic: + (/work/ModemManager/plugins/.libs/lt-test-service-generic:20166): + GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call + g_type_init() + FAIL + + plugins/generic/tests/test-service-generic.c | 1 + + 1 file changed, 1 insertion(+) + +commit 50de6798b0ae86692ad1f9a7b3e3188f16d2e45a +Author: Dan Williams +Date: Thu Feb 13 15:55:35 2014 -0600 + + broadband-modem: fix double-free of QCDM mode-pref query + + Caused by a merge conflict between 81ee0783 and 529e94b0. + + src/mm-broadband-modem.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 42ad7b758a09b91bba6cda7fe9ac06525aa86f6a +Author: Dan Williams +Date: Thu Feb 13 15:18:16 2014 -0600 + + manager: make Bluetooth rfcomm ports work again + + At some point rfcomm serial ports stopped having parents in sysfs, + so checks to get the physical device fail because the rfcomm port + is /sys/devices/virtual/rfcommX and has no parents. So we have + to fall back on checking the interface name. + + src/mm-device.c | 7 +++++++ + src/mm-manager.c | 9 ++++++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit fbb35628d525a7072ef87a9968cbc2ab1a705a6b +Author: Aleksander Morgado +Date: Tue Feb 4 11:10:20 2014 +0100 + + po: don't translate test files + + po/POTFILES.skip | 1 + + 1 file changed, 1 insertion(+) + +commit bff2a8d2f29fbf5e493c115101e48dd0ce37c3cd +Author: Aleksander Morgado +Date: Mon Nov 25 18:32:20 2013 +0100 + + tests: added support for DBus service tests + + We can now run 'simulated' modems against a ModemManager running in + its own + session bus. + + .gitignore | 1 + + plugins/Makefile.am | 53 +++- + plugins/generic/tests/test-service-generic.c | 84 ++++++ + plugins/tests/gsm-port.conf | 46 ++++ + plugins/tests/test-fixture.c | 186 +++++++++++++ + plugins/tests/test-fixture.h | 54 ++++ + plugins/tests/test-port-context.c | 391 + +++++++++++++++++++++++++++ + plugins/tests/test-port-context.h | 35 +++ + 8 files changed, 849 insertions(+), 1 deletion(-) + +commit ba58aa42f2ff931b561c45e2073772bc9b419dfc +Author: Aleksander Morgado +Date: Mon Nov 25 18:03:32 2013 +0100 + + base-modem: don't apply auth checks if running in the SESSION bus + + src/mm-base-modem.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit f85e345a9e0f6cd78e69092a55adfacb911f89bc +Author: Aleksander Morgado +Date: Mon Nov 25 18:03:08 2013 +0100 + + manager: as soon as we know we're going to stop, clear DBus connection + + So that the ObjectManager interface doesn't try to signal about + e.g. interface + removals; see: + + https://bugzilla.gnome.org/show_bug.cgi?id=715157. + + src/main.c | 7 +++++++ + src/mm-manager.c | 21 +++++++++++++++++++-- + 2 files changed, 26 insertions(+), 2 deletions(-) + +commit 247a9459509a1eeee7ffb686034920d3614c2b99 +Author: Aleksander Morgado +Date: Sun Nov 24 16:34:15 2013 +0100 + + context: new '--test-plugin-dir' to allow specifying where the + plugins are + + .../tests/org.freedesktop.ModemManager1.service.in | 2 +- + src/main.c | 1 + + src/mm-context.c | 8 +++ + src/mm-context.h | 1 + + src/mm-manager.c | 24 +++++++- + src/mm-manager.h | 2 + + src/mm-plugin-manager.c | 72 + ++++++++++++++++++++-- + src/mm-plugin-manager.h | 5 +- + 8 files changed, 107 insertions(+), 8 deletions(-) + +commit ea362ce18e0e594bf2815e8c94f3491e73fc68d7 +Author: Aleksander Morgado +Date: Sun Nov 24 15:50:18 2013 +0100 + + service,tests: run in MM in debug mode in service tests + + data/tests/org.freedesktop.ModemManager1.service.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6810aff8641151a092adda02a84e90ac10b48b0c +Author: Aleksander Morgado +Date: Fri Nov 22 23:42:15 2013 +0100 + + manager: allow to remotely setup test profiles with 'virtual' ports + + src/mm-manager.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 52 insertions(+), 2 deletions(-) + +commit 2d9d15f892cd0b2181b6fab73290d81bad63e7e3 +Author: Aleksander Morgado +Date: Fri Nov 22 23:40:55 2013 +0100 + + plugin: allow creating 'virtual' modems with 'virtual' ports + + src/mm-plugin.c | 43 +++++++++++++++++++++++++++++++++++-------- + 1 file changed, 35 insertions(+), 8 deletions(-) + +commit c182a04f6438850875319862cf8d22de2250e907 +Author: Aleksander Morgado +Date: Fri Nov 22 23:40:31 2013 +0100 + + base-modem: allow grabbing 'virtual' AT ports + + src/mm-base-modem.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +commit abb88a5e0ab7a0ed4a661372aa24e82aa38bc89f +Author: Aleksander Morgado +Date: Fri Nov 22 23:40:05 2013 +0100 + + plugin-manager: allow looking plugins by name + + src/mm-plugin-manager.c | 22 ++++++++++++++++++++++ + src/mm-plugin-manager.h | 4 ++++ + 2 files changed, 26 insertions(+) + +commit 9641d27518e3f0a33c909ce46331d34eed76b432 +Author: Aleksander Morgado +Date: Fri Nov 22 23:32:28 2013 +0100 + + device: allow creating 'virtual' devices + + src/mm-device.c | 146 + ++++++++++++++++++++++++++++++++++++++++++++++++-------- + src/mm-device.h | 11 +++++ + 2 files changed, 136 insertions(+), 21 deletions(-) + +commit b7fa48dd22f9bf4cb38a60e7c78184b7eea5fcf7 +Author: Aleksander Morgado +Date: Fri Nov 22 21:15:15 2013 +0100 + + device: new 'hotplugged' property + + src/mm-device.c | 29 +++++++++++++++++++++-------- + src/mm-device.h | 4 +++- + 2 files changed, 24 insertions(+), 9 deletions(-) + +commit 84ab92d85a331e835ab5672865e0238d08ee8857 +Author: Aleksander Morgado +Date: Fri Nov 22 16:58:25 2013 +0100 + + port-serial: allow ports based on Unix sockets + + src/mm-port-serial-at.c | 4 +- + src/mm-port-serial.c | 363 + +++++++++++++++++++++++++++++++++++------------- + src/mm-port.h | 3 +- + 3 files changed, 273 insertions(+), 97 deletions(-) + +commit 65f87561c58571bce8fca18c568a03f53f3d40eb +Author: Aleksander Morgado +Date: Fri Nov 22 13:47:11 2013 +0100 + + context: new '--test-enable' to enable the Test interface + + .../tests/org.freedesktop.ModemManager1.service.in | 2 +- + src/Makefile.am | 5 +- + src/main.c | 1 + + src/mm-context.c | 8 +++ + src/mm-context.h | 1 + + src/mm-manager.c | 63 + ++++++++++++++++++++++ + src/mm-manager.h | 6 ++- + 7 files changed, 82 insertions(+), 4 deletions(-) + +commit 243720414e2d7a1b1c6d42bed3275296b4bc1da0 +Author: Aleksander Morgado +Date: Fri Nov 22 11:54:30 2013 +0100 + + context: new '--test-no-auto-scan' to avoid automatic scanning + for devices + + .../tests/org.freedesktop.ModemManager1.service.in | 2 +- + src/main.c | 4 ++- + src/mm-context.c | 8 ++++++ + src/mm-context.h | 1 + + src/mm-manager.c | 31 + +++++++++++++++++++++- + src/mm-manager.h | 2 ++ + 6 files changed, 45 insertions(+), 3 deletions(-) + +commit bf57da537d62c5ef15b7be32818cd4a531f89d38 +Author: Aleksander Morgado +Date: Fri Nov 22 11:27:14 2013 +0100 + + context: new '--test-session' allows launching the MM daemon in the + session bus + + .../tests/org.freedesktop.ModemManager1.service.in | 2 +- + src/main.c | 5 ++- + src/mm-context.c | 49 + ++++++++++++++++++---- + src/mm-context.h | 3 ++ + 4 files changed, 49 insertions(+), 10 deletions(-) + +commit 46ff06ff80b404ceb92297c4d8ca8cec40c7c51e +Author: Aleksander Morgado +Date: Fri Nov 22 10:11:36 2013 +0100 + + service,tests: new DBus service file for tests + + .gitignore | 1 + + configure.ac | 2 ++ + data/Makefile.am | 2 ++ + data/tests/Makefile.am | 2 ++ + data/tests/org.freedesktop.ModemManager1.service.in | 5 +++++ + 5 files changed, 12 insertions(+) + +commit 4827e79848da98c600fd228d02ea6fb56dc4e814 +Author: Aleksander Morgado +Date: Fri Nov 22 09:25:21 2013 +0100 + + libmm-glib,tests: use gdbus-codegen to generate code for the new + Test interface + + .gitignore | 1 + + configure.ac | 1 + + docs/reference/libmm-glib/Makefile.am | 9 +++++++- + libmm-glib/generated/Makefile.am | 2 ++ + libmm-glib/generated/tests/Makefile.am | 38 + ++++++++++++++++++++++++++++++++++ + 5 files changed, 50 insertions(+), 1 deletion(-) + +commit 1eaa416f22d7d247a3a69afe6ff025984f10b491 +Author: Aleksander Morgado +Date: Fri Nov 22 09:24:07 2013 +0100 + + introspection,tests: add new 'Test' interface + + configure.ac | 1 + + introspection/Makefile.am | 3 +++ + introspection/tests/Makefile.am | 3 +++ + .../tests/org.freedesktop.ModemManager1.Test.xml | 31 + ++++++++++++++++++++++ + 4 files changed, 38 insertions(+) + +commit e684851698924e5b3872ac3adc93c2773ef910ee +Author: Aleksander Morgado +Date: Wed Nov 20 18:31:39 2013 +0100 + + huawei: use shortened version of NDISDUP when possible + + Adds support for the Huawei E3276 by sending the shortened form of the + AT^NDISDUP command where possible, as the E3276 fails with an + '+CME ERROR: + Incorrect parameters' if encoded_auth is set to 0. This behaviour + is slightly + different to the E1820 and K4605 (E372) which will happily establish a + connection with encoded_auth set to 0, 1 or 2. + + plugins/huawei/mm-broadband-bearer-huawei.c | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit b28230411a3f47bbba71b905e3982575308f81f4 +Author: Aleksander Morgado +Date: Wed Nov 20 18:24:38 2013 +0100 + + port-serial: always set the forced_close flag if forced to close + + src/mm-port-serial.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 0d0f5de161562df82a47bdc387b6ecb62e902719 +Author: Aleksander Morgado +Date: Tue Nov 19 23:59:57 2013 +0100 + + base-modem: allow looking for a subset of the available ports + + src/mm-base-modem.c | 32 ++++++++++++++++++++++++++++++++ + src/mm-base-modem.h | 5 +++++ + 2 files changed, 37 insertions(+) + +commit 2b46f658799e51d3db0ad61bbde45b3426622827 +Author: Aleksander Morgado +Date: Tue Nov 19 23:15:48 2013 +0100 + + base-modem: allow grabbing non-tty AT ports + + src/mm-base-modem.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 070f4938f3ff5425f8c4f18f57e79d935ad05b32 +Author: Aleksander Morgado +Date: Tue Nov 19 20:48:20 2013 +0100 + + plugin: allow probing non-tty AT ports + + src/mm-plugin.c | 20 +++++++++++++------- + src/mm-port-probe.c | 6 ++---- + 2 files changed, 15 insertions(+), 11 deletions(-) + +commit 38ebf7c95b94f065f80c85505e65f102cef733d2 +Author: Aleksander Morgado +Date: Tue Nov 19 20:24:27 2013 +0100 + + port-serial-at: allow specifying subsystem when creating a + 'MMPortSerialAt' + + Don't just assume that all AT ports are TTYs. + + src/mm-base-modem.c | 2 +- + src/mm-port-probe.c | 7 ++++++- + src/mm-port-serial-at.c | 13 ++++++++++--- + src/mm-port-serial-at.h | 3 ++- + 4 files changed, 19 insertions(+), 6 deletions(-) + +commit 9432674087617b8140ca2e517e367bf74061e87e +Author: Aleksander Morgado +Date: Wed Nov 20 17:47:19 2013 +0100 + + port-serial: use the GIOChannel also for writing data + + src/mm-port-serial.c | 113 + +++++++++++++++++++++++++++++++++------------------ + 1 file changed, 74 insertions(+), 39 deletions(-) + +commit 3ef71e45414b6797d464bb572a1dfb29c9c49d16 +Author: Aleksander Morgado +Date: Tue Nov 19 20:22:45 2013 +0100 + + port-serial: allow non-tty 'MMPortSerial' objects + + Allow having 'MMPortSerial' objects for non-tty devices. This will + allow us e.g. + handling /dev/cdc-wdm ports speaking the AT protocol. + + src/mm-port-serial.c | 112 + +++++++++++++++++++++++++++++---------------------- + 1 file changed, 64 insertions(+), 48 deletions(-) + +commit 6fc14f6611cb94fe0b2d280cfeddf658fdce8c53 +Author: Aleksander Morgado +Date: Tue Nov 19 20:19:22 2013 +0100 + + port-serial: remove unneeded method + + src/mm-port-serial.c | 8 -------- + src/mm-port-serial.h | 2 -- + 2 files changed, 10 deletions(-) + +commit a2f4fbe373de4f0cf094004b954504e510546b6e +Author: Aleksander Morgado +Date: Mon Nov 18 12:07:25 2013 +0100 + + port-serial-qcdm: commands are never cached + + The QCDM port commands are never cached, so remove the option from + the command() + method. Will also simplify command caching afterwards as it will be + an AT-only + thing. + + plugins/novatel/mm-broadband-modem-novatel.c | 4 ---- + src/mm-broadband-modem.c | 10 ---------- + src/mm-port-probe.c | 2 -- + src/mm-port-serial-qcdm.c | 3 +-- + src/mm-port-serial-qcdm.h | 1 - + src/tests/test-qcdm-serial-port.c | 2 +- + 6 files changed, 2 insertions(+), 20 deletions(-) + +commit 5792bcc876c9e3152d0444fca938091c112d05af +Author: Aleksander Morgado +Date: Tue Nov 19 18:51:50 2013 +0100 + + port: remove 'constructor' checking for property validity + + A constructor cannot return NULL, specially when there are subclasses, + as it + would segfault. Just remove it, as it doesn't really do anything + useful. + + src/mm-port.c | 41 ----------------------------------------- + 1 file changed, 41 deletions(-) + +commit ef77e35a7f203bbe64cc13fb00feb1602ccbc1f5 +Author: Aleksander Morgado +Date: Tue Nov 19 18:50:14 2013 +0100 + + port: use a 'priv' pointer to handle the private info + + src/mm-port.c | 56 + +++++++++++++++++++++++++++----------------------------- + src/mm-port.h | 2 ++ + 2 files changed, 29 insertions(+), 29 deletions(-) + +commit 3f8f88499e100a3c0cce7775c3bf36c09052ac4a +Author: Aleksander Morgado +Date: Mon Nov 18 00:34:10 2013 +0100 + + port-serial: use a 'priv' pointer to handle the private info + + src/mm-port-serial.c | 469 + ++++++++++++++++++++++++--------------------------- + src/mm-port-serial.h | 3 +- + 2 files changed, 220 insertions(+), 252 deletions(-) + +commit dbe13520eedfce385ef5f2e09185ba0321ed9d86 +Author: Aleksander Morgado +Date: Mon Nov 18 00:18:47 2013 +0100 + + port-serial-at: use a 'priv' pointer to handle the private info + + src/mm-port-serial-at.c | 125 + ++++++++++++++++++++++-------------------------- + src/mm-port-serial-at.h | 2 + + 2 files changed, 60 insertions(+), 67 deletions(-) + +commit e909edcf1fb18d884ebf9915e15a53ff19bbe00d +Author: Aleksander Morgado +Date: Mon Nov 18 00:07:04 2013 +0100 + + port-serial: use GIO Async API like method for command() + + src/mm-port-serial-at.c | 75 ++++---- + src/mm-port-serial-qcdm.c | 152 +++++++--------- + src/mm-port-serial.c | 445 + ++++++++++++++++++++++------------------------ + src/mm-port-serial.h | 32 +--- + 4 files changed, 318 insertions(+), 386 deletions(-) + +commit 8122153a88b6f87962d2702c14b642d4f344eca2 +Author: Aleksander Morgado +Date: Sun Nov 17 14:50:22 2013 +0100 + + port-serial: use GIO Async API like method for flash() + + src/mm-broadband-bearer.c | 22 ++++-- + src/mm-broadband-modem.c | 11 +-- + src/mm-port-probe.c | 10 +-- + src/mm-port-serial.c | 180 + ++++++++++++++++++++++++++++------------------ + src/mm-port-serial.h | 12 ++-- + 5 files changed, 144 insertions(+), 91 deletions(-) + +commit 6e35f0a8881de9f5a81a9abb2db17a15fda618bc +Author: Aleksander Morgado +Date: Sun Nov 17 14:13:50 2013 +0100 + + port-serial: use GIO Async API like method for reopen() + + src/mm-broadband-bearer.c | 20 +++--- + src/mm-port-serial.c | 161 + ++++++++++++++++++++++++++++------------------ + src/mm-port-serial.h | 12 ++-- + 3 files changed, 117 insertions(+), 76 deletions(-) + +commit d4dfd661b9bcfdad5a79e2a3f28374f0d0982c23 +Author: Aleksander Morgado +Date: Sun Nov 17 01:11:12 2013 +0100 + + port-serial-at: use GIO Async API like methods + + plugins/cinterion/mm-plugin-cinterion.c | 31 ++++---- + plugins/huawei/mm-plugin-huawei.c | 55 ++++++++------ + plugins/longcheer/mm-plugin-longcheer.c | 19 +++-- + plugins/novatel/mm-plugin-novatel.c | 28 ++++--- + plugins/sierra/mm-plugin-sierra.c | 32 +++++--- + plugins/x22x/mm-plugin-x22x.c | 19 +++-- + src/mm-base-modem-at.c | 107 +++++++++++++------------- + src/mm-port-probe.c | 35 +++++---- + src/mm-port-serial-at.c | 130 + +++++++++++++++++++------------- + src/mm-port-serial-at.h | 31 +++----- + 10 files changed, 276 insertions(+), 211 deletions(-) + +commit 81ee07832d3ab733f59f869ad17d1d5577aef3ff +Author: Aleksander Morgado +Date: Sat Nov 16 00:56:29 2013 +0100 + + port-serial-qcdm: use GIO Async API like methods + + plugins/novatel/mm-broadband-modem-novatel.c | 83 +++++++--- + src/mm-broadband-modem.c | 239 + +++++++++++++++++---------- + src/mm-port-probe.c | 48 ++++-- + src/mm-port-serial-qcdm.c | 93 +++++++---- + src/mm-port-serial-qcdm.h | 20 +-- + src/mm-port-serial.c | 10 +- + src/tests/test-qcdm-serial-port.c | 93 +++++------ + 7 files changed, 352 insertions(+), 234 deletions(-) + +commit 1d57a008df410846499099fb84e06abcbfbbb6f5 +Author: Aleksander Morgado +Date: Sat Nov 16 00:16:35 2013 +0100 + + port-serial-qcdm: remove unneeded private info + + src/mm-port-serial-qcdm.c | 18 ------------------ + 1 file changed, 18 deletions(-) + +commit 0c86840dde3baf1b77c841426453e014c9af9d31 +Author: Aleksander Morgado +Date: Wed Nov 20 16:00:14 2013 +0100 + + ports: rename 'libserial' to 'libport' + + .gitignore | 4 ++-- + plugins/huawei/mm-plugin-huawei.c | 2 +- + src/Makefile.am | 44 + +++++++++++++++++++-------------------- + src/mm-base-modem.c | 2 +- + src/mm-bearer-mbim.c | 2 +- + src/mm-bearer-qmi.c | 2 +- + src/mm-broadband-bearer.c | 2 +- + src/tests/Makefile.am | 4 ++-- + 8 files changed, 31 insertions(+), 31 deletions(-) + +commit c236e18692d887269a71da6e8105187f58ddfd75 +Author: Aleksander Morgado +Date: Wed Nov 20 15:54:35 2013 +0100 + + ports: rename 'MMMbimPort' to 'MMPortMbim' + + src/Makefile.am | 4 +-- + src/mm-base-modem.c | 26 +++++++++--------- + src/mm-base-modem.h | 10 +++---- + src/mm-bearer-mbim.c | 4 +-- + src/mm-broadband-modem-mbim.c | 24 ++++++++--------- + src/{mm-mbim-port.c => mm-port-mbim.c} | 48 + +++++++++++++++++----------------- + src/{mm-mbim-port.h => mm-port-mbim.h} | 46 + ++++++++++++++++---------------- + src/mm-port-probe.c | 20 +++++++------- + src/mm-sim-mbim.c | 4 +-- + src/mm-sms-mbim.c | 4 +-- + 10 files changed, 95 insertions(+), 95 deletions(-) + +commit 403e013f15903ee3d2d3fe2c5f60e8beb3c4356e +Author: Aleksander Morgado +Date: Wed Nov 20 15:49:57 2013 +0100 + + ports: rename 'MMQmiPort' to 'MMPortQmi' + + src/Makefile.am | 4 +-- + src/mm-base-modem.c | 26 +++++++------- + src/mm-base-modem.h | 10 +++--- + src/mm-bearer-qmi.c | 40 +++++++++++----------- + src/mm-broadband-modem-qmi.c | 54 ++++++++++++++--------------- + src/mm-port-probe.c | 24 ++++++------- + src/{mm-qmi-port.c => mm-port-qmi.c} | 66 + ++++++++++++++++++------------------ + src/{mm-qmi-port.h => mm-port-qmi.h} | 64 + +++++++++++++++++----------------- + src/mm-sim-qmi.c | 6 ++-- + src/mm-sms-qmi.c | 6 ++-- + 10 files changed, 150 insertions(+), 150 deletions(-) + +commit 6f235b9948cf1ff1d11a7a339d3d1ffc40171dcd +Author: Aleksander Morgado +Date: Wed Nov 20 15:41:33 2013 +0100 + + ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' + + plugins/altair/mm-broadband-bearer-altair-lte.c | 18 +-- + plugins/altair/mm-broadband-modem-altair-lte.c | 28 ++--- + plugins/anydata/mm-broadband-modem-anydata.c | 16 +-- + plugins/cinterion/mm-plugin-cinterion.c | 16 +-- + plugins/huawei/mm-broadband-bearer-huawei.c | 12 +- + plugins/huawei/mm-broadband-modem-huawei.c | 76 ++++++------ + plugins/huawei/mm-plugin-huawei.c | 38 +++--- + plugins/icera/mm-broadband-bearer-icera.c | 20 +-- + plugins/icera/mm-broadband-modem-icera.c | 16 +-- + plugins/iridium/mm-bearer-iridium.c | 2 +- + plugins/iridium/mm-broadband-modem-iridium.c | 4 +- + plugins/longcheer/mm-plugin-longcheer.c | 16 +-- + plugins/mbm/mm-broadband-bearer-mbm.c | 10 +- + plugins/mbm/mm-broadband-modem-mbm.c | 34 +++--- + plugins/mtk/mm-broadband-modem-mtk.c | 31 +++-- + plugins/mtk/mm-plugin-mtk.c | 6 +- + plugins/nokia/mm-broadband-modem-nokia.c | 4 +- + plugins/nokia/mm-plugin-nokia-icera.c | 6 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 20 +-- + plugins/novatel/mm-plugin-novatel.c | 10 +- + plugins/option/mm-broadband-bearer-hso.c | 20 +-- + plugins/option/mm-broadband-modem-hso.c | 14 +-- + plugins/option/mm-broadband-modem-option.c | 28 ++--- + plugins/option/mm-plugin-hso.c | 12 +- + plugins/option/mm-plugin-option.c | 4 +- + plugins/pantech/mm-plugin-pantech.c | 4 +- + plugins/samsung/mm-broadband-modem-samsung.c | 2 +- + plugins/sierra/mm-broadband-bearer-sierra.c | 16 +-- + plugins/sierra/mm-broadband-modem-sierra.c | 4 +- + plugins/sierra/mm-common-sierra.c | 6 +- + plugins/sierra/mm-plugin-sierra.c | 18 +-- + plugins/simtech/mm-broadband-modem-simtech.c | 8 +- + plugins/simtech/mm-plugin-simtech.c | 8 +- + plugins/telit/mm-plugin-telit.c | 6 +- + plugins/via/mm-broadband-modem-via.c | 28 ++--- + plugins/wavecom/mm-broadband-modem-wavecom.c | 4 +- + plugins/x22x/mm-plugin-x22x.c | 22 ++-- + plugins/zte/mm-common-zte.c | 16 +-- + plugins/zte/mm-plugin-zte.c | 6 +- + src/Makefile.am | 8 +- + src/mm-at-serial-port.h | 134 + -------------------- + src/mm-base-modem-at.c | 44 +++---- + src/mm-base-modem-at.h | 6 +- + src/mm-base-modem.c | 90 +++++++------- + src/mm-base-modem.h | 20 +-- + src/mm-broadband-bearer.c | 66 +++++----- + src/mm-broadband-bearer.h | 22 ++-- + src/mm-broadband-modem.c | 88 +++++++------- + src/mm-iface-modem-3gpp-ussd.h | 2 - + src/mm-iface-modem-3gpp.h | 2 +- + src/mm-iface-modem-cdma.h | 2 +- + src/mm-iface-modem-location.h | 2 - + src/mm-iface-modem-messaging.h | 1 - + src/mm-iface-modem.h | 2 +- + src/mm-plugin.c | 4 +- + src/mm-port-probe.c | 22 ++-- + src/mm-port-probe.h | 4 +- + src/{mm-at-serial-port.c => mm-port-serial-at.c} | 142 + +++++++++++----------- + src/mm-port-serial-at.h | 133 + ++++++++++++++++++++ + src/tests/test-at-serial-port.c | 4 +- + 60 files changed, 700 insertions(+), 707 deletions(-) + +commit 0d1602bf0f861eed0af68a51610a3a6d3e139d0b +Author: Aleksander Morgado +Date: Wed Nov 20 15:38:34 2013 +0100 + + ports: rename 'MMQcdmSerialPort' to 'MMPortSerialQcdm' + + plugins/novatel/mm-broadband-modem-novatel.c | 22 +++--- + src/Makefile.am | 4 +- + src/mm-base-modem.c | 14 ++-- + src/mm-base-modem.h | 6 +- + src/mm-broadband-modem.c | 80 + +++++++++++----------- + src/mm-plugin.c | 2 +- + src/mm-port-probe.c | 14 ++-- + ...mm-qcdm-serial-port.c => mm-port-serial-qcdm.c} | 46 ++++++------- + ...mm-qcdm-serial-port.h => mm-port-serial-qcdm.h} | 43 ++++++------ + src/tests/test-qcdm-serial-port.c | 16 ++--- + 10 files changed, 123 insertions(+), 124 deletions(-) + +commit e505ea0a5874f783b3e76c1f7f18174f1012f9f4 +Author: Aleksander Morgado +Date: Wed Nov 20 15:36:32 2013 +0100 + + ports: rename 'MMGpsSerialPort' to 'MMPortSerialGps' + + plugins/option/mm-broadband-modem-hso.c | 12 ++--- + src/Makefile.am | 4 +- + src/mm-base-modem.c | 14 +++--- + src/mm-base-modem.h | 6 +-- + src/mm-gps-serial-port.h | 57 + ---------------------- + src/{mm-gps-serial-port.c => mm-port-serial-gps.c} | 36 +++++++------- + src/mm-port-serial-gps.h | 57 + ++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 93 deletions(-) + +commit 9cde02111b3c0eb2ef487c021bcb0950d7cb5f92 +Author: Aleksander Morgado +Date: Wed Nov 20 15:28:34 2013 +0100 + + ports: rename 'MMSerialPort' to 'MMPortSerial' + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + plugins/icera/mm-broadband-bearer-icera.c | 2 +- + plugins/iridium/mm-broadband-modem-iridium.c | 2 +- + plugins/mbm/mm-broadband-modem-mbm.c | 4 +- + plugins/option/mm-broadband-bearer-hso.c | 2 +- + plugins/option/mm-broadband-modem-hso.c | 6 +- + plugins/samsung/mm-broadband-modem-samsung.c | 2 +- + src/Makefile.am | 4 +- + src/mm-at-serial-port.c | 28 +-- + src/mm-at-serial-port.h | 6 +- + src/mm-base-modem-at.c | 6 +- + src/mm-base-modem.c | 2 +- + src/mm-broadband-bearer.c | 34 +-- + src/mm-broadband-modem.c | 32 +-- + src/mm-gps-serial-port.c | 12 +- + src/mm-gps-serial-port.h | 6 +- + src/mm-port-probe.c | 28 +-- + src/{mm-serial-port.c => mm-port-serial.c} | 310 + ++++++++++++------------- + src/{mm-serial-port.h => mm-port-serial.h} | 96 ++++---- + src/mm-qcdm-serial-port.c | 22 +- + src/mm-qcdm-serial-port.h | 6 +- + src/tests/test-qcdm-serial-port.c | 4 +- + 22 files changed, 309 insertions(+), 307 deletions(-) + +commit c9e2b46b2124afcf710736900ba1848711126a83 +Author: Aleksander Morgado +Date: Thu Feb 13 11:55:59 2014 +0100 + + cinterion: try to gather port type for devices with multiple tty ports + + The new PHS8 or PXS8 devices may expose multiple tty ports, but only + one is + supposed to be used for PPP. So, query which port that is and flag + it before + grabbing it in the modem. + + plugins/cinterion/mm-plugin-cinterion.c | 119 + ++++++++++++++++++++++++++++++++ + 1 file changed, 119 insertions(+) + +commit e60485a4aaede4d5a85b941574bd3e12143cb501 +Author: Aleksander Morgado +Date: Wed Feb 12 17:18:24 2014 +0100 + + wavecom: implement after-sim-unlock step + + Just give some time to the SIM to get properly initialized, so that + we avoid + errors when reloading e.g. facility lock status. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 39 + ++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 5d2f15041bb17b1c6108632b862a5cfba4d76826 +Author: Ben Chan +Date: Tue Feb 11 23:31:31 2014 -0800 + + zte: allow MBIM devices + + plugins/zte/mm-plugin-zte.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit bd5cecb577b7e47ff1f84f9f476fb0a69374c798 +Author: Arnd Hannemann +Date: Tue Feb 11 09:52:18 2014 +0100 + + mbm: add lenovo branded ericsson ID (Lenovo N5321gw) + + This device ID is used in a Lenovo Thinkpad T440s. + + Link: + http://forums.debian.net/viewtopic.php?f=7&t=107986&sid=4f81b9c1a8f4563f26fec24f7b65aaea&start=15 + + Signed-off-by: Arnd Hannemann + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 121fbd91e7208746e5f5f802b9ef406d9b5e5152 +Author: Aleksander Morgado +Date: Thu Feb 6 10:41:09 2014 +0100 + + docs,api: fix section reference to the Messaging interface + + docs/reference/api/ModemManager-overview.xml | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit c48b97b1187971a7b545921bfdc961e9ad53f0a6 +Author: Yunlian Jiang +Date: Wed Feb 5 16:08:07 2014 -0800 + + libqcdm: use NULL instead of 0 for empty pointer + + When I use clang 3.5 to build it, I got + + commands.c:1444:16: error: expression which evaluates to zero treated + as a + null + pointer constant of type 'QcdmResult *' (aka 'struct QcdmResult + *') + [-Werror,-Wnon-literal-null-conversion] + return FALSE; + ^~~~~ + ./utils.h:29:15: note: expanded from macro 'FALSE' + #define FALSE ((u_int8_t) 0) + ^~~~~~~~~~~~~~ + commands.c:1464:20: error: expression which evaluates to zero treated + as a + null + pointer constant of type 'QcdmResult *' (aka 'struct QcdmResult + *') + [-Werror,-Wnon-literal-null-conversion] + return FALSE; + ^~~~~ + ./utils.h:29:15: note: expanded from macro 'FALSE' + #define FALSE ((u_int8_t) 0) + ^~~~~~~~~~~~~~ + 2 errors generated. + make[3]: *** [libqcdm_la-commands.lo] Error 1 + make[3]: *** Waiting for unfinished jobs.... + + Below is the patch that fixes it + + libqcdm/src/commands.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 9447527c357a91bbd3660274c41fd1b802e4cf84 +Author: Julian Oes +Date: Tue Feb 4 12:11:39 2014 +0100 + + blacklist: ignore all devices from VID 0x26a, no modems from 3D + Robotics + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 94bf076f28ecf32b8a28f6b88b775bf11c5c1250 +Author: Aleksander Morgado +Date: Thu Jan 30 18:03:10 2014 +0100 + + docs: update email address + + AUTHORS | 2 +- + docs/reference/api/ModemManager-docs.xml | 2 +- + docs/reference/libmm-glib/libmm-glib-docs.xml | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit d81dd744529b2d732302d8aec04be9c922e504a4 +Author: Aleksander Morgado +Date: Thu Jan 30 17:57:00 2014 +0100 + + build: post release version bump to 1.3.0 (development) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2c53c664d85f8762b2cada1a7fcddc6c6a20fc03 +Author: Aleksander Morgado +Date: Thu Jan 30 17:17:45 2014 +0100 + + release: bump version to 1.2.0 + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 38501a06bf059182cbb43b3c667366cf5fb3e71e +Author: Aleksander Morgado +Date: Thu Jan 30 13:10:03 2014 +0100 + + mmcli: allow passing SMS index in --messaging-delete-sms + + cli/mmcli-modem-messaging.c | 57 + +++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 50 insertions(+), 7 deletions(-) + +commit 513248a2b7b4bc9d3043c81c024ad3277d35523f +Author: Aleksander Morgado +Date: Thu Jan 30 12:50:30 2014 +0100 + + mmcli: allow passing bearer index in --delete-bearer + + cli/mmcli-modem.c | 57 + ++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 50 insertions(+), 7 deletions(-) + +commit 06d2e51bbc4e183d7934adcc9cddbbe6195689a3 +Author: Ben Chan +Date: Thu Jan 30 00:43:45 2014 -0800 + + zte: add port type hints for the ZTE MF190 (19d2:1254) + + plugins/zte/77-mm-zte-port-types.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit c28ff0d5470f0564cc09d8fa06e18506876033a3 +Author: Ben Chan +Date: Tue Jan 28 23:44:01 2014 -0800 + + modem-helpers: recognize "3G" as UMTS access technology + + Some modems (e.g. ZTE MF190) report UMTS access technology as "3G": + + --> 'AT+ZPAS?' + <-- '+ZPAS: "3G","CS_PS"OK' + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c5cfa2cad103bba58f281324458be6c05dbd8326 +Author: Guido Günther +Date: Sun Jan 26 16:37:58 2014 +0100 + + broadband-modem-qmi: Fix compilation error due to removed variable + + otherwise we fail with: + + CC ModemManager-mm-broadband-modem-qmi.o + mm-broadband-modem-qmi.c: In function ‘process_gsm_info’: + mm-broadband-modem-qmi.c:4182:18: error: ‘egprs_support_valid’ + undeclared (first use in this function) + &egprs_support_valid, &egprs_support, + ^ + mm-broadband-modem-qmi.c:4182:18: note: each undeclared identifier + is reported only once for each function it appears in + mm-broadband-modem-qmi.c:4182:40: error: ‘egprs_support’ + undeclared (first use in this function) + &egprs_support_valid, &egprs_support, + + src/mm-broadband-modem-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3c2800f02eef9f1aed2ad7b25717b2bb54fcd764 +Author: Guido Günther +Date: Sun Jan 26 16:37:57 2014 +0100 + + broadband-modem-qmi: Fix compilation error due to variable type change + + otherwise we fail with: + + CC ModemManager-mm-broadband-modem-qmi.o + mm-broadband-modem-qmi.c: In function ‘get_signal_info_ready’: + mm-broadband-modem-qmi.c:2309:5: error: passing argument 3 of + ‘signal_info_get_quality’ from incompatible pointer type [-Werror] + if (!signal_info_get_quality (ctx->self, output, &quality)) { + ^ + mm-broadband-modem-qmi.c:2236:1: note: expected ‘gint8 *’ but + argument is of type ‘guint *’ + signal_info_get_quality (MMBroadbandModemQmi *self, + ^ + cc1: all warnings being treated as errors + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 983c197c6b7b6c31e91bfb82c3d32a2578c39b53 +Author: Guido Günther +Date: Sun Jan 26 16:37:56 2014 +0100 + + broadband-modem-qmi: Fix compilation error due to variable name change + + otherwise we fail with: + + CC ModemManager-mm-broadband-modem-qmi.o + mm-broadband-modem-qmi.c: In function ‘modem_load_current_bands’: + mm-broadband-modem-qmi.c:1881:35: error: ‘ctx’ undeclared (first + use in this function) + if (qmi_client_check_version (ctx->client, 1, 19)) { + ^ + mm-broadband-modem-qmi.c:1881:35: note: each undeclared identifier + is reported only once for each function it appears in + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fdba981f8e5023fc4c42ba29c401444a3a2f2578 +Author: Aleksander Morgado +Date: Sun Jan 26 19:56:58 2014 +0100 + + huawei: fix leaked string + + plugins/huawei/mm-broadband-modem-huawei.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 48585c250b68ab2ca192af36b8873c475f73165c +Author: Aleksander Morgado +Date: Sun Jan 26 19:29:45 2014 +0100 + + udev: apply udev rules upon 'move' events as well + + Otherwise, we may end up losing the tags we expect if the device + gets a 'move' + event just after the initial 'add'. + + plugins/huawei/77-mm-huawei-net-port-types.rules | 2 +- + plugins/longcheer/77-mm-longcheer-port-types.rules | 2 +- + plugins/mbm/77-mm-ericsson-mbm.rules | 2 +- + plugins/mtk/77-mm-mtk-port-types.rules | 2 +- + plugins/nokia/77-mm-nokia-port-types.rules | 2 +- + plugins/simtech/77-mm-simtech-port-types.rules | 2 +- + plugins/telit/77-mm-telit-port-types.rules | 2 +- + plugins/x22x/77-mm-x22x-port-types.rules | 2 +- + plugins/zte/77-mm-zte-port-types.rules | 2 +- + src/77-mm-pcmcia-device-blacklist.rules | 3 +-- + src/77-mm-platform-serial-whitelist.rules | 3 +-- + src/77-mm-usb-device-blacklist.rules | 2 +- + src/77-mm-usb-serial-adapters-greylist.rules | 2 +- + 13 files changed, 13 insertions(+), 15 deletions(-) + +commit b7adbf97a560d8c4ae59d151872ed154c7e49822 +Author: Aleksander Morgado +Date: Sun Jan 26 11:25:06 2014 +0100 + + port-probe: the 'buffer-full' signal is only used during AT probing + + Make sure we cleanup the 'buffer-full' signal handler when moving + from AT + probing to QCDM probing, so that we don't try to remove a signal + handler from + a QCDM port in which we haven't set it. + + E.g. avoids: + + ModemManager[1493]: [1390731359.108502] [mm-port-probe.c:239] + mm_port_probe_set_result_qcdm(): (tty/ttyHS2) port is QCDM-capable + + (ModemManager:1493): GLib-GObject-WARNING **: gsignal.c:2585: instance + '0x7431b0' has no handler with id '16' + + src/mm-port-probe.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 72d83898da16015361c2fed216fe797678fca427 +Author: Aleksander Morgado +Date: Sun Jan 26 11:01:42 2014 +0100 + + huawei: fix some leaked 'GStrv' arrays + + plugins/huawei/mm-modem-helpers-huawei.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 0cfc825e11ba935d84c51e2d206d3e7ee242b9fb +Author: Aleksander Morgado +Date: Sun Jan 26 10:55:43 2014 +0100 + + huawei: fix leaked 'GUdevDevice' + + plugins/huawei/mm-broadband-modem-huawei.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a282237ae518bb782f1e92e3a8044be431421cfd +Author: Aleksander Morgado +Date: Sat Jan 25 20:56:01 2014 +0100 + + port-probe: buffer_full_id is a signal handler, not a GSource + + src/mm-port-probe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 93108fdb60641ec82f363be1a4ecb4be5f575607 +Author: Aleksander Morgado +Date: Sat Jan 25 20:45:34 2014 +0100 + + novatel: fix leaked 'GSimpleAsyncResult' + + plugins/novatel/mm-broadband-modem-novatel.c | 1 + + 1 file changed, 1 insertion(+) + +commit 95249239a21870c85082306e7ac791979abc9a76 +Author: Aleksander Morgado +Date: Sat Jan 25 20:01:32 2014 +0100 + + sierra: fix leaked 'GStrv' with CDMA modems + + plugins/sierra/mm-broadband-modem-sierra.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 529e94b039305eacc13df48e9721120eb14a4636 +Author: Aleksander Morgado +Date: Sat Jan 25 19:34:57 2014 +0100 + + broadband-modem: fix leaked 'QcdmResult' + + src/mm-broadband-modem.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 561c8b715ecdff3e4e6f0bc397e4ca46b71f21f2 +Author: Aleksander Morgado +Date: Fri Jan 24 21:26:46 2014 +0100 + + bearer-mbim: fix leaked 'MMBearerIpConfig' objects + + src/mm-bearer-mbim.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit ae86ce1cbbea78fe90c4801f50ab0aa6671547c6 +Author: Aleksander Morgado +Date: Fri Jan 24 21:08:47 2014 +0100 + + bearer-mbim: fix leaked 'MMBearerProperties' + + src/mm-bearer-mbim.c | 1 + + 1 file changed, 1 insertion(+) + +commit 1547be518165464fc0700c65aa864fcc35597717 +Author: Aleksander Morgado +Date: Fri Jan 24 20:44:14 2014 +0100 + + bearer-mbim: fix several leaked 'MbimMessage' objects + + mbim_device_command_finish() returns always a new reference to + the response. + + src/mm-bearer-mbim.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit 26793e10d6e32ba8595cbc70970e8d02aa3169b9 +Author: Aleksander Morgado +Date: Fri Jan 24 19:15:46 2014 +0100 + + release: update NEWS + + NEWS | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit 3914808120bb852dc22ee1d89ad2a21d6120af9d +Author: Aleksander Morgado +Date: Thu Dec 27 06:50:06 2012 +0100 + + zte: support for QMI-based modems + + E.g. the ZTE MF190 + + [/dev/cdc-wdm1] QMI Device supports 4 services: + [/dev/cdc-wdm1] ctl (1.2) + [/dev/cdc-wdm1] wds (1.3) + [/dev/cdc-wdm1] dms (1.2) + [/dev/cdc-wdm1] nas (1.0) + + plugins/zte/mm-plugin-zte.c | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +commit 19b0a7e28fa27556db8f09f93c8628a3fa21aeaa +Author: Aleksander Morgado +Date: Sat Jan 18 14:16:59 2014 +0100 + + altair-lte: add 'mm' prefix in the exported helper methods + + plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++-- + plugins/altair/mm-modem-helpers-altair-lte.c | 8 ++++---- + plugins/altair/mm-modem-helpers-altair-lte.h | 8 ++++---- + plugins/altair/tests/test-modem-helpers-altair-lte.c | 20 + ++++++++++---------- + 4 files changed, 20 insertions(+), 20 deletions(-) + +commit 87f0f808bf9282e3de3bfcf7486049ff9b6f6aa8 +Author: Thieu Le +Date: Wed Jan 15 13:06:39 2014 -0800 + + altair-lte: set subscription state using PCO + + This patch sets the subscription state using Verizon's PCO values. + + plugins/altair/mm-broadband-modem-altair-lte.c | 229 + +++++++++++++++++++-- + plugins/altair/mm-modem-helpers-altair-lte.c | 155 ++++++++++++++ + plugins/altair/mm-modem-helpers-altair-lte.h | 8 + + .../altair/tests/test-modem-helpers-altair-lte.c | 38 ++++ + src/mm-iface-modem-3gpp.c | 1 + + 5 files changed, 415 insertions(+), 16 deletions(-) + +commit afabde0f2c710302024d4fd40c8d719d4196ded6 +Author: Aleksander Morgado +Date: Fri Jan 17 11:58:18 2014 +0100 + + build: fix linker flags when building plugins + + MM_LIBS was missing in PLUGIN_COMMON_LINKER_FLAGS, and replace + GUDEV_LDFLAGS + with GUDEV_LIBS. + + plugins/Makefile.am | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 22eb8816f1711d9903c9de55d5a99f6bdaad6c50 +Author: Mario Blättermann +Date: Mon Jan 13 17:55:41 2014 +0100 + + po: add German translation + + po/LINGUAS | 3 +- + po/de.po | 95 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 97 insertions(+), 1 deletion(-) + +commit 5c00736f4402eae5ea15861f376239ae73cf8aa0 +Author: Ben Chan +Date: Fri Jan 10 16:55:44 2014 -0800 + + iface-modem,sim: make SIM interface initialization cancellable + + src/mm-iface-modem.c | 2 +- + src/mm-sim.c | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit 50f3f41c3a857caf9403ef943b4832735fb4ffba +Author: Ben Chan +Date: Wed Jan 8 16:10:06 2014 -0800 + + huawei: avoid creating Connect3gppContext when no data port is + available + + This patch modifies MMBroadbandBearerHuawei such that connect_3gpp + simply reports an error via g_simple_async_report_error_in_idle, + without + creating a Connect3gppContext, if no data port is available. + + plugins/huawei/mm-broadband-bearer-huawei.c | 30 + ++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit fd1a1839ae1bcade2f9d422f6bc0d6e6040295e6 +Author: Ben Chan +Date: Wed Jan 8 10:13:16 2014 -0800 + + serial-port: fail open/reopen after a serial port has been forced + close + + After a MMSerialPort object is forced close, it may be opened again + if some + other object still holds a reference to it. When the MMSerialPort + object is + eventually disposed, mm_serial_port_close_force is invoked on the + object but + does nothing as 'priv->forced_close' is already set to + TRUE. 'priv->watch_id' + is still active, which could potentially lead to a crash if + data_available is + called after the MMSerialPort object is finalized. This patch prevents + such a + scenario by failing mm_serial_port_open / mm_serial_port_reopen + after the + MMSerialPort has been forced close. + + src/mm-serial-port.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 910a55a0f2373a3469e7d0f3fe6dc5b0e8440e9f +Author: Ben Chan +Date: Tue Jan 7 23:16:56 2014 -0800 + + novatel-lte: remove unused macro definitions + + plugins/novatel/mm-broadband-bearer-novatel-lte.h | 3 --- + 1 file changed, 3 deletions(-) + +commit 76d52c2df38ce6bf7c2093df097e97b6f6690946 +Author: Ben Chan +Date: Tue Jan 7 23:55:45 2014 -0800 + + huawei: avoid calling g_object_unref on NULL + + This patch prevents connect_3gpp_context_complete_and_free from + calling + 'g_object_unref (ctx->data)' when connect_3gpp finds no data port + (i.e. + ctx->data is set to NULL). + + plugins/huawei/mm-broadband-bearer-huawei.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 84bdcb04ed076a8c32a6e7146922e8bdded930c2 +Author: Yegor Yefremov +Date: Tue Jan 7 11:41:59 2014 +0100 + + trivial: resolve maybe-uninitialized warnings + + Signed-off-by: Yegor Yefremov + + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + src/mm-serial-port.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 1601069e50b9cf2d2d22cf44245bee042c35f150 +Author: Ben Chan +Date: Mon Jan 6 17:20:52 2014 -0800 + + novatel-lte: explicitly use primary port for connection/disconnection + sequence + + The Novatel LTE modem only uses its primary AT port for AT commands. + Instead of referencing any existing secondary port, this patch changes + MMBroadbandBearerNovatelLte to explicitly use the primary port + during the + connection and disconnection sequence. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 39 + +++++++++++++---------- + 1 file changed, 22 insertions(+), 17 deletions(-) + +commit 6c1c0d5e2b45ad0d156ace656d9e74c62ff485b9 +Author: Ben Chan +Date: Mon Jan 6 11:27:46 2014 -0800 + + altair-lte: explicitly use primary port for connection/disconnection + sequence + + The Altair LTE modem only uses its primary AT port for AT commands. + Instead of referencing any existing secondary port, this patch changes + MMBroadbandBearerAltairLte to explicitly use the primary port + during the + connection and disconnection sequence. + + plugins/altair/mm-broadband-bearer-altair-lte.c | 64 + ++++++++++++------------- + 1 file changed, 32 insertions(+), 32 deletions(-) + +commit 22b0de736b73d076eebd8978a8d0b9da1f3d126d +Author: Ben Chan +Date: Mon Jan 6 09:50:05 2014 -0800 + + huawei: handle ^NDISSTAT disconnected notification only on a + connected bearer + + If the bearer is not actually connected and the modem + (inappropriately) + indicates a disconnected status via a ^NDISSTAT unsolicited message, + it + could potentially lead to the following assertion in + connect_3gpp_context_step. This patch addresses such an issue. + + g_assert (ctx->self->priv->network_disconnect_pending_id == 0); + + 0x7f940c2ecd95 [libc-2.15.so] - raise.c:64 + raise + 0x7f940c2ee217 [libc-2.15.so] - abort.c:91 + abort + 0x7f940c8e6086 [libglib-2.0.so.0.3400.3] - gtestutils.c:1877 + g_assertion_message + 0x7f940c8e6553 [libglib-2.0.so.0.3400.3] - gtestutils.c:1888 + g_assertion_message_expr + 0x7f940cba5710 [libmm-plugin-huawei.so] - + mm-broadband-bearer-huawei.c:240 connect_3gpp_context_step + 0x7f940cd4a51e [ModemManager] - + mm-broadband-bearer.c:1246 connect + 0x7f940cd662b7 [ModemManager] - + mm-iface-modem-simple.c:588 connection_step + 0x7f940cd66e6e [ModemManager] - + mm-iface-modem-simple.c:267 + register_in_3gpp_or_cdma_network_ready + 0x7f940ca0e296 [libgio-2.0.so.0.3400.3] - gsimpleasyncresult.c:775 + g_simple_async_result_complete + 0x7f940ca0e398 [libgio-2.0.so.0.3400.3] - gsimpleasyncresult.c:787 + complete_in_idle_cb + 0x7f940c8c2ff4 [libglib-2.0.so.0.3400.3] - gmain.c:2715 + g_main_context_dispatch + 0x7f940c8c3377 [libglib-2.0.so.0.3400.3] - gmain.c:3290 + g_main_context_iterate + 0x7f940c8c37c9 [libglib-2.0.so.0.3400.3] - gmain.c:3484 + g_main_loop_run + 0x7f940cd3b425 [ModemManager] - main.c:142 + main + 0x7f940c2d9464 [libc-2.15.so] - libc-start.c:234 + __libc_start_main + 0x7f940cd3afa8 [ModemManager] + 0x0001efa8 + + plugins/huawei/mm-broadband-bearer-huawei.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 2a946bd72cbc1f1a09db2d72e46e0e1f2a95107f +Author: Ben Chan +Date: Mon Jan 6 11:47:08 2014 -0800 + + novatel-lte: remove unnecessary MM_BASE_MODEM() casts + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 19 + +++++-------------- + plugins/novatel/mm-sim-novatel-lte.c | 2 +- + 2 files changed, 6 insertions(+), 15 deletions(-) + +commit 885a453dadecf00e08f7f8c6cdaec2a208907f88 +Author: Jens Seidel +Date: Fri Jan 3 11:31:58 2014 -0600 + + mbm: add another C5621 ID + + This device ID is used in a Lenovo Helix. + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0ddbbaab17023bf83a6566c4ef57c2fcfc8b8cf0 +Author: Aleksander Morgado +Date: Fri Jan 3 12:38:01 2014 +0100 + + sms-mbim: increase timeout when sending SMS part to 30s + + Aligned to the value used also in QMI, and likely a much better + value than the + original 10s. + + See: + http://lists.freedesktop.org/archives/libmbim-devel/2013-December/000079.html + + src/mm-sms-mbim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 496f298832a8269204e11662d20d3feaebba0739 +Author: Ben Chan +Date: Thu Jan 2 16:00:44 2014 -0800 + + altair-lte: remove unnecessary MM_BASE_MODEM() casts + + plugins/altair/mm-broadband-bearer-altair-lte.c | 12 +++--------- + plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++-- + 2 files changed, 5 insertions(+), 11 deletions(-) + +commit dac652321bd59a2d1d9b992f4a436de1e129ab3f +Author: Ben Chan +Date: Thu Jan 2 16:00:43 2014 -0800 + + altair-lte: refactor code for handling 'data' in + DetailedConnectContext + + plugins/altair/mm-broadband-bearer-altair-lte.c | 40 + ++++++++++++------------- + 1 file changed, 19 insertions(+), 21 deletions(-) + +commit cddc4af7bd18b93214ac270295b6410db1e0749f +Author: Ben Chan +Date: Thu Jan 2 15:56:33 2014 -0800 + + huawei: report an error when ^PREFMODE reports no valid values + + This patch fixes mm_huawei_parse_prefmode_test to always report an + error when + returning NULL, which avoid a potential crash when the caller tries + to access + the error. + + plugins/huawei/mm-modem-helpers-huawei.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 52d34ce0dbe375de646fd6ae25d2d8197d24dd32 +Author: Aleksander Morgado +Date: Thu Dec 19 12:55:51 2013 +0100 + + bearer-mbim: parse replies on failure + + Based on a patch from: Bjørn Mork + + Some messages provide an additional NwError cause code from + the network in case of failure. This means that we need to + parse the reply even if the status indicates failure, to be + able to return the exact failure cause. + + src/mm-bearer-mbim.c | 146 + ++++++++++++++++++++++++++++++++------------------- + 1 file changed, 91 insertions(+), 55 deletions(-) + +commit ab12d17bfb508e85c6b983b5d0ec8c915bd67a86 +Author: Ben Chan +Date: Mon Dec 16 16:17:38 2013 -0800 + + iface-modem: fix crash in + wait_for_final_state_context_complete_and_free + + When wait_for_final_state_context_complete_and_free is invoked, + if the callback + associated with the GSimpleAsyncResult object of the + WaitForFinalStateContext + object updates the modem state via mm_iface_modem_update_state, + state_changed + is invoked, which causes + wait_for_final_state_context_complete_and_free to be + invoked again on the same WaitForFinalStateContext object. That + leads to the + following crash, which is observed sometimes when a modem is being + disabled. + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7fcb7728f202 [libgobject-2.0.so.0.3400.3] - gobject.c:2916 + g_object_unref + 0x7fcb7743205c [ModemManager] - + mm-broadband-modem.c:8034 disabling_context_complete_and_free + 0x7fcb77434d64 [ModemManager] - + mm-broadband-modem.c:8130 disabling_wait_for_final_state_ready + 0x7fcb770c0b86 [libgio-2.0.so.0.3400.3] - + gsimpleasyncresult.c:775 g_simple_async_result_complete + 0x7fcb7740cdbc [ModemManager] - mm-iface-modem.c:101] + wait_for_final_state_context_complete_and_free + 0x7fcb7740ce19 [ModemManager] - mm-iface-modem.c:128] + state_changed_wait_expired + 0x7fcb76f78c33 [libglib-2.0.so.0.3400.3] - gmain.c:4026] + g_timeout_dispatch + 0x7fcb76f78087 [libglib-2.0.so.0.3400.3] - gmain.c:2715] + g_main_context_dispatch + 0x7fcb76f78437 [libglib-2.0.so.0.3400.3] - gmain.c:3290] + g_main_context_iterate + 0x7fcb76f78891 [libglib-2.0.so.0.3400.3] - gmain.c:3484] + g_main_loop_run + 0x7fcb773f4d55 [ModemManager] - main.c:142] + main + 0x7fcb7698a9c6 [libc-2.15.so] - libc-start.c:234] + __libc_start_main + 0x7fcb773f48b8 [ModemManager] + 0x000218b8] + + src/mm-iface-modem.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 004924b0385a503520f26e499444f8c8c42616a6 +Author: Aleksander Morgado +Date: Mon Dec 16 12:30:13 2013 +0100 + + broadband-modem-qmi: fix segfault when using AT-fallback mode for + messaging + + The default broadband modem implementation doesn't have a method + to disable + unsolicited messages for SMS. + + src/mm-broadband-modem-qmi.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit 5b078edc214653cf28e172230e50eab1f647bbbd +Author: Aleksander Morgado +Date: Tue Dec 10 14:27:35 2013 +0100 + + release: bump version to 1.1.900 (1.2-rc1) + + Also bump soname of libmm-glib, as the interface has grown since + the last tag. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 5aa2f11535b1d650111963af0a195103e45af604 +Author: Ben Chan +Date: Mon Dec 9 15:07:27 2013 -0800 + + sim-mbim: prevent potential leak when loading SIM idenitifier and IMSI + + This patch addresses a potential memory leak when load_sim_identifier + or + load_imsi in MMSimMbim is called but the caller does not provide a + GAsyncReadyCallback. + + src/mm-sim-mbim.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4c213d460e446e69eb3265de3042e9e1582f1fd0 +Author: Ben Chan +Date: Mon Dec 9 15:07:26 2013 -0800 + + broadband-modem-mbim: prevent potential leak when scanning networks + + This patch addresses a potential memory leak when scan_networks in + MMBroadbandModemMbim is called but the caller does not provide a + GAsyncReadyCallback. + + Reported by Aleksander Morgado + + src/mm-broadband-modem-mbim.c | 38 +++++++++++++++++++------------------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +commit ebadb6786a4a398c0110c8e794922427081f10ee +Author: Ben Chan +Date: Mon Dec 9 15:07:25 2013 -0800 + + sim-mbim: prevent potential leak when loading operator idenitifier + and name + + This patch addresses a potential memory leak when + load_operator_identifier or load_operator_name in MMSimMbim is called + but the caller does not provide a GAsyncReadyCallback. + + Reported by Aleksander Morgado + + src/mm-sim-mbim.c | 26 ++++++++++++++++---------- + 1 file changed, 16 insertions(+), 10 deletions(-) + +commit fc42b2df8c0c68425f79dae17f6fac988f69f6f5 +Author: Aleksander Morgado +Date: Mon Nov 11 01:12:21 2013 +0100 + + huawei: handle empty response to AT^SYSCFG=? + + Some Huawei modems (e.g. E220) may give an empty response for + AT^SYSCFG=?, even + if they do support the command. Handle this case by prividing a + default fallback + format string when this happens. + + plugins/huawei/mm-broadband-modem-huawei.c | 15 ++++++++-- + plugins/huawei/mm-modem-helpers-huawei.h | 4 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 35 + ++++++++++++++++++++++++ + 3 files changed, 52 insertions(+), 2 deletions(-) + +commit e81fdd07c3e8ef824b13e157d4c50213786d9973 +Author: Aleksander Morgado +Date: Mon Nov 11 00:55:15 2013 +0100 + + huawei: new current mode setting based on the supported combinations + + plugins/huawei/mm-broadband-modem-huawei.c | 262 + +++++++++++++++++------------ + 1 file changed, 151 insertions(+), 111 deletions(-) + +commit c337f52e30125d4c7e5a607b2bb71ccd92b07784 +Author: Aleksander Morgado +Date: Sun Nov 10 22:07:03 2013 +0100 + + huawei: new current mode loading based on the supported combinations + + plugins/huawei/mm-broadband-modem-huawei.c | 347 + ++++++++++++++++------------- + 1 file changed, 194 insertions(+), 153 deletions(-) + +commit 02839b2e4468afcd96e1259e60f5f4665057581a +Author: Aleksander Morgado +Date: Sun Nov 10 21:28:17 2013 +0100 + + huawei: new ^SYSCFGEX? response parser + + plugins/huawei/mm-modem-helpers-huawei.c | 71 ++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 7 ++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 138 + +++++++++++++++++++++++ + 3 files changed, 216 insertions(+) + +commit 9ac136028b710f6b65c7fa2b61a535afb3b0b192 +Author: Aleksander Morgado +Date: Sun Nov 10 21:24:42 2013 +0100 + + huawei: new ^SYSCFG? response parser + + plugins/huawei/mm-modem-helpers-huawei.c | 66 + +++++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 7 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 69 + ++++++++++++++++++++++++ + 3 files changed, 142 insertions(+) + +commit 4e5c35a69fd8e9aab7c7b2b3f7d14298487c2de6 +Author: Aleksander Morgado +Date: Sun Nov 10 21:14:00 2013 +0100 + + huawei: new ^PREFMODE? response parser + + plugins/huawei/mm-modem-helpers-huawei.c | 46 +++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 7 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 56 + ++++++++++++++++++++++++ + 3 files changed, 109 insertions(+) + +commit 8cc3eff661ea8cfa61c2c7d5960e82d0c411e8e1 +Author: Aleksander Morgado +Date: Fri Nov 8 21:15:53 2013 +0100 + + huawei: load supported modes, not just assume them + + plugins/huawei/mm-broadband-modem-huawei.c | 249 + +++++++++++++++++++++++------ + 1 file changed, 201 insertions(+), 48 deletions(-) + +commit ef526395df7ed2688db5e1a3e3536153e09f0677 +Author: Aleksander Morgado +Date: Fri Nov 8 20:02:24 2013 +0100 + + huawei: consolidate command support checks + + plugins/huawei/mm-broadband-modem-huawei.c | 77 + +++++++++++++----------------- + 1 file changed, 33 insertions(+), 44 deletions(-) + +commit 47640a65078cc796c638a7c70ff5951ab240fd6d +Author: Aleksander Morgado +Date: Fri Nov 8 00:06:07 2013 +0100 + + huawei: new ^SYSCFGEX=? test parser + + plugins/huawei/mm-modem-helpers-huawei.c | 180 + ++++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 12 ++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 185 + +++++++++++++++++++++++ + 3 files changed, 377 insertions(+) + +commit 677dd7da91b001a5eeb53f2e1b54b7935b764a66 +Author: Aleksander Morgado +Date: Thu Nov 7 23:30:53 2013 +0100 + + huawei: new ^SYSCFG=? test parser + + plugins/huawei/mm-modem-helpers-huawei.c | 299 + +++++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 13 + + plugins/huawei/tests/test-modem-helpers-huawei.c | 150 ++++++++++++ + 3 files changed, 462 insertions(+) + +commit ceb578a824c60310c64d7a972afb12282fd7af35 +Author: Aleksander Morgado +Date: Sun Nov 3 19:16:20 2013 +0100 + + huawei: new ^PREFMODE=? test parser + + plugins/huawei/mm-modem-helpers-huawei.c | 119 + +++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 12 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 125 + +++++++++++++++++++++++ + 3 files changed, 256 insertions(+) + +commit 0dcf609dcc49c3f6831184133c933c924ff5e397 +Author: Aleksander Morgado +Date: Sun Nov 3 19:13:48 2013 +0100 + + huawei,tests: enable log traces in the tests + + plugins/Makefile.am | 4 +++- + plugins/huawei/mm-modem-helpers-huawei.h | 3 +++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 25 + ++++++++++++++++++++++++ + 3 files changed, 31 insertions(+), 1 deletion(-) + +commit a1ffe805affb058e49692b6e473d296a72a39f1b +Author: Dan Williams +Date: Mon Dec 9 11:15:15 2013 -0600 + + broadband-modem-huawei: fix CDMA unsolicited response parsing + + On at least the EC168C, various unsolicited responses like RSSILVL, + HRSSILVL, and MODE can include an extra Carriage Return: + + ^MODE: 2 + ^RSSILVL:60 + + plugins/huawei/mm-broadband-modem-huawei.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f721c650d2b37dc91301ed41e3ed10f28c8acd10 +Author: Bjørn Mork +Date: Thu Dec 5 12:43:20 2013 +0100 + + qcdm: add utility to display and set the "IPv6 enabled" variable + + Signed-off-by: Bjørn Mork + + .gitignore | 1 + + libqcdm/tests/Makefile.am | 8 +- + libqcdm/tests/ipv6pref.c | 316 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 324 insertions(+), 1 deletion(-) + +commit fa0fa1c647a10e229b61477e2768fd8b12c1924c +Author: Bjørn Mork +Date: Thu Dec 5 12:43:19 2013 +0100 + + qcdm: add IPv6 nvram setting to test suite + + Signed-off-by: Bjørn Mork + + libqcdm/tests/test-qcdm-com.c | 55 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 3 files changed, 58 insertions(+) + +commit 13552aa8b67058caa5a183238f2cfe73737f26c2 +Author: Bjørn Mork +Date: Thu Dec 5 12:43:18 2013 +0100 + + qcdm: add IPv6 nvram setting + + Some Qualcomm firmwares disable IPv6 unless this flag is set in + nvram, at + least for the LTE default bearer. The firmware will happily let you + configure the IPV6 and IPV4V6 PDP types, also including the default + profile, but any attempt to connect will fail. + + Signed-off-by: Bjørn Mork + + libqcdm/src/commands.c | 88 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 23 +++++++++++++ + libqcdm/src/nv-items.h | 13 ++++++++ + 3 files changed, 124 insertions(+) + +commit 073163fb0b7fd1408029d986b7052638d357f69c +Author: Ben Chan +Date: Wed Dec 4 23:44:15 2013 -0800 + + core: fix some typos in comments + + src/mm-broadband-modem.c | 4 ++-- + src/mm-iface-modem.c | 4 ++-- + src/mm-serial-port.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 9a72f90cf7d36092be4fdb8fed35ac8146a97cc3 +Author: Ben Chan +Date: Wed Dec 4 13:19:26 2013 -0800 + + cli: fix source tag of GSimpleAsyncResult objects + + cli/mmcli-common.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 2db3df9d934acf01e93b11b6bcb1fc5a34f7b25a +Author: Ben Chan +Date: Wed Dec 4 11:07:42 2013 -0800 + + broadband-modem-mbim: implement network scan + + src/mm-broadband-modem-mbim.c | 81 + ++++++++++++++++++++++++++++++++++++++++--- + src/mm-modem-helpers-mbim.c | 48 +++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.h | 4 +++ + 3 files changed, 129 insertions(+), 4 deletions(-) + +commit 891f55f25c86e8bc35dd02b4254891508d4becba +Author: Ben Chan +Date: Tue Dec 3 23:38:51 2013 -0800 + + broadband-modem-mbim: fix source tag of GSimpleAsyncResult objects + + src/mm-broadband-modem-mbim.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 1e8baaf7a2927a95945333eda97744bf7f04aa95 +Author: Ben Chan +Date: Sat Nov 30 13:19:34 2013 -0800 + + sim-mbim: implement operator identifier and name loading + + src/mm-sim-mbim.c | 138 + +++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 132 insertions(+), 6 deletions(-) + +commit 1b34fe6c514e319bfac66e1edb89798c7c411979 +Author: Dan Williams +Date: Sun Dec 1 14:15:13 2013 -0600 + + broadband-bearer-qmi: ensure errors are cleared before re-using them + + If the bearer doesn't have one of IPv4 or IPv6 configuration, then the + qmi_message_wds_get_current_settings_output_get_ip*_address() + functions + will return FALSE with a filled error, which was not cleared. + + This fixes a glib warning message about overwriting an already-filled + GError. + + src/mm-bearer-qmi.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit c30a8f67eff3afe5565e7e2134f56841802556fb +Author: Aleksander Morgado +Date: Fri Nov 22 14:57:39 2013 +0100 + + base-modem: also release cdc-wdm ports + + src/mm-base-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 6d251daf4716c34587bf11826b7f798c54fda5ff +Author: Ben Chan +Date: Thu Nov 21 22:24:50 2013 -0800 + + cli: print 'Bearers' property in Modem interface + + cli/mmcli-modem.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit e4382212586447f63004db0fdd7df78243da582a +Author: Ben Chan +Date: Thu Nov 21 22:24:49 2013 -0800 + + libmm-glib: add methods to retrieve 'Bearers' property in Modem + interface + + docs/reference/libmm-glib/libmm-glib-sections.txt | 2 ++ + libmm-glib/mm-modem.c | 39 + +++++++++++++++++++++++ + libmm-glib/mm-modem.h | 3 ++ + 3 files changed, 44 insertions(+) + +commit a787d1bbb8460e577f1f32bda84f6c1b7420274e +Author: Aleksander Morgado +Date: Thu Nov 21 12:46:05 2013 +0100 + + docs,libmm-glib: add missing methods for the new properties + + docs/reference/libmm-glib/libmm-glib-sections.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f7546ad82456afcd0bb176586d26c8bd7cec60cc +Author: Aleksander Morgado +Date: Fri Nov 15 19:33:04 2013 +0100 + + introspection,api: new 'Messages' property in the Messaging interface + + https://bugzilla.gnome.org/show_bug.cgi?id=712276 + + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 7 +++ + libmm-glib/mm-modem-messaging.c | 50 + ++++++---------------- + src/mm-iface-modem-messaging.c | 13 ++++++ + src/mm-sms-list.c | 3 ++ + 4 files changed, 37 insertions(+), 36 deletions(-) + +commit 7f442b777c6fe7fd71f4f9022121752dabad5cdd +Author: Aleksander Morgado +Date: Fri Nov 15 19:06:58 2013 +0100 + + introspection,api: new 'Bearers' property in the Modem interface + + https://bugzilla.gnome.org/show_bug.cgi?id=712276 + + .../org.freedesktop.ModemManager1.Modem.xml | 8 ++++ + libmm-glib/mm-modem.c | 52 + +++++++--------------- + src/mm-bearer-list.c | 27 +++++++++-- + src/mm-bearer-list.h | 1 + + src/mm-iface-modem.c | 27 +++++++++++ + 5 files changed, 75 insertions(+), 40 deletions(-) + +commit c21709b32e1af46f1764888a03b21fd747db7da1 +Author: Thieu Le +Date: Tue Nov 19 13:06:19 2013 -0800 + + altair-lte: add SIMREFRESH support + + Register for SIMREFRESH event and reload own numbers and reregister + modem with network when this happens. + + plugins/altair/mm-broadband-modem-altair-lte.c | 189 + ++++++++++++++++++++++--- + src/mm-iface-modem.c | 15 ++ + src/mm-iface-modem.h | 4 + + 3 files changed, 191 insertions(+), 17 deletions(-) + +commit 5e7fee1d116f69fbee0b984e11c39f1f9c5277f3 +Author: Aleksander Morgado +Date: Wed Nov 20 15:07:45 2013 +0100 + + build: use 'g_cclosure_marshal_generic' by default + + Avoid custom marshalers, and just use libffi-based + 'g_cclosure_marshal_generic'. + + src/Makefile.am | 18 +----------------- + src/mm-marshal.list | 3 --- + src/mm-plugin.c | 1 - + src/mm-serial-port.c | 26 +++++++++++++------------- + src/mm-sim.c | 3 +-- + src/mm-sms-list.c | 5 ++--- + 6 files changed, 17 insertions(+), 39 deletions(-) + +commit fe744b4534a3190112e8dbd0f0131ebcf34f3643 +Author: Aleksander Morgado +Date: Tue Nov 19 23:59:38 2013 +0100 + + base-modem: fix port validity checks + + src/mm-base-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 974408760c548b25fbf6972da13c49756d7ecb0e +Author: Aleksander Morgado +Date: Fri Nov 15 19:14:13 2013 +0100 + + introspection,api: fix Messaging documentation + + We don't have a Completed signal. + + introspection/org.freedesktop.ModemManager1.Modem.Messaging.xml | + 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit 85d5d968248b54fbcbc145cc05a4690bd865a782 +Author: Aleksander Morgado +Date: Fri Nov 15 17:25:33 2013 +0100 + + port: remove 'carrier-detect' property + + It is no longer used since commit 736aa0d2d. + + plugins/samsung/mm-broadband-modem-samsung.c | 1 - + plugins/sierra/mm-common-sierra.c | 4 ---- + plugins/zte/mm-broadband-modem-zte-icera.c | 16 ---------------- + plugins/zte/mm-broadband-modem-zte.c | 16 ---------------- + src/mm-port-probe.c | 1 - + src/mm-port.c | 25 + ------------------------- + src/mm-port.h | 11 ++++------- + 7 files changed, 4 insertions(+), 70 deletions(-) + +commit 3d4c143b40285b1ce6d5d0b502ddea50245a6ae5 +Author: Prathmesh Prabhu +Date: Thu Nov 7 13:08:37 2013 -0800 + + altair-lte: early fail connect/disconnect attempts when out of + coverage + + A firmware bug in Altair ALT3100 bricks the modem when + - The modem is out of coverage (Registration state is unknown + (CEREG: 4)) + - A disconnect attempt is made using the AT%DPDNACT command. + + This patch prevents this situation by failing the connect/disconnect + attempts in + the altair plugin when registration state is unknown, without + attempting to + connect/disconnect the modem. + + plugins/altair/mm-broadband-bearer-altair-lte.c | 41 + +++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 3 deletions(-) + +commit 3c6428fa588cbd9f81f30de259af20d3825b0320 +Author: Prathmesh Prabhu +Date: Wed Oct 30 15:57:03 2013 -0700 + + bearer: notify final disconnect status using + mm_bearer_report_connection_status + + Some MMBearer methods to disconnect the bearer assume that the + bearer is + disconnected even if the operation fails in a subclass. This leaves + MMBearer + and MMBroadbandBearer states out of sync. + + This patch notifies the bearer object of the final disconnection using + mm_bearer_report_connection_status. This gives the subclasses a + chance to update + their state even when the disconnection attempt fails. + + src/mm-bearer.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit 1b3114a0f9ca28273e1446535b73d5b83c54c6cf +Author: Aleksander Morgado +Date: Fri Nov 1 15:44:18 2013 +0100 + + modem-helpers: handle +CGDCONT=? replies with single context + + https://bugzilla.gnome.org/show_bug.cgi?id=708983 + + src/mm-modem-helpers.c | 21 ++++++++++----------- + src/tests/test-modem-helpers.c | 15 +++++++++++++++ + 2 files changed, 25 insertions(+), 11 deletions(-) + +commit 04b52d590f9c47316e8eca9eeccb8084991f2f55 +Author: Aleksander Morgado +Date: Fri Nov 1 15:43:44 2013 +0100 + + tests: enable logging if 'ENABLE_TEST_MESSAGE_TRACES' is defined + + src/tests/test-at-serial-port.c | 10 ++++++++++ + src/tests/test-modem-helpers.c | 10 ++++++++++ + src/tests/test-qcdm-serial-port.c | 10 ++++++++++ + 3 files changed, 30 insertions(+) + +commit deaeeec3678f0996a58fae8be1e365e463ee9400 +Author: Aleksander Morgado +Date: Fri Oct 18 08:55:09 2013 +0200 + + x22x: handle QMI modems + + With some bits and pieces developed by Dan Williams + + https://bugzilla.gnome.org/show_bug.cgi?id=710439 + + plugins/x22x/mm-plugin-x22x.c | 58 + ++++++++++++++++++++++++++++--------------- + 1 file changed, 38 insertions(+), 20 deletions(-) + +commit fcc2b1be2c36f4d866cd8a13b39df1c8931c067a +Author: Aleksander Morgado +Date: Thu Oct 31 11:31:00 2013 +0100 + + altair-lte: fix LDFLAGS in the helper tests + + plugins/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e9523a6abdead8669e21a1190209d962ab1cbf7d +Author: Aleksander Morgado +Date: Wed Oct 30 20:18:11 2013 +0100 + + huawei: clear only once the timeout to wait for the first interface + + As soon as we get a match between the current interface being probed, + and the + first expected interface to probe, clear the timeout. But this + doesn't mean that + this interface being probed will be the correct one, so it may be + the case that + we end up expecting a new first interface and probing another one. + + With an example probably seen better... + + Modem appears with interfaces 2, 3 and 4. + + 1. We first try to look for interface 0, which is not in the set: + 1.1. Probing interfaces 2, 3 and 4 get deferred. + + 2. First-interface timeout happens because interface 0 doesn't appear, + so we + switch to wait for interface 1: + 2.1 Probing interfaces 2, 3 and 4 get deferred. + + 3. First-interface timeout happens because interface 1 doesn't appear, + so we + switch to wait for interface 2: + 3.1. We get a match on interface 2, which exists. We now remove the + first-interface timeout and start running the init sequence + there. + 3.2. Probing interfaces 3 and 4 get deferred. + + 4. Init sequence in interface 2 fails, because it is not an AT port, + so we + switch to wait for interface 3: + 3.1. We get a match on interface 3, which exists. We do *not* + need to remove + now the first-interface timeout because this interface we are + testing is + actually the second one which we tried. + + So, just check whether the timeout exists or not, and if it exists + remove it. + Yeah, this commit just fixes a warning at the end. + + plugins/huawei/mm-plugin-huawei.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 6a26ad7b530b112e694c406316934429039c7fb2 +Author: Aleksander Morgado +Date: Wed Oct 30 16:10:58 2013 +0100 + + blacklist: include the whole Openmoko VID + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit b09044bcb3153e17e7b75ef1a22402027e3f4d8f +Author: Aleksander Morgado +Date: Mon Oct 28 18:13:14 2013 +0100 + + plugin: for non-AT ports, don't expect vendor/product string probing + + When running the pre-probing VID/PID filters, the ports were not + filtered out if + the plugin had configured post-probing vendor/product string + filters. But, these + post-probing filters are only applicable to AT ports. + + From now on, this logic will not be applied to non-serial ports. In + other words, + pre-probing VID/PID filters applied to non-serial ports will always + result in + the port being filtered out or being allowed, regardless of any + additional + vendor/product string post-probing filter configured by the plugin. + + https://bugzilla.gnome.org/show_bug.cgi?id=710437 + + src/mm-plugin.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 9c2be510f6324b288d45f4d424c15ec5f865b5f3 +Author: Aleksander Morgado +Date: Mon Oct 28 17:57:43 2013 +0100 + + build: ignore built translation files + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit c65c01703b7465229320b9eca29b3f57249c9cff +Author: Aleksander Morgado +Date: Mon Oct 28 17:51:02 2013 +0100 + + mtk: fix GOTO tag in udev rules + + plugins/mtk/77-mm-mtk-port-types.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 51b4ab44f16844236916584939799707b9cf1a1d +Author: Yuri Chornoivan +Date: Sat Oct 19 18:24:15 2013 +0300 + + po: add Ukrainian translation (bgo #710513) + + po/LINGUAS | 1 + + po/uk.po | 98 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 99 insertions(+) + +commit c431fb8208e1b6299b06ad8ebbff094c6f6f3740 +Author: Dan Williams +Date: Fri Oct 25 16:25:14 2013 -0500 + + blacklist/greylist: add more GPS devices (rh #1023234) + + Attempt to blacklist entire drivers that we know aren't modems, + and add a sprinkling of specific devices too. + + src/77-mm-usb-device-blacklist.rules | 16 ++++++++++++++++ + src/77-mm-usb-serial-adapters-greylist.rules | 1 + + 2 files changed, 17 insertions(+) + +commit adc7df200ff5f3c8f9fb62bda8f48be7f403d3ff +Author: Aleksander Morgado +Date: Fri Oct 25 11:55:59 2013 +0200 + + sms-part-cdma,test: new tests for Latin and Unicode encodings + + src/tests/test-sms-part-cdma.c | 158 + ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 156 insertions(+), 2 deletions(-) + +commit c669464eec28cfb390dbb00ae62a3f68ff21334a +Author: Aleksander Morgado +Date: Fri Oct 25 11:17:47 2013 +0200 + + sms-part-cdma: fix log message + + src/mm-sms-part-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 364df3106ad068175b423d6dbbd478f49b5cb788 +Author: Aleksander Morgado +Date: Fri Oct 25 10:55:03 2013 +0200 + + sms-part-cdma: improve logging when creating PDUs + + src/mm-sms-part-cdma.c | 86 + ++++++++++++++++++++++++++++---------------------- + 1 file changed, 48 insertions(+), 38 deletions(-) + +commit 80f55923ed9a7e3dcdaa35d8c31b6ae94d27d8b4 +Author: Aleksander Morgado +Date: Fri Oct 25 10:35:21 2013 +0200 + + sms-part-cdma: support parsing SMS with Unicode encoding + + src/mm-sms-part-cdma.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +commit 66f134b7bd0f5114630faafdf9083936cf143c9d +Author: Aleksander Morgado +Date: Fri Oct 25 10:34:31 2013 +0200 + + sms-part-cdma: support generating SMS with Latin or Unicode encodings + + src/mm-sms-part-cdma.c | 115 + +++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 92 insertions(+), 23 deletions(-) + +commit 3174b7b73fe2cfb08e39fd95c34195d1e25d1d08 +Author: Aleksander Morgado +Date: Thu Oct 24 09:50:09 2013 +0200 + + sms-part-cdma: support receiving SMS with Latin encoding + + src/mm-sms-part-cdma.c | 26 ++++++++++++++++++++++++ + src/tests/test-sms-part-cdma.c | 46 + ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 72 insertions(+) + +commit 57882f6dad82e605fbe39fe292145939811fe64d +Author: Aleksander Morgado +Date: Thu Oct 24 09:19:43 2013 +0200 + + sms: decide whether to create a 3GPP2 or 3GPP SMS based on caps + + Don't rely on receiving a Teleservice ID. If none received, and the + modem is + CDMA-only, default to WMT. + + src/mm-sms.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +commit 43694e26772ba9c9716e95e1c3607980e4ab5c12 +Author: Aleksander Morgado +Date: Tue Aug 20 20:39:04 2013 +0200 + + sms: unknown delivery state in newly created SMS objects + + src/mm-sms.c | 1 + + 1 file changed, 1 insertion(+) + +commit 0341c1663c555149a8c2cdff9bb0d76fe600a3fb +Author: Aleksander Morgado +Date: Tue Aug 20 20:32:57 2013 +0200 + + sms: handle CDMA SMS when creating new ones from MMSmsProperties + + src/mm-sms.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 86795b928e0cc7945c88103a79d5cf7353319d8f +Author: Aleksander Morgado +Date: Tue Aug 20 20:17:53 2013 +0200 + + libmm-glib: allow new 'teleservice-id' and 'service-category' + keywords in MMSmsProperties + + docs/reference/libmm-glib/libmm-glib-sections.txt | 4 + + libmm-glib/mm-common-helpers.c | 44 ++++++++ + libmm-glib/mm-common-helpers.h | 4 + + libmm-glib/mm-sms-properties.c | 120 + +++++++++++++++++++++- + libmm-glib/mm-sms-properties.h | 6 ++ + 5 files changed, 176 insertions(+), 2 deletions(-) + +commit 663017a3d20f3beeff12bd5b56f730c6b43eee32 +Author: Aleksander Morgado +Date: Tue Aug 20 19:56:05 2013 +0200 + + sms: clear generated parts when storing/sending fails + + src/mm-sms.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit bd05787b51ba1806850a365bc7d08088a2109c2a +Author: Aleksander Morgado +Date: Tue Aug 20 19:50:49 2013 +0200 + + sms-qmi: check whether the modem supports the specific SMS type + + src/mm-sms-qmi.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 49 insertions(+), 2 deletions(-) + +commit b728b14efb2ad96bb8501a021969f6155bed9ea3 +Author: Aleksander Morgado +Date: Tue Aug 20 19:38:37 2013 +0200 + + sms: only set concat reference on multipart messages + + src/mm-sms.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +commit 9ed42af5373839c1c0031014d7050258f848070e +Author: Aleksander Morgado +Date: Tue Aug 20 19:37:03 2013 +0200 + + sms: handle CDMA SMS part creation + + src/mm-sms.c | 68 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 66 insertions(+), 2 deletions(-) + +commit 5267cf6f4a4eace00c216d733a92f6ecae55e8cc +Author: Aleksander Morgado +Date: Tue Aug 20 18:50:30 2013 +0200 + + cli,sms: print properties just when they are available + + The logic to decide whether a property is valid in a given PDU type + is kind of + fuzzy for 3GPP2 as it is currently implemented; so just print whatever + we have + in the interface. + + cli/mmcli-sms.c | 50 +++++++++++++++++++++++--------------------------- + 1 file changed, 23 insertions(+), 27 deletions(-) + +commit 7a56b143aa5dc4d4fe8794d4f70dd6945f628b87 +Author: Aleksander Morgado +Date: Mon Aug 19 18:44:02 2013 +0200 + + sms-qmi: handle CDMA SMS messages + + src/mm-sms-part.h | 8 ++++++ + src/mm-sms-qmi.c | 77 + ++++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 73 insertions(+), 12 deletions(-) + +commit 2eb5e0d578adbb6c630d88f8d55a4eae0c887cdd +Author: Aleksander Morgado +Date: Mon Aug 19 18:27:19 2013 +0200 + + sms-part-cdma: new CDMA SMS creator + + Currently very limited: + * Only WMT teleservice. + * Only DMTF-encoded numbers. + * Only either raw binary data or ASCII-7 text. + + src/mm-sms-part-cdma.c | 370 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-part-cdma.h | 4 + + src/tests/test-sms-part-cdma.c | 99 +++++++++++ + 3 files changed, 473 insertions(+) + +commit cadbc0412d5dee16cd484b52b14df4f19ae47cf6 +Author: Aleksander Morgado +Date: Mon Aug 19 18:24:55 2013 +0200 + + sms-part-3gpp: ensure PDU type in part is the correct one when + building SUBMIT + + src/mm-sms-part-3gpp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 3a6bdabcdf2da5ddea5ef52df5017c82ff765ef2 +Author: Aleksander Morgado +Date: Mon Aug 19 12:51:43 2013 +0200 + + sms-part-cdma: consolidate logging + + src/mm-sms-part-cdma.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 49ab6ce9807a0a9925e998671df499081a0d47cc +Author: Aleksander Morgado +Date: Mon Aug 19 12:37:43 2013 +0200 + + sms-part-cdma: read 7-bit ASCII text or raw data + + src/mm-sms-part-cdma.c | 44 + +++++++++++++++++++++++++++++++++++++++++- + src/tests/test-sms-part-cdma.c | 17 +++++++++++----- + 2 files changed, 55 insertions(+), 6 deletions(-) + +commit aba7efb6155a15298689211053b47e725b25e66d +Author: Aleksander Morgado +Date: Mon Aug 19 11:58:05 2013 +0200 + + broadband-modem-qmi: add CDMA SMS parts if found + + src/mm-broadband-modem-qmi.c | 49 + ++++++++++++++++++++++---------------------- + 1 file changed, 25 insertions(+), 24 deletions(-) + +commit e493292b7a1a0648d058147aca0022b64538653b +Author: Aleksander Morgado +Date: Mon Jul 22 23:39:11 2013 +0200 + + tests: new CDMA SMS part tester + + .gitignore | 1 + + src/tests/Makefile.am | 27 ++++- + src/tests/test-sms-part-cdma.c | 241 + +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 268 insertions(+), 1 deletion(-) + +commit c440f121cc8625332e5dce63cda054e1ca8ce66f +Author: Aleksander Morgado +Date: Mon Jul 22 23:15:50 2013 +0200 + + tests: rename 3GPP SMS part tester + + .gitignore | 2 +- + src/tests/Makefile.am | 14 ++--- + .../{test-sms-part.c => test-sms-part-3gpp.c} | 66 + +++++++++++----------- + 3 files changed, 41 insertions(+), 41 deletions(-) + +commit 5ecdae8dc807c95ffeca7266288c0ee0ce6398a6 +Author: Aleksander Morgado +Date: Mon Jul 22 21:38:56 2013 +0200 + + sms-part-cdma: new CDMA SMS parser + + src/Makefile.am | 4 +- + src/mm-sms-part-cdma.c | 1070 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-part-cdma.h | 33 ++ + 3 files changed, 1106 insertions(+), 1 deletion(-) + +commit 7db17b64a3f7263f91c2f7e7625f3ba8a1d9a4b4 +Author: Aleksander Morgado +Date: Mon Jul 22 20:00:15 2013 +0200 + + sms-part: handle CDMA teleservice ID and service category + + src/mm-sms-part.c | 11 +++++++++++ + src/mm-sms-part.h | 8 ++++++++ + src/mm-sms.c | 4 ++-- + 3 files changed, 21 insertions(+), 2 deletions(-) + +commit df986c076dec33128c2ba202062ce4338cef3ad2 +Author: Aleksander Morgado +Date: Thu Jul 18 14:45:58 2013 +0200 + + sms: split SMS part handling into common and 3GPP-specific + + src/Makefile.am | 6 +- + src/mm-broadband-modem-mbim.c | 9 +- + src/mm-broadband-modem-qmi.c | 9 +- + src/mm-broadband-modem.c | 11 +- + src/mm-sms-mbim.c | 3 +- + src/mm-sms-part-3gpp.c | 1160 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-part-3gpp.h | 54 ++ + src/mm-sms-part.c | 1124 + --------------------------------------- + src/mm-sms-part.h | 25 - + src/mm-sms-qmi.c | 5 +- + src/mm-sms.c | 7 +- + src/tests/test-sms-part.c | 20 +- + 12 files changed, 1252 insertions(+), 1181 deletions(-) + +commit e90ff4155c63735581d0a213fdf3ae53c02bfc26 +Author: Aleksander Morgado +Date: Tue Jul 23 14:31:00 2013 +0200 + + api,header: added new CDMA-specific 'MMSmsDeliveryState' enumeration + values + + include/ModemManager-enums.h | 131 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 129 insertions(+), 2 deletions(-) + +commit 0bb91ce53dd2d2351f2070d302a35b6f0b8d7c8b +Author: Aleksander Morgado +Date: Thu Jul 18 13:32:16 2013 +0200 + + api: add 'ServiceCategory' property to the SMS interface + + Will be used in 3GPP2 SMS messages. + + cli/mmcli-sms.c | 8 ++- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 ++ + include/ModemManager-enums.h | 82 + ++++++++++++++++++++++ + .../org.freedesktop.ModemManager1.Sms.xml | 9 +++ + libmm-glib/mm-sms.c | 18 +++++ + libmm-glib/mm-sms.h | 2 + + src/mm-sms.c | 2 + + 8 files changed, 126 insertions(+), 3 deletions(-) + +commit d0fb94c49f3c27590bb6134fdca328c6f0a2180f +Author: Aleksander Morgado +Date: Thu Jul 18 13:27:18 2013 +0200 + + api: add 'TeleserviceId' property to the SMS interface + + Will be used in 3GPP2 SMS messages. + + cli/mmcli-sms.c | 10 ++++++++ + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 ++++++ + include/ModemManager-enums.h | 27 + ++++++++++++++++++++++ + .../org.freedesktop.ModemManager1.Sms.xml | 9 ++++++++ + libmm-glib/mm-sms.c | 18 +++++++++++++++ + libmm-glib/mm-sms.h | 2 ++ + src/mm-sms.c | 2 ++ + 8 files changed, 76 insertions(+) + +commit 2864e777ae0232561b23b7bf08fdebb8f26311a4 +Author: Aleksander Morgado +Date: Thu Jul 18 13:23:33 2013 +0200 + + cli,sms: 'class' and 'smsc' are 3GPP specific + + cli/mmcli-sms.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit 13595dcd7f439cfc49cb6d7f165690e22676a805 +Author: Aleksander Morgado +Date: Thu Jul 18 13:15:54 2013 +0200 + + api,introspection: minor indentation fixes in 'Validity' property + definition + + introspection/org.freedesktop.ModemManager1.Sms.xml | 18 + +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 1ebbd16f98cb8f88ab0cf910c3d225de3b427f9f +Author: Aleksander Morgado +Date: Thu Jul 18 13:11:19 2013 +0200 + + api,header: added new CDMA-specific 'MMSmsPduType' enumeration values + + include/ModemManager-enums.h | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +commit c37f94ffd02a6a77151c33bed78b09c1cee0ee5e +Author: Aleksander Morgado +Date: Wed Jul 17 09:46:10 2013 +0200 + + broadband-modem-qmi: SM storage not supported in CDMA-only modems + + src/mm-broadband-modem-qmi.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit cb42a80b1e4d703d8556e59a09504c022dd6e8ee +Author: Aleksander Morgado +Date: Tue Jul 16 13:13:36 2013 +0200 + + broadband-modem-qmi: also request to read 3GPP2 SMS + + src/mm-broadband-modem-qmi.c | 141 + ++++++++++++++++++++++++++++++++----------- + 1 file changed, 106 insertions(+), 35 deletions(-) + +commit 9a9638ef2098e11f3496ad51ed2471df869a1986 +Author: Ben Chan +Date: Thu Oct 24 08:38:16 2013 -0700 + + iface-modem: remove unnecessary G_SIMPLE_ASYNC_RESULT() cast + + This patch removes an unnecessary G_SIMPLE_ASYNC_RESULT() cast of the + 'result' field, which is already of type GSimpleAsyncResult, of + InternalLoadUnlockRequiredContext. + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5dc6db19621ba53c883741edd01b10dd18260f9b +Author: Aleksander Morgado +Date: Thu Oct 24 17:38:36 2013 +0200 + + libmm-glib: fix some more introspection annotations + + libmm-glib/mm-modem-location.c | 2 +- + libmm-glib/mm-modem.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit e1c0621b099d698d2c462f32e4d341207a98d520 +Author: Aleksander Morgado +Date: Thu Oct 24 17:16:33 2013 +0200 + + libmm-glib: fix several introspection annotations + + libmm-glib/mm-bearer.c | 12 ++++++------ + libmm-glib/mm-location-gps-nmea.c | 2 +- + libmm-glib/mm-modem-location.c | 14 +++++++------- + libmm-glib/mm-modem.c | 6 +++--- + libmm-glib/mm-sms.c | 2 +- + libmm-glib/mm-unlock-retries.c | 2 +- + 6 files changed, 19 insertions(+), 19 deletions(-) + +commit babc4aa2594b239aae7287a4f3944b47d5cbe737 +Author: Ben Chan +Date: Thu Oct 24 07:52:10 2013 -0700 + + broadband-modem: remove unnecessary G_SIMPLE_ASYNC_RESULT() casts + + This patch removes unnecessary G_SIMPLE_ASYNC_RESULT() casts of the + 'result' field, which is already of type GSimpleAsyncResult, of + InitializeContext, EnablingContext and DisablingContext. + + src/mm-broadband-modem.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 686caef536f4dee3ddee22bdfc8f3522e68abf7b +Author: Ben Chan +Date: Thu Oct 24 02:30:18 2013 -0700 + + huawei: handle pending network-initiated disconnection in + disconnect_3gpp + + If a client-initiated disconnection attempt is issued while a + network-initiated disconnection is still pending, the latter may + interfere with the former. Also, when the client-initiated + disconnection + attempt fails but the bearer status is reported as 'disconnected', the + pending network-initiated disconnection is not cleared and may result + in an assertion when a connection attempt is issued. + + This patch addresses the issue by clearing any pending + network-initiated + disconnection before proceeding with a client-initiated disconnection. + + plugins/huawei/mm-broadband-bearer-huawei.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 613155cb2e92d858c8a9465be0d5daf80475a24e +Author: Dan Williams +Date: Wed Oct 23 19:39:04 2013 -0500 + + broadband-modem: report signal quality as 0 when no + service/unknown/etc + + Instead of using the NO_NETWORK error, which is only ever read + internally by ModemManager and not very useful when reading quality, + just report signal quality as zero. Before MM 1.0, the signal quality + could be explicitly requested by clients, so the NO_NETWORK error + was of + some use, but now that the quality is updated automatically by MM + and is + a property instead of a D-Bus method call, the error is pointless. + + src/mm-broadband-modem.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +commit f81a3fc0b445de1f2a595b9aed1a8f66fd5dc396 +Author: Prathmesh Prabhu +Date: Fri Oct 18 15:27:59 2013 -0700 + + broadband-modem: mark SIM provisioned by default in + load_subscription_state + + load_subscription_state is called only after a successful + registration, so the + default behaviour should be to mark the SIM as provisioned. + This default behaviour is needed because it is not possible for + plugins to + detect a successful registration state during the registration + update itself. + So, this function is the first place where a plugin can detect + a successful + registration update. + + src/mm-broadband-modem.c | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit 18053540eae1794da9289e8af087d1cb4fa9137c +Author: Ben Chan +Date: Fri Oct 18 02:56:51 2013 -0700 + + huawei: handle unquoted strings in ^SYSINFOEX response + + The original sysinfoex_parse() in MMBroadbandModemHuawei does + not handle + unquoted and fields in ^SYSINFOEX + responses, + which are sen on some Huawei modems (e.g. E303). This patch moves the + ^SYSINFOEX parsing code to mm-modem-helpers-huawei.c, fixes the + regex for + handling unquoted strings in ^SYSINFOEX responses, and adds unit + tests. + + plugins/huawei/mm-broadband-modem-huawei.c | 76 + +++--------------------- + plugins/huawei/mm-modem-helpers-huawei.c | 65 + ++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 10 ++++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 60 ++++++++++++++++++- + 4 files changed, 140 insertions(+), 71 deletions(-) + +commit 49d4163a2b1271edc2a1794c4e86a3f01c19a92c +Author: Ben Chan +Date: Fri Oct 18 02:56:50 2013 -0700 + + huawei: fix ^SYSINFO parsing + + The original sysinfo_parse() in MMBroadbandModemHuawei incorrectly + sets + 'out_sys_submode_valid' to TRUE even when is not present + in a ^SYSINFO response. This patch moves the code to + mm-modem-helpers-huawei.c, fixes the regex for parsing ^SYSINFO + responses, and adds unit tests. + + plugins/huawei/mm-broadband-modem-huawei.c | 82 + +++--------------------- + plugins/huawei/mm-modem-helpers-huawei.c | 67 +++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 11 ++++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 64 ++++++++++++++++++ + 4 files changed, 151 insertions(+), 73 deletions(-) + +commit e529cd32124618d26ef15a7b8d25597a9634531a +Author: Aleksander Morgado +Date: Thu Oct 10 08:34:52 2013 +0200 + + build: ignore plugin testers + + .gitignore | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 09ea458f78f417df0b5e7ff86dafc1b5ab326d5a +Author: Prathmesh Prabhu +Date: Wed Oct 9 10:06:27 2013 -0700 + + altair-lte: obtain subscription state of SIM from registration + failure code + + This patch uses the extended error code after a registration + failure to + determine if the SIM in the relevant modem is associated with a + non-provisioned + account. It uses the standard AT+CEER command, but the implementation + is + restricted to the altair plugin. + + plugins/Makefile.am | 13 ++ + plugins/altair/mm-broadband-modem-altair-lte.c | 134 + ++++++++++++++++++++- + plugins/altair/mm-modem-helpers-altair-lte.c | 68 +++++++++++ + plugins/altair/mm-modem-helpers-altair-lte.h | 26 ++++ + .../altair/tests/test-modem-helpers-altair-lte.c | 75 ++++++++++++ + 5 files changed, 313 insertions(+), 3 deletions(-) + +commit 92a2953e938e7687d8f2a534b38b26647517c99a +Author: Aleksander Morgado +Date: Wed Oct 9 10:06:56 2013 +0200 + + docs: fixed a couple of issues regarding the new + MMModem3gppSubscriptionState enum + + docs/reference/api/ModemManager-sections.txt | 1 + + include/ModemManager-enums.h | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit f9a4f87d5204432b52cb41b31809d43425467da5 +Author: Thieu Le +Date: Mon Oct 7 13:57:27 2013 -0700 + + iface-modem-3gpp: add SubscriptionState property + + cli/mmcli-modem-simple.c | 15 ++- + cli/mmcli-modem.c | 3 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 9 ++ + docs/reference/libmm-glib/libmm-glib.types | 1 + + include/ModemManager-enums.h | 17 +++ + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 9 ++ + libmm-glib/mm-modem-3gpp.c | 19 +++ + libmm-glib/mm-modem-3gpp.h | 1 + + libmm-glib/mm-simple-status.c | 45 +++++++ + libmm-glib/mm-simple-status.h | 2 + + src/mm-broadband-modem.c | 4 +- + src/mm-iface-modem-3gpp.c | 148 + ++++++++++++++++----- + src/mm-iface-modem-3gpp.h | 28 ++-- + 13 files changed, 252 insertions(+), 49 deletions(-) + +commit 564b3610fd6e4060bc36c2cf568b2305aaf6ea19 +Author: Aleksander Morgado +Date: Tue Oct 8 10:15:57 2013 +0200 + + TODO: remove already implemented or no longer applicable items + + TODO | 45 --------------------------------------------- + 1 file changed, 45 deletions(-) + +commit a006761c7159594c6c3fade53eb2326393510a2a +Author: Thieu Le +Date: Fri Sep 27 16:47:25 2013 -0700 + + novatel-lte: abort connect request if call failed + + Change-Id: Iae16ec87e12aaaf314b7e66b2f9c72a13251e352 + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit b5ef861d12c7533d89a18454b03e8e3301164bea +Author: Ben Chan +Date: Thu Sep 26 11:07:16 2013 -0700 + + modem-helpers,sim: auto-detect if ICCID response is character swapped + + This patch modifies mm_3gpp_parse_iccid() to auto-detect if an ICCID + response is character swapped or not by comparsing the major industry + identifier part of the ICCID response to the known value (89) for + telecommunication purposes. This addresses the issue where the same AT + command (e.g. AT^ICCID used by the huawei plugin) does not report + ICCID + in a consistent format. + + plugins/huawei/mm-sim-huawei.c | 3 +-- + plugins/sierra/mm-sim-sierra.c | 3 +-- + src/mm-modem-helpers.c | 19 ++++++++++++++++++- + src/mm-modem-helpers.h | 2 +- + src/mm-sim.c | 3 +-- + src/tests/test-modem-helpers.c | 36 ++++++++++++++++++++++++++++++------ + 6 files changed, 52 insertions(+), 14 deletions(-) + +commit b786ac0debc7aa5e9a6b0f00bd61e15d9daea049 +Author: Ben Chan +Date: Thu Sep 26 00:10:59 2013 -0700 + + serial-port: ensure GCancellable handler is disconnected when serial + port is closed + + src/mm-serial-port.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 2a611c38563db71a1dbd18c8bb56f95a69841c9c +Author: Aleksander Morgado +Date: Wed Sep 25 17:46:31 2013 +0200 + + cinterion: support QMI-based Cinterion PLXX and PHXX modules + + E.g. with a Cinterion PLS8 LTE modem: + + $ sudo mmcli -m 0 + + /org/freedesktop/ModemManager1/Modem/0 (device id + '0042872f6597b3d772a3d9d3cd6f14f152af8a0b') + ------------------------- + Hardware | manufacturer: 'QUALCOMM INCORPORATED' + | model: '0' + | revision: 'M9615A-CETWMAZM-2.0.19015 1 [Jan + 31 2013 00:00:00]' + | supported: 'gsm-umts + | lte + | gsm-umts, lte' + | current: 'gsm-umts, lte' + | equipment id: 'unknown' + ------------------------- + System | device: + '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7' + | drivers: 'option1, qmi_wwan' + | plugin: 'Cinterion' + | primary port: 'cdc-wdm0' + | ports: 'ttyUSB2 (at), cdc-wdm0 (qmi), + wwp0s29u1u7i4 (net)' + ------------------------- + Numbers | own : 'unknown' + ------------------------- + Status | lock: 'sim-pin' + | unlock retries: 'sim-pin (3), sim-pin2 (2), sim-puk + (10), sim-puk2 (10)' + | state: 'locked' + | power state: 'on' + | access tech: 'unknown' + | signal quality: '0' (cached) + ------------------------- + Modes | supported: 'allowed: 2g, 3g, 4g; preferred: none' + | current: 'allowed: 2g, 3g, 4g; preferred: none' + ------------------------- + Bands | supported: 'cdma-bc15-aws, dcs, egsm, u2100, + u1800, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, + eutran-xx' + | current: 'cdma-bc15-aws, dcs, egsm, u2100, + u1800, u900, eutran-i, eutran-iii, eutran-vii, + eutran-viii, eutran-xx' + ------------------------- + IP | supported: 'ipv4, ipv6, ipv4v6' + ------------------------- + SIM | path: '/org/freedesktop/ModemManager1/SIM/0' + + plugins/cinterion/mm-plugin-cinterion.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +commit 0dd93549a175f05cd5290ca8b3a3fd78e59863b5 +Author: Aleksander Morgado +Date: Tue Sep 24 16:50:59 2013 +0200 + + blacklist: add Bluegiga BLE112B + + https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1229748 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 2f7ec3df8ca2176cbe8f8c1513dcbd5a2b1b1d14 +Author: Aleksander Morgado +Date: Tue Sep 24 16:49:13 2013 +0200 + + blacklist: add some missing commas + + src/77-mm-usb-device-blacklist.rules | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6774d93acae0534fa57f43cef2bdf948e651641b +Author: Arun Raghavan +Date: Mon Sep 23 18:53:15 2013 +0530 + + blacklist: Add Adafruit Flora + + The official PID is 8004, but I've seen the device sometimes turn up + with a 0004, so adding both to be safe. + + https://bugzilla.gnome.org/show_bug.cgi?id=708644 + + src/77-mm-usb-device-blacklist.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 21a5aaf4fe6934aad2e6c770aa4bdffa3ad29f9d +Author: Aleksander Morgado +Date: Fri Sep 20 19:29:38 2013 +0200 + + huawei: delay processing of network-initiated disconnection + + Originally developed by: + Prathmesh Prabhu + Ben Chan + + Huawei MU736 prematurely fires a ^NDISSTAT unsolicited message upon a + network-initiated disconnection. The modem can go into a bad state + if a + reconnect attempt happens before the disconnection completes. This + patch works + around the issue by delaying the reporting of the disconnection. + + plugins/huawei/mm-broadband-bearer-huawei.c | 56 + ++++++++++++++++++++++++++++- + plugins/huawei/mm-broadband-modem-huawei.c | 7 ++-- + src/mm-bearer.h | 1 + + 3 files changed, 61 insertions(+), 3 deletions(-) + +commit d818d9fe065b4baac979abf5c45e0d212ccf908d +Author: Aleksander Morgado +Date: Fri Sep 20 19:29:37 2013 +0200 + + bearer: consolidate unsolicited connection status reports + + Originally developed by: + Ben Chan + + This patch replaces mm_bearer_report_disconnection() with a more + generic + mm_bearer_report_connection_status(), which allows reporting any + connection status of a bearer. This further allows getting rid + of those + custom report_connection_status functions in plugic specific bearer + subclasses. + + Note that while plugin-specific implementations can receive multiple + 'MMBearerConnectionStatus' values, the generic implementation is + only allowed + to receive DISCONNECTED. Plugins need to make sure that they process + all the + other status values, and only report DISCONNECTED to the parent + when required. + + MBM: + The MBM bearer implementation of report_connection_status() + expects either + CONNECTED or DISCONNECTED. If any of these is received and there + is an ongoing + connection attempt, the corresponding operation will be + completed. If there is + no connection attempt, we will just handle the DISCONNECTED state, + calling the + parent method to notify that the modem got network-disconnected. + + Icera: + The Icera bearer implementation of report_connection_status() + expects either + CONNECTED, CONNECT FAILED or DISCONNECTED. If any of these is + received and + there is an ongoing connection or disconnection attempt, the + corresponding + operation will be completed. If there is no connection or + disconnection + attempt, we will just handle the CONNECT FAILED and DISCONNECTED + states, + calling the parent method (always with DISCONNECTED) to notify + that the modem + got network-disconnected. + + Option/HSO: + The Option/HSO bearer implementation of report_connection_status() + expects + either CONNECTED, CONNECTION FAILED or DISCONNECTED. If any of + these is + received and there is an ongoing connection or disconnection + attempt, the + corresponding operation will be completed. If there is no + connection or + disconnection attempt, we will just handle the CONNECTION FAILED and + DISCONNECTED states, calling the parent method (always with + DISCONNECTED) to + notify that the modem got network-disconnected. + + Huawei: + The Huawei bearer implementation of report_connection_status() + expects either + CONNECTED or DISCONNECTED. These messages are not used to process + pending + connection or disconnection attempts; so if they are received + while one of + these is on-going, it will just be ignored. CONNECTED reports + are also + ignored, so we will just handle the DISCONNECTED state, calling + the parent + method to notify that the modem got network-disconnected. + + Altair-LTE: + The Altair-LTE bearers will only report DISCONNECTED on + network-disconnected + cases. There is no custom report_connection_status(). + + Novatel-LTE: + The Novatel-LTE bearers will only report DISCONNECTED on + network-disconnected + cases. There is no custom report_connection_status(). + + plugins/altair/mm-broadband-modem-altair-lte.c | 3 +- + plugins/huawei/mm-broadband-bearer-huawei.c | 30 +++-- + plugins/huawei/mm-broadband-bearer-huawei.h | 3 - + plugins/huawei/mm-broadband-modem-huawei.c | 6 +- + plugins/icera/mm-broadband-bearer-icera.c | 154 + ++++++++++------------ + plugins/icera/mm-broadband-bearer-icera.h | 10 -- + plugins/icera/mm-broadband-modem-icera.c | 15 +-- + plugins/mbm/mm-broadband-bearer-mbm.c | 63 +++++---- + plugins/mbm/mm-broadband-bearer-mbm.h | 9 -- + plugins/mbm/mm-broadband-modem-mbm.c | 13 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 2 +- + plugins/option/mm-broadband-bearer-hso.c | 107 +++++++-------- + plugins/option/mm-broadband-bearer-hso.h | 10 -- + plugins/option/mm-broadband-modem-hso.c | 15 +-- + src/mm-bearer-qmi.c | 14 +- + src/mm-bearer.c | 16 ++- + src/mm-bearer.h | 15 ++- + src/mm-broadband-bearer.c | 16 ++- + 18 files changed, 243 insertions(+), 258 deletions(-) + +commit 6b4602a3356e779389ef97bac0b8461e6d26fc41 +Author: Aleksander Morgado +Date: Wed Sep 18 19:56:41 2013 +0200 + + broadband-modem-qmi: make 'internal' errors on pin check retriable + + When we get an internal error while checking the lock status, tell + the upper + layers that we can retry the check. It's been observed that this + internal error + may be issued not only when e.g. there is no SIM, but also when the + SIM is not + yet fully ready. + + src/mm-broadband-modem-qmi.c | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit 13c7319bffe80545a5c7e8399ad6279b8d3cd87d +Author: Aleksander Morgado +Date: Wed Sep 18 19:55:22 2013 +0200 + + iface-modem: consolidate new unlock required check with retries + + The new internal_load_unlock_required() method will take care of + running the + subclassed load_unlock_required(), if available, and also retry the + check up + to 6 times. + + This method will be used both by the standard unlock required check + and by the + check within the current capabilities loading for multimode devices. + + src/mm-iface-modem.c | 231 + ++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 172 insertions(+), 59 deletions(-) + +commit 43d1c904e6f7668143007723d205d923feb620c0 +Author: Lionel Landwerlin +Date: Thu Jul 18 16:30:16 2013 +0100 + + plugins: fix linkage of huawei test program + + https://bugzilla.gnome.org/show_bug.cgi?id=704481 + + plugins/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b3307524323e17af040d74c8d3e5147ef3c3b2ef +Author: Lionel Landwerlin +Date: Thu Jul 18 16:28:56 2013 +0100 + + plugins: add missing linker flags + + https://bugzilla.gnome.org/show_bug.cgi?id=704481 + + plugins/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit 2b2026421507df561fa329b3d480a7d6476221b9 +Author: Ben Chan +Date: Wed Sep 18 01:46:20 2013 -0700 + + huawei: handle disconnection via ^NDISSTAT unsolicited message + + This patch changes MMBroadbandModemHuawei to use ^NDISSTAT unsolicited + messages to handle network-initiated disconnection. As a ^NDISSTAT + unsolicited message is similar to a ^NDISSTATQRY response, the patch + extends the ^NDISSTATQRY parser code to handle both ^NDISSTAT and + ^NDISSTATQRY responses. + + plugins/huawei/mm-broadband-bearer-huawei.c | 20 ++++++ + plugins/huawei/mm-broadband-bearer-huawei.h | 3 + + plugins/huawei/mm-broadband-modem-huawei.c | 83 + +++++++++++++++++++++--- + plugins/huawei/mm-modem-helpers-huawei.c | 18 +++-- + plugins/huawei/mm-modem-helpers-huawei.h | 2 +- + plugins/huawei/tests/test-modem-helpers-huawei.c | 34 +++++++++- + 6 files changed, 143 insertions(+), 17 deletions(-) + +commit aa74ea1aa64470b2b4ec76dbc707f30fc22e3f83 +Author: Ben Chan +Date: Tue Sep 17 14:47:09 2013 -0700 + + iface-modem: fix MODEM_STATE_IS_INTERMEDIATE macro + + src/mm-iface-modem.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 1eee8824fd932f86cfeab40cb830f95d4553bfd3 +Author: Ben Chan +Date: Mon Sep 16 23:07:33 2013 -0700 + + altair-lte: use mm_base_modem_at_command_full{,_finish} correctly + + This patch fixes own_enable_unsolicited_events_ready() to use + mm_base_modem_at_command_full_finish(), instead of + mm_base_modem_at_sequence_full_finish(), as the %STATCM=1 command is + issued via mm_base_modem_at_command_full(). + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9aced8311be0f9f98ac7a81599d0937e8d8aff87 +Author: Ben Chan +Date: Mon Sep 16 15:54:47 2013 -0700 + + huawei: ignore ^CONNECT unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 0755beff07e2ffb7b1c27e5128edc15c80a8654c +Author: Dan Williams +Date: Mon Sep 16 11:52:13 2013 -0500 + + mtk: update udev rules to always match both VID/PID together + + See commit c79d266e627242b22a5e146ab157e34135e7a36a. + + If the rules to tag specific USB interface numbers only apply + on the PID, we'll + end up seeing that if the port has a parent with another PID, + and that other + PID also has a rule, port will get tagged multiple times. + + plugins/mtk/77-mm-mtk-port-types.rules | 36 + +++++++++++++++++----------------- + 1 file changed, 18 insertions(+), 18 deletions(-) + +commit 872bd3e8378411a087553f64edcb0f9c326c6490 +Author: Dan Williams +Date: Mon Sep 16 11:46:17 2013 -0500 + + mtk: add D-Link DWM-156 udev rules + + For HW version A5 and possibly later, which are based on MediaTek + chipsets instead of Qualcomm ones. + + plugins/mtk/77-mm-mtk-port-types.rules | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +commit c22eca999bac9ccb9307970a059da39cdd100122 +Author: Quentin.Li +Date: Mon Sep 16 02:44:06 2013 -0400 + + mtk: add plugin for various MediaTek devices + + Signed-off-by: Quentin.Li + + plugins/Makefile.am | 13 +- + plugins/mtk/77-mm-mtk-port-types.rules | 35 ++ + plugins/mtk/mm-broadband-modem-mtk.c | 1036 + ++++++++++++++++++++++++++++++++ + plugins/mtk/mm-broadband-modem-mtk.h | 51 ++ + plugins/mtk/mm-plugin-mtk.c | 118 ++++ + plugins/mtk/mm-plugin-mtk.h | 42 ++ + 6 files changed, 1294 insertions(+), 1 deletion(-) + +commit 5d8efff2910d448a0df220d8e38efc72875aa730 +Author: Ben Chan +Date: Fri Sep 13 23:14:45 2013 -0700 + + iface-modem: free GError when interface initialization is cancelled + + This patch fixes an assertion failure 'ctx->fatal_error == NULL' in + initialization_context_complete_and_free(), which happens if + 'fatal_error' of the initialization context is set during the modem + interface initialization and the initialization is later cancelled. + + src/mm-iface-modem.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 8a857b7b264204fd193fb83ad783d4316246a9b0 +Author: Ben Chan +Date: Fri Sep 13 00:43:27 2013 -0700 + + broadband-modem: use InProgress instead of WrongState when appropriate + + This patch changes MMBroadbandModem to report an + org.freedesktop.ModemManager1.Error.Core.InProgress error, instead + of an + org.freedesktop.ModemManager1.Error.Core.WrongState error, when one + tries to initialize a modem that is already being initialized, or to + enable a modem that is already being enabled. + + src/mm-broadband-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e446037aa71ff15dfa6be0f396ccb619240e8ff7 +Author: Bjørn Mork +Date: Wed Sep 11 21:24:56 2013 +0200 + + mbm: add another H5321gw ID + + This device ID is used in a Lenovo Thinkpad T430. + + Link: http://bugs.debian.org/705942 + Reported-by: Etienne Bagnoud + Signed-off-by: Bjørn Mork + + plugins/mbm/77-mm-ericsson-mbm.rules | 1 + + 1 file changed, 1 insertion(+) + +commit e755181fd57f8059e3bc5451865d9dafff58f922 +Author: Aleksander Morgado +Date: Wed Sep 11 17:08:27 2013 +0200 + + broadband-modem: only used CIND? for signal quality if actually + reported + + The Huawei MU736 supports CIND? but not for signal quality reporting: + + AT+CIND=? + +CIND : ("call",(0,1)), ("message",(0,1)), ("roam",(0,1)) + OK + + AT+CIND? + +CIND:0,0,0 + OK + + Which ended up with the following during execution: + + ModemManager[3044]: (ttyUSB1) Could not parse CIND signal quality + results; + signal index (255) outside received + range (0-3) + + Just avoid this, and make CIND? be used for signal quality retrieval + only if + (1) CIND? is actually supported and (2) CIND? reports signal quality + information. + + src/mm-broadband-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 0ff4da71e37e449eb4ade106d78cf6b753af671d +Author: Aleksander Morgado +Date: Wed Sep 11 17:00:43 2013 +0200 + + error-helpers: don't warn when unknown errors are found + + Just add the messages with debug level, so that they don't get + reported at + syslog. Having this kind of warnings in syslog is not useful, + specially because + we wouldn't know which was the specific command that issued the + warning. Errors + due to critical issues will anyway be reported in syslog in some + way or another. + + src/mm-error-helpers.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 4f451cf76737acd66d7ba3842a5fcf483723d0be +Author: Aleksander Morgado +Date: Thu Sep 5 16:26:52 2013 +0200 + + qmi-port: use the new qmi-proxy if available + + src/mm-qmi-port.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f7776a3784fc58c8d46034d5f53dd16518d31f65 +Author: Colin Walters +Date: Tue Sep 10 08:40:17 2013 -0400 + + libmm-glib: don't include internal header from public header + + This broke gnome-control-center in gnome-ostree. It should be + included in the C file where stuff from the private header is + actually used. + + libmm-glib/mm-modem-oma.c | 1 + + libmm-glib/mm-modem-oma.h | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 0d96662a0a4eea120b9130ff680c42e0c9493a18 +Author: Aleksander Morgado +Date: Tue Sep 10 09:42:18 2013 +0200 + + sim-huawei: fix refcount + + g_async_result_get_source_object() returns a full reference, which + needs to get + unref-ed when no longer used. + + plugins/huawei/mm-sim-huawei.c | 1 + + 1 file changed, 1 insertion(+) + +commit 73978cbe6fbe8549a08c011f9f48d910fc16f8aa +Author: Dan Williams +Date: Mon Sep 9 14:57:46 2013 -0500 + + sim-huawei: add SIM class to handle ICCID request + + Use AT^ICCID if possible to read the ICCID. + + plugins/Makefile.am | 2 + + plugins/huawei/mm-broadband-modem-huawei.c | 27 +++++ + plugins/huawei/mm-sim-huawei.c | 181 + +++++++++++++++++++++++++++++ + plugins/huawei/mm-sim-huawei.h | 53 +++++++++ + 4 files changed, 263 insertions(+) + +commit 11a7e3dfdf0642c451bfd7c214f4b52640ef661a +Author: Dan Williams +Date: Mon Sep 9 13:00:43 2013 -0500 + + core: add helper for parsing and validating the ICCID + + plugins/sierra/mm-sim-sierra.c | 37 ++++--------------- + src/mm-modem-helpers.c | 82 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 2 + + src/mm-sim.c | 66 +-------------------------------- + src/tests/test-modem-helpers.c | 84 + ++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 178 insertions(+), 93 deletions(-) + +commit ac343d390ba804ebd58c5477f45c69c1b8402edd +Author: Aleksander Morgado +Date: Mon Sep 9 09:46:26 2013 +0200 + + iface-modem-oma: fix OMA session state reporting + + Reported by Arman Uguray + + src/mm-iface-modem-oma.c | 1 + + 1 file changed, 1 insertion(+) + +commit cf78c385d60e3146aa374170a6472102baff6b69 +Author: Aleksander Morgado +Date: Mon Sep 9 09:45:59 2013 +0200 + + libmm-glib: fix return type + + Reported by Arman Uguray + + libmm-glib/mm-modem-oma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7751f2d6ed0a4afeb7330ae9262c949e76ce14b2 +Author: Aleksander Morgado +Date: Fri Aug 16 14:28:42 2013 +0200 + + mmcli,oma: support for the new OMA interface + + cli/Makefile.am | 1 + + cli/mmcli-modem-oma.c | 521 + +++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 + + cli/mmcli.h | 8 + + docs/man/mmcli.8 | 27 +++ + libmm-glib/mm-common-helpers.c | 72 ++++++ + libmm-glib/mm-common-helpers.h | 4 + + 7 files changed, 644 insertions(+) + +commit 03dc346adde7e00af1c6f08b05f40fd01250089f +Author: Aleksander Morgado +Date: Fri Aug 16 13:34:23 2013 +0200 + + broadband-modem-qmi: implement OMA CancelSession() + + src/mm-broadband-modem-qmi.c | 58 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + +commit 76835446eb9b6c2465b730ca447a56833aa95305 +Author: Aleksander Morgado +Date: Fri Aug 16 13:19:25 2013 +0200 + + iface-modem-oma: ensure the session id is known when + accepting/rejecting it + + src/mm-iface-modem-oma.c | 74 + ++++++++++++++++++++++++++++-------------------- + 1 file changed, 43 insertions(+), 31 deletions(-) + +commit 3ba2fee6fc1a883bc2b6ab95b017dd7613bec3a0 +Author: Aleksander Morgado +Date: Fri Aug 16 13:18:52 2013 +0200 + + broadband-modem-qmi: never add UNKNOWN OMA session types to the + pending list + + src/mm-broadband-modem-qmi.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 461d75dae952dceb0702b044014cc9478790499f +Author: Aleksander Morgado +Date: Fri Aug 16 13:10:04 2013 +0200 + + broadband-modem-qmi: implement OMA AcceptNetworkInitiatedSession() + + src/mm-broadband-modem-qmi.c | 70 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + +commit 0c7def2f345c329364ae7d5af680ca8688315aee +Author: Aleksander Morgado +Date: Fri Aug 16 11:53:50 2013 +0200 + + broadband-modem-qmi: implement OMA StartClientInitiatedSession() + + src/mm-broadband-modem-qmi.c | 73 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 23 ++++++++++++++ + src/mm-modem-helpers-qmi.h | 1 + + 3 files changed, 97 insertions(+) + +commit 72be4f1d570c5a748963f6a831e765e620a4073d +Author: Aleksander Morgado +Date: Fri Aug 16 11:41:10 2013 +0200 + + broadband-modem-qmi: implement OMA Setup() + + src/mm-broadband-modem-qmi.c | 78 + +++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 77 insertions(+), 1 deletion(-) + +commit 959c7b9cde2aac56e63825a56ed9d33999ea288f +Author: Aleksander Morgado +Date: Fri Aug 16 10:50:23 2013 +0200 + + broadband-modem-qmi: implement OMA feature loading + + src/mm-broadband-modem-qmi.c | 86 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit e6a7c85661d33493a8de7f19c6c7ff8773b83e8c +Author: Aleksander Morgado +Date: Wed Aug 14 16:14:37 2013 +0200 + + broadband-modem-qmi: handle OMA indications + + src/mm-broadband-modem-qmi.c | 271 + ++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-qmi.c | 80 +++++++++++++ + src/mm-modem-helpers-qmi.h | 9 ++ + 3 files changed, 359 insertions(+), 1 deletion(-) + +commit df47f1ac8f696c2712efc8c76bd9551d88c3d837 +Author: Aleksander Morgado +Date: Wed Aug 14 15:53:04 2013 +0200 + + broadband-modem-qmi: check support for OMA capabilities + + src/mm-broadband-modem-qmi.c | 53 + ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 51 insertions(+), 2 deletions(-) + +commit d37b21e116cf5b1f452ec150ef5254109f6f05be +Author: Aleksander Morgado +Date: Wed Aug 14 15:20:04 2013 +0200 + + iface-modem-oma: new object interface to handle the OMA DBus interface + + src/Makefile.am | 2 + + src/mm-broadband-modem.c | 63 +++ + src/mm-iface-modem-oma.c | 1252 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-oma.h | 164 ++++++ + 4 files changed, 1481 insertions(+) + +commit 8ab38ae96850da78c82ebd53ae037907c5b480a9 +Author: Aleksander Morgado +Date: Tue Aug 13 14:45:06 2013 +0200 + + libmm-glib: support for the 'OMA' interface + + docs/reference/libmm-glib/libmm-glib-docs.xml | 4 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 58 +++ + docs/reference/libmm-glib/libmm-glib.types | 8 + + libmm-glib/Makefile.am | 3 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-common-helpers.c | 80 +++ + libmm-glib/mm-common-helpers.h | 8 + + libmm-glib/mm-helper-types.h | 14 + + libmm-glib/mm-manager.c | 1 + + libmm-glib/mm-modem-oma.c | 592 + ++++++++++++++++++++++ + libmm-glib/mm-modem-oma.h | 136 +++++ + libmm-glib/mm-object.c | 36 ++ + libmm-glib/mm-object.h | 3 + + 13 files changed, 944 insertions(+) + +commit 32de7d6fef06b75137ed573782fc25173f6f02f2 +Author: Aleksander Morgado +Date: Tue Aug 13 11:20:03 2013 +0200 + + introspection,api: new 'Oma' interface + + docs/reference/api/Makefile.am | 1 + + docs/reference/api/ModemManager-dbus-reference.xml | 1 + + docs/reference/api/ModemManager-sections.txt | 4 + + docs/reference/libmm-glib/libmm-glib-docs.xml | 4 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 86 ++++++++++++++ + include/ModemManager-enums.h | 92 +++++++++++++++ + introspection/all.xml | 1 + + .../org.freedesktop.ModemManager1.Modem.Oma.xml | 123 + +++++++++++++++++++++ + libmm-glib/generated/Makefile.am | 3 + + 9 files changed, 315 insertions(+) + +commit b8e8c2a56d6847ea480388845ddce2f7ced68139 +Author: Dan Williams +Date: Fri Sep 6 21:35:54 2013 -0500 + + telit: install udev rules + + plugins/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 0c618274e8c95d97a3d5bebbe91faa4339a5ac8a +Author: Aleksander Morgado +Date: Thu Sep 5 15:31:46 2013 +0200 + + build: require libqmi 1.6.0 + + We were already requiring some features from 1.5.0 (dev version), + so depend + on the stable 1.6.0 now that it's out. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 29688595252e7108fc3364569185cc029d8fcaef +Author: Aleksander Morgado +Date: Wed Sep 4 08:27:30 2013 +0200 + + huawei: check NDISDUP support in the port once + + Don't query udev for the tag every time we recreate a bearer, just + do it once. + For some reason, re-querying the same tag after the first time + doesn't always + return the proper result. + + plugins/huawei/mm-broadband-modem-huawei.c | 26 + ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +commit 51202907055476f7fc4ef2b8d9ad4206b16ca087 +Author: Ben Chan +Date: Wed Sep 4 15:31:34 2013 -0700 + + huawei: fix uninitialized variable issues + + This patch fixes the following uninitialized variable issues, + which was + introduced in the previous commit "huawei: retry connect/disconnect + attempt + upon ^NDISSTATQRY? failures" (commit + 57c657bd066366db6892ac2a8adfec2ca209ccbe). + + huawei/mm-broadband-bearer-huawei.c:127:9: error: variable + 'ipv4_available' is used uninitialized whenever '||' condition is true + [-Werror,-Wsometimes-uninitialized] + if (!response || + ^~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:141:9: note: uninitialized use + occurs here + if (ipv4_available && ipv4_connected) { + ^~~~~~~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:127:9: note: remove the '||' + if its condition is always false + if (!response || + ^~~~~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:115:28: note: initialize the + variable 'ipv4_available' to silence this warning + gboolean ipv4_available; + ^ + = 0 + huawei/mm-broadband-bearer-huawei.c:484:9: error: variable + 'ipv4_available' is used uninitialized whenever '||' condition is true + [-Werror,-Wsometimes-uninitialized] + if (!response || + ^~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:498:9: note: uninitialized use + occurs here + if (ipv4_available && !ipv4_connected) { + ^~~~~~~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:484:9: note: remove the '||' + if its condition is always false + if (!response || + ^~~~~~~~~~~~ + huawei/mm-broadband-bearer-huawei.c:472:28: note: initialize the + variable 'ipv4_available' to silence this warning + gboolean ipv4_available; + ^ + = 0 + + plugins/huawei/mm-broadband-bearer-huawei.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 57c657bd066366db6892ac2a8adfec2ca209ccbe +Author: Prathmesh Prabhu +Date: Tue Sep 3 23:54:07 2013 -0700 + + huawei: retry connect/disconnect attempt upon ^NDISSTATQRY? failures + + The Huawei MU736 modem sometimes responds to the ^NDISSTATQRY? query + with a + '+CME ERROR: 100' error. This patch works around the issue by ignoring + a few + of these error responses in a connect / disconnect attempt. The + overall timeout + for the connect/disconnect operation is not affected by this change. + + plugins/huawei/mm-broadband-bearer-huawei.c | 50 + ++++++++++++++++++----------- + 1 file changed, 32 insertions(+), 18 deletions(-) + +commit c014bce554cc4710c25bae40ff1f88e1d4577c4a +Author: Bjørn Mork +Date: Sat Aug 31 13:02:51 2013 +0200 + + mbm: add udev rule for Toshiba branded H5321gw module + + Reported-by: Thomas Schäfer + Signed-off-by: Bjørn Mork + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0e64ba01d4cf4f791e29c128b9331780aa18a4a1 +Author: Ben Chan +Date: Tue Aug 27 00:44:04 2013 -0700 + + huawei: ignore ^DSDORMANT unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 60e1ac69194bddc10640f07a982430890056616e +Author: Ben Chan +Date: Tue Aug 27 12:21:34 2013 -0700 + + iface-modem: allow reset and factory reset operation in every state + + src/mm-iface-modem.c | 50 + +++++++++++--------------------------------------- + 1 file changed, 11 insertions(+), 39 deletions(-) + +commit 387c97d81f3cd28524ba0b33e0e11c34f82ef2a8 +Author: Ben Chan +Date: Tue Aug 27 00:15:39 2013 -0700 + + novatel-lte: check if a connect operation has been cancelled + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 2b28b7acb65df8e5778dde04225274db0a1e99da +Author: Aleksander Morgado +Date: Mon Aug 26 16:21:27 2013 +0200 + + at-serial-port: avoid 'enable_disable', use just 'enable' in + method name + + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + src/mm-at-serial-port.c | 6 +++--- + src/mm-at-serial-port.h | 6 +++--- + 3 files changed, 7 insertions(+), 7 deletions(-) + +commit 82eb2158db348dcc3ac0883ad2a1bf240c7c50ef +Author: Ben Chan +Date: Wed Aug 21 17:32:59 2013 -0700 + + huawei: ignore ^RFSWITCH unsolicited messages + + This patch ignores the ^RFSWITCH unsolicited messages in order + to avoid + them being mixed with other unsolicited messages. The modem power + state + is explicitly determined by the ^RFSWITCH? command, if supported, + so we + don't need to depend on the ^RFSWITCH unsolicited messages. + + plugins/huawei/mm-broadband-modem-huawei.c | 38 + ++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +commit 0f2a0aa0bc1b5ceea8275ca5c98834195c050ed6 +Author: Ben Chan +Date: Wed Aug 21 17:32:23 2013 -0700 + + at-serial-port: allow enabling/disabling unsolicited message handlers + + This patch adds an 'enable' flag in MMAtUnsolicitedMsgHandler and + mm_at_serial_port_enable_disable_unsolicited_msg_handler() to allow + enabling and disabling of unsolicited message handlers. The enable + flag + is set to TRUE by mm_at_serial_port_add_unsolicited_msg_handler(). + + src/mm-at-serial-port.c | 28 ++++++++++++++++++++++++++++ + src/mm-at-serial-port.h | 4 ++++ + 2 files changed, 32 insertions(+) + +commit 3979939eaf2a99483c50035b8c5a6c4633ce61e7 +Author: Ben Chan +Date: Wed Aug 21 23:00:09 2013 -0700 + + huawei: ignore +CUSATP and +CUSATEND unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 3fcc908ed5354f6dd2b708d8cbaa4a0cc0c97fea +Author: Ben Chan +Date: Fri Aug 23 00:05:31 2013 -0700 + + huawei: always parse operator name in +COPS responses as ASCII + + Despite +CSCS? may claim supporting UCS2, Huawei modems always report + the oerator name in ASCII in a +COPS response. This patch addresses + that + by always assuming the charset is IRA when parsing the operator name + in a + +COPS response. + + plugins/huawei/mm-broadband-modem-huawei.c | 43 + ++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit f2fb2fe9fcf7009fe567931194c8f91c9e0aaf36 +Author: Ben Chan +Date: Fri Aug 23 00:05:56 2013 -0700 + + altair-lte: increase timeout for %APNN, %DPDNACT, and %STATCM + + plugins/altair/mm-broadband-bearer-altair-lte.c | 6 +++--- + plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 7e9ae215509c7e55ca128023100258d664894c32 +Author: Aleksander Morgado +Date: Wed Aug 21 13:27:41 2013 +0200 + + broadband-modem-qmi: avoid processing invalid TLVs in + GetSignalStrength response + + E.g. in the GetSignalStrength output we get EV-DO-only TLVs, even + if EV-DO is + not the current access technology, what ends up generating the + following: + + $ sudo mmcli -m 0 --signal-get + + /org/freedesktop/ModemManager1/Modem/0 + ------------------------- + Refresh rate: '5' seconds + ------------------------- + EV-DO | RSSI: '0.00' dBm + | EcIo: '0.00' dBm + | SINR: '9.00' dBm + | Io: '-106.00' dB + ------------------------- + UMTS | RSSI: '94.00' dBm + | EcIo: '-6.00' dBm + + Instead, we will now assume that the RSSI list always contains the + valid access + technologies being reported, and use that list to decide whether we + process some + of the per-technology TLVs. We now end up getting: + + $ sudo mmcli -m 0 --signal-get + + /org/freedesktop/ModemManager1/Modem/0 + ------------------------- + Refresh rate: '5' seconds + ------------------------- + UMTS | RSSI: '94.00' dBm + | EcIo: '-8.00' dBm + + src/mm-broadband-modem-qmi.c | 49 + ++++++++++++++++++++++---------------------- + 1 file changed, 24 insertions(+), 25 deletions(-) + +commit 75aa4a0df708a981a5d2b1dafc8912dfd3af78e4 +Author: Aleksander Morgado +Date: Wed Aug 21 12:56:49 2013 +0200 + + libmm-glib,time: fix gtk-doc comments + + libmm-glib/mm-modem-time.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 4cd82fcc8a35e835fae1b23930778664ee95a4ae +Author: Aleksander Morgado +Date: Wed Aug 21 12:44:28 2013 +0200 + + libmm-glib,signal: fix introspection annotations and gtk-doc comments + + libmm-glib/mm-modem-signal.c | 62 + ++++++++++++++++++++++---------------------- + 1 file changed, 31 insertions(+), 31 deletions(-) + +commit 27b739b838e1c09ff8a9904d203990463fcfe591 +Author: Aleksander Morgado +Date: Thu Aug 1 14:20:39 2013 +0200 + + broadband-modem-qmi: try with 'NAS Signal Strength' for extended + signal info + + src/mm-broadband-modem-qmi.c | 237 + ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 210 insertions(+), 27 deletions(-) + +commit 71c60fc6eb4f341e9785172d73c16613f79ba4a5 +Author: Aleksander Morgado +Date: Thu Aug 1 13:37:38 2013 +0200 + + iface-modem-signal: use the new 'MMSignal' in the interface + implementation + + Also modify the QMI-specific implementation to act as a state machine, + as we'll + add more steps afterwards. + + src/mm-broadband-modem-qmi.c | 248 + ++++++++++++++++++++++++++----------------- + src/mm-iface-modem-signal.c | 95 +++++------------ + src/mm-iface-modem-signal.h | 26 ++--- + 3 files changed, 186 insertions(+), 183 deletions(-) + +commit ca8a414668e5caf55970664855f796632d467260 +Author: Aleksander Morgado +Date: Wed Jul 24 09:33:58 2013 +0200 + + libmm-glib: distribute the mm-modem-signal.h header + + libmm-glib/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 9449f0f9fb4800682041a18f163778b8307891f0 +Author: Aleksander Morgado +Date: Wed Jul 24 09:32:39 2013 +0200 + + introspection,api: specify units for the 'rate' value in Setup() + + introspection/org.freedesktop.ModemManager1.Modem.Signal.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4a68e8d27389edee2285c497491292e14003b61a +Author: Aleksander Morgado +Date: Thu Jul 18 23:32:10 2013 +0200 + + broadband-modem-qmi: extended signal support only in NAS >= 1.8 + + src/mm-broadband-modem-qmi.c | 42 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +commit 1340896b504e9f5a711df4d36fc0608f03c3297a +Author: Aleksander Morgado +Date: Thu Jul 18 23:16:45 2013 +0200 + + iface-modem-signal: explicitly check support for the Signal interface + + src/mm-iface-modem-signal.c | 202 + ++++++++++++++++++++++++++++++++++++-------- + src/mm-iface-modem-signal.h | 8 ++ + 2 files changed, 176 insertions(+), 34 deletions(-) + +commit 564e0fd94bd2bb451812e4218d64f28368a2411a +Author: Aleksander Morgado +Date: Thu Jul 18 23:03:22 2013 +0200 + + libmm-glib,signal: don't create a 'MMSignal' with an empty dictionary + + libmm-glib/mm-signal.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 0502646f9f68a37b00066247beb856bc781c6afa +Author: Aleksander Morgado +Date: Thu Jul 18 08:27:20 2013 +0200 + + api,introspection: use per-technology dictionaries in the 'Signal' + interface + + cli/mmcli-modem-signal.c | 100 ++--- + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 114 ++--- + docs/reference/libmm-glib/libmm-glib.types | 1 + + .../org.freedesktop.ModemManager1.Modem.Signal.xml | 261 ++++++----- + libmm-glib/Makefile.am | 7 +- + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-modem-signal.c | 490 + ++++++++++++++++----- + libmm-glib/mm-modem-signal.h | 53 +-- + libmm-glib/mm-signal.c | 442 + +++++++++++++++++++ + libmm-glib/mm-signal.h | 98 +++++ + src/mm-iface-modem-signal.c | 86 ++-- + 12 files changed, 1256 insertions(+), 398 deletions(-) + +commit e8ce650ed0bd271681fae881f8b597ebe739fb7b +Author: Aleksander Morgado +Date: Mon Jul 8 21:37:18 2013 +0200 + + broadband-modem-qmi: implement extended signal quality reporting + + src/mm-broadband-modem-qmi.c | 207 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 206 insertions(+), 1 deletion(-) + +commit 5ef439e2d696e0c9acb9f146ed541848fd8db0ce +Author: Aleksander Morgado +Date: Mon Jul 8 21:11:02 2013 +0200 + + broadband-modem: handle the new 'Signal' interface + + src/mm-broadband-modem.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 63 insertions(+) + +commit d368d30c531f6595826255a6f5c496ab91894b40 +Author: Aleksander Morgado +Date: Mon Jul 8 20:50:02 2013 +0200 + + iface-modem-signal: new implementation for the 'Signal' interface + + src/Makefile.am | 2 + + src/mm-iface-modem-signal.c | 489 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-signal.h | 97 +++++++++ + 3 files changed, 588 insertions(+) + +commit d29423202555e41283796a1abeb28f3372ea15ab +Author: Aleksander Morgado +Date: Sun Jul 7 21:11:47 2013 +0200 + + mmcli: new actions to use the 'Signal' interface + + cli/Makefile.am | 1 + + cli/mmcli-modem-signal.c | 340 + +++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 4 files changed, 360 insertions(+) + +commit fcdbefa51962aac545db7a797b5fbeb60a66ab60 +Author: Aleksander Morgado +Date: Sun Jul 7 20:41:17 2013 +0200 + + libmm-glib: handle the new 'Signal' interface + + docs/reference/libmm-glib/libmm-glib-docs.xml | 8 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 144 +++++++++ + docs/reference/libmm-glib/libmm-glib.types | 4 + + libmm-glib/Makefile.am | 2 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-manager.c | 1 + + libmm-glib/mm-modem-signal.c | 356 + ++++++++++++++++++++++ + libmm-glib/mm-modem-signal.h | 120 ++++++++ + libmm-glib/mm-object.c | 36 +++ + libmm-glib/mm-object.h | 3 + + 10 files changed, 675 insertions(+) + +commit 37115dee9383c79985e6b05122380449b408ae13 +Author: Aleksander Morgado +Date: Sun Jul 7 20:17:23 2013 +0200 + + api,introspection: new 'Signal' interface for extended signal quality + + data/org.freedesktop.ModemManager1.conf.polkit | 7 + + docs/reference/api/Makefile.am | 1 + + docs/reference/api/ModemManager-dbus-reference.xml | 1 + + introspection/all.xml | 1 + + .../org.freedesktop.ModemManager1.Modem.Signal.xml | 155 + +++++++++++++++++++++ + libmm-glib/generated/Makefile.am | 9 +- + 6 files changed, 171 insertions(+), 3 deletions(-) + +commit b61827f474af19302ff66621ef152419d75f0ef0 +Author: Aleksander Morgado +Date: Wed Aug 21 11:16:15 2013 +0200 + + huawei: ignore ^NDISEND unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit ef5aae51254cd2336f09c87e84dfa9f496fc88dc +Author: Aleksander Morgado +Date: Wed Aug 14 18:01:53 2013 +0200 + + iface-modem-messaging: never add UNKNOWN to the lists of supported + storages + + src/mm-iface-modem-messaging.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit b83ef8b5e2a139ab5e04388e457570812701b7ca +Author: Ben Chan +Date: Thu Aug 15 11:12:01 2013 -0700 + + altair-lte: increase timeout for +CFUN=4 + + plugins/altair/mm-broadband-modem-altair-lte.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d42011d6bf3394a6ac1508a667ac9c1348a2514e +Author: Aleksander Morgado +Date: Thu Aug 15 19:20:59 2013 +0200 + + build: include vapigen.m4 and introspection.m4 + + So that we don't require vala or g-i for building even when not + wanting them. + + m4/introspection.m4 | 96 + +++++++++++++++++++++++++++++++++++++++++++++++++ + m4/vapigen.m4 | 101 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 197 insertions(+) + +commit 663d49696821e8a269662f4c42ecab6c43c3055e +Author: Aleksander Morgado +Date: Thu Aug 15 18:57:10 2013 +0200 + + huawei: improve ^NDISSTATQRY parser for newer firmware + + Newer firmware for Huawei devices will not split the IPv4 and IPv6 + info in + different lines for the ^NDISSTATQRY reply; instead they will be + included in the + same line. E.g. instead of + + ^NDISSTATQRY: 1,,,IPV4 + ^NDISSTATQRY: 0,33,,IPV6 + OK + + We may have: + + ^NDISSTATQRY:0,,,"IPV4",0,33,,"IPV6" + + Also note the optional spaces after the ':', and that in the new + version the + strings are enclosed in double quotes. + + https://bugzilla.gnome.org/show_bug.cgi?id=705339 + + plugins/huawei/mm-modem-helpers-huawei.c | 64 + ++++++++++++++---------- + plugins/huawei/tests/test-modem-helpers-huawei.c | 10 +++- + 2 files changed, 46 insertions(+), 28 deletions(-) + +commit f9c75bc4876311c4fd4e30a5d78562e532c085b6 +Author: Ben Chan +Date: Wed Aug 14 11:52:59 2013 -0700 + + cli: fix help message for --3gpp-ussd-respond + + cli/mmcli-modem-3gpp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 33a6cb2fa5034060376dfac3332f960f2e3ee7ae +Author: Colin Walters +Date: Wed Aug 14 19:22:27 2013 +0200 + + build: An even cleaner srcdir != builddir fix + + Suggested-by: Dan Winship + + libmm-glib/Makefile.am | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit 54fa505e67e1f0f315314822c7b81db25254263f +Author: Colin Walters +Date: Wed Aug 14 18:59:54 2013 +0200 + + build: Various srcdir != builddir fixes for gnome-ostree + + The gnome-ostree build system does srcdir != builddir from git, not + quite like autotools does. + + libmm-glib/Makefile.am | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 65f633ab961570ad90644fcfa1fe748f50908da9 +Author: Dan Williams +Date: Wed Aug 14 10:37:45 2013 -0500 + + build: fix distcheck after Introspection changes + + libmm-glib/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 36fe2012cc995fe9eb3482d8d0671467190f9060 +Author: Aleksander Morgado +Date: Wed Aug 14 15:43:28 2013 +0200 + + license: update to latest gplv2 text + + COPYING | 41 ++++++++++++++++++++--------------------- + 1 file changed, 20 insertions(+), 21 deletions(-) + +commit 81194337fec82d3c58aa58da8ce393da8404b5d2 +Author: Christian Persch +Date: Wed Aug 14 12:32:17 2013 +0200 + + build: Error out if vala bindings are enabled but Makefile.vapigen + not found + + Cannot test this for enable_vala=auto since enable_vala has been + set to + yes/no by this time. + + Bug #705641. + + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 6eec45cb73f2430dcb8a6e6751d4dc2446b8861c +Author: Christian Persch +Date: Tue Aug 13 10:30:13 2013 +0200 + + gitignore: Updated to ignore GIR and VAPI bindings generated files + + Bug #705641. + + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +commit bfae86329602635f203310b352a71c0597283589 +Author: Christian Persch +Date: Tue Aug 6 23:12:26 2013 +0200 + + libmm-glib: Add vala bindings + + Bug #705641. + + Makefile.am | 2 +- + configure.ac | 5 +++++ + vapi/Makefile.am | 22 ++++++++++++++++++++++ + vapi/ModemManager-1.0.metadata | 0 + vapi/libmm-glib.deps | 1 + + 5 files changed, 29 insertions(+), 1 deletion(-) + +commit b8838b88829bdffd849eb115bd1a74932d6adabb +Author: Christian Persch +Date: Sun Aug 4 13:51:27 2013 +0200 + + libmm-glib: Generate GObject introspection information + + Bug #705641. + + configure.ac | 4 +++ + libmm-glib/Makefile.am | 75 + ++++++++++++++++++++++++++++++++++++++++++-- + libmm-glib/mm-helper-types.h | 10 +++--- + 3 files changed, 83 insertions(+), 6 deletions(-) + +commit d1d28687852a2e683e9c3f4ca0b6404a248c1b7c +Author: Aleksander Morgado +Date: Tue Aug 13 10:06:25 2013 +0200 + + api: Change error enum nicks + + Introspection can't copy with a '.' in the value nicks, so just + remove those. + + Note: This could be considered an ABI break! + + Bug #705641. + + Patch based on a previous one from Christian Persch . + + include/ModemManager-errors.h | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit 0abba497ab8ebc0564044917df67c2237b20168b +Author: Christian Persch +Date: Sun Aug 4 15:13:17 2013 +0200 + + libmm-glib: Fix and add introspection annotations + + Bug #705641. + + libmm-glib/mm-bearer-ip-config.c | 10 +++++++++- + libmm-glib/mm-bearer-properties.c | 27 + +++++++++++++++++++++++++++ + libmm-glib/mm-bearer-properties.h | 2 +- + libmm-glib/mm-modem-3gpp.c | 4 ++-- + libmm-glib/mm-modem-firmware.c | 4 ++-- + libmm-glib/mm-modem-location.c | 2 +- + libmm-glib/mm-modem-messaging.c | 6 +++--- + libmm-glib/mm-modem-time.c | 16 ++++++++-------- + libmm-glib/mm-modem.c | 12 ++++++------ + libmm-glib/mm-simple-connect-properties.c | 8 ++++++++ + libmm-glib/mm-simple-connect-properties.h | 2 +- + libmm-glib/mm-sms-properties.c | 8 ++++++++ + libmm-glib/mm-unlock-retries.c | 4 ++-- + 13 files changed, 78 insertions(+), 27 deletions(-) + +commit 34f6a2b63e9053f2beabb2a5af221221d5a0f791 +Author: Ben Chan +Date: Wed Aug 14 00:01:29 2013 -0700 + + huawei: implement modem reset via +CFUN=16 for MU736 + + plugins/huawei/mm-broadband-modem-huawei.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit f515cd1d903fefbdaec163dea3e3f0da870ff58a +Author: Ben Chan +Date: Wed Aug 14 00:01:28 2013 -0700 + + iface-modem: add mm_iface_modem_get_model helper to query model + + src/mm-iface-modem.c | 20 ++++++++++++++++++++ + src/mm-iface-modem.h | 3 +++ + 2 files changed, 23 insertions(+) + +commit c94943322b3e497bf0131eae2aa21489bc71a061 +Author: Aleksander Morgado +Date: Tue Aug 13 16:02:41 2013 +0200 + + docs: add missing types + + docs/reference/libmm-glib/libmm-glib.types | 1 + + 1 file changed, 1 insertion(+) + +commit e778283f5512acd294929ae504113040faff3e14 +Author: Fangxiaozhi (Franko) +Date: Mon Aug 12 09:04:43 2013 +0200 + + huawei: enlarge the checking times for ndisstatqry in disconnecting + + In sometimes, the disconnection of NDISDUP will spend more time + than 10s. + So it is better to enlarge the checking times, such as up to 60 times. + + plugins/huawei/mm-broadband-bearer-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a82acb34ec7ca3d276263a6f286b586ac23d3856 +Author: Ben Chan +Date: Fri Aug 9 20:56:52 2013 -0700 + + huawei: implement modem reset + + plugins/huawei/mm-broadband-modem-huawei.c | 26 + ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit 1d3ec932d56355e2a84956c3d543969bea8ebd6f +Author: Dan Williams +Date: Thu Aug 8 09:45:16 2013 -0500 + + build: install mm-cdma-manual-activation-properties.h to includes dir + + libmm-glib/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit bb1d39cf7cb7a75553879a3ccaf2003343a68f6c +Author: Aleksander Morgado +Date: Tue Jul 23 12:06:52 2013 +0200 + + broadband-modem-qmi: check MDN set after manual activation + + src/mm-broadband-modem-qmi.c | 154 + ++++++++++++++++++++++++++++++++----------- + 1 file changed, 116 insertions(+), 38 deletions(-) + +commit 512ef6970cfd1793f667a23dc1b10c3f3b43c988 +Author: Aleksander Morgado +Date: Mon Jul 15 11:50:35 2013 +0200 + + broadband-modem-qmi: implement manual CDMA activation + + We'll also now require libqmi 1.5 (git master), needed to handle + the PRL TLV + in 'DMS Activate Manual'. + + TODO: require 1.6 as soon as it is released. + + configure.ac | 2 +- + src/mm-broadband-modem-qmi.c | 245 + +++++++++++++++++++++++++++++++++++++++---- + 2 files changed, 225 insertions(+), 22 deletions(-) + +commit 4e3d0ec3fd4a40b9c38e6278b0e70aadf9fbfb42 +Author: Aleksander Morgado +Date: Mon Jul 15 12:31:23 2013 +0200 + + mmcli,cdma: new '--cdma-activate-manual' action + + Along with a new '--cdma-activate-manual-with-prl'. + + These can be used to request CDMA Manual Activation, like: + + $> sudo mmcli \ + -m 0 \ + --cdma-activate-manual="spc=123456,sid=ab,mdn=0123456789abcde,min=0123456789abcde" + + Or: + + $> sudo mmcli \ + -m 0 \ + --cdma-activate-manual="spc=123456,sid=ab,mdn=0123456789abcde,min=0123456789abcde" + \ + --cdma-activate-manual-with-prl=/path/to/my/prl.data + + cli/mmcli-modem-cdma.c | 130 + ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 129 insertions(+), 1 deletion(-) + +commit 5de526f7080c3c56474b277fe46a49537f44ed74 +Author: Aleksander Morgado +Date: Mon Jul 15 12:26:57 2013 +0200 + + libmm-glib,cdma: implement manual activation methods + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 + + libmm-glib/mm-modem-cdma.c | 92 + +++++++++++++++++++++++ + libmm-glib/mm-modem-cdma.h | 14 ++++ + 3 files changed, 109 insertions(+) + +commit b769d48ed88d0dd69c70dffce23b21fa99814791 +Author: Aleksander Morgado +Date: Fri Jul 12 13:35:39 2013 +0200 + + iface-modem-cdma: use the new 'MMCdmaManualActivationProperties' + + src/mm-iface-modem-cdma.c | 24 +++++++++++++++++------- + src/mm-iface-modem-cdma.h | 2 +- + 2 files changed, 18 insertions(+), 8 deletions(-) + +commit c0d4f3157aeb2452155e558fb11daa6b7ef860dd +Author: Aleksander Morgado +Date: Fri Jul 12 12:56:50 2013 +0200 + + libmm-glib: new 'MMCdmaManualActivationProperties' helper object + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 40 + + libmm-glib/Makefile.am | 4 +- + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-cdma-manual-activation-properties.c | 879 + ++++++++++++++++++++++ + libmm-glib/mm-cdma-manual-activation-properties.h | 113 +++ + 6 files changed, 1037 insertions(+), 1 deletion(-) + +commit 5ba2c1d6cbd2d1a089d5d1219ffd3a7b8b5c60d3 +Author: Aleksander Morgado +Date: Fri Jul 12 13:10:54 2013 +0200 + + introspection,api: document the expected parameters in + Cdma.ActivateManual() + + ...g.freedesktop.ModemManager1.Modem.ModemCdma.xml | 58 + +++++++++++++++++++++- + src/mm-iface-modem-cdma.c | 2 +- + 2 files changed, 58 insertions(+), 2 deletions(-) + +commit ffac6f17b5912dfa4d2e55eaf078796680871ea7 +Author: Ben Chan +Date: Wed Jul 31 23:07:52 2013 -0700 + + modem-helpers: fix parsing of CREG/CGREG/CEREG responses + + The format of CREG/CGREG/CEREG responses is not very precisely defined + in or strictly enforced by the 3GPP specifications. That leads to the + fact that some modems put leading zeros in integer type fields (e.g. + , , ), and not all modems put double quotes around + string + type fields (e.g. , ) in those C*REG responses. + + For example, 0001 can be a valid value for both and . The + original C*REG parsing code in ModemManager could potentially + interpret + '+CREG: ,,,' as '+CREG: + ,,,'. This + patch addresses this issue by refining the regular expressions + returned + by mm_3gpp_creg_regex_get() with the following assumptions: + + 1. If a modem puts leading zeros in integer type fields, it puts + double + quotes around string type fields. + 2. If a modem omits double quotes around string type fields, it + does not + put leading zeros in integer type fields. + + src/mm-modem-helpers.c | 30 ++++++++++++--- + src/tests/test-modem-helpers.c | 86 + +++++++++++++++++++++++++++++++++++++----- + 2 files changed, 100 insertions(+), 16 deletions(-) + +commit 755c61a2ffad6d54fc3116dd29d91b4325cf6b18 +Author: Ben Chan +Date: Tue Aug 6 10:10:09 2013 -0700 + + huawei: ignore ^PDPDEACT unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 8ff3f6703a804cce60ae85b6c3ab543d21c5460f +Author: Ben Chan +Date: Tue Aug 6 10:04:46 2013 -0700 + + huawei: handle whitespace in RSSI responses + + This patch modifies the regular expressions for parsing ^RSSI, + ^RSSILVL, + and ^HRSSILVL responses to handle any whitespace that is inserted + between the colon and the RSSI value. + + The issue is identified by Dan Williams + + plugins/huawei/mm-broadband-modem-huawei.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f2fd4d8de0feb3d089d5ae950bea753f65a0e384 +Author: Ben Chan +Date: Fri Aug 2 18:07:11 2013 -0700 + + huawei: implement modem power up and down + + This patch is originally developed by: + Franko Fang + + And then reviewed and updated by: + Ben Chan + + plugins/huawei/mm-broadband-modem-huawei.c | 218 + +++++++++++++++++++++++++++++ + 1 file changed, 218 insertions(+) + +commit 48fbe1a24297d0eeb3a143230937438dc14c6109 +Author: Ben Chan +Date: Wed Jul 31 00:59:26 2013 -0700 + + huawei: reset disconnect_pending to NULL when ^NDISSTATQRY fails + + plugins/huawei/mm-broadband-bearer-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 965ef76547988fa8299a79ed383550cb6505d2f6 +Author: Dan Williams +Date: Tue Jul 23 10:00:23 2013 -0500 + + serial: add logging to serial port open failures + + src/mm-serial-port.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit 74056e02ced535400ce961f6bcd39cb049ca7ff2 +Author: Aleksander Morgado +Date: Tue Jul 23 11:04:29 2013 +0200 + + build: fix dbus activation file generation + + https://bugzilla.gnome.org/show_bug.cgi?id=704711 + + configure.ac | 1 - + data/Makefile.am | 3 +++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +commit 599b3dd830a64d7ea12522ae91b9e652c05476c0 +Author: Aleksander Morgado +Date: Fri Jul 19 11:14:09 2013 +0200 + + build: post release version bump to 1.1.0 (development) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5c68a3686d6fcd61f3fe262d4e7c9b806900b920 +Author: Aleksander Morgado +Date: Fri Jul 19 10:00:01 2013 +0200 + + release: bump version to 1.0.0 + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 953b7df70c448ff0d3fe44736eca96b58b1d986a +Author: Aleksander Morgado +Date: Fri Jul 19 09:59:50 2013 +0200 + + release: update NEWS + + NEWS | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit 184c5a925a53e4822f759ad556c487bec6dfea98 +Author: Aleksander Morgado +Date: Fri Jul 19 09:59:41 2013 +0200 + + docs: update migration reference version number + + docs/reference/api/ModemManager-migration-reference.xml | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 1e69874e598711cf713b2c6ea6f73cb8b1a9d6db +Author: Aleksander Morgado +Date: Fri Jul 19 09:59:21 2013 +0200 + + api,introspection: update interface version number + + introspection/org.freedesktop.ModemManager1.Bearer.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Location.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Messaging.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Simple.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.Time.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Modem.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Sim.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.Sms.xml | + 2 +- + introspection/org.freedesktop.ModemManager1.xml | + 2 +- + introspection/wip-org.freedesktop.ModemManager1.Modem.Contacts.xml | + 2 +- + 14 files changed, 14 insertions(+), 14 deletions(-) + +commit d90a6309fbce3f96127e413e0c161a3f4385c2e4 +Author: Aleksander Morgado +Date: Thu Jul 18 22:43:55 2013 +0200 + + broadband-modem-qmi: plug memleak when listing SMS messages + + src/mm-broadband-modem-qmi.c | 47 + ++++++++++++++++++++------------------------ + 1 file changed, 21 insertions(+), 26 deletions(-) + +commit 0245b6256a86f7ebb7202cc60485a2d8cb54c369 +Author: Aleksander Morgado +Date: Thu Jul 18 17:54:45 2013 +0200 + + libmm-glib,firmware-properties: allow NULL when building dictionary + + libmm-glib/mm-firmware-properties.c | 2 -- + 1 file changed, 2 deletions(-) + +commit abce098cfe2ed1b2d922201b20756511a65e5748 +Author: Aleksander Morgado +Date: Wed Jul 17 09:03:16 2013 +0200 + + sms: initialize 'validity' property always to a default + + When we're exposing not-yet-completed multipart messages, we need + to provide a + correct value for the validity property, or gdbus may crash, see e.g.: + + https://bugzilla.gnome.org/show_bug.cgi?id=704319 + + src/mm-sms.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 022f5bb490b225426caa6e1e88bbbac8b6590b86 +Author: Aleksander Morgado +Date: Mon Jul 15 12:05:36 2013 +0200 + + mmcli,messaging: plug memleak + + cli/mmcli-modem-messaging.c | 1 + + 1 file changed, 1 insertion(+) + +commit 48d35ee61049e65b83bf3484a45657a83709b2a1 +Author: Ben Chan +Date: Sun Jul 14 17:24:39 2013 -0700 + + altair-lte: set serial port send delay to 0 + + With a non-zero send delay, the communication over the ttyACM port of + the modem is not very stable when USB auto-suspend is enabled for the + modem. The send delay is not necessary and thus removed by this patch. + + Ori Inbar reported the issue and suggested + this fix. + + plugins/altair/mm-broadband-modem-altair-lte.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 5b3392e84b910c88af64db54986a74122b40f1f4 +Author: Aleksander Morgado +Date: Sun Jul 14 17:12:55 2013 +0200 + + build: require libmbim by default, and explicitly log about + --without-mbim + + configure.ac | 39 ++++++++++++++++----------------------- + 1 file changed, 16 insertions(+), 23 deletions(-) + +commit ac588e9d0e6b4dd59d1e929545bf39247cb8f72c +Author: Aleksander Morgado +Date: Sun Jul 14 17:04:26 2013 +0200 + + build: explicitly log about --without-qmi when looking for libqmi + fails + + configure.ac | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 19f07c12a1fb4a09d866b12f58ad91b38e482a4e +Author: Aleksander Morgado +Date: Fri Jul 12 12:56:27 2013 +0200 + + sms-properties: fix introspection comment + + libmm-glib/mm-sms-properties.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f3d9c35e9b60265cc19f5a9468425b057627686e +Author: Dan Williams +Date: Thu Jul 11 09:07:12 2013 -0500 + + build: fix multiply defined EXTRA_DIST + + plugins/Makefile.am:375: warning: EXTRA_DIST multiply defined in + condition TRUE ... + gtester.make:6: ... 'EXTRA_DIST' previously defined here + plugins/Makefile.am:1: 'gtester.make' included from here + + plugins/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0b2e04ed149717a60ec2e399a2d4e1c6f3200cd9 +Author: Aleksander Morgado +Date: Sat Jun 15 13:05:32 2013 +0200 + + huawei: use ^NDISSTATQRY to check for connection status + + Patch based on changes from Franko Fang . + + plugins/huawei/mm-broadband-bearer-huawei.c | 129 + ++++++++++++++++++---------- + 1 file changed, 84 insertions(+), 45 deletions(-) + +commit 8d0ec0fc246ad4be53b426ae99443e9b5f66a5f5 +Author: Aleksander Morgado +Date: Sat Jun 15 12:19:50 2013 +0200 + + huawei: new helper to parse ^NDISSTATQRY responses + + .gitignore | 5 ++ + plugins/Makefile.am | 23 ++++- + plugins/huawei/mm-modem-helpers-huawei.c | 100 + ++++++++++++++++++++++ + plugins/huawei/mm-modem-helpers-huawei.h | 30 +++++++ + plugins/huawei/tests/test-modem-helpers-huawei.c | 103 + +++++++++++++++++++++++ + 5 files changed, 260 insertions(+), 1 deletion(-) + +commit 5e82707b3fba0b7cb95df6b544741bdc1119bd51 +Author: Ben Chan +Date: Wed Jul 10 23:31:15 2013 -0700 + + broadband-modem-qmi: fix incorrect conversions from double to gint32 + + This patch fixes the following incorrect conversions from double + to gint32: + + mm-broadband-modem-qmi.c:4785:27: error: implicit conversion from + 'double' to 'gint32' (aka 'int') + changes value from 2.225073858507201E-308 to 0 + [-Werror,-Wliteral-conversion] + gint32 bs_longitude = MM_LOCATION_LONGITUDE_UNKNOWN; + ~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + mm-broadband-modem-qmi.c:4786:26: error: implicit conversion from + 'double' to 'gint32' (aka 'int') + changes value from 2.225073858507201E-308 to 0 + [-Werror,-Wliteral-conversion] + gint32 bs_latitude = MM_LOCATION_LATITUDE_UNKNOWN; + ~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + src/mm-broadband-modem-qmi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit d366b28650be8a3da92eff74da2ff962da82355d +Author: Ben Chan +Date: Wed Jul 10 20:36:56 2013 -0700 + + modem-helpers-qmi: fix enumeration type mismatches + + This patch fixes the following enumeration type mismatches: + + mm-modem-helpers-qmi.c:980:12: error: implicit conversion from + enumeration type 'QmiNasRatModePreference' to different + enumeration type 'QmiNasRadioTechnologyPreference' + [-Werror,-Wenum-conversion] + return qmi; + ~~~~~~ ^~~ + + mm-modem-helpers-qmi.c:1082:12: error: implicit conversion from + enumeration type 'MMModemMode' to different + enumeration type 'QmiNasGsmWcdmaAcquisitionOrderPreference' + [-Werror,-Wenum-conversion] + return MM_MODEM_MODE_NONE; + ~~~~~~ ^~~~~~~~~~~~~~~~~~ + + mm-modem-helpers-qmi.c:1096:16: error: implicit conversion from + enumeration type 'QmiNasRegistrationState' to different + enumeration type 'MMModem3gppRegistrationState' + [-Werror,-Wenum-conversion] + return QMI_NAS_REGISTRATION_STATE_NOT_REGISTERED; + ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + src/mm-modem-helpers-qmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8660be8f39601ddb7811d77759a8e087401b9118 +Author: Dan Williams +Date: Wed Jul 10 10:56:45 2013 -0500 + + x22x: add support for Olivetti Olicard 200 + + plugins/x22x/77-mm-x22x-port-types.rules | 22 ++++++++++++++++++++-- + plugins/x22x/mm-plugin-x22x.c | 4 ++-- + 2 files changed, 22 insertions(+), 4 deletions(-) + +commit 1bd60c7dac84070c9226f5f525f3904c0a408272 +Author: Aleksander Morgado +Date: Mon Jul 8 13:10:51 2013 +0200 + + docs,libmm-glib: update type information + + docs/reference/libmm-glib/libmm-glib.types | 29 + ++++++----------------------- + 1 file changed, 6 insertions(+), 23 deletions(-) + +commit dd2b4672623919ddf7916234ce11fc6c15e959a7 +Author: Ben Chan +Date: Fri Jul 5 11:09:54 2013 -0700 + + serial-port: warn if ioctl(TIOCSSERIAL) fails to set closing_wait + + Prints out a warning if ioctl(TIOCSSERIAL) fails to set closing_wait + to + none. This helps debug issues when a serial driver does not support or + properly handle closing_wait, which may cause closing of the + serial port + to block. + + src/mm-serial-port.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit f0490b4fffef6566bf01995489a6cc87ff5f4547 +Author: Ben Chan +Date: Wed Jul 3 19:41:15 2013 -0700 + + altair-lte: support load_power_state in MMIfaceModem + + Being able to determine the current power state of the modem is + necessary to ensure reliable modem operations. + + plugins/altair/mm-broadband-modem-altair-lte.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 989210bfd87da57bc729a0b09720d6bc5f7fcb5c +Author: Ben Chan +Date: Thu Jun 27 21:51:25 2013 -0700 + + altair-lte: propagate error when load_{supported,current}_bands fails + + This patch fixes a potential crash when + MMIfaceModem::load_current_bands_ready() dereferences a NULL GError + pointer, which happens when the altair-lte plugin fails to load the + current bands but does not propagate the error. It also fixes + a similar + issue with the plugin fails to load the supported bands, even though + MMIfaceModem::load_supported_bands_ready() checks for a NULL GError + pointer. + + plugins/altair/mm-broadband-modem-altair-lte.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 5be1ce6ee165373288ea6852d6148f724b61e68f +Author: Ben Chan +Date: Thu Jun 27 21:50:28 2013 -0700 + + novatel-lte: propagate error when load_current_bands fails + + This patch fixes the following crash when + MMIfaceModem::load_current_bands_ready() dereferences a NULL GError + pointer, which happens when the novatel-lte plugin fails to load the + current bands but does not propagate the error. + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7f04d6c89c36 [ModemManager] - mm-iface-modem.c:3886 + load_current_bands_ready + 0x7f04d6942236 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:767 + g_simple_async_result_complete + 0x7f04d6942338 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:779 + complete_in_idle_cb + 0x7f04d67fad74 [libglib-2.0.so.0.3200.4] - gmain.c:2539 + g_main_context_dispatch + 0x7f04d67fb0f7 [libglib-2.0.so.0.3200.4] - gmain.c:3146 + g_main_context_iterate + 0x7f04d67fb551 [libglib-2.0.so.0.3200.4] - gmain.c:3340 + g_main_loop_run + 0x7f04d6c68795 [ModemManager] - main.c:142] + main + 0x7f04d6213464 [libc-2.15.so] - libc-start.c:234] + __libc_start_main + 0x7f04d6c68318 [ModemManager] + 0x0001d318] + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 49f017abfff0a513f0592ccad9beff4cf17d0d21 +Author: Aleksander Morgado +Date: Thu Jun 27 10:17:20 2013 +0200 + + man,mmcli: changing modes and bands no longer allowed in + '--simple-connect' + + docs/man/mmcli.8 | 9 --------- + 1 file changed, 9 deletions(-) + +commit 6f3d9e5dac101d484c581e6b93a982686d2266cb +Author: Ben Chan +Date: Wed Jun 26 22:32:52 2013 -0700 + + altair-lte: avoid sending ATZ when enabling the modem + + This patch prevents an ATZ command, which causes the modem to reboot, + from being sent to the modem when the modem is being enabled. + + plugins/altair/mm-broadband-modem-altair-lte.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit a9ebec949e5d9bfafad08cb04f7d0bbef5201be1 +Author: Aleksander Morgado +Date: Tue Jun 25 10:56:17 2013 +0200 + + plugin-manager: handle modems where only some ports report being Icera + + Icera-based Nokia modems may reply correctly to the Icera probing + only in some + AT ports, not in all. In order to handle this situation we override + the final + plugin selected to be the Icera-based one if we find that the + mismatched plugins + have the 'icera-allowed' and 'icera-forbidden' filters. + + https://bugzilla.gnome.org/show_bug.cgi?id=703022 + + src/mm-plugin-manager.c | 85 + +++++++++++++++++++++++++++++++++++++++---------- + src/mm-port-probe.c | 2 +- + 2 files changed, 70 insertions(+), 17 deletions(-) + +commit a420ef3a0ad9e1eeb0f302b511ba8c2bb5883e9a +Author: Aleksander Morgado +Date: Tue Jun 25 11:47:35 2013 +0200 + + icera: load supported modes with AT%IPSYS=? + + http://bugzilla.gnome.org/show_bug.cgi?id=703023 + + plugins/icera/mm-broadband-modem-icera.c | 191 + +++++++++++++++++++++---------- + 1 file changed, 132 insertions(+), 59 deletions(-) + +commit a05bd765648a1291485e65d42c7ff6709e08a555 +Author: Aleksander Morgado +Date: Tue Jun 25 11:53:49 2013 +0200 + + systemd: schedule to restart the service on-abort + + See https://bugzilla.gnome.org/show_bug.cgi?id=701229. + + data/ModemManager.service.in | 1 + + 1 file changed, 1 insertion(+) + +commit ddb9691922b6c61068d6b5615b18c7e28ca115f4 +Author: Aleksander Morgado +Date: Tue Jun 25 11:46:19 2013 +0200 + + iface-modem: plug memleak + + src/mm-iface-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit b4f6a4ac0b9f393cb5b5b1ed7fc5e2650249e16f +Author: Aleksander Morgado +Date: Tue Jun 25 11:46:09 2013 +0200 + + serial-parsers: plug memleak + + src/mm-serial-parsers.c | 1 + + 1 file changed, 1 insertion(+) + +commit 597401f80aa42eb17e3ae358e3ab629b0982f2ab +Author: Dan Williams +Date: Mon Jun 24 22:04:32 2013 -0500 + + broadband-bearer-hso: IPv4 prefix is always /32 + + The modem doesn't give us a prefix in the OWANDATA response, but it's + always /32. This didn't get set previously because NetworkManager + always just used /32 for the 'static' configuration, but NM isn't the + only user of MM, and only MM knows for sure that the prefix should + be /32. + + plugins/option/mm-broadband-bearer-hso.c | 1 + + 1 file changed, 1 insertion(+) + +commit 3206e9566392e8a9678bbd49e0de9bb21ed75291 +Author: Aleksander Morgado +Date: Thu Jun 20 23:45:12 2013 +0200 + + api,introspection: new 'Ports' property in the Modem interface + + We will expose a new 'Ports' property listing all ports currently + known by a + given modem. Ports which are not used but are detected as being part + of the + modem will be listed with an 'unknown' port type. + + This change uses the new 'MMModemPortType' enum and the new + 'MMModemPortInfo' + helper struct to handle these values in libmm-glib. The already + available + 'MMPortType' enum hasn't been re-used for the interface because + it contains + values that we don't need (e.g. IGNORED). + + The port list is now also included in the modem information command + of mmcli: + + $ sudo mmcli -m 0 + + /org/freedesktop/ModemManager1/Modem/0 (device id + '97b7b99e3e2bea103880545b619fb05a3cc81b26') + ------------------------- + System | device: + '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4' + | drivers: 'qcserial, qmi_wwan' + | plugin: 'Gobi' + | primary port: 'cdc-wdm0' + | ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 + (qmi), wwp0s29u1u4 (net)' + + https://bugzilla.gnome.org/show_bug.cgi?id=702678 + + cli/mmcli-modem.c | 13 ++- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 12 ++ + include/ModemManager-enums.h | 22 ++++ + .../org.freedesktop.ModemManager1.Modem.xml | 10 ++ + libmm-glib/Makefile.am | 1 + + libmm-glib/mm-common-helpers.c | 91 +++++++++++++++ + libmm-glib/mm-common-helpers.h | 10 ++ + libmm-glib/mm-helper-types.c | 41 +++++++ + libmm-glib/mm-helper-types.h | 16 +++ + libmm-glib/mm-modem.c | 123 + +++++++++++++++++++++ + libmm-glib/mm-modem.h | 7 ++ + src/mm-base-modem.c | 47 ++++++++ + src/mm-base-modem.h | 6 + + src/mm-iface-modem.c | 9 ++ + 15 files changed, 407 insertions(+), 2 deletions(-) + +commit 30fe6eab4844966a9ad99599aeac910fd9898798 +Author: Aleksander Morgado +Date: Sun Jun 23 11:40:36 2013 +0200 + + hso: if IPv6 bearer type requested, create a generic bearer + + Option/HSO modems don't seem to support IPv6 when using the net + interface. So if + IPv6 is requested, create a generic bearer. + + $ sudo mmcli -m 0 --simple-connect="apn=internet,ip-type=ipv6" + successfully connected the modem + + $ sudo mmcli -b 0 + Bearer '/org/freedesktop/ModemManager1/Bearer/0' + ------------------------- + Status | connected: 'yes' + | suspended: 'no' + | interface: 'ttyHS3' + | IP timeout: '20' + ------------------------- + Properties | apn: 'internet' + | roaming: 'allowed' + | IP type: 'ipv6' + | user: 'none' + | password: 'none' + | number: 'none' + | Rm protocol: 'unknown' + ------------------------- + IPv4 configuration | method: 'ppp' + ------------------------- + IPv6 configuration | method: 'unknown' + + $ sudo mmcli -m 0 --simple-disconnect + successfully disconnected all bearers in the modem + + https://bugzilla.gnome.org/show_bug.cgi?id=702472 + + plugins/option/mm-broadband-modem-hso.c | 34 + ++++++++++++++++++++++++++++++++- + 1 file changed, 33 insertions(+), 1 deletion(-) + +commit e227d4af39d2c09ef1e8a8818d2558fba210f334 +Author: Aleksander Morgado +Date: Sun Jun 23 11:22:00 2013 +0200 + + iface-modem: don't rely on the cached current power state value + + The real power state value of the modem may be changed by other + means, e.g. + rfkill. So when changing power state of the modem in MM, we better + recheck + which the current power status is. + + A better full approach would be to follow rfkill changes, but this + fix should + help until that is done. + + https://bugzilla.gnome.org/show_bug.cgi?id=702838 + + src/mm-iface-modem.c | 136 + +++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 95 insertions(+), 41 deletions(-) + +commit bcb00df1422b8a3a6d0fafbefe8ac3fcc9011b97 +Author: Aleksander Morgado +Date: Mon Jun 24 18:54:25 2013 +0200 + + mmcli: SMS class value is a signed integer, not unsiged + + cli/mmcli-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 08ef3c81da88257ffe9c8208275e59d455ba1234 +Author: Aleksander Morgado +Date: Mon Jun 24 18:48:27 2013 +0200 + + broadband-modem-mbim: fix notification signal handling + + src/mm-broadband-modem-mbim.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 19bd63ecfd02c02148e4efeab0a0b7a0476abac1 +Author: Aleksander Morgado +Date: Mon Jun 24 18:32:50 2013 +0200 + + broadband-modem-mbim: log about all received notifications + + src/mm-broadband-modem-mbim.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 697b6fdadb7f61b2430f64426bfa0a3f5fcfdfb3 +Author: Aleksander Morgado +Date: Thu Jun 20 18:12:02 2013 +0200 + + broadband-modem-mbim: add support for flash/alert SMS messages + + My Huawei MBIM modem notifies of standard new messages using + MBIM_CID_MESSAGE_STORE_STATUS + notifications, which is kind of wrong, as they should really be + notified using + MBIM_SMS_READ notifications; but anyway, try to handle those. + + src/mm-broadband-modem-mbim.c | 86 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit ee62806a1a1885108ae03da8eac0fe51816e2b7c +Author: Aleksander Morgado +Date: Wed Jun 19 23:02:17 2013 +0200 + + broadband-modem-mbim: setup enabling and disabling of unsolicited + messages + + src/mm-broadband-modem-mbim.c | 237 + ++++++++++++++++++++++++++---------------- + 1 file changed, 146 insertions(+), 91 deletions(-) + +commit 817fc43bb0bb4538d089624d0f5169a569976340 +Author: Aleksander Morgado +Date: Wed Jun 19 22:33:01 2013 +0200 + + broadband-modem-mbim: rename 'notification_flags' to 'setup_flags' + + We'll add 'enable_flags' later on. + + src/mm-broadband-modem-mbim.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit ac7c87c0d2b857a3de60af16e6bc9956f590a0c8 +Author: Aleksander Morgado +Date: Wed Jun 19 19:08:46 2013 +0200 + + broadband-modem-mbim: rename 3GPP specific methods + + src/mm-broadband-modem-mbim.c | 44 + +++++++++++++++++++++---------------------- + 1 file changed, 22 insertions(+), 22 deletions(-) + +commit 67207f279b85f7989c08f089858551d04b90fcec +Author: Aleksander Morgado +Date: Tue Jun 18 17:39:05 2013 +0200 + + sms: don't warn about unsupported validities + + src/mm-sms.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 347ea7cd4e347336050e0c4a96e639caa6f25a66 +Author: Aleksander Morgado +Date: Sun Jun 16 18:14:58 2013 +0200 + + broadband-modem-mbim: implement setup/cleanup messaging events + + src/mm-broadband-modem-mbim.c | 182 + +++++++++++++++++++++++++++++++----------- + 1 file changed, 137 insertions(+), 45 deletions(-) + +commit 6afbcc2c27810e32cdd480a5adfb563a4ab4c749 +Author: Aleksander Morgado +Date: Sun Jun 16 17:49:30 2013 +0200 + + sms-mbim: new 'MMSmsMbim' object type + + src/Makefile.am | 2 + + src/mm-broadband-modem-mbim.c | 12 +- + src/mm-sms-mbim.c | 362 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-mbim.h | 49 ++++++ + 4 files changed, 424 insertions(+), 1 deletion(-) + +commit 73bab06049d0c2be376dfcc8bc2180b199b900b7 +Author: Aleksander Morgado +Date: Sun Jun 16 17:22:00 2013 +0200 + + broadband-modem-mbim: implement initial sms parts loading + + src/mm-broadband-modem-mbim.c | 118 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-mbim.c | 19 +++++++ + src/mm-modem-helpers-mbim.h | 5 ++ + 3 files changed, 140 insertions(+), 2 deletions(-) + +commit a09cabd48e708646a6cc251a094c698552493d88 +Author: Aleksander Morgado +Date: Sun Jun 16 16:51:39 2013 +0200 + + broadband-modem-mbim: implement supported storages loading + + We'll only expose 'MT' (ME+SM) as supported, as in MBIM the device + doesn't + specify different storages. + + src/mm-broadband-modem-mbim.c | 41 + +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 39 insertions(+), 2 deletions(-) + +commit cb046934c338954d14ab77fedef6b27d97d19183 +Author: Aleksander Morgado +Date: Sun Jun 16 16:45:27 2013 +0200 + + broadband-modem-mbim: check for messaging support + + src/mm-broadband-modem-mbim.c | 68 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 67 insertions(+), 1 deletion(-) + +commit 76ff021a3c2a2e2339cfc3ce7d754f6e72dae5e7 +Author: Aleksander Morgado +Date: Mon Jun 24 19:37:11 2013 +0200 + + build: require libmbim-glib >= 1.4.0 + + We need it to get SMS support. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 223db868a83d39e38bb5d7cda68a91bbceccd8a5 +Author: Aleksander Morgado +Date: Sun Jun 23 12:08:03 2013 +0200 + + dbus: no need for systemd and nosystemd setups of the service file + + We can just merge them. + + configure.ac | 1 + + data/Makefile.am | + 11 +---------- + ...ce.systemd.in => org.freedesktop.ModemManager1.service.in} | 2 +- + data/org.freedesktop.ModemManager1.service.nosystemd.in | 4 ---- + 4 files changed, 3 insertions(+), 15 deletions(-) + +commit ce6777c53b8a147d0764d46071fa5b9ea46ecb9e +Author: Aleksander Morgado +Date: Sun Jun 23 11:47:41 2013 +0200 + + Revert "systemd: simplify unit file" + + This reverts commit 91898aa8b0bb8164b61e84ae68534c38cebb1482. + + See additional comments in the following bug: + + https://bugzilla.gnome.org/show_bug.cgi?id=701229 + + Basically, 'mask' and 'unmask' operations are not the ones we should + be using + or suggesting; and the Alias= for the DBus file is the correct way + to go. + + .gitignore | 2 ++ + data/Makefile.am | 13 + ++++++++++--- + data/ModemManager.service.in | 1 + + ...n => org.freedesktop.ModemManager1.service.nosystemd.in} | 1 - + data/org.freedesktop.ModemManager1.service.systemd.in | 11 + +++++++++++ + 5 files changed, 24 insertions(+), 4 deletions(-) + +commit b8825f79d524f9c1d27398d025d0e2a5698a2e61 +Author: Aleksander Morgado +Date: Fri Jun 21 10:13:00 2013 +0200 + + build: remove '--with-tests' from the distcheck configure flags + + Makefile.am | 1 - + 1 file changed, 1 deletion(-) + +commit 3862ed6dfddba097d57875202324899b8aa81716 +Author: Aleksander Morgado +Date: Fri Jun 21 10:13:38 2013 +0200 + + build: add gtester.make to the dist tarball + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 6a01e51a5cc2cfb89bba7b0b3adfde45ebf8faff +Author: Aleksander Morgado +Date: Tue Jun 18 17:15:03 2013 +0200 + + tests: avoid printing in stdout by default + + Tests had either their own g_print()s or they would enable a _mm_log() + method to + get all g_debug()s from the libraries printed. In order to cleanup + the result of + the tests run, avoid this stdout dumps by default, and only enable + them if + explicitly enabled in CFLAGS, e.g.: + + $> ./configure CFLAGS="-DENABLE_TEST_MESSAGE_TRACES" + + src/tests/test-modem-helpers-qmi.c | 2 ++ + src/tests/test-modem-helpers.c | 56 + +++++++++++++++++++++----------------- + src/tests/test-sms-part.c | 2 ++ + 3 files changed, 35 insertions(+), 25 deletions(-) + +commit 2a922f836d7d9a4f550ec0d789ff644cbcf5ce69 +Author: Aleksander Morgado +Date: Tue Jun 18 16:55:29 2013 +0200 + + build: remove unneeded GLIB_CHECK_VERSION checks, 2.32 already + required + + libqcdm/tests/test-qcdm.c | 5 ----- + libwmc/tests/test-wmc.c | 5 ----- + src/mm-serial-port.c | 8 -------- + src/tests/test-charsets.c | 5 ----- + src/tests/test-qcdm-serial-port.c | 4 ---- + 5 files changed, 27 deletions(-) + +commit a33e9671ea990cb30d7647db4b52ae16bf300ecb +Author: Aleksander Morgado +Date: Tue Jun 18 16:51:52 2013 +0200 + + build: remove --with-tests option + + configure.ac | 14 -------------- + 1 file changed, 14 deletions(-) + +commit 2ad39277d2737e6e041c6df018bcf581bd78d978 +Author: Aleksander Morgado +Date: Tue Jun 18 16:45:37 2013 +0200 + + build: setup gtester based tests + + gtester.make | 91 + ++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/tests/Makefile.am | 12 ++---- + libqcdm/tests/Makefile.am | 15 ++------ + libwmc/tests/Makefile.am | 18 +++------ + src/tests/Makefile.am | 18 ++------- + 5 files changed, 106 insertions(+), 48 deletions(-) + +commit f3f499fcec13e6ffa9a428972c1108e7c23065d2 +Author: Aleksander Morgado +Date: Tue Jun 18 16:26:51 2013 +0200 + + test: remove testers of the old interface + + Old python tests using the old ModemManager interface are removed, + as mmcli + provides already a much nicer way to test the DBus interface. + + Also, mm-test.py and the PPPD plugin get removed, which were also + using the old + interface, and which were not very useful for testing newer non-PPP + based + modems. + + https://bugzilla.gnome.org/show_bug.cgi?id=702061 + + configure.ac | 21 -- + test/Makefile.am | 30 +-- + test/disable.py | 30 --- + test/disconnect.py | 30 --- + test/enable.py | 30 --- + test/info.py | 261 ---------------------- + test/list-modems.py | 54 ----- + test/location.py | 60 ------ + test/mm-test-pppd-plugin.c | 264 ----------------------- + test/mm-test.py | 527 + --------------------------------------------- + test/modem-autoenable.py | 50 ----- + test/scan.py | 89 -------- + test/send-pin.py | 69 ------ + test/sms-get.py | 80 ------- + test/sms-send.py | 89 -------- + test/ussd.py | 48 ----- + 16 files changed, 2 insertions(+), 1730 deletions(-) + +commit b582ba58e8e5a3f6ab0b0b18b3883b71373e5e05 +Author: Aleksander Morgado +Date: Tue Jun 11 10:11:39 2013 +0200 + + api,introspection: avoid exposing the Contacts interface + + There is no implementation of the Contacts interface yet, just avoid + exposing it + for now. + + https://bugzilla.gnome.org/show_bug.cgi?id=701989 + + docs/reference/api/Makefile.am | 1 - + docs/reference/api/ModemManager-dbus-reference.xml | 2 +- + docs/reference/libmm-glib/libmm-glib-docs.xml | 4 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 88 + ---------------------- + docs/reference/libmm-glib/libmm-glib.types | 3 - + introspection/Makefile.am | 2 +- + introspection/all.xml | 3 +- + ...g.freedesktop.ModemManager1.Modem.Contacts.xml} | 0 + libmm-glib/generated/Makefile.am | 3 - + libmm-glib/mm-manager.c | 2 +- + 10 files changed, 7 insertions(+), 101 deletions(-) + +commit ce84ea510f5213e526917db2d7218d4ca001089d +Author: Aleksander Morgado +Date: Mon Jun 17 08:29:15 2013 +0200 + + bearer-mbim: make packet service attach operation optional + + Some modems do require it, but some others won't (e.g. CDMA based + ones), so + just make the operation optional, but only if the modem replies + NoDeviceSupport. + + https://bugzilla.gnome.org/show_bug.cgi?id=702419 + + src/mm-bearer-mbim.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit e65f6ca2afd32d2abf9bdd6b876801676adda655 +Author: Aleksander Morgado +Date: Mon Jun 17 08:21:22 2013 +0200 + + bearer: MMBearerIpFamily is flags, not enum + + Fixes the following warning... + [mm-broadband-modem-mbim.c:1133] modem_create_bearer(): Creating + MBIM bearer in MBIM modem + GLib-GObject-CRITICAL **: g_param_spec_enum: assertion + `G_TYPE_IS_ENUM (enum_type)' failed + GLib-GObject-CRITICAL **: g_object_class_install_property: + assertion `G_IS_PARAM_SPEC (pspec)' failed + + src/mm-bearer.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit fcede1a80acfdc299c5aa0015012a68846dfc763 +Author: Aleksander Morgado +Date: Sat Jun 15 17:13:55 2013 +0200 + + broadband-modem-qmi: fallback to AT if WMS service not available + for messaging + + It is quite common to have modems handled with QMI but with very + limited + services implemented, e.g. without WMS: + + [/dev/cdc-wdm0] QMI Device supports 5 services: + [/dev/cdc-wdm0] ctl (1.3) + [/dev/cdc-wdm0] wds (1.5) + [/dev/cdc-wdm0] dms (1.2) + [/dev/cdc-wdm0] nas (1.0) + [/dev/cdc-wdm0] cat (0.0) + + We'll now fallback to use plain AT commands when no QMI WMS service + is found. + + src/mm-broadband-modem-qmi.c | 263 + ++++++++++++++++++++++++++++++++++++------- + 1 file changed, 222 insertions(+), 41 deletions(-) + +commit f4c488ea5851ebc5ec61536a21144d3ac88de813 +Author: Aleksander Morgado +Date: Thu Jun 13 12:44:06 2013 +0200 + + docs: reorder version symbols + + docs/reference/api/ModemManager-sections.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0d4cf54cfe01761f0f7997043fe7068c5010eed4 +Author: Aleksander Morgado +Date: Thu Jun 13 11:43:27 2013 +0200 + + api,header: fix MM_MINOR_VERSION definition + + docs/reference/api/ModemManager-sections.txt | 2 +- + include/ModemManager-version.h.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 56cce851533c8aacf68d0349b87fbde9c96d436f +Author: Aleksander Morgado +Date: Thu Jun 13 11:35:57 2013 +0200 + + build: use new mailing list as contact address + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2139e394c2126705fc2940908d487752c3a727cf +Author: Aleksander Morgado +Date: Thu Jun 13 10:56:04 2013 +0200 + + build: setup libtool versioning for libmm-glib + + We'll use it once we've released 0.8. + + configure.ac | 21 +++++++++++++++++++++ + libmm-glib/Makefile.am | 3 +++ + 2 files changed, 24 insertions(+) + +commit a43cecb456327b6a19c026c097d588a08961d394 +Author: Aleksander Morgado +Date: Thu Jun 13 09:48:10 2013 +0200 + + api,header: setup and export MM version symbols in the API + + .gitignore | 2 + + configure.ac | 24 +++++++- + docs/reference/api/ModemManager-dbus-reference.xml | 6 -- + docs/reference/api/ModemManager-docs.xml | 7 +++ + docs/reference/api/ModemManager-sections.txt | 9 +++ + include/Makefile.am | 4 ++ + include/ModemManager-version.h.in | 69 + ++++++++++++++++++++++ + include/ModemManager.h | 9 ++- + 8 files changed, 118 insertions(+), 12 deletions(-) + +commit 0c7265de29163ab9c9ba03257d393ce99bb47ff6 +Author: Aleksander Morgado +Date: Mon Jun 10 18:30:12 2013 +0200 + + build: new strict & permissive polkit policies in '--with-polkit' + + The '--with-polkit' configure switch now supports more options than + just yes + or no: + + * strict: Active user needs to explicitly authenticate when + peforming an + operation defined in the Device.Control, Messaging, Location + or Contacts + interfaces. Polkit policy is set to 'auth_self_keep'. + + * permissive: Active user doesn't need to explicitly authenticate + when + peforming an operation defined in the Device.Control, Messaging, + Location or + Contacts interfaces. Polkit policy is set to 'yes'. + + * none: don't use polkit. + + If '--with-polkit' is not given, usage will be automatically decided + based on + the presence of the Polkit headers in the system (if headers found, + strict + policy will be applied, otherwise none). + + Also: + * '--with-polkit' is equivalent to '--with-polkit=strict' + * '--with-polkit=yes' is equivalent to '--with-polkit=strict' + * '--with-polkit=no' is equivalent to '--with-polkit=none' + * '--without-polkit' is equivalent to '--with-polkit=none' + + By default, ModemManager will always apply the strict policy, in + order to + protect the user from unwanted operations in the modem (e.g. getting + the PIN + locked forever after wrong PIN/PUK unlock attempts). + + https://bugzilla.gnome.org/show_bug.cgi?id=701740 + + .gitignore | 1 + + configure.ac | 61 + ++++++++++++++++------ + data/Makefile.am | 9 ++-- + ... => org.freedesktop.ModemManager1.policy.in.in} | 8 +-- + po/POTFILES.in | 2 +- + po/POTFILES.skip | 1 + + 6 files changed, 57 insertions(+), 25 deletions(-) + +commit dc815569148f9f697bdc827b419258bc3af1c0d6 +Author: Dan Williams +Date: Wed Jun 12 09:16:16 2013 -0500 + + broadband-bearer-qmi: log both IPv4 and IPv6 settings for V4V6 + connections + + Old code only printed one or the other; but if we have dual-stack + connectivity, print everything we can read. + + src/mm-bearer-qmi.c | 79 + +++++++++++++++++++++++++++-------------------------- + 1 file changed, 40 insertions(+), 39 deletions(-) + +commit c2b2f0eb2b44135f5a75781f86b1849fcc71e847 +Author: Aleksander Morgado +Date: Wed Jun 12 10:05:14 2013 +0200 + + docs,api: new migration reference + + docs/reference/api/Makefile.am | 2 + + docs/reference/api/ModemManager-docs.xml | 4 + + .../api/ModemManager-migration-reference.xml | 156 + +++++++++++++++++++++ + 3 files changed, 162 insertions(+) + +commit 0d4bc8240e7662ef50af49b548fcacfbf109b75c +Author: Aleksander Morgado +Date: Wed Jun 12 09:41:32 2013 +0200 + + NEWS: update, add reference to MBIM devices + + NEWS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9327b723df5e2cdc72bdb95f995de4ef101848e2 +Author: Aleksander Morgado +Date: Wed Jun 12 09:40:20 2013 +0200 + + AUTHORS: update + + AUTHORS | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 29fb3fad80c152c70fa0fc6410338d4894a971ac +Author: Aleksander Morgado +Date: Wed Jun 12 09:05:12 2013 +0200 + + README,docs: update basic ModemManager information + + README | 44 + +++++++++++++--------------- + docs/reference/api/ModemManager-overview.xml | 38 + +++++++++++++----------- + 2 files changed, 42 insertions(+), 40 deletions(-) + +commit 2be7adb5eaa6852d91c0e708678c39a641240224 +Author: Aleksander Morgado +Date: Tue Jun 11 10:05:42 2013 +0200 + + api,introspection: update copyright notices + + introspection/org.freedesktop.ModemManager1.Bearer.xml | + 9 ++++----- + introspection/org.freedesktop.ModemManager1.Modem.Contacts.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml | + 9 ++++----- + introspection/org.freedesktop.ModemManager1.Modem.Location.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.Messaging.xml | + 8 ++++---- + .../org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.Simple.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Modem.Time.xml | + 7 ++++--- + introspection/org.freedesktop.ModemManager1.Modem.xml | + 8 ++++---- + introspection/org.freedesktop.ModemManager1.Sim.xml | + 9 ++++----- + introspection/org.freedesktop.ModemManager1.Sms.xml | + 9 ++++----- + introspection/org.freedesktop.ModemManager1.xml | + 8 ++++---- + 14 files changed, 56 insertions(+), 59 deletions(-) + +commit 6920a177d6c2522a2a78ab65b0f3ba7d0c2af05a +Author: Aleksander Morgado +Date: Mon Jun 10 20:30:13 2013 +0200 + + manager: require whitelist for devices in the 'pnp' subsystem + + src/mm-manager.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 97657908315b530ad0c7cbbbd12886d69b44c358 +Author: Aleksander Morgado +Date: Mon Jun 10 16:58:43 2013 +0200 + + build: distribute in .xz format + + Up to 30% size reduction: + + $ du -hs ModemManager-0.7.991.tar.* + 1.6M ModemManager-0.7.991.tar.bz2 + 1.1M ModemManager-0.7.991.tar.xz + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6c098dd9f54bdffbd81e7de172c3b5aa93901692 +Author: Dmitry Ivanyushin +Date: Fri Jun 7 16:26:20 2013 -0500 + + manager: handle PNP-connected devices too + + I have a modem that is connected to motherboard's built-in serial + port. Its + parent is listed in udev as "pnp" so this patch handles that + situation. + + src/mm-manager.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 8d070402073c0c6a02d06740d62f37bcfcfcf7e9 +Author: Aleksander Morgado +Date: Fri Jun 7 16:16:44 2013 +0200 + + man,mmcli: fix minor typo + + docs/man/mmcli.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a00f1d7428a8ecb1f4f8756cf9eaabd0941641a9 +Author: Aleksander Morgado +Date: Thu Jun 6 10:16:22 2013 +0200 + + build: fix distcheck + + data/Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 91898aa8b0bb8164b61e84ae68534c38cebb1482 +Author: Aleksander Morgado +Date: Tue Jun 4 15:18:55 2013 +0200 + + systemd: simplify unit file + + Avoid setting up the Alias rule, which was a helper to let us + 'disable' the + systemd service including dbus-activations. Without the Alias, + 'disable' will + still let starting ModemManager through dbus-activation. If you + really want to + fully disallow starting MM also through dbus-activation, you should + 'mask' and + 'unmask' the service. + + E.g.: + $ sudo systemctl mask ModemManager + ln -s '/dev/null' '/etc/systemd/system/ModemManager.service' + + $ sudo mmcli -L + error: couldn't find the ModemManager process in the bus + + $ sudo systemctl unmask ModemManager + rm '/etc/systemd/system/ModemManager.service' + + $ sudo mmcli -L + No modems were found + + https://bugzilla.gnome.org/show_bug.cgi?id=701229 + + .gitignore | 2 -- + data/Makefile.am | 13 + +++---------- + data/ModemManager.service.in | 1 - + ...osystemd.in => org.freedesktop.ModemManager1.service.in} | 1 + + data/org.freedesktop.ModemManager1.service.systemd.in | 11 + ----------- + 5 files changed, 4 insertions(+), 24 deletions(-) + +commit 81451db1d73e297d0ef034d0a62395d33380d187 +Author: Aleksander Morgado +Date: Tue Jun 4 12:50:27 2013 +0200 + + release: bump version to 0.7.991 + + Tagging to handle the new API updates, so that applications depending + on the + libmm-glib library can use the version number to check support. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4901ee8632f91306230552e14c9c1f8b4ac0742b +Author: Aleksander Morgado +Date: Tue Jun 4 13:33:56 2013 +0200 + + broadband-modem: run *CNTI=2 to when loading supported modes + + It sometimes provides a much better view of the supported modes than + the WS46=? + command, which is not always properly implemented. E.g.: + + Nokia N950: + --------------- + at+ws46=? + (12) + OK + + at*cnti=2 + *CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA,HSUPA + OK + + Sierra AC313u + --------------- + at+ws46=? + ERROR + + at*cnti=2 + *CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA/HSUPA,HSPA+,LTE + OK + + src/mm-broadband-modem.c | 67 + +++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 66 insertions(+), 1 deletion(-) + +commit de944262b43d42d26e218b5f22810b6ab4b6faf6 +Author: Aleksander Morgado +Date: Tue Jun 4 13:31:57 2013 +0200 + + broadband-modem: don't set supported mode defaults based on guesses + + We may be asking to load supported modes while in locked state, + so the commands + may fail. In order to re-load them properly once we're unlocked, + we better just + return an error instead of setting defaults. + + src/mm-broadband-modem.c | 33 ++++++--------------------------- + 1 file changed, 6 insertions(+), 27 deletions(-) + +commit e446db9ca4c31bb18a36ff759d8f7f51c3719178 +Author: Aleksander Morgado +Date: Tue Jun 4 12:48:04 2013 +0200 + + huawei: default to IPv4 if no specific IP type to use given in + NDISDUP modems + + plugins/huawei/mm-broadband-bearer-huawei.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +commit 5b080915200d0ba5de28d50bb088eba0aef9b362 +Author: Aleksander Morgado +Date: Mon Jun 3 12:44:40 2013 +0200 + + api,introspection: Simple.Connect() won't change neither bands nor + allowed modes + + We won't allow changing modes or bands through + Simple.Connect(). Applications + should instead look at the corresponding SupportedBands or + SupportedModes, and + then use SetCurrentBands() or SetCurrentModes() explicitly. + + docs/reference/libmm-glib/libmm-glib-sections.txt | 4 - + .../org.freedesktop.ModemManager1.Modem.Simple.xml | 21 -- + libmm-glib/mm-simple-connect-properties.c | 221 + +-------------------- + libmm-glib/mm-simple-connect-properties.h | 12 -- + src/mm-iface-modem-simple.c | 160 --------------- + 5 files changed, 1 insertion(+), 417 deletions(-) + +commit b41278c423cb81547c65da46057912ad9372715d +Author: Aleksander Morgado +Date: Fri May 31 09:56:30 2013 +0200 + + iface-modem: allow changing capabilities in every state + + Same as done with the firmware switching, we allow capabilities + changing even + if the modem is in FAILED state, e.g. to switch from 3GPP to 3GPP2 + mode. + + src/mm-iface-modem.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit f09eff633c2c6842a6c2e739a0e5b9d72b7255c7 +Author: Aleksander Morgado +Date: Fri May 31 09:14:18 2013 +0200 + + iface-modem: load current modes and bands during initialization + + We now load current modes and bands before enabling the modem, + and we also allow + mode and bands changes while the modem is disabled. + + src/mm-iface-modem.c | 409 + +++++++++++++++++++++++---------------------------- + 1 file changed, 185 insertions(+), 224 deletions(-) + +commit 0db920b7624337fa0b98d17d452fe7b6ecb1f076 +Author: Aleksander Morgado +Date: Wed May 29 17:50:49 2013 +0200 + + mmcli: new '--set-current-capabilities' command + + New command to allow changing modem capabilities, if supported. The + modem will + power cycle automatically after having changed them. + + cli/mmcli-modem.c | 74 + ++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-common-helpers.c | 50 ++++++++++++++++++++++++++++ + libmm-glib/mm-common-helpers.h | 2 ++ + 3 files changed, 126 insertions(+) + +commit da606ef572eeca18af14d04cbcb94f7e7c7eb474 +Author: Aleksander Morgado +Date: Wed May 29 17:52:28 2013 +0200 + + broadband-modem-qmi: update current capabilities loading logic + + Changes being: + + * Don't rely on the band preference TLVs presence. The band + preference TLVs are + always given, even if the modem doesn't support the specific + capability right + away. E.g. a GSM/UMTS/LTE modem configured with 'gsm-umts' + capability (no + 'lte') still shows the LTE band preference TLV in the SSP + responses. + + * Don't automatically add LTE as current capability. We needed this + when we + were not able to change capabilities, so that we didn't lose the + ability to + set 4G mode as allowed. + + src/mm-broadband-modem-qmi.c | 11 ------ + src/mm-modem-helpers-qmi.c | 22 ------------ + src/mm-modem-helpers-qmi.h | 2 -- + src/tests/test-modem-helpers-qmi.c | 72 + +++++++++----------------------------- + 4 files changed, 16 insertions(+), 91 deletions(-) + +commit 83a8e08c3714ce92483e4cba549dcb7e65846b87 +Author: Aleksander Morgado +Date: Wed May 29 17:03:40 2013 +0200 + + broadband-modem-qmi: implement capabilities setting + + src/mm-broadband-modem-qmi.c | 386 + +++++++++++++++++++++++++++++++++++++------ + src/mm-modem-helpers-qmi.c | 49 ++++++ + src/mm-modem-helpers-qmi.h | 2 + + 3 files changed, 384 insertions(+), 53 deletions(-) + +commit a902e6859e077edd72f7b27a48df37f8dd6631e2 +Author: Aleksander Morgado +Date: Fri May 24 12:55:07 2013 +0200 + + api,introspection: new 'SetCurrentCapabilities' method + + For those modems which expose a valid 'SupportedCapabilities' + property with more + than one item in the list, we'll allow switching between them. + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 ++ + .../org.freedesktop.ModemManager1.Modem.xml | 10 ++ + libmm-glib/mm-modem.c | 82 ++++++++++++ + libmm-glib/mm-modem.h | 13 ++ + src/mm-iface-modem.c | 140 + +++++++++++++++++++++ + src/mm-iface-modem.h | 9 ++ + 6 files changed, 261 insertions(+) + +commit 700ebc5c07ce667204f95dbe61716234131c15fb +Author: Aleksander Morgado +Date: Fri May 24 12:35:44 2013 +0200 + + api,introspection: rename 'ModemCapabilities' to + 'SupportedCapabilities' + + And also make it a list of masks, specifying which are the specific + combinations + supported, not just one mask with all. + + E.g.: + ------------------------- + Hardware | manufacturer: 'Sierra Wireless, Incorporated' + | model: 'MC7710' + | revision: 'SWI9200X_03.05.19.04ap r5475 + carmd-en-10527 2012/09/17 17:57:14' + | supported: 'gsm-umts + | gsm-umts, lte' + | current: 'gsm-umts, lte' + | equipment id: '358178040668164' + + cli/mmcli-modem.c | 24 +++- + docs/reference/libmm-glib/libmm-glib-sections.txt | 8 +- + include/ModemManager-enums.h | 2 + + .../org.freedesktop.ModemManager1.Modem.xml | 16 +-- + libmm-glib/mm-common-helpers.c | 125 + +++++++++++++++++++++ + libmm-glib/mm-common-helpers.h | 12 ++ + libmm-glib/mm-modem.c | 122 + ++++++++++++++++++-- + libmm-glib/mm-modem.h | 7 +- + src/mm-broadband-modem-mbim.c | 2 - + src/mm-broadband-modem-qmi.c | 94 ++++++++++------ + src/mm-iface-modem.c | 78 ++++++++++--- + src/mm-iface-modem.h | 14 +-- + src/mm-modem-helpers.c | 28 +++++ + src/mm-modem-helpers.h | 3 + + src/tests/test-modem-helpers.c | 94 ++++++++++++++++ + 15 files changed, 540 insertions(+), 89 deletions(-) + +commit 1c67d050cb0451a63c8fdb0bd673892bdc04e4e0 +Author: Aleksander Morgado +Date: Wed May 29 13:42:14 2013 +0200 + + api,introspection: merge 'AllowedModes' and 'SupportedMode' into + 'CurrentModes' + + We now have a single 'CurrentModes' property which contains both + values in a + tuple with signature "(uu)". + + Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update + the list of + arguments expected to have a single "(uu)" tuple. + + cli/mmcli-modem.c | 37 ++-- + docs/reference/libmm-glib/libmm-glib-sections.txt | 28 ++- + .../org.freedesktop.ModemManager1.Modem.xml | 45 ++--- + libmm-glib/mm-modem.c | 87 ++++----- + libmm-glib/mm-modem.h | 12 +- + libmm-glib/mm-simple-connect-properties.c | 22 +-- + libmm-glib/mm-simple-connect-properties.h | 4 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 18 +- + plugins/huawei/mm-broadband-modem-huawei.c | 20 +-- + plugins/icera/mm-broadband-modem-icera.c | 18 +- + plugins/linktop/mm-broadband-modem-linktop.c | 18 +- + plugins/longcheer/mm-broadband-modem-longcheer.c | 18 +- + plugins/mbm/mm-broadband-modem-mbm.c | 34 ++-- + plugins/novatel/mm-broadband-modem-novatel.c | 26 +-- + plugins/option/mm-broadband-modem-option.c | 18 +- + plugins/sierra/mm-broadband-modem-sierra.c | 28 +-- + plugins/simtech/mm-broadband-modem-simtech.c | 72 ++++---- + plugins/wavecom/mm-broadband-modem-wavecom.c | 48 ++--- + plugins/x22x/mm-broadband-modem-x22x.c | 18 +- + plugins/zte/mm-broadband-modem-zte.c | 18 +- + src/mm-broadband-modem-qmi.c | 102 +++++------ + src/mm-iface-modem-simple.c | 22 +-- + src/mm-iface-modem.c | 198 + +++++++++++++-------- + src/mm-iface-modem.h | 16 +- + 24 files changed, 481 insertions(+), 446 deletions(-) + +commit 45ceba76924f184ed9e12ba3d35e00a55ad3a197 +Author: Aleksander Morgado +Date: Wed May 29 12:41:49 2013 +0200 + + api,introspection: 'SupportedModes' is now a list of possible + combinations + + Instead of just a mask of MMModemMode values, we now provide a list + of the + allowed and preferred mode combinations supported by the modem. E.g.: + + $> sudo mmcli -m 0 + ------------------------- + Modes | supported: 'allowed: 2g; preferred: none + | allowed: 3g; preferred: none + | allowed: 2g, 3g; preferred: none + | allowed: 2g, 3g; preferred: 2g + | allowed: 2g, 3g; preferred: 3g + | allowed: 4g; preferred: none + | allowed: 2g, 3g, 4g; preferred: none' + + cli/mmcli-modem.c | 16 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 + + .../org.freedesktop.ModemManager1.Modem.xml | 23 ++- + libmm-glib/Makefile.am | 2 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-common-helpers.c | 122 ++++++++++++ + libmm-glib/mm-common-helpers.h | 12 ++ + libmm-glib/mm-helper-types.h | 44 +++++ + libmm-glib/mm-modem.c | 121 +++++++++++- + libmm-glib/mm-modem.h | 8 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 82 +++++++- + plugins/huawei/mm-broadband-modem-huawei.c | 93 +++++++++- + plugins/icera/mm-broadband-modem-icera.c | 92 ++++++++- + plugins/iridium/mm-broadband-modem-iridium.c | 17 +- + plugins/linktop/mm-broadband-modem-linktop.c | 88 ++++++++- + plugins/longcheer/mm-broadband-modem-longcheer.c | 106 +++++++++-- + plugins/mbm/mm-broadband-modem-mbm.c | 79 ++++++++ + plugins/nokia/mm-broadband-modem-nokia.c | 41 ---- + plugins/novatel/mm-broadband-modem-novatel.c | 90 ++++++++- + plugins/option/mm-broadband-modem-option.c | 92 ++++++++- + plugins/sierra/mm-broadband-modem-sierra.c | 119 +++++++++++- + plugins/simtech/mm-broadband-modem-simtech.c | 109 ++++++++++- + plugins/wavecom/mm-broadband-modem-wavecom.c | 134 +++++++++----- + plugins/x22x/mm-broadband-modem-x22x.c | 84 ++++++++- + plugins/zte/mm-broadband-modem-zte.c | 103 ++++++++++- + src/mm-broadband-modem-mbim.c | 70 ++++--- + src/mm-broadband-modem-qmi.c | 143 +++++++++++--- + src/mm-broadband-modem.c | 23 ++- + src/mm-iface-modem.c | 206 + ++++++++++++++------- + src/mm-iface-modem.h | 19 +- + src/mm-modem-helpers-qmi.c | 23 +++ + src/mm-modem-helpers-qmi.h | 2 + + src/mm-modem-helpers.c | 47 +++++ + src/mm-modem-helpers.h | 3 + + src/tests/test-modem-helpers.c | 124 +++++++++++++ + 35 files changed, 2047 insertions(+), 294 deletions(-) + +commit 212d00c529ee07131bf3b71a8759dca49292c059 +Author: Aleksander Morgado +Date: Wed May 29 10:47:53 2013 +0200 + + api,instrospection: rename 'Bands' to 'CurrentBands' + + ... and 'SetBands()' to 'SetCurrentBands()'. + + We'll keep the 'Current' keyword in those properties which also have + 'Supported' values. + + cli/mmcli-modem-simple.c | 2 +- + cli/mmcli-modem.c | 99 +++++++------- + docs/reference/libmm-glib/libmm-glib-sections.txt | 32 ++--- + .../org.freedesktop.ModemManager1.Modem.Simple.xml | 4 +- + .../org.freedesktop.ModemManager1.Modem.xml | 8 +- + libmm-glib/mm-modem.c | 150 + ++++++++++----------- + libmm-glib/mm-modem.h | 32 ++--- + libmm-glib/mm-simple-connect-properties.c | 66 ++++----- + libmm-glib/mm-simple-connect-properties.h | 4 +- + libmm-glib/mm-simple-status.c | 62 ++++----- + libmm-glib/mm-simple-status.h | 10 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 22 +-- + plugins/huawei/mm-broadband-modem-huawei.c | 22 +-- + plugins/icera/mm-broadband-modem-icera.c | 64 ++++----- + plugins/wavecom/mm-broadband-modem-wavecom.c | 22 +-- + src/mm-broadband-modem-qmi.c | 22 +-- + src/mm-iface-modem-simple.c | 32 +++-- + src/mm-iface-modem.c | 136 + +++++++++---------- + src/mm-iface-modem.h | 30 ++--- + 19 files changed, 408 insertions(+), 411 deletions(-) + +commit 4dc8d1ff3a88a54707e75859619b020780de2f79 +Author: Aleksander Morgado +Date: Thu May 23 11:53:54 2013 +0200 + + broadband-modem-mbim: implement supported IP families loading + + src/mm-broadband-modem-mbim.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 8f3bf6b8949d2cd046daea2cb1e7077769afeb2c +Author: Aleksander Morgado +Date: Thu May 23 11:49:16 2013 +0200 + + broadband-modem-qmi: implement supported IP families loading + + We'll default to IPv4 if the modem is CDMA-only, and IPv4+IPv6 + otherwise. + + src/mm-broadband-modem-qmi.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 2e223b5dbd60daef5e7a02f75973c72e62910f0d +Author: Aleksander Morgado +Date: Thu May 23 11:45:51 2013 +0200 + + mmcli,modem: show supported IP families in modem info + + cli/mmcli-modem.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 44ddbf48e2dae9efb2e8d87298c82a2c3020578c +Author: Aleksander Morgado +Date: Thu May 23 11:42:19 2013 +0200 + + broadband-bearer: use the new CGDCONT=? test response parser + + src/mm-broadband-bearer.c | 60 + ++++++++++++++--------------------------------- + 1 file changed, 18 insertions(+), 42 deletions(-) + +commit 7b3dd32df71b9c61ff521fd3f910da3ec6c42fb9 +Author: Aleksander Morgado +Date: Thu May 23 10:41:18 2013 +0200 + + broadband-modem: implement default supported IP families loading + + For CDMA-only devices, we will default to IPv4. + + For 3GPP devices, we will use the AT+CGDCONT=? test command to query + which are + the supported PDP types. + + src/mm-broadband-modem.c | 79 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit 2acb125819fbda75dfc19b6c008137bb3b2ebb6e +Author: Aleksander Morgado +Date: Thu May 23 10:40:23 2013 +0200 + + modem-helpers: new CGDCONT=? test response parser + + src/mm-modem-helpers.c | 82 + ++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 10 +++++ + src/tests/test-modem-helpers.c | 90 + ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 182 insertions(+) + +commit bd360aa029f27ad2fc9f8a937765f4c3e61581fd +Author: Aleksander Morgado +Date: Thu May 23 10:39:59 2013 +0200 + + libmm-glib,modem: handle the new 'SupportedIpFamilies' property + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +++ + libmm-glib/mm-modem.c | 18 ++++++++++++++++++ + libmm-glib/mm-modem.h | 2 ++ + 3 files changed, 23 insertions(+) + +commit b3222202bdabf762ffe0b2e92835ab22a3cd3d5c +Author: Aleksander Morgado +Date: Thu May 23 10:39:13 2013 +0200 + + api,introspection: new 'SupportedIpFamilies' property + + This property will let the clients know which are the IP families + supported by + the modem. + + .../org.freedesktop.ModemManager1.Modem.xml | 8 +++++ + src/mm-iface-modem.c | 41 + ++++++++++++++++++++++ + src/mm-iface-modem.h | 8 +++++ + 3 files changed, 57 insertions(+) + +commit 7ad30ecce14f72a1b4bfe0274a2fefedf734d56a +Author: Aleksander Morgado +Date: Thu May 23 10:08:08 2013 +0200 + + modem-helpers: rename CGDCONT? tests + + Adding the 'read' suffix, as they are for CGDCONT? read responses. + + src/tests/test-modem-helpers.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit 804642adc234094717158ff09857de1432565dda +Author: Aleksander Morgado +Date: Wed May 22 17:43:21 2013 +0200 + + api: let MMBearerIpFamily be flags instead of a enumeration + + We want to expose in the Modem interface the list of supported IP + families, and + the easiest way to do so is to have the IP family as flags, and + provide in the + interface a single enum. + + Also, a value of 0 for a MMBearerIpFamily specifies that no flags + are set, so + just rename it to 'NONE'. + + And add a new 'ANY' value which sets all flags to 1. + + cli/mmcli-bearer.c | 8 ++++-- + include/ModemManager-enums.h | 12 +++++---- + libmm-glib/mm-bearer-properties.c | 6 ++--- + libmm-glib/mm-common-helpers.c | 12 ++++----- + libmm-glib/mm-simple-connect-properties.c | 2 +- + src/mm-bearer-mbim.c | 40 + ++++++++++++++++++++---------- + src/mm-bearer-qmi.c | 41 + +++++++++++++++++++------------ + src/mm-broadband-bearer.c | 31 +++++++++++++++++------ + src/mm-iface-modem-simple.c | 6 +++-- + src/mm-modem-helpers.c | 4 +-- + 10 files changed, 104 insertions(+), 58 deletions(-) + +commit a42234dd1c680e7604008fc2e66be849c7bf70de +Author: Aleksander Morgado +Date: Tue Jun 4 11:25:14 2013 +0200 + + bearers: update connection logic in 3GPP+3GPP2 devices + + https://bugzilla.gnome.org/show_bug.cgi?id=701333 + + src/mm-bearer-mbim.c | 26 +++++++++++++++++++++ + src/mm-bearer-qmi.c | 31 +++++++++++++++++++++++++ + src/mm-broadband-bearer.c | 59 + +++++++++++++++++++++++++++++++++++++++++++---- + 3 files changed, 112 insertions(+), 4 deletions(-) + +commit 68a7d1a3ac0a62379280dbd40c632113273df00f +Author: Dan Williams +Date: Fri May 31 13:13:57 2013 -0500 + + broadband-modem-mbm: *EPIN response often needs a lot of time + + If the modem was locked, it'll delay responding until the SIM + is ready, + which can take a long time. + + plugins/mbm/mm-broadband-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fe5c81458ff6c06029376e7fc311bb1af11da232 +Author: Dan Williams +Date: Fri May 31 11:23:16 2013 -0500 + + nokia: CS-12 appears to only accept PPP on USB interface 3 + + Attempting PPP on interface 1 never returns CONNECT, simply hangs and + times out at the dial. + + plugins/nokia/77-mm-nokia-port-types.rules | 2 ++ + 1 file changed, 2 insertions(+) + +commit 93fcaf93ce92aa8b335705e66c993dc6f9e628b0 +Author: Dan Williams +Date: Thu May 30 23:51:05 2013 -0500 + + modem-helpers: handle commas within +COPS response items (bgo #701329) + + Modems can probably put whatever they want between the quotes for + the operator name, including commas. Handle that. + + https://bugzilla.gnome.org/show_bug.cgi?id=701329 + + src/mm-modem-helpers.c | 2 +- + src/tests/test-modem-helpers.c | 14 ++++++++++++++ + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit 67d3ed11d383b591d8fec4810eef1d2c9ab4ac37 +Author: Dan Williams +Date: Tue May 28 15:06:59 2013 -0500 + + broadband-bearer: don't create PDP context when using an existing one + (bgo #701151) + + If the context is already defined, then we can just use it instead + of calling +CGDCONT to create it again. Modems don't like this, + plus it's pointless. + + https://bugzilla.gnome.org/show_bug.cgi?id=701151 + + src/mm-broadband-bearer.c | 38 ++++++++++++++++++++++++++------------ + 1 file changed, 26 insertions(+), 12 deletions(-) + +commit ba14d15df349502f2fa1c2e60b9f472635b83f1d +Author: Ben Chan +Date: Tue May 28 08:29:49 2013 -0700 + + novatel-lte: increase number of retries for connection status checks + + This patch increases the number of retries, from 4 to 60, for + connection + status check during a connection / disconnection request, which + handles + some scenario when the connection / disconnection request takes more + than 5 seconds to complete. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c4f0ad6905fc33133ba3bda53e976f84a30d77ad +Author: Ben Chan +Date: Mon May 27 20:55:35 2013 -0700 + + novatel-lte: normalize QMI status when included in DBus error message + + This patches normalize a response for the AT$NWQMISTATUS command, by + replacing white-space characters with a space, before the response is + included in a DBus error message. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 33 + ++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 4 deletions(-) + +commit 05ac6b6cf1567ced672f913e1c5a91580982d1b6 +Author: Aleksander Morgado +Date: Mon May 27 15:45:03 2013 +0200 + + wavecom: don't grab ports handled by the qcserial driver + + Sierra Wireless will assign the Wavecom USB vendor ID to some + Gobi-based modems, + like the MC7750. Just ignore those by filtering out all devices with + the Wavecom + USB vendor ID if they are handled by the qcserial driver. + + plugins/wavecom/mm-plugin-wavecom.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit e134a81a87ff8bc4e43393b99d14a6bac88dc67a +Author: Aleksander Morgado +Date: Thu May 23 13:16:54 2013 +0200 + + build: use --enable-gtk-doc instead of our custom --with-docs + + Makefile.am | 2 +- + configure.ac | 14 +------------- + 2 files changed, 2 insertions(+), 14 deletions(-) + +commit 3ed1cb2e1dd111ed0e5435bbc88396b42180df1d +Author: Aleksander Morgado +Date: Thu May 23 13:10:58 2013 +0200 + + docs: don't require 'dia' to build the docs + + These diagrams are not expected to change much, so just include + the generated + PNGs in the repository, and remove 'dia' from the prerequisites to + build the + documentation. + + configure.ac | 8 ------- + data/Makefile.am | 10 ++++++++- + ...nterface-initialization-sequence-subclassed.dia | 0 + ...nterface-initialization-sequence-subclassed.png | Bin 0 -> 31781 bytes + ...emManager-interface-initialization-sequence.dia | 0 + ...emManager-interface-initialization-sequence.png | Bin 0 -> 20059 bytes + .../reference/api => data}/ModemManager-states.dia | 0 + data/ModemManager-states.png | Bin 0 -> 38256 bytes + docs/reference/api/Makefile.am | 25 + +++++++-------------- + 9 files changed, 17 insertions(+), 26 deletions(-) + +commit 5c8f1fe0f25973a248b3fe7418d154fa400d07cc +Author: Aleksander Morgado +Date: Thu May 23 17:38:09 2013 +0200 + + mmcli: fix newline prefixing + + The last line in a multi-line string was getting lost if it wasn't + '\n' + terminated. + + cli/mmcli-common.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit a12be165d14083c11d9f8f916b1dd82ae3cf9e21 +Author: Aleksander Morgado +Date: Thu May 23 15:52:31 2013 +0200 + + libmm-glib,modem: avoid accessing an already freed GArray + + We cannot g_array_unref() the GArray when get()-ing bands as that + will clear + the contents of the GArray, even if there are references + around. Instead, just + dup the array contents when returning. + + libmm-glib/mm-modem.c | 77 + +++++++++++++++++++++++++++++++-------------------- + 1 file changed, 47 insertions(+), 30 deletions(-) + +commit d0a8911cf66b7a4f6a6209698bfabd69af1aa3f5 +Author: Aleksander Morgado +Date: Wed May 22 17:47:35 2013 +0200 + + modem-helpers-mbim: handle MBIM_PIN_TYPE_UNKNOWN in switch + + src/mm-modem-helpers-mbim.c | 1 + + 1 file changed, 1 insertion(+) + +commit 7ceca95323a5fb01c81343884d6051c7427cedb5 +Author: Aleksander Morgado +Date: Wed May 22 17:47:07 2013 +0200 + + build: require mbim-glib >= 1.0.0 when building MBIM support + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3332333852e472ec5c3d4d9bff6734cc7d935bb8 +Author: Ben Chan +Date: Mon May 20 01:20:08 2013 -0700 + + novatel: fix invalid comparison of unsigned expression + + This patch fixes the following invalid comparison of unsigned + expression: + + novatel/mm-plugin-novatel.c:148:29: error: comparison of unsigned + expression >= 0 is always true [-Werror,-Wtautological-compare] + if (ctx->nwdmat_retries >= 0) { + ~~~~~~~~~~~~~~~~~~~ ^ ~ + + Bug reported on + https://code.google.com/p/chromium/issues/detail?id=242150 + + plugins/novatel/mm-plugin-novatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 619b327012dde1120a2018d020bcdaf11d59ca4d +Author: Aleksander Morgado +Date: Fri May 17 15:01:12 2013 +0200 + + broadband-modem-qmi: when listing all SMS fails, list per tag + + Some QMI modems seem to fail when requesting to list all SMS messages + in a given + storage. When this happens, we'll loop through all storages but + performing per + tag list requests. + + src/mm-broadband-modem-qmi.c | 126 + +++++++++++++++++++++++++++++++++---------- + 1 file changed, 99 insertions(+), 27 deletions(-) + +commit 09d70454b4e276ff2091c650cbfb0978dcf54f17 +Author: Aleksander Morgado +Date: Fri May 17 13:11:43 2013 +0200 + + sms-qmi: always specify message mode when deleting SMS messages + + src/mm-sms-qmi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 5caa0c96fbcaabbbf15546d511c1fea097b30a44 +Author: Aleksander Morgado +Date: Thu May 16 16:16:39 2013 +0200 + + broadband-modem-qmi: always specify message mode when reading SMS + + src/mm-broadband-modem-qmi.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 2a93ca92810c6759dd51936ef6b76791504ee41a +Author: Aleksander Morgado +Date: Thu May 9 10:50:31 2013 +0200 + + bearer: defer forced disconnection when modem unregistered while + connected + + If the bearer is connected and we get a notification of being + unregistered, wait + up to 15s to force the disconnection, in case we can recover the + registration + in the meantime. + + https://bugzilla.gnome.org/show_bug.cgi?id=699803 + + src/mm-bearer.c | 141 + +++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 108 insertions(+), 33 deletions(-) + +commit e18e1686820136fe133651231f8a1d28da9912bc +Author: Aleksander Morgado +Date: Tue May 7 14:59:20 2013 +0200 + + bearer: allow registration changes from/to SEARCHING without + disconnecting + + We allow the modem to be connected while the registration state is + 'SEARCHING', + which may happen when the coverage is poor. + + src/mm-bearer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2bb0a23b1f3de4d3234193f392941a57160c606c +Author: Aleksander Morgado +Date: Tue May 7 14:57:43 2013 +0200 + + iface-modem-3gpp: remove the deferred registration updates + + We should really notify registration updates right away in the + DBus interface. + + src/mm-iface-modem-3gpp.c | 95 + ----------------------------------------------- + 1 file changed, 95 deletions(-) + +commit 82a0787906dbf06219202345e2d39be1cb4e9350 +Author: Ben Chan +Date: Fri May 17 11:05:44 2013 -0700 + + device: check for NULL driver in add_port_driver + + This patch fixes a crash in MMDevice::add_port_driver() due to + g_str_equal() dereferencing a NULL driver returned by + mm_device_utils_get_port_driver(). + + Bug reported on + https://code.google.com/p/chromium/issues/detail?id=241823 + + src/mm-device.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit e63e062a76d9598d62d0efc21a6a5853ce1f33d9 +Author: Aleksander Morgado +Date: Fri May 17 23:14:36 2013 +0200 + + build: use -Wformat-security + + m4/compiler_warnings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 48f47cd53f69d43cd797a8889c86e688727a1441 +Author: Aleksander Morgado +Date: Fri May 17 08:48:24 2013 +0200 + + sms: fix validity variant parsing + + src/mm-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f31ab0943336ab1919b74f0ac0426ed2a427edda +Author: Adrian Bunk +Date: Sun May 12 17:10:32 2013 +0300 + + configure.ac: enable maintainer mode by default + + This is how it should be, and also consistent with NetworkManager. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 027d95506cd599db8d23e471c5d9136f86e707d3 +Author: Aleksander Morgado +Date: Thu May 9 13:39:32 2013 +0200 + + huawei: use ^SYSINFOEX if available instead of ^SYSINFO + + Newer Huawei modems, like the E3276 or the ME906 won't support + ^SYSINFO, and we + should instead use the newer ^SYSINFOEX. By default, use ^SYSINFOEX + when + available, as it provides more information than the plain ^SYSINFO. + + E.g.: + ^SYSINFOEX:2,3,0,1,,3,"WCDMA",41,"HSPA+" + ^SYSINFOEX:2,3,1,1,1,3,”WCDMA”,46,”DC-HSPA+” + + plugins/huawei/mm-broadband-modem-huawei.c | 545 + ++++++++++++++++++++++++----- + 1 file changed, 458 insertions(+), 87 deletions(-) + +commit f96bb04c001d637a43989961a57ddaa553aa7a27 +Author: Aleksander Morgado +Date: Thu May 9 12:36:08 2013 +0200 + + huawei: ignore ^NDISSTAT unsolicited messages + + These messages give us information about the current connection + status in the + NDIS interface. We already have other means to know this status, + so we just + ignore the unsolicited message for now. + + E.g.: + ^NDISSTAT: 1,,,"IPV4" + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit cba3f7db657d53db910e725f95c258f4faabcbbd +Author: Aleksander Morgado +Date: Thu May 9 12:32:53 2013 +0200 + + huawei: ignore ^HCSQ unsolicited messages + + Newer Huawei modems use ^HCSQ to report per-interface signal quality + values, + but we don't know yet what each field means for each technology, + so just ignore + them for now. + + E.g.: + ^HCSQ: "GSM", 53 + ^HCSQ: "WCDMA", 26, 24, 43 + ^HCSQ: "LTE", 40, 28, 216, 14 + + We also don't use this message to update current access technology + information, + as it is not detailed enough (e.g. WCDMA doesn't specify whether + it's plain UMTS + or HSDPA or HSPA+...) + + plugins/huawei/mm-broadband-modem-huawei.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit d169c99dc960f02233f65b2fcfb702b76814594f +Author: Aleksander Morgado +Date: Tue May 7 18:49:57 2013 +0200 + + novatel: skip $NWDMAT if the modem has QMI ports + + plugins/novatel/mm-plugin-novatel.c | 142 + +++++++++++++++++++++++++++++++++++- + 1 file changed, 141 insertions(+), 1 deletion(-) + +commit 2c83334c259ef2e1a1f61fa9fb8ac42751933923 +Author: Aleksander Morgado +Date: Tue May 7 09:11:28 2013 +0200 + + novatel: allow QMI-powered modems + + plugins/novatel/mm-plugin-novatel.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +commit 031657cea5dd6afa5e3c0573afbd3b3c44afe417 +Author: Aleksander Morgado +Date: Tue May 7 09:08:17 2013 +0200 + + novatel: don't filter out the USB551L + + We filter the E362 because it's managed by the Novatel LTE plugin. If + we also + filter out the USB551L, but it's not explicitly grabbed by any other + plugin, it + will default to the Generic one. + + plugins/novatel/mm-plugin-novatel.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 76d97c6334908dc6dab6972f8142c3a64081e3ec +Author: Aleksander Morgado +Date: Tue May 7 09:05:49 2013 +0200 + + novatel: don't explicitly filter by drivers + + No real need to do it; the VID filter is already enough. + + plugins/novatel/mm-plugin-novatel.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 89ae657fcedf0028cfd46aede6ecd308494747d4 +Author: Dan Williams +Date: Mon Apr 22 10:57:48 2013 -0500 + + telit: add basic plugin for Telit 3GPP and 3GPP2 devices + + plugins/Makefile.am | 12 +- + plugins/telit/77-mm-telit-port-types.rules | 48 +++++++ + plugins/telit/mm-broadband-modem-telit.c | 210 + +++++++++++++++++++++++++++++ + plugins/telit/mm-broadband-modem-telit.h | 49 +++++++ + plugins/telit/mm-plugin-telit.c | 136 +++++++++++++++++++ + plugins/telit/mm-plugin-telit.h | 42 ++++++ + 6 files changed, 496 insertions(+), 1 deletion(-) + +commit c4fa405e2e3c66ca69594cef7f0f517da94a5ff7 +Author: Dan Williams +Date: Mon May 6 10:51:01 2013 -0500 + + sms: enforce message 'class' value validity + + Class is -1 to 3, so warn about out-of-bounds values when it's + being set on the client side. + + libmm-glib/mm-sms-properties.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 9bbcd9d6a5d0b01e16bdd4f94f707f0341f73e24 +Author: Dan Williams +Date: Tue Apr 30 12:07:16 2013 -0500 + + sms: add support for message class + + We need to redefine the message class property to int since class + 0 is a valid message class. Thus -1 now means "unspecified class". + + .../org.freedesktop.ModemManager1.Sms.xml | 7 +++-- + libmm-glib/mm-sms-properties.c | 35 + +++++++++++----------- + libmm-glib/mm-sms-properties.h | 4 +-- + libmm-glib/mm-sms.c | 6 ++-- + libmm-glib/mm-sms.h | 2 +- + src/mm-broadband-modem.c | 2 +- + src/mm-sms-part.c | 20 +++++++------ + src/mm-sms-part.h | 4 +-- + src/tests/test-sms-part.c | 16 +++++----- + 9 files changed, 50 insertions(+), 46 deletions(-) + +commit ab4198f576cb4308fecef3897675fe49cbcbe48a +Author: Dan Williams +Date: Mon Apr 29 10:23:20 2013 -0500 + + broadband-modem-zte: chain up to parent access tech loading for + CDMA-only devices (bgo #698850) + + CDMA-only devices don't support +ZPAS for access tech loading, + so chain up to the + parent so we get the QCDM fallback access tech loading functions. + + https://bugzilla.gnome.org/show_bug.cgi?id=698850 + + plugins/zte/mm-broadband-modem-zte.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +commit 7d671825213eef4f4be5a67a5f8ce2cfd58a3fbc +Author: Dan Williams +Date: Fri May 3 15:33:56 2013 -0500 + + broadband-modem-nokia: load access technology with *CNTI if possible + + Works on the N9/N950, but not supported by the N900. + + plugins/nokia/mm-broadband-modem-nokia.c | 124 + +++++++++++++++++++++++++++++++ + 1 file changed, 124 insertions(+) + +commit 881da689dacf474ffb8edba8143f995a9a33ad33 +Author: Dan Williams +Date: Fri May 3 15:34:32 2013 -0500 + + broadband-modem-nokia: N900 doesn't disable echo unless explicitly + done + + During init, the N900 appears to ignore an E0 in the same command as + an E1. So just add another init command to disable echo, which won't + have any effect on devices that work with the first command. + + plugins/nokia/mm-broadband-modem-nokia.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 2eee2e48ba65a24b17a0b91a619027a0c6f3185a +Author: Ben Chan +Date: Mon May 6 00:24:25 2013 -0700 + + sierra: remove comparison of unsigned expression >= 0 + + This patch removes an unnecessary check of unsigned expression >= 0, + which also fixes the following clang warnings: + + sierra/mm-broadband-modem-sierra.c:570:18: error: comparison of + unsigned expression >= 0 is always true + [-Werror,-Wtautological-compare] + mode >= 0 && + ~~~~ ^ ~ + + Bug reported on + https://code.google.com/p/chromium/issues/detail?id=235989 + Patched by Yunlian Jiang + + plugins/sierra/mm-broadband-modem-sierra.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 9f702aed0297ff180fd6b3bce0e30db95a082e81 +Author: Ben Chan +Date: Tue Apr 30 12:54:54 2013 -0700 + + broadband-bearer: fix cid check in disconnect_3gpp + + A value 0 is used to denote an invalid/uninitialized CID. This patch + fixes a CID check in disconnect_3gpp() of MMBroadbandBearer such + that it + disables all PDP contexts via AT+CGACT=0 when no specific CID is used + (i.e. cid == 0). + + src/mm-broadband-bearer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 32d6dda859ec599340ddd58f2b26e8d8769952f8 +Author: Ben Chan +Date: Tue Apr 30 13:32:11 2013 -0700 + + broadband-modem: update signal quality normalization + + This patch updates normalize_ciev_cind_signal_quality() in + MMBroadbandModem to remove an unnecessary check on 'quality >= 0' and + also makes sure the normalized signal quality is capped at 100 when no + maximum is specified. + + This is revised from a patch originally authored by + Yunlian Jiang . + + Bug reported on + https://code.google.com/p/chromium/issues/detail?id=235989 + + src/mm-broadband-modem.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 862eaf4d584037cc44ad662b60a131ec04a972f0 +Author: Dan Williams +Date: Tue Apr 30 09:38:32 2013 -0500 + + serial-port-qcdm: set SEND_DELAY to 0 (bgo #698869) + + For some reason a number of ZTE CDMA devices want the whole QCDM + frame in one USB transaction, or at least don't like it being + broken up and sent byte-by-byte with a send delay. They simply + don't respond. Since testing indicates that every other QCDM + capable device I've got also handles a zero send delay on both + 3.8.8 and 2.6.32, lets just set it to zero for everything, + which should speed things up a bit too. + + https://bugzilla.gnome.org/show_bug.cgi?id=698869 + + src/mm-qcdm-serial-port.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9dcbf33c88615b6b3baeec0d79a320b6df0bd403 +Author: Yunlian Jiang +Date: Mon Apr 29 11:53:26 2013 -0500 + + mm-glib: use correct enum type + + libmm-glib/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2e8866c8b74c50c3c5318b13cfc78530a6130c41 +Author: Dan Williams +Date: Wed Apr 24 14:46:23 2013 -0500 + + time: normalize GetNetworkTime() response to local time + timezone + info (bgo #697372) + + The GetNetworkTime() response is defined to be an ISO8601 string, + which + is in turn defined to be in local time. Make sure that's reflected in + the documentation, and append the timezone offset to UTC where we have + it. + + Oddly, Icera devices return their time info in UTC with an offset to + the local timezone, so we have to jump through some hoops there to + convert the response to localtime based on the reported offset. + + Some additional fixes by Aleksander Morgado . + + https://bugzilla.gnome.org/show_bug.cgi?id=697372 + + .../org.freedesktop.ModemManager1.Modem.Time.xml | 6 +- + plugins/icera/mm-broadband-modem-icera.c | 94 + ++++++++++++++-------- + plugins/novatel/mm-broadband-modem-novatel.c | 5 +- + plugins/sierra/mm-broadband-modem-sierra.c | 4 +- + src/mm-modem-helpers.c | 32 ++++++++ + src/mm-modem-helpers.h | 9 +++ + 6 files changed, 110 insertions(+), 40 deletions(-) + +commit 7d3a4aba4fb0f7920e40f88836698a0a10bc7e3c +Author: Dan Williams +Date: Thu Apr 25 15:07:19 2013 -0500 + + broadband-modem: fix assertion during capabilities checking (bgo + #698845) + + If no capabilities could be determined from the modem's responses, + result would be NULL but no error would be set, since the modem + didn't time out or have some other critical error, it simply didn't + report any recognized capabilities. Ensure that an error is + reported in this case. + + https://bugzilla.gnome.org/show_bug.cgi?id=698845 + + src/mm-broadband-modem.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 135bec690ddbb1b8974d90d60317c1ad1b6d935e +Author: Aleksander Morgado +Date: Thu Apr 25 19:05:04 2013 +0200 + + sms: initialize the validity property when creating SMS + + src/mm-sms.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 456a4289b7532f646fe697118cc7bfb386f7d328 +Author: Aleksander Morgado +Date: Thu Apr 25 19:04:35 2013 +0200 + + libmm-glib: handle relative validity in the MMSmsProperties + + docs/reference/libmm-glib/libmm-glib-sections.txt | 5 +- + libmm-glib/mm-sms-properties.c | 70 + ++++++++++++++++------- + libmm-glib/mm-sms-properties.h | 5 +- + 3 files changed, 55 insertions(+), 25 deletions(-) + +commit 23204111130fca0a93a22508431ad8bb17210bdd +Author: Dan Williams +Date: Wed Apr 24 16:48:29 2013 -0500 + + broadband-modem-icera: fix issues checking supported bands + + Icera devices include bands that the modem doesn't support in + the %IPBM=? list, so the plugin sets the band to its current + enabled/disabled value to test whether that band is supported. + There were two problems with this approach: + + 1) Setting an already-enabled band to be enabled apparently + isn't a NOP; it might take more than the 3 seconds given, and + if the response comes after 3 seconds, this greatly confuses + ModemManager because the AT command/reply sequence is now + messed up. So increase the timeout to 10 seconds. + + 2) Why bother checking bands that are already enabled anyway? + We already know they are supported, so just don't check those + bands at all. This requires some parkour because we use the + parsed band array from %IPBM=? to track whether bands are + enabled/disabled by indexing into the array, so instead just + use two separate arrays. This actually makes the fix for #1 + un-needed (because we never enable any bands) but it's good + to have #1 anyway. + + plugins/icera/mm-broadband-modem-icera.c | 51 + ++++++++++++++++++++++---------- + 1 file changed, 36 insertions(+), 15 deletions(-) + +commit 18bfefba2dba3f5c77cd971820646d84a85f9334 +Author: Dan Williams +Date: Wed Apr 24 15:04:57 2013 -0500 + + iface-modem: fix array insertion when setting bands + + You can't g_array_insert_val() to an index that's beyond the end + of the array, which was happening if the user tried to set the + band list to "any": + + mmcli -m 0 --set-bands=any + + Just use g_array_append_val() instead. + + ==5618== Invalid read of size 2 + ==5618== at 0x4A0A158: memcpy@GLIBC_2.2.5 (mc_replace_strmem.c:881) + ==5618== by 0x326201D8FB: g_array_insert_vals (string3.h:57) + ==5618== by 0x442EFB: mm_iface_modem_set_bands + (mm-iface-modem.c:1982) + ==5618== by 0x44307E: handle_set_bands_auth_ready + (mm-iface-modem.c:2100) + ==5618== by 0x326386DFF6: g_simple_async_result_complete + (gsimpleasyncresult.c:775) + ==5618== by 0x4358E3: authorize_ready (mm-base-modem.c:1300) + ==5618== by 0x326386DFF6: g_simple_async_result_complete + (gsimpleasyncresult.c:775) + ==5618== by 0x326386E0F8: complete_in_idle_cb + (gsimpleasyncresult.c:787) + ==5618== by 0x3262047A54: g_main_context_dispatch (gmain.c:2715) + ==5618== by 0x3262047D87: g_main_context_iterate.isra.24 + (gmain.c:3290) + ==5618== by 0x3262048181: g_main_loop_run (gmain.c:3484) + ==5618== by 0x426235: main (main.c:142) + ==5618== Address 0x10a7ea74e is not stack'd, malloc'd or (recently) + free'd + ==5618== + ==5618== + ==5618== Process terminating with default action of signal 11 + (SIGSEGV) + ==5618== Access not within mapped region at address 0x10A7EA74E + ==5618== at 0x4A0A158: memcpy@GLIBC_2.2.5 (mc_replace_strmem.c:881) + ==5618== by 0x326201D8FB: g_array_insert_vals (string3.h:57) + ==5618== by 0x442EFB: mm_iface_modem_set_bands + (mm-iface-modem.c:1982) + ==5618== by 0x44307E: handle_set_bands_auth_ready + (mm-iface-modem.c:2100) + ==5618== by 0x326386DFF6: g_simple_async_result_complete + (gsimpleasyncresult.c:775) + ==5618== by 0x4358E3: authorize_ready (mm-base-modem.c:1300) + ==5618== by 0x326386DFF6: g_simple_async_result_complete + (gsimpleasyncresult.c:775) + ==5618== by 0x326386E0F8: complete_in_idle_cb + (gsimpleasyncresult.c:787) + ==5618== by 0x3262047A54: g_main_context_dispatch (gmain.c:2715) + ==5618== by 0x3262047D87: g_main_context_iterate.isra.24 + (gmain.c:3290) + ==5618== by 0x3262048181: g_main_loop_run (gmain.c:3484) + ==5618== by 0x426235: main (main.c:142) + + src/mm-iface-modem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit cabf53179eb0c660ff3bdfb765645a3d0f88530d +Author: Dan Williams +Date: Wed Apr 24 14:44:57 2013 -0500 + + sierra: handle probing ERROR response better + + The USB305 (Icera-based) apparently has a port that replies to + everything + with ERROR, and that port is unusable. Make sure it's ignored, + otherwise + MM may claim it as the primary AT port since it technically speaks AT. + + plugins/sierra/mm-plugin-sierra.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit cebe828f7fb62585614b756efb80799286f35261 +Author: Aleksander Morgado +Date: Wed Apr 24 23:25:53 2013 +0200 + + huawei: only expect custom inits to be run on tty ports + + plugins/huawei/mm-plugin-huawei.c | 28 +++++++++++++++++----------- + 1 file changed, 17 insertions(+), 11 deletions(-) + +commit 99a8dcce2ca04dccfe7a71bfd78394e710aa1ab1 +Author: Aleksander Morgado +Date: Wed Apr 24 23:15:43 2013 +0200 + + zte: ensure error is set when +ZSNT response parser doesn't match + + plugins/zte/mm-broadband-modem-zte.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit a32eef3434b169c8e58b285d8f30a3b206fc0dd7 +Author: Aleksander Morgado +Date: Wed Apr 24 23:12:12 2013 +0200 + + x22x: ensure error is set when +SYSSEL response parser doesn't match + + plugins/x22x/mm-broadband-modem-x22x.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 77d096bdac59d6627785490aae71c9ddc9445807 +Author: Aleksander Morgado +Date: Wed Apr 24 23:10:56 2013 +0200 + + sierra: ensure error is set when !SELRAT response parser doesn't match + + plugins/sierra/mm-broadband-modem-sierra.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 52fd67e36591588f76c7d8e1f0a115ab1a1db74c +Author: Aleksander Morgado +Date: Wed Apr 24 23:08:09 2013 +0200 + + novatel: ensure error is set when $NWRAT response parser doesn't match + + plugins/novatel/mm-broadband-modem-novatel.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 2e6ba7cd09287bb984a356cf2606c64f5a779cd4 +Author: Aleksander Morgado +Date: Wed Apr 24 23:07:45 2013 +0200 + + huawei: ensure error is set when ^CPIN response parser doesn't match + + plugins/huawei/mm-broadband-modem-huawei.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +commit 40dc35a65718050297b12c6e7c106866a44a3305 +Author: Aleksander Morgado +Date: Wed Apr 24 23:05:12 2013 +0200 + + modem-helpers: ensure error is set when +CRM response parser + doesn't match + + src/mm-modem-helpers.c | 81 + +++++++++++++++++++++++++++----------------------- + 1 file changed, 44 insertions(+), 37 deletions(-) + +commit 1f99eaf80e6c3124c871c416638d50c57199535e +Author: Ben Chan +Date: Wed Apr 24 17:37:55 2013 -0700 + + qcdm: remove unnecessary NULL check on free() + + This patch removes a few unnecessary NULL checks on free(), which + also fixes + the following clang warnings: + + result.c:59:27: error: if statement has empty body + [-Werror,-Wempty-body] + if (v->u.u8_array); + ^ + result.c:59:27: note: put the semicolon on a separate line to silence + this warning + result.c:62:28: error: if statement has empty body + [-Werror,-Wempty-body] + if (v->u.u16_array); + ^ + result.c:62:28: note: put the semicolon on a separate line to silence + this warning + + Bug reported on + https://code.google.com/p/chromium/issues/detail?id=219280 + Patched by Yunlian Jiang + + libqcdm/src/result.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit d1708f243dfdb2fe6a478be6e616f70fca50b254 +Author: Dan Williams +Date: Wed Apr 24 17:09:04 2013 -0500 + + x22x: add Archos G9 device tags + + plugins/x22x/77-mm-x22x-port-types.rules | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit b017064a5802c820ab26e7a3b832e2917186820d +Author: Aleksander Morgado +Date: Wed Apr 24 23:06:34 2013 +0200 + + altair-lte: minor coding style fixes + + plugins/altair/mm-broadband-modem-altair-lte.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit ba83bc61d05629762c72c2dce18cff5fadc30658 +Author: ori inbar +Date: Tue Apr 23 13:15:42 2013 -0500 + + altair-lte: Add SIM unlock retries query to the Altair plugin. + + plugins/altair/mm-broadband-modem-altair-lte.c | 73 + ++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + +commit 126d89b2f311b46784434db52a6614699bac83b5 +Author: Aleksander Morgado +Date: Wed Apr 24 22:48:18 2013 +0200 + + x22x: fix regex when parsing +SYSSEL response + + The numbers reported by +SYSSEL may have more than one digit, e.g.: + +SYSSEL: 14,2,0,0 + + https://bugzilla.gnome.org/show_bug.cgi?id=698774 + + plugins/x22x/mm-broadband-modem-x22x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4ac3a6d4f212b3fc04e004c85b89fd567e865ffa +Author: Ben Chan +Date: Mon Apr 22 14:34:44 2013 -0700 + + bearer: allow specifying default IP family for bearers + + This patch adds a 'bearer-default-ip-family' property to MMBearer, + which + specifies the default IP family to use for a bearer when no explicit + value is given via the simple connect properties. The default + IP family + is set to IPv4 in MMBearer but can be overridden by a MMBearer + subclass, + which allows a modem plugin to specify an appropriate default value. + + libmm-glib/mm-bearer-properties.c | 8 +------- + src/mm-bearer-mbim.c | 14 +++++++++++--- + src/mm-bearer-qmi.c | 18 +++++++++++++----- + src/mm-bearer.c | 25 +++++++++++++++++++++++++ + src/mm-bearer.h | 2 ++ + src/mm-broadband-bearer.c | 16 ++++++++++++---- + 6 files changed, 64 insertions(+), 19 deletions(-) + +commit 60845f10c9dae6c7e53022050aa8d09e1e1354ea +Author: Dan Williams +Date: Fri Apr 19 16:24:17 2013 -0500 + + broadband-modem-qmi: work around old Gobi 1K firmware SetDataFormat + issue + + It seems that really old Gobi 1K firmware (from ~2008) doesn't + implement + the SetDataFormat command, and will simply ignore the request without + replying to it. But the device works just fine if we retry the + QMI port open operation without the SetDataFormat request. + + The downside of this is is that on older kernels, the qmi_wwan driver + won't automatically fix up any raw-ip packets it receives, but the + old Gobi devices don't ever send raw-ip packets anyway, so it's not + a problem. + + src/mm-broadband-modem-qmi.c | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +commit aa4fd7c421776c33f0955517eb441fa2a14d6401 +Author: Aleksander Morgado +Date: Fri Apr 19 08:34:40 2013 +0200 + + broadband-modem-mbim: don't make no-SIM errors directly fatal, + retry instead + + The MC7710 will report a MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED + status + when initializing and the SIM is not ready yet. So retry a couple + of times as we + do for MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED. If all retries + are consumed, + get the last reported status to build the error. + + This change makes all modems without SIM require up to 10s to + get fully + initialized and exposed in DBus; but it shouldn't be a big deal as + the modems + are unusable anyway. + + https://bugzilla.gnome.org/show_bug.cgi?id=698264 + + src/mm-broadband-modem-mbim.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +commit 92035fdf1c39c9e1bf8b7d419d913e85bc8e1a44 +Author: Dan Williams +Date: Thu Apr 18 12:19:46 2013 -0500 + + iface-modem: skip modem_after_sim_unlock() for CDMA-only devices + + We don't support SIM/RUIM on CDMA devices (yet), so for now it makes + no sense to run the after-sim-unlock step on CDMA-only devices where + a SIM won't be present. + + Unfortunately we don't know at this point whether there is a SIM + or not, so if the modem is a multi-mode device (implying it has a SIM + slot) and its plugin implements the modem_after_sim_unlock() hook, + the hook will still be executed and might cause an unecessary delay + when a SIM is not inserted. + + src/mm-iface-modem.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 7d668eb407eccf89cbbfeb96bbb553ade5b47c92 +Author: Aleksander Morgado +Date: Thu Apr 18 18:32:13 2013 +0200 + + iface-modem: for multimode 3GPP+3GPP2 devices, check if SIM is + available + + If SIM is not available, no 3GPP caps in current caps. + + src/mm-iface-modem.c | 106 + ++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 88 insertions(+), 18 deletions(-) + +commit 4f3932cb2b07a0c4b60a754afcdacf935a1a9b61 +Author: Aleksander Morgado +Date: Thu Apr 18 15:15:38 2013 +0200 + + iface-modem: ignore SIM errors in 3GPP2-capable devices + + We already fully skipped SIM unlock check in 3GPP2-only devices; + now we also + ignore SIM errors if the device is a 3GPP+3GPP2 device. + + src/mm-iface-modem.c | 65 + ++++++++++++++++++++++++++++++---------------------- + 1 file changed, 38 insertions(+), 27 deletions(-) + +commit 27e19362778312e958a7caf68091cf8e46077d5b +Author: Dan Williams +Date: Thu Apr 18 10:19:57 2013 -0500 + + core: rework logging code to remove log message truncation (bgo + #698312) + + Use a static GString which will resize itself if the log message + is bigger than the current string size, but will also ensure we + don't do a ton of memory reallocation on every log message. + + Previously all log messages were trucated at 512 bytes due to the + log buffer char array being 512 bytes long. + + src/mm-log.c | 71 + ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 36 insertions(+), 35 deletions(-) + +commit 3cb639a6bbac52bddace33844f643ca487741ef9 +Author: Aleksander Morgado +Date: Thu Apr 18 16:46:17 2013 +0200 + + plugin-manager: handle race condition during probing + + The specific case: + * Modem exposes cdc-wdm port, Generic plugin probes it successfully + as QMI. + * Modem exposes new ports, including the wwan one. All ttys fail + probing + because they're neither AT nor QCDM (CnS in this case). + * The wwan port ends up without a port being suggested and is + not grabbed. + + The root cause of this is that we do not propagate the suggested + plugin to newly + added ports when it's the Generic one. If it wasn't the Generic one, + the newly + added ports would start with the suggested one for probing. + + Now, handle this by looking for the device-specified plugin when + the port + probing ends without a specific port given. If there is such a + device-specified + plugin accept the port, and otherwise, reject it. + + src/mm-plugin-manager.c | 59 + ++++++++++++++++++++++++++++--------------------- + 1 file changed, 34 insertions(+), 25 deletions(-) + +commit 4d4d6141388e2eca8acdc8efaf3ee0b5e2a09ebb +Author: Dan Williams +Date: Wed Apr 17 14:56:11 2013 -0500 + + broadband-modem: read current capabilities via QCDM if available + (bgo #698229) + + Many multi-mode Qualcomm devices report all available modes in their + AT+GCAP response (for example, CDMA/EVDO and GSM/UMTS) but they cannot + actually function in all these modes at the same time. The modem's + actual current capabilities are expressed by the QCDM NV ModePref + item, which is not reflected in the AT+GCAP response. + + Reading the current capabilities from the NV ModePref item ensures + that ModemManager does not create interfaces for the modem which + the modem cannot actually implement. + + Because the generic modem plugin does not implement the Modem + Capabilities hook (because there is no standard way to determine + what access technologies a modem supports), the Current Capabilities + are copied to the Modem Capabilities. For devices that support + QCDM this means that Modem Capabilies which used to be created from + the GCAP response and thus would contain all available capabilities + now contain only current capabilities. This isn't a problem though + since there was no way to switch the devices to use any of their + other capabilities, becuase there aren't any standard commands for + it. Plugins that know how to switch their modem's capabilities + should (and they already do) override load_current_capabilities + and load_modem_capabilities to get the correct information. + + src/mm-broadband-modem.c | 133 + ++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 125 insertions(+), 8 deletions(-) + +commit 95274bfa2327a5fec59db33ca94463f4f9baff9c +Author: Aleksander Morgado +Date: Thu Apr 18 14:43:06 2013 +0200 + + sms-part: check UDH length vs available size before trying to read it + + https://bugzilla.gnome.org/show_bug.cgi?id=698246 + + src/mm-sms-part.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 9fa5b9001a4a61128aa894941062d8e6d025e101 +Author: Dan Williams +Date: Wed Apr 17 17:18:05 2013 -0500 + + qcdm: fix CDMA1x Pilot Sets pilot handling + + The helper functions got the return code of qcdm_result_* wrong + and thus failed all requests for pilot sets. + + libqcdm/src/commands.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b95dc3f2f56084b7cfd253beed62716e708bd67e +Author: Aleksander Morgado +Date: Wed Apr 17 19:15:24 2013 +0200 + + mbm: allow MBIM devices + + plugins/mbm/mm-plugin-mbm.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 0e60d964b3a95065b6164e5e9dd77b72a162d8f9 +Author: Aleksander Morgado +Date: Wed Apr 17 15:34:23 2013 +0200 + + build: MBIM support is auto + + Use it if found, don't use it if not found. + + Can be explicitly requested with --with-mbim. + + configure.ac | 39 +++++++++++++++++++++++++-------------- + 1 file changed, 25 insertions(+), 14 deletions(-) + +commit f8e7f2ebe118208da0f664dbbfa7b00f43c71338 +Author: Aleksander Morgado +Date: Wed Apr 17 12:18:41 2013 +0200 + + device: look for vendor/product ID on the grandparent for MBIM devices + + src/mm-device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 56387bb79c3ed4d24f55be7016f2ac6133401fc3 +Author: Aleksander Morgado +Date: Tue Apr 16 22:20:33 2013 +0200 + + sierra: allow MBIM modems handled by the plugin + + plugins/sierra/mm-plugin-sierra.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 99694dec93f8903591927e89e8718db099e4f9ba +Author: Aleksander Morgado +Date: Sun Apr 14 21:22:12 2013 +0200 + + bearer-mbim: handle static IP configuration + + src/mm-bearer-mbim.c | 323 + +++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 298 insertions(+), 25 deletions(-) + +commit 91e4c9832ac317b4fbda91e5b3eb4ef34c6c701f +Author: Aleksander Morgado +Date: Sun Apr 14 14:19:32 2013 +0200 + + bearer-mbim: update connection timeout values + + src/mm-bearer-mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 07d4aa993803a7c83349f9865dd0654086439b31 +Author: Aleksander Morgado +Date: Sun Apr 14 14:18:07 2013 +0200 + + bearer-mbim: activate packet service during connection request + + src/mm-bearer-mbim.c | 74 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit 6cbb3e9fc9caf24e09e476ec86e5041d7a1f6dbb +Author: Aleksander Morgado +Date: Sun Apr 14 13:45:11 2013 +0200 + + bearer-mbim: no auth protocol if neither user nor password given + + src/mm-bearer-mbim.c | 52 + ++++++++++++++++++++++++++++------------------------ + 1 file changed, 28 insertions(+), 24 deletions(-) + +commit a9f20e90be74bd53bfaeeda93b68b1bfa49ae9fe +Author: Aleksander Morgado +Date: Sun Apr 14 12:54:12 2013 +0200 + + bearer-mbim: implement bearer disconnection + + src/mm-bearer-mbim.c | 172 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 172 insertions(+) + +commit 032911ec20f984b306ba8fb6d45f243c81437fd2 +Author: Aleksander Morgado +Date: Sun Apr 14 12:39:45 2013 +0200 + + bearer-mbim: gather a unique session id in the [0,255] range + + src/mm-bearer-mbim.c | 86 + ++++++++++++++++++++++++++++++++++++++----- + src/mm-bearer-mbim.h | 7 +++- + src/mm-broadband-modem-mbim.c | 69 +++++++++++++++++++++++++++++++++- + 3 files changed, 150 insertions(+), 12 deletions(-) + +commit 4609f708b8321dbd73af52a7958d46b13844e343 +Author: Aleksander Morgado +Date: Sun Apr 14 10:58:16 2013 +0200 + + bearer-mbim: implement bearer connection + + src/mm-bearer-mbim.c | 256 + ++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 194 insertions(+), 62 deletions(-) + +commit 3c4a26cb918a2a4b0835a82003b69af4bda7a5df +Author: Aleksander Morgado +Date: Sun Apr 14 09:31:19 2013 +0200 + + bearer-mbim: log available provisioned contexts during connection + + src/mm-bearer-mbim.c | 281 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 281 insertions(+) + +commit 0e9a0eb4c79d22ce50918abaab954fbf7aeebd6d +Author: Aleksander Morgado +Date: Sat Apr 13 18:35:24 2013 +0200 + + broadband-modem-mbim: implement access technologies updates + + src/mm-broadband-modem-mbim.c | 15 +++++++++++++-- + src/mm-modem-helpers-mbim.c | 42 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.h | 2 ++ + 3 files changed, 57 insertions(+), 2 deletions(-) + +commit 6b5dd6af51b729fc608560f85ca6a1af0020d671 +Author: Aleksander Morgado +Date: Sat Apr 13 18:23:32 2013 +0200 + + broadband-modem-mbim: add TODO about the network scan + + src/mm-broadband-modem-mbim.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 854c371c8aa93b96006e668be6d5163db501febe +Author: Aleksander Morgado +Date: Sat Apr 13 18:18:29 2013 +0200 + + broadband-modem-mbim: implement 3GPP registration request + + src/mm-broadband-modem-mbim.c | 91 + +++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.c | 61 +++++++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.h | 2 + + 3 files changed, 154 insertions(+) + +commit c7f3d33b3e47ead7e012a4a7dbe6c670aa935678 +Author: Aleksander Morgado +Date: Sat Apr 13 18:18:06 2013 +0200 + + api,errors: define new GPRS related errors + + include/ModemManager-errors.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 9cdd8c901db84b40ec126446e8a9f43376a4fd5f +Author: Aleksander Morgado +Date: Sat Apr 13 17:43:58 2013 +0200 + + broadband-modem-mbim: implement 3GPP registration logic + + src/mm-broadband-modem-mbim.c | 301 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-mbim.c | 21 +++ + src/mm-modem-helpers-mbim.h | 2 + + 3 files changed, 321 insertions(+), 3 deletions(-) + +commit 6333b239ff0e5069d1ea5b4f34626ccf7811f38a +Author: Aleksander Morgado +Date: Sat Apr 13 16:22:03 2013 +0200 + + sim-mbim: add TODO about the home provider info + + src/mm-sim-mbim.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 916dc3466f10e706e0e73f0c9e8864f7571dacb7 +Author: Aleksander Morgado +Date: Sat Apr 13 16:17:55 2013 +0200 + + broadband-modem-mbim: implement signal quality updates + + src/mm-broadband-modem-mbim.c | 148 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 148 insertions(+) + +commit 10f2cdebcb23e608d41d4fceea0abe4e5b74b795 +Author: Aleksander Morgado +Date: Sat Apr 13 15:52:30 2013 +0200 + + broadband-modem-mbim: process signal state indications + + src/mm-broadband-modem-mbim.c | 46 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 6b827cc7a306ef2f3719ba7310952305b97fa04c +Author: Aleksander Morgado +Date: Sat Apr 13 15:20:07 2013 +0200 + + broadband-modem-mbim: implement 3GPP unsolicited messages + setup/cleanup + + src/mm-broadband-modem-mbim.c | 78 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit 3e758d5394c65ea087f32b876e4b7f245b75dac1 +Author: Aleksander Morgado +Date: Sat Apr 13 14:01:02 2013 +0200 + + broadband-modem-mbim: implement enabled facility locks loading + + src/mm-broadband-modem-mbim.c | 122 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +commit 115bf6c077565d689095636dcb0803e086e8f9f1 +Author: Aleksander Morgado +Date: Sat Apr 13 12:33:41 2013 +0200 + + broadband-modem-mbim: implement IMEI loading + + src/mm-broadband-modem-mbim.c | 43 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit e878a8ef06eb11e2f8cda9b12d4b8bd49ca991ec +Author: Aleksander Morgado +Date: Sat Apr 13 12:30:10 2013 +0200 + + broadband-modem-mbim: implement the 3GPP interface + + src/mm-broadband-modem-mbim.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit bb9031ed38a682b3cd99a48f1c38df6d8263a2c6 +Author: Aleksander Morgado +Date: Sat Apr 13 11:54:08 2013 +0200 + + broadband-modem-mbim: build fake manufacturer and model strings + + src/mm-broadband-modem-mbim.c | 63 + ++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 59 insertions(+), 4 deletions(-) + +commit 45ae6dd672306cada1814ab23e2e88e2e5b7ed7e +Author: Aleksander Morgado +Date: Sat Apr 13 11:45:23 2013 +0200 + + broadband-modem-mbim: implement power up/down + + src/mm-broadband-modem-mbim.c | 129 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 129 insertions(+) + +commit 9504cb93398f69c824f361996de91cd091af448d +Author: Aleksander Morgado +Date: Sat Apr 13 09:44:41 2013 +0200 + + broadband-modem-mbim: simplify power state loading + + src/mm-broadband-modem-mbim.c | 37 +++++++++++-------------------------- + 1 file changed, 11 insertions(+), 26 deletions(-) + +commit f6958bb362c4849846e5408dee246268f87b3128 +Author: Aleksander Morgado +Date: Thu Apr 11 20:09:27 2013 +0200 + + broadband-modem-mbim,sim-mbim: update message creator/parser names + + Sync with libmbim commit: + commit b73673bf30a82e95819deb17296c9234399f0795 + Author: Aleksander Morgado + Date: Thu Apr 11 20:07:12 2013 +0200 + + mbim-codegen: properly define the 4 types of messages that + we may have + + src/mm-broadband-modem-mbim.c | 24 ++++++++++++------------ + src/mm-sim-mbim.c | 20 ++++++++++---------- + 2 files changed, 22 insertions(+), 22 deletions(-) + +commit 67c322361ea2efbf2ca68322e7ca8a3a76e14f0e +Author: Aleksander Morgado +Date: Thu Apr 11 20:08:56 2013 +0200 + + broadband-modem-mbim: implement own numbers loading + + src/mm-broadband-modem-mbim.c | 74 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit 04d515497d2005c8ca279a5153f42af27feba96e +Author: Aleksander Morgado +Date: Thu Apr 11 20:07:21 2013 +0200 + + sim-mbim: implement SIM identifier and IMSI loading + + src/mm-sim-mbim.c | 140 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +commit 6024142facf549f90a5aafb3782434ef19398947 +Author: Aleksander Morgado +Date: Thu Apr 11 20:03:39 2013 +0200 + + sim-mbim: these modems don't allow to enable/disable/change PIN + if locked + + src/mm-sim-mbim.c | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +commit cd610fb6207ecc683ea9d8104f4774a993e5f7ee +Author: Aleksander Morgado +Date: Thu Apr 11 20:03:07 2013 +0200 + + sim-mbim: implement PIN changing + + src/mm-sim-mbim.c | 75 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +commit ef7e6a14f0cef6900961a2e6bd9bade88e2cec01 +Author: Aleksander Morgado +Date: Thu Apr 11 20:02:53 2013 +0200 + + broadband-modem-mbim: check SIM status with 'Subscriber Ready Status' + + src/mm-broadband-modem-mbim.c | 151 + +++++++++++++++++++++++++++++++++++++----- + 1 file changed, 133 insertions(+), 18 deletions(-) + +commit 659d942c33767d44f2470aee183b0eb0fc268016 +Author: Aleksander Morgado +Date: Thu Apr 11 19:21:21 2013 +0200 + + mbim-port: make port closing async always + + Don't just close the port and forget, really wait to get the CLOSE + response + before going on. + + src/mm-broadband-modem-mbim.c | 5 +- + src/mm-mbim-port.c | 117 + +++++++++++++++++++++++++++++------------- + src/mm-mbim-port.h | 23 +++++---- + src/mm-port-probe.c | 28 +++++++--- + 4 files changed, 118 insertions(+), 55 deletions(-) + +commit d1d5616ca5607836fc2a17024555ef2578bb6d8e +Author: Aleksander Morgado +Date: Thu Apr 11 17:37:32 2013 +0200 + + sim-mbim: implement PIN enabling/disabling + + src/mm-sim-mbim.c | 75 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +commit c67fa3459bb78c3c6813ed68eeb720da9431a53f +Author: Aleksander Morgado +Date: Thu Apr 11 17:37:10 2013 +0200 + + broadband-modem-mbim,sim-mbim: consider MBIM result errors + + src/mm-broadband-modem-mbim.c | 4 ++++ + src/mm-sim-mbim.c | 56 + +++++++++++++++++++++++++------------------ + 2 files changed, 37 insertions(+), 23 deletions(-) + +commit 8a8dc23f5071b5155a21bd96356a7b3a38993d6a +Author: Aleksander Morgado +Date: Thu Apr 11 16:01:07 2013 +0200 + + sim-mbim: implement PUK unlocking + + src/mm-sim-mbim.c | 91 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 91 insertions(+) + +commit abd22dacfb332c9568d432c4008763e6e8432041 +Author: Aleksander Morgado +Date: Thu Apr 11 15:37:12 2013 +0200 + + broadband-modem-mbim: don't cache remaining attempts, just requery + + There are many more places where we reload remaining attempts, + not just after + querying initial lock status. So re-query to get the most up to + date info. + + src/mm-broadband-modem-mbim.c | 119 + +++++++++++++++++++++++------------------- + 1 file changed, 64 insertions(+), 55 deletions(-) + +commit b8904b3b5285e3a35e9ec0845f8bbca45568cb34 +Author: Aleksander Morgado +Date: Thu Apr 11 15:22:23 2013 +0200 + + mbim-port: no longer needed to request next transaction ID + + Already handled by the MbimDevice if none given. + + src/mm-broadband-modem-mbim.c | 12 +++--------- + src/mm-mbim-port.c | 10 ---------- + src/mm-mbim-port.h | 2 -- + src/mm-sim-mbim.c | 1 - + 4 files changed, 3 insertions(+), 22 deletions(-) + +commit 8232d023c178f8c804dd550ca567c5cf64710f93 +Author: Aleksander Morgado +Date: Wed Apr 10 23:19:33 2013 +0200 + + port-probe: delay 3s MBIM probing + + src/mm-port-probe.c | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +commit 968c2e360a269c994d4e4a571dcf8054b64f4b96 +Author: Aleksander Morgado +Date: Wed Apr 10 20:33:27 2013 +0200 + + sim-mbim: implement PIN unlocking + + src/mm-sim-mbim.c | 124 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 124 insertions(+) + +commit cc76e7a41c758d4fcc6cffc4f9650430e125e679 +Author: Aleksander Morgado +Date: Wed Apr 10 23:08:03 2013 +0200 + + broadband-modem-mbim: sync with libmbim 'input-parameters' branch + + src/mm-broadband-modem-mbim.c | 196 + ++++++++++++++++++++++++++---------------- + 1 file changed, 123 insertions(+), 73 deletions(-) + +commit df4cd12fef8c112017f02851a27f9580ef9750a5 +Author: Aleksander Morgado +Date: Sun Apr 7 22:51:39 2013 +0200 + + broadband-modem-mbim: implement initial power state loading + + src/mm-broadband-modem-mbim.c | 96 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 92 insertions(+), 4 deletions(-) + +commit deb9f21a6653c3ab68470395919aa21edc2d8034 +Author: Aleksander Morgado +Date: Sun Apr 7 21:02:31 2013 +0200 + + broadband-modem-mbim: implement unlock required & retries loading + + src/Makefile.am | 8 +++ + src/mm-broadband-modem-mbim.c | 142 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-mbim.c | 63 +++++++++++++++++++ + src/mm-modem-helpers-mbim.h | 29 +++++++++ + 4 files changed, 242 insertions(+) + +commit affe2fdeeb938285c697c6c97fd5ae90691d8c1e +Author: Aleksander Morgado +Date: Sun Apr 7 20:08:40 2013 +0200 + + broadband-modem-mbim: disable unneeded steps + + src/mm-broadband-modem-mbim.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 14a03848ce63243d90bafbc1cbbc6e9cc1f358e4 +Author: Aleksander Morgado +Date: Sun Apr 7 20:02:41 2013 +0200 + + broadband-modem-mbim: implement supported modes loading + + src/mm-broadband-modem-mbim.c | 65 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit 6ebda738f4a3e3dd791c20818aec2b68710c1e99 +Author: Aleksander Morgado +Date: Sun Apr 7 19:53:32 2013 +0200 + + broadband-modem-mbim: implement device identifier loading + + src/mm-broadband-modem-mbim.c | 42 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +commit 6b379e525dbcc117a82fb367a6db2146042880ab +Author: Aleksander Morgado +Date: Sun Apr 7 19:51:49 2013 +0200 + + plugin: limit cdc-wdm port probing types depending on the available + drivers + + We'll use the given device drivers as a hint of what we can or + should probe. + + src/mm-plugin.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +commit 00ec505e741eed62a04d2d810dcbb9c841a09445 +Author: Aleksander Morgado +Date: Sun Apr 7 19:39:08 2013 +0200 + + broadband-modem-mbim: implement equipment id loading + + src/mm-broadband-modem-mbim.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +commit 3b8c9a0e2dd6ad5087312f62539fdaa7e68f5d21 +Author: Aleksander Morgado +Date: Sun Apr 7 19:34:08 2013 +0200 + + broadband-modem-mbim: implement revision string loading + + src/mm-broadband-modem-mbim.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 211803f886e333123a375bbb8aa6ee720e725809 +Author: Aleksander Morgado +Date: Sun Apr 7 19:22:02 2013 +0200 + + broadband-modem-mbim: implement current capabilities loading + + src/mm-broadband-modem-mbim.c | 124 + +++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 123 insertions(+), 1 deletion(-) + +commit 07f39cc29f30d7892b1615c26be9752b593d4486 +Author: Aleksander Morgado +Date: Sun Apr 7 19:21:47 2013 +0200 + + mbim-port: provide access to the internal MbimDevice + + src/mm-mbim-port.c | 20 ++++++++++++++++++++ + src/mm-mbim-port.h | 4 ++++ + 2 files changed, 24 insertions(+) + +commit 12d6e59c86dc9feb38cc84ec49e3ade25f07336e +Author: Aleksander Morgado +Date: Sat Apr 6 23:27:40 2013 +0200 + + log: enable MBIM traces if running in debug mode + + src/mm-log.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit cbee87f2f54b928dafb6a099b3ec2521d8658440 +Author: Aleksander Morgado +Date: Sat Apr 6 22:58:08 2013 +0200 + + iface-modem: let the MBIM port be the primary one + + src/mm-iface-modem.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 76ed80e1c98166ffe1f6ae4f49baf335c3e0f8a1 +Author: Aleksander Morgado +Date: Sat Apr 6 21:08:10 2013 +0200 + + generic: allow MBIM devices + + plugins/generic/mm-plugin-generic.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 2e4a83628a6a24cf06549d346b74fcdc2f97830f +Author: Aleksander Morgado +Date: Sat Apr 6 20:23:22 2013 +0200 + + huawei: allow MBIM devices + + plugins/huawei/mm-plugin-huawei.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit e476c1c67ba158b9588bd72308e25d88c5089279 +Author: Aleksander Morgado +Date: Sat Apr 6 21:05:41 2013 +0200 + + mbim: add initial MBIM support skeleton + + src/Makefile.am | 7 + + src/mm-bearer-mbim.c | 84 ++++++++++ + src/mm-bearer-mbim.h | 55 +++++++ + src/mm-broadband-modem-mbim.c | 348 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-modem-mbim.h | 49 ++++++ + src/mm-sim-mbim.c | 77 ++++++++++ + src/mm-sim-mbim.h | 51 +++++++ + 7 files changed, 671 insertions(+) + +commit a0ced36f142255ffc0995e358636cf8a7b9efe07 +Author: Aleksander Morgado +Date: Sat Apr 6 20:45:42 2013 +0200 + + base-modem: allow grabbing MBIM ports + + src/mm-base-modem.c | 249 + +++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-base-modem.h | 12 +++ + 2 files changed, 247 insertions(+), 14 deletions(-) + +commit cb45de048faac153b6b49af7f98bcd4e3922a4d9 +Author: Aleksander Morgado +Date: Sat Apr 6 20:00:28 2013 +0200 + + plugin: allow plugins to require MBIM probing of cdc-wdm ports + + plugins/Makefile.am | 4 ++++ + src/mm-plugin.c | 35 +++++++++++++++++++++++++++++++++-- + src/mm-plugin.h | 1 + + 3 files changed, 38 insertions(+), 2 deletions(-) + +commit 3d2c0cc83ca59a5fd42548fa7af96a81c951d753 +Author: Aleksander Morgado +Date: Sat Apr 6 19:54:55 2013 +0200 + + port-probe: include MBIM port probing logic + + src/Makefile.am | 15 +++- + src/mm-mbim-port.c | 226 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-mbim-port.h | 61 ++++++++++++++ + src/mm-port-probe.c | 207 ++++++++++++++++++++++++++++++++++++++++++----- + src/mm-port-probe.h | 13 ++- + src/mm-port.h | 3 +- + 6 files changed, 500 insertions(+), 25 deletions(-) + +commit dd5680debeeb43a13865343d5e7fe65bbc297360 +Author: Aleksander Morgado +Date: Sat Apr 6 19:23:14 2013 +0200 + + build: new '--with-mbim' configure switch + + Will enable MBIM support through libmbim. + + configure.ac | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 463de46e9e018b68c2fdb20abf3e25180de4d415 +Author: Dan Williams +Date: Tue Apr 16 19:36:55 2013 -0500 + + novatel: ignore USB551L + + Just like the E362, which the USB551L is quite similar to. + + plugins/novatel/mm-plugin-novatel.c | 1 + + 1 file changed, 1 insertion(+) + +commit d3831fc641d41019122bad9022f4f4cf4ee295f1 +Author: Aleksander Morgado +Date: Tue Apr 16 14:41:22 2013 +0200 + + serial greylist: tag device from Netchip Technology + + src/77-mm-usb-serial-adapters-greylist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 72441677618cc211ff76b78bf8f5393194102537 +Author: Aleksander Morgado +Date: Tue Apr 16 14:39:58 2013 +0200 + + serial greylist: fix udev tag name for Arduino devices + + src/77-mm-usb-serial-adapters-greylist.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f770ea43c23f98c3a81db93fd93439c7b9418174 +Author: Dan Williams +Date: Thu Apr 11 14:46:17 2013 -0500 + + huawei: fix up udev rules file name + + plugins/Makefile.am | + 2 +- + ...mm-huawei_net_port_types.rules => 77-mm-huawei-net-port-types.rules} + | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 3c1e77d78964d79deafee79b65da1f11cdb98890 +Author: Aleksander Morgado +Date: Thu Apr 11 19:21:46 2013 +0200 + + sim: fix signal emission + + Signal should be emitted by the SIM object, not by the Modem object. + + src/mm-sim.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 31215aba327a9151638ccc5ac37666e6efca3bb2 +Author: Aleksander Morgado +Date: Wed Mar 13 15:42:14 2013 +0100 + + modem-helpers-qmi: explicitly add LTE as current cap if modem caps + report it + + For loading current capabilities we use a mix of "Technology + Preference" (TP), + "System Selection Preference" (SSP) and DMS-reported + capabilities. But, as we + also use TP and SSP for allowed modes, it may be the case that we + end up + leaving 4G out of the allowed modes, which afterwards will make the + modem not + report LTE as current capabilitiy, as TP/SSP don't include LTE. + + So, just assume LTE is a current capability if DMS-reported + capabilities include + it. We can really do this because LTE is the only 4G technology, + the same logic + wouldn't apply correctly for 2G or 3G (due to having different techs + for 3GPP + and 3GPP2). + + src/mm-modem-helpers-qmi.c | 5 +++++ + src/tests/test-modem-helpers-qmi.c | 8 ++++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit 162d96b11680bbdf819a3f8e1c058184abb7b792 +Author: Aleksander Morgado +Date: Wed Mar 13 11:16:13 2013 +0100 + + test-modem-helpers-qmi: new unit tests to check the + 'current-capabilities' logic + + Based on Dan's tests with QMI modems. + + .gitignore | 1 + + src/mm-broadband-modem-qmi.c | 143 ++++---------- + src/mm-modem-helpers-qmi.c | 71 +++++++ + src/mm-modem-helpers-qmi.h | 16 ++ + src/tests/Makefile.am | 43 ++++- + src/tests/test-modem-helpers-qmi.c | 383 + +++++++++++++++++++++++++++++++++++++ + 6 files changed, 549 insertions(+), 108 deletions(-) + +commit be8c8a99bb29d340720715874696bc1fae11d331 +Author: Ben Chan +Date: Wed Apr 10 12:06:13 2013 -0700 + + device: handle NULL returned by g_udev_device_get_driver() gracefully + + This patch fixes a crash in mm_device_grab_port() when doing a string + comparison on a NULL returned by g_udev_device_get_driver(). + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x76b760b4 [libc-2.15.so] - strcmp.c:38 + strcmp + 0x76c66a7d [libglib-2.0.so.0.3200.4] - ghash.c:1704 + g_str_equal + 0x76ee0e5d [ModemManager] - mm-device.c:147 + mm_device_grab_port + 0x76edf9d9 [ModemManager] - mm-manager.c:313 + device_added + 0x76e95b2d [libgudev-1.0.so.0.1.0] - + extras/gudev/gudevmarshal.c:84 g_udev_marshal_VOID__STRING_OBJECT + 0x76d1fb2b [libgobject-2.0.so.0.3200.4] - gclosure.c:777 + g_closure_invoke + 0x76d2b88b [libgobject-2.0.so.0.3200.4] - gsignal.c:3551 + signal_emit_unlocked_R + 0x76d313c5 [libgobject-2.0.so.0.3200.4] - gsignal.c:3300 + g_signal_emit_valist + 0x76d31569 [libgobject-2.0.so.0.3200.4] - gsignal.c:3356 + g_signal_emit + 0x76e93bdd [libgudev-1.0.so.0.1.0] - + extras/gudev/gudevclient.c:105 monitor_event + 0x76c9beb7 [libglib-2.0.so.0.3200.4] - giounix.c:166 + g_io_unix_dispatch + 0x76c714c1 [libglib-2.0.so.0.3200.4] - gmain.c:2539 + g_main_context_dispatch + 0x76c71745 [libglib-2.0.so.0.3200.4] - gmain.c:3146 + g_main_context_iterate + 0x76c71a59 [libglib-2.0.so.0.3200.4] - gmain.c:3340 + g_main_loop_run + 0x76ede8ed [ModemManager] - main.c:142 + main + 0x76b35f79 [libc-2.15.so] - libc-start.c:226 + __libc_start_main + 0x76edea49 [ModemManager] + 0x00014a49 + 0x76eb4eab [ld-2.15.so] + 0x0000aeab + + src/mm-device.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 33a572b9d00128492af2d3890e4c6aeec400b465 +Author: Dan Williams +Date: Tue Apr 9 14:10:32 2013 -0500 + + broadband-modem-qmi: ignore invalid signal strengths + + Sometimes invalid signal strengths will be returned by the modem, + which we should ignore. Otherwise they make the reported signal + quality bounce around from eg 21% -> 100%, or cause access + technology updates for radio interfaces that can't possible have + a usable signal. + + src/mm-broadband-modem-qmi.c | 158 + +++++++++++++++++++++++++++++-------------- + 1 file changed, 109 insertions(+), 49 deletions(-) + +commit c737c57eb031e300d24d9cc81a592b541f66e74b +Author: Aleksander Morgado +Date: Wed Apr 10 09:49:15 2013 +0200 + + broadband-modem-qmi: fix setup of unsolicited registration updates + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 089dc1ddc0715f0bea0fdabc33b42b252b9e4d13 +Author: Aleksander Morgado +Date: Wed Apr 10 09:26:03 2013 +0200 + + man,mmcli: --simple-connect allows any of the --create-bearer options + + docs/man/mmcli.8 | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit a12d979373a7c0724664889a237905f6ea3aeb1e +Author: Aleksander Morgado +Date: Tue Apr 9 18:41:42 2013 +0200 + + huawei: increase the connection timeout to 60s + + plugins/huawei/mm-broadband-bearer-huawei.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit cb11bd09d6ad8cdfc97cef8f3793dd82580006b8 +Author: Aleksander Morgado +Date: Wed Apr 3 13:38:31 2013 +0200 + + huawei: plug memleak + + plugins/huawei/mm-broadband-modem-huawei.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 01400024cdf6faea50faa6ba170dc37876fa5d5f +Author: Franko Fang +Date: Wed Apr 3 13:14:14 2013 +0200 + + huawei: add port type rules for modems + + plugins/huawei/77-mm-huawei_net_port_types.rules | 6 +++++ + plugins/huawei/mm-plugin-huawei.c | 33 + +++++++++++++++++------- + 2 files changed, 30 insertions(+), 9 deletions(-) + +commit d56a87a3bde4f504f828c050b905f20425c4c665 +Author: Franko Fang +Date: Wed Apr 3 13:12:43 2013 +0200 + + base-modem: keep AT port as possible data port if flagged as PPP + + src/mm-base-modem.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +commit 9d4091cc89366e59a4e41b9f0212cce24d26127b +Author: Franko Fang +Date: Wed Apr 3 13:11:56 2013 +0200 + + huawei: flag modems which support NDISDUP + + plugins/Makefile.am | 1 + + plugins/huawei/77-mm-huawei_net_port_types.rules | 10 +++++ + plugins/huawei/mm-broadband-modem-huawei.c | 55 + +++++++++--------------- + 3 files changed, 31 insertions(+), 35 deletions(-) + +commit 4d31315b959ce87e242070842cd9fe3c234fa7e7 +Author: Aleksander Morgado +Date: Tue Apr 9 17:20:27 2013 +0200 + + port-probe: fix source_remove() vs signal_handler_disconnect() + + src/mm-port-probe.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit dff23f57b3e829e5abe6008b6b21e45d1297eade +Author: Aleksander Morgado +Date: Mon Apr 8 18:03:39 2013 +0200 + + huawei: use a 3s timeout as after-sim-unlock step + + Huawei e220 may fail miserably (rebooting itself) if we issue + commands just + after having unlocked the PIN. + + plugins/huawei/mm-broadband-modem-huawei.c | 38 + ++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +commit 55fdc76a56e5da0eb391d22d6f53d985ca38a9af +Author: Dan Williams +Date: Mon Apr 8 11:09:46 2013 -0500 + + blacklist: move Arduino USB/Serial adapter to greylist + + It's a generic adapter, should be in the manual-probe-only + greylist instead of the blacklist. + + src/77-mm-usb-device-blacklist.rules | 6 ------ + src/77-mm-usb-serial-adapters-greylist.rules | 5 ++++- + 2 files changed, 4 insertions(+), 7 deletions(-) + +commit 660d59ab44d9821a2b2a5efea823d51fb72e5511 +Author: Dan Williams +Date: Mon Apr 8 10:53:38 2013 -0500 + + blacklist: ignore a few more Arduinos (rh #861620) + + src/77-mm-usb-device-blacklist.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 358fe7f9067d1496b762b97e12babd27a3882ee7 +Author: Aleksander Morgado +Date: Sat Apr 6 22:44:00 2013 +0200 + + base-modem: don't assume primary AT port is available + + QMI modems may not have it. + + src/mm-base-modem.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 3b6b049e51a5be5d099a8ac3c27973b91b8a5be9 +Author: Aleksander Morgado +Date: Fri Apr 5 18:08:46 2013 +0200 + + serial-parser: detect 'NA' as a mobile equipment error + + Just treat 'NA' as MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED error. + + https://bugzilla.gnome.org/show_bug.cgi?id=697368 + + src/mm-serial-parsers.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit a294800c7f6290b49ee5011e0a4e99831a070161 +Author: Aleksander Morgado +Date: Fri Apr 5 18:22:02 2013 +0200 + + icera: create generic bearer when no net port available + + https://bugzilla.gnome.org/show_bug.cgi?id=697374 + + plugins/icera/mm-broadband-modem-icera.c | 38 + ++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +commit f9105bff875ae0e7263718a317e156948957a6d0 +Author: Aleksander Morgado +Date: Wed Apr 3 16:30:48 2013 +0200 + + api,introspection: update 'Validity' property in the SMS interface + + We don't want to support only 'relative' validity, so don't assume + that the + Validity property will always be a uint32 value. + + Instead, we define the Validity propery as '(uv)' tuple, where the + first value + (a MMSmsValidityType) specifies the type of validity, and the second + value is + a variant formatted accordingly to what the validity type specifies + (e.g. a + uint32 value if the type is MM_SMS_VALIDITY_TYPE_RELATIVE). + + cli/mmcli-sms.c | 17 ++++--- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 8 ++- + include/ModemManager-enums.h | 16 ++++++ + .../org.freedesktop.ModemManager1.Sms.xml | 24 +++++++-- + libmm-glib/mm-sms.c | 59 + +++++++++++++++++++--- + libmm-glib/mm-sms.h | 3 +- + src/mm-sms-part.c | 16 +++--- + src/mm-sms-part.h | 4 +- + src/mm-sms.c | 33 +++++++++++- + src/tests/test-sms-part.c | 2 +- + 11 files changed, 149 insertions(+), 34 deletions(-) + +commit 372a49bbf661c95110852c86df54008a7bad2774 +Author: Dan Williams +Date: Fri Apr 5 10:33:16 2013 -0500 + + qcdm: add unsolicited signal level indication from Samsung Z810 + + libqcdm/src/dm-commands.h | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit 086557e5d53806c962c44060306e49fcbb446786 +Author: Aleksander Morgado +Date: Fri Apr 5 10:16:21 2013 +0200 + + iface-modem-simple: log about all parameters passed to + Simple.Connect() + + src/mm-iface-modem-simple.c | 63 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 63 insertions(+) + +commit a2d2f839100e84b721dc335b083f444cebcbb8a1 +Author: Aleksander Morgado +Date: Fri Apr 5 09:47:31 2013 +0200 + + mbm: plug memleaks + + plugins/mbm/mm-broadband-bearer-mbm.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 30e2a0f4d0eaf632b357c1b1fd17730c932c6e63 +Author: Aleksander Morgado +Date: Fri Apr 5 09:43:38 2013 +0200 + + mbm: don't pass (null) as string when either user or password is empty + + E.g. instead of: + (ttyACM1): --> 'AT*EIAAUW=2,1,"(null)","vodafone"' + (ttyACM1): <-- 'OK' + + Better pass: + (ttyACM1): --> 'AT*EIAAUW=2,1,"","vodafone"' + (ttyACM1): <-- 'OK' + + plugins/mbm/mm-broadband-bearer-mbm.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 1cb5831af33237ca8f343410982f44cf8fd2903c +Author: Aleksander Morgado +Date: Fri Apr 5 08:54:09 2013 +0200 + + iface-modem: ensure we cancel the re-initialization idle if the + modem goes away + + https://bugzilla.gnome.org/show_bug.cgi?id=697290 + + src/mm-iface-modem.c | 30 ++++++++++++++++++++++++++++-- + 1 file changed, 28 insertions(+), 2 deletions(-) + +commit 76ecc1301af4a19d1bef31d320c79edb4ce013a2 +Author: Ben Chan +Date: Thu Apr 4 12:40:10 2013 -0700 + + broadband-bearer: handle NULL and character escaping of APN value + + src/mm-broadband-bearer.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 5554658cd2c87d92156f8224db50ccc5f58950a6 +Author: Aleksander Morgado +Date: Thu Apr 4 18:14:36 2013 +0200 + + port-probe: remove non-AT port hint, as it may come in ATI replies + + We remove "/SRC/AMSS" as a hint of non-AT port, as it really comes + in ATI + replies, see: + + [mm-at-serial-port.c:408] debug_log(): (ttyUSB6): + <-- 'Manufacturer: Sierra Wireless, + IncorporatedModel: USB 306Revision: + M3_0_10_1AP C:/WS/FW/M3_0_10_1AP/MDM8200/SRC/AMSS + 2010/03/29 17:52:11IMEI: xxxxxxxxIMEI SV: + 11FSN: xxxxxxxxxx3GPP Release 7+GCAP: + +CGSM,+DS,+ESOK' + [mm-serial-parsers.c:188] mm_serial_parser_v1_parse(): Got response + filtered in serial port: Not an AT response + [mm-port-probe.c:148] mm_port_probe_set_result_at(): (tty/ttyUSB6) + port is not AT-capable + + src/mm-port-probe.c | 1 - + 1 file changed, 1 deletion(-) + +commit 8c39f2c55157b0304269fa303f5feb2889ec6333 +Author: Aleksander Morgado +Date: Wed Apr 3 17:45:39 2013 +0200 + + sierra: implement PIN/PUK retry count loading + + Not all Sierra modems support it, but those which do reply like this: + + AT+CPINC=? + OK + + AT+CPINC? + +CPINC: 3,3,10,10 + + plugins/sierra/mm-broadband-modem-sierra.c | 61 + ++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit 464f33f77f66738c17c14390d7605167f52f62e5 +Author: Aleksander Morgado +Date: Wed Apr 3 12:29:14 2013 +0200 + + sierra: early detect non-AT ports + + Detect the parser filter errors during our custom_init(), and set + the port as + not being AT if the error found. + + plugins/sierra/mm-plugin-sierra.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 069a17afd3c0ae007168987836ddaf9dfa63c3e0 +Author: Aleksander Morgado +Date: Wed Apr 3 12:28:16 2013 +0200 + + port-probe: remove no longer needed filter + + Remove the additional check for AT responses done *after* having + parsed the + response. This check only worked whenever the response string ended + up matching + one of the regular expressions in the parser, which of course + wasn't always. + + src/mm-port-probe.c | 10 ---------- + 1 file changed, 10 deletions(-) + +commit f24fc68e04fbe225de162f57e3cbd254f8f03df4 +Author: Aleksander Morgado +Date: Wed Apr 3 12:26:24 2013 +0200 + + port-probe: add a new serial parser filter to detect non-AT strings + + We will check each string with our custom filter before even trying to + parse them. A MM_SERIAL_ERROR_PARSE_FAILED error will be issued + whenever the + string doesn't match the filter. + + include/ModemManager-errors.h | 2 ++ + src/mm-port-probe-at.c | 11 +++++++---- + src/mm-port-probe.c | 25 ++++++++++++++++++++++++- + 3 files changed, 33 insertions(+), 5 deletions(-) + +commit 4e4d139e309c890b2c5c44b747aeaf9a5deac9bc +Author: Aleksander Morgado +Date: Wed Apr 3 12:24:18 2013 +0200 + + serial-parsers: allow specifying a custom response filter + + The serial parser will now allow specifying a custom user-provided + filter, which + is applied before even trying to match successful/error + responses. This filter + provides a very early barrier to detect strings that are clearly + not going to + match. + + E.g. this filter may be used during port probing to early detect + non-AT ports. + + src/mm-serial-parsers.c | 36 ++++++++++++++++++++++++++++++++++-- + src/mm-serial-parsers.h | 28 +++++++++++++++++++--------- + 2 files changed, 53 insertions(+), 11 deletions(-) + +commit 38b120c8617724ba97ac212c9e01d01c850abdc8 +Author: Aleksander Morgado +Date: Wed Apr 3 12:20:46 2013 +0200 + + port-probe: don't assume the NULL bytes will be at the beginning of + the response + + Also report as non-AT responses if the NUL bytes are embedded within + a stream + of bytes which doesn't start with NUL. This e.g. applies to CnS + ports from + Sierra modems, which show streams like: + + ~\0\245y\0}^T1_0_4_0BT R372 CNSZXD00000061 2011/05/12 + 15:25:25\0\0\0\0\0\0\0\0\0 + \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0T1_0_4_0AP R372 + CNSZXD00000061 2011/05 + /12 + 15:25:25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 + 03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 + \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0~~ + \0Tb\0T1_0_4_0AP R372 CNSZXD + + src/mm-port-probe.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 4ea827a3a11767081d1c055d694ce644e6723cef +Author: Aleksander Morgado +Date: Wed Apr 3 11:05:36 2013 +0200 + + sierra: too many timeout errors during custom init means non-AT port + + Reduces probing time of the modem in ~10s. + + plugins/sierra/mm-plugin-sierra.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 2c3e2bd457b908800155e3cfecbccfa9a1f530c7 +Author: Ben Chan +Date: Thu Apr 4 09:28:45 2013 -0700 + + serial,blacklist: fix file mode (0755 -> 0644) + + src/77-mm-usb-device-blacklist.rules | 0 + src/mm-at-serial-port.c | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) + +commit e60ad8d8dc82e8bd6ae9afff2d0b1da264a4ce15 +Author: Aleksander Morgado +Date: Thu Apr 4 18:25:29 2013 +0200 + + mbm: ignore *ESTKSMS unsolicited messages + + https://bugzilla.gnome.org/show_bug.cgi?id=697280 + + plugins/mbm/mm-broadband-modem-mbm.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit d2b4ab9d9c24dfd97ad842b35a2bbd41e6110e00 +Author: Aleksander Morgado +Date: Thu Apr 4 17:22:45 2013 +0200 + + sierra: 'data' may be NULL if the parent dialling fails + + plugins/sierra/mm-broadband-bearer-sierra.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit a62624aa2293a480e42d49856d131cb2c35b2f27 +Author: Aleksander Morgado +Date: Wed Apr 3 17:12:24 2013 +0200 + + sierra: plug memleak + + plugins/sierra/mm-broadband-modem-sierra.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit bc41dd40cdd8db66c1929465df9b8babf1bd0af1 +Author: Aleksander Morgado +Date: Thu Apr 4 16:59:19 2013 +0200 + + broadband-bearer: ensure we close the port even if we got cancelled + + When there is an error in the connection attempt we need to close + the dialling + port ourselves. In the case where we got an error and we also got + cancelled, + we need to make sure that the port gets closed. + + src/mm-broadband-bearer.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0d20a7c85a3b287cf68372eef756194f760a23f7 +Author: Aleksander Morgado +Date: Thu Apr 4 09:48:54 2013 +0200 + + altair-lte: minor style changes + + plugins/altair/mm-broadband-modem-altair-lte.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 84e68cd4cdad03766513cc689519be6dad2f75f6 +Author: ori inbar +Date: Wed Apr 3 12:47:30 2013 -0500 + + altair-lte: initial altair lte plugin + + plugins/Makefile.am | 12 + + plugins/altair/mm-broadband-bearer-altair-lte.c | 377 +++++++++ + plugins/altair/mm-broadband-bearer-altair-lte.h | 61 ++ + plugins/altair/mm-broadband-modem-altair-lte.c | 973 + ++++++++++++++++++++++++ + plugins/altair/mm-broadband-modem-altair-lte.h | 51 ++ + plugins/altair/mm-plugin-altair-lte.c | 84 ++ + plugins/altair/mm-plugin-altair-lte.h | 48 ++ + src/77-mm-usb-device-blacklist.rules | 3 + + 8 files changed, 1609 insertions(+) + +commit 585b51f922c10f28b7b1bf3ba82a0904c33715c8 +Author: Aleksander Morgado +Date: Wed Apr 3 09:07:55 2013 +0200 + + broadband-modem: remove incorrect debug log + + src/mm-broadband-modem.c | 1 - + 1 file changed, 1 deletion(-) + +commit 53b033c727a5fb69155e445d11aec30d87d4c3d9 +Author: Dan Williams +Date: Tue Apr 2 12:17:40 2013 -0500 + + broadband-modem: turn off CNMI reporting if modem doesn't + support it + + MM doesn't yet parse the +CNMI=? response and dynamically figure out + what indication settings are supported, so add another last-resort + CNMI setting for the UMW190 which doesn't support any at all. + + And the commands shouldn't be cached, so fix that too. + + src/mm-broadband-modem.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit b67a3948b5900c9af0fd4b97f0febae52ac4a1cc +Author: Dan Williams +Date: Tue Apr 2 12:10:54 2013 -0500 + + qcdm: fix IM*I buffer sizes for GSM and WCDMA state info requests + + Found by Enrico Murador. + + libqcdm/src/commands.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 9ffb424ed4fc07a4aa0662ce0f84d7b7d5b06617 +Author: Aleksander Morgado +Date: Tue Apr 2 17:41:54 2013 +0200 + + pantech: skip WMC ports + + WMC ports will return "ERROR" to all AT commands, except for "AT" + itself. So + just provide a custom AT probing logic, which uses "ATE0" instead, + and assumes + the port is not an AT port if an error is returned. + + plugins/pantech/mm-plugin-pantech.c | 41 + +++++++++++++++++++++++++++++++++++++ + 1 file changed, 41 insertions(+) + +commit 678f596ff996dd483d00f026cd21e120fbde698b +Author: Aleksander Morgado +Date: Tue Apr 2 13:31:31 2013 +0200 + + qcdm-serial-port: avoid playing with GByteArray internals + + Since glib 2.32, we can use g_byte_array_new_take() to build a + new GByteArray + from an own allocated buffer, so skip playing with the GByteArray + internals. + + configure.ac | 6 +++--- + src/mm-qcdm-serial-port.c | 17 ++++++++++------- + 2 files changed, 13 insertions(+), 10 deletions(-) + +commit fc219be4d46aefe644cc17b6a0976be5c1a732b8 +Author: Aleksander Morgado +Date: Tue Apr 2 16:13:43 2013 +0200 + + sms-part: properly skip validity field when given in absolute or + enhanced format + + We don't support absolute or enhanced format for validity, but we + still need to + properly skip those fields if given. + + According to GSM 03.40, they are both always 7 bytes, not just 1. + + src/mm-sms-part.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit c1e70924d8197c51bb8dedb2d232f03dff87aa7b +Author: Aleksander Morgado +Date: Sat Mar 30 14:53:17 2013 +0100 + + broadband-modem: update CMGL parsing logic + + Pantech UMW190 modem uses a custom +CMGL response which includes only + three fields before the actual PDU, e.g: + + +CMGL: ,,\r\n + + instead of what we had before: + + +CMGL: ,,,\r\n + + The CMGL parsing logic is now updated to use a regex to match the + reply, and + also considering the UMW190 specific case. + + Actually, we end up reading only the two first fields (index and + status) which + are the ones we really need, so we skip the and the + if given. + + Added also unit tests to cover all these known cases. + + Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=696723 + (missing the + actual PDU parsing fixes). + + src/mm-broadband-modem.c | 45 ++++------- + src/mm-modem-helpers.c | 70 ++++++++++++++++- + src/mm-modem-helpers.h | 11 +++ + src/tests/test-modem-helpers.c | 172 + +++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 268 insertions(+), 30 deletions(-) + +commit bb4f4f4e9e91d79974d1bb4ce3d42c5b0bbc734d +Author: Aleksander Morgado +Date: Sat Mar 30 12:43:25 2013 +0100 + + pantech: fully skip the SIM storage in the messaging interface + + Seems that trying to use the SIM storage hangs a UMW190 modem, + so just fully + ignore it for now. + + https://bugzilla.gnome.org/show_bug.cgi?id=696724 + + plugins/pantech/mm-broadband-modem-pantech.c | 61 + +++++++++++++++++++++++++++- + 1 file changed, 60 insertions(+), 1 deletion(-) + +commit a066cc84cfb699056774c31d7025b83a26fc910c +Author: Aleksander Morgado +Date: Mon Apr 1 17:47:43 2013 +0200 + + mbm: fix udev rule tagging logic + + plugins/mbm/77-mm-ericsson-mbm.rules | 1 + + 1 file changed, 1 insertion(+) + +commit 4fe5b3e42c50cadca0cb5606e7142a22f7449049 +Author: Aleksander Morgado +Date: Mon Apr 1 16:38:29 2013 +0200 + + serial-usb greylist: added new USB<->Serial adapters + + https://bugzilla.gnome.org/show_bug.cgi?id=643793 + + src/77-mm-usb-serial-adapters-greylist.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 2896e711ae8d4ae5b2188c963aeb8456ff2189fe +Author: David Castellanos +Date: Tue Mar 26 16:24:40 2013 +0100 + + x22x: Fix problem in set allowed mode + + NM attempts to set allowed and preferred mode during the connection + process. The plugin x220x does not handle properly when NM request + allowed mode to '2g, 3g' and the preferred mode to 'none'. + + This commit attempts to solve the problem described above. When this + situation happens, establish the mode of the modem has 'ANY' (which + seems the safest one) instead of just throwing an error. + + Signed-off-by: David Castellanos + + plugins/x22x/mm-broadband-modem-x22x.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit c9b7761ed5ae83989cd3c8e2fbb5fc413c351102 +Author: Aleksander Morgado +Date: Mon Apr 1 14:12:54 2013 +0200 + + base-modem: don't assume all cdc-wdm ports are QMI + + src/mm-base-modem.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +commit 5ffad1f51f217abe237f9c9ef0bc3151a7cad227 +Author: Aleksander Morgado +Date: Sat Mar 30 11:38:29 2013 +0100 + + mbm: don't tag only tty ports, and also grab cdc-wdm ports + + We also need to tag cdc-wdm ports, so that they get grabbed but + ignored and + not QMI-probed. + + https://bugzilla.gnome.org/show_bug.cgi?id=696701 + + plugins/mbm/77-mm-ericsson-mbm.rules | 5 +++-- + plugins/mbm/mm-plugin-mbm.c | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +commit b9b5ca39dfc13073584d99f20c94bd275aeba713 +Author: Aleksander Morgado +Date: Fri Mar 29 13:47:16 2013 +0100 + + mbm: wait for unlock reporting READY after PIN/PUK unlock + + MBM modems will lie about the unlock status just after having sent a + correct PIN or PUK. So, explicitly wait to get in READY state + after having + sent the PIN or PUK, before keeping on. + + https://bugzilla.gnome.org/show_bug.cgi?id=696702 + + plugins/Makefile.am | 4 +- + plugins/mbm/mm-broadband-modem-mbm.c | 26 ++++ + plugins/mbm/mm-sim-mbm.c | 237 + +++++++++++++++++++++++++++++++++++ + plugins/mbm/mm-sim-mbm.h | 51 ++++++++ + 4 files changed, 317 insertions(+), 1 deletion(-) + +commit 477623f0a076b09f703db96927c7b3baeab493d8 +Author: Dan Williams +Date: Wed Mar 27 17:38:45 2013 -0500 + + broadband-modem-novatel: implement CDMA time API (bgo #696739) + + Use AT$NWLTIME to get current time and UTC offset. + + plugins/novatel/mm-broadband-modem-novatel.c | 169 + ++++++++++++++++++++++++++- + 1 file changed, 168 insertions(+), 1 deletion(-) + +commit a7b8cbb71d1447a5cc870aefed99ccc6b3325cd3 +Author: Aleksander Morgado +Date: Fri Mar 29 12:33:20 2013 +0100 + + port-probe: don't reschedule next probing step when serial port + buffer full + + When the serial port buffer gets full of non-AT garbage during + port probing, + we were re-scheduling the next probing step, which is completely + wrong, as we + then would be processing the same probing task twice. If we get a + buffer full, + just cancel the AT probing cancellable, which would cancel not only + the possible + AT probings, but also the custom init if there is any. + + Also, make sure that the custom_init() of the plugins out there + don't return an + error if the GCancellable is cancelled. Cancelling the GCancellable + means we + should just stop the custom_init(), and actually sending an error in + custom_init() means that the port should be set as unsupported by + the plugin, so + completely different things. + + Should fix https://bugzilla.gnome.org/show_bug.cgi?id=696695 + + plugins/huawei/mm-plugin-huawei.c | 5 +---- + plugins/longcheer/mm-plugin-longcheer.c | 5 +---- + plugins/sierra/mm-plugin-sierra.c | 10 ++++------ + plugins/x22x/mm-plugin-x22x.c | 5 +---- + src/mm-port-probe.c | 10 ++++++++-- + 5 files changed, 15 insertions(+), 20 deletions(-) + +commit 1e7164792732b28db77fdc3d56e4a7a9e43e6602 +Author: Aleksander Morgado +Date: Thu Mar 28 20:48:42 2013 +0100 + + broadband-modem: plugins may disable parent's access tech loading + + src/mm-broadband-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 633708b364c646595af3242c6d1a7b03b9a2359f +Author: ori inbar +Date: Wed Mar 27 15:14:51 2013 -0500 + + serial: add support to optionally send line-feed at the end of + AT commands. + + src/mm-at-serial-port.c | 40 ++++++++++++++++++++++++++++++++++------ + src/mm-at-serial-port.h | 2 ++ + src/mm-plugin.c | 19 +++++++++++++++++++ + src/mm-plugin.h | 1 + + src/mm-port-probe.c | 5 +++++ + src/mm-port-probe.h | 1 + + 6 files changed, 62 insertions(+), 6 deletions(-) + +commit 98772f2ec9af0662631232a176141465a12b06e6 +Author: ori inbar +Date: Wed Mar 27 15:25:58 2013 -0500 + + iface-modem-3gpp: handle access technology change in operator_loading + state + + This patch fixes a problem of disregarding CEREG/CGREG/CREG reported + access technology since we are in "registering" state - meaning we are + loading operator name+code. now even in this transition state the ACT + is updated. + + src/mm-iface-modem-3gpp.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit effd574a632c78f70887368c8296d133157c2a3c +Author: Aleksander Morgado +Date: Thu Mar 28 17:49:22 2013 +0100 + + option: don't apply both vendor and product filters at the same time + + The probing logic expects either one or the other right now. In this + case, it is + just simpler to include the Nozomi-related VID in the vendor filter, + and remove + the product filter. + + plugins/option/mm-plugin-option.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 2bbe2f83275e04c44f7fb46102d40871ae505603 +Author: Dan Williams +Date: Wed Mar 27 16:05:31 2013 -0500 + + device: read PCI VID/PID + + Nozomi devices are old Option NV CardBus devices with the ttys (nozX) + hanging directly off the PCI device. We need to read the vendor and + product IDs off them too. It appears that udev screws up the + ID_MODEL_ID + field (at least on F17, its set to the device path and not the PCI ID) + so just skip looking at the TTY itself and read the PCI parent, where + we're 100% sure to find the PCI IDs we want. + + src/mm-device.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit e33fc37ec2e7574bf74ae60496fe3c1ed2ff0e3a +Author: Aleksander Morgado +Date: Wed Mar 27 15:15:04 2013 +0100 + + option: ignore PH_SIM facility lock in 'nozomi' based modems + + https://bugzilla.gnome.org/show_bug.cgi?id=696593 + + plugins/option/mm-broadband-modem-option.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit d9cf4fe91c21eb045cc4718d73cf2210b945d273 +Author: Aleksander Morgado +Date: Wed Mar 27 15:14:34 2013 +0100 + + iface-modem-3gpp: let plugins ignore facility locks + + Plugins may decide which facility locks can be completely skipped + from the list + being checked. + + src/mm-broadband-modem.c | 24 ++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.c | 9 +++++++++ + src/mm-iface-modem-3gpp.h | 11 ++++++----- + 3 files changed, 39 insertions(+), 5 deletions(-) + +commit fea5b7a670ac64775771ccd3d3b635d4878d6ba9 +Author: Dan Williams +Date: Wed Mar 27 18:20:34 2013 -0500 + + broadband-modem-icera: make CME 3 errors fail power-up (bgo #696742) + + +CME ERROR: 3 (Not Allowed) means airplane mode, at least for the + Samsung Yxxxx devices that I've got. And if we get this error + on any other devices, chances are they'll fail to power up too. + + plugins/icera/mm-broadband-modem-icera.c | 54 + ++++++++++++++++++++++++++++++++ + 1 file changed, 54 insertions(+) + +commit d6ac6508d95aeab49f7ed9a5fe225c7685107f73 +Author: Aleksander Morgado +Date: Wed Mar 27 17:00:08 2013 +0100 + + plugin: explicitly request QMI probing + + Plugins which may support QMI ports need to explicitly request + QMI probing + in cdc-wdm devices. This should also avoid probing cdc-wdm ports + when we know + that the plugin doesn't support them (e.g. with Ericsson MBM devices). + + https://bugzilla.gnome.org/show_bug.cgi?id=696701 + + plugins/anydata/mm-plugin-anydata.c | 1 + + plugins/generic/mm-plugin-generic.c | 1 + + plugins/gobi/mm-plugin-gobi.c | 1 + + plugins/huawei/mm-plugin-huawei.c | 1 + + plugins/pantech/mm-plugin-pantech.c | 7 ++++--- + plugins/sierra/mm-plugin-sierra.c | 1 + + src/mm-plugin.c | 29 +++++++++++++++++++++++++++-- + src/mm-plugin.h | 1 + + 8 files changed, 37 insertions(+), 5 deletions(-) + +commit b76dc134bf6bed78c0a83fdc12d2e1f66821148c +Author: Aleksander Morgado +Date: Wed Mar 27 17:29:49 2013 +0100 + + novatel: try to flip secondary ports to AT as soon as possible + + So do it during port probing. If we send this command early enough + in the + first AT port being probed, it should flip the secondary ports to + AT mode + before their port probing is finished. + + https://bugzilla.gnome.org/show_bug.cgi?id=696696 + + plugins/novatel/mm-broadband-modem-novatel.c | 23 ----------------------- + plugins/novatel/mm-plugin-novatel.c | 16 ++++++++++++++++ + 2 files changed, 16 insertions(+), 23 deletions(-) + +commit ca97f0e79fde28f934eddebb32b51dfa31be5d74 +Author: Dan Williams +Date: Wed Mar 27 18:02:50 2013 -0500 + + broadband-modem-sierra: fix trivial copy & paste error + + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 190eb73bf969e3c1bd4e3dc101b538e810739664 +Author: Dan Williams +Date: Wed Mar 27 15:02:40 2013 -0500 + + broadband-modem: prefer specific access tech checks over generic + +CGREG access tech (bgo #696705) + + If the modem has specific access technology checks, don't override + them + with the generic access technology from +CGREG responses, since that + doesn't have the granularity that specific checks do. For example, + the + +CGREG response only indicates UMTS, and cannot indicate HSDPA, HSUPA, + HSPA, HSPA+, DC-HSPA, etc. + + src/mm-broadband-modem.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 9119962e12aa886eae575993df09602362554cf3 +Author: Dan Williams +Date: Wed Mar 27 08:31:18 2013 -0500 + + broadband-modem: remove debugging code + + Slipped in while debugging Nozomi stuff; not caught in review. + + src/mm-broadband-modem.c | 2 -- + 1 file changed, 2 deletions(-) + +commit b377a62377db46c2cdb2b3b8f6f4166f7d2a3dcc +Author: Aleksander Morgado +Date: Tue Mar 26 16:40:54 2013 +0100 + + iface-modem: never try to create a SIM in a CDMA-only modem + + CDMA modems without LTE capabilities will usually not have a SIM, + so just skip + loading a SIM object if so. + + https://bugzilla.gnome.org/show_bug.cgi?id=696582 + + src/mm-broadband-modem.c | 52 + +++--------------------------------------------- + src/mm-iface-modem.c | 6 ++++-- + 2 files changed, 7 insertions(+), 51 deletions(-) + +commit 7f1bea5fbf9ea25eeebb320e476d56ece44f276e +Author: Dan Williams +Date: Mon Mar 25 13:47:00 2013 -0500 + + broadband-modem-qmi: zero-pad ESN to 8 characters + + It's very likely to already be 8 characters, but if by some + chance it's 7, zero-pad like we do for AT+GSN responses in + the generic CDMA code. + + src/mm-broadband-modem-qmi.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 3b3326bdf03a02822ac8d1e9e0ff08db2324c3ed +Author: Dan Williams +Date: Mon Mar 25 13:20:13 2013 -0500 + + broadband-modem: parse +GSN response for IMEI, MEID, and ESN + (bgo #696596) + + +GSN response differs widely between modems. Some prefix the + MEID and/or ESN with 0x, some have leading zeros, some return the + MEID and the ESN, and some append the serial number to the end of + the IMEI. Handle that and make the ESN, MEID, IMEI, and + EquipmentIdentifier parsing consistent. + + src/mm-broadband-modem.c | 81 +++++++++++++++++++++++---- + src/mm-modem-helpers.c | 121 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 5 ++ + src/tests/test-modem-helpers.c | 68 ++++++++++++++++++++++- + 4 files changed, 263 insertions(+), 12 deletions(-) + +commit f299a05571f8d9b9f0bf996f20563ed9a13dab02 +Author: Aleksander Morgado +Date: Tue Mar 26 12:34:52 2013 +0100 + + sms-part: use correct printf modifier for gsize + + This is the port to git master of the following commit: + + commit 294a91d9f6390d532399be35ddbf6a2b8d136576 + Author: Thomas Bechtold + Date: Mon Mar 25 14:28:03 2013 +0100 + + sms-utils: use correct printf modifier for gsize + + src/mm-sms-part.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit fcbaa4355505b9de3f227145c4455ca5c387c1e8 +Author: Dan Williams +Date: Mon Mar 25 16:18:28 2013 -0500 + + broadband-modem: minimally verify QCDM MDN before using it + + Sometimes it's garbage, and we don't like garbage. + + src/mm-broadband-modem.c | 27 ++++++++++++++++++++++++--- + 1 file changed, 24 insertions(+), 3 deletions(-) + +commit 95b46c16f1ddb5102876ad87ade47b974cd45e34 +Author: Dan Williams +Date: Mon Mar 25 15:49:08 2013 -0500 + + broadband-modem-sierra: add after-sim-unlock delay + + Older devices may crash if asked to connect right after sending the + PIN and unlocking the SIM; they simply stop responding to AT commands + around the first request for access technology and then reboot. A + delay seems prevents this behavior. + + Since it's not uncommon to require a delay after SIM unlock, add one + for newer sierra_net devices as well, even though we're not quite + sure if they need one or not. It doesn't hurt, at least. + + plugins/sierra/mm-broadband-modem-sierra.c | 50 + ++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +commit 8ebce66f966c18bea0114206bcfeacdc08023c84 +Author: Dan Williams +Date: Mon Mar 25 15:03:59 2013 -0500 + + sierra: fix time check warnings for modems that don't support time + + 'result' may be NULL even if no error is set. Errors aren't set + because we want to continue the !TIME/!SYSTIME sequence regardless + of errors, so we can figure out which command the modem supports. + + Trying to get a uint32 out of a NULL GVariant makes glib complain, + and it's wrong, so don't do that. + + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 14bb687b946380e03c6c6e482f14c0374e50ac18 +Author: Aleksander Morgado +Date: Fri Mar 22 08:17:48 2013 +0100 + + iface-modem-cdma: fix use of uninitialized variable + + src/mm-iface-modem-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 215255d32553c3ef8919052b8c33a866c84cac7a +Author: Aleksander Morgado +Date: Wed Oct 10 15:35:50 2012 +0200 + + cli: show CDMA activation state info + + cli/mmcli-modem.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 3b66047d941e8d38c38022fc835ce1f5dab32bf8 +Author: Aleksander Morgado +Date: Tue Oct 9 18:59:56 2012 +0200 + + broadband-modem-qmi: implement automatic CDMA activation + + src/mm-broadband-modem-qmi.c | 347 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 344 insertions(+), 3 deletions(-) + +commit 6252df0bef49c417a4d5b7bab51695d57de3b658 +Author: Aleksander Morgado +Date: Wed Oct 10 11:30:05 2012 +0200 + + broadband-modem-qmi: new generic power cycle action + + src/mm-broadband-modem-qmi.c | 176 + ++++++++++++++++++++++++++++--------------- + 1 file changed, 114 insertions(+), 62 deletions(-) + +commit 3e5251cad703dcb7ec679fae215f4cb01503df4e +Author: Aleksander Morgado +Date: Tue Oct 9 18:21:02 2012 +0200 + + broadband-modem-qmi: implement initial CDMA activation state loading + + src/mm-broadband-modem-qmi.c | 97 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 27 ++++++++++++ + src/mm-modem-helpers-qmi.h | 2 + + 3 files changed, 126 insertions(+) + +commit 5cc98341ad5fbafd3d8f83c65767f604b0e5a5e4 +Author: Aleksander Morgado +Date: Tue Oct 9 17:59:06 2012 +0200 + + iface-modem-cdma: load initial activation state during init + + src/mm-iface-modem-cdma.c | 38 ++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 8 ++++++++ + 2 files changed, 46 insertions(+) + +commit 240dc12fd268b2fed4c14e303779d779d9c39490 +Author: Aleksander Morgado +Date: Tue Oct 9 17:46:27 2012 +0200 + + iface-modem-cdma: allow reporting activation state changes + + src/mm-iface-modem-cdma.c | 68 + ++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-cdma.h | 10 ++++--- + 2 files changed, 74 insertions(+), 4 deletions(-) + +commit 685eb85534118557545b5b4e5516818ab21394a5 +Author: Aleksander Morgado +Date: Tue Oct 9 17:50:33 2012 +0200 + + api,enums: new `MM_MODEM_CDMA_ACTIVATION_STATE_UNKNOWN' value + + Used initially when we don't know the current activation state. + + include/ModemManager-enums.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 3e33f1bc4dd925da6c52191aa953f64e1cd22de2 +Author: Aleksander Morgado +Date: Tue Oct 9 17:45:43 2012 +0200 + + api,introspection: new `ActivationState' property in the CDMA + interface + + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +++ + .../org.freedesktop.ModemManager1.Modem.ModemCdma.xml | 8 ++++++++ + libmm-glib/mm-modem-cdma.c | 18 + ++++++++++++++++++ + libmm-glib/mm-modem-cdma.h | 1 + + 4 files changed, 30 insertions(+) + +commit 9367f239db5b64f560e02575335b176c0a38024b +Author: Aleksander Morgado +Date: Tue Oct 9 17:15:57 2012 +0200 + + api,introspection: minor updates in the CDMA interface descriptions + + introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml | + 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit ad757bd3bc722bd8ee9d015d1a6b45f689fc1628 +Author: Aleksander Morgado +Date: Thu Mar 21 17:29:49 2013 +0100 + + bearer-qmi: don't try to gather connection settings if we didn't + connect + + src/mm-bearer-qmi.c | 46 +++++++++++++++++++++++++--------------------- + 1 file changed, 25 insertions(+), 21 deletions(-) + +commit aa84ce98f7a94085b81ec581a2ef45db77ee5080 +Author: Aleksander Morgado +Date: Wed Mar 20 21:36:34 2013 +0100 + + blacklist: ignore Arduino devices + + https://bugs.launchpad.net/bugs/910736 + https://bugs.launchpad.net/bugs/1153632 + + src/77-mm-usb-device-blacklist.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 0b39072b76cc5cca1dd84a7db079b4d6db3386cb +Author: Aleksander Morgado +Date: Wed Mar 20 18:16:10 2013 +0100 + + error-helpers: avoid crash when error is not recognized + + Just remove the last element with NULL strings in the array of errors, + as we're + safe using G_N_ELEMENTS() to iterate it. + + Reported by Jose Maria Gonzalez Calabozo + + src/mm-error-helpers.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit f27dbda4a7b21aa4093d71c3886e67ca614e4f64 +Author: Aleksander Morgado +Date: Wed Mar 20 09:50:34 2013 +0100 + + iface-modem-cdma: fix checking support for manual activation + + src/mm-iface-modem-cdma.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit e6a5ad259ce20fb55e9524502f9c66c80e3ba5eb +Author: Aleksander Morgado +Date: Thu Mar 14 14:41:50 2013 +0100 + + build: fix check for libqmi when newest QMI commands are enabled + + Reported by Marius Kotsbak + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b64fc4b588a9dfa953219b9ab3a1ec036d7c9c80 +Author: Aleksander Morgado +Date: Wed Mar 13 17:05:55 2013 +0100 + + blacklist: ignore West Mountain radio devices + + https://bugs.launchpad.net/bugs/1154654 + + src/77-mm-usb-device-blacklist.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 671d34cf925c63e0c06934bb3516d42581efeb35 +Author: Dan Williams +Date: Wed Mar 13 10:31:06 2013 -0500 + + qcdm: add auto-LTE modes for GSM and CDMA + + as in, CDMA+EVDO+LTE and GSM+UMTS+LTE which were missing before. + + libqcdm/tests/modepref.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit bee388098cb892c8697419f5f007f8d506ec8dd4 +Author: Aleksander Morgado +Date: Wed Mar 13 11:17:27 2013 +0100 + + build: ignore 'modepref' test + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit dd4be407b210aa710dc862bb246bbbec17c27805 +Author: Dan Williams +Date: Tue Mar 12 16:50:49 2013 -0500 + + qcdm: modepref: reset device after setting mode preference + + Otherwise it doesn't actually take until you unplug/replug. + + libqcdm/tests/modepref.c | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit 974471e2952b985d8d93de01b7f6f54086180365 +Author: Dan Williams +Date: Tue Mar 12 15:46:33 2013 -0500 + + build: distribute autogen.sh + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e390d210750f21585185d3ed0b9dd5629b974ed5 +Author: Dan Williams +Date: Tue Mar 12 13:00:06 2013 -0500 + + qcdm: add modepref utility + + Sets and gets the NV "mode pref" item for allowed access + technologies. + + libqcdm/tests/Makefile.am | 8 +- + libqcdm/tests/modepref.c | 516 + ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 523 insertions(+), 1 deletion(-) + +commit 5efb1ceb5eacaabad1d640de713d3576a19c5831 +Author: Dan Williams +Date: Tue Mar 12 12:58:37 2013 -0500 + + qcdm: fix up NV Mode Pref item handling + + While the QCDM and DIAG_NV are the same, in reality they shouldn't + be and there should be a mapping between them. That wasn't happening, + so fix that up and add a few missing modes to the NV item defines. + + libqcdm/src/commands.c | 65 + +++++++++++++++++++++++++++++--------------------- + libqcdm/src/commands.h | 2 ++ + libqcdm/src/nv-items.h | 1 + + 3 files changed, 41 insertions(+), 27 deletions(-) + +commit 30fb4e9da7f808659d8e7bfe9e9c2de2b8eafea2 +Author: Dan Williams +Date: Tue Mar 12 12:08:24 2013 -0500 + + wmc: add get functionality to uml290mode + + uml290/uml290mode.c | 301 + ++++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 256 insertions(+), 45 deletions(-) + +commit 66c5416e3cbe6233c24de3738c1e3cbe6c1709af +Author: Aleksander Morgado +Date: Tue Mar 12 12:57:31 2013 +0100 + + broadband-modem-qmi: fix logic to include GSM/WCDM acquisition + order preference + + src/mm-broadband-modem-qmi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 4e6400d3c8f30fa590b0276823254a4be11ff105 +Author: Aleksander Morgado +Date: Tue Mar 12 18:48:45 2013 +0100 + + zte: add port type hints for the ZTE MF195 + + https://bugzilla.gnome.org/show_bug.cgi?id=691480 + + plugins/zte/77-mm-zte-port-types.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 5758fafaf5b5c87269f99b5dfaae64e492d519fd +Author: Aleksander Morgado +Date: Tue Mar 12 12:22:22 2013 +0100 + + modem-helpers-qmi: fix allowed mode translation from QMI to MM + + Which actually fixes allowed mode switching in MM... + + src/mm-modem-helpers-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4b2577fe297e7e49bf369a18ba51b2de44dc3dfe +Author: Aleksander Morgado +Date: Tue Mar 12 11:01:27 2013 +0100 + + broadband-modem-qmi: fix initial operating mode loading + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2bcc647d3e1fa548b224dfb23ce5489ce6c5ac44 +Author: Aleksander Morgado +Date: Tue Mar 12 10:59:14 2013 +0100 + + broadband-modem-qmi: handle 'UimUninitialized' error when checking + unlock status + + QMI modems without SIM may report 'UimUninitialized' QMI protocol + errors, so + catch those and use them as 'SIM failure' so that they get reported + to the user. + + src/mm-broadband-modem-qmi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 0dea5b5d72bfd9c3c1dab88dcd6d054408abbb53 +Author: Ben Chan +Date: Tue Mar 5 13:21:21 2013 -0800 + + broadband-modem: fix enable flag in + UnsolicitedRegistrationEventsContext + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 14c03f98ad9d25af117c0d161676fb1f9f481005 +Author: Aleksander Morgado +Date: Tue Mar 5 20:47:58 2013 +0100 + + mbm: fix 3gpp dialling sequence when result comes through polling + + plugins/mbm/mm-broadband-bearer-mbm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 144cc7011ea62426af784607e431318ae113361e +Author: Aleksander Morgado +Date: Tue Mar 5 20:32:03 2013 +0100 + + mbm: tag the ttys instead of the parent usb device + + We can just tag the ttys instead of the parent usb device, so that + the core + logic which looks in the plugin-specified port tags works + properly. There is no + need to explicitly tag the net port, as the probing for this port + ends when a + plugin suggestion comes from another port probing on the same device. + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 3ebc8413b0d06346824942da400b04908b2c7ab7 +Author: Aleksander Morgado +Date: Mon Mar 4 13:38:19 2013 +0100 + + udev: tag all devices from idVendor 0x0711 as manual-scan-only + + Magic Control Technology Corp (0x0711) manufacturers several + USB<->RS232 + adapters. + + src/77-mm-usb-serial-adapters-greylist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8450b7b2a39a6e1c9fda950dc3f821984c73c56b +Author: Aleksander Morgado +Date: Sat Mar 2 14:13:32 2013 +0100 + + core: don't automatically probe ports of USB<->serial adapters + + We should not automatically probe ports marked as coming from USB + to serial + adapters, as we're not sure that a modem is behind the adapter. Still, + let the + user request a manual scan and have these devices probed in that case. + + https://bugzilla.gnome.org/show_bug.cgi?id=647556 + https://bugzilla.gnome.org/show_bug.cgi?id=691076 + + src/77-mm-usb-device-blacklist.rules | 6 ----- + src/77-mm-usb-serial-adapters-greylist.rules | 22 ++++++++++++++++++ + src/Makefile.am | 1 + + src/main.c | 4 ++-- + src/mm-manager.c | 34 + +++++++++++++++++++--------- + src/mm-manager.h | 3 ++- + 6 files changed, 50 insertions(+), 20 deletions(-) + +commit 3678ae53788848d2e202d9afcc7f8eb9577fc427 +Author: Ben Chan +Date: Mon Mar 4 18:37:46 2013 -0800 + + iface-modem-3gpp: handle non-deferrable registration state updates + + This patch changes MMIfaceModem3gpp to differentiate between + deferrable + and non-deferrable 3GPP registration state updates. Periodic or + unsolicited registration state updates are deferrable, while internal + updates, e.g. due to modem being disabled, are non-deferrable. + + src/mm-iface-modem-3gpp.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 1e67312aaf0f03fda9bf15e2f8b8175ab1e2847a +Author: Ben Chan +Date: Mon Mar 4 17:00:36 2013 -0800 + + broadband-modem: fix disabling of unsolicited registration events + + src/mm-broadband-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 113916beb5dcb16f139054bd3913255e4028b111 +Author: Gerald Richter +Date: Mon Mar 4 08:32:23 2013 -0600 + + sierra: add MC8790 to APP1 PPP whitelist + + plugins/sierra/mm-plugin-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9ee9845b1ebbb29a7540eb5adb6ee03cbe030b2d +Author: Aleksander Morgado +Date: Fri Mar 1 18:21:19 2013 +0100 + + iface-modem-3gpp: avoid re-setting deferred registration update + while disabling + + Don't clear the current deferred registration update until having + disabled + and cleaned up unsolicited registrations state messages, or we may + end up + re-setting the deferred registration update again meanwhile + + src/mm-iface-modem-3gpp.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit f93bba25f2ef41af8f28296c8f8b2be81c42bdb6 +Author: Ben Chan +Date: Thu Feb 28 11:11:59 2013 -0800 + + iface-modem-3gpp: clear deferred registration state update when + disabling + + src/mm-iface-modem-3gpp.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit c79d266e627242b22a5e146ab157e34135e7a36a +Author: Aleksander Morgado +Date: Tue Feb 26 23:02:04 2013 +0100 + + udev: update all udev rules to always match both VID/PID together + + If the rules to tag specific USB interface numbers only apply on + the PID, we'll + end up seeing that if the port has a parent with another PID, and + that other + PID also has a rule, port will get tagged multiple times. Easier to + see with an + example: + + The ZTE MF637 (VID 0x19D2, PID 0x0121) had the following rules: + + ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="04", + ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" + ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="01", + ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" + + In our ZTE rules we also have some for the device with PID 0x0002, + like: + + ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="02", + ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" + ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="04", + ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" + + And it seems that we can grab multiple PIDs from a single port, + i.e. from the + parent objects in the hierarchy: + + udevadm info -a -n /dev/ttyUSB4 | grep idProduct + ATTRS{idProduct}=="0121" + ATTRS{idProduct}=="0020" + ATTRS{idProduct}=="0002" + + Where that 0x0002 idProduct is not from the modem, but from the + EHCI Host + Controller (with idVendor 0x1d6b in my case). + + So... we end up seeing that both set of rules will apply to the ports, + and we + misleadingly get: + + (ttyUSB3) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + ZTE: AT port 'tty/ttyUSB2' flagged as primary + (ttyUSB2) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + ZTE: AT port 'tty/ttyUSB1' flagged as secondary + (ttyUSB1) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + ZTE: AT port 'tty/ttyUSB4' flagged as primary + b_port(): (ttyUSB4) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB2 + at (primary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB1 + at (secondary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB2 + data (primary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB0 + qcdm + + Which is wrong, as ttyUSB4 should have been our primary port, + not ttyUSB2. + + With this patch on, the rules apply only to the VID/PID pair, and + we end up + getting what we really wanted: + + (ttyUSB3) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + (ttyUSB2) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + ZTE: AT port 'tty/ttyUSB1' flagged as secondary + (ttyUSB1) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + ZTE: AT port 'tty/ttyUSB4' flagged as primary + b_port(): (ttyUSB4) type 'at' claimed by + /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB4 + at (primary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB1 + at (secondary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB4 + data (primary) + (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB0 + qcdm + + https://bugzilla.gnome.org/show_bug.cgi?id=694759 + + plugins/longcheer/77-mm-longcheer-port-types.rules | 269 + ++++++++++----------- + plugins/nokia/77-mm-nokia-port-types.rules | 25 +- + plugins/simtech/77-mm-simtech-port-types.rules | 21 +- + plugins/x22x/77-mm-x22x-port-types.rules | 25 +- + plugins/zte/77-mm-zte-port-types.rules | 233 + +++++++++--------- + 5 files changed, 284 insertions(+), 289 deletions(-) + +commit 89461cf7b3bea1ba3fe02de1629305f62cd4cb48 +Author: Aleksander Morgado +Date: Tue Feb 26 21:17:43 2013 +0100 + + iface-modem: allow falling back to 'failed' state + + Allow mm_iface_modem_update_state() receive 'MM_MODEM_STATE_FAILED', + and treat + it as any other change to failed state, but with + 'MM_MODEM_STATE_FAILED_REASON_UNKNOWN'. + + src/mm-iface-modem.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 3f3950bd12e4e09bf6505e7a3f96acdee924ad1c +Author: Aleksander Morgado +Date: Tue Feb 26 20:57:37 2013 +0100 + + plugins: log about all port type hints received from udev + + plugins/longcheer/mm-plugin-longcheer.c | 12 +++++++++--- + plugins/nokia/mm-plugin-nokia-icera.c | 11 +++++++++-- + plugins/simtech/mm-plugin-simtech.c | 12 ++++++++++-- + plugins/x22x/mm-plugin-x22x.c | 12 +++++++++--- + plugins/zte/mm-plugin-zte.c | 13 ++++++++++--- + 5 files changed, 47 insertions(+), 13 deletions(-) + +commit 8d74b11bd3a5627490a25c52ffddae0843c2ee49 +Author: Aleksander Morgado +Date: Mon Feb 25 12:04:23 2013 +0100 + + plugin-manager: cancelled tasks are no longer deferred-until-suggested + + The deferred-until-suggested tasks specify tasks that are + open/ongoing; + cancelled tasks shouldn't have this flag set. + + https://bugzilla.gnome.org/show_bug.cgi?id=694603 + + src/mm-plugin-manager.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 8488782e1424db0ec42839b4713373b588224a3e +Author: Ben Chan +Date: Fri Feb 15 15:17:18 2013 -0800 + + iface-modem-3gpp: defer registration state update when registration + is lost + + This patch defers the update of 3GPP registration state by 15 seconds + when the registration state changes from 'registered' (home / roaming) + to 'searching'. This allows a temporary loss of 3GPP registration to + recover itself when relying on ModemManager to explicitly disconnect + and + reconnect to the network. + + src/mm-iface-modem-3gpp.c | 122 + ++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 102 insertions(+), 20 deletions(-) + +commit 980ad52a479a12e9777419d6e6f0a77005a36528 +Author: Colin Walters +Date: Sun Feb 24 05:16:17 2013 -0500 + + build: Look for generated file in builddir, not srcdir + + libmm-glib/generated/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3f8b11e3f0af19b0df0fb510b76cdcae42a3dd5d +Author: Aleksander Morgado +Date: Fri Feb 22 21:48:45 2013 +0100 + + broadband-modem: fix CUSD response parsing + + When reading the string reply in a +CUSD indication, don't blindly + split + using whitespace or comma as field separator, as the string may be + a text string + with both whitespaces and commas, e.g.: + + +CUSD: 0,"hey hey, something here***and something more here" + + Also, skip reading the encoding field for now, as we don't use it yet. + + src/mm-broadband-modem.c | 47 + ++++++++++++++++------------------------------- + 1 file changed, 16 insertions(+), 31 deletions(-) + +commit c19ee43cbea5c553b5ad2d5bb10f88abad574965 +Author: Aleksander Morgado +Date: Fri Feb 22 20:16:32 2013 +0100 + + broadband-modem: avoid reading already freed memory in USSD operations + + src/mm-broadband-modem.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +commit 9976625f94335295843ff38440d9e48a6e899d3a +Author: Aleksander Morgado +Date: Fri Feb 22 19:39:06 2013 +0100 + + broadband-modem: USSD response may come even before finishing + our request + + MBM devices seem to include the '+CUSD: 0' indication before even + returning OK to our '+CUSD=1' + + (ttyACM0): --> 'AT+CUSD=1,"*111#",15' + (ttyACM0): <-- '+CUSD: 0,"reply here"' + (ttyACM0): <-- 'OK' + + src/mm-broadband-modem.c | 71 + ++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 54 insertions(+), 17 deletions(-) + +commit b1bb8e30b4fd835649b5790895fcd519f1809141 +Author: Aleksander Morgado +Date: Fri Feb 22 18:58:06 2013 +0100 + + broadband-modem: don't assume the returned string is always + hex-encoded + + libmm-glib/mm-common-helpers.c | 25 +++++++++++++++++++++++++ + libmm-glib/mm-common-helpers.h | 1 + + src/mm-broadband-modem.c | 7 ++++++- + 3 files changed, 32 insertions(+), 1 deletion(-) + +commit ca49af0c5d4b649950ef3ed038e70f58a37050f3 +Author: Aleksander Morgado +Date: Fri Feb 22 17:54:16 2013 +0100 + + mbm: fix CFUN result parsing + + plugins/mbm/mm-broadband-modem-mbm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b22bba509aced5aee4da2094fb9a0ff40d2a2cd2 +Author: Aleksander Morgado +Date: Fri Feb 22 17:47:25 2013 +0100 + + broadband-modem: increase default AT command timeout for USSD + operations + + May really take more than 3s. + + src/mm-broadband-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 50ecf2a7d91221ea1db4a26e26222c048062a7a2 +Author: Aleksander Morgado +Date: Fri Feb 22 17:19:58 2013 +0100 + + mbm: implement custom modem_power_down() + + Cache last valid allowed mode always, so that we re-use it when + powering up + again. + + plugins/mbm/mm-broadband-modem-mbm.c | 112 + ++++++++++++++++++++++++++--------- + 1 file changed, 84 insertions(+), 28 deletions(-) + +commit c0ce165d09d5ed80fff31ffd4bceb168e6c10b26 +Author: Aleksander Morgado +Date: Fri Feb 22 16:35:50 2013 +0100 + + mbm: implement custom load_power_state() + + We need to handle modems which appear in low-power mode (e.g. CFUN=4), + so + implement a custom check of the power state. We cannot use the + default check + as MBM modems use CFUN also for allowed mode handling. + + plugins/mbm/mm-broadband-modem-mbm.c | 74 + +++++++++++++++++++++++++++++++----- + 1 file changed, 64 insertions(+), 10 deletions(-) + +commit 75d20c15d4f844270cfc6c31fae261412e4b1b59 +Author: Aleksander Morgado +Date: Fri Feb 22 08:58:36 2013 +0100 + + api: notify in the interface about the reason why the modem is FAILED + + We currently implement 'SIM missing' and 'SIM error', which are + probably the + most common ones. + + cli/mmcli-common.c | 2 ++ + cli/mmcli-modem.c | 15 +++++++---- + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 7 +++++ + include/ModemManager-enums.h | 18 +++++++++++++ + .../org.freedesktop.ModemManager1.Modem.xml | 10 +++++++ + libmm-glib/mm-modem.c | 18 +++++++++++++ + libmm-glib/mm-modem.h | 2 ++ + src/mm-broadband-modem.c | 24 ++++++++++++----- + src/mm-iface-modem.c | 31 + +++++++++++++++++++--- + src/mm-iface-modem.h | 2 ++ + 11 files changed, 115 insertions(+), 15 deletions(-) + +commit a18140e8ed86e6881d1b5f4bcf33620ff791f35e +Author: Aleksander Morgado +Date: Thu Feb 21 11:15:07 2013 +0100 + + plugin: avoid using uninitialized variable + + Reported by: Jose Maria Gonzalez + + src/mm-plugin.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 0377ccaa59c46dc8536b753cc8b9de17a0f19790 +Author: Aleksander Morgado +Date: Wed Feb 20 19:06:16 2013 +0100 + + manager: during initial scan, add new ports in idles + + Treat each port independently in its own idle, as if we're receiving + independent + udev events, otherwise, GSources may not be properly scheduled in + the main loop. + + src/mm-manager.c | 35 +++++++++++++++++++++++++++++++---- + 1 file changed, 31 insertions(+), 4 deletions(-) + +commit 5b072b9198aba83ba4cd69f4310d431682c8ee67 +Author: Aleksander Morgado +Date: Wed Feb 20 17:00:14 2013 +0100 + + plugin: plug memleak + + A new reference to probe was acquired through mm_device_get_probe(), + just unref it + when no longer needed. Note that mm_port_probe_run() will take its + own reference + for as long as required to complete the operation. + + src/mm-plugin.c | 1 + + 1 file changed, 1 insertion(+) + +commit 688bb2cb3a1c960a3e3c5a75c30aeeb641ff2c7a +Author: Aleksander Morgado +Date: Wed Feb 20 16:48:41 2013 +0100 + + plugin: plug memleaks + + This is really just to have a nice valgrind/memcheck output report, + no big deal + if they were never freed. + + src/mm-plugin.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 9bef8531c189887954cb20938a304b2b51f40a94 +Author: Aleksander Morgado +Date: Wed Feb 20 16:07:02 2013 +0100 + + iridium: use generic disconnection logic + + The generic disconnection logic now already handles getting the + port fully + closed and a wait time before reopening it, so no need for a custom + disconnection logic any more. + + plugins/iridium/mm-bearer-iridium.c | 124 + ------------------------------------ + 1 file changed, 124 deletions(-) + +commit 000bb642255ecfefe10f7b6629493c34877399c7 +Author: Aleksander Morgado +Date: Wed Feb 20 12:15:19 2013 +0100 + + serial-port: allow specifying some wait time between closing and + reopening + + We will now by default wait some time (1s) between port getting + fully closed and + the port being reopened again. This logic seems to work for multiple + modems + where there is a single port for both AT and data, like my Nokia C7 + and Iridium + modems. If this wait time is not applied, the port ends up returning + EAGAIN for + every write that we try to do afterwards. + + src/mm-broadband-bearer.c | 75 ++++++++++++++++++++++++------------ + src/mm-serial-port.c | 97 + +++++++++++++++++++++++++++++++++++++++++------ + src/mm-serial-port.h | 8 +++- + 3 files changed, 142 insertions(+), 38 deletions(-) + +commit 9a6fce0a086f28aafda7d963e8661e98a4d44ef6 +Author: Aleksander Morgado +Date: Wed Feb 20 11:41:53 2013 +0100 + + serial-port: remove unneeded property name + + Was incorrectly included in a previous commit + + src/mm-serial-port.h | 1 - + 1 file changed, 1 deletion(-) + +commit d0c18b4277917a39edf50c78ebd14713509321c3 +Author: Aleksander Morgado +Date: Wed Feb 20 10:09:42 2013 +0100 + + bearer-novatel-lte: fix reference counting of the 'data' port + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2267fb04801074fe4dce715699b632499fbea918 +Author: Aleksander Morgado +Date: Wed Feb 20 09:59:20 2013 +0100 + + plugin: plug memleaks + + src/mm-plugin.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f27737e0317c16bf0e13b90d20b6eb670b2f44de +Author: Aleksander Morgado +Date: Wed Feb 20 09:53:14 2013 +0100 + + bearer: plug memleak + + src/mm-bearer.c | 1 + + 1 file changed, 1 insertion(+) + +commit 061760a4f8d5b05eb1d636ecf3264ca3974ad103 +Author: Aleksander Morgado +Date: Wed Feb 20 09:50:04 2013 +0100 + + broadband-modem: plug memleak + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit bb73ce0aaf7c8ae4354d34412880a07f82b8a23e +Author: Ben Chan +Date: Tue Feb 19 22:22:58 2013 -0800 + + iface-modem: fix modem state consolidation upon bearer disconnection + + Patch "iface-modem: fix invalid modem state consolidation" (commit + 69aff6183a9e6532b4074c89831d6dcfa81ddcce) incorrectly consolidates the + modem state upon the disconnection of a bearer. The modem state + remains + 'connected' after the last bearer is disconnected. This patch fixes + that. + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit add455c7e587883abbe1b16e511a3a8b24064b38 +Author: Evan Nemerson +Date: Tue Feb 19 03:16:07 2013 -0800 + + build: fix passing arguments to configure from autogen.sh (bgo + #694157) + + autogen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8fb57bb5534c83c358a9c4c4c681ac787c14289a +Author: Aleksander Morgado +Date: Tue Feb 19 15:37:43 2013 +0100 + + zte: load unlock retries with +ZPINPUK + + e.g: + + AT+ZPINPUK=? | + | ZPINPUK: 3,10 + | OK + + plugins/zte/mm-broadband-modem-zte.c | 71 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 71 insertions(+) + +commit 5fe69d0ebbb621f754e1b0e048bfb4b6ae21e2a1 +Author: Aleksander Morgado +Date: Tue Feb 19 13:17:57 2013 +0100 + + at-serial-port: plug memleak + + src/mm-at-serial-port.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f9583cb5304ba5ecd862cdf214c669f7babdfe66 +Author: Aleksander Morgado +Date: Tue Feb 19 12:54:56 2013 +0100 + + core: update logging levels of several messages + + 'info' log level, the default if none specified, included too many + logs which + aren't that useful, to try to minimize the noise we produce by + default. + + src/mm-broadband-modem-qmi.c | 4 ++-- + src/mm-broadband-modem.c | 17 ++--------------- + src/mm-plugin-manager.c | 18 +++++++++--------- + src/mm-port-probe.c | 8 ++++---- + src/mm-serial-port.c | 11 +++++------ + src/mm-sms-qmi.c | 4 ++-- + 6 files changed, 24 insertions(+), 38 deletions(-) + +commit 37ddfe202eb138ab50140cc0e2a0309092547bbf +Author: Aleksander Morgado +Date: Tue Feb 19 12:52:01 2013 +0100 + + plugin-manager: log time required for device probing + + src/mm-plugin-manager.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit ed2b32c6829ad6ed9310f2f76047a6dc2e12d9dd +Author: Aleksander Morgado +Date: Tue Feb 19 12:45:10 2013 +0100 + + plugin-manager: if minimum time consumed and all deferred tasks, + abort probing + + For the case where we just get a device with all net ports (i.e. all + deferred + until result suggested), just abort the probing if the minimum + probing time is + consumed. + + src/mm-plugin-manager.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +commit 1a11af0f86cee0ca24861a8369782627906363d1 +Author: Aleksander Morgado +Date: Tue Feb 19 09:50:52 2013 +0100 + + broadband-bearer: fallback to primary AT port if no data AT port + available + + Spotted by Dan Williams with his ADU960S. + + src/mm-broadband-bearer.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit d593116d68ecda7fc0ef67e7399d0588cde60a38 +Author: Aleksander Morgado +Date: Mon Feb 18 16:06:01 2013 +0100 + + base-modem: don't run port init sequence if we're just sending + a command + + This may happen when sending commands to the modem while in + non-enabled state, + like when sending the PIN. In this case, just send the command, + don't fully + initialize the port with the initialization sequence. + + src/mm-base-modem-at.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 7a58647af78295d059628c73c4dc2558131fea51 +Author: Aleksander Morgado +Date: Mon Feb 18 15:34:57 2013 +0100 + + broadband-bearer: fully reopen data port before flashing + + When disconnecting the data port, first fully close and reopen the + port before + flashing. This helps with some modems where the flashing mechanism + doesn't + fully work, like this ZTE modem: + + Before: + [1360325270.357678] [mm-bearer.c:690] mm_bearer_disconnect(): + Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0' + [1360325270.357796] [mm-iface-modem.c:1198] + mm_iface_modem_update_state(): Modem + /org/freedesktop/ModemManager1/Modem/1: state changed (connected + -> disconnecting) + [1360325270.358503] [mm-broadband-bearer.c:1539] + disconnect_3gpp(): Sending PDP context deactivation in secondary + port... + [1360325270.358549] [mm-serial-port.c:927] mm_serial_port_open(): + (ttyUSB4) device open count is 2 (open) + [1360325270.358633] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB4): --> 'AT+CGACT=0,2' + [1360325270.375131] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB4): <-- 'OK' + [1360325270.375251] [mm-serial-port.c:967] mm_serial_port_close(): + (ttyUSB7) device open count is 1 (close) + [1360325270.375282] [mm-serial-port.c:927] mm_serial_port_open(): + (ttyUSB7) device open count is 2 (open) + [1360325270.375300] [mm-broadband-bearer.c:1497] + cgact_secondary_ready(): Flash primary port... + [1360325270.375833] [mm-serial-port.c:967] mm_serial_port_close(): + (ttyUSB4) device open count is 1 (close) + [1360325271.377539] [mm-broadband-bearer.c:1455] + primary_flash_3gpp_ready(): PDP disconnection already sent in + secondary port + [1360325271.377634] [mm-serial-port.c:967] mm_serial_port_close(): + (ttyUSB7) device open count is 1 (close) + [1360325271.377680] [mm-port.c:149] mm_port_set_connected(): + (ttyUSB7): port now disconnected + [1360325271.377721] [mm-bearer.c:623] disconnect_ready(): + Disconnected bearer '/org/freedesktop/ModemManager1/Bearer/0' + [1360325286.415396] [mm-serial-port.c:927] mm_serial_port_open(): + (ttyUSB7) device open count is 2 (open) + [1360325286.415510] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB7): --> 'AT+ZPAS?' + [1360325287.400589] [mm-broadband-modem.c:1717] + modem_load_signal_quality(): loading signal quality... + [1360325287.400679] [mm-serial-port.c:927] mm_serial_port_open(): + (ttyUSB7) device open count is 3 (open) + [1360325289.401873] [mm-iface-modem.c:762] + access_technologies_check_ready(): Couldn't refresh access + technologies: 'Serial command timed out' + [1360325289.401940] [mm-serial-port.c:967] mm_serial_port_close(): + (ttyUSB7) device open count is 2 (close) + [1360325289.401998] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB7): --> 'AT+CIND?' + [1360325292.403162] [mm-serial-port.c:927] mm_serial_port_open(): + (ttyUSB7) device open count is 3 (open) + [1360325292.403247] [mm-serial-port.c:967] mm_serial_port_close(): + (ttyUSB7) device open count is 2 (close + ... + + After: + [1360326617.604527] [mm-bearer.c:690] mm_bearer_disconnect(): + Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0' + [1360326617.604622] [mm-iface-modem.c:1198] + mm_iface_modem_update_state(): Modem + /org/freedesktop/ModemManager1/Modem/0: state changed (connected + -> disconnecting) + [1360326617.605006] [mm-broadband-bearer.c:1535] + disconnect_3gpp(): Sending PDP context deactivation in secondary + port... + [1360326617.605034] [mm-serial-port.c:929] mm_serial_port_open(): + (ttyUSB4) device open count is 2 (open) + [1360326617.605088] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB4): --> 'AT+CGACT=0,2' + [1360326617.620075] [mm-at-serial-port.c:392] debug_log(): + (ttyUSB4): <-- 'OK' + [1360326617.620206] [mm-broadband-bearer.c:1493] + cgact_secondary_ready(): Flash primary port... + [1360326617.620241] [mm-serial-port.c:1334] + mm_serial_port_flash(): (ttyUSB7) reopening before flash (2) + [1360326617.620265] [mm-serial-port.c:969] mm_serial_port_close(): + (ttyUSB7) device open count is 1 (close) + [1360326617.620286] [mm-serial-port.c:969] mm_serial_port_close(): + (ttyUSB7) device open count is 0 (close) + [1360326617.620320] [mm-serial-port.c:985] mm_serial_port_close(): + (ttyUSB7) closing serial port... + [1360326617.620356] [mm-port.c:149] mm_port_set_connected(): + (ttyUSB7): port now disconnected + [1360326617.621355] [mm-serial-port.c:1017] + mm_serial_port_close(): (ttyUSB7) serial port closed + [1360326617.621403] [mm-serial-port.c:860] mm_serial_port_open(): + (ttyUSB7) opening serial port... + [1360326617.622836] [mm-serial-port.c:417] real_config_fd(): + (ttyUSB7): port attributes not fully set + + src/mm-broadband-bearer.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 553bebe8255a78e1f9f7b559d7782f9ac87be443 +Author: Aleksander Morgado +Date: Fri Feb 8 13:32:51 2013 +0100 + + serial-port: new method to reopen a port + + We will fully close the port and the re-open it again keeping the same + open_count that we had before. + + src/mm-serial-port.c | 32 +++++++++++++++++++++++++++++++- + src/mm-serial-port.h | 4 ++++ + 2 files changed, 35 insertions(+), 1 deletion(-) + +commit f8e3a8adb9584bf462c8016eea831f3a1f945875 +Author: Aleksander Morgado +Date: Mon Feb 18 14:32:27 2013 +0100 + + broadband-bearer: try to run CGACT first on the primary port + + It may happen that the primary port is not the data port; if so, + try with the + primary port first, and otherwise fallback to the secondary port. + + src/mm-broadband-bearer.c | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 92f0c579c466c02adcdc1875109071ef530bda08 +Author: Aleksander Morgado +Date: Mon Feb 18 14:31:09 2013 +0100 + + broadband-bearer: update disconnection logic + + We were maintaining the port we used for dialling (the data port) + open during + the connection, as specified by the CDMA or 3GPP specific logic. We'll + now close + that open count reference ourselves within the CDMA or 3GPP + disconnection logic + itself. + + src/mm-broadband-bearer.c | 105 + ++++++++++++++++++++++++++-------------------- + 1 file changed, 59 insertions(+), 46 deletions(-) + +commit b6402a4e2158adf28dad2cd6b2dcf8b4966be2d0 +Author: Aleksander Morgado +Date: Sun Feb 17 21:57:34 2013 +0100 + + bearer,3gpp: dial operation specifies which data port to use + + Instead of deciding in advance which data port to use, we let the + dialling + operation gather it. For the generic dialling logic, ATD-based, + always an + 'AT' port will be used as data port, even if we grabbed a 'net' + port. Those + plugins that can work with 'net' ports will grab the specific + 'net' port + themselves. + + plugins/huawei/mm-broadband-bearer-huawei.c | 15 +- + plugins/huawei/mm-broadband-modem-huawei.c | 2 +- + plugins/icera/mm-broadband-bearer-icera.c | 74 +++++----- + plugins/icera/mm-broadband-modem-icera.c | 30 ---- + plugins/mbm/mm-broadband-bearer-mbm.c | 79 +++++----- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 93 ++++++------ + plugins/option/mm-broadband-bearer-hso.c | 125 +++++++--------- + plugins/sierra/mm-broadband-bearer-sierra.c | 21 +-- + src/mm-base-modem.c | 13 +- + src/mm-base-modem.h | 4 +- + src/mm-bearer-qmi.c | 2 +- + src/mm-broadband-bearer.c | 166 + +++++++++++++--------- + src/mm-broadband-bearer.h | 5 +- + 13 files changed, 312 insertions(+), 317 deletions(-) + +commit 15d34d56fd3277b23c5f477d9aab257cb0bc10a7 +Author: Aleksander Morgado +Date: Sun Feb 17 20:27:24 2013 +0100 + + bearer: new helper 'MMBearerConnectResult' type + + Instead of returning 3 variables in connect_finish(), return a + single reference + counted struct. This simplifies how the result is built and passed + within a + GSimpleAsyncResult to each _finish() method. + + This also simplifies the dialling step in the 3GPP connection + sequence, as we + can use the same new type. + + plugins/huawei/mm-broadband-bearer-huawei.c | 31 ++-- + plugins/iridium/mm-bearer-iridium.c | 49 +----- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 27 +-- + src/mm-bearer-qmi.c | 55 ++---- + src/mm-bearer.c | 103 ++++++++--- + src/mm-bearer.h | 25 ++- + src/mm-broadband-bearer.c | 201 + +++++----------------- + src/mm-broadband-bearer.h | 19 +- + 8 files changed, 196 insertions(+), 314 deletions(-) + +commit 1746949277cbcf9209fc67b36a091177a8476b29 +Author: Aleksander Morgado +Date: Mon Feb 18 13:37:35 2013 +0100 + + ports: add port initialization sequences instead of iface-modem's + modem_init() + + Instead of a custom modem_init() step in the 'Modem' interface, + just add a + sequence of port initialization commands in each port. + + While enabling for the first time a non-hotplugged modem, we will + issue the + port initialization commands only after having run the + enabling_modem_init() + step (i.e. after ATZ usually). + + plugins/iridium/mm-broadband-modem-iridium.c | 46 ++----- + plugins/mbm/mm-broadband-modem-mbm.c | 31 ----- + plugins/nokia/mm-broadband-modem-nokia.c | 77 +++++------ + src/mm-broadband-modem-qmi.c | 2 - + src/mm-broadband-modem.c | 188 + +++++++++++---------------- + src/mm-iface-modem.c | 55 +++----- + src/mm-iface-modem.h | 8 -- + 7 files changed, 138 insertions(+), 269 deletions(-) + +commit be37f41f06af74280edd3e412c42e2357c180925 +Author: Aleksander Morgado +Date: Mon Feb 18 12:56:24 2013 +0100 + + at-serial-port: new properties to define and manage a set of init + commands + + We are now able to specify a list of AT commands to be run whenever + the port is + opened for the first time (i.e. open_count from 0 to 1). These + commands are + to be treated as a 'port initialization' sequence, where + port-configuration + specific AT commands are defined (e.g. ATE0). + + src/mm-at-serial-port.c | 71 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-at-serial-port.h | 7 ++++- + src/mm-serial-port.c | 5 ++++ + src/mm-serial-port.h | 6 ++++- + 4 files changed, 87 insertions(+), 2 deletions(-) + +commit 30639606d35dcc323cb13a29b6e0627aad87dd8d +Author: Aleksander Morgado +Date: Mon Feb 18 12:13:46 2013 +0100 + + broadband-modem: new step during 'enabling_started' to initialize + the modem + + We previously had the modem initialization command merged with some + other port + setup commands in the 'modem_init' step of the 'Modem' + interface. Instead of + doing this, we now split the logic into two separate steps: + + A first 'enabling_modem_init' modem initialization step is to be + run just after + the ports have been opened, but only during the first enabling + operation, and + only if the modem was not hotplugged. A hotplugged modem is assumed + to be + properly initialized already, so no need to ATZ-it. Also, we will + now wait 500ms + by default after the modem initialization command has been sent, + to let it + settle down. + + The second 'modem_init' step will be run during the 'Modem' interface + initialization, and it currently only holds specific setup of the + primary and + secondary serial ports. We'll be modifying this logic a bit in the + next commits, + so no big deal to have that step name unchanged. + + plugins/iridium/mm-broadband-modem-iridium.c | 81 ++------------ + plugins/mbm/mm-broadband-modem-mbm.c | 96 +++++++++++------ + plugins/nokia/mm-broadband-modem-nokia.c | 110 + +++++++++++++++++-- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 108 + ------------------- + src/mm-broadband-modem-qmi.c | 3 + + src/mm-broadband-modem.c | 128 + ++++++++++++++++++----- + src/mm-broadband-modem.h | 11 ++ + 7 files changed, 292 insertions(+), 245 deletions(-) + +commit 263be58465ba0e449d73b65fd69d5dc10423a78f +Author: Dan Williams +Date: Fri Feb 15 13:42:44 2013 -0600 + + serial-port: don't steal data from PPP when connected + + There was a race where if PPP was slow to start, MM could read the + first bits of PPP from the port, which MM shouldn't really do. So + if the port is connected, remove our GIOChannel watch and let pppd + handle all the data. When the port is disconnected, re-attach our + watch and start reading from the port again. + + This may make it harder to detect spurious disconnects if for example + pppd drops the connection and the thing controlling PPP (eg, + NetworkManager or something else) doesn't tell us about that event + by disconnecting the bearer. This is arguably programmer error + though. + + See the logs in https://bugzilla.gnome.org/show_bug.cgi?id=624956#c10 + for an example of this: + + DEBUG: <1280300196.929489> (ttyACM0): <-- 'CONNECT' + DEBUG: <1280300196.929761> (ttyACM0): port now connected + DEBUG: <1280300196.929853> Modem + /org/freedesktop/ModemManager/Modems/0: state changed (connecting + -> connected) + DEBUG: <1280300196.929954> (ttyACM0): simple connect state 6 + DEBUG: <1280300196.933432> (ttyACM0): <-- '~\-1}#\-64!}!} } + }2}#}$\-64#}!}$}%\-36}"}&} }*} } g}%~' + + src/mm-serial-port.c | 31 ++++++++++++++++++++++++++----- + 1 file changed, 26 insertions(+), 5 deletions(-) + +commit 5280364c4bfc0e84ccac9abbc02c82d46db5034a +Author: Dan Williams +Date: Fri Feb 15 13:42:48 2013 -0600 + + Revert "serial-port: don't steal data from PPP when connected" + + This reverts commit 625e1c4884215bb9989dad6c9868c06ba76a4d94. + + By simply returning when data is available, no data gets cleared + from the file descriptor and data_available() keeps getting + rescheduled, leading to a busy-loop. This is the wrong approach, + we should be removing the GIOChannel watch instead. + + src/mm-serial-port.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 253242256c951f60f4dfbae451d68b9c3374450b +Author: Dan Williams +Date: Fri Feb 15 13:40:01 2013 -0600 + + broadband-modem-longcheer: fix getting and setting of allowed modes + + When setting allowed modes, a ",2" crept into the MODODR command when + porting the plugin from 0.6. That shouldn't be there. + + When getting allowed modes, 2 is UMTS preferred and 4 is GSM + preferred, + which the previous code combined into only UMTS preferred. + + plugins/longcheer/mm-broadband-modem-longcheer.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit 85b67ed8d9ecc76062777f63a61ade28074f1fa9 +Author: Ben Chan +Date: Tue Feb 12 11:04:29 2013 -0800 + + modem: use +CEREG to determine EPS network registration status + + This patch adds the support for solicited/unsolicited EPS network + registration status via AT+CEREG, which is configurable via the + 'iface-modem-3gpp-eps-network-supported' property of the + MMIfaceModem3gpp interface and is disabled by default. + + src/mm-broadband-modem-qmi.c | 3 + + src/mm-broadband-modem.c | 165 + +++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem-3gpp.c | 51 ++++++++++++- + src/mm-iface-modem-3gpp.h | 10 ++- + src/mm-modem-helpers.c | 82 +++++++++++++++----- + src/mm-modem-helpers.h | 1 + + src/tests/test-modem-helpers.c | 121 +++++++++++++++++++++++------- + 7 files changed, 365 insertions(+), 68 deletions(-) + +commit 7144b673e2d102a08186d48d13c71b49800a7274 +Author: Dan Williams +Date: Thu Feb 14 14:51:54 2013 -0600 + + vl600: update AT com tool and RE notes + + vl600/atcom.py | 36 ++++++++++++++++++++++++++++++------ + vl600/vl600.txt | 28 ++++++++++++++++++++++++++-- + 2 files changed, 56 insertions(+), 8 deletions(-) + +commit 594adc38ff5a6277d120b21856dba5cfcff2b3a1 +Author: Dan Williams +Date: Wed Feb 13 17:00:16 2013 -0600 + + broadband-modem: don't try QCDM access technology checks for non-QCDM + 3GPP devices + + Result handling code mistakenly ran for these devices, when it + shouldn't. + + src/mm-broadband-modem.c | 109 + +++++++++++++++++++++++++---------------------- + src/mm-iface-modem.c | 4 +- + 2 files changed, 60 insertions(+), 53 deletions(-) + +commit 29c0560a9a40bd4ad0f864266dc754e0056d6bc5 +Author: Aleksander Morgado +Date: Thu Feb 14 17:43:54 2013 +0100 + + broadband-modem-qmi: don't try to load access technologies using QCDM + + src/mm-broadband-modem-qmi.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 914cda5de3fb61e517106ea01fdd1021b00493b8 +Author: Aleksander Morgado +Date: Thu Feb 14 10:47:14 2013 +0100 + + bearer-qmi: wait longer for the 'Stop Network' reply + + The 'Stop Network' reply may really take more than 10s to arrive; + so let's wait + some more time, 30s, before falling back. + + src/mm-bearer-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c1ef36b860931d32bd216af85d143b061913f2ce +Author: Aleksander Morgado +Date: Wed Feb 13 15:03:07 2013 +0100 + + libmm-glib,simple-connect-properties: avoid using an uninitialized + variable + + libmm-glib/mm-simple-connect-properties.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 2d700043abc5686faa54d215ffe60c92f4d0c00e +Author: Dan Williams +Date: Tue Feb 12 15:48:39 2013 -0600 + + core: use g_unix_signal_add() for more reliable Unix signal handling + + There were a few problems with MM's existing signal handling, first + of which was that calling g_main_loop_quit() from a signal handler + only works 50% of the time due to severe restrictions on what you + can do from the handler. This caused INT or TERM to sometimes be + ignored by MM. + + Instead, use the glib signal functions which ensure that the handler + is run in the right context, where we can do anything we want. + + src/main.c | 38 +++++++++++--------------------------- + src/mm-log.c | 5 ----- + src/mm-log.h | 2 -- + 3 files changed, 11 insertions(+), 34 deletions(-) + +commit 625e1c4884215bb9989dad6c9868c06ba76a4d94 +Author: Dan Williams +Date: Tue Feb 12 15:24:15 2013 -0600 + + serial-port: don't steal data from PPP when connected + + There was a race where if PPP was slow to start, MM could read the + first bits of PPP from the port, which MM shouldn't really do. So + if the port is connected, don't read any data and let pppd do its + thing. + + See the logs in https://bugzilla.gnome.org/show_bug.cgi?id=624956#c10 + for an example of this: + + DEBUG: <1280300196.929489> (ttyACM0): <-- 'CONNECT' + DEBUG: <1280300196.929761> (ttyACM0): port now connected + DEBUG: <1280300196.929853> Modem + /org/freedesktop/ModemManager/Modems/0: state changed (connecting + -> connected) + DEBUG: <1280300196.929954> (ttyACM0): simple connect state 6 + DEBUG: <1280300196.933432> (ttyACM0): <-- '~\-1}#\-64!}!} } + }2}#}$\-64#}!}$}%\-36}"}&} }*} } g}%~' + + src/mm-serial-port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 67fcac254150a34c7c1467a7857cad7509ca41ff +Author: Dan Williams +Date: Fri Feb 8 08:25:07 2013 -0600 + + qcdm: fix handling of active pilot set + + Typo caused candidate or remaining sets to be treated as the + active pilot set. + + libqcdm/src/commands.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 5860de182d785c9eef3c5bd6097f600a7c1a3a72 +Author: Aleksander Morgado +Date: Fri Feb 8 12:08:44 2013 +0100 + + sierra: fix access tech reporting logic + + plugins/sierra/mm-broadband-modem-sierra.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit cd2545c2b63b064675c88129f7a4dcde3e982056 +Author: Dan Williams +Date: Thu Feb 7 12:49:55 2013 -0600 + + broadband-modem-mbm: handle HSPA access technology in ERINFO response + + HSUPA/HSPA capable devices (ex F5521gw) can report '3' here, which + we'll decide to interpret as HSPA. It might actually be HSDPA + + HSUPA, + but whatever... + + plugins/mbm/mm-broadband-modem-mbm.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit a4ad95e3dae0b3cbbb612cb0febcfb3132ebe333 +Author: Dan Williams +Date: Wed Feb 6 16:18:51 2013 -0600 + + broadband-modem-longcheer: fix handling of preferred modes + + Treat NONE the same as ANY and handle specific preferred modes too. + + plugins/longcheer/mm-broadband-modem-longcheer.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 18436a8f77306bf3d5379881bcbd066018014858 +Author: Dan Williams +Date: Wed Feb 6 15:25:22 2013 -0600 + + iface-modem-messaging: fix INSTANCE_CAST() vs. GET_INTERFACE() + confusion + + Yeah, GObject is pretty obscure here. But to get the implementation's + override function, we want GET_INTERFACE, otherwise we're looking at + some random memory location that's sometimes NULL. And then we crash. + + src/mm-iface-modem-messaging.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d44eb83ac425c0fa79c2cf76cf492c8223f2d268 +Author: Aleksander Morgado +Date: Wed Feb 6 22:20:19 2013 +0100 + + libmm-glib,manager: add missing logic to ensure the proxy is created + + libmm-glib/mm-manager.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 84adf4e4ef0100b4e871babe7aea18c561d2234b +Author: Aleksander Morgado +Date: Wed Feb 6 19:59:16 2013 +0100 + + cli: don't autostart the ModemManager service + + cli/mmcli-common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a85fd0ab4f3b08b8da5782f4ab9212923ba47cce +Author: Aleksander Morgado +Date: Wed Feb 6 19:32:33 2013 +0100 + + libmm-glib,manager: don't fail creation if the ModemManager process + is not found + + A 'GDBusObjectManagerClient' for a service for which there is + no current + name-owner is a perfectly valid and useful object. For example, + we could then + connect to the 'notify::name-owner' property to follow the life + cycle of the + ModemManager process. + + So, don't tie the successful creation of a 'MMManager' to the + successful + creation of the internal GDBusProxy for the 'Manager1' interface. If + there is + no current name owner, the GDBusProxy wouldn't be created, and + instead we + would completely fail the 'MMManager' creation. + + libmm-glib/mm-manager.c | 284 + +++++++++++++++--------------------------------- + 1 file changed, 85 insertions(+), 199 deletions(-) + +commit 2ad6e0627d1c2d1fb28ce00a89e371097af9e5f5 +Author: Aleksander Morgado +Date: Wed Feb 6 19:09:09 2013 +0100 + + libmm-glib: fix error reporting when 'MMManager' is created + + libmm-glib/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 34da83450e8a8e9319b0c6738e94c1db546180cf +Author: Dan Williams +Date: Wed Feb 6 11:55:49 2013 -0600 + + anydata: support QMI-based devices + + Some devices (like the ADU960S) support QMI, so if the modem has a + QMI port, use it. + + plugins/anydata/mm-plugin-anydata.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit f3ad2e5bb5aef11e4c8517632e24f3396711b129 +Author: Dan Williams +Date: Wed Feb 6 11:59:16 2013 -0600 + + trivial: fix typo + + data/org.freedesktop.ModemManager1.service.systemd.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dcbb6dc81171ad0f71c1b81e193a8887edad3ce2 +Author: Dan Williams +Date: Tue Feb 5 21:04:30 2013 -0600 + + iface-modem-cdma: fix handling of HDR registration state + + hybrid mode is the first parameter, not the third. Caused EVDO + to look like it wasn't registered. + + src/mm-iface-modem-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8070627011ddac6e00155e6309750578ab95e6ee +Author: Dan Williams +Date: Tue Feb 5 21:03:24 2013 -0600 + + trivial: add debugging to generic QCDM registration parsing + + src/mm-iface-modem-cdma.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 90ecbe325a63699da9230fc3d02f0ef01e9a2bf0 +Author: Dan Williams +Date: Tue Feb 5 20:55:53 2013 -0600 + + broadband-modem-novatel: read HDR revision for access technology + + Specialize what the superclass gave us, if we can. + + plugins/novatel/mm-broadband-modem-novatel.c | 253 + ++++++++++++++++++++++++--- + 1 file changed, 227 insertions(+), 26 deletions(-) + +commit 8253d6f9de7b086a22a564180986b46fda35556b +Author: Dan Williams +Date: Tue Feb 5 20:17:13 2013 -0600 + + broadband-modem-novatel: use ERI subsystem information to better + determine roaming + + We use the Icon ID here because a value of 1 *always* means not + roaming, + while the other values don't appear to be consistent. For example, + an ERI value of "0" is supposed to mean roaming according to the + standards, but the Novatel devices appear to use 0 to mean home. + Since we're not sure, don't depend on the ERI value itself, just + depend on the Icon ID, where we know for sure that 1 means "home". + + plugins/novatel/mm-broadband-modem-novatel.c | 116 + +++++++++++++++++---------- + 1 file changed, 73 insertions(+), 43 deletions(-) + +commit 74e94e624da0c86561436029922654bff0bf8884 +Author: Dan Williams +Date: Thu Jan 17 11:39:23 2013 -0600 + + qcdm: add Novatel ERI subsystem support + + Returns various ERI information like Indicator ID/Index, Icon + ID/Index, Icon Mode, and banner. + + libqcdm/src/commands.c | 70 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 39 ++++++++++++++++++++++++ + libqcdm/src/dm-commands.h | 23 +++++++++++++- + libqcdm/tests/test-qcdm-com.c | 60 +++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 194 insertions(+), 1 deletion(-) + +commit bf07f02cffa4d3b33830ff85599e0ef6717858ae +Author: Dan Williams +Date: Wed Jan 16 17:28:14 2013 -0600 + + qcdm: rename Novatel subsystem defines + + libqcdm/src/commands.c | 8 ++++---- + libqcdm/src/dm-commands.h | 26 +++++++++++++------------- + 2 files changed, 17 insertions(+), 17 deletions(-) + +commit b9d0a3275f7be0d394c2875935cc22d8fa0556f0 +Author: Dan Williams +Date: Tue Jan 15 14:39:43 2013 -0600 + + trivial: debug print CDMA1x State results + + src/mm-broadband-modem.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 222825d642fd3148caf3168c6e9a33f02b4f3733 +Author: Aleksander Morgado +Date: Wed Feb 6 15:40:28 2013 +0100 + + systemd: include systemd unit file support + + Allow having systemd handling the life cycle of the ModemManager + process. + + .gitignore | 1 + + Makefile.am | 1 + + configure.ac | 9 +++++ + data/Makefile.am | 43 + +++++++++++++++++----- + data/ModemManager.service.in | 13 +++++++ + ...freedesktop.ModemManager1.service.nosystemd.in} | 0 + ...rg.freedesktop.ModemManager1.service.systemd.in | 11 ++++++ + 7 files changed, 69 insertions(+), 9 deletions(-) + +commit 596c9ea508c005bd1e3b01b439ac5872c926d7cf +Author: Aleksander Morgado +Date: Wed Feb 6 13:55:04 2013 +0100 + + build: polish configure.ac a bit + + configure.ac | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 86fcfe312174a5c0a14dc38ca9f5bb132e4ca97c +Author: Ben Chan +Date: Wed Jan 30 12:21:42 2013 -0800 + + novatel-lte: use +CFUN=4 for power down + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 26 + ++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit 87a556dbb18fa21d47331c2504350820480414c9 +Author: Ben Chan +Date: Wed Jan 30 01:07:54 2013 -0800 + + novatel-lte: retry $NWQMISTATUS check upon error during disconnect + + $NWQMISTATUS sometimes returns 'ERROR'. This patch modifies the + Novatel + LTE plugin to retry $NWQMISTATUS (up to 5 times) to determine if the + disconnect operation succeeds. It also changes the plugin to + assume that + the disconnect operation succeeds if $NWQMISTATUS fails to report the + current connection status. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 68 + +++++++++++++++++------ + 1 file changed, 51 insertions(+), 17 deletions(-) + +commit 24b28d1a72a71a38399184d2c2f85a34612f3a2a +Author: Ben Chan +Date: Wed Jan 30 12:32:25 2013 -0800 + + iface-modem: add a missing step increment in + interface_initialization_step + + src/mm-iface-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit c204a8ce4ebbcfa88cbfe2a08098d2a527bc0b6a +Author: Ben Chan +Date: Thu Jan 24 00:43:08 2013 -0800 + + iface-modem: rearrange initialization steps + + This patch rearranges the initialization steps in MMIfaceModem + such that + the following SIM related operations happen at the end of the + initialization: + - INITIALIZATION_STEP_UNLOCK_REQUIRED + - INITIALIZATION_STEP_SIM + - INITIALIZATION_STEP_OWN_NUMBERS + + The rationale of this change is that the SIM interface of some modems + may require some time to initialize before it responds to SIM related + AT commands. By rearranging the initialization steps to execute + non-SIM + related AT commands first, some of the latency for the SIM + initialization can be absorbed. + + src/mm-iface-modem.c | 118 + +++++++++++++++++++++++++-------------------------- + 1 file changed, 59 insertions(+), 59 deletions(-) + +commit 69aff6183a9e6532b4074c89831d6dcfa81ddcce +Author: Ben Chan +Date: Wed Jan 23 17:16:52 2013 -0800 + + iface-modem: fix invalid modem state consolidation + + ModemManager has a bogus modem state transition from 'enabling' to + 'disabled': + + ModemManager[26214]: Modem fully enabled... + ModemManager[26214]: Modem + /org/freedesktop/ModemManager1/Modem/2: state changed (enabling -> + disabled) + + The root cause seems to be the following: + + get_current_consolidated_state() in MMIfaceModem returns + MM_MODEM_STATE_DISABLED as the default fallback value. When + mm_iface_modem_update_state() is invoked to transition the modem + state from + MM_MODEM_STATE_ENABLING to MM_MODEM_STATE_ENABLED, the following + code can + potentially cause the final state to be MM_MODEM_STATE_DISABLED + instead. + + /* Enabled may really be searching or registered */ + if (new_state == MM_MODEM_STATE_ENABLED) + new_state = get_current_consolidated_state (self); + + https://code.google.com/p/chromium-os/issues/detail?id=38173 + + src/mm-iface-modem.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 9d5794e9e4e86239f450042223dc606b3472c067 +Author: Aleksander Morgado +Date: Mon Jan 21 10:33:49 2013 +0100 + + iface-modem: print power state as string + + Thanks to Marius B. Kotsbak for reporting. + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1cf8ccbdd5ca3f3c13319ac47ac2b877f408da23 +Author: Ben Chan +Date: Thu Jan 17 23:06:45 2013 -0800 + + iface-modem: schedule signal quality check more often initially + + This patch modifies MMIfaceModem to schedule the periodic signal + quality + check with a period of 3s instead of 30s (up to 5 periods) initially + until a non-zero signal quality value is obtained and then switch back + to the 30s period. + + src/mm-iface-modem.c | 36 +++++++++++++++++++++++++++++------- + 1 file changed, 29 insertions(+), 7 deletions(-) + +commit 9474654f671a2aa452f1de0dc8895bbb3ab5968e +Author: Ben Chan +Date: Thu Jan 17 23:11:10 2013 -0800 + + novatel-lte: skip soft reset if modem is newly plugged in + + Soft resetting a Novatel LTE modem can a significant amount of time + (3-4 seconds). If the modem is newly plugged in, skip the unnecessary + soft reset when enabling the modem. + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 108 + +++++++++++++++++++++++ + 1 file changed, 108 insertions(+) + +commit e75dba639febded0e2878a02f47829cedb6239f7 +Author: Ben Chan +Date: Thu Jan 17 23:11:09 2013 -0800 + + core: add 'hotplugged' flag to indicate if modem is newly plugged in + + This patch adds a 'hotplugged' flag to MMBaseModem to indicate if a + modem is newly plugged in. A plugin can use this information to + determine if, for example, the modem needs to be soft reset using the + ATZ command. + + Dan Williams contributed the idea of implementation. + + src/mm-base-modem.c | 18 ++++++++++++++++++ + src/mm-base-modem.h | 4 ++++ + src/mm-device.c | 21 +++++++++++++++++---- + src/mm-device.h | 4 +++- + src/mm-manager.c | 15 ++++++++------- + src/mm-plugin.c | 2 ++ + 6 files changed, 52 insertions(+), 12 deletions(-) + +commit 2550cb20a9741378c747233ddea8e7a7daa5c198 +Author: Aleksander Morgado +Date: Tue Jan 15 16:05:11 2013 +0100 + + huawei: only retry DHCP? check on specific errors + + We don't want to retry DHCP? on every possible GError reported; + specially if the + error is about the port being forced to get closed when the modem gets + unplugged or the like. So just retry on very specific errors reported. + + The main cause for retry is really when the modem replies the + following: + --> AT^DHCP? + <-- ERROR + + Which in our case gets translated to a 'unknown' mobile equipment + error. We'll + also consider any kind of mobile equipment error, as the modems may + reply a + CME ERROR instead. + + plugins/huawei/mm-broadband-bearer-huawei.c | 25 + ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +commit 2b3f353770799932c05dbf2a6fd5b3519270052b +Author: Aleksander Morgado +Date: Fri Jan 11 11:35:51 2013 +0100 + + huawei: check NDISDUP support only once + + plugins/huawei/mm-broadband-modem-huawei.c | 68 + +++++++++++++++++++++--------- + 1 file changed, 49 insertions(+), 19 deletions(-) + +commit f2a9ea377957355e7a703c6d08ff85c8b0ba4d0c +Author: Aleksander Morgado +Date: Wed Jan 9 12:51:54 2013 +0100 + + huawei: use NDISDUP only if net port from cdc_ncm or cdc_ether + + plugins/huawei/mm-broadband-modem-huawei.c | 29 + +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +commit 8c5bd6375fed0150fa80a5623c0e6ca1e430b4fd +Author: Aleksander Morgado +Date: Thu Dec 27 12:05:05 2012 +0100 + + huawei: refactor the connection and disconnection sequences in + the bearer + + We will now use a step-based state machine to handle the connection + and + disconnection sequences. All the previous behaviour is kept, except + for these + new things: + + * Instead of just subclassing the 'dialling' step in the 3GPP + connection + sequence, completely subclass the whole 3GPP connection + sequence. We do this + because we don't need to preconfigure PDP contexts with AT+CGDCONT + before + issuing ^NDISDUP. + + * Don't allow IP types other than IPv4. These modems work only + with IPv4 + bearers. + + * Remove cancellation signal handler; not needed as we can check + the status of + the cancellation in every 1s timeout. + + * Removed the event source id handling for timeouts; timeouts + are never + cancelled here. + + plugins/huawei/mm-broadband-bearer-huawei.c | 622 + +++++++++++++++------------- + 1 file changed, 335 insertions(+), 287 deletions(-) + +commit 2499f5760b70b1c3aa45e0a3fd6c38331fc5fb6b +Author: Aleksander Morgado +Date: Thu Dec 27 10:17:20 2012 +0100 + + huawei: explicitly check for the ^NDISDUP command support + + Don't assume that all modems exporting a 'net' port will support + ^NDISDUP. + + plugins/huawei/mm-broadband-modem-huawei.c | 121 + +++++++++++++++++++++-------- + 1 file changed, 87 insertions(+), 34 deletions(-) + +commit 696403e50a975bc6c8f14d2db79ce10835b25719 +Author: Franko Fang +Date: Sun Dec 2 15:30:01 2012 +0100 + + huawei: handle modems exposing 'net' ports with AT^NDISDUP + + Modems with ECM (e.g. usb0) ports should use AT^NDISDUP in the + control port to + request the connection and afterwards just fire up the DHCP client + in the net + port. + + This patch is originally developed by: + Franko Fang + + And afterwareds reviewed and updated by: + Aleksander Morgado + + plugins/Makefile.am | 5 +- + plugins/huawei/mm-broadband-bearer-huawei.c | 558 + ++++++++++++++++++++++++++++ + plugins/huawei/mm-broadband-bearer-huawei.h | 59 +++ + plugins/huawei/mm-broadband-modem-huawei.c | 83 ++++- + 4 files changed, 702 insertions(+), 3 deletions(-) + +commit fdad4d636d39e6f5df80ff1197ee645ccd572078 +Author: Dan Williams +Date: Tue Jan 8 14:41:51 2013 -0600 + + broadband-modem: guess CDMA access technologies from registration + state + + Setting access technologies from registration state as part of the + registration checking in the CDMA Interface code fights with + custom implementations in each modem subclass, which causes the + access technologies to ping-pong between more specific (custom + implementation) and less specific (generated from registration state + during registration checking). If the modem class has more + specific access technology knowledge, we should use that and not + override it on the next registration state poll. + + So instead, implement the generic access technology update from + registration state in the broadband modem base class' + load_access_technologies() hook. Thus, modem classes with more + specific checking (which override MMBroadbandModem's implementation) + will never fight with generic checking, while modems that don't + (and thus actually need the generic checking) still get some basic + access technology handling. + + src/mm-broadband-modem.c | 116 + ++++++++++++++++++++++++++++++++-------------- + src/mm-iface-modem-cdma.c | 17 ------- + 2 files changed, 82 insertions(+), 51 deletions(-) + +commit edeb75b0286b8a6915a4512d1d823875326e15cf +Author: Dan Williams +Date: Tue Jan 8 21:11:18 2013 -0600 + + broadband-modem: implement generic QCDM access technology checks + + For modems that don't implement vendor-specific access technology + checks, try to get the access technology via QCDM if the modem has + a QCDM port. + + src/mm-broadband-modem.c | 335 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 335 insertions(+) + +commit f71852c5b93b365c21c8b1ea2f8c236da2e70899 +Author: Dan Williams +Date: Wed Jan 9 12:02:18 2013 -0600 + + iface-modem-cdma: get CDMA1x Serving System during QCDM registration + + We want the SID/NID even when AT Serving System checks are disabled, + otherwise the SID/NID don't get filled at all. QCDM doesn't need the + SID/NID to determine registration, so the values are informational + only and don't affect registration state. But we still want to + export them via the API. + + src/mm-iface-modem-cdma.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit fe7438973ad11c9ca2cd78b85f7f97a31a3f23e6 +Author: Dan Williams +Date: Wed Jan 9 11:11:27 2013 -0600 + + trivial: fix comment + + src/mm-iface-modem-cdma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7489951f88c3e96f811dedc7b352baf8dd1d4f29 +Author: Dan Williams +Date: Tue Jan 8 20:06:18 2013 -0600 + + qcdm: various LTE-related NV mode pref and sysmode updates + + libqcdm/src/commands.h | 3 +++ + libqcdm/src/dm-commands.h | 1 + + libqcdm/tests/test-qcdm-com.c | 27 +++++++++++++++++++++++++++ + 3 files changed, 31 insertions(+) + +commit fc4034a72f0c0e1507baa719f959ccc666ae8392 +Author: Dan Williams +Date: Tue Jan 8 15:14:42 2013 -0600 + + broadband-modem-sierra: implement access technology reporting for + CDMA devices + + Use AT!STATUS to grab current access technology. + + plugins/sierra/mm-broadband-modem-sierra.c | 88 + +++++++++++++++++++++++------- + 1 file changed, 69 insertions(+), 19 deletions(-) + +commit 56bdf4a37b49a9d79d14c6131cc93023ca86e426 +Author: Dan Williams +Date: Tue Jan 8 14:59:24 2013 -0600 + + broadband-modem-sierra: make CDMA AT!STATUS parsing code generic + + We'll use it for access technology reporting too. + + plugins/sierra/mm-broadband-modem-sierra.c | 490 + +++++++++++++++-------------- + 1 file changed, 258 insertions(+), 232 deletions(-) + +commit b68a487e157519e5b75dcd176b9e9e8201cf500f +Author: Dan Williams +Date: Tue Jan 8 14:43:48 2013 -0600 + + broadband-modem-sierra: don't check +CAD and +CSS for CDMA devices + + We have !STATUS for that, which is much more detailed. Use it. + + plugins/sierra/mm-broadband-modem-sierra.c | 93 + ++++++++++++++++++++++++++++++ + 1 file changed, 93 insertions(+) + +commit 01e8e0574f463dc03cccc4a6b8c9dacb754abae1 +Author: Dan Williams +Date: Tue Jan 8 14:26:31 2013 -0600 + + broadband-modem: more compatible CSQ parsing + + Some devices (usually CDMA modems like the Sierra MC5725 and others) + don't prefix their +CSQ replies with +CSQ. So don't require that. + The scanf() should ensure the reply is valid even without the +CSQ. + + src/mm-broadband-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 48b36b1afae3a316be75c9c613e6f41be2ad64d2 +Author: Dan Williams +Date: Tue Jan 8 11:01:34 2013 -0600 + + broadband-modem-sierra: load own numbers via ~NAMVAL?0 for CDMA + + Sierra CDMA devices don't always have QCDM ports, or if they do, + they aren't always usable. Try Sierra-proprietary commands for + loading the modem's MDN and fall back to QCDM if that fails. + + plugins/sierra/mm-broadband-modem-sierra.c | 122 + +++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +commit f7d55a688a59670ab2932569fc50151e6a1cdb4d +Author: Dan Williams +Date: Tue Jan 8 10:02:53 2013 -0600 + + broadband-modem-novatel: fix signal strength processing for older + devices + + mm_get_int_from_str() does not allow anything in the string after the + number, eg "-91 asdfasdf" returns an error. So we have to chop off + anything after the number we're interested in. + + plugins/novatel/mm-broadband-modem-novatel.c | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +commit f95274e735f8c690b6a33e513460603049a23b58 +Author: Dan Williams +Date: Tue Jan 8 09:10:04 2013 -0600 + + broadband-modem: load own numbers with QCDM too + + Not many CDMA/EVDO-only modems support CNUM since it's not a + standard IS707/856 AT command, so for those that don't + support it and have a QCDM port, try grabbing the number from + NV memory. + + src/mm-broadband-modem.c | 137 + ++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 131 insertions(+), 6 deletions(-) + +commit 2bd4c63716b0729974a7d9e2a5aea75fd56e4cd9 +Author: Aleksander Morgado +Date: Mon Jan 14 17:38:34 2013 +0100 + + hso: remove duplicated code + + plugins/option/mm-broadband-bearer-hso.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 9a07688524256e40fa46853482ec1fb5b247b1d3 +Author: Aleksander Morgado +Date: Thu Jan 10 22:25:14 2013 +0100 + + huawei: check with next port if the first one is not AT + + plugins/huawei/mm-plugin-huawei.c | 69 + +++++++++++++++++++++------------------ + 1 file changed, 38 insertions(+), 31 deletions(-) + +commit 8403a48b311868f4fb767b093a29ea913ade57fb +Author: Aleksander Morgado +Date: Fri Jan 11 12:20:00 2013 +0100 + + plugin-manager: new debug logs to help track probing issues + + src/mm-plugin-manager.c | 41 ++++++++++++++++++++++++++++++++--------- + 1 file changed, 32 insertions(+), 9 deletions(-) + +commit 0f9873c23a3eb1c43f04ebb12cad6e2548a98b58 +Author: Aleksander Morgado +Date: Fri Jan 11 11:21:08 2013 +0100 + + sierra: load power state with !pcstate? in cdma-only modems + + plugins/sierra/mm-common-sierra.c | 60 + +++++++++++++++++++++++++++++++++++---- + 1 file changed, 54 insertions(+), 6 deletions(-) + +commit 695680b2ff6129f3df95f40b72b7683f01ca054a +Author: Aleksander Morgado +Date: Tue Jan 1 12:47:04 2013 +0100 + + cli: show current power state in the modem status information + + cli/mmcli-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 669f0928f3a8e2e839de551cc8764f3d607c35a0 +Author: Aleksander Morgado +Date: Tue Jan 1 12:23:33 2013 +0100 + + cli: new '--set-power-state-on' and '--set-power-state-low' commands + + cli/mmcli-modem.c | 81 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 81 insertions(+) + +commit 091c47d695bf48541c49e8d5e07647d0901e367b +Author: Aleksander Morgado +Date: Tue Jan 1 12:09:27 2013 +0100 + + libmm-glib,modem: new methods to handle the power state + + docs/reference/libmm-glib/libmm-glib-sections.txt | 4 + + libmm-glib/mm-modem.c | 94 + +++++++++++++++++++++++ + libmm-glib/mm-modem.h | 15 ++++ + 3 files changed, 113 insertions(+) + +commit eec5d00a97582830baf7e0458f483ffc04398da0 +Author: Aleksander Morgado +Date: Tue Jan 1 11:58:42 2013 +0100 + + core,plugins: remove initial power down sequence + + We no longer power down the modem during initialization, so remove + that + implementation. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 -- + plugins/gobi/mm-broadband-modem-gobi.c | 2 -- + plugins/iridium/mm-broadband-modem-iridium.c | 2 -- + plugins/motorola/mm-broadband-modem-motorola.c | 2 -- + plugins/nokia/mm-broadband-modem-nokia.c | 2 -- + plugins/sierra/mm-broadband-modem-sierra.c | 2 -- + plugins/wavecom/mm-broadband-modem-wavecom.c | 2 -- + plugins/zte/mm-broadband-modem-zte.c | 2 -- + src/mm-broadband-modem-qmi.c | 2 -- + src/mm-iface-modem.h | 8 -------- + 10 files changed, 26 deletions(-) + +commit 7c87555bf850aa1066c908359d8ff101cd04eb98 +Author: Aleksander Morgado +Date: Tue Jan 1 11:56:15 2013 +0100 + + mbm: force initial power-up during first enabling + + When both load_power_state() and modem_power_down() are not + implemented, the + logic will launch the power-up command during (only the first) + enabling of the + modem. + + In this kind of modems, CFUN is directly related to allowed/preferred + modes, so + during the initial power-up we'll just assume we want ANY mode. + + plugins/mbm/mm-broadband-modem-mbm.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 5d02361501f7c93345aa10dfbd052a093fed40fd +Author: Aleksander Morgado +Date: Tue Jan 1 11:53:29 2013 +0100 + + iridium: ignore initial power state loading + + No need to initially power-up the modem. + + plugins/iridium/mm-broadband-modem-iridium.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 923d4dd8bdd6d7a785ddbf7874c35b838ba46606 +Author: Aleksander Morgado +Date: Tue Jan 1 11:53:21 2013 +0100 + + motorola: ignore initial power state loading + + No need to initially power-up the modem. + + plugins/motorola/mm-broadband-modem-motorola.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f79f3b8770e356fa051927f783f332740cfab8de +Author: Aleksander Morgado +Date: Tue Jan 1 11:53:09 2013 +0100 + + nokia: ignore initial power state loading + + No need to initially power-up the modem. + + plugins/nokia/mm-broadband-modem-nokia.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9f5cfefb009eda1af986236a92fbfdc46de7efd7 +Author: Aleksander Morgado +Date: Tue Jan 1 11:52:16 2013 +0100 + + sierra: in 3GPP, no need to check if already powered up before + powering up + + This logic is now implemented by the parent broadband modem object. + + Also, implement a custom initial power state loading, so that + CDMA-only modems + get marked as 'offline', in order to launch !pcstate=1 to power them + up during + the first enabling. The custom initial power state loading will run + the parent's + implementation in non-CDMA-only modems. + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 4 + + plugins/sierra/mm-broadband-modem-sierra.c | 4 + + plugins/sierra/mm-common-sierra.c | 134 + ++++++++++++++--------- + plugins/sierra/mm-common-sierra.h | 9 ++ + 4 files changed, 98 insertions(+), 53 deletions(-) + +commit e3db373be45464b8c14d4c38f23105aaa7354ba2 +Author: Aleksander Morgado +Date: Tue Jan 1 11:50:10 2013 +0100 + + wavecom: no need to check if already powered up before powering up + + This logic is now implemented by the parent broadband modem object. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 74 + +++------------------------- + 1 file changed, 6 insertions(+), 68 deletions(-) + +commit 952d96234bf179f26ec757eed7325518445327f0 +Author: Aleksander Morgado +Date: Tue Jan 1 11:12:05 2013 +0100 + + broadband-modem: implement custom power state loading + + src/mm-broadband-modem.c | 96 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 96 insertions(+) + +commit 696b879b6dc1d3330406210abe7a28ecf86a5f6a +Author: Aleksander Morgado +Date: Tue Jan 1 11:11:44 2013 +0100 + + broadband-modem-qmi: implement custom power state loading + + src/mm-broadband-modem-qmi.c | 93 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 93 insertions(+) + +commit e55b543d384296ad07fddc3bbcb0a9ec51c86e6a +Author: Aleksander Morgado +Date: Mon Dec 31 16:25:06 2012 +0100 + + iface-modem: implement power mode loading and setting + + src/mm-iface-modem.c | 435 + +++++++++++++++++++++++++++++++++++++++------------ + src/mm-iface-modem.h | 17 ++ + 2 files changed, 349 insertions(+), 103 deletions(-) + +commit 49aecb57dc2aeebb1e133816aec05321e5073cda +Author: Aleksander Morgado +Date: Mon Dec 31 15:10:22 2012 +0100 + + api,modem: new 'SetPowerState()' method and 'PowerState' property + + Going into/outof low-power state is now a user-requested action. + + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 ++++++++++ + include/ModemManager-enums.h | 16 + ++++++++++++++++ + .../org.freedesktop.ModemManager1.Modem.xml | 20 + ++++++++++++++++++++ + 4 files changed, 47 insertions(+) + +commit f50aa47fb282cd250322c70fdbbe0c9889705485 +Author: Dan Williams +Date: Thu Jan 10 10:09:35 2013 -0600 + + sim-qmi: fix trivial GError literal issues/format string warnings + + src/mm-sim-qmi.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 763e207e9cfdff78e0d40cafc8fd3c685374888d +Author: Aleksander Morgado +Date: Wed Jan 9 10:05:15 2013 +0100 + + blacklist: ignore all devices from VID 0x0617 + + No modems from the Swiss Federal Institute of Technology. + + https://bugzilla.gnome.org/show_bug.cgi?id=691384 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit dc7aa25f0a43571de3d32451ef71e7f69ae4d2dd +Author: Aleksander Morgado +Date: Wed Dec 19 09:56:02 2012 +0100 + + sim-qmi: translate common SIM-related QMI errors into ME errors + + Upper layers expect Mobile Equipment errors, so try to translate + known QMI + protocol errors. + + src/mm-sim-qmi.c | 39 +++++++++++++++++++++++++++++++++++---- + 1 file changed, 35 insertions(+), 4 deletions(-) + +commit 1372933345b197d89a7e4ae0d5bdcec1fd1e1b2e +Author: Aleksander Morgado +Date: Tue Dec 18 23:38:42 2012 +0100 + + iface-modem,sim: improve lock info update logic + + The logic to handle the lock information (current lock and unlock + retry count) + wasn't handling all possible cases properly, e.g.: + + * When PIN is incorrectly entered too many times, a SIM-PUK error + may happen. + In this case we need to directly assume SIM-PUK is the current lock + (some + modems, like Option HSO ones, would incorrectly reply SIM-PIN if + CPIN? asked + just after the SIM-PUK error). + + * After every operation acting in SIM locks, we need to update + the current + unlock retry count. + + This change tries to cover those cases, by: + + * The logic to check current lock is extended to also load the + unlock retry + count when needed. + + * Whenever a SIM-PUK error happens in the SIM operations, we + directly assume + that SIM-PUK is required, without re-asking CPIN?. + + * The overall logic of lock checking is now handled by a state + machine, which + is much easier to understand. + + src/mm-iface-modem-simple.c | 15 +- + src/mm-iface-modem.c | 447 + ++++++++++++++++++++++---------------------- + src/mm-iface-modem.h | 26 +-- + src/mm-sim.c | 119 +++++++----- + 4 files changed, 310 insertions(+), 297 deletions(-) + +commit 959bb9d2ffb8bd7a3d701c21ec2cb58cab3717d9 +Author: Aleksander Morgado +Date: Mon Jan 7 22:19:02 2013 +0100 + + broadband-modem: launch the Firmware interface even on fatal errors + + Even when there is a fatal error during initialization (e.g. missing + PIN in a + 3GPP modem), we should allow operations on the Firmware interface. + + src/mm-broadband-modem.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit e93922197522067851f8cb4b7948ecae93e2843c +Author: Ben Chan +Date: Thu Jan 3 18:50:40 2013 -0800 + + iface-modem, novatel-lte: disable network scan in LTE mode + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 102 + ++++++++++++++++++++++- + src/mm-iface-modem.c | 20 +++++ + src/mm-iface-modem.h | 3 + + 3 files changed, 124 insertions(+), 1 deletion(-) + +commit bc399d9cf87c3fb775fc677963bb2522c385e2e2 +Author: Ben Chan +Date: Thu Jan 3 02:55:11 2013 -0800 + + iface-modem-3gpp,iface-modem-cdma: check for deallocated + RegistrationCheckContext + + This patch fixes a crash in periodic_registration_checks_ready() + due to + access of an already deallocated RegistrationCheckContext. + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7fc344d355cd [ModemManager] - + mm-iface-modem-cdma.c:1112 periodic_registration_checks_ready + 0x7fc3449ea266 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:767 + g_simple_async_result_complete + 0x7fc3449ea368 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:779 + complete_in_idle_cb + 0x7fc344851dc4 [libglib-2.0.so.0.3200.4] - gmain.c:2539 + g_main_context_dispatch + 0x7fc344852147 [libglib-2.0.so.0.3200.4] - gmain.c:3146 + g_main_context_iterate + 0x7fc3448525a1 [libglib-2.0.so.0.3200.4] - gmain.c:3340 + g_main_loop_run + 0x7fc344d0f154 [ModemManager] - main.c:158 + main + 0x7fc34426a474 [libc-2.15.so] - libc-start.c:234 + __libc_start_main + 0x7fc344d0eb68 [ModemManager] + 0x0001bb68 + + src/mm-iface-modem-3gpp.c | 3 ++- + src/mm-iface-modem-cdma.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit d40ef838986eb62b4c657a981791e8225ce3ce2c +Author: Aleksander Morgado +Date: Fri Dec 28 11:07:46 2012 +0100 + + sierra: implement modem reset + + plugins/sierra/mm-broadband-modem-sierra.c | 26 + ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit eae28e9be4af1bb1d588cfd604eee68a0f2778e7 +Author: Aleksander Morgado +Date: Fri Dec 28 10:32:55 2012 +0100 + + sierra: wait up to 10s for the power up command reply + + Specially the first time that CFUN=1,0 is issued after the initial + power up, we + really need to wait more than 3s for the AT command reply. Otherwise, + the modem + won't like it and it will reset itself :-/ + + plugins/sierra/mm-common-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 35775e3634e2783b808bbce777a6e6565d989abb +Author: Aleksander Morgado +Date: Fri Dec 28 08:49:35 2012 +0100 + + sierra: ignore all +PACSP messages + + Not only +PACSP0, but also +PACSP1. + + plugins/sierra/mm-common-sierra.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit b5257491b040ae4873194573608de267a9375bb1 +Author: Aleksander Morgado +Date: Fri Dec 28 08:13:40 2012 +0100 + + sierra: fix 3GPP dialling sequence + + There was a missing step++ when falling down to the next step in + the switch(), + which was preventing a proper connection. + + plugins/sierra/mm-broadband-bearer-sierra.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 95598e2e37463e95555c296a7ae023e7ded46408 +Author: Aleksander Morgado +Date: Fri Dec 28 08:01:05 2012 +0100 + + sierra: pass data port to parent's 3GPP dialling sequence + + plugins/sierra/mm-broadband-bearer-sierra.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 1b0ab2ea60eef1fb8d9b9c185d2700dab562be0d +Author: Aleksander Morgado +Date: Fri Dec 28 08:00:04 2012 +0100 + + broadband-bearer: dial port may be different to the primary port + + src/mm-broadband-bearer.c | 51 + ++++++++++++++++++----------------------------- + 1 file changed, 19 insertions(+), 32 deletions(-) + +commit 731812fe342ba4d2a5531992638a21b8a27bdbb4 +Author: Aleksander Morgado +Date: Thu Dec 27 13:42:28 2012 +0100 + + plugin: avoid QMI-managed net ports when compiling without QMI support + + src/mm-device.c | 29 +++++++++++++---------------- + src/mm-device.h | 2 ++ + src/mm-plugin.c | 13 ++++++++++++- + 3 files changed, 27 insertions(+), 17 deletions(-) + +commit 80b68ac0aeb4e6263ac5d17d268723ac6fd1df47 +Author: Aleksander Morgado +Date: Thu Dec 27 12:43:11 2012 +0100 + + plugin-manager: initially never start with the Generic plugin + suggested + + The generic plugin should be a fallback, so when starting to probe + the port, + never start with the Generic plugin first. + + src/mm-plugin-manager.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit ef31ff75358657a4a048bd4b0b34aeedb092086f +Author: Aleksander Morgado +Date: Thu Dec 27 08:58:39 2012 +0100 + + broadband-bearer: PDP context deactivation may take longer + + Update the default timeout from 3s to 10s. + + src/mm-broadband-bearer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c8fcf7a91d5d9f4d5d0942a3b07984e330198d10 +Author: Aleksander Morgado +Date: Thu Dec 27 08:47:49 2012 +0100 + + plugin: re-run subsystems filter before grabbing the ports + + Every port probing will have the Generic plugin as fallback, and + due to some + other issues in other plugins (see ee099fcd), we need to allow + overwriting the + suggested plugin from the Generic to a more specific one. + + One of the drawbacks of this is that we're actually allowing the + Generic plugin + to probe and accept the port, which means that the generic plugin + may accept a + specific port type (e.g. QMI) while the specific plugin wouldn't. So, + we will + now also run the subsystems filter before grabbing the specific port, + in order + to really filter out those cases. We still keep the subsystems + filter in + pre-probing, so that we build a better initial plugin list to probe. + + src/mm-plugin.c | 63 + ++++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 42 insertions(+), 21 deletions(-) + +commit 7da2a65b43a386499bd5df66dba53f4b31417cad +Author: Aleksander Morgado +Date: Thu Dec 27 07:39:52 2012 +0100 + + plugins: fix generic GObject related macros + + plugins/iridium/mm-broadband-modem-iridium.h | 8 ++++---- + plugins/novatel/mm-broadband-modem-novatel-lte.h | 8 ++++---- + plugins/novatel/mm-broadband-modem-novatel.h | 8 ++++---- + plugins/samsung/mm-broadband-modem-samsung.h | 8 ++++---- + plugins/sierra/mm-broadband-modem-sierra-icera.h | 8 ++++---- + plugins/zte/mm-broadband-modem-zte-icera.h | 8 ++++---- + 6 files changed, 24 insertions(+), 24 deletions(-) + +commit f923e95861eb65a29ba9ced2040abaed8add6703 +Author: Aleksander Morgado +Date: Thu Dec 27 07:23:01 2012 +0100 + + base-modem: don't set the modem valid if we didn't export the Modem + interface + + If an error occurs early during the initialization (e.g. during port + setup), we + would be aborting without even having exported the modem interface. So + detect + that case and skip setting the modem as valid. + + src/mm-base-modem.c | 33 ++++++++++++++++++++------------- + src/mm-broadband-modem.c | 45 + ++++++++++++++++++++++++++++----------------- + 2 files changed, 48 insertions(+), 30 deletions(-) + +commit 4ffa871228fa9b267f1647bf73238811e20e51b7 +Author: Aleksander Morgado +Date: Thu Dec 27 06:48:23 2012 +0100 + + zte: ignore net ports in non-Icera based modems + + Plain non-Icera ZTE modems will use ATD calls and PPP to establish the + connection, so ignore 'net' ports that may be found in the way + (e.g. when the + modem is a QMI modem and we're not using QMI support). + + plugins/zte/mm-plugin-zte.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit ded8bfe96585088629f5d70369fbe9f39f4e54b5 +Author: Aleksander Morgado +Date: Mon Dec 24 19:06:26 2012 +0100 + + hso: new helper code to debug GPS related issues + + Disabled in normal compilation, can be enabled to debug issues. + + plugins/option/mm-broadband-modem-hso.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 4d4ea9c3698077451ecf91c27d45e6503aa1cd0b +Author: Aleksander Morgado +Date: Mon Dec 24 18:57:39 2012 +0100 + + iface-modem-location: fix periodic reporting of the GPS location info + + The Location property was never being updated properly. + + src/mm-iface-modem-location.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 850a7737b809ad844fd91de1befa273a66cbe8d3 +Author: Aleksander Morgado +Date: Mon Dec 24 15:54:37 2012 +0100 + + broadband-modem: fix reloading of operator code when enabling 3GPP + location + + When the 3GPP location is enabled, we need to reload the operator code + information, but only if the modem is registered in a 3GPP network. + + Now, instead of looking at the global modem state value, look at + the specific + 3GPP registration state. This will avoid issues like: + * updating 3GPP operator info and the modem registered in a CDMA + network. + * not updating the 3GPP operator info when the modem is registered + in a 3GPP + network but not yet fully enabled (i.e. 'enabling'). + + src/mm-broadband-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 0380045aacb370c1a95e8119abbe1ffe8e5fb44b +Author: Anton Blanchard +Date: Sat Dec 22 22:13:28 2012 +1100 + + ModemManager: Blacklist Dangerous Prototypes Bus Pirate v4 + + The Bus Pirate v4 presents itself as a CDC ACM device which + ModemManager attempts to configure. This results in a range + of confusing issues because it injects a bunch of AT commands + over whatever is going on at the time. + + Firmware updates were failing at random points and avrdude + failed to work at all. Blacklisting it fixed my issues. + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit c08b03f6fde138bad5d4d3232af073314fdce640 +Author: Dan Williams +Date: Mon Dec 17 14:23:00 2012 -0600 + + sierra: fix APP1 PPP functionality + + Unfortunately, Sierra secondary APP ports reply to +GCAP with + only "OK", and not their APP port number or model number. So instead + of using +GCAP, we have to use ATI to get secondary port information. + This allows us to detect which port is the APP1 port that we can + potentially use for PPP, leaving the primary port available for + control and status. + + Also, some modems have up to 3 or 4 APP secondary ports, which we + need to ensure aren't used as primary. The previous check for +GCAP + handled that, but let's make it more explicit. + + AT+GCAP reply: + OK + + ATI reply: + Sierra Wireless, Inc. + C885 + APP1 + OK + + See also: 3f3987e09ee762e48c1d53cb42a1288ce9f332cb (MM_06) + + plugins/sierra/mm-plugin-sierra.c | 52 + +++++++++++++++++++++------------------ + 1 file changed, 28 insertions(+), 24 deletions(-) + +commit dc9bbefbc083a328fad0b770d1e716e704c72c65 +Author: Aleksander Morgado +Date: Fri Nov 30 14:03:31 2012 +0100 + + icera,hso: don't wait to get connected if the primary port is removed + + If the primary port is gone (e.g. when going to sleep) and we are + just in the + middle of a connection attempt, we won't be able to receive any + unsolicited + message regarding the status of the attempt. So, if we detect that + the port is + forced to get closed, we'll just treat it as a connection failure. + + http://code.google.com/p/chromium-os/issues/detail?id=35391 + + plugins/icera/mm-broadband-bearer-icera.c | 30 + +++++++++++++++++++++++++++++- + plugins/option/mm-broadband-bearer-hso.c | 28 + ++++++++++++++++++++++++++++ + src/mm-serial-port.c | 13 +++++++++++++ + src/mm-serial-port.h | 1 + + 4 files changed, 71 insertions(+), 1 deletion(-) + +commit f20922ba9d766bfbb198a3c2e41981b4d9473cfa +Author: Aleksander Morgado +Date: Wed Dec 12 12:55:33 2012 +0100 + + bearer: check if signal handler is connected before trying to + disconnect it + + Avoids warnings like: + GLib-GObject-WARNING **: gsignal.c:2576: instance `0x78624028' + has no handler with id `148' + + src/mm-bearer.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit c43c8958d09ba93909c3a2aebd691df9872a10e8 +Author: Aleksander Morgado +Date: Wed Dec 12 12:21:17 2012 +0100 + + sms-part: plug memleak + + src/mm-sms-part.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 9d5e2c608dc75fdb5a660829a77faafe5e686312 +Author: Dan Williams +Date: Mon Dec 10 16:34:07 2012 -0600 + + sierra: implement the Time interface for 3GPP and CDMA devices + + plugins/sierra/mm-broadband-modem-sierra.c | 243 + ++++++++++++++++++++++++++++- + plugins/sierra/mm-broadband-modem-sierra.h | 2 + + 2 files changed, 244 insertions(+), 1 deletion(-) + +commit 5427f0d356c115814562cbe0483157a62de616cb +Author: Dan Williams +Date: Mon Dec 10 16:30:05 2012 -0600 + + sierra: restore longer CFUN=1 timeout for older devices + + Turns out older devices (like the C885/AT&T Mercury) crash often + when we don't wait for them to settle from CFUN=1. 5 seconds is + too short, but the crashes go away when we wait for 10 seconds. + Newer modems like the USB306 don't have this problem, so we just + check to see if the modem is a DirectIP device (using sierra_net) + and only use the shorter timeout for those newer devices. + + This is a separate problem from some older modems returning ERROR + to valid commands that are sent too soon after CFUN=1, which was + observed on really old devices like the PCMCIA 860. + + plugins/sierra/mm-common-sierra.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 26c19ff4741b1ec72b4e131dcb8439dfb9b4af0a +Author: Dan Williams +Date: Fri Dec 7 15:43:26 2012 -0600 + + release: bump version to 0.7.990 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 46d2d40e9d23c88907f2866e9aca09ca0c902235 +Author: Dan Williams +Date: Fri Dec 7 15:38:29 2012 -0600 + + release: update NEWS + + NEWS | 30 +++++++----------------------- + 1 file changed, 7 insertions(+), 23 deletions(-) + +commit d952571b2b09319a25eda1519db145c8967396eb +Author: Dan Williams +Date: Wed Dec 5 14:38:13 2012 -0600 + + broadband-modem: strip prefixes from GMM/GMR/GMI replies + + Some devices prefix the replies with the command, some don't, so + strip off the prefix if it exists. + + src/mm-broadband-modem.c | 77 + ++++++++++++++++++++++++++---------------------- + 1 file changed, 42 insertions(+), 35 deletions(-) + +commit 4b23fd00a0dd1e4c5127124af01a60d48e7dcdb7 +Author: Dan Williams +Date: Wed Dec 5 13:53:44 2012 -0600 + + icera: implement Time interface support check + + plugins/icera/mm-broadband-modem-icera.c | 34 + +++++++++++++++++++++++++++++++- + 1 file changed, 33 insertions(+), 1 deletion(-) + +commit 8c1f80a9a44e686b8f12dcbafa0d3d9b6ad5b7f0 +Author: Dan Williams +Date: Wed Dec 5 12:17:38 2012 -0600 + + huawei: implement Time interface for CDMA modems + + plugins/huawei/mm-broadband-modem-huawei.c | 135 + ++++++++++++++++++++++++++++- + 1 file changed, 134 insertions(+), 1 deletion(-) + +commit 4e980d17396bc65acd49edbaf195013dcae5e5d0 +Author: Dan Williams +Date: Wed Dec 5 12:15:51 2012 -0600 + + icera: report 4-digit year as required by ISO-8601 + + Assume 2000 + year. + + plugins/icera/mm-broadband-modem-icera.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit dd51f7a6aeb5b133dad32918c73c3e7583a96d97 +Author: Dan Williams +Date: Wed Dec 5 11:15:28 2012 -0600 + + libmm-glib: document mm_get_uint_from_str() + + Unlike strtol/stroul, this function doesn't ignore leading or + trailing non-digit characters, so document that restriction. + + libmm-glib/mm-common-helpers.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 75731cf21c9eb64f70ba243122a7c384c4d1be00 +Author: Dan Williams +Date: Wed Dec 5 11:00:31 2012 -0600 + + modem-helpers: add EVDO rev. B and "CDMA2000 1X" to access tech helper + + Some Huawei modems report these, and we may use the generic helper + in the future. + + src/mm-modem-helpers.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e3a71711bfbb0998b85bdb00fe7857c34b560dec +Author: Dan Williams +Date: Wed Nov 28 13:09:58 2012 -0600 + + huawei: handle CDMA allowed modes + + plugins/huawei/mm-broadband-modem-huawei.c | 107 + ++++++++++++++++++++++++----- + 1 file changed, 89 insertions(+), 18 deletions(-) + +commit c3984d3982ecce269451cb6d3a1ac2281bfc57b5 +Author: Dan Williams +Date: Wed Nov 28 10:27:07 2012 -0600 + + huawei: fix crash disabling CDMA unsolicited response handlers + + Parent MMBroadbandModem may not implement these functions so we + shouldn't call them unless it does. + + plugins/huawei/mm-broadband-modem-huawei.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +commit f0ba40f3a1c3ea34c84bfd94cc5f87c4e288f37d +Author: Dan Williams +Date: Wed Nov 28 10:23:38 2012 -0600 + + huawei: implement Huawei-specific CDMA signal quality checks + + Many Huawei CDMA modems implement vendor commands for 1x and EVDO + signal quality, so use them since they are more accurate than the + generic signal checking. + + (port of a similar patch for MM_06 by heiher ) + + plugins/huawei/mm-broadband-modem-huawei.c | 132 + ++++++++++++++++++++++++++++- + 1 file changed, 131 insertions(+), 1 deletion(-) + +commit 8fdcfd5b97e9a2a9e6fd98a9d833691256443498 +Author: Dan Williams +Date: Wed Nov 28 10:15:45 2012 -0600 + + huawei: consolidate MODE parsing + + Both CDMA and 3GPP modems emit this, but using slightly different + formats. + + plugins/huawei/mm-broadband-modem-huawei.c | 54 + +++++++++++++++++++++++++++--- + 1 file changed, 49 insertions(+), 5 deletions(-) + +commit 56e5ecdc1b64c37f103eea1adc8ace3c743ed0e2 +Author: Dan Williams +Date: Wed Nov 28 09:45:47 2012 -0600 + + huawei: consolidate SYSINFO parsing + + Both CDMA and 3GPP modems use SYSINFO, so consolidate the parsing of + its response. + + plugins/huawei/mm-broadband-modem-huawei.c | 219 + ++++++++++++++++++----------- + 1 file changed, 135 insertions(+), 84 deletions(-) + +commit b39ae775d6c13474d0c3b74acfd642a420f1faba +Author: Aleksander Morgado +Date: Fri Nov 30 15:25:37 2012 +0100 + + serial: clear serial info struct before calling ioctl() + + We need the kernel driver to give a proper value for the + 'closing_wait' + variable, but don't assume it will. + + This should solve the following kind of issues reported by valgrind: + + ==8985== Conditional jump or move depends on uninitialised value(s) + ==8985== at 0x4409A6: mm_serial_port_close (mm-serial-port.c:932) + ==8985== by 0x41A420: disable_all_done (mm-generic-cdma.c:753) + ==8985== by 0x4125A4: mm_manager_shutdown (mm-manager.c:1130) + ==8985== by 0x40DE35: main (main.c:203) + + src/mm-serial-port.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1e23fe62fe80a7351760bfb7fe9eeba7631d882b +Author: Dan Williams +Date: Thu Nov 29 11:22:52 2012 -0600 + + sierra: USB 306 modems support PPP on the APPx ports + + plugins/sierra/mm-plugin-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ad51361cb78a2d2fae0b164d8396882dd2638bbf +Author: Aleksander Morgado +Date: Mon Oct 29 10:42:45 2012 +0100 + + plugin-base: handle Huawei Data07 capabilities probing + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit b0746c591f052587999ca22b81b86f1e8dd56354 +Author: Aleksander Morgado +Date: Tue Nov 27 22:04:04 2012 +0100 + + huawei: don't assume g_regex_match_full() sets error when not matching + + plugins/huawei/mm-broadband-modem-huawei.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit 2f28193cd48a8d965ad9e26f1b918649ba10f5ec +Author: Dan Williams +Date: Tue Nov 27 14:50:14 2012 -0600 + + broadband-modem-huawei: don't call non-existent MMBroadbandModem + CDMA functions + + plugins/huawei/mm-broadband-modem-huawei.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +commit ef644fba84544c1a91b3fd2b510e39f9877b3680 +Author: Dan Williams +Date: Tue Nov 27 09:54:51 2012 -0600 + + hso: DIAG ports aren't always DIAG + + The 'hso' driver tags Icera-based modems' proprietary protocol port + as a DIAG port, but since they aren't Qualcomm-based, it's not + a DIAG port. Just turn off AT probing and let QCDM probing + fail the port instead of assuming it's a DIAG port. + + plugins/option/mm-plugin-hso.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit c90e41fb1327ad48166b58a8f8281ac6462a9690 +Author: Dan Williams +Date: Tue Nov 27 09:53:29 2012 -0600 + + port-probe: early-exit if port is certainly not AT capable + + If we read a response that indicates the port is definitely not an + AT capable port, stop AT probing. Certain ports that use proprietary + protocols or other non-AT protocols tend to spew data at us, so when + this happens we can cut probing short. + + src/mm-port-probe.c | 131 + +++++++++++++++++++++++++++++----------------------- + 1 file changed, 74 insertions(+), 57 deletions(-) + +commit a01e8aa31724ee1210b86d1d7261897a305d8710 +Author: Dan Williams +Date: Mon Nov 26 17:29:48 2012 -0600 + + serial-port: consistently use mm_warn() instead of g_warning() + + src/mm-serial-port.c | 45 +++++++++++++++++++++------------------------ + 1 file changed, 21 insertions(+), 24 deletions(-) + +commit 8772d63389b97a65bcace9fe0b54175a6adab9fe +Author: Dan Williams +Date: Mon Nov 26 17:05:52 2012 -0600 + + serial-port: stop reading data if the serial port was closed + + If a response processor closed the port, don't try to read any + more data from it. Move the priv->watch_id check to the + while condition so the loop terminates before calling + g_io_channel_read_chars() again, which caused a warning since + the underlying file descriptor was already closed. + + Also, bytes_read will never be less than zero (it's unsigned), + so skip the bytes_read > 0 check and just assert that this + condition is true. + + src/mm-serial-port.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit a7167b93b9f077e063024754ad2d566fc65f76b4 +Author: Dan Williams +Date: Mon Nov 26 16:49:39 2012 -0600 + + port-probe: fix crash in buffer-full processing + + Signal was attached with user_data as MMPortProbe*, but + serial_buffer_full() treated user_data as a PortProbeRunTask*. + Hillarity ensued. + + src/mm-port-probe.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 6106d1d6a2b05a031c54c75861363b199136e417 +Author: Dan Williams +Date: Mon Nov 26 16:17:07 2012 -0600 + + port-probe: fix checking of Icera capability on some devices + + Sierra devices often have limited AT parsers on their APP ports + which reply with OK to any command they don't understand, and + thus we need to actually check for a valid IPSYS reply instead of + just checking whether the IPSYS request completed without error. + + Previously MM would detect Icera capability on devices that + didn't actually have it. + + src/mm-port-probe-at.c | 18 ------------------ + src/mm-port-probe-at.h | 7 ------- + src/mm-port-probe.c | 9 ++++----- + 3 files changed, 4 insertions(+), 30 deletions(-) + +commit 3e39144100315c5be83396d5ef2433be4b7ae203 +Author: Dan Williams +Date: Mon Nov 26 13:56:32 2012 -0600 + + qcdm: handle more test failures for NW subsystem + + Bandrich C120 returns BAD_LENGTH rather than BAD_COMMAND, perhaps + because it re-uses the same subsystem number for something else. + + libqcdm/tests/test-qcdm-com.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 33f440c88543c32b70b0ba9458dc047c35ad23c9 +Author: Dan Williams +Date: Mon Nov 26 13:55:07 2012 -0600 + + broadband-modem: fall back to +CSQ if +CIND signal quality checking + fails + + If +CIND fails for any reason (generic failure, wrong indexes, etc) or + reports zero signal strength (quirky modem) then fall back to +CSQ. + + src/mm-broadband-modem.c | 72 + +++++++++++++++++++++++++----------------------- + 1 file changed, 37 insertions(+), 35 deletions(-) + +commit 562055b53b7878e7bb0e240ae121d4bcd6926e93 +Author: Aleksander Morgado +Date: Tue Nov 27 16:24:54 2012 +0100 + + libmm-glib,manager: client creation may fail, avoid explicit + MM_MANAGER() cast + + libmm-glib/mm-manager.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e97b229e663dcd6d24a15fef51f13e2886ddf134 +Author: Jiří Klimeš +Date: Tue Nov 27 10:48:48 2012 +0100 + + core: fix possible crash in g_utf8_validate() + + We can skip additional UTF-8 validity check when parsing operator. + mm_charset_take_and_convert_to_utf8() already does a UTF-8 validity + check + internally before returning the string, so it's pointless to do a + new one + on the returned string. + Plus, mm_charset_take_and_convert_to_utf8() may really return NULL, + which + would end up in segfaulting as g_utf8_validate() expects always + a non-NULL + string. + + Based on 219424a6e2d017491a05ecbed661bccde3f991ef (MM_06 branch) + + src/mm-modem-helpers.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit e6052a4abfde3550b0b9c2229adb0bb381ac4a06 +Author: Aleksander Morgado +Date: Tue Nov 27 11:26:51 2012 +0100 + + icera,hso: don't disconnect() cancellable in the cancellation callback + + The logic gets completely stuck when this happens: + + Stack trace below: + #0 0x77661424 in __kernel_vsyscall () + #1 0x77337c3c in pthread_cond_wait () + #2 0x773cebaa in g_cond_wait () from /usr/lib/libglib-2.0.so.0 + #3 0x774c03cc in g_cancellable_disconnect () from + /usr/lib/libgio-2.0.so.0 + #4 0x76955d36 in connect_cancelled_cb (cancellable=0x78e055a0, + self=0x78e0b590) + #5 0x77460982 in g_cclosure_marshal_VOID__VOIDv () from + /usr/lib/libgobject-2.0.so.0 + #6 0x7745ed8a in ?? () from /usr/lib/libgobject-2.0.so.0 + #7 0x77478435 in g_signal_emit_valist () from + /usr/lib/libgobject-2.0.so.0 + #8 0x77478eb3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0 + #9 0x774c01eb in g_cancellable_cancel () from + /usr/lib/libgio-2.0.so.0 + #10 0x776a0eab in mm_bearer_disconnect (self=0x78e0b590, + callback=0x776c5980 , + #11 0x776c57de in disconnect_next_bearer (ctx=0x78e12870) at + mm-iface-modem-simple.c:898 + #12 0x776c58d2 in disconnect_auth_ready (self=0x78df3048, + res=0x78e06210, ctx=0x78e12870) + #13 0x774fed25 in g_simple_async_result_complete () from + /usr/lib/libgio-2.0.so.0 + #14 0x776a8c4e in authorize_ready (authp=0x78db68d0, res=0x76801638, + simple=0x78e06210) + #15 0x774fed25 in g_simple_async_result_complete () from + /usr/lib/libgio-2.0.so.0 + #16 0x774fee3e in ?? () from /usr/lib/libgio-2.0.so.0 + #17 0x7738a7a2 in ?? () from /usr/lib/libglib-2.0.so.0 + #18 0x7738ce83 in g_main_context_dispatch () from + /usr/lib/libglib-2.0.so.0 + #19 0x7738d248 in ?? () from /usr/lib/libglib-2.0.so.0 + #20 0x7738d6eb in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 + #21 0x77696a7d in main (argc=2, argv=0x7fbb1f04) at main.c:158 + + http://code.google.com/p/chromium-os/issues/detail?id=36448 + + plugins/icera/mm-broadband-bearer-icera.c | 2 -- + plugins/option/mm-broadband-bearer-hso.c | 2 -- + 2 files changed, 4 deletions(-) + +commit 674ecaa6eb356539a56d84057cc9fa7b5aeed0b1 +Author: Ben Chan +Date: Mon Nov 26 23:56:27 2012 -0800 + + broadband-modem: check for NULL response in + parse_caps_{cpin,cgmm,gcap} + + src/mm-broadband-modem.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit cf46ed42384e9fbd4872e2f98d743755d8f9a571 +Author: Aleksander Morgado +Date: Thu Nov 15 09:37:56 2012 +0100 + + libmm-glib,manager: register DBus error associations in advance + + In order to have a proper conversion between DBus error names and + GErrors for + our known domains, the associations need to be registered before + any DBus + call attempt. + + Given that the high-level API of libmm-glib has its entry point + always in the + MMManager, just register them as soon as the first such object + is created. + + libmm-glib/mm-manager.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit b74741e6420519767bd7551f29dc69f9f31b4c51 +Author: Dan Williams +Date: Wed Jul 25 14:06:17 2012 -0500 + + qcdm: get/set functions for hybrid preference + + libqcdm/src/commands.c | 88 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 23 +++++++++++ + libqcdm/src/nv-items.h | 13 +++++++ + libqcdm/tests/test-qcdm-com.c | 42 +++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 169 insertions(+) + +commit 773d0022d0d1756ca8a29ad273bea38916a93499 +Author: Dan Williams +Date: Wed Nov 14 11:07:28 2012 -0600 + + qcdm: trivial cleanup of log item numbers + + libqcdm/src/log-items.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 79652bb671d188da2905fb95d7f928c689305451 +Author: Dan Williams +Date: Wed Nov 14 11:05:21 2012 -0600 + + qcdm: clarify log item command length member + + libqcdm/src/dm-commands.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e798b6e663131aaabc8919de2a46eb2f58d43aa0 +Author: Dan Williams +Date: Thu Nov 8 12:17:00 2012 -0600 + + serial: fix warning when driver doesn't support closing_wait + (bgo #630670) + + It appears that GIOChannel might also do some flushing, so make sure + our warning captures that delay if there is one. Also be paranoid + and make sure nothing reset our closing_wait value. + + src/mm-serial-port.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +commit 191eabe952031b5dcc86e92c993d6bfbef101f3f +Author: Aleksander Morgado +Date: Tue Nov 13 07:41:03 2012 +0100 + + blacklist: skip probing Atmel samba bootloader + + https://bugzilla.gnome.org/show_bug.cgi?id=688213 + + src/77-mm-usb-device-blacklist.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit c2db8abe5238c3ddd05d11a0f99f10914b2af9cf +Author: Aleksander Morgado +Date: Thu Nov 8 15:59:12 2012 +0100 + + huawei: better detection of data port on some modems + + Some devices (e173) appear to lie about NDIS support; GETPORTMODE + reports NDIS + is enabled, but that port is actually the MDM port and responds to + AT commands. + So, if we get a port reported as NDIS and none reported as MDM, + use the one + reported as NDIS for PPP. + + https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1057186 + + plugins/huawei/mm-plugin-huawei.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 8c4a836a2dbb9f682ab99871496c47a4c899ded9 +Author: Aleksander Morgado +Date: Wed Oct 31 11:36:36 2012 +0100 + + option,hso: early check of port type hints to avoid probings + + Instead of getting the port type hints while grabbing each probed + port, we now + run a custom init operation in the probing which already gives us + the port type, + and therefore allows us to completely skip port probings. + + Also now added hints for 'Diag' (QCDM) ports and AT/'Modem' ports + (I guess it's + the one for PPP if we don't have a net port, which is unlikely anyway + in HSO). + + This makes the probing of an Option/HSO modem almost instant. + + plugins/option/mm-plugin-hso.c | 142 + ++++++++++++++++++++++++++--------------- + 1 file changed, 92 insertions(+), 50 deletions(-) + +commit 94d62146e39c3c48fcd4e134cad99f6aadb0d77d +Author: Aleksander Morgado +Date: Wed Nov 7 10:01:03 2012 +0100 + + libmm-glib,manager: avoid unref of unset cancellables + + libmm-glib/mm-manager.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 11db2ea38093bc8d1bb1424cfca84abf3b66185c +Author: Dan Williams +Date: Mon Nov 5 16:29:30 2012 -0600 + + sierra: fix CFUN power up delay handling + + All Sierra devices appear to require short delay after powering up, + otherwise subsequent commands may return errors. Older devices need + longer so ensure new devices are penalized just for being new. + + This is the port to git master of the following commit, for which we + don't need to do #2: + + commit 814febe1fd9baacdb33c79f11c140187df36c4f1 + Author: Dan Williams + Date: Tue Oct 30 16:16:25 2012 -0500 + + sierra: fix CFUN power up delay handling + + 1) all Sierra devices appear to require short delay after + powering up, + otherwise subsequent commands may return errors. Older devices + need + longer so ensure new devices are penalized just for being new. + + 2) When the modem is already in full functionality status and + no power + up command was sent, there's no need to delay, which was happening + regardless of what state the modem was already in. Detect whether + the power up was actually executed (response and error will + be NULL) + and only delay if it was executed. + + plugins/sierra/mm-common-sierra.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 5a16f2aff10660bdf279a5ebbd0138f6aea6480a +Author: Ben Chan +Date: Sat Nov 3 18:00:03 2012 -0700 + + novatel-lte: use $NWMDN to read own number when +CNUM fails + + +CNUM may return ERROR when the modem fails to read the own numbers + from + the SIM card or when the SIM card hasn't been activated. Use $NWMDN to + read the MDN as a fallback, which distinguishes these two cases. + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 103 + +++++++++++++++++++++++ + 1 file changed, 103 insertions(+) + +commit af48e1c8b7b4cdc4212540d0f893a09f68630959 +Author: Aleksander Morgado +Date: Fri Nov 2 14:29:52 2012 +0100 + + broadband-modem-qmi: by default request only GSM-WCDMA mode messages + + This should probably fix the issues seen with the Novatel E362 + (CDMA+LTE): + + ModemManager[4813]: [1351697325.212782] + [mm-broadband-modem-qmi.c:5541] load_initial_sms_parts(): loading + messages from storage 'sm'... + ModemManager[4813]: [/dev/cdc-wdm0] Sending message... + <<<<<< QMUX: + <<<<<< length = 16 + <<<<<< flags = 0x00 + <<<<<< service = "wms" + <<<<<< client = 2 + <<<<<< QMI: + <<<<<< flags = "none" + <<<<<< transaction = 3 + <<<<<< tlv_length = 4 + <<<<<< message = "List Messages" (0x0031) + <<<<<< TLV: + <<<<<< type = "Storage Type" (0x01) + <<<<<< length = 1 + <<<<<< value = 01 + <<<<<< translated = 1 + ModemManager[4813]: [/dev/cdc-wdm0] Received message... + >>>>>> QMUX: + >>>>>> length = 19 + >>>>>> flags = 0x80 + >>>>>> service = "wms" + >>>>>> client = 2 + >>>>>> QMI: + >>>>>> flags = "response" + >>>>>> transaction = 3 + >>>>>> tlv_length = 7 + >>>>>> message = "List Messages" (0x0031) + >>>>>> TLV: + >>>>>> type = "Result" (0x02) + >>>>>> length = 4 + >>>>>> value = 01:00:11:00 + >>>>>> translated = FAILURE: MissingArgument + ModemManager[4813]: [1351697325.215112] + [mm-iface-modem-messaging.c:757] load_initial_sms_parts_ready(): + Couldn't load SMS parts from storage 'sm': 'Couldn't list messages: + QMI protocol error (17): 'MissingArgument'' + + src/mm-broadband-modem-qmi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit b43575fdf9c2f6b9f47dcb034343c0cb58e3df90 +Author: Aleksander Morgado +Date: Fri Nov 2 14:19:15 2012 +0100 + + iface-modem-messaging: fix storage string when reporting errors + + src/mm-iface-modem-messaging.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 9ec90d9a11f53c91274a1341217e7da5f8621674 +Author: Aleksander Morgado +Date: Fri Nov 2 09:52:31 2012 +0100 + + core,plugins: don't assume 'CS' supported when '2G' supported + + We will not report 'CS' as a supported mode every time '2G' is + supported. This + actually was forcing all plugins to handle a 'CS' fallback when they + didn't have + CS-specific mode setup. So, to simplify things, we will only report + 'CS' as + supported for those plugins which actually allow to select 'CS' mode + (e.g. the + 'wavecom' plugin). + + plugins/huawei/mm-broadband-modem-huawei.c | 7 ------- + plugins/icera/mm-broadband-modem-icera.c | 9 +-------- + plugins/linktop/mm-broadband-modem-linktop.c | 7 ------- + plugins/longcheer/mm-broadband-modem-longcheer.c | 7 ------- + plugins/option/mm-broadband-modem-option.c | 9 +-------- + plugins/x22x/mm-broadband-modem-x22x.c | 7 ------- + plugins/zte/mm-broadband-modem-zte.c | 7 ------- + src/mm-broadband-modem.c | 7 ------- + src/mm-modem-helpers-qmi.c | 9 ++------- + 9 files changed, 4 insertions(+), 65 deletions(-) + +commit 96305bb5c1d32e5a0e517750501b705502e74111 +Author: Aleksander Morgado +Date: Fri Nov 2 09:48:56 2012 +0100 + + iridium: report only 'CS' mode supported + + Iridium modems only support circuit-switched connections, so just + report that + one as supported. + + plugins/iridium/mm-broadband-modem-iridium.c | 31 + ++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +commit 55c05121adf23e9fc9669540cedc63e84005e2cd +Author: Aleksander Morgado +Date: Fri Nov 2 08:49:37 2012 +0100 + + broadband-modem-qmi: fix error reporting when loading current + bands fails + + src/mm-broadband-modem-qmi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 1fd1f558f1ad05b8f06f09b0d2b2ce318ac30ee7 +Author: Aleksander Morgado +Date: Wed Oct 31 13:12:12 2012 +0100 + + broadband-modem-qmi: implement CDMA BS location reporting + + src/mm-broadband-modem-qmi.c | 53 + +++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 47 insertions(+), 6 deletions(-) + +commit 31ec55aea8ed310403929f5b9c7ffcca74b145e7 +Author: Aleksander Morgado +Date: Wed Oct 31 12:50:13 2012 +0100 + + iface-modem-location: implement handling the CDMA BS location source + + src/mm-iface-modem-location.c | 112 + +++++++++++++++++++++++++++++++++++++----- + src/mm-iface-modem-location.h | 6 +++ + 2 files changed, 107 insertions(+), 11 deletions(-) + +commit b508316a5a87409e9acf5a625f7501280dd29f74 +Author: Aleksander Morgado +Date: Wed Oct 31 12:35:01 2012 +0100 + + cli: new actions to setup or gather CDMA BS location source + + cli/mmcli-modem-location.c | 74 + ++++++++++++++++++++++++++++++++++++++++------ + docs/man/mmcli.8 | 24 ++++++++++----- + 2 files changed, 82 insertions(+), 16 deletions(-) + +commit d9241d08db31cf5bbb91ecc13c5b6839161a3804 +Author: Aleksander Morgado +Date: Wed Oct 31 12:34:46 2012 +0100 + + libmm-glib: implement handling the CDMA BS location source + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 27 +++ + libmm-glib/Makefile.am | 3 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-location-cdma-bs.c | 219 + ++++++++++++++++++++++ + libmm-glib/mm-location-cdma-bs.h | 84 +++++++++ + libmm-glib/mm-modem-location.c | 97 +++++++++- + libmm-glib/mm-modem-location.h | 14 ++ + 8 files changed, 438 insertions(+), 8 deletions(-) + +commit 24c40e32bd6b5a9becbba05d18f8fbbdc3592d51 +Author: Aleksander Morgado +Date: Wed Oct 31 12:34:07 2012 +0100 + + api: new source for the CDMA Base Station location + + include/ModemManager-enums.h | 2 ++ + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 24 + ++++++++++++++++++++++ + 2 files changed, 26 insertions(+) + +commit 72068598e51a020a1f4c405c3d1650e4d2eef0a3 +Author: Aleksander Morgado +Date: Wed Oct 31 12:09:46 2012 +0100 + + libmm-glib: new header file for common stuff in location reporting + + docs/reference/libmm-glib/libmm-glib-sections.txt | 6 +-- + libmm-glib/Makefile.am | 2 + + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-location-common.h | 48 + +++++++++++++++++++++++ + libmm-glib/mm-location-gps-raw.c | 38 +++++++++--------- + libmm-glib/mm-location-gps-raw.h | 27 +------------ + 6 files changed, 75 insertions(+), 47 deletions(-) + +commit 15f7a370d2c4adb118488287fd553c673e8142b4 +Author: Ben Chan +Date: Wed Oct 31 21:31:29 2012 -0700 + + novatel-lte: increase the wait after SIM unlock to 3 seconds + + After repeated stress tests on a few Novatel E362 modems and SIM + cards, + it is revealed that a 3-second wait after SIM unlock is necessary for + reliably reading ICCID and IMSI through the SIM interface. + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 02ef7d95474af3d13ce6905d7f8dcd3c8ce82608 +Author: Ben Chan +Date: Wed Oct 31 21:23:42 2012 -0700 + + iface-modem: load own numbers after SIM initialization + + In 3GPP, own numbers are loaded from the SIM card, the loading of own + numbers should be scheduled after the SIM card is ready. + + src/mm-iface-modem.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit daf1a353c32e3bbf182e8c9c2948c35627c3111d +Author: Aleksander Morgado +Date: Wed Oct 31 10:54:25 2012 +0100 + + core: allow QMI modems without AT ports + + src/mm-base-modem.c | 24 ++++++++++++++--- + src/mm-broadband-modem-qmi.c | 62 + +++++++++++++++++++++++++++++++++++++++++--- + src/mm-broadband-modem.c | 13 ++++++---- + 3 files changed, 86 insertions(+), 13 deletions(-) + +commit 25d35b6f915b65565ec90d17bfdaa96a7e6c391f +Author: Aleksander Morgado +Date: Mon Oct 29 16:11:35 2012 +0100 + + broadband-modem-qmi: run power-down during init + + src/mm-broadband-modem-qmi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 189726de1156146f41b73e0a3570a106c79862c4 +Author: Dan Williams +Date: Tue Oct 30 18:39:53 2012 -0500 + + sierra: allow more time for PDP context activation + + 3 seconds isn't always enough to set up the context with the network. + + plugins/sierra/mm-broadband-bearer-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 26956924b062bed7f1b724376f9e6ee7e89c1e13 +Author: Marius B. Kotsbak +Date: Tue Oct 30 18:01:23 2012 +0100 + + sierra: avoid reset when setting cfun=1 + + Some Sierra modems trigger a reset of the modem when sending +cfun=1. + All sierra modems supports a second parameter to indicate that no + reset is to be done: "+cfun=1,0". + + plugins/sierra/mm-common-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 120b660fd4824e779b37e16a4e211867c8e34a68 +Author: Aleksander Morgado +Date: Tue Oct 30 16:06:27 2012 +0100 + + core,log: include logging from the 'Qmi' log domain + + Sync with libqmi: + + commit 2835a53732fdae32478dd954a9ee3fa8afd93cab + Author: Aleksander Morgado + Date: Tue Oct 30 15:02:24 2012 +0100 + + libqmi-glib: define library G_LOG_DOMAIN + + src/mm-log.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 3c2bcb8d04da23567f88db2710a93803ca54f347 +Author: Aleksander Morgado +Date: Tue Oct 30 15:50:32 2012 +0100 + + huawei: ignore '^STIN' unsolicited messages + + plugins/huawei/mm-broadband-modem-huawei.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 6992e3b32d33d7d2ff340b7f9c26f99f91099ad3 +Author: Aleksander Morgado +Date: Tue Oct 30 15:48:30 2012 +0100 + + huawei: reset ignored unsolicited message handlers only once + + plugins/huawei/mm-broadband-modem-huawei.c | 56 + +++++++++++++++++++----------- + 1 file changed, 36 insertions(+), 20 deletions(-) + +commit 0ca6ae1b4b142dfa947bec45c833388f86cc9709 +Author: Aleksander Morgado +Date: Fri Oct 26 13:41:27 2012 +0200 + + plugin-manager,plugin: run pre-probing filters early + + For each port, we will construct the list of plugins to test with. In + that list + we will include those plugins which are likely to handle a given port, + so we + will skip all those which aren't. + + To see if a plugin is likely or not, we will run the pre-probing + filters before + adding them to the list, with the new + `mm_plugin_discard_port_early()'. This + method will return one of these hints: + + * UNSUPPORTED: The plugin will not be able to handle this port. + * MAYBE: The plugin may handle this port. + * LIKELY: The plugin may (very likely) handle this port. + * SUPPORTED: If any plugin should support the port, this is it. + + Plugins reported to be 'likely' supporting the port will be probed + before the + ones reported just as 'maybe'. + + If a plugin reports 'supported' only that one and the fallback + generic ones will + be tried. + + src/mm-plugin-manager.c | 119 + ++++++++++++++++++++++++++++++++++-------------- + src/mm-plugin.c | 82 +++++++++++++++++++++------------ + src/mm-plugin.h | 15 +++++- + 3 files changed, 152 insertions(+), 64 deletions(-) + +commit e5b4b4d0e5ab11a581504ce88be2a1aa317524e8 +Author: Aleksander Morgado +Date: Fri Oct 26 13:00:49 2012 +0200 + + plugin-manager: use dispose() as we're holding plugin objects + + src/mm-plugin-manager.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 49c19bf83e0c03e8d134d2c1d6a8d60df7d341f3 +Author: Aleksander Morgado +Date: Fri Oct 26 12:56:08 2012 +0200 + + plugin: avoid unneeded vendor/product AT probing if already passed + USB ID filter + + Don't require vendor/product string probing if the plugin already had + vendor/product ID filters and we actually passed those. + + src/mm-plugin.c | 42 ++++++++++++++++++++++++++++-------------- + 1 file changed, 28 insertions(+), 14 deletions(-) + +commit 3f255b628aac5c7b491a4daeb5a7cb43357d8432 +Author: Aleksander Morgado +Date: Fri Oct 26 12:44:15 2012 +0200 + + plugin-manager,plugin: improve logging + + Logging which are the reasons for a plugin to filter a given port + really help + when trying to debug user issues. Some other general logging + improvements also + done. + + src/mm-plugin-manager.c | 61 ++++++++-------------------- + src/mm-plugin.c | 103 + ++++++++++++++++++++++++++++++++++++------------ + 2 files changed, 94 insertions(+), 70 deletions(-) + +commit 28114f66d53a5f232904f2609778b9cd8f84ffa0 +Author: Aleksander Morgado +Date: Wed Oct 24 16:25:38 2012 +0200 + + iface-modem,broadband-modem: update 'enabling->enabled transition + logic + + It is not the Modem interface the one notifying about the + 'enabling->enabled' + transition, it's the BroadbandModem directly doing it, covering all + the enabling + sequences of all the interfaces. + + src/mm-broadband-modem.c | 93 + ++++++++++++++++++++++++++++++++++++++---------- + src/mm-iface-modem.c | 26 -------------- + 2 files changed, 75 insertions(+), 44 deletions(-) + +commit d09d02442ff19f7b0b47b6a5505d49ed3154c30a +Author: Aleksander Morgado +Date: Wed Oct 24 16:24:52 2012 +0200 + + iface-modem,broadband-modem: update 'disabling->disabled' transition + logic + + It is not the Modem interface the one notifying about the + 'disabling->disabled' + transition, it's the BroadbandModem directly doing it, covering + all the + disabling sequences of all the interfaces. + + src/mm-broadband-modem.c | 125 + +++++++++++++++++++++++++++-------------------- + src/mm-iface-modem.c | 17 ------- + 2 files changed, 72 insertions(+), 70 deletions(-) + +commit a12d1e36b0bcda80f3b7f0ae28513a086bb3fd91 +Author: Aleksander Morgado +Date: Wed Oct 24 16:22:25 2012 +0200 + + iface-modem: when transitioning to ENABLED check registration-specific + states + + src/mm-iface-modem.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f667898ecac27906fae9dfa526b799b0c81221f6 +Author: Aleksander Morgado +Date: Wed Oct 24 16:22:55 2012 +0200 + + iface-modem: ignore registration-related state changes if enabling + or disabling + + src/mm-iface-modem.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit db80fd25509ca9c9cf56d57d1e4de637a859c0cd +Author: Aleksander Morgado +Date: Wed Oct 24 16:22:05 2012 +0200 + + iface-modem: ignore bearer related state changes if disabling + or enabling + + src/mm-iface-modem.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 16428630372d5047da8fa6874fd7b7ebc6da7fd1 +Author: Aleksander Morgado +Date: Wed Oct 24 11:21:48 2012 +0200 + + iface-modem-simple: avoid intermediate states + + If the modem is currently disabling, we need to wait to get fully + disabled + before starting with the new connection sequence. + + If the modem is currently disconnecting, we need to wait to get fully + disconnected before starting with the new connection sequence. + + src/mm-iface-modem-simple.c | 160 + +++++++++++++++++++++++++------------------- + 1 file changed, 90 insertions(+), 70 deletions(-) + +commit 4fc3f527919182031e039d902f7d1e3cd2b3ab11 +Author: Aleksander Morgado +Date: Wed Oct 24 13:37:52 2012 +0200 + + iface-modem: new helper method to wait until a final state is reached + + src/mm-iface-modem.c | 128 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 9 ++++ + 2 files changed, 137 insertions(+) + +commit 96986117b3f5dcbfa3c70d9e74047ebccc99dfcd +Author: Aleksander Morgado +Date: Wed Oct 24 13:39:20 2012 +0200 + + option,hso: don't reset connection if cancelled, wait to get + connected before + + If we are requested to cancel the connection, we first need to wait + for the + connection attempt to finish before issuing the disconnect command, + as otherwise + the modem just returns an error saying that it cannot perform the + operation and + at the end we end up with the modem connected but ModemManager + thinking that it + isn't. + + plugins/option/mm-broadband-bearer-hso.c | 152 + ++++++++++++++++++++----------- + 1 file changed, 101 insertions(+), 51 deletions(-) + +commit 6297c4b4c891ab99576cf69f88fc570313553e1a +Author: Aleksander Morgado +Date: Tue Oct 23 12:40:55 2012 +0200 + + icera: don't reset connection if cancelled, wait to get connected + before + + If we are requested to cancel the connection, we first need to wait + for the + connection attempt to finish before issuing the disconnect command, + as otherwise + the modem just returns an error saying that it cannot perform the + operation and + at the end we end up with the modem connected but ModemManager + thinking that it + isn't. + + Tries to fix https://bugzilla.gnome.org/show_bug.cgi?id=685578 + + plugins/icera/mm-broadband-bearer-icera.c | 103 + ++++++++++++++++++++++-------- + 1 file changed, 76 insertions(+), 27 deletions(-) + +commit a772b28ad61d5ebd5dd0705d81707dbc9cf04273 +Author: Aleksander Morgado +Date: Thu Oct 25 16:50:08 2012 +0200 + + broadband-modem-qmi: only give gsm/wcdma acquisition order if both + 2G & 3G given + + src/mm-broadband-modem-qmi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 79af94fdbda0c7ed093108fa9e79f4e2ef74be1b +Author: Aleksander Morgado +Date: Thu Oct 25 16:49:16 2012 +0200 + + broadband-modem-qmi: don't treat no-effect errors as failure when + setting SSP + + src/mm-broadband-modem-qmi.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit e2d20974c14b1c28d172864974e1e73b2f65dc10 +Author: Aleksander Morgado +Date: Thu Oct 25 16:18:16 2012 +0200 + + iface-modem: don't re-set interface skeleton after PIN unlock + + Before the change, the client application loses all new property + change + notifications in the interface object: + + $ sudo mmcli -m 0 -w + /org/freedesktop/ModemManager1/Modem/0: Initial state, + 'locked' + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'locked' --> 'initializing' (Reason: None or unknown) + + After the change, it doesn't: + + $ sudo mmcli -m 0 -w + /org/freedesktop/ModemManager1/Modem/0: Initial state, + 'locked' + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'locked' --> 'initializing' (Reason: None or unknown) + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'initializing' --> 'disabled' (Reason: None or unknown) + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'disabled' --> 'enabling' (Reason: User request) + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'enabling' --> 'registered' (Reason: User request) + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'registered' --> 'disabling' (Reason: User request) + /org/freedesktop/ModemManager1/Modem/0: State changed, + 'disabling' --> 'disabled' (Reason: User request) + + src/mm-iface-modem.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 7fd09123f899c8d9a9d82af6a2fde2e503eb1b47 +Author: Aleksander Morgado +Date: Wed Oct 24 11:30:06 2012 +0200 + + broadband-bearer: log all found PDP contexts before looking for + a match + + src/mm-broadband-bearer.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 675d8aeeea8ded0adcfacb2ef20ca2db2fc1388d +Author: Aleksander Morgado +Date: Wed Oct 24 11:29:50 2012 +0200 + + tests: add PDP context reply parser test for Samsung/Icera replies + + src/tests/test-modem-helpers.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit e499d32ef1f3eafe130585a2be9089b1c7d31892 +Author: Aleksander Morgado +Date: Wed Oct 24 10:57:51 2012 +0200 + + core: add info logs to show main state machine start/stop points + + src/mm-broadband-modem.c | 7 +++++++ + src/mm-iface-modem-simple.c | 2 ++ + 2 files changed, 9 insertions(+) + +commit 6d4a4d647cfd5740abdd729691f553741dbf5200 +Author: Aleksander Morgado +Date: Wed Oct 24 10:38:35 2012 +0200 + + broadband-modem: disable echo in secondary port when enabling + + src/mm-broadband-modem.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +commit d3ddfd583c5bd4cf3fc45886983b0bf4f26a1d3d +Author: Aleksander Morgado +Date: Wed Oct 24 10:36:24 2012 +0200 + + broadband-modem: make sure the primary port is used for the modem + init sequence + + src/mm-broadband-modem.c | 57 + +++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 44 insertions(+), 13 deletions(-) + +commit 89723c7ef28e3b071413bb22c561abfa5724d3ea +Author: Martyn Russell +Date: Wed Oct 24 10:43:00 2012 +0200 + + docs,ModemManager: include the missing manpage + + (aleksander) I messed up the integration of commit bc49794848, + this should fix + it. + + .gitignore | 2 -- + docs/man/ModemManager.8 | 51 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 51 insertions(+), 2 deletions(-) + +commit 96c6db99265e7448a8e21df49f7c94de35a540a4 +Author: Aleksander Morgado +Date: Tue Oct 23 19:37:04 2012 +0200 + + man,mmcli: add additional commonly used examples + + docs/man/mmcli.8 | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit b5040fa033b44fdf2036dc2873840582afeea94d +Author: Martyn Russell +Date: Tue Oct 23 18:42:58 2012 +0200 + + docs,mmcli: Add man page for mmcli(8) + + docs/man/Makefile.am | 2 +- + docs/man/mmcli.8 | 699 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 700 insertions(+), 1 deletion(-) + +commit bc497948487a7c3f8e5df683db77262bfee8c19d +Author: Martyn Russell +Date: Tue Oct 23 18:40:38 2012 +0200 + + docs,ModemManager: Don't use .in file for manpage, no need + + configure.ac | 1 - + docs/man/Makefile.am | 6 +----- + docs/man/ModemManager.8.in | 51 + ---------------------------------------------- + 3 files changed, 1 insertion(+), 57 deletions(-) + +commit 90e67404d6ab075d8d4bae1f006b69ca26696296 +Author: Dan Williams +Date: Fri Oct 19 19:32:03 2012 -0500 + + bearer-qmi: get and log current IP settings when connecting the bearer + + All addresses are given as machine byte order, and thus must be + converted + to network byte order (BE) before passing to inet_ntop(). + + src/mm-bearer-qmi.c | 216 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 210 insertions(+), 6 deletions(-) + +commit 6788f809ea442b7ed3dca7a4f4351d51c67db5d1 +Author: Aleksander Morgado +Date: Tue Oct 23 16:31:51 2012 +0200 + + cli,sms: add missing parameter documentation in `--store-in-storage' + + cli/mmcli-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 29e3c0e742d7a33e5d24fdcd3c2c0b24c98469bc +Author: Aleksander Morgado +Date: Mon Oct 22 19:05:58 2012 +0200 + + bearer: fix connection allowance rules in 3GPP+LTE modems + + Only force disconnection of the bearer if not registered in any + network or if + registered in both 3GPP and CDMA roaming networks. + + src/mm-bearer.c | 66 + +++++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 48 insertions(+), 18 deletions(-) + +commit 82f91f321788689ca527405ed7e84a44c8c03f06 +Author: Aleksander Morgado +Date: Mon Oct 22 18:57:42 2012 +0200 + + iface-modem: when playing with bands is not supported, use 'unknown' + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 219aff47e075a5bfc7b7fdc2c7f251a5133c93ab +Author: Aleksander Morgado +Date: Mon Oct 22 17:06:14 2012 +0200 + + iface-modem: try to avoid showing 'any' as current bands + + Just expose the list of supported bands when the current bands is + set to 'any'. + + src/mm-iface-modem.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit b317996a8e18ba039d3d8ffb9968139d6d0bf9c1 +Author: Aleksander Morgado +Date: Mon Oct 22 17:05:25 2012 +0200 + + iface-modem: always ensure that current bands is a subset of + supported bands + + In QMI modems the logic behind supported and current bands is + completely + separated in different services (DMS vs NAS). Actually, the list + reported by NAS + as current band preferences seems to include more values than the + ones reported + by DMS as supported bands (e.g. CDMA bands are reported even if + the firmware + image is GSM/HSPA only). + + So, just clean up the list of current preferred bands so that no + more than those + given as supported is used. + + src/mm-iface-modem.c | 20 +++++++++++++++----- + src/mm-modem-helpers.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 3 +++ + 3 files changed, 68 insertions(+), 5 deletions(-) + +commit 8e4d93c04eed7eefb25da22bfa071f6650b4203c +Author: Aleksander Morgado +Date: Mon Oct 22 14:03:43 2012 +0200 + + nokia,icera: setup custom AT probing as in the generic Nokia plugin + + plugins/nokia/mm-plugin-nokia-icera.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit c900aa7c0b41be04082f1bdfe6dc7c28e1d41f18 +Author: Aleksander Morgado +Date: Mon Oct 22 13:08:31 2012 +0200 + + nokia: run vendor string probing, in order to grab Bluetooth DUN + devices + + plugins/nokia/mm-plugin-nokia.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 2559dc5baffc97afd637172a16c445f544e1d6f3 +Author: Aleksander Morgado +Date: Mon Oct 22 12:46:34 2012 +0200 + + cli: don't abort when looking for bearers in failed modems + + cli/mmcli-common.c | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +commit 5978258d85a148307a8ddb1c4dedccd81aa5871a +Author: Aleksander Morgado +Date: Mon Oct 22 12:33:19 2012 +0200 + + base-modem-at: handle NULL responses from the serial parsing in + sequences + + src/mm-base-modem-at.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c5f3198a9fdcd22a342be496b7ba6751ea1b53d2 +Author: Aleksander Morgado +Date: Mon Oct 22 12:27:55 2012 +0200 + + device: only export modem if it is available + + src/mm-device.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 10a0ed12c461242ca3dbf6f9192907d320b561f7 +Author: Ben Chan +Date: Thu Oct 18 23:44:19 2012 -0700 + + novatel-lte: retry $NWQMISTATUS upon an unknown error during + connecting + + The $NWQMISTATUS command sometimes replies an ERROR shortly after + calling the $NWQMICONNECT command, but then replies the proper QMI + status if we retry it. This behavior is observed on an E362 modem with + 4.08 firmware. + + (ttyUSB0): --> 'AT$NWQMICONNECT=,,,,,,"",,,"",""' + (ttyUSB0): <-- 'OK' + (ttyUSB0): --> 'AT$NWQMISTATUS' + (ttyUSB0): <-- 'ERROR' + Got failure code 100: Unknown error + QMI connection status failed: Unknown error + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 8362171973c600eb7d253a3f9cc343488f93408f +Author: Ben Chan +Date: Thu Oct 18 23:44:18 2012 -0700 + + novatel-lte: handle $NWQMISTATUS responses for firmware 4.08 + + In firmware 4.08, the $NWQMISTATUS command returns different + values for + QMI state to indicate the current connection state. This patch + modifies + the code to handle $NWQMISTATUS responses in firmware 1.41 and 4.08. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 26 + +++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +commit 7f105dc3862ad53236dcd5d1ce0b9e2539341dfa +Author: Dan Williams +Date: Fri Oct 19 19:30:04 2012 -0500 + + simple: don't try to enable the "unknown" band + + If the band isn't actually given, don't try to enable it. + + src/mm-iface-modem-simple.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 79fdddccbfccd50f2c4d98d90fc707061c39d1f5 +Author: Aleksander Morgado +Date: Fri Oct 19 00:58:36 2012 +0200 + + api,modem: new 'PrimaryPort' property + + We do need to specify which is the primary port being used for + controlling the + modem. This allows us to match the device with an already existing + bluetooth + device in NetworkManager. + + cli/mmcli-modem.c | 6 ++-- + docs/reference/libmm-glib/libmm-glib-sections.txt | 5 +++ + .../org.freedesktop.ModemManager1.Modem.xml | 7 ++++ + libmm-glib/mm-modem.c | 41 + ++++++++++++++++++++++ + libmm-glib/mm-modem.h | 3 ++ + src/mm-iface-modem.c | 15 ++++++++ + 6 files changed, 75 insertions(+), 2 deletions(-) + +commit e123c7d5b43cd4fb63d7f1fbdb44fbb641e410ac +Author: Aleksander Morgado +Date: Wed Oct 17 15:20:37 2012 +0200 + + blacklist: skip probing SheevaPlug serial ports + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686217 + + src/77-mm-usb-device-blacklist.rules | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 64a11ceec786de3bdd950532e066cceeb3f164ac +Author: Ben Chan +Date: Tue Oct 16 11:39:39 2012 +0200 + + icera: parse HSPA+ access technology in %NWSTATE response + + plugins/icera/mm-broadband-modem-icera.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 6223f61803c674d4c60e4ab126151de0696e0f48 +Author: Aleksander Morgado +Date: Tue Oct 16 11:34:36 2012 +0200 + + Revert "icera: improve parsing of access technologies in %NWSTATE + response" + + This reverts commit e2f3034f6e2c79062c095be0bc4278907b32ec8f. + + The report of current access technologies is supposed to give which + is the + *current* access technology being active. We allow reporting more + than one for + the cases where several access technologies are given simultaneously + (e.g. + cdma1x + evdo + lte). For example, we shouldn't be giving 4 different + technologies like "umts, hsdpa, hsupa, hspa" when the modem reports + "3G-HSDPA-HSUPA". Just giving HSPA in that case is enough and more + accurate. + + plugins/icera/mm-broadband-modem-icera.c | 40 + ++++++++++++++++---------------- + 1 file changed, 20 insertions(+), 20 deletions(-) + +commit e2f3034f6e2c79062c095be0bc4278907b32ec8f +Author: Ben Chan +Date: Mon Oct 15 23:48:18 2012 -0700 + + icera: improve parsing of access technologies in %NWSTATE response + + plugins/icera/mm-broadband-modem-icera.c | 40 + ++++++++++++++++---------------- + 1 file changed, 20 insertions(+), 20 deletions(-) + +commit e39b3a42edae4806f195824ce01251d625df0028 +Author: Aleksander Morgado +Date: Mon Oct 15 13:35:30 2012 +0200 + + TODO: remove tasks which were already done + + TODO | 17 ----------------- + 1 file changed, 17 deletions(-) + +commit ae26762d110855ab1294c6afad1dc153dd3532c7 +Author: Aleksander Morgado +Date: Mon Oct 15 13:35:15 2012 +0200 + + cli: avoid segfault when revision info is not given + + cli/mmcli-modem.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 4f55511680c04c89f8288cdf07fc7ad2c5c5b096 +Author: Aleksander Morgado +Date: Mon Oct 15 13:34:51 2012 +0200 + + pantech: wait up to 5s after SIM unlock before sending new commands + + Or the modem will get stuck completely. + + plugins/pantech/mm-broadband-modem-pantech.c | 39 + ++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 5c8ef351bb191e3735efcc9ac65df5a844afedb7 +Author: Aleksander Morgado +Date: Mon Oct 15 13:34:16 2012 +0200 + + pantech: create a Pantech-specific SIM object + + We'll just skip most SIM info retrieval commands based on AT+CRSM, + as they seem + to be unsupported. + + plugins/Makefile.am | 6 +- + plugins/pantech/mm-broadband-modem-pantech.c | 92 + ++++++++++++++++++++++++++++ + plugins/pantech/mm-broadband-modem-pantech.h | 47 ++++++++++++++ + plugins/pantech/mm-plugin-pantech.c | 12 ++-- + plugins/pantech/mm-sim-pantech.c | 86 + ++++++++++++++++++++++++++ + plugins/pantech/mm-sim-pantech.h | 51 +++++++++++++++ + 6 files changed, 287 insertions(+), 7 deletions(-) + +commit e6930921af46a7ccbe05c7973ae3bdc4043d1d20 +Author: Aleksander Morgado +Date: Mon Oct 15 12:41:22 2012 +0200 + + broadband-modem-qmi: map 'any' to all supported bands when setting + current bands + + src/mm-broadband-modem-qmi.c | 46 + +++++++++++++++++++++++++++++++++++++------- + src/mm-modem-helpers-qmi.c | 5 ----- + 2 files changed, 39 insertions(+), 12 deletions(-) + +commit b0eca9c09c167f3467acd20493b68224dc1ef04c +Author: Aleksander Morgado +Date: Mon Oct 15 12:19:45 2012 +0200 + + modem-helpers-qmi: add missing GSM primary 900 and WCDMA PCS 1900 + band mappings + + src/mm-modem-helpers-qmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 3025893c942f747172647fb1c0fa6c6bb151a7c3 +Author: Aleksander Morgado +Date: Mon Oct 15 11:46:02 2012 +0200 + + broadband-modem-qmi: set current bands using NAS System Selection + Preference + + src/mm-broadband-modem-qmi.c | 86 + ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 84 insertions(+), 2 deletions(-) + +commit d64b016231aa5ea147b0fee813ea0d2507fdb1f3 +Author: Aleksander Morgado +Date: Mon Oct 15 11:45:50 2012 +0200 + + modem-helpers-qmi: new helper to load NAS band preferences from + bands array + + src/mm-modem-helpers-qmi.c | 53 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.h | 3 +++ + 2 files changed, 56 insertions(+) + +commit c2d4dc3951d8d7483753c6d2733323483ab6c706 +Author: Aleksander Morgado +Date: Mon Oct 15 11:20:58 2012 +0200 + + broadband-modem-qmi: load current bands using NAS System Selection + Preference + + src/mm-broadband-modem-qmi.c | 90 + +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 84 insertions(+), 6 deletions(-) + +commit 3a7d2dcf7d12ea73c8bfd8d42e84db5c3c09ad90 +Author: Aleksander Morgado +Date: Mon Oct 15 11:20:29 2012 +0200 + + modem-helpers-qmi: new helper to load bands array from NAS band + preferences + + src/mm-modem-helpers-qmi.c | 208 + +++++++++++++++++++++++++++++++++++++++++---- + src/mm-modem-helpers-qmi.h | 3 + + 2 files changed, 193 insertions(+), 18 deletions(-) + +commit 529b031a017940e7176e1d4ca154a888f7579a18 +Author: David Härdeman +Date: Fri Oct 12 21:38:26 2012 +0200 + + Add udev rules for HP (Ericsson) hs2350 Mobile Broadband Module + + This WWAN module came installed in my new HP EliteBook 8570p Laptop. + The patch is generated against the master branch but the same udev + rule should be useful in the 0.5 and 0.6 branches as well. + + Signed-off-by: David Härdeman + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit e2c68681ce74c32d21f73f1a354f2060d067a841 +Author: Aleksander Morgado +Date: Thu Oct 11 12:23:16 2012 +0200 + + iface-modem: plug memleak + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a850644cd8520aa0a515231d1a1bfc6fd0c8ffc1 +Author: Aleksander Morgado +Date: Thu Oct 11 11:47:53 2012 +0200 + + iface-modem-simple: plug memleaks + + src/mm-iface-modem-simple.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit c16bcdf68c0d1e2d027a5a44b7e3b4bf29d4aee3 +Author: Aleksander Morgado +Date: Thu Oct 11 11:41:15 2012 +0200 + + core: make sure objects retrieved with g_object_get() are valid in + the ifaces + + The interfaces usually retrieve objects (e.g. skeletons) from the + Modem object + using g_object_get(), but we didn't make sure that these objects + were actually + valid before using them. + + This should clean up errors happening when the modem gets unplugged + and still + some actions are ongoing. + + Should fix https://bugzilla.gnome.org/show_bug.cgi?id=685933 + + src/mm-iface-modem-3gpp-ussd.c | 145 ++++++------- + src/mm-iface-modem-3gpp.c | 173 ++++++++-------- + src/mm-iface-modem-cdma.c | 154 ++++++-------- + src/mm-iface-modem-firmware.c | 46 ++-- + src/mm-iface-modem-location.c | 169 +++++++-------- + src/mm-iface-modem-messaging.c | 244 +++++++++++----------- + src/mm-iface-modem-simple.c | 23 +- + src/mm-iface-modem-time.c | 158 ++++++-------- + src/mm-iface-modem.c | 461 + +++++++++++++++++++++-------------------- + 9 files changed, 747 insertions(+), 826 deletions(-) + +commit 224b73709956818e3091b68be1966beffbc3ba1b +Author: Aleksander Morgado +Date: Thu Oct 11 09:25:52 2012 +0200 + + broadband-modem-qmi: don't check PIN lock in CDMA-only modems + + src/mm-broadband-modem-qmi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 014d0688ff2eebd5ef821ef74e20ba704b52634d +Author: Aleksander Morgado +Date: Thu Oct 11 09:23:49 2012 +0200 + + core,qmi: don't assume QMI port is always available + + When the modem gets unplugged all ports disappear from the modem, + so don't + assume the port is always given. + + E.g. if the unplug happens in the middle of the initialization + sequence we may + end up with nasty segfaults: + + Crash reason: SIGSEGV + Crash address: 0x0 + + Thread 0 (crashed) + 0 ModemManager!mm_qmi_port_peek_client [mm-qmi-port.c : 50 + + 0x0] + rbx = 0x00007fbb5c1d8010 r12 = 0x0000000000000003 + r13 = 0x00007fbb5c1f9880 r14 = 0x00007fbb59a30980 + r15 = 0x00007fbb5c187a60 rip = 0x00007fbb5a1a54c0 + rsp = 0x00007fffc6c0f628 rbp = 0x00007fffc6c0f650 + Found by: given as instruction pointer in context + 1 ModemManager!peek_qmi_client [mm-broadband-modem-qmi.c : + 109 + 0x24] + rbx = 0x00007fbb5c1d8010 r12 = 0x0000000000000003 + r13 = 0x00007fbb5c1f9880 r14 = 0x00007fbb59a30980 + r15 = 0x00007fbb5c187a60 rip = 0x00007fbb5a193851 + rsp = 0x00007fffc6c0f630 rbp = 0x00007fffc6c0f650 + Found by: call frame info + 2 ModemManager!ensure_qmi_client [mm-broadband-modem-qmi.c : + 132 + 0x4] + rbx = 0x00007fbb5c1d8010 r12 = 0x00007fbb5a165140 + r13 = 0x00007fbb5c1f9880 r14 = 0x00007fbb59a30980 + r15 = 0x00007fbb5c187a60 rip = 0x00007fbb5a1938e4 + rsp = 0x00007fffc6c0f650 rbp = 0x00007fffc6c0f690 + Found by: call frame info + ... + + Reported by: Ben Chan + + src/mm-broadband-modem-qmi.c | 45 + +++++++++++++++++++++++++++++++++++--------- + src/mm-sim-qmi.c | 26 +++++++++++++++++++------ + src/mm-sms-qmi.c | 26 +++++++++++++++++++------ + 3 files changed, 76 insertions(+), 21 deletions(-) + +commit ba64c49f3689f6fbc4dd740a39941b691768b04a +Author: Aleksander Morgado +Date: Wed Oct 10 17:06:59 2012 +0200 + + bearer-qmi: update timeout when starting network to 45s + + It really may get worse than 10s, specially if the modem changes + access + technologies after getting registered. + + src/mm-bearer-qmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e2a36bd6bec59f361b528ff861835e5bd2e6e39e +Author: Aleksander Morgado +Date: Wed Oct 10 16:55:24 2012 +0200 + + libmm-glib: allow 'none' authentication with more values + + Specifying 'none' is really not exclusive. We may want to say that + the modem can + either authenticate with a given protocol, or otherwise just try + without + authentication. + + The reality is that 'none' itself is usually always given in the + connection + settings. + + libmm-glib/mm-common-helpers.c | 10 ---------- + src/mm-modem-helpers-qmi.c | 2 +- + 2 files changed, 1 insertion(+), 11 deletions(-) + +commit 255ac4364dac4260e20ee7cbbe2d4b97cc8cc350 +Author: Aleksander Morgado +Date: Wed Oct 10 16:35:11 2012 +0200 + + bearer-qmi: fix authentication logic + + src/mm-bearer-qmi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit c668972d9e568e7ea7902591c0b457498979fe42 +Author: Aleksander Morgado +Date: Wed Oct 10 15:57:35 2012 +0200 + + build: add missing includes in polkit auth provider + + src/mm-auth-provider-polkit.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit fa76ca95a7433993c84bd3eb81ce15bbca2274ae +Author: Aleksander Morgado +Date: Fri Oct 5 13:20:14 2012 +0200 + + via: new 'Via CBP7' plugin + + This is the port to git master of the following commit: + + commit ff8c60641aa2ea41080c15f81f633b3f78e07bf8 + Author: Dan Williams + Date: Mon Sep 10 17:12:38 2012 -0500 + + via: new plugin for CBP7-based CDMA and EVDO devices (bgo #683525) + + The Via baseband is used in a number of CDMA/EVDO devices, from + ChinaTelecom USB sticks, to the Fusion Wireless/UBlox 2770p, to + various Motorola Android phones. + + plugins/Makefile.am | 12 +- + plugins/via/mm-broadband-modem-via.c | 583 + +++++++++++++++++++++++++++++++++++ + plugins/via/mm-broadband-modem-via.h | 49 +++ + plugins/via/mm-plugin-via.c | 83 +++++ + plugins/via/mm-plugin-via.h | 46 +++ + 5 files changed, 772 insertions(+), 1 deletion(-) + +commit df330dd7294611cf3f1d90879b996a4f4bb08873 +Author: Aleksander Morgado +Date: Tue Oct 9 16:41:35 2012 +0200 + + broadband-modem-qmi: don't require a PDS client to disable 3GPP + location + + src/mm-broadband-modem-qmi.c | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +commit 88d80935d6c5930fe0657da8383487a23c4705ab +Author: Aleksander Morgado +Date: Tue Oct 9 16:30:09 2012 +0200 + + core: second request to terminate does a hard exit() + + src/main.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit caefbcfbd901d875f256adc61b12532f8f7777d3 +Author: Aleksander Morgado +Date: Tue Oct 9 16:29:37 2012 +0200 + + base-modem: new fallback when matching QMI vs data ports + + If no matching found, but there is only one QMI port and only one + data port, + assume that is already a valid match. + + src/mm-base-modem.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +commit f1bcc531a353287d8f2b213b3bb8c33ceb13b724 +Author: Aleksander Morgado +Date: Tue Oct 9 16:28:46 2012 +0200 + + log: enable QMI traces when showing debug logs + + Use the new `qmi_utils_set_traces_enabled()' to specify that we want + QMI traces + when running with DEBUG logs. + + Sync with libqmi: + + commit 35dcb4bb6ed2755d968cf97d69faff9ed5f6871f + Author: Aleksander Morgado + Date: Tue Oct 9 13:44:16 2012 +0200 + + libqmi-glib: message traces compiled always + + Message traces have been very useful when debugging issues in + the protocol, and + we should avoid requiring a full recompilation in order to get + them enabled. + + Instead, we provide two new API methods, + `qmi_utils_(get|set)_traces_enabled()', + which allow specifying whether traces should be dumped with + g_debug() or not. + + src/mm-log.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 927889edbec5fc68f457303cf62c563d546d0f1b +Author: Aleksander Morgado +Date: Tue Oct 9 15:54:48 2012 +0200 + + bearer-qmi: use user-specified allowed authentication methods + + If none of the specified methods is supported, an error is returned. + + src/mm-bearer-qmi.c | 40 +++++++++++++++++++++++++++++++++++----- + src/mm-modem-helpers-qmi.c | 16 ++++++++++++++++ + src/mm-modem-helpers-qmi.h | 4 ++++ + 3 files changed, 55 insertions(+), 5 deletions(-) + +commit 316b9fa001edee37a17d831708839016aed93e80 +Author: Aleksander Morgado +Date: Mon Oct 8 14:09:35 2012 +0200 + + libmm-glib,build: remove unneeded rule + + libmm-glib/Makefile.am | 4 ---- + 1 file changed, 4 deletions(-) + +commit 08eb8c22e8634b52dd3d958556abed721eacc760 +Author: Aleksander Morgado +Date: Mon Oct 8 12:26:53 2012 +0200 + + base-modem: cleanly close the QMI port to get the CIDs released + + If we end up allocating too many CIDs without releasing them new + allocations + will fail with client-ids-exhausted errors. This usually happens + specially + when debugging/developing as you're all the time Ctrl+C-ing the + daemon without + rebooting the system. + + src/mm-base-modem.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 13fa73f66677062f254f1c5e25eb874047012d96 +Author: Aleksander Morgado +Date: Mon Oct 8 11:41:03 2012 +0200 + + broadband-modem-qmi: process CDMA 1x & EV-DO roaming flags + + src/mm-broadband-modem-qmi.c | 60 + +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 56 insertions(+), 4 deletions(-) + +commit 8d47d31b29ebec367dfbc64782961d7c30a0a83e +Author: Aleksander Morgado +Date: Mon Oct 8 09:53:28 2012 +0200 + + broadband-modem: cancellable may not be given during disable() + + If the modem is currently being disposed, we may not get a proper + GCancellable + when disabling, so try to handle that case in order to avoid + warnings like: + + GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT + (object)' failed + + #0 0x00007ffff7ab1ba0 in g_log () from + /usr/lib64/libglib-2.0.so.0 + #1 0x00007ffff7b99784 in g_object_ref () from + /usr/lib64/libgobject-2.0.so.0 + #2 0x0000000000456c05 in disable (self=0x50d3f0, cancellable=0x0, + callback=, user_data=) at + mm-broadband-modem.c:7052 + #3 0x0000000000431e69 in handle_enable_auth_ready (self=0x50d3f0, + res=, ctx=0xa41200) at mm-iface-modem.c:1216 + #4 0x00007ffff7e7f447 in g_simple_async_result_complete () from + /usr/lib64/libgio-2.0.so.0 + #5 0x0000000000427bc1 in authorize_ready (authp=, res=, simple=0x51d810) at + mm-base-modem.c:1015 + #6 0x00007ffff7e7f447 in g_simple_async_result_complete () from + /usr/lib64/libgio-2.0.so.0 + #7 0x00007ffff7e7f549 in ?? () from /usr/lib64/libgio-2.0.so.0 + #8 0x00007ffff7aaa5c3 in g_main_context_dispatch () from + /usr/lib64/libglib-2.0.so.0 + #9 0x00007ffff7aaa940 in ?? () from /usr/lib64/libglib-2.0.so.0 + #10 0x00007ffff7aaad7a in g_main_loop_run () from + /usr/lib64/libglib-2.0.so.0 + #11 0x0000000000417ef2 in main (argc=, + argv=) at main.c:150 + + GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT + (object)' failed + + #0 0x00007ffff7ab1ba0 in g_log () from + /usr/lib64/libglib-2.0.so.0 + #1 0x000000000044af26 in disabling_context_complete_and_free + (ctx=0xa408a0) at mm-broadband-modem.c:6788 + #2 0x0000000000431e69 in handle_enable_auth_ready (self=0x50d3f0, + res=, ctx=0xa41200) at mm-iface-modem.c:1216 + #3 0x00007ffff7e7f447 in g_simple_async_result_complete () from + /usr/lib64/libgio-2.0.so.0 + #4 0x0000000000427bc1 in authorize_ready (authp=, res=, simple=0x51d810) at + mm-base-modem.c:1015 + #5 0x00007ffff7e7f447 in g_simple_async_result_complete () from + /usr/lib64/libgio-2.0.so.0 + #6 0x00007ffff7e7f549 in ?? () from /usr/lib64/libgio-2.0.so.0 + #7 0x00007ffff7aaa5c3 in g_main_context_dispatch () from + /usr/lib64/libglib-2.0.so.0 + #8 0x00007ffff7aaa940 in ?? () from /usr/lib64/libglib-2.0.so.0 + #9 0x00007ffff7aaad7a in g_main_loop_run () from + /usr/lib64/libglib-2.0.so.0 + #10 0x0000000000417ef2 in main (argc=, + argv=) at main.c:150 + + Reported by: Ben Chan + + Partially fixes: https://bugzilla.gnome.org/show_bug.cgi?id=684693 + + src/mm-broadband-modem.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +commit 41cc66f33adc81d19246dfb8c3beeed3aff6a1e3 +Author: Aleksander Morgado +Date: Mon Oct 8 09:41:58 2012 +0200 + + core: log successful shutdown + + src/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit c9d22a655ad58724d0e8916e63ec2c0631d8331d +Author: Aleksander Morgado +Date: Mon Oct 8 09:38:46 2012 +0200 + + core: don't wait forever to get all modems disabled and removed + + Just in case, put a maximum time to wait for all modems to get + disabled and + removed, as we don't want to wait forever. + + src/main.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +commit 7f216537866b77b749df2c03e040e12690b8d497 +Author: Aleksander Morgado +Date: Mon Oct 8 08:59:25 2012 +0200 + + broadband-modem: skeletons may already be disposed when disabling + the modem + + Fixes https://bugzilla.gnome.org/show_bug.cgi?id=684694 + + Reported by: Ben Chan + + src/mm-broadband-modem.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 8ddee24cc9b1a11eadd895bd928660fc7b8f0b6a +Author: Aleksander Morgado +Date: Sun Oct 7 20:52:16 2012 +0200 + + hso: use user-specified allowed authentication methods + + If none of the specified methods is supported, an error is returned. + + Also quote user and password using `mm_at_serial_port_quote_string()'. + + plugins/option/mm-broadband-bearer-hso.c | 49 + ++++++++++++++++++++++++++++---- + 1 file changed, 43 insertions(+), 6 deletions(-) + +commit de96243cd4fa588f22c078b838d5f8bb3529baee +Author: Aleksander Morgado +Date: Sun Oct 7 20:47:31 2012 +0200 + + sierra: use user-specified allowed authentication methods + + If none of the specified methods is supported, an error is returned. + + Also quote user and password using `mm_at_serial_port_quote_string()'. + + plugins/sierra/mm-broadband-bearer-sierra.c | 54 + ++++++++++++++++++++++++----- + 1 file changed, 45 insertions(+), 9 deletions(-) + +commit f4790c26bf8b6dd8dbd4a3b0b6ab2e4123524e42 +Author: Aleksander Morgado +Date: Sun Oct 7 20:41:34 2012 +0200 + + icera: use user-specified allowed authentication methods + + If none of the specified methods is supported, an error is returned. + + plugins/icera/mm-broadband-bearer-icera.c | 38 + +++++++++++++++++++++++++++---- + 1 file changed, 33 insertions(+), 5 deletions(-) + +commit ebd792d2aaa0917a6628eb1f9c1fbeedafbf2617 +Author: Aleksander Morgado +Date: Sun Oct 7 20:19:13 2012 +0200 + + api,libmm-glib: new `allowed-auth' configuration for bearers + + For bearers using STATIC or DHCP IP method, the modem itself is + the one + negotiating authentication with the network. The new `allowed-auth' + property + allows users to specify which authentication method(s) are allowed + to be used. + + See the following NetworkManager commit for more reference: + commit 34aef8aaaa09b7473b9496aa49e550bd2def03f8 + Author: Andrew Bird + Date: Thu Mar 15 16:19:43 2012 -0500 + + docs/reference/api/ModemManager-sections.txt | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 12 ++++- + include/ModemManager-enums.h | 23 ++++++++ + .../org.freedesktop.ModemManager1.Modem.Simple.xml | 7 +++ + .../org.freedesktop.ModemManager1.Modem.xml | 2 + + libmm-glib/mm-bearer-properties.c | 61 + +++++++++++++++++++++- + libmm-glib/mm-bearer-properties.h | 3 ++ + libmm-glib/mm-common-helpers.c | 60 + +++++++++++++++++++++ + libmm-glib/mm-common-helpers.h | 30 ++++++----- + libmm-glib/mm-simple-connect-properties.c | 34 ++++++++++++ + libmm-glib/mm-simple-connect-properties.h | 31 ++++++----- + 11 files changed, 233 insertions(+), 31 deletions(-) + +commit 7ae18eecdd3c0aae851441d970b3a54319dd3404 +Author: Dan Williams +Date: Sat Oct 6 12:17:38 2012 -0500 + + vl600: add supported AT commands for V8 firmware + + vl600/vl600.txt | 334 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 334 insertions(+) + +commit 2a96592f697e1a1267f3348e0ffdfdb58f9d6167 +Author: Aleksander Morgado +Date: Fri Oct 5 14:40:28 2012 +0200 + + cli: include signal quality information in modem status info + + cli/mmcli-modem.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit 8a23ac8a554c9d37d2b0fe016537ea913832fa6e +Author: Aleksander Morgado +Date: Fri Oct 5 12:59:34 2012 +0200 + + broadband-modem: fall back to +CSQ if +CIND reports no signal + + This is the port to git master of the following commit: + + commit 8bd6903c30e52e65a4afbebf85ba59e6c0fada71 + Author: Dan Williams + Date: Thu Oct 4 09:34:01 2012 -0500 + + gsm: fall back to +CSQ if +CIND reports no signal (bgo #636040) + + Some devices say they support +CIND signal reporting, but either + actually don't, or they report signal for a non-current access + technology that we don't care about. So if +CIND reports zero + signal, fall back to +CSQ. + + src/mm-broadband-modem.c | 46 + +++++++++++++++++++++++++++++++--------------- + 1 file changed, 31 insertions(+), 15 deletions(-) + +commit 0f8f345d79192a329161298ab4742dfdab548b1b +Author: Aleksander Morgado +Date: Fri Oct 5 11:28:19 2012 +0200 + + broadband-modem: export the Firmware interface even if locked + + src/mm-broadband-modem.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f7433502104abe64f63310ddc5599eacb1b535cb +Author: Aleksander Morgado +Date: Fri Oct 5 11:09:53 2012 +0200 + + broadband-modem-qmi: allow 'PRI info' substrings when changing + firmware + + Instead of just the exact 'Build ID' we now also allow specifying + a substring + of the 'PRI info' as ID to select a the new firmware to change to. + + If we get multiple matches of the substring in the existing Firmware + images + the change is cancelled with error. + + src/mm-broadband-modem-qmi.c | 72 + ++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 59 insertions(+), 13 deletions(-) + +commit da8cc53636976b9033b83e3a674869a43b6daf4c +Author: Aleksander Morgado +Date: Fri Oct 5 11:07:41 2012 +0200 + + iface-modem-firmware: fix error reporting on firmware change + + src/mm-iface-modem-firmware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d4b6b8dd8c7bf654eaebb83d6cf08f676eadf57e +Author: Aleksander Morgado +Date: Fri Oct 5 10:10:50 2012 +0200 + + broadband-modem-qmi: implement Firmware switching using QMI + + Soo... we can now switch firmware images directly from ModemManager, + taking care + of completely rebooting the modem directly. + + The new image to select needs to be specified by the 'unique-id' + currently, + which maps to the 'Build ID' reported in QMI for PRI and MODEM images. + + src/mm-broadband-modem-qmi.c | 236 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 236 insertions(+) + +commit 3cf4f3cc1d6713dd251978b1ad497fa506a5ba7d +Author: Aleksander Morgado +Date: Thu Oct 4 15:17:08 2012 +0200 + + broadband-modem-qmi: implement Firmware interface support using QMI + + src/mm-broadband-modem-qmi.c | 437 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 436 insertions(+), 1 deletion(-) + +commit 1ccf89dbb89c3068e30bb7fb395c4fe7b0ee843a +Author: Aleksander Morgado +Date: Thu Oct 4 17:09:27 2012 +0200 + + api,libmm-glib,cli: handle firmware images of type + `MM_FIRMWARE_IMAGE_TYPE_GOBI' + + cli/mmcli-modem-firmware.c | 19 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 + + include/ModemManager-enums.h | 4 +- + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 38 +++- + libmm-glib/mm-firmware-properties.c | 215 + ++++++++++++++++++++- + libmm-glib/mm-firmware-properties.h | 19 ++ + 6 files changed, 294 insertions(+), 11 deletions(-) + +commit 1b83af9482c848ef9f53e9986c1736341f00a8e3 +Author: Aleksander Morgado +Date: Thu Oct 4 13:37:59 2012 +0200 + + broadband-modem: implement the firmware interface + + src/mm-broadband-modem.c | 63 + +++++++++++++++++++++++++++++++++++------------- + 1 file changed, 46 insertions(+), 17 deletions(-) + +commit 67db1b50b4abdbcdf3e0d79f465579a9854afb8e +Author: Aleksander Morgado +Date: Thu Oct 4 13:37:47 2012 +0200 + + iface-modem-firmware: new `MMIfaceModemFirmware' interface + + src/Makefile.am | 2 + + src/mm-iface-modem-firmware.c | 511 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-firmware.h | 86 +++++++ + 3 files changed, 599 insertions(+) + +commit 9e16aeb6bfc097c59e3dfc8932c21353e00f73c1 +Author: Aleksander Morgado +Date: Thu Oct 4 18:35:57 2012 +0200 + + libmm-glib: fix firmware list result parsing + + libmm-glib/mm-modem-firmware.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit a27fd5a47bbb7842712cf228184148b5158dea8b +Author: Aleksander Morgado +Date: Thu Oct 4 18:36:46 2012 +0200 + + api,instrospection: fix firmware list result signature + + introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 15a99ebe55e8cc948295577f3dc0cdfd5616a883 +Author: Aleksander Morgado +Date: Thu Oct 4 17:22:59 2012 +0200 + + cli,firmware: no need to be enabled to run actions + + cli/mmcli-modem-firmware.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 0d00ee28be0e82227dd6795ab62669944fb7076f +Author: Aleksander Morgado +Date: Thu Oct 4 16:43:43 2012 +0200 + + api,libmm-glib: use a 'unique-id' as ID of the firmware image, not a + 'name' + + Also, make only the 'unique-id' mandatory. + + cli/mmcli-modem-firmware.c | 14 ++--- + docs/reference/libmm-glib/libmm-glib-sections.txt | 3 +- + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 10 ++-- + libmm-glib/mm-firmware-properties.c | 70 + ++++++---------------- + libmm-glib/mm-firmware-properties.h | 6 +- + libmm-glib/mm-modem-firmware.c | 18 +++--- + libmm-glib/mm-modem-firmware.h | 4 +- + 7 files changed, 43 insertions(+), 82 deletions(-) + +commit d84b4f634eac8e5aca8243824243e8c017c11f13 +Author: Aleksander Morgado +Date: Thu Oct 4 12:10:13 2012 +0200 + + build,data: include missing generation of the policy file + + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +commit 7cd047b75da45c3cfbae930da947e392adada24b +Author: Aleksander Morgado +Date: Thu Oct 4 12:09:53 2012 +0200 + + build,plugins: include missing builddir in CPPFLAGS + + Built files in the ModemManager daemon + (e.g. mm-serial-enums-types.[c|h]) will + be available in ${top_builddir}/src, not in ${top_srcdir}/src. + + plugins/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit ebf7f790a657a5bcb4043aea1a3e25f3faa07a0e +Author: Aleksander Morgado +Date: Thu Oct 4 12:07:55 2012 +0200 + + build,build-aux: include missing `mm-errors-quarks-template.c' + file in dist + + build-aux/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 99cb8cb2e6933241bae5734faf85815b941fd9e9 +Author: Aleksander Morgado +Date: Thu Oct 4 11:36:02 2012 +0200 + + tests: fix sms part tests + + src/tests/test-sms-part.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 82f253b8ca69cdc99f8e72ba9548c7493baed604 +Author: Aleksander Morgado +Date: Thu Oct 4 11:14:09 2012 +0200 + + docs: include the logos in the generated documentation + + docs/reference/api/Makefile.am | 16 +++++++++++++--- + docs/reference/api/ModemManager-docs.xml | 11 ++++++++++- + docs/reference/libmm-glib/Makefile.am | 20 ++++++++++++++++++++ + docs/reference/libmm-glib/libmm-glib-docs.xml | 11 ++++++++++- + 4 files changed, 53 insertions(+), 5 deletions(-) + +commit 86ff6b35c34604184fc5f44527abad8969d5cebd +Author: Aleksander Morgado +Date: Thu Oct 4 11:13:49 2012 +0200 + + data: include ModemManager logo images + + data/Makefile.am | 10 +- + data/ModemManager-logo-square.png | Bin 0 -> 11029 bytes + data/ModemManager-logo-square.svg | 229 + +++++++++++++++++++++++++++++++++ + data/ModemManager-logo-wide-text.png | Bin 0 -> 18072 bytes + data/ModemManager-logo-wide-text.svg | 238 + +++++++++++++++++++++++++++++++++++ + data/ModemManager-logo-wide.png | Bin 0 -> 11017 bytes + data/ModemManager-logo-wide.svg | 217 + ++++++++++++++++++++++++++++++++ + 7 files changed, 693 insertions(+), 1 deletion(-) + +commit 8bdf70e1c2f1768b2729261214c4e2904b3066cb +Author: Aleksander Morgado +Date: Thu Oct 4 10:08:02 2012 +0200 + + docs: include documentation for enum/flags helpers + + build-aux/mm-enums-template.c | 40 ++++++++----- + build-aux/mm-enums-template.h | 10 ++-- + docs/reference/libmm-glib/libmm-glib-docs.xml | 5 ++ + docs/reference/libmm-glib/libmm-glib-sections.txt | 71 + ++++++++++++----------- + docs/reference/libmm-glib/libmm-glib.types | 23 ++++++++ + 5 files changed, 94 insertions(+), 55 deletions(-) + +commit 3228ca10beecb8db0979f25deade78fc2f3f1e29 +Author: Aleksander Morgado +Date: Wed Oct 3 20:44:40 2012 +0200 + + docs: don't rebuild types every time + + .gitignore | 1 - + docs/reference/libmm-glib/libmm-glib.types | 100 + +++++++++++++++++++++++++++++ + 2 files changed, 100 insertions(+), 1 deletion(-) + +commit 2d5000abaeac508a5bec051aa8ff912553c76df5 +Author: Aleksander Morgado +Date: Wed Oct 3 19:48:06 2012 +0200 + + docs: fix `libmm-glib-sections.txt' for the gdbus-codegen generated + stuff + + docs/reference/libmm-glib/libmm-glib-docs.xml | 65 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 1723 + ++++++++++++--------- + 2 files changed, 1072 insertions(+), 716 deletions(-) + +commit 4251030bd8bc08af713c7865027ecdb40a3b3db4 +Author: Aleksander Morgado +Date: Wed Oct 3 18:06:14 2012 +0200 + + api: only allow including `ModemManager.h' directly + + include/ModemManager-enums.h | 4 ++++ + include/ModemManager-errors.h | 4 ++++ + include/ModemManager.h | 2 ++ + libmm-glib/generated/Makefile.am | 6 +++--- + libmm-glib/mm-common-helpers.h | 2 +- + src/mm-broadband-modem.h | 3 ++- + src/mm-error-helpers.h | 4 ++-- + 7 files changed, 18 insertions(+), 7 deletions(-) + +commit 239c56cf7fe42d37257fbcd1f1d0893498c6cd05 +Author: Aleksander Morgado +Date: Wed Oct 3 17:49:03 2012 +0200 + + libmm-glib: don't install the common helpers header + + And make it only available for internal ModemManager compilation. + + docs/reference/libmm-glib/Makefile.am | 1 + + docs/reference/libmm-glib/libmm-glib-sections.txt | 37 + ----------------------- + libmm-glib/Makefile.am | 1 - + libmm-glib/libmm-glib.h | 8 ++++- + libmm-glib/tests/Makefile.am | 3 +- + 5 files changed, 10 insertions(+), 40 deletions(-) + +commit b52bbf7b0b2b7564f725db4eccac505823bade79 +Author: Aleksander Morgado +Date: Wed Oct 3 17:40:25 2012 +0200 + + libmm-glib,sms-properties: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 35 +-- + libmm-glib/mm-sms-properties.c | 285 + +++++++++++++++++----- + libmm-glib/mm-sms-properties.h | 30 ++- + 3 files changed, 265 insertions(+), 85 deletions(-) + +commit 054915299afefc27f0f19d12553960544e1bd624 +Author: Aleksander Morgado +Date: Wed Oct 3 17:20:16 2012 +0200 + + libmm-glib,bearer-ip-config: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 12 +- + libmm-glib/mm-bearer-ip-config.c | 139 + +++++++++++++++------- + libmm-glib/mm-bearer-ip-config.h | 29 ++++- + 3 files changed, 129 insertions(+), 51 deletions(-) + +commit 52f457bb8807f1330bbb177954e7944361a8c8a9 +Author: Aleksander Morgado +Date: Wed Oct 3 17:09:05 2012 +0200 + + libmm-glib,bearer-properties: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 37 ++-- + libmm-glib/mm-bearer-properties.c | 231 + +++++++++++++++++----- + libmm-glib/mm-bearer-properties.h | 58 ++++-- + 3 files changed, 241 insertions(+), 85 deletions(-) + +commit 54c2ee77b018d19098805cd1b7be63a6f4b85ce8 +Author: Aleksander Morgado +Date: Wed Oct 3 16:46:31 2012 +0200 + + libmm-glib,firmware-properties: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 6 ++++-- + libmm-glib/mm-firmware-properties.c | 16 ++++++++++++++++ + libmm-glib/mm-firmware-properties.h | 17 +++++++++++++---- + 3 files changed, 33 insertions(+), 6 deletions(-) + +commit dc4656cead106a4f52a2e53ac329d8606d79c23c +Author: Aleksander Morgado +Date: Wed Oct 3 16:41:12 2012 +0200 + + libmm-glib,network-timezone: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 +-- + libmm-glib/mm-network-timezone.c | 75 + +++++++++++++++++------ + libmm-glib/mm-network-timezone.h | 36 +++++++++-- + 3 files changed, 95 insertions(+), 26 deletions(-) + +commit 487090607d73378cfaa4f0691fbacea55335946e +Author: Aleksander Morgado +Date: Wed Oct 3 16:29:54 2012 +0200 + + libmm-glib,location-gps-raw: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 18 ++++---- + libmm-glib/mm-location-gps-nmea.h | 2 + + libmm-glib/mm-location-gps-raw.c | 51 + +++++++++++++++++++++++ + libmm-glib/mm-location-gps-raw.h | 48 + +++++++++++++++++---- + 4 files changed, 104 insertions(+), 15 deletions(-) + +commit 030daafc4554a20f53d1fee48a588e7907393716 +Author: Aleksander Morgado +Date: Wed Oct 3 16:19:14 2012 +0200 + + libmm-glib,location-gps-nmea: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 10 +++++--- + libmm-glib/mm-location-gps-nmea.c | 30 + +++++++++++++++++++++++ + libmm-glib/mm-location-gps-nmea.h | 23 ++++++++++++++--- + 3 files changed, 55 insertions(+), 8 deletions(-) + +commit 7edc3508c766f64ec21825695ce98730a289429c +Author: Aleksander Morgado +Date: Wed Oct 3 16:18:07 2012 +0200 + + libmm-glib,location-3gpp: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 8 +- + libmm-glib/mm-location-3gpp.c | 98 + +++++++++++++++++------ + libmm-glib/mm-location-3gpp.h | 29 +++++-- + 3 files changed, 102 insertions(+), 33 deletions(-) + +commit f99ac11cbb9acd00c889eb11e58d690196ed929c +Author: Aleksander Morgado +Date: Wed Oct 3 14:35:46 2012 +0200 + + libmm-glib,simple-status: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 28 +++-- + libmm-glib/mm-simple-status.c | 143 + ++++++++++++++++++++-- + libmm-glib/mm-simple-status.h | 52 +++++--- + 3 files changed, 181 insertions(+), 42 deletions(-) + +commit 8185f24e64b28bab4966c97e9fe8cbfcc242ad8d +Author: Aleksander Morgado +Date: Wed Oct 3 14:10:40 2012 +0200 + + libmm-glib,simple-connect-properties: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 43 ++- + libmm-glib/mm-simple-connect-properties.c | 437 + ++++++++++++++++------ + libmm-glib/mm-simple-connect-properties.h | 66 ++-- + 3 files changed, 381 insertions(+), 165 deletions(-) + +commit 4f5dd8afaa79efecc1e7ffa56988d60f6e45c706 +Author: Aleksander Morgado +Date: Wed Oct 3 13:17:12 2012 +0200 + + libmm-glib,unlock-retries: improve documentation + + docs/reference/libmm-glib/libmm-glib-sections.txt | 12 +++--- + libmm-glib/mm-unlock-retries.c | 31 ++++++++++++++ + libmm-glib/mm-unlock-retries.h | 50 + ++++++++++++++++++----- + 3 files changed, 78 insertions(+), 15 deletions(-) + +commit 433fdea6d4107dcbe7848a28aa492c44742a00c2 +Author: Aleksander Morgado +Date: Wed Oct 3 13:01:25 2012 +0200 + + libmm-glib: only allow including `libmm-glib.h' directly + + Unless when compiling libmm-glib itself, of course. + + libmm-glib/Makefile.am | 3 ++- + libmm-glib/libmm-glib.h | 4 +++- + libmm-glib/mm-bearer-ip-config.h | 4 ++++ + libmm-glib/mm-bearer-properties.h | 4 ++++ + libmm-glib/mm-bearer.h | 4 ++++ + libmm-glib/mm-common-helpers.h | 4 ++++ + libmm-glib/mm-firmware-properties.h | 4 ++++ + libmm-glib/mm-location-3gpp.h | 4 ++++ + libmm-glib/mm-location-gps-nmea.h | 4 ++++ + libmm-glib/mm-location-gps-raw.h | 4 ++++ + libmm-glib/mm-manager.h | 4 ++++ + libmm-glib/mm-modem-3gpp-ussd.h | 4 ++++ + libmm-glib/mm-modem-3gpp.h | 4 ++++ + libmm-glib/mm-modem-cdma.h | 4 ++++ + libmm-glib/mm-modem-firmware.h | 4 ++++ + libmm-glib/mm-modem-location.h | 4 ++++ + libmm-glib/mm-modem-messaging.h | 4 ++++ + libmm-glib/mm-modem-simple.h | 4 ++++ + libmm-glib/mm-modem-time.h | 4 ++++ + libmm-glib/mm-modem.h | 4 ++++ + libmm-glib/mm-network-timezone.h | 4 ++++ + libmm-glib/mm-object.h | 4 ++++ + libmm-glib/mm-sim.h | 4 ++++ + libmm-glib/mm-simple-connect-properties.h | 4 ++++ + libmm-glib/mm-simple-status.h | 4 ++++ + libmm-glib/mm-sms-properties.h | 4 ++++ + libmm-glib/mm-sms.h | 4 ++++ + libmm-glib/mm-unlock-retries.h | 4 ++++ + 28 files changed, 109 insertions(+), 2 deletions(-) + +commit c250fa3797b40f70cbac1d9e417b1d3ad946ee89 +Author: Aleksander Morgado +Date: Wed Oct 3 12:46:37 2012 +0200 + + libmm-glib: remove the `libmm-common.h' header + + Both the ModemManager daemon and the mmcli will now include + `libmm-glib.h' only. + + We also handle two new special `_LIBMM_INSIDE_MM' and + `LIBMM_INSIDE_MMCLI' + symbols, which if included before the `libmm-glib.h' library allow + us to: + + * Don't include the libmm-glib high level API in the ModemManager + daemon, as + the object names would clash with those in the core. + + * Define some of the methods of helper objects to be included only + if compiling + ModemManager daemon or the mmcli. + + cli/mmcli-bearer.c | 1 + + cli/mmcli-common.c | 1 + + cli/mmcli-common.h | 2 + + cli/mmcli-manager.c | 1 + + cli/mmcli-modem-3gpp.c | 1 + + cli/mmcli-modem-cdma.c | 1 + + cli/mmcli-modem-firmware.c | 1 + + cli/mmcli-modem-location.c | 1 + + cli/mmcli-modem-messaging.c | 1 + + cli/mmcli-modem-simple.c | 1 + + cli/mmcli-modem-time.c | 1 + + cli/mmcli-modem.c | 1 + + cli/mmcli-sim.c | 1 + + cli/mmcli-sms.c | 1 + + cli/mmcli.c | 1 + + docs/reference/libmm-glib/libmm-glib-docs.xml | 54 + ++++++++++++++++------- + libmm-glib/libmm-common.h | 46 + ------------------- + libmm-glib/libmm-glib.h | 42 +++++++++++++++--- + libmm-glib/mm-bearer.h | 5 ++- + libmm-glib/mm-manager.c | 6 ++- + libmm-glib/mm-manager.h | 3 +- + libmm-glib/mm-modem-3gpp-ussd.c | 1 + + libmm-glib/mm-modem-3gpp-ussd.h | 3 +- + libmm-glib/mm-modem-3gpp.c | 1 + + libmm-glib/mm-modem-3gpp.h | 3 +- + libmm-glib/mm-modem-cdma.c | 1 + + libmm-glib/mm-modem-cdma.h | 3 +- + libmm-glib/mm-modem-firmware.c | 1 + + libmm-glib/mm-modem-firmware.h | 4 +- + libmm-glib/mm-modem-location.c | 1 + + libmm-glib/mm-modem-location.h | 6 ++- + libmm-glib/mm-modem-messaging.c | 2 + + libmm-glib/mm-modem-messaging.h | 2 +- + libmm-glib/mm-modem-simple.c | 1 + + libmm-glib/mm-modem-simple.h | 4 +- + libmm-glib/mm-modem-time.c | 1 + + libmm-glib/mm-modem-time.h | 4 +- + libmm-glib/mm-modem.c | 4 +- + libmm-glib/mm-modem.h | 3 +- + libmm-glib/mm-object.c | 1 + + libmm-glib/mm-object.h | 2 +- + libmm-glib/mm-sim.h | 3 +- + libmm-glib/mm-sms.h | 4 +- + libmm-glib/tests/test-common-helpers.c | 4 +- + plugins/anydata/mm-plugin-anydata.c | 3 +- + plugins/cinterion/mm-plugin-cinterion.c | 3 +- + plugins/generic/mm-plugin-generic.c | 3 +- + plugins/gobi/mm-plugin-gobi.c | 3 +- + plugins/huawei/mm-broadband-modem-huawei.c | 6 ++- + plugins/huawei/mm-plugin-huawei.c | 3 +- + plugins/icera/mm-broadband-bearer-icera.c | 3 +- + plugins/icera/mm-broadband-bearer-icera.h | 3 +- + plugins/iridium/mm-bearer-iridium.c | 3 +- + plugins/iridium/mm-bearer-iridium.h | 3 +- + plugins/iridium/mm-plugin-iridium.c | 3 +- + plugins/iridium/mm-sim-iridium.c | 3 +- + plugins/linktop/mm-broadband-modem-linktop.c | 3 +- + plugins/linktop/mm-plugin-linktop.c | 4 +- + plugins/longcheer/mm-plugin-longcheer.c | 3 +- + plugins/mbm/mm-broadband-bearer-mbm.c | 3 +- + plugins/mbm/mm-broadband-bearer-mbm.h | 3 +- + plugins/mbm/mm-plugin-mbm.c | 3 +- + plugins/motorola/mm-plugin-motorola.c | 3 +- + plugins/nokia/mm-plugin-nokia-icera.c | 3 +- + plugins/nokia/mm-plugin-nokia.c | 3 +- + plugins/nokia/mm-sim-nokia.c | 3 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 3 +- + plugins/novatel/mm-broadband-bearer-novatel-lte.h | 3 +- + plugins/novatel/mm-sim-novatel-lte.c | 3 +- + plugins/option/mm-broadband-bearer-hso.c | 3 +- + plugins/option/mm-broadband-bearer-hso.h | 3 +- + plugins/option/mm-plugin-hso.c | 3 +- + plugins/option/mm-plugin-option.c | 3 +- + plugins/pantech/mm-plugin-pantech.c | 3 +- + plugins/sierra/mm-broadband-bearer-sierra.c | 3 +- + plugins/sierra/mm-broadband-bearer-sierra.h | 3 +- + plugins/sierra/mm-plugin-sierra.c | 3 +- + plugins/sierra/mm-sim-sierra.c | 3 +- + plugins/simtech/mm-broadband-modem-simtech.c | 3 +- + plugins/simtech/mm-plugin-simtech.c | 4 +- + plugins/wavecom/mm-broadband-modem-wavecom.c | 3 +- + plugins/wavecom/mm-plugin-wavecom.c | 3 +- + plugins/x22x/mm-plugin-x22x.c | 3 +- + plugins/zte/mm-plugin-zte.c | 3 +- + src/mm-auth-provider-polkit.c | 2 - + src/mm-bearer-list.c | 3 +- + src/mm-bearer-qmi.c | 4 +- + src/mm-bearer-qmi.h | 3 +- + src/mm-bearer.c | 3 +- + src/mm-bearer.h | 3 +- + src/mm-broadband-bearer.c | 3 +- + src/mm-broadband-bearer.h | 3 +- + src/mm-broadband-modem.c | 3 +- + src/mm-charsets.c | 3 +- + src/mm-device.c | 3 +- + src/mm-iface-modem-3gpp-ussd.c | 3 +- + src/mm-iface-modem-3gpp-ussd.h | 3 +- + src/mm-iface-modem-3gpp.c | 3 +- + src/mm-iface-modem-3gpp.h | 4 +- + src/mm-iface-modem-cdma.c | 3 +- + src/mm-iface-modem-cdma.h | 3 +- + src/mm-iface-modem-location.c | 3 +- + src/mm-iface-modem-messaging.c | 3 +- + src/mm-iface-modem-simple.c | 3 +- + src/mm-iface-modem-time.c | 3 +- + src/mm-iface-modem.c | 3 +- + src/mm-iface-modem.h | 3 +- + src/mm-modem-helpers.c | 3 +- + src/mm-sim-qmi.c | 3 +- + src/mm-sim.c | 3 +- + src/mm-sms-list.c | 3 +- + src/mm-sms-part.c | 4 +- + src/mm-sms-qmi.c | 3 +- + src/mm-sms-qmi.h | 3 +- + src/mm-sms.c | 3 +- + src/mm-sms.h | 3 +- + src/tests/test-sms-part.c | 3 +- + 117 files changed, 292 insertions(+), 165 deletions(-) + +commit 8bdcdeecb68036bb6be39c5896342f1f1905b606 +Author: Aleksander Morgado +Date: Tue Oct 2 17:47:30 2012 +0200 + + libmm-glib,manager: minor indentation fixes + + libmm-glib/mm-manager.c | 49 + +++++++++++++++++++++++++------------------------ + 1 file changed, 25 insertions(+), 24 deletions(-) + +commit b6d628b3a10bf183b918c7afe89a5b260eb87760 +Author: Aleksander Morgado +Date: Tue Oct 2 15:08:46 2012 +0200 + + build: merge libmm-common into libmm-glib + + It's pointless to have libmm-common around, just merge it into + libmm-glib and + make ModemManager depend on libmm-glib directly. At the end, + the non-common + stuff in libmm-glib is really minimal. + + .gitignore | 14 +- + Makefile.am | 2 +- + cli/Makefile.am | 7 +- + configure.ac | 16 +- + data/Makefile.am | 1 - + data/mm-common.pc.in | 11 - + data/mm-glib.pc.in | 4 +- + docs/reference/api/Makefile.am | 28 +- + docs/reference/api/ModemManager-dbus-reference.xml | 28 +- + docs/reference/libmm-glib/Makefile.am | 6 +- + docs/reference/libmm-glib/libmm-glib-docs.xml | 82 +- + docs/reference/libmm-glib/libmm-glib-sections.txt | 1500 + +++++++++++++++++++- + libmm-glib/Makefile.am | 63 +- + {libmm-common => libmm-glib/generated}/Makefile.am | 135 +- + {libmm-common => libmm-glib}/libmm-common.h | 0 + {libmm-common => libmm-glib}/mm-bearer-ip-config.c | 0 + {libmm-common => libmm-glib}/mm-bearer-ip-config.h | 0 + .../mm-bearer-properties.c | 0 + .../mm-bearer-properties.h | 0 + {libmm-common => libmm-glib}/mm-common-helpers.c | 0 + {libmm-common => libmm-glib}/mm-common-helpers.h | 0 + .../mm-firmware-properties.c | 0 + .../mm-firmware-properties.h | 0 + {libmm-common => libmm-glib}/mm-location-3gpp.c | 0 + {libmm-common => libmm-glib}/mm-location-3gpp.h | 0 + .../mm-location-gps-nmea.c | 2 + + .../mm-location-gps-nmea.h | 0 + {libmm-common => libmm-glib}/mm-location-gps-raw.c | 2 + + {libmm-common => libmm-glib}/mm-location-gps-raw.h | 0 + {libmm-common => libmm-glib}/mm-network-timezone.c | 0 + {libmm-common => libmm-glib}/mm-network-timezone.h | 0 + .../mm-simple-connect-properties.c | 0 + .../mm-simple-connect-properties.h | 0 + {libmm-common => libmm-glib}/mm-simple-status.c | 0 + {libmm-common => libmm-glib}/mm-simple-status.h | 0 + {libmm-common => libmm-glib}/mm-sms-properties.c | 0 + {libmm-common => libmm-glib}/mm-sms-properties.h | 0 + {libmm-common => libmm-glib}/mm-unlock-retries.c | 0 + {libmm-common => libmm-glib}/mm-unlock-retries.h | 0 + {libmm-common => libmm-glib}/tests/Makefile.am | 8 +- + .../tests/test-common-helpers.c | 0 + plugins/Makefile.am | 5 +- + src/Makefile.am | 18 +- + src/tests/Makefile.am | 27 +- + 44 files changed, 1736 insertions(+), 223 deletions(-) + +commit 624fdb6ab4544a82774e9805332cc242c1068b0f +Author: Aleksander Morgado +Date: Tue Oct 2 14:41:39 2012 +0200 + + docs,libmm-glib: properly order the sections + + docs/reference/libmm-glib/libmm-glib-sections.txt | 541 + ++++++++++++++++++++++ + 1 file changed, 541 insertions(+) + +commit c07a3832dd87e1501420a4f902d8c3b0f57e24d6 +Author: Aleksander Morgado +Date: Tue Oct 2 12:55:35 2012 +0200 + + cli: new `--firmware-list' and `--firmware-select' actions + + cli/Makefile.am | 1 + + cli/mmcli-modem-firmware.c | 322 + +++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 4 files changed, 342 insertions(+) + +commit 715a7759491b3c7c716ffbf768a2ece222b23fb1 +Author: Aleksander Morgado +Date: Tue Oct 2 11:37:01 2012 +0200 + + libmm-glib,firmware: new `MMModemFirmware' type to handle the + Firmware interface + + docs/reference/libmm-glib/libmm-glib-docs.xml | 1 + + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-firmware.c | 377 + ++++++++++++++++++++++++++ + libmm-glib/mm-modem-firmware.h | 93 +++++++ + libmm-glib/mm-object.c | 36 +++ + libmm-glib/mm-object.h | 3 + + 7 files changed, 514 insertions(+), 1 deletion(-) + +commit a795772e3ddb26a0e8c07e959e68c05f61f29728 +Author: Aleksander Morgado +Date: Tue Oct 2 09:34:33 2012 +0200 + + libmm-common: new `MMFirmwareProperties' to handle firmare image + properties + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-firmware-properties.c | 300 + ++++++++++++++++++++++++++++++++++ + libmm-common/mm-firmware-properties.h | 68 ++++++++ + 4 files changed, 373 insertions(+) + +commit f198bc4eb054223d27ce96829d3437b87a61f3cb +Author: Aleksander Morgado +Date: Tue Oct 2 11:35:23 2012 +0200 + + api,introspection: simplify the Firmware interface + + The Firmware interface was highly based on 'slots' to identify + the existing + firmware images; but that doesn't fit very well with the initial + implementation + of the Firmware interface in QMI-based modems. In these modems the + 'storage + index' is a property which is not available in all types of images + (e.g. 'PRI' + images don't have it). + + Therefore, instead of using a unique 'slot' identifier we'll just + use the + 'name' of the firmware as unique ID. + + Also, currently skip the handling of 'available' images, and the + method to + 'Install()' new images, at least until we have one implementation + defining what + to do with those. + + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 34 + ++++++++++------------ + 1 file changed, 15 insertions(+), 19 deletions(-) + +commit dda274437c0b688b33027adac9c2496b5511d76d +Author: Aleksander Morgado +Date: Tue Oct 2 09:22:45 2012 +0200 + + api,introspection: firmware images require a new `image-type' property + + Image types of `MM_FIRMWARE_IMAGE_TYPE_GENERIC' will expose only + the mandatory + parameters. Other vendor-specific images may expose other properties. + + docs/reference/api/ModemManager-sections.txt | 1 + + include/ModemManager-enums.h | 12 + ++++++++++++ + .../org.freedesktop.ModemManager1.Modem.Firmware.xml | + 11 ++++++++++- + 3 files changed, 23 insertions(+), 1 deletion(-) + +commit d148eb6c7db59ea2f960d56876fc97a6a36ea78f +Author: Aleksander Morgado +Date: Tue Oct 2 14:06:17 2012 +0200 + + libmm-glib,sms: `MMSms' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusSms'. + + libmm-glib/mm-modem-messaging.c | 100 ++++++---- + libmm-glib/mm-sms.c | 412 + ++++++++++++++++++++++++---------------- + libmm-glib/mm-sms.h | 108 +++++++---- + 3 files changed, 375 insertions(+), 245 deletions(-) + +commit ba075e48f4c4470022f0eec28918e14b499dd681 +Author: Aleksander Morgado +Date: Tue Oct 2 13:24:05 2012 +0200 + + libmm-glib,sim: `MMSim' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusSim'. + + libmm-glib/mm-modem.c | 48 ++++--- + libmm-glib/mm-sim.c | 355 + +++++++++++++++++++++++++++++--------------------- + libmm-glib/mm-sim.h | 50 +++++-- + 3 files changed, 275 insertions(+), 178 deletions(-) + +commit 41ece5a021cc2b3f53db465a06d60267bada3c5e +Author: Aleksander Morgado +Date: Tue Oct 2 12:29:44 2012 +0200 + + libmm-glib,bearer: `MMBearer' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusBearer'. + + libmm-glib/mm-bearer.c | 545 + ++++++++++++++++++++++++++++++++++++------- + libmm-glib/mm-bearer.h | 51 +++- + libmm-glib/mm-modem-simple.c | 49 ++-- + libmm-glib/mm-modem.c | 118 +++++----- + 4 files changed, 596 insertions(+), 167 deletions(-) + +commit 730f69a6d49e8785ea8051692e025f61dad8d7ef +Author: Aleksander Morgado +Date: Mon Oct 1 23:44:35 2012 +0200 + + libmm-glib,time: `MMModemTime' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusModemTime'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-time.c | 223 + +++++++++++++++++++++++++++++++++++++++++---- + libmm-glib/mm-modem-time.h | 37 +++++++- + 3 files changed, 238 insertions(+), 24 deletions(-) + +commit 653582ce1786119017e5814fb081620246faff34 +Author: Aleksander Morgado +Date: Mon Oct 1 22:41:07 2012 +0200 + + libmm-glib,simple: `MMModemSimple' is now a real object + + Not just a typedef of the gdbus-codegen generated + `MmGdbusModemSimple'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-simple.c | 215 + ++++++++++++++++++++++++++++++++++++------- + libmm-glib/mm-modem-simple.h | 39 ++++++-- + 3 files changed, 215 insertions(+), 41 deletions(-) + +commit 6ac9460543300ae66d3429031dabeaae2053a68a +Author: Aleksander Morgado +Date: Mon Oct 1 21:34:58 2012 +0200 + + libmm-glib,messaging: `MMModemMessaging' is now a real object + + Not just a typedef of the gdbus-codegen generated + `MmGdbusModemMessaging'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-messaging.c | 257 + +++++++++++++++++++++++++++++++--------- + libmm-glib/mm-modem-messaging.h | 48 ++++++-- + 3 files changed, 244 insertions(+), 63 deletions(-) + +commit 45172e39b4b902e4c68bd810fccf3cafa5283477 +Author: Aleksander Morgado +Date: Mon Oct 1 19:41:02 2012 +0200 + + libmm-glib,location: `MMModemLocation' is now a real object + + Not just a typedef of the gdbus-codegen generated + `MmGdbusModemLocation'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-location.c | 311 + ++++++++++++++++++++++++++++++++++++++--- + libmm-glib/mm-modem-location.h | 34 ++++- + 3 files changed, 321 insertions(+), 26 deletions(-) + +commit 2d6bca4b8bcc67225ca8b77e37813c458b8b8075 +Author: Aleksander Morgado +Date: Mon Oct 1 18:43:07 2012 +0200 + + libmm-glib,cdma: `MMModemCdma' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusModemCdma'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-cdma.c | 175 + ++++++++++++++++++++++++++++++++------------- + libmm-glib/mm-modem-cdma.h | 52 ++++++++++++-- + 3 files changed, 173 insertions(+), 56 deletions(-) + +commit 9a722de6bb187b99ceb2e490feb625d5b01120c8 +Author: Aleksander Morgado +Date: Mon Oct 1 18:13:41 2012 +0200 + + libmm-glib,3gpp-ussd: `MMModem3gppUssd' is now a real object + + Not just a typedef of the gdbus-codegen generated + `MmGdbusModem3gppUssd'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-3gpp-ussd.c | 321 + +++++++++++++++++++++++++++++----------- + libmm-glib/mm-modem-3gpp-ussd.h | 34 ++++- + 3 files changed, 265 insertions(+), 92 deletions(-) + +commit f5be23757d247b6f09d3009643c199165bd8d32c +Author: Aleksander Morgado +Date: Mon Oct 1 17:35:54 2012 +0200 + + libmm-glib,3gpp: `MMModem3gpp' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusModem3gpp'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem-3gpp.c | 300 + ++++++++++++++++++++++++++++++++++----------- + libmm-glib/mm-modem-3gpp.h | 47 ++++++- + 3 files changed, 271 insertions(+), 78 deletions(-) + +commit 8ae0c36ab99ee82ed2b60e19949f08e9f02cd9b9 +Author: Aleksander Morgado +Date: Mon Oct 1 13:42:45 2012 +0200 + + libmm-glib,modem: `MMModem' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusModem'. + + libmm-glib/mm-manager.c | 2 +- + libmm-glib/mm-modem.c | 1333 + +++++++++++++++++++++++++++++++++++------------ + libmm-glib/mm-modem.h | 108 +++- + 3 files changed, 1070 insertions(+), 373 deletions(-) + +commit d07a138d37ed1267f43a950d47a45a0698d879b6 +Author: Aleksander Morgado +Date: Mon Oct 1 11:25:56 2012 +0200 + + libmm-glib,object: `MMObject' is now a real object + + Not just a typedef of the gdbus-codegen generated `MmGdbusObject'. + + libmm-glib/mm-manager.c | 3 +- + libmm-glib/mm-object.c | 314 + +++++++++++++++++++++++++++++------------------- + libmm-glib/mm-object.h | 64 +++++++--- + 3 files changed, 238 insertions(+), 143 deletions(-) + +commit 2f16ef2278a8e6cb991af3cf0c196b914a6e6bb8 +Author: Aleksander Morgado +Date: Mon Oct 1 13:41:34 2012 +0200 + + libmm-glib,manager: cleanup object implementation + + libmm-glib/mm-manager.c | 202 + +++++++++++++++++++++++++++++++----------------- + libmm-glib/mm-manager.h | 19 +++-- + 2 files changed, 145 insertions(+), 76 deletions(-) + +commit acf2e6d1e0c830ae357f334e141146b3ca0abcad +Author: Aleksander Morgado +Date: Mon Oct 1 11:23:55 2012 +0200 + + libmm-glib,manager: allow specifying the generated proxy types + ourselves + + libmm-glib/mm-manager.c | 41 +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 39 insertions(+), 2 deletions(-) + +commit ca14de0605c5d881c46dc43e77ce36d3c4bf6027 +Author: Aleksander Morgado +Date: Mon Oct 1 14:08:40 2012 +0200 + + doc: setup gtk-doc generation for libmm-glib + + .gitignore | 13 ++++ + configure.ac | 2 + + docs/reference/Makefile.am | 2 +- + docs/reference/libmm-glib/Makefile.am | 65 +++++++++++++++++ + docs/reference/libmm-glib/libmm-glib-docs.xml | 100 + ++++++++++++++++++++++++++ + docs/reference/libmm-glib/version.xml.in | 1 + + 6 files changed, 182 insertions(+), 1 deletion(-) + +commit 54f476fe10e9683c19b50fc26b52ca648745fd9f +Author: Aleksander Morgado +Date: Wed Sep 19 08:14:11 2012 +0200 + + sierra: run power-down during init + + plugins/sierra/mm-broadband-modem-sierra.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit e669e4c8685ab668397436c42cc7d591fd62e154 +Author: Aleksander Morgado +Date: Wed Sep 19 08:13:43 2012 +0200 + + cinterion: run power-down during init + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 2ca70365cf015bec7cd0098fecaf6d72a68f6768 +Author: Aleksander Morgado +Date: Wed Sep 19 08:12:30 2012 +0200 + + wavecom: run power-down during init + + plugins/wavecom/mm-broadband-modem-wavecom.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 814bb21e9b3d718b376b6079410ee04d1a8b4702 +Author: Aleksander Morgado +Date: Wed Sep 19 08:11:57 2012 +0200 + + nokia: ensure we skip power down during init + + plugins/nokia/mm-broadband-modem-nokia.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 305f02267eec36889f70ce8f13acb50219e13ce0 +Author: Aleksander Morgado +Date: Wed Sep 19 08:11:31 2012 +0200 + + motorola: ensure we skip power down during init + + plugins/motorola/mm-broadband-modem-motorola.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 28800018fb1ac459e67351eac3082f13958ab23e +Author: Aleksander Morgado +Date: Wed Sep 19 08:10:56 2012 +0200 + + gobi: ensure we skip power down during init + + plugins/gobi/mm-broadband-modem-gobi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 668976f4d7c8b1d79bff6282241cc7dad8d397e0 +Author: Aleksander Morgado +Date: Wed Sep 19 08:09:51 2012 +0200 + + iridium: ensure we skip power down during init + + plugins/iridium/mm-broadband-modem-iridium.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit a5870ac3c6ec8e3b036f493a3066f0addb37deb9 +Author: Aleksander Morgado +Date: Wed Sep 19 08:07:33 2012 +0200 + + zte: run power-down during init + + plugins/zte/mm-broadband-modem-zte.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit a0e19630e4dafbff51ae9a7e1f815ee98167f37d +Author: Aleksander Morgado +Date: Wed Sep 19 08:07:21 2012 +0200 + + icera: we won't be implementing power-down during init + + Some Icera-based modems (e.g. Samsung/Icera Y3300/Y3400) may take + a loong time + to run the power down command (see commit 5f1a1cf8). So, for these + modems we + will fully skip the power down command run during initialization. + + plugins/icera/mm-broadband-modem-icera.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 77208f66ab4ad3c8401b2fe62c93915a5b944331 +Author: Aleksander Morgado +Date: Tue Sep 18 16:09:54 2012 +0200 + + iface-modem: ensure we're in low power mode when initializing + + The power-down command defined by the plugin will be run *only* + after having + checked for current and modem capabilities, as plugins (e.g. Sierra) + may have + different commands for that depending on whether they are 3GPP + or 3GPP2. + + We do not reuse the 'modem_power_down' callback from the disabling + sequence, as + some plugins really behave pretty badly with this (e.g. Samsung + CFUN=4 may take + up to 30s to complete). So, we let plugins use the power-down + command when + disabling but avoid launching it during init. + + src/mm-iface-modem.c | 35 +++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 43 insertions(+) + +commit b622424d2fdcd1f455c3ecbc86a7624a39050f2d +Author: Aleksander Morgado +Date: Fri Sep 28 20:35:41 2012 +0200 + + broadband-modem: handle unknown errors in AT sequences + + When none of the commands in the AT sequence succeeds no error is set. + + src/mm-broadband-modem.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 00a8ed3af44835ccb83c05c2ecfec2a119320420 +Author: Aleksander Morgado +Date: Fri Sep 28 14:57:25 2012 +0200 + + iface-modem: ensure the state change is flushed before the detailed + notify + + In order to ease the life for clients listening to the 'state-changed' + signal, + the change in the 'state' property in the DBus interface skeleton + is flushed + right away, before emitting 'state-changed'. By doing this we make + sure that + the 'state-changed' callbacks in the clients are able to see exactly + the same + current state in the modem proxy. + + src/mm-iface-modem.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 65c3976cad2ed5ee14b979270b73d5c2a93ed215 +Author: Aleksander Morgado +Date: Fri Sep 28 08:41:44 2012 +0200 + + core: acquire DBus name only after having created the `MMManager' + + The `MMManager' is itself also a `GDBusObjectManagerServer'. If we + create this + object after having fully acquired the bus name, the client + application in the + other side of the bus could be trying to use the ObjectManager + interface before + we actually exported it, which is wrong. Therefore, we need to make + sure that + the Manager interfaces are all exported before the name is acquired. + + src/main.c | 51 +++++++++++++++++++++++++++------------------------ + 1 file changed, 27 insertions(+), 24 deletions(-) + +commit 0b059ea9c9b894c470da0a3dc795ba7bc2b46cfd +Author: Dan Williams +Date: Thu Sep 27 11:13:26 2012 -0500 + + uml290mode: fix log message + + uml290/uml290mode.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f5c5a455c1d96efbb4cec4f677b1b9746ff637e7 +Author: Dan Williams +Date: Thu Sep 27 10:55:48 2012 -0500 + + uml290mode: offline and reset modem after making changes + + uml290/uml290mode.c | 59 + ++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 58 insertions(+), 1 deletion(-) + +commit fb65cba607eaebaccd9b1df64074297e6f197d1a +Author: Dan Williams +Date: Thu Sep 27 10:55:20 2012 -0500 + + qcdm: add qcdm_cmd_control_new() to set operating mode + + libqcdm/src/commands.c | 29 +++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 13 +++++++++++++ + libqcdm/src/dm-commands.h | 13 +++++++++++++ + 3 files changed, 55 insertions(+) + +commit 1b5804895f9eeb81fc469acfaa316ba3ea1da86e +Author: Aleksander Morgado +Date: Mon Sep 24 04:36:38 2012 +0200 + + build: use $PKG_CONFIG + + The build system sets up this variable for us, so use it rather than + hardcoding "pkg-config" which might be the wrong one. + + Equivalent to the one done by + Mike Frysinger + in libqmi. + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 717b16b5b6cbca628f48791c9ea35075f393fe68 +Author: Ben Chan +Date: Sat Sep 22 00:03:43 2012 -0700 + + broadband-modem: increase timeout for ATZ + + Some modem like Novatel LTE can take up to 5 seconds to complete + the ATZ + command. Increase the timeout for ATZ from 3 seconds to 6 seconds. + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e60207d6ab6ebe56d702924a8fcbe966e60196a7 +Author: Ben Chan +Date: Sat Sep 22 00:07:08 2012 -0700 + + broadband-modem: disconnect bearers only if the bearer list still + exists + + This patch fixes a crash when MMBroadbandModem tries to access an + already cleared bearer list during the disabling steps. + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7f6eed4c40a3 [ModemManager] - mm-bearer-list.c:259 + mm_bearer_list_disconnect_all_bearers + 0x7f6eed4cd6f8 [ModemManager] - mm-iface-modem.c:1216 + handle_enable_auth_ready + 0x7f6eed332676 [libgio-2.0.so.0.3000.2] - gsimpleasyncresult.c:749 + g_simple_async_result_complete + 0x7f6eed4c5750 [ModemManager] - mm-base-modem.c:1015 + authorize_ready + 0x7f6eed332676 [libgio-2.0.so.0.3000.2] - gsimpleasyncresult.c:749 + g_simple_async_result_complete + 0x7f6eed332788 [libgio-2.0.so.0.3000.2] - gsimpleasyncresult.c:761 + complete_in_idle_cb + 0x7f6eecf36f44 [libglib-2.0.so.0.3000.2] - gmain.c:2441 + g_main_context_dispatch + 0x7f6eecf37597 [libglib-2.0.so.0.3000.2] - gmain.c:3089 + g_main_context_iterate + 0x7f6eecf37b51 [libglib-2.0.so.0.3000.2] - gmain.c:3297 + g_main_loop_run + 0x7f6eed4b5ad1 [ModemManager] - main.c:150 + main + 0x7f6eec95141c [libc-2.15.so] - libc-start.c:234 + __libc_start_main + 0x7f6eed4b55e8 [ModemManager] + 0x0001a5e8 + + src/mm-broadband-modem.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit 6124022ab38222d1b9a239b3f21ec6c8a6eced0f +Author: Ben Chan +Date: Thu Sep 20 08:41:30 2012 -0700 + + modem-helpers: handle the case when operator name is "Unknown" + + Some modems report "Unknown" as the operator name when failed + to obtain + the actual value: + + --> 'AT+COPS=3,0;+COPS?' + <-- '+COPS: 0,0,"Unknown",0OK' + + This patch prevents "Unknown" from being treated as a valid operator + name. + + src/mm-modem-helpers.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 6995300ecd8534e99539ca2a9974c2fb7236484f +Author: Aleksander Morgado +Date: Wed Sep 19 10:37:31 2012 +0200 + + huawei: if port replies to AT^GETPORTMODE, port is AT + + Just skips the additional check for AT support in the port. + + plugins/huawei/mm-plugin-huawei.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit c4b5293669f5b956e47a8b0fbfe70d179c0ef43f +Author: Aleksander Morgado +Date: Wed Sep 19 10:18:18 2012 +0200 + + device: if failed to get VID/PID in first port, try the next one + + Don't rely only in the first grabbed port to get VID/PID. Some + modems, e.g. + Huawei E367, won't report a proper VID in the cdc-wdm port, which + is the first + one probed. + + src/mm-device.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit ee099fcd087c0960e4b6f40b251e798e53978edf +Author: Aleksander Morgado +Date: Wed Sep 19 10:16:41 2012 +0200 + + plugin-manager: never suggest the Generic plugin to others + + Some modems, e.g. Huawei E367, will probe first the QMI port and + for some reason + it doesn't report a proper VID/PID so the Generic plugin is the + one finally + accepting that port. When we probe the AT ports afterwards we already + got the + Generic plugin as suggestion, and we end up not grabbing the proper + primary and + secondary ports as we skipped the AT^GETPORTMODE reply. + + So, from now on the Generic plugin is never suggested to other + probes; except + for the case where we need the suggestion to finish a probing task + which was + 'deferred until suggested'. + + Also, the device-level plugin can now be overwritten, if and only + if, the + previously set plugin was the Generic one. + + src/mm-plugin-manager.c | 73 + ++++++++++++++++++++++++++++++++----------------- + 1 file changed, 48 insertions(+), 25 deletions(-) + +commit a6faae32608833f3d26d57bc6bace4f2a9add8bd +Author: Aleksander Morgado +Date: Wed Sep 19 07:35:23 2012 +0200 + + broadband-modem: skip +CGMM: prefix when loading device model + + Some devices, e.g. ZTE MF820D, seem to prefix the `AT+CGMM?' response + with the + `+CGMM:' string, resulting in the following model string being loaded: + + model: '+CGMM: "MF820D"' + + Avoid this by: + 1) Removing the expected prefixes. + 2) Unquoting the resulting string. + + Reported by: Marius Kotsbak + + src/mm-broadband-modem.c | 12 +++++++++++- + src/mm-modem-helpers.c | 17 +++++++++++++++++ + src/mm-modem-helpers.h | 5 +++-- + 3 files changed, 31 insertions(+), 3 deletions(-) + +commit d2353e01ff4b786da4542f7fd6f4f4e76081f450 +Author: Marius B. Kotsbak +Date: Sun Sep 9 18:06:30 2012 +0200 + + sierra: use +CFUN=4 for powering down GSM modems + + plugins/sierra/mm-broadband-modem-sierra.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit b65bc50777a9de7d0f5a16503056435b19140048 +Author: Aleksander Morgado +Date: Tue Sep 18 19:01:30 2012 +0200 + + qmi-port: plug memleak + + Ensure we clear all allocated client objects when disposing the port. + + src/mm-qmi-port.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 127900b67b73b80ded9dc24f2bfb8f2274e6a325 +Author: Aleksander Morgado +Date: Tue Sep 18 18:54:37 2012 +0200 + + broadband-modem-qmi: plug memleak, always need to unref() input + containers + + src/mm-broadband-modem-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit 48bb20d0184ac5db085521539b186842b87a47e3 +Author: Aleksander Morgado +Date: Tue Sep 18 13:57:25 2012 +0200 + + libmm-common,gps-nmea: skip duplicate traces in sequence + + libmm-common/mm-location-gps-nmea.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 598799a61ce2862a6bf8f603c91ebee7ef83576b +Author: Aleksander Morgado +Date: Tue Sep 18 13:11:59 2012 +0200 + + broadband-modem-qmi: request NMEA trace indications + + src/mm-broadband-modem-qmi.c | 60 + ++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 50 insertions(+), 10 deletions(-) + +commit 48d8bf4164f201fba3228d56ff4a21e1a9ee88e7 +Author: Aleksander Morgado +Date: Tue Sep 18 12:41:07 2012 +0200 + + broadband-modem-qmi: listen to "PDS Event Report" indications + + src/mm-broadband-modem-qmi.c | 161 + ++++++++++++++++++++++++++++++------------- + 1 file changed, 112 insertions(+), 49 deletions(-) + +commit b43c5933d85f244d977d72da8a9d2a3477f713f4 +Author: Aleksander Morgado +Date: Tue Sep 18 12:16:24 2012 +0200 + + broadband-modem-qmi: enable/disable GPS location gathering + + src/mm-broadband-modem-qmi.c | 292 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 292 insertions(+) + +commit 4babcbe30edf254d17de9a2a6d55af3152d40f62 +Author: Aleksander Morgado +Date: Tue Sep 18 11:53:52 2012 +0200 + + broadband-modem-qmi: new common method to peek a QMI client + + src/mm-broadband-modem-qmi.c | 37 +++++++++++++++++++++++++++---------- + 1 file changed, 27 insertions(+), 10 deletions(-) + +commit 0e40bb7b11caf0079a2b9a1d0b387ef08b46254f +Author: Aleksander Morgado +Date: Tue Sep 18 10:59:49 2012 +0200 + + broadband-modem-qmi: check support for GPS location capabilities + + src/mm-broadband-modem-qmi.c | 84 + ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 82 insertions(+), 2 deletions(-) + +commit 6284737249aca9d65d721c746bb2b3750a677ebe +Author: Aleksander Morgado +Date: Fri Sep 14 13:12:02 2012 +0200 + + sms: don't allow more than 255 parts + + src/mm-sms.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit d5e57dd8eb98d89f68d2e651271d54949c910b31 +Author: Aleksander Morgado +Date: Fri Sep 14 13:11:33 2012 +0200 + + sms: fix error message string when failing to parse input text + + src/mm-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d30ec8f5a6054fb42e458bfadef0d2786a6b13d8 +Author: Aleksander Morgado +Date: Fri Sep 14 11:57:36 2012 +0200 + + cli: minor text output fixes + + cli/mmcli-sms.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 2c1ce492cebd2a95de8b14abc644beb370d4f6b5 +Author: Aleksander Morgado +Date: Thu Sep 13 12:33:50 2012 +0200 + + sms: don't try the generic SMS method if we got a timeout error + + src/mm-sms.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e212f6b6edcd2b5678372bd0b05c70209c516f05 +Author: Aleksander Morgado +Date: Thu Sep 13 12:00:37 2012 +0200 + + sms: create SMS parts only when storing or sending + + When a user creates an SMS object, we will expose all its properties + in DBus + properly, but we will not create the internal list of SMS parts. + + The list of SMS parts will be created when the SMS is stored or + sent, whatever + comes first. When the message is sent and it was previously stored, + the list of + parts is not re-created. + + If the message requires multiple parts, the multipart reference is + computed as + follows: + * If the SMS was not stored and is being sent, we just use a + random number. + * If the SMS is being stored, we will use a multipart reference + which is not + being used already in another SMS to the same destination. + + src/mm-iface-modem-messaging.c | 48 ++++++ + src/mm-iface-modem-messaging.h | 5 + + src/mm-sms-list.c | 29 ++++ + src/mm-sms-list.h | 4 + + src/mm-sms-part.c | 19 +-- + src/mm-sms-part.h | 3 +- + src/mm-sms.c | 357 + +++++++++++++++++++++++++---------------- + 7 files changed, 320 insertions(+), 145 deletions(-) + +commit 2da9474d0c0e22044d7ab636e3336cab1a75bc22 +Author: Aleksander Morgado +Date: Thu Sep 13 11:54:42 2012 +0200 + + test: new tester for the messaging capabilities of a modem, using + `mmcli' + + Usage: + mmcli-test-sms [MODEM INDEX] [all|ucs2|gsm7|data] [NUMBER]" + + If [NUMBER] is not given, a dummy number will be used and NO SMS + will be sent. + + If you give a proper [NUMBER], we will try to send the SMS. + + test/mmcli-test-sms | 169 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 169 insertions(+) + +commit 4196ef1a86bbac44461bfdae985cfc3a9696f488 +Author: Aleksander Morgado +Date: Thu Sep 13 11:40:05 2012 +0200 + + sms: don't try to delete parts if SMS not stored + + src/mm-sms.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 861266777693162fdfeb54a3e1094ab05f0d3c4d +Author: Aleksander Morgado +Date: Thu Sep 13 07:45:17 2012 +0200 + + sms,sms-qmi: update timeout when sending an SMS to 30s + + src/mm-sms-qmi.c | 4 ++-- + src/mm-sms.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit f6832d72cf386eb495c5d2b988d24c1a963f71d6 +Author: Aleksander Morgado +Date: Wed Sep 12 15:44:01 2012 +0200 + + cli: new `--create-file-with-data' action for SMS objects + + This new action allows creating a new file with the binary data + stored in the + SMS, if any. + + E.g.: + + $> sudo mmcli -s 7 \ + --create-file-with-data=output.txt + + This action can only be run on SMS object with binary data. + + cli/mmcli-sms.c | 80 + ++++++++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 74 insertions(+), 6 deletions(-) + +commit 015627974984ef7b5a7595421a9921fbaa759555 +Author: Aleksander Morgado +Date: Wed Sep 12 15:42:34 2012 +0200 + + cli: new `--messaging-create-sms-with-data' switch + + This switch can be run along with the `--messaging-create-sms' + action, in order + to include in the SMS the data as given in the file specified by + the new switch. + + E.g.: + + $> sudo mmcli -m 0 \ + --messaging-create-sms="number='1234567890'" \ + --messaging-create-sms-with-data=file.txt + + In this case, the SMS properties string cannot contain a 'text' field. + + cli/mmcli-modem-messaging.c | 68 + ++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 55 insertions(+), 13 deletions(-) + +commit 1304a628f8b7e3ebc1b41101533c2eb5ff2f25ec +Author: Aleksander Morgado +Date: Wed Sep 12 15:39:19 2012 +0200 + + sms-part: include user data, if passed, when building the PDU + + src/mm-sms-part.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 8e6a6035780da3ccc18e5eb9c30eb40ab4ea9885 +Author: Aleksander Morgado +Date: Wed Sep 12 13:08:36 2012 +0200 + + libmm-glib: provide accessors for the 'Data' property in the SMS + interface + + libmm-glib/mm-sms.c | 67 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms.h | 40 ++++++++++++++++++-------------- + 2 files changed, 89 insertions(+), 18 deletions(-) + +commit a66f971a7cdea4bf1d9f6390e12f950f41ee5595 +Author: Aleksander Morgado +Date: Wed Sep 12 13:06:40 2012 +0200 + + libmm-common: added common utils from core + + Moved the utils to play with binary to hex strings into libmm-common. + + libmm-common/mm-common-helpers.c | 94 + +++++++++++++++++++ + libmm-common/mm-common-helpers.h | 7 ++ + plugins/huawei/mm-broadband-modem-huawei.c | 5 +- + plugins/icera/mm-broadband-bearer-icera.c | 1 - + plugins/iridium/mm-bearer-iridium.c | 1 - + plugins/mbm/mm-broadband-bearer-mbm.c | 1 - + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 1 - + plugins/option/mm-broadband-bearer-hso.c | 1 - + plugins/sierra/mm-broadband-bearer-sierra.c | 1 - + src/Makefile.am | 2 - + src/mm-bearer-list.c | 1 - + src/mm-bearer-qmi.c | 1 - + src/mm-bearer.c | 1 - + src/mm-broadband-bearer.c | 1 - + src/mm-broadband-modem.c | 3 +- + src/mm-charsets.c | 13 +-- + src/mm-device.c | 11 +-- + src/mm-sim.c | 5 +- + src/mm-sms-list.c | 1 - + src/mm-sms-part.c | 3 +- + src/mm-sms.c | 3 +- + src/mm-utils.c | 109 + ---------------------- + src/mm-utils.h | 28 ------ + src/tests/test-sms-part.c | 7 +- + 24 files changed, 124 insertions(+), 177 deletions(-) + +commit fbe01c8d6a22cb95ff74ddefc907e663cdeee710 +Author: Aleksander Morgado +Date: Wed Sep 12 12:34:43 2012 +0200 + + sms: 'Text' and 'Data' will never be given at the same time + + When receiving an SMS, if the encoding is either GSM7 or UCS2, + we will treat the + contents of the SMS as text; and if the encoding is either 8BIT or + unknown, we + will just dump the contents of the SMS as data. + + When creating an SMS, the user is not allowed to give both text and + data, only + one can be given. We will use by default 8BIT when data is given, + and guess the + best encoding if text is given. + + Note that it's still possible to have SMS with neither text nor data, + as in + delivery status reports. + + This commit also handles the split of the input data in order to + make it fit + into singlepart or multipart messages. + + .../org.freedesktop.ModemManager1.Sms.xml | 6 +- + src/mm-sms-part.c | 73 +++++++++++--- + src/mm-sms-part.h | 2 + + src/mm-sms.c | 111 + +++++++++++++++++---- + 4 files changed, 157 insertions(+), 35 deletions(-) + +commit 15be01d4fac9c761411f23903df5c0d6c2360424 +Author: Aleksander Morgado +Date: Wed Sep 12 11:40:06 2012 +0200 + + sms: fix error return when a mandatory parameter missing in dictionary + + src/mm-sms.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit baf3ed0c64135af4a21d21ba4d1ca7c6f534ba29 +Author: Aleksander Morgado +Date: Wed Sep 12 11:27:30 2012 +0200 + + sms-part: don't keep track of the whole TP-DCS value + + We already retrieve the bits we use from it, class and encoding. + + src/mm-broadband-modem.c | 1 - + src/mm-sms-part.c | 6 ------ + src/mm-sms-part.h | 4 ---- + src/tests/test-sms-part.c | 41 +++++++++++++++++------------------------ + 4 files changed, 17 insertions(+), 35 deletions(-) + +commit 64f728b375f494a31dcbe978ffa864a1f96e4713 +Author: Aleksander Morgado +Date: Wed Sep 12 11:19:21 2012 +0200 + + sms-part: read message class only if TP-DCS available + + src/mm-sms-part.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 815decb03474754a56e7572a2823ce438a81023b +Author: Aleksander Morgado +Date: Wed Sep 12 10:41:27 2012 +0200 + + broadband-modem: properly avoid duplicate CMTI indications + + We will look for the part being notified in the CMTI indication + directly in the + list of processed parts; and if we have it there already we won't + re-process it. + + Still, we may get several CMTI indications for the same part one + after the + other, so it may still happen that the second CMTI comes *before* + we have parsed + and created the part in the SMS list. For that case, the SMS list + will reject + taking the part if there is already a part with the same storage+index + already + processed. + + This fix removes the `known_sms_parts' hash table, which was being + handled + incorrectly. + + This should fix https://bugzilla.gnome.org/show_bug.cgi?id=675175 + + src/mm-broadband-modem.c | 55 + ++++++++++++++++++++---------------------------- + src/mm-sms-list.c | 26 +++++++++++++++++++---- + src/mm-sms-list.h | 4 ++++ + 3 files changed, 49 insertions(+), 36 deletions(-) + +commit 8cbf3b7826ccf794431d37e449724caaf0f4206b +Author: Aleksander Morgado +Date: Wed Sep 12 10:35:51 2012 +0200 + + broadband-modem: fix SMS list object type + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 91b324ed407a849173701aa70e2a15f842ac6db6 +Author: Aleksander Morgado +Date: Wed Sep 12 10:06:17 2012 +0200 + + broadband-modem: select and lock proper storage when reading CMTI + indications + + src/mm-broadband-modem.c | 71 + ++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 56 insertions(+), 15 deletions(-) + +commit f6147e0d6bb9d24f6fd470f99a278178690e5d83 +Author: Aleksander Morgado +Date: Tue Sep 11 16:04:11 2012 +0200 + + cli: print new SMS properties in SMS status report + + cli/mmcli-sms.c | 50 +++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 37 insertions(+), 13 deletions(-) + +commit 744b9fba671d858f4ca31a17e358764767703ae6 +Author: Aleksander Morgado +Date: Tue Sep 11 15:56:11 2012 +0200 + + libmm-glib: added methods to retrieve new SMS properties + + libmm-glib/mm-sms.c | 84 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms.h | 5 ++++ + 2 files changed, 89 insertions(+) + +commit 1111bfa80664d88b5e9572a9d3de7c4f117e7384 +Author: Aleksander Morgado +Date: Wed Sep 12 09:19:23 2012 +0200 + + api: new `DeliveryState' property in the SMS interface + + Given only for STATUS REPORT SMS messages. + + docs/reference/api/ModemManager-sections.txt | 1 + + include/ModemManager-enums.h | 71 + ++++++++++++++++++++++ + .../org.freedesktop.ModemManager1.Sms.xml | 11 ++++ + libmm-common/mm-common-helpers.c | 44 ++++++++++++++ + libmm-common/mm-common-helpers.h | 2 + + src/mm-sms-part.c | 9 ++- + src/mm-sms-part.h | 4 ++ + src/mm-sms.c | 1 + + 8 files changed, 142 insertions(+), 1 deletion(-) + +commit bdf0f9484b4244c024599e00ec589ccc5b97893e +Author: Aleksander Morgado +Date: Tue Sep 11 16:35:46 2012 +0200 + + sms: allow parts with neither text nor data only in Status Report PDUs + + src/mm-sms.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 83ab63138cfbe7988e3462f66675a3f7261b381f +Author: Aleksander Morgado +Date: Tue Sep 11 16:31:14 2012 +0200 + + sms: fix double free when parsing PDUs + + If we get an error when telling the SMS list to take the new PDU, + the caller is + the one responsible for freeing the part, so avoid doing it twice. + + Relevant valgrind log: + ==7287== Invalid read of size 8 + ==7287== at 0x437CE1: mm_sms_part_free (mm-sms-part.c:344) + ==7287== by 0x454D11: mm_iface_modem_messaging_take_part + (mm-iface-modem-messaging.c:359) + ==7287== by 0x461234: cds_received (mm-broadband-modem.c:4626) + ==7287== by 0x48A305: parse_unsolicited (mm-at-serial-port.c:256) + ==7287== by 0x48723D: parse_response (mm-serial-port.c:731) + ==7287== by 0x48759B: data_available (mm-serial-port.c:801) + ==7287== by 0x36ADC47694: g_main_context_dispatch (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x36ADC479C7: ??? (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x36ADC47DC1: g_main_loop_run (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x421398: main (main.c:150) + ==7287== Address 0x9840b78 is 24 bytes inside a block of size + 104 free'd + ==7287== at 0x4A079AE: free (vg_replace_malloc.c:427) + ==7287== by 0x36ADC4D37E: g_free (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x36ADC61CCE: g_slice_free1 (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x437D5A: mm_sms_part_free (mm-sms-part.c:351) + ==7287== by 0x36ADC449EC: g_list_foreach (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x36ADC44A0A: g_list_free_full (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==7287== by 0x43D8A1: finalize (mm-sms.c:1629) + ==7287== by 0x36AE8145DA: g_object_unref (in + /usr/lib64/libgobject-2.0.so.0.3200.4) + ==7287== by 0x43CD52: mm_sms_singlepart_new (mm-sms.c:1376) + ==7287== by 0x43E223: take_singlepart (mm-sms-list.c:236) + ==7287== by 0x43E60D: mm_sms_list_take_part (mm-sms-list.c:338) + ==7287== by 0x454CC7: mm_iface_modem_messaging_take_part + (mm-iface-modem-messaging.c:353) + + src/mm-sms.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 2871e3e821251245823d0e178c965a1ecbb5984a +Author: Aleksander Morgado +Date: Tue Sep 11 16:20:01 2012 +0200 + + sms-part: don't read out of the pdu buffer + + ... or Valgrind will complain: + + ==4834== Invalid read of size 1 + ==4834== at 0x43904C: mm_sms_part_new_from_binary_pdu + (mm-sms-part.c:783) + ==4834== by 0x4382C9: mm_sms_part_new_from_pdu (mm-sms-part.c:485) + ==4834== by 0x461D85: sms_pdu_part_list_ready + (mm-broadband-modem.c:5004) + ==4834== by 0x3161A6CFB6: g_simple_async_result_complete (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x432F82: at_command_parse_response + (mm-base-modem-at.c:490) + ==4834== by 0x489F96: handle_response (mm-at-serial-port.c:161) + ==4834== by 0x486D0A: mm_serial_port_got_response + (mm-serial-port.c:588) + ==4834== by 0x48758B: data_available (mm-serial-port.c:804) + ==4834== by 0x36ADC47694: g_main_context_dispatch (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x36ADC479C7: ??? (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x36ADC47DC1: g_main_loop_run (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x421398: main (main.c:150) + ==4834== Address 0x927e489 is 0 bytes after a block of size 25 + alloc'd + ==4834== at 0x4A06F18: calloc (vg_replace_malloc.c:566) + ==4834== by 0x36ADC4D2C6: g_malloc0 (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x4844B2: utils_hexstr2bin (mm-utils.c:63) + ==4834== by 0x438284: mm_sms_part_new_from_pdu (mm-sms-part.c:476) + ==4834== by 0x461D85: sms_pdu_part_list_ready + (mm-broadband-modem.c:5004) + ==4834== by 0x3161A6CFB6: g_simple_async_result_complete (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x432F82: at_command_parse_response + (mm-base-modem-at.c:490) + ==4834== by 0x489F96: handle_response (mm-at-serial-port.c:161) + ==4834== by 0x486D0A: mm_serial_port_got_response + (mm-serial-port.c:588) + ==4834== by 0x48758B: data_available (mm-serial-port.c:804) + ==4834== by 0x36ADC47694: g_main_context_dispatch (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x36ADC479C7: ??? (in + /usr/lib64/libglib-2.0.so.0.3200.4) + + src/mm-sms-part.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 2b01c93c577e480768d721c48d09645914794666 +Author: Aleksander Morgado +Date: Tue Sep 11 15:50:58 2012 +0200 + + api: make read-only all SMS properties for now + + We don't support yet modifying these properties on the fly (e.g. we + would need + to re-construct the internal PDU list when the text changes). + + introspection/org.freedesktop.ModemManager1.Sms.xml | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 628f7e41a481756950cf896e326c5050ef4c1489 +Author: Aleksander Morgado +Date: Tue Sep 11 15:47:39 2012 +0200 + + sms-list: don't look for duplicate parts if index is unknown + + src/mm-sms-list.c | 28 +++++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +commit 4f1991e2bab533176d0e720aee0bbe7ce755cc21 +Author: Aleksander Morgado +Date: Tue Sep 11 15:41:53 2012 +0200 + + api: new `MessageReference' property in the SMS interface + + Message reference allows to match a sent SMS with its corresponding + delivery + report, if requested. + + .../org.freedesktop.ModemManager1.Sms.xml | 11 ++++ + src/mm-sms-part.c | 4 ++ + src/mm-sms-part.h | 4 ++ + src/mm-sms-qmi.c | 10 +++ + src/mm-sms.c | 77 + ++++++++++++++++++++-- + 5 files changed, 101 insertions(+), 5 deletions(-) + +commit 320984a4a00b886a7c6b61aa48413900efe56e86 +Author: Aleksander Morgado +Date: Tue Sep 11 15:03:08 2012 +0200 + + api: new `DischargeTimestamp' property for Status Report SMS messages + + introspection/org.freedesktop.ModemManager1.Sms.xml | 18 + +++++++++++++++++- + src/mm-sms-part.c | 8 ++++++-- + src/mm-sms-part.h | 6 ++++++ + src/mm-sms.c | 3 ++- + 4 files changed, 31 insertions(+), 4 deletions(-) + +commit f1a73a5719002426f1f0a7ffdbec1dc1822c794c +Author: Aleksander Morgado +Date: Tue Sep 11 14:52:31 2012 +0200 + + sms-part: always treat TP-DCS as a bitmask + + src/mm-sms-part.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 6c7766afed735500ffc4c3197518b479760edec6 +Author: Aleksander Morgado +Date: Tue Sep 11 14:48:35 2012 +0200 + + sms-part: always treat TP-MTI as a bitmask + + src/mm-sms-part.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit ef5842f4dab34843f514838505102ea37bf95ba6 +Author: Aleksander Morgado +Date: Tue Sep 11 14:46:24 2012 +0200 + + sms-part: implement parsing SUBMIT and STATUS REPORT PDUs + + src/mm-sms-part.c | 532 + ++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 361 insertions(+), 171 deletions(-) + +commit 7faa48ea9490c0af563d3bb8426a1e2d9bf83f82 +Author: Aleksander Morgado +Date: Tue Sep 11 14:40:42 2012 +0200 + + api: new `PduType' property in the SMS interface + + It will help deciding the type of message. + + docs/reference/api/ModemManager-sections.txt | 1 + + include/ModemManager-enums.h | 16 +++++++++++ + .../org.freedesktop.ModemManager1.Sms.xml | 8 ++++++ + src/mm-broadband-modem.c | 32 + ++++++++++++++++------ + src/mm-sms-part.c | 10 +++++-- + src/mm-sms-part.h | 8 +++++- + src/mm-sms.c | 7 +++-- + src/tests/test-sms-part.c | 2 +- + 8 files changed, 69 insertions(+), 15 deletions(-) + +commit 5b6e080472952d1c97568d9925aae268677623a6 +Author: Aleksander Morgado +Date: Tue Sep 11 14:00:44 2012 +0200 + + test: set text encoding when testing PDU creator + + src/tests/test-sms-part.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 6c5bead94b39f344464dbbd5db36599c377c798c +Author: Aleksander Morgado +Date: Tue Sep 11 14:00:24 2012 +0200 + + test: print all logs in SMS part tests + + They are extremely helpful for debugging issues. + + src/tests/test-sms-part.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit f7caa7c9bc189c6a13ffafdb26e95e5343488abf +Author: Aleksander Morgado +Date: Tue Sep 11 13:59:31 2012 +0200 + + test: new tests to parse SUBMIT PDUs + + src/tests/test-sms-part.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit f139bbe48503f34c2e9f80d0e7196eb9b3f75999 +Author: Aleksander Morgado +Date: Tue Sep 11 08:37:21 2012 +0200 + + test: new tests to parse non-stored PDUs + + src/tests/test-sms-part.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit af4f23a1d250b9e348ac2e7dcb874b2f5f3c4c3f +Author: Aleksander Morgado +Date: Tue Sep 11 08:21:27 2012 +0200 + + test: new tester for +CDS unsolicited messages + + src/tests/test-modem-helpers.c | 46 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 8acaf7baa7b2bb585bdbdce556a4c37b3b7d2afe +Author: Aleksander Morgado +Date: Tue Sep 11 07:39:27 2012 +0200 + + broadband-modem: process not-stored SMS part indications + + src/mm-broadband-modem.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.c | 12 ++++++++++++ + src/mm-modem-helpers.h | 1 + + 3 files changed, 55 insertions(+) + +commit 7be32700fb474621db732f4eb1599a6951280b86 +Author: Aleksander Morgado +Date: Tue Sep 11 07:39:01 2012 +0200 + + broadband-modem: minor improvement when reading from match info + + src/mm-broadband-modem.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 7c9beae0136a4c3f030265f21b403ca0cf655484 +Author: Aleksander Morgado +Date: Tue Sep 11 07:10:30 2012 +0200 + + cli: print delivery report request information in SMS status + + cli/mmcli-sms.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit bda572faa7cac778e133c0b385cdc35fbfa0b0d6 +Author: Aleksander Morgado +Date: Tue Sep 11 07:06:57 2012 +0200 + + libmm-glib,sms: new `mm_sms_get_delivery_report_request()' + + libmm-glib/mm-sms.c | 8 ++++++++ + libmm-glib/mm-sms.h | 25 +++++++++++++------------ + 2 files changed, 21 insertions(+), 12 deletions(-) + +commit 2508d01bdf13b0757947dcff7ea58488810a366e +Author: Aleksander Morgado +Date: Tue Sep 11 07:06:25 2012 +0200 + + libmm-glib,sms: fix values returned on error + + libmm-glib/mm-sms.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 1c119be83492dac56f8d2ea5bd6b8717ccda1ae6 +Author: Aleksander Morgado +Date: Mon Sep 10 20:13:00 2012 +0200 + + api: new `Sms.DeliveryReportRequest' property + + Also allowing the 'delivery-report-request' key in the + `Messaging.CreateSms()' + method. + + .../org.freedesktop.ModemManager1.Sms.xml | 7 ++ + libmm-common/mm-sms-properties.c | 78 + ++++++++++++++++++++-- + libmm-common/mm-sms-properties.h | 51 +++++++------- + src/mm-sms-part.c | 17 ++++- + src/mm-sms-part.h | 4 ++ + src/mm-sms.c | 4 ++ + 6 files changed, 128 insertions(+), 33 deletions(-) + +commit b42b5795e33e052e7dacc4731af89fde44f56ff5 +Author: Aleksander Morgado +Date: Mon Sep 10 19:01:50 2012 +0200 + + iface-modem-messaging: automatically detect the best default storage + + Instead of letting the plugins specify a default storage to use, + just look at + the supported ones and use the best one. + + "MT is preferred over "ME" or "SM", as "MT=ME+SM" + + plugins/cinterion/mm-broadband-modem-cinterion.c | 1 - + plugins/iridium/mm-broadband-modem-iridium.c | 2 - + plugins/novatel/mm-broadband-modem-novatel-lte.c | 2 - + plugins/novatel/mm-broadband-modem-novatel.c | 2 - + src/mm-broadband-modem.c | 2 +- + src/mm-iface-modem-messaging.c | 65 + ++++++++++++++++-------- + 6 files changed, 44 insertions(+), 30 deletions(-) + +commit 54178a7959c018341da48b86164a0cb6f74be1e1 +Author: Aleksander Morgado +Date: Mon Sep 10 18:27:15 2012 +0200 + + cli: include default SMS storage info in `--messaging-status' + + $> sudo mmcli -m 1 --messaging-status + + /org/freedesktop/ModemManager1/Modem/1 + ---------------------------- + Messaging | supported storages: 'sm, mt, me, sr' + | default storage: 'me' + + cli/mmcli-modem-messaging.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit fdb9db8d2858c7c53cad0666c539faefd990f6f7 +Author: Aleksander Morgado +Date: Mon Sep 10 18:26:50 2012 +0200 + + libmm-glib: new `mm_modem_messaging_get_default_storage()' method + + libmm-glib/mm-modem-messaging.c | 16 ++++++++++++++++ + libmm-glib/mm-modem-messaging.h | 7 ++++--- + 2 files changed, 20 insertions(+), 3 deletions(-) + +commit 4f7534452dc9eb96c5119052707987c41c7c091d +Author: Aleksander Morgado +Date: Mon Sep 10 18:21:16 2012 +0200 + + option,hso: properly parse returned IMEI + + plugins/option/mm-broadband-modem-option.c | 44 + ++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +commit 43650043eabf1e84c48842d5494668a30515639c +Author: Aleksander Morgado +Date: Mon Sep 10 18:12:08 2012 +0200 + + sms: select proper storage when sending SMS from storage + + We need to select the correct 'mem2' storage before trying to send + from storage. + + src/mm-sms.c | 46 +++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 5 deletions(-) + +commit bddcc2fb07f96c9332b031a7b91bc5ba74b62149 +Author: Aleksander Morgado +Date: Mon Sep 10 18:03:29 2012 +0200 + + iface-modem-messaging: instead of mem1,mem2,mem3 use just a new + default storage + + There is no point in specifying a default 'mem1' memory storage, + which is used + for reading/listing/deleting, as those are operations that need + a specific + 'mem1' set each time. + + Also, there is no point in specifying separate default 'mem2' and + 'mem3' memory + storages, specially because now we allow Sms.Store() to specify + a storage. + + So, we will now only have a 'default' memory storage, which is + applicable for + both 'mem2' and 'mem3' (storing, sending from storage and deleting). + + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 8 ++ + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + plugins/iridium/mm-broadband-modem-iridium.c | 5 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 5 +- + plugins/novatel/mm-broadband-modem-novatel.c | 6 +- + src/mm-broadband-modem-qmi.c | 42 +++------- + src/mm-broadband-modem.c | 90 + +++++++--------------- + src/mm-iface-modem-messaging.c | 66 ++++++---------- + src/mm-iface-modem-messaging.h | 28 +++---- + src/mm-sms.c | 2 +- + 10 files changed, 90 insertions(+), 164 deletions(-) + +commit 584fc77bb361f8485c255bd5ce2bb9c6320efc21 +Author: Aleksander Morgado +Date: Mon Sep 10 16:25:29 2012 +0200 + + cli: include the `--messaging' prefix in all Messaging-related actions + + Just for consistency with other interfaces, which also provide + interface + specific prefixes in their mmcli actions. + + cli/mmcli-modem-messaging.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 47b459603a2605f574d8ea1a7b51d501754d67ac +Author: Aleksander Morgado +Date: Mon Sep 10 16:23:58 2012 +0200 + + cli: new `--messaging-status' action + + Currently shows the list of supported SMS storages. + + cli/mmcli-modem-messaging.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 45 insertions(+), 1 deletion(-) + +commit c7e81d74708ca87d37d374cd8d2f67e9199a3c43 +Author: Aleksander Morgado +Date: Mon Sep 10 16:23:37 2012 +0200 + + libmm-glib: new `mm_modem_messaging_get_supported_storages()' method + + libmm-glib/mm-modem-messaging.c | 24 ++++++++++++++++++++++++ + libmm-glib/mm-modem-messaging.h | 4 ++++ + 2 files changed, 28 insertions(+) + +commit 67081f02c88bc907561f6d9a9bd0e74cf9797189 +Author: Aleksander Morgado +Date: Mon Sep 10 16:23:05 2012 +0200 + + api: new `SupportedStorages' property in the Messaging interface + + We will list which are the storages allowed to use when + receiving/storing SMS + messages. + + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 9 +++++++ + src/mm-iface-modem-messaging.c | 28 + ++++++++++++++++++++++ + 2 files changed, 37 insertions(+) + +commit b7e1c6d36dd10c6772582196117dc5d0ccefcb08 +Author: Aleksander Morgado +Date: Mon Sep 10 16:21:29 2012 +0200 + + libmm-common: new helpers to work with arrays of `MMSmsStorage' values + + libmm-common/mm-common-helpers.c | 61 + ++++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 7 +++++ + 2 files changed, 68 insertions(+) + +commit d75bfa2db9aeaa98140249770e919822af88ccaa +Author: Aleksander Morgado +Date: Mon Sep 10 15:35:05 2012 +0200 + + broadband-modem: allow locking/unlocking either 'mem1' or 'mem2' + or both + + So that e.g. listing all SMS in a given storage ('mem1' lock) + doesn't collide + with storing a new SMS ('mem2' lock). + + src/mm-broadband-modem.c | 83 + +++++++++++++++++++++++++++++++++--------------- + src/mm-broadband-modem.h | 4 ++- + src/mm-sms.c | 8 ++--- + 3 files changed, 64 insertions(+), 31 deletions(-) + +commit e6f827ed3367ad9e3311f4d5c2dc1f501fb04748 +Author: Aleksander Morgado +Date: Mon Sep 10 14:51:33 2012 +0200 + + sms: select proper storage when deleting SMS + + src/mm-sms.c | 38 ++++++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +commit f0e873b26e036f3a6374ac3859987403cfc01d52 +Author: Aleksander Morgado +Date: Mon Sep 10 14:31:16 2012 +0200 + + cli: new `--store-in-storage' action to be able to select where to + store the SMS + + Expects the storage as the enum nickname string, e.g: + "me" for MM_SMS_STORAGE_ME + or + "sm" for MM_SMS_STORAGE_SM + + cli/mmcli-sms.c | 51 + ++++++++++++++++++++++++++++++++++++++-- + libmm-common/mm-common-helpers.c | 23 +++++++++++++++++- + libmm-common/mm-common-helpers.h | 2 ++ + 3 files changed, 73 insertions(+), 3 deletions(-) + +commit 667026f0c829ba1be3d69726d7145b3ecd224dbd +Author: Aleksander Morgado +Date: Mon Sep 10 14:18:00 2012 +0200 + + api: Sms.Store() now requires the specific memory storage where to + store the SMS + + ... or MM_SMS_STORAGE_UNKNOWN to store it in the default storage. + + cli/mmcli-sms.c | 2 + + .../org.freedesktop.ModemManager1.Sms.xml | 9 +- + libmm-glib/mm-sms.c | 6 ++ + libmm-glib/mm-sms.h | 2 + + src/mm-sms-qmi.c | 5 +- + src/mm-sms.c | 101 + +++++++++++++++------ + src/mm-sms.h | 1 + + 7 files changed, 96 insertions(+), 30 deletions(-) + +commit 96928909b9294b319374f1440832fbd7d934e0cb +Author: Aleksander Morgado +Date: Mon Sep 10 14:07:31 2012 +0200 + + iface-modem-messaging: setting preferred storages is a one-time + operation + + Selection specific storages to run actions on them can now be done + with the + broadband-modem-specific lock|unlock_sms_storages() methods. + + src/mm-iface-modem-messaging.c | 129 + ++++++++++++++--------------------------- + src/mm-iface-modem-messaging.h | 11 ---- + 2 files changed, 42 insertions(+), 98 deletions(-) + +commit 2481d97d525b5e6a9d91d893892c72fcc91f7217 +Author: Aleksander Morgado +Date: Mon Sep 10 13:58:54 2012 +0200 + + iface-modem-messaging: load initial SMS parts after having set + default storages + + We really want the 'mem3' storage set as soon as possible. + + src/mm-iface-modem-messaging.c | 56 + +++++++++++++++++++++--------------------- + 1 file changed, 28 insertions(+), 28 deletions(-) + +commit a5650ca091140def2070f0b631e398047313d5ba +Author: Aleksander Morgado +Date: Mon Sep 10 13:53:22 2012 +0200 + + broadband-modem: lock/unlock the 'mem1' storage when reading initial + SMS lists + + src/mm-broadband-modem.c | 42 +++++++++++++++++++++++------------------- + src/mm-broadband-modem.h | 2 +- + 2 files changed, 24 insertions(+), 20 deletions(-) + +commit 4f9817741ff6284c895a90ff15cab3ab056ac21b +Author: Aleksander Morgado +Date: Mon Sep 10 13:45:23 2012 +0200 + + broadband-modem: new methods to lock/unlock current SMS storages + + The default AT commands to play with SMS rely on AT+CPMS to select + the default + memory storages for different operations. AT+CPMS defines 3 different + storages, + called 'mem1' (for reading/listing/deleting), 'mem2' (for storing + or sending + from storage) and 'mem3' (for receiving). + + For example, when an SMS is to be deleted, we first need to select + with AT+CPMS + the proper 'mem1' storage before issuing the command to delete the + SMS part. + But, in order to do this properly we need to synchronize the access + to the + currently set storages, so that no more than one action is run in + the storages + at the same time (e.g. don't store an SMS while another SMS is + being deleted). + In order to synchronize this access, we now provide commands to + lock()/unlock() + the storages, which should be used when we want to do some operation + on them. + + Note that this logic is only required because we cannot specify + the storage + explicitly in the specific AT command operations. With QMI we don't + need this + locking/unlocking. + + src/mm-broadband-modem.c | 147 + ++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-broadband-modem.h | 12 ++++ + 2 files changed, 158 insertions(+), 1 deletion(-) + +commit 83dc9e3e1d32eb72ed60163a066c20d553f4c468 +Author: Aleksander Morgado +Date: Mon Sep 10 12:42:54 2012 +0200 + + iface-modem-messaging: new methods to check support for storage + actions + + We can now check whether a specific storage is valid for receiving + or storing. + + src/mm-iface-modem-messaging.c | 60 + ++++++++++++++++++++++++++++++------------ + src/mm-iface-modem-messaging.h | 8 ++++++ + 2 files changed, 51 insertions(+), 17 deletions(-) + +commit bfa742ae13f36150e7b08fa0e9428a4a4f0f1d96 +Author: Aleksander Morgado +Date: Mon Sep 10 11:59:58 2012 +0200 + + broadband-modem-qmi: we don't support 3GPP2 messaging yet + + src/mm-broadband-modem-qmi.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit e6a4c72ebc1e0f32722c58c03eaa19ee237cf6dc +Author: Aleksander Morgado +Date: Mon Sep 10 11:27:56 2012 +0200 + + sms-qmi: handle sending/storing multipart SMS messages + + src/mm-sms-qmi.c | 251 + ++++++++++++++++++++++++++++++------------------------- + 1 file changed, 135 insertions(+), 116 deletions(-) + +commit 3c814d74caeef9218bf678e21e56fa054ad67703 +Author: Aleksander Morgado +Date: Fri Sep 7 20:18:16 2012 +0200 + + sms-part: create proper SUBMIT PDUs for multipart SMS messages + + If the SMS part is from a multipart message we'll need to create a + PDU with a + proper User Data Header. + + This patch is based on a previous implementation by: + Roberto Majadas + + src/mm-sms-part.c | 122 + +++++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 83 insertions(+), 39 deletions(-) + +commit 3332ec0c688ce302ba276f5aa0a31d62452cec8b +Author: Aleksander Morgado +Date: Fri Sep 7 18:01:25 2012 +0200 + + sms: try to store/send all parts of a SMS message + + src/mm-sms.c | 213 + ++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 114 insertions(+), 99 deletions(-) + +commit b2b7fccdf58eda4f7d1f6585cb0749d1812103f7 +Author: Aleksander Morgado +Date: Fri Sep 7 17:38:40 2012 +0200 + + sms: allow users to create multipart SMS messages + + src/mm-sms.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 61 insertions(+), 2 deletions(-) + +commit 0edb58b7381ef38e04a6b3b5e84828b3e5ffc74a +Author: Aleksander Morgado +Date: Fri Sep 7 17:37:55 2012 +0200 + + sms: always export incomplete multipart SMS messages + + src/mm-sms-list.c | 7 ------- + src/mm-sms.c | 8 ++++++++ + 2 files changed, 8 insertions(+), 7 deletions(-) + +commit e7b094ea3c67209f305b3f8b9cb9eb8ed89d52b5 +Author: Aleksander Morgado +Date: Fri Sep 7 17:00:03 2012 +0200 + + sms-part: new util to split input text string into chunks to fit + in PDUs + + src/mm-sms-part.c | 107 ++++++++++++++++++++++++++++++++++++ + src/mm-sms-part.h | 3 + + src/tests/test-sms-part.c | 137 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 247 insertions(+) + +commit 6b575cece08f026710d4421c11dfba8051036dc4 +Author: Aleksander Morgado +Date: Fri Sep 7 14:33:27 2012 +0200 + + sms-part: allow storing and accessing the user encoding info of an + SMS part + + src/mm-sms-part.c | 37 ++++++++++++++++++------------------- + src/mm-sms-part.h | 11 +++++++++++ + 2 files changed, 29 insertions(+), 19 deletions(-) + +commit cb0ce9c6ca13fafb0c86182aa2924f296cfeb48b +Author: Aleksander Morgado +Date: Fri Sep 7 13:56:45 2012 +0200 + + sms: either 'text' or 'data' is mandatory + + src/mm-sms.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit c2b246414cb7d4bbd6782b7879fa66a7d627177a +Author: Aleksander Morgado +Date: Thu Sep 13 14:57:55 2012 +0200 + + iface-modem-3gpp: update state to REGISTERED after loading operator + code/name + + Call managers all want to be able to set the operator ID and/or name + as soon as + we get registered. We will consider now that whenever we get into + registered + state we already have operator code and name updated to the proper + values. + + Applications shouldn't, though, just rely on those values to be + valid as long as + we're registered, as the modem may re-register automatically in + some other + network (e.g. going from a roaming network to the home network). + + This change involves not setting the state to REGISTERED until + operator name + and code loading sequences have been run. We will still signal in + the log the + change, with a new 'registering' intermediate state indication. + + src/mm-broadband-modem.c | 3 +- + src/mm-iface-modem-3gpp.c | 254 + ++++++++++++++++++++++++++++++++-------------- + src/mm-iface-modem-3gpp.h | 8 +- + 3 files changed, 189 insertions(+), 76 deletions(-) + +commit 40816e5c90b73fef238da525af91b69657ceb203 +Author: Aleksander Morgado +Date: Thu Sep 13 16:04:24 2012 +0200 + + broadband-modem-qmi: don't update access technology from operator info + + The operator info seems to show what the operator can do; it doesn't + show the + current access technology. + + src/mm-broadband-modem-qmi.c | 48 + ++++++-------------------------------------- + 1 file changed, 6 insertions(+), 42 deletions(-) + +commit 4b906f7996256bf16453bc05b4b5444f8a692411 +Author: Aleksander Morgado +Date: Thu Sep 13 15:17:36 2012 +0200 + + broadband-modem-qmi: update access technology along with signal + quality + + src/mm-broadband-modem-qmi.c | 33 +++++++++++++++++++++++++++------ + 1 file changed, 27 insertions(+), 6 deletions(-) + +commit 0080a0d023278bcb456b810cf29eba1901e2d381 +Author: Aleksander Morgado +Date: Thu Sep 13 14:57:16 2012 +0200 + + broadband-modem-qmi: handle SEARCHING registration state + + src/mm-broadband-modem-qmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 210af3241cd950e09d02451decb7a035993eba08 +Author: Dan Williams +Date: Wed Sep 12 23:02:53 2012 -0500 + + core: fix a leak in "core: better handling of non-UCS2 conversions + that should be UCS2 (bgo #683817)" + + src/mm-charsets.c | 1 + + 1 file changed, 1 insertion(+) + +commit c524734d9fd897add850391e7db0a1060e2f6c37 +Author: Dan Williams +Date: Tue Sep 11 16:36:16 2012 -0500 + + core: better handling of non-UCS2 conversions that should be UCS2 + (bgo #683817) + + Some modems return the +COPS operator name in hex-encoded current + character set (as set with +CSCS). Others return the operator name + in ASCII when set to UCS2, while yet others return the ASCII name + with trash at the end (*cough* Huawei *cough*). Handle that better + by not crashing. + + src/mm-charsets.c | 42 ++++++++++++++++++++++++++++++------------ + src/mm-charsets.h | 3 +-- + src/tests/test-charsets.c | 39 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 70 insertions(+), 14 deletions(-) + +commit 73ced242da75abf63a1b5be47ad95123a9e53a3f +Author: Aleksander Morgado +Date: Wed Sep 12 07:59:39 2012 +0200 + + api: remove `Completed' signal from the Messaging interface + + This signal is no longer needed, as the individual state changes of + the SMS + objects are enough to know their correct status of completion. + + See https://bugzilla.gnome.org/show_bug.cgi?id=675178 + + .../org.freedesktop.ModemManager1.Modem.Messaging.xml | 14 + -------------- + 1 file changed, 14 deletions(-) + +commit ea87a4556e4f4d09d0c4eaa6d85a7efc85431328 +Author: Aleksander Morgado +Date: Tue Sep 11 16:19:38 2012 +0200 + + sms: fix full data setting with `g_variant_new_from_data()' + + The `g_variant_new_from_data()' method uses the original array + during its + operation, so we need to make sure it is valid as long as the + method needs + it, or we'll end up with Valgrind complaining a bit: + + ==4834== Invalid read of size 1 + ==4834== at 0x36ADC75DA5: g_variant_get_byte (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x3161ABED8C: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161ABEEA2: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161ABE844: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161ABE91E: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161ABEEA2: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161AC232E: g_dbus_message_to_blob (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161AB750A: ??? (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161AB9FEF: g_dbus_connection_send_message (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x3161ABDB22: g_dbus_connection_emit_signal (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x4C5B8BD: _mm_gdbus_sms_emit_changed + (mm-gdbus-sms.c:2291) + ==4834== by 0x36ADC47694: g_main_context_dispatch (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== Address 0x939efa0 is 0 bytes inside a block of size + 512 free'd + ==4834== at 0x4A079AE: free (vg_replace_malloc.c:427) + ==4834== by 0x36ADC4D37E: g_free (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x36ADC1CF40: ??? (in + /usr/lib64/libglib-2.0.so.0.3200.4) + ==4834== by 0x43C88E: assemble_sms (mm-sms.c:1260) + ==4834== by 0x43CAD6: mm_sms_multipart_take_part (mm-sms.c:1329) + ==4834== by 0x43E2EF: take_multipart (mm-sms-list.c:268) + ==4834== by 0x43E546: mm_sms_list_take_part (mm-sms-list.c:328) + ==4834== by 0x454C8F: mm_iface_modem_messaging_take_part + (mm-iface-modem-messaging.c:353) + ==4834== by 0x461DF6: sms_pdu_part_list_ready + (mm-broadband-modem.c:5007) + ==4834== by 0x3161A6CFB6: g_simple_async_result_complete (in + /usr/lib64/libgio-2.0.so.0.3200.4) + ==4834== by 0x432F82: at_command_parse_response + (mm-base-modem-at.c:490) + ==4834== by 0x489F96: handle_response (mm-at-serial-port.c:161) + + src/mm-sms.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 36c7136510d40313c2dcbcb847d9092d0f56148a +Author: Ben Chan +Date: Mon Sep 10 22:22:17 2012 -0700 + + novatel-lte: implement modem reset + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 26 + ++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit 776d755d7704773b8ca92a7e87774ba0c8217302 +Author: Ben Chan +Date: Sat Sep 8 20:18:21 2012 -0700 + + iface-modem-3gpp-ussd: avoid update if object skeleton is NULL + + src/mm-iface-modem-3gpp-ussd.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 8213a09a3412a3eb47666c6ccc6a56a75adbb668 +Author: Dan Williams +Date: Wed Sep 5 16:11:51 2012 -0500 + + broadband-modem-qmi: set network port to 802.3/no-QoS mode + + The kernel drivers expect this mode, so make sure we set it. + + src/mm-bearer-qmi.c | 1 + + src/mm-broadband-modem-qmi.c | 1 + + src/mm-port-probe.c | 1 + + src/mm-qmi-port.c | 9 ++++++++- + src/mm-qmi-port.h | 1 + + 5 files changed, 12 insertions(+), 1 deletion(-) + +commit 5f1a1cf834d06a6ed430f835b8d694c4dd44ac95 +Author: Ben Chan +Date: Fri Sep 7 14:15:12 2012 -0700 + + icera: increase timeout for +CFUN=4 + + plugins/icera/mm-broadband-modem-icera.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 1252572607094cc0036dd656e6d596510ce49f39 +Author: Ben Chan +Date: Fri Sep 7 13:39:39 2012 -0700 + + novatel-lte: set default SMS storage to 'SM' + + Novatel E362 LTE modem only supports 'SM' and 'SR', but not 'ME'. + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2ca6d6285696d09d7a0f8bad3a551e6af0dd9be1 +Author: Aleksander Morgado +Date: Fri Sep 7 13:13:14 2012 +0200 + + broadband-modem: clear error properly as it may be re-used + + Avoids this kind of issues: + + [mm-sms-list.c:334] mm_sms_list_take_part(): SMS part at 'me/0' + is from a singlepart SMS + [mm-iface-modem-messaging.c:475] sms_added(): Added received SMS at + '/org/freedesktop/ModemManager1/SMS/31' + [mm-broadband-modem.c:4791] sms_pdu_part_list_ready(): Error parsing + PDU (1): PDU too short (2): 41 < 79 + + GLib-WARNING **: GError set over the top of a previous GError or + uninitialized memory. + This indicates a bug in someone's code. You must ensure an error is + NULL before it's set. + The overwriting error message was: PDU too short (3): 28 < (210 + + 14), user data length: '203' + + [mm-broadband-modem.c:4791] sms_pdu_part_list_ready(): Error parsing + PDU (2): PDU too short (3): 28 < (210 + 14), user data length: '203' + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a973825eac2b741282c3e09410362ed96f4d6c28 +Author: Aleksander Morgado +Date: Fri Sep 7 12:20:14 2012 +0200 + + sms: multipart sequence starts with 1; singlepart is always 0 + + src/mm-sms-list.c | 6 ++++-- + src/mm-sms.c | 48 ++++++++++++++++++++++++++++++++++++------------ + 2 files changed, 40 insertions(+), 14 deletions(-) + +commit f2cc69bc7f729efc2400cb01681b54a9fa148858 +Author: Aleksander Morgado +Date: Fri Sep 7 11:19:46 2012 +0200 + + cli: include both current and modem capabilities in modem report + + cli/mmcli-modem.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 997848ef4f6417bbd10696447e6754b7b69d8ee2 +Author: Aleksander Morgado +Date: Fri Sep 7 11:19:26 2012 +0200 + + broadband-modem-qmi: try to use Band Preference for current caps + if available + + The "NAS Get System Selection Preference" response may come without + "Mode + Preference". If that is found, look for "Band Preference" and + "LTE Band + Preference" TLVs and try to build capabilities from those. + + This makes my UML290 properly report CDMA/EVDO+LTE capabilities: + + ModemManager[16586]: [/dev/cdc-wdm0] Received message... + >>>>>> QMUX: + >>>>>> length = 55 + >>>>>> flags = 0x80 + >>>>>> service = "nas" + >>>>>> client = 1 + >>>>>> QMI: + >>>>>> flags = "response" + >>>>>> transaction = 1 + >>>>>> tlv_length = 43 + >>>>>> message = "Get System Selection Preference" (0x0034) + >>>>>> TLV: + >>>>>> type = "Result" (0x02) + >>>>>> length = 4 + >>>>>> value = 00:00:00:00 + >>>>>> translated = SUCCESS + >>>>>> TLV: + >>>>>> type = "Emergency mode" (0x10) + >>>>>> length = 1 + >>>>>> value = 00 + >>>>>> translated = 0 + >>>>>> TLV: + >>>>>> type = "Band Preference" (0x12) + >>>>>> length = 8 + >>>>>> value = 07:00:00:00:00:00:00:00 + >>>>>> translated = 7 + >>>>>> TLV: + >>>>>> type = "CDMA PRL Preference" (0x13) + >>>>>> length = 2 + >>>>>> value = FF:3F + >>>>>> translated = 16383 + >>>>>> TLV: + >>>>>> type = "Roaming Preference" (0x14) + >>>>>> length = 2 + >>>>>> value = FF:00 + >>>>>> translated = 255 + >>>>>> TLV: + >>>>>> type = "LTE Band Preference" (0x15) + >>>>>> length = 8 + >>>>>> value = 00:00:00:00:00:00:00:00 + >>>>>> translated = 0 + ModemManager[16586]: KEY: 01:00:01:03:00:00:00:00 + ModemManager[16586]: Service: 03 + ModemManager[16586]: Client ID: 01 + ModemManager[16586]: Transaction ID: 01:00 + ModemManager[16586]: + [1347005734.979115] [mm-broadband-modem-qmi.c:321] + load_current_capabilities_get_system_selection_preference_ready(): + Mode preference not reported in system selection preference + ModemManager[16586]: + [1347005734.979131] [mm-broadband-modem-qmi.c:333] + load_current_capabilities_get_system_selection_preference_ready(): + Valid bands reported in system selection preference: 'bc-0-a-system, + bc-0-b-system, bc-1-all-blocks' + ModemManager[16586]: + [1347005734.979141] [mm-broadband-modem-qmi.c:341] + load_current_capabilities_get_system_selection_preference_ready(): + LTE band preference found + ModemManager[16586]: [/dev/cdc-wdm0] Sending message... + <<<<<< QMUX: + <<<<<< length = 12 + <<<<<< flags = 0x00 + <<<<<< service = "dms" + <<<<<< client = 1 + <<<<<< QMI: + <<<<<< flags = "none" + <<<<<< transaction = 1 + <<<<<< tlv_length = 0 + <<<<<< message = "Get Capabilities" (0x0020) + ModemManager[16586]: KEY: 01:00:01:02:00:00:00:00 + ModemManager[16586]: Service: 02 + ModemManager[16586]: Client ID: 01 + ModemManager[16586]: Transaction ID: 01:00 + ModemManager[16586]: [1347005734.982676] + [mm-at-serial-port.c:392] debug_log(): (ttyACM0): <-- + 'OK' + ModemManager[16586]: [1347005734.982751] + [mm-serial-port.c:969] mm_serial_port_close(): (ttyACM0) device open + count is 2 (close) + ModemManager[16586]: [1347005734.982797] + [mm-at-serial-port.c:392] debug_log(): (ttyACM0): --> 'AT+CMEE=1' + ModemManager[16586]: [/dev/cdc-wdm0] Received message... + >>>>>> QMUX: + >>>>>> length = 38 + >>>>>> flags = 0x80 + >>>>>> service = "dms" + >>>>>> client = 1 + >>>>>> QMI: + >>>>>> flags = "response" + >>>>>> transaction = 1 + >>>>>> tlv_length = 26 + >>>>>> message = "Get Capabilities" (0x0020) + >>>>>> TLV: + >>>>>> type = "Result" (0x02) + >>>>>> length = 4 + >>>>>> value = 00:00:00:00 + >>>>>> translated = SUCCESS + >>>>>> TLV: + >>>>>> type = "Info" (0x01) + >>>>>> length = 16 + >>>>>> value = B0:9D:57:00:00:DD:6D:00:03:02:05:01:02:04:05:08 + >>>>>> translated = [ max_tx_channel_rate = '5742000' + max_rx_channel_rate = '7200000' data_service_capability = '3' + sim_capability = '2' radio_interface_list = '{ [0] = '1 ' [1] = '2 ' + [2] = '4 ' [3] = '5 ' [4] = '8 '}' ] + ModemManager[16586]: KEY: 01:00:01:02:00:00:00:00 + ModemManager[16586]: Service: 02 + ModemManager[16586]: Client ID: 01 + ModemManager[16586]: Transaction ID: 01:00 + ModemManager[16586]: + [1347005734.983353] [mm-broadband-modem-qmi.c:183] + modem_load_current_capabilities_finish(): loaded current capabilities: + cdma-evdo, lte + + src/mm-broadband-modem-qmi.c | 26 ++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 58 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.h | 2 ++ + 3 files changed, 86 insertions(+) + +commit c2952e0adc3534bfb28ad57f30e9690b236c49a9 +Author: Aleksander Morgado +Date: Fri Sep 7 09:50:49 2012 +0200 + + broadband-modem-qmi: don't always trust the current capabilities + reported by SSP + + Sometimes the 'Mode Preference' TLV in the SSP response will have + incorrect + values. The following log is for a Gobi3k modem which is *only* + GMS/UMTS. + + ModemManager[13415]: [/dev/cdc-wdm0] Received message... + >>>>>> QMUX: + >>>>>> length = 44 + >>>>>> flags = 0x80 + >>>>>> service = "nas" + >>>>>> client = 2 + >>>>>> QMI: + >>>>>> flags = "response" + >>>>>> transaction = 1 + >>>>>> tlv_length = 32 + >>>>>> message = "Get System Selection Preference" (0x0034) + >>>>>> TLV: + >>>>>> type = "Result" (0x02) + >>>>>> length = 4 + >>>>>> value = 00:00:00:00 + >>>>>> translated = SUCCESS + >>>>>> TLV: + >>>>>> type = "Emergency mode" (0x10) + >>>>>> length = 1 + >>>>>> value = 00 + >>>>>> translated = 0 + >>>>>> TLV: + >>>>>> type = "Mode Preference" (0x11) + >>>>>> length = 2 + >>>>>> value = 0F:00 + >>>>>> translated = 15 + >>>>>> TLV: + >>>>>> type = "Band Preference" (0x12) + >>>>>> length = 8 + >>>>>> value = FF:FF:FF:3F:FF:FF:FF:FF + >>>>>> translated = 18446744070488326143 + >>>>>> TLV: + >>>>>> type = "Roaming Preference" (0x14) + >>>>>> length = 2 + >>>>>> value = FF:00 + >>>>>> translated = 255 + + Instead of setting to '1' only the bits related to GSM/UMTS in the + "Mode + Preference" TLV, the modem sets all the bits it knows of to '1', + including the + CDMA/EVDO ones. It is not easy to detect this properly, because the + modem didn't + set to '1' the bits it didn't know of (e.g. LTE or TD-SCDMA), so + we *cannot* + assume that 0x000F actually means 'unknown'. + + So, we now will pass these returned values through the "DMS Get + Capabilities" + filter, as we did for the Technology Preference result. The final + reported + current capabilities will be either: + * The intersection between the capabilities loaded by "NAS Get + System Selection + Preference" and "DMS Get Capabilities" or, + * The intersection between the capabilities loaded by "NAS Get + Technology + Preference" and "DMS Get Capabilities". + + For 'modem' (not 'current') capabilities, we still rely only on + "DMS Get + Capabilities". + + src/mm-broadband-modem-qmi.c | 70 + ++++++++++++++++++++------------------------ + 1 file changed, 32 insertions(+), 38 deletions(-) + +commit ebc7b3dc70dd15b5f0d2bf0bb4ca03c34fae3a02 +Author: Aleksander Morgado +Date: Thu Sep 6 19:22:23 2012 +0200 + + sms-qmi: implement SMS part deleting + + src/mm-sms-qmi.c | 140 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +commit a8ec884931286b8f5aca36adb44ced316492dcb6 +Author: Aleksander Morgado +Date: Thu Sep 6 18:44:36 2012 +0200 + + sms-qmi: implement singlepart SMS sending + + src/mm-sms-qmi.c | 252 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 252 insertions(+) + +commit d3b632c7a83a08e6d8dbab4e596fb5ee5af13855 +Author: Aleksander Morgado +Date: Thu Sep 6 16:39:53 2012 +0200 + + sms-qmi: implement singlepart SMS storage + + src/mm-sms-qmi.c | 193 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 193 insertions(+) + +commit bdf4df2b6b9dd795f12f457f6ce101fee9679c64 +Author: Aleksander Morgado +Date: Thu Sep 6 16:04:25 2012 +0200 + + sms-qmi: new `MMSmsQmi' object + + src/Makefile.am | 2 ++ + src/mm-broadband-modem-qmi.c | 11 ++++++++++ + src/mm-sms-qmi.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-qmi.h | 50 + ++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 113 insertions(+) + +commit 912eea79ef8510d2df15f3732c2abdcb0ab3e21f +Author: Aleksander Morgado +Date: Thu Sep 6 14:11:04 2012 +0200 + + broadband-modem-qmi: implement unsolicited messaging events + setup/cleanup + + src/mm-broadband-modem-qmi.c | 288 + ++++++++++++++++++++++++++++++++++++------- + src/mm-modem-helpers-qmi.c | 13 ++ + src/mm-modem-helpers-qmi.h | 1 + + 3 files changed, 259 insertions(+), 43 deletions(-) + +commit 3db1094e411d52a6946adbbb78023719e674c796 +Author: Aleksander Morgado +Date: Thu Sep 6 13:40:47 2012 +0200 + + broadband-modem-qmi: implement unsolicited messaging events + enabling/disabling + + src/mm-broadband-modem-qmi.c | 135 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 135 insertions(+) + +commit 249ec8955cd4ed5483539a968660a0d7a1cb3c7d +Author: Aleksander Morgado +Date: Thu Sep 6 13:26:56 2012 +0200 + + broadband-modem-qmi: minor indentation fix + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0fb980a28a689bb5bacc800982ddffe28339d29d +Author: Aleksander Morgado +Date: Thu Sep 6 12:13:05 2012 +0200 + + broadband-modem-qmi: load initial SMS parts using QMI + + src/mm-broadband-modem-qmi.c | 232 + +++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 18 ++++ + src/mm-modem-helpers-qmi.h | 2 + + 3 files changed, 252 insertions(+) + +commit 454b0e1c33cf067b24609aba2f252128a4b76971 +Author: Aleksander Morgado +Date: Tue Sep 4 13:39:19 2012 +0200 + + broadband-modem-qmi: implement default storage setting using QMI + + src/mm-broadband-modem-qmi.c | 104 + +++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 15 +++++++ + src/mm-modem-helpers-qmi.h | 5 +++ + 3 files changed, 124 insertions(+) + +commit 26596b1615463a0c270b1b97136377a24d949627 +Author: Aleksander Morgado +Date: Tue Sep 4 09:49:10 2012 +0200 + + broadband-modem-qmi: no need to setup SMS format, always in PDU mode + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 88942a5f1baca9b25b553adfda38beec45132107 +Author: Aleksander Morgado +Date: Tue Sep 4 09:42:14 2012 +0200 + + broadband-modem-qmi: QMI enabled modems have SM and ME messaging + storages + + src/mm-broadband-modem-qmi.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 9235a24c11cfab7fc890fd9c65dd3db112046f98 +Author: Aleksander Morgado +Date: Tue Sep 4 09:41:36 2012 +0200 + + broadband-modem-qmi: if WMS service is available Messaging is + supported + + src/mm-broadband-modem-qmi.c | 46 + ++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 42 insertions(+), 4 deletions(-) + +commit 018d9b458f1c5456cf131659548c3dec09965aad +Author: Aleksander Morgado +Date: Thu Sep 6 19:14:07 2012 +0200 + + sms: set state back to UNKNOWN when all SMS parts were deleted + + src/mm-sms.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit c9a80609d49ccf0c52f175b7d2a7a96b9756cd2a +Author: Aleksander Morgado +Date: Thu Sep 6 18:25:38 2012 +0200 + + sms: transition from Unknown|Stored to Sent when the SMS is sent + + src/mm-sms.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit a5266406ba3a28397a4c31b5b127aada9c2ec8eb +Author: Aleksander Morgado +Date: Thu Sep 6 17:50:04 2012 +0200 + + sms: use property accessors from parent MmGdbusSms when it simplifies + things + + src/mm-sms.c | 38 ++++++++++---------------------------- + 1 file changed, 10 insertions(+), 28 deletions(-) + +commit 8fd02318ec5aee2b44924d1e49d991e5a5dbf3a5 +Author: Aleksander Morgado +Date: Thu Sep 6 17:45:12 2012 +0200 + + sms: transition from Unknown to Stored in user-created SMS objects + + src/mm-sms.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit b03985a019181511c5147e9ec54790a87e004e66 +Author: Aleksander Morgado +Date: Thu Sep 6 17:33:45 2012 +0200 + + sms: user-created SMS objects will have either 'text' or 'data' + + .../org.freedesktop.ModemManager1.Modem.Messaging.xml | 3 ++- + src/mm-sms.c | 14 + ++++++++++---- + 2 files changed, 12 insertions(+), 5 deletions(-) + +commit 39e819788d9d6751a1b90be4dc1b400b7e6cbcc4 +Author: Aleksander Morgado +Date: Thu Sep 6 17:33:03 2012 +0200 + + libmm-common,sms-properties: handle the 'data' property for SMS + + libmm-common/mm-sms-properties.c | 92 + +++++++++++++++++++++++++++++++++++++++- + libmm-common/mm-sms-properties.h | 39 ++++++++++------- + 2 files changed, 115 insertions(+), 16 deletions(-) + +commit 163e16754388f74d2bac28e28573de37e837f9ed +Author: Aleksander Morgado +Date: Thu Sep 6 17:32:33 2012 +0200 + + sms-part: beware of NULL input data + + src/mm-sms-part.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 98f588867caf95b174eb3bcf09af7f43c1bdb791 +Author: Aleksander Morgado +Date: Thu Sep 6 16:38:57 2012 +0200 + + sms: allow getting list of parts + + src/mm-sms.c | 6 ++++++ + src/mm-sms.h | 1 + + 2 files changed, 7 insertions(+) + +commit a90d149ce476010747a32398df8b556ec597afb1 +Author: Aleksander Morgado +Date: Thu Sep 6 15:58:48 2012 +0200 + + sms: SMS objects need to be create by `create_modem()' in the + Messaging iface + + So that plugins can subclass the generic SMS object. + + src/mm-broadband-modem.c | 11 ++++++++++- + src/mm-iface-modem-messaging.c | 10 ++++++++++ + src/mm-iface-modem-messaging.h | 5 ++++- + src/mm-sms.c | 10 ++++++++-- + 4 files changed, 32 insertions(+), 4 deletions(-) + +commit 11740e9075fd43009929c57b86d78d82c34aed78 +Author: Aleksander Morgado +Date: Tue Sep 4 09:47:32 2012 +0200 + + iface-modem-messaging: plug memleak + + src/mm-iface-modem-messaging.c | 1 + + 1 file changed, 1 insertion(+) + +commit db457fdb468b614c5cdc314d3f08b9b20f64f84e +Author: Aleksander Morgado +Date: Thu Sep 6 13:13:07 2012 +0200 + + sms: fix setting full text in object + + src/mm-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 28c22ce8dbec9e48b836e8dd4cd983c97914d02c +Author: Aleksander Morgado +Date: Thu Sep 6 13:13:18 2012 +0200 + + sms-list: add helper debug logs + + src/mm-sms-list.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 32c41f62e51ece885190910e258b35f1c4f36ee4 +Author: Aleksander Morgado +Date: Thu Sep 6 13:04:42 2012 +0200 + + sms-part: add helper debug logs + + src/mm-sms-part.c | 9 +++++++-- + src/tests/test-sms-part.c | 11 +++++++++++ + 2 files changed, 18 insertions(+), 2 deletions(-) + +commit 176498239f9024c5954edb06c20da0fc457cc1b6 +Author: Aleksander Morgado +Date: Thu Sep 6 12:47:15 2012 +0200 + + sms-part: new `mm_sms_part_new_from_binary_pdu()' method + + src/mm-sms-part.c | 35 ++++++++++++++++++++++------------- + src/mm-sms-part.h | 4 ++++ + 2 files changed, 26 insertions(+), 13 deletions(-) + +commit 4c2951692cffd44d0b8b3ebfe91c2943d77f92d8 +Author: Aleksander Morgado +Date: Wed Sep 5 18:31:51 2012 -0700 + + bearer: set signal handlers only after setting 'config' and 'modem' + properties + + Modem plugins may set the 'modem' property before the 'config' + property when + creating a bearer. set_signal_handlers() should thus be called + after both + properties are set such that + modem_{3gpp,cdma}_registration_state_changed + checks roaming allowance correctly when launching a connection. + + Based on a draft patch by: + Ben Chan + + src/mm-bearer.c | 25 ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +commit e3152772e5a3219748fe3ac19a4dd3f5a3dab098 +Author: Ben Chan +Date: Wed Sep 5 17:21:53 2012 -0700 + + icera: properly specify MM_BROADBAND_BEARER_ICERA_DEFAULT_IP_METHOD + property + + plugins/icera/mm-broadband-bearer-icera.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 143674ea3ed47062fa382a5c3a411b5e811583d4 +Author: Ben Chan +Date: Wed Sep 5 23:26:23 2012 -0700 + + sms: use g_variant_new_from_data instead of g_variant_new_fixed_array + + ModemManager configure script currenty requires glib 2.30.2 or later, + bud g_variant_new_fixed_array requires at least glib 2.32. To maintain + the compatibility with glib 2.30, this patch modifies the code to use + g_variant_new_from_data instead of g_variant_new_fixed_array. + + src/mm-sms.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 02b71336ae98775c1a613b5a4133515ea7b06c4a +Author: Marius B. Kotsbak +Date: Thu Sep 6 08:36:34 2012 +0200 + + zte: extend allowed modes for LTE/4G devices for +ZSNT command + + Updates: + AT+ZSNT=6 means LTE only + AT+ZSNT to specify 2G and 3G doesn't support 2G or 3G preference + in LTE modems + + Tested with a ZTE MF 820D. + + plugins/zte/mm-broadband-modem-zte.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +commit 4804c376049ad5746eb054ab5ed08bc4d8f9fedf +Author: Aleksander Morgado +Date: Wed Sep 5 19:51:18 2012 +0200 + + build: new `--without-qmi' configure option + + For those who don't care about the QMI support through libqmi-glib, + or if you're + stuck with glib 2.30 (libqmi-glib requires 2.32), this configure + switch allows + disabling the QMI support completely. + + The logic to detect cdc-wdm ports is still in place, but the QMI + probing is + never launched at them. Also, all QMI-related objects won't be + compiled. + + configure.ac | 23 +++++++++++++++-- + plugins/Makefile.am | 4 +++ + plugins/generic/mm-plugin-generic.c | 7 +++++- + plugins/gobi/mm-plugin-gobi.c | 7 +++++- + plugins/huawei/mm-plugin-huawei.c | 7 +++++- + plugins/pantech/mm-plugin-pantech.c | 5 ++++ + plugins/sierra/mm-plugin-sierra.c | 7 +++++- + src/Makefile.am | 49 + ++++++++++++++++++++++++------------- + src/mm-base-modem.c | 33 ++++++++++++++++++++++++- + src/mm-base-modem.h | 9 +++++++ + src/mm-port-probe.c | 25 ++++++++++++++++++- + src/mm-port-probe.h | 2 ++ + src/mm-port.h | 2 +- + src/tests/Makefile.am | 26 ++++++++++++++++++++ + 14 files changed, 180 insertions(+), 26 deletions(-) + +commit bf1da3faea4605a9a1305993b04e9db425561b1d +Author: Aleksander Morgado +Date: Tue Sep 4 11:34:00 2012 +0200 + + iface-modem-simple: never remove connected bearers + + Modems have a maximum of bearers allowed to be connected at a time, + number which + is given by the number of available ports that may be used for + data connections. + + When Simple.Connect() tries to launch a connection, it will try to + find first an + existing bearer with the required parameters (e.g. APN, IP type). If + such bearer + is found, it will just use it. If no such bearer is found, it will + try to create + one. When trying to create one, if there is no more room for bearers + in the + modem, we will remove the first disconnected bearer that we find, + if any, before + trying to create the new one. This logic now makes sure that no + connected bearer + gets removed in order to create a new one, and also that only one + existing gets + removed if possible (not every bearer as we did previously). + + Further logic to connect multiple bearers at a time cannot be done + using the + Simple interface. + + src/mm-iface-modem-simple.c | 59 + ++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 55 insertions(+), 4 deletions(-) + +commit 72db2a53ed114a6b46515130a6ed8238eba35bfe +Author: Aleksander Morgado +Date: Mon Sep 3 17:20:29 2012 +0200 + + plugin: defer task if supports check tells us to retry + + Huawei modems will probe interface 0 always first; if we try to + probe another + interface meanwhile the supports check will give us a + MM_CORE_ERROR_RETRY error, + indicating that we need to defer the probing of the port. + + src/mm-plugin.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit 9c2a6320a82aa301b2415227741a8bff5a33ea1b +Author: Marius B. Kotsbak +Date: Mon Sep 3 18:26:59 2012 +0200 + + sierra: add support for new !SELRAT values in newer Sierra LTE modems + + AT!SELRAT=? + !SELRAT: Index, Name + 00, Automatic + 01, UMTS 3G Only + 02, GSM 2G Only + 03, Automatic + 04, Automatic + 05, GSM and UMTS Only + 06, LTE Only + 07, GSM, UMTS, LTE + + plugins/sierra/mm-broadband-modem-sierra.c | 45 + ++++++++++++++++++++++++++---- + 1 file changed, 39 insertions(+), 6 deletions(-) + +commit d99169022eefe658e405051ef58c1af6c653faee +Author: Aleksander Morgado +Date: Mon Sep 3 09:43:52 2012 +0200 + + iface-modem: don't try to use the bearer list if there is none + + When the modem gets unplugged, or system gone into suspend, we start + losing the + modem ports one by one. When the last is lost, we trigger the disposal + of the + modem (we call g_object_run_dispose() and then we call the + main-reference + unref()). So, if we end up losing all ports while the connection + sequence was + being run, we would end up in this situation, where we try to + disconnect the + bearers (the bearer and modem objects are still valid, as we have + references + around, but the list of bearers won't be available any more in the + modem object + as it was cleared in the modem dispose(). + + Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) + + 0x7f5cdbd5cda0 [ModemManager] - + mm-bearer-list.c:163] mm_bearer_list_foreach + 0x7f5cdbd6a4bd [ModemManager] - + mm-iface-modem.c:110] bearer_status_changed + 0x7f5cdbad0903 [libgobject-2.0.so.0.3000.2] - gclosure.c:774] + g_closure_invoke + 0x7f5cdbae1dbb [libgobject-2.0.so.0.3000.2] - gsignal.c:3272] + signal_emit_unlocked_R + 0x7f5cdbaeac82 [libgobject-2.0.so.0.3000.2] - gsignal.c:3003] + g_signal_emit_valist + 0x7f5cdbaeae5e [libgobject-2.0.so.0.3000.2] - gsignal.c:3060] + g_signal_emit + 0x7f5cdbad3876 [libgobject-2.0.so.0.3000.2] - gobject.c:925] + g_object_dispatch_properties_changed + 0x7f5cdbad5ceb [libgobject-2.0.so.0.3000.2] - + gobjectnotifyqueue.c:132] g_object_notify_by_pspec + 0x7f5cdbd56b08 [ModemManager] - mm-bearer.c:112] + bearer_update_status + 0x7f5cdbd56ffd [ModemManager] - mm-bearer.c:393] + disconnect_ready + 0x7f5cdbbcc676 [libgio-2.0.so.0.3000.2] - + gsimpleasyncresult.c:749] g_simple_async_result_complete + 0x7f5cdbbcc788 [libgio-2.0.so.0.3000.2] - + gsimpleasyncresult.c:761] complete_in_idle_cb + 0x7f5cdb7cff44 [libglib-2.0.so.0.3000.2] - gmain.c:2441] + g_main_context_dispatch + 0x7f5cdb7d0597 [libglib-2.0.so.0.3000.2] - gmain.c:3089] + g_main_context_iterate + 0x7f5cdb7d0b51 [libglib-2.0.so.0.3000.2] - gmain.c:3297] + g_main_loop_run + 0x7f5cdbd4e331 [ModemManager] - main.c:150] + main + 0x7f5cdb1ea41c [libc-2.15.so] - libc-start.c:234] + __libc_start_main + 0x7f5cdbd4de48 [ModemManager] + 0x00019e48] + + Reported by Ben Chan + + src/mm-iface-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f146c3a3dcc43688e7e8d3eb6b7752567cf2dfc4 +Author: Aleksander Morgado +Date: Sun Sep 2 16:34:39 2012 +0200 + + broadband-modem: avoid segfault when initialization sequence is + aborted + + The ports context is only set if the initialization sequence succeeds; + so don't + try to clear the ports context if it wasn't set. + + src/mm-broadband-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 80fa4cb31216c9448334ac2efe83a488c3c97e35 +Author: Aleksander Morgado +Date: Sun Sep 2 16:20:12 2012 +0200 + + sierra: use generic current capabilities loading + + The generic current capabilities loading already has the required + extra + AT+WS46=? query to see if LTE capabilities are available. + + plugins/sierra/mm-broadband-modem-sierra.c | 133 + ----------------------------- + 1 file changed, 133 deletions(-) + +commit 22d70792dcea230e9224d56dc89d41d6b37532f7 +Author: Aleksander Morgado +Date: Sun Sep 2 16:11:26 2012 +0200 + + broadband-modem: run an extra AT+WS46=? when querying current + capabilities + + Some modems (e.g. Sierra Wireless MC7710 or ZTE MF820D) won't + report LTE + capabilities even if they have them. So just run AT+WS46=? as well + to see + if the current supported modes list includes any LTE-specific mode. + + This is not a big deal, as the AT+WS46=? command is a test command + with a + cache-able result, so the next time we need the command result + (when loading + supported modes) the value will be loaded from the cache. + + src/mm-broadband-modem.c | 139 + +++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 117 insertions(+), 22 deletions(-) + +commit 5eab715bb6a9c3f6aacdb77bcf036d25caed72c6 +Author: Marius B. Kotsbak +Date: Sat Sep 1 02:04:19 2012 +0200 + + modem-helpers: recognize "4G" as LTE access technology + + Some modems (e.g. ZTE MF 820D) report LTE access technology as "4G": + +ZPAS: "4G","PS_ONLY" + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6f2c440b7be4e843c1eb193eb04f111924a89dfd +Author: Dan Williams +Date: Fri Aug 31 12:30:13 2012 -0500 + + broadband-modem-qmi: fix handling of current and overall modem + capabilities + + Current capabilities is the set of *active* radios that can be used + right now. Modem capabilities are the set of all radios the modem + could use, if some action were performed to enable them if they are + not enabled already (firmware reload, changing allowed mode, etc). + + For QMI devices, the DMS Get Capabilities command represents all + radios, and thus "modem capabilities". + + But to read *current* capabilities, ie active radios, we need to + query the NAS System Selection Preference and grab the "mode + preference" TLV. Unfortunately that is only available with NAS + >= 1.1, which means older Gobi devices (1K and 2K) don't support + it. So for older devices, we try to get the Technology Preference + (which takes into account user-requested limitations) and then + mask that with the DMS Get Capabilities result for a best-effort + current capabilities. + + For example, the Pantech UML290VW reports DMS Get Capabilities + of "cdma, evdo, gsm, umts, lte", but a more limited SSP mode + preference according to what modes are actually enabled. Gobi + 1K devices don't support SSP, and the DMS Get Capabilities + reports cdma/evdo or gsm/umts depending on the currently loaded + firmware. Previous to this patch, ModemManager reported all + modes as available on the UML290, ignoring what modes were + actually enabled. + + src/mm-broadband-modem-qmi.c | 310 + ++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers-qmi.c | 57 ++++++++ + src/mm-modem-helpers-qmi.h | 4 + + 3 files changed, 364 insertions(+), 7 deletions(-) + +commit 04ce8b567cca9f3ab125f59af3bd8bfed554adce +Author: Aleksander Morgado +Date: Fri Aug 31 16:52:59 2012 +0200 + + broadband-modem-qmi: use System Selection Preference when available + + Get/Set Technology Preference was introduced in NAS 1.0, so should + be always + available (even if we thought it was introduced in NAS 1.7, that's + not true). + But the newer System Selection Preference behaves better as it + allows more + features like 'preferred' modes; so use it when available (NAS + >= 1.1). + + src/mm-broadband-modem-qmi.c | 66 + +++++++------------------------------------- + src/mm-modem-helpers-qmi.c | 4 --- + src/mm-modem-helpers-qmi.h | 4 --- + 3 files changed, 10 insertions(+), 64 deletions(-) + +commit 61d41978c1b217870f399aa38df9af110ca977b1 +Author: Dan Williams +Date: Fri Aug 31 10:37:49 2012 -0500 + + icera: fix parsing of IP config options + + Some of the IP address items will be 0.0.0.0 depending on what the + other items are, like when the duplicate gateway is set on newer + devices, the first gateway address may be 0.0.0.0. Since that's + not a valid IP address, just don't set that member of the config. + + Second, the intent with the duplicate gateway is only to use that + when the first gateway was not given (ie, was 0.0.0.0) so fix the + check for that. + + plugins/icera/mm-broadband-bearer-icera.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +commit 20539a88e66df64d311752d889d239a34b389d87 +Author: Aleksander Morgado +Date: Fri Aug 31 16:50:56 2012 +0200 + + broadband-modem-qmi: fix compilation when using + `--with-newest-qmi-comands' + + src/mm-broadband-modem-qmi.c | 8 ++++---- + src/mm-modem-helpers-qmi.c | 1 + + 2 files changed, 5 insertions(+), 4 deletions(-) + +commit fa0ccc593e9c7f3f7a5754b5977eb63fe231df32 +Author: Aleksander Morgado +Date: Fri Aug 31 16:41:38 2012 +0200 + + sierra: fix finding LTE capabilities + + plugins/sierra/mm-broadband-modem-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 63ef0990b65a46b56707e6f28534e0e01bc4e22c +Author: Dan Williams +Date: Tue Aug 28 21:33:44 2012 -0500 + + sierra: allow users to help debug APP1 PPP capability + + Most Sierra PPP-based devices are supposed to allow PPP on the + APP1 port, which has a dumb AT parser, leaving the main port + (with the intelligent AT parser) free for status and signal strength. + But out of all the devices I've tested it with (8775, 8781, AC881, + and C885), only the C885 actually works. The rest (including three + different firmware versions for the 8775) either crash or disconnect + shortly after PPP starts. + + To help figure out which devices actually support this, when + running MM in debug mode, users can set the MM_SIERRA_APP1_PPP_OK + environment variable and assume the APP1 port allows PPP. This + is only for debugging purposes. + + plugins/sierra/mm-plugin-sierra.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 369e14f1d374eb2eaeda9724aa70fd0b7242dfab +Author: Aleksander Morgado +Date: Fri Aug 31 14:31:04 2012 +0200 + + huawei: additional unsolicited messages to ignore + + plugins/huawei/mm-broadband-modem-huawei.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit b4e0fa3d89ab4d8b053769335a489cd4517b68ae +Author: Aleksander Morgado +Date: Fri Aug 31 14:23:11 2012 +0200 + + sierra: skip echo removal in the secondary port + + This is the port to git master of the following commit: + + commit d1be19d231a395339b1f452d1a30b73ea77ad528 + Author: Dan Williams + Date: Tue Aug 28 21:58:43 2012 -0500 + + sierra: fix CSQ handling on APP1 port + + The APP1 port doesn't always prefix its replies with + which + runs afoul of the built-in echo removal. Since Sierra modems + are on + the whole well-behaved WRT echo removal, just disable it on the + secondary ports. Only changes behavior for PPP-based devices + since + they are the only ones that use the APP1 ports. + + plugins/sierra/mm-common-sierra.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit fa8c09ca668d27af39c28b9590c5c48410c6b3d5 +Author: Aleksander Morgado +Date: Fri Aug 31 14:19:50 2012 +0200 + + port-probe: speed up QCDM probing a bit + + This is the port to git master of the following commit: + + commit 01201860de5565a78823913423c6b2a762e3731f + Author: Dan Williams + Date: Tue Aug 28 21:12:14 2012 -0500 + + core: speed up QCDM probing a bit + + The point of sending two "version info" commands was to ensure + that + the terminating 0x7E of the first one was processed as a QCDM + frame + boundary and that any random data in the buffer (like AT commands + from probing) got cleared out. The second command would always + get processed as a valid QCDM command if the device supported + QCDM, + since there was no garbage before it. + + Instead of that dance, just prepend the version info message with + an extra 0x7E to ensure a clean QCDM frame which the device + hopefully + responds to immediately. Second, actually process that response + instead of throwing it away. Should save about 3 seconds when + probing QCDM ports. + + src/mm-port-probe.c | 53 + +++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 37 insertions(+), 16 deletions(-) + +commit 061e184d393e22d4331f8f004be110a0176ea4dc +Author: Aleksander Morgado +Date: Fri Aug 31 14:05:29 2012 +0200 + + sierra: use DHCP for the USB 305 (AT&T Lightning) + + This is the port to git master of the following commit: + + commit 44f70121f75d59dbf31a4a9a1a4e87293e509e7a + Author: Dan Williams + Date: Tue Aug 28 20:18:40 2012 -0500 + + sierra: use DHCP for the USB 305 (AT&T Lightning) + + For some reason, my AT&T Lightning just doesn't work with static + IP (AT%IPDPADDR) any more. No traffic passes even though + everything + is set up the way it was before. No idea what happened. Using + latest firmware 2.0.0.11. + + But what's interesting is on Windows the generic Sierra Watcher + app uses DHCP. But on Linux, when using AT%IPDPACT, DHCP doesn't + work. That's odd. But it turns out the modem supports the + "standard" Sierra proprietary AT!SCACT commands, and that + *does* make DHCP work. Crazy no? So since the Windows app + uses DHCP, it's likely that the non-DHCP case + (AT%IPDPACT/AT%IPDPADDR) + either isn't well tested or isn't well supported. With that + in mind, let's just use DHCP for this device in Linux too. + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 59 + ++++++++++++++++++++++++ + 1 file changed, 59 insertions(+) + +commit a195dabc93153c7acc220cd9daccbbf4657bbb62 +Author: Aleksander Morgado +Date: Fri Aug 31 13:56:42 2012 +0200 + + icera: handle additional IPv4 configuration options + + This is the port to git master of the following commit: + + commit c8153b1ecdec1995258b114c90b575af1e721d3d + Author: Dan Williams + Date: Tue Aug 28 12:16:26 2012 -0500 + + icera: handle additional IPv4 configuration options + + Newer devices like the ZTE/Vodafone K3805-z have an enhanced + %IPDPADDR command that includes a netmask and gateway, and + these are necessary to configure the device since it uses /24 + instead of a /32. Since the device is nice enough to tell + us that, we should probably use that information. + + Unfortunately the MM API doens't expose the netmask and gateway + yet, so we'll have to add a GetIP4ConfigEx() method or something + like that, but this commit sets us up to do that. + + plugins/icera/mm-broadband-bearer-icera.c | 47 + +++++++++++++++++++++++++++++-- + 1 file changed, 44 insertions(+), 3 deletions(-) + +commit 529eecdb9771cbb9140af015e4a8a5fdb3df59a7 +Author: Aleksander Morgado +Date: Fri Aug 31 13:54:48 2012 +0200 + + modem-helpers: new helper to convert from netmask string to CIDR + + src/mm-modem-helpers.c | 12 ++++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 14 insertions(+) + +commit ab7f558a2c6376396c021d57175c6faaba57554c +Author: Aleksander Morgado +Date: Fri Aug 31 13:21:35 2012 +0200 + + zte: handle Icera-based devics that use DHCP + + This is the port to git master of the following commit: + + commit d2654a287c309346cc46b535dd974b0a5fc06fd4 + Author: Dan Williams + Date: Tue Aug 28 12:15:30 2012 -0500 + + zte: handle Icera-based devics that use DHCP + + Since we can't autodetect that the devices use DHCP, we'll need to + tag them with udev rules for the time being. + + plugins/zte/77-mm-zte-port-types.rules | 3 +++ + plugins/zte/mm-plugin-zte.c | 7 +++++++ + 2 files changed, 10 insertions(+) + +commit c6a1d91cd5683df2551fd7b9750f23bbad5c1077 +Author: Aleksander Morgado +Date: Fri Aug 31 13:05:32 2012 +0200 + + sierra: use an additional AT+WS46=? to detect LTE capabilities + + Some Sierra modems (e.g. MC7710) will report LTE-specific supported + modes in the + AT+WS46=? reply, but not +CLTE capability in the AT+GCAP reply: + + AT+GCAP + +GCAP: +CGSM + OK + + AT+WS46=? + +WS46: (12,22,25,28,29) + OK + + plugins/sierra/mm-broadband-modem-sierra.c | 133 + +++++++++++++++++++++++++++++ + 1 file changed, 133 insertions(+) + +commit e8ca43e315688f04a4f896646abaffab2b3a395e +Author: Aleksander Morgado +Date: Fri Aug 31 12:31:00 2012 +0200 + + broadband-modem: if the generic CNMI request fails, try a + Qualcomm-compatible one + + This is the port to git master of the following commit: + + commit 1d9164ec90788d1be134482ff88c501e3c5d623c + Author: Dan Williams + Date: Mon Aug 27 18:20:33 2012 -0500 + + gsm: if the generic CNMI request fails, try a Qualcomm-compatible + one + + Many devices based on Qualcomm chipsets don't support a value + of '1', despite saying they do in the AT+CNMI=? response. + But they + do accept '2'. Since we're not doing much with delivery status + reports yet, if we get a CME 303 (not supported) error when + setting + the message indication parameters via CNMI, fall back to the + Qualcomm-compatible CNMI parameters. + + If we don't do this, we don't get SMS indications on these + devices, + because the original CNMI failed. + + Tested on Huawei E1550, Huawei E160G, ZTE MF622, and Novatel + XU870. + + src/mm-broadband-modem.c | 61 + ++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 54 insertions(+), 7 deletions(-) + +commit a3d32c552c526a7f5850007428a5a32216766a64 +Author: Aleksander Morgado +Date: Fri Aug 31 12:13:45 2012 +0200 + + sms: fix handling of 'data' property for multipart messages + + This is the port to git master of the following commit: + + commit 1c29ce5999d11dee2898e7bf41c00995a00c71d0 + Author: Dan Williams + Date: Mon Aug 27 17:36:49 2012 -0500 + + sms: fix handling of 'data' property for multipart messages + + Text was getting concatenated when reconstructing the full + message, + but the data wasn't. That meant that non-text multipart messages, + like the binary APN/MMS settings messages that operators often + send, + were broken. + + libmm-common/Makefile.am | 1 + + src/mm-sms.c | 77 + +++++++++++++++++++++++++++++++++--------------- + 2 files changed, 54 insertions(+), 24 deletions(-) + +commit 5af3e232a0ac0725ef62ac543ac92854fad78677 +Author: Aleksander Morgado +Date: Fri Aug 31 12:12:25 2012 +0200 + + api,introspection: new `Data' property in the SMS interface + + We need to expose the raw data for the case where we get SMS + messages with + binary content (e.g. settings SMS). + + introspection/org.freedesktop.ModemManager1.Sms.xml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 9d2a046754d383dec8ef7415e2c77ba739989c3b +Author: Dan Williams +Date: Mon Aug 27 16:36:39 2012 -0500 + + mbm: add Ericsson H5321gw (often found in Thinkpad X230) + + plugins/mbm/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 19e91c5c79f5f824c309c8d11c0b148ca8b0955e +Author: Aleksander Morgado +Date: Fri Aug 31 10:08:11 2012 +0200 + + sim: better handling of IMSI response + + This is a port to git master of the following commit: + + commit 0b051f9c7033143c56f59267794d1cadf4bd3416 + Author: Dan Williams + Date: Mon Aug 27 10:24:50 2012 -0500 + + gsm: better handling of IMSI response + + Moto EZX devices prefix the response with "+CIMI:" while most + devices do not. + + src/mm-sim.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit f53e53ba3738f3d24465ea577781b6c3ed6f6083 +Author: Aleksander Morgado +Date: Fri Aug 31 10:04:37 2012 +0200 + + novatel: fix checking ERI for roaming/home decision + + This is a port to git master of the following commit: + + commit c21e29c50b5661308fb3b223c05f6942c06dc15d + Author: Dan Williams + Date: Fri Aug 24 13:31:04 2012 -0500 + + novatel: fix checking ERI for roaming/home decision + + More fallout from b22b2d99db57e4cec8e6c3074dd20acd6845cb62 + which changed the return type of the qcdm_result_get_*() + functions. + + plugins/novatel/mm-broadband-modem-novatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 04d50e2db7a4bae2b21112faadf5f23176663d1d +Author: Aleksander Morgado +Date: Fri Aug 31 10:01:11 2012 +0200 + + icera: retry configuring PDP context if it fails. + + This is the port to git master of the following commit: + + commit fb3187847b9c62d5205962c3c707ac1f44eaddcc + Author: Eric Shienbrood + Date: Thu Aug 11 16:58:34 2011 -0400 + + icera: retry configuring PDP context if it fails. + + If a connect operation is attempted immediately after a + disconnect, + it sometimes fails with CME error 583 - "a profile (CID) + is currently + active". Apparently, even though the preceding operation + (%IPDPACT) + to deactivate the PDP context returned an OK response, the context + is not really completely available until a fraction of a second + later. This causes the %IPDPCFG operation that is part of the + subsequent connect attempt to fail with error 583. This change + retries the %IPDPCFG after a one second delay. + + BUG=chrome-os-partner:4936 + TEST=This can be tested from the UI, but I found it easier + to produce + the timing needed to trigger the bug by running mm-disconnect and + mm-connect from a shell. + + Start out with the modem in the connected state. In the shell, run + + sudo /usr/local/lib/flimflam/test/mm-disconnect; sudo + /usr/local/lib/flimflam/test/mm-connect --number='*99#' + --apn=wap.cingular + + modem-manager should emit the log line "Invalid error code: 583". + Prior to this change, the connect operation would fail. Now + it should + succeed. + + Change-Id: I6ae0e6a9f5405b54b0b465fe91d9542529f365c2 + Reviewed-on: http://gerrit.chromium.org/gerrit/5781 + Tested-by: Eric Shienbrood + Reviewed-by: Nathan J. Williams + + plugins/icera/mm-broadband-bearer-icera.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +commit 31d98a43c8dcd2a7721615a05da684edc2b4dd71 +Author: Dan Williams +Date: Fri Aug 24 08:39:07 2012 -0500 + + test: add utility to force a modem disconnect + + test/Makefile.am | 1 + + test/disconnect.py | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 31 insertions(+) + +commit a2c7cacb695b062146b3acda249e26bb180dd10e +Author: Aleksander Morgado +Date: Fri Aug 31 09:22:45 2012 +0200 + + sierra: fix detection of APP1 port + + This is the port to git master of the following commit: + + commit e0242b4db7fb1556e79f6829d22edf411f9f6ba4 + Author: Dan Williams + Date: Thu Aug 23 21:14:38 2012 -0500 + + sierra: fix detection of APP1 port + + The APP1 port (which has a limited AT parser) doesn't prefix + its replies with like nice modems do, and that means + it runs afoul of the echo removal bits of the AT serial port + code. We need to parse the whole string even though it's not + prefixed properly to find the APP1 string in the response. + + plugins/sierra/mm-plugin-sierra.c | 1 + + 1 file changed, 1 insertion(+) + +commit 1e5b00e33b98dbfd3fc6208ff51c30f4b0b40d88 +Author: Aleksander Morgado +Date: Fri Aug 31 09:20:43 2012 +0200 + + plugin: let plugins decide if they want echo removal during AT probing + + This is the port to git master of the following patch: + + commit 21e66dfa1774ac2ee037ac8b6e8bb4d71a6f7931 + Author: Dan Williams + Date: Thu Aug 23 21:13:35 2012 -0500 + + core: add function to open probe ports without removing echo + + Some devices (Sierra GSM ones) return stuff we need but don't + bother to prefix it with , so we need to optionally turn + off the echo removal at probe time. + + src/mm-plugin.c | 19 +++++++++++++++++++ + src/mm-plugin.h | 1 + + src/mm-port-probe.c | 11 ++++++++--- + src/mm-port-probe.h | 1 + + 4 files changed, 29 insertions(+), 3 deletions(-) + +commit 9faba582263f541048816d8e161166a525952a52 +Author: Aleksander Morgado +Date: Fri Aug 31 00:21:36 2012 +0200 + + bearer: check only roaming allowance when launching a connection + + Don't abort the connection if the modem reports unregistered in either + 3GPP or CDMA, as mixed CDMA+3GPP modems may connect even if not + registered + in both technologies. + + src/mm-bearer.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 6c94741e04ecb786579855a562a5ee5039901068 +Author: Aleksander Morgado +Date: Fri Aug 31 00:05:21 2012 +0200 + + sierra: fix dialling context deallocation + + We were using the slice allocator, not plain g_malloc(). + + plugins/sierra/mm-broadband-bearer-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6c1e005b54692ffd3dbb3f3c185b5d0eb951196b +Author: Aleksander Morgado +Date: Thu Aug 30 23:47:30 2012 +0200 + + hso: fix error handling in PIN retry counts + + plugins/option/mm-broadband-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8be5ecf186ffbbf941dce68460be3d69e4b19e97 +Author: Aleksander Morgado +Date: Thu Aug 30 23:47:21 2012 +0200 + + longcheer: fix error handling in PIN retry counts + + plugins/longcheer/mm-broadband-modem-longcheer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b288b26718dc95f86fe28eb740b18c0f91f72336 +Author: Aleksander Morgado +Date: Thu Aug 30 23:46:58 2012 +0200 + + icera: fix error handling in loading supported/current bands + + plugins/icera/mm-broadband-modem-icera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ff1a175035206fa092ad603327455c296cde3f5c +Author: Aleksander Morgado +Date: Thu Aug 30 22:33:01 2012 +0200 + + sierra: detect stupid secondary ports + + Some sierra modems (e.g. MC7710) have a secondary port that likes + to reply OK + to any AT command passed. Detect that as soon as possible, and + don't consider + the Icera port probing result from that secondary port. + + plugins/sierra/mm-plugin-sierra.c | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +commit 57f56f0f161bd622a7808a97adcce2b0fdaf69a1 +Author: Aleksander Morgado +Date: Thu Aug 30 19:22:16 2012 +0200 + + icera: fix error handling in PIN retry counts + + GErrors need to be always NULL initialized. + + plugins/icera/mm-broadband-modem-icera.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit f61db0fc4b0b41cd9bf0ea7aab7d1498c3e41cec +Author: Aleksander Morgado +Date: Thu Aug 30 19:18:05 2012 +0200 + + broadband-modem-qmi: implement current bands loading + + Also, sync with libqmi: + + commit b03ca502f45f75541c2b2ccebf44e712ab925456 + Author: Aleksander Morgado + Date: Thu Aug 30 19:17:19 2012 +0200 + + nas: consolidate `QmiNasActiveBand' names + + src/mm-broadband-modem-qmi.c | 87 ++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.c | 144 + +++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.h | 2 + + 3 files changed, 233 insertions(+) + +commit 4f406b2c380dc42ee50267430377ecea85b38ef3 +Author: Aleksander Morgado +Date: Thu Aug 30 18:36:11 2012 +0200 + + broadband-modem-qmi: move common enum translators to new + -helpers-qmi.[ch] files + + src/Makefile.am | 2 + + src/mm-broadband-modem-qmi.c | 581 + +++---------------------------------------- + src/mm-modem-helpers-qmi.c | 579 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers-qmi.h | 69 +++++ + 4 files changed, 678 insertions(+), 553 deletions(-) + +commit 5e448cf5d33013241a2b17a10886f79ad2dd2efd +Author: Aleksander Morgado +Date: Thu Aug 30 11:01:55 2012 +0200 + + bearer-qmi: try to use proper QMI port to connect a given net + interface + + src/mm-bearer-qmi.c | 19 ++++--------------- + 1 file changed, 4 insertions(+), 15 deletions(-) + +commit 36733aa4de83bfce7676899c7d1acea36cc4a147 +Author: Aleksander Morgado +Date: Thu Aug 30 11:01:29 2012 +0200 + + base-modem: allow looking for the QMI port associated to a given + data port + + QMI and wwan ports come in pairs. Each wwan port has an associated + control QMI + port, which is the only port allowed to send the Start|Stop Network + QMI requests + to start|stop the connection in the given wwan interface. + + Paired QMI and wwan interfaces (should) share the same parent + udev device, + quoting Bjørn: + + "If we ignore the unfortunate 3.4 and 3.5 kernels, then a + matching wwanX + and cdc-wdmY set will always share the same parent USB interface + on QMI + devices. + + Having the same parent USB device is *not* sufficient. + You cannot control + wwan0 using cdc-wdm1 in the above example." + + src/mm-base-modem.c | 118 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-modem.h | 20 +++++---- + 2 files changed, 129 insertions(+), 9 deletions(-) + +commit 3132e34dc143e90542746f3c85102584279433b0 +Author: Aleksander Morgado +Date: Thu Aug 30 16:36:38 2012 +0200 + + iface-mode-simple: when setting bands or modes, wait some time to + settle down + + When bands or allowed modes are changed, the modem will very likely + reset its + current registration and start from scratch. We will now give it + some seconds + to settle down before going on with the connection request, so that + the modem + has enough time to report being unregistered. Without this sleep + time, the + unsolicited message reporting being unregistered may arrive *after* + having + checked registration status in the Simple connect sequence, and + therefore we + end up failing the connection request. + + src/mm-iface-modem-simple.c | 56 + +++++++++++++++++++++++++++++++++------------ + 1 file changed, 42 insertions(+), 14 deletions(-) + +commit aa51a16f70178e2c0edb1be0db30b816d02d8f85 +Author: Aleksander Morgado +Date: Thu Aug 30 14:24:16 2012 +0200 + + port-probe: fix generic icera support check during probing + + src/mm-port-probe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 35a69d6b8ea1bcaf68552fb258f9e7ac8412f065 +Author: Aleksander Morgado +Date: Thu Aug 30 14:18:03 2012 +0200 + + huawei: enable QMI-powered Huawei modems + + plugins/huawei/mm-plugin-huawei.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 35bece0af36b017a0fce879e235a2b62bb9a13e2 +Author: Aleksander Morgado +Date: Thu Aug 30 14:17:51 2012 +0200 + + sierra: enable QMI-powered Sierra modems + + plugins/sierra/mm-plugin-sierra.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 1ca46bb4a7e750655f3d066881f4f3823c03f537 +Author: Aleksander Morgado +Date: Thu Aug 30 13:57:56 2012 +0200 + + port-probe: easier check for Icera support over a list of port probes + + plugins/sierra/mm-plugin-sierra.c | 10 +--------- + plugins/zte/mm-plugin-zte.c | 10 +--------- + src/mm-port-probe.c | 13 +++++++++++++ + src/mm-port-probe.h | 1 + + 4 files changed, 16 insertions(+), 18 deletions(-) + +commit a4e5964506cbb6613421ab44bb43c225eb9d82a3 +Author: Aleksander Morgado +Date: Thu Aug 30 13:35:37 2012 +0200 + + bearer: add roaming connection allowance rules from the broadband + bearer + + Connection allowance rules need to be applied to every kind of bearer, + regardless of whether it's based on the generic broadband bearer + or not. + + src/mm-bearer.c | 195 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-broadband-bearer.c | 212 + ++++++---------------------------------------- + 2 files changed, 218 insertions(+), 189 deletions(-) + +commit 58553df9bb5b1228861920196abc637b23e93443 +Author: Aleksander Morgado +Date: Thu Aug 30 11:21:46 2012 +0200 + + bearer-qmi: 'no-effect' errors while disconnecting aren't fatal + + src/mm-bearer-qmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 2edbf674e0781680cd0c5a2681565d1b2489d9d1 +Author: Aleksander Morgado +Date: Thu Aug 30 11:04:51 2012 +0200 + + bearer-qmi: assume we need the global packet data handle on no-effect + errors + + src/mm-bearer-qmi.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit b060bcfc743a39f4385466f57e2f43c9569a9d54 +Author: Ben Chan +Date: Wed Aug 29 20:36:18 2012 -0700 + + novatel-lte: use 'AT+CRSM=176,28423,0,0,9' instead of 'AT+CIMI' + to read IMSI + + Based on empirical results, 'AT+CRSM=176,28423,0,0,9' is found + more reliable + than 'AT+CIMI' for reading IMSI. + + plugins/Makefile.am | 4 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 26 +++ + plugins/novatel/mm-sim-novatel-lte.c | 251 + +++++++++++++++++++++++ + plugins/novatel/mm-sim-novatel-lte.h | 51 +++++ + 4 files changed, 331 insertions(+), 1 deletion(-) + +commit a2aad7d2931baf1260fe2652dc75b991416e0c2d +Author: Ben Chan +Date: Tue Aug 28 13:35:25 2012 -0700 + + novatel-lte: add a 2-second wait after SIM unlock + + plugins/novatel/mm-broadband-modem-novatel-lte.c | 38 + ++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +commit 1c49e35a8e03ea0724cd0831f2ca7819368b0a66 +Author: Aleksander Morgado +Date: Tue Aug 28 18:34:07 2012 +0200 + + iface-modem: run after-sim-unlock also when PIN request is not enabled + + Whenever we query current unlock required status and we get that + we're unlocked, + we'll launch the after-sim-unlock step so that we try to ensure that + the SIM is + ready. + + src/mm-iface-modem.c | 88 + +++++++++++++++++++++++++++++----------------------- + 1 file changed, 50 insertions(+), 38 deletions(-) + +commit 4114eabaa31bb10ec3af14a7308760f0fbe42608 +Author: Aleksander Morgado +Date: Wed Aug 29 18:43:01 2012 +0200 + + plugin-manager: never suggest result to the probe which generated + the suggestion + + src/mm-plugin-manager.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 72602a395105006736ecf5829ba33ffcefce3692 +Author: Aleksander Morgado +Date: Tue Aug 28 23:04:11 2012 +0200 + + qmi-bearer: use new enum types for call end reasons + + Sync with libqmi: + + commit d473f9ab35b85b76ebd6510a69a49ffa141d85f1 + Author: Aleksander Morgado + Date: Tue Aug 28 13:18:44 2012 +0200 + + wds: implement "Verbose Call End Reason" types + + commit d39c997771da9a8037e61f1b4fc5ccfbb34be952 + Author: Aleksander Morgado + Date: Mon Aug 27 20:29:16 2012 +0200 + + wds: implement "Call End Reason" type + + src/mm-bearer-qmi.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 4cb6c42d6cea99f9dc674f5f38fe7d781d19becd +Author: Aleksander Morgado +Date: Tue Aug 28 22:58:31 2012 +0200 + + qmi-bearer: fix IPv6 disconnection logic + + src/mm-bearer-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 84e69a1abb534452547b62d18a5658515a516a7f +Author: Aleksander Morgado +Date: Mon Aug 27 15:49:19 2012 +0200 + + bearer-qmi: only keep internal state if IP type specific connection + succeeds + + src/mm-bearer-qmi.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +commit c468e5b35236bfd006e5e841143b5795536f7030 +Author: Aleksander Morgado +Date: Mon Aug 27 15:38:36 2012 +0200 + + bearer-qmi: if possible, use "WDS Set IP Family" to select IP family + preference + + src/mm-bearer-qmi.c | 92 + +++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 90 insertions(+), 2 deletions(-) + +commit ea7edbbf9e3de5f3cd1c4c0ed335a0f5504f0edc +Author: Aleksander Morgado +Date: Mon Aug 27 15:16:50 2012 +0200 + + bearer-qmi: only specify IP family preference TLV if one explicitly + requested + + src/mm-bearer-qmi.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit fb932268587bb59e5700e93a52c72e619e150b27 +Author: Aleksander Morgado +Date: Mon Aug 27 15:10:23 2012 +0200 + + bearer-qmi: allocate different WDS clients for IPv4 and IPv6 setups + + src/mm-bearer-qmi.c | 178 + ++++++++++++++++++++++++++++++++++++---------------- + src/mm-qmi-port.h | 4 +- + 2 files changed, 126 insertions(+), 56 deletions(-) + +commit 28eb5df342e26c0792c2fc141dbb1ef6cc186577 +Author: Aleksander Morgado +Date: Mon Aug 27 14:52:00 2012 +0200 + + qmi-port: allow allocating more than one client of a given service + + We'll uniquely identify each client generated by the service ID and + a user + defined flag, so that we then allow to peek/get the specific client. + + src/mm-bearer-qmi.c | 9 +++++++-- + src/mm-broadband-modem-qmi.c | 5 ++++- + src/mm-qmi-port.c | 16 +++++++++++----- + src/mm-qmi-port.h | 11 +++++++++-- + src/mm-sim-qmi.c | 4 +++- + 5 files changed, 34 insertions(+), 11 deletions(-) + +commit a8cf6f627856e8d072dd59d1af7518b19e22d8f1 +Author: Aleksander Morgado +Date: Mon Aug 27 12:55:36 2012 +0200 + + bearer-qmi: enable dual IPv4/IPv6 connections + + We provide separate steps to connect/disconnect IPv4 and IPv6. + + src/mm-bearer-qmi.c | 461 + +++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 326 insertions(+), 135 deletions(-) + +commit 7c291ab7a3973dea5d901fb87cae204421a88380 +Author: Aleksander Morgado +Date: Fri Aug 24 08:27:01 2012 +0200 + + bearer-qmi: make compiler happy + + src/mm-bearer-qmi.c | 1 + + 1 file changed, 1 insertion(+) + +commit 26d95381048e0e4c91b17eda0a7e6d444a736b52 +Author: Aleksander Morgado +Date: Tue Aug 21 18:42:09 2012 +0200 + + bearer-qmi: 'no-effect' errors while starting network aren't fatal + + src/mm-bearer-qmi.c | 63 + ++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 38 insertions(+), 25 deletions(-) + +commit 5fdb820f28dcdcba76fa5e4300b806bfd7181fcb +Author: Aleksander Morgado +Date: Tue Aug 21 18:29:15 2012 +0200 + + bearer-qmi: pass down APN/username/password/IP-type to `WDS Start + Network' + + src/mm-bearer-qmi.c | 58 + +++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 56 insertions(+), 2 deletions(-) + +commit 60b0812d3ad75db9188f3012c12895284ec9c615 +Author: Aleksander Morgado +Date: Tue Aug 21 17:06:19 2012 +0200 + + bearer-qmi: implement connection/disconnection sequences + + src/mm-bearer-qmi.c | 490 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 489 insertions(+), 1 deletion(-) + +commit 02c049ce7dfd7aacfc2fe50fe76a2221764501eb +Author: Aleksander Morgado +Date: Tue Aug 21 13:16:45 2012 +0200 + + broadband-modem-qmi: create a `MMBearerQmi' always by default + + We still don't consider the case of having all net ports already + connected and + falling back to PPP over a serial port. + + src/mm-broadband-modem-qmi.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit b29fcde7e223fc96fb1445e38797b46916927aa6 +Author: Aleksander Morgado +Date: Tue Aug 21 13:11:36 2012 +0200 + + bearer-qmi: new `MMBearerQmi' object + + This bearer type does not inherit from `MMBroadbandBearer', and + therefore it + doesn't need to be async-initable. + + src/Makefile.am | 2 ++ + src/mm-bearer-qmi.c | 73 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-bearer-qmi.h | 56 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 131 insertions(+) + +commit 1525c6a15438aac530aa0470152ac96afed8aff4 +Author: Aleksander Morgado +Date: Tue Aug 21 13:07:56 2012 +0200 + + build: minor reorder of files to build + + src/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c07490887aac281e5a5a546645f7fcb30552e432 +Author: Aleksander Morgado +Date: Tue Aug 21 13:04:06 2012 +0200 + + broadband-bearer: remove obsolete property names + + src/mm-broadband-bearer.h | 6 ------ + 1 file changed, 6 deletions(-) + +commit e2a6be368eab6045c176ef5f404afb246769953f +Author: Aleksander Morgado +Date: Tue Aug 21 12:21:08 2012 +0200 + + iface-modem: max number of bearers equal to the number of available + data ports + + src/mm-iface-modem.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 14bd267e8e1fd8411df8155c5c487adf2a4764d2 +Author: Aleksander Morgado +Date: Tue Aug 21 12:18:21 2012 +0200 + + base-modem: allow getting/peeking all data ports + + src/mm-base-modem.c | 20 ++++++++++++++++++++ + src/mm-base-modem.h | 2 ++ + 2 files changed, 22 insertions(+) + +commit bc3e77dadf81a18adc88073fe1601e784ff90150 +Author: Aleksander Morgado +Date: Tue Aug 21 12:11:09 2012 +0200 + + broadband-modem-qmi: assume we don't have messaging support + + Just to cleanup the sequence for now, we can develop it later. + + src/mm-broadband-modem-qmi.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 877fbba595092c7f0dab7eac350a5a8bfa1a3e45 +Author: Aleksander Morgado +Date: Tue Aug 21 12:09:08 2012 +0200 + + broadband-modem-qmi: assume we don't have USSD support + + Just to cleanup the sequence for now, we can develop it later. + + src/mm-broadband-modem-qmi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 494a70a8ffff4a50d0a00e99e964165054ff36aa +Author: Aleksander Morgado +Date: Tue Aug 21 11:32:24 2012 +0200 + + core: handle the 'usb'->'usbmisc' subsystem rename in the kernel + + We'll try to cope with getting devices being reported in either + 'usb' or + 'usbmisc', trying to avoid the need of checking kernel version + during runtime. + + src/80-mm-candidate.rules | 1 + + src/mm-base-modem.c | 4 ++-- + src/mm-device.c | 4 ++-- + src/mm-manager.c | 22 +++++++++++++++++----- + src/mm-plugin.c | 4 ++++ + src/mm-port-probe.c | 12 ++++++------ + 6 files changed, 32 insertions(+), 15 deletions(-) + +commit 8cb021293ce0aa316028339c8f213c0bf72c9158 +Author: Aleksander Morgado +Date: Tue Aug 21 10:27:25 2012 +0200 + + broadband-modem-qmi: don't allocate WDS client during startup + + We'll allocate WDS clients only when launching a connection. + + src/mm-broadband-modem-qmi.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit e9aff3ba42c3b29c529c155694c7df3770792814 +Author: Aleksander Morgado +Date: Tue Aug 21 10:23:42 2012 +0200 + + base-modem: allow grabbing multiple 'net' and 'qmi' ports + + All grabbed 'net' ports are added to the new list of data ports. It + is a task + for the specific plugin to decide how each of the data ports should be + connected. In the case of not having 'net' ports, the list of data + ports will + only contain a single AT port. + + All grabbed 'qmi' ports are added to the new list of QMI ports. The + first port + in the list is to be considered the 'primary' one, and will be the + one used + for all services. The remaining QMI ports, if any, will only be used + to for WDS, + to manage the associated 'net' ports. + + src/mm-base-modem.c | 121 + ++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 79 insertions(+), 42 deletions(-) + +commit 7369f1675972e203b906315a9c79f851fbca6c7d +Author: Aleksander Morgado +Date: Fri Aug 10 10:21:36 2012 +0200 + + broadband-modem-qmi: don't rely on the detailed service status to + get HDR reg + + The 'detailed service status' TLV is either pretty new and not + always available, + or given only under some specific circumstances. So, try to gather + CDMA1x and + EV-DO registration status with the default info we usually do get. + + The logic is the following: + * If registered and the access technologies contain CDMA1x, then + CDMA1x is + registered, otherwise it's not. + * If registered and the access technologies contain any of the + EV-DO revisions, + then EV-DO is registered, otherwise it's not. + + An example output in a CDMA network: + + [/dev/cdc-wdm0] Successfully got serving system: + Registration state: 'registered' + CS: 'attached' + PS: 'attached' + Selected network: '3gpp2' + Radio interfaces: '2' + [0]: 'cdma-1xevdo' + [1]: 'cdma-1x' + Roaming status: 'off' + Data service capabilities: '2' + [0]: 'cdma' + [1]: 'evdo-rev-a' + Current PLMN: + MCC: '311' + MNC: '480' + Description: 'Verizon Wireless' + CDMA System ID: + SID: '26' + ESN: '1' + CDMA Base station info: + Base station ID: '3633' + Latitude: '44.913333'º + Longitude: '-93.279722'º + Roaming indicators: '2' + [0]: '(null)' (cdma-1x) + [1]: '(null)' (none) + Default roaming status: '(null)' + 3GPP2 time zone: + Leap seconds: '16' seconds + Local time offset: '-300' minutes + Daylight saving time: 'no' + CDMA P_Rev: '6' + + src/mm-broadband-modem-qmi.c | 35 +++++++---------------------------- + 1 file changed, 7 insertions(+), 28 deletions(-) + +commit 1f82cd1a32d7643c1a24bb9a1001ba01d19c9096 +Author: Aleksander Morgado +Date: Fri Aug 10 10:14:25 2012 +0200 + + broadband-modem-qmi: handle serving system output when selected + network is unknown + + Seems that sometimes we get 'selected network' as UNKNOWN, but we + still have + proper registration information. Try to handle those cases. + + [/dev/cdc-wdm0] Successfully got serving system: + Registration state: 'registered' + CS: 'detached' + PS: 'attached' + Selected network: 'unknown' + Radio interfaces: '1' + [0]: 'lte' + Roaming status: 'off' + Data service capabilities: '1' + [0]: 'lte' + Current PLMN: + MCC: '311' + MNC: '480' + Description: 'Verizon Wireless' + Roaming indicators: '1' + [0]: 'off' (lte) + + src/mm-broadband-modem-qmi.c | 80 + +++++++++++++++++++++++++------------------- + 1 file changed, 46 insertions(+), 34 deletions(-) + +commit 12246a8c606f567e2d74eeffe2f96827c48b5922 +Author: Aleksander Morgado +Date: Thu Aug 9 16:58:34 2012 +0200 + + broadband-modem-qmi: use only deprecated commands + + The QMI protocol is updated frequently with new commands replacing and + improving some already existing ones, which get marked as deprecated. + Instead of initially try to cover the logic with both the old and + the new + commands, we'll default to use only the old deprecated ones, which + should be + supported also in the modems with newer services. + + The supported already implemented for the new QMI commands is hidden + behind a + `--with-newest-qmi-commands' configure switch. + + Once the implementation is fully developed and tested using the + deprecated + commands we can then focus in including the support for the new ones. + + configure.ac | 16 ++++++ + src/mm-broadband-modem-qmi.c | 114 + +++++++++++++++++++++++++++++++++++-------- + 2 files changed, 110 insertions(+), 20 deletions(-) + +commit 0886322cc48b06eb9d19699555854ea3ab5af997 +Author: Aleksander Morgado +Date: Thu Aug 9 11:43:46 2012 +0200 + + broadband-modem-qmi: implement supported modes loading + + src/mm-broadband-modem-qmi.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 716256595f6809df8fb071d3a694396c20176df2 +Author: Aleksander Morgado +Date: Thu Aug 9 11:10:36 2012 +0200 + + broadband-modem-qmi: implement CDMA unsolicited registration events + for NAS < 1.8 + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 930235cbb62f082766e3e46ca7a109847b4a7f38 +Author: Aleksander Morgado +Date: Thu Aug 9 11:08:44 2012 +0200 + + broadband-modem-qmi: implement CDMA registration checks for NAS < 1.8 + + src/mm-broadband-modem-qmi.c | 230 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 229 insertions(+), 1 deletion(-) + +commit edf2940c15d9d1f00e4af2936171335d8cf814aa +Author: Aleksander Morgado +Date: Thu Aug 9 10:58:12 2012 +0200 + + iface-modem-cdma: provide separate method to update access tech + + src/mm-broadband-modem.c | 7 +++++ + src/mm-iface-modem-cdma.c | 66 + +++++++++++++++++++++++++++++++---------------- + src/mm-iface-modem-cdma.h | 19 ++++++++++---- + 3 files changed, 65 insertions(+), 27 deletions(-) + +commit be05543a9a0f52ac48beb23c0efd9354a8f15b1d +Author: Aleksander Morgado +Date: Thu Aug 9 18:03:51 2012 +0200 + + broadband-modem-qmi: build 3GPP access technologies from data + service capabilities + + src/mm-broadband-modem-qmi.c | 65 + ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 63 insertions(+), 2 deletions(-) + +commit fe4d94788badc3b41f60919b0bb635a54f5cda08 +Author: Aleksander Morgado +Date: Thu Aug 9 10:31:01 2012 +0200 + + iface-modem-3gpp: provide separate methods to update access tech + and location + + src/mm-broadband-modem-qmi.c | 47 +++++------------ + src/mm-broadband-modem.c | 32 ++++-------- + src/mm-iface-modem-3gpp.c | 121 + +++++++++++++++++++++++-------------------- + src/mm-iface-modem-3gpp.h | 18 +++---- + 4 files changed, 95 insertions(+), 123 deletions(-) + +commit 483f59c01def1df37a6fe85e19aebf1c1a1532f3 +Author: Aleksander Morgado +Date: Thu Aug 9 09:51:41 2012 +0200 + + broadband-modem-qmi: include '3gpp' prefix in the 3GPP registration + checks + + src/mm-broadband-modem-qmi.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit 9baac727fe5172718c2a3327f7f7ea930d8d9bae +Author: Aleksander Morgado +Date: Thu Aug 9 09:50:56 2012 +0200 + + broadband-modem-qmi: don't keep cs|ps flags when checking registration + status + + Just report both always. + + src/mm-broadband-modem-qmi.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit f796c6d906a4d6728728452a52c636ca148a9a91 +Author: Aleksander Morgado +Date: Thu Aug 9 08:19:31 2012 +0200 + + iface-modem-3gpp: log about which registration check will be run + + src/mm-iface-modem-3gpp.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 05f80036d15c826866422b41ebbcde41e6ff512d +Author: Aleksander Morgado +Date: Wed Aug 8 21:35:23 2012 +0200 + + iface-modem-cdma: allow implementations to fully override registration + checks + + Implementations of the CDMA interface can either: + * Implement run_registration_checks() + or, + * Implement the sub-steps of the generic registration checks + sequence + + src/mm-iface-modem-cdma.c | 110 + +++++++++++++++++++++++++++++++++------------- + src/mm-iface-modem-cdma.h | 52 ++++++++++++++++------ + 2 files changed, 117 insertions(+), 45 deletions(-) + +commit 421d4237778d1ff4eaa0ec038020f7f277ef0b99 +Author: Aleksander Morgado +Date: Wed Aug 8 18:09:35 2012 +0200 + + iface-modem-cdma: minor fix in interface API names + + src/mm-broadband-modem.c | 29 ++++++++++++++--------------- + src/mm-iface-modem-cdma.c | 44 + +++++++++++++++++++++----------------------- + src/mm-iface-modem-cdma.h | 12 ++++++------ + 3 files changed, 41 insertions(+), 44 deletions(-) + +commit 7af1edbd111744029829b68569e2501d7a23db0c +Author: Aleksander Morgado +Date: Wed Aug 8 14:37:37 2012 +0200 + + TODO: QMI based modems always require a QMI and WWAN port + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit bccd80058a2c35ca29a636f9ee70374f6565a2aa +Author: Aleksander Morgado +Date: Wed Aug 8 14:34:07 2012 +0200 + + broadband-modem-qmi: 'no-effect' is not an error during automatic + registration + + src/mm-broadband-modem-qmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 43315f1121824de6cace9e4bb00555f21bd81be5 +Author: Aleksander Morgado +Date: Wed Aug 8 14:28:07 2012 +0200 + + broadband-modem-qmi: fix signal handlers + + User data is always the last parameter + + src/mm-broadband-modem-qmi.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit d31b2ae019dbf32824c1a9df4ee7d42accf07337 +Author: Aleksander Morgado +Date: Wed Aug 8 13:20:10 2012 +0200 + + broadband-modem-qmi: implement auto/manual network registration + using QMI + + src/mm-broadband-modem-qmi.c | 102 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 102 insertions(+) + +commit a6ff9b2a17d3f76026afcffc660d0842fb737b7b +Author: Aleksander Morgado +Date: Wed Aug 8 13:19:49 2012 +0200 + + iface-modem-3gpp: implement the network registration request logic + + In the generic broadband modem implementation we'll just implement + the specific + command to request auto/manual network registration, and we leave + all the other + logic (waiting for the new registration status and all that) in + the interface, + as it is really common for every possible implementation. + + src/mm-broadband-modem.c | 238 ++-------------------------- + src/mm-iface-modem-3gpp.c | 386 + +++++++++++++++++++++++++++++++++++----------- + src/mm-iface-modem-3gpp.h | 2 +- + 3 files changed, 310 insertions(+), 316 deletions(-) + +commit 7ce6b1296288271c02dbb7d2a85651f87bd244fb +Author: Aleksander Morgado +Date: Wed Aug 8 10:13:19 2012 +0200 + + broadband-modem: validate operator ID before trying to register to it + + src/mm-broadband-modem.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 51678e141b74eab4303414db2f3837d02a39a587 +Author: Aleksander Morgado +Date: Wed Aug 8 10:12:43 2012 +0200 + + modem-helpers: new method to validate and/or parse MCC/MNC operator + ID string + + src/mm-modem-helpers.c | 60 ++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 5 +++ + src/tests/test-modem-helpers.c | 73 + ++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 138 insertions(+) + +commit 02573a55654a17b1270a34f1e91622f4afbf0fcd +Author: Aleksander Morgado +Date: Tue Aug 7 17:36:10 2012 +0200 + + broadband-modem-qmi: limit 3GPP registration updates for 3GPP modems + + src/mm-broadband-modem-qmi.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 6b5799ea0f061197bd54730c89bbe1c1b523bcab +Author: Aleksander Morgado +Date: Tue Aug 7 17:34:53 2012 +0200 + + broadband-modem-qmi: consolidate Serving System response/indication + processing + + src/mm-broadband-modem-qmi.c | 306 + +++++++++++++++++-------------------------- + 1 file changed, 121 insertions(+), 185 deletions(-) + +commit 8bcf6dc47d1479a2c2252e9c0a9b2bc0a0f5383f +Author: Aleksander Morgado +Date: Tue Aug 7 17:15:52 2012 +0200 + + broadband-modem-qmi: implement 3GPP unsolicited registration events + for NAS >= 1.8 + + src/mm-broadband-modem-qmi.c | 394 + +++++++++++++++++++++++++++++-------------- + 1 file changed, 270 insertions(+), 124 deletions(-) + +commit c3f6e2e06fcc7ffda94a0545287937c0ec0f0a80 +Author: Aleksander Morgado +Date: Tue Aug 7 16:38:41 2012 +0200 + + TODO: add note about SIM provisioning info + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit 2a9b9506ec56e7eb23ffc5e682099ae4fb389907 +Author: Aleksander Morgado +Date: Tue Aug 7 15:32:06 2012 +0200 + + TODO: add reminder to implement Operator name loading in NAS >= 1.8 + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit a6a34c3b9c12247a3973970adf0f93aaf22a1dfa +Author: Aleksander Morgado +Date: Tue Aug 7 12:30:16 2012 +0200 + + broadband-modem-qmi: implement 3GPP registration checks for NAS >= 1.8 + + src/mm-broadband-modem-qmi.c | 449 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 443 insertions(+), 6 deletions(-) + +commit f015bf54db8de0e45f3843020684f38e3c339567 +Author: Aleksander Morgado +Date: Mon Aug 6 20:48:35 2012 +0200 + + broadband-modem-qmi: fix radio technology preference enum names + + Sync with libqmi: + + commit 54e5400f6977ae2036b54c2661c1e5c101e03fe4 + Author: Aleksander Morgado + Date: Mon Aug 6 19:57:06 2012 +0200 + + nas: fix `QmiNasRadioTechnologyPreference' enum names + 'Analog' and 'Digital' are purely 3GPP2 terms, so avoid those + and provide a mix + of 3GPP and 3GPP2 names. + + src/mm-broadband-modem-qmi.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 03e1c9348e817607823f5df12c5b57ece7731d9e +Author: Aleksander Morgado +Date: Mon Aug 6 18:24:18 2012 +0200 + + broadband-modem-qmi: implement operator name/code loading with QMI + + Just report the values cached during the 3GPP registration checks + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit b708976bd6610b21813bffc71a2a6640eea5f99f +Author: Aleksander Morgado +Date: Mon Aug 6 17:52:50 2012 +0200 + + broadband-modem-qmi: implement 3GPP unsolicited registration events + for NAS < 1.8 + + src/mm-broadband-modem-qmi.c | 391 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 389 insertions(+), 2 deletions(-) + +commit 0b52840d1560e1a97e8a72ddbb87d8b1ae2eaff3 +Author: Aleksander Morgado +Date: Mon Aug 6 17:23:30 2012 +0200 + + broadband-modem-qmi: implement 3GPP registration checks for NAS < 1.8 + + src/mm-broadband-modem-qmi.c | 272 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 268 insertions(+), 4 deletions(-) + +commit c97aaba47f4894422fe9c83c1f8cd6690a4e1e07 +Author: Aleksander Morgado +Date: Mon Aug 6 15:50:19 2012 +0200 + + broadband-modem-qmi: use version from the client to know supported + commands + + Instead of always trying to use the newest commands and falling back + to the + deprecated one when found that it is not supported, use the service + version + given by the client to determine which is the best command to use. + + Still, sometimes we need to handle ourselves the fallback to the + deprecated + command, when we don't exactly know in which service version the + new behaviour + was added (e.g. the 'Mode Preference' TLV in 'Get/Set System Selection + Preference' was last updated in NAS 1.16, but we don't exactly know + when it + was added). + + src/mm-broadband-modem-qmi.c | 405 + +++++++++++++++++-------------------------- + 1 file changed, 162 insertions(+), 243 deletions(-) + +commit ad37b494c44ef10ac3a4f24b58eb6382cb4ee8fb +Author: Aleksander Morgado +Date: Sun Aug 5 20:43:41 2012 +0200 + + broadband-modem-qmi: fix radio interface variable name + + Sync with libqmi: + + commit ebfa80154fad012bb6ea3e964dcea6f5b6cf3f91 + Author: Aleksander Morgado + Date: Thu Aug 2 12:06:09 2012 +0200 + + nas: consolidate variable names for `QmiNasRadioInterface' types + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e2c6c66d0c94000e34d621b2e1b11f772dcd0552 +Author: Aleksander Morgado +Date: Sun Aug 5 20:42:44 2012 +0200 + + broadband-modem-qmi: fix method name + + Sync with libqmi: + + commit cc97645578d937417bb2d72d22714776a98c549e + Author: Aleksander Morgado + Date: Thu Aug 2 12:15:05 2012 +0200 + + nas: don't mistake 'change duration' with 'preference duration' + They actually have POWER_CYCLE and PERMANENT values swapped. + Kudos to the one who decided that. + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 651d306c282d93bfd23d3987c0c2f23407d6ad94 +Author: Aleksander Morgado +Date: Wed Aug 1 09:28:50 2012 +0200 + + broadband-modem-qmi: fix missing GSimpleAsyncResult unrefs + + src/mm-broadband-modem-qmi.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3a29d1b2bc75418c8c61f19599581e252b79488a +Author: Aleksander Morgado +Date: Tue Jul 31 18:28:24 2012 +0200 + + broadband-modem-qmi: setup/cleanup signal quality related unsolicited + events + + We setup signal handlers for every possible indication, even if they + are not + supported. + + src/mm-broadband-modem-qmi.c | 227 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 227 insertions(+) + +commit 0bd9b46b0991ba43b12ae1cac1ae417f80b7f389 +Author: Aleksander Morgado +Date: Tue Jul 31 14:53:00 2012 +0200 + + broadband-modem-qmi: enable/disable signal quality related unsolicited + events + + The logic here involves knowing if we have support for 'Signal Info' + indications. All the 'Signal Info' stuff was included in NAS 1.8, + so we're + just using a single flag to indicate support for that. + + If we do have 'Signal Info', enabling the signal quality indications + involves + two steps: configuring thresholds with "Config Signal Info" and + then enabling + them with "Register Indications". + + If we don't have 'Signal Info' we fallback to the good old "Set + Event Report" + for enabling/disabling the indications. + + src/mm-broadband-modem-qmi.c | 383 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 378 insertions(+), 5 deletions(-) + +commit 88053b7342036ef27a168d728a8a2467bcfc94da +Author: Aleksander Morgado +Date: Mon Jul 30 16:07:45 2012 +0200 + + broadband-modem-qmi: implement allowed mode setting + + src/mm-broadband-modem-qmi.c | 312 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 312 insertions(+) + +commit da106845ca1eddb016445181b5d15e5c00dfed77 +Author: Aleksander Morgado +Date: Tue Jul 31 11:13:10 2012 +0200 + + broadband-modem-qmi: fix flags of supported commands for allowed modes + + src/mm-broadband-modem-qmi.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +commit 979ae98feba2ffbf9801ec72a15c92646768d9de +Author: Aleksander Morgado +Date: Tue Jul 31 16:21:30 2012 +0200 + + TODO: handle devices with multiple QMI ports + + TODO | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit e94f19789891707e4fa1c126927f4682d9bcf81e +Author: Aleksander Morgado +Date: Tue Jul 31 16:03:14 2012 +0200 + + broadband-modem-qmi: use 'low-power' mode when disabling + + Reported by: Bjørn Mork + + src/mm-broadband-modem-qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bef4fd64d4dbfd998eda68e47c20a81aeb2f7447 +Author: Aleksander Morgado +Date: Fri Jul 27 16:05:36 2012 +0200 + + broadband-modem-qmi: implement initial allowed mode loading using QMI + + src/mm-broadband-modem-qmi.c | 319 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 319 insertions(+) + +commit 68c32dcf7b1a73fa78ecce096622aa2289c33c12 +Author: Aleksander Morgado +Date: Thu Jul 26 14:22:35 2012 +0200 + + broadband-modem-qmi: fix band enum names + + src/mm-broadband-modem-qmi.c | 116 + +++++++++++++++++++++---------------------- + 1 file changed, 58 insertions(+), 58 deletions(-) + +commit 1c9ec829be51ed48958048229e848bfe460505c8 +Author: Aleksander Morgado +Date: Thu Jul 26 10:57:27 2012 +0200 + + broadband-modem-qmi: load ESN from the cached info + + src/mm-broadband-modem-qmi.c | 45 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit bb54ff4fecf2beb2ad7380c32bde785dba9d0c53 +Author: Aleksander Morgado +Date: Thu Jul 26 10:56:00 2012 +0200 + + broadband-modem-qmi: load MEID from the cached info + + src/mm-broadband-modem-qmi.c | 45 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit b12abb6b97cddae88aeb2ad230e58d93be0fc620 +Author: Aleksander Morgado +Date: Thu Jul 26 10:53:44 2012 +0200 + + broadband-modem-qmi: implement the CDMA interface + + src/mm-broadband-modem-qmi.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 9f6250e7a5876576c25223ec46f3c35175ae915c +Author: Aleksander Morgado +Date: Thu Jul 26 10:52:16 2012 +0200 + + broadband-modem-qmi: load IMEI from the cached info + + src/mm-broadband-modem-qmi.c | 45 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit 38c9ccd0b9f0b556eb3e35f562f5f1ecb275bf45 +Author: Aleksander Morgado +Date: Thu Jul 26 10:45:59 2012 +0200 + + TODO: add task to see how to avoid QMI clients exhausted problem + in Gobi2k + + TODO | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 2fb4080a7efab378fd88078eff32cd529ebe3084 +Author: Aleksander Morgado +Date: Thu Jul 26 10:26:42 2012 +0200 + + broadband-modem-qmi: cache IMEI, ESN and MEID values when loaded + + src/mm-broadband-modem-qmi.c | 125 + ++++++++++++++++++++++++++++--------------- + 1 file changed, 82 insertions(+), 43 deletions(-) + +commit 37da8fabdab1a672dbfe205aee6b53ad45562ba0 +Author: Aleksander Morgado +Date: Thu Jul 26 09:46:03 2012 +0200 + + broadband-modem-qmi: ignore charsets setup + + src/mm-broadband-modem-qmi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e03edd56af21d4f40c0d5534482cda3fafb5ed35 +Author: Aleksander Morgado +Date: Thu Jul 26 09:44:53 2012 +0200 + + broadband-modem-qmi: ignore flow control setup + + Not needed for QMI commands. + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit d19fd3bcb154b1c4baa94850effc5c40f1da3359 +Author: Aleksander Morgado +Date: Thu Jul 26 09:43:56 2012 +0200 + + broadband-modem-qmi: ignore modem after-power-up + + The generic implementation doesn't have a method for after power + up, we're + just ensuring that that is the case always. + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit eaa94518195b8d12cdf6c1f1ce398181f94f20e2 +Author: Aleksander Morgado +Date: Thu Jul 26 09:42:43 2012 +0200 + + broadband-modem-qmi: ignore modem initialization sequence + + src/mm-broadband-modem-qmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f1781f7589ffdf0f433375fc4c6c09b8c0d529f0 +Author: Aleksander Morgado +Date: Thu Jul 26 09:20:31 2012 +0200 + + broadband-modem-qmi: run modem power up/down using QMI + + src/mm-broadband-modem-qmi.c | 115 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 115 insertions(+) + +commit 56721d687f0f6844bfddb558072c88d1e60665ff +Author: Aleksander Morgado +Date: Thu Jul 26 08:45:41 2012 +0200 + + broadband-modem-qmi: log gathered signal strength/rssi values + + src/mm-broadband-modem-qmi.c | 65 + +++++++++++++++++++++++++++++--------------- + 1 file changed, 43 insertions(+), 22 deletions(-) + +commit 40f96158af253e3efcee274e8e09430e364e1c14 +Author: Aleksander Morgado +Date: Wed Jul 25 17:37:44 2012 +0200 + + broadband-modem-qmi: implement signal quality loading using QMI + + src/mm-broadband-modem-qmi.c | 242 + +++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-modem-qmi.h | 2 + + 2 files changed, 244 insertions(+) + +commit 629f452d0746156d8adc61290305eba22ac25890 +Author: Aleksander Morgado +Date: Wed Jul 25 17:19:05 2012 +0200 + + broadband-modem-qmi: treat as fatal internal protocol errors when + checking PIN status + + src/mm-broadband-modem-qmi.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +commit b5534d123bb023220a1d816110828912d4681de3 +Author: Aleksander Morgado +Date: Wed Jul 25 11:42:38 2012 +0200 + + broadband-modem-qmi: implement network scan + + The "NAS Network Scan" command replies with several optional TLVs. One + of the + TLVs gives the status of the network, using MCC/MNC as index; + another one gives + the radio access technology, also using MCC/MNC as index. But, + several entries + may have the same MCC/MNC, so there is no clear way to mix the + results of both + TLVs in the same element. We'll try to do a best guess, trying not + to use the + same RAT result twice, but this is really a best guess. + + src/mm-broadband-modem-qmi.c | 201 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 201 insertions(+) + +commit 6686f8d4db3819a7b603bdb033d9731d47d91d76 +Author: Aleksander Morgado +Date: Mon Jul 23 11:15:58 2012 +0200 + + port-probe: minor indentation fixes + + src/mm-port-probe.h | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 90c32a7a6db1df086c8b3ff60ba4a6184d8492ec +Author: Aleksander Morgado +Date: Wed Jul 18 14:49:14 2012 +0200 + + broadband-modem-qmi: load supported bands using QMI + + Seems to me that "Get Band Capabilities" just returns the bands + 'currently' + allowed to use. E.g. my Pantech UML290 gives me: + 'cdma-bc0-cellular-800, cdma-bc1-pcs-1900' + (even if I know the modem can also do LTE and 3GPP) + + src/mm-broadband-modem-qmi.c | 259 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 259 insertions(+) + +commit 7c3849ca53eddf79bac4f48cd1466551a17e5769 +Author: Aleksander Morgado +Date: Tue Jul 17 11:03:49 2012 +0200 + + broadband-modem-qmi: load facility locks state using QMI + + src/mm-broadband-modem-qmi.c | 182 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 182 insertions(+) + +commit 8634403fd935e8875a33451a73262f4e0148ec2b +Author: Aleksander Morgado +Date: Tue Jul 17 10:36:56 2012 +0200 + + broadband-modem-qmi: implement the 3GPP interface + + src/mm-broadband-modem-qmi.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 65b8d4794eb1d352a4a25f5346ae0579ac3c68be +Author: Aleksander Morgado +Date: Tue Jul 17 09:45:54 2012 +0200 + + broadband-modem-qmi: run factory reset using QMI + + src/mm-broadband-modem-qmi.c | 83 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 83 insertions(+) + +commit a17bc801a527bcf553090835263e7869067bded7 +Author: Aleksander Morgado +Date: Wed Jul 4 10:21:43 2012 +0200 + + sim-qmi: enable/disable PIN using QMI + + src/mm-sim-qmi.c | 79 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit 1e6d8ba7796843726a26034d017e05234d28dd5d +Author: Aleksander Morgado +Date: Wed Jul 4 10:15:24 2012 +0200 + + sim-qmi: change PIN using QMI + + src/mm-sim-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit 36aca91abb84ec4cd381625982ac8bfaaff914d8 +Author: Aleksander Morgado +Date: Wed Jul 4 10:09:45 2012 +0200 + + sim-qmi: skip loading operator identifier/name + + Not yet implemented in libqmi-glib. + + src/mm-sim-qmi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 30bdc8d592ae83480b93c0788ae9be6d48976901 +Author: Aleksander Morgado +Date: Mon Jul 2 15:40:29 2012 +0200 + + sim-qmi: send PUK using QMI + + src/mm-sim-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit d1d5322f510e6c121ed797953802c0a32d685b2d +Author: Aleksander Morgado +Date: Mon Jul 2 15:34:18 2012 +0200 + + sim-qmi: send PIN using QMI + + src/mm-sim-qmi.c | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +commit 6dc6f7bf0d48ab060b0b79fbd465871d5a134245 +Author: Aleksander Morgado +Date: Mon Jul 2 13:19:01 2012 +0200 + + sim-qmi: update IMSI using QMI + + src/mm-sim-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit 742527aa606c73139fd8046c506362ed8c6ffef5 +Author: Aleksander Morgado +Date: Mon Jul 2 13:04:48 2012 +0200 + + sim-qmi: update SIM ID (ICCID) using QMI + + src/mm-sim-qmi.c | 114 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 114 insertions(+) + +commit 086a25da98e0902cb466cbb02d115adeb7d30023 +Author: Aleksander Morgado +Date: Fri Jul 13 12:43:13 2012 +0200 + + broadband-modem-qmi: create a `MMSimQmi' by default + + src/mm-broadband-modem-qmi.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit e64bb097312078d88e603b8a7656bc3fc1d7f49b +Author: Aleksander Morgado +Date: Mon Jul 2 12:11:42 2012 +0200 + + sim-qmi: new `MMSimQmi' object + + src/Makefile.am | 2 ++ + src/mm-sim-qmi.c | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sim-qmi.h | 51 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 128 insertions(+) + +commit f9ebfb8ee680dcb6a2e5cc91f332558e090fbc1c +Author: Aleksander Morgado +Date: Fri Jul 13 12:41:18 2012 +0200 + + broadband-modem-qmi: load unlock retries using QMI + + src/mm-broadband-modem-qmi.c | 95 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 95 insertions(+) + +commit 6fe32b58cb66405df92f7219beeb9eef82b3cfbe +Author: Aleksander Morgado +Date: Fri Jul 13 12:40:34 2012 +0200 + + broadband-modem-qmi: load unlock required using QMI + + src/mm-broadband-modem-qmi.c | 120 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +commit 5436a62f9c4de51af26126586ecb7364d0f5606f +Author: Aleksander Morgado +Date: Fri Jul 13 12:39:56 2012 +0200 + + broadband-modem-qmi: load own numbers using QMI + + src/mm-broadband-modem-qmi.c | 79 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit b4dedcf944e6483563666b81aa803176f7a2a392 +Author: Aleksander Morgado +Date: Fri Jul 13 12:38:56 2012 +0200 + + broadband-modem-qmi: load device ID using QMI + + src/mm-broadband-modem-qmi.c | 44 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +commit 12fb2312bb9899e0c8167103266dac5efe3efe77 +Author: Aleksander Morgado +Date: Fri Jul 13 12:38:21 2012 +0200 + + broadband-modem: let subclasses create their own device IDs + + src/mm-broadband-modem.c | 38 ++++++++++++++++++++++++-------------- + src/mm-broadband-modem.h | 6 ++++++ + 2 files changed, 30 insertions(+), 14 deletions(-) + +commit 81fe9f84ec05b9faa99f90191da12b6e986a330e +Author: Aleksander Morgado +Date: Fri Jul 13 12:36:15 2012 +0200 + + broadband-modem-qmi: load equipment ID using QMI + + src/mm-broadband-modem-qmi.c | 104 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 104 insertions(+) + +commit 573af140b8de386a373ef2a21b5bcf52d2f36485 +Author: Aleksander Morgado +Date: Fri Jul 13 12:35:24 2012 +0200 + + broadband-modem-qmi: load revision using QMI + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit f3dee3d8ee295f8da6353d2b80864b82e171df59 +Author: Aleksander Morgado +Date: Fri Jul 13 12:34:49 2012 +0200 + + broadband-modem-qmi: load model using QMI + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit bbbb98198d11d405e3609cb31798568ca7ca235f +Author: Aleksander Morgado +Date: Fri Jun 29 13:20:03 2012 +0200 + + broadband-modem-qmi: load manufacturer using QMI + + src/mm-broadband-modem-qmi.c | 78 + ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit 816a7b14da6304b066250d6eddd967157413bf2f +Author: Aleksander Morgado +Date: Fri Jun 29 13:12:53 2012 +0200 + + broadband-modem-qmi: load current capabilities using QMI + + src/mm-broadband-modem-qmi.c | 148 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 148 insertions(+) + +commit d2d5a4b89a526d275e4c224bf36b067a99122b7e +Author: Aleksander Morgado +Date: Fri Jun 29 12:44:11 2012 +0200 + + broadband-modem-qmi: implement the `Modem' interface + + src/mm-broadband-modem-qmi.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 6d77a54230292d8d7b4a1707eec98dd68bd49f57 +Author: Aleksander Morgado +Date: Fri Jun 29 14:17:18 2012 +0200 + + generic: create a generic QMI Broadband Modem if at least one QMI + port found + + plugins/generic/mm-plugin-generic.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit b2db092b25f40aa21052d5807b48b7c940a70fee +Author: Aleksander Morgado +Date: Fri Jun 29 14:17:13 2012 +0200 + + gobi: create a generic QMI Broadband Modem if at least one QMI + port found + + plugins/gobi/mm-plugin-gobi.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 2038c5ed8625f925ae701f74b7573e6322844a03 +Author: Aleksander Morgado +Date: Fri Jun 29 12:15:24 2012 +0200 + + pantech: create a generic QMI Broadband Modem if at least one QMI + port found + + plugins/pantech/mm-plugin-pantech.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit b2ea82ed3b85897094257ac63230048ab9605f1c +Author: Aleksander Morgado +Date: Fri Jul 13 12:19:19 2012 +0200 + + broadband-modem-qmi: keep the QMI port open for the whole lifetime + of the modem + + The QMI port is opened during the modem initialization, and kept + open until the + modem gets destroyed. + + src/mm-broadband-modem-qmi.c | 175 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 175 insertions(+) + +commit 19da38a330ad0e5ef567c074932a79ae09e897f2 +Author: Aleksander Morgado +Date: Thu Jun 28 11:42:07 2012 +0200 + + qmi: new generic `MMBroadbandModemQmi' object + + src/Makefile.am | 2 ++ + src/mm-broadband-modem-qmi.c | 58 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-modem-qmi.h | 47 +++++++++++++++++++++++++++++++++++ + 3 files changed, 107 insertions(+) + +commit 40c5e74fec2123aa4016b11df2751962238c7325 +Author: Aleksander Morgado +Date: Fri Jun 29 12:13:38 2012 +0200 + + qmi: setup allocation of service-specific clients + + src/mm-qmi-port.c | 140 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-qmi-port.h | 16 +++++++ + 2 files changed, 156 insertions(+) + +commit 8ee0e3f30fad2cf808ad4f87b5b0827e3d741584 +Author: Aleksander Morgado +Date: Fri Jun 29 14:16:53 2012 +0200 + + port-probe: new helper to check if a QMI port was found in a list + of probes + + src/mm-port-probe.c | 13 +++++++++++++ + src/mm-port-probe.h | 3 ++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit db99f340c89f589784a76879bcf3735c8317cfc7 +Author: Aleksander Morgado +Date: Wed Jun 27 13:57:34 2012 +0200 + + port-probe: launch QMI probing on cdc-wdm ports + + Some devices may export cdc-wdm ports talking AT. We need to + explicitly check + for QMI protocol support on the cdc-wdm ports before assuming they + are QMI. + + src/mm-plugin.c | 38 +++++++------- + src/mm-port-probe.c | 140 + +++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-port-probe.h | 4 ++ + 3 files changed, 157 insertions(+), 25 deletions(-) + +commit 3e251129c2f2d481e3391d64db9fc12820899803 +Author: Aleksander Morgado +Date: Tue Jun 26 14:18:01 2012 +0200 + + base-modem: use the new `MMQmiPort' object + + src/mm-base-modem.c | 12 ++++-------- + src/mm-base-modem.h | 5 +++-- + 2 files changed, 7 insertions(+), 10 deletions(-) + +commit 26d3c28e435a07aa4233ef3c3e6fc09f94a8e2b0 +Author: Aleksander Morgado +Date: Tue Jun 26 14:12:44 2012 +0200 + + core: new `MMQmiPort' object + + This object encapsulates the usage of the `QmiDevice' coming from + libqmi-glib. + + configure.ac | 3 +- + src/Makefile.am | 4 +- + src/mm-qmi-port.c | 216 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-qmi-port.h | 59 +++++++++++++++ + 4 files changed, 280 insertions(+), 2 deletions(-) + +commit dc8d9dfdb9456c3aae466d4f2168c1b0e24d8c16 +Author: Aleksander Morgado +Date: Tue Jun 26 13:01:39 2012 +0200 + + build: fix definitions of cflags/libs + + configure.ac | 9 ++++++--- + libmm-glib/Makefile.am | 4 ++-- + 2 files changed, 8 insertions(+), 5 deletions(-) + +commit f1e711e01bd08cfb68fbfbda0119913ed123f8b4 +Author: Aleksander Morgado +Date: Fri Apr 13 11:22:56 2012 +0200 + + udev: don't require specific driver for cdc-wdm ports + + Reported by Bjørn Mork + + src/80-mm-candidate.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 73a9a037be65807f7eb3c04b5726bc9416ac1524 +Author: Aleksander Morgado +Date: Wed Apr 11 11:47:02 2012 +0200 + + base-modem: allow getting/peeking the QMI port + + src/mm-base-modem.c | 33 ++++++++++++++++++++++++++++++++- + src/mm-base-modem.h | 2 ++ + 2 files changed, 34 insertions(+), 1 deletion(-) + +commit 306b4eb5094fb4f46120b41a104e937d0f41e1e9 +Author: Aleksander Morgado +Date: Wed Apr 11 11:38:49 2012 +0200 + + core: allow grabbing QMI ports + + src/80-mm-candidate.rules | 2 +- + src/mm-base-modem.c | 14 +++++++++++-- + src/mm-device.c | 11 ++++++++++ + src/mm-manager.c | 39 ++++++++++++++++++++++++++--------- + src/mm-plugin.c | 7 ++++--- + src/mm-port-probe.c | 52 + ++++++++++++++++++++++++++++++++++++++++------- + src/mm-port.h | 6 ++++-- + 7 files changed, 106 insertions(+), 25 deletions(-) + +commit ab67c0b7c363198078c49b6003c4a2cbdffa6694 +Author: Aleksander Morgado +Date: Tue Aug 28 17:34:47 2012 +0200 + + cinterion: update AT command timeout when setting bands to 15s + + Seems the reply to the command is received once the change has been + done, so it + may take longer than the previous default of 3s. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ae9e2df294faf2a6469db1223bb0ab7955be633c +Author: Aleksander Morgado +Date: Tue Aug 28 17:25:32 2012 +0200 + + iface-modem-3gpp: don't try to update anything if no skeleton + available + + src/mm-iface-modem-3gpp.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3ee1fb691c87cee5a5c27548a2f8dc03e596ec17 +Author: Aleksander Morgado +Date: Tue Aug 28 17:25:25 2012 +0200 + + iface-modem-cdma: don't try to update anything if no skeleton + available + + src/mm-iface-modem-cdma.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 26e95b2d3c979bf35a49466a2b245a39da82fde0 +Author: Aleksander Morgado +Date: Tue Aug 28 17:21:08 2012 +0200 + + iface-modem-location: don't try to update anything if no skeleton + available + + src/mm-iface-modem-location.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 3ff03c946fb244bf336aebd61807b5ffa0b28124 +Author: Aleksander Morgado +Date: Tue Aug 28 17:07:10 2012 +0200 + + iface-modem-simple: don't launch band/mode updates unless explicitly + required + + libmm-common/mm-simple-connect-properties.c | 38 ++++++++++++------- + libmm-common/mm-simple-connect-properties.h | 4 +- + src/mm-iface-modem-simple.c | 58 + +++++++++++++++++------------ + 3 files changed, 61 insertions(+), 39 deletions(-) + +commit 567a744a49deb81ecdda307444692d8c38d062c6 +Author: Aleksander Morgado +Date: Tue Aug 28 17:06:09 2012 +0200 + + wavecom: fix segfault when setting allowed modes + + plugins/wavecom/mm-broadband-modem-wavecom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6b684fec5fef608eb28ab443598c3ca03f0077bc +Author: Aleksander Morgado +Date: Tue Aug 28 16:55:08 2012 +0200 + + cinterion: fix loading supported bands + + plugins/cinterion/mm-broadband-modem-cinterion.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +commit b087ba7d1d87cdc51d136eb186d984c40d04c831 +Author: Aleksander Morgado +Date: Tue Aug 28 16:52:26 2012 +0200 + + wavecom: fix loading supported bands + + plugins/wavecom/mm-broadband-modem-wavecom.c | 33 + ++++++++++++++++------------ + 1 file changed, 19 insertions(+), 14 deletions(-) + +commit 8225dec907adaca45eb7c2c1c8205401499e3d1d +Author: Aleksander Morgado +Date: Tue Aug 28 16:36:37 2012 +0200 + + iface-modem: supported bands may be reported as UNKNOWN if couldn't + be loaded + + src/mm-iface-modem.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +commit 9dbf9a8d0ec50be69b2b0f09634f12e04a4efd15 +Author: Aleksander Morgado +Date: Tue Aug 28 16:26:28 2012 +0200 + + iface-modem: don't validate against supported bands if these are + unknown + + src/mm-iface-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 67b051cf6999526d961ea7bb657644502df9ef90 +Author: Aleksander Morgado +Date: Tue Aug 28 16:18:03 2012 +0200 + + broadband-modem: skip trail/leading whitespaces in manufacturer, + model, revision + + src/mm-broadband-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 667df5635c7ce947232d5071bed260668e843d7d +Author: Ben Chan +Date: Fri Aug 24 09:12:42 2012 -0700 + + iface-modem: skip setting bands if target list equals to current list + + src/mm-iface-modem.c | 55 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 53 insertions(+), 2 deletions(-) + +commit 178de0e51d925f7b20aedcfc6b773e9d173d13a8 +Author: Ben Chan +Date: Sat Aug 25 21:34:55 2012 -0700 + + sms-part: use g_set_error instead of g_error_new for consistency + + src/mm-sms-part.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit e997803594873dffbdd9922e2f4f682f07e9a0eb +Author: Ben Chan +Date: Fri Aug 24 08:04:09 2012 -0700 + + sim: validate IMSI value in +CIMI response + + src/mm-sim.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +commit a1d6667df93703b3a15bca0388192680aa54027c +Author: Aleksander Morgado +Date: Sun Aug 26 23:01:07 2012 +0200 + + novatel: don't claim the Novatel E362, should be handled by + `novatel-lte' + + plugins/novatel/mm-plugin-novatel.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +commit 0436b3e45753a166fea18d6c1463aef5a38fd1ee +Author: Aleksander Morgado +Date: Fri Aug 24 13:28:22 2012 +0200 + + api,introspection: report list of drivers, not just one + + Different ports of the same modem may get handled by different + drivers. We + therefore need to provide a list of drivers (new `Modem.Drivers' + property with + signature 'as') instead of just one (removed `Modem.Driver' + property with + signature 's'). + + $ sudo mmcli -m 0 | grep drivers + | drivers: 'qcserial, qmi_wwan' + + TODO | 3 -- + cli/mmcli-modem.c | 15 ++++++- + .../org.freedesktop.ModemManager1.Modem.xml | 6 +-- + libmm-glib/mm-modem.c | 24 +++++------ + libmm-glib/mm-modem.h | 4 +- + plugins/anydata/mm-broadband-modem-anydata.c | 4 +- + plugins/anydata/mm-broadband-modem-anydata.h | 2 +- + plugins/anydata/mm-plugin-anydata.c | 4 +- + plugins/cinterion/mm-broadband-modem-cinterion.c | 4 +- + plugins/cinterion/mm-broadband-modem-cinterion.h | 2 +- + plugins/cinterion/mm-plugin-cinterion.c | 4 +- + plugins/generic/mm-plugin-generic.c | 4 +- + plugins/gobi/mm-broadband-modem-gobi.c | 4 +- + plugins/gobi/mm-broadband-modem-gobi.h | 2 +- + plugins/gobi/mm-plugin-gobi.c | 4 +- + plugins/huawei/mm-broadband-modem-huawei.c | 4 +- + plugins/huawei/mm-broadband-modem-huawei.h | 2 +- + plugins/huawei/mm-plugin-huawei.c | 4 +- + plugins/icera/mm-broadband-modem-icera.c | 4 +- + plugins/icera/mm-broadband-modem-icera.h | 2 +- + plugins/iridium/mm-broadband-modem-iridium.c | 4 +- + plugins/iridium/mm-broadband-modem-iridium.h | 2 +- + plugins/iridium/mm-plugin-iridium.c | 4 +- + plugins/linktop/mm-broadband-modem-linktop.c | 4 +- + plugins/linktop/mm-broadband-modem-linktop.h | 2 +- + plugins/linktop/mm-plugin-linktop.c | 4 +- + plugins/longcheer/mm-broadband-modem-longcheer.c | 4 +- + plugins/longcheer/mm-broadband-modem-longcheer.h | 2 +- + plugins/longcheer/mm-plugin-longcheer.c | 4 +- + plugins/mbm/mm-broadband-modem-mbm.c | 4 +- + plugins/mbm/mm-broadband-modem-mbm.h | 2 +- + plugins/mbm/mm-plugin-mbm.c | 4 +- + plugins/motorola/mm-broadband-modem-motorola.c | 4 +- + plugins/motorola/mm-broadband-modem-motorola.h | 2 +- + plugins/motorola/mm-plugin-motorola.c | 4 +- + plugins/nokia/mm-broadband-modem-nokia.c | 4 +- + plugins/nokia/mm-broadband-modem-nokia.h | 2 +- + plugins/nokia/mm-plugin-nokia-icera.c | 4 +- + plugins/nokia/mm-plugin-nokia.c | 4 +- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 +- + plugins/novatel/mm-broadband-modem-novatel-lte.h | 2 +- + plugins/novatel/mm-broadband-modem-novatel.c | 4 +- + plugins/novatel/mm-broadband-modem-novatel.h | 2 +- + plugins/novatel/mm-plugin-novatel-lte.c | 4 +- + plugins/novatel/mm-plugin-novatel.c | 4 +- + plugins/option/mm-broadband-modem-hso.c | 10 ++--- + plugins/option/mm-broadband-modem-hso.h | 2 +- + plugins/option/mm-broadband-modem-option.c | 4 +- + plugins/option/mm-broadband-modem-option.h | 2 +- + plugins/option/mm-plugin-hso.c | 4 +- + plugins/option/mm-plugin-option.c | 4 +- + plugins/pantech/mm-plugin-pantech.c | 4 +- + plugins/samsung/mm-broadband-modem-samsung.c | 4 +- + plugins/samsung/mm-broadband-modem-samsung.h | 2 +- + plugins/samsung/mm-plugin-samsung.c | 4 +- + plugins/sierra/mm-broadband-modem-sierra-icera.c | 4 +- + plugins/sierra/mm-broadband-modem-sierra-icera.h | 2 +- + plugins/sierra/mm-broadband-modem-sierra.c | 4 +- + plugins/sierra/mm-broadband-modem-sierra.h | 2 +- + plugins/sierra/mm-common-sierra.c | 15 ++++--- + plugins/sierra/mm-plugin-sierra.c | 6 +-- + plugins/simtech/mm-broadband-modem-simtech.c | 4 +- + plugins/simtech/mm-broadband-modem-simtech.h | 2 +- + plugins/simtech/mm-plugin-simtech.c | 4 +- + plugins/wavecom/mm-broadband-modem-wavecom.c | 4 +- + plugins/wavecom/mm-broadband-modem-wavecom.h | 2 +- + plugins/wavecom/mm-plugin-wavecom.c | 4 +- + plugins/x22x/mm-broadband-modem-x22x.c | 4 +- + plugins/x22x/mm-broadband-modem-x22x.h | 2 +- + plugins/x22x/mm-plugin-x22x.c | 4 +- + plugins/zte/mm-broadband-modem-zte-icera.c | 4 +- + plugins/zte/mm-broadband-modem-zte-icera.h | 2 +- + plugins/zte/mm-broadband-modem-zte.c | 4 +- + plugins/zte/mm-broadband-modem-zte.h | 2 +- + plugins/zte/mm-plugin-zte.c | 6 +-- + src/mm-base-modem.c | 36 ++++++++-------- + src/mm-base-modem.h | 8 ++-- + src/mm-broadband-modem.c | 4 +- + src/mm-broadband-modem.h | 2 +- + src/mm-device.c | 50 + ++++++++++++++++++---- + src/mm-device.h | 24 +++++------ + src/mm-iface-modem.c | 12 +++--- + src/mm-plugin.c | 37 ++++++++++------ + src/mm-plugin.h | 2 +- + 84 files changed, 268 insertions(+), 214 deletions(-) + +commit a595912d2d70fce7a8370b194c230331fee605a7 +Author: Aleksander Morgado +Date: Fri Aug 24 13:09:17 2012 +0200 + + novatel: fix creation of the `MMBroadbandModemNovatel' object + + plugins/novatel/mm-plugin-novatel.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 985f510041a131cd1400deca5a9a9b004479dcac +Author: Aleksander Morgado +Date: Fri Aug 24 12:28:34 2012 +0200 + + cli: fix output message when storing a SMS + + cli/mmcli-sms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ba4e209745676a08f7c886d7cd0ba13202e336d5 +Author: Aleksander Morgado +Date: Fri Aug 24 12:01:01 2012 +0200 + + sms: fix sending SMS messages on some modems + + This is the port to git master of the following commit: + + commit 65f13f41cfd00cd38f118121a58b83713501f45f + Author: Dan Williams + Date: Tue Jul 17 16:00:31 2012 -0500 + + gsm: fix sending SMS messages on some modems and use PDU by + default + + It turns out we really do have to wait for the modem to return the + ">" prompt before sending the message data, otherwise a number of + modems will complain about the data and fail the message. + Fix that + by sending the first bit of the CMGS, waiting for the ">", + and then + sending the rest. + + This also switches all modems over to PDU mode by default if they + support it, since it's more compatible and most recent modems + don't + even bother to support text mode anyway. + + src/mm-serial-parsers.c | 19 ++++++-- + src/mm-sms.c | 118 + ++++++++++++++++++++++++++++++++++++------------ + 2 files changed, 105 insertions(+), 32 deletions(-) + +commit 4fe7c7d637644de6b24e7d71a45aad3647086e19 +Author: Aleksander Morgado +Date: Fri Aug 24 11:47:14 2012 +0200 + + base-modem-at: new `mm_base_modem_at_command_raw()' + + Equivalent to `mm_base_modem_at_command()', but with a raw setup. + + src/mm-base-modem-at.c | 39 +++++++++++++++++++++++++++++++-------- + src/mm-base-modem-at.h | 7 +++++++ + 2 files changed, 38 insertions(+), 8 deletions(-) + +commit d18dbb869ae0546dc5baa3118535e701fa513b34 +Author: Aleksander Morgado +Date: Fri Aug 24 11:45:02 2012 +0200 + + base-modem-at: add 'raw' handling to `mm_base_modem_at_command_full()' + + plugins/huawei/mm-broadband-modem-huawei.c | 1 + + plugins/icera/mm-broadband-bearer-icera.c | 7 +++++++ + plugins/iridium/mm-bearer-iridium.c | 3 +++ + plugins/mbm/mm-broadband-bearer-mbm.c | 4 ++++ + plugins/option/mm-broadband-bearer-hso.c | 32 + +++++++++++++++++------------ + plugins/option/mm-broadband-modem-hso.c | 4 +++- + plugins/sierra/mm-broadband-bearer-sierra.c | 4 ++++ + plugins/sierra/mm-broadband-modem-sierra.c | 2 ++ + src/mm-base-modem-at.c | 11 +++++----- + src/mm-base-modem-at.h | 1 + + src/mm-broadband-bearer.c | 9 ++++++++ + src/mm-broadband-modem.c | 8 ++++++-- + 12 files changed, 65 insertions(+), 21 deletions(-) + +commit d9ea4a304c06d28c5f8d780abe6f57cc179ba2a8 +Author: Aleksander Morgado +Date: Fri Aug 24 11:39:19 2012 +0200 + + at-serial-port: allow sending 'raw' commands + + Commands treated as 'raw' won't get the 'AT' prefix and will also + not get the + trailing carriage return. + + plugins/huawei/mm-plugin-huawei.c | 2 ++ + plugins/longcheer/mm-plugin-longcheer.c | 1 + + plugins/sierra/mm-plugin-sierra.c | 1 + + plugins/x22x/mm-plugin-x22x.c | 1 + + src/mm-at-serial-port.c | 25 ++++++++++++++++--------- + src/mm-at-serial-port.h | 2 ++ + src/mm-base-modem-at.c | 5 +++++ + src/mm-port-probe.c | 1 + + 8 files changed, 29 insertions(+), 9 deletions(-) + +commit d74336e96dc24b578324f45d57e108d686a95df5 +Author: Aleksander Morgado +Date: Fri Aug 24 11:37:38 2012 +0200 + + build: warn about unused but set variables + + m4/compiler_warnings.m4 | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 20cd805a2a9a1f637108b9b132d3ab007bd43d5f +Author: Aleksander Morgado +Date: Thu Aug 23 18:54:26 2012 +0200 + + build: cleanup plugin compilation rules + + plugins/Makefile.am | 36 ------------------------------------ + 1 file changed, 36 deletions(-) + +commit e1aa7d376f27ab46a3f7711a2a0c0b0c4be913bd +Author: Aleksander Morgado +Date: Thu Aug 23 18:53:51 2012 +0200 + + mbm: plugin fully ported + + plugins/mm-modem-mbm.c | 1068 + ----------------------------------------------- + plugins/mm-modem-mbm.h | 50 --- + plugins/mm-plugin-mbm.c | 194 --------- + plugins/mm-plugin-mbm.h | 44 -- + 4 files changed, 1356 deletions(-) + +commit 2d0cb24af86610032e4f797ccc407ec0722623bd +Author: Aleksander Morgado +Date: Thu Aug 23 18:52:32 2012 +0200 + + mbm: implement custom 3GPP disconnection sequence + + plugins/mbm/mm-broadband-bearer-mbm.c | 82 + +++++++++++++++++++++++++++++++++++ + 1 file changed, 82 insertions(+) + +commit 3ddb57d816ae449c4b4b2d7fc4c201d4d68cf50d +Author: Aleksander Morgado +Date: Thu Aug 23 18:49:16 2012 +0200 + + mbm: implement custom 3GPP dialling sequence + + plugins/mbm/mm-broadband-bearer-mbm.c | 417 + ++++++++++++++++++++++++++++++++++ + plugins/mbm/mm-broadband-bearer-mbm.h | 10 + + plugins/mbm/mm-broadband-modem-mbm.c | 103 +++++++-- + 3 files changed, 516 insertions(+), 14 deletions(-) + +commit 2f20fc64c27fa48675c170460f2584279831ae23 +Author: Aleksander Morgado +Date: Thu Aug 23 17:57:25 2012 +0200 + + mbm: new `MMBroadbandBearerMbm' object + + plugins/Makefile.am | 4 +- + plugins/mbm/mm-broadband-bearer-mbm.c | 93 + +++++++++++++++++++++++++++++++++++ + plugins/mbm/mm-broadband-bearer-mbm.h | 66 +++++++++++++++++++++++++ + plugins/mbm/mm-broadband-modem-mbm.c | 59 ++++++++++++++++++++++ + 4 files changed, 221 insertions(+), 1 deletion(-) + +commit 3753184eb149c9f12ea8d24f65da3a9339f890ae +Author: Aleksander Morgado +Date: Thu Aug 23 17:41:31 2012 +0200 + + mbm: implement custom PIN retry count loading + + plugins/mbm/mm-broadband-modem-mbm.c | 61 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit 3cdfa93c7376a10092cc771ff79430bc3e77fb75 +Author: Aleksander Morgado +Date: Thu Aug 23 17:32:51 2012 +0200 + + mbm: implement custom modem factory reset + + plugins/mbm/mm-broadband-modem-mbm.c | 48 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +commit 1fa82ebd403c6b696b607046ad370726a3db7272 +Author: Aleksander Morgado +Date: Thu Aug 23 17:27:03 2012 +0200 + + mbm: implement custom modem reset + + plugins/mbm/mm-broadband-modem-mbm.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit ef300a69b6b859f071849bd7a39653cf03a0e305 +Author: Aleksander Morgado +Date: Thu Aug 23 17:24:17 2012 +0200 + + mbm: receive E2NAP unsolicited messages + + plugins/mbm/mm-broadband-modem-mbm.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit e9941b1b80f4cc7c237fc9a5b94b5d7a025bc7d3 +Author: Aleksander Morgado +Date: Thu Aug 23 17:19:29 2012 +0200 + + mbm: implement custom 3GPP unsolicited messages setup/cleanup + + Including access technology reporting now. + + plugins/mbm/mm-broadband-modem-mbm.c | 162 + +++++++++++++++++++++++++++++++++++ + 1 file changed, 162 insertions(+) + +commit 08825d361c8cf033df3acf1a3483ce55d8f96816 +Author: Aleksander Morgado +Date: Thu Aug 23 17:10:04 2012 +0200 + + mbm: no need to flash serial ports + + plugins/mbm/mm-broadband-modem-mbm.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 894ff1be689647425b76237515ffe2f50701693b +Author: Aleksander Morgado +Date: Thu Aug 23 17:09:03 2012 +0200 + + mbm: ignore several unsolicited messages + + plugins/mbm/mm-broadband-modem-mbm.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit 49f5bc98e2577a0e6c4d1c4f9695d344a0a38830 +Author: Aleksander Morgado +Date: Thu Aug 23 17:02:16 2012 +0200 + + mbm: only allow enabling if *EMRDY has been received + + plugins/mbm/mm-broadband-modem-mbm.c | 152 + +++++++++++++++++++++++++++++++++-- + 1 file changed, 146 insertions(+), 6 deletions(-) + +commit 6c6cbb33e7bfd1709e57f677ec265b65e4e5c1ef +Author: Aleksander Morgado +Date: Thu Aug 23 16:31:34 2012 +0200 + + mbm: implement custom initialization commands + + plugins/mbm/mm-broadband-modem-mbm.c | 36 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +commit 2a06d1ed08addd97578f71d671cdaf87d8a71515 +Author: Aleksander Morgado +Date: Thu Aug 23 16:27:01 2012 +0200 + + mbm: implement custom power-up command + + plugins/mbm/mm-broadband-modem-mbm.c | 52 + +++++++++++++++++++++++++++++++++++- + plugins/mbm/mm-broadband-modem-mbm.h | 2 ++ + 2 files changed, 53 insertions(+), 1 deletion(-) + +commit efe4a7fb755b4b140cb680cb92e2d9f925387f96 +Author: Aleksander Morgado +Date: Thu Aug 23 15:25:56 2012 +0200 + + mbm: implement custom 3GPP unsolicited events enabling/disabling + + plugins/mbm/mm-broadband-modem-mbm.c | 155 + ++++++++++++++++++++++++++++++++++- + 1 file changed, 154 insertions(+), 1 deletion(-) + +commit 78a716e07b3fb4e2227eb35ac3cf8d325751805b +Author: Aleksander Morgado +Date: Thu Aug 23 15:19:31 2012 +0200 + + mbm: implement custom allowed mode setting + + plugins/mbm/mm-broadband-modem-mbm.c | 87 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 87 insertions(+) + +commit e2c7ff2219d546e1ded96c0ace4e4f7b7648c25d +Author: Aleksander Morgado +Date: Thu Aug 23 15:10:49 2012 +0200 + + mbm: implement custom allowed mode loading + + plugins/mbm/mm-broadband-modem-mbm.c | 65 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit 758eb07c0d830eaa6cc01b96c1d7cbdf89a25156 +Author: Aleksander Morgado +Date: Thu Aug 23 15:00:56 2012 +0200 + + mbm: sleep 500ms after sim unlock + + plugins/mbm/mm-broadband-modem-mbm.c | 48 + +++++++++++++++++++++++++++++++++++- + 1 file changed, 47 insertions(+), 1 deletion(-) + +commit ea53df17ddb140f63d0743e83bf98e697952d595 +Author: Aleksander Morgado +Date: Thu Aug 23 14:53:14 2012 +0200 + + mbm: new `MMBroadbandModemMbm' object + + plugins/Makefile.am | 4 ++- + plugins/mbm/mm-broadband-modem-mbm.c | 66 + ++++++++++++++++++++++++++++++++++++ + plugins/mbm/mm-broadband-modem-mbm.h | 56 ++++++++++++++++++++++++++++++ + plugins/mbm/mm-plugin-mbm.c | 12 +++---- + 4 files changed, 131 insertions(+), 7 deletions(-) + +commit c7c21ae460cd87aa93c9fcba3f35fec0cffffd9d +Author: Aleksander Morgado +Date: Thu Aug 23 12:33:01 2012 +0200 + + mbm: start porting the MBM plugin + + plugins/Makefile.am | 18 +++---- + plugins/{ => mbm}/77-mm-ericsson-mbm.rules | 0 + plugins/mbm/mm-plugin-mbm.c | 83 + ++++++++++++++++++++++++++++++ + plugins/mbm/mm-plugin-mbm.h | 43 ++++++++++++++++ + 4 files changed, 135 insertions(+), 9 deletions(-) + +commit 24bb59f5a52257cf3e785736ca8fc27517d2e010 +Author: Aleksander Morgado +Date: Thu Aug 23 11:44:24 2012 +0200 + + sierra: plugin fully ported + + plugins/mm-modem-sierra-cdma.c | 415 ------------------- + plugins/mm-modem-sierra-cdma.h | 47 --- + plugins/mm-modem-sierra-gsm.c | 917 + ----------------------------------------- + plugins/mm-modem-sierra-gsm.h | 45 -- + plugins/mm-plugin-sierra.c | 244 ----------- + plugins/mm-plugin-sierra.h | 42 -- + 6 files changed, 1710 deletions(-) + +commit 6b1ee4e3cbf82a06943de56589c5ee533065bc79 +Author: Aleksander Morgado +Date: Thu Aug 23 12:10:55 2012 +0200 + + sierra: both AT and QCDM expected + + plugins/sierra/mm-plugin-sierra.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 896e0469f027768757a68266f0390b203cbf06d5 +Author: Aleksander Morgado +Date: Thu Aug 23 11:43:07 2012 +0200 + + sierra: implement custom CDMA detailed registration checks + + plugins/sierra/mm-broadband-modem-sierra.c | 338 + ++++++++++++++++++++++++++++- + 1 file changed, 337 insertions(+), 1 deletion(-) + +commit 5764d396899c725d5702710af030d23744d3f0d4 +Author: Aleksander Morgado +Date: Thu Aug 23 11:42:50 2012 +0200 + + modem-helpers: ERI parser is generic enough, not just for !SPERI + + plugins/novatel/mm-broadband-modem-novatel.c | 2 +- + src/mm-broadband-modem.c | 2 +- + src/mm-modem-helpers.c | 8 ++++---- + src/mm-modem-helpers.h | 10 +++++----- + 4 files changed, 11 insertions(+), 11 deletions(-) + +commit 86e7b0e8c6d88565adcac5dcb72f87e3fd97f0d8 +Author: Aleksander Morgado +Date: Thu Aug 23 11:24:33 2012 +0200 + + sierra: custom power-down command for CDMA modems + + plugins/sierra/mm-broadband-modem-sierra.c | 58 + ++++++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + +commit 5b9c1625b6025d027c40fc62081e154507181557 +Author: Aleksander Morgado +Date: Thu Aug 23 11:19:14 2012 +0200 + + sierra: custom power-up command for CDMA modems + + plugins/sierra/mm-common-sierra.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 7027c6e9729f5eeaf53c11d7791b372cb9e85e43 +Author: Aleksander Morgado +Date: Wed Aug 22 17:14:14 2012 +0200 + + sierra: custom 3GPP disconnection sequence + + plugins/sierra/mm-broadband-bearer-sierra.c | 97 + +++++++++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + +commit d8bc27a8c3681693a0c297a965d5f5858258d96a +Author: Aleksander Morgado +Date: Wed Aug 22 17:02:18 2012 +0200 + + sierra: custom 3GPP dialling sequence + + plugins/sierra/mm-broadband-bearer-sierra.c | 244 + ++++++++++++++++++++++++++++ + 1 file changed, 244 insertions(+) + +commit d091344da2e50ef4016a87493b06fc54e40a2184 +Author: Aleksander Morgado +Date: Wed Aug 22 16:44:10 2012 +0200 + + broadband-bearer: pass down the data port to the 3GPP dialling step + + Plugins may require specific dialling commands depending on the + port type. + + plugins/icera/mm-broadband-bearer-icera.c | 1 + + plugins/option/mm-broadband-bearer-hso.c | 1 + + src/mm-broadband-bearer.c | 2 ++ + src/mm-broadband-bearer.h | 1 + + 4 files changed, 5 insertions(+) + +commit 3666168c121e7ad74c611af74f8c905cec9d030b +Author: Aleksander Morgado +Date: Wed Aug 22 16:30:56 2012 +0200 + + sierra: new `MMBroadbandBearerSierra' object + + plugins/Makefile.am | 2 + + plugins/sierra/mm-broadband-bearer-sierra.c | 85 + +++++++++++++++++++++++++++++ + plugins/sierra/mm-broadband-bearer-sierra.h | 58 ++++++++++++++++++++ + plugins/sierra/mm-broadband-modem-sierra.c | 59 ++++++++++++++++++++ + 4 files changed, 204 insertions(+) + +commit 79b4c4b47d39907c0a38d5e13d9e9a6c576b5e9b +Author: Aleksander Morgado +Date: Wed Aug 22 16:11:19 2012 +0200 + + sierra: implement custom ports setup + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 15 +++++++++++ + plugins/sierra/mm-broadband-modem-sierra.c | 15 +++++++++++ + plugins/sierra/mm-common-sierra.c | 32 + ++++++++++++++++++++++++ + plugins/sierra/mm-common-sierra.h | 2 ++ + 4 files changed, 64 insertions(+) + +commit 96a6e8923ae2d2d418f868a15fbf662c737df09d +Author: Aleksander Morgado +Date: Wed Aug 22 16:01:10 2012 +0200 + + broadband-bearer: generic CDMA connections are all over serial port + and PPP + + src/mm-broadband-bearer.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +commit e38828c31808d7055a739083dffe773e9e8782aa +Author: Aleksander Morgado +Date: Wed Aug 22 16:00:12 2012 +0200 + + broadband-bearer: allow implementations to override the port used + for connection + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 4 ++ + src/mm-broadband-bearer.c | 84 + +++++++++++++++-------- + src/mm-broadband-bearer.h | 2 + + 3 files changed, 61 insertions(+), 29 deletions(-) + +commit 3dfb48d75a715e593354840e3ec59eedf55c3847 +Author: Aleksander Morgado +Date: Wed Aug 22 15:05:30 2012 +0200 + + sierra: custom SIM identifier loading + + plugins/sierra/mm-sim-sierra.c | 113 + +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 113 insertions(+) + +commit 0c80815ea2366bbf2dbc3b2bf4aee8aa175d435e +Author: Aleksander Morgado +Date: Wed Aug 22 14:50:28 2012 +0200 + + sierra: new `MMSimSierra' object + + plugins/Makefile.am | 2 + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 2 + + plugins/sierra/mm-broadband-modem-sierra.c | 2 + + plugins/sierra/mm-common-sierra.c | 24 ++++++++ + plugins/sierra/mm-common-sierra.h | 7 +++ + plugins/sierra/mm-sim-sierra.c | 77 + ++++++++++++++++++++++++ + plugins/sierra/mm-sim-sierra.h | 53 ++++++++++++++++ + 7 files changed, 167 insertions(+) + +commit cd2174d2ef0a0fa023ac2ddfeaa7ca0abb2ea7b0 +Author: Aleksander Morgado +Date: Wed Aug 22 14:38:01 2012 +0200 + + sierra: implement custom allowed/preferred mode setting + + plugins/sierra/mm-broadband-modem-sierra.c | 117 + +++++++++++++++++++++++++++++ + 1 file changed, 117 insertions(+) + +commit bce0a2c48e4a865f30ee0371712d577be8ccfaa1 +Author: Aleksander Morgado +Date: Wed Aug 22 12:55:40 2012 +0200 + + sierra: implement custom allowed/preferred mode loading + + plugins/sierra/mm-broadband-modem-sierra.c | 145 + +++++++++++++++++++++++++++++ + 1 file changed, 145 insertions(+) + +commit b6fb78ffd71ff14b14a302158cc87ed1f42b3dba +Author: Aleksander Morgado +Date: Wed Aug 22 12:31:23 2012 +0200 + + sierra,icera: implement custom power up sequence + + plugins/sierra/mm-broadband-modem-sierra-icera.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +commit 713eb2848476d331d01df57549cb5aa307f77f6f +Author: Aleksander Morgado +Date: Wed Aug 22 12:29:39 2012 +0200 + + sierra: new `MMBroadbandModemSierraIcera' object + + plugins/Makefile.am | 4 +- + plugins/sierra/mm-broadband-modem-sierra-icera.c | 59 + ++++++++++++++++++++++++ + plugins/sierra/mm-broadband-modem-sierra-icera.h | 49 + ++++++++++++++++++++ + plugins/sierra/mm-plugin-sierra.c | 12 ++--- + 4 files changed, 117 insertions(+), 7 deletions(-) + +commit 4195a3f1a3ee3a7b15457a965b04489d9b091c22 +Author: Aleksander Morgado +Date: Wed Aug 22 12:25:03 2012 +0200 + + sierra: implement custom power up sequence + + It is split in a new set of `mm-common-sierra.[hc]' files as this + sequence will + also be used in Icera-based modems. + + plugins/Makefile.am | 2 + + plugins/sierra/mm-broadband-modem-sierra.c | 3 + + plugins/sierra/mm-common-sierra.c | 137 + +++++++++++++++++++++++++++++ + plugins/sierra/mm-common-sierra.h | 31 +++++++ + 4 files changed, 173 insertions(+) + +commit d517b611e9fbc24a5d0e58cc7bd87f2d448412cf +Author: Aleksander Morgado +Date: Wed Aug 22 12:12:50 2012 +0200 + + sierra: load access technologies in 3GPP modems + + plugins/sierra/mm-broadband-modem-sierra.c | 103 + ++++++++++++++++++++++++++++- + 1 file changed, 102 insertions(+), 1 deletion(-) + +commit 2d425d89b94694979ea182c1ead7b0af4dd623a3 +Author: Aleksander Morgado +Date: Wed Aug 22 12:00:33 2012 +0200 + + sierra: new `MMBroadbandModemSierra' object + + plugins/Makefile.am | 4 +- + plugins/sierra/mm-broadband-modem-sierra.c | 59 + ++++++++++++++++++++++++++++++ + plugins/sierra/mm-broadband-modem-sierra.h | 49 +++++++++++++++++++++++++ + plugins/sierra/mm-plugin-sierra.c | 12 +++--- + 4 files changed, 117 insertions(+), 7 deletions(-) + +commit d033d6927ff59c0b11dbe5922ca9a7db516934c0 +Author: Aleksander Morgado +Date: Wed Aug 22 10:52:21 2012 +0200 + + sierra: allow Icera-based sierra modems + + plugins/Makefile.am | 3 ++- + plugins/sierra/mm-plugin-sierra.c | 17 +++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 69316289e8aaea84cd5c22f940f4e83def1819e4 +Author: Aleksander Morgado +Date: Wed Aug 22 10:38:49 2012 +0200 + + sierra: start porting the Sierra plugin + + plugins/Makefile.am | 21 ++-- + plugins/sierra/mm-plugin-sierra.c | 232 + ++++++++++++++++++++++++++++++++++++++ + plugins/sierra/mm-plugin-sierra.h | 42 +++++++ + 3 files changed, 282 insertions(+), 13 deletions(-) + +commit b2ada906b0c39f5b4f74fff9c4167d11faf4f3c7 +Author: Aleksander Morgado +Date: Wed Aug 22 14:50:05 2012 +0200 + + nokia: fix SIM object creation + + plugins/nokia/mm-broadband-modem-nokia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 55699e651892b62d46a2734f9aca7b773115bb1d +Author: Aleksander Morgado +Date: Wed Aug 22 14:49:55 2012 +0200 + + iridium: fix SIM object creation + + plugins/iridium/mm-broadband-modem-iridium.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1ac18a06bb37d8745480a9af4fd6bc2f762bf265 +Author: Aleksander Morgado +Date: Wed Aug 22 09:35:15 2012 +0200 + + api,dbus: 'ip-type' property now given as a MMBearerIpFamily (u) + + Instead of using a predefined set of string values for 'ip-type' in + Modem.CreateBearer() and Simple.Connect(), we'll use an + enumeration. The + implementation will then need to convert the requested IP family + type to e.g. + the correct PDP type in 3GPP modems. + + This change also consolidates the use of enums in dictionary + properties when + possible to do so, as with the Rm Protocol. + + cli/mmcli-bearer.c | 3 +- + docs/reference/api/ModemManager-sections.txt | 1 + + include/ModemManager-enums.h | 16 +++++ + .../org.freedesktop.ModemManager1.Modem.Simple.xml | 4 +- + .../org.freedesktop.ModemManager1.Modem.xml | 2 +- + libmm-common/mm-bearer-properties.c | 36 +++++++----- + libmm-common/mm-bearer-properties.h | 4 +- + libmm-common/mm-common-helpers.c | 22 +++++++ + libmm-common/mm-common-helpers.h | 2 + + libmm-common/mm-simple-connect-properties.c | 6 +- + libmm-common/mm-simple-connect-properties.h | 30 +++++----- + src/mm-broadband-bearer.c | 22 +++++-- + src/mm-modem-helpers.c | 68 + +++++++++++++++++----- + src/mm-modem-helpers.h | 5 +- + src/tests/test-modem-helpers.c | 4 +- + 15 files changed, 163 insertions(+), 62 deletions(-) + +commit c15525a1b3c2006e614f75a372f374176f576c23 +Author: Aleksander Morgado +Date: Tue Aug 21 18:28:46 2012 +0200 + + libmm-common: default is to request IPv4 + + libmm-common/mm-bearer-properties.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 39b497c3e758c8be6974ea0ae9a4e64cb5151c34 +Author: Aleksander Morgado +Date: Tue Aug 21 16:41:44 2012 +0200 + + iridium: plug memleak + + plugins/iridium/mm-bearer-iridium.c | 1 + + 1 file changed, 1 insertion(+) + +commit d26071325c2555c1926db84cc77db2084313c4ef +Author: Aleksander Morgado +Date: Mon Aug 20 16:24:08 2012 +0200 + + novatel: plugin fully ported + + plugins/mm-modem-novatel-cdma.c | 310 ---------------------------------- + plugins/mm-modem-novatel-cdma.h | 47 ------ + plugins/mm-modem-novatel-gsm.c | 366 + ---------------------------------------- + plugins/mm-modem-novatel-gsm.h | 45 ----- + plugins/mm-plugin-novatel.c | 191 --------------------- + plugins/mm-plugin-novatel.h | 42 ----- + 6 files changed, 1001 deletions(-) + +commit 678972b63a0c2608f19a49a9caf9efd3406054a8 +Author: Aleksander Morgado +Date: Mon Aug 20 16:22:56 2012 +0200 + + novatel: add detailed CDMA registration state checks + + plugins/novatel/mm-broadband-modem-novatel.c | 171 + ++++++++++++++++++++++++++- + 1 file changed, 170 insertions(+), 1 deletion(-) + +commit 773ff03f9132d7b8a16818cdfa2ea6c2e0ac304a +Author: Aleksander Morgado +Date: Tue Aug 14 18:08:24 2012 +0200 + + novatel: custom signal quality loading for non-3GPP modems + + plugins/novatel/mm-broadband-modem-novatel.c | 151 + +++++++++++++++++++++++++++ + 1 file changed, 151 insertions(+) + +commit 953f787bf349842d5a31a5dd38f7b78a4d860b98 +Author: Aleksander Morgado +Date: Mon Aug 13 11:56:18 2012 +0200 + + novatel: allowed modes and access tech loading only in non-CDMA modems + + plugins/novatel/mm-broadband-modem-novatel.c | 195 + +++++++++++++++++++++------ + 1 file changed, 152 insertions(+), 43 deletions(-) + +commit c9337cc8b91ea6c5fc8022ae876d4dc5ee3904fa +Author: Aleksander Morgado +Date: Mon Aug 13 11:31:26 2012 +0200 + + novatel: configure SM storage as default always + + plugins/novatel/mm-broadband-modem-novatel.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 348a80374ae8ff5d523349f8874011525647f683 +Author: Aleksander Morgado +Date: Mon Aug 13 11:29:21 2012 +0200 + + novatel: implement custom messaging unsolicited messages enabling + + plugins/novatel/mm-broadband-modem-novatel.c | 37 + +++++++++++++++++++++++++++- + 1 file changed, 36 insertions(+), 1 deletion(-) + +commit 1931a69e50d295b0e7ea308e9770381fdf0700b7 +Author: Aleksander Morgado +Date: Mon Aug 13 11:07:45 2012 +0200 + + novatel: implement current access technology loading + + plugins/novatel/mm-broadband-modem-novatel.c | 49 + ++++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + +commit e150c4cf922a4caf2b741a2a155e7ae53eb57740 +Author: Aleksander Morgado +Date: Tue Jul 31 08:52:03 2012 +0200 + + novatel: implement allowed mode loading/setting + + Settings are given with the 'AT$NWRAT' arguments as follows: + 1,1: 2G allowed + 2,1: 3G allowed + 0,2: 2G and 3G allowed, none preferred + 1,2: 2G and 3G allowed, 2G preferred + 2,2: 2G and 3G allowed, 3G preferred + + plugins/novatel/mm-broadband-modem-novatel.c | 205 + ++++++++++++++++++++++++++- + 1 file changed, 204 insertions(+), 1 deletion(-) + +commit b8e5dbcaf45aa34423e066e2af669f9c87af9f6f +Author: Aleksander Morgado +Date: Mon Jul 30 23:49:11 2012 +0200 + + novatel: flip secondary ports to AT mode during port setup + + plugins/novatel/mm-broadband-modem-novatel.c | 23 +++++++++++++++++++++++ + src/mm-base-modem-at.c | 17 +++++++++++++++++ + src/mm-base-modem-at.h | 9 +++++++++ + 3 files changed, 49 insertions(+) + +commit 058fd0256de7e374660088387f291df63880cdb4 +Author: Aleksander Morgado +Date: Mon Jul 30 21:06:12 2012 +0200 + + novatel: new `MMBroadbandModemNovatel' + + plugins/Makefile.am | 4 +- + plugins/novatel/mm-broadband-modem-novatel.c | 60 + ++++++++++++++++++++++++++++ + plugins/novatel/mm-broadband-modem-novatel.h | 51 +++++++++++++++++++++++ + 3 files changed, 114 insertions(+), 1 deletion(-) + +commit 56a7e40e373883a7d2c5e430b4a554aa65974b3e +Author: Aleksander Morgado +Date: Mon Jul 30 20:48:40 2012 +0200 + + novatel: start porting the Novatel plugin + + plugins/Makefile.am | 8 ++++ + plugins/novatel/mm-plugin-novatel.c | 86 + +++++++++++++++++++++++++++++++++++++ + plugins/novatel/mm-plugin-novatel.h | 48 +++++++++++++++++++++ + 3 files changed, 142 insertions(+) + +commit eb71b9464d715ce00027aea33b98b4455e178192 +Author: Aleksander Morgado +Date: Mon Jul 30 21:02:07 2012 +0200 + + novatel-lte: reorganize code + + Just to make it more aligned with how other plugins are structured. + + plugins/novatel/mm-broadband-bearer-novatel-lte.c | 82 + ++++++++++++----------- + plugins/novatel/mm-broadband-modem-novatel-lte.c | 60 +++++++++-------- + 2 files changed, 77 insertions(+), 65 deletions(-) + +commit b399a17163d4035d208050220ef5daf230677bfb +Author: Aleksander Morgado +Date: Mon Jul 30 19:47:09 2012 +0200 + + novatel-lte: renamed the plugin to "Novatel LTE" + + This plugin only handles the E362 right now. + + plugins/Makefile.am | 22 ++++---- + ...novatel.c => mm-broadband-bearer-novatel-lte.c} | 44 +++++++-------- + plugins/novatel/mm-broadband-bearer-novatel-lte.h | 64 + ++++++++++++++++++++++ + plugins/novatel/mm-broadband-bearer-novatel.h | 64 + ---------------------- + ...-novatel.c => mm-broadband-modem-novatel-lte.c} | 28 +++++----- + plugins/novatel/mm-broadband-modem-novatel-lte.h | 50 +++++++++++++++++ + plugins/novatel/mm-broadband-modem-novatel.h | 50 ----------------- + ...mm-plugin-novatel.c => mm-plugin-novatel-lte.c} | 24 ++++---- + ...mm-plugin-novatel.h => mm-plugin-novatel-lte.h} | 24 ++++---- + 9 files changed, 185 insertions(+), 185 deletions(-) + +commit 84d205c9be4fa5e6d773ac60edc7200885da7af6 +Author: Aleksander Morgado +Date: Mon Jul 30 20:25:22 2012 +0200 + + plugin: new filters for forbidden product IDs/strings + + Plugins may specify that specific vendor & product IDs or strings + are not + supported. This is useful when plugins need to specify that they + support + all devices of a given vendor except for some specific ones. + + docs/reference/api/ModemManager-overview.xml | 52 +++++++++------ + src/mm-plugin.c | 99 + +++++++++++++++++++++++----- + src/mm-plugin.h | 38 ++++++----- + 3 files changed, 137 insertions(+), 52 deletions(-) + +commit 4e84cd241b7b41fe6f87242136b3f5ae857e5a13 +Author: Aleksander Morgado +Date: Mon Jul 30 20:20:17 2012 +0200 + + plugin: fix icera filters when using the allowed product string filter + + src/mm-plugin.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 9512eda21d7392bcb80cfd4dae6708fb1c92907e +Author: Aleksander Morgado +Date: Mon Jul 30 20:18:05 2012 +0200 + + plugin: don't apply product ID filters if no vendor ID was retrieved + + src/mm-plugin.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7b13b5e1c02bca89a317fce57abc9b5faa115ee7 +Author: Ben Chan +Date: Sun Aug 19 23:26:14 2012 -0700 + + broadband-bearer,icera: fix CID matching for unsolicited IPDPACT + responses + + plugins/icera/mm-broadband-modem-icera.c | 2 +- + src/mm-broadband-bearer.c | 7 +++++-- + 2 files changed, 6 insertions(+), 3 deletions(-) + +commit 2b5fb682c6315d27723137d8c7a7982e198a538a +Author: Ben Chan +Date: Sun Aug 19 23:27:19 2012 -0700 + + icera: fix modem_load_current_bands and modem_set_bands + + This patch modifies MMBroadbandModemIcera as follows: + - Change modem_load_current_bands to report only bands that are + currently enabled + - Change modem_set_bands to handle setting ANY band in a way that no + forbidden bands are activated. + + plugins/icera/mm-broadband-modem-icera.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 3955aab25bfc5ad68678ee27ee29867c805ce57d +Author: Ben Chan +Date: Thu Aug 16 21:26:51 2012 -0700 + + icera: add missing break statement in MMBroadbandBearerIcera + set_property + + plugins/icera/mm-broadband-bearer-icera.c | 1 + + 1 file changed, 1 insertion(+) + +commit 946dcca4fca28296ed326fe800018993470df927 +Author: Dan Williams +Date: Wed Aug 15 12:18:59 2012 -0500 + + qcdm: add some EVDO log item numbers + + libqcdm/src/log-items.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7eb1782023b3704f91c1bac2d4686463fb1bc9cd +Author: Ben Chan +Date: Thu Aug 9 23:05:46 2012 -0700 + + iface-modem: increase number of trials for PIN check from 3 to 6 + + In practice, it may take longer time for a SIM to become ready + when the + modem interface tries to use AT+CPIN? to determine if the SIM is + PIN-locked. This patch increases the number of trials for PIN check to + address the issue. + + src/mm-iface-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6c9a7c54506e57238056d13bcba130c1aaff7840 +Author: Aleksander Morgado +Date: Thu Aug 9 11:48:10 2012 +0200 + + nokia: implement custom supported modes loading + + Nokia handsets report incorrect modes in AT+WS46?, so just fully + skip that. + + plugins/nokia/mm-broadband-modem-nokia.c | 42 + ++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +commit 1e687337c12655760c2f187b5278684e7776dac4 +Author: Aleksander Morgado +Date: Thu Aug 9 09:31:57 2012 +0200 + + zte: plug memleak + + The GError wasn't properly disposed. + + Reported by: Ben Chan + + plugins/zte/mm-broadband-modem-zte.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1e286f80eae1d4cbdb7e92c52d68529f0662fa22 +Author: Dan Williams +Date: Wed Aug 8 16:20:32 2012 -0500 + + qcdm: interpret MCC value from StatusSnapshot command + + libqcdm/src/commands.c | 36 ++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 4 ++++ + libqcdm/tests/test-qcdm-com.c | 5 +++++ + 3 files changed, 45 insertions(+) + +commit 36594dd9fbe3d1a9848343b529ae404121aa2423 +Author: Aleksander Morgado +Date: Wed Aug 8 13:17:29 2012 +0200 + + broadband-modem: fix GError disposal + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 45e8aa50df7357f7c96fc73e3cda6b69ae93bff8 +Author: Aleksander Morgado +Date: Mon Aug 6 19:05:54 2012 +0200 + + iface-modem-3gpp: when disabled, cleanup interface properties + + src/mm-iface-modem-3gpp.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 278842108c2cc1cb887f1afedfbf6cfd4a91d26a +Author: Aleksander Morgado +Date: Mon Aug 6 11:58:42 2012 +0200 + + iface-modem-3gpp: refactor registration sequences + + Once upon a time it was a good idea to have separate steps for CS + and PS related + actions, so that plugins could override specific steps with a great + detail. That + idea turned out to be not very useful, as the only case which + requires custom + CS/PS registration actions is the QMI-enabled modem, and that one + has commands + to act on both registration actions at the same time. So, we now + consolidate + all steps, so that the implementation of the interface needs to + provide all the + logic to setup/enable/disable/cleanup/check registrations in each + mode. + + Also, we consolidate how the unsolicited registration messages are + handled, so + that it's equivalent to other unsolicited messages: + * 'Setup' will configure ports to process the unsolicited messages. + * 'Enable' will tell the modem to send unsolicited messages. + * 'Disable' will tell the modem not to send unsolicited messages. + * 'Cleanup will configure ports to ignore the unsolicited messages. + + src/mm-broadband-modem.c | 789 + +++++++++++++++++++++++++--------------------- + src/mm-iface-modem-3gpp.c | 334 ++++++-------------- + src/mm-iface-modem-3gpp.h | 113 +++---- + 3 files changed, 559 insertions(+), 677 deletions(-) + +commit 01bb5cd6601a2eb47af002579af7978bf503976d +Author: Aleksander Morgado +Date: Tue Jul 31 15:53:50 2012 +0200 + + iface-modem-cdma: new steps to enable/disable unsolicited events + + src/mm-iface-modem-cdma.c | 63 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 17 +++++++++++++ + 2 files changed, 80 insertions(+) + +commit 779b293387643daf2453dca484a1e35fd284e550 +Author: Aleksander Morgado +Date: Tue Jul 31 15:51:15 2012 +0200 + + iface-modem-cdma: skip checks to see if unsolicited events are + supported + + src/mm-iface-modem-cdma.c | 55 + ++++++++++++----------------------------------- + 1 file changed, 14 insertions(+), 41 deletions(-) + +commit 4aaafc54c78f96160675109a27c4fde75ebb6f2e +Author: Aleksander Morgado +Date: Tue Jul 31 12:59:23 2012 +0200 + + iface-modem-3gpp: removed the 'setup indicators' step + + The previous logic would first request to check if indicators were + supported, + and only then allow to setup/enable/cleanup/disable unsolicited + events. This + behaviour is very specific to the generic 3GPP case, and therefore + it shouldn't + be handled in the even more generic 3GPP interface. The logic is + still kept, + but handled within the MMBroadbandModem object. + + src/mm-broadband-modem.c | 288 + +++++++++++++++++++++++++--------------------- + src/mm-iface-modem-3gpp.c | 155 +++++-------------------- + src/mm-iface-modem-3gpp.h | 8 -- + 3 files changed, 186 insertions(+), 265 deletions(-) + +commit 4d5892204d9f28b65a9f1a8495c036c7448791bc +Author: Aleksander Morgado +Date: Mon Jul 23 11:06:25 2012 +0200 + + zte: use +CFUN=4 for powering down + + Icera-based ZTE already has the same functionality coming from + the parent + `MMBroadbandModemIcera' modem object. + + plugins/zte/mm-broadband-modem-zte.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit f6415a71b6ee3998b144393c3c4facdb7a77c545 +Author: Aleksander Morgado +Date: Sun Jul 22 21:00:42 2012 +0200 + + device: keep all unsupported ports in a separate list + + Ports being marked as unsupported should not be passed to the + plugin specific + create_modem() or grab_port() methods. + + src/mm-device.c | 43 +++++++++++++++++++++++++++++++++++++------ + src/mm-device.h | 2 ++ + src/mm-plugin-manager.c | 3 +++ + 3 files changed, 42 insertions(+), 6 deletions(-) + +commit 1811bb015c79b319c517d0bd23ae04899d2bc981 +Author: Aleksander Morgado +Date: Sun Jul 22 20:59:38 2012 +0200 + + plugin-manager: relaunch probing when suggestion comes to deferred + tasks + + If a port support task was deferred until suggested, do not assume + that the + suggested plugin actually supports the port, instead re-launch + support check. + + This covers the cases where a net port appears in a modem which + only supports + AT ports (e.g. Nokia case). + + src/mm-plugin-manager.c | 35 ++++++++++++++++++++++++----------- + 1 file changed, 24 insertions(+), 11 deletions(-) + +commit 793218bfdbe92806f231c59e6ecbb68b9bb3ec13 +Author: Aleksander Morgado +Date: Sun Jul 22 19:05:59 2012 +0200 + + zte: plugin fully ported + + plugins/mm-modem-zte.c | 761 + ------------------------------------------------ + plugins/mm-modem-zte.h | 45 --- + plugins/mm-plugin-zte.c | 230 --------------- + plugins/mm-plugin-zte.h | 41 --- + 4 files changed, 1077 deletions(-) + +commit 73a420095fcde1bd745d44a87359afa7af505791 +Author: Aleksander Morgado +Date: Sun Jul 22 11:15:16 2012 +0200 + + TODO: the ZTE MF637 doesn't like default setup fo messaging + unsolicited messages + + TODO | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 125f297434032218ecc057ff613a4daa02567b0c +Author: Aleksander Morgado +Date: Sun Jul 22 12:37:17 2012 +0200 + + zte: setup/cleanup unsolicited messages in Icera based modems + + plugins/zte/mm-broadband-modem-zte-icera.c | 110 + ++++++++++++++++++++++++++++- + 1 file changed, 109 insertions(+), 1 deletion(-) + +commit efe85fd1abc2e26fc2207189eb03c9523eaa57aa +Author: Aleksander Morgado +Date: Sun Jul 22 12:33:08 2012 +0200 + + zte: use common unsolicited messages handler setup in Icera based + modems + + plugins/zte/mm-broadband-modem-zte-icera.c | 59 + ++++++++++++++++++++++++++++++ + plugins/zte/mm-broadband-modem-zte-icera.h | 2 + + 2 files changed, 61 insertions(+) + +commit 64dfa59c42d3f9b7e1b4d643996bc87268da7987 +Author: Aleksander Morgado +Date: Sun Jul 22 12:15:31 2012 +0200 + + zte: use common unsolicited messages handler setup + + plugins/zte/mm-broadband-modem-zte.c | 106 + +++++------------------------------ + 1 file changed, 14 insertions(+), 92 deletions(-) + +commit a8516fa1f8cdab03f9e8b13cea15f03de10fe70d +Author: Aleksander Morgado +Date: Sun Jul 22 12:14:48 2012 +0200 + + zte: new common code to setup unsolicited event handlers + + plugins/Makefile.am | 2 + + plugins/zte/mm-common-zte.c | 141 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/zte/mm-common-zte.h | 31 ++++++++++ + 3 files changed, 174 insertions(+) + +commit 1f2a7bd87c2bd5b166b93150d07bb8ff56594d90 +Author: Aleksander Morgado +Date: Sun Jul 22 00:41:56 2012 +0200 + + zte: try +CPMS? calls after SIM unlock until SIM gets ready + + plugins/zte/mm-broadband-modem-zte.c | 104 + +++++++++++++++++++++++++++++++++++ + 1 file changed, 104 insertions(+) + +commit dcde1e04083a175f11986c47d526ec36cec9c049 +Author: Aleksander Morgado +Date: Sun Jul 22 00:03:12 2012 +0200 + + zte: carrier-detect disabled in serial ports + + plugins/zte/mm-broadband-modem-zte.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 4cf4a98bba3a94efb49fea86636e13db017a351c +Author: Aleksander Morgado +Date: Sat Jul 21 23:34:57 2012 +0200 + + zte: support Icera-based modems + + We request Icera support check during port probing, and we then + decide which + modem object to create based on the check results. + + plugins/Makefile.am | 7 +++- + plugins/zte/mm-broadband-modem-zte-icera.c | 60 + ++++++++++++++++++++++++++++++ + plugins/zte/mm-broadband-modem-zte-icera.h | 49 ++++++++++++++++++++++++ + plugins/zte/mm-plugin-zte.c | 17 +++++++++ + 4 files changed, 131 insertions(+), 2 deletions(-) + +commit 855c0ec5143d3a48c3f8a5cba0eb58d74a45740c +Author: Aleksander Morgado +Date: Sat Jul 21 23:06:38 2012 +0200 + + zte: implement access technology loading + + plugins/mm-modem-zte.c | 1 - + plugins/zte/mm-broadband-modem-zte.c | 41 + ++++++++++++++++++++++++++++++++++++ + 2 files changed, 41 insertions(+), 1 deletion(-) + +commit 169ccdf1d4bbfad4d63c6b11b3dbb349e8985970 +Author: Aleksander Morgado +Date: Sat Jul 21 20:44:05 2012 +0200 + + zte: implement allowed mode loading/setting + + plugins/zte/mm-broadband-modem-zte.c | 201 + +++++++++++++++++++++++++++++++++++ + 1 file changed, 201 insertions(+) + +commit 641c5aed06b3f7f42723455813394b051c731857 +Author: Aleksander Morgado +Date: Fri Jul 20 14:22:27 2012 +0200 + + zte: setup ports and unsolicited message handling + + plugins/zte/mm-broadband-modem-zte.c | 232 + ++++++++++++++++++++++++++++++++++- + plugins/zte/mm-broadband-modem-zte.h | 2 + + 2 files changed, 233 insertions(+), 1 deletion(-) + +commit 3b00c6f5ac97a5aeefbc4772be09a36061027eda +Author: Aleksander Morgado +Date: Fri Jul 20 13:13:34 2012 +0200 + + zte: new `MMBroadbandModemZte' + + plugins/Makefile.am | 4 ++- + plugins/zte/mm-broadband-modem-zte.c | 60 + ++++++++++++++++++++++++++++++++++++ + plugins/zte/mm-broadband-modem-zte.h | 49 +++++++++++++++++++++++++++++ + plugins/zte/mm-plugin-zte.c | 12 ++++---- + 4 files changed, 118 insertions(+), 7 deletions(-) + +commit bbb4ed2b0a7e171e9a045a1e37580697b9cbc783 +Author: Aleksander Morgado +Date: Fri Jul 20 13:10:29 2012 +0200 + + zte: start porting the ZTE plugin + + plugins/Makefile.am | 19 ++-- + plugins/{ => zte}/77-mm-zte-port-types.rules | 0 + plugins/zte/mm-plugin-zte.c | 126 + +++++++++++++++++++++++++++ + plugins/zte/mm-plugin-zte.h | 42 +++++++++ + 4 files changed, 177 insertions(+), 10 deletions(-) + +commit bdcc4becab4a10ae100117678e8249021d4bfd69 +Author: Aleksander Morgado +Date: Sat Jul 21 18:41:35 2012 +0200 + + nokia: no need specific port grabbing + + The udev tags for port grabbing hints are for Icera-based Nokia + modems only. + + plugins/nokia/mm-plugin-nokia.c | 35 ----------------------------------- + 1 file changed, 35 deletions(-) + +commit 5c2df4a0cac1675d31a94d1ee5f6b9c113e8ed35 +Author: Aleksander Morgado +Date: Sat Jul 21 18:17:24 2012 +0200 + + nokia-icera: new plugin to handle Icera-based Nokia modems + + We have a whole new plugin because the whole probing process is + different + between the Icera and non-Icera based Nokia modems. + + plugins/Makefile.am | 9 +++ + plugins/nokia/mm-plugin-nokia-icera.c | 106 + ++++++++++++++++++++++++++++++++++ + plugins/nokia/mm-plugin-nokia-icera.h | 41 +++++++++++++ + 3 files changed, 156 insertions(+) + +commit 3b6a20dfb64495653d636e24b124733ca82df3c3 +Author: Aleksander Morgado +Date: Sat Jul 21 18:08:11 2012 +0200 + + nokia: don't support Icera-based modems + + Nokia CS Internet sticks are based on Icera chipsets; the default + Nokia plugin + shouldn't handle them. + + plugins/nokia/mm-plugin-nokia.c | 1 + + 1 file changed, 1 insertion(+) + +commit 509ad9420460a652f2390eebea72d4b0ed486382 +Author: Aleksander Morgado +Date: Sat Jul 21 18:40:40 2012 +0200 + + plugin: check if the current probe is the one with AT support before + assuming it's not + + src/mm-plugin.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit edc9825788bc12d03add9b6fdf83ae2f55886c34 +Author: Aleksander Morgado +Date: Sat Jul 21 18:07:22 2012 +0200 + + plugin: let plugins request Icera support checks and Icera based + filters + + docs/reference/api/ModemManager-overview.xml | 29 ++++++++++++ + src/mm-plugin.c | 69 + ++++++++++++++++++++++++++++ + src/mm-plugin.h | 3 ++ + 3 files changed, 101 insertions(+) + +commit 0b3eb27856462e232f54762a3ba496bf36e25775 +Author: Aleksander Morgado +Date: Sat Jul 21 18:01:02 2012 +0200 + + port-probe: include Icera support check in the probing sequence + + src/mm-port-probe-at.c | 19 +++++++++++++ + src/mm-port-probe-at.h | 8 ++++++ + src/mm-port-probe.c | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-port-probe.h | 6 +++- + 4 files changed, 104 insertions(+), 4 deletions(-) + +commit 5b96aa9db4899d6c217b7ba5596e1dd64ca8f931 +Author: Aleksander Morgado +Date: Sun Jul 22 10:20:54 2012 +0200 + + samsung: use generic power down of the Icera modem + + plugins/samsung/mm-broadband-modem-samsung.c | 39 + +--------------------------- + 1 file changed, 1 insertion(+), 38 deletions(-) + +commit 53707357f39ac9da71896a6bb11dad2a779f7586 +Author: Aleksander Morgado +Date: Sun Jul 22 10:20:39 2012 +0200 + + icera: use +CFUN=4 for power down in all Icera modems + + plugins/icera/mm-broadband-modem-icera.c | 28 + ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit e9a367eb21e937e5f757e9d00ac49d19be7d57f0 +Author: Aleksander Morgado +Date: Sat Jul 21 16:56:58 2012 +0200 + + icera: remove `MMIfaceIcera' + + plugins/Makefile.am | 2 - + plugins/icera/mm-iface-icera.c | 1405 + ---------------------------------------- + plugins/icera/mm-iface-icera.h | 160 ----- + 3 files changed, 1567 deletions(-) + +commit 7ad73e4fa3c13ef1c73538d70ee2f7ad63853849 +Author: Aleksander Morgado +Date: Fri Jul 20 19:49:11 2012 +0200 + + samsung: make the modem object inherit from the + `MMBroadbandModemIcera' + + plugins/Makefile.am | 4 +- + plugins/samsung/mm-broadband-bearer-samsung.c | 89 ------- + plugins/samsung/mm-broadband-bearer-samsung.h | 57 ----- + plugins/samsung/mm-broadband-modem-samsung.c | 320 + +------------------------- + plugins/samsung/mm-broadband-modem-samsung.h | 6 +- + 5 files changed, 9 insertions(+), 467 deletions(-) + +commit 4f1269344fa5b27286cd01314477066c07770e27 +Author: Aleksander Morgado +Date: Fri Jul 20 19:42:22 2012 +0200 + + icera: create a generic broadband bearer when no net ports available + + plugins/icera/mm-broadband-modem-icera.c | 43 + +++++++++++++++++++++++++++++--- + 1 file changed, 39 insertions(+), 4 deletions(-) + +commit fa8bcb0a7f9a84822ea2f196c1165a93e8380c11 +Author: Aleksander Morgado +Date: Fri Jul 20 19:35:06 2012 +0200 + + icera: allow specifying at modem/bearer level whether we want DHCP + or STATIC + + plugins/icera/mm-broadband-bearer-icera.c | 117 + +++++++++++++++++++++++++----- + plugins/icera/mm-broadband-bearer-icera.h | 3 + + plugins/icera/mm-broadband-modem-icera.c | 59 +++++++++++++++ + plugins/icera/mm-broadband-modem-icera.h | 2 + + plugins/icera/mm-iface-icera.c | 1 + + 5 files changed, 165 insertions(+), 17 deletions(-) + +commit ef4de86b4281c16229729d724c2aedc2b8248fe5 +Author: Aleksander Morgado +Date: Fri Jul 20 18:31:51 2012 +0200 + + icera: new `MMBroadbandModemIcera' + + We'll get rid of the `MMIfaceIcera'. + + plugins/Makefile.am | 2 + + plugins/icera/mm-broadband-modem-icera.c | 1577 + ++++++++++++++++++++++++++++++ + plugins/icera/mm-broadband-modem-icera.h | 51 + + 3 files changed, 1630 insertions(+) + +commit e0c17f936f83b81296c643d656fa68de36a24883 +Author: Dan Williams +Date: Thu Jul 19 21:27:15 2012 -0500 + + icera: implement dynamic band support checking + + Turns out we can check supported bands by asking the modem what + the enabled state is for the bands it says it supports, and then + setting the enabled state to what it currently is. For bands the + modem actually doesn't support, it'll return an error. Use that + to build up the modem's actual supported band list. + + plugins/icera/mm-iface-icera.c | 311 + ++++++++++++++++++++++++++++++----------- + 1 file changed, 231 insertions(+), 80 deletions(-) + +commit ea024f2e520789ac41ec281d3737f74a89df6b74 +Author: Dan Williams +Date: Fri Jul 20 10:49:27 2012 -0500 + + samsung: use generic Icera band handling functions + + plugins/samsung/mm-broadband-modem-samsung.c | 354 + +-------------------------- + 1 file changed, 6 insertions(+), 348 deletions(-) + +commit a532c081d15911a289b837f0e0247e131733130e +Author: Dan Williams +Date: Thu Jul 19 16:05:28 2012 -0500 + + icera: add generic band handling functions + + plugins/icera/mm-iface-icera.c | 343 + +++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 25 +++ + 2 files changed, 368 insertions(+) + +commit b1c2e0ba5fc001c20249c76a8698c6b5d8ee7531 +Author: Dan Williams +Date: Fri Jul 20 10:48:08 2012 -0500 + + samsung: use generic Icera unlock retries checking functions + + plugins/samsung/mm-broadband-modem-samsung.c | 76 + +--------------------------- + 1 file changed, 2 insertions(+), 74 deletions(-) + +commit abfce5493c05fb1207a274573f56460bd3e84e2c +Author: Dan Williams +Date: Thu Jul 19 15:30:16 2012 -0500 + + icera: add generic unlock retries checking + + plugins/icera/mm-iface-icera.c | 72 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 7 ++++ + 2 files changed, 79 insertions(+) + +commit 36924d8f82d240d1fc963d0444d42625368c42be +Author: Aleksander Morgado +Date: Fri Jul 20 14:56:36 2012 +0200 + + samsung: add Samsung Electronics, Inc. as copyright owners + + They actually wrote the original Samsung plugin in ModemManager 0.5. + + plugins/samsung/mm-broadband-bearer-samsung.c | 1 + + plugins/samsung/mm-broadband-bearer-samsung.h | 1 + + plugins/samsung/mm-broadband-modem-samsung.c | 2 +- + plugins/samsung/mm-broadband-modem-samsung.h | 1 + + plugins/samsung/mm-plugin-samsung.c | 1 + + plugins/samsung/mm-plugin-samsung.h | 1 + + 6 files changed, 6 insertions(+), 1 deletion(-) + +commit 2bf2b8e84804c261690032809a6775e3e7b01ed4 +Author: Aleksander Morgado +Date: Fri Jul 20 14:51:23 2012 +0200 + + samsung: new `MMBroadbandBearerSamsung' + + Based on the Icera bearer, but using DHCP in the net port. + + plugins/Makefile.am | 4 +- + plugins/samsung/mm-broadband-bearer-samsung.c | 88 + +++++++++++++++++++++++++++ + plugins/samsung/mm-broadband-bearer-samsung.h | 56 +++++++++++++++++ + plugins/samsung/mm-broadband-modem-samsung.c | 61 ++++++++++++++++++- + 4 files changed, 206 insertions(+), 3 deletions(-) + +commit 39bb356fe5dc5572ef1f560d6aebe2af60977c71 +Author: Aleksander Morgado +Date: Fri Jul 20 12:54:12 2012 +0200 + + TODO: add task to update drivers info in the Modem iface + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit 97730df9c706412577776a5f5219dc172ed85f4f +Author: Aleksander Morgado +Date: Fri Jul 20 12:52:36 2012 +0200 + + TODO: we should retry Icera authentication command + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit d861ad1d570e734079be473dcff4e617fde6ad24 +Author: Aleksander Morgado +Date: Fri Jul 20 12:47:03 2012 +0200 + + TODO: add task to check if HSO disconnection needs to get updated + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit 93252f39ef75dbca4e7e238032c5065727464a85 +Author: Aleksander Morgado +Date: Fri Jul 20 12:34:22 2012 +0200 + + icera: avoid highly unlikely use of already unref-ed bearer + + In the connection and disconnection sequences, we make sure that + the Bearer + object is valid by keeping a reference in the Dial3gppContext and + Disconnect3gppContext (actually, another one kept by the + GSimpleAsyncResult as + well). But we are considering here the case where the context is + completed and + freed by an unsolicited message handler before we get the reply to + the AT + command, so to properly ensure that the bearer object is still valid + when we try + to check if the context is in the priv struct, we need to keep an + extra ref + around. + + plugins/icera/mm-broadband-bearer-icera.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 40730b115e3aa7f744f6e0c72772c8a4f1872695 +Author: Aleksander Morgado +Date: Fri Jul 20 12:26:28 2012 +0200 + + hso: avoid highly unlikely use of already unref-ed bearer + + In the connection sequence, we make sure that the Bearer object is + valid by + keeping a reference in the Dial3gppContext (actually, another one + kept by the + GSimpleAsyncResult as well). But we are considering here the case + where the + connection context is completed and freed by an unsolicited message + handler + before we get the reply to the AT command, so to properly ensure + that the bearer + object is still valid when we try to check if the context is in the + priv struct, + we need to keep an extra ref around. + + plugins/option/mm-broadband-bearer-hso.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 63a45f808260f3138b595bf9b250d2a212cb83d4 +Author: Aleksander Morgado +Date: Fri Jul 20 12:24:13 2012 +0200 + + hso: avoid trying to use an already freed context + + In the connection sequence, we keep the context in the private info + of the + Bearer object, so that we can complete and free it when we receive + OWANCALL + unsolicited messages. Now, the reply of the OWANCALL itself may + get processed + as an unsolicited message, so effectively we're processing and + finishing the + connection/disconnection context *before* we process the reply of + the AT + command. + + This patch ensures that we do not try to re-use the connection + context after it + has been processed by the unsolicited messages handler. + + plugins/option/mm-broadband-bearer-hso.c | 48 + ++++++++++++++++++++++---------- + 1 file changed, 33 insertions(+), 15 deletions(-) + +commit d065dd572b3abb5e76467abe1140bf2010fe6fbb +Author: Aleksander Morgado +Date: Fri Jul 20 11:58:55 2012 +0200 + + icera: avoid trying to use an already freed context + + In both the connection and disconnection sequences, we keep the + context in the + private info of the Bearer object, so that we can complete and free + it when we + receive %IPDPACT unsolicited messages. Now, the reply of the %IPDPACT + itself may + get processed as an unsolicited message, so effectively we're + processing and + finishing the connection/disconnection context *before* we process + the reply of + the AT command. + + This patch ensures that we do not try to re-use the + connection/disconnection + context after it has been processed by the unsolicited messages + handler. + + plugins/icera/mm-broadband-bearer-icera.c | 92 + +++++++++++++++++++++---------- + 1 file changed, 64 insertions(+), 28 deletions(-) + +commit e18778d815ffda24ac0f9a7b17dab3fdd22a575e +Author: Ben Chan +Date: Fri Jul 13 11:09:55 2012 -0700 + + samsung: fix crash due to uninitialized GError variables + + BUG=chromium-os:32475 + TEST=emerge modemmanager-next + + Change-Id: I8dad924dae9a249c3b9235786226b7dd40bd8819 + + plugins/samsung/mm-broadband-modem-samsung.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3a28f660c5b60b1615f0c664bf16d5d3c69ed2a6 +Author: Dan Williams +Date: Thu Jul 19 13:28:24 2012 -0500 + + icera: fix timezone request AT command + + Actual command uses a *, not a %. Must have been a typo when + porting to the new MM since 0.6 uses a * too. + + plugins/icera/mm-iface-icera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8740f0b72f442a33caf91010a91f1454ed021fc2 +Author: Dan Williams +Date: Thu Jul 19 13:23:12 2012 -0500 + + trivial: comment spelling fix + + plugins/nokia/mm-broadband-modem-nokia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6f3a83534cfd1e6ff6bd3aeff5b338a7d71db9eb +Author: Dan Williams +Date: Thu Jul 19 13:02:10 2012 -0500 + + longcheer: implement unlock retries checking + + TODO | 4 -- + plugins/longcheer/mm-broadband-modem-longcheer.c | 78 + ++++++++++++++++++++++++ + 2 files changed, 78 insertions(+), 4 deletions(-) + +commit 4e92b849affb87ceecf3f902449cef8b275932fd +Author: Dan Williams +Date: Thu Jul 19 12:16:48 2012 -0500 + + hso: fix small error in unlock retries checking + + _OERCN only reports PIN and PUK, so we only check for two values. + + plugins/option/mm-broadband-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 32bc031ae6a8a76818bb0e8cf8f2ea5180c959a7 +Author: Dan Williams +Date: Thu Jul 19 12:12:19 2012 -0500 + + hso: implement unlock retries checking + + plugins/option/mm-broadband-modem-hso.c | 71 + +++++++++++++++++++++++++++++++++ + 1 file changed, 71 insertions(+) + +commit b1ebf221829ae09821d1ea6effc25feb13bd0ba5 +Author: Aleksander Morgado +Date: Thu Jul 19 17:51:47 2012 +0200 + + TODO: add generic bearer improvements + + TODO | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit cc095c9a94877a741d86c8cad6fedab3e66b8e1f +Author: Aleksander Morgado +Date: Thu Jul 19 16:05:56 2012 +0200 + + samsung: plugin fully ported + + plugins/mm-modem-samsung-gsm.c | 722 + ----------------------------------------- + plugins/mm-modem-samsung-gsm.h | 47 --- + plugins/mm-plugin-samsung.c | 163 ---------- + plugins/mm-plugin-samsung.h | 45 --- + 4 files changed, 977 deletions(-) + +commit d820ca8f2726da56dfa27318bad65ea62281bbbe +Author: Aleksander Morgado +Date: Thu Jul 19 15:58:36 2012 +0200 + + samsung: use CFUN=4 for power down + + plugins/samsung/mm-broadband-modem-samsung.c | 28 + ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit ef217c23b064a9d43e13bcd16aba4bd47d902e33 +Author: Aleksander Morgado +Date: Thu Jul 19 15:55:00 2012 +0200 + + samsung: custom configuration for AT serial ports + + plugins/samsung/mm-broadband-modem-samsung.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 5fcc8d16291fb4efbe70b69ca2ed6d7579403769 +Author: Aleksander Morgado +Date: Thu Jul 19 15:52:21 2012 +0200 + + samsung: use Icera-based time loading + + plugins/samsung/mm-broadband-modem-samsung.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit e70fea145e3c113a37e515d5511268dc8915c591 +Author: Aleksander Morgado +Date: Thu Jul 19 15:41:37 2012 +0200 + + samsung: user Icera-based timezone loading + + plugins/icera/mm-iface-icera.c | 12 ++++++++---- + plugins/samsung/mm-broadband-modem-samsung.c | 11 +++++++++++ + 2 files changed, 19 insertions(+), 4 deletions(-) + +commit 268db7fe0b29df8ab5962e8ebac89c6a0b3a9ebc +Author: Aleksander Morgado +Date: Thu Jul 19 11:35:26 2012 +0200 + + samsung: minor coding style fixes + + plugins/samsung/mm-broadband-modem-samsung.c | 41 + +++++++++++++++++----------- + 1 file changed, 25 insertions(+), 16 deletions(-) + +commit d8ae69e7d1c19fabffd4ef92e33f99ace12d491a +Author: Aleksander Morgado +Date: Thu Jul 19 11:31:58 2012 +0200 + + samsung: use the generic Icera bearer + + plugins/Makefile.am | 4 +- + plugins/samsung/mm-broadband-bearer-samsung.c | 551 + -------------------------- + plugins/samsung/mm-broadband-bearer-samsung.h | 61 --- + plugins/samsung/mm-broadband-modem-samsung.c | 60 +-- + 4 files changed, 3 insertions(+), 673 deletions(-) + +commit 8d651dd68eee23cf4c86a177a4359735414bd4fb +Author: Aleksander Morgado +Date: Thu Jul 19 09:11:09 2012 +0200 + + samsung: use Icera-based unsolicited messages setup and access + tech loading + + plugins/samsung/mm-broadband-modem-samsung.c | 301 + ++++++--------------------- + plugins/samsung/mm-broadband-modem-samsung.h | 2 - + 2 files changed, 59 insertions(+), 244 deletions(-) + +commit 01e85aa1efe217a5ccc6c3627d1f2bf76388947b +Author: Aleksander Morgado +Date: Wed Jul 18 20:26:16 2012 +0200 + + samsung: don't hardcode supported modes + + Don't try to implement supported modes loading if we're just + hardcoding the + values; the proper way would be to run the %IPSYS=? test command + and parse + the results. + + plugins/samsung/mm-broadband-modem-samsung.c | 31 + ---------------------------- + 1 file changed, 31 deletions(-) + +commit 4f0157cec4a25af4c6d34fa4fcbe7dd3aad39ef9 +Author: Aleksander Morgado +Date: Wed Jul 18 19:46:25 2012 +0200 + + samsung: use Icera-based allowed mode setting + + plugins/samsung/mm-broadband-modem-samsung.c | 87 + +--------------------------- + 1 file changed, 2 insertions(+), 85 deletions(-) + +commit f127afd402a0324eccd578254333f80fa5c46de6 +Author: Aleksander Morgado +Date: Wed Jul 18 19:32:09 2012 +0200 + + samsung: use Icera-based initial allowed mode loading + + plugins/samsung/mm-broadband-modem-samsung.c | 112 + +-------------------------- + 1 file changed, 4 insertions(+), 108 deletions(-) + +commit ae22a99dabd32770cac5808f8174001fd55adcdf +Author: Aleksander Morgado +Date: Wed Jul 18 19:29:57 2012 +0200 + + samsung: implement the `MMIfaceIcera' interface + + plugins/Makefile.am | 3 ++- + plugins/samsung/mm-broadband-modem-samsung.c | 10 +++++++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit 6d6fc3bcde548d26697dce9b872f87731852d033 +Author: Aleksander Morgado +Date: Thu Jul 19 16:10:36 2012 +0200 + + icera: plugin fully ported + + plugins/mm-modem-icera.c | 989 + ----------------------------------------------- + plugins/mm-modem-icera.h | 114 ------ + 2 files changed, 1103 deletions(-) + +commit 89834810ae7c789847d987e8f772e7e859fe0e10 +Author: Aleksander Morgado +Date: Thu Jul 19 16:09:50 2012 +0200 + + icera: provide method to check Icera support + + plugins/icera/mm-iface-icera.c | 24 ++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 8 ++++++++ + 2 files changed, 32 insertions(+) + +commit 6c0f14132b8f6a12e8535cb95961eeb78cf8342f +Author: Aleksander Morgado +Date: Thu Jul 19 15:47:43 2012 +0200 + + icera: implement network time retrieval + + plugins/icera/mm-iface-icera.c | 30 ++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 7 +++++++ + 2 files changed, 37 insertions(+) + +commit a105ffa7b73b2e1f27b759e8c67dfec9a19c9b04 +Author: Aleksander Morgado +Date: Thu Jul 19 15:38:52 2012 +0200 + + icera: implement timezone loading + + plugins/icera/mm-iface-icera.c | 90 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 11 ++++++ + 2 files changed, 101 insertions(+) + +commit 051b79cba3ad014a872ea4d1c96208173bcc9855 +Author: Aleksander Morgado +Date: Thu Jul 19 15:04:16 2012 +0200 + + icera: try to gather extended connection failed reasons when + reporting error + + plugins/icera/mm-broadband-bearer-icera.c | 50 + +++++++++++++++++++++++++++---- + 1 file changed, 45 insertions(+), 5 deletions(-) + +commit 7209a090332abd03899072743befe164d83a043d +Author: Aleksander Morgado +Date: Thu Jul 19 14:52:05 2012 +0200 + + icera: implement IP config retrieval in the bearer + + plugins/icera/mm-broadband-bearer-icera.c | 192 + ++++++++++++++++++++++++++++++ + 1 file changed, 192 insertions(+) + +commit 4dbc213184a7add84d7a75a3bd6e01c13f3fbac8 +Author: Aleksander Morgado +Date: Thu Jul 19 14:28:16 2012 +0200 + + icera: implement modem reset + + plugins/icera/mm-iface-icera.c | 23 +++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 8 ++++++++ + 2 files changed, 31 insertions(+) + +commit 5246a842caeb9bf2e39e286c388713e279c69efd +Author: Aleksander Morgado +Date: Thu Jul 19 11:28:01 2012 +0200 + + icera: implement 3GPP disconnection + + plugins/icera/mm-broadband-bearer-icera.c | 169 + ++++++++++++++++++++++++++++++ + 1 file changed, 169 insertions(+) + +commit 4dc9d674d14a9a1eaffada2c02ab51b59613a202 +Author: Aleksander Morgado +Date: Thu Jul 19 10:39:58 2012 +0200 + + icera: listen for %IPDPACT unsolicited messages and report connection + status + + plugins/icera/mm-iface-icera.c | 88 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 88 insertions(+) + +commit 35df0bfc743857d70c67f104bf21c608e2c56790 +Author: Aleksander Morgado +Date: Thu Jul 19 10:27:53 2012 +0200 + + icera: implement 3GPP dialling + + The modem object needs to listen to unsolicited messages and report + bearer + connection status itself. + + plugins/icera/mm-broadband-bearer-icera.c | 400 + ++++++++++++++++++++++++++++++ + plugins/icera/mm-broadband-bearer-icera.h | 10 + + 2 files changed, 410 insertions(+) + +commit fa6ea4258a5db51f4fd9d93e8a8649d5c20f9211 +Author: Aleksander Morgado +Date: Thu Jul 19 09:33:56 2012 +0200 + + icera: new `MMBroadbandBearerIcera' + + plugins/Makefile.am | 4 +- + plugins/icera/mm-broadband-bearer-icera.c | 84 + +++++++++++++++++++++++++++++++ + plugins/icera/mm-broadband-bearer-icera.h | 60 ++++++++++++++++++++++ + plugins/icera/mm-iface-icera.c | 57 +++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 8 +++ + 5 files changed, 212 insertions(+), 1 deletion(-) + +commit e8aa5d0f722c1c8b72a62307124b05b8f6e73c7b +Author: Aleksander Morgado +Date: Thu Jul 19 08:27:39 2012 +0200 + + icera: ignore +PACSP unsolicited messages + + plugins/icera/mm-iface-icera.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit b4f20bfaca787e9c91417ae9ea578876858aa5d8 +Author: Aleksander Morgado +Date: Thu Jul 19 08:13:20 2012 +0200 + + icera: implement 3GPP unsolicited messages enabling/disabling + + plugins/icera/mm-iface-icera.c | 52 + +++++++++++++++++++++++++++++++++++++++++- + plugins/icera/mm-iface-icera.h | 17 ++++++++++++++ + 2 files changed, 68 insertions(+), 1 deletion(-) + +commit 7163f4fe5fa2927e702a5d034e1852a03e5f4bf1 +Author: Aleksander Morgado +Date: Wed Jul 18 21:13:58 2012 +0200 + + icera: implement loading access technologies + + plugins/icera/mm-iface-icera.c | 69 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 9 ++++++ + 2 files changed, 78 insertions(+) + +commit 8ddd6e097d4980fadafd872c38551a39081c8293 +Author: Aleksander Morgado +Date: Wed Jul 18 20:58:46 2012 +0200 + + icera: implement %NWSTATE unsolicited messages handling + + plugins/icera/mm-iface-icera.c | 153 + +++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 4 ++ + 2 files changed, 157 insertions(+) + +commit a47cbae678ae64b391f010f9f69247d9fedf35a2 +Author: Aleksander Morgado +Date: Wed Jul 18 19:44:50 2012 +0200 + + icera: implement allowed mode setting + + plugins/icera/mm-iface-icera.c | 101 + +++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 9 ++++ + 2 files changed, 110 insertions(+) + +commit b8310729ad94e024a0ce9217607fa6667e4735a2 +Author: Aleksander Morgado +Date: Wed Jul 18 19:22:48 2012 +0200 + + icera: implement initial allowed mode loading + + plugins/icera/mm-iface-icera.c | 78 + +++++++++++++++++++++++++++++++++++++++++- + plugins/icera/mm-iface-icera.h | 12 +++++++ + 2 files changed, 89 insertions(+), 1 deletion(-) + +commit 2e8ede1a2970ae1108a6b4e4f75a7bcc6a15b7aa +Author: Aleksander Morgado +Date: Sun Jun 10 04:40:52 2012 +0200 + + icera: add initial skeleton of the `MMIfaceIcera' interface + + plugins/Makefile.am | 24 ++++++++--------- + plugins/icera/mm-iface-icera.c | 58 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/icera/mm-iface-icera.h | 35 +++++++++++++++++++++++++ + 3 files changed, 105 insertions(+), 12 deletions(-) + +commit 9a068b4294b535de36f92c799dd94b28704ab336 +Author: Aleksander Morgado +Date: Wed Jul 18 18:44:12 2012 +0200 + + samsung: port Bearer to use the 'config' property in the MMBearer + class + + This saves us from requiring to implement user & password in all + modems. + + plugins/samsung/mm-broadband-bearer-samsung.c | 164 + +++----------------------- + plugins/samsung/mm-broadband-bearer-samsung.h | 6 +- + 2 files changed, 19 insertions(+), 151 deletions(-) + +commit fc9a7dbbd971b14cc1ff56a61d2f8e90a0a55869 +Author: Aleksander Morgado +Date: Wed Jul 18 18:22:07 2012 +0200 + + samsung: port plugin to the refactored probing logic + + plugins/samsung/mm-plugin-samsung.c | 72 + ++++++++++--------------------------- + plugins/samsung/mm-plugin-samsung.h | 6 ++-- + 2 files changed, 22 insertions(+), 56 deletions(-) + +commit 03a0fee4ff3443a441f1356edb71af22d9048f47 +Author: Aleksander Morgado +Date: Sun May 6 13:15:46 2012 +0200 + + samsung: minor coding style fixes + + plugins/samsung/mm-broadband-bearer-samsung.c | 16 +++++++++------- + plugins/samsung/mm-plugin-samsung.c | 6 +++--- + 2 files changed, 12 insertions(+), 10 deletions(-) + +commit 6f814bb15afad3fc0a8490c7a8a7534a8d63c1f5 +Author: Aleksander Morgado +Date: Sun May 6 13:08:22 2012 +0200 + + samsung: plug memleak + + get_port() actually increases the refcount of the returned port, + use peek_port() + instead. + + plugins/samsung/mm-broadband-bearer-samsung.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a80e620342a2e1f12d582dff95098e73566701b7 +Author: Aleksander Morgado +Date: Sun May 6 13:07:41 2012 +0200 + + samsung: fix typo, s/recieved/received + + plugins/samsung/mm-broadband-bearer-samsung.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f15527eecde0b7349cccd6a2ea60d6999bc41e7a +Author: Nathan Williams +Date: Wed Feb 22 16:48:39 2012 -0500 + + samsung: plugin for Samsung Y3300/Y3400 UMTS modems based on the + Icera/Nvidia chipset + + plugins/Makefile.am | 21 +- + plugins/samsung/mm-broadband-bearer-samsung.c | 679 ++++++++++++++ + plugins/samsung/mm-broadband-bearer-samsung.h | 63 ++ + plugins/samsung/mm-broadband-modem-samsung.c | 1179 + +++++++++++++++++++++++++ + plugins/samsung/mm-broadband-modem-samsung.h | 50 ++ + plugins/samsung/mm-plugin-samsung.c | 115 +++ + plugins/samsung/mm-plugin-samsung.h | 47 + + 7 files changed, 2144 insertions(+), 10 deletions(-) + +commit ea3652ef6313238e36d48f60e138271810eaea9e +Author: Aleksander Morgado +Date: Mon Jul 16 08:08:49 2012 +0200 + + TODO: add task to give time to modems to settle down after PIN entry + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0bd8f5bc94abcc3134ce9446c31371014ffef442 +Author: Aleksander Morgado +Date: Wed Apr 11 11:36:31 2012 +0200 + + pantech: expect QCDM ports + + plugins/pantech/mm-plugin-pantech.c | 1 + + 1 file changed, 1 insertion(+) + +commit b96a50f42be86c21f5b4b0ea320b6568c9426c96 +Author: Aleksander Morgado +Date: Tue Apr 10 14:23:54 2012 +0200 + + pantech: always prefer the ttyACM port as primary AT port + + plugins/pantech/mm-plugin-pantech.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit f4754e150ecf34380935d7eb1d39c55063574664 +Author: Aleksander Morgado +Date: Tue Apr 10 14:06:08 2012 +0200 + + pantech: initial dummy plugin + + plugins/Makefile.am | 10 ++++- + plugins/pantech/mm-plugin-pantech.c | 76 + +++++++++++++++++++++++++++++++++++++ + plugins/pantech/mm-plugin-pantech.h | 40 +++++++++++++++++++ + 3 files changed, 125 insertions(+), 1 deletion(-) + +commit aab85242851deddd097721d376b64116bc11953a +Author: Aleksander Morgado +Date: Thu Jul 12 06:36:04 2012 +0200 + + x22x: plugin fully ported + + plugins/mm-modem-x22x-gsm.c | 267 + -------------------------------------------- + plugins/mm-modem-x22x-gsm.h | 45 -------- + plugins/mm-plugin-x22x.c | 246 + ---------------------------------------- + plugins/mm-plugin-x22x.h | 41 ------- + 4 files changed, 599 deletions(-) + +commit 14d482286ff80cd0b3bacd4ead3e7682b1146059 +Author: Aleksander Morgado +Date: Thu Jul 12 06:35:14 2012 +0200 + + x22x: implement allowed mode loading and setting + + plugins/x22x/mm-broadband-modem-x22x.c | 167 + +++++++++++++++++++++++++++++++++ + 1 file changed, 167 insertions(+) + +commit d206bb045b2de6f835cdcce27625a96806ef21d8 +Author: Aleksander Morgado +Date: Wed Jul 11 17:32:52 2012 +0200 + + x22x: implement access technology loading + + plugins/x22x/mm-broadband-modem-x22x.c | 50 + +++++++++++++++++++++++++++++++++- + 1 file changed, 49 insertions(+), 1 deletion(-) + +commit 2483eaecb537d52f2ee7425ceb2e72c56f972dad +Author: Aleksander Morgado +Date: Wed Jul 11 17:28:41 2012 +0200 + + x22x: new `MMBroadbandModemX22x' object + + plugins/Makefile.am | 4 ++- + plugins/x22x/mm-broadband-modem-x22x.c | 60 + ++++++++++++++++++++++++++++++++++ + plugins/x22x/mm-broadband-modem-x22x.h | 49 +++++++++++++++++++++++++++ + plugins/x22x/mm-plugin-x22x.c | 12 +++---- + 4 files changed, 118 insertions(+), 7 deletions(-) + +commit a74523feabab7b917f74318a4459c23275131359 +Author: Aleksander Morgado +Date: Wed Jul 11 17:24:56 2012 +0200 + + x22x: start porting the X22X plugin + + plugins/Makefile.am | 21 +- + plugins/{ => x22x}/77-mm-x22x-port-types.rules | 0 + plugins/x22x/mm-plugin-x22x.c | 274 + +++++++++++++++++++++++++ + plugins/x22x/mm-plugin-x22x.h | 42 ++++ + 4 files changed, 326 insertions(+), 11 deletions(-) + +commit 6a4ce68e401c612b9cd71a13620ab7e284a22569 +Author: Aleksander Morgado +Date: Wed Jul 11 17:06:30 2012 +0200 + + TODO: add task for the PIN/PUK retries left loading in Longcheer + modems + + TODO | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 24446735274333b91c2710737fc6954d3f88d00b +Author: Aleksander Morgado +Date: Wed Jul 11 17:01:53 2012 +0200 + + longcheer: plugin fully ported + + plugins/mm-modem-longcheer-gsm.c | 242 + --------------------------------------- + plugins/mm-modem-longcheer-gsm.h | 45 -------- + 2 files changed, 287 deletions(-) + +commit 2a871db7ec58e5909553eb1dbf55f77444da55f9 +Author: Aleksander Morgado +Date: Wed Jul 11 17:01:12 2012 +0200 + + longcheer: implement allowed mode loading and setting + + plugins/longcheer/mm-broadband-modem-longcheer.c | 164 + +++++++++++++++++++++++ + 1 file changed, 164 insertions(+) + +commit f5d7605defc8cef51fca03c60e6e6ece3764b825 +Author: Aleksander Morgado +Date: Wed Jul 11 16:45:56 2012 +0200 + + longcheer: implement access technology loading + + plugins/longcheer/mm-broadband-modem-longcheer.c | 50 + +++++++++++++++++++++++- + 1 file changed, 49 insertions(+), 1 deletion(-) + +commit 1f9c3ef61e687658516a868ab3f92e596c0832cb +Author: Aleksander Morgado +Date: Wed Jul 11 16:30:30 2012 +0200 + + longcheer: new `MMBroadbandModemLongcheer' object + + plugins/Makefile.am | 4 +- + plugins/longcheer/mm-broadband-modem-longcheer.c | 60 + ++++++++++++++++++++++++ + plugins/longcheer/mm-broadband-modem-longcheer.h | 49 +++++++++++++++++++ + plugins/longcheer/mm-plugin-longcheer.c | 12 ++--- + 4 files changed, 118 insertions(+), 7 deletions(-) + +commit 3fb5f1ae38cbcba50bc9a47613d4fee78f793524 +Author: Aleksander Morgado +Date: Wed Jul 11 16:26:52 2012 +0200 + + longcheer: start porting the Longcheer plugin + + plugins/Makefile.am | 20 +- + .../77-mm-longcheer-port-types.rules | 0 + plugins/longcheer/mm-plugin-longcheer.c | 277 + +++++++++++++++++++++ + plugins/{ => longcheer}/mm-plugin-longcheer.h | 9 +- + plugins/mm-plugin-longcheer.c | 259 + ------------------- + 5 files changed, 292 insertions(+), 273 deletions(-) + +commit 5b2c839dd9437f4845fea953c4c41d9d7951f9f0 +Author: Aleksander Morgado +Date: Mon Jul 16 19:25:13 2012 +0200 + + huawei: cache port mode results in the parent `MMDevice' + + This lets us skip the search for the `MMPortProbe' where we got + the results. + + plugins/huawei/mm-plugin-huawei.c | 34 ++++++++++++++++------------------ + 1 file changed, 16 insertions(+), 18 deletions(-) + +commit e303e5c90d42d1d37dab6ef093d8b526e1e74586 +Author: Aleksander Morgado +Date: Mon Jul 16 18:38:59 2012 +0200 + + huawei: plugin fully ported + + plugins/mm-modem-huawei-cdma.c | 304 -------------- + plugins/mm-modem-huawei-cdma.h | 47 --- + plugins/mm-modem-huawei-gsm.c | 922 + ----------------------------------------- + plugins/mm-modem-huawei-gsm.h | 45 -- + plugins/mm-plugin-huawei.c | 332 --------------- + plugins/mm-plugin-huawei.h | 42 -- + 6 files changed, 1692 deletions(-) + +commit dd7165610644be9a19106e3d61ff4e8a46fdb045 +Author: Aleksander Morgado +Date: Mon Jul 16 18:37:56 2012 +0200 + + huawei: implement custom detailed CDMA registration state checks + + plugins/huawei/mm-broadband-modem-huawei.c | 155 + +++++++++++++++++++++++++++++ + 1 file changed, 155 insertions(+) + +commit ad3f3fe6a69731d5ba911a3729bae38f3a8c9006 +Author: Aleksander Morgado +Date: Mon Jul 16 18:18:50 2012 +0200 + + huawei: do not run AT+CSS? in EV-DO capable devices + + plugins/huawei/mm-broadband-modem-huawei.c | 94 + ++++++++++++++++++++++++++++++ + 1 file changed, 94 insertions(+) + +commit e6d7885d7fc34722e459d7a4b3c55bb8680d2401 +Author: Aleksander Morgado +Date: Fri Jul 13 20:15:35 2012 +0200 + + huawei: implement CDMA unsolicited signal change report handling + + plugins/huawei/mm-broadband-modem-huawei.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit a7f0a313e5eea4abb74db9b744ae73ce104e5c60 +Author: Aleksander Morgado +Date: Fri Jul 13 20:15:04 2012 +0200 + + huawei: setup/cleanup unsolicited message handlers in the CDMA + interface + + plugins/huawei/mm-broadband-modem-huawei.c | 157 + ++++++++++++++++++++++++++++- + 1 file changed, 156 insertions(+), 1 deletion(-) + +commit 93cc9483bc4fbdafa18134efd0edb41c175c11d4 +Author: Aleksander Morgado +Date: Thu Jul 12 12:36:47 2012 +0200 + + huawei: allow grabbing QCDM ports + + plugins/huawei/mm-plugin-huawei.c | 1 + + 1 file changed, 1 insertion(+) + +commit 5d38983d66234144ed56a1a3def10dd882120322 +Author: Aleksander Morgado +Date: Thu Jul 12 12:13:24 2012 +0200 + + huawei: ignore unsolicited ^CSNR notifications + + plugins/huawei/mm-broadband-modem-huawei.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 1c3644e4775696b5b68aa2b22fe51560751e9a40 +Author: Aleksander Morgado +Date: Thu Jul 12 12:00:12 2012 +0200 + + TODO: add task to check messaging unsolicited messages in Huawei + modems + + TODO | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 87757029067aea382ad630c01363e733539fd27d +Author: Aleksander Morgado +Date: Thu Jul 12 11:32:38 2012 +0200 + + huawei: implement custom USSD encode/decode methods + + plugins/huawei/mm-broadband-modem-huawei.c | 68 + +++++++++++++++++++++++++++++- + 1 file changed, 67 insertions(+), 1 deletion(-) + +commit 5a5aa9b78969e5f46bcd14ea60bd56381576cdcd +Author: Aleksander Morgado +Date: Thu Jul 12 11:25:40 2012 +0200 + + huawei: implement allowed mode getting/setting + + TODO | 6 + + plugins/huawei/mm-broadband-modem-huawei.c | 226 + ++++++++++++++++++++++++++++- + 2 files changed, 230 insertions(+), 2 deletions(-) + +commit c0126531c5573f23ecb1b8b610067240c2c90d78 +Author: Aleksander Morgado +Date: Thu Jul 12 10:34:58 2012 +0200 + + huawei: implement band loading/setting + + plugins/huawei/mm-broadband-modem-huawei.c | 216 + +++++++++++++++++++++++++++++ + 1 file changed, 216 insertions(+) + +commit 325ece6fe38dc24a4feea05632f79e2f4dc34cf2 +Author: Aleksander Morgado +Date: Thu Jul 12 09:45:01 2012 +0200 + + huawei: implement unlock retries loading + + plugins/huawei/mm-broadband-modem-huawei.c | 77 + ++++++++++++++++++++++++++++++ + 1 file changed, 77 insertions(+) + +commit 8c5f13a657414f400d5ab7c1deb15ee9a6ec64e3 +Author: Aleksander Morgado +Date: Thu Jul 12 08:41:25 2012 +0200 + + huawei: implement unsolicited messages enabling/disabling + + plugins/huawei/mm-broadband-modem-huawei.c | 155 + +++++++++++++++++++++++++++++ + 1 file changed, 155 insertions(+) + +commit 6f2fe89ef2f642e22cbea7539aef27bb76da56a0 +Author: Aleksander Morgado +Date: Thu Jul 12 08:22:27 2012 +0200 + + huawei: implement unsolicited 3GPP signal change report handling + + plugins/huawei/mm-broadband-modem-huawei.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 02cf87b149a44335259f4ec60da401cba2c53f52 +Author: Aleksander Morgado +Date: Thu Jul 12 08:10:19 2012 +0200 + + huawei: implement access technology loading and update handling + + plugins/huawei/mm-broadband-modem-huawei.c | 162 + +++++++++++++++++++++++++++++ + 1 file changed, 162 insertions(+) + +commit 433c8fa85b67a8ba691876aebd7b92129be2986f +Author: Aleksander Morgado +Date: Thu Jul 12 07:35:36 2012 +0200 + + huawei: report connection status statistics + + plugins/huawei/mm-broadband-modem-huawei.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit b25b7f91cb625c4a89e1322797b2fa03134ddc3c +Author: Aleksander Morgado +Date: Thu Jul 12 07:30:51 2012 +0200 + + huawei: setup/cleanup unsolicited message handlers in the 3GPP + interface + + plugins/huawei/mm-broadband-modem-huawei.c | 103 + ++++++++++++++++++++++++++++- + 1 file changed, 102 insertions(+), 1 deletion(-) + +commit 98f28db6e3bae0c38bc6e0679317fb38eb6d9ece +Author: Aleksander Morgado +Date: Thu Jul 12 07:22:46 2012 +0200 + + huawei: setup handlers for unsolicited messages + + Initially all disabled. + + plugins/huawei/mm-broadband-modem-huawei.c | 132 + +++++++++++++++++++++++++++++ + plugins/huawei/mm-broadband-modem-huawei.h | 2 + + 2 files changed, 134 insertions(+) + +commit 008beeedccf201c2e4f4438c26525bf9af71935d +Author: Aleksander Morgado +Date: Thu Jul 12 06:59:29 2012 +0200 + + huawei: new `MMBroadbandModemHuawei' object + + plugins/Makefile.am | 4 +- + plugins/huawei/mm-broadband-modem-huawei.c | 60 + ++++++++++++++++++++++++++++++ + plugins/huawei/mm-broadband-modem-huawei.h | 49 ++++++++++++++++++++++++ + plugins/huawei/mm-plugin-huawei.c | 12 +++--- + 4 files changed, 118 insertions(+), 7 deletions(-) + +commit efe2228515bcc702ac1f510b91629288d8876ed7 +Author: Aleksander Morgado +Date: Wed Jul 11 10:21:28 2012 +0200 + + huawei: try to gather port layout while probing + + We will try to use usbif0 to gather the port layout with + AT^GETPORTMODE. + + plugins/huawei/mm-plugin-huawei.c | 403 + +++++++++++++++++++++++++++++++++++++- + 1 file changed, 401 insertions(+), 2 deletions(-) + +commit f9a0aba08c928f3cfb45ba7d609c5446687196ed +Author: Aleksander Morgado +Date: Wed Jul 11 06:54:47 2012 +0200 + + huawei: start porting the Huawei plugin + + plugins/Makefile.am | 22 ++++----- + plugins/huawei/mm-plugin-huawei.c | 93 + +++++++++++++++++++++++++++++++++++++++ + plugins/huawei/mm-plugin-huawei.h | 42 ++++++++++++++++++ + 3 files changed, 144 insertions(+), 13 deletions(-) + +commit b8cc7c66ec4a8754902909b3d23d07462a881e6c +Author: Aleksander Morgado +Date: Sun Jul 22 13:07:26 2012 +0200 + + device: don't create devices with 0 ports + + If for any reason we're requested to create a device with 0 ports, + just return + error. + + src/mm-device.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit da0226708a2ff8ec0fda82776b03ff02b626c9f5 +Author: Aleksander Morgado +Date: Tue Jul 17 08:31:02 2012 +0200 + + plugin: abort probing when the port has been released from the device + + src/mm-plugin.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +commit 68c276efc1d7c856f8ce9790f384ae485fcaad66 +Author: Aleksander Morgado +Date: Fri Jun 29 09:52:37 2012 +0200 + + broadband-modem: new generic steps in + initialization/enabling/disabling + + Instead of hardcoding the logic to decide which ports are open or + closed in the + different steps, we now let the subclasses of MMBroadbandModem to + do that + themselves. + + We now provide: + + * initialization_started() and initialization_stopped(): the generic + implementation does the serial port open/close in these steps. + + * enabling_started(): the generic implementation does the serial + port opening + here. The serial ports are kept open as long the modem is in + enabled state. + + * disabling_stopped(): the generic implementation does the serial + port closing + here. + + src/mm-broadband-modem.c | 436 + ++++++++++++++++++++++++++++++++++++++++++----- + src/mm-broadband-modem.h | 24 +++ + src/mm-iface-modem.c | 125 -------------- + 3 files changed, 415 insertions(+), 170 deletions(-) + +commit 3b1d3063ba9aacb6ecbb927de3f20bd938c45f55 +Author: Aleksander Morgado +Date: Thu Jul 12 15:35:55 2012 +0200 + + manager: remove the MMDevice object when the last port of the device + is released + + src/mm-manager.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 8ae87f5c38d0947adddc5cf4a82798d6663a3100 +Author: Aleksander Morgado +Date: Thu Jul 12 12:51:41 2012 +0200 + + manager: fix removal of device from our HT of devices + + src/mm-manager.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit ff8a962d990c53a0e901a96df4fc01211e4d1962 +Author: Aleksander Morgado +Date: Wed Jul 11 13:25:20 2012 +0200 + + port-probe: let us peek the `MMDevice' owning the probe from the + probe itself + + src/mm-device.c | 11 +++++++---- + src/mm-device.h | 5 ++--- + src/mm-plugin.c | 2 +- + src/mm-port-probe.c | 44 +++++++++++++++++++++++++++++++++++++++++--- + src/mm-port-probe.h | 9 +++++++-- + 5 files changed, 58 insertions(+), 13 deletions(-) + +commit 1ca46cc0ec2fd407f3c70dcac11279dec4cc61d8 +Author: Aleksander Morgado +Date: Wed Jul 11 12:40:55 2012 +0200 + + plugins: use default port grabbing on those plugins without special + requirements + + plugins/anydata/mm-plugin-anydata.c | 15 -------------- + plugins/cinterion/mm-plugin-cinterion.c | 25 ----------------------- + plugins/generic/mm-plugin-generic.c | 25 ----------------------- + plugins/gobi/mm-plugin-gobi.c | 24 ---------------------- + plugins/iridium/mm-plugin-iridium.c | 24 ---------------------- + plugins/linktop/mm-plugin-linktop.c | 36 + --------------------------------- + plugins/motorola/mm-plugin-motorola.c | 24 ---------------------- + plugins/novatel/mm-plugin-novatel.c | 22 -------------------- + plugins/wavecom/mm-plugin-wavecom.c | 24 ---------------------- + 9 files changed, 219 deletions(-) + +commit b64f52cddc9dc1f49f167d010a8150671d0dd44a +Author: Aleksander Morgado +Date: Wed Jul 11 12:36:42 2012 +0200 + + plugin: if no grab_port() method given, use the default one + + src/mm-plugin.c | 20 ++++++++++++++++---- + src/mm-plugin.h | 6 ++---- + 2 files changed, 18 insertions(+), 8 deletions(-) + +commit bfc3cb27e1ae798b6934bb85d7b2106dec556ae5 +Author: Aleksander Morgado +Date: Wed Jul 11 12:26:22 2012 +0200 + + device,plugin: let the `MMPlugin' API know about `MMDevice' + + src/mm-device.c | 17 +++++++++-------- + src/mm-device.h | 9 +++++---- + src/mm-plugin-manager.c | 12 +++++++----- + src/mm-plugin.c | 6 ++---- + src/mm-plugin.h | 5 +++-- + 5 files changed, 26 insertions(+), 23 deletions(-) + +commit 884aa7f2eb944ed70c3aa33b41631aa7138f854d +Author: Aleksander Morgado +Date: Wed Jul 11 12:15:08 2012 +0200 + + plugin-manager: simplify by iterating the list ourselves + + src/mm-plugin-manager.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +commit 9be646f274c431f55cf89cc9109a1c9a9c931537 +Author: Aleksander Morgado +Date: Wed Jul 11 12:12:01 2012 +0200 + + plugin-manager: use a double-linked list for the plugin list + + src/mm-plugin-manager.c | 37 ++++++++++++++++++------------------- + 1 file changed, 18 insertions(+), 19 deletions(-) + +commit 86f4923d7f69e7adcd488fb7085429b04dec3190 +Author: Aleksander Morgado +Date: Wed Jul 11 12:08:35 2012 +0200 + + plugin: new method to compare plugins + + Instead of providing a method to get if a plugin is requesting to + get sorted + last, we provide a way to comparing two plugins, compatible with the + GCompareFunc required in g_list_sort(). + + src/mm-plugin-manager.c | 21 +-------------------- + src/mm-plugin.c | 25 +++++++++++++++++++++---- + src/mm-plugin.h | 5 +++-- + 3 files changed, 25 insertions(+), 26 deletions(-) + +commit 624a1e9087a7020824a94914d3989ebf00093c07 +Author: Aleksander Morgado +Date: Wed Jul 11 11:00:29 2012 +0200 + + plugin: remove obsolete comment + + src/mm-plugin.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 6e3d90e2a4cd0a5b863748b88ab67e959f47f0f6 +Author: Aleksander Morgado +Date: Wed Jul 11 10:20:11 2012 +0200 + + plugin: new `MM_PLUGIN_CUSTOM_INIT' property + + We let plugins execute some custom initialization in the ports, + specified by + a `MMAsyncMethod'. + + docs/reference/api/ModemManager-overview.xml | 14 ++++++++++ + src/mm-plugin.c | 38 + +++++++++++++++++++++++--- + src/mm-plugin.h | 1 + + src/mm-port-probe.c | 40 + ++++++++++++++++++++++++++++ + src/mm-port-probe.h | 15 +++++++++++ + 5 files changed, 104 insertions(+), 4 deletions(-) + +commit d63570838be002b4e82d4753e3b137aced1bcfe0 +Author: Aleksander Morgado +Date: Wed Jul 11 08:28:27 2012 +0200 + + port-probe: fix typo in class definition + + src/mm-port-probe.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 79abe00221450b9076eb9bb9898ec347ad863348 +Author: Aleksander Morgado +Date: Wed Jul 11 08:26:38 2012 +0200 + + core: new `MMAsyncMethod' boxed type + + Helps to bundle the async method implementation in a property. + + src/mm-private-boxed-types.c | 37 +++++++++++++++++++++++++++++++++++++ + src/mm-private-boxed-types.h | 7 +++++++ + 2 files changed, 44 insertions(+) + +commit f5fdf946c9a2eefb049155f476888742c5901643 +Author: Aleksander Morgado +Date: Wed Jul 11 07:03:56 2012 +0200 + + plugin: new `MM_PLUGIN_FORBIDDEN_DRIVERS' property + + It allows plugins to specify whether they cannot support ports + handled by + specific drivers. + + docs/reference/api/ModemManager-overview.xml | 10 ++++-- + src/mm-plugin.c | 50 + ++++++++++++++++++++++------ + src/mm-plugin.h | 1 + + 3 files changed, 48 insertions(+), 13 deletions(-) + +commit 1078b246b0ccea5a85dbef713c527e22c9cc64a2 +Author: Aleksander Morgado +Date: Wed Jul 11 06:57:16 2012 +0200 + + plugin: remove no longer used `MM_PLUGIN_SORT_LAST' property + + The behaviour previously handled by this property is now automatically + handled. + + src/mm-plugin.h | 1 - + 1 file changed, 1 deletion(-) + +commit 9b0f6c83f2e34620c99a7d3b2c945ef92314369a +Author: Aleksander Morgado +Date: Wed Jul 11 06:53:56 2012 +0200 + + plugin: renamed `custom-init' property to `custom-at-probe' + + The `custom-at-probe' property is just to modify the way we check + for AT port + support. + + docs/reference/api/ModemManager-overview.xml | 50 + ++++++++++++---------------- + plugins/nokia/mm-plugin-nokia.c | 6 ++-- + src/mm-plugin.c | 22 ++++++------ + src/mm-plugin.h | 2 +- + src/mm-port-probe.c | 39 ++++++---------------- + src/mm-port-probe.h | 2 +- + 6 files changed, 47 insertions(+), 74 deletions(-) + +commit 89b3c0132879157c16526ae7da1aa3cdefe64fe8 +Author: Aleksander Morgado +Date: Tue Jul 10 15:26:04 2012 +0200 + + port-probe: setup the port object as a property + + src/mm-port-probe.c | 74 + ++++++++++++++++++++++++++++++++++++++++++++++++----- + src/mm-port-probe.h | 3 +++ + 2 files changed, 71 insertions(+), 6 deletions(-) + +commit 055b56306ab194910416f5358ef7454a53bdfc59 +Author: Aleksander Morgado +Date: Tue Jul 10 15:11:57 2012 +0200 + + port-probe: no need to keep our internal copies of subsys/name + + src/mm-port-probe.c | 128 + ++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 78 insertions(+), 50 deletions(-) + +commit 4a85707b09e2fffbae36f8a3320366f5cc869595 +Author: Aleksander Morgado +Date: Tue Jul 10 15:07:36 2012 +0200 + + port-probe: no need to keep neither physdev path nor driver + + src/mm-device.c | 4 +--- + src/mm-port-probe.c | 26 +------------------------- + src/mm-port-probe.h | 6 +----- + 3 files changed, 3 insertions(+), 33 deletions(-) + +commit a5560bef3d46c60acb05c4c3d94ca76c8d52df2c +Author: Aleksander Morgado +Date: Tue Jul 10 15:01:22 2012 +0200 + + port-probe: don't warn if requesting info which wasn't probed + + src/mm-port-probe.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +commit a8bc1909e4e2aa369efbccd97737c087927f5b78 +Author: Aleksander Morgado +Date: Tue Jul 10 13:27:31 2012 +0200 + + plugin: setup a `priv' opaque pointer for the internal data + + G_TYPE_INSTANCE_GET_PRIVATE() is really slow, so try to call it as + less as + possible. + + src/mm-plugin.c | 196 + ++++++++++++++++++++++++++++---------------------------- + src/mm-plugin.h | 2 + + 2 files changed, 99 insertions(+), 99 deletions(-) + +commit a31560216672b08f27cb93798478f49e31fb6298 +Author: Aleksander Morgado +Date: Tue Jul 10 13:18:21 2012 +0200 + + plugin: no need to have our own `GUdevClient' + + src/mm-plugin.c | 7 ------- + 1 file changed, 7 deletions(-) + +commit 1e9c6772ce674606b2e999baf9e9b7a3b25bb862 +Author: Aleksander Morgado +Date: Tue Jul 10 13:14:31 2012 +0200 + + plugin: no need to take care of probing tasks ourselves + + src/mm-plugin.c | 55 + +------------------------------------------------------ + 1 file changed, 1 insertion(+), 54 deletions(-) + +commit cf48d3daa790a57bd003e6488baf936ec186caee +Author: Aleksander Morgado +Date: Tue Jul 10 13:14:13 2012 +0200 + + plugin: don't provide an additional method to cancel the probing + + We'll do it with a GCancellable. + + src/mm-plugin.c | 20 -------------------- + src/mm-plugin.h | 3 --- + 2 files changed, 23 deletions(-) + +commit d84cecac99fa0b06ade470d093932ae97c72fe4b +Author: Aleksander Morgado +Date: Tue Jul 10 13:11:01 2012 +0200 + + plugin: don't use internal task list to cancel AT probing in other + probes + + src/mm-plugin.c | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +commit 61e285497cd61f4b7620d3def3d63a01dc150b59 +Author: Aleksander Morgado +Date: Tue Jul 10 13:03:42 2012 +0200 + + port-probe-cache: removed, no longer needed + + The `MMDevice' acts as port probe cache for us now, directly storing + all port + probes of the same device. + + src/Makefile.am | 2 -- + src/mm-manager.c | 6 ---- + src/mm-plugin.c | 4 +-- + src/mm-port-probe-cache.c | 87 + ----------------------------------------------- + src/mm-port-probe-cache.h | 31 ----------------- + 5 files changed, 1 insertion(+), 129 deletions(-) + +commit 9d14e4e8e9f2c4c15016a62ab5a3aadddaf08312 +Author: Aleksander Morgado +Date: Tue Jul 10 12:59:01 2012 +0200 + + device: get vendor/product IDs + + And don't do it in MMPlugin. + + src/mm-device.c | 106 ++++++++++++++++++++++++++++++++++++++++++-- + src/mm-device.h | 2 + + src/mm-plugin.c | 133 + +++++--------------------------------------------------- + 3 files changed, 115 insertions(+), 126 deletions(-) + +commit 74dd7246697bb086c92fcdea93b26966fecc7fa5 +Author: Aleksander Morgado +Date: Tue Jul 10 12:41:00 2012 +0200 + + plugin: simplify interface by passing around the device and/or + port objects + + src/mm-device.c | 2 +- + src/mm-plugin-manager.c | 6 +- + src/mm-plugin.c | 159 + +++++++++++++++++------------------------------- + src/mm-plugin.h | 8 +-- + 4 files changed, 61 insertions(+), 114 deletions(-) + +commit b816887cace031b1b5fc33818fba9b513850f5b6 +Author: Aleksander Morgado +Date: Tue Jul 10 12:40:04 2012 +0200 + + port-probe: use dispose() to cleanup internal object references + + src/mm-port-probe.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +commit 87c2c8632e73a5e128c8b47a958e02fb809618c9 +Author: Aleksander Morgado +Date: Tue Jul 10 12:39:43 2012 +0200 + + port-probe: new method to check if there is an AT port in a list + of probes + + src/mm-port-probe.c | 13 +++++++++++++ + src/mm-port-probe.h | 3 +++ + 2 files changed, 16 insertions(+) + +commit b791e87b23b3cbfdad53edf1129a1428b14c191c +Author: Aleksander Morgado +Date: Tue Jul 10 12:11:52 2012 +0200 + + device: keep a list of port probes instead of just ports + + src/mm-device.c | 111 + ++++++++++++++++++++++++++++++++++++++------------------ + src/mm-device.h | 7 ++++ + src/mm-plugin.c | 31 +++------------- + src/mm-plugin.h | 2 +- + 4 files changed, 89 insertions(+), 62 deletions(-) + +commit a9075b0c09eb999eb64fda70154e055a9d0edb1d +Author: Aleksander Morgado +Date: Tue Jul 10 11:48:02 2012 +0200 + + port-probe: rename _get_port() to _peek_port() as there is no + ownership transfer + + plugins/linktop/mm-plugin-linktop.c | 2 +- + plugins/nokia/mm-plugin-nokia.c | 2 +- + plugins/option/mm-plugin-hso.c | 2 +- + plugins/option/mm-plugin-option.c | 2 +- + plugins/simtech/mm-plugin-simtech.c | 2 +- + src/mm-port-probe.c | 2 +- + src/mm-port-probe.h | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +commit e5e46f489e9d89bdecb4c4948b0d9627e33555cc +Author: Aleksander Morgado +Date: Tue Jul 10 11:15:23 2012 +0200 + + core: merge `MMPluginBase' and `MMPlugin' + + There's no real point in maintaining a separate `MMPlugin' interface, + as all the + plugins will inherit from `MMPluginBase', so just merge them and + simplify + everything. + + TODO | 4 - + docs/reference/api/ModemManager-overview.xml | 74 +- + plugins/anydata/mm-plugin-anydata.c | 24 +- + plugins/anydata/mm-plugin-anydata.h | 6 +- + plugins/cinterion/mm-plugin-cinterion.c | 24 +- + plugins/cinterion/mm-plugin-cinterion.h | 6 +- + plugins/generic/mm-plugin-generic.c | 22 +- + plugins/generic/mm-plugin-generic.h | 5 +- + plugins/gobi/mm-plugin-gobi.c | 24 +- + plugins/gobi/mm-plugin-gobi.h | 7 +- + plugins/iridium/mm-plugin-iridium.c | 26 +- + plugins/iridium/mm-plugin-iridium.h | 6 +- + plugins/linktop/mm-plugin-linktop.c | 22 +- + plugins/linktop/mm-plugin-linktop.h | 6 +- + plugins/motorola/mm-plugin-motorola.c | 22 +- + plugins/motorola/mm-plugin-motorola.h | 6 +- + plugins/nokia/mm-plugin-nokia.c | 24 +- + plugins/nokia/mm-plugin-nokia.h | 6 +- + plugins/novatel/mm-plugin-novatel.c | 22 +- + plugins/novatel/mm-plugin-novatel.h | 6 +- + plugins/option/mm-plugin-hso.c | 24 +- + plugins/option/mm-plugin-hso.h | 6 +- + plugins/option/mm-plugin-option.c | 26 +- + plugins/option/mm-plugin-option.h | 6 +- + plugins/simtech/mm-plugin-simtech.c | 24 +- + plugins/simtech/mm-plugin-simtech.h | 6 +- + plugins/wavecom/mm-plugin-wavecom.c | 22 +- + plugins/wavecom/mm-plugin-wavecom.h | 6 +- + src/Makefile.am | 4 +- + src/mm-plugin-base.c | 1138 + -------------------------- + src/mm-plugin-base.h | 79 -- + src/mm-plugin.c | 1116 + +++++++++++++++++++++++-- + src/mm-plugin.h | 137 ++-- + 33 files changed, 1352 insertions(+), 1584 deletions(-) + +commit 7e9d3e4b685f0e92979af2f595be6cd336b5dbd6 +Author: Aleksander Morgado +Date: Tue Jul 10 10:44:14 2012 +0200 + + plugin-base: method to get device IDs doesn't need to be public + + Given the new pre-probing filters, the IDs are no longer retrieved + by the + plugins. + + src/mm-plugin-base.c | 16 ++++++++-------- + src/mm-plugin-base.h | 5 ----- + 2 files changed, 8 insertions(+), 13 deletions(-) + +commit aaa487094e140583c4e652c8f59e38431d77b865 +Author: Aleksander Morgado +Date: Tue Jul 10 10:24:58 2012 +0200 + + plugin-manager: simplify device/port probing logic + + The plugin manager no longer needs to take care of keeping track of + which probes + are being run and to which physical device they correspond, as the + upper layer's + `MMDevice' already does this. This simplifies the internal logic + quite a lot, as + we can now easily suggest plugins to the remaining port probes of + the same + device directly. + + src/mm-plugin-manager.c | 742 + ++++++++++++++++++------------------------------ + 1 file changed, 271 insertions(+), 471 deletions(-) + +commit a1ffbdf1c8fef089e8c114649ed2161bab2aaaa6 +Author: Aleksander Morgado +Date: Tue Jul 10 08:39:28 2012 +0200 + + plugin-manager: find port support is now only an internal operation + + src/mm-plugin-manager.c | 41 +++++++++++++++++++++++------------------ + src/mm-plugin-manager.h | 14 -------------- + 2 files changed, 23 insertions(+), 32 deletions(-) + +commit c1c3702f5336b7e759afc7d8b51a7422b18098ed +Author: Aleksander Morgado +Date: Tue Jul 10 08:35:47 2012 +0200 + + plugin-manager: remove unneeded methods + + We no longer need to query the plugin manager whether we're checking + support for + a specific port, as the ports are now grabbed only once in the + MMDevice, and + therefore we ensure that supports check is launched only once in the + PluginManager for that specific port. + + Also, we no longer need to query the plugin manager whether we're + checking + support for a given device, as the logic to check when all ports of + the device + are probed is now maintained internally. + + src/mm-plugin-manager.c | 50 + ------------------------------------------------- + src/mm-plugin-manager.h | 13 ------------- + 2 files changed, 63 deletions(-) + +commit b35d6a65faff87c6cb96bdda4fee5cc270be4f6f +Author: Aleksander Morgado +Date: Tue Jul 10 08:29:14 2012 +0200 + + plugin-manager: define a minimum probing time of 2s + + Effectively, we're now letting the kernel up to 2s to show all the + ports of the + device, starting from the time where the first port is exposed. + + src/mm-plugin-manager.c | 50 + ++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 41 insertions(+), 9 deletions(-) + +commit e8339385da87665befd36c7041b2ab334883130e +Author: Aleksander Morgado +Date: Tue Jul 10 08:15:29 2012 +0200 + + manager: use the new method to check support of a given full device + + src/mm-manager.c | 202 + +++++++++++++++++-------------------------------------- + 1 file changed, 61 insertions(+), 141 deletions(-) + +commit 5b4abce64afc2987a12a80ba86277d4b5fb53cc4 +Author: Aleksander Morgado +Date: Tue Jul 10 08:14:32 2012 +0200 + + plugin-manager: new method to check support for a given device and + all its ports + + The new `mm_plugin_manager_find_device_support()' will be an async + method which + waits for ports to be added in the given `MMDevice'. As soon as all + added ports + are probed, the device support check is considered finished. + + src/mm-plugin-manager.c | 185 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-manager.h | 21 ++++-- + 2 files changed, 202 insertions(+), 4 deletions(-) + +commit 3daed5130fcbbf958c61274199001bd9aa307fbb +Author: Aleksander Morgado +Date: Tue Jul 10 08:12:40 2012 +0200 + + plugin-base: don't assume a plugin will give as supported all ports + of the device + + E.g. the Generic plugin will give as unsupported 'net' ports found + in the + device, as it doesn't know how to use them. + + src/mm-plugin-base.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 66ec5cd724ca82d4b0ad538f0d196833e88624e5 +Author: Aleksander Morgado +Date: Tue Jul 10 07:09:36 2012 +0200 + + device: signal grabbed/released ports + + src/mm-device.c | 38 ++++++++++++++++++++++++++++++++------ + src/mm-device.h | 9 +++++++++ + 2 files changed, 41 insertions(+), 6 deletions(-) + +commit 72ffa7a1e5e5cb45efa165d44467a32cf60fc52f +Author: Aleksander Morgado +Date: Tue Jul 10 07:07:56 2012 +0200 + + device: load driver being used when first port grabbed + + src/mm-device.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-device.h | 1 + + 2 files changed, 51 insertions(+) + +commit 7b7f5b9dcb0b3cde4adc8e615ee6ee3fb01b9a80 +Author: Aleksander Morgado +Date: Tue Jul 10 07:03:08 2012 +0200 + + device: keep sysfs path around for logging + + src/mm-device.c | 19 +++++++++++++++++++ + src/mm-device.h | 1 + + 2 files changed, 20 insertions(+) + +commit 0aff871b04b76ca45aa9afbf7f1c88cb65c0e80d +Author: Aleksander Morgado +Date: Tue Jul 10 07:00:46 2012 +0200 + + device: split `MMDevice' creation and plugin setting + + We want to be able to create the MMDevice way before we have + decided which + plugin to use. + + src/mm-device.c | 21 +++++++++++++++------ + src/mm-device.h | 5 +++-- + src/mm-manager.c | 4 ++-- + 3 files changed, 20 insertions(+), 10 deletions(-) + +commit 815693661c7f6a4225d271d2cec67e59bad8e070 +Author: Aleksander Morgado +Date: Tue Jun 5 15:25:38 2012 +0200 + + core: compile all ports before creating the modem object + + Before this, we only exported the modem to DBus when all ports + were organized, + in order to make sure that we select as primary port the one we + really want and + not the first AT port grabbed. Given that to get all the ports + organized we also + needed to wait to get all the ports grabbed, we can now also defer + the creation + of the modem object until all the ports get grabbed. This allows us + to create + different types of objects based on the ports available (e.g. we + can now create + QMI-supported modem objects if we see a QMI port around). + + include/ModemManager-errors.h | 2 + + plugins/Makefile.am | 2 +- + plugins/anydata/mm-plugin-anydata.c | 60 ++-- + plugins/cinterion/mm-plugin-cinterion.c | 61 ++-- + plugins/generic/mm-plugin-generic.c | 80 ++---- + plugins/gobi/mm-plugin-gobi.c | 63 ++--- + plugins/iridium/mm-plugin-iridium.c | 65 ++--- + plugins/linktop/mm-plugin-linktop.c | 64 ++--- + plugins/motorola/mm-plugin-motorola.c | 63 ++--- + plugins/nokia/mm-plugin-nokia.c | 73 ++--- + plugins/novatel/mm-plugin-novatel.c | 58 ++-- + plugins/option/mm-plugin-hso.c | 57 ++-- + plugins/option/mm-plugin-option.c | 63 ++--- + plugins/simtech/mm-plugin-simtech.c | 61 ++-- + plugins/wavecom/mm-plugin-wavecom.c | 62 ++-- + src/Makefile.am | 2 + + src/mm-device.c | 413 +++++++++++++++++++++++++++ + src/mm-device.h | 74 +++++ + src/mm-manager.c | 486 + +++++++++++--------------------- + src/mm-plugin-base.c | 98 +++++-- + src/mm-plugin-base.h | 17 +- + src/mm-plugin.c | 15 +- + src/mm-plugin.h | 23 +- + 23 files changed, 1095 insertions(+), 867 deletions(-) + +commit 4add521a98e59c9fbaaf30d965771ca01f748242 +Author: Aleksander Morgado +Date: Thu Aug 2 10:40:33 2012 +0200 + + build: remove duplicate `--with-docs' switch + + configure.ac | 8 -------- + 1 file changed, 8 deletions(-) + +commit 0336b8f89d83998323643e5db8478590f310c256 +Author: Aleksander Morgado +Date: Thu Aug 2 09:23:16 2012 +0200 + + iface-modem: don't process signal/act updates if interface is + shut down + + When the interface is shut down the skeleton object no longer + exists. Given that + we're allowing this actions from outside the interface, we should + be safe and + don't assume that the caller knows exactly the state of the interface. + + src/mm-iface-modem.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +commit b320f5c065e634a7fd2f98accafa164a1ccd8e1b +Author: Ben Chan +Date: Wed Aug 1 11:53:06 2012 -0700 + + iface-modem: fix crashes due to removed context + + src/mm-iface-modem.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 0ff904b3c501969d953c05834d897211b92a1324 +Author: Aleksander Morgado +Date: Tue Jul 31 09:16:07 2012 +0200 + + bearer: set state as DISCONNECTING as soon as we cancel the connection + sequence + + Just when we request to cancel the connection we need to set the + bearer as + being disconnected, so that we do not end up overwriting connection + cancellation + requests. + + Reported by: Thieu Le + + src/mm-bearer.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 737b6c2fc5d576c744aa7e5bb70b171bf3271e6f +Author: Aleksander Morgado +Date: Tue Jul 31 09:02:58 2012 +0200 + + cli,libmm-glib: provide mm_manager_(peek|get)_proxy() + + peek() doesn't increase the reference count of the proxy object, + while get() + does it. + + cli/mmcli-manager.c | 4 ++-- + libmm-glib/mm-manager.c | 18 ++++++++++++++++-- + libmm-glib/mm-manager.h | 3 ++- + 3 files changed, 20 insertions(+), 5 deletions(-) + +commit 60405ce4ff5cc8ce7d8116b2387add00465dbd49 +Author: Ben Chan +Date: Mon Jul 30 16:46:25 2012 -0700 + + cli,libmm-glib: set default timeout on manager DBus proxy + + This patch fixes mmcli to set the default timeout on the manager proxy + interface (MmGdbusOrgFreedesktopModemManager1) instead of MMManager + itself. The later is not a GDBusProxy object. + + cli/mmcli-manager.c | 4 ++-- + libmm-glib/mm-manager.c | 14 ++++++++++++++ + libmm-glib/mm-manager.h | 2 ++ + 3 files changed, 18 insertions(+), 2 deletions(-) + +commit a448eabb3d8c238f1f734e233edd0ca9b49b2d60 +Author: Aleksander Morgado +Date: Thu Jul 26 09:31:30 2012 +0200 + + iface-modem: SIM-PIN2 lock takes us to disabled state, not locked + + src/mm-iface-modem.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 8d31e79ac42a5a7df8fbef10cc5454f5a69515f0 +Author: Aleksander Morgado +Date: Thu Jul 26 09:28:06 2012 +0200 + + sim: getting SIM-PIN2 lock doesn't mean PIN sending failed + + src/mm-sim.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 05289d094b8068dca147a5a43073f544578d49bb +Author: Aleksander Morgado +Date: Wed Jul 25 12:00:28 2012 +0200 + + iface-modem-3gpp: fix variant ref count + + src/mm-iface-modem-3gpp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 75d84b7402e61f8d793f876775be9623f842d43a +Author: Aleksander Morgado +Date: Wed Jul 25 10:41:09 2012 +0200 + + cli: get AT command timeout directly from our default operation + timeout + + We remove the `--command-timeout' option, as the AT command timeout + is now + directly computed from our default DBus timeout (modifiable with + `--timeout'). + + cli/mmcli-modem.c | 39 ++++++++++++++++++++++++++++++--------- + 1 file changed, 30 insertions(+), 9 deletions(-) + +commit 8b863c5a4bd03a6b8ff668e25f750b51bc19ddbe +Author: Aleksander Morgado +Date: Wed Jul 25 10:15:38 2012 +0200 + + libmm-glib: don't change default DBus timeout when running + Modem.Command() + + Just warn if the default DBus timeout is shorter than the one being + requested. + + libmm-glib/mm-modem.c | 26 ++++++++++---------------- + 1 file changed, 10 insertions(+), 16 deletions(-) + +commit 8f8bcd7724e8c75cf7e0460946c04624ce6ed46a +Author: Aleksander Morgado +Date: Wed Jul 25 10:04:20 2012 +0200 + + cli: allow modifying default DBus timeout with `--timeout' + + By default 30s will be used for every operation. + + cli/mmcli-manager.c | 6 ++++++ + cli/mmcli-modem-3gpp.c | 12 ++++++++++++ + cli/mmcli-modem-cdma.c | 8 ++++++++ + cli/mmcli-modem-location.c | 8 ++++++++ + cli/mmcli-modem-messaging.c | 8 ++++++++ + cli/mmcli-modem-simple.c | 8 ++++++++ + cli/mmcli-modem-time.c | 8 ++++++++ + cli/mmcli-modem.c | 16 ++++++++++++++++ + cli/mmcli-sim.c | 6 ++++++ + cli/mmcli-sms.c | 5 +++++ + cli/mmcli.c | 11 +++++++++++ + cli/mmcli.h | 7 ++++--- + 12 files changed, 100 insertions(+), 3 deletions(-) + +commit 8a34e417943df90f6b43a0de08550def557c7db7 +Author: Aleksander Morgado +Date: Wed Jul 25 10:01:41 2012 +0200 + + cli: fix showing CDMA related info in sync mode + + cli/mmcli-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit 001f35234e16d7aeb2ed1282ba3b57aea73c5a9e +Author: Aleksander Morgado +Date: Wed Jul 25 09:25:18 2012 +0200 + + cli: ensure modem is enabled when performing actions + + Don't rely on the lock status, as the modem may say it requires SIM + PIN 2, but + we're allowed to run most operations even with that unlock required. + + cli/mmcli-modem-3gpp.c | 4 ++-- + cli/mmcli-modem-cdma.c | 4 ++-- + cli/mmcli-modem-location.c | 4 ++-- + cli/mmcli-modem-messaging.c | 4 ++-- + cli/mmcli-modem-time.c | 4 ++-- + 5 files changed, 10 insertions(+), 10 deletions(-) + +commit c6c1e0fb50569b9eafd92ba170a8dba42c4948be +Author: Aleksander Morgado +Date: Sun Jul 22 14:36:32 2012 +0200 + + broadband-modem: fallback to unencoded command in USSD if encoded + fails + + src/mm-broadband-modem.c | 173 + +++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 139 insertions(+), 34 deletions(-) + +commit 19e65253de194c8e6cdf1d1846729e2d778cf7ef +Author: Aleksander Morgado +Date: Sun Jul 22 11:52:45 2012 +0200 + + broadband-bearer: debug logs when disconnecting 3GPP bearer + + src/mm-broadband-bearer.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit aa11a0bf7d334bf8fa766f4f74935ebb970bcaf0 +Author: Aleksander Morgado +Date: Sun Jul 22 11:33:18 2012 +0200 + + broadband-modem: assume CS if 2G supported + + src/mm-broadband-modem.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 79fbe274e92605f7d31de3e4588dd4848bc6e797 +Author: Aleksander Morgado +Date: Sun Jul 22 00:21:07 2012 +0200 + + iface-modem: new async method to be run just after the successful + SIM unlock + + src/mm-iface-modem.c | 33 +++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 9 +++++++++ + 2 files changed, 40 insertions(+), 2 deletions(-) + +commit 2aceb907f4b1bc892874627f94586deff6c6808e +Author: Aleksander Morgado +Date: Sun Jul 22 13:29:51 2012 +0200 + + mm-broadband-modem: fix result completion on hex encoding errors + + src/mm-broadband-modem.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 9670b362bf1a058a8ecea818530f29df166f1027 +Author: Aleksander Morgado +Date: Sun Jul 22 13:30:27 2012 +0200 + + mm-broadband-modem: fix USSD command sending, don't use cached + AT replies + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ea10c57056996dcc888444a5386d4cfe43b94950 +Author: Aleksander Morgado +Date: Sun Jul 22 13:17:05 2012 +0200 + + broadband-modem: cancel pending USSD request if USSD session cancelled + + src/mm-broadband-modem.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit ce33bcfd7a2389a1d7255991afd0383eff763c53 +Author: Aleksander Morgado +Date: Sun Jul 22 13:08:56 2012 +0200 + + iface-modem-3gpp-ussd: set proper initial session state + + src/mm-iface-modem-3gpp-ussd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 89cdb8819a1427c371b6f307608bcac6c12b5a12 +Author: Aleksander Morgado +Date: Sun Jul 22 12:59:47 2012 +0200 + + iface-modem-3gpp-ussd: don't allow USSD actions if the modem is + not enabled + + src/mm-iface-modem-3gpp-ussd.c | 61 + +++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 58 insertions(+), 3 deletions(-) + +commit dd8dcbb899c27041f856ecdb633ed0aa0db6442b +Author: Aleksander Morgado +Date: Sun Jul 22 11:14:41 2012 +0200 + + messaging: don't treat as fatal error if we cannot read from a + given storage + + src/mm-iface-modem-messaging.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 2146553c5971e55ae0544852b6be4389e7590334 +Author: Aleksander Morgado +Date: Sat Jul 21 17:12:45 2012 +0200 + + broadband-bearer: fix missing method + + It was wrongly removed in commit + 2506e3093e9cc47bc03e34b0dd9c58c13469aec5. + + src/mm-broadband-bearer.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 9f5dd85d968006c6bb4326fbcf3ca0ac82ffbebb +Author: Aleksander Morgado +Date: Sat Jul 21 16:20:31 2012 +0200 + + doc: include missing description of the new LTE bands + + include/ModemManager-enums.h | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +commit 3653ec4b8e32bf856937ba49faaa982bdf774594 +Author: Aleksander Morgado +Date: Thu Jul 19 16:04:26 2012 +0200 + + broadband-modem: send always ATZ alone + + ITU rec v.250 (6.1.1) says: + The DTE should not include additional commands on the same command + line after + the Z command because such commands may be ignored. + + src/mm-broadband-modem.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit b30011005512eddccf8022ba60aa17312289acd3 +Author: Aleksander Morgado +Date: Thu Jul 19 14:52:39 2012 +0200 + + hso: use common integer string parsers + + plugins/option/mm-broadband-bearer-hso.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 487cd29d8bdae22af6c2ee897615279e92f77eb7 +Author: Aleksander Morgado +Date: Thu Jul 19 10:41:50 2012 +0200 + + hso: unsolicited %IPDPACT may come before the AT command reply + + plugins/option/mm-broadband-bearer-hso.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit c63f42a20cc26fb89bfbe5d14e9b2b4437f41102 +Author: Aleksander Morgado +Date: Thu Jul 19 10:41:09 2012 +0200 + + hso: plug memleak when finishing dialling with error + + plugins/option/mm-broadband-bearer-hso.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit b43ee56d067fae90809776b388a1fa335f508796 +Author: Aleksander Morgado +Date: Thu Jul 19 10:40:25 2012 +0200 + + hso: fix cid to report to + + plugins/option/mm-broadband-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e7715af875eb26517ae63e6e1db784b903da702e +Author: Dan Williams +Date: Tue Jul 17 15:49:05 2012 -0500 + + serial: fix AT port carriage return handling + + Off-by-one, fix it. + + src/mm-at-serial-port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2506e3093e9cc47bc03e34b0dd9c58c13469aec5 +Author: Aleksander Morgado +Date: Wed Jul 18 14:46:51 2012 +0200 + + api,header: add LTE specific bands in `MMModemBand' + + include/ModemManager-enums.h | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +commit d25f767559a9e558546c991cee1cb5ecdf037aec +Author: Aleksander Morgado +Date: Wed Jul 18 14:46:24 2012 +0200 + + api,header: fix description of `MMModemBand' + + It was a bitmask once... + + include/ModemManager-enums.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit f08c76f00cc52e672af8515440067b223e045a0c +Author: Dan Williams +Date: Tue Jul 17 11:58:35 2012 -0500 + + decode: handle another UsbSnoop URB function + + decode/packet.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 717977d0b5202c1d0a8cf2a16ae0500cc049a821 +Author: Ben Chan +Date: Mon Jul 16 22:23:55 2012 -0700 + + iface-modem-messaging: check if supported storage is allocated + before use + + load_supported_storages may fail, which results in unallocated storage + memory. This patch modifies load_initial_sms_parts_from_storages and + is_storage_supported to handle that gracefully. + + src/mm-iface-modem-messaging.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 431b6a0fc5da7e2c339f30b4993fa78bd83cbbe9 +Author: Aleksander Morgado +Date: Mon Jul 16 08:34:01 2012 +0200 + + broadband-modem: remove `USE_WS46' property + + 3GPP modems will all try to use AT+WS46=? by default to gather + supported modes. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 1 - + plugins/novatel/mm-broadband-modem-novatel.c | 1 - + src/mm-broadband-modem.c | 20 + -------------------- + src/mm-broadband-modem.h | 2 -- + 4 files changed, 24 deletions(-) + +commit 7ce65fe85d7a66cce1c4a507afe9968d811304c5 +Author: Aleksander Morgado +Date: Mon Jul 16 07:43:10 2012 +0200 + + broadband-modem: try to guess more specific 2G/3G/4G mode support + + For 3GPP modems, we'll try with AT+WS46=?, which is the standard + command to + query supported networks. If it returns error, we'll fallback to + the defaults. + + For CDMA modems, we'll try to gather CDMA1x and/or EV-DO support + directly from + the AT+GCAP response. + + src/mm-broadband-modem.c | 332 + ++++++++++++++++++++++++++++++----------------- + 1 file changed, 214 insertions(+), 118 deletions(-) + +commit f4ad5c805e9368babc126b92be89df0de431e830 +Author: Aleksander Morgado +Date: Fri Jul 13 19:07:56 2012 +0200 + + iface-modem-cdma: new steps to setup/cleanup unsolicited messages + + src/mm-iface-modem-cdma.c | 90 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 16 +++++++++ + 2 files changed, 106 insertions(+) + +commit 209f4d4420d531cf56fa7691977869bdd02a2d15 +Author: Aleksander Morgado +Date: Fri Jul 13 09:09:15 2012 +0200 + + iface-modem-[3gpp|cdma]: remove contexts with timeouts when shutting + down + + Following the same logic as in commit 9ddcf92a, those contexts in + the interface + which contain the setup of a timeout are cleared before removing + the DBus + skeleton objects, so that we make sure they are not fired out once + these have + been disposed. + + src/mm-iface-modem-3gpp.c | 8 ++++++++ + src/mm-iface-modem-cdma.c | 8 ++++++++ + 2 files changed, 16 insertions(+) + +commit 9ddcf92a18f94e4d4e38c2807311ad8518b5e9a7 +Author: Ben Chan +Date: Thu Jul 12 14:12:52 2012 -0700 + + iface-modem: fix crashes due to removed skeleton + + expire_signal_quality() / mm_iface_modem_update_access_technologies() + may be called after the DBus object skeleton is removed in + mm_iface_modem_shutdown() and before their associated timeout + source is + removed (in *_context_free) due to destruction of the modem object. + + This patch fixes the issue by removing context objects before removing + the DBus skeleton in mm_iface_modem_shutdown(). + + src/mm-iface-modem.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit 0519af932e5306ecb6c7ae7c37bc11ab1ffbd73f +Author: Ben Chan +Date: Thu Jul 12 08:28:16 2012 -0700 + + port-probe: fix crash in serial_probe_at_parse_response due to + NULL response + + When the serial port is not open, internal_queue_command + (mm-serial-port.c) invokes serial_probe_at_parse_response + (mm-port-probe.c) with a NULL response. This patch modifies + serial_probe_at_parse_response to handle NULL response properly. + + src/mm-port-probe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 107c78306ef9ff32dc0b3434cb0aa064df8f2233 +Author: Aleksander Morgado +Date: Fri Jun 29 13:28:59 2012 +0200 + + cli: fix showing revision when not multiline + + cli/mmcli-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 513abb2ccfe7215cf1195ec786f8d2e28533f7f2 +Author: Aleksander Morgado +Date: Wed Jun 27 15:38:28 2012 +0200 + + polkit: fix authority object disposal + + src/mm-auth-provider-polkit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cb881a2653575671d77c3b6d32d435819bc49fde +Author: Aleksander Morgado +Date: Tue Jun 26 12:15:40 2012 +0200 + + uml290: git-ignore generated program + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit 061b4d202c74aaef25ac926cdb991c96a19e5d2d +Author: Dan Williams +Date: Mon Jun 25 12:48:01 2012 -0500 + + decode: handle FUNCTION_CLASS_INTERFACE requests like CONTROL_TRANSFER + + The Novatel USB551L uses these to send data to the device, but + the data + is QMUX. + + decode/packet.py | 6 +++--- + decode/qmux.py | 4 ++++ + 2 files changed, 7 insertions(+), 3 deletions(-) + +commit d20f33b5c9bf0c187725d96e90acd673a120a409 +Author: Dan Williams +Date: Fri Jun 22 13:56:02 2012 -0500 + + trivial: fix format string + + uml290/uml290mode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 16d85f7b33b51beaf7c6155eb2d939c338b811f5 +Author: Dan Williams +Date: Fri Jun 22 12:06:08 2012 -0500 + + decode: update with latest QMI enums + + Since QC stopped distributing the database files, we can't easily + decode the TLV names unless we start parsing the C headers. + + decode/packet.py | 4 +- + decode/qmiprotgen.py | 108 + ++++++++++++++++++++++++++++++++++++++++++++++++-- + decode/qmiprotocol.py | 101 + ++++++++++++++++++++++++++++++++++++++++++++++ + decode/qmux.py | 16 ++++++-- + 4 files changed, 222 insertions(+), 7 deletions(-) + +commit ab5e9a49cffde9c640879e681f270cdfdacfbaca +Author: Dan Williams +Date: Wed Jun 6 11:40:47 2012 -0500 + + zte: try to handle Icera devices that use PPP + + Not all devices present a network interface, and on these devices + we need to fall back to PPP using the standard setup commands. But + they appear to support the Icera custom commands for access technology + and such, so still use those. + + Hopefully fixes ZTE MF665C. + + plugins/mm-modem-zte.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 4ac45ba0911a03ce83b748f977e6dabfb2e8907b +Author: Dan Williams +Date: Mon Jun 4 13:52:09 2012 -0500 + + uml290: allow setting more global modes + + uml290/uml290mode.c | 29 ++++++++++++++++++++++++----- + 1 file changed, 24 insertions(+), 5 deletions(-) + +commit 5337b2277ae38cb9becd21e2b1d9493c8644e939 +Author: Dan Williams +Date: Mon Jun 4 13:51:13 2012 -0500 + + qcdm: fix 1x/HDR mode pref and add GSM/UMTS mode prefs + + libqcdm/src/commands.h | 5 ++++- + libqcdm/src/nv-items.h | 5 ++++- + libqcdm/tests/test-qcdm-com.c | 9 +++++++++ + 3 files changed, 17 insertions(+), 2 deletions(-) + +commit 99b877ee6834fd41f57a9fd768d03f7319822de1 +Author: Dan Williams +Date: Wed May 30 12:11:25 2012 -0500 + + test: ignore ESN errors in info.py + + test/info.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit fcc4903a839a9b953ee2a9b2a2156c1ba50c4f1d +Author: Dan Williams +Date: Wed May 30 11:52:36 2012 -0500 + + trivial: whitespace fixes + + uml290/uml290mode.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit e7b1c48daf92ca85ce411b1f4efba52ae42b74a2 +Author: Dan Williams +Date: Wed May 30 11:47:10 2012 -0500 + + uml290: add mode switching tool + + Switches UML290 mode between 4G/LTE, 3G/EVDO/1X, and auto. + + Makefile.am | 2 +- + configure.ac | 1 + + uml290/Makefile.am | 10 ++ + uml290/uml290mode.c | 435 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 447 insertions(+), 1 deletion(-) + +commit 96166e4b7599f80a76f1cc776fb79cc5fdf55d26 +Author: Dan Williams +Date: Wed May 30 11:40:20 2012 -0500 + + wmc: namespace stuff properly + + libwmc/src/utils.c | 8 ++++---- + libwmc/src/utils.h | 8 ++++---- + libwmc/tests/test-wmc-crc.c | 4 ++-- + 3 files changed, 10 insertions(+), 10 deletions(-) + +commit 9fb8158279ce64bfbe626b7e36d08f77d2ce81c2 +Author: Dan Williams +Date: Wed May 30 11:39:23 2012 -0500 + + qcdm: namespace stuff properly + + libqcdm/src/errors.h | 6 +++--- + libqcdm/src/utils.c | 8 ++++---- + libqcdm/src/utils.h | 8 ++++---- + libqcdm/tests/test-qcdm-crc.c | 4 ++-- + 4 files changed, 13 insertions(+), 13 deletions(-) + +commit e5f787d36486f20d728378ce0bd4e5027c7405b3 +Author: Dan Williams +Date: Tue May 29 13:49:26 2012 -0500 + + wmc: add command for setting global mode + + libwmc/src/commands.c | 51 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + libwmc/src/commands.h | 6 ++++++ + 2 files changed, 57 insertions(+) + +commit 6fa3f0b0d7cb415ea642feda1e33462af7a941b1 +Author: Aleksander Morgado +Date: Thu May 24 09:59:00 2012 +0200 + + build: provide pkg-config files for ModemManager, libmm-common + and libmm-glib + + .gitignore | 4 +++- + configure.ac | 3 +++ + data/Makefile.am | 8 ++++++++ + data/ModemManager.pc.in | 9 +++++++++ + data/mm-common.pc.in | 11 +++++++++++ + data/mm-glib.pc.in | 11 +++++++++++ + 6 files changed, 45 insertions(+), 1 deletion(-) + +commit e582a22db7fdbbd187fd1631c1cab3712fe85763 +Author: Aleksander Morgado +Date: Thu May 24 09:57:04 2012 +0200 + + api: install common headers to ${prefix}/include/ModemManager + + ...instead of ${prefix}/include/mm + + include/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6bf277e7948b01062459fd6b7ea2ba40b022e248 +Author: Aleksander Morgado +Date: Thu May 24 09:56:23 2012 +0200 + + libmm-glib: install missing headers + + libmm-glib/Makefile.am | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 4ae13ef5d947bf7042f0d1028aade0a6172d651a +Author: Aleksander Morgado +Date: Thu May 24 09:56:15 2012 +0200 + + libmm-common: install missing header + + libmm-common/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 6d888e2e90928fae126392211f3e004dfdf77486 +Author: Jiří Klimeš +Date: Wed May 23 10:21:29 2012 +0200 + + dbus: remove 'max_replies_per_connection' limit from D-Bus + configuration + + It is leftover from times when D-Bus default limit was 32. Now, + it is 8192, see + http://cgit.freedesktop.org/dbus/dbus/commit/?id=8d3d8ff55739eebd84d0d53a20a025329feafc3b + + data/org.freedesktop.ModemManager1.conf.nopolkit | 2 -- + data/org.freedesktop.ModemManager1.conf.polkit | 2 -- + 2 files changed, 4 deletions(-) + +commit 9bee743a9d193373df82a93ef4fd159504d0763e +Author: Dan Williams +Date: Wed May 16 12:13:48 2012 -0500 + + vl600: add some reverse engineering docs and an AT com utility + + vl600/atcom.py | 147 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + vl600/vl600.txt | 38 +++++++++++++++ + 2 files changed, 185 insertions(+) + +commit df1f21d17f6923145926fba5be38cff947254cae +Author: Aleksander Morgado +Date: Sun May 6 18:53:03 2012 +0200 + + sms: fix setting multipart specific properties + + Don't make them construct-only, so that we can set them whenever + needed. + + src/mm-sms.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8a47621a5c7dd909e117033ca21f5fb3fa7ece9e +Author: Aleksander Morgado +Date: Sun May 6 18:48:59 2012 +0200 + + sms,tests: new test to check for multipart support in SMS parts + + src/tests/test-sms-part.c | 48 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +commit 97baa44b04ac90b25c792a6883fe6b7c49aa1f17 +Author: Aleksander Morgado +Date: Sun May 6 16:29:47 2012 +0200 + + novatel: report error if not properly disconnected + + When we request to disconnect, and the disconnection status check + fails, return + a proper error. + + plugins/novatel/mm-broadband-bearer-novatel.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit b2d376696c0e0d7eddf2cb67b0869cc6f20cf953 +Author: Aleksander Morgado +Date: Sun May 6 16:25:32 2012 +0200 + + novatel: minor coding style fixes + + plugins/novatel/mm-broadband-bearer-novatel.c | 83 + +++++++++++++++------------ + 1 file changed, 46 insertions(+), 37 deletions(-) + +commit 6b9ee7c83352bb545eab3352b32843a76cde9176 +Author: Tore Anderson +Date: Fri Apr 13 23:29:17 2012 +0200 + + broadband-bearer: derive PDP type from the ip-type bearer property + + This patch makes it possible to use MM to set up PDP contexts with + PDP types other than 'IP', which is particularly useful when trying + to use the 'IPV6' or 'IPV4V6' PDP types defined in recent 3GPP specs. + + If ip-type isn't specified, 'IP' will be used by default, due to the + fact that modem support for the 'IPV4V6' type is still rather scarce. + + The patch applies to Aleksander's 'bearer-properties' branch. It has + been tested using mmcli in this fashion: + + mmcli -m 0 --simple-connect=apn=internet # default to 'IP' + mmcli -m 0 --simple-connect=apn=internet,ip-type=IP + mmcli -m 0 --simple-connect=apn=internet,ip-type=IPV6 + mmcli -m 0 --simple-connect=apn=internet,ip-type=IPV4V6 + + libmm-common/mm-bearer-properties.c | 7 +++++++ + src/mm-broadband-bearer.c | 14 +++++++------- + 2 files changed, 14 insertions(+), 7 deletions(-) + +commit caeeae27219a91384fa41ac5a1e0f21e1edbaa76 +Author: Aleksander Morgado +Date: Mon Apr 2 20:25:18 2012 +0200 + + bearer: simplify handling of the bearer configuration + + The base MMBearer object will receive the MMBearerProperties + configuration, + which contains every generic and plugin-specific set up. Not every + configuration + parameter will be used by every implementation (e.g. not every + bearer needs + user/password). + + The Bearer object will expose every configuration parameter received + in its + `Properties' property in the interface, even if it's not really used. + + libmm-common/mm-bearer-properties.c | 16 ++ + libmm-common/mm-bearer-properties.h | 3 + + plugins/iridium/mm-bearer-iridium.c | 18 +- + plugins/iridium/mm-bearer-iridium.h | 3 +- + plugins/iridium/mm-broadband-modem-iridium.c | 5 +- + plugins/novatel/mm-broadband-bearer-novatel.c | 155 ++------------ + plugins/option/mm-broadband-bearer-hso.c | 148 +------------ + plugins/option/mm-broadband-bearer-hso.h | 5 +- + src/mm-bearer-list.c | 2 +- + src/mm-bearer.c | 71 ++++--- + src/mm-bearer.h | 20 +- + src/mm-broadband-bearer.c | 286 + ++++---------------------- + src/mm-broadband-bearer.h | 5 - + 13 files changed, 141 insertions(+), 596 deletions(-) + +commit 1984c155ad7dc488001a01d3c65fefc8002ac836 +Author: Aleksander Morgado +Date: Thu Apr 12 22:38:59 2012 +0200 + + wavecom: plugin fully ported + + plugins/mm-modem-wavecom-gsm.c | 1174 + ---------------------------------------- + plugins/mm-modem-wavecom-gsm.h | 45 -- + 2 files changed, 1219 deletions(-) + +commit 6c26e90610b1e657f1675d7c097dcb797735d56a +Author: Aleksander Morgado +Date: Thu Apr 12 22:35:58 2012 +0200 + + wavecom: implement custom band setting + + plugins/wavecom/mm-broadband-modem-wavecom.c | 212 + +++++++++++++++++++++++++-- + 1 file changed, 201 insertions(+), 11 deletions(-) + +commit 8b329c1012427f88ccedf61e4ed3d455db38baf4 +Author: Aleksander Morgado +Date: Wed Apr 11 23:59:41 2012 +0200 + + wavecom: setup custom serial parser + + AT+CPIN? replies come without trailing 'OK'; which we need to handle. + + plugins/wavecom/mm-broadband-modem-wavecom.c | 34 + ++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 43d7f4f17a77a19f3edbb32a7709aac609677cf1 +Author: Aleksander Morgado +Date: Wed Apr 11 23:54:15 2012 +0200 + + wavecom: implement custom current bands loading + + plugins/wavecom/mm-broadband-modem-wavecom.c | 191 + +++++++++++++++++++++++++++ + 1 file changed, 191 insertions(+) + +commit 513f5d5f207ce29263f95ff2e6762ede03a587b7 +Author: Aleksander Morgado +Date: Wed Apr 11 23:34:27 2012 +0200 + + wavecom: implement custom supported bands loading + + plugins/wavecom/mm-broadband-modem-wavecom.c | 61 + ++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit aeb38e0f30af3ea70186e647e88e47410bc8e053 +Author: Aleksander Morgado +Date: Wed Apr 11 23:18:39 2012 +0200 + + wavecom: implement custom access technology loading + + plugins/wavecom/mm-broadband-modem-wavecom.c | 78 + ++++++++++++++++++++++++++++ + 1 file changed, 78 insertions(+) + +commit 3885bb365daa9bd377df34b74fbfeb04f44b87a8 +Author: Aleksander Morgado +Date: Tue Apr 3 17:49:20 2012 +0200 + + wavecom: implement setting allowed/preferred modes + + plugins/wavecom/mm-broadband-modem-wavecom.c | 148 + +++++++++++++++++++++++++++ + 1 file changed, 148 insertions(+) + +commit 1447dfee3c6b62f0f3ac68d76637cc7deff04a1e +Author: Aleksander Morgado +Date: Tue Apr 3 16:50:39 2012 +0200 + + wavecom: implement loading of initial allowed/preferred modes + + plugins/wavecom/mm-broadband-modem-wavecom.c | 209 + +++++++++++++++++++++++++++ + 1 file changed, 209 insertions(+) + +commit 7bd2ba6973ef619d63ca89038ff7553d0ba11197 +Author: Aleksander Morgado +Date: Tue Apr 3 16:03:36 2012 +0200 + + wavecom: implement custom supported mode loading + + plugins/wavecom/mm-broadband-modem-wavecom.c | 100 + +++++++++++++++++++++++++++ + 1 file changed, 100 insertions(+) + +commit c3cc8f84104d14a1c5281312fb033644f4709329 +Author: Aleksander Morgado +Date: Tue Apr 3 15:39:02 2012 +0200 + + wavecom: implement custom power up sequence + + plugins/wavecom/mm-broadband-modem-wavecom.c | 95 + ++++++++++++++++++++++++++++ + 1 file changed, 95 insertions(+) + +commit 8ce1e26e1b37e2cf3bc652872a707b493ed657dc +Author: Aleksander Morgado +Date: Tue Apr 3 15:19:09 2012 +0200 + + wavecom: implement custom flow control handling + + plugins/wavecom/mm-broadband-modem-wavecom.c | 40 + +++++++++++++++++++++++----- + 1 file changed, 33 insertions(+), 7 deletions(-) + +commit 65b92dfba5131579be663f6b00140342d5b450e7 +Author: Aleksander Morgado +Date: Tue Apr 3 15:15:13 2012 +0200 + + wavecom: implement custom power down sequence + + plugins/wavecom/mm-broadband-modem-wavecom.c | 41 + +++++++++++++++++++++++++++- + 1 file changed, 40 insertions(+), 1 deletion(-) + +commit b7d423288a9fdf98bdc99426a7134e28aaf01471 +Author: Aleksander Morgado +Date: Tue Apr 3 12:42:07 2012 +0200 + + wavecom: start porting the Wavecom plugin + + plugins/Makefile.am | 21 ++-- + plugins/mm-plugin-wavecom.c | 168 + --------------------------- + plugins/wavecom/mm-broadband-modem-wavecom.c | 60 ++++++++++ + plugins/wavecom/mm-broadband-modem-wavecom.h | 50 ++++++++ + plugins/wavecom/mm-plugin-wavecom.c | 120 +++++++++++++++++++ + plugins/{ => wavecom}/mm-plugin-wavecom.h | 3 +- + 6 files changed, 243 insertions(+), 179 deletions(-) + +commit c7d39e2c2885fb69d354b47f921ef68e0c1c0615 +Author: Aleksander Morgado +Date: Thu Apr 12 22:35:08 2012 +0200 + + cinterion: simplify loop when loading 2G bands + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 90f4a034b203d08a3c1a04fcdb6bbbf16d982b7a +Author: Dan Williams +Date: Fri May 4 17:38:36 2012 -0500 + + modem-helpers: recognize 3GPP2 access tech strings too + + Various Gobi-based devices (USB551L, probably Gobis too) can report + EVDO and 1X as the current RAT from CNTI so parse that here too. + + plugins/gobi/mm-broadband-modem-gobi.c | 2 +- + src/mm-modem-helpers.c | 11 ++++++++++- + src/mm-modem-helpers.h | 2 +- + 3 files changed, 12 insertions(+), 3 deletions(-) + +commit 1e024c711abf303aa2ff53676ad1bbd3dfceb982 +Author: Dan Williams +Date: Fri May 4 17:19:20 2012 -0500 + + broadband-modem: add another Novatel +GCAP LTE response + + This time from the 551L. I wonder when they'll make up their minds + about what to return. + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit 1c1a6a16ec7c7eab81f4a9eb026982aa2d77e348 +Author: Nathan Williams +Date: Fri Apr 6 13:12:15 2012 -0400 + + novatel: Poll for whether the connection still exists. + + Novatel E362 firmware doesn't notify us by unsolicited message if the + connection goes away, so set up a polling loop to check. + + While here, inline a method that's only used in one place so that the + containing function is single-exit and single-cleanup. + + Change-Id: If72f7c6ef06de3fb22530d42f62a8dddc6fecfda + + plugins/novatel/mm-broadband-bearer-novatel.c | 112 + ++++++++++++++++++-------- + 1 file changed, 79 insertions(+), 33 deletions(-) + +commit 83bc51edcbc814f687d3653c841a2ff0040d4f6e +Author: Nathan Williams +Date: Wed Mar 21 17:31:46 2012 -0400 + + novatel: Add support for connecting to specific APNs and specifying + username/password. + + While here, pass through the other relevant bearer properties. + + Change-Id: If925ac78d2edcc744e834e108029f5abdbb375a1 + + plugins/novatel/mm-broadband-bearer-novatel.c | 177 + ++++++++++++++++++++++++-- + plugins/novatel/mm-broadband-bearer-novatel.h | 4 + + 2 files changed, 171 insertions(+), 10 deletions(-) + +commit 00cb8a26a829bd26ea7f1d953ebdbe657e85f83c +Author: Nathan Williams +Date: Fri Mar 23 14:05:40 2012 -0400 + + Add a utility routine to do ITU V.250 quoting of strings for AT + commands. + + BUG=chromium-os:27096,chromium-os:27063 + TEST=None + Change-Id: Ic1d24a9e4b7421db7f8d16c52535bd6d2780423e + + src/mm-at-serial-port.c | 26 ++++++++++++++++++++++++++ + src/mm-at-serial-port.h | 6 ++++++ + 2 files changed, 32 insertions(+) + +commit 67698b43c4c088fbd319de6f14914e958a0888d8 +Author: Nathan Williams +Date: Thu Mar 22 16:18:24 2012 -0400 + + novatel: Use the ALLOWED_SINGLE_AT property. Saves 5 seconds on + probing. + + Change-Id: I0b0c2cb07781eb32ba6eb4294868ed123f57fd9f + + plugins/novatel/mm-plugin-novatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 81665fe379268e234847e54824bc8ca63e1e3277 +Author: Nathan Williams +Date: Thu Apr 26 15:14:56 2012 -0400 + + novatel: Remove band-setting implementation to improve connections + + The $NWBAND command seems to disturb the internal state of the modem + such that it is unlikely to connect to the network, and produces + widely varying error codes. We don't actively use this functionality, + it's just that setting "use all bands" is part of the normal + ModemManager simple-connect sequence. Remove it so it doesn't get + triggered. + + Change-Id: I9b5914291a88a59015fb51906af6fd1c78f3952b + + plugins/novatel/mm-broadband-modem-novatel.c | 66 + +--------------------------- + 1 file changed, 1 insertion(+), 65 deletions(-) + +commit baa64257265194c5fcf2c0e2f21e9072e089f4b0 +Author: Nathan Williams +Date: Fri Mar 23 17:18:22 2012 -0400 + + novatel: Implement load_access_technologies. + + Change-Id: Ib503d900850d3754d79525dbc9a40b7b9c221dd7 + + plugins/novatel/mm-broadband-modem-novatel.c | 79 + ++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit 0f324de94f7bebc566a3bc6ae8e31e9569a3dfdb +Author: Dan Williams +Date: Tue Apr 24 13:34:16 2012 -0500 + + decode: recognize another UsbSnoop packet type + + decode/packet.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit e8bc2f41e710ed9e3a2576538f5c9fe74b7ef6db +Author: Aleksander Morgado +Date: Sat Apr 14 16:03:08 2012 +0200 + + simtech: implement custom allowed/preferred mode setting + + plugins/simtech/mm-broadband-modem-simtech.c | 134 + +++++++++++++++++++++++++++ + 1 file changed, 134 insertions(+) + +commit b97890a0123253e87ecd14a3836582ed6f1a68ee +Author: Aleksander Morgado +Date: Fri Apr 13 23:24:04 2012 +0200 + + simtech: plugin fully ported + + plugins/mm-modem-simtech-gsm.c | 495 + ----------------------------------------- + plugins/mm-modem-simtech-gsm.h | 45 ---- + 2 files changed, 540 deletions(-) + +commit 9e89e88ce938487d94e1054347f9f7dd6fc973f6 +Author: Aleksander Morgado +Date: Fri Apr 13 21:26:36 2012 +0200 + + simtech: implement custom allowed/preferred mode loading + + plugins/simtech/mm-broadband-modem-simtech.c | 201 + +++++++++++++++++++++++++++ + 1 file changed, 201 insertions(+) + +commit c9214bd54ff3445be99c78d04102b92012b7b377 +Author: Aleksander Morgado +Date: Fri Apr 13 21:00:53 2012 +0200 + + simtech: implement custom access technology loading + + plugins/simtech/mm-broadband-modem-simtech.c | 93 + ++++++++++++++++++++++++++++ + 1 file changed, 93 insertions(+) + +commit 281cada39de64b23e94c9c017b31798e9d2f7578 +Author: Aleksander Morgado +Date: Fri Apr 13 20:38:12 2012 +0200 + + simtech: implement custom unsolicited events enabling/disabling + + plugins/simtech/mm-broadband-modem-simtech.c | 163 + +++++++++++++++++++++++++++ + 1 file changed, 163 insertions(+) + +commit 1cea1e5bbe46e4955f8920ed21049bd207082211 +Author: Aleksander Morgado +Date: Fri Apr 13 20:30:12 2012 +0200 + + simtech: implement custom unsolicited events setup/cleanup + + plugins/simtech/mm-broadband-modem-simtech.c | 188 + ++++++++++++++++++++++++++- + 1 file changed, 187 insertions(+), 1 deletion(-) + +commit 8cd4b29fde4577baa2ca0ec9bb81d2682d70aa03 +Author: Aleksander Morgado +Date: Fri Apr 13 20:09:23 2012 +0200 + + simtech: new `MMBroadbandModemSimtech' object + + plugins/Makefile.am | 4 +- + plugins/simtech/mm-broadband-modem-simtech.c | 69 + ++++++++++++++++++++++++++++ + plugins/simtech/mm-broadband-modem-simtech.h | 49 ++++++++++++++++++++ + plugins/simtech/mm-plugin-simtech.c | 12 ++--- + 4 files changed, 127 insertions(+), 7 deletions(-) + +commit ba7761f6648fc015ec76074dfa832ba921070dfd +Author: Aleksander Morgado +Date: Fri Apr 13 20:04:08 2012 +0200 + + simtech: include udev rules + + plugins/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit 43be521ef6220c0587e6f76dbc3a1f368acb98de +Author: Aleksander Morgado +Date: Fri Apr 13 20:03:43 2012 +0200 + + build: split includes for plugin specific udev rules + + Let each plugin block include its own udev rules, instead of having + them all + together at the end of the Makefile. + + plugins/Makefile.am | 11 +++++------ + plugins/{ => simtech}/77-mm-simtech-port-types.rules | 0 + 2 files changed, 5 insertions(+), 6 deletions(-) + +commit 7183216d9de52686db6276a108478c5890e2b365 +Author: Aleksander Morgado +Date: Fri Apr 13 19:59:39 2012 +0200 + + simtech: start porting the SimTech plugin + + plugins/Makefile.am | 17 ++- + plugins/mm-plugin-simtech.c | 202 + ------------------------------ + plugins/simtech/mm-plugin-simtech.c | 139 ++++++++++++++++++++ + plugins/{ => simtech}/mm-plugin-simtech.h | 3 +- + 4 files changed, 149 insertions(+), 212 deletions(-) + +commit 01a17f5c6c322f116e0a20647d3b9f2dc0276fef +Author: Nathan Williams +Date: Fri Apr 13 10:50:34 2012 -0400 + + helpers: adjust parsing of +CNUM response to permit spaces in the + alphanumeric descriptor. + + This permits matching a response such as '"Line + 1","+19999999999",145', + which previously did not match. + + Change-Id: I666af8774507c6c3b3e214b820449542065dd8b4 + + src/mm-modem-helpers.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit a07220650b7636fe1376d15580bab311710379ff +Author: Nathan Williams +Date: Fri Apr 13 11:19:45 2012 -0400 + + libmm-glib,modem: mm_modem_{get,dup}_own_numbers(): fix inverted + logic. + + The string vector test was reversed, causing valid vectors not to be + returned, and commands like mmcli to not display own numbers from a + modem. + + Change-Id: Ia889f49f18511a2dfcdbc71a80ee0239a6c912e0 + + libmm-glib/mm-modem.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit d379b9ea2a1c7ee559878609fd1c14bfc7ae7b83 +Author: Aleksander Morgado +Date: Tue Apr 10 23:24:19 2012 +0200 + + bearer: allow subclasses to report disconnection + + The new `mm_bearer_report_disconnection()' allows subclasses to + notify about + being disconnected, so that every layer of inheritance can chain + its own code + to reset the connection status. + + This commit partially disables the logic included in commit + 981222. Now + subclasses (actually, no one) are not allowed to g_object_set() the + MM_BEARER_STATUS property. + + plugins/option/mm-broadband-bearer-hso.c | 4 +-- + src/mm-bearer.c | 28 +++++++++++++++------ + src/mm-bearer.h | 5 ++++ + src/mm-broadband-bearer.c | 42 + ++++++++++++++++++++++++-------- + 4 files changed, 59 insertions(+), 20 deletions(-) + +commit dac1021e4c4c52989fa74247b17a610813281f81 +Author: Aleksander Morgado +Date: Tue Apr 10 17:45:06 2012 +0200 + + cinterion: no need for custom supported modes loading + + plugins/cinterion/mm-broadband-modem-cinterion.c | 134 + +++-------------------- + 1 file changed, 13 insertions(+), 121 deletions(-) + +commit 83afd3ddc9a81321233065d4ff17fa620faf8ca6 +Author: Aleksander Morgado +Date: Tue Apr 10 17:25:34 2012 +0200 + + iface-modem: new helpers to query supported modes + + src/mm-iface-modem.c | 65 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 9 ++++++++ + 2 files changed, 74 insertions(+) + +commit e89a8a42a9c382f9471f14a5016afef8fb5eae36 +Author: Aleksander Morgado +Date: Tue Apr 10 17:20:50 2012 +0200 + + novatel: no need for custom supported modes loading + + plugins/novatel/mm-broadband-modem-novatel.c | 96 + +--------------------------- + 1 file changed, 1 insertion(+), 95 deletions(-) + +commit bc0d9ddf5fc5168e3a192c6cadf86823c2cc7040 +Author: Aleksander Morgado +Date: Tue Apr 10 17:20:32 2012 +0200 + + broadband-modem: query supported networks to get a better supported + modes value + + If we base our supported modes default guessing only on capabilities + listed by + AT+GCAP, we find that we don't know how to differenciate between 2G + and 3G 3GPP + modems. So, if supported, we will try to query the list of supported + networks + with AT+WS46=?, which explicitly tells us if the modem supports + GERAN and/or + UTRAN and/or E-UTRAN. Note that plugins need to request this new + behaviour by + setting the `MM_BROADBAND_MODEM_USE_WS46' property to TRUE when + creating the + modem object. + + src/mm-broadband-modem.c | 147 + ++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-broadband-modem.h | 2 + + 2 files changed, 142 insertions(+), 7 deletions(-) + +commit b49ddfe9300429cee5f5648582be01c541df2c82 +Author: Aleksander Morgado +Date: Tue Apr 10 17:17:42 2012 +0200 + + iface-modem: skip handling the CURRENT_CAPABILITIES property + + It is an unnecessary complication, as long as we can keep the helpers + in the interface. + + src/mm-broadband-modem.c | 21 ++------ + src/mm-iface-modem.c | 121 + +++++++++++++++++------------------------------ + src/mm-iface-modem.h | 26 +++++----- + 3 files changed, 58 insertions(+), 110 deletions(-) + +commit 9812225d93da8a257ae85c9737afdd2b1d9cfda6 +Author: Aleksander Morgado +Date: Tue Apr 10 10:46:10 2012 +0200 + + bearer: always reset interface state when going into disconnected + status + + Custom bearer implementations in Plugins are allowed to g_object_set() + the + MM_BEARER_STATUS property to DISCONNECTED in order to notify that + the bearer got + disconnected. We need to always reset the interface state (remove + IP config, set + connected=FALSE,...) also in that case. + + Also consolidated in some helper private functions the way the bearer + status is + updated. + + src/mm-bearer.c | 120 + +++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 76 insertions(+), 44 deletions(-) + +commit 8d4a549e613a76c9f6899ad890fd3410db4cb16f +Author: Aleksander Morgado +Date: Mon Apr 2 15:38:56 2012 +0200 + + TODO: GPS location implemented already + + TODO | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +commit f183a5d73d11b9941affccecc1ae110ec36d5b7d +Author: Aleksander Morgado +Date: Sat Mar 31 14:56:54 2012 +0200 + + iridium: remove previous modem implementation + + plugins/mm-modem-iridium-gsm.c | 517 + ----------------------------------------- + plugins/mm-modem-iridium-gsm.h | 45 ---- + 2 files changed, 562 deletions(-) + +commit c2a096f9a13dd374ff80dff338c7e4059300c8c6 +Author: Aleksander Morgado +Date: Sat Mar 31 14:54:27 2012 +0200 + + linktop: plugin fully ported + + plugins/Makefile.am | 21 +-- + plugins/linktop/mm-broadband-modem-linktop.c | 238 + +++++++++++++++++++++++++++ + plugins/linktop/mm-broadband-modem-linktop.h | 49 ++++++ + plugins/linktop/mm-plugin-linktop.c | 122 ++++++++++++++ + plugins/{ => linktop}/mm-plugin-linktop.h | 3 +- + plugins/mm-modem-linktop.c | 193 ---------------------- + plugins/mm-modem-linktop.h | 45 ----- + plugins/mm-plugin-linktop.c | 169 ------------------- + 8 files changed, 422 insertions(+), 418 deletions(-) + +commit cfeebcd63a392eb27a44095efa83b3d487ee5f6d +Author: Aleksander Morgado +Date: Fri Mar 30 16:18:48 2012 +0200 + + manager: no need to remove modems in idle + + There is no problem in getting the modem removed just after + finishing the + disabling sequence. + + src/mm-manager.c | 24 +----------------------- + 1 file changed, 1 insertion(+), 23 deletions(-) + +commit 3094e3f26b3b369f4b29fe54a8c4692bb611014d +Author: Aleksander Morgado +Date: Fri Mar 30 16:11:55 2012 +0200 + + manager: try to get all modems disabled before while shutting down + + src/mm-broadband-modem.c | 10 ++++------ + src/mm-manager.c | 39 ++++++++++++++++++--------------------- + 2 files changed, 22 insertions(+), 27 deletions(-) + +commit 8c84aea3f0ca03dee98efa854a2862c1c36b6c04 +Author: Aleksander Morgado +Date: Fri Mar 30 16:11:14 2012 +0200 + + base-modem: disconnect internal cancellable handler while disposing + + src/mm-base-modem.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit b68461c417172c69bdad74b0e3526037ae5916d4 +Author: Aleksander Morgado +Date: Fri Mar 30 16:09:27 2012 +0200 + + base-modem: plug small leaks + + src/mm-base-modem.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit a416f6eaea7ef862eca72c6319c2e4eb52fbae90 +Author: Aleksander Morgado +Date: Fri Mar 30 13:53:24 2012 +0200 + + docs: document MM_PLUGIN_BASE_ALLOWED_SINGLE_AT + + docs/reference/api/ModemManager-overview.xml | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +commit b03541b1fe92513afefcacbaeff38cca433a74e6 +Author: Aleksander Morgado +Date: Fri Mar 30 13:30:48 2012 +0200 + + plugin-base: don't setup udev client notifications + + src/mm-plugin-base.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 0372e73abd413c94791e9a7f8f88f3acaf533c06 +Author: Aleksander Morgado +Date: Fri Mar 30 13:12:22 2012 +0200 + + port-probe-cache: ensure we cleanup every possible leftover + + src/mm-manager.c | 3 ++- + src/mm-port-probe-cache.c | 27 +++++++++++++++++---------- + src/mm-port-probe-cache.h | 3 ++- + 3 files changed, 21 insertions(+), 12 deletions(-) + +commit 94d46a43877107f9b558946a2f5dff0d95f02ca5 +Author: Aleksander Morgado +Date: Fri Mar 30 13:11:41 2012 +0200 + + plugin-base: plug memleak + + src/mm-plugin-base.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 7518772d4bcb5f6a2c5d4fcf33346e1036625755 +Author: Aleksander Morgado +Date: Fri Mar 30 11:06:32 2012 +0200 + + core: fatal errors in iface initializations force the modem into a + FAILED state + + Modems which end up being found unusable (e.g. no SIM, fatal SIM + error, no + capabilities) will be exposed in DBus, but just with the Modem + interface and + in a FAILED state which allows no actions. + + include/ModemManager-enums.h | 2 + + .../org.freedesktop.ModemManager1.Modem.xml | 6 +- + src/mm-base-modem.c | 18 +- + src/mm-broadband-modem.c | 139 ++++++++---- + src/mm-iface-modem-3gpp.c | 22 +- + src/mm-iface-modem-cdma.c | 20 +- + src/mm-iface-modem.c | 245 + ++++++++------------- + 7 files changed, 223 insertions(+), 229 deletions(-) + +commit 3b366118b66bb27642a72adb49ceafaab5b6da5d +Author: Aleksander Morgado +Date: Fri Mar 30 10:25:33 2012 +0200 + + simple: need to wait to get fully initialized before trying to enable + + src/mm-iface-modem-simple.c | 86 + +++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 84 insertions(+), 2 deletions(-) + +commit 374c028b16e00881d7da1d19490ef9be434bbb3e +Author: Aleksander Morgado +Date: Fri Mar 30 08:20:38 2012 +0200 + + broadband: reload operator and registration info only when enabling + 3GPP location source + + src/mm-broadband-modem.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 0d8cf160e5083b9f1433534b218490b7a1b5ce55 +Author: Aleksander Morgado +Date: Thu Mar 29 17:20:37 2012 +0200 + + broadband: ensure 3GPP location info gets updated when enabling + the source + + Whenever 3GPP location source gets enabled, we'll launch new + registration status + checks (to get updated LAC/CI) and new operator code/name checks + (to get updated + MCC/MNC). + + Additional changes were needed in the HSO plugin, so that the + specific location + gathering enabling implemented by the HSO modem chains up parent's + one first. + + plugins/option/mm-broadband-modem-hso.c | 121 + ++++++++++++++++++++++---------- + src/mm-broadband-modem.c | 42 +++++++++++ + 2 files changed, 125 insertions(+), 38 deletions(-) + +commit 3cea187a9449c3aefe0a1a381a9477c6aff83745 +Author: Aleksander Morgado +Date: Thu Mar 29 17:17:52 2012 +0200 + + location: update the status before running enabling/disabling + sequences + + This will allow implementations of location source enabling to + actually update + the location information during the enabling phase. + + src/mm-iface-modem-location.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit 43bd3f95ae7c8130a61239e45430319ccde131c0 +Author: Aleksander Morgado +Date: Thu Mar 29 17:16:38 2012 +0200 + + 3gpp: let operator name/code reloading be requested by implementations + + src/mm-iface-modem-3gpp.c | 60 + +++++++++++++++++++++++++++++++++-------------- + src/mm-iface-modem-3gpp.h | 3 +++ + 2 files changed, 45 insertions(+), 18 deletions(-) + +commit dc376bb725a970c654610a21ebe55c53870ae249 +Author: Aleksander Morgado +Date: Thu Mar 29 17:15:48 2012 +0200 + + 3gpp: errors when reloading operator name/code will reset the values + in the interface + + src/mm-iface-modem-3gpp.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit bb2f9b672c397f53a74b9278152bd01feab1b27b +Author: Aleksander Morgado +Date: Thu Mar 29 16:10:07 2012 +0200 + + broadband-modem: remove unused variable + + src/mm-broadband-modem.c | 1 - + 1 file changed, 1 deletion(-) + +commit b80fdfdaa8017eeb155f72c99f47492eb87c2d6e +Author: Aleksander Morgado +Date: Wed Mar 28 15:22:39 2012 +0200 + + iface-modem-location: plug memleak and reference count mismatch + + src/mm-iface-modem-location.c | 1 + + 1 file changed, 1 insertion(+) + +commit f1d4e0fb637bd9c3f5ad72c22cb5a716c3e669c8 +Author: Aleksander Morgado +Date: Wed Mar 28 15:15:12 2012 +0200 + + mmcli: prefix all NMEA traces in order to get a pretty print + + cli/mmcli-common.c | 38 ++++++++++++++++++++++++++++++++++++++ + cli/mmcli-common.h | 3 +++ + cli/mmcli-modem-location.c | 9 ++++++--- + cli/mmcli-modem.c | 42 + ++---------------------------------------- + 4 files changed, 49 insertions(+), 43 deletions(-) + +commit 422ed7b63331d1cbf8f58dcc694404bbb8b4a335 +Author: Aleksander Morgado +Date: Wed Mar 28 15:11:53 2012 +0200 + + libmm-common,location-gps-nmea: ensure traces get separated with \r\n + + libmm-common/mm-location-gps-nmea.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +commit 4bc990ce7678117bf3ecba6646e0df06d03c0f2f +Author: Aleksander Morgado +Date: Wed Mar 28 14:05:38 2012 +0200 + + mmcli: new actions to request gps-specific or all available locations + + cli/mmcli-modem-location.c | 187 + ++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 149 insertions(+), 38 deletions(-) + +commit 3dd00345604d2c1f72cd2174b092997e9e969e93 +Author: Aleksander Morgado +Date: Wed Mar 28 14:02:16 2012 +0200 + + libmm-glib: provide extended getters for location information objects + + The user can now query for all location information with + `mm_modem_location_get_full()', or just for specific location + sources with + `mm_modem_location_get_3gpp()', `mm_modem_location_get_gps_nmea()' or + `mm_modem_location_get_gps_raw()'. + + libmm-glib/mm-modem-location.c | 166 + +++++++++++++++++++++++++++++++++++------ + libmm-glib/mm-modem-location.h | 40 ++++++++++ + 2 files changed, 182 insertions(+), 24 deletions(-) + +commit 3f7a6fe31b3fbcec493ba6a1ab97e766ebec7edc +Author: Aleksander Morgado +Date: Wed Mar 28 14:00:47 2012 +0200 + + libmm-common,location-gps-raw: fix check looking for mandatory + parameters + + libmm-common/mm-location-gps-raw.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 19d53751a2cca0ecd2d6b60813076db08fb4bd52 +Author: Aleksander Morgado +Date: Wed Mar 28 14:00:21 2012 +0200 + + libmm-common,location-gps-raw: don't build dictionary if mandatory + parameters missing + + libmm-common/mm-location-gps-raw.c | 45 + +++++++++++++++++++------------------- + 1 file changed, 23 insertions(+), 22 deletions(-) + +commit 9116a58eb6bcfa81a10a53f8863ef240e74c7e97 +Author: Aleksander Morgado +Date: Wed Mar 28 12:43:19 2012 +0200 + + mmcli: allow multiple location source enabling/disabling commands + + For example, we do allow: + mmcli -m 0 --enable-location-gps-nmea --disable-location-gps-raw + + All the options get merged into a single Setup() call in the Location + interface. + + cli/mmcli-modem-location.c | 207 + ++++++++++++++++----------------------------- + 1 file changed, 75 insertions(+), 132 deletions(-) + +commit ad8a40f8aa26d8a4b92b275f01dd015425f817d8 +Author: Aleksander Morgado +Date: Wed Mar 28 11:27:47 2012 +0200 + + api,dbus: update the fields retrievable in the raw GPS location source + + Currently just provide the time of measurement, latitude, longitude + and + altitude. + + .../org.freedesktop.ModemManager1.Modem.Location.xml | 17 + ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +commit 2bf61649d81fc1f9821f467454fe29a5b1ced15c +Author: Aleksander Morgado +Date: Wed Mar 28 11:25:44 2012 +0200 + + libmm-common,tests: new unit tests for the numeric field parsers + + libmm-common/tests/test-common-helpers.c | 146 + +++++++++++++++++++++++++++++++ + 1 file changed, 146 insertions(+) + +commit e00705c20349cf936d2a732942f0edd9103a4b51 +Author: Aleksander Morgado +Date: Wed Mar 28 11:25:22 2012 +0200 + + libmm-common,helpers: additional checks in the string to number + converters + + We won't allow NULL, empty, or strings with non-digits. + + libmm-common/mm-common-helpers.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +commit 71e108fd64174e76502408d59b124387616a5270 +Author: Aleksander Morgado +Date: Wed Mar 28 10:50:31 2012 +0200 + + hso: include support for the raw GPS location source + + plugins/option/mm-broadband-modem-hso.c | 39 + +++++++++++++++++++++++++++------ + 1 file changed, 32 insertions(+), 7 deletions(-) + +commit 33e569bbabcf56c49d444043acdb247ac6244cef +Author: Aleksander Morgado +Date: Wed Mar 28 09:40:06 2012 +0200 + + iface-modem-location: handle the raw GPS location source + + src/mm-iface-modem-location.c | 74 + ++++++++++++++++++++++++++++++++++++------- + 1 file changed, 62 insertions(+), 12 deletions(-) + +commit 423c4a9d6712a5bc6e71bd77ddd6753b2f309570 +Author: Aleksander Morgado +Date: Wed Mar 28 09:27:04 2012 +0200 + + libmm-common: new helper `MMModemLocationGpsRaw' object + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-location-gps-raw.c | 334 + +++++++++++++++++++++++++++++++++++++ + libmm-common/mm-location-gps-raw.h | 70 ++++++++ + 4 files changed, 409 insertions(+) + +commit bf4208246609a6b2a71d9c51696fbb9283871d55 +Author: Aleksander Morgado +Date: Wed Mar 28 09:26:39 2012 +0200 + + libmm-common: new helpers to parse doubles from strings or match infos + + libmm-common/mm-common-helpers.c | 32 ++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 5 +++++ + 2 files changed, 37 insertions(+) + +commit ee8afd8034f47f2f17ae042a2efe16034556dcf4 +Author: Aleksander Morgado +Date: Tue Mar 27 17:59:22 2012 +0200 + + libmm-common,location-gps-nmea: allow sequences of traces + + Some traces, e.g. $GPGSV, are part of a sequence. For those traces, + we'll try + to always keep the whole sequence around, not just the last received + trace. + + libmm-common/mm-location-gps-nmea.c | 46 + +++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 614a5473164418e6392e80e7f3d14777e39a6d0e +Author: Aleksander Morgado +Date: Tue Mar 27 17:16:13 2012 +0200 + + hso: report received NMEA traces + + plugins/option/mm-broadband-modem-hso.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +commit 53b500c11dc648cff834be2885886f5e575046e4 +Author: Aleksander Morgado +Date: Tue Mar 27 17:15:57 2012 +0200 + + iface-modem-location: handle the NMEA-based GPS location source + + src/mm-iface-modem-location.c | 153 + +++++++++++++++++++++++++++++++++++++----- + src/mm-iface-modem-location.h | 4 ++ + 2 files changed, 140 insertions(+), 17 deletions(-) + +commit 0012b7118656afd127097d3cbfa27e9190cedd47 +Author: Aleksander Morgado +Date: Tue Mar 27 16:33:25 2012 +0200 + + libmm-common: new helper `MMModemLocationGpsNmea' object + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-location-gps-nmea.c | 189 + ++++++++++++++++++++++++++++++++++++ + libmm-common/mm-location-gps-nmea.h | 61 ++++++++++++ + 4 files changed, 255 insertions(+) + +commit 20721906913805a645ab2c66b5e6224b2bde6a88 +Author: Aleksander Morgado +Date: Tue Mar 27 12:24:58 2012 +0200 + + hso: open/close the raw GPS port when we enable/disable GPS gathering + + plugins/option/mm-broadband-modem-hso.c | 51 + +++++++++++++++++++++++++++++---- + 1 file changed, 46 insertions(+), 5 deletions(-) + +commit 97f779df1e2d5dfd82aea1084edf018c5fe5c9e5 +Author: Aleksander Morgado +Date: Tue Mar 27 12:24:29 2012 +0200 + + hso: ensure GPS is disabled when we initialize the modem + + plugins/option/mm-broadband-modem-hso.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 1cfab89719c29b6019070fb40126bb8c95c5ee4a +Author: Aleksander Morgado +Date: Tue Mar 27 11:24:06 2012 +0200 + + base-modem: use new `MMGpsSerialPort' type for the raw GPS port + + src/mm-base-modem.c | 15 +++++++-------- + src/mm-base-modem.h | 5 +++-- + 2 files changed, 10 insertions(+), 10 deletions(-) + +commit a0b3663274f9e22a9a74267c0b1748613bc34999 +Author: Aleksander Morgado +Date: Tue Mar 27 11:21:06 2012 +0200 + + gps-serial-port: new type to handle read-only serial ports with + GPS traces + + src/Makefile.am | 4 +- + src/mm-gps-serial-port.c | 218 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-gps-serial-port.h | 57 +++++++++++++ + 3 files changed, 278 insertions(+), 1 deletion(-) + +commit 2bd321489dc2dd51ee0de7784be00e0f31a1f848 +Author: Aleksander Morgado +Date: Tue Mar 27 10:56:55 2012 +0200 + + mmcli: new `--location-enable-gps' and `--location-disable-gps' + actions + + cli/mmcli-modem-location.c | 68 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 68 insertions(+) + +commit ab9363011ad2d6619d45e81ca9eb0b9a9ae9e013 +Author: Aleksander Morgado +Date: Tue Mar 27 10:56:23 2012 +0200 + + hso: enable/disable GPS location gathering + + plugins/option/mm-broadband-modem-hso.c | 97 + +++++++++++++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + +commit 335ba97f48f00b2bf8bf97f4aec87de25f77d8c6 +Author: Aleksander Morgado +Date: Tue Mar 27 09:48:34 2012 +0200 + + hso: include custom location capabilities loading + + Will check for GPS location sources. + + plugins/option/mm-broadband-modem-hso.c | 90 + ++++++++++++++++++++++++++++++++- + 1 file changed, 89 insertions(+), 1 deletion(-) + +commit 6d50e5195fe0e98dfd928e6f0dec3d28f78827e7 +Author: Aleksander Morgado +Date: Mon Mar 26 21:24:22 2012 +0200 + + serial-port: forced close only to be done once + + src/mm-serial-port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit a69b4d2451c11bf277d37c20e2e58b37c3986a80 +Author: Aleksander Morgado +Date: Mon Mar 26 20:29:14 2012 +0200 + + mmcli: new `--location-status' to show supported and enabled location + sources + + cli/mmcli-modem-location.c | 45 + ++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 44 insertions(+), 1 deletion(-) + +commit ceefa2c356ae270c7dda4b5e771d225502d4913d +Author: Aleksander Morgado +Date: Mon Mar 26 19:24:25 2012 +0200 + + location: rework to allow multiple location sources + + Location sources can now be enabled or disabled by using the mask + of sources + given in Setup() (similar previous Enable()). + + cli/mmcli-modem-location.c | 77 +-- + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 25 +- + libmm-glib/mm-modem-location.c | 87 ++-- + libmm-glib/mm-modem-location.h | 39 +- + src/mm-iface-modem-location.c | 515 + +++++++++++++++------ + src/mm-iface-modem-location.h | 2 + + 6 files changed, 478 insertions(+), 267 deletions(-) + +commit 090e3492095cf6d663bfb3f83b3ed0cb19121f1a +Author: Aleksander Morgado +Date: Mon Mar 26 16:37:22 2012 +0200 + + hso: grab GPS-specific ports + + plugins/option/mm-plugin-hso.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit be633fd66bbbdf962a8883d445926b9d1ee3c9ff +Author: Aleksander Morgado +Date: Mon Mar 26 16:37:03 2012 +0200 + + base-modem: handle GPS control and data ports + + Plugin may specify GPS-specific port tyeps when requesting to grab + the port. + These could either be an AT-based GPS control port, or the raw GPS + serial port + which emits the NMEA traces. + + src/mm-base-modem.c | 66 + +++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-base-modem.h | 28 ++++++++++++----------- + src/mm-port.h | 3 ++- + 3 files changed, 79 insertions(+), 18 deletions(-) + +commit b19f97ae7dbbe38f1613c978a5760ac05e0bd72f +Author: Aleksander Morgado +Date: Mon Mar 26 16:28:28 2012 +0200 + + port: new `MM_PORT_TYPE_NET' for pure net devices + + Net devices will be MMPorts of type MM_PORT_TYPE_NET. + + src/mm-base-modem.c | 21 ++++++++++++++++----- + src/mm-port-probe.c | 2 +- + src/mm-port.h | 1 + + 3 files changed, 18 insertions(+), 6 deletions(-) + +commit 3b481cf17f7c28edd58da87f3f0a0373f7c03131 +Author: Aleksander Morgado +Date: Mon Mar 26 16:24:50 2012 +0200 + + base-modem: no need for `port_grabbed()' + + Subclasses can configure additional stuff in the ports just after + all have been + organized, in the SETUP_PORTS initialization step in MMBroadbandModem. + + src/mm-base-modem.c | 4 ---- + src/mm-base-modem.h | 6 ------ + 2 files changed, 10 deletions(-) + +commit 8dfbf195c1e7a8d25f1250e913be283ac3269bb2 +Author: Aleksander Morgado +Date: Mon Mar 26 16:01:40 2012 +0200 + + port: skip LAST enums in glib-mkenums processing + + src/mm-port.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 68421638f5c700cad8ae9fe105b94ea8e3733841 +Author: Aleksander Morgado +Date: Mon Mar 26 15:47:19 2012 +0200 + + at-serial-port: new flag to define the GPS control port + + src/mm-at-serial-port.c | 7 +++++-- + src/mm-at-serial-port.h | 10 ++++++---- + 2 files changed, 11 insertions(+), 6 deletions(-) + +commit 79c93f4333868fc7aedaf1bf1302c2a00fc67d1c +Author: Aleksander Morgado +Date: Mon Mar 26 15:46:25 2012 +0200 + + at-serial-port: define flags by shifting bits + + Otherwise glib-mkenums doesn't take the enumeration as being flags. + + src/mm-at-serial-port.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 62923f9086c80412f95a79c3a3148933837e74c9 +Author: Aleksander Morgado +Date: Wed Mar 28 15:13:05 2012 +0200 + + serial-port: ensure we close the port when forcing to close it + + src/mm-serial-port.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit b8157228eb0e7196e32d1f4b7c64afd028a5542e +Author: Aleksander Morgado +Date: Wed Mar 28 15:14:04 2012 +0200 + + broadband-modem: plug memleak when uppercasing storage names + + src/mm-broadband-modem.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 029cb2abe9ada012838e960c382d2fae232fbb5e +Author: Aleksander Morgado +Date: Wed Mar 28 15:13:38 2012 +0200 + + broadband-modem: plug memleak when building AT command + + src/mm-broadband-modem.c | 1 + + 1 file changed, 1 insertion(+) + +commit f0b02ce321a247b81ad4f2ec3b97525739be6ec2 +Author: Aleksander Morgado +Date: Wed Mar 28 15:14:42 2012 +0200 + + hso: plug small memleak when building devfile + + Why do we need the devfile anyway? + + plugins/option/mm-plugin-hso.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit b29eb54080aeefbab838b523890af0eee567d948 +Author: Aleksander Morgado +Date: Wed Mar 28 15:47:38 2012 +0200 + + sim: plug memleak + + src/mm-sim.c | 1 + + 1 file changed, 1 insertion(+) + +commit 121c543711c44c536b82da3fd1079f779fe505d0 +Author: Aleksander Morgado +Date: Wed Mar 28 15:12:52 2012 +0200 + + sim: fix completion of pin-puk check + + src/mm-sim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 45e4f390eb7ab7394651bf7bddf865c74d677e84 +Author: Aleksander Morgado +Date: Wed Mar 28 15:12:26 2012 +0200 + + charsets: plug memleak + + src/mm-charsets.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e07786ebb1025d89eeb670be0ce518c6a8497cec +Author: Aleksander Morgado +Date: Mon Mar 26 15:23:28 2012 +0200 + + option: fix loading current allowed modes + + The proper command to check the current allowed modes is `AT_OPSYS?'. + + plugins/option/mm-broadband-modem-option.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2d02279ba7af4c4ee0ca4df588ba320817fe2919 +Author: Aleksander Morgado +Date: Mon Mar 26 15:20:55 2012 +0200 + + Revert "option: fix allowed modes response parsing" + + This reverts commit 0bc824b452de45815a8b8675d2b041a5eb98cb4c. + + The fix is NOT to change the expected result, but to change the + command itself. + + plugins/option/mm-broadband-modem-option.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f07d3748c6bad7fda9d485ffb0144f8c3380460e +Author: Aleksander Morgado +Date: Mon Mar 26 13:49:02 2012 +0200 + + broadband-modem: fix error reporting in the modem initialization + sequence + + The initialization sequence doesn't expect any result, so + `mm_base_modem_at_sequence_finish()' will actually return NULL even + if there is + no error. Therefore, we base the success of the sequence on the + existence of a + GError in the return. + + src/mm-broadband-modem.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 063c4f9bf8e59ba2ab2b5877446d685e816692f6 +Author: Aleksander Morgado +Date: Mon Mar 26 13:46:30 2012 +0200 + + option: fix disabling sequence handling + + This provides the proper fix for the disabling sequence, also + amending the + erroneous checks introduced in commit 5b10af0f. + + plugins/option/mm-broadband-modem-option.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit b581d6765fb9afb72acc37cb765188d459ffeedd +Author: Aleksander Morgado +Date: Mon Mar 26 13:39:21 2012 +0200 + + hso: skip the 10s timeout in High-Speed Option devices + + Will only be applied to non-HSO Option modems. + + plugins/option/mm-broadband-modem-hso.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e69d4974ef80dc6613e01d712f0087de35525ab4 +Author: Aleksander Morgado +Date: Mon Mar 26 13:37:41 2012 +0200 + + broadband-modem: use current charset when parsing operator name + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 28f13c09ecf6433385d9b7a8cff5be825d74c9c8 +Author: Aleksander Morgado +Date: Mon Mar 26 13:00:07 2012 +0200 + + mmcli: abort certain operations if modem is unlocked + + Do not try to perform feature/capability specific actions if we're + still + unlocked, as the modem didn't yet export the feature/capability + specific + interface. + + The only interfaces expected while modem is unlocked are the Modem + and Simple + interfaces, as well as the SIM interface in the SIM object, of course. + + cli/mmcli-modem-3gpp.c | 28 ++++++++++++++++++++-------- + cli/mmcli-modem-cdma.c | 14 ++++++++++---- + cli/mmcli-modem-location.c | 14 ++++++++++---- + cli/mmcli-modem-messaging.c | 14 ++++++++++---- + cli/mmcli-modem-simple.c | 9 +++++---- + cli/mmcli-modem-time.c | 14 ++++++++++---- + 6 files changed, 65 insertions(+), 28 deletions(-) + +commit d10780dcf573749137710c376edf52086e2b4500 +Author: Aleksander Morgado +Date: Mon Mar 26 12:58:18 2012 +0200 + + mmcli: fix alignment of properties in IP config output + + cli/mmcli-bearer.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit e387100eb51da541dff4b7323ebe2286dc193a12 +Author: Aleksander Morgado +Date: Mon Mar 26 12:57:44 2012 +0200 + + hso: update connection status only in the bearer matching the + specific CID + + plugins/option/mm-broadband-modem-hso.c | 69 + ++++++++++++++++++++------------- + 1 file changed, 41 insertions(+), 28 deletions(-) + +commit 770511f44937d9ca697ef014439380556f4dab90 +Author: Aleksander Morgado +Date: Mon Mar 26 12:57:00 2012 +0200 + + hso: fix segfault in bearer status update handling + + plugins/option/mm-broadband-bearer-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5191dd3d9e1c20cc27bdce9ff1502b15c1c7e042 +Author: Aleksander Morgado +Date: Mon Mar 26 12:56:18 2012 +0200 + + option: fix reading port-specific setup file + + The `physdev' stored in the probe is the sysfs path of the parent + device, that + owning all ports. We need to build the setup file path using the + port's sysfs + path instead. + + plugins/option/mm-plugin-hso.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 46fa15c6034ba4d1444a0b04a0f6e4c2f479eda0 +Author: Aleksander Morgado +Date: Mon Mar 26 12:54:17 2012 +0200 + + broadband-modem: initialize the Simple interface even if unlocked + + We should be able to unlock the modem during Simple Connect(). + + src/mm-broadband-modem.c | 32 ++++++++++++++++++++------------ + 1 file changed, 20 insertions(+), 12 deletions(-) + +commit 467b8892ae4c5107247fb2dc030bbf2becb07cac +Author: Aleksander Morgado +Date: Mon Mar 26 12:09:33 2012 +0200 + + mmcli: ensure the modem exports the Simple interface before trying + to use it + + cli/mmcli-modem-simple.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit fec294b2265ef897967d3b01685108c79c21f59e +Author: Aleksander Morgado +Date: Mon Mar 26 10:41:38 2012 +0200 + + plugin: bump major plugin version + + The PluginBase object got modified during the new codebase + development, and + therefore we need to ensure that the current codebase doesn't try + to load old + plugins. + + src/mm-plugin.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f6d8c52bc91743782497c56f3b25de4cabbcc643 +Author: Aleksander Morgado +Date: Sun Mar 25 01:09:24 2012 +0100 + + iface-modem: do not try to set new allowed/preferred config if modem + already in there + + src/mm-iface-modem.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit ae50d291cda0def4757a84bf808aa159aa5da184 +Author: Aleksander Morgado +Date: Sat Mar 24 20:29:26 2012 +0100 + + hso: probe for QCDM ports + + plugins/option/mm-plugin-hso.c | 1 + + 1 file changed, 1 insertion(+) + +commit 6b678bd8cf15aecc6f596892cc18a170a7675409 +Author: Aleksander Morgado +Date: Sat Mar 24 19:50:10 2012 +0100 + + hso: fix bearer private data handling + + plugins/option/mm-broadband-bearer-hso.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit bd90ee80943af30ac31ec24e0887c9f8bb84d170 +Author: Aleksander Morgado +Date: Sat Mar 24 19:15:50 2012 +0100 + + option: handle special 'auto' mode when setting allowed/preferred + modes + + plugins/option/mm-broadband-modem-option.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit 43cdb25eb176a18d04de68d1104a630555d7e60d +Author: Aleksander Morgado +Date: Sat Mar 24 19:02:01 2012 +0100 + + option: handle response specifying automatic mode + + Option modems may reply '_OPSYS: 5,2' to report automatic mode + being used. + + plugins/option/mm-broadband-modem-option.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 41a592b5352281db24a030065778731dec87e53a +Author: Aleksander Morgado +Date: Sat Mar 24 18:58:55 2012 +0100 + + iface-modem: treat ANY in allowed modes as being equal to the list + of supported modes + + src/mm-iface-modem.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 19436a99068f758fe96dacd282be52082086616e +Author: Aleksander Morgado +Date: Sat Mar 24 18:20:50 2012 +0100 + + option: fix setting allowed modes + + plugins/option/mm-broadband-modem-option.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 5b10af0ff3975fd855c5187ef34cb278031102d8 +Author: Aleksander Morgado +Date: Sat Mar 24 18:08:30 2012 +0100 + + option: no result expected in unsolicited enabling/disabling sequence + + plugins/option/mm-broadband-modem-option.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0bc824b452de45815a8b8675d2b041a5eb98cb4c +Author: Aleksander Morgado +Date: Sat Mar 24 11:48:34 2012 +0100 + + option: fix allowed modes response parsing + + Expecting a `_OSSYS' reply, not `_OPSYS'. + + plugins/option/mm-broadband-modem-option.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit d841916c4fef16dc58888c306a2930ffafe9162c +Author: Aleksander Morgado +Date: Fri Mar 23 16:52:39 2012 +0100 + + port-probe: don't probe product string if vendor string probing failed + + src/mm-port-probe.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e2730d6a0213afbb70bd77ddacf63aa89bc5bf97 +Author: Aleksander Morgado +Date: Fri Mar 23 16:51:23 2012 +0100 + + port-probe: probed vendor/product string will be NULL when error + probing + + src/mm-port-probe.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit d41d62f57743580f306ac2703561d1f17b45145e +Author: Dan Williams +Date: Fri Mar 23 10:15:39 2012 -0500 + + serial: fix crash when sending some commands to a closed port + (lp:963102) + + If the command we're sending doesn't have a callback, don't try + to call NULL. Triggered if the port got closed (because the modem + crashed, or refcounting errors or whatever) with some code like this: + + mm_at_serial_port_queue_command (MM_AT_SERIAL_PORT (port), + "+CREG=0", 3, NULL, NULL); + + src/mm-serial-port.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ac92ac74984a75ca4e125c0eabf8acba048a2b35 +Author: M. I. Spozta +Date: Thu Mar 22 11:34:39 2012 -0500 + + wmc: increase estimate decapsulation buffer size + + (dcbw) + Some packets are much larger and require a lot more escaping than + we thought so we need larger buffers here to be able to handle + all packets. In this case, SMS receipt. + + libwmc/src/utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c5a6e1fcab44df046569ed77f6f67149b9d671d2 +Author: Aleksander Morgado +Date: Sun Mar 18 17:27:37 2012 +0100 + + anydata: plugin fully ported + + plugins/mm-modem-anydata-cdma.c | 388 + ---------------------------------------- + plugins/mm-modem-anydata-cdma.h | 47 ----- + 2 files changed, 435 deletions(-) + +commit 58f21a6d94d31aeaf3bf3ce9760215f96ee8d9da +Author: Aleksander Morgado +Date: Sun Mar 18 17:26:23 2012 +0100 + + anydata: ignore several unsolicited messages + + plugins/anydata/mm-broadband-modem-anydata.c | 64 + ++++++++++++++++++++++++++++ + 1 file changed, 64 insertions(+) + +commit ffee9141972e11ee4d2eab949685bacf9c398e84 +Author: Aleksander Morgado +Date: Sun Mar 18 17:17:27 2012 +0100 + + anydata: implement modem reset + + plugins/anydata/mm-broadband-modem-anydata.c | 34 + ++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 82d72744a25c6912cb6e6737b40b830f9652d06c +Author: Aleksander Morgado +Date: Sun Mar 18 17:07:13 2012 +0100 + + anydata: get detailed CDMA1x/EVDO registration states + + plugins/anydata/mm-broadband-modem-anydata.c | 217 + +++++++++++++++++++++++++++ + 1 file changed, 217 insertions(+) + +commit d58d3f52a29aaed06c805da70311a2b66d4eeaf9 +Author: Aleksander Morgado +Date: Sat Mar 17 16:47:42 2012 +0100 + + anydata: don't get serving system with +CSS? + + plugins/anydata/mm-broadband-modem-anydata.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 75c38941a835f5de307108d5f2453ae11592e794 +Author: Aleksander Morgado +Date: Sat Mar 17 16:26:14 2012 +0100 + + anydata: start porting the AnyDATA plugin + + plugins/Makefile.am | 23 ++-- + plugins/anydata/mm-broadband-modem-anydata.c | 61 +++++++++ + plugins/anydata/mm-broadband-modem-anydata.h | 49 +++++++ + plugins/anydata/mm-plugin-anydata.c | 106 +++++++++++++++ + plugins/{ => anydata}/mm-plugin-anydata.h | 4 +- + plugins/mm-plugin-anydata.c | 185 + --------------------------- + 6 files changed, 231 insertions(+), 197 deletions(-) + +commit 46d16d5c995dc2e8f954dd1c27a6fd29e03cedef +Author: Aleksander Morgado +Date: Sat Mar 17 17:46:06 2012 +0100 + + libmm-common: new common uint/int/str parsers + + libmm-common/mm-common-helpers.c | 96 +++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 16 ++++- + plugins/generic/mm-plugin-generic.c | 1 - + src/mm-broadband-modem.c | 65 +++-------------- + src/mm-modem-helpers.c | 135 + ++++++++++++------------------------ + src/mm-modem-helpers.h | 1 - + 6 files changed, 166 insertions(+), 148 deletions(-) + +commit 3046059affaee447923bb8b3e70d06ec02ac9d96 +Author: Aleksander Morgado +Date: Fri Mar 16 15:52:36 2012 +0100 + + iface-modem-3gpp: if already registered as requested, don't try to + register from scratch + + src/mm-iface-modem-3gpp.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +commit 6bb90d92e47fb432b4916f0cb6521f541ffa0647 +Author: Aleksander Morgado +Date: Fri Mar 16 15:38:09 2012 +0100 + + iface-modem-simple: try to skip initial steps in the Simple Connect + sequence + + src/mm-iface-modem-simple.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 295272196dbdf256a7378066889fc89b855b1777 +Author: Aleksander Morgado +Date: Fri Mar 16 15:37:37 2012 +0100 + + iface-modem-simple: don't request to connect the bearer if already + connected + + src/mm-iface-modem-simple.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit 29b955afa29396cb51636ba58193d6ba5d87436c +Author: Aleksander Morgado +Date: Fri Mar 16 15:37:12 2012 +0100 + + iface-modem: if we are already unlocked, don't try to check it again + + We're assuming here we are never getting locked without us knowing it. + + src/mm-iface-modem.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 1dbe4a12cf88bf4e5bd1dab4aab170040747362b +Author: Aleksander Morgado +Date: Fri Mar 16 15:21:56 2012 +0100 + + iface-modem-simple: don't call the enable() methods in the class + directly + + Use the new `mm_base_modem_enable()' instead, which will pass down the + modem-wide cancellable to the enable() implementation. + + src/mm-iface-modem-simple.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +commit 686cfbb2c003b7023394b5c9a1eaa85671210815 +Author: Aleksander Morgado +Date: Fri Mar 16 15:21:01 2012 +0100 + + iface-modem-simple: don't assume bearer is always set + + src/mm-iface-modem-simple.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit f2fee29968f50ccd3b637d49df8c106360048f97 +Author: Aleksander Morgado +Date: Fri Mar 16 15:20:40 2012 +0100 + + broadband-bearer: pass down cancellable to the 3gpp dialing + implementation + + src/mm-broadband-bearer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8f488d604970bca585ed6f0a2531bcaa766b38f1 +Author: Aleksander Morgado +Date: Fri Mar 16 14:27:50 2012 +0100 + + hso,option: plugins fully ported + + plugins/Makefile.am | 20 - + plugins/mm-modem-hso.c | 816 + ---------------------------------------- + plugins/mm-modem-hso.h | 51 --- + plugins/mm-modem-option-utils.c | 561 --------------------------- + plugins/mm-modem-option.c | 237 ------------ + plugins/mm-modem-option.h | 45 --- + plugins/mm-plugin-hso.c | 206 ---------- + plugins/mm-plugin-hso.h | 43 --- + plugins/mm-plugin-option.c | 184 --------- + 9 files changed, 2163 deletions(-) + +commit 3a7270930a5e52739834b59b5b6b1450088a4fac +Author: Aleksander Morgado +Date: Fri Mar 16 14:24:48 2012 +0100 + + hso: custom disconnection implementation + + plugins/option/mm-broadband-bearer-hso.c | 86 + ++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 93b4256fb6710de6cb10d22301aa902ba2456deb +Author: Aleksander Morgado +Date: Fri Mar 16 14:18:41 2012 +0100 + + broadband-bearer: pass down CID to the 3GPP-specific disconnection + logic + + plugins/novatel/mm-broadband-bearer-novatel.c | 1 + + src/mm-broadband-bearer.c | 21 ++++++++++----------- + src/mm-broadband-bearer.h | 1 + + 3 files changed, 12 insertions(+), 11 deletions(-) + +commit 51956459dcf57ac0109ca0b8cc25d6fd927c2395 +Author: Aleksander Morgado +Date: Fri Mar 16 14:00:56 2012 +0100 + + hso: custom IP config retrieval implementation + + plugins/option/mm-broadband-bearer-hso.c | 188 + +++++++++++++++++++++++++++++++ + 1 file changed, 188 insertions(+) + +commit cd7d4c301928f25ece4dfba903fe2f6dedd14100 +Author: Aleksander Morgado +Date: Fri Mar 16 13:17:06 2012 +0100 + + broadband-bearer: let subclasses handle their own IP config retrieval + mechanism + + Mainly given for bearers requiring static IP addresses in net ports. + + src/mm-broadband-bearer.c | 148 + ++++++++++++++++++++++++++++++++++++++-------- + src/mm-broadband-bearer.h | 16 +++++ + 2 files changed, 139 insertions(+), 25 deletions(-) + +commit 6900348b643a762ed26834af86410ede83f67da2 +Author: Aleksander Morgado +Date: Fri Mar 16 13:15:54 2012 +0100 + + broadband-bearer: let subclasses know the CID being used + + src/mm-broadband-bearer.c | 6 ++++++ + src/mm-broadband-bearer.h | 2 ++ + 2 files changed, 8 insertions(+) + +commit 327a69ed16f2a47e26cce704f025b864f03130a4 +Author: Aleksander Morgado +Date: Fri Mar 16 13:15:01 2012 +0100 + + novatel: assume only IPv4 supported for now + + plugins/novatel/mm-broadband-bearer-novatel.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 70c70a61abdfee3faf8491a54c2c19af160b5875 +Author: Aleksander Morgado +Date: Fri Mar 16 12:22:27 2012 +0100 + + hso: let modem report connection status to the bearer + + Connection status notifications are unsolicited; the modem will + receive them + and it will forward them to the available bearer. + + plugins/option/mm-broadband-modem-hso.c | 171 + +++++++++++++++++++++++++++++++- + 1 file changed, 170 insertions(+), 1 deletion(-) + +commit 5a8a5d0f225b5266b116a8d0724bb67f6785f1c3 +Author: Aleksander Morgado +Date: Fri Mar 16 12:21:21 2012 +0100 + + hso: always create a HSO-specific broadband bearer + + plugins/option/mm-broadband-modem-hso.c | 67 + ++++++++++++++++++++++++++++++++- + 1 file changed, 66 insertions(+), 1 deletion(-) + +commit 7de8b588b630e25d54cf4f6b0a7323fe4478f3dc +Author: Aleksander Morgado +Date: Fri Mar 16 10:09:57 2012 +0100 + + hso: setup connection sequence + + plugins/option/mm-broadband-bearer-hso.c | 369 + +++++++++++++++++++++++++++++++ + plugins/option/mm-broadband-bearer-hso.h | 10 + + 2 files changed, 379 insertions(+) + +commit fe13d4cb66977e8641315683254e685b0b80584f +Author: Aleksander Morgado +Date: Fri Mar 16 10:09:25 2012 +0100 + + broadband-bearer: ensure a result is always set + + Just a convenience, as it is anyway not used afterwards. + + src/mm-broadband-bearer.c | 1 + + 1 file changed, 1 insertion(+) + +commit d374b995f92c03cda5d0a2e5684225feb061980a +Author: Aleksander Morgado +Date: Thu Mar 15 19:16:38 2012 +0100 + + hso: new `MMBroadbandBearerHso' + + Includes handling of user and password. + + plugins/Makefile.am | 2 + + plugins/option/mm-broadband-bearer-hso.c | 225 + +++++++++++++++++++++++++++++++ + plugins/option/mm-broadband-bearer-hso.h | 61 +++++++++ + 3 files changed, 288 insertions(+) + +commit 473c5fee4d920d723366cef1f406279e48eaf3d2 +Author: Aleksander Morgado +Date: Thu Mar 15 18:17:01 2012 +0100 + + bearer: properties are exposed before exporting the bearer object + + And we let subclasses to specify which of the input properties need + to be + exposed. + + src/mm-bearer.c | 31 ++++++++++++++++--------------- + src/mm-bearer.h | 4 ++++ + src/mm-broadband-bearer.c | 34 ++++++++++++++++------------------ + 3 files changed, 36 insertions(+), 33 deletions(-) + +commit 4f06aa5106be4688a751bf34601d1a03e3c49ce6 +Author: Aleksander Morgado +Date: Thu Mar 15 16:56:45 2012 +0100 + + api,dbus: include `user' and `password' as properties given to + Simple Connect + + introspection/org.freedesktop.ModemManager1.Modem.Simple.xml | 12 + ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 52ac88824e17ae26379e263b5a8dbcbdca805325 +Author: Aleksander Morgado +Date: Thu Mar 15 16:45:47 2012 +0100 + + hso: setup ports + + Only the primary port will get the OWANCALL unsolicited messages, + so we only + setup not to remove the echo in that specific port. + + plugins/option/mm-broadband-modem-hso.c | 43 + ++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit db052c2e5021066502ebfdd56c29e011abc2f55c +Author: Aleksander Morgado +Date: Thu Mar 15 13:54:49 2012 +0100 + + hso: started porting the High-Speed Option plugin + + Just skeleton for now. + + plugins/Makefile.am | 15 +++- + plugins/option/mm-broadband-modem-hso.c | 72 +++++++++++++++ + plugins/option/mm-broadband-modem-hso.h | 51 +++++++++++ + plugins/option/mm-plugin-hso.c | 150 + ++++++++++++++++++++++++++++++++ + plugins/option/mm-plugin-hso.h | 42 +++++++++ + 5 files changed, 328 insertions(+), 2 deletions(-) + +commit 1b394ebfe7556fad973ee470b8565daeb2ecaca2 +Author: Aleksander Morgado +Date: Thu Mar 15 13:29:36 2012 +0100 + + option: allow setting allowed/preferred modes + + plugins/option/mm-broadband-modem-option.c | 90 + ++++++++++++++++++++++++++++++ + 1 file changed, 90 insertions(+) + +commit 63926eac0278e806c81c476a8a19df365d1c8ba8 +Author: Aleksander Morgado +Date: Thu Mar 15 13:18:47 2012 +0100 + + option: load initial allowed/preferred modes + + plugins/option/mm-broadband-modem-option.c | 73 + ++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + +commit 7400b14ee61bf3de03aa6f477a6500f2bcb33c91 +Author: Aleksander Morgado +Date: Thu Mar 15 12:49:44 2012 +0100 + + mmcli: fix looking for unexisting SMS + + We need to ensure we iterate over all modems available. + + cli/mmcli-common.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 6dea9964bec11ac168835afc397d4bef061cc4c1 +Author: Aleksander Morgado +Date: Thu Mar 15 12:49:06 2012 +0100 + + mmcli: fix looking for unexisting bearers + + We need to ensure we iterate over all modems available. + + cli/mmcli-common.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 979c52038176ded90809c77ee7e97e0ddb665ebb +Author: Aleksander Morgado +Date: Thu Mar 15 12:31:14 2012 +0100 + + cli: don't assume every modem exposes the Messaging interface + + cli/mmcli-common.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +commit 346de780bea9ac00d2d4b0f01566755649498002 +Author: Aleksander Morgado +Date: Thu Mar 15 11:37:54 2012 +0100 + + option: completely ignore +PACSP0 unsolicited messages + + plugins/option/mm-broadband-modem-option.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit dda9e2a37fcc064341a23fb712010eb8a851e1e1 +Author: Aleksander Morgado +Date: Thu Mar 15 11:23:13 2012 +0100 + + option: enable and disable unsolicited messages + + plugins/option/mm-broadband-modem-option.c | 161 + +++++++++++++++++++++++++++++ + 1 file changed, 161 insertions(+) + +commit 00094fcad2bb603cb8786e7c2a7f60dab3cf044a +Author: Aleksander Morgado +Date: Thu Mar 15 11:03:30 2012 +0100 + + option: setup and cleanup unsolicited messages + + plugins/option/mm-broadband-modem-option.c | 291 + ++++++++++++++++++++++++++--- + 1 file changed, 266 insertions(+), 25 deletions(-) + +commit 657f7280252907f066b0f896bd7599dc21ecdab1 +Author: Aleksander Morgado +Date: Wed Mar 14 19:23:38 2012 +0100 + + option: reset expected unsolicited message handlers + + plugins/option/mm-broadband-modem-option.c | 64 + ++++++++++++++++++++++++++++++ + 1 file changed, 64 insertions(+) + +commit 39e0f953b003fed958d61682a2168805ec63f9cb +Author: Aleksander Morgado +Date: Wed Mar 14 17:37:50 2012 +0100 + + option: need to wait some seconds after power up + + plugins/option/mm-broadband-modem-option.c | 64 + +++++++++++++++++++++++++++++- + plugins/option/mm-broadband-modem-option.h | 2 + + 2 files changed, 65 insertions(+), 1 deletion(-) + +commit 15e99430363fcaf7d2a3be6afb7961d2e3f7e8b3 +Author: Aleksander Morgado +Date: Tue Mar 13 18:20:01 2012 +0100 + + plugin-base: avoid launching AT probing on new ports if the modem + expects only one + + If we got an existing modem showing a new port, and the plugin + handling that modem + said that only one AT port was expected, we shouldn't be AT-probing + it any more. + + src/mm-plugin-base.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +commit 29f23f2a492d7743f19aa99c0f9dc1960160698c +Author: Aleksander Morgado +Date: Tue Mar 13 18:18:43 2012 +0100 + + base-modem: new method to check if the modem got any AT port + + Required for the single-at logic in the plugins. + + src/mm-base-modem.c | 17 +++++++++++++++++ + src/mm-base-modem.h | 3 ++- + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 3eb4220caa92ef5be21829b37778690802802ce9 +Author: Aleksander Morgado +Date: Tue Mar 13 18:17:53 2012 +0100 + + port-probe: new probing result setters + + We make them public, so that we can set results before actually + running the + probing. + + src/mm-port-probe.c | 106 + ++++++++++++++++++++++++++++++++++++---------------- + src/mm-port-probe.h | 10 +++++ + 2 files changed, 83 insertions(+), 33 deletions(-) + +commit d2559e2716c43f52701144ee25c14d87786b5a11 +Author: Aleksander Morgado +Date: Tue Mar 13 16:47:06 2012 +0100 + + plugin-base: only cancel AT probing in probes of the same device + + src/mm-plugin-base.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit c52762ea6763b93772f13ad0fd2c89fb6d201018 +Author: Aleksander Morgado +Date: Tue Mar 13 16:42:49 2012 +0100 + + build: require gudev >= 147 + + Since udev 147 the gudev API is no longer marked as experimental, + and therefore + `G_UDEV_API_IS_SUBJECT_TO_CHANGE' is no longer needed. + + configure.ac | 2 +- + src/mm-manager.c | 2 -- + src/mm-plugin-base.c | 7 ++----- + src/mm-plugin-base.h | 2 -- + src/mm-port-probe.h | 2 -- + test/lsudev.c | 1 - + 6 files changed, 3 insertions(+), 13 deletions(-) + +commit 703ab2590b031b028199c872e2525936a9d7088f +Author: Aleksander Morgado +Date: Tue Mar 13 14:58:42 2012 +0100 + + port-probe: probing may just require vendor or product probing + + If we already had probed, e.g. AT capabilities, and a next plugin + requires + Vendor AT probing, the task will only show that VENDOR_AT is + requested. + + src/mm-port-probe.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 56e7b15f5c2bb8f88dc638766774db1f15a5b4d0 +Author: Aleksander Morgado +Date: Tue Mar 13 13:49:25 2012 +0100 + + base-modem: ensure we cancel any ongoing operation when we're + disposing + + src/mm-base-modem.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 09026ed89a0a7d85112aec52ca1e3ae57e497f11 +Author: Aleksander Morgado +Date: Tue Mar 13 13:12:18 2012 +0100 + + iface-modem: treat serial errors also as fatal when checking unlock + status + + src/mm-iface-modem.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +commit a20441f4c03bc57cb2dfabb00dd4f94848db2739 +Author: Aleksander Morgado +Date: Tue Mar 13 12:41:46 2012 +0100 + + nokia: don't even bother checking for messaging support + + Nokia modems/handsets use their own protocol (phonet) for all + messaging related + operations, currently unsupported, so don't bother trying to check + messaging + support with the generic implementation. + + plugins/nokia/mm-broadband-modem-nokia.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit e2a56ba490fdb49e81f693fad5e48ee319041727 +Author: Aleksander Morgado +Date: Tue Mar 13 12:35:15 2012 +0100 + + iface-modem-time: let initialization and enabling sequences get + cancelled + + src/mm-broadband-modem.c | 2 ++ + src/mm-iface-modem-time.c | 48 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-time.h | 2 ++ + 3 files changed, 52 insertions(+) + +commit 9eebb75ca3a5cb84630ccb1df92de511bbd120ca +Author: Aleksander Morgado +Date: Tue Mar 13 12:20:16 2012 +0100 + + iface-modem-messaging: let initialization and enabling sequences + get cancelled + + src/mm-broadband-modem.c | 4 +++- + src/mm-iface-modem-messaging.c | 54 + ++++++++++++++++++++++++++++++++++++++---- + src/mm-iface-modem-messaging.h | 2 ++ + 3 files changed, 55 insertions(+), 5 deletions(-) + +commit 2c4a69b190cd0963d650a048560a96c1e4cf0dc2 +Author: Aleksander Morgado +Date: Tue Mar 13 12:15:00 2012 +0100 + + iface-modem-location: let initialization and enabling sequences + get cancelled + + src/mm-broadband-modem.c | 2 ++ + src/mm-iface-modem-location.c | 49 + ++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-location.h | 2 ++ + 3 files changed, 52 insertions(+), 1 deletion(-) + +commit fea2ef0e5cbf908a889a04c5c488aa76070aeaa5 +Author: Aleksander Morgado +Date: Tue Mar 13 12:07:03 2012 +0100 + + iface-modem-cdma: let initialization and enabling sequences get + cancelled + + src/mm-broadband-modem.c | 2 ++ + src/mm-iface-modem-cdma.c | 48 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 2 ++ + 3 files changed, 52 insertions(+) + +commit 0d4b644572603114d9b6eda46778af6a8a5c021d +Author: Aleksander Morgado +Date: Tue Mar 13 11:58:32 2012 +0100 + + iface-modem-3gpp: let initialization and enabling sequences get + cancelled + + src/mm-broadband-modem.c | 2 ++ + src/mm-iface-modem-3gpp.c | 48 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 2 ++ + 3 files changed, 52 insertions(+) + +commit e140ff3c5f1dda2e1310b79b81e73fada5b6d312 +Author: Aleksander Morgado +Date: Tue Mar 13 11:52:20 2012 +0100 + + iface-modem: let initialization and enabling sequences get cancelled + + src/mm-broadband-modem.c | 2 ++ + src/mm-iface-modem.c | 48 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 2 ++ + 3 files changed, 52 insertions(+) + +commit d27e40ae9aea1166831920a92d4eba4f3f51605d +Author: Aleksander Morgado +Date: Fri Mar 9 19:48:43 2012 +0100 + + core: new `Initializing' state in the global modem state machine + + We need to define a state to be used while the modem is being + initialized, so + that we forbid any operation on the modem on already exported + interfaces, while + there are interfaces pending to get exported. + + This Initializing state will also cover the state between having + the SIM + unlocked (which launches re-initialization) and being completely + initialized. + + include/ModemManager-enums.h | 22 ++++++++------ + src/mm-broadband-modem.c | 72 + ++++++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem-3gpp.c | 24 ++++++++++++--- + src/mm-iface-modem-cdma.c | 22 +++++++++++--- + src/mm-iface-modem.c | 34 ++++++++++++--------- + src/mm-sim.c | 13 +++++--- + 6 files changed, 140 insertions(+), 47 deletions(-) + +commit 6de2e3f72cb058ce31b93274ede144d95c5440bc +Author: Aleksander Morgado +Date: Fri Mar 9 19:47:04 2012 +0100 + + sim: don't require the Modem object in the context + + It's already easily available in self->priv->modem; + + src/mm-sim.c | 28 ++++------------------------ + 1 file changed, 4 insertions(+), 24 deletions(-) + +commit 3a22128d9e87d2948e948b44f170cf4167dcc746 +Author: Aleksander Morgado +Date: Fri Mar 9 19:43:34 2012 +0100 + + iface-modem: don't leave locked state until re-initialization + is complete + + src/mm-iface-modem.c | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 961290ddd7d6acd8d9da76e100b5c8063fa70cb5 +Author: Aleksander Morgado +Date: Fri Mar 9 17:01:13 2012 +0100 + + build: autogenerate `mm-errors-quarks.c' + + We define custom nicks for each error enum, matching the DBus error + entry that + we want to have with each of them. + + .gitignore | 1 + + build-aux/header-generator.xsl | 3 + + build-aux/mm-errors-quarks-template.c | 42 +++++ + docs/reference/api/ModemManager-sections.txt | 7 + + include/ModemManager-errors.h | 224 + ++++++++++++++------------- + libmm-common/Makefile.am | 13 +- + libmm-common/mm-errors-quarks.c | 219 + -------------------------- + 7 files changed, 178 insertions(+), 331 deletions(-) + +commit be7f499aa6da3630e145c311c489fe478c339b78 +Author: Aleksander Morgado +Date: Fri Mar 9 15:49:41 2012 +0100 + + broadband-modem: set cancellations in the initialization, enabling + and disabling sequences + + src/mm-broadband-modem.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 63 insertions(+) + +commit 4b64d3dcf044937d92f4bc0c7af54da6ee92c34e +Author: Aleksander Morgado +Date: Fri Mar 9 00:13:53 2012 +0100 + + nokia: new `MMSimNokia' + + Nokia phones don't support AT+CRSM. + + plugins/Makefile.am | 2 + + plugins/nokia/mm-broadband-modem-nokia.c | 30 +++++++++++- + plugins/nokia/mm-sim-nokia.c | 84 + ++++++++++++++++++++++++++++++++ + plugins/nokia/mm-sim-nokia.h | 51 +++++++++++++++++++ + 4 files changed, 166 insertions(+), 1 deletion(-) + +commit 25e8bfd2a31c87bc2a1a4f5d98ebb173303b348b +Author: Aleksander Morgado +Date: Thu Mar 8 23:37:10 2012 +0100 + + nokia: expect only one AT port + + This speeds up probing, as we cancel other AT probings as soon as + we grab the + first AT port. + + plugins/nokia/mm-plugin-nokia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 181f9c85f037cc4d0a603dc314382b3ffaa961f0 +Author: Aleksander Morgado +Date: Thu Mar 8 23:32:30 2012 +0100 + + log: only include LOC and method name in debug logs if running + with --debug + + If the modem is started with --log-level=DEBUG, they will not + be shown. + + src/main.c | 1 + + src/mm-log.c | 7 +++++-- + src/mm-log.h | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +commit cdd339f8024af8088d94f0ffde78beef5a0c998d +Author: Aleksander Morgado +Date: Thu Mar 8 23:19:19 2012 +0100 + + base-modem: implement new modem-wide cancellable, and rework AT + commands + + Instead of the `_in_port()' variants, we'll provide more generic + `_full()' methods. These should be used either if we want to send + commands + to a specific port, or if we want to use a specific user-provided + GCancellable. + + In addition to this user-provided GCancellable, we keep the internal + modem-wide + one. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 36 ++--- + plugins/gobi/mm-broadband-modem-gobi.c | 1 - + plugins/iridium/mm-bearer-iridium.c | 12 +- + plugins/iridium/mm-broadband-modem-iridium.c | 5 - + plugins/nokia/mm-broadband-modem-nokia.c | 1 - + plugins/novatel/mm-broadband-bearer-novatel.c | 4 - + plugins/novatel/mm-broadband-modem-novatel.c | 3 - + plugins/option/mm-broadband-modem-option.c | 3 - + src/mm-base-modem-at.c | 185 + ++++++++++++---------- + src/mm-base-modem-at.h | 91 +++++------ + src/mm-base-modem.c | 16 ++ + src/mm-base-modem.h | 3 + + src/mm-broadband-bearer.c | 191 + +++++++++++------------ + src/mm-broadband-modem.c | 162 + ++++++++----------- + src/mm-sim.c | 7 - + src/mm-sms.c | 4 - + 16 files changed, 334 insertions(+), 390 deletions(-) + +commit 215c27808230352e3def81b45808ef29a9cd5b7a +Author: Aleksander Morgado +Date: Thu Mar 8 15:30:48 2012 +0100 + + base-modem: new modem-wide cancellable, passed to every state machine + + src/mm-base-modem.c | 132 + ++++++++++++++++++++++++++++++++++++++++++++------- + src/mm-base-modem.h | 39 +++++++++++---- + src/mm-iface-modem.c | 37 +++++---------- + 3 files changed, 155 insertions(+), 53 deletions(-) + +commit 7bfc56c2a8d1d5d9eb70cdfa803b840c176071b2 +Author: Aleksander Morgado +Date: Thu Mar 8 15:30:14 2012 +0100 + + base-modem-at: set error if NULL port detected + + Users of mm_base_modem_at_command_in_port() can now directly pass + the result + of mm_base_modem_peek_port_primary() or + mm_base_modem_peek_port_secondary(), + which may be NULL if no such port exists in the modem. So we'll + gracefully + detect the NULL port and complete the async operation with an error. + + src/mm-base-modem-at.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit cc6d4a97fb0a11c799f1079c6db86b31db7eadf7 +Author: Aleksander Morgado +Date: Thu Mar 8 12:47:45 2012 +0100 + + base-modem: new port getters and peekers + + * mm_base_modem_peek_port_* () will return either a port object + (no new + reference), or NULL if none available. + + You would usually peek() a port if you're going to use it just in + the current + method, as there is no way to that reference to get invalid (we're + single + threaded). + + * mm_base_modem_get_port_* () will return either NEW references + to valid + port objects, or NULL if none available. + + And, you would usually get() a port, whenever you want the port + object to be + valid even out of the current method, for example when keeping it + in the + context of an async operation. + + Also, we need to consider that the primary AT port MAY BE NULL + when you + peek() or get() it. This is due to the fact that we may be releasing + ports + (due to device disconnection) in the middle of async operations. + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + plugins/iridium/mm-bearer-iridium.c | 121 +++++++++------- + plugins/iridium/mm-broadband-modem-iridium.c | 8 +- + src/mm-base-modem-at.c | 6 +- + src/mm-base-modem.c | 57 +++++++- + src/mm-base-modem.h | 20 ++- + src/mm-broadband-bearer.c | 73 ++++++++-- + src/mm-broadband-modem.c | 177 + +++++++++++++---------- + src/mm-iface-modem-3gpp-ussd.c | 6 - + src/mm-iface-modem-3gpp.c | 6 - + src/mm-iface-modem-cdma.c | 6 - + src/mm-iface-modem-location.c | 6 - + src/mm-iface-modem-messaging.c | 6 - + src/mm-iface-modem-time.c | 6 - + src/mm-iface-modem.c | 29 ++-- + src/mm-sim.c | 17 +-- + 16 files changed, 323 insertions(+), 223 deletions(-) + +commit 48285dcfdf04becbe90922ac3f2dd942bc43de53 +Author: Aleksander Morgado +Date: Wed Mar 7 17:17:59 2012 +0100 + + serial-port: forcing to close a port is an internal operation + + Ports being forced to get closed will only happen when we get a + HUP error + in the serial port (e.g. device got disconnected). + + src/mm-serial-port.c | 6 +++--- + src/mm-serial-port.h | 2 -- + 2 files changed, 3 insertions(+), 5 deletions(-) + +commit 4f59a696fc5a01551c9fc53ac5893d429613ff7e +Author: Aleksander Morgado +Date: Wed Mar 7 17:10:16 2012 +0100 + + serial-port: don't warn when trying to close a port which was forced + to be closed + + src/mm-serial-port.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +commit 4bdfd25de18bc6abaae6197f5f4646586c0da511 +Author: Aleksander Morgado +Date: Wed Mar 7 17:07:36 2012 +0100 + + base-modem: when getting best AT port, assume we may have lost + specific ports + + Don't assume that primary port is always set. + + src/mm-base-modem.c | 31 +++++++++++++++---------------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +commit c24012ef1b6a4ba1368ca22f30b7db6c5ccec334 +Author: Aleksander Morgado +Date: Wed Mar 7 16:49:22 2012 +0100 + + plugin-base: handle the case of expecting a single AT port + + If we only expect a single AT port, we'll cancel all remaining AT + port probings + in the other ports, as soon as we get the first one. + + TODO | 4 ---- + src/mm-plugin-base.c | 35 +++++++++++++++++++++++++++++------ + 2 files changed, 29 insertions(+), 10 deletions(-) + +commit dc58cce7c45cc77b31923a2520a501ba5e3590da +Author: Aleksander Morgado +Date: Wed Mar 7 16:48:18 2012 +0100 + + port-probe: allow cancelling all AT probing steps + + src/mm-port-probe.c | 50 + ++++++++++++++++++++++++++++++++++++++++---------- + src/mm-port-probe.h | 4 +++- + 2 files changed, 43 insertions(+), 11 deletions(-) + +commit 9fbddcb8a94ae6755b6afccf9dcf070b4d9c45bd +Author: Aleksander Morgado +Date: Wed Mar 7 14:23:15 2012 +0100 + + plugin-base: new property to specify that only one single AT port + is expected + + Will allow us to cancel other AT probings as soon as the first AT + port is + grabbed. + + src/mm-plugin-base.c | 19 +++++++++++++++++++ + src/mm-plugin-base.h | 2 +- + 2 files changed, 20 insertions(+), 1 deletion(-) + +commit 690777986b0efe6a38135ea8f42f392a6320cf77 +Author: Aleksander Morgado +Date: Wed Mar 7 14:21:11 2012 +0100 + + port-probe: refactor AT command handling + + Make it use a GVariant in the response processor, as the AT command + handling in + the MMBaseModem. + + TODO | 4 -- + plugins/nokia/mm-plugin-nokia.c | 44 ++----------- + src/Makefile.am | 4 +- + src/mm-port-probe-at-command.c | 135 + ---------------------------------------- + src/mm-port-probe-at-command.h | 58 ----------------- + src/mm-port-probe-at.c | 93 +++++++++++++++++++++++++++ + src/mm-port-probe-at.h | 79 +++++++++++++++++++++++ + src/mm-port-probe.c | 74 ++++++++++++++-------- + src/mm-port-probe.h | 2 +- + 9 files changed, 226 insertions(+), 267 deletions(-) + +commit 70103fdef3556551cb282849fb8fb1dbcd102deb +Author: Aleksander Morgado +Date: Wed Mar 7 14:18:19 2012 +0100 + + TODO: new task to consolidate the serial parser as a GObject + + TODO | 2 ++ + 1 file changed, 2 insertions(+) + +commit 1e1927334031f8eda5383962063c54ac06267bfe +Author: Aleksander Morgado +Date: Wed Mar 7 13:10:18 2012 +0100 + + serial-parsers: new method to check if a given error was set by + the parser + + src/mm-serial-parsers.c | 9 +++++++++ + src/mm-serial-parsers.h | 1 + + 2 files changed, 10 insertions(+) + +commit ef2b1cf030e257ff93ada4a5397425d192df1805 +Author: Aleksander Morgado +Date: Wed Mar 7 13:08:43 2012 +0100 + + at-serial-port: allow cancelling the response timeout + + src/mm-at-serial-port.c | 6 ++++-- + src/mm-at-serial-port.h | 2 ++ + src/mm-base-modem-at.c | 5 +++++ + src/mm-port-probe.c | 1 + + 4 files changed, 12 insertions(+), 2 deletions(-) + +commit 5a485d74a20a57498d06db09b621af93b433d7e2 +Author: Aleksander Morgado +Date: Wed Mar 7 13:07:17 2012 +0100 + + qcdm-serial-port: allow cancelling the response timeout + + src/mm-broadband-modem.c | 4 ++++ + src/mm-port-probe.c | 2 ++ + src/mm-qcdm-serial-port.c | 6 ++++-- + src/mm-qcdm-serial-port.h | 2 ++ + src/tests/test-qcdm-serial-port.c | 2 +- + 5 files changed, 13 insertions(+), 3 deletions(-) + +commit 9b38cd4f5ce68d816aaa5ffd5b90c1982199bcf2 +Author: Aleksander Morgado +Date: Wed Mar 7 13:04:35 2012 +0100 + + serial-port: allow cancelling the response timeout + + src/mm-at-serial-port.c | 2 ++ + src/mm-qcdm-serial-port.c | 2 ++ + src/mm-serial-port.c | 62 + +++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-serial-port.h | 4 ++- + 4 files changed, 67 insertions(+), 3 deletions(-) + +commit 64d83737fe8fc2a4a16e61f817e5046f40cb843b +Author: Aleksander Morgado +Date: Wed Mar 7 12:37:42 2012 +0100 + + serial-parsers: remove v0 and v1_e1 parsers, which are unused + + Given that we now perform our own built-in echo removal in the v1 + parser, we no + longer need the v1_e1 parser. + + The v0 parser was also unused from long ago. + + src/mm-serial-parsers.c | 184 + ------------------------------------------------ + src/mm-serial-parsers.h | 14 ---- + 2 files changed, 198 deletions(-) + +commit 05e2ce862dc5d834b274676bd1afa31fae62a740 +Author: Aleksander Morgado +Date: Wed Mar 7 10:38:33 2012 +0100 + + port-probe: log the list of probing tasks to be run + + src/mm-port-probe.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 66984e77cdfd7e1292da31a03996696b3f5288d1 +Author: Aleksander Morgado +Date: Wed Mar 7 10:37:49 2012 +0100 + + port-probe: convert port probe flags to a private enum + + src/Makefile.am | 6 ++++-- + src/mm-port-probe.h | 11 +++++++---- + 2 files changed, 11 insertions(+), 6 deletions(-) + +commit b07e13f49d5e343377d086c5a564ae5659b6a40a +Author: Aleksander Morgado +Date: Tue Mar 6 18:19:17 2012 +0100 + + TODO: time interface and own numbers now done + + TODO | 9 --------- + 1 file changed, 9 deletions(-) + +commit 1df1fe4f4aa271bb66616da789dda0b2bc7f653e +Author: Aleksander Morgado +Date: Tue Mar 6 17:45:41 2012 +0100 + + mmcli: new Time-specific actions + + cli/Makefile.am | 1 + + cli/mmcli-modem-time.c | 262 + +++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 +++ + cli/mmcli.h | 8 ++ + 4 files changed, 282 insertions(+) + +commit a3e6faeaca45ab7499ba3652597042e036c03a15 +Author: Aleksander Morgado +Date: Tue Mar 6 17:45:16 2012 +0100 + + libmm-glib: implement Time interface specific actions + + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-time.c | 123 + +++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-time.h | 54 ++++++++++++++++++++ + libmm-glib/mm-object.c | 37 +++++++++++++- + libmm-glib/mm-object.h | 6 ++- + 5 files changed, 220 insertions(+), 2 deletions(-) + +commit b50c5d42e0966c0bab5d7e9984b8ff77ff4b0f02 +Author: Aleksander Morgado +Date: Tue Mar 6 14:56:44 2012 +0100 + + mmcli: print own numbers in modem info + + cli/mmcli-modem.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 59d811076759255d4a55cb8157de43330b1aadcd +Author: Aleksander Morgado +Date: Tue Mar 6 14:32:16 2012 +0100 + + libmm-glib: add support to retrieve own numbers + + libmm-glib/mm-modem.c | 26 ++++++++++++++++++++++++++ + libmm-glib/mm-modem.h | 2 ++ + 2 files changed, 28 insertions(+) + +commit 1f250585dd810e8b6db2514036a470ab955febf4 +Author: Aleksander Morgado +Date: Tue Mar 6 14:15:43 2012 +0100 + + modem-helpers: refactor and reorganize sources + + src/mm-broadband-bearer.c | 8 +- + src/mm-broadband-modem.c | 54 +- + src/mm-modem-helpers.c | 2506 + ++++++++++++++++++++-------------------- + src/mm-modem-helpers.h | 182 +-- + src/tests/test-modem-helpers.c | 30 +- + 5 files changed, 1423 insertions(+), 1357 deletions(-) + +commit c824ee310603971ed4ccbfb9531b83dcfcc75bd6 +Author: Aleksander Morgado +Date: Tue Mar 6 13:10:10 2012 +0100 + + broadband-modem: implement own numbers generic loading + + src/mm-broadband-modem.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 51c28d0f79cfebae60982b824abbfbdf2d730f68 +Author: Aleksander Morgado +Date: Tue Mar 6 13:09:34 2012 +0100 + + modem-helpers: new +CNUM response parser and tests + + src/mm-modem-helpers.c | 37 +++++++++++++++ + src/mm-modem-helpers.h | 3 ++ + src/tests/test-modem-helpers.c | 105 + +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 145 insertions(+) + +commit 4a52a19c41c92aa8c9091b0ddcbfe6f18d3691ad +Author: Aleksander Morgado +Date: Tue Mar 6 12:42:42 2012 +0100 + + tests,modem-helpers: cleanup tests + + Properly order the tests in blocks, and ensure that the common + data for + registration tests is not passed to other non-registration related + tests. + + src/tests/test-modem-helpers.c | 191 + +++++++++++++++++++++++------------------ + 1 file changed, 107 insertions(+), 84 deletions(-) + +commit 4c38ab4864463b8266f7202a702f4fd3b01af060 +Author: Aleksander Morgado +Date: Tue Mar 6 12:33:00 2012 +0100 + + test,modem-helpers: remove conditional compilation + + We require already GLib 2.30 + + src/tests/test-modem-helpers.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +commit 2dcff5590e22d47de41b4bf1beb1d6666286bee7 +Author: Aleksander Morgado +Date: Tue Mar 6 11:45:02 2012 +0100 + + iface-modem: setup loading of own numbers during the initialization + phase + + src/mm-iface-modem.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 50 insertions(+) + +commit 238e2a5341f2825bedbdb2c0e70e3dcdeaae5f62 +Author: Aleksander Morgado +Date: Tue Mar 6 11:44:30 2012 +0100 + + api,dbus: new `OwnNumbers' property in the Modem interface + + introspection/org.freedesktop.ModemManager1.Modem.xml | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 478b9c5f36c8e740ef5c49bf487a5fe106e9e62c +Author: Aleksander Morgado +Date: Mon Mar 5 20:09:03 2012 +0100 + + cinterion: no need to complete in idle in sleep_ready() + + plugins/cinterion/mm-broadband-modem-cinterion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 22113859c935c6f979f8d1cfe633a4aa3cb05e81 +Author: Aleksander Morgado +Date: Mon Mar 5 18:29:27 2012 +0100 + + messaging: part index may be repeated in different storages + + src/mm-sms-list.c | 21 ++++++++++++++++----- + src/mm-sms.c | 11 +++++++++++ + src/mm-sms.h | 7 ++++--- + 3 files changed, 31 insertions(+), 8 deletions(-) + +commit 120e117c49d50d853e08a9291e31eb33fc73d5ac +Author: Aleksander Morgado +Date: Mon Mar 5 18:17:02 2012 +0100 + + time: removed old interface sources + + src/mm-modem-time.c | 169 + ---------------------------------------------------- + src/mm-modem-time.h | 60 ------------------- + 2 files changed, 229 deletions(-) + +commit a339546c4547e0950d8dc8aa1d22aafc8969fac9 +Author: Aleksander Morgado +Date: Mon Mar 5 18:11:18 2012 +0100 + + iface-modem-time: setup generic unsolicited message handling + + Modems may get notified via unsolicited messages (either AT or QMI + or some + other thing), that the network time was updated. This setup allows + subclasses + implementing the Time interface to setup/cleanup and enable/disable + the + unsolicited messages, as well as notify about the network time + updates. + + src/mm-iface-modem-time.c | 149 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-time.h | 37 ++++++++++++ + 2 files changed, 186 insertions(+) + +commit 5b01df5baa796d6a1ddec4e57c18a1c742f870f4 +Author: Aleksander Morgado +Date: Mon Mar 5 16:30:39 2012 +0100 + + iface-modem-time: handle `GetNetworkTime' + + src/mm-iface-modem-time.c | 88 + ++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-time.h | 8 +++++ + 2 files changed, 95 insertions(+), 1 deletion(-) + +commit 10669881a5520c253ab8ba6f05de4ff5afdc7a31 +Author: Aleksander Morgado +Date: Mon Mar 5 16:10:53 2012 +0100 + + iface-modem-time: only retry if MM_CORE_ERROR_RETRY was returned + + We don't want to retry if the error is fatal in some other kind, + e.g. a reply + parsing error or something. + + src/mm-iface-modem-time.c | 7 +++++-- + src/mm-iface-modem-time.h | 4 +++- + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit 120ac6da39ef1d3abb57f77f1e77de10bf58f194 +Author: Aleksander Morgado +Date: Mon Mar 5 16:07:31 2012 +0100 + + api,errors: new `MM_CORE_ERROR_RETRY' + + Lets operations specify that they cannot be run currently, but that + the caller + may retry later. Of course, it depends on the caller to really + honour the + retry-later suggestion. + + include/ModemManager-errors.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 6e753996293bc0c397b896f7db5fad328237adc5 +Author: Aleksander Morgado +Date: Mon Mar 5 15:20:21 2012 +0100 + + iface-modem-time: load network timezone information + + Following the same logic as in the original implementation, we try + to load the + network timezone information only after being registered, and also + with up to N + retries. The async operation in charge of the loading can be cancelled + gracefully, i.e. if the interface is disabled before we get ever + registered. + + src/mm-iface-modem-time.c | 315 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-time.h | 14 ++- + 2 files changed, 324 insertions(+), 5 deletions(-) + +commit df4e7131240c960d1c351d21e82aad0810188580 +Author: Aleksander Morgado +Date: Mon Mar 5 11:59:54 2012 +0100 + + broadband-modem: implement the Time interface + + src/mm-broadband-modem.c | 68 + +++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 67 insertions(+), 1 deletion(-) + +commit 16cf2a49f681c1b1e1a23b6a86aef470dc9f4d89 +Author: Aleksander Morgado +Date: Mon Mar 5 11:53:54 2012 +0100 + + iface-modem-time: new interface to handle the Time DBus interface + + src/Makefile.am | 2 + + src/mm-iface-modem-time.c | 457 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-time.h | 76 ++++++++ + 3 files changed, 535 insertions(+) + +commit 455fc68d8ab2a003d743163f538e8e3de9558ea3 +Author: Aleksander Morgado +Date: Mon Mar 5 11:43:37 2012 +0100 + + libmm-common: new `MMNetworkTimezone' helper object + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-network-timezone.c | 216 + +++++++++++++++++++++++++++++++++++++ + libmm-common/mm-network-timezone.h | 68 ++++++++++++ + 4 files changed, 289 insertions(+) + +commit bd9d7011b9ecdd588b74f0948352a4822c8222da +Author: Aleksander Morgado +Date: Mon Mar 5 10:50:01 2012 +0100 + + api,dbus: rewrote Time interface to be used with gdbus-codegen + + docs/reference/api/Makefile.am | 1 + + docs/reference/api/ModemManager-dbus-reference.xml | 1 + + introspection/all.xml | 1 + + .../org.freedesktop.ModemManager.Modem.Time.xml | 56 ---------------- + .../org.freedesktop.ModemManager1.Modem.Time.xml | 75 + ++++++++++++++++++++++ + libmm-common/Makefile.am | 2 + + 6 files changed, 80 insertions(+), 56 deletions(-) + +commit 480fe4b8087ea323f46e8abee6a71323746b6693 +Author: Aleksander Morgado +Date: Fri Mar 2 13:06:42 2012 +0100 + + docs: new section about plugin-specific modems + + docs/reference/api/Makefile.am | 6 +- + ...nterface-initialization-sequence-subclassed.dia | 1083 + ++++++++++++++++++++ + ...emManager-interface-initialization-sequence.dia | 999 + ++++++++++++++++++ + docs/reference/api/ModemManager-overview.xml | 51 +- + 4 files changed, 2136 insertions(+), 3 deletions(-) + +commit 52ff02323d07d4b27755f7ad49bef5ee53e27109 +Author: Aleksander Morgado +Date: Thu Mar 1 23:47:57 2012 +0100 + + plugin-manager: avoid race when port deferred until suggested and + suggestion already there + + It may happen that we launch the supports task in the port AFTER + having received + the suggestion. + + src/mm-plugin-manager.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit f8f09692894dc30e6bfd019554783b7a18de61a2 +Author: Aleksander Morgado +Date: Thu Mar 1 23:46:37 2012 +0100 + + plugin-base: log also when starting to check support + + So that we get logs when net ports are being checked for support, + which won't be + probed. + + src/mm-plugin-base.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 9c5c072bab444a269dd4f6c8d847191eafe0c1b6 +Author: Aleksander Morgado +Date: Thu Mar 1 21:41:12 2012 +0100 + + iface-modem: fix signal name + + src/mm-iface-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c590cde7e594d5020c2bc400ce8397a666fed9d9 +Author: Aleksander Morgado +Date: Thu Mar 1 17:36:09 2012 +0100 + + TODO: new possible probing improvement + + TODO | 3 +++ + 1 file changed, 3 insertions(+) + +commit 47265a80acb81f48332fa175a084fa3e9922b206 +Author: Aleksander Morgado +Date: Thu Mar 1 17:35:53 2012 +0100 + + TODO: pin retry counts and enabled facility locks now ported from + master + + TODO | 2 -- + 1 file changed, 2 deletions(-) + +commit 41fe01b2179f080bf62d52acf2e6d1b8fa45ed90 +Author: Aleksander Morgado +Date: Thu Mar 1 17:17:30 2012 +0100 + + sim: update unlock retry counts after PIN change/enable operations + + src/mm-sim.c | 57 + ++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 46 insertions(+), 11 deletions(-) + +commit cd63df938f4fdf3fb656f715745608a9318d1c74 +Author: Aleksander Morgado +Date: Thu Mar 1 13:17:12 2012 +0100 + + libmm-common: `MMSimpleStatus' won't be considered internal any more + + Renamed `MMCommonSimpleProperties' to `MMSimpleStatus', and removed + the + `MMSimpleStatusProperties' provided in libmm-glib. We'll just use + the original + one from libmm-common always. + + cli/mmcli-modem-simple.c | 37 +++-- + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + libmm-common/mm-common-simple-properties.h | 86 ---------- + ...mmon-simple-properties.c => mm-simple-status.c} | 179 + +++++++++++++-------- + libmm-common/mm-simple-status.h | 85 ++++++++++ + libmm-glib/Makefile.am | 3 - + libmm-glib/mm-modem-simple-status-properties.c | 115 ------------- + libmm-glib/mm-modem-simple-status-properties.h | 50 ------ + libmm-glib/mm-modem-simple.c | 16 +- + libmm-glib/mm-modem-simple.h | 21 ++- + src/mm-broadband-modem.c | 4 +- + src/mm-iface-modem-3gpp-ussd.c | 2 +- + src/mm-iface-modem-3gpp-ussd.h | 2 +- + src/mm-iface-modem-3gpp.c | 8 +- + src/mm-iface-modem-3gpp.h | 2 +- + src/mm-iface-modem-cdma.c | 11 +- + src/mm-iface-modem-cdma.h | 2 +- + src/mm-iface-modem-location.c | 2 +- + src/mm-iface-modem-location.h | 2 +- + src/mm-iface-modem-messaging.c | 2 +- + src/mm-iface-modem-messaging.h | 2 +- + src/mm-iface-modem-simple.c | 10 +- + src/mm-iface-modem.c | 10 +- + src/mm-iface-modem.h | 2 +- + 25 files changed, 264 insertions(+), 399 deletions(-) + +commit bb352d5da30413e70a71d14acb952b7bedfe6f99 +Author: Aleksander Morgado +Date: Thu Mar 1 12:50:23 2012 +0100 + + libmm-common: `MMLocation3gpp' won't be considered internal any more + + Renamed `MMCommonLocation3gpp' to `MMLocation3gpp', and removed the + `MMModemLocation3gpp' provided in libmm-glib. We'll just use the + original one + from libmm-common always. + + cli/mmcli-modem-location.c | 14 ++-- + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + libmm-common/mm-common-location-3gpp.h | 68 --------------- + ...m-common-location-3gpp.c => mm-location-3gpp.c} | 96 + +++++++++++++--------- + libmm-common/mm-location-3gpp.h | 68 +++++++++++++++ + libmm-glib/Makefile.am | 2 - + libmm-glib/mm-modem-location-3gpp.c | 48 ----------- + libmm-glib/mm-modem-location-3gpp.h | 45 ---------- + libmm-glib/mm-modem-location.c | 12 +-- + libmm-glib/mm-modem-location.h | 24 +++--- + src/mm-iface-modem-location.c | 46 +++++------ + 12 files changed, 177 insertions(+), 256 deletions(-) + +commit 1385eb394f977ee3a7014bd0025fa65cd7e4a25a +Author: Aleksander Morgado +Date: Thu Mar 1 12:31:17 2012 +0100 + + libmm-common: `MMSimpleConnectProperties' won't be considered internal + any more + + Renamed `MMCommonConnectProperties' to `MMSimpleConnectProperties', + and removed + the `MMModemSimpleConnectProperties' provided in libmm-glib. We'll + just use the + original one from libmm-common always. + + cli/mmcli-modem-simple.c | 4 +- + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + libmm-common/mm-common-connect-properties.h | 121 --------------- + ...properties.c => mm-simple-connect-properties.c} | 164 + ++++++++++++++------- + libmm-common/mm-simple-connect-properties.h | 98 ++++++++++++ + libmm-glib/Makefile.am | 3 - + libmm-glib/mm-modem-simple-connect-properties.c | 123 ---------------- + libmm-glib/mm-modem-simple-connect-properties.h | 71 --------- + libmm-glib/mm-modem-simple.c | 10 +- + libmm-glib/mm-modem-simple.h | 5 +- + src/mm-iface-modem-simple.c | 17 +-- + 12 files changed, 230 insertions(+), 396 deletions(-) + +commit d306bb082f1237f6437e05b7a166df91f46655fb +Author: Aleksander Morgado +Date: Thu Mar 1 12:14:44 2012 +0100 + + libmm-common: `MMBearerProperties' won't be considered internal + any more + + Renamed `MMCommonBearerProperties' to `MMBearerProperties', and + removed the + `MMBearerProperties' provided in libmm-glib. We'll just use the + original one + from libmm-common always. + + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + ...-bearer-properties.c => mm-bearer-properties.c} | 200 + +++++++++++++-------- + libmm-common/mm-bearer-properties.h | 91 ++++++++++ + libmm-common/mm-common-bearer-properties.h | 107 ----------- + libmm-common/mm-common-connect-properties.c | 56 +++--- + libmm-common/mm-common-connect-properties.h | 4 +- + libmm-glib/Makefile.am | 3 - + libmm-glib/mm-bearer-properties.c | 190 + -------------------- + libmm-glib/mm-bearer-properties.h | 85 --------- + libmm-glib/mm-bearer.c | 2 +- + libmm-glib/mm-bearer.h | 2 - + libmm-glib/mm-modem.c | 6 +- + libmm-glib/mm-modem.h | 1 - + plugins/iridium/mm-bearer-iridium.c | 12 +- + plugins/iridium/mm-broadband-modem-iridium.c | 2 +- + plugins/novatel/mm-broadband-bearer-novatel.c | 2 +- + plugins/novatel/mm-broadband-bearer-novatel.h | 10 +- + plugins/novatel/mm-broadband-modem-novatel.c | 2 +- + src/mm-bearer-list.c | 2 +- + src/mm-bearer-list.h | 2 +- + src/mm-bearer.c | 6 +- + src/mm-bearer.h | 6 +- + src/mm-broadband-bearer.c | 38 ++-- + src/mm-broadband-bearer.h | 2 +- + src/mm-broadband-modem.c | 2 +- + src/mm-iface-modem-simple.c | 2 +- + src/mm-iface-modem.c | 6 +- + src/mm-iface-modem.h | 4 +- + 29 files changed, 301 insertions(+), 554 deletions(-) + +commit 323df60ed92d66e985a36a12fb334a0cca9bd1ea +Author: Aleksander Morgado +Date: Thu Mar 1 11:27:46 2012 +0100 + + libmm-common: `MMBearerIpConfig' won't be considered internal any more + + Renamed `MMCommonBearerIpConfig' to `MMBearerIpConfig', and removed + the + `MMBearerIpConfig' provided in libmm-glib. We'll just use the + original one + from libmm-common always. + + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + ...on-bearer-ip-config.c => mm-bearer-ip-config.c} | 126 + +++++++++++++-------- + libmm-common/mm-bearer-ip-config.h | 73 ++++++++++++ + libmm-common/mm-common-bearer-ip-config.h | 73 ------------ + libmm-glib/Makefile.am | 3 - + libmm-glib/mm-bearer-ip-config.c | 56 --------- + libmm-glib/mm-bearer-ip-config.h | 39 ------- + libmm-glib/mm-bearer.c | 4 +- + libmm-glib/mm-bearer.h | 1 - + plugins/iridium/mm-bearer-iridium.c | 14 +-- + plugins/novatel/mm-broadband-bearer-novatel.c | 14 +-- + src/mm-bearer.c | 12 +- + src/mm-bearer.h | 4 +- + src/mm-broadband-bearer.c | 38 +++---- + src/mm-broadband-bearer.h | 8 +- + 16 files changed, 205 insertions(+), 270 deletions(-) + +commit ef9fb0bfacac348c5bab35a3a99d52270e510d99 +Author: Aleksander Morgado +Date: Thu Mar 1 11:11:28 2012 +0100 + + libmm-common: `MMSmsProperties' won't be considered internal any more + + Renamed `MMCommonSmsProperties' to `MMSmsProperties', and removed the + `MMSmsProperties' provided in libmm-glib. We'll just use the + original one + from libmm-common always. + + libmm-common/Makefile.am | 8 +- + libmm-common/libmm-common.h | 2 +- + libmm-common/mm-common-sms-properties.h | 87 ------------ + ...common-sms-properties.c => mm-sms-properties.c} | 149 + +++++++++++++-------- + libmm-common/mm-sms-properties.h | 75 +++++++++++ + libmm-glib/Makefile.am | 3 - + libmm-glib/mm-modem-messaging.c | 6 +- + libmm-glib/mm-sms-properties.c | 76 ----------- + libmm-glib/mm-sms-properties.h | 54 -------- + libmm-glib/mm-sms.h | 2 - + src/mm-iface-modem-messaging.c | 4 +- + src/mm-sms.c | 18 +-- + src/mm-sms.h | 2 +- + 13 files changed, 185 insertions(+), 301 deletions(-) + +commit 3ccc78e8588acec9632863d30e310cdc76ad8598 +Author: Aleksander Morgado +Date: Thu Mar 1 00:22:22 2012 +0100 + + api: `UnlockRetries' will reply a list of per-lock retry counts + + Equivalent to `PinRetryCount' in the previous API. We don't have + an additional + property for the retry count of the current lock, as it really + is duplicating + information. + + cli/mmcli-modem.c | 32 ++--- + .../org.freedesktop.ModemManager1.Modem.xml | 11 +- + libmm-glib/mm-modem.c | 18 +-- + libmm-glib/mm-modem.h | 2 +- + src/mm-iface-modem.c | 140 + ++++++++++++++++++--- + src/mm-iface-modem.h | 16 ++- + 6 files changed, 158 insertions(+), 61 deletions(-) + +commit 036711eb1cea191e7acc3c3858eebef850238fa6 +Author: Aleksander Morgado +Date: Thu Mar 1 00:20:17 2012 +0100 + + libmm-common: new `MMUnlockRetries' helper object + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-unlock-retries.c | 218 + +++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-unlock-retries.h | 78 ++++++++++++++ + 4 files changed, 301 insertions(+) + +commit 7ab252f079f6d115ed13325f7749edc99c5b5b57 +Author: Aleksander Morgado +Date: Wed Feb 29 20:21:12 2012 +0100 + + cli: print list of enabled facility locks + + cli/mmcli-modem.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 2e1a322837016c826cf3c51f264d15c6b035aa57 +Author: Aleksander Morgado +Date: Wed Feb 29 20:18:48 2012 +0100 + + api,header: define facilities flags with bitwise operations instead + of hex values + + So that glib-mkenums detects that we're talking about flags. + + include/ModemManager-enums.h | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 9a442b01bc6e53fbeb42ce4d74a83b9a1218f915 +Author: Aleksander Morgado +Date: Wed Feb 29 20:17:58 2012 +0100 + + api,header: minor alignment fix + + include/ModemManager-enums.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit c66817622c8c0f7bd20cd423b8b813d3df671fa6 +Author: Aleksander Morgado +Date: Wed Feb 29 20:12:18 2012 +0100 + + broadband-modem: implement default facility locks status loading + + src/mm-broadband-modem.c | 151 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 151 insertions(+) + +commit 491d8e03f99baded9f59a97daddc06cd223ef4bd +Author: Aleksander Morgado +Date: Wed Feb 29 19:36:52 2012 +0100 + + iface-modem-3gpp: update facilities mask when SIM PIN lock enabling + status changes + + src/mm-iface-modem-3gpp.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +commit a797d6d68382b546e8b6e22f4f533cc44a7ac7ee +Author: Aleksander Morgado +Date: Wed Feb 29 19:36:00 2012 +0100 + + sim: signal when the pin lock enabling status changes + + src/Makefile.am | 1 + + src/mm-marshal.list | 1 + + src/mm-sim.c | 24 +++++++++++++++++++++++- + src/mm-sim.h | 8 ++++++++ + 4 files changed, 33 insertions(+), 1 deletion(-) + +commit eb87c2fe07e209d8226d3f3bcdbe1825fb7b6591 +Author: Aleksander Morgado +Date: Wed Feb 29 19:35:34 2012 +0100 + + iface-modem-3gpp: load initial set of enabled facility locks + + src/mm-iface-modem-3gpp.c | 34 ++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 ++++++++ + 2 files changed, 42 insertions(+) + +commit 75a2b407bdd976b862d5745705afc41b3c3fa7ac +Author: Aleksander Morgado +Date: Wed Feb 29 16:57:41 2012 +0100 + + modem-helpers: port facility lock related helpers to use + `MMModemFacility' enums + + src/mm-modem-helpers.c | 138 + ++++++++++++++++++++----------------------------- + src/mm-modem-helpers.h | 15 +++--- + 2 files changed, 63 insertions(+), 90 deletions(-) + +commit 1628f495fe5f38c579f87920ef492a47ef73335e +Author: Aleksander Morgado +Date: Wed Feb 29 12:49:46 2012 +0100 + + libmm-common,tests: include tests when running make check/distcheck + + libmm-common/tests/Makefile.am | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 8f200940ecebb566e7a978581a8fd566e41564e5 +Author: Aleksander Morgado +Date: Wed Feb 29 12:49:20 2012 +0100 + + tests: fix automake rule dependencies + + We need to ensure all test programs are built. + + src/tests/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 10d9775c541bbcd4de54bfcd774fe7a23c23a620 +Author: Aleksander Morgado +Date: Wed Feb 29 11:40:39 2012 +0100 + + TODO: new file with a list of pending things and ideas + + TODO | 134 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 134 insertions(+) + +commit 64f49c0c7261d7de2eae03477cd69cf540184041 +Author: Aleksander Morgado +Date: Tue Feb 28 23:24:53 2012 +0100 + + iface-modem: the Command() method is only allowed when running in + debug mode + + introspection/org.freedesktop.ModemManager1.Modem.xml | 9 ++++++--- + src/mm-iface-modem.c | 12 ++++++++++++ + 2 files changed, 18 insertions(+), 3 deletions(-) + +commit 952b9164b9ae2af4d1fd18f77d4b97bfa4d78eab +Author: Aleksander Morgado +Date: Tue Feb 28 23:09:10 2012 +0100 + + context: new source files to keep the daemon context + + src/Makefile.am | 2 ++ + src/main.c | 38 +++++------------------ + src/mm-context.c | 91 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-context.h | 30 +++++++++++++++++++ + 4 files changed, 131 insertions(+), 30 deletions(-) + +commit 1701230f5164087bd7c279c35c8797ae1e80f0d5 +Author: Aleksander Morgado +Date: Tue Feb 28 22:48:00 2012 +0100 + + plugin-base: remove the SORT_LAST property + + Plugins that need to get sorted last by the PluginManager can now + be determined + just by looking at the post probing filters. + + plugins/cinterion/mm-plugin-cinterion.c | 1 - + plugins/iridium/mm-plugin-iridium.c | 1 - + src/mm-plugin-base.c | 23 ++++------------------- + 3 files changed, 4 insertions(+), 21 deletions(-) + +commit 03fbdece7178d3b65e4a8ed2825dc45b4c9527ff +Author: Aleksander Morgado +Date: Tue Feb 28 22:46:22 2012 +0100 + + plugin: remove unnecessary callback type + + src/mm-plugin.h | 11 ----------- + 1 file changed, 11 deletions(-) + +commit b6203ab425651e78fdab0219b686c5e24a1bc661 +Author: Nathan Williams +Date: Tue Feb 28 12:52:34 2012 -0500 + + libmm-glib: set the gdbus timeout to a value longer than that remote + operation timeout + + Lets commands like "mmcli -m 0 --command-timeout=60 + --command='+COPS=?'" work, + instead of tripping over the 25-second gdbus default timeout first. + + Change-Id: I67034423ca5ab08a07ecf3c9e313082d4860ffb3 + + libmm-glib/mm-modem.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit 6f22eb6a635a9c2f132df1da3082949dc4ef826b +Author: Nathan Williams +Date: Tue Feb 28 10:13:10 2012 -0500 + + broadband-bearer: don't choke if an APN wasn't specified when parsing + PDP list + + Change-Id: I1535fdae0659ae049b4a795d85017abe1fea6be8 + + src/mm-broadband-bearer.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 94a110960e2401294a86c96575ec2a2d4fd61ce4 +Author: Nathan Williams +Date: Mon Feb 27 13:33:15 2012 -0500 + + broadband-bearer: split out "dial" as a separate phase of the 3gpp + connection + + So that we can override it in modems that use a different sequence + to get a net + connection instead of a PPP connection. + + Change-Id: I9c5635a7635b66eb7bca9ec9552d2d7794bc8827 + + src/mm-broadband-bearer.c | 207 + +++++++++++++++++++++++++++++++++++++--------- + src/mm-broadband-bearer.h | 12 +++ + 2 files changed, 180 insertions(+), 39 deletions(-) + +commit 36fbfab3e6c62ae7e4c7270dc55bf2d61d49bd98 +Author: Aleksander Morgado +Date: Tue Feb 28 21:33:21 2012 +0100 + + docs: document Modem probing and global state machine + + docs/reference/api/ModemManager-overview.xml | 575 + ++++++++++++++++++++++++++- + 1 file changed, 562 insertions(+), 13 deletions(-) + +commit 5f85cfc352ddaf5ce583894c6209c422be3d890f +Author: Aleksander Morgado +Date: Tue Feb 28 10:48:17 2012 +0100 + + docs: fix path of images + + PNGs are copied over to the HTML directory, so they will always be + available in + the same directory as the final HTML files. + + docs/reference/api/ModemManager-overview.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c4581af5d910fd5d823f0c7c36fec4e0acd59388 +Author: Aleksander Morgado +Date: Tue Feb 28 10:47:38 2012 +0100 + + docs: set `ModemManager' as module name instead of `mm' + + .gitignore | + 10 +++++----- + docs/reference/api/Makefile.am | + 10 +++++----- + .../{mm-dbus-reference.xml => ModemManager-dbus-reference.xml} | 0 + docs/reference/api/{mm-docs.xml => ModemManager-docs.xml} | + 6 +++--- + .../api/{mm-overview.xml => ModemManager-overview.xml} | 0 + .../api/{mm-sections.txt => ModemManager-sections.txt} | 0 + docs/reference/api/{mm.types => ModemManager.types} | 0 + 7 files changed, 13 insertions(+), 13 deletions(-) + +commit 21c0731ad96d3e406f061075584e4f26db17607c +Author: Aleksander Morgado +Date: Tue Feb 28 01:25:30 2012 +0100 + + tests: fix CGDCONT reply test, NULL expected instead of empty string + + src/tests/test-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7f0afa078b860c84ae3d178e8f90dbe94a43dab4 +Author: Aleksander Morgado +Date: Tue Feb 28 01:01:51 2012 +0100 + + build: fix distcheck + + Need to pass the full path of the input files to the glib-mkenums + call. This is + because we use an explicit list given in a $(VARIABLE) instead of + the built-in + automake variables (e.g. $<) + + src/Makefile.am | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0c6dad40a0926795cf33da5a4f557302a50a8639 +Author: Aleksander Morgado +Date: Tue Feb 28 00:59:50 2012 +0100 + + build: get path of `glib-mkenums' from pkg-config + + configure.ac | 3 +++ + libmm-common/Makefile.am | 8 ++++---- + src/Makefile.am | 8 ++++---- + 3 files changed, 11 insertions(+), 8 deletions(-) + +commit 3e511f90c70f7eae68c3452998dbf28c8b1ec764 +Author: Aleksander Morgado +Date: Tue Feb 28 00:45:04 2012 +0100 + + build: don't distribute generated sources + + libmm-common/Makefile.am | 6 ++++-- + src/Makefile.am | 22 +++++++++++++++------- + 2 files changed, 19 insertions(+), 9 deletions(-) + +commit 1ad7bc885d69c291f643952c08a36fd97eb54c21 +Author: Aleksander Morgado +Date: Tue Feb 28 00:17:40 2012 +0100 + + build: ensure gtk-doc is enabled when doing dist + + docs/Makefile.am | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit ca9104dcb4a9d84f6fb224510f17bb24e3d823a8 +Author: Aleksander Morgado +Date: Tue Feb 28 00:17:16 2012 +0100 + + build: generate PNG files automatically from DIA files + + .gitignore | 1 + + configure.ac | 8 ++++++++ + docs/reference/api/Makefile.am | 22 ++++++++++++++++++++-- + docs/reference/api/ModemManager-states.png | Bin 28305 -> 0 bytes + 4 files changed, 29 insertions(+), 2 deletions(-) + +commit e26f6ef1769349cdfa81b4265b35f514559ca16c +Author: Aleksander Morgado +Date: Tue Feb 28 00:03:10 2012 +0100 + + po: fix policy filename to translate + + po/POTFILES.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 7d9d003324bb6a466104c7d935758ca29aeac9e5 +Author: Aleksander Morgado +Date: Mon Feb 27 23:11:17 2012 +0100 + + build: rename the binary from `modem-manager' to `ModemManager' + + .gitignore | 6 ++---- + configure.ac | 2 +- + data/Makefile.am | 2 +- + data/{modem-manager.png => ModemManager.png} | Bin + data/org.freedesktop.ModemManager1.policy.in | 2 +- + data/org.freedesktop.ModemManager1.service.in | 2 +- + docs/man/Makefile.am | 4 ++-- + docs/man/{modem-manager.8.in => ModemManager.8.in} | 21 + ++++++++++----------- + src/Makefile.am | 14 +++++++------- + 9 files changed, 25 insertions(+), 28 deletions(-) + +commit 12786d21cf6573a9851882cb109d9490ea6904d3 +Author: Aleksander Morgado +Date: Mon Feb 27 23:00:11 2012 +0100 + + core: remove uses of `MMModemStateReason' + + Use `MMModemStateChangeReason' instead. + + src/mm-iface-modem-3gpp.c | 4 ++-- + src/mm-iface-modem-cdma.c | 8 ++++---- + src/mm-iface-modem.c | 4 ++-- + src/mm-iface-modem.h | 4 ++-- + 4 files changed, 10 insertions(+), 10 deletions(-) + +commit 8b78e037a2b1e81f27e75d3645fbadb34ee9abe1 +Author: Aleksander Morgado +Date: Mon Feb 27 22:59:35 2012 +0100 + + modem-helpers: temporarily disable facility-related helpers + + src/mm-modem-helpers.c | 5 +++++ + src/mm-modem-helpers.h | 5 ++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +commit f1999ef4a3bb61b82956a93f2cc9c4ec72de47c5 +Author: Aleksander Morgado +Date: Mon Feb 27 22:49:43 2012 +0100 + + api,header: cleanup public header file + + include/Makefile.am | 1 - + include/ModemManager.h | 152 + +++--------------------------------------------- + include/ModemManager1.h | 32 ---------- + 3 files changed, 9 insertions(+), 176 deletions(-) + +commit e68db23a97df9cf94ebcb0b63fc83b4cdb0d9b78 +Author: Aleksander Morgado +Date: Mon Feb 27 22:32:53 2012 +0100 + + introspection: setup all new files and remove old ones + + data/Makefile.am | 7 - + include/Makefile.am | 6 +- + introspection/Makefile.am | 27 +- + introspection/all.xml | 53 +--- + introspection/mm-mobile-error.xml | 318 + ------------------- + introspection/mm-modem-connect-error.xml | 30 -- + introspection/mm-modem-error.xml | 36 --- + introspection/mm-serial-error.xml | 24 -- + introspection/org.freedesktop.DBus.Properties.xml | 45 --- + .../org.freedesktop.ModemManager.Modem.Cdma.xml | 220 ------------- + ...org.freedesktop.ModemManager.Modem.Firmware.xml | 114 ------- + ...org.freedesktop.ModemManager.Modem.Gsm.Card.xml | 154 ---------- + ...freedesktop.ModemManager.Modem.Gsm.Contacts.xml | 104 ------- + .../org.freedesktop.ModemManager.Modem.Gsm.Hso.xml | 19 -- + ....freedesktop.ModemManager.Modem.Gsm.Network.xml | 340 + --------------------- + .../org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 158 ---------- + ...org.freedesktop.ModemManager.Modem.Gsm.Ussd.xml | 84 ----- + .../org.freedesktop.ModemManager.Modem.Gsm.xml | 208 ------------- + ...org.freedesktop.ModemManager.Modem.Location.xml | 253 --------------- + .../org.freedesktop.ModemManager.Modem.Simple.xml | 59 ---- + .../org.freedesktop.ModemManager.Modem.xml | 319 + ------------------- + introspection/org.freedesktop.ModemManager.xml | 61 ---- + .../org.freedesktop.ModemManager1.Bearer.xml | 0 + ...rg.freedesktop.ModemManager1.Modem.Contacts.xml | 0 + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 0 + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 0 + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 0 + ...edesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml | 0 + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 0 + ...g.freedesktop.ModemManager1.Modem.ModemCdma.xml | 0 + .../org.freedesktop.ModemManager1.Modem.Simple.xml | 0 + .../org.freedesktop.ModemManager1.Modem.xml | 0 + .../org.freedesktop.ModemManager1.Sim.xml | 0 + .../org.freedesktop.ModemManager1.Sms.xml | 0 + .../org.freedesktop.ModemManager1.xml | 0 + libmm-common/Makefile.am | 26 +- + new/all.xml | 18 -- + 37 files changed, 34 insertions(+), 2649 deletions(-) + +commit 6887a6850c5ed75baaae2aa1b40a707b89b7c2d9 +Author: Aleksander Morgado +Date: Mon Feb 27 16:36:40 2012 +0100 + + marshallers: cleanup unneeded ones + + src/mm-marshal.list | 10 ---------- + 1 file changed, 10 deletions(-) + +commit c55b5d097e8bfcfbcc956f45ac18e8c795100195 +Author: Aleksander Morgado +Date: Mon Feb 27 16:35:42 2012 +0100 + + marshallers: integrate them into the daemon compilation + + .gitignore | 2 +- + Makefile.am | 2 +- + configure.ac | 1 - + marshallers/Makefile.am | 21 --------------------- + marshallers/mm-marshal-main.c | 2 -- + src/Makefile.am | 28 +++++++++++++++++++++------- + {marshallers => src}/mm-marshal.list | 0 + 7 files changed, 23 insertions(+), 33 deletions(-) + +commit f42eb8684bd1d3d46f93de24c5ac98f18880f7d4 +Author: Aleksander Morgado +Date: Mon Feb 27 16:22:17 2012 +0100 + + build: look for src/main.c in autogen.sh + + autogen.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 5c73e8d200a16a3f83be475705f61c6e11bec491 +Author: Aleksander Morgado +Date: Mon Feb 27 16:14:58 2012 +0100 + + build: remove obsolete files + + This will very likely create lots of conflicts until the branch + gets merged + into master, but anyway... + + .../NetworkManager-r4359-use-modem-manager.patch | 5691 + ---------------- + .../nm-applet-r1053-use-modem-manager.patch | 2253 ------- + src/mm-callback-info.c | 276 - + src/mm-callback-info.h | 87 - + src/mm-generic-cdma.c | 2626 -------- + src/mm-generic-cdma.h | 155 - + src/mm-generic-gsm.c | 7020 + -------------------- + src/mm-generic-gsm.h | 265 - + src/mm-modem-base.c | 1323 ---- + src/mm-modem-base.h | 121 - + src/mm-modem-cdma.c | 433 -- + src/mm-modem-cdma.h | 126 - + src/mm-modem-firmware.c | 316 - + src/mm-modem-firmware.h | 72 - + src/mm-modem-gsm-card.c | 702 -- + src/mm-modem-gsm-card.h | 134 - + src/mm-modem-gsm-network.c | 647 -- + src/mm-modem-gsm-network.h | 158 - + src/mm-modem-gsm-sms.c | 836 --- + src/mm-modem-gsm-sms.h | 114 - + src/mm-modem-gsm-ussd.c | 404 -- + src/mm-modem-gsm-ussd.h | 95 - + src/mm-modem-location.c | 331 - + src/mm-modem-location.h | 69 - + src/mm-modem-simple.c | 156 - + src/mm-modem-simple.h | 59 - + src/mm-modem.c | 1008 --- + src/mm-modem.h | 300 - + src/mm-properties-changed-signal.c | 352 - + src/mm-properties-changed-signal.h | 40 - + src/mm-sms-utils.c | 795 --- + src/mm-sms-utils.h | 49 - + 32 files changed, 27013 deletions(-) + +commit 17ef0777976b3897972fcc14e5efc09d6bc60b55 +Author: Aleksander Morgado +Date: Mon Feb 27 16:02:05 2012 +0100 + + sms: include policy authorization checks + + src/mm-sms.c | 179 + +++++++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 124 insertions(+), 55 deletions(-) + +commit d6edfbd9d585d55e43d9119711353093fda90de3 +Author: Aleksander Morgado +Date: Mon Feb 27 16:01:52 2012 +0100 + + policy: implement Sms interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 333779bda9046a5c3055e9093eb3acd6ef7e6264 +Author: Aleksander Morgado +Date: Mon Feb 27 15:00:35 2012 +0100 + + iface-modem-messaging: include policy authorization checks + + src/mm-iface-modem-messaging.c | 169 + +++++++++++++++++++++++++++-------------- + 1 file changed, 112 insertions(+), 57 deletions(-) + +commit 4bdeea41aefcc388ca3d8e5937033cd90a3b9c17 +Author: Aleksander Morgado +Date: Mon Feb 27 13:15:08 2012 +0100 + + policy: implement Messaging interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit e2a5ab250e8fdce0090bc517be1ede64fb467fe6 +Author: Aleksander Morgado +Date: Mon Feb 27 13:04:12 2012 +0100 + + iface-modem-location: include policy authorization checks + + src/mm-iface-modem-location.c | 253 + ++++++++++++++++++++++++++---------------- + 1 file changed, 156 insertions(+), 97 deletions(-) + +commit 8e1955cb88be5e5ad6f1088efa0ca0792117761d +Author: Aleksander Morgado +Date: Mon Feb 27 12:51:33 2012 +0100 + + policy: implement Location interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 1d1936e1ce1d7fc616b7bbe29fc1d73963eb6f4a +Author: Aleksander Morgado +Date: Mon Feb 27 12:47:56 2012 +0100 + + iface-modem-3gpp-ussd: include policy authorization checks + + src/mm-iface-modem-3gpp-ussd.c | 251 + ++++++++++++++++++++++++++++------------- + 1 file changed, 170 insertions(+), 81 deletions(-) + +commit eaa47892b582ebfc613822457ba201616f44706e +Author: Aleksander Morgado +Date: Mon Feb 27 12:47:28 2012 +0100 + + policy: implement USSD interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit b4bed06f985373acf6460aae61e3e0a167474e6e +Author: Aleksander Morgado +Date: Mon Feb 27 12:23:05 2012 +0100 + + bearer: include policy authorization checks + + src/mm-bearer.c | 147 + ++++++++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 117 insertions(+), 30 deletions(-) + +commit cf0a4ae0ceb6c3ba30e94beb607f1d7afc2d4301 +Author: Aleksander Morgado +Date: Mon Feb 27 12:22:54 2012 +0100 + + policy: implement Bearer interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 454e3ab3612dc518f38edf8a3c3fcf8058d94776 +Author: Aleksander Morgado +Date: Mon Feb 27 12:09:18 2012 +0100 + + sim: include policy authorization checks + + src/mm-sim.c | 335 + ++++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 276 insertions(+), 59 deletions(-) + +commit 986ab0cb233521f0d90577d2600cf0d24ddda8e1 +Author: Aleksander Morgado +Date: Mon Feb 27 12:08:59 2012 +0100 + + policy: implement Sim interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit da0aa7af2a884ac484210d04bfaa04ab5786775f +Author: Aleksander Morgado +Date: Mon Feb 27 11:43:27 2012 +0100 + + iface-modem-cdma: include policy authorization checks + + src/mm-iface-modem-cdma.c | 283 + +++++++++++++++++++++------------------------- + src/mm-iface-modem-cdma.h | 18 --- + 2 files changed, 126 insertions(+), 175 deletions(-) + +commit 96fdb716e1d3f7da8ba208ad38b001b4de8000a0 +Author: Aleksander Morgado +Date: Mon Feb 27 11:43:11 2012 +0100 + + policy: implement CDMA interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 71a3de448627e41bb342a37b1a8149e862d23ba1 +Author: Aleksander Morgado +Date: Mon Feb 27 11:26:43 2012 +0100 + + iface-modem-3gpp: include policy authorization checks + + src/mm-iface-modem-3gpp.c | 205 + ++++++++++++++++++++++++++++------------------ + 1 file changed, 126 insertions(+), 79 deletions(-) + +commit 83586c9a629cb959cf44aaa2fd03a293a24d5491 +Author: Aleksander Morgado +Date: Mon Feb 27 11:26:30 2012 +0100 + + policy: implement 3GPP interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 6a655f5daf63dd3f74b353a269e49d9496ad8cf2 +Author: Aleksander Morgado +Date: Mon Feb 27 11:06:16 2012 +0100 + + iface-modem-simple: include policy authorization checks + + src/mm-iface-modem-simple.c | 109 + ++++++++++++++++++++++++++++++-------------- + 1 file changed, 75 insertions(+), 34 deletions(-) + +commit f2440e9ab2b104d8a9eddbaa5a516461d9fcdf31 +Author: Aleksander Morgado +Date: Sun Feb 26 22:53:25 2012 +0100 + + policy: implement Simple interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 22407477158d6840040b246a260da475acdb54d6 +Author: Aleksander Morgado +Date: Mon Feb 27 10:40:03 2012 +0100 + + iface-modem: include policy authorization checks + + src/mm-iface-modem.c | 711 + ++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 510 insertions(+), 201 deletions(-) + +commit e176d56b32193191ef937a82902a28dabcca834d +Author: Aleksander Morgado +Date: Sun Feb 26 22:49:48 2012 +0100 + + policy: implement Modem interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 41 + ++++++++++++++++++++++++++ + 1 file changed, 41 insertions(+) + +commit d5deb2bb1408732ceaee5467f7d5fafbfb5e53e5 +Author: Aleksander Morgado +Date: Tue Feb 21 12:46:48 2012 +0100 + + manager: use new simplified authentication setup + + src/mm-manager.c | 158 + +++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 108 insertions(+), 50 deletions(-) + +commit dad31604cb4237d94df0d85ecb61fe46aa42fa78 +Author: Aleksander Morgado +Date: Sun Feb 26 22:45:03 2012 +0100 + + policy: implement Manager interface rules + + data/org.freedesktop.ModemManager1.conf.polkit | 24 + +++++++++++++++++++++--- + 1 file changed, 21 insertions(+), 3 deletions(-) + +commit d06d76e3796b1fed7efe1990b27497e42f16d984 +Author: Aleksander Morgado +Date: Mon Feb 27 10:39:08 2012 +0100 + + policy: no need for a rule to manage readable info + + data/org.freedesktop.ModemManager1.policy.in | 9 --------- + 1 file changed, 9 deletions(-) + +commit 587bca48f07a70d9036e679de269bc0d9aeab4d6 +Author: Aleksander Morgado +Date: Sun Feb 26 22:39:12 2012 +0100 + + policy: renamed `Sms' action to `Messaging' + + data/org.freedesktop.ModemManager1.policy.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5ab3ec6bce3e756f481bdac11905ae1b383689e0 +Author: Aleksander Morgado +Date: Tue Feb 21 12:48:23 2012 +0100 + + build: require polkit-gobject >= 0.97 + + It's new enough, and it lets us use polkit_authority_get_sync(). + + configure.ac | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit 3e5b42569b02814cf07e936a475e590f0878c1ba +Author: Aleksander Morgado +Date: Tue Feb 21 12:46:36 2012 +0100 + + base-modem: use new simplified authentication setup + + src/mm-base-modem.c | 88 + ++++++++++++++++++++++++++++++++++------------------- + src/mm-base-modem.h | 21 ++++++------- + 2 files changed, 65 insertions(+), 44 deletions(-) + +commit 089a98385071527ca17925f8cd63f79cff02f8de +Author: Aleksander Morgado +Date: Tue Feb 21 12:45:50 2012 +0100 + + auth: refactor and simplify authentication related setup + + We get rid of the MMAuthRequests; and we leave up to the caller and + user of the + MMAuthProvider the handling of request cancellations through the + provided + GCancellable. + + Also made GIO-async-friendly methods. + + src/Makefile.am | 26 +-- + src/mm-auth-provider-polkit.c | 232 ++++++++++++--------- + src/mm-auth-provider-polkit.h | 21 +- + src/mm-auth-provider.c | 283 + ++++---------------------- + src/mm-auth-provider.h | 92 ++++----- + src/mm-auth-request-polkit.c | 174 ---------------- + src/mm-auth-request-polkit.h | 51 ----- + src/mm-auth-request.c | 182 ----------------- + src/mm-auth-request.h | 70 ------- + src/{mm-auth-provider-factory.c => mm-auth.c} | 34 ++-- + src/mm-auth.h | 27 +++ + 11 files changed, 286 insertions(+), 906 deletions(-) + +commit 7316f4645bf82a8586507a4f7abf57bf9470d309 +Author: Aleksander Morgado +Date: Tue Feb 21 12:26:29 2012 +0100 + + iface-modem-3gpp-ussd: fix copyrights + + src/mm-iface-modem-3gpp-ussd.c | 1 + + src/mm-iface-modem-3gpp-ussd.h | 1 + + 2 files changed, 2 insertions(+) + +commit 8e640d3adcabac0373ec0ee916bf665d08cbe2f6 +Author: Nathan Williams +Date: Wed Feb 22 08:41:18 2012 +0100 + + novatel: new plugin for the Novatel E362 + + plugins/Makefile.am | 13 + + plugins/novatel/mm-broadband-bearer-novatel.c | 422 + ++++++++++++++++++++++++ + plugins/novatel/mm-broadband-bearer-novatel.h | 60 ++++ + plugins/novatel/mm-broadband-modem-novatel.c | 452 + ++++++++++++++++++++++++++ + plugins/novatel/mm-broadband-modem-novatel.h | 50 +++ + plugins/novatel/mm-plugin-novatel.c | 111 +++++++ + plugins/novatel/mm-plugin-novatel.h | 47 +++ + 7 files changed, 1155 insertions(+) + +commit e992d5cbd1d6bf1d56df6451bd6fdb35d0253c7d +Author: Aleksander Morgado +Date: Wed Feb 22 08:26:21 2012 +0100 + + charsets: fix compilation with -Werror=maybe-uninitialized + + src/mm-charsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 38b7e6e129126caf442738ceb4a4c80502e7bbc1 +Author: Aleksander Morgado +Date: Mon Feb 20 16:37:15 2012 +0100 + + build: so long dbus-glib, and thanks for all the fish + + configure.ac | 7 ------- + 1 file changed, 7 deletions(-) + +commit 7a892b74cb5473b10b49aee6a9f9793b7c8e826d +Author: Aleksander Morgado +Date: Mon Feb 20 16:40:18 2012 +0100 + + build: don't build the MMCallbackInfo, we're now fully GIO-Async + instead + + src/Makefile.am | 2 -- + 1 file changed, 2 deletions(-) + +commit 680e292914fd9be1ca155e874b8b41ee4a106709 +Author: Aleksander Morgado +Date: Mon Feb 20 16:36:09 2012 +0100 + + build: fix header dependencies + + We shouldn't depend on any header file from the previous + implementation. + + plugins/cinterion/mm-plugin-cinterion.c | 3 ++- + plugins/generic/mm-plugin-generic.c | 2 +- + plugins/gobi/mm-plugin-gobi.c | 2 +- + plugins/iridium/mm-plugin-iridium.c | 3 ++- + plugins/motorola/mm-plugin-motorola.c | 2 +- + plugins/nokia/mm-plugin-nokia.c | 2 +- + plugins/option/mm-plugin-option.c | 2 +- + plugins/option/mm-plugin-option.h | 1 - + src/mm-base-modem.h | 3 ++- + src/mm-modem-helpers.h | 1 - + src/tests/test-modem-helpers.c | 1 + + 11 files changed, 12 insertions(+), 10 deletions(-) + +commit 4de848de39111f8e836400ba207977ad5b4add5f +Author: Aleksander Morgado +Date: Mon Feb 20 16:27:37 2012 +0100 + + tests,sms: print traces if enabled during compilation + + src/tests/test-sms-part.c | 32 +++++++++++++++++++------------- + 1 file changed, 19 insertions(+), 13 deletions(-) + +commit 2522acf8998cbf9d9166988d857fe27c61834271 +Author: Aleksander Morgado +Date: Mon Feb 20 16:15:13 2012 +0100 + + tests,sms: refactor SMS part related tests + + Now using the MMSmsPart setup. + + .gitignore | 2 +- + src/Makefile.am | 4 +- + src/tests/Makefile.am | 12 +- + src/tests/test-sms-part.c | 648 + +++++++++++++++++++++++++++++++++++++++++++ + src/tests/test-sms.c | 690 + ---------------------------------------------- + 5 files changed, 657 insertions(+), 699 deletions(-) + +commit 5bee67c032df8d9127c8c0aeb88cbd3c0c844b4b +Author: Aleksander Morgado +Date: Mon Feb 20 13:36:18 2012 +0100 + + core: use GDBusMethodInvocation in the auth API + + src/mm-auth-provider-polkit.c | 3 +-- + src/mm-auth-provider.c | 7 +++---- + src/mm-auth-provider.h | 8 +++----- + src/mm-auth-request-polkit.c | 11 +++++------ + src/mm-auth-request-polkit.h | 6 ++---- + src/mm-auth-request.c | 6 +++--- + src/mm-auth-request.h | 8 +++----- + 7 files changed, 20 insertions(+), 29 deletions(-) + +commit 5f167fd199ce7cc359aa1d884df9b332aa669a79 +Author: Aleksander Morgado +Date: Mon Feb 20 13:13:55 2012 +0100 + + Revert "core: avoid using DBusGMethodInvocation in auth API" + + This reverts commit 013fd179f458d87bba9fd7657ffe1bd90169f231. + + We will start using GDBus-only based code from now on. + + src/mm-auth-provider-polkit.c | 29 ++++++++--------------------- + src/mm-auth-provider.c | 4 ++-- + src/mm-auth-provider.h | 4 ++-- + src/mm-auth-request-polkit.c | 9 ++++++--- + src/mm-auth-request-polkit.h | 3 +-- + src/mm-auth-request.c | 4 ++-- + src/mm-auth-request.h | 7 ++----- + src/mm-modem-cdma.c | 2 +- + src/mm-modem-firmware.c | 6 +++--- + src/mm-modem-gsm-card.c | 16 ++++++++-------- + src/mm-modem-gsm-network.c | 2 +- + src/mm-modem-gsm-sms.c | 16 ++++++++-------- + src/mm-modem-gsm-ussd.c | 6 +++--- + src/mm-modem-location.c | 4 ++-- + src/mm-modem.c | 4 ++-- + 15 files changed, 51 insertions(+), 65 deletions(-) + +commit 080d046e643a203b7f37c464e38108f6083943ed +Author: Aleksander Morgado +Date: Mon Feb 20 12:57:08 2012 +0100 + + iface-modem: load allowed/preferred modes during modem enabling + + src/mm-iface-modem.c | 59 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 10 +++++++++ + 2 files changed, 69 insertions(+) + +commit 8396d8a82f05a548d5bc5c058713b413964d7c0a +Author: Aleksander Morgado +Date: Mon Feb 20 09:53:46 2012 +0100 + + option: implement default access technology loading + + plugins/option/mm-broadband-modem-option.c | 339 + ++++++++++++++++++++++++++++- + 1 file changed, 338 insertions(+), 1 deletion(-) + +commit 205313b783d63aa4a61520c351f5db74141b5d8e +Author: Aleksander Morgado +Date: Sun Feb 19 13:05:33 2012 +0100 + + option: start porting the Option plugin + + plugins/Makefile.am | 23 ++--- + plugins/option/mm-broadband-modem-option.c | 70 +++++++++++++++ + plugins/option/mm-broadband-modem-option.h | 49 +++++++++++ + plugins/option/mm-plugin-option.c | 133 + +++++++++++++++++++++++++++++ + plugins/{ => option}/mm-plugin-option.h | 3 +- + 5 files changed, 266 insertions(+), 12 deletions(-) + +commit 725745399ae5596e96176ea20e346a02e9a7852d +Author: Aleksander Morgado +Date: Sun Feb 19 11:45:53 2012 +0100 + + generic: new Generic-specific source directory + + plugins/Makefile.am | 4 ++-- + plugins/{ => generic}/mm-plugin-generic.c | 0 + plugins/{ => generic}/mm-plugin-generic.h | 0 + 3 files changed, 2 insertions(+), 2 deletions(-) + +commit ab3d53741665d2dff80ee27a1e958efb92ddde17 +Author: Aleksander Morgado +Date: Sun Feb 19 11:43:53 2012 +0100 + + motorola: fully ported the moto-c plugin + + plugins/Makefile.am | 20 +-- + plugins/mm-modem-moto-c-gsm.c | 133 ------------------- + plugins/mm-modem-moto-c-gsm.h | 45 ------- + plugins/mm-plugin-moto-c.c | 172 + ------------------------- + plugins/mm-plugin-moto-c.h | 43 ------- + plugins/motorola/mm-broadband-modem-motorola.c | 87 +++++++++++++ + plugins/motorola/mm-broadband-modem-motorola.h | 49 +++++++ + plugins/motorola/mm-plugin-motorola.c | 119 +++++++++++++++++ + plugins/motorola/mm-plugin-motorola.h | 42 ++++++ + 9 files changed, 307 insertions(+), 403 deletions(-) + +commit d255902f9bab5d92b3fbb2e4382bcbb7ca4ed6ef +Author: Aleksander Morgado +Date: Sun Feb 19 10:53:16 2012 +0100 + + gobi: remove old sources, plugin fully ported + + plugins/mm-modem-gobi-gsm.c | 175 + -------------------------------------------- + plugins/mm-modem-gobi-gsm.h | 45 ------------ + 2 files changed, 220 deletions(-) + +commit ecc5b4f26005e618321d6ca5bb127a8fd0091cb5 +Author: Aleksander Morgado +Date: Sun Feb 19 10:52:36 2012 +0100 + + gobi: new Gobi-specific source directory + + plugins/Makefile.am | 8 ++++---- + plugins/{ => gobi}/mm-broadband-modem-gobi.c | 0 + plugins/{ => gobi}/mm-broadband-modem-gobi.h | 0 + plugins/{ => gobi}/mm-plugin-gobi.c | 0 + plugins/{ => gobi}/mm-plugin-gobi.h | 0 + 5 files changed, 4 insertions(+), 4 deletions(-) + +commit d09dfbb7d1eed75c28576d0461a62cbec3b5127f +Author: Aleksander Morgado +Date: Sun Feb 19 10:50:11 2012 +0100 + + gobi: access technology loading implementation + + plugins/mm-broadband-modem-gobi.c | 55 + ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 54 insertions(+), 1 deletion(-) + +commit 1359c0a9282d46f7cc84786bd2a5ac6033d371d8 +Author: Aleksander Morgado +Date: Sun Feb 19 10:49:36 2012 +0100 + + modem-helpers: updated the string to access technology converter + + We can now return a mask of flags specifying more than one access + technology, + and therefore the order is not really important any more, unless + for special + cases like looking for substrings of valid expected strings (e.g + "HSPA" and + "HSPA+"). + + Also, add "LTE" in the list of expected strings. + + src/mm-modem-helpers.c | 57 + +++++++++++++++++++++++++++++--------------------- + src/mm-modem-helpers.h | 2 +- + 2 files changed, 34 insertions(+), 25 deletions(-) + +commit 4315208cfa572d83f5c385f746de8bde46aa2f45 +Author: Aleksander Morgado +Date: Sun Feb 19 10:47:50 2012 +0100 + + iface-modem-cdma: include in the API the mask of all CDMA access + technologies + + src/mm-iface-modem-cdma.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 049d4434f9e33e6075817852de1327e4a9f084c9 +Author: Aleksander Morgado +Date: Sun Feb 19 10:46:01 2012 +0100 + + iface-modem-3gpp: include in the API the mask of all 3GPP access + technologies + + src/mm-iface-modem-3gpp.c | 16 ++-------------- + src/mm-iface-modem-3gpp.h | 12 ++++++++++++ + 2 files changed, 14 insertions(+), 14 deletions(-) + +commit 39eaeb2c4e5c4311698860c2be203be40f91492b +Author: Aleksander Morgado +Date: Sun Feb 19 10:08:02 2012 +0100 + + nokia: new Nokia-specific source directory + + plugins/Makefile.am | 23 + +++++++++++++---------- + plugins/{ => nokia}/77-mm-nokia-port-types.rules | 0 + plugins/{ => nokia}/mm-broadband-modem-nokia.c | 0 + plugins/{ => nokia}/mm-broadband-modem-nokia.h | 0 + plugins/{ => nokia}/mm-plugin-nokia.c | 0 + plugins/{ => nokia}/mm-plugin-nokia.h | 0 + 6 files changed, 13 insertions(+), 10 deletions(-) + +commit 213706c503378460360f5aeb4f43bb7fa8296044 +Author: Aleksander Morgado +Date: Sun Feb 19 10:04:43 2012 +0100 + + cinterion: remove old sources, plugin fully ported + + plugins/mm-modem-cinterion-gsm.c | 1121 + -------------------------------------- + plugins/mm-modem-cinterion-gsm.h | 45 -- + 2 files changed, 1166 deletions(-) + +commit a9c406e3c0d0c9c21e43e978ec3d531f3fbec93c +Author: Aleksander Morgado +Date: Sun Feb 19 10:04:01 2012 +0100 + + cinterion: new Cinterion-specific source directory + + .gitignore | 1 + + plugins/Makefile.am | 8 ++++---- + plugins/{ => cinterion}/mm-broadband-modem-cinterion.c | 0 + plugins/{ => cinterion}/mm-broadband-modem-cinterion.h | 0 + plugins/{ => cinterion}/mm-plugin-cinterion.c | 0 + plugins/{ => cinterion}/mm-plugin-cinterion.h | 0 + 6 files changed, 5 insertions(+), 4 deletions(-) + +commit fdddafd1ca777f660d2671842164c6e26ff7b72f +Author: Aleksander Morgado +Date: Sun Feb 19 09:58:13 2012 +0100 + + iridium: new Iridium-specific source directory + + plugins/Makefile.am | 16 ++++++++-------- + plugins/{ => iridium}/mm-bearer-iridium.c | 0 + plugins/{ => iridium}/mm-bearer-iridium.h | 0 + plugins/{ => iridium}/mm-broadband-modem-iridium.c | 0 + plugins/{ => iridium}/mm-broadband-modem-iridium.h | 0 + plugins/{ => iridium}/mm-plugin-iridium.c | 0 + plugins/{ => iridium}/mm-plugin-iridium.h | 0 + plugins/{ => iridium}/mm-sim-iridium.c | 0 + plugins/{ => iridium}/mm-sim-iridium.h | 0 + 9 files changed, 8 insertions(+), 8 deletions(-) + +commit bf7d0c712f0696884a6140b8c00f8bc79158b7e1 +Author: Aleksander Morgado +Date: Sat Feb 18 10:49:23 2012 +0100 + + cinterion: implement frequency band setting + + plugins/mm-broadband-modem-cinterion.c | 245 + +++++++++++++++++++++++++++++++-- + 1 file changed, 236 insertions(+), 9 deletions(-) + +commit f6b6688cce3e8e373bded63755635e2e308deba6 +Author: Aleksander Morgado +Date: Sat Feb 18 10:48:54 2012 +0100 + + broadband-modem: new method to convert from UTF-8 to the charset in + the modem + + src/mm-broadband-modem.c | 11 +++++++++++ + src/mm-broadband-modem.h | 6 ++++++ + 2 files changed, 17 insertions(+) + +commit 3028126bd244506e709093636245aab2b835dce5 +Author: Aleksander Morgado +Date: Sat Feb 18 10:48:18 2012 +0100 + + charsets: new UTF-8 to given charset converter + + UCS-2 strings are always hex-converted. + + src/mm-charsets.c | 86 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-charsets.h | 3 ++ + 2 files changed, 89 insertions(+) + +commit 6f1a4514da5041ee57437e651e357bc3a3b86418 +Author: Aleksander Morgado +Date: Sat Feb 18 08:57:06 2012 +0100 + + libmm-common: new bands array comparator + + libmm-common/mm-common-helpers.c | 38 +++++++++++ + libmm-common/mm-common-helpers.h | 2 + + libmm-common/tests/test-common-helpers.c | 106 + +++++++++++++++++++++++++++++++ + 3 files changed, 146 insertions(+) + +commit 91416a3e3dc1f880a958726e4a8db737bf960a1e +Author: Aleksander Morgado +Date: Fri Feb 17 20:09:22 2012 +0100 + + cinterion: implement current band list loading + + plugins/mm-broadband-modem-cinterion.c | 242 + +++++++++++++++++++++++++++++++++ + 1 file changed, 242 insertions(+) + +commit a0583a46873197e07573befeb1c6df041eb2cef8 +Author: Aleksander Morgado +Date: Fri Feb 17 20:09:12 2012 +0100 + + broadband-modem: expose the current charset to UTF-8 converter + + So that subclasses can also use it. + + src/mm-broadband-modem.c | 23 +++++++++++++++++++---- + src/mm-broadband-modem.h | 6 ++++++ + 2 files changed, 25 insertions(+), 4 deletions(-) + +commit 3595b33648ce6aa78586c820c179c78b84687cf1 +Author: Aleksander Morgado +Date: Fri Feb 17 19:16:47 2012 +0100 + + iface-modem: load current bands during modem enabling + + src/mm-iface-modem.c | 51 + +++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 57 insertions(+), 2 deletions(-) + +commit 09d2f062c73a62bc32c21d2bcd9249c8a174fe82 +Author: Aleksander Morgado +Date: Fri Feb 17 16:57:12 2012 +0100 + + api,dbus: rename `AllowedBands' to just `Bands' + + ModemManager will load: + 1) The list of supported bands. Note that this doesn't mean that + any possible + combination of bands is supported, as modems may support only + specific + combinations, but at least gives a rough idea of what the modem + is capable + of handling. + + 2) The list of CURRENT bands. There is no such "Allowed" bands, + as we do with + modes, modems will have a specific set of bands being currently + used, which + will be reported in the `Bands' property. + + If the modem allows modifying the list of bands to use, this can be + done with + the `SetBands()' method. If the modem doesn't support using a specific + combination of bands, this method will report an error. + + cli/mmcli-modem.c | 104 ++++++++-------- + libmm-common/mm-common-connect-properties.c | 56 ++++----- + libmm-common/mm-common-connect-properties.h | 4 +- + libmm-glib/mm-modem-simple-connect-properties.c | 8 +- + libmm-glib/mm-modem-simple-connect-properties.h | 2 +- + libmm-glib/mm-modem.c | 58 ++++----- + libmm-glib/mm-modem.h | 30 ++--- + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 2 +- + new/org.freedesktop.ModemManager1.Modem.xml | 16 +-- + src/mm-iface-modem-simple.c | 42 +++---- + src/mm-iface-modem.c | 132 + ++++++++++----------- + src/mm-iface-modem.h | 30 ++--- + 12 files changed, 238 insertions(+), 246 deletions(-) + +commit 76e52236a44d87bc7aacb141b956146ab67d66eb +Author: Aleksander Morgado +Date: Fri Feb 17 09:36:05 2012 +0100 + + iridium: create a MMBearerIridium + + plugins/mm-broadband-modem-iridium.c | 45 + +++++++++++++++++++++++++++++++++++- + 1 file changed, 44 insertions(+), 1 deletion(-) + +commit 6d8404a6ab9e4fb63654120ade3f076c6f43030f +Author: Aleksander Morgado +Date: Thu Feb 16 20:45:25 2012 +0100 + + iridium: implement custom SMS indication enabling + + plugins/mm-broadband-modem-iridium.c | 43 + +++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 4e55b16f9aa7cedb531d1b04b20df87b4f942031 +Author: Aleksander Morgado +Date: Thu Feb 16 20:07:04 2012 +0100 + + iridium: close and open the port during disconnection + + The Iridium modem doesn't seem to like only the port flashing + during the + disconnection, so we fully close and open again the port. + + plugins/mm-bearer-iridium.c | 46 + ++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 5 deletions(-) + +commit b14bf797f1a7bc5501757c5e01830615dbfbba83 +Author: Aleksander Morgado +Date: Thu Feb 16 19:54:48 2012 +0100 + + iridium: override generic initialization + + We must send ATZ alone and once reply received, wait some time + before sending + the next initialization commands. Otherwise, the next commands + will receive + garbage as reply. The only way to handle this is to override the + whole generic + initialization phase. + + plugins/mm-broadband-modem-iridium.c | 98 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 98 insertions(+) + +commit 7e31470066e1b8e113e73a4732daf4692667d87e +Author: Aleksander Morgado +Date: Thu Feb 16 19:28:53 2012 +0100 + + iridium: set bearer service type to 9600bps V.110 + + plugins/mm-bearer-iridium.c | 49 + +++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 43 insertions(+), 6 deletions(-) + +commit 4492adae2e3013ec534fcb5389f216166ececad9 +Author: Aleksander Morgado +Date: Thu Feb 16 19:19:53 2012 +0100 + + iridium: allow up to 200s to get a proper IP connection + + plugins/mm-bearer-iridium.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 447d8a230dd2f7594b0c35d0d48814fdaf7c74c4 +Author: Aleksander Morgado +Date: Thu Feb 16 10:21:07 2012 +0100 + + iridium: new MMBearerIridium + + plugins/Makefile.am | 2 + + plugins/mm-bearer-iridium.c | 350 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-bearer-iridium.h | 53 +++++++ + 3 files changed, 405 insertions(+) + +commit 022272f88c32e500780deb9400a526e5704144d6 +Author: Aleksander Morgado +Date: Thu Feb 16 18:58:24 2012 +0100 + + iridium: allow only up to 3 consecutive timeouts + + plugins/mm-broadband-modem-iridium.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 060ca3ff49438a924255946b6f7cee8cbeceeeea +Author: Aleksander Morgado +Date: Thu Feb 16 16:22:14 2012 +0100 + + iridium: set baudrate to 9600 bps + + This will be set after flashing the port during modem enabling. + + plugins/mm-broadband-modem-iridium.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 1357880686cfee5a8c5526785100fbf575963cbc +Author: Aleksander Morgado +Date: Tue Feb 14 15:40:41 2012 +0100 + + iridium: only CS mode supported by the Iridium modems + + plugins/mm-broadband-modem-iridium.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit b57d32acbeb0de5b5befa3746e690f3450bd1203 +Author: Aleksander Morgado +Date: Fri Feb 17 13:08:33 2012 +0100 + + iridium: don't try to scan for networks + + The Iridium network will be the only one reported in the scan results. + + plugins/mm-broadband-modem-iridium.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 35f0b773ef4ba251cdba0b1a7e7245253ca44828 +Author: Aleksander Morgado +Date: Tue Feb 14 15:31:05 2012 +0100 + + iridium: implement specific operator name and code retrieval + + plugins/mm-broadband-modem-iridium.c | 52 + +++++++++++++++++++++++++++++++++++- + 1 file changed, 51 insertions(+), 1 deletion(-) + +commit 1bcecc9e1d9f990a881c339e34c0f06c39378c8a +Author: Aleksander Morgado +Date: Tue Feb 14 15:18:13 2012 +0100 + + iridium: use +CSQF to get signal quality + + plugins/mm-broadband-modem-iridium.c | 55 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +commit 50c5d69be647e9db6aa0ae4546d2f74ab7f08701 +Author: Aleksander Morgado +Date: Tue Feb 14 15:16:55 2012 +0100 + + iridium: use SM storage for mem1, mem2 and mem3 + + plugins/mm-broadband-modem-iridium.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2a351a69108584b06e3f99f0414a8b222c213bbf +Author: Aleksander Morgado +Date: Tue Feb 14 14:48:04 2012 +0100 + + iridium: don't try to load SIM identifier or operator info + + plugins/Makefile.am | 4 +- + plugins/mm-broadband-modem-iridium.c | 28 ++++++++++++ + plugins/mm-sim-iridium.c | 87 + ++++++++++++++++++++++++++++++++++++ + plugins/mm-sim-iridium.h | 52 +++++++++++++++++++++ + 4 files changed, 170 insertions(+), 1 deletion(-) + +commit 789cf58acee0334990e18fb4793f3f872626e697 +Author: Aleksander Morgado +Date: Tue Feb 14 14:19:57 2012 +0100 + + iridium: setup RTS/CTS flow control + + plugins/mm-broadband-modem-iridium.c | 61 + ++++++++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit 8456dae53dabfed294f02926424892a2bd81168e +Author: Aleksander Morgado +Date: Tue Feb 14 14:17:24 2012 +0100 + + iridium: no need to power up/down the modem + + plugins/mm-broadband-modem-iridium.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +commit 64542961a3efac67992fa4d07dbcdde7af0918f0 +Author: Aleksander Morgado +Date: Tue Feb 14 14:11:05 2012 +0100 + + iridium: start porting the Iridium plugin to the '06-api' codebase + + plugins/Makefile.am | 17 +-- + plugins/mm-broadband-modem-iridium.c | 59 +++++++++ + plugins/mm-broadband-modem-iridium.h | 49 +++++++ + plugins/mm-plugin-iridium.c | 243 + ++++++++++------------------------- + plugins/mm-plugin-iridium.h | 3 +- + 5 files changed, 187 insertions(+), 184 deletions(-) + +commit c8f525ee47fcdf70283043141ea2d1ece31d247b +Author: Aleksander Morgado +Date: Tue Feb 14 10:58:53 2012 +0100 + + api,header: added new Iridium capability + + include/ModemManager-enums.h | 2 ++ + src/mm-broadband-modem.c | 1 + + 2 files changed, 3 insertions(+) + +commit f72f68b311b5c283494f0ba329c73d053b4a4280 +Author: Aleksander Morgado +Date: Tue Feb 14 14:23:18 2012 +0100 + + broadband-modem: allow no whitespaces before CPIN? reply value + + src/mm-broadband-modem.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 2a12322a80d7c6a41c447c4c6bbfc5810b498b0c +Author: Aleksander Morgado +Date: Tue Feb 14 16:00:15 2012 +0100 + + modem-helpers: allow leading zeroes in CREG/CGREG responses + + src/mm-modem-helpers.c | 2 +- + src/tests/test-modem-helpers.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 5589df8946793f14159bc1b341999fea1428e709 +Author: Aleksander Morgado +Date: Thu Feb 16 20:50:07 2012 +0100 + + cinterion: implement custom SMS indication enabling + + plugins/mm-broadband-modem-cinterion.c | 40 + +++++++++++++++++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +commit f0d516e556d19376bd24cc446f05a6354c20b4e8 +Author: Aleksander Morgado +Date: Thu Feb 16 20:40:51 2012 +0100 + + broadband-modem: implement default enabling of SMS indications + + src/mm-broadband-modem.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 3dd5ec64ccc845b6c3018fb3b221c29dc586384c +Author: Aleksander Morgado +Date: Thu Feb 16 20:35:56 2012 +0100 + + iface-modem-messaging: need to enable/disable SMS indications + + src/mm-iface-modem-messaging.c | 96 + +++++++++++++++++++++++++++++++++++------- + src/mm-iface-modem-messaging.h | 16 +++++++ + 2 files changed, 97 insertions(+), 15 deletions(-) + +commit 5ee0f23efaff26b7db1e01b1dfdec22b05931a30 +Author: Aleksander Morgado +Date: Thu Feb 16 17:49:59 2012 +0100 + + cli: print the IP timeout value from the bearer + + cli/mmcli-bearer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit aa2ad5c31949e3bcb5a5ed7a8d66e5c6a69cda62 +Author: Aleksander Morgado +Date: Thu Feb 16 17:49:42 2012 +0100 + + libmm-glib: allow retrieving the IP timeout value from the bearer + + libmm-glib/mm-bearer.c | 8 ++++++++ + libmm-glib/mm-bearer.h | 13 +++++++------ + 2 files changed, 15 insertions(+), 6 deletions(-) + +commit 7fdd08c02ea676df7407a1045b39fe23d80eabe1 +Author: Aleksander Morgado +Date: Thu Feb 16 16:43:08 2012 +0100 + + api,dbus: new `IpTimeout' property in the Bearer interface + + This IpTimeout property will be read by NetworkManager, and used as + the time to + wait for pppd to establish the IP configuration (20s by default). + + new/org.freedesktop.ModemManager1.Bearer.xml | 7 +++++++ + src/mm-bearer.c | 4 ++++ + 2 files changed, 11 insertions(+) + +commit dc1df5bf2fb00b9eda0e98f59bb783c895fdeebf +Author: Aleksander Morgado +Date: Fri Feb 17 10:52:28 2012 +0100 + + iface-modem-simple: SIM-PIN2 locking does not prevent from connecting + + src/mm-iface-modem-simple.c | 7 +++++-- + src/mm-iface-modem.c | 4 +++- + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit c176117941257156b2da6e094239f5a9a07142fc +Author: Aleksander Morgado +Date: Fri Feb 17 10:10:15 2012 +0100 + + libmm-common: no need to check for end of string when looking + for spaces + + libmm-common/mm-common-helpers.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 22342055700384118a6af62b7292a974f526613a +Author: Aleksander Morgado +Date: Fri Feb 17 10:07:39 2012 +0100 + + libmm-common: allow empty strings passed to the key value parser + + libmm-common/mm-common-helpers.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit c89fd703bbff17fe9f703db444981f70c0b6aa4b +Author: Aleksander Morgado +Date: Tue Feb 14 17:18:20 2012 +0100 + + sim: allow subclasses to specify they can't load property values + + src/mm-sim.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +commit 3c41ce5d8b238e6a3a2cf101885e3a2df8efae0e +Author: Nathan Williams +Date: Mon Jan 23 11:04:49 2012 -0500 + + api,dbus: new `Command' method in the API to send arbitrary AT + commands + + BUG=chromium-os:25348 + TEST="mmcli -m 0 --command='E0'" + Change-Id: I320587560fde5780f9d5a4998e32364d36a71ed7 + + cli/mmcli-modem.c | 67 + +++++++++++++++++++++++++++++ + libmm-glib/mm-modem.c | 59 + +++++++++++++++++++++++++ + libmm-glib/mm-modem.h | 15 +++++++ + new/org.freedesktop.ModemManager1.Modem.xml | 14 ++++++ + src/mm-broadband-modem.c | 31 +++++++++++++ + src/mm-iface-modem.c | 56 ++++++++++++++++++++++++ + src/mm-iface-modem.h | 10 +++++ + 7 files changed, 252 insertions(+) + +commit 54c2daf937e3bc6062d5b867c1b0490381de711e +Author: Aleksander Morgado +Date: Tue Feb 14 14:10:19 2012 +0100 + + plugin-base: filters for product ID/string also require vendor + ID/string checks + + src/mm-plugin-base.c | 177 + +++++++++++++++++++++++++++------------------------ + 1 file changed, 93 insertions(+), 84 deletions(-) + +commit 1f3e67775c608ce49c44cd4b67bcd7ba34840b76 +Author: Aleksander Morgado +Date: Tue Feb 14 14:04:46 2012 +0100 + + core: new private boxed types for string and uint16 pairs + + src/mm-private-boxed-types.c | 84 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-private-boxed-types.h | 8 +++++ + 2 files changed, 92 insertions(+) + +commit 85dc060c82b42c45441790201bba23cf9e9034cf +Author: Aleksander Morgado +Date: Tue Feb 14 14:05:21 2012 +0100 + + manager: print modem debug info as soon as it gets exported + + src/mm-manager.c | 52 + ++++++++++++++++++++++------------------------------ + 1 file changed, 22 insertions(+), 30 deletions(-) + +commit 26ac82f60760a366a77ad2eda3577bb05cd5a868 +Author: Aleksander Morgado +Date: Tue Feb 14 10:55:46 2012 +0100 + + broadband-modem: minor indentation fixes + + src/mm-broadband-modem.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit 2000331f86c3a361206abde6b160dfe366a8704f +Author: Aleksander Morgado +Date: Thu Feb 16 09:57:59 2012 +0100 + + broadband-bearer: avoid double free + + Don't free an error which is taken by the async result. + + src/mm-broadband-bearer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 21a722b6169d27ea960ad24ff432f174163ed53a +Author: Aleksander Morgado +Date: Mon Feb 13 23:13:39 2012 +0100 + + core: don't pass primary port to interface initializations + + They will all get it themselves. + + src/mm-base-modem.c | 2 -- + src/mm-base-modem.h | 3 +-- + src/mm-broadband-modem.c | 9 +-------- + src/mm-broadband-modem.h | 1 - + src/mm-iface-modem-3gpp-ussd.c | 6 ------ + src/mm-iface-modem-3gpp-ussd.h | 1 - + src/mm-iface-modem-3gpp.c | 6 ------ + src/mm-iface-modem-3gpp.h | 1 - + src/mm-iface-modem-cdma.c | 6 ------ + src/mm-iface-modem-cdma.h | 1 - + src/mm-iface-modem-location.c | 6 ------ + src/mm-iface-modem-location.h | 1 - + src/mm-iface-modem-messaging.c | 14 ++++---------- + src/mm-iface-modem-messaging.h | 1 - + src/mm-iface-modem.c | 11 ----------- + src/mm-iface-modem.h | 1 - + 16 files changed, 6 insertions(+), 64 deletions(-) + +commit 3de4a2996340844b6808a4ca6e2d31b9b4b791f7 +Author: Aleksander Morgado +Date: Mon Feb 13 23:00:34 2012 +0100 + + broadband-modem: run setup of all ports as first step in + initialization + + This is run always once all ports grabbed and organized. + + src/mm-broadband-modem.c | 100 + +++++++++++++++++++++++++++++++---------------- + src/mm-broadband-modem.h | 5 +++ + 2 files changed, 71 insertions(+), 34 deletions(-) + +commit 8b7b614105c784b391f818a2eb6462accd844a4e +Author: Aleksander Morgado +Date: Mon Feb 13 22:19:28 2012 +0100 + + core: rework port grabbing and organization + + Make port roles more flexible. We have modems that do PPP + on interfaces other than the primary interface, and that + wasn't possible with the old code. So clean up all that + logic and move the port organization code into the core + so we can reduce code in the plugins. + + In the new world order, the plugins say whether the port + is a QCDM port, an AT port, or ignored. If it's an AT + port the plugins get to tag it as primary, secondary, or + PPP, or any combination of the 3. This allows for modems + where PPP should really be done on the secondary port + (Huawei E220, Sierra devices) so that the primary port + stays open for command and status. + + After all ports are grabbed by the generic classes, they get + "organized", which assigns various ports to the roles of + PRIMARY, SECONDARY, DATA, and QCDM based on specific rules + and hints that the plugin provided (which are expressed as + MMAtPortFlags). + + The plugin code is responsible for determining the port + hints (ie MMAtPortFlags) at probe time, instead of having + a combination of the plugin and the modem class do the + job. This simplifies things greatly for the plugins at + the expense of more complicated logic in the core. + + This is the port of commit 96505d42ed62327101dcee7c2bf31177b0bb1c9f + to the 06-api branch. + + plugins/mm-plugin-cinterion.c | 4 +- + plugins/mm-plugin-generic.c | 6 +- + plugins/mm-plugin-gobi.c | 6 +- + plugins/mm-plugin-nokia.c | 10 +- + src/mm-base-modem.c | 361 + +++++++++++++++++++++++++----------------- + src/mm-base-modem.h | 13 +- + src/mm-broadband-modem.c | 54 +++++++ + src/mm-manager.c | 19 ++- + src/mm-port-probe.c | 19 +++ + src/mm-port-probe.h | 11 +- + src/mm-port.h | 1 - + 11 files changed, 336 insertions(+), 168 deletions(-) + +commit 0b39bf91ecde4d19d231e495bc9573a67869c3f2 +Author: Aleksander Morgado +Date: Mon Feb 13 12:43:57 2012 +0100 + + at-serial-port: new AT port specific flags + + src/Makefile.am | 6 ++++-- + src/mm-at-serial-port.c | 8 +++++--- + src/mm-at-serial-port.h | 16 ++++++++-------- + 3 files changed, 17 insertions(+), 13 deletions(-) + +commit 11962711e4404f0e70973e196b7d473e29f23d73 +Author: Aleksander Morgado +Date: Mon Feb 13 12:32:07 2012 +0100 + + at-serial-port: no need to pass port type when creating the object + + We'll just specify the port is AT, not primary or secondary + + src/mm-base-modem.c | 2 +- + src/mm-port-probe.c | 3 +-- + src/mm-port.h | 1 + + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit f8cc4114adab326b19efcbf3a10f0755cb172eca +Author: Aleksander Morgado +Date: Mon Feb 13 12:27:45 2012 +0100 + + qcdm-serial-port: no need to pass port type when creating the object + + src/mm-base-modem.c | 2 +- + src/mm-port-probe.c | 3 +-- + src/mm-qcdm-serial-port.h | 1 - + src/tests/test-qcdm-serial-port.c | 1 - + 4 files changed, 2 insertions(+), 5 deletions(-) + +commit 44e5ebfec3e4a0d469afb30db8bb84dfa0ad8bfd +Author: Aleksander Morgado +Date: Tue Feb 14 16:51:25 2012 +0100 + + bearer-list: avoid redefinition of MMBearerLisForeachFunc + + src/mm-bearer-list.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 66b2b7fb23e30c63eb7e852e4cc42c94e5f2bd41 +Author: Aleksander Morgado +Date: Mon Feb 13 22:16:59 2012 +0100 + + base-modem: also signal validity when reporting invalid + + Otherwise the manager won't catch invalid modems failing at + initialization. + + src/mm-base-modem.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 20d8fd92bf76cd98eb0a3ab21827284a7d7ab635 +Author: Aleksander Morgado +Date: Mon Feb 13 12:13:55 2012 +0100 + + port: no need for custom enum to string converters + + src/mm-port.c | 32 -------------------------------- + src/mm-port.h | 4 ---- + 2 files changed, 36 deletions(-) + +commit 46a665630de33fede12cb53d255ee727a24bb521 +Author: Aleksander Morgado +Date: Mon Feb 13 12:13:32 2012 +0100 + + base-modem: use new autogenerated port-enum-string getters + + src/mm-base-modem.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +commit 06260cdced10404b7b9fef5035c5388e5b47111f +Author: Aleksander Morgado +Date: Mon Feb 13 12:42:45 2012 +0100 + + build: private enums don't depend on the public ones + + src/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ec9895536227ccc318e86cb0988de51877c55a66 +Author: Aleksander Morgado +Date: Mon Feb 13 12:07:04 2012 +0100 + + build: ignore built files + + .gitignore | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 4d3a61d58b3534a1abe1fe2b290832e237068728 +Author: Aleksander Morgado +Date: Mon Feb 13 11:59:51 2012 +0100 + + build: generate libserial-specific enum types + + src/Makefile.am | 20 +++++++++++++++++++- + src/mm-port.h | 5 ++--- + 2 files changed, 21 insertions(+), 4 deletions(-) + +commit ffdb034413d281361803ebb52fcbb4f569e1b9f2 +Author: Aleksander Morgado +Date: Mon Feb 13 11:58:06 2012 +0100 + + build: renamed files holding daemon-specific enum types + + src/Makefile.am | 20 ++++++++++---------- + src/mm-bearer.c | 2 +- + 2 files changed, 11 insertions(+), 11 deletions(-) + +commit 71c3c8d8e55af4b78ad99285f32ee28b6fe87aa0 +Author: Aleksander Morgado +Date: Sat Feb 11 20:25:06 2012 +0100 + + libmm-common: use the new key/value parser in the common bearer + properties builder + + libmm-common/mm-common-bearer-properties.c | 71 + ++++++++++++------------------ + 1 file changed, 28 insertions(+), 43 deletions(-) + +commit 591e6413698897fecbb6b96e98004462f6e0e88a +Author: Aleksander Morgado +Date: Sat Feb 11 20:09:45 2012 +0100 + + libmm-common: use the new key/value parser in the common connect + properties builder + + libmm-common/mm-common-connect-properties.c | 155 + ++++++++++++++-------------- + 1 file changed, 75 insertions(+), 80 deletions(-) + +commit f0b9f3954c886f4f73b1c2a39628d5d124195546 +Author: Aleksander Morgado +Date: Sat Feb 11 19:09:01 2012 +0100 + + libmm-common: use the new key/value parser in the common SMS + properties builder + + libmm-common/mm-common-sms-properties.c | 70 + +++++++++++++-------------------- + 1 file changed, 28 insertions(+), 42 deletions(-) + +commit b7938448ea125827a7e54f11d6b548d26653cc37 +Author: Aleksander Morgado +Date: Sat Feb 11 19:08:39 2012 +0100 + + libmm-common,tests: new tests for the key/value parser + + .gitignore | 1 + + configure.ac | 1 + + libmm-common/Makefile.am | 1 + + libmm-common/tests/Makefile.am | 20 +++ + libmm-common/tests/test-common-helpers.c | 277 + +++++++++++++++++++++++++++++++ + 5 files changed, 300 insertions(+) + +commit 7df5874a88c6fc09ad62f655f4da9c0626c224eb +Author: Aleksander Morgado +Date: Sat Feb 11 19:08:12 2012 +0100 + + libmm-common: new helper key/value parser + + libmm-common/mm-common-helpers.c | 145 + ++++++++++++++++++++++++++++++++++++++- + libmm-common/mm-common-helpers.h | 9 +++ + 2 files changed, 153 insertions(+), 1 deletion(-) + +commit 46cbee191c9350d246379d2ec211c3ef9f4836a9 +Author: Aleksander Morgado +Date: Fri Feb 10 17:59:35 2012 +0100 + + broadband-modem: always PDU mode preferred + + src/mm-broadband-modem.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 7f8ca20096af4b19b06223a6a0e664f0386f337e +Author: Aleksander Morgado +Date: Fri Feb 10 17:39:11 2012 +0100 + + cli: include storage when printing SMS info + + cli/mmcli-sms.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit a35472b0a1d3cb96491f97b439cb72b3032804cf +Author: Aleksander Morgado +Date: Fri Feb 10 17:38:55 2012 +0100 + + libmm-glib: allow getting SMS storage + + libmm-glib/mm-sms.c | 16 ++++++++++++++++ + libmm-glib/mm-sms.h | 1 + + 2 files changed, 17 insertions(+) + +commit 978801ee7b740abe46d7117346d4696f0ec369f0 +Author: Aleksander Morgado +Date: Fri Feb 10 17:38:39 2012 +0100 + + sms: specify storage where the SMS is kept + + src/mm-broadband-modem.c | 83 + +++++++++++++++++++++++++----------------- + src/mm-iface-modem-messaging.c | 5 ++- + src/mm-iface-modem-messaging.h | 3 +- + src/mm-sms-list.c | 9 ++++- + src/mm-sms-list.h | 1 + + src/mm-sms.c | 18 ++++++++- + src/mm-sms.h | 2 + + 7 files changed, 81 insertions(+), 40 deletions(-) + +commit 86dd0816b597d48cddaa0613a2cd1a3dfe9542ff +Author: Aleksander Morgado +Date: Fri Feb 10 17:14:36 2012 +0100 + + api,dbus: new `Storage' property in the SMS interface + + new/org.freedesktop.ModemManager1.Sms.xml | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 50d474056dcc9836f4fbd43d3370d0097bacd378 +Author: Aleksander Morgado +Date: Fri Feb 10 17:06:23 2012 +0100 + + iface-modem-messaging: once all messages initially loaded, set + default storages + + src/mm-iface-modem-messaging.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) + +commit 8c8e5efa14b9eaee8e24cd8122ec885f0cf1eabd +Author: Aleksander Morgado +Date: Fri Feb 10 16:35:20 2012 +0100 + + cinterion: SMS storage mem3 doesn't support 'ME' + + plugins/mm-broadband-modem-cinterion.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit cce2869f1b4d14dce8af6ca1fa471199048c529d +Author: Aleksander Morgado +Date: Fri Feb 10 16:34:56 2012 +0100 + + broadband-modem: implement default storage settings + + src/mm-broadband-modem.c | 61 + +++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 60 insertions(+), 1 deletion(-) + +commit f7c41b8e4843e488214b2aa7009f3334d62cd873 +Author: Aleksander Morgado +Date: Fri Feb 10 16:34:40 2012 +0100 + + iface-modem-messaging: use defaults when no specific storage specified + + src/mm-iface-modem-messaging.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 9e3f66393fc03b7d285c4326f23c7962c833dae5 +Author: Aleksander Morgado +Date: Fri Feb 10 15:43:34 2012 +0100 + + iface-modem-messaging: load initial parts from all available storages + + src/mm-broadband-modem.c | 50 +++++++++++++++++++++++------ + src/mm-iface-modem-messaging.c | 71 + +++++++++++++++++++++++++++++++++++++++--- + src/mm-iface-modem-messaging.h | 1 + + 3 files changed, 108 insertions(+), 14 deletions(-) + +commit cd184f33f9f78692dbf9135818e69c98cdf1fcb8 +Author: Aleksander Morgado +Date: Fri Feb 10 15:39:22 2012 +0100 + + test: new tester for CPMS=? results + + src/tests/test-modem-helpers.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 69ecae2dc46f6cd6292f11e3c397234c0cb375e7 +Author: Aleksander Morgado +Date: Fri Feb 10 14:37:59 2012 +0100 + + iface-modem-messaging: new method to set preferred SMS storages + + src/mm-iface-modem-messaging.c | 73 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 22 +++++++++++++ + 2 files changed, 95 insertions(+) + +commit e6e7aa1846ec0591f1566a2d111d5775f31f2b74 +Author: Aleksander Morgado +Date: Thu Feb 9 23:48:07 2012 +0100 + + broadband-modem: override default preferred mem1/mem2/mem3 storages + + src/mm-broadband-modem.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit f6ef117d32b690b8fe75b45d278f439a3d1c8b3b +Author: Aleksander Morgado +Date: Thu Feb 9 23:47:36 2012 +0100 + + iface-modem-messaging: new properties to define preferred + mem1/mem2/mem3 storages + + src/mm-iface-modem-messaging.c | 28 +++++++++++++++++++++++++++- + src/mm-iface-modem-messaging.h | 9 ++++++--- + 2 files changed, 33 insertions(+), 4 deletions(-) + +commit 55ba297fb8418cde124a5cdc3c1a8837b9e1fd5e +Author: Aleksander Morgado +Date: Thu Feb 9 23:47:10 2012 +0100 + + broadband-modem: implement default SMS storage loading + + src/mm-broadband-modem.c | 108 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 108 insertions(+) + +commit 7fb1234015f68d3139400b9ec184e6dae1fe0f78 +Author: Aleksander Morgado +Date: Thu Feb 9 23:46:37 2012 +0100 + + iface-modem-messaging: load supported SMS storages during + initialization + + src/mm-iface-modem-messaging.c | 103 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 15 ++++++ + 2 files changed, 118 insertions(+) + +commit 09adad847e9982c72e99da9ffb4b7b67d387e12e +Author: Aleksander Morgado +Date: Thu Feb 9 23:45:35 2012 +0100 + + modem-helpers: new CPMS format result parser + + src/mm-modem-helpers.c | 92 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 5 +++ + 2 files changed, 97 insertions(+) + +commit 23508ddd7f208c4dcc88ce38a20c0ec4fc49582f +Author: Aleksander Morgado +Date: Thu Feb 9 23:45:15 2012 +0100 + + libmm-common: new helpers to work with SMS storage strings + + libmm-common/mm-common-helpers.c | 24 ++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 3 +++ + 2 files changed, 27 insertions(+) + +commit 1e5756c33b3059e661d47f7ae110a5fe75dc5231 +Author: Aleksander Morgado +Date: Thu Feb 9 22:01:38 2012 +0100 + + api,header: new `MMSmsStorage' enumeration + + docs/reference/api/mm-sections.txt | 1 + + include/ModemManager-enums.h | 22 ++++++++++++++++++++++ + 2 files changed, 23 insertions(+) + +commit 4b6792dd62ce37fc1a0559355cf106589445412d +Author: Aleksander Morgado +Date: Thu Feb 9 18:37:36 2012 +0100 + + sms: implement default sending, either from storage or through the + generic cmd + + src/mm-sms.c | 152 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 152 insertions(+) + +commit ea8b4c80b7adcde5d9beb02f90c09efc3d1992ac +Author: Aleksander Morgado +Date: Thu Feb 9 18:16:57 2012 +0100 + + sms: don't allow sending received messages + + src/mm-sms.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit 4e4078ef2eab0750baa38c2b23f3987fc70dfd2e +Author: Aleksander Morgado +Date: Thu Feb 9 18:09:33 2012 +0100 + + sms: implement default storing + + src/mm-sms.c | 175 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 175 insertions(+) + +commit 183e7c32051339255fc6f6e3069baf8815b1bbe0 +Author: Aleksander Morgado +Date: Thu Feb 9 14:55:39 2012 +0100 + + sms-part: include the submit-pdu building code + + It currently doesn't do multi-part. When do support that, we may + end up needing + to move all this code to mm-sms.c + + src/mm-sms-part.c | 303 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-part.h | 11 ++ + 2 files changed, 314 insertions(+) + +commit bf5276d4c709adb2bb2d49609e7fc91812ae88d8 +Author: Aleksander Morgado +Date: Thu Feb 9 14:39:51 2012 +0100 + + broadband-modem: implement the use-pdu-mode flag property + + src/mm-broadband-modem.c | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +commit 6bb4f9cb5774d02e60af5dd243bd0a6ef3334a26 +Author: Aleksander Morgado +Date: Thu Feb 9 14:38:57 2012 +0100 + + iface-modem-messaging: handle the flag to use PDU mode as a property + + src/mm-iface-modem-messaging.c | 8 ++++++++ + src/mm-iface-modem-messaging.h | 1 + + 2 files changed, 9 insertions(+) + +commit 2622705744eb27f834abc72fdd8518289d486fda +Author: Aleksander Morgado +Date: Thu Feb 9 14:23:18 2012 +0100 + + cli: new `--store' action to store SMS messages + + cli/mmcli-sms.c | 55 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 54 insertions(+), 1 deletion(-) + +commit cee94ef536fa759b5fbd6fcbd20860ba1a32f3ce +Author: Aleksander Morgado +Date: Thu Feb 9 14:23:03 2012 +0100 + + libmm-glib: new method to store SMS messages + + libmm-glib/mm-sms.c | 73 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms.h | 11 ++++++++ + 2 files changed, 84 insertions(+) + +commit 556efdd37874f726b7ad6b6a3cf32fffad7972d2 +Author: Aleksander Morgado +Date: Thu Feb 9 14:05:48 2012 +0100 + + sms-list: refactor SMS removal + + If any of the parts couldn't be removed, an error is reported and + the SMS is + left in the list. + + src/mm-sms-list.c | 104 + +++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 64 insertions(+), 40 deletions(-) + +commit 572565c1e0d9c9b1c136aafcb9a6038d1e31b7fc +Author: Aleksander Morgado +Date: Thu Feb 9 14:05:06 2012 +0100 + + sms: delete() just removes the parts from the storage + + It's left to the delete() caller to unexport the SMS object from + DBus and such. + + src/mm-sms.c | 51 ++++++++++++++++++++++++++++++++------------------- + src/mm-sms.h | 1 + + 2 files changed, 33 insertions(+), 19 deletions(-) + +commit 40a39e4d47f051bda579104958024128812b567c +Author: Aleksander Morgado +Date: Thu Feb 9 14:04:33 2012 +0100 + + sms-part: allow reseting part index + + so that we can for example, tell the index is INVALID + + src/mm-sms-part.c | 1 + + src/mm-sms-part.h | 2 ++ + 2 files changed, 3 insertions(+) + +commit a8b3b50f456d90e8ea746ec9657ffeec1a0f06bf +Author: Aleksander Morgado +Date: Thu Feb 9 13:28:13 2012 +0100 + + sms: 'number' and 'text' are mandatory when creating from properties + + src/mm-sms.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit b61c94016afe8a598f3b7f576430f790c6898a4f +Author: Aleksander Morgado +Date: Thu Feb 9 13:07:29 2012 +0100 + + api,dbus: remove the option to send the SMS in the Create() call + + An SMS must be first created with the Messaging interface, and then + sent using the + Send() method from the SMS-specific interface. + + cli/mmcli-modem-messaging.c | 2 -- + libmm-glib/mm-modem-messaging.c | 6 ------ + libmm-glib/mm-modem-messaging.h | 2 -- + new/org.freedesktop.ModemManager1.Modem.Messaging.xml | 6 ++---- + src/mm-iface-modem-messaging.c | 1 - + 5 files changed, 2 insertions(+), 15 deletions(-) + +commit 8a4a7ca4dcd7d92d964733c5c30865354a7a6f82 +Author: Aleksander Morgado +Date: Thu Feb 9 12:50:45 2012 +0100 + + broadband-modem: get and use SMS part state when parsing CMGL reply + + src/mm-broadband-modem.c | 51 + +++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 46 insertions(+), 5 deletions(-) + +commit 714e4ca44b2dc4d877e28d01e9f402fa0d9066a7 +Author: Aleksander Morgado +Date: Thu Feb 9 12:48:00 2012 +0100 + + sms: export uncomplete multipart messages as well + + Uncompleted multipart SMS will be exported to DBus, where only the + "state" + property is valid, so that we allow completely removing those + uncompleted + multipart SMS which will never get completed due to one reason + or another. + + src/mm-broadband-modem.c | 6 +-- + src/mm-iface-modem-messaging.c | 4 +- + src/mm-iface-modem-messaging.h | 2 +- + src/mm-sms-list.c | 87 + ++++++++++++++++++++---------------------- + src/mm-sms-list.h | 2 +- + src/mm-sms.c | 22 +++++++++-- + 6 files changed, 67 insertions(+), 56 deletions(-) + +commit 186584f26f1aa6699ddc970fa6b85f60a27d1820 +Author: Aleksander Morgado +Date: Wed Feb 8 16:31:59 2012 +0100 + + broadband-modem: ensure text mode SMS list doesn't pick up too + much text + + This is the port of commit 2104cd725a5f3f9aeacf4dfc4faa70dba293789d + to the + 06-api branch. + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3c886d257986022c9d539e740e6beadb4139ed88 +Author: Aleksander Morgado +Date: Wed Feb 8 16:29:59 2012 +0100 + + broadband-modem: fix text SMS list regex + + This is a port of commit c7f54a635a84d5861b1d5f819c25de97b8c0ac32 + to the + 06-api branch. + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ad3b3d0ba772c5d4603abcf2cfe6f5a4842fd92c +Author: Aleksander Morgado +Date: Wed Feb 8 16:08:53 2012 +0100 + + iface-modem-messaging: don't allow method calls if not enabled + + src/mm-iface-modem-messaging.c | 43 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit a1dc38360c57388058d955319cf32afc76e2ab4f +Author: Aleksander Morgado +Date: Wed Feb 8 16:08:29 2012 +0100 + + iface-modem: don't force port closing here, it breaks the open/close + count + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 214a146a2856200f438977822f71b8a20d7095c1 +Author: Aleksander Morgado +Date: Wed Feb 8 16:08:04 2012 +0100 + + iface-modem: simplify disabling sequence + + Avoid the _ready() function generator macro, not really needed here. + + src/mm-iface-modem.c | 39 +++++++++++++++++++-------------------- + 1 file changed, 19 insertions(+), 20 deletions(-) + +commit a826e7c8ae11cd6a469bcb726fb0daf8f32cb5bf +Author: Aleksander Morgado +Date: Wed Feb 8 16:07:02 2012 +0100 + + cinterion: fix power down sequence + + Need to complete the operation result at some point! + + plugins/mm-broadband-modem-cinterion.c | 40 + +++++++++++++++++++++++++++++----- + 1 file changed, 35 insertions(+), 5 deletions(-) + +commit 7bc586258d9d63c05b7e103e79a11a31d70e0a57 +Author: Aleksander Morgado +Date: Wed Feb 8 15:30:03 2012 +0100 + + sim: leave up to 10s for CRSM queries + + src/mm-sim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d528a2211b58820d23528e1afd187652151f4853 +Author: Aleksander Morgado +Date: Wed Feb 8 15:18:21 2012 +0100 + + cli: ensure EOL is added at every error message + + cli/mmcli-modem-3gpp.c | 4 ++-- + cli/mmcli-modem-cdma.c | 2 +- + cli/mmcli-modem-location.c | 2 +- + cli/mmcli-modem-messaging.c | 6 +++--- + cli/mmcli-modem-simple.c | 2 +- + cli/mmcli-modem.c | 4 ++-- + cli/mmcli.c | 4 ++-- + 7 files changed, 12 insertions(+), 12 deletions(-) + +commit 470d9b933ef3a324195b1cd15edd10aba57c564d +Author: Aleksander Morgado +Date: Wed Feb 8 14:26:13 2012 +0100 + + sms: handle message storing and sending actions from DBus + + src/mm-sms.c | 127 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-sms.h | 17 +++++++- + 2 files changed, 142 insertions(+), 2 deletions(-) + +commit fb02fbf7a0f303ea685fe1db1af9810a4234ff84 +Author: Aleksander Morgado +Date: Wed Feb 8 14:25:44 2012 +0100 + + sms-part: new symbol to define invalid indexes + + SMS parts with invalid indexes are NOT stored yet in the device + + src/mm-sms-part.h | 1 + + src/mm-sms.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit e07e26c6e188f94c91a621ee7cbdd1f16d8237d2 +Author: Aleksander Morgado +Date: Wed Feb 8 14:09:19 2012 +0100 + + api,dbus: new method to request storing a SMS messages + + new/org.freedesktop.ModemManager1.Sms.xml | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit e257c4ac499d0e9e12d27d74de435e4a0fc8d98e +Author: Aleksander Morgado +Date: Wed Feb 8 13:57:00 2012 +0100 + + cli: avoid unneeded refs when synchronously looking for bearer/sms/sim + + cli/mmcli-common.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0833934f11e96916e2ffe188cc6808350b70a95d +Author: Aleksander Morgado +Date: Wed Feb 8 13:51:50 2012 +0100 + + cli: added Messaging-specific actions + + cli/Makefile.am | 1 + + cli/mmcli-modem-messaging.c | 375 + ++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 + + 4 files changed, 395 insertions(+) + +commit 6ff1543c3250be3c55a1f3689cc1692153093221 +Author: Aleksander Morgado +Date: Wed Feb 8 13:30:06 2012 +0100 + + cli: added SMS-specific actions + + cli/Makefile.am | 3 +- + cli/mmcli-sms.c | 252 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 +++ + cli/mmcli.h | 8 ++ + 4 files changed, 273 insertions(+), 1 deletion(-) + +commit 2021ba80fd1dba6edc47a958aeb9c12e5bdbb141 +Author: Aleksander Morgado +Date: Wed Feb 8 13:24:40 2012 +0100 + + cli: setup to work with SMS objects + + cli/mmcli-common.c | 275 + ++++++++++++++++++++++++++++++++++++++++++++++++++++- + cli/mmcli-common.h | 14 +++ + 2 files changed, 287 insertions(+), 2 deletions(-) + +commit d80d06cd6e2b8a441dac610ba396fe0b05c8b63e +Author: Aleksander Morgado +Date: Wed Feb 8 12:57:19 2012 +0100 + + cli: fix help, bearers and SIMs can be specified also by index + + cli/mmcli-common.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit e82db676466319ce03998b678c3c89d1385187ee +Author: Aleksander Morgado +Date: Wed Feb 8 12:54:09 2012 +0100 + + libmm-glib: implement support for the Messaging interface + + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-messaging.c | 552 + ++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-messaging.h | 83 ++++++ + libmm-glib/mm-object.c | 34 +++ + libmm-glib/mm-object.h | 29 ++- + 5 files changed, 687 insertions(+), 13 deletions(-) + +commit 26075236f6348a942890cdc699e971c6f0cb3620 +Author: Aleksander Morgado +Date: Wed Feb 8 12:53:45 2012 +0100 + + libmm-glib: (trivial) fix some return types + + libmm-glib/mm-modem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 9de213fcc16175635abc03d7c4d2f5b1aea83789 +Author: Aleksander Morgado +Date: Wed Feb 8 00:52:44 2012 +0100 + + libmm-glib: methods to create MMSms objects + + We need them, as received messages are signaled just with their path, + so the + program listening to those signals will need to create the proxy + objects itself. + + libmm-glib/mm-sms.c | 37 +++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms.h | 13 +++++++++++++ + 2 files changed, 50 insertions(+) + +commit bfbcf3cfafdf3a026f9bfbd73ee348c810e7f7df +Author: Aleksander Morgado +Date: Wed Feb 8 00:38:03 2012 +0100 + + libmm-glib: new object to handle SMS objects + + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-sms.c | 329 + +++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms.h | 66 ++++++++++ + 3 files changed, 398 insertions(+) + +commit 14baeff88d8eba049ecf306d29ed803ed3c04743 +Author: Aleksander Morgado +Date: Wed Feb 8 00:28:02 2012 +0100 + + api,dbus: renamed `To' to `Number' in the SMS interface + + new/org.freedesktop.ModemManager1.Sms.xml | 4 ++-- + src/mm-sms.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit d30c101e53d974abdb1e9242b301104d0ffd9167 +Author: Aleksander Morgado +Date: Wed Feb 8 00:14:58 2012 +0100 + + libmm-glib: new common object to handle SMS properties + + To be used when requesting to create new SMS. + + libmm-glib/Makefile.am | 3 ++ + libmm-glib/mm-sms-properties.c | 76 + ++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sms-properties.h | 54 ++++++++++++++++++++++++++++++ + 3 files changed, 133 insertions(+) + +commit 76aaac23ec3ad86a02fe283179dc5bd022f17b78 +Author: Aleksander Morgado +Date: Wed Feb 8 00:07:57 2012 +0100 + + iface-modem-messaging: allow creating new SMS objects + + src/mm-iface-modem-messaging.c | 53 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +commit f414350b24459a6420e7e1f91a76a1ad34cbc1df +Author: Aleksander Morgado +Date: Wed Feb 8 00:07:12 2012 +0100 + + sms: allow creating SMS objects from the common properties + + src/mm-sms.c | 20 ++++++++------------ + src/mm-sms.h | 10 +++------- + 2 files changed, 11 insertions(+), 19 deletions(-) + +commit f9a7533ac41fd3fe176d2b3e85ccc9c4748c4d42 +Author: Aleksander Morgado +Date: Wed Feb 8 00:06:47 2012 +0100 + + sms-list: allow adding full SMS objects to the list + + src/mm-sms-list.c | 9 +++++++++ + src/mm-sms-list.h | 3 +++ + 2 files changed, 12 insertions(+) + +commit 9fd2c3a1dcb03d85137357925fe56ffa7fbc9f84 +Author: Aleksander Morgado +Date: Wed Feb 8 00:06:20 2012 +0100 + + sms-list: handle NULL paths in SMS objects + + They will have NULL paths when they are not exported yet + + src/mm-sms-list.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 672e9d09e366d02bffd5fcf1bca9e40c53a55416 +Author: Aleksander Morgado +Date: Tue Feb 7 23:43:24 2012 +0100 + + libmm-common: new helper object to handle common SMS properties + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-common-sms-properties.c | 413 + ++++++++++++++++++++++++++++++++ + libmm-common/mm-common-sms-properties.h | 87 +++++++ + 4 files changed, 505 insertions(+) + +commit 69b8742ca354a396f7df4e72c8ce26b9eb3dcbea +Author: Aleksander Morgado +Date: Tue Feb 7 23:16:08 2012 +0100 + + api,header: renamed `MMModemSmsState' to `MMSmsState' + + docs/reference/api/mm-sections.txt | 2 +- + include/ModemManager-enums.h | 30 + +++++++++++++++--------------- + new/org.freedesktop.ModemManager1.Sms.xml | 2 +- + src/mm-sms-list.c | 8 ++++---- + src/mm-sms.c | 6 +++--- + src/mm-sms.h | 4 ++-- + 6 files changed, 26 insertions(+), 26 deletions(-) + +commit c15fbedc03569723b26b39706d93bace50e1ada0 +Author: Aleksander Morgado +Date: Tue Feb 7 23:11:06 2012 +0100 + + sms: pass known state when creating the MMSms object + + src/mm-sms-list.c | 8 ++++++-- + src/mm-sms.c | 14 +++++--------- + src/mm-sms.h | 4 ++-- + 3 files changed, 13 insertions(+), 13 deletions(-) + +commit c17d6c09a4595663e87ad80202bd6add75254fb4 +Author: Aleksander Morgado +Date: Tue Feb 7 22:57:06 2012 +0100 + + sms-part: include validity + + src/mm-sms-part.c | 3 +++ + src/mm-sms-part.h | 4 ++++ + src/mm-sms.c | 1 + + 3 files changed, 8 insertions(+) + +commit 0841f123158b747de5a2ea7744644b049de1307d +Author: Aleksander Morgado +Date: Tue Feb 7 22:24:04 2012 +0100 + + iface-modem-messaging: allow subclassing SMS object creation methods + + src/mm-broadband-modem.c | 1 + + src/mm-iface-modem-messaging.h | 4 +++ + src/mm-sms-list.c | 2 ++ + src/mm-sms.c | 62 + ++++++++++++++++++++++++++++++++---------- + src/mm-sms.h | 11 ++++++++ + 5 files changed, 65 insertions(+), 15 deletions(-) + +commit 61a84528932fcbae61f3fb2275d89595634de0dd +Author: Aleksander Morgado +Date: Tue Feb 7 20:54:47 2012 +0100 + + sms: allow sublassing the part deletion procedure + + src/mm-sms-list.c | 14 +++++++------- + src/mm-sms.c | 53 + ++++++++++++++++++++++++++++++++++++++++++++--------- + src/mm-sms.h | 21 +++++++++++++++------ + 3 files changed, 66 insertions(+), 22 deletions(-) + +commit 9ca03ba9f2cffea4470162ef310ea1bc0830e553 +Author: Aleksander Morgado +Date: Tue Feb 7 20:03:20 2012 +0100 + + sms: rename method which creates MMSms from single part + + src/mm-sms-list.c | 8 ++++---- + src/mm-sms.c | 8 ++++---- + src/mm-sms.h | 8 ++++---- + 3 files changed, 12 insertions(+), 12 deletions(-) + +commit 61697b0054a1f34be9626ac17dfbff5aa840dd47 +Author: Aleksander Morgado +Date: Tue Feb 7 19:37:38 2012 +0100 + + modem-helpers: use new common charset converter when parsing operator + name/code + + This is the port of commit 4af8483ae4e32ca3d815f14aaf5f012b0ed98eed + into the + 06-api branch. + + src/mm-modem-helpers.c | 31 +------------------------------ + 1 file changed, 1 insertion(+), 30 deletions(-) + +commit 9c5e8d697c966902cd8ac4afd208ba476ce94f53 +Author: Aleksander Morgado +Date: Tue Feb 7 17:51:15 2012 +0100 + + broadband-modem: try to get SMS text and number in the current charset + + src/mm-broadband-modem.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit a8ca3df9be2a44465380fe68c5ea276cc51a3927 +Author: Aleksander Morgado +Date: Tue Feb 7 17:05:26 2012 +0100 + + plugins: always set a proper error domain in GErrors + + plugins/mm-plugin-cinterion.c | 6 +++++- + plugins/mm-plugin-generic.c | 12 ++++++++++-- + plugins/mm-plugin-gobi.c | 11 ++++++++--- + plugins/mm-plugin-nokia.c | 10 ++++++++-- + 4 files changed, 31 insertions(+), 8 deletions(-) + +commit 23a615605996415cfdbc8d80831959e5f2679278 +Author: Aleksander Morgado +Date: Tue Feb 7 16:03:20 2012 +0100 + + broadband-modem: allow listing SMS parts in Text mode + + src/mm-broadband-modem.c | 170 + ++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 159 insertions(+), 11 deletions(-) + +commit ffedaf2ec3ca45d348abf9faf0ef353f81fac782 +Author: Aleksander Morgado +Date: Tue Feb 7 16:02:35 2012 +0100 + + sms-part: allow creating MMSmsParts not only from parsing a PDU + + src/mm-sms-part.c | 134 + +++++++++++++++++++++++++++++++++++++++++++----------- + src/mm-sms-part.h | 48 +++++++++++++++++-- + 2 files changed, 152 insertions(+), 30 deletions(-) + +commit dc5ff06b4f8c730d8f378ef8d2d5cf985a51e5c5 +Author: Aleksander Morgado +Date: Mon Feb 6 18:12:15 2012 +0100 + + broadband-modem: implement generic unsolicited SMS events handling + + src/mm-broadband-modem.c | 183 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 183 insertions(+) + +commit d9f5779bbbbcf0559a5dd0a3a897b5d4241ad186 +Author: Aleksander Morgado +Date: Fri Feb 3 13:34:03 2012 +0100 + + iface-modem-messaging: allow setting up unsolicited events + + src/mm-iface-modem-messaging.c | 110 + ++++++++++++++++++++++++++--------------- + src/mm-iface-modem-messaging.h | 16 ++++++ + 2 files changed, 85 insertions(+), 41 deletions(-) + +commit ee13bbe4a3c1e2a95b203787af9d5cbd3a09a567 +Author: Aleksander Morgado +Date: Fri Feb 3 13:27:02 2012 +0100 + + base-modem: ignore every unsolicited CMTI until we set up messaging + + src/mm-base-modem.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 3912bf062e47db7ab96f178ffb833841223885a3 +Author: Aleksander Morgado +Date: Fri Feb 3 13:26:22 2012 +0100 + + modem-helpers: new common CMTI regex getter + + src/mm-modem-helpers.c | 11 +++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 13 insertions(+) + +commit 1eb7f60e4cee9295980d14de7d586a0bca24e869 +Author: Aleksander Morgado +Date: Wed Feb 1 22:30:20 2012 +0100 + + sms: assemble and export the SMS when its completed + + src/mm-sms-list.c | 35 ++++++++++++----- + src/mm-sms.c | 114 + +++++++++++++++++++++++++++++++++++++++++++++++++----- + src/mm-sms.h | 9 ++++- + 3 files changed, 138 insertions(+), 20 deletions(-) + +commit 6f103c136660eee618d6b38c69d3ba91e3b41921 +Author: Aleksander Morgado +Date: Wed Feb 1 22:29:39 2012 +0100 + + sms-list: don't signal completed messages + + We will instead not export an SMS until completed and assembled + + src/mm-iface-modem-messaging.c | 13 ------------- + src/mm-sms-list.c | 15 --------------- + src/mm-sms-list.h | 3 --- + 3 files changed, 31 deletions(-) + +commit a91948879c546686797a5ace317a617273d9fc08 +Author: Aleksander Morgado +Date: Wed Feb 1 21:21:48 2012 +0100 + + sms: set modem object, so that the SMS are exported in DBus + + src/mm-sms-list.c | 5 +++-- + src/mm-sms.c | 11 ++++++++--- + src/mm-sms.h | 6 ++++-- + 3 files changed, 15 insertions(+), 7 deletions(-) + +commit 0cdc8e8dd7efeee36dc18abd6b9456447e613283 +Author: Aleksander Morgado +Date: Wed Feb 1 21:12:01 2012 +0100 + + broadband-modem: don't assume CIEV/CIND signal quality is in the + [0,5] range + + When running AT+CIND=? we get the real range for the signal quality + indications, + like: "signal",(1-7). + + The max value doesn't need to be 5; so if we do get min and max, + we will + normalize the returned quality using the proper range and scale it + to the + [0,100] range. + + src/mm-broadband-modem.c | 106 + ++++++++++++++++++++++++++++++++--------------- + 1 file changed, 73 insertions(+), 33 deletions(-) + +commit aee2b32a3551786415041098978640a00df54397 +Author: Aleksander Morgado +Date: Wed Feb 1 21:09:21 2012 +0100 + + modem-helpers: allow strings instead of indexes in CIEV unsolicited + events + + Some modems will report strings instead of indicator indexes, like: + +CIEV: roam,1 + + So allow non-integer indicators. + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb37fc158921d2283787d7089c7a6f318ac6c6d6 +Author: Aleksander Morgado +Date: Wed Feb 1 19:04:13 2012 +0100 + + broadband-modem: log the indexes expected in CIEV unsolicited messages + + src/mm-broadband-modem.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 18ca53b6676ed9eb2cc064d6d8f9acfb48614535 +Author: Aleksander Morgado +Date: Wed Feb 1 19:03:57 2012 +0100 + + modem-helpers: update the regex for the AT+CIND=? response + + Cinterion modems seem to include + "signal",(0-7,99) + + We just get rid of the ',99' part. + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 664f407b99c7b2ec51dc9607bb01123e67145fe4 +Author: Aleksander Morgado +Date: Wed Feb 1 18:44:32 2012 +0100 + + broadband-modem: by default use PDU mode for SMS operations + + Currently the support for text mode lacks a lot of functionality. + + src/mm-broadband-modem.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +commit 0f94abd3ae4c74719c9b2214be84aaa62f8b4be0 +Author: Aleksander Morgado +Date: Wed Feb 1 18:31:58 2012 +0100 + + iface-modem-3gpp: avoid segfault with empty MCCMNC + + src/mm-iface-modem-3gpp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cd5e9c27a37ae2994dfab344ff83912c66cc4c12 +Author: Aleksander Morgado +Date: Wed Feb 1 18:12:44 2012 +0100 + + broadband-modem: if locked, don't try to initialize remaining + interfaces + + Whenever we get unlocked, the modem initialization sequence will be + run again. + + src/mm-base-modem.c | 14 ++++++++++++-- + src/mm-broadband-modem.c | 17 +++++++++++++++++ + src/mm-iface-modem.c | 10 ++++++---- + 3 files changed, 35 insertions(+), 6 deletions(-) + +commit 47a990390175747b2d213681eda4f41a6edb7a7b +Author: Aleksander Morgado +Date: Wed Feb 1 17:06:19 2012 +0100 + + iface-modem-messaging: handle SMS listing + + src/mm-iface-modem-messaging.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 6432c54d7024a36c53bc316b8c697fdd5fca8d68 +Author: Aleksander Morgado +Date: Wed Feb 1 17:06:06 2012 +0100 + + api,dbus: return just the list of SMS object paths, not a dictionary + + new/org.freedesktop.ModemManager1.Modem.Messaging.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 19ce344df8986b88190f538e7c8a5c8bbd43ac05 +Author: Aleksander Morgado +Date: Wed Feb 1 17:01:22 2012 +0100 + + iface-modem-messaging: handle SMS deletion requests + + src/mm-iface-modem-messaging.c | 79 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit 7956fc4e17dbc53c602c0723739c6390c4a05541 +Author: Aleksander Morgado +Date: Wed Feb 1 16:54:25 2012 +0100 + + sms-list: allow deleting an SMS object and its parts + + src/mm-sms-list.c | 83 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-list.h | 8 ++++++ + 2 files changed, 91 insertions(+) + +commit 9dee04a9717c846ae9de004cf3cacccd811845ee +Author: Aleksander Morgado +Date: Wed Feb 1 16:54:08 2012 +0100 + + sms: allow deleting all parts of an SMS + + src/mm-sms.c | 112 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms.h | 7 ++++ + 2 files changed, 119 insertions(+) + +commit 2ede62e45e655eadbcd098dc1e4e746470a79ea6 +Author: Aleksander Morgado +Date: Wed Feb 1 16:03:57 2012 +0100 + + iface-modem-messaging: emit SMS added/completed/deleted signals + + src/mm-iface-modem-messaging.c | 47 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +commit 75b722541735fa37b32d443de5df978980a205eb +Author: Aleksander Morgado +Date: Wed Feb 1 12:51:15 2012 +0100 + + sms-list: signal messages added/completed/deleted + + marshallers/mm-marshal.list | 2 + + src/mm-sms-list.c | 128 + +++++++++++++++++++++++++++++++++++++++++++- + src/mm-sms-list.h | 13 +++++ + 3 files changed, 141 insertions(+), 2 deletions(-) + +commit ba0a622616070961c0d8792b741cdd066a3bb966 +Author: Aleksander Morgado +Date: Wed Feb 1 12:47:37 2012 +0100 + + sms: new method to check if the SMS has a given part + + src/mm-sms.c | 18 ++++++++++++++++++ + src/mm-sms.h | 4 ++++ + 2 files changed, 22 insertions(+) + +commit c938a25ca77b5c10dba8fce982cbac79ef2c003f +Author: Aleksander Morgado +Date: Wed Feb 1 11:18:20 2012 +0100 + + sms: new methods to handle multipart messages + + src/mm-sms.c | 18 ++++++++++++++---- + src/mm-sms.h | 4 +++- + 2 files changed, 17 insertions(+), 5 deletions(-) + +commit 8c5dd282f51a790302e1ac713f63613a95346675 +Author: Aleksander Morgado +Date: Wed Feb 1 11:17:50 2012 +0100 + + sms-part: new method to check if the part is from a multipart message + + src/mm-sms-part.c | 16 +++++++++++++--- + src/mm-sms-part.h | 8 +++++--- + 2 files changed, 18 insertions(+), 6 deletions(-) + +commit c29f06f1e5b0e9d7e6857da142bdc1a184f74ffa +Author: Aleksander Morgado +Date: Wed Feb 1 11:02:22 2012 +0100 + + api,dbus: just notify SMS object paths, not their properties + + When notifying added or completed SMS objects, don't return their + properties as + they can be retrieved by looking at the specific objects in DBus. + + new/org.freedesktop.ModemManager1.Modem.Messaging.xml | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +commit 157dd69646df6e7750fd91b2120ebc1af385e689 +Author: Aleksander Morgado +Date: Wed Feb 1 10:01:21 2012 +0100 + + broadband-modem: default implementation of SMS part list loading + + src/mm-broadband-modem.c | 97 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + +commit d996ef84f4b31b376ef71dff28181bd859c9b8d7 +Author: Aleksander Morgado +Date: Wed Feb 1 10:00:43 2012 +0100 + + iface-modem-messaging: load initial list of SMS parts + + src/mm-iface-modem-messaging.c | 64 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 15 ++++++++++ + 2 files changed, 79 insertions(+) + +commit 9079d660a52744f1d53a2d50d96d057775a4f86c +Author: Aleksander Morgado +Date: Wed Feb 1 09:59:53 2012 +0100 + + broadband-modem: default implementation of SMS format setting + + src/mm-broadband-modem.c | 117 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 117 insertions(+) + +commit 21b1de678d3c457716fd4caffe1b179cb3212a2f +Author: Aleksander Morgado +Date: Wed Feb 1 09:58:32 2012 +0100 + + iface-modem-messaging: allow configuring preferred SMS format + + src/mm-iface-modem-messaging.c | 34 ++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 8 ++++++++ + 2 files changed, 42 insertions(+) + +commit 14fa4aae1d8c5e07c2eb0e6546e036e868de6b9b +Author: Aleksander Morgado +Date: Wed Feb 1 09:55:43 2012 +0100 + + broadband-modem: override the SMS list property + + src/mm-broadband-modem.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +commit 03ee0b44f68fe081e85240f3c9e3a3ed83e5698b +Author: Aleksander Morgado +Date: Wed Feb 1 09:54:28 2012 +0100 + + iface-modem-messaging: new property to handle the list of SMS objects + + src/mm-iface-modem-messaging.c | 27 ++++++++++++++++++++++++++- + src/mm-iface-modem-messaging.h | 1 + + 2 files changed, 27 insertions(+), 1 deletion(-) + +commit fba16a2a2c1bccf8bef6181b09fda07752f8f7a2 +Author: Aleksander Morgado +Date: Wed Feb 1 09:51:57 2012 +0100 + + sms-list: new object to handle SMS objects and SMS parts + + src/Makefile.am | 2 + + src/mm-sms-list.c | 170 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-list.h | 59 +++++++++++++++++++ + 3 files changed, 231 insertions(+) + +commit ad8fbcd1a6b37aabc18b14864eecc17f48a1b927 +Author: Aleksander Morgado +Date: Wed Feb 1 09:49:47 2012 +0100 + + sms: new object to handle single-part and multi-part messages + + src/Makefile.am | 2 + + src/mm-sms.c | 415 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms.h | 71 ++++++++++ + 3 files changed, 488 insertions(+) + +commit d41f4226f43fa12a54794497fb54dcbaa72a69ef +Author: Aleksander Morgado +Date: Wed Feb 1 09:49:15 2012 +0100 + + sms-part: new struct to handle parsed SMS parts + + src/Makefile.am | 2 + + src/mm-sms-part.c | 444 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-part.h | 43 ++++++ + 3 files changed, 489 insertions(+) + +commit b34d14ba5b090df33fba46bf0cc3100299026bc9 +Author: Aleksander Morgado +Date: Wed Feb 1 09:43:35 2012 +0100 + + api,header: include default DBus path prefix for SMS objects + + build-aux/header-generator.xsl | 1 + + 1 file changed, 1 insertion(+) + +commit bc375ec7c5611be3a9839f0e93ead3fb2024c632 +Author: Aleksander Morgado +Date: Wed Feb 1 09:42:48 2012 +0100 + + libmm-common: include gdbus-codegen generated SMS-related sources + + libmm-common/libmm-common.h | 1 + + 1 file changed, 1 insertion(+) + +commit 2bb43e00207f101673cc178d41c667c17ee6ea2f +Author: Aleksander Morgado +Date: Wed Feb 1 09:42:29 2012 +0100 + + modem-helpers: new CMGF format query result parser + + src/mm-modem-helpers.c | 57 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 5 +++++ + 2 files changed, 62 insertions(+) + +commit 4c6765857b53a204afd70fc247a2f1bc817d82b3 +Author: Aleksander Morgado +Date: Wed Jan 25 15:57:06 2012 +0100 + + broadband-modem: implement default messaging support check + + We'll just: + * Report unsupported on CDMA-only modems. + * Check if AT+CNMI=? replies correctly, and if so, assume SMS-based + messaging + is supported. + + src/mm-broadband-modem.c | 68 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 68 insertions(+) + +commit c9c46b6f51fe756a3260018671627d9d2f98554e +Author: Aleksander Morgado +Date: Wed Jan 25 15:55:54 2012 +0100 + + iface-modem-messaging: check if modem has messaging capabilities + + The interface won't be exported if the given check fails. + + src/mm-iface-modem-messaging.c | 82 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 8 +++++ + 2 files changed, 90 insertions(+) + +commit 52f1c87b06339250cd9cbfb267105cdb264ae73c +Author: Aleksander Morgado +Date: Wed Jan 25 13:04:30 2012 +0100 + + broadband-modem: implement the Messaging interface + + src/mm-broadband-modem.c | 58 + +++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 55 insertions(+), 3 deletions(-) + +commit bc0454badf7df37f67af2e327da6ea54b5f558e6 +Author: Aleksander Morgado +Date: Wed Jan 25 12:51:08 2012 +0100 + + iface-modem-messaging: new interface to handle the Messaging DBus + interface + + src/Makefile.am | 2 + + src/mm-iface-modem-messaging.c | 379 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-messaging.h | 71 ++++++++ + 3 files changed, 452 insertions(+) + +commit 37bc2103c956b5f99997a8d25267b7353410b1ee +Author: Aleksander Morgado +Date: Thu Jan 26 20:57:35 2012 +0100 + + broadband-bearer: fix default implementations of connect_3gpp() + and connect_cdma() + + These implementations must not update neither port nor + connection_type, as + these items are specific of the MMBroadbandBearer object, and + hence not + available by subclasses. + + src/mm-broadband-bearer.c | 27 ++++++++++++++++++--------- + 1 file changed, 18 insertions(+), 9 deletions(-) + +commit c9e7e80c3b912b15c8c4f9bdedf627603ff23876 +Author: Aleksander Morgado +Date: Thu Jan 26 17:32:59 2012 +0100 + + iface-modem-3gpp: update access tech and location even if registration + didn't change + + src/mm-iface-modem-3gpp.c | 56 + +++++++++++++++++++++++------------------------ + 1 file changed, 28 insertions(+), 28 deletions(-) + +commit ad37101c0db0cda89b422c4d9d60cb7b61cb3512 +Author: Aleksander Morgado +Date: Wed Jan 25 12:50:07 2012 +0100 + + api,dbus: don't allow for an SMS object to delete itself + + Managing existence of the SMS objects better done only via the + Messaging + interface. + + new/org.freedesktop.ModemManager1.Modem.Messaging.xml | 4 +--- + new/org.freedesktop.ModemManager1.Sms.xml | 7 ------- + 2 files changed, 1 insertion(+), 10 deletions(-) + +commit c2e750d5bfa328fe0ba8c3dc1e1d8c818ad74849 +Author: Aleksander Morgado +Date: Wed Jan 25 11:45:14 2012 +0100 + + sim: avoid passing source of the async object in finish + + src/mm-broadband-modem.c | 4 ++-- + src/mm-sim.c | 9 ++++++--- + src/mm-sim.h | 3 +-- + 3 files changed, 9 insertions(+), 7 deletions(-) + +commit 64de09f052af5f5ecb0bc295bdcdccff803657ee +Author: Aleksander Morgado +Date: Wed Jan 25 17:22:20 2012 +0100 + + broadband-modem: if failed to initialize an optional interface, + shut it down + + src/mm-broadband-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit ffa374c793ac360262e414cab16c40edd1859543 +Author: Aleksander Morgado +Date: Tue Jan 24 17:12:46 2012 +0100 + + cli: fail if requesting location actions and modem doesn't handle + locations + + cli/mmcli-modem-location.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit c075363c2c3563d548f12598a30d1a255e8285cb +Author: Aleksander Morgado +Date: Tue Jan 24 17:11:18 2012 +0100 + + cli: fail if requesting CDMA actions and modem is not CDMA + + cli/mmcli-modem-cdma.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 0527667500463cf858612b6e88b7d2f3e8e58d2e +Author: Aleksander Morgado +Date: Tue Jan 24 17:05:45 2012 +0100 + + cli: include 3GPP-USSD specific actions + + cli/mmcli-modem-3gpp.c | 226 + ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 224 insertions(+), 2 deletions(-) + +commit 31ce3e5ae140ffd5a96f8b010d4a281dafb0d17e +Author: Aleksander Morgado +Date: Tue Jan 24 16:19:05 2012 +0100 + + cli: fail if requesting 3GPP actions and modem is not 3GPP + + cli/mmcli-modem-3gpp.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit a1b199d90338c2756673ff1b3c46cacbb2a6e20c +Author: Aleksander Morgado +Date: Tue Jan 24 15:35:42 2012 +0100 + + libmm-glib: handle the 3GPP/USSD interface + + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-3gpp-ussd.c | 291 + ++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-3gpp-ussd.h | 85 ++++++++++++ + libmm-glib/mm-object.c | 34 +++++ + libmm-glib/mm-object.h | 3 + + 5 files changed, 415 insertions(+) + +commit e808e04910fbe30b2af5e81e329b7ff27a8bc95b +Author: Aleksander Morgado +Date: Tue Jan 24 14:53:26 2012 +0100 + + broadband-modem: implement USSD cancellation + + src/mm-broadband-modem.c | 53 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +commit 8acf9e4fbc9532dcd896517acdc9aa4ca273cc86 +Author: Aleksander Morgado +Date: Tue Jan 24 14:47:30 2012 +0100 + + broadband-modem: implement USSD command sending + + src/mm-broadband-modem.c | 106 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 104 insertions(+), 2 deletions(-) + +commit 2bf40184e058fed71fe4d5815964a433271895ca +Author: Aleksander Morgado +Date: Tue Jan 24 13:10:37 2012 +0100 + + iface-modem-3gpp-ussd: allow error reporting in encode/decode + + src/mm-broadband-modem.c | 186 + +++++++++++++++++++++++++---------------- + src/mm-iface-modem-3gpp-ussd.c | 10 ++- + src/mm-iface-modem-3gpp-ussd.h | 12 ++- + 3 files changed, 128 insertions(+), 80 deletions(-) + +commit 7210e6caf1cc54b43aff9b7d4e62489ab8188799 +Author: Aleksander Morgado +Date: Mon Jan 23 17:59:17 2012 +0100 + + iface-modem-3gpp-ussd: handle USSD session initiate/respond/cancel + + src/mm-iface-modem-3gpp-ussd.c | 205 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 17 ++++ + 2 files changed, 222 insertions(+) + +commit f3ee74c1e871f23564d7e6c5198ed26a8dd35833 +Author: Aleksander Morgado +Date: Mon Jan 23 15:23:47 2012 +0100 + + broadband-modem: implement default handling of USSD URCs + + src/mm-broadband-modem.c | 133 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 132 insertions(+), 1 deletion(-) + +commit e975543316f6bf95a21b2db37ec48dd43ef0cec0 +Author: Aleksander Morgado +Date: Mon Jan 23 17:55:56 2012 +0100 + + broadband-modem: implement default USSD encode/decode + + src/mm-broadband-modem.c | 43 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 4 ++++ + 2 files changed, 47 insertions(+) + +commit 3ea437d522879e4dd6ddcf632512f587f2adb227 +Author: Aleksander Morgado +Date: Mon Jan 23 17:54:46 2012 +0100 + + iface-modem-3gpp-ussd: allow subclassing encode/decode + + src/mm-iface-modem-3gpp-ussd.c | 17 +++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 14 ++++++++++++++ + 2 files changed, 31 insertions(+) + +commit 5d330154a5b00a69feb64dc601e60094678f7c0d +Author: Aleksander Morgado +Date: Mon Jan 23 17:53:57 2012 +0100 + + iface-modem-3gpp-ussd: allow setting properties from implementations + + src/mm-iface-modem-3gpp-ussd.c | 51 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 8 +++++++ + 2 files changed, 59 insertions(+) + +commit f0bbe7aa114db3d2a3044e6e1ec4ac9d63a6509c +Author: Aleksander Morgado +Date: Mon Jan 23 17:48:51 2012 +0100 + + api,dbus: USSD session state is given as a + `MMModem3gppUssdSessionState' + + new/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4718ba00557295b1955e13ab138b5a784c840dfc +Author: Aleksander Morgado +Date: Mon Jan 23 15:23:27 2012 +0100 + + broadband-modem: implement generic URC setup/cleanup + + src/mm-broadband-modem.c | 79 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit fdbb07ca427a8dbc9885fa2166a16d27b5d85e59 +Author: Aleksander Morgado +Date: Mon Jan 23 15:22:14 2012 +0100 + + iface-modem-3gpp-ussd: implement logic to setup/cleanup URC message + handlers + + src/mm-iface-modem-3gpp-ussd.c | 88 + ++++++++++++++++++++++++++++++++---------- + src/mm-iface-modem-3gpp-ussd.h | 16 ++++++++ + 2 files changed, 84 insertions(+), 20 deletions(-) + +commit 259ce3439bbc52dbb2e3e219bbe9accc844fa634 +Author: Aleksander Morgado +Date: Mon Jan 23 15:21:20 2012 +0100 + + iface-modem-3gpp-ussd: set initial property defaults + + src/mm-iface-modem-3gpp-ussd.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3e866b2330b224be47e7d19b2e4dbac483fdb946 +Author: Aleksander Morgado +Date: Mon Jan 23 15:20:39 2012 +0100 + + api,header: new `MM_MODEM_3GPP_USSD_SESSION_STATE_UNKNOWN' + + To be set when USSD is not enabled. + + include/ModemManager-enums.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 81d130b2bb92eeb7736b04e325fe739cea87c6f0 +Author: Aleksander Morgado +Date: Mon Jan 23 15:19:28 2012 +0100 + + base-modem: initially set the unsolicited CUSD handler with NULL + callback + + src/mm-base-modem.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit f37a1a2b62ab40e907364f000372eb8a7daa9d95 +Author: Aleksander Morgado +Date: Mon Jan 23 15:19:00 2012 +0100 + + modem-helpers: new method to get common CUSD regex + + src/mm-modem-helpers.c | 11 +++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 13 insertions(+) + +commit c9c2a9aa4d0641056a8d36afb60b92c4f93748d9 +Author: Aleksander Morgado +Date: Mon Jan 23 12:05:59 2012 +0100 + + broadband-modem: default URC enabling/disabling implementation + + src/mm-broadband-modem.c | 77 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 77 insertions(+) + +commit b28af06d1cf09ec513c3564e4f7ead4f7f2721bf +Author: Aleksander Morgado +Date: Mon Jan 23 12:01:33 2012 +0100 + + iface-modem-3gpp-ussd: implement logic to enable/disable URCs + + src/mm-iface-modem-3gpp-ussd.c | 68 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 16 ++++++++++ + 2 files changed, 84 insertions(+) + +commit 1f01274a5fe9478d9cfbbe15d2971cbe033ce84b +Author: Aleksander Morgado +Date: Mon Jan 23 11:44:24 2012 +0100 + + broadband-modem: implement generic USSD support check + + src/mm-broadband-modem.c | 55 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +commit e491dc2b9c18f48261b42bbe6cc01eb1ae309e60 +Author: Aleksander Morgado +Date: Mon Jan 23 11:44:06 2012 +0100 + + iface-modem-3gpp-ussd: check if USSD supported + + src/mm-iface-modem-3gpp-ussd.c | 85 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 8 ++++ + 2 files changed, 93 insertions(+) + +commit a54226a0dda5666b9df5324fbfbc5208795308d8 +Author: Aleksander Morgado +Date: Mon Jan 23 10:49:50 2012 +0100 + + broadband-modem: implement the 3GPP/USSD interface + + src/mm-broadband-modem.c | 79 + ++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 67 insertions(+), 12 deletions(-) + +commit b65f96aec73e0b4cba3e9e1fa76438b7e68f300a +Author: Aleksander Morgado +Date: Mon Jan 23 10:49:24 2012 +0100 + + iface-modem-3gpp-ussd: new interface for USSD related actions + + src/Makefile.am | 2 + + src/mm-iface-modem-3gpp-ussd.c | 387 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp-ussd.h | 73 ++++++++ + 3 files changed, 462 insertions(+) + +commit 18531e5a2d4ee4a96bc789adcd94bf0209fffd81 +Author: Aleksander Morgado +Date: Sun Jan 22 18:39:14 2012 +0100 + + cinterion: implement supported bands loading logic + + plugins/mm-broadband-modem-cinterion.c | 54 + ++++++++++++++++++++++++++++++++++ + 1 file changed, 54 insertions(+) + +commit 45ca92ee2e6cc4537e1d8be4594cff652d35958b +Author: Aleksander Morgado +Date: Sun Jan 22 18:00:36 2012 +0100 + + cinterion: implement allowed modes setting logic + + plugins/mm-broadband-modem-cinterion.c | 121 + +++++++++++++++++++++++++++++++++ + 1 file changed, 121 insertions(+) + +commit a6301ee0c461f5f9af800877d56fb3af6fc15d7b +Author: Aleksander Morgado +Date: Sun Jan 22 15:54:05 2012 +0100 + + cinterion: implement access technology loading logic + + plugins/mm-broadband-modem-cinterion.c | 250 + +++++++++++++++++++++++++++++++++ + 1 file changed, 250 insertions(+) + +commit 8321bd5875a5aedb845d8b196ae6db75c3f769d2 +Author: Aleksander Morgado +Date: Sun Jan 22 12:55:23 2012 +0100 + + iface-modem: periodically request to update current access + technologies + + src/mm-iface-modem.c | 136 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-iface-modem.h | 10 ++++ + 2 files changed, 140 insertions(+), 6 deletions(-) + +commit 59e903820d21dc041443ebb05348ee305d269429 +Author: Aleksander Morgado +Date: Sun Jan 22 12:55:00 2012 +0100 + + api,header: new MM_ACCESS_TECHNOLOGY_ANY + + Helps as a mask covering all the available access technologies. + + include/ModemManager-enums.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 65455558bef9dd885805f650a2afea149aedf546 +Author: Aleksander Morgado +Date: Sun Jan 22 10:44:34 2012 +0100 + + iface-modem: s/access_tech/access_technologies + + src/mm-iface-modem-3gpp.c | 12 ++++++------ + src/mm-iface-modem-cdma.c | 24 ++++++++++++------------ + src/mm-iface-modem.c | 6 +++--- + src/mm-iface-modem.h | 6 +++--- + 4 files changed, 24 insertions(+), 24 deletions(-) + +commit 6d5c98b30c6cc19ae7bac33171e33244358fd746 +Author: Aleksander Morgado +Date: Sun Jan 22 00:14:39 2012 +0100 + + cinterion: implement custom unsolicited events enabling command + + plugins/mm-broadband-modem-cinterion.c | 46 + ++++++++++++++++++++++++++++++++-- + 1 file changed, 44 insertions(+), 2 deletions(-) + +commit 5667339ead6df6d4877e7c15233227da1e090a32 +Author: Aleksander Morgado +Date: Sun Jan 22 00:14:09 2012 +0100 + + broadband-modem: implement the default setup/enable unsolicited + events logic + + src/mm-broadband-modem.c | 106 + +++++++++++++++++++++++++++++++++-------------- + 1 file changed, 76 insertions(+), 30 deletions(-) + +commit 3acdf7b9b8fe499750a3791c282cf00b5899c6d3 +Author: Aleksander Morgado +Date: Sun Jan 22 00:13:43 2012 +0100 + + iface-modem-3gpp: split unsolicited events setup and enabling + + Configuring unsolicited events involves: + + * Setup unsolicited events. This handles the setup of the unsolicited + message + handlers in the AT ports, including the setup of the callback to + get called + when the unsolicited messages are received. + + * Enable unsolicited events. This tells the modem to actually + send the + unsolicited messages. + + * Disable unsolicited events. This tells the modem to stop sending + unsolicited + messages. + + * Cleanup unsolicited events. This removes the unsolicited message + handlers + in the AT ports. + + src/mm-iface-modem-3gpp.c | 94 + +++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem-3gpp.h | 16 ++++++++ + 2 files changed, 107 insertions(+), 3 deletions(-) + +commit 050c30db1c5ac9ed5003b73fd4cbf0fe56f3008f +Author: Aleksander Morgado +Date: Sat Jan 21 18:24:26 2012 +0100 + + iface-modem-simple: don't create a bearer if we can reuse an + existing one + + src/mm-iface-modem-simple.c | 38 ++++++++++++++++++++++++-------------- + 1 file changed, 24 insertions(+), 14 deletions(-) + +commit 77999f3bcec7753bdcc5a51da4c271c78157f051 +Author: Aleksander Morgado +Date: Sat Jan 21 18:24:06 2012 +0100 + + bearer-list: new method to look for a bearer using its properties + + src/mm-bearer-list.c | 14 ++++++++++++++ + src/mm-bearer-list.h | 3 +++ + 2 files changed, 17 insertions(+) + +commit 718093dc59f2cce7556d28efa4a26866b39e4c2e +Author: Aleksander Morgado +Date: Sat Jan 21 18:08:41 2012 +0100 + + broadband-bearer: implement comparison with bearer properties + + src/mm-broadband-bearer.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 1603fd1109d6056320472e072c5ec3698a95c81c +Author: Aleksander Morgado +Date: Sat Jan 21 18:08:03 2012 +0100 + + bearer: allow comparing current bearer with a set of properties + + src/mm-bearer.c | 9 +++++++++ + src/mm-bearer.h | 7 +++++++ + 2 files changed, 16 insertions(+) + +commit cf4633649443e8292529f34f055562dbf7df089e +Author: Aleksander Morgado +Date: Sat Jan 21 16:34:20 2012 +0100 + + cli: allow specifying bearers and SIMs by index + + So, these two are equivalent: + $> mmcli -b 0 + $> mmcli -b /org/freedesktop/ModemManager1/Bearer/0 + + and also this two: + $> mmcli -s 0 + $> mmcli -s /org/freedesktop/ModemManager1/SIM/0 + + cli/mmcli-common.c | 138 + ++++++++++++++++++++++++++++++++++++++--------------- + cli/mmcli-common.h | 12 ++--- + 2 files changed, 106 insertions(+), 44 deletions(-) + +commit 885042e3651a8a3ead8928c233522bd41297bd63 +Author: Aleksander Morgado +Date: Sat Jan 21 16:11:16 2012 +0100 + + api,header: define common object prefixes in the daemon header + + build-aux/header-generator.xsl | 9 +++++++-- + src/mm-bearer.h | 3 --- + src/mm-manager.c | 2 +- + src/mm-sim.h | 3 --- + 4 files changed, 8 insertions(+), 9 deletions(-) + +commit 93a776b17c3265c952fd071bbd8bbd2c70d83e73 +Author: Aleksander Morgado +Date: Sat Jan 21 15:58:51 2012 +0100 + + sim: allow subclassing pin change/enabling + + src/mm-sim.c | 188 + ++++++++++++++++++++++++++++++++++++++++++++++------------- + src/mm-sim.h | 20 +++++++ + 2 files changed, 168 insertions(+), 40 deletions(-) + +commit c65c5aedc334d5eaa0a186c183f79b2c5645379f +Author: Aleksander Morgado +Date: Sat Jan 21 15:43:31 2012 +0100 + + sim: allow subclassing pin/puk sending operations + + src/mm-iface-modem-simple.c | 1 - + src/mm-sim.c | 164 + +++++++++++++++++++++++++++++++++++++------- + src/mm-sim.h | 29 +++++++- + 3 files changed, 166 insertions(+), 28 deletions(-) + +commit 72afc058bffff9753cd1cc612b01adaf4143ed5b +Author: Aleksander Morgado +Date: Sat Jan 21 12:41:15 2012 +0100 + + sim: allow subclassing the SIM object + + Plugins can subclass the MMSim object and provide custom + implementations of the + actions performed by the object. + + src/mm-sim.c | 23 +++++++++++++++++------ + src/mm-sim.h | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 49 insertions(+), 6 deletions(-) + +commit 24c28c2692c776ded60c54766a8bdbf3c298bde1 +Author: Aleksander Morgado +Date: Sat Jan 21 12:25:36 2012 +0100 + + sim: export only valid objects + + src/mm-sim.c | 48 ++++++++++++++++++++++++++++++++---------------- + src/mm-sim.h | 5 +++++ + 2 files changed, 37 insertions(+), 16 deletions(-) + +commit 418e0ac5596bc305c3806f4f85a0d94a2077de74 +Author: Nathan Williams +Date: Sat Jan 21 11:16:22 2012 +0100 + + libmm-common: CDMA sid/nid are uint, not enum + + libmm-common/mm-common-simple-properties.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4aeadbb7765e3b55c0bcfbeb13f5fd3b3e721e40 +Author: Aleksander Morgado +Date: Fri Jan 20 12:30:12 2012 +0100 + + iface-modem: proper fallback state when bearer connection fails + + src/mm-iface-modem.c | 60 + ++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 40 insertions(+), 20 deletions(-) + +commit a2203d7d14379a47ff96afc9a7820ee11cc542fd +Author: Aleksander Morgado +Date: Fri Jan 20 11:51:26 2012 +0100 + + broadband-bearer: expose properties used by the bearer implementation + + src/mm-broadband-bearer.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 9feb177e212f07351b7d485da375dc736f3d9bd6 +Author: Aleksander Morgado +Date: Fri Jan 20 11:51:02 2012 +0100 + + bearer: expose IP config dictionaries with unknown method + + src/mm-bearer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 507b48dcd99e70b08a0cc80eb196942ab57ad957 +Author: Aleksander Morgado +Date: Fri Jan 20 11:47:20 2012 +0100 + + cli: IP config getters return newly created objects + + cli/mmcli-bearer.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 2a5e9b46b6b27b8c0a7b26f0087f97259cbab71f +Author: Aleksander Morgado +Date: Fri Jan 20 11:46:52 2012 +0100 + + libmm-glib: use the common IP config object from libmm-common + + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-bearer-ip-config.c | 56 ++++++++++ + libmm-glib/mm-bearer-ip-config.h | 39 +++++++ + libmm-glib/mm-bearer.c | 222 + +++------------------------------------ + libmm-glib/mm-bearer.h | 28 +---- + 5 files changed, 115 insertions(+), 233 deletions(-) + +commit f797beefacc321b680b4813b7efc734d099b5f33 +Author: Aleksander Morgado +Date: Fri Jan 20 11:46:28 2012 +0100 + + libmm-common: build dictionary even if IP config object not given + + libmm-common/mm-common-bearer-ip-config.c | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +commit af1f8ed6b35de3ac08263e8ee1de8783f54ffa20 +Author: Aleksander Morgado +Date: Fri Jan 20 10:54:45 2012 +0100 + + broadband-modem: disconnect all bearers when disabling + + src/mm-broadband-modem.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +commit a33b05cc10e3317b2fddea709da4938c239c506e +Author: Aleksander Morgado +Date: Thu Jan 19 15:40:14 2012 +0100 + + broadband-bearer: reimplement CDMA and 3GPP disconnection logic + + src/mm-broadband-bearer.c | 384 + +++++++++++++++++++++++++++++++++++----------- + src/mm-broadband-bearer.h | 24 +++ + 2 files changed, 320 insertions(+), 88 deletions(-) + +commit 9ab4ad28ff8bdd62ba16012fc0af4f950720da02 +Author: Aleksander Morgado +Date: Fri Jan 20 10:53:44 2012 +0100 + + bearer-list: new async method to disconnect all bearers + + src/mm-bearer-list.c | 87 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-bearer-list.h | 7 +++++ + 2 files changed, 93 insertions(+), 1 deletion(-) + +commit 43ac87170cffe9da225dc3a0e6dd2c0e6a487ca3 +Author: Aleksander Morgado +Date: Thu Jan 19 17:51:08 2012 +0100 + + bearer: don't handle reasons to forbid connection in the generic + Bearer object + + src/mm-bearer.c | 67 + ++++++++------------------------------------------------- + src/mm-bearer.h | 21 ++++++------------ + 2 files changed, 15 insertions(+), 73 deletions(-) + +commit 6ae1785b644d26ec8e1344e6f55e13f9b8522961 +Author: Aleksander Morgado +Date: Thu Jan 19 15:41:19 2012 +0100 + + broadband-bearer: don't connect if roaming forbidden or unregistered + + src/mm-broadband-bearer.c | 236 + +++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 214 insertions(+), 22 deletions(-) + +commit 015756e57299b9fbd1fe62f48962951ede5fb517 +Author: Aleksander Morgado +Date: Thu Jan 19 15:39:40 2012 +0100 + + broadband-bearer: reimplement CDMA and 3GPP connection logic + + src/mm-broadband-bearer.c | 666 + ++++++++++++++++++++++++++-------------------- + src/mm-broadband-bearer.h | 32 +++ + 2 files changed, 413 insertions(+), 285 deletions(-) + +commit 1d450d7c4eba60d5d85c3feba0a3f9abcd527696 +Author: Aleksander Morgado +Date: Thu Jan 19 15:36:34 2012 +0100 + + broadband-modem: by default, just create a single broadband bearer + + src/mm-broadband-modem.c | 86 + +++++++----------------------------------------- + 1 file changed, 12 insertions(+), 74 deletions(-) + +commit c6b9aead8140a20aa89ffca9b4fc585c533b8b39 +Author: Aleksander Morgado +Date: Thu Jan 19 15:34:51 2012 +0100 + + bearer: subclasses need to report IPv4/v6 config when connection ready + + src/mm-bearer.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- + src/mm-bearer.h | 3 +++ + 2 files changed, 47 insertions(+), 1 deletion(-) + +commit aa36af424dfb0962605c209529c0bc217e04b83f +Author: Aleksander Morgado +Date: Thu Jan 19 15:34:11 2012 +0100 + + bearer: number in Connect() no longer needed + + src/mm-bearer.c | 6 +----- + src/mm-bearer.h | 2 -- + 2 files changed, 1 insertion(+), 7 deletions(-) + +commit a400db4b5c79052a46fe07474b56fda58488c21e +Author: Aleksander Morgado +Date: Thu Jan 19 15:32:55 2012 +0100 + + bearer: remove allow-roaming, only meaningful in the broadband bearer + + src/mm-bearer.c | 24 ------------------------ + src/mm-bearer.h | 3 --- + 2 files changed, 27 deletions(-) + +commit 22846fc46f17a29638e086600f00b96f15701ba5 +Author: Aleksander Morgado +Date: Thu Jan 19 15:30:45 2012 +0100 + + cli: remove `--connect-with-number' option, no longer needed + + cli/mmcli-bearer.c | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +commit 98d7edadb5b50663c4c26285e58459476896ad98 +Author: Aleksander Morgado +Date: Thu Jan 19 15:30:28 2012 +0100 + + libmm-glib: number no longer needed in Connect() + + libmm-glib/mm-bearer.c | 10 ---------- + libmm-glib/mm-bearer.h | 2 -- + 2 files changed, 12 deletions(-) + +commit 009582b6fd763b1516077b4db882152b061263b4 +Author: Aleksander Morgado +Date: Thu Jan 19 15:30:07 2012 +0100 + + api,dbus: remove optional 'number' in bearer Connect() call + + We can already give the number as a parameter in the dictionary + when creating + the Bearer object. + + new/org.freedesktop.ModemManager1.Bearer.xml | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +commit ff7406005d0ea802fc1ffe3f352ce1108a716b97 +Author: Aleksander Morgado +Date: Thu Jan 19 15:29:06 2012 +0100 + + libmm-common: new helper object to handle Bearer IP config + + libmm-common/Makefile.am | 4 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-common-bearer-ip-config.c | 296 + ++++++++++++++++++++++++++++++ + libmm-common/mm-common-bearer-ip-config.h | 73 ++++++++ + 4 files changed, 374 insertions(+) + +commit fa17f900825b44a56ebc1f34b6e07b5162fd1066 +Author: Aleksander Morgado +Date: Thu Jan 19 15:27:40 2012 +0100 + + bearer-3gpp, bearer-cdma: removed, they were mixed in broadband-bearer + + src/Makefile.am | 4 - + src/mm-bearer-3gpp.c | 946 + --------------------------------------------------- + src/mm-bearer-3gpp.h | 71 ---- + src/mm-bearer-cdma.c | 833 --------------------------------------------- + src/mm-bearer-cdma.h | 69 ---- + 5 files changed, 1923 deletions(-) + +commit 2b1aabe4fd8c177b87522af9b2139f13ec1c2672 +Author: Aleksander Morgado +Date: Thu Jan 19 15:26:37 2012 +0100 + + iface-modem-3gpp: 3GPP bearer creation removed + + src/mm-iface-modem-3gpp.c | 258 + ---------------------------------------------- + src/mm-iface-modem-3gpp.h | 18 ---- + 2 files changed, 276 deletions(-) + +commit 63f209d6da0cc2349c6911876a11814e98e3acd2 +Author: Aleksander Morgado +Date: Thu Jan 19 15:26:24 2012 +0100 + + iface-modem-cdma: CDMA bearer creation removed + + src/mm-iface-modem-cdma.c | 59 + ----------------------------------------------- + src/mm-iface-modem-cdma.h | 18 --------------- + 2 files changed, 77 deletions(-) + +commit 24dd208b59310deb6fce4b35495c6dc854c74920 +Author: Aleksander Morgado +Date: Thu Jan 19 15:25:58 2012 +0100 + + iface-modem-simple: remove dual 3GPP/CDMA bearers logic + + Just rely on a single Bearer object created. + + src/mm-iface-modem-simple.c | 400 + +++++--------------------------------------- + 1 file changed, 41 insertions(+), 359 deletions(-) + +commit a3b5c9faef4ef27cc0f7e67d0c639bf929b884b2 +Author: Aleksander Morgado +Date: Wed Jan 18 23:39:42 2012 +0100 + + broadband-bearer: new generic 3GPP+CDMA bearer + + src/Makefile.am | 2 + + src/mm-broadband-bearer.c | 1480 + +++++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-bearer.h | 69 +++ + 3 files changed, 1551 insertions(+) + +commit 6c2dc9eef18952f9c612d8307865e00db9c4a36a +Author: Aleksander Morgado +Date: Wed Jan 18 23:39:19 2012 +0100 + + bearer: set unique path when the bearer gets exported + + src/mm-bearer.c | 27 +++++++++++++++++++++------ + src/mm-bearer.h | 1 + + 2 files changed, 22 insertions(+), 6 deletions(-) + +commit 2ca4d36e5e47bf47e076c8a3cd55ebe12950c31a +Author: Aleksander Morgado +Date: Thu Jan 19 01:16:15 2012 +0100 + + libmm-common: 3gpp location doesn't use any of our enum/flags + + libmm-common/mm-common-location-3gpp.c | 1 - + 1 file changed, 1 deletion(-) + +commit d5b74be89924d7562b198d5f2fec23520048eae6 +Author: Aleksander Morgado +Date: Thu Jan 19 00:59:41 2012 +0100 + + build: fix errors template + + Equivalent to the fix in d15b1f201 applied to the enums template. + + Spotted by Nathan Williams. + + build-aux/mm-errors-template.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 332d1a089113ddf89ec3a0fbb556d54ac23cd7c8 +Author: Aleksander Morgado +Date: Thu Jan 19 00:58:30 2012 +0100 + + build: add missing build dependency in libmm-common + + Spotted by Nathan Williams. + + libmm-common/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 8d25f46292c5155f498feff7ee78ccbec0d6ec9f +Author: Aleksander Morgado +Date: Wed Jan 18 18:01:44 2012 +0100 + + build: we no longer need to have the DBus.Properties introspection XML + + Not needed in gdbus-based code. + + new/org.freedesktop.DBus.Properties.xml | 45 + --------------------------------- + 1 file changed, 45 deletions(-) + +commit c753649361d0339f8b491aca2ef53cdc11727075 +Author: Aleksander Morgado +Date: Wed Jan 18 13:45:40 2012 +0100 + + cli: use new enums/flags string getters/builders + + cli/mmcli-bearer.c | 6 ++-- + cli/mmcli-common.c | 91 + ------------------------------------------------ + cli/mmcli-common.h | 10 +----- + cli/mmcli-modem-3gpp.c | 4 +-- + cli/mmcli-modem-simple.c | 12 +++---- + cli/mmcli-modem.c | 30 ++++++++-------- + 6 files changed, 27 insertions(+), 126 deletions(-) + +commit a3532e7730b9f776c5590f2680f444306e411bdd +Author: Aleksander Morgado +Date: Wed Jan 18 13:45:32 2012 +0100 + + libmm-common: flags string builders are now all autogenerated + + libmm-common/mm-common-helpers.c | 141 + ++------------------------------------- + libmm-common/mm-common-helpers.h | 7 +- + 2 files changed, 8 insertions(+), 140 deletions(-) + +commit 69e860329b92796fc9d7e648f67ae09a77d41840 +Author: Aleksander Morgado +Date: Wed Jan 18 13:44:51 2012 +0100 + + libmm-glib: no need to expose custom flags string builders + + libmm-glib/mm-modem.c | 58 + --------------------------------------------------- + libmm-glib/mm-modem.h | 6 ------ + 2 files changed, 64 deletions(-) + +commit 7e36f04b37c14a518370dd5be2e99b7c629b5214 +Author: Aleksander Morgado +Date: Wed Jan 18 13:43:49 2012 +0100 + + core: use new enums/flags string getters/builders + + src/mm-bearer-cdma.c | 9 ++------ + src/mm-bearer.c | 20 ++++------------- + src/mm-broadband-modem.c | 2 +- + src/mm-iface-modem-3gpp.c | 16 +++----------- + src/mm-iface-modem-simple.c | 8 +------ + src/mm-iface-modem.c | 54 + +++++++++++++-------------------------------- + src/mm-modem-helpers.c | 30 +++++-------------------- + src/mm-sim.c | 18 ++++----------- + 8 files changed, 36 insertions(+), 121 deletions(-) + +commit 04fc34fab89483e9cfdaf7b273a867b72e622fbc +Author: Aleksander Morgado +Date: Wed Jan 18 13:43:23 2012 +0100 + + build: autogenerate enum/flags string getter/builders + + Each enum will have its own #_get_string (), + and each flags will have its own #_build_string_from_mask (). + + build-aux/mm-enums-template.c | 96 + ++++++++++++++++++++++++++++++++++++------- + build-aux/mm-enums-template.h | 14 +++++++ + libmm-common/Makefile.am | 4 +- + src/Makefile.am | 4 +- + 4 files changed, 99 insertions(+), 19 deletions(-) + +commit f8cb1269e31526813450cae4fd7382842fee242d +Author: Aleksander Morgado +Date: Wed Jan 18 11:22:27 2012 +0100 + + cli: include Location-related actions + + cli/Makefile.am | 1 + + cli/mmcli-modem-location.c | 327 + +++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 4 files changed, 347 insertions(+) + +commit b05430cb289e058ec118be13e4b0a813c46b1fb2 +Author: Aleksander Morgado +Date: Wed Jan 18 10:41:26 2012 +0100 + + libmm-glib: include support for the Location interface + + We hide the location signaling; not sure if we should even support it. + + libmm-glib/Makefile.am | 4 + + libmm-glib/mm-modem-location-3gpp.c | 48 ++++++++ + libmm-glib/mm-modem-location-3gpp.h | 45 +++++++ + libmm-glib/mm-modem-location.c | 238 + ++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-location.h | 78 ++++++++++++ + libmm-glib/mm-object.c | 34 ++++++ + libmm-glib/mm-object.h | 3 + + 7 files changed, 450 insertions(+) + +commit 3b443b6954046cb7cc1c7576a3720af0b987d573 +Author: Aleksander Morgado +Date: Wed Jan 18 09:44:43 2012 +0100 + + libmm-common: fix usage of main library header + + libmm-common/libmm-common.h | 1 + + src/mm-iface-modem-location.c | 1 - + src/mm-iface-modem-simple.c | 1 - + 3 files changed, 1 insertion(+), 2 deletions(-) + +commit bcdd376b6bd9443e2a7001230a8189bb243d658a +Author: Aleksander Morgado +Date: Tue Jan 17 23:43:55 2012 +0100 + + iface-modem-3gpp, broadband-modem: update LAC/CI 3gpp-based location + + src/mm-broadband-modem.c | 51 +++++++++------ + src/mm-iface-modem-3gpp.c | 161 + ++++++++++++++++++++++++++++++++++++---------- + src/mm-iface-modem-3gpp.h | 8 ++- + 3 files changed, 164 insertions(+), 56 deletions(-) + +commit 71125777d38126f41c18a2b04a0dbfdb6b2628d6 +Author: Aleksander Morgado +Date: Tue Jan 17 23:43:20 2012 +0100 + + iface-modem-location: handle 3GPP location + + src/mm-iface-modem-location.c | 208 + ++++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem-location.h | 9 ++ + 2 files changed, 190 insertions(+), 27 deletions(-) + +commit 5fa8918847fffa7f373c2f863ed765091db659d3 +Author: Aleksander Morgado +Date: Tue Jan 17 23:42:50 2012 +0100 + + libmm-common: new helper object to handle 3GPP location + + libmm-common/Makefile.am | 3 + + libmm-common/mm-common-location-3gpp.c | 263 + +++++++++++++++++++++++++++++++++ + libmm-common/mm-common-location-3gpp.h | 68 +++++++++ + 3 files changed, 334 insertions(+) + +commit f94d8ce30a49af868d7b58b9dd3ba7d71d8bb73c +Author: Aleksander Morgado +Date: Tue Jan 17 23:42:30 2012 +0100 + + api: include '3gpp' prefix for LAC/CI location, instead of 'gsm' + + include/ModemManager-enums.h | 4 ++-- + new/org.freedesktop.ModemManager1.Modem.Location.xml | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 182a9542055bbc4b560672e70d7383bffb395378 +Author: Aleksander Morgado +Date: Mon Jan 16 20:04:27 2012 +0100 + + broadband-modem: enable/disable the Location interface + + src/mm-broadband-modem.c | 57 + +++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 44 insertions(+), 13 deletions(-) + +commit 74f29981c8db7f27b061d9740b1472efcec952d5 +Author: Aleksander Morgado +Date: Mon Jan 16 20:02:47 2012 +0100 + + broadband-modem: load default location reporting capabilities + + Currently, only LAC/CI if the modem has 3GPP capabilities. + + src/mm-broadband-modem.c | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit 03c5f4e6fbb5d5f2750f23deb5832b5eaa5c5197 +Author: Aleksander Morgado +Date: Mon Jan 16 19:39:00 2012 +0100 + + iface-modem-location: handle enabling/disabling location gathering + + src/mm-iface-modem-location.c | 429 + +++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-location.h | 32 ++++ + 2 files changed, 458 insertions(+), 3 deletions(-) + +commit d7f98cf27781babb5fb9b051c1b3be228232177e +Author: Aleksander Morgado +Date: Mon Jan 16 17:13:24 2012 +0100 + + broadband-modem: implement the Location interface + + src/mm-broadband-modem.c | 69 + ++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 55 insertions(+), 14 deletions(-) + +commit 1b45b6a015b7d1270959cc4dabbf01159fd5e2f4 +Author: Aleksander Morgado +Date: Mon Jan 16 17:13:13 2012 +0100 + + api,dbus: we won't enable the modem if we're enabling location + + new/org.freedesktop.ModemManager1.Modem.Location.xml | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit d0a845c81933493281043cfe94c622791638b825 +Author: Aleksander Morgado +Date: Mon Jan 16 17:11:44 2012 +0100 + + iface-modem-location: new interface for Location-related stuff + + src/Makefile.am | 2 + + src/mm-iface-modem-location.c | 295 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-location.h | 63 +++++++++ + 3 files changed, 360 insertions(+) + +commit 38578f13b5b07f9a57b9407a2e2b8b34a8671f8e +Author: Aleksander Morgado +Date: Mon Jan 16 15:58:16 2012 +0100 + + docs: include initial state machine documentation + + docs/reference/api/Makefile.am | 3 + + docs/reference/api/ModemManager-states.dia | 1210 + ++++++++++++++++++++++++++++ + docs/reference/api/ModemManager-states.png | Bin 0 -> 28305 bytes + docs/reference/api/mm-overview.xml | 79 +- + 4 files changed, 1272 insertions(+), 20 deletions(-) + +commit b52e223f3026a60223a819899776f9b77c26380a +Author: Aleksander Morgado +Date: Mon Jan 16 15:25:20 2012 +0100 + + docs: improved DBus interface documentation + + docs/reference/api/Makefile.am | 2 + + docs/reference/api/mm-dbus-reference.xml | 179 + +++++++++++++++++++++++++++++++ + docs/reference/api/mm-docs.xml | 124 ++++++--------------- + 3 files changed, 213 insertions(+), 92 deletions(-) + +commit bb88a63a72af3dd5b87a381a363aff4cc782eca1 +Author: Aleksander Morgado +Date: Mon Jan 16 10:03:33 2012 +0100 + + cli: add CDMA-related option group, and enable activation request + + cli/Makefile.am | 1 + + cli/mmcli-modem-cdma.c | 207 + +++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 +++ + cli/mmcli.h | 8 ++ + 4 files changed, 227 insertions(+) + +commit 231e54f037964bb08686e006c32eecbbe70c878e +Author: Aleksander Morgado +Date: Mon Jan 16 10:03:03 2012 +0100 + + libmm-glib: implement CDMA activation request + + libmm-glib/mm-modem-cdma.c | 42 + ++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-cdma.h | 13 +++++++++++++ + 2 files changed, 55 insertions(+) + +commit 4bf03a24a1400204bcbdbf3dccb0d07fea8673eb +Author: Aleksander Morgado +Date: Mon Jan 16 09:52:34 2012 +0100 + + api,header: treat CDMA activation errors as any other error + + docs/reference/api/mm-sections.txt | 2 +- + include/ModemManager-enums.h | 28 + ---------------------- + include/ModemManager-errors.h | 28 + ++++++++++++++++++++++ + ...g.freedesktop.ModemManager1.Modem.ModemCdma.xml | 2 +- + 4 files changed, 30 insertions(+), 30 deletions(-) + +commit 6238ba8568323db3c7a52f19f691cf6105b9c585 +Author: Aleksander Morgado +Date: Mon Jan 16 09:51:57 2012 +0100 + + api,dbus: don't return immediate CDMA activation errors + + Seems like an unnecessary complication, as the client anyway needs + to handle + asynchronously reported errors. + + new/org.freedesktop.ModemManager1.Modem.ModemCdma.xml | 7 +------ + src/mm-iface-modem-cdma.c | 4 +--- + 2 files changed, 2 insertions(+), 9 deletions(-) + +commit 15f2c56f8978dafcc0db7744f1a95fae52e8c91e +Author: Aleksander Morgado +Date: Sat Jan 14 22:53:11 2012 +0100 + + cinterion: avoid after-power-up step + + Split the after power up step into: + * querying supported functionality status during the first power-down + request. + * querying supported networks during supported modes loading. + + plugins/mm-broadband-modem-cinterion.c | 209 + ++++++++++++++++++++------------- + 1 file changed, 125 insertions(+), 84 deletions(-) + +commit d76f545322dea8c8391a3940e623e0771014f8d4 +Author: Aleksander Morgado +Date: Fri Jan 13 17:32:33 2012 +0100 + + plugin-base: use MM_TYPE_POINTER_ARRAY for custom init callbacks + + src/mm-plugin-base.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 0358c787c0dcc49e0350389a4480cb35a4adbfe0 +Author: Aleksander Morgado +Date: Fri Jan 13 17:32:11 2012 +0100 + + core: new boxed type for NULL-terminated array of gpointers + + src/mm-private-boxed-types.c | 36 ++++++++++++++++++++++++++++++++++++ + src/mm-private-boxed-types.h | 3 +++ + 2 files changed, 39 insertions(+) + +commit af41076e7dbc05f2b92e567cb583e0bc7de4c987 +Author: Aleksander Morgado +Date: Fri Jan 13 17:18:40 2012 +0100 + + plugin-base: use MM_TYPE_UINT16_ARRAY for vendor/product ID properties + + src/mm-plugin-base.c | 35 +++++++++++++++++++---------------- + 1 file changed, 19 insertions(+), 16 deletions(-) + +commit 2052b8184f0581e562d7caccc319e78bb6d27b65 +Author: Aleksander Morgado +Date: Fri Jan 13 17:17:53 2012 +0100 + + core: new boxed type for 0-terminated array of guint16 values + + src/Makefile.am | 2 ++ + src/mm-private-boxed-types.c | 52 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-private-boxed-types.h | 28 ++++++++++++++++++++++++ + 3 files changed, 82 insertions(+) + +commit 536865040e79076a5dbbbceb23501b4f15df249e +Author: Aleksander Morgado +Date: Fri Jan 13 17:01:24 2012 +0100 + + plugin-base: use GStrv boxed types for string array properties + + src/mm-plugin-base.c | 85 + +++++++++++++++++++++++++++------------------------- + 1 file changed, 45 insertions(+), 40 deletions(-) + +commit 771e3c4ff70717b51158d64c011505e32c92ac14 +Author: Aleksander Morgado +Date: Fri Jan 13 16:01:48 2012 +0100 + + nokia: plugin fully ported to the new codebase + + plugins/mm-modem-nokia.c | 131 + ----------------------------------------------- + plugins/mm-modem-nokia.h | 45 ---------------- + 2 files changed, 176 deletions(-) + +commit 983f081f309d28b391422aa53bb36da8b1b61fc0 +Author: Aleksander Morgado +Date: Fri Jan 13 15:59:39 2012 +0100 + + nokia: include port type hints + + Ported commit 44194ac to the new codebase. + + plugins/mm-plugin-nokia.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 0d5c23742891aa6f9ae715875882ce16d42bcb41 +Author: Aleksander Morgado +Date: Fri Jan 13 12:39:37 2012 +0100 + + bearer-cdma: use #777 as default number to dial when none given + explicitly + + src/mm-bearer-cdma.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +commit e5c5411d0514f121e9c98c2b49b6d9a11a60cc1a +Author: Aleksander Morgado +Date: Fri Jan 13 11:41:47 2012 +0100 + + broadband-modem: redefine generic supported mode loading + implementation + + * assume CDMA1x is 2G + * consider CS/PS/CDMA1x/EVDO network support flags specified by + the plugins + + src/mm-broadband-modem.c | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +commit 8adc9cd699503885d9878403834d2a7f674cc661 +Author: Aleksander Morgado +Date: Fri Jan 13 11:26:28 2012 +0100 + + broadband-modem: we can expect non-LTE 3GPP+CDMA modems + + src/mm-broadband-modem.c | 19 +++++-------------- + src/mm-iface-modem-simple.c | 4 ++-- + 2 files changed, 7 insertions(+), 16 deletions(-) + +commit c0e0649a821d7370087931af9546c506248f4530 +Author: Aleksander Morgado +Date: Thu Jan 12 17:52:44 2012 +0100 + + core,plugins: handle missing `last_command' flags + + These didn't get compilation errors when + `MMBaseModemAtResponseProcessor' + was changed, as we're doing an explicit casting. + + plugins/mm-broadband-modem-cinterion.c | 2 ++ + src/mm-bearer-3gpp.c | 2 ++ + src/mm-broadband-modem.c | 1 + + 3 files changed, 5 insertions(+) + +commit 31131a1f669a9eadded03b739ec499fba4097a2f +Author: Aleksander Morgado +Date: Thu Jan 12 17:41:15 2012 +0100 + + cli: print properties only if registered in the specific network(s) + + If registered in the 3GPP network, print 3GPP-specific properties; + and if + registered in a CDMA network, print CDMA-specific properties. + + cli/mmcli-modem-simple.c | 92 + ++++++++++++++++++++++++++++-------------------- + 1 file changed, 53 insertions(+), 39 deletions(-) + +commit 5f5ad3843122f74dfd6609d84eab9621d2228446 +Author: Aleksander Morgado +Date: Thu Jan 12 17:22:35 2012 +0100 + + cli: include CDMA-specific properties in the simple status report + + cli/mmcli-modem-simple.c | 38 +++++++++++++++++++++++++++++++++----- + 1 file changed, 33 insertions(+), 5 deletions(-) + +commit 801a129fe96dcda13dfc0f786e4505f1871f99ae +Author: Aleksander Morgado +Date: Thu Jan 12 17:16:15 2012 +0100 + + iface-modem-cdma: bind CDMA-specific properties for the simple status + + src/mm-iface-modem-cdma.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +commit 6c36ae9101489f8b43b78a6616c808956c3acc69 +Author: Aleksander Morgado +Date: Thu Jan 12 17:15:57 2012 +0100 + + libmm-glib: include CDMA-specific items in the simple status + properties + + libmm-glib/mm-modem-simple-status-properties.c | 37 + ++++++++++++++++++++++++++ + libmm-glib/mm-modem-simple-status-properties.h | 5 ++++ + 2 files changed, 42 insertions(+) + +commit 263f106b33825700c7cf1ee1ff4994e9b016e68f +Author: Aleksander Morgado +Date: Thu Jan 12 17:10:18 2012 +0100 + + libmm-common: include CDMA-specific items in the simple properties + + libmm-common/mm-common-simple-properties.c | 137 + ++++++++++++++++++++++++++++- + libmm-common/mm-common-simple-properties.h | 11 +++ + 2 files changed, 147 insertions(+), 1 deletion(-) + +commit 9324c9cbb7e6d1a8a3087e1f32a39f80a9cd0ddb +Author: Aleksander Morgado +Date: Thu Jan 12 17:09:47 2012 +0100 + + api,dbus: include CDMA-specific properties in the simple status query + + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 28 + ++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit 71fbd2248c20d583300259648703df2f81139dac +Author: Aleksander Morgado +Date: Thu Jan 12 16:42:29 2012 +0100 + + api,dbus: prefix with 'm3gpp' the 3GPP-specific entries returned in + the simple status + + Note that we cannot have properties starting with a digit :-/ + + libmm-common/mm-common-simple-properties.h | 7 +++-- + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 36 + +++++++++++----------- + 2 files changed, 22 insertions(+), 21 deletions(-) + +commit 8c704ea7a25c2efc1927d63b42853a4d13b55965 +Author: Aleksander Morgado +Date: Thu Jan 12 16:34:04 2012 +0100 + + libmm-glib: prefix with '3gpp' the 3GPP-specific simple status + properties + + cli/mmcli-modem-simple.c | 6 +++--- + libmm-glib/mm-modem-simple-status-properties.c | 6 +++--- + libmm-glib/mm-modem-simple-status-properties.h | 7 ++++--- + 3 files changed, 10 insertions(+), 9 deletions(-) + +commit d2af326e1a4a6223930ae6af8c336c478a0437f5 +Author: Aleksander Morgado +Date: Thu Jan 12 16:33:34 2012 +0100 + + libmm-common: prefix with '3gpp' the 3GPP-specific simple properties + + libmm-common/mm-common-simple-properties.c | 50 + +++++++++++++------------- + libmm-common/mm-common-simple-properties.h | 6 ++-- + libmm-glib/mm-modem-simple-status-properties.c | 6 ++-- + 3 files changed, 31 insertions(+), 31 deletions(-) + +commit f07101943cdd3d74fe3f2600953d6085bc670e24 +Author: Aleksander Morgado +Date: Thu Jan 12 14:07:58 2012 +0100 + + iface-modem-simple: new connection logic when more than one bearer + around + + For mixed 3GPP+CDMA modems, we first try to connect the 3GPP bearers, + and then + the CDMA ones. + + src/mm-iface-modem-simple.c | 400 + ++++++++++++++++++++++++++++++++++++++++---- + src/mm-iface-modem.c | 47 ++---- + src/mm-iface-modem.h | 1 - + 3 files changed, 385 insertions(+), 63 deletions(-) + +commit d19cf55f8f35bd82408ecfce012cdebe0ed2183f +Author: Aleksander Morgado +Date: Thu Jan 12 14:06:07 2012 +0100 + + libmm-common: allow duplicating the bearer properties object + + libmm-common/mm-common-bearer-properties.c | 17 +++++++++++++++++ + libmm-common/mm-common-bearer-properties.h | 2 ++ + 2 files changed, 19 insertions(+) + +commit 8782df1b152b0ade1970282fb799ac6608fa3483 +Author: Aleksander Morgado +Date: Thu Jan 12 10:57:05 2012 +0100 + + broadband-modem: on mixed CDMA+LTE modems, guess which kind of bearer + to create + + src/mm-broadband-modem.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +commit 744fe5712df5de050f2942c1cb692a53d2eead70 +Author: Aleksander Morgado +Date: Wed Jan 11 16:25:51 2012 +0100 + + iface-modem-simple: build 3GPP+CDMA registration check logic + + For mixed 3GPP+CDMA modems, we check registrations in both 3GPP + and CDMA + networks, and we stop checks when we find ourselves registered in + either one + or the other. + + src/mm-iface-modem-simple.c | 165 + +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 155 insertions(+), 10 deletions(-) + +commit a0255273f0195c234062f326dfdc46c45d3116eb +Author: Aleksander Morgado +Date: Wed Jan 11 16:24:29 2012 +0100 + + iface-modem-cdma: let caller decide the maximum registration timeout + + src/mm-broadband-modem.c | 9 ++++----- + src/mm-iface-modem-cdma.c | 2 ++ + src/mm-iface-modem-cdma.h | 2 ++ + 3 files changed, 8 insertions(+), 5 deletions(-) + +commit cc4e469b1a91a5c1f247706acddebd406db46702 +Author: Aleksander Morgado +Date: Wed Jan 11 16:24:02 2012 +0100 + + iface-modem-3gpp: let caller decide the maximum registration timeout + + src/mm-broadband-modem.c | 15 +++++++-------- + src/mm-iface-modem-3gpp.c | 7 +++++-- + src/mm-iface-modem-3gpp.h | 4 +++- + 3 files changed, 15 insertions(+), 11 deletions(-) + +commit 787a651f198c1c85635e1f8598d4ffb9752d1dd4 +Author: Aleksander Morgado +Date: Wed Jan 11 13:44:02 2012 +0100 + + broadband-modem: implement CDMA registration method + + Will wait up to 60s to be registered in the CDMA network. + + src/mm-broadband-modem.c | 167 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 167 insertions(+) + +commit 0b8ad7025013d88a38c63a1adf5ca13aa0abb226 +Author: Aleksander Morgado +Date: Wed Jan 11 13:43:12 2012 +0100 + + iface-modem-cdma: provide a method to register in the CDMA network + + This will really not be like the 3GPP method. In 3GPP we can request + to do + auto-registration, or request to lock to a specific Operator. Once + that done, + we wait for unsolicited registration messages and also perform peridic + registration checks. + + In the case of the CDMA network, the registration seems to be always + automatic. + Therefore, this method to register in the CDMA network will just + make sure that + we got registered, by waiting up to N seconds while doing periodic + registration + checks. + + src/mm-iface-modem-cdma.c | 57 + ++++++++++++++++++++++++++++++++++++++++++----- + src/mm-iface-modem-cdma.h | 16 +++++++++++++ + 2 files changed, 68 insertions(+), 5 deletions(-) + +commit 165a4dcb943d2d81fc3ec371d19695afb4e3508a +Author: Aleksander Morgado +Date: Wed Jan 11 13:35:46 2012 +0100 + + cli: split the command to register in a 3GPP network + + We provide `--3gpp-register-home' to request automatic + registration. This will + try to register in the home network if available; and if not + available, in any + other network being allowed. + + We also provide `--3gpp-register-in-operator' to try to lock the + registration + in the network of a given specific operator, specified by MCCMNC. + + cli/mmcli-modem-3gpp.c | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +commit e7e1a4d15687394d5e4edace29ac2da76d088fe2 +Author: Aleksander Morgado +Date: Wed Jan 11 13:33:44 2012 +0100 + + api,dbus: MCCMNC identifies the operator (country+network), not just + the network + + MCCMNC = MCC (Mobile Country Code) + MNC (Mobile Network Code) + + new/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 205dc51cb55fdaa1f12c48e8d92257153dfb68f1 +Author: Aleksander Morgado +Date: Wed Jan 11 12:20:24 2012 +0100 + + broadband-modem: refactor the code a bit + + * Include interface-specific prefixes in methods implemented (e.g. + 'modem_3gpp_' for all 3GPP interface method implementations. + + * Pack together in the private struct variables required in the + implementation + of a given interface. + + src/mm-broadband-modem.c | 1094 + +++++++++++++++++++++++----------------------- + 1 file changed, 554 insertions(+), 540 deletions(-) + +commit b74c01478ed4bbb79e0174eea436208638e3b257 +Author: Aleksander Morgado +Date: Wed Jan 11 01:31:21 2012 +0100 + + broadband-modem: set auto registration with AT+COPS=0 + + This is, remove the use of "AT+COPS=0,,". The extra commas break + its use in a + Nokia C7, and the proper/clean way to do it anyway is to avoid using + the commas. + + src/mm-broadband-modem.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit d3c25e54c432445fb22a64fd99a7624a28b7b1d2 +Author: Aleksander Morgado +Date: Mon Jan 9 21:07:50 2012 +0100 + + cli: print CDMA-related info from the modem + + cli/mmcli-modem.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit c5fdd839056d13b13e017fe1fb2d76d6c8424db2 +Author: Aleksander Morgado +Date: Mon Jan 9 21:07:35 2012 +0100 + + cli: new helper to get the CDMA registration state string + + cli/mmcli-common.c | 13 +++++++++++++ + cli/mmcli-common.h | 1 + + 2 files changed, 14 insertions(+) + +commit a71393f227da1d4aa2ca1b237ec9c5061c25434f +Author: Aleksander Morgado +Date: Mon Jan 9 21:07:10 2012 +0100 + + libmm-glib: handle the CDMA interface + + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-cdma.c | 212 + +++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-cdma.h | 53 ++++++++++++ + libmm-glib/mm-object.c | 16 ++++ + libmm-glib/mm-object.h | 3 + + 5 files changed, 286 insertions(+) + +commit 713937f1f0b317ca3d911274a3600baa64835979 +Author: Dan Williams +Date: Mon Jan 9 14:03:30 2012 -0600 + + manager: make sure modems get exported when all their ports are + finished + + My LG Rumor2 phone (ttyACM0 - AT, ttyUSB0 - QCDM) was never getting + exported after the QCDM port finished probing. Not entirely sure + why, but we should check whether we need to export a modem or not + any time a port gets grabbed. + + src/mm-manager.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit ded020efeb25b88b0c80319e5279936ec03c0b63 +Author: Dan Williams +Date: Mon Jan 9 13:18:21 2012 -0600 + + gobi: ensure QCDM ports are correctly grabbed + + Need to suggest that it's QCDM since the MMPortProbe stuff + doesn't get passed through to mm_base_modem_grab_port() so + we can't detect QCDM ports automatically there. + + plugins/mm-plugin-gobi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit c697027cee5dbfb9f90a5c3c6be85da71a4bcf5d +Author: Dan Williams +Date: Mon Jan 9 13:15:06 2012 -0600 + + broadband-modem: fix check for QCDM capability + + has_qcdm_port was never set to TRUE anywhere... + + src/mm-broadband-modem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 0ccfcbd986ed28fa71d555dc3e6dec2270d36e16 +Author: Dan Williams +Date: Mon Jan 9 12:58:50 2012 -0600 + + gobi: port to 06-api + + plugins/Makefile.am | 22 ++--- + plugins/mm-broadband-modem-gobi.c | 72 ++++++++++++++++ + plugins/mm-broadband-modem-gobi.h | 49 +++++++++++ + plugins/mm-plugin-gobi.c | 170 + +++++++++++--------------------------- + plugins/mm-plugin-gobi.h | 2 - + 5 files changed, 182 insertions(+), 133 deletions(-) + +commit 98755bd508fd7476ebfc6700b283bda8648b4ea5 +Author: Dan Williams +Date: Mon Jan 9 12:42:51 2012 -0600 + + broadband-modem: ignore early AT error responses for modem info + + Where we have multiple commands that are all supposed to return + the same thing (ie, GMM/CGMM, CSQ/CSQ?) but some modems + support one and not the other, don't exit the sequence early if + the modem doesn't support one of them. + + Gobi modems with CDMA firmware don't support the Cxxx variants + so the returned ERROR (CME error 100) made the generic parser + break out of the AT sequence without trying the additional + commands that are supported. + + src/mm-broadband-modem.c | 44 + ++++++++++++++++++++++++++++++++++---------- + 1 file changed, 34 insertions(+), 10 deletions(-) + +commit cb2d6d610524f32fd95633e4a491ba88f983e956 +Author: Dan Williams +Date: Mon Jan 9 12:40:30 2012 -0600 + + base-modem-at: indicate sequence status to response parsers + + Let parsers know if this command is the last in a sequence since + they may want to handle errors differently if that's the case. + + src/mm-base-modem-at.c | 6 ++++++ + src/mm-base-modem-at.h | 5 ++++- + src/mm-broadband-modem.c | 5 +++++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +commit 4e06e0e67d1f4180e0ea2c86aae3f63701c176d7 +Author: Aleksander Morgado +Date: Mon Jan 9 15:08:36 2012 +0100 + + bearer-cdma: implement bearer connection and disconnection + + src/mm-bearer-cdma.c | 414 + ++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers.c | 23 +++ + src/mm-modem-helpers.h | 2 + + 3 files changed, 436 insertions(+), 3 deletions(-) + +commit 9641c6375988e5dcd2602bf54c707336acd01ab8 +Author: Aleksander Morgado +Date: Mon Jan 9 15:08:06 2012 +0100 + + bearer-cdma: new property for the number to dial + + src/mm-bearer-cdma.c | 19 +++++++++++++++++++ + src/mm-bearer-cdma.h | 1 + + 2 files changed, 20 insertions(+) + +commit d1cfdd974cefb6ec87d6bc2889320ac8373dd4be +Author: Aleksander Morgado +Date: Mon Jan 9 13:30:00 2012 +0100 + + bearer-cdma: when specific RM protocol given to be used, ensure it + is supported + + If the requested RM protocol is not supported, the CDMA Bearer + creation will + fail. + + src/mm-bearer-cdma.c | 69 ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.c | 81 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 8 +++++ + 3 files changed, 158 insertions(+) + +commit 070c27701305dfa5c549f072d09785a12d6f03f5 +Author: Aleksander Morgado +Date: Mon Jan 9 12:09:48 2012 +0100 + + bearer-cdma: make it async-initable + + We'll run some checks before having the object fully created. + + src/mm-bearer-cdma.c | 167 + +++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 135 insertions(+), 32 deletions(-) + +commit 2a0deb47f4e170b6cf7b20e72355dab86e0518b9 +Author: Aleksander Morgado +Date: Mon Jan 9 12:07:51 2012 +0100 + + bearer-cdma: avoid the need of the modem object during new_finish() + + src/mm-bearer-cdma.c | 4 ++-- + src/mm-bearer-cdma.h | 4 ++-- + src/mm-broadband-modem.c | 4 ++-- + src/mm-iface-modem-cdma.c | 20 ++++++++++---------- + src/mm-iface-modem-cdma.h | 16 ++++++++-------- + 5 files changed, 24 insertions(+), 24 deletions(-) + +commit 56956a36adcb11e7c789f8ef6518a2afae990f84 +Author: Aleksander Morgado +Date: Mon Jan 9 12:05:17 2012 +0100 + + bearer-cdma: allow subclasses to use the same unique path generator + + src/mm-bearer-cdma.c | 13 +++++++++++-- + src/mm-bearer-cdma.h | 3 +++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +commit 91eb041a635c3dfd4703c0f77110349d4a58199a +Author: Aleksander Morgado +Date: Sun Jan 8 23:54:24 2012 +0100 + + bearer-3gpp: avoid the need of the modem object during new_finish() + + src/mm-bearer-3gpp.c | 4 ++-- + src/mm-bearer-3gpp.h | 4 ++-- + src/mm-broadband-modem.c | 4 ++-- + src/mm-iface-modem-3gpp.c | 19 ++++++++++--------- + src/mm-iface-modem-3gpp.h | 16 ++++++++-------- + 5 files changed, 24 insertions(+), 23 deletions(-) + +commit ba9bdb37a9c7d026b764c27e59ef0d33bcb9c501 +Author: Aleksander Morgado +Date: Sun Jan 8 23:49:53 2012 +0100 + + bearer-3gpp: allow subclasses to use the same unique path generator + + src/mm-bearer-3gpp.c | 11 +++++++++-- + src/mm-bearer-3gpp.h | 3 +++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit 3d6df6a1f4c17d903b69efee6e23d7be1bd3d920 +Author: Aleksander Morgado +Date: Sun Jan 8 23:46:48 2012 +0100 + + bearer: export the object whenever both path and connection are set + + src/mm-bearer.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 816a1318cb75460d1a61e8483d3671a133ac90b1 +Author: Aleksander Morgado +Date: Sun Jan 8 23:46:05 2012 +0100 + + sim: minor code simplification + + src/mm-sim.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit a534afa84d1affcc10b6fc7b414d8f9df8307dd3 +Author: Aleksander Morgado +Date: Sun Jan 8 23:45:51 2012 +0100 + + sim: handle initialization failures properly + + We should't use MM_SIM() on possibly NULL values. + + src/mm-sim.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 7db16d2279891d1014999bd3eaa8a9e6c6496e88 +Author: Aleksander Morgado +Date: Sun Jan 8 22:14:35 2012 +0100 + + bearer: make bearer creation an asynchronous operation + + We may want to do some checks while creating a new bearer. + + src/mm-bearer-3gpp.c | 41 ++++++++++++---- + src/mm-bearer-3gpp.h | 12 +++-- + src/mm-bearer-cdma.c | 28 +++++++++-- + src/mm-bearer-cdma.h | 12 +++-- + src/mm-broadband-modem.c | 119 + +++++++++++++++++++++++++++++----------------- + src/mm-iface-modem-3gpp.c | 33 ++++++++----- + src/mm-iface-modem-3gpp.h | 20 +++++--- + src/mm-iface-modem-cdma.c | 34 ++++++++----- + src/mm-iface-modem-cdma.h | 20 +++++--- + 9 files changed, 221 insertions(+), 98 deletions(-) + +commit 6a38bcf1a12acd9d2230873d18d13853eb40e76d +Author: Aleksander Morgado +Date: Sun Jan 8 19:20:56 2012 +0100 + + broadband-modem: setup 3GPP and CDMA bearer creation logic + + On mixed CDMA+LTE modems, just default to create a 3GPP bearer. + + src/mm-broadband-modem.c | 39 +++++++++++++++++++++++++++++++-------- + 1 file changed, 31 insertions(+), 8 deletions(-) + +commit cc4f662239acee20d69356a3f47b004d5e275138 +Author: Aleksander Morgado +Date: Sun Jan 8 19:20:36 2012 +0100 + + iface-modem-cdma: setup creation of CDMA bearers + + src/mm-iface-modem-cdma.c | 49 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 10 ++++++++++ + 2 files changed, 59 insertions(+) + +commit 06ea25c0d480303e56c7f1b8b7bcd12b8e9b05c2 +Author: Aleksander Morgado +Date: Sun Jan 8 19:16:50 2012 +0100 + + bearer-cdma: new bearer to handle connections in CDMA networks + + src/Makefile.am | 2 + + src/mm-bearer-cdma.c | 194 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-bearer-cdma.h | 61 ++++++++++++++++ + 3 files changed, 257 insertions(+) + +commit 531c1fa6602ec8d6af8808fc37aa290369a973ec +Author: Aleksander Morgado +Date: Sun Jan 8 19:06:43 2012 +0100 + + bearer: set allow-roaming as property at generic bearer object level + + src/mm-bearer-3gpp.c | 26 +------------------------- + src/mm-bearer-3gpp.h | 2 -- + src/mm-bearer.c | 24 ++++++++++++++++++++++++ + src/mm-bearer.h | 3 +++ + src/mm-iface-modem-3gpp.c | 4 ++-- + 5 files changed, 30 insertions(+), 29 deletions(-) + +commit 7f975a30b32375ed7bbfadc71e17c2dfa4937c30 +Author: Aleksander Morgado +Date: Sun Jan 8 19:05:19 2012 +0100 + + build: remove glib-mkenums generated files during make clean + + src/Makefile.am | 3 +++ + 1 file changed, 3 insertions(+) + +commit ad95567e88eadf452c7e48a1d97bac4b741c206b +Author: Aleksander Morgado +Date: Sun Jan 8 16:15:39 2012 +0100 + + cli: print Rm protocol in bearer info + + cli/mmcli-bearer.c | 7 +++++-- + cli/mmcli-common.c | 13 +++++++++++++ + cli/mmcli-common.h | 4 +++- + 3 files changed, 21 insertions(+), 3 deletions(-) + +commit 014a9eddab6c1787470caad58c0626a551fdc842 +Author: Aleksander Morgado +Date: Sun Jan 8 16:08:21 2012 +0100 + + libmm-glib: allow passing Rm protocol to bearer properties + + libmm-glib/mm-bearer-properties.c | 17 +++++++++++++++++ + libmm-glib/mm-bearer-properties.h | 5 +++++ + 2 files changed, 22 insertions(+) + +commit 1c447ba85b4ec22a42e1c9f5d3e0bb7ae2c11bdc +Author: Aleksander Morgado +Date: Sun Jan 8 16:04:58 2012 +0100 + + libmm-common: expect 'rm-protocol' in the common bearer properties + + libmm-common/mm-common-bearer-properties.c | 35 + +++++++++++++++++++++++++++++- + libmm-common/mm-common-bearer-properties.h | 5 +++++ + libmm-common/mm-common-helpers.c | 23 ++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 18 ++++++++------- + 4 files changed, 72 insertions(+), 9 deletions(-) + +commit fa0dba6a6e797d532a7f130f5b1f9a2561e72989 +Author: Aleksander Morgado +Date: Sun Jan 8 16:03:49 2012 +0100 + + api,dbus: expect 'rm-protocol' in Simple Connect() and CreateBearer() + + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 7 +++++++ + new/org.freedesktop.ModemManager1.Modem.xml | 2 ++ + 2 files changed, 9 insertions(+) + +commit aaf92347477fbb1bd39bd3ff778794ece96db696 +Author: Aleksander Morgado +Date: Sun Jan 8 16:03:12 2012 +0100 + + api,header: new enum to specify Rm protocol + + docs/reference/api/mm-sections.txt | 1 + + include/ModemManager-enums.h | 20 ++++++++++++++++++++ + 2 files changed, 21 insertions(+) + +commit d178fb1f09f3b28f664942424684f156b931269c +Author: Aleksander Morgado +Date: Sat Jan 7 22:53:20 2012 +0100 + + plugin-manager: fix loop of deferred tasks when no best plugin found + + If deferring tasks until result suggested, and we never got a + suggestion, the + tasks may have been left deferred in loop forever. We now remove + the defer + timeout in the case of waiting for suggestion, and ensure that we + cancel tasks + if the last valid probing ended without best plugin found. + + src/mm-plugin-manager.c | 113 + ++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 81 insertions(+), 32 deletions(-) + +commit 4d19a66722e85e2e776092161b7d7515d295cafe +Author: Aleksander Morgado +Date: Sat Jan 7 17:26:43 2012 +0100 + + cli: fix invalid write when completing async operation + + Don't use the same context to pass the results to finalize(). + + cli/mmcli-common.c | 47 ++++++++++++++++++++++++++++------------------- + 1 file changed, 28 insertions(+), 19 deletions(-) + +commit 2c0c66846271c41d1573d9260bd76ef2009c9f5a +Author: Aleksander Morgado +Date: Sat Jan 7 16:31:13 2012 +0100 + + iface-modem-cdma: load NID if available in the CDMA status QCDM + response + + src/mm-broadband-modem.c | 14 ++++++++++++-- + src/mm-iface-modem-cdma.c | 16 +++++++++++++--- + src/mm-iface-modem-cdma.h | 4 +++- + 3 files changed, 28 insertions(+), 6 deletions(-) + +commit 4016a1ec200ca01ac6a39ea791f8d6ee91591a19 +Author: Aleksander Morgado +Date: Thu Jan 5 20:26:48 2012 +0100 + + build: require glib 2.30.2 + + So that we get the following fix in glib-mkenums: + https://bugzilla.gnome.org/show_bug.cgi?id=661797 + + build-aux/mm-enums-template.h | 2 +- + configure.ac | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit e8aeb59293063cb4cfedddcaf27da665f9d968e0 +Author: Aleksander Morgado +Date: Thu Jan 5 20:01:30 2012 +0100 + + cli: use g_list_free_full() when possible + + cli/mmcli-common.c | 21 +++++++-------------- + cli/mmcli-manager.c | 3 +-- + cli/mmcli-modem-3gpp.c | 3 +-- + 3 files changed, 9 insertions(+), 18 deletions(-) + +commit 20acb274dcd1924d64b56021fd0c3125c95d9fee +Author: Aleksander Morgado +Date: Thu Jan 5 20:01:16 2012 +0100 + + libmm-glib: use g_list_free_full() when possible + + libmm-glib/mm-modem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 48d5ac66824848ee31fcbaeb9600d5e276b3ab70 +Author: Aleksander Morgado +Date: Thu Jan 5 20:01:05 2012 +0100 + + core: use g_list_free_full() when possible + + src/mm-bearer-list.c | 5 +---- + src/mm-iface-modem-3gpp.c | 3 +-- + src/mm-iface-modem-simple.c | 5 +---- + src/mm-modem-helpers.c | 6 ++---- + 4 files changed, 5 insertions(+), 14 deletions(-) + +commit a0f7db513f712316636ddfb31a6fcec569c9f54b +Author: Aleksander Morgado +Date: Thu Jan 5 19:07:43 2012 +0100 + + iface-modem-cdma: setup periodic registration checks + + src/mm-iface-modem-cdma.c | 110 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 110 insertions(+) + +commit abf0d1afc139738075ab8c5e5769a7b42aeac181 +Author: Aleksander Morgado +Date: Thu Jan 5 19:06:52 2012 +0100 + + iface-modem-cdma: report state changes with subsystem ID + + Different subsystem IDs used for CDMA1x and EVDO + + src/mm-iface-modem-cdma.c | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +commit 8b78c394142c74101e0a4f4e02794422898044cf +Author: Aleksander Morgado +Date: Thu Jan 5 19:05:43 2012 +0100 + + iface-modem-3gpp: report state changes with subsystem ID + + src/mm-iface-modem-3gpp.c | 32 ++++++++++++++++++-------------- + 1 file changed, 18 insertions(+), 14 deletions(-) + +commit 0b8d0c697d68efd9cf2828508c06cb03cd4b1145 +Author: Aleksander Morgado +Date: Thu Jan 5 19:05:15 2012 +0100 + + iface-modem: get consolidated state from all subsystems + + We don't want, e.g., REGISTERED->ENABLED transitions when 3GPP gets + unregistered but we're still registered in CDMA. + + src/mm-iface-modem.c | 110 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 4 ++ + 2 files changed, 114 insertions(+) + +commit 6d76f1755f480fa9c3a4858e250d8b85d423d1b5 +Author: Aleksander Morgado +Date: Thu Jan 5 16:32:55 2012 +0100 + + broadband-modem: implement default detailed CDMA registration getter + + Fully based on Sprint commands + + src/mm-broadband-modem.c | 201 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 201 insertions(+) + +commit a767c2c523eafec72462da66b62a552e72f4d78f +Author: Aleksander Morgado +Date: Thu Jan 5 16:32:14 2012 +0100 + + broadband-modem: skip CDMA registration check steps on default + implementation + + If we know that there is no QCDM port, skip QCDM-based checks. + If we know there are Sprint commands, skip CDMA1x Serving System + check. + If we know there are no Sprint commands, skip detailed registration + getter. + + src/mm-broadband-modem.c | 178 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 177 insertions(+), 1 deletion(-) + +commit 9b860021a0fa9a0f3a9a513ced53b4d34f853b31 +Author: Aleksander Morgado +Date: Thu Jan 5 16:29:31 2012 +0100 + + broadband-modem: set NO_NETWORK error if we couldn't get SID from + CDMA1x SS checks + + src/mm-broadband-modem.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +commit 9f8e81277fc5441f0c49f92c13ef4e2c59ec05d0 +Author: Aleksander Morgado +Date: Thu Jan 5 16:26:29 2012 +0100 + + iface-modem-cdma: allow to configure which registration steps to run + + Implementations of the CDMA interface are allowed to specify which + steps in the + registration checks can be skipped. For example, if no QCDM ports + are available, + there won't be any need to try QCDM-based checks; or if Sprint + commands are + available, there won't be any need to run CDMA1x Serving System + checks. + + src/mm-iface-modem-cdma.c | 130 + +++++++++++++++++++++++++++++++++++----------- + src/mm-iface-modem-cdma.h | 13 +++++ + 2 files changed, 114 insertions(+), 29 deletions(-) + +commit ad05cd2916563d218cf48a1c9327c3a689896796 +Author: Aleksander Morgado +Date: Thu Jan 5 11:41:56 2012 +0100 + + iface-modem-cdma: last step to get detailed registration state + + src/mm-iface-modem-cdma.c | 106 + ++++++++++++++++++++++++++++++++++++++-------- + src/mm-iface-modem-cdma.h | 15 ++++++- + 2 files changed, 102 insertions(+), 19 deletions(-) + +commit d0d3d1f54555bd12ce726aa42524c776a82a174d +Author: Aleksander Morgado +Date: Thu Jan 5 02:17:09 2012 +0100 + + plugin-base: keep track of the probe for the net port, even if it + wasn't run + + src/mm-plugin-base.c | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit 16ed08cc851df2ce9501210feba55c0d86887032 +Author: Aleksander Morgado +Date: Thu Jan 5 02:15:07 2012 +0100 + + port-probe: avoid warnings when probe was for a net device + + net devices aren't really probed + + src/mm-port-probe.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 32a0c8fbb7d5fa76e963aec2e288a0e2dcc214a4 +Author: Aleksander Morgado +Date: Thu Jan 5 01:30:08 2012 +0100 + + plugin-manager: new defer-until-suggested support check result + handling + + 'net' ports will be supported as soon as there is another port + reporting + successful support. + + src/mm-plugin-base.c | 15 +++++++++------ + src/mm-plugin-manager.c | 25 ++++++++++++++++++++++++- + src/mm-plugin.h | 2 +- + 3 files changed, 34 insertions(+), 8 deletions(-) + +commit 65c14607cd8233217116e19e7c30067257a6f03c +Author: Aleksander Morgado +Date: Thu Jan 5 01:14:11 2012 +0100 + + broadband-modem: add LTE capability checks + + src/mm-broadband-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit e28183274f6b10af42f2ec9e6e77f1a9cb01ee03 +Author: Aleksander Morgado +Date: Wed Jan 4 22:47:36 2012 +0100 + + broadband-modem: implement default serving system and service status + retrieval + + src/mm-broadband-modem.c | 330 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.c | 12 +- + 2 files changed, 340 insertions(+), 2 deletions(-) + +commit 9efabb8fcb9aa0c8e7d8afb3e313082fc9773e64 +Author: Aleksander Morgado +Date: Wed Jan 4 22:42:47 2012 +0100 + + modem-helpers: new CDMA helper parsers + + src/mm-iface-modem-cdma.c | 4 +-- + src/mm-iface-modem-cdma.h | 3 --- + src/mm-modem-helpers.c | 68 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 8 ++++++ + 4 files changed, 78 insertions(+), 5 deletions(-) + +commit 44289da5316d8a90d6016d181d828d754a4e2096 +Author: Aleksander Morgado +Date: Wed Jan 4 18:36:55 2012 +0100 + + iface-modem-cdma: run all registration checks during CDMA interface + enable + + src/mm-iface-modem-cdma.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 11038be07f9ccc00f8413c85c6ab912467a680f7 +Author: Aleksander Morgado +Date: Wed Jan 4 12:12:06 2012 +0100 + + broadband-modem: implement CDMA registration state and network + supported properties + + src/mm-broadband-modem.c | 313 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 312 insertions(+), 1 deletion(-) + +commit 91e146e1feb69bb0e85be46f8377908425366fbe +Author: Aleksander Morgado +Date: Wed Jan 4 12:04:48 2012 +0100 + + iface-modem-cdma: start implementing CDMA registration state logic + + QCDM-based Call Manager and HDR state for now. + + src/mm-iface-modem-cdma.c | 486 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-cdma.h | 64 +++++- + 2 files changed, 543 insertions(+), 7 deletions(-) + +commit 14269e11386f41e89b821e40907ba6f4af81f72f +Author: Aleksander Morgado +Date: Wed Jan 4 10:49:07 2012 +0100 + + broadband-modem: implement ESN retrieval + + src/mm-broadband-modem.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +commit 0c6b505a6bd485d9bf65c105ed6bd7b35c930040 +Author: Aleksander Morgado +Date: Wed Jan 4 10:45:33 2012 +0100 + + iface-modem-cdma: load ESN during initialization + + src/mm-iface-modem-cdma.c | 60 + ++++++++++++++++++++++++++++++++--------------- + src/mm-iface-modem-cdma.h | 8 +++++++ + 2 files changed, 49 insertions(+), 19 deletions(-) + +commit 08a950ffb644574d4bf2a8b214728cdeab0a1a27 +Author: Aleksander Morgado +Date: Tue Jan 3 22:00:09 2012 +0100 + + iface-modem-simple: plug memleak + + src/mm-iface-modem-simple.c | 1 + + 1 file changed, 1 insertion(+) + +commit 45adc5054edeb4aed9de48e2f354f05e85e8d49f +Author: Aleksander Morgado +Date: Tue Jan 3 21:43:37 2012 +0100 + + iface-modem-3gpp: fix registration state context creation + + src/mm-iface-modem-3gpp.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit cb2612d0cee5d676564a14749a28021cf412354d +Author: Aleksander Morgado +Date: Tue Jan 3 21:43:20 2012 +0100 + + iface-modem: fix signal quality context creation + + src/mm-iface-modem.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 5edb863eded7bef4e3a83b2900b3b3fdc262319f +Author: Aleksander Morgado +Date: Tue Jan 3 20:27:18 2012 +0100 + + iface-modem: make old compilers happy + + src/mm-iface-modem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 3789c10819ddd1263bdd4e2066a6d79845177e31 +Author: Aleksander Morgado +Date: Tue Jan 3 20:19:30 2012 +0100 + + api,header: add explanation for the MMModemCdmaActivationErrors + + include/ModemManager-enums.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit ee07cc51ea52731180628219627ace508de7701a +Author: Aleksander Morgado +Date: Tue Jan 3 20:18:24 2012 +0100 + + iface-modem: fix checks for single technology capabilities + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7b884c46351bde98a371007b37e2ae13c8284ca6 +Author: Aleksander Morgado +Date: Tue Jan 3 19:59:10 2012 +0100 + + base-modem-at: always unref the modem object in AT command/sequence + contexts + + src/mm-base-modem-at.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 1304b659569db42c6b69b8a1f20041a6cb6a4012 +Author: Aleksander Morgado +Date: Tue Jan 3 19:58:36 2012 +0100 + + base-modem: log when fully disposing the object + + src/mm-base-modem.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 8af488b4524300ac900df0d19e5ce47e09962e7c +Author: Aleksander Morgado +Date: Tue Jan 3 19:58:23 2012 +0100 + + base-modem: use g_clear_object() before setting new objects + + src/mm-base-modem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit c3f1a7ec98277fd68db12c61c30e6c5753a63fcd +Author: Aleksander Morgado +Date: Tue Jan 3 19:57:43 2012 +0100 + + bearer: use g_clear_object() before setting new objects + + src/mm-bearer.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 1097993212176e69079ad23ed32e0691f7e29df1 +Author: Aleksander Morgado +Date: Tue Jan 3 19:57:14 2012 +0100 + + broadband-modem: use g_clear_object() before setting new objects + + src/mm-broadband-modem.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 8610fd47b366cf7be49ed0ad89576fd3d84e57a2 +Author: Aleksander Morgado +Date: Tue Jan 3 19:56:16 2012 +0100 + + iface-modem: plug small leak + + src/mm-iface-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 8c0d67a81a4658102be6338b6dd5bc8338cf7f8c +Author: Aleksander Morgado +Date: Tue Jan 3 19:55:57 2012 +0100 + + sim: use g_clear_object() before setting new objects + + src/mm-sim.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit f3bc54eb40ce17a81b71de550dff78d795a09241 +Author: Aleksander Morgado +Date: Tue Jan 3 19:54:58 2012 +0100 + + libmm-common: plug small leak in the common simple properties + + libmm-common/mm-common-simple-properties.c | 1 + + 1 file changed, 1 insertion(+) + +commit a68847a091074364f57be671fb405dd340cfa9d9 +Author: Aleksander Morgado +Date: Tue Jan 3 17:07:08 2012 +0100 + + iface-modem-3gpp: if modem is LTE-only, assume no CS network is + expected + + src/mm-iface-modem-3gpp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit ffae95a46b66190484f414d40e50434aa278d34d +Author: Aleksander Morgado +Date: Tue Jan 3 17:06:45 2012 +0100 + + iface-modem: new helpers to check if modem has LTE capabilities + + src/mm-iface-modem.c | 32 ++++++++++++++++++++++++++++---- + src/mm-iface-modem.h | 2 ++ + src/mm-modem-helpers.h | 8 +++++--- + 3 files changed, 35 insertions(+), 7 deletions(-) + +commit 3c703dd5a33714852fe0dc32879d6ea8aec7c849 +Author: Aleksander Morgado +Date: Tue Jan 3 16:53:59 2012 +0100 + + iface-modem-3gpp: new properties to tell whether PS/CS networks + are supported + + E.g, Iridium modems won't support PS networks, and LTE-only modems + won't support + CS networks. + + src/mm-broadband-modem.c | 26 ++++++++++++ + src/mm-iface-modem-3gpp.c | 101 + ++++++++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem-3gpp.h | 2 + + 3 files changed, 117 insertions(+), 12 deletions(-) + +commit 517d47b69984d8c9f7703945d78a0344984c0223 +Author: Aleksander Morgado +Date: Tue Jan 3 16:15:21 2012 +0100 + + iface-modem-3gpp: update PS/CS registration states separately + + But provide a consolidate state in the interface. + + src/mm-broadband-modem.c | 108 + ++++++++++++++++++---------------------------- + src/mm-iface-modem-3gpp.c | 88 +++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem-3gpp.h | 12 +++--- + 3 files changed, 133 insertions(+), 75 deletions(-) + +commit 6abcfd54a6c3b45b38c0bc4a999b39f0c683de35 +Author: Aleksander Morgado +Date: Tue Jan 3 13:23:36 2012 +0100 + + iface-modem-cdma: load MEID during initialization + + src/mm-iface-modem-cdma.c | 39 +++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 8 ++++++++ + 2 files changed, 47 insertions(+) + +commit 863bfe9ecd4a5a9e8fba087ee05de04523f8b9d0 +Author: Aleksander Morgado +Date: Tue Jan 3 13:08:28 2012 +0100 + + broadband-modem: implement the CDMA interface + + src/mm-broadband-modem.c | 56 + +++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 51 insertions(+), 5 deletions(-) + +commit f5d894f5a2620565140fcfb92ff9790e509c2436 +Author: Aleksander Morgado +Date: Tue Jan 3 13:02:11 2012 +0100 + + iface-modem-cdma: new interface to handle CDMA specific actions + + src/Makefile.am | 2 + + src/mm-iface-modem-cdma.c | 728 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-cdma.h | 109 +++++++ + 3 files changed, 839 insertions(+) + +commit ad9df4a5d1b848641903f283095f4117a62aa662 +Author: Aleksander Morgado +Date: Sat Dec 31 17:04:54 2011 +0100 + + broadband-modem: implement QCDM-based signal quality retrieval + + Will work for CDMA modems with QCDM ports. + + src/mm-broadband-modem.c | 226 + +++++++++++++++++++++++++++++++++++------------ + 1 file changed, 170 insertions(+), 56 deletions(-) + +commit 94846a2f51bf3ca40ec945de690e74dbb5f0ce97 +Author: Aleksander Morgado +Date: Sat Dec 31 17:04:16 2011 +0100 + + base-modem: make public the method to get best AT port + + Sometimes, we want to check whether a given port is available to + send commands, + and fallback to some other method if so (e.g. using a QCDM port). + + src/mm-base-modem-at.c | 32 +++----------------------------- + src/mm-base-modem.c | 26 ++++++++++++++++++++++++++ + src/mm-base-modem.h | 2 ++ + 3 files changed, 31 insertions(+), 29 deletions(-) + +commit edc117406888f489d4ebd29b6d08ea67d60bb99c +Author: Aleksander Morgado +Date: Sat Dec 31 15:41:19 2011 +0100 + + broadband-modem: try +CSQ? if +CSQ fails + + As done in the generic CDMA implementation + + src/mm-broadband-modem.c | 43 ++++++++++++++++++++++++++++--------------- + 1 file changed, 28 insertions(+), 15 deletions(-) + +commit d5af2286e2ecd18e653ea63c601d7528af56a45c +Author: Aleksander Morgado +Date: Sat Dec 31 15:28:57 2011 +0100 + + iface-modem-3gpp: indicators and unsolicited events are 3GPP-specific + + Moved code from the Modem interface, as this is really 3GPP-specific + + src/mm-broadband-modem.c | 28 +++++----- + src/mm-iface-modem-3gpp.c | 130 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 24 +++++++++ + src/mm-iface-modem.c | 127 + -------------------------------------------- + src/mm-iface-modem.h | 24 --------- + 5 files changed, 167 insertions(+), 166 deletions(-) + +commit 5c3154bbba15fd5ec450850ff0d9f5fe12b62c98 +Author: Aleksander Morgado +Date: Sat Dec 31 15:23:53 2011 +0100 + + Revert "broadband-modem: skip indicators and unsolicited events + setup in CDMA-only modems" + + This reverts commit b16f9bbba6aeb8b54a81192dca76d57ac0e88aae. + + src/mm-broadband-modem.c | 49 + ++++++++---------------------------------------- + 1 file changed, 8 insertions(+), 41 deletions(-) + +commit 611970a4242ae87132f226079d34b05f18c73e5a +Author: Aleksander Morgado +Date: Sat Dec 31 15:00:09 2011 +0100 + + broadband-modem: remove obsolete commented code + + src/mm-broadband-modem.c | 14 -------------- + 1 file changed, 14 deletions(-) + +commit 41bf8413342eeb6aab270495e3bfb4842faba0a2 +Author: Aleksander Morgado +Date: Sat Dec 31 14:59:36 2011 +0100 + + generic: allow QCDM ports + + plugins/mm-plugin-generic.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit def30139d7feb32fdc8a6c5e18a7f95d1d4417dc +Author: Aleksander Morgado +Date: Sat Dec 31 13:31:33 2011 +0100 + + cli: report as 'none' when no SIM path is given + + Instead of giving '/' + + cli/mmcli-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7043b2ef6ef0da5c4253a95e215f6ad86de7b320 +Author: Aleksander Morgado +Date: Sat Dec 31 13:18:48 2011 +0100 + + broadband-modem: skip indicators and unsolicited events setup in + CDMA-only modems + + src/mm-broadband-modem.c | 49 + ++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 41 insertions(+), 8 deletions(-) + +commit ae5da014032ff195661856214144774662c3caf9 +Author: Aleksander Morgado +Date: Sat Dec 31 13:13:56 2011 +0100 + + broadband-modem: skip supported charsets check in CDMA-only modems + + src/mm-broadband-modem.c | 82 + +++++++++++++++++++++++++++++++++++------------- + 1 file changed, 60 insertions(+), 22 deletions(-) + +commit f4acff17daf158071e9a0e965e80131dfc91b2c5 +Author: Aleksander Morgado +Date: Sat Dec 31 12:57:10 2011 +0100 + + broadband-modem: skip SIM creation in CDMA-only modems + + src/mm-broadband-modem.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit bda0d0c1d4e5bf06cd1296c140e4f03ecba6836c +Author: Aleksander Morgado +Date: Sat Dec 31 12:56:55 2011 +0100 + + iface-modem: allow implementations to return no SIM and no error + + That would mean that the implementation doesn't want to handle a + SIM object + around, maybe because it doesn't support it properly, or because + there is + no SIM at all (e.g. CDMA-only modems). + + src/mm-iface-modem.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +commit 34bf2e6dd1405cd15ff727c0401482a14cd1bdbd +Author: Aleksander Morgado +Date: Sat Dec 31 12:46:55 2011 +0100 + + broadband-modem: helper comments when setting interface implementation + + src/mm-broadband-modem.c | 44 + ++++++++++++++++++++++++++++---------------- + 1 file changed, 28 insertions(+), 16 deletions(-) + +commit 89646f2b6480facd5a028b72de181640acb6f153 +Author: Aleksander Morgado +Date: Sat Dec 31 12:46:10 2011 +0100 + + broadband-modem: check for 3GPP using capabilities, not availability + of the interface + + src/mm-broadband-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e107528f8798e78c91a65752333c72559ad81168 +Author: Aleksander Morgado +Date: Sat Dec 31 12:45:03 2011 +0100 + + broadband-modem: skip unlock check in CDMA-only modems + + src/mm-broadband-modem.c | 52 + +++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 45 insertions(+), 7 deletions(-) + +commit 021ff8a35bf7833d6c34459f400ea2e80857fa21 +Author: Aleksander Morgado +Date: Sat Dec 31 11:36:48 2011 +0100 + + iface-modem: open/close secondary AT/QCDM ports during enable/disable + + src/mm-iface-modem.c | 67 + +++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 61 insertions(+), 6 deletions(-) + +commit be7cee24f3fd8c21245dd6c5c8c53bf95a8a1d2f +Author: Aleksander Morgado +Date: Sat Dec 31 11:34:58 2011 +0100 + + iface-modem: place all tags/quarks handled together + + src/mm-iface-modem.c | 73 + +++++++++++++++++++++++++++------------------------- + 1 file changed, 38 insertions(+), 35 deletions(-) + +commit d28171b1db0ac5b5186ab4c1b38a0b19a8662a3f +Author: Aleksander Morgado +Date: Sat Dec 31 11:13:34 2011 +0100 + + broadband-modem: don't try +CGSN in CDMA-only modems + + src/mm-broadband-modem.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 0f7716887c0839515a55863397423df24fa7c2bd +Author: Aleksander Morgado +Date: Sat Dec 31 11:12:19 2011 +0100 + + iface-modem: new methods to check for specific capabilities being + supported + + src/mm-iface-modem.c | 36 ++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 5 +++++ + 2 files changed, 41 insertions(+) + +commit dd3d1c0337e54366d8da3558f05f5f4f0a572017 +Author: Aleksander Morgado +Date: Fri Dec 30 23:48:11 2011 +0100 + + broadband-modem: provide default implementation of MMSim creation + + src/mm-broadband-modem.c | 61 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit ba5321adf153bed36a3328b6178e3746c17140ce +Author: Aleksander Morgado +Date: Fri Dec 30 23:47:39 2011 +0100 + + iface-modem: let different SIM object creation implementations + + We let objects implementing the Modem interface to provide their + own SIM + creation method. This allows plugins to subclass MMSim themselves. + + src/mm-iface-modem.c | 69 + +++++++++++++++++++++++++++++----------------------- + src/mm-iface-modem.h | 9 +++++++ + 2 files changed, 47 insertions(+), 31 deletions(-) + +commit 7d2626ea4495ffaac5a180ae167fe264b355c990 +Author: Aleksander Morgado +Date: Fri Dec 30 23:46:28 2011 +0100 + + sim: new SIM path getter + + src/mm-sim.c | 8 ++++++++ + src/mm-sim.h | 2 ++ + 2 files changed, 10 insertions(+) + +commit e4486fd5f0aacb0c80ee49e89f4cd188a849291d +Author: Aleksander Morgado +Date: Fri Dec 30 19:27:24 2011 +0100 + + base-modem: store the AT sequence context GDestroyNotify callback + + src/mm-base-modem-at.c | 1 + + 1 file changed, 1 insertion(+) + +commit b18a801df3b0467f0c3c02eb055a7e19f8a879d5 +Author: Aleksander Morgado +Date: Fri Dec 30 19:16:04 2011 +0100 + + libmm-common: fix build dependencies + + Added proper rules in the Makefile so that those files which need the + glib-mkenums generated files are built always once the prerequisites + are all + ready. + + Also, avoid including libmm-common.h from within source files of + the library. + + libmm-common/Makefile.am | 7 +++++++ + libmm-common/mm-common-bearer-properties.c | 4 ++-- + libmm-common/mm-common-connect-properties.c | 4 ++-- + libmm-common/mm-common-simple-properties.c | 5 +++-- + 4 files changed, 14 insertions(+), 6 deletions(-) + +commit 5c1d18d15675d43d9b3bb42adf6911e03823ad88 +Author: Aleksander Morgado +Date: Fri Dec 30 18:33:21 2011 +0100 + + port-probe: store the task always before completing it + + If we already got all needed probing results, we complete the + task without + launching any new probing, but still, we need to store it internally + so + that it's properly disposed. + + src/mm-port-probe.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 51dc93e3d50129a25985e84a4c8953392a975af6 +Author: Aleksander Morgado +Date: Fri Dec 30 18:32:08 2011 +0100 + + manager: plug small leak + + src/mm-manager.c | 1 + + 1 file changed, 1 insertion(+) + +commit bf69930edee26994bce706b394718921bdb9ea56 +Author: Aleksander Morgado +Date: Fri Dec 30 17:24:14 2011 +0100 + + iface-modem: ensure initial allowed modes is a subset of supported + modes + + Also make loading supported modes a mandatory method that must be + provided by + objects implementing the Modem interface. + + src/mm-iface-modem.c | 35 ++++++++++++++++++++++++++++++----- + 1 file changed, 30 insertions(+), 5 deletions(-) + +commit f0c5e5145ed8fa9eaab78e794f820d5eb98ed523 +Author: Aleksander Morgado +Date: Fri Dec 30 17:09:01 2011 +0100 + + iface-modem-simple: include setting bands during simple Connect() + + src/mm-iface-modem-simple.c | 53 + +++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 51 insertions(+), 2 deletions(-) + +commit a34f51b0a5e694514a6d32dac60809303ecf9969 +Author: Aleksander Morgado +Date: Fri Dec 30 16:53:19 2011 +0100 + + cli: new `--set-allowed-bands' + + cli/mmcli-modem.c | 85 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 84 insertions(+), 1 deletion(-) + +commit 6002ad1b70722c1960d9ae923150aca6c4041d2c +Author: Aleksander Morgado +Date: Fri Dec 30 16:52:58 2011 +0100 + + iface-modem: run checks when trying to set allowed bands + + Allowed bands must be a subset of the supported bands. + + src/mm-iface-modem.c | 125 + ++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 98 insertions(+), 27 deletions(-) + +commit aae179463b6dab0a8e7cc25af94f67ac65b9628f +Author: Aleksander Morgado +Date: Fri Dec 30 15:39:59 2011 +0100 + + broadband-modem: implement default supported mode loading + + Try to guess the supported modes, based on the current capabilities. + + src/mm-broadband-modem.c | 55 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +commit 148025c3818b4f4f64361314056470e49a9ff2f6 +Author: Aleksander Morgado +Date: Fri Dec 30 15:39:19 2011 +0100 + + cli: new `--set-allowed-modes' and `--set-preferred-modes' actions + + cli/mmcli-modem.c | 128 + +++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 126 insertions(+), 2 deletions(-) + +commit 1be7c274535a17ca05b8eeb7c1b0cc58029dc5dd +Author: Aleksander Morgado +Date: Fri Dec 30 15:38:55 2011 +0100 + + iface-modem: run checks when trying to set allowed modes + + Allowed modes being set must be a subset of Supported modes. + Preferred mode being set must be a subset of Allowed modes. + + src/mm-iface-modem.c | 105 + ++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 92 insertions(+), 13 deletions(-) + +commit 9a4940c4b20d6729cfeff52dd6ca0af3bfae7ba8 +Author: Aleksander Morgado +Date: Fri Dec 30 15:37:37 2011 +0100 + + libmm-common: handle strings coming in capitals when building bands + or modes + + libmm-common/mm-common-helpers.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ebbfe9cb61e95964df2b0ae52147ac30a0db86cc +Author: Aleksander Morgado +Date: Fri Dec 30 15:36:51 2011 +0100 + + libmm-common: print modes string with capitals for the acronyms + + libmm-common/mm-common-helpers.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 15079bcb2d0b916c2077c18527b82170ce54b52b +Author: Aleksander Morgado +Date: Fri Dec 30 15:35:32 2011 +0100 + + api,header: fix flags to ensure they all start with 1 + + include/ModemManager-enums.h | 42 + +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +commit cc55734a01566e73f214526f124b87baa548e19d +Author: Aleksander Morgado +Date: Fri Dec 30 15:35:01 2011 +0100 + + api,header: don't use '1G' for modem modes, use 'CS' instead. + + 1G is not the proper way to define GSM, which is already 2G. Use + CS instead, + which will include all circuit-switched broadband modem technologies. + + include/ModemManager-enums.h | 2 +- + libmm-common/mm-common-helpers.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit a71e27af961b356ad2a80ebbce2c3036767eadfa +Author: Aleksander Morgado +Date: Fri Dec 30 12:29:38 2011 +0100 + + iface-modem-3gpp: setup context struct for periodic registration + checks + + src/mm-iface-modem-3gpp.c | 81 + +++++++++++++++++++++++++++++++---------------- + 1 file changed, 53 insertions(+), 28 deletions(-) + +commit da9d070e8b738519b4828bed5a70d8d27f90acab +Author: Aleksander Morgado +Date: Thu Dec 29 23:16:49 2011 +0100 + + iface-modem: don't run signal quality check if last update was less + than 15s ago + + src/mm-iface-modem.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +commit 73eeffbd5e388034011e162dd29906e42a0b85a7 +Author: Aleksander Morgado +Date: Thu Dec 29 23:16:14 2011 +0100 + + iface-modem: handle struct signal quality check/update contexts as + object data + + src/mm-iface-modem.c | 169 + +++++++++++++++++++++++++++++++-------------------- + 1 file changed, 103 insertions(+), 66 deletions(-) + +commit d05a7a0a3edc99b4deef527aa91a5a814c1bf409 +Author: Aleksander Morgado +Date: Thu Dec 29 22:24:55 2011 +0100 + + broadband-modem: handle signal quality changes reported by unsolicited + CIEV + + src/mm-broadband-modem.c | 131 + ++++++++++++++++++++++++++++++++--------------- + 1 file changed, 89 insertions(+), 42 deletions(-) + +commit b0d3f5939751ad09a51c3dcd6c9bb6446d743ff1 +Author: Aleksander Morgado +Date: Thu Dec 29 22:24:31 2011 +0100 + + base-modem: fully ignore CIEV messages on startup + + src/mm-base-modem.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit d5e6776a525940bb7be72c9710aee049d242faab +Author: Aleksander Morgado +Date: Thu Dec 29 22:24:03 2011 +0100 + + modem-helpers: new common regex for CIEV unsolicited messages + + src/mm-modem-helpers.c | 11 +++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 13 insertions(+) + +commit d9338049c6213ef165d7d2dc8a73c7fcb3c82921 +Author: Aleksander Morgado +Date: Thu Dec 29 21:46:25 2011 +0100 + + broadband-modem: implement indicators setup and unsolicited event + handling + + src/mm-broadband-modem.c | 264 + ++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 206 insertions(+), 58 deletions(-) + +commit 953be3e81da7e0b6f9b64b19516b83098efda949 +Author: Aleksander Morgado +Date: Thu Dec 29 11:31:27 2011 +0100 + + iface-modem: new methods to setup/cleanup unsolicited result codes + + src/mm-iface-modem.c | 128 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 24 ++++++++++ + 2 files changed, 152 insertions(+) + +commit b29acbb239c3a08f3c27601109d5354bb1b35530 +Author: Aleksander Morgado +Date: Thu Dec 29 11:46:40 2011 +0100 + + iface-modem: renamed `modem_charset' to `setup_charset' + + And changed broadband modem accordingly. + + src/mm-broadband-modem.c | 30 +++++++++++++++--------------- + src/mm-iface-modem.c | 16 ++++++++-------- + src/mm-iface-modem.h | 4 ++-- + 3 files changed, 25 insertions(+), 25 deletions(-) + +commit 7b506bc8a6931568edc97b444e64e620b13c671b +Author: Aleksander Morgado +Date: Thu Dec 29 11:37:52 2011 +0100 + + iface-modem: renamed `modem_flow_control' to `setup_flow_control' + + Changed broadband modem and Cinterion plugin accordingly. + + plugins/mm-broadband-modem-cinterion.c | 14 +++++++------- + src/mm-broadband-modem.c | 12 ++++++------ + src/mm-iface-modem.c | 10 +++++----- + src/mm-iface-modem.h | 4 ++-- + 4 files changed, 20 insertions(+), 20 deletions(-) + +commit 08b7620b7ab690c2b8f63247452b18adce7ae704 +Author: Aleksander Morgado +Date: Wed Dec 28 20:59:01 2011 +0100 + + broadband-modem: implement on demand signal quality checks with + AT+CIND? + + src/mm-broadband-modem.c | 128 + ++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 120 insertions(+), 8 deletions(-) + +commit e06d42c868745af69f63b8f9ca418b07b70602de +Author: Aleksander Morgado +Date: Wed Dec 28 20:33:08 2011 +0100 + + broadband-modem: implement on demand signal quality checks with AT+CSQ + + Still need to implement CIND-based signal quality checks. + + src/mm-broadband-modem.c | 119 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 119 insertions(+) + +commit f0433a4dda362a5d8658c154abf356f1fc5f5c82 +Author: Aleksander Morgado +Date: Wed Dec 28 20:31:48 2011 +0100 + + iface-modem: setup periodic signal quality checks + + src/mm-iface-modem.c | 370 + ++++++++++++++++++++++++++++++--------------------- + src/mm-iface-modem.h | 5 +- + 2 files changed, 221 insertions(+), 154 deletions(-) + +commit eb1c7afc8cd86f3c55b850bf2c4a0d16d5db15fb +Author: Aleksander Morgado +Date: Wed Dec 28 15:08:39 2011 +0100 + + cli: implement `--simple-status' + + cli/mmcli-modem-simple.c | 114 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 112 insertions(+), 2 deletions(-) + +commit fa5064ece35a1af500d03b1709f793b8432f6f4b +Author: Aleksander Morgado +Date: Wed Dec 28 14:43:32 2011 +0100 + + libmm-glib: implement handling of GetStatus() calls in the Simple + interface + + libmm-glib/mm-modem-simple.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-simple.h | 11 ++++++++++ + 2 files changed, 61 insertions(+) + +commit f58a23c9c20c1a4a4a1987e8e0d9b3d988eaee59 +Author: Aleksander Morgado +Date: Wed Dec 28 14:30:49 2011 +0100 + + libmm-glib: new interface to handle simple status properties + + libmm-glib/Makefile.am | 3 + + libmm-glib/mm-modem-simple-status-properties.c | 78 + ++++++++++++++++++++++++++ + libmm-glib/mm-modem-simple-status-properties.h | 44 +++++++++++++++ + 3 files changed, 125 insertions(+) + +commit 1745d8c9ebf00dc06ff4f2172d754b54c2ec9fbc +Author: Aleksander Morgado +Date: Wed Dec 28 14:30:20 2011 +0100 + + libmm-common: let the simple properties object be built from a + dictionary + + libmm-common/mm-common-simple-properties.c | 64 + ++++++++++++++++++++++++++++++ + libmm-common/mm-common-simple-properties.h | 3 ++ + 2 files changed, 67 insertions(+) + +commit 0edf4037349ab087925de1e47faf609c78f225e8 +Author: Aleksander Morgado +Date: Wed Dec 28 14:29:34 2011 +0100 + + build: fix libmm-glib library headers + + Remove headers from libmm-common, and include all public headers. + + libmm-glib/Makefile.am | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 045d0c2df8492c23782a6944740f80690aec6786 +Author: Aleksander Morgado +Date: Wed Dec 28 14:02:00 2011 +0100 + + broadband-modem: run property bindings for simple status on each + interface + + Once an interface gets initialized, we run the property binding + method in the + interface in order to get the simple properties bound. + + src/mm-broadband-modem.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 2eb3dbb010c743f196c0e5e1a7127b333a0627d0 +Author: Aleksander Morgado +Date: Wed Dec 28 14:00:30 2011 +0100 + + iface-modem-3gpp: implement property binding for the simple status + + src/mm-iface-modem-3gpp.c | 29 +++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 4 ++++ + 2 files changed, 33 insertions(+) + +commit 0c009a2c4aad1ccbc6a74044750a4ea5d49c4061 +Author: Aleksander Morgado +Date: Wed Dec 28 14:00:15 2011 +0100 + + iface-modem: implement property binding for the simple status + + src/mm-iface-modem.c | 110 + +++++++++++++++++++++++++++++++-------------------- + src/mm-iface-modem.h | 3 ++ + 2 files changed, 71 insertions(+), 42 deletions(-) + +commit 93880155f0e38b54a0886c7cebb05075293c86f4 +Author: Aleksander Morgado +Date: Wed Dec 28 13:59:48 2011 +0100 + + iface-modem-simple: implement GetStatus() + + src/mm-iface-modem-simple.c | 28 +++++++++++++++++++++++++--- + src/mm-iface-modem-simple.h | 3 ++- + 2 files changed, 27 insertions(+), 4 deletions(-) + +commit ba1a448717d29885492ac1e9644df19324e7bfd0 +Author: Aleksander Morgado +Date: Wed Dec 28 13:58:16 2011 +0100 + + api,dbus: improve GetStatus() documentation in the Simple interface + + * We will also return 'registration-state' in 3GPP networks + * Specified that 'operator-code' and 'operator-name' are only set if + registered in a 3GPP network. + + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 22 + ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 111cd56a2bf25a76e5634807f393e8a9f5b04bbc +Author: Aleksander Morgado +Date: Wed Dec 28 13:49:32 2011 +0100 + + libmm-common: new helper object to handle simple properties from + all interfaces + + libmm-common/Makefile.am | 3 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-common-simple-properties.c | 361 + +++++++++++++++++++++++++++++ + libmm-common/mm-common-simple-properties.h | 71 ++++++ + 4 files changed, 436 insertions(+) + +commit b0272444cbafe3c845790e8c3a73be4c13b5862e +Author: Aleksander Morgado +Date: Wed Dec 28 13:48:27 2011 +0100 + + libmm-common: new helpers to work with bands arrays + + libmm-common/mm-common-helpers.c | 92 + +++++++++++++++++++++++++++++++--------- + libmm-common/mm-common-helpers.h | 13 ++++-- + 2 files changed, 82 insertions(+), 23 deletions(-) + +commit 0cdb293452cb62830326e465e521830914b705bf +Author: Aleksander Morgado +Date: Tue Dec 27 16:35:49 2011 +0100 + + cli: new `simple-disconnect' command + + This command doesn't expect any argument, it will disconnect all + available + bearers. You can disconnect specific bearers using `--bearer' and + `--disconnect'. + + cli/mmcli-modem-simple.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 61 insertions(+), 2 deletions(-) + +commit dd4b073e089c833609aea5b0da0bc65b41f5a91b +Author: Aleksander Morgado +Date: Tue Dec 27 16:34:09 2011 +0100 + + libmm-glib: handle simple Disconnect() + + libmm-glib/mm-modem-simple.c | 42 + +++++++++++++++++++++++++++++++++++++++++- + libmm-glib/mm-modem-simple.h | 22 ++++++++++++---------- + 2 files changed, 53 insertions(+), 11 deletions(-) + +commit adcc33d0eace99c4f0990cb69d714a31dc2603eb +Author: Aleksander Morgado +Date: Tue Dec 27 16:05:35 2011 +0100 + + iface-modem-simple: implement Disconnect() + + src/mm-iface-modem-simple.c | 117 + ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 114 insertions(+), 3 deletions(-) + +commit e435deb2ba6ca3309a2aaeee59bd358a2b594b4e +Author: Aleksander Morgado +Date: Tue Dec 27 15:34:00 2011 +0100 + + iface-modem-simple: implement bearer creation and connection during + Connect() + + src/mm-iface-modem-simple.c | 68 + ++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 61 insertions(+), 7 deletions(-) + +commit 4ccc00fc6d333e16683f50941ed708acee56d36f +Author: Aleksander Morgado +Date: Tue Dec 27 15:33:33 2011 +0100 + + iface-modem: return a MMBearer reference when creating a new bearer + + Not just the bearer path. + + src/mm-iface-modem.c | 67 + +++++++++++++++++++++++++++++----------------------- + src/mm-iface-modem.h | 15 ++++++------ + 2 files changed, 45 insertions(+), 37 deletions(-) + +commit b232cc4f111ac449aca33c41d47789344cd5dcbd +Author: Aleksander Morgado +Date: Tue Dec 27 15:32:44 2011 +0100 + + bearer: allow launching connection not only via DBus + + src/mm-bearer.c | 109 + +++++++++++++++++++++++++++++++++++++++++--------------- + src/mm-bearer.h | 8 +++++ + 2 files changed, 88 insertions(+), 29 deletions(-) + +commit b37c951cb1a447d0c6b8f8988da98fac8b9de223 +Author: Aleksander Morgado +Date: Tue Dec 27 15:32:14 2011 +0100 + + bearer-list: new method to remove all existing bearers + + src/mm-bearer-list.c | 19 ++++++++++++++----- + src/mm-bearer-list.h | 1 + + 2 files changed, 15 insertions(+), 5 deletions(-) + +commit 93732cf0757b7320f371ce0ac9681b95b5b98e73 +Author: Aleksander Morgado +Date: Tue Dec 27 14:36:54 2011 +0100 + + bearers: base bearer creation in the new bearer properties object + + src/mm-bearer-3gpp.c | 27 ++++++------ + src/mm-bearer-3gpp.h | 5 +-- + src/mm-bearer.c | 34 +++------------ + src/mm-bearer.h | 6 +-- + src/mm-broadband-modem.c | 11 +++-- + src/mm-iface-modem-3gpp.c | 70 ++++--------------------------- + src/mm-iface-modem-3gpp.h | 15 +++---- + src/mm-iface-modem.c | 105 + +++++++++++++++++++++++++++++++++++++--------- + src/mm-iface-modem.h | 11 ++++- + 9 files changed, 141 insertions(+), 143 deletions(-) + +commit e08ce775c554ab2d4cba445cac93980273f2182a +Author: Aleksander Morgado +Date: Tue Dec 27 13:56:47 2011 +0100 + + libmm-common: let the connection properties use bearer properties + internally + + Removes lots of duplicated code. + + libmm-common/mm-common-bearer-properties.c | 143 +++++++++------ + libmm-common/mm-common-bearer-properties.h | 10 ++ + libmm-common/mm-common-connect-properties.c | 267 + +++++++++++----------------- + libmm-common/mm-common-connect-properties.h | 5 + + 4 files changed, 206 insertions(+), 219 deletions(-) + +commit 10a4360d83488c29abaf525ed22da20b937c9a78 +Author: Aleksander Morgado +Date: Tue Dec 27 12:11:09 2011 +0100 + + bearer: provide reason of why connection is forbidden + + src/mm-bearer.c | 67 + ++++++++++++++++++++++++++++++----------------- + src/mm-bearer.h | 19 +++++++++----- + src/mm-iface-modem-3gpp.c | 48 +++++++++++++++++++++------------ + 3 files changed, 87 insertions(+), 47 deletions(-) + +commit 6cdc6a4f731b0b9afe959bc10bc7386ff6735607 +Author: Aleksander Morgado +Date: Tue Dec 27 11:23:41 2011 +0100 + + cli: use the new properties handler object in bearer + + cli/mmcli-bearer.c | 31 ++++++----- + cli/mmcli-modem.c | 150 + ++++++++--------------------------------------------- + 2 files changed, 39 insertions(+), 142 deletions(-) + +commit fe7f71b67753a471b8119ccc5cad28d6ec8bf1f0 +Author: Aleksander Morgado +Date: Tue Dec 27 10:51:23 2011 +0100 + + libmm-common,libmm-glib: new object to handle bearer creation + properties + + libmm-common/Makefile.am | 3 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-common-bearer-properties.c | 368 + +++++++++++++++++++++++++++++ + libmm-common/mm-common-bearer-properties.h | 90 +++++++ + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-bearer-properties.c | 173 ++++++++++++++ + libmm-glib/mm-bearer-properties.h | 80 +++++++ + libmm-glib/mm-bearer.c | 169 +------------ + libmm-glib/mm-bearer.h | 28 +-- + libmm-glib/mm-modem.c | 71 ++---- + libmm-glib/mm-modem.h | 20 +- + 11 files changed, 750 insertions(+), 255 deletions(-) + +commit 8ff310be28450c780e63d12aef0289da601d0fa6 +Author: Aleksander Morgado +Date: Tue Dec 27 10:17:34 2011 +0100 + + iface-modem-simple: use the new connect properties object + + src/mm-iface-modem-simple.c | 98 + ++++++++++++--------------------------------- + 1 file changed, 26 insertions(+), 72 deletions(-) + +commit 3c90793f225c697b4fef7da23fcac9bd47a34be2 +Author: Aleksander Morgado +Date: Mon Dec 26 21:31:27 2011 +0100 + + cli: use the new properties handler object in simple Connect() + + cli/mmcli-modem-simple.c | 130 + ++++------------------------------------------- + 1 file changed, 11 insertions(+), 119 deletions(-) + +commit dcecb94631935584919c2cce6a814b78772ac0aa +Author: Aleksander Morgado +Date: Mon Dec 26 21:31:07 2011 +0100 + + libmm-common,libmm-glib: new object to handle properties in simple + Connect() + + Instead of using type unsafe properties passed to the connect() + call, we build + a new object which does the handling of the properties to be passed. + + .gitignore | 4 +- + libmm-common/Makefile.am | 3 + + libmm-common/libmm-common.h | 1 + + libmm-common/mm-common-connect-properties.c | 580 + ++++++++++++++++++++++++ + libmm-common/mm-common-connect-properties.h | 116 +++++ + libmm-common/mm-common-helpers.c | 74 ++- + libmm-common/mm-common-helpers.h | 8 +- + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-simple-connect-properties.c | 123 +++++ + libmm-glib/mm-modem-simple-connect-properties.h | 71 +++ + libmm-glib/mm-modem-simple.c | 86 +--- + libmm-glib/mm-modem-simple.h | 21 +- + 12 files changed, 983 insertions(+), 106 deletions(-) + +commit 034381250277751741f134123fc61c0c5405adea +Author: Aleksander Morgado +Date: Mon Dec 26 21:29:18 2011 +0100 + + libmm-common: new modes string parser + + libmm-common/mm-common-helpers.c | 38 + ++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 1 + + 2 files changed, 39 insertions(+) + +commit 6cfccb14526a6b0fa27f680cb76d7bef165cd169 +Author: Aleksander Morgado +Date: Mon Dec 26 21:29:01 2011 +0100 + + libmm-common,libmm-glib: new modes string builder + + libmm-common/mm-common-helpers.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 1 + + libmm-glib/mm-modem.c | 14 ++++++++++++++ + libmm-glib/mm-modem.h | 1 + + 4 files changed, 56 insertions(+) + +commit aa3d98d0ff6ff75cdeb8106b7d9e1108eef4994e +Author: Aleksander Morgado +Date: Mon Dec 26 21:27:57 2011 +0100 + + libmm-common: new bands string parser + + libmm-common/mm-common-helpers.c | 49 + ++++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 4 ++++ + 2 files changed, 53 insertions(+) + +commit d81d1d9d6a05e8c0024e887158c585c0c1540633 +Author: Aleksander Morgado +Date: Mon Dec 26 21:26:23 2011 +0100 + + libmm-common: handle exact mask matches when building capabilities + string + + libmm-common/mm-common-helpers.c | 34 +++++++++++++++++++++------------- + 1 file changed, 21 insertions(+), 13 deletions(-) + +commit 9868d757c75f8d06ca435ae99bc8caa8f36a00ac +Author: Aleksander Morgado +Date: Mon Dec 26 19:25:56 2011 +0100 + + cli: print supported/allowed bands in modem info + + cli/mmcli-modem.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit 5e0df902721c251d6876e5ff3e509284a92676e6 +Author: Aleksander Morgado +Date: Mon Dec 26 19:25:34 2011 +0100 + + libmm-common, libmm-glib: new bands string builder + + libmm-common/mm-common-helpers.c | 32 ++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 2 ++ + libmm-glib/mm-modem.c | 16 ++++++++++++++++ + libmm-glib/mm-modem.h | 2 ++ + 4 files changed, 52 insertions(+) + +commit b224f1889428780dc0656ed9fc60750c144a138e +Author: Aleksander Morgado +Date: Mon Dec 26 19:06:59 2011 +0100 + + cli: modem options check always last, even when shutting down + + cli/mmcli.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 9d7e3de4cd7d607dc797b8b6adf93eb75a018b6e +Author: Aleksander Morgado +Date: Mon Dec 26 18:50:16 2011 +0100 + + api: MMModemBand is now an enum, not flags + + We don't want to handle bands as flags, in order to avoid the need + of 64-bits + for the enum. This change implies that setting allowed bands will + be done by + giving an array of uint32 values, signature "au". + + cli/mmcli-modem-simple.c | 6 +- + include/ModemManager-enums.h | 70 ++++++------- + libmm-common/mm-common-helpers.c | 41 ++++++++ + libmm-common/mm-common-helpers.h | 5 + + libmm-glib/mm-modem-simple.h | 2 +- + libmm-glib/mm-modem.c | 59 +++++++---- + libmm-glib/mm-modem.h | 14 ++- + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 12 +-- + new/org.freedesktop.ModemManager1.Modem.xml | 12 +-- + src/mm-iface-modem.c | 114 + +++++++++++++++++++-- + src/mm-iface-modem.h | 10 +- + 11 files changed, 258 insertions(+), 87 deletions(-) + +commit a142a209eca617cd3cf4edc6436408e1e9c9f878 +Author: Aleksander Morgado +Date: Sat Dec 24 19:53:31 2011 +0100 + + broadband-modem: update registration state when disabling + + src/mm-broadband-modem.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 5c74c53354000968e55097a42631a202b935318b +Author: Aleksander Morgado +Date: Fri Dec 23 13:45:59 2011 +0100 + + iface-modem: don't update access tech if it didn't change + + src/mm-iface-modem.c | 51 + +++++++++++++++++++++++++++++---------------------- + 1 file changed, 29 insertions(+), 22 deletions(-) + +commit 54d718efe51d4e19a6cda3c9f4bac92a4ed1496e +Author: Aleksander Morgado +Date: Fri Dec 23 13:13:57 2011 +0100 + + broadband-modem: try to simplify 3GPP network registration + + When requesting to register in the network manually, we will poll + every once + in a while to check whether we got registered or not. We remove + the registration + timeout and we handle the case where it never gets registered by + allowing a + maximum number of registration checks in our request. + + src/mm-broadband-modem.c | 269 + ++++++++++++++++++++++------------------------- + 1 file changed, 128 insertions(+), 141 deletions(-) + +commit 21d3aed12536509ca3694374a2dc5abad619e577 +Author: Aleksander Morgado +Date: Thu Dec 22 20:44:18 2011 +0100 + + cli: implement actions from the Simple interface + + cli/Makefile.am | 1 + + cli/mmcli-modem-simple.c | 319 + +++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 4 files changed, 339 insertions(+) + +commit 90b4323b8a5499ac6f18e99477778f9e9c4e20ee +Author: Aleksander Morgado +Date: Thu Dec 22 20:44:02 2011 +0100 + + libmm-glib: handle the Simple interface + + libmm-glib/Makefile.am | 2 + + libmm-glib/mm-modem-simple.c | 265 + +++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-simple.h | 79 +++++++++++++ + libmm-glib/mm-object.c | 34 ++++++ + libmm-glib/mm-object.h | 3 + + 5 files changed, 383 insertions(+) + +commit ab9c7d90132ea685313eaba548f897832807614e +Author: Aleksander Morgado +Date: Thu Dec 22 20:43:19 2011 +0100 + + iface-modem-simple: implement Connect() + + src/mm-iface-modem-simple.c | 401 + ++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 373 insertions(+), 28 deletions(-) + +commit 4387fa183cc96c7d853bddbd339fe4fecab4cb8d +Author: Aleksander Morgado +Date: Thu Dec 22 20:42:50 2011 +0100 + + broadband-modem: use new common method to check if modem is 3GPP + + src/mm-broadband-modem.c | 7 +------ + src/mm-modem-helpers.h | 6 ++++++ + 2 files changed, 7 insertions(+), 6 deletions(-) + +commit 473ca46ad9fda23a8c3bd9a8124e337091aeaf39 +Author: Aleksander Morgado +Date: Thu Dec 22 20:41:39 2011 +0100 + + iface-modem-3gpp: allow requesting to register internally, not just + via DBus + + src/mm-iface-modem-3gpp.c | 59 + +++++++++++++++++++++++++++++++++++++++-------- + src/mm-iface-modem-3gpp.h | 9 ++++++++ + 2 files changed, 59 insertions(+), 9 deletions(-) + +commit c9c94211025dd65bfec43d43019ee9366d0ec721 +Author: Aleksander Morgado +Date: Thu Dec 22 20:41:11 2011 +0100 + + iface-modem: allow setting allowed modes and bands internally, + not just via DBus + + src/mm-iface-modem.c | 200 + +++++++++++++++++++++++++++++++++++++-------------- + src/mm-iface-modem.h | 22 ++++++ + 2 files changed, 170 insertions(+), 52 deletions(-) + +commit 937baa1a0a39aa21008224cd9c9f67b8b7f21653 +Author: Aleksander Morgado +Date: Thu Dec 22 20:39:57 2011 +0100 + + sim: allow sending PIN code internally, not just via DBus + + src/mm-sim.c | 159 + ++++++++++++++++++++++++++++++++++++++++++----------------- + src/mm-sim.h | 10 +++- + 2 files changed, 122 insertions(+), 47 deletions(-) + +commit 0cb3be0618d30a1fb8c8bfd9cb47139221eb6522 +Author: Aleksander Morgado +Date: Thu Dec 22 20:39:27 2011 +0100 + + api,dbus: let Connect() return just the bearer path + + Also renamed some of the properties that can be passed, trying to + consolidate a + common set of names. + + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +commit 8a636f6b16641ca90a5b87be412713cce15af45f +Author: Aleksander Morgado +Date: Wed Dec 21 21:55:44 2011 +0100 + + broadband-modem: handle state checks during Enable() and Disable() + + Before it was done in the interface; but we should really be doing + it in the + implementation; so that mm_base_modem_enable()/disable() also has + the state + checks. + + src/mm-broadband-modem.c | 126 + +++++++++++++++++++++++++++++++++++++++------- + src/mm-iface-modem.c | 127 + ++++++----------------------------------------- + 2 files changed, 122 insertions(+), 131 deletions(-) + +commit 9a80f5816568b52ee8e159e4b5775a02b3d095cf +Author: Aleksander Morgado +Date: Wed Dec 21 19:57:57 2011 +0100 + + broadband-modem: implement the Simple interface + + src/mm-broadband-modem.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +commit 7ea8bf59fb1ed202320aa525c83d56e290d494fe +Author: Aleksander Morgado +Date: Wed Dec 21 19:57:47 2011 +0100 + + iface-modem-simple: new interface to handle the Simple interface + + src/Makefile.am | 2 + + src/mm-iface-modem-simple.c | 136 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-simple.h | 43 ++++++++++++++ + 3 files changed, 181 insertions(+) + +commit ea934148304388f02435253f371c1af201f9116d +Author: Aleksander Morgado +Date: Wed Dec 21 19:52:03 2011 +0100 + + broadband-modem: shutdown 3GPP interface when disposing + + src/mm-broadband-modem.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 88e8c4835b50c8967e3caa120b7cbc898a7875b7 +Author: Aleksander Morgado +Date: Wed Dec 21 17:34:43 2011 +0100 + + cli: implement SIM related actions + + cli/Makefile.am | 3 +- + cli/mmcli-common.c | 247 +++++++++++++++++++++++++--- + cli/mmcli-common.h | 14 ++ + cli/mmcli-modem.c | 62 +++---- + cli/mmcli-sim.c | 475 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 13 +- + cli/mmcli.h | 8 + + 7 files changed, 762 insertions(+), 60 deletions(-) + +commit 241c29491873d527ac44272cbf4214e955ec5be6 +Author: Aleksander Morgado +Date: Wed Dec 21 15:27:10 2011 +0100 + + cli: include 3GPP related stuff when printing modem info + + cli/mmcli-common.c | 13 +++++++++++++ + cli/mmcli-common.h | 1 + + cli/mmcli-modem.c | 19 +++++++++++++++++++ + 3 files changed, 33 insertions(+) + +commit 6583bd61e13e842ab6b016cb0947432f1e3aea26 +Author: Aleksander Morgado +Date: Wed Dec 21 15:16:07 2011 +0100 + + cli: implement 3GPP related actions + + cli/Makefile.am | 1 + + cli/mmcli-common.c | 13 +++ + cli/mmcli-common.h | 9 +- + cli/mmcli-modem-3gpp.c | 298 + +++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 6 files changed, 336 insertions(+), 4 deletions(-) + +commit 73ca5dcb24c131d3e3a99a89dcd6f1329c9d90f4 +Author: Aleksander Morgado +Date: Wed Dec 21 15:15:28 2011 +0100 + + cli: don't recheck group options if already done + + cli/mmcli-bearer.c | 7 ++++++- + cli/mmcli-manager.c | 7 ++++++- + cli/mmcli-modem.c | 7 ++++++- + 3 files changed, 18 insertions(+), 3 deletions(-) + +commit 8fc2050e768157076dfa5445d52541904602e832 +Author: Aleksander Morgado +Date: Wed Dec 21 15:14:40 2011 +0100 + + libmm-glib: provide a list of opaque structs with network info in + scan reply + + libmm-glib/mm-modem-3gpp.c | 138 + +++++++++++++++++++++++++++++++++++++++++---- + libmm-glib/mm-modem-3gpp.h | 31 ++++++---- + 2 files changed, 145 insertions(+), 24 deletions(-) + +commit 6cce67a45103052b2adba360ba5d438923fa907c +Author: Aleksander Morgado +Date: Wed Dec 21 15:14:10 2011 +0100 + + modem-helpers: MMModemAccessTechnology is flags, not enum + + src/mm-modem-helpers.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 16f2b7bdb8ffdb84e7bd142bde91c7670c63a3e7 +Author: Aleksander Morgado +Date: Wed Dec 21 13:05:25 2011 +0100 + + cli: specify common options in a new group + + Actions on modems from specific interfaces, like 3GPP, will also + need the modem + to be specified. + + The new 'Common' option group will handle all options to specify + objects. + + cli/mmcli-bearer.c | 11 +++-------- + cli/mmcli-common.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli-common.h | 4 ++++ + cli/mmcli-modem.c | 13 +++++-------- + cli/mmcli.c | 3 +++ + 5 files changed, 59 insertions(+), 16 deletions(-) + +commit 265a516f42a0ff8d2b421aa199e54d779f0c153f +Author: Aleksander Morgado +Date: Wed Dec 21 12:27:14 2011 +0100 + + cli: add debug logs when parsing properties to create a bearer + + cli/mmcli-modem.c | 26 ++++++++++++++++---------- + 1 file changed, 16 insertions(+), 10 deletions(-) + +commit 9f960e986571ed4b17bc0fd3aa81bc2e82ecf5f2 +Author: Aleksander Morgado +Date: Wed Dec 21 11:19:00 2011 +0100 + + cli: print properties used when bearer was created + + cli/mmcli-bearer.c | 36 +++++++++++++++++++++++++++--------- + 1 file changed, 27 insertions(+), 9 deletions(-) + +commit 215b9c1a31e182cd34c792995e08b1ea56de5507 +Author: Aleksander Morgado +Date: Wed Dec 21 11:18:46 2011 +0100 + + libmm-glib: allow getting properties used when the bearer was created + + libmm-glib/mm-bearer.c | 175 + +++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-bearer.h | 24 +++++++ + 2 files changed, 199 insertions(+) + +commit a422f5619fbcc99dd1e14905ecad52583b168847 +Author: Aleksander Morgado +Date: Wed Dec 21 11:13:45 2011 +0100 + + libmm-glib: generic warning if IP config dictionary has unexpected + contents + + libmm-glib/mm-bearer.c | 44 +++++++++++++++----------------------------- + libmm-glib/mm-bearer.h | 8 ++------ + 2 files changed, 17 insertions(+), 35 deletions(-) + +commit dcfe2e53901a2417c822a9d3558ede5174e2e4bc +Author: Aleksander Morgado +Date: Wed Dec 21 10:30:27 2011 +0100 + + 3gpp: control 3GPP bearer creation in the 3GPP modem interface + + And implement bearer connection allowance based on roaming status. + + src/mm-bearer-3gpp.c | 57 -------------------- + src/mm-bearer-3gpp.h | 4 +- + src/mm-broadband-modem.c | 40 +++++++------- + src/mm-iface-modem-3gpp.c | 132 + ++++++++++++++++++++++++++++++++++++++-------- + src/mm-iface-modem-3gpp.h | 15 ++++++ + 5 files changed, 144 insertions(+), 104 deletions(-) + +commit 4c5244193278cbf3c0cd844152f6648c5cf598e0 +Author: Aleksander Morgado +Date: Wed Dec 21 10:29:40 2011 +0100 + + bearer-3gpp: provide getters for the properties + + src/mm-bearer-3gpp.c | 20 ++++++++++++++++++++ + src/mm-bearer-3gpp.h | 4 ++++ + 2 files changed, 24 insertions(+) + +commit 405f7c8660218d363bef10b7ae36b9374cd05b32 +Author: Aleksander Morgado +Date: Tue Dec 20 21:44:03 2011 +0100 + + cli: allow passing the new 'allow-roaming' in the bearer creation + string + + cli/mmcli-modem.c | 51 + ++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 36 insertions(+), 15 deletions(-) + +commit 6f98da93100d3635b173edb1802678be03775c9e +Author: Aleksander Morgado +Date: Tue Dec 20 21:43:22 2011 +0100 + + libmm-glib: handle new 'allow-roaming' property when creating bearers + + libmm-glib/mm-modem.c | 21 ++++++++++++++------- + libmm-glib/mm-modem.h | 11 ++++++----- + 2 files changed, 20 insertions(+), 12 deletions(-) + +commit e385b5b07972129488ad049224af807610cf3be7 +Author: Aleksander Morgado +Date: Tue Dec 20 21:42:39 2011 +0100 + + api,core: new 'allow-roaming' property to be set when creating + a bearer + + This new boolean property, applicable to 3GPP bearers, will specify + whether 3GPP + bearers are allowed to get connected when registered in a roaming + network. + + new/org.freedesktop.ModemManager1.Bearer.xml | 2 +- + new/org.freedesktop.ModemManager1.Modem.xml | 14 ++++--- + src/mm-bearer-3gpp.c | 59 + ++++++++++++++++++++++------ + src/mm-bearer-3gpp.h | 10 +++-- + src/mm-bearer.c | 19 ++++++--- + 5 files changed, 74 insertions(+), 30 deletions(-) + +commit fdd05ee977479206774627a38e57a002146787c6 +Author: Aleksander Morgado +Date: Tue Dec 20 19:14:46 2011 +0100 + + cli: on modem actions creating/listing bearers, just print bearer path + + cli/mmcli-modem.c | 78 + +++---------------------------------------------------- + 1 file changed, 4 insertions(+), 74 deletions(-) + +commit a7b414e8a9976c3030f8c0bf61be316c6230103c +Author: Aleksander Morgado +Date: Tue Dec 20 18:49:48 2011 +0100 + + cli: report access technologies in use by the modem + + cli/mmcli-modem.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +commit 52c5f6051bb12800194023afdb2a01109c035a8e +Author: Aleksander Morgado +Date: Tue Dec 20 18:49:23 2011 +0100 + + libmm-glib: new helper method to build a string with access + technologies + + libmm-glib/mm-modem.c | 14 ++++++++++++++ + libmm-glib/mm-modem.h | 1 + + 2 files changed, 15 insertions(+) + +commit 4495ba180e9d39ff8ae113387cc69eb3004b5612 +Author: Aleksander Morgado +Date: Tue Dec 20 18:48:54 2011 +0100 + + core: implement Access Technology reporting + + For 3GPP modems only for now.. + + libmm-common/mm-common-helpers.c | 39 + +++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 1 + + src/mm-broadband-modem.c | 11 +++++++---- + src/mm-iface-modem-3gpp.c | 26 ++++++++++++++++++++++++-- + src/mm-iface-modem-3gpp.h | 3 ++- + src/mm-iface-modem.c | 37 + +++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 5 +++++ + 7 files changed, 115 insertions(+), 7 deletions(-) + +commit 516b0973318fa9cc4e928e1d47f5a40105d382b6 +Author: Aleksander Morgado +Date: Tue Dec 20 18:43:43 2011 +0100 + + api,enums: renamed `MMModemAccessTech' to `MMModemAccessTechnology' + + This one was the last enum without full name. + + docs/reference/api/mm-sections.txt | 2 +- + include/ModemManager-enums.h | 70 ++++---- + libmm-glib/mm-modem.c | 8 +- + libmm-glib/mm-modem.h | 2 +- + ...g.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 4 +- + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 2 +- + new/org.freedesktop.ModemManager1.Modem.xml | 4 +- + src/mm-broadband-modem.c | 4 +- + src/mm-iface-modem-3gpp.c | 2 +- + src/mm-iface-modem.c | 2 +- + src/mm-modem-helpers.c | 30 ++-- + src/mm-modem-helpers.h | 4 +- + src/tests/test-modem-helpers.c | 198 + ++++++++++----------- + 13 files changed, 166 insertions(+), 166 deletions(-) + +commit b6a3ccd5781da0d2d2dbfa404a3c643ae9e8bf13 +Author: Aleksander Morgado +Date: Tue Dec 20 18:34:06 2011 +0100 + + modem-helpers: renamed 3GPP registration related helpers with + `mm_3gpp' prefix + + src/mm-base-modem.c | 4 ++-- + src/mm-broadband-modem.c | 40 + ++++++++++++++++++++-------------------- + src/mm-modem-helpers.c | 18 +++++++++--------- + src/mm-modem-helpers.h | 20 +++++++++----------- + src/tests/test-modem-helpers.c | 10 +++++----- + 5 files changed, 45 insertions(+), 47 deletions(-) + +commit e2e0812272828a1f374233522972f19ca247a2e2 +Author: Aleksander Morgado +Date: Tue Dec 20 18:32:02 2011 +0100 + + api,dbus: renamed `AccessTechnology' to `AccessTechnologies' + + We are reporting a bitmask of flags, not just one value. + + libmm-glib/mm-modem.c | 4 ++-- + libmm-glib/mm-modem.h | 2 +- + new/org.freedesktop.ModemManager1.Modem.xml | 10 +++++----- + src/mm-iface-modem.c | 2 +- + 4 files changed, 9 insertions(+), 9 deletions(-) + +commit ff60251733c9fb5001071c9834839c44a48ef066 +Author: Aleksander Morgado +Date: Tue Dec 20 18:29:42 2011 +0100 + + api,enums: let MMModemAccessTech be flags instead of enum + + We should be able to report more than one access technology used at + a given + time. + + include/ModemManager-enums.h | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit e86c8554cc60f8349cd121a3b5b46b0b800a8f04 +Author: Aleksander Morgado +Date: Tue Dec 20 16:05:40 2011 +0100 + + broadband-modem: bearer connection allowance handled in ifaces + + src/mm-broadband-modem.c | 14 -------------- + src/mm-iface-modem-3gpp.c | 1 + + 2 files changed, 1 insertion(+), 14 deletions(-) + +commit ddac446e86319156eb520da159d2a661047afd4e +Author: Aleksander Morgado +Date: Tue Dec 20 16:04:24 2011 +0100 + + iface-modem-3gpp: disable periodic registration checks + + src/mm-iface-modem-3gpp.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +commit 4b27149cf4170d92a5ae91d3f36107270695828c +Author: Aleksander Morgado +Date: Tue Dec 20 15:02:33 2011 +0100 + + iface-modem-3gpp: when disabling, disconnect all 3GPP bearers + + src/mm-iface-modem-3gpp.c | 134 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 134 insertions(+) + +commit 855824d7da3604e53723e6df428dc55f4f686564 +Author: Aleksander Morgado +Date: Tue Dec 20 15:02:16 2011 +0100 + + bearer: allow disconnection also with internal requests + + src/mm-bearer.c | 87 + ++++++++++++++++++++++++++++++++++++++++++++------------- + src/mm-bearer.h | 7 +++++ + 2 files changed, 75 insertions(+), 19 deletions(-) + +commit ee9cbbfcfb5b77d84f0c096317dc268226149a42 +Author: Aleksander Morgado +Date: Tue Dec 20 13:57:11 2011 +0100 + + bearer,bearer-3gpp: implement connection request cancellation + + We allow connection requests to get cancelled, either via DBus calls + or any + other method. + + src/mm-bearer-3gpp.c | 54 ++++++++++++ + src/mm-bearer.c | 228 + +++++++++++++++++++++++++++++++++++++++++++++------ + src/mm-bearer.h | 1 + + 3 files changed, 256 insertions(+), 27 deletions(-) + +commit 96defb4cd2ca24e8b76e63c1f74d14b3abcd6d3a +Author: Aleksander Morgado +Date: Tue Dec 20 13:55:54 2011 +0100 + + iface-modem-3gpp: if we get unregistered ensure we have disconnected + 3GPP bearers + + It is actually very likely that we get automatically the bearer + disconnected when + we get unregistered in the network, but anyway. + + src/mm-iface-modem-3gpp.c | 57 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 57 insertions(+) + +commit e71a9ef971119e342afffaa9867f6011f9e9ce5a +Author: Aleksander Morgado +Date: Tue Dec 20 10:45:54 2011 +0100 + + iface-modem: handle connection related states + + Moved from broadband-modem. All this logic is really common not + specific to the + generic implementation. + + src/mm-broadband-modem.c | 61 ---------------------------------------- + src/mm-iface-modem.c | 72 + ++++++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 70 insertions(+), 63 deletions(-) + +commit dd2006797565dce831d5e9fd891ac1bd75fa0a75 +Author: Aleksander Morgado +Date: Tue Dec 20 10:34:36 2011 +0100 + + iface-modem: while connected, ignore registration state changes + + src/mm-iface-modem-3gpp.c | 4 ---- + src/mm-iface-modem.c | 33 ++++++++++++++++++++++++++++++++- + 2 files changed, 32 insertions(+), 5 deletions(-) + +commit 534aeb0c8ac83126048353b8f30128cd6f1cd92a +Author: Aleksander Morgado +Date: Mon Dec 19 20:40:54 2011 +0100 + + cli: always keep a MMManager around + + In order to receive signals in the GDBusObjects retrieved from the + GDBusObjectManagerClient, we need to keep a reference of the client + around. + + cli/mmcli-bearer.c | 15 +++++- + cli/mmcli-common.c | 146 + ++++++++++++++++++++++++++++++++++++++--------------- + cli/mmcli-common.h | 14 +++-- + cli/mmcli-modem.c | 11 ++-- + 4 files changed, 134 insertions(+), 52 deletions(-) + +commit cd6caf61061e18736ecf0ddd4834c1ad1fbcb7c2 +Author: Aleksander Morgado +Date: Mon Dec 19 19:05:18 2011 +0100 + + broadband-modem: handle connection related states in the modem + + As a modem can have more than one bearer, the mapping between the + bearer state + and the modem state is not direct. + + src/mm-broadband-modem.c | 61 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +commit 9962f5cbde7e16a93897846a209d990b362b6942 +Author: Aleksander Morgado +Date: Mon Dec 19 18:42:49 2011 +0100 + + bearer: new `bearer-state' property + + .gitignore | 2 ++ + src/Makefile.am | 18 ++++++++++++++++++ + src/mm-bearer.c | 56 + ++++++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-bearer.h | 10 ++++++++++ + 4 files changed, 82 insertions(+), 4 deletions(-) + +commit cadc27ca0ee20fd312a73751a298c4227e753036 +Author: Aleksander Morgado +Date: Mon Dec 19 18:20:12 2011 +0100 + + core,libmm-glib: include ony `libmm-common.h' + + Don't include one by one all the headers from libmm-common, just + include the + global `libmm-common.h' which includes all the others. + + libmm-glib/libmm-glib.h | 7 +++++-- + src/mm-bearer-3gpp.c | 4 +--- + src/mm-bearer-list.c | 4 +--- + src/mm-bearer.c | 5 +---- + src/mm-broadband-modem.c | 4 +--- + src/mm-iface-modem-3gpp.c | 5 +---- + src/mm-iface-modem.c | 6 +----- + src/mm-modem-helpers.c | 3 +-- + src/mm-sim.c | 6 +----- + 9 files changed, 13 insertions(+), 31 deletions(-) + +commit 60819197441e191c662f93da2691c4cb1a13385e +Author: Aleksander Morgado +Date: Mon Dec 19 18:08:24 2011 +0100 + + libmm-common: make it installable + + We'll install libmm-common and its headers, which will be used + by libmm-glib + and the ModemManager daemon. + + cli/Makefile.am | 1 + + configure.ac | 6 +++++- + libmm-common/Makefile.am | 21 ++++++++++++++++++--- + libmm-common/libmm-common.h | 34 ++++++++++++++++++++++++++++++++++ + 4 files changed, 58 insertions(+), 4 deletions(-) + +commit d22def9309d4051ebd82b76f6704f65ad39d98b5 +Author: Aleksander Morgado +Date: Mon Dec 19 17:24:33 2011 +0100 + + build: let enum and error templates be completely generic + + Don't include anything in the templates specific to the file to be + built, like + #ifdef guards in headers or #include in sources. + + build-aux/Makefile.am | 8 ++++---- + ...-enums-types.c.template => mm-enums-template.c} | 2 -- + ...-enums-types.h.template => mm-enums-template.h} | 3 --- + ...rrors-types.c.template => mm-errors-template.c} | 3 --- + ...rrors-types.h.template => mm-errors-template.h} | 6 +----- + libmm-common/Makefile.am | 22 + ++++++++++++++-------- + 6 files changed, 19 insertions(+), 25 deletions(-) + +commit 4b8b99ee96f16e3f2d623cb896a4d1bf7f12820f +Author: Aleksander Morgado +Date: Mon Dec 19 16:25:31 2011 +0100 + + bearer-3gpp: set ip method when connecting the bearer + + Currently, assume PPP when we have an AT data port, and DHCP + otherwise. + + src/mm-bearer-3gpp.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 85b14b0008f217c3124e381c998fcf7ead6d999b +Author: Aleksander Morgado +Date: Mon Dec 19 14:57:44 2011 +0100 + + cli: new Bearer related options + + cli/Makefile.am | 6 +- + cli/mmcli-bearer.c | 353 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 11 ++ + cli/mmcli.h | 8 ++ + 4 files changed, 374 insertions(+), 4 deletions(-) + +commit 9e1b2105fb9b7454774a0414fa3f5958d79e8211 +Author: Aleksander Morgado +Date: Mon Dec 19 14:05:59 2011 +0100 + + cli: default to showing modem info if no action specified + + cli/mmcli-modem.c | 17 +++++++++-------- + cli/mmcli.c | 5 ++++- + 2 files changed, 13 insertions(+), 9 deletions(-) + +commit c2e4d9cea709d8175e475359a2a611d3b3dcf0e4 +Author: Aleksander Morgado +Date: Mon Dec 19 13:03:48 2011 +0100 + + cli: new helper to look for specific MMBearer objects + + cli/mmcli-common.c | 196 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli-common.h | 9 +++ + 2 files changed, 205 insertions(+) + +commit 803bc339cf5698040c5db76886398febc6e624e7 +Author: Aleksander Morgado +Date: Mon Dec 19 12:29:40 2011 +0100 + + cli: implement bearer creating and listing based on the new MMBearer + + cli/mmcli-modem.c | 126 + +++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 102 insertions(+), 24 deletions(-) + +commit 0dec4b447e40031b415151c7fe41a6b5e2e0099c +Author: Aleksander Morgado +Date: Mon Dec 19 12:29:12 2011 +0100 + + cli: don't unref cancellable if already done + + cli/mmcli.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 55654d5b462f59ec5d6d77de759a1b7012f3d5c6 +Author: Aleksander Morgado +Date: Mon Dec 19 12:28:49 2011 +0100 + + cli: new helper to get name of MMBearerIpMethod + + cli/mmcli-common.c | 13 +++++++++++++ + cli/mmcli-common.h | 7 ++++--- + 2 files changed, 17 insertions(+), 3 deletions(-) + +commit dae3f9570422fd14f630fa1c060bc26e0f27481c +Author: Aleksander Morgado +Date: Mon Dec 19 11:59:16 2011 +0100 + + libmm-glib: get a list of MMBearer objects when listing bearers in + the MMModem + + libmm-glib/mm-modem.c | 222 + ++++++++++++++++++++++++++++++++++++++++---------- + libmm-glib/mm-modem.h | 4 +- + 2 files changed, 181 insertions(+), 45 deletions(-) + +commit c6d7fb893afa1ff10cc732105618070ad38bb488 +Author: Aleksander Morgado +Date: Mon Dec 19 10:06:27 2011 +0100 + + libmm-glib: get the MMBearer object when creating it in the MMModem + + libmm-glib/mm-modem.c | 166 + +++++++++++++++++++++++++++++++++++++------------- + libmm-glib/mm-modem.h | 29 ++++----- + 2 files changed, 139 insertions(+), 56 deletions(-) + +commit dad4bb3493d0eca6bc629a350d772bdbb4ef0837 +Author: Aleksander Morgado +Date: Mon Dec 19 10:05:32 2011 +0100 + + libmm-glib: new MMBearer object + + libmm-glib/Makefile.am | 4 +- + libmm-glib/mm-bearer.c | 545 + +++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-bearer.h | 96 +++++++++ + 3 files changed, 644 insertions(+), 1 deletion(-) + +commit b7960f82acce3093d47f1330a00405be9c25443b +Author: Aleksander Morgado +Date: Thu Dec 15 22:10:21 2011 +0100 + + manager: don't try to export already exported modems + + src/mm-manager.c | 42 ++++++++++++++++++++++++++---------------- + 1 file changed, 26 insertions(+), 16 deletions(-) + +commit 7e99d9415bafa0cfba8f9260354c9b3b5ae31b14 +Author: Aleksander Morgado +Date: Thu Dec 15 21:28:33 2011 +0100 + + broadband-modem: allow 3GPP bearer connection if registered in + 3GPP network + + src/mm-broadband-modem.c | 53 + ++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 42 insertions(+), 11 deletions(-) + +commit 770ea5310987f89154b7cf14eed900bcecd0ca28 +Author: Aleksander Morgado +Date: Thu Dec 15 21:28:09 2011 +0100 + + bearer: fail connecting try if not allowed to connect + + src/mm-bearer.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 3d1d4c42e5a2774251a88f8a01bfe5a964f0824f +Author: Aleksander Morgado +Date: Thu Dec 15 21:27:36 2011 +0100 + + bearer-list: allow iterating over the bearers in the list + + src/mm-bearer-list.c | 10 ++++++++++ + src/mm-bearer-list.h | 6 ++++++ + 2 files changed, 16 insertions(+) + +commit 00b2e2d2dd72e920fae5b1d6f12a4158a775d604 +Author: Aleksander Morgado +Date: Thu Dec 15 20:41:49 2011 +0100 + + bearer: new property to define whether the bearer is allowed to + connect + + Modems will allow bearers to get connected once they are registered + in the + network. + + src/mm-bearer.c | 32 +++++++++++++++++++++++++++++++- + src/mm-bearer.h | 10 +++++++--- + 2 files changed, 38 insertions(+), 4 deletions(-) + +commit 48f0061355780dfb6ebc61c0df94abd338872846 +Author: Aleksander Morgado +Date: Thu Dec 15 20:25:48 2011 +0100 + + bearer-3gpp: implement 3GPP-specific bearer + + Implement basic functionality of a 3GPP based bearer, including + connnection and + disconnection. + + src/Makefile.am | 2 + + src/mm-bearer-3gpp.c | 869 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-bearer-3gpp.h | 63 ++++ + src/mm-bearer.c | 305 +++++------------ + src/mm-bearer.h | 35 +- + src/mm-broadband-modem.c | 12 +- + 6 files changed, 1041 insertions(+), 245 deletions(-) + +commit c855e5be2da80bdb3b6226073d8782a7154945fa +Author: Aleksander Morgado +Date: Thu Dec 15 20:24:19 2011 +0100 + + iface-modem: minor fix, remove unneeded variables in the + initialization context + + src/mm-iface-modem.c | 2 -- + 1 file changed, 2 deletions(-) + +commit c133c3284d03afb537c6467fc322d8174eb91fb4 +Author: Aleksander Morgado +Date: Thu Dec 15 20:23:35 2011 +0100 + + base-modem: allow retrieving non-connected data ports + + Bearers will ask for data ports that can be used for + connections. Right now, + only one data port is expected to be handled, but we don't impose any + restriction in the API. + + src/mm-base-modem.c | 16 +++++++++++++--- + src/mm-base-modem.h | 1 + + 2 files changed, 14 insertions(+), 3 deletions(-) + +commit 88077cbbe83a8d6beaed92a3277cab3ba0e429d3 +Author: Aleksander Morgado +Date: Thu Dec 15 20:21:57 2011 +0100 + + iface-modem: treat several SIM related errors as fatal + + If the SIM is not inserted or the modem reports SIM failures, just + abort the + initialization process. We don't want to export modems which cannot + be used. + + I know at least of one modem (wavecom) which supports SIM insertion + while + connected, but being such a corner case, probably not worth + supporting it. + + src/mm-iface-modem.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +commit 5f4655c57415e5fe28581fbe6e29f334d1517c17 +Author: Aleksander Morgado +Date: Thu Dec 15 19:57:18 2011 +0100 + + helpers: implement CGDCONT reply parsing + + New method to parse the PDP query reply, and build a list of structs + with the + found info. + + src/mm-modem-helpers.c | 77 + ++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 12 ++++++- + src/tests/test-modem-helpers.c | 53 +++++++++++++++++++++++++++++ + 3 files changed, 141 insertions(+), 1 deletion(-) + +commit d7f4a5e134d5bb2e02d29e1b9cfbed1bf9261d39 +Author: Aleksander Morgado +Date: Mon Dec 12 20:38:17 2011 +0100 + + bearer: populate Properties used when creating the Bearer + + src/mm-bearer.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 473f45cc99c0475c13de095dec1ca282ced02a11 +Author: Aleksander Morgado +Date: Mon Dec 12 20:37:40 2011 +0100 + + api: expose in the Bearer the dict of properties used when creating it + + new/org.freedesktop.ModemManager1.Bearer.xml | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 776cc66e2c8cd366a9179d66cd193a1ea09a76ea +Author: Aleksander Morgado +Date: Mon Dec 12 20:22:51 2011 +0100 + + iface-modem: implement all bearer list operations in the interface + + Bearer list operations, except for Bearer creation, are so generic + that the + interface itself can implement it for every object implementing + the interface. + This implementation is based on a new MMBearerList object. + + src/Makefile.am | 2 + + src/mm-bearer-list.c | 264 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-bearer-list.h | 68 ++++++++++++ + src/mm-broadband-modem.c | 148 ++++---------------------- + src/mm-iface-modem.c | 218 +++++++++++++++++++------------------- + src/mm-iface-modem.h | 42 +------- + 6 files changed, 468 insertions(+), 274 deletions(-) + +commit 0793522d287ffd8d37886d927645743d0fec77a0 +Author: Aleksander Morgado +Date: Mon Dec 12 20:18:05 2011 +0100 + + errors: new TOO_MANY and NOT_FOUND core errors + + include/ModemManager-errors.h | 4 ++++ + libmm-common/mm-errors-quarks.c | 2 ++ + 2 files changed, 6 insertions(+) + +commit 667e3edfbd62d4b2f9ceb90eaaf38571441eaf36 +Author: Aleksander Morgado +Date: Mon Dec 12 17:54:14 2011 +0100 + + bearer: ensure only valid bearers are exported + + We setup bearer export in DBus only if the input properties are + the expected + ones. + + src/mm-bearer.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit e00d3127d5589dd1ae72e87f4330ce7502ea0921 +Author: Aleksander Morgado +Date: Sun Dec 11 19:48:29 2011 +0100 + + cli: implement bearer creation, deletion and listing + + cli/mmcli-modem.c | 281 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 281 insertions(+) + +commit 6a07753ba0647336503b129980054597db5958f2 +Author: Aleksander Morgado +Date: Sun Dec 11 19:48:08 2011 +0100 + + libmm-glib: handle bearer creation, deletion and listing + + libmm-glib/mm-modem.c | 235 + ++++++++++++++++++++++++++++++++++++++++++++------ + libmm-glib/mm-modem.h | 33 +++++-- + 2 files changed, 235 insertions(+), 33 deletions(-) + +commit 82693cf523456058f03a06d6e9e449e1df7caac2 +Author: Aleksander Morgado +Date: Fri Dec 9 19:10:08 2011 +0100 + + cli: enable printing modem info + + cli/mmcli-common.c | 13 +++ + cli/mmcli-common.h | 1 + + cli/mmcli-modem.c | 329 + +++++++++++++++++++++++------------------------------ + 3 files changed, 156 insertions(+), 187 deletions(-) + +commit 46248460156fd8d558372df3c1a06f9d06aad15e +Author: Aleksander Morgado +Date: Fri Dec 9 18:54:13 2011 +0100 + + libmm-glib: return NULL instead of empty strings + + libmm-glib/Makefile.am | 1 + + libmm-glib/mm-helpers.h | 45 +++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem-3gpp.c | 25 +++++++++++++------- + libmm-glib/mm-modem.c | 59 + ++++++++++++++++++++++++++++++---------------- + libmm-glib/mm-sim.c | 25 +++++++++++++------- + 5 files changed, 118 insertions(+), 37 deletions(-) + +commit 62469445101babdff53d238e602d7e988dbaa0cb +Author: Aleksander Morgado +Date: Fri Dec 9 17:58:20 2011 +0100 + + cli: allow option groups to force async/sync operations + + Some operations are clearly asynchronous (e.g. monitoring modem + state), while + others are clearly synchronous (e.g. printing modem info). So just + allow option + groups to force the operation to be async or sync based on the + detected action. + + cli/mmcli-manager.c | 3 +++ + cli/mmcli-modem.c | 24 ++++++++++-------------- + cli/mmcli.c | 35 ++++++++++++++++++++++++----------- + cli/mmcli.h | 4 +++- + 4 files changed, 40 insertions(+), 26 deletions(-) + +commit ec8da67921c648dbe2e3b82c2392f7196229c914 +Author: Aleksander Morgado +Date: Fri Dec 9 17:27:56 2011 +0100 + + libmm-glib: new API method to build a string of capabilities from + a bitmask + + libmm-glib/mm-modem.c | 16 ++++++++++++++++ + libmm-glib/mm-modem.h | 4 +++- + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 4d594c50e8d9e286300e048b700c86b9a49c590b +Author: Aleksander Morgado +Date: Fri Dec 9 17:27:21 2011 +0100 + + libmm-common: capabilities string builder moved from core + + Keep in libmm-common the capabilities string builder. + + libmm-common/Makefile.am | 4 +++- + libmm-common/mm-common-helpers.c | 50 + ++++++++++++++++++++++++++++++++++++++++ + libmm-common/mm-common-helpers.h | 24 +++++++++++++++++++ + src/mm-broadband-modem.c | 34 ++------------------------- + 4 files changed, 79 insertions(+), 33 deletions(-) + +commit 038448312169d72a9e72b266998f52314d291694 +Author: Aleksander Morgado +Date: Fri Dec 9 16:45:34 2011 +0100 + + nokia: start porting the Nokia plugin to the new codebase + + plugins/Makefile.am | 23 ++-- + plugins/mm-broadband-modem-nokia.c | 135 +++++++++++++++++++++ + plugins/mm-broadband-modem-nokia.h | 49 ++++++++ + plugins/mm-plugin-nokia.c | 237 + ++++++++++++++----------------------- + 4 files changed, 288 insertions(+), 156 deletions(-) + +commit 88cc35b850de43ce5068495324f163e7326f642a +Author: Aleksander Morgado +Date: Fri Dec 9 16:44:58 2011 +0100 + + cinterion: ignore non-AT ports + + plugins/mm-plugin-cinterion.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +commit 68b0ac6e197649900e05ee53467699de12ba4809 +Author: Aleksander Morgado +Date: Fri Dec 9 16:44:19 2011 +0100 + + broadband-modem: by default only send init command once + + Will handle sending it twice only for Nokia phones. + + src/mm-broadband-modem.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +commit c15181ae37a7ef9a4ae6e95c3bc3372b1a9d740b +Author: Aleksander Morgado +Date: Fri Dec 9 16:43:42 2011 +0100 + + port-probe: always complete probing task in idle + + src/mm-port-probe.c | 26 ++++++-------------------- + 1 file changed, 6 insertions(+), 20 deletions(-) + +commit ed83d540873a8818fe4b28a859740eb1665e40cf +Author: Aleksander Morgado +Date: Fri Dec 9 16:43:25 2011 +0100 + + port-probe: plug small leak when reporting error in AT command + response + + src/mm-port-probe.c | 1 + + 1 file changed, 1 insertion(+) + +commit 6a3e91ee836cb5145485468e0f0f281a08742c84 +Author: Aleksander Morgado +Date: Fri Dec 9 15:45:26 2011 +0100 + + cli: use the new libmm-glib API fixes + + cli/mmcli-common.c | 48 +++++++++++++++++----- + cli/mmcli-common.h | 19 +++++---- + cli/mmcli-manager.c | 14 +++---- + cli/mmcli-modem.c | 114 + +++++++++++++++------------------------------------- + 4 files changed, 90 insertions(+), 105 deletions(-) + +commit 7acacbbfd76bb59f0e0b370b66cb283ddeb5bbd4 +Author: Aleksander Morgado +Date: Fri Dec 9 15:44:56 2011 +0100 + + libmm-glib: simplify handling of interfaces + + Avoid trying to merge all interfaces into the same set of APIs, + and keep having + a specific object (proxy) for each interface handled by the + GDBusObjects + reported listed by the GDBusObjectManager. + + libmm-glib/Makefile.am | 4 + + libmm-glib/libmm-glib.h | 6 +- + libmm-glib/mm-modem-3gpp.c | 302 ++++++++++++++++++ + libmm-glib/mm-modem-3gpp.h | 77 +++++ + libmm-glib/mm-modem.c | 768 + ++++++++++++++++++++------------------------- + libmm-glib/mm-modem.h | 12 +- + libmm-glib/mm-object.c | 129 ++++++++ + libmm-glib/mm-object.h | 50 +++ + 8 files changed, 916 insertions(+), 432 deletions(-) + +commit 838f38ec8c9561dcb5305617d665bc11258af953 +Author: Aleksander Morgado +Date: Fri Dec 9 15:42:57 2011 +0100 + + api: minor fixes in `OperatorCode' and `OperatorName' documentation + + new/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 92cb17be4d05e85dc375801a578fa517c0b00b61 +Author: Aleksander Morgado +Date: Fri Dec 2 20:44:57 2011 +0100 + + cli: fix sync operations, initialize context + + cli/mmcli-modem.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 77ff2758b3c377f326e49f92abf959a5be33a55d +Author: Aleksander Morgado +Date: Fri Dec 2 20:44:36 2011 +0100 + + cli: logging improvements + + cli/mmcli-common.c | 4 ++-- + cli/mmcli-manager.c | 29 +++++++++++++++++++---------- + cli/mmcli-modem.c | 8 ++++++++ + 3 files changed, 29 insertions(+), 12 deletions(-) + +commit 95675e3e54ffcd06d5c6b0c7cf5ca7b9b5cc9fc0 +Author: Aleksander Morgado +Date: Fri Dec 2 20:41:39 2011 +0100 + + libmm-glib: fix macro implementing async ready callbacks + + libmm-glib/mm-modem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 85a542b5c86ea06b01c629995f23dd1e32f2a0e0 +Author: Aleksander Morgado +Date: Fri Dec 2 20:11:04 2011 +0100 + + cli: new `--verbose' to dump debug logging + + cli/mmcli.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 46 insertions(+), 1 deletion(-) + +commit e1cba4a53365753aa1ecadd06b369b2a43765037 +Author: Aleksander Morgado +Date: Fri Dec 2 12:25:53 2011 +0100 + + broadband-modem: implement bearer creation, deletion and listing + + Currently do not limit the number of bearers that can be created. + + src/mm-broadband-modem.c | 183 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 183 insertions(+) + +commit 4f4bb6b54bfd8c0f1f1bed60127fe5d4d5c9af69 +Author: Aleksander Morgado +Date: Fri Dec 2 12:25:11 2011 +0100 + + bearer: fix object export/unexport + + src/mm-bearer.c | 28 ++++++++++++++++++++++------ + src/mm-bearer.h | 6 +++++- + 2 files changed, 27 insertions(+), 7 deletions(-) + +commit a7acdcd071df69cbeecb9afa122c6b1b3aa1ae9f +Author: Aleksander Morgado +Date: Fri Dec 2 12:09:33 2011 +0100 + + sim: only unexport object if currently exported + + Avoid trying to unexport the object if it was never exported before. + + src/mm-sim.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 7030bbc5866fc800c6a99ff921c42f81c805f759 +Author: Aleksander Morgado +Date: Fri Dec 2 12:01:08 2011 +0100 + + iface-modem-3gpp: bind connection property right away + + src/mm-iface-modem-3gpp.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 8725fe5346b062f85ad97dd1af617641dab0b656 +Author: Aleksander Morgado +Date: Fri Dec 2 12:00:57 2011 +0100 + + iface-modem: bind connection property right away + + src/mm-iface-modem.c | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +commit ad1c7d8dec96e7a666db22e93abd1dff052111a3 +Author: Aleksander Morgado +Date: Fri Dec 2 12:00:41 2011 +0100 + + sim: bind connection property right away + + src/mm-sim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b435012eb123273814e0aa61851844e749eb7a12 +Author: Aleksander Morgado +Date: Fri Dec 2 11:47:24 2011 +0100 + + sim: make sure we unexport the SIM object when destroying it + + Usually, if not always, the connection stored in the SIM object + never exists + when disposing it, as we clear the connection property in the + Modem object + before destroying it, and both properties are bound. But just in case, + in order + to avoid ending up with a zombie object in DBus, we make sure we + unexport it. + + src/mm-sim.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit a2f0814fc54d1e71351463754b9125fcc30b9bdb +Author: Aleksander Morgado +Date: Fri Dec 2 09:56:55 2011 +0100 + + bearer: keep properties given as input, and avoid async creation + + No need to create this object asynchronously. + + src/mm-bearer.c | 272 + +++++++++++++++++++++++++++++++++++++++++++------------- + src/mm-bearer.h | 19 ++-- + 2 files changed, 224 insertions(+), 67 deletions(-) + +commit 3dcdc3c9207f5c08fd1d2265de023d3ec0c55cf9 +Author: Aleksander Morgado +Date: Fri Dec 2 09:55:39 2011 +0100 + + modem-helpers: new helper to count number of bits set in a bitmask + + src/mm-modem-helpers.c | 10 ++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 12 insertions(+) + +commit a181b152a1f50ea8f6ab6a85b6edc1c3ab4c3292 +Author: Aleksander Morgado +Date: Fri Dec 2 09:55:04 2011 +0100 + + api: when creating new bearer, use dict of strings + + Changed the signature of the 'properties' input argument in the + CreateBearer() + DBus call from a{sv} to a{ss}. We'll only expect string values. + + new/org.freedesktop.ModemManager1.Modem.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 36fae5564b68e06368ece484911da0b85632e327 +Author: Aleksander Morgado +Date: Fri Dec 2 08:21:42 2011 +0100 + + bearer: new object to handle bearers, implements the Bearer DBus + interface + + src/Makefile.am | 2 + + src/mm-bearer.c | 327 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-bearer.h | 61 +++++++++++ + 3 files changed, 390 insertions(+) + +commit 3164f5512d1af3c04465b5f2159728a64544f6d6 +Author: Aleksander Morgado +Date: Fri Dec 2 08:05:03 2011 +0100 + + sim: plug memleak, free path on finalize() + + src/mm-sim.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 71bf6b0048538912fd88d2b19b05cc09f70a23b2 +Author: Aleksander Morgado +Date: Thu Dec 1 21:23:45 2011 +0100 + + cinterion: start porting features from the old implementation + + Currently ported: + * Power Down + * Flow control + * After power up setup: + ** Available functionality status + ** Supported networks + + plugins/mm-broadband-modem-cinterion.c | 230 + ++++++++++++++++++++++++++++++++- + 1 file changed, 226 insertions(+), 4 deletions(-) + +commit c345f5fe6361f7659c93c31502fbcbced32c99a9 +Author: Aleksander Morgado +Date: Thu Dec 1 20:20:26 2011 +0100 + + cinterion: re-enabled Cinterion plugin + + Just dummy plugin for now. + + plugins/Makefile.am | 36 +++--- + plugins/mm-broadband-modem-cinterion.c | 83 +++++++++++++ + plugins/mm-broadband-modem-cinterion.h | 51 ++++++++ + plugins/mm-plugin-cinterion.c | 218 + ++++++++------------------------- + plugins/mm-plugin-cinterion.h | 1 - + 5 files changed, 206 insertions(+), 183 deletions(-) + +commit 0c64e08f853ad01cd4e459c4f57e9d8469b20286 +Author: Aleksander Morgado +Date: Thu Dec 1 19:41:18 2011 +0100 + + error-helpers: small refactor + + src/mm-error-helpers.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +commit fb90f205d1345a9dd3f9a3007a534f043a32952d +Author: Aleksander Morgado +Date: Thu Dec 1 19:40:07 2011 +0100 + + core: port to use the new AT command/sequences in the MMBaseModem API + + src/Makefile.am | 2 - + src/mm-at.c | 258 ---------- + src/mm-at.h | 90 ---- + src/mm-broadband-modem.c | 1273 + +++++++++++++++++++--------------------------- + src/mm-iface-modem.c | 2 +- + src/mm-sim.c | 537 +++++++++---------- + 6 files changed, 762 insertions(+), 1400 deletions(-) + +commit 52db9b9035f1a39b3d38a6df8c5aea996b653c42 +Author: Aleksander Morgado +Date: Thu Dec 1 13:11:56 2011 +0100 + + base-modem-at: refactor AT sequence/command handling + + Make a tight connection between the action of sending AT commands, + either single + or in a sequence, with the MMBaseModem object owning the port. This + direct + relation allows sending commands without specifying which port to use, + so that + the modem object can get the best port at each time, and handling + all that in a + single common place. + + The original mm-at API has also been modified so that when a single + command is + sent, a constant string is returned. We are allowed to return + constant strings + in mm_base_modem_at_command_finish() because the string itself is + owned by the + GSimpleAsyncResult, and hence, alive enough time. The + GSimpleAsyncResult is + completely disposed only after the async call is fully completed. + + Same reasoning behind the GVariant returned in the AT sequences; + it should not + be owned by the caller, it's a transfer-none in introspection terms. + + src/Makefile.am | 2 + + src/mm-base-modem-at.c | 561 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-modem-at.h | 152 ++++++++++++++ + 3 files changed, 715 insertions(+) + +commit 7b12da9169cca545af1d8295859160551ad13d7f +Author: Aleksander Morgado +Date: Thu Dec 1 13:13:19 2011 +0100 + + errors: new MM_CORE_ERROR_CONNECTED error + + To be returned when we try to send an AT command to a modem, but + there is no + usable AT port available, as the primary port is connected (hence + the name) + and there is no secondary port. + + include/ModemManager-errors.h | 2 ++ + libmm-common/mm-errors-quarks.c | 1 + + 2 files changed, 3 insertions(+) + +commit 2be2288754e3852f4b437d7aa6f43c43d6464c74 +Author: Aleksander Morgado +Date: Wed Nov 30 18:22:22 2011 +0100 + + iface-modem: handle CreateBearer(), DeleteBearer() and ListBearers() + + Just pass the task to the specific underlying implementation. + + src/mm-iface-modem.c | 98 + ++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-iface-modem.h | 27 +++++++++++++++ + 2 files changed, 119 insertions(+), 6 deletions(-) + +commit 6549c23db885f3b3003955f604734af34e2cc87b +Author: Aleksander Morgado +Date: Wed Nov 30 16:44:14 2011 +0100 + + broadband-modem: implement cleaning up CS and PS registrations + + src/mm-broadband-modem.c | 122 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +commit 1e026fe98619749112958d5ac5b7b243ef6aee7a +Author: Aleksander Morgado +Date: Wed Nov 30 16:28:44 2011 +0100 + + iface-modem-3gpp: cleanup CS and PS registrations during disable + + src/mm-iface-modem-3gpp.c | 30 ++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 16 ++++++++++++++++ + 2 files changed, 46 insertions(+) + +commit e3117333d91bcaa213308de8b655b4980cfaa362 +Author: Aleksander Morgado +Date: Wed Nov 30 16:07:36 2011 +0100 + + broadband-modem: implement cleaning up unsolicited registration + message handlers + + src/mm-broadband-modem.c | 59 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 59 insertions(+) + +commit 029902312da0e0593111f71093fe63bf084c1a02 +Author: Aleksander Morgado +Date: Wed Nov 30 16:02:25 2011 +0100 + + iface-modem-3gpp: cleanup unsolicited registration messages during + disable + + src/mm-iface-modem-3gpp.c | 36 ++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 ++++++++ + 2 files changed, 44 insertions(+) + +commit 289057bf92406d40342574eb5a88f2af9796d1aa +Author: Aleksander Morgado +Date: Wed Nov 30 15:57:22 2011 +0100 + + iface-modem: don't flash port during disable + + At least just for now. Flashing should be done as part of the + disconnection. + + src/mm-iface-modem.c | 56 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 28 insertions(+), 28 deletions(-) + +commit a170c0841d260c368a13f20f2e6c82a5adbdeaff +Author: Aleksander Morgado +Date: Wed Nov 30 15:39:12 2011 +0100 + + broadband-modem: setup steps when disabling the modem + + Include disabling the Modem and 3GPP interfaces for now. + + src/mm-broadband-modem.c | 151 + +++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 127 insertions(+), 24 deletions(-) + +commit c867da54b1312b59318d510ee9c9d2d61b5af23a +Author: Aleksander Morgado +Date: Wed Nov 30 15:10:53 2011 +0100 + + iface-modem-3gpp: interface can be disabled + + src/mm-iface-modem-3gpp.c | 88 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 +++++ + 2 files changed, 96 insertions(+) + +commit 8459eba214f83efa6dc795b748fe5fa1a9e93c66 +Author: Aleksander Morgado +Date: Wed Nov 30 14:29:16 2011 +0100 + + iface-modem-3gpp: enable periodic registration checks if no + unsolicited + + If we get errors when configuring the unsolicited registration + messages, setup a + timeout to be run every 30s which will check our registration status. + + src/mm-iface-modem-3gpp.c | 114 + +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 112 insertions(+), 2 deletions(-) + +commit 3c3a2b811a3be982ec0f9893d7edc5cb31e70454 +Author: Aleksander Morgado +Date: Wed Nov 30 13:29:58 2011 +0100 + + broadband-modem: implement network scan + + src/mm-broadband-modem.c | 45 + ++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 44 insertions(+), 1 deletion(-) + +commit 8ecb80b553d8b60ceeaa78af92a7163e9db8f10a +Author: Aleksander Morgado +Date: Wed Nov 30 13:29:32 2011 +0100 + + iface-modem-3gpp: handle network scan requests + + src/mm-iface-modem-3gpp.c | 124 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-3gpp.h | 8 +++ + 2 files changed, 131 insertions(+), 1 deletion(-) + +commit a92e9c59c1c2a4b2078e02d631b04eced68320be +Author: Aleksander Morgado +Date: Wed Nov 30 13:29:00 2011 +0100 + + modem-helpers: provide list of scanned networks in a list of structs + + We provide the result of the +COPS=? parsing in a GList of + MM3gppNetworkInfo + structures. We avoid the previous hash table, or using a dictionary, + as a + list of structs with a predefined set of elements, which should be + easier for + plugins wanting to make their own version + + src/mm-modem-helpers.c | 175 ++++++++++++------- + src/mm-modem-helpers.h | 22 ++- + src/tests/test-modem-helpers.c | 376 + +++++++++++++++++++---------------------- + 3 files changed, 307 insertions(+), 266 deletions(-) + +commit a265798e0d4cf016417c85b7b8cfd288a493148f +Author: Aleksander Morgado +Date: Wed Nov 30 13:21:13 2011 +0100 + + api: rename key in dictionary returned by Scan() + + We'll keep on using 'code' to refer to the Operator MCC/MNC. + + new/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0c7281b2d91a042a810bce4596ce5b061b643926 +Author: Aleksander Morgado +Date: Wed Nov 30 09:16:25 2011 +0100 + + broadband-modem: implement Operator Code and Name loading + + src/mm-broadband-modem.c | 105 + ++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-helpers.c | 75 +++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 3 ++ + 3 files changed, 182 insertions(+), 1 deletion(-) + +commit ad0a18d10755a53a45245845e0c7b230b10aeab1 +Author: Aleksander Morgado +Date: Wed Nov 30 08:51:27 2011 +0100 + + iface-modem-3gpp: when going into REGISTERED, load Operator Name + and Code + + src/mm-iface-modem-3gpp.c | 51 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 16 +++++++++++++++ + 2 files changed, 67 insertions(+) + +commit 3b2b0645bec963b2955c578eccfbc38bbd34672b +Author: Aleksander Morgado +Date: Wed Nov 30 08:24:13 2011 +0100 + + iface-modem-3gpp: report registration state change in the log + + src/mm-iface-modem-3gpp.c | 78 + ++++++++++++++++++++++++++++------------------- + 1 file changed, 47 insertions(+), 31 deletions(-) + +commit 12ea55286d53a9349491e483573bb2c123a4293d +Author: Aleksander Morgado +Date: Tue Nov 29 20:46:39 2011 +0100 + + broadband-modem: implement registration to 3GPP network + + src/mm-broadband-modem.c | 265 + +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 257 insertions(+), 8 deletions(-) + +commit 7ea0c4905df0c5b8108bd51d37a11af83c27c563 +Author: Aleksander Morgado +Date: Tue Nov 29 20:45:44 2011 +0100 + + iface-modem-3gpp: always run CS and PS registration checks together + + And report a single error, only if all available registration + checks failed. + + src/mm-iface-modem-3gpp.c | 159 + ++++++++++++++++++++++++++++++++++++++-------- + src/mm-iface-modem-3gpp.h | 8 +++ + 2 files changed, 140 insertions(+), 27 deletions(-) + +commit fd51bd349a3b92cf92bfc38edc1ece7152178fa8 +Author: Aleksander Morgado +Date: Tue Nov 29 17:06:10 2011 +0100 + + iface-modem-3gpp: handle network registration requests + + src/mm-iface-modem-3gpp.c | 112 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-3gpp.h | 9 ++++ + 2 files changed, 120 insertions(+), 1 deletion(-) + +commit 0076106c9048ed73f260297c5aea54deae2f1f10 +Author: Aleksander Morgado +Date: Tue Nov 29 17:02:05 2011 +0100 + + iface-modem: don't report LOCKED state if SIM PIN2/PUK2 + + If unlock required reports needing SIM PIN2 or PUK2, don't report + LOCKED state, + as the device is fully operational without it. + + src/mm-iface-modem.c | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +commit 670e2dcdc9bcb79147606e029f99969b930ad6fd +Author: Aleksander Morgado +Date: Tue Nov 29 15:43:26 2011 +0100 + + iface-modem: launch reinitialization only when going from LOCKED + to DISABLED + + src/mm-iface-modem.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 48a9da117b50f8586b3838f69d27012c69c59939 +Author: Aleksander Morgado +Date: Tue Nov 29 14:23:20 2011 +0100 + + broadband-modem: implement CS/PS registration checks + + Running a CS/PS registration check may not return any direct result + (this is, no + MMModem3gppRegistrationStatus returned), as usually replies to + +CREG? and + +CGREG? are parsed as unsolicited messages. + + src/mm-broadband-modem.c | 225 + ++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 222 insertions(+), 3 deletions(-) + +commit b3389ff2d437e7ebba541af53b32ef4f779872ac +Author: Aleksander Morgado +Date: Tue Nov 29 14:21:15 2011 +0100 + + test-modem-helpers: fix C(G)REG parsing tests + + src/tests/test-modem-helpers.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 5805a931e65759b86338b8fa315a3d10f8b732d4 +Author: Aleksander Morgado +Date: Tue Nov 29 14:19:35 2011 +0100 + + modem-helpers: use MMModemAccessTech when parsing C(G)REG responses + + src/mm-modem-helpers.c | 31 +++++++++++++++++++-- + src/mm-modem-helpers.h | 2 +- + src/tests/test-modem-helpers.c | 62 + +++++++++++++++++++++--------------------- + 3 files changed, 61 insertions(+), 34 deletions(-) + +commit 9c60fe6e16255539ac0406a61272cc3fb4b91ea4 +Author: Aleksander Morgado +Date: Tue Nov 29 12:20:33 2011 +0100 + + iface-modem-3gpp: load registration states during enable + + src/mm-iface-modem-3gpp.c | 28 ++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 20 ++++++++++++++++++++ + 2 files changed, 48 insertions(+) + +commit b64658164026413fe3b2451e77c3220f0d016457 +Author: Aleksander Morgado +Date: Tue Nov 29 12:10:29 2011 +0100 + + broadband-modem: implement unsolicited registration message setup + + We setup custom handlers for unsolicited registration state + messages. Plugins + are allowed to setup their own handlers. + + src/mm-broadband-modem.c | 101 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 101 insertions(+) + +commit 9b796e0d86e33847225450139e30fe4a59ce4a4a +Author: Aleksander Morgado +Date: Tue Nov 29 12:08:44 2011 +0100 + + iface-modem-3gpp: allow changing the RegistrationState from outside + the interface + + The 3GPP registration state will always be set from outside the + 3GPP interface, + for example when parsing unsolicited registration messages, on + when the + interface requests manual checking of registration state. + + We'll also update the State property in the Modem interface when we + switch to a + connected state, so we also set the Modem interface as a prerrequisite + of the + 3GPP interface. + + src/mm-iface-modem-3gpp.c | 48 + ++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem-3gpp.h | 7 +++++++ + 2 files changed, 54 insertions(+), 1 deletion(-) + +commit b31ad376704d007a69b9b6ba85e3fb01a510731c +Author: Aleksander Morgado +Date: Tue Nov 29 12:05:44 2011 +0100 + + iface-modem: allow changing the State from outside the interface + + Some states need to be set from outside the scope of the Modem + interface, like + Registration-related ones (REGISTERED, SEARCHING, ...) or + Connection-related + ones (CONNECTED, ...). + + src/mm-iface-modem.c | 61 + ++++++++++++++++++++++++++-------------------------- + src/mm-iface-modem.h | 5 +++++ + 2 files changed, 36 insertions(+), 30 deletions(-) + +commit ddbfad8ca49500740989e9b2d10d319410017569 +Author: Aleksander Morgado +Date: Tue Nov 29 12:02:42 2011 +0100 + + broadband-modem: override the RegistrationState property + + src/mm-broadband-modem.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 430878c452177a9dbb129025f413ae43c9226b3b +Author: Aleksander Morgado +Date: Tue Nov 29 11:02:11 2011 +0100 + + modem-helpers: use MMModem3gppRegistrationState when parsing C(G)REG + responses + + src/mm-modem-helpers.c | 12 +++++++++--- + src/mm-modem-helpers.h | 3 +-- + 2 files changed, 10 insertions(+), 5 deletions(-) + +commit c636cdb27ffd23378c793bb3b4f2ce889d2a0da3 +Author: Aleksander Morgado +Date: Tue Nov 29 10:41:15 2011 +0100 + + base-modem: setup NULL callbacks in unsolicited CREG message handlers + + When the port is grabbed, we setup NULL callbacks for all unsolicited + registration message handlers. If we do enable 3GPP registrations + afterwards, we'll set proper callbacks. + + src/mm-base-modem.c | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +commit d1072bda54344ed16a1dfbad27b6583dd73c25cc +Author: Aleksander Morgado +Date: Tue Nov 29 10:38:48 2011 +0100 + + iface-modem: new RegistrationState property, bound to the one in DBus + + src/mm-iface-modem-3gpp.c | 16 +++++++++++++++- + src/mm-iface-modem-3gpp.h | 1 + + 2 files changed, 16 insertions(+), 1 deletion(-) + +commit 68044fb01e6e7e84c4c3a53944e007167c89ab54 +Author: Aleksander Morgado +Date: Tue Nov 29 10:04:07 2011 +0100 + + iface-modem-3gpp: setup unsolicited registration messages handling + during enable + + src/mm-iface-modem-3gpp.c | 14 ++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 ++++++++ + 2 files changed, 22 insertions(+) + +commit 2f5e8c46a34bd88eba47b0488dcc5d3d0fe242e4 +Author: Aleksander Morgado +Date: Tue Nov 29 09:21:57 2011 +0100 + + at-serial-port: allow overwriting unsolicited message handlers + + Existing unsolicited message handlers can be overwritten at any time + now. This + allows initializing the port with all possible message handlers + configured with + a NULL callback, and then setup the proper handlers when we go on + enabling the + different interfaces. + + src/mm-at-serial-port.c | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +commit 20f53ec15b5f9b7b3251259bedceccfb1ae5114e +Author: Aleksander Morgado +Date: Mon Nov 28 19:38:11 2011 +0100 + + broadband-modem: implement CS/PS registration notifications setup + + src/mm-broadband-modem.c | 140 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +commit 8f6018d9c60e318d6593c576e1ba804730785604 +Author: Aleksander Morgado +Date: Mon Nov 28 18:47:32 2011 +0100 + + iface-modem-3gpp: setup CS and PS registrations during enable + + src/mm-iface-modem-3gpp.c | 50 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 16 +++++++++++++++ + 2 files changed, 66 insertions(+) + +commit 04f10820f38a57d8f3e13ced25274c2fbdee518d +Author: Aleksander Morgado +Date: Mon Nov 28 18:18:17 2011 +0100 + + broadband-modem: setup enabling steps + + When the modem is enabled, we'll go one by one enabling all our + interfaces. + + src/mm-broadband-modem.c | 149 + ++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 128 insertions(+), 21 deletions(-) + +commit 73db436f71558c700254731f254d35dbcd3ba7c5 +Author: Aleksander Morgado +Date: Mon Nov 28 17:51:20 2011 +0100 + + iface-modem-3gpp: interface can be enabled + + In addition to initializing the interface, to load initial values + of all + properties and export the object in DBus, the interface can now also + be enabled. + Enabling the 3GPP interface will take care of running the network + registration + process. + + src/mm-iface-modem-3gpp.c | 88 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 +++++ + 2 files changed, 96 insertions(+) + +commit bd24d0d14c415916bb739255178301359de1347a +Author: Aleksander Morgado +Date: Mon Nov 28 14:49:17 2011 +0100 + + broadband-modem: implement IMEI loading + + src/mm-broadband-modem.c | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +commit 27c973b6b47e5080863acf7e0bdbf15f9f70ec2e +Author: Aleksander Morgado +Date: Mon Nov 28 13:23:47 2011 +0100 + + broadband-modem: implement the Modem 3GPP interface + + It will only be initialized and exported in DBus if the modem has 3GPP + capabilities. + + src/mm-broadband-modem.c | 30 ++++++++++++++++++++++++++++-- + 1 file changed, 28 insertions(+), 2 deletions(-) + +commit c6b69f9a594c016b1cff36364d401d7932e5d658 +Author: Aleksander Morgado +Date: Mon Nov 28 14:55:30 2011 +0100 + + iface-modem-3gpp: export DBus interface when properly initialized + + src/mm-iface-modem-3gpp.c | 42 ++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 38 insertions(+), 4 deletions(-) + +commit 69079ff8914419d08c21720f022ef33da8225959 +Author: Aleksander Morgado +Date: Mon Nov 28 14:42:43 2011 +0100 + + iface-modem-3gpp: load `IMEI' during init + + src/mm-iface-modem-3gpp.c | 39 +++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 8 ++++++++ + 2 files changed, 47 insertions(+) + +commit bb625b332a4dfd6159455e8a795ffe6a0b81a3ee +Author: Aleksander Morgado +Date: Mon Nov 28 13:13:54 2011 +0100 + + iface-modem-3gpp: setup interface initialization and shutdown + + src/mm-iface-modem-3gpp.c | 132 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 14 +++++ + 2 files changed, 146 insertions(+) + +commit 829b79eff4c0d7e55862ba3a8d7d34acd8995a42 +Author: Aleksander Morgado +Date: Mon Nov 28 14:54:56 2011 +0100 + + iface-modem: complete the result before freeing init context + + src/mm-iface-modem.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 78d788d4dcd03aa69b1f040c4bb7ef3768f24a10 +Author: Aleksander Morgado +Date: Mon Nov 28 13:04:59 2011 +0100 + + iface-modem: avoid inner async operation during initialization + + src/mm-iface-modem.c | 145 + +++++++++++++++------------------------------------ + 1 file changed, 43 insertions(+), 102 deletions(-) + +commit acc3e3f6da1d83ed9050505cc1e79da602c5c5ef +Author: Aleksander Morgado +Date: Mon Nov 28 12:53:30 2011 +0100 + + core: always pass open port to interface initializations + + When the first AT port is grabbed, modem initialization is launched, + using that + specific port. This port is also passed to all interface + initialization methods. + + src/mm-base-modem.c | 2 +- + src/mm-base-modem.h | 2 +- + src/mm-broadband-modem.c | 25 ++++++++++++++++++++++++- + src/mm-iface-modem.c | 34 +++++++++++++--------------------- + src/mm-iface-modem.h | 2 ++ + 5 files changed, 41 insertions(+), 24 deletions(-) + +commit 1d495c58e65d2160722467b54aefe7b70188ee19 +Author: Aleksander Morgado +Date: Mon Nov 28 12:29:15 2011 +0100 + + iface-modem-3gpp: new interface to handle the Modem 3GPP DBus + interface + + src/Makefile.am | 2 ++ + src/mm-iface-modem-3gpp.c | 69 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem-3gpp.h | 37 +++++++++++++++++++++++++ + 3 files changed, 108 insertions(+) + +commit b9448b83cb0d5165b3e4002a3c9cea4fa7a153b1 +Author: Aleksander Morgado +Date: Mon Nov 28 12:21:48 2011 +0100 + + iface-modem: simplify interface handling + + Interfaces won't have a 'status', just initialize(), enable(), + disable() and + shutdown(). + + Also, shutdown() should never fail. We will take care of cancelling + any ongoing + operation afterwards, before calling shutdown(). + + src/mm-broadband-modem.c | 10 +-- + src/mm-iface-modem.c | 200 + +++++++++++++++-------------------------------- + src/mm-iface-modem.h | 3 +- + 3 files changed, 67 insertions(+), 146 deletions(-) + +commit d2d9251733cc4c8e6b5c10fd79341c2f0be08726 +Author: Aleksander Morgado +Date: Mon Nov 28 12:13:25 2011 +0100 + + broadband-modem: setup initialization of all interfaces + + src/mm-broadband-modem.c | 236 + ++++++++++++++++++++++++++++++++++------------- + 1 file changed, 171 insertions(+), 65 deletions(-) + +commit a58f95121af8435574b65a2763b445c2e113c07c +Author: Aleksander Morgado +Date: Mon Nov 28 17:37:02 2011 +0100 + + api: rename 3GPP and CDMA interface paths + + Elements in a DBus interface name cannot start with a digit, so + "org.freedesktop.ModemManager1.Modem.3gpp" is an invalid interface + name. + + Renamed here all relevant interfaces so that they have an additional + "Modem" + prefix in the element, so we get now: + "org.freedesktop.ModemManager1.Modem.Modem3gpp" + "org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd" + "org.freedesktop.ModemManager1.Modem.ModemCdma" + + Objects generated with gdbus-codegen maintain the previous names. + + docs/reference/api/Makefile.am | 6 +++--- + docs/reference/api/mm-docs.xml | 6 +++--- + libmm-common/Makefile.am | 15 + +++++++++------ + new/all.xml | 6 +++--- + ...rg.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml} | 8 ++++---- + ... => org.freedesktop.ModemManager1.Modem.Modem3gpp.xml} | 5 ++--- + ... => org.freedesktop.ModemManager1.Modem.ModemCdma.xml} | 4 ++-- + 7 files changed, 26 insertions(+), 24 deletions(-) + +commit 27494eae51e329ff19544fab4a08a5d8cca56f5b +Author: Aleksander Morgado +Date: Fri Nov 25 15:27:41 2011 +0100 + + iface-modem: handle Enable() calls + + src/mm-iface-modem.c | 157 + ++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 155 insertions(+), 2 deletions(-) + +commit 22bdfdbf8b06a98d3b0ebdbb65c480de4eabd8d2 +Author: Aleksander Morgado +Date: Fri Nov 25 15:26:42 2011 +0100 + + broadband-modem: disable the Modem iface when disabling the modem + + src/mm-broadband-modem.c | 47 + +++++++++++++++++++++++++++++++++-------------- + 1 file changed, 33 insertions(+), 14 deletions(-) + +commit b0a9c6a7efcc31f74ff6d1bae5b55734068b3f35 +Author: Aleksander Morgado +Date: Fri Nov 25 15:25:18 2011 +0100 + + broadband-modem: enable the Modem iface when enabling the modem + + src/mm-broadband-modem.c | 47 + +++++++++++++++++++++++++++++++++-------------- + 1 file changed, 33 insertions(+), 14 deletions(-) + +commit c74c3a5d2ea1db54b3893690a5db51fc9e0b76f6 +Author: Aleksander Morgado +Date: Fri Nov 25 15:23:21 2011 +0100 + + broadband-modem: implement charset loading and setup + + src/mm-broadband-modem.c | 258 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 258 insertions(+) + +commit ad8fed66fedcde2c707c3741f64e7fdeaab80abf +Author: Aleksander Morgado +Date: Fri Nov 25 15:22:26 2011 +0100 + + broadband-modem: implement flow control setup + + src/mm-broadband-modem.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 00949c4782069326cb2d126a866b8167e6c24598 +Author: Aleksander Morgado +Date: Fri Nov 25 15:21:31 2011 +0100 + + broadband-modem: implement modem power-up commands + + src/mm-broadband-modem.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +commit 491758c266bdc22b8b0ab3c369da9b36815c2d0c +Author: Aleksander Morgado +Date: Fri Nov 25 15:20:32 2011 +0100 + + broadband-modem: implement modem initialization commands + + src/mm-broadband-modem.c | 74 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit ea7a939201bdde4cf0630c9564183b18031ffaa5 +Author: Aleksander Morgado +Date: Fri Nov 25 15:17:58 2011 +0100 + + broadband-modem: override the Current Capabilities property + + src/mm-broadband-modem.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 8b1515b2a0e75e98a7938052a6b754890a684862 +Author: Aleksander Morgado +Date: Fri Nov 25 15:14:27 2011 +0100 + + iface-modem: close primary port during disable + + src/mm-iface-modem.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 589c6419d2d247e53a50d3bd8d96be5b9d51fea3 +Author: Aleksander Morgado +Date: Fri Nov 25 15:13:43 2011 +0100 + + iface-modem: send power-down command during disable + + src/mm-iface-modem.c | 43 +++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 51 insertions(+) + +commit 5e3ad0fe589f48e0582faf02f05fa114b4c6f3de +Author: Aleksander Morgado +Date: Fri Nov 25 15:12:37 2011 +0100 + + iface-modem: flash primary port during disable + + src/mm-iface-modem.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +commit f3b6bfeb8f2ac03440ba797fb8cb3e3226baa4c7 +Author: Aleksander Morgado +Date: Fri Nov 25 15:10:13 2011 +0100 + + iface-modem: interface can be disabled + + The Modem interface can be disabled, going from enabled back to + initialized. The + disabling process will include closing the ports opened during + the enabling. + + src/mm-iface-modem.c | 107 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++ + 2 files changed, 115 insertions(+) + +commit 781c1821fdcf4b71c4571c87c4c149beb0b4b8f3 +Author: Aleksander Morgado +Date: Fri Nov 25 15:05:56 2011 +0100 + + iface-modem: setup modem charset configuration during enable + + Load supported charsets, and loop trying to set the best one. + + src/mm-iface-modem.c | 106 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 19 +++++++++ + 2 files changed, 125 insertions(+) + +commit c0d3bd944c9644aca556221fce4d4b1e5ae0ed6b +Author: Aleksander Morgado +Date: Fri Nov 25 15:04:17 2011 +0100 + + iface-modem: send flow control setup commands during enable + + src/mm-iface-modem.c | 14 ++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 22 insertions(+) + +commit 7fa372d1185dc9ea195d3d7d8b8a5cfffe26963e +Author: Aleksander Morgado +Date: Fri Nov 25 15:02:31 2011 +0100 + + iface-modem: allow plugins to send custom commands after power-up + + Just after powering up the modem, plugins can run additional setup + commands + themselves, in a new "after" power-up step. + + src/mm-iface-modem.c | 14 ++++++++++++++ + src/mm-iface-modem.h | 9 +++++++++ + 2 files changed, 23 insertions(+) + +commit 0adbd8edadbf3c0a07df59c362977e015481cedb +Author: Aleksander Morgado +Date: Fri Nov 25 15:01:41 2011 +0100 + + iface-modem: send power-up commands during enable + + src/mm-iface-modem.c | 14 ++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 22 insertions(+) + +commit b948c93e598ffc42e4c0a34f856b42944719e916 +Author: Aleksander Morgado +Date: Fri Nov 25 14:59:53 2011 +0100 + + iface-modem: send modem initialization commands during enable + + src/mm-iface-modem.c | 36 ++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 8 ++++++++ + 2 files changed, 44 insertions(+) + +commit b0a1eccd543f88880a9d6bcab90398e2b2fbd45e +Author: Aleksander Morgado +Date: Fri Nov 25 14:57:54 2011 +0100 + + iface-modem: flash primary port during enable + + src/mm-iface-modem.c | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 50 insertions(+) + +commit fc19509e4ffb3c1fdf34fe1ea56d8d65f2813f6a +Author: Aleksander Morgado +Date: Fri Nov 25 14:53:35 2011 +0100 + + iface-modem: during init, fall down to next states directly + + src/mm-iface-modem.c | 49 + ++++++++++++++++++++++++++++++------------------- + 1 file changed, 30 insertions(+), 19 deletions(-) + +commit 8327b6af30b2ca0d97263d474945833f2f9bddda +Author: Aleksander Morgado +Date: Fri Nov 25 14:49:40 2011 +0100 + + iface-modem: interface can be enabled + + In addition to initializing the interface, to load initial values + of all + properties and export the object in DBus, the interface can now also + be enabled. + Enabling the Modem interface will take care of running the modem + enabling + process (flashing port, power up and such). + + src/mm-iface-modem.c | 128 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 122 insertions(+), 6 deletions(-) + +commit f049dbb21768304a39d48c83c18f20b976c8a9e9 +Author: Aleksander Morgado +Date: Fri Nov 25 14:42:34 2011 +0100 + + iface-modem: emit StateChanged signal when modem state changes + + src/mm-iface-modem.c | 66 + ++++++++++++++++++++++++++++++++++++++++++++++------ + src/mm-iface-modem.h | 8 +++++++ + 2 files changed, 67 insertions(+), 7 deletions(-) + +commit 7b59a8091295db52f9eda914b854a96401a8215f +Author: Aleksander Morgado +Date: Fri Nov 25 14:36:26 2011 +0100 + + iface-modem: load CurrentCapabilities first + + With AT+GCAP we load the currently available capabilities, and we + store them + in a new "iface-modem-capabilities" property in the MMIfaceModem + interface. This + property is bound to the "current-capabilities" property in the + MmGdbusModem + skeleton object, so no need to update both when it changes. + + ModemCapabilities depend directly on whether the modem can load + firmware without + reflashing the device. Currently, just set it equal to + CurrentCapabilities. + + src/mm-broadband-modem.c | 20 ++++++------ + src/mm-iface-modem.c | 80 + +++++++++++++++++++++++++++++++++++------------- + src/mm-iface-modem.h | 7 +++-- + 3 files changed, 73 insertions(+), 34 deletions(-) + +commit ec1d94044f493b7e88c41bf45dd497796b71928e +Author: Aleksander Morgado +Date: Fri Nov 25 14:32:17 2011 +0100 + + sim: during init, fall down to next states directly + + src/mm-sim.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 1257ecd13613d6f60d317a3ee3f34332188d0cfc +Author: Aleksander Morgado +Date: Sun Nov 20 20:55:07 2011 +0100 + + cli: start to port Modem actions to use the new libmm-glib + + cli/Makefile.am | 2 + + cli/mmcli-common.c | 237 ++++++++++++++++ + cli/mmcli-common.h | 39 +++ + cli/mmcli-manager.c | 62 +---- + cli/mmcli-modem.c | 752 + ++++++++++++++++++++++++-------------------------- + cli/mmcli.c | 5 +- + cli/mmcli.h | 2 +- + libmm-glib/mm-modem.c | 1 + + 8 files changed, 656 insertions(+), 444 deletions(-) + +commit 9ae68b3fee0a8f58e308f1a20cccf433a414fc8b +Author: Aleksander Morgado +Date: Sat Aug 20 15:24:41 2011 +0200 + + cli: add command to reset the modem to factory state + + cli/mmcli-modem.c | 59 + ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 56 insertions(+), 3 deletions(-) + +commit 6221e4f76b5a0edfa253493635a64f971916f9ba +Author: Aleksander Morgado +Date: Sat Aug 20 15:16:32 2011 +0200 + + cli: add command to reset the modem + + cli/mmcli-modem.c | 56 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 55 insertions(+), 1 deletion(-) + +commit e341c7ff49ffff5a2986a56e105c01b86b6f6478 +Author: Aleksander Morgado +Date: Sat Aug 20 13:47:05 2011 +0200 + + cli: use new modem enabling and disabling API + + cli/mmcli-modem.c | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit ea5f81b804e923d94e802d67ba889637814186f5 +Author: Aleksander Morgado +Date: Sat Aug 20 13:35:56 2011 +0200 + + cli: add commands to enable and disable the modem + + cli/mmcli-modem.c | 114 + +++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 113 insertions(+), 1 deletion(-) + +commit 5de1ae6a4fd2681147babb0e5fc0cfb3a502ad40 +Author: Aleksander Morgado +Date: Sat Aug 20 13:12:27 2011 +0200 + + cli: add command to monitor modem state + + cli/mmcli-modem.c | 62 + +++++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 58 insertions(+), 4 deletions(-) + +commit 9a6bb0bb196bce46d355d02fd635788308c0d73e +Author: Aleksander Morgado +Date: Sat Aug 20 12:56:48 2011 +0200 + + cli: include status information properties in the info command output + + cli/mmcli-modem.c | 102 + +++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 101 insertions(+), 1 deletion(-) + +commit 90f6a5ec75f88c9942e62d7c91134451ba7bd0b4 +Author: Aleksander Morgado +Date: Sat Aug 20 11:44:29 2011 +0200 + + cli: include system information properties in the info command output + + cli/mmcli-modem.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) + +commit fed5ad5623859f5ebf092547f81e4cc282fcccb5 +Author: Aleksander Morgado +Date: Sat Aug 20 11:10:09 2011 +0200 + + cli: handle multiline revision strings + + cli/mmcli-modem.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 45 insertions(+), 1 deletion(-) + +commit fcadc0f841750a108d154cabee159c115b3e557a +Author: Aleksander Morgado +Date: Sat Aug 20 10:33:01 2011 +0200 + + cli: add commands to get info from modem + + cli/Makefile.am | 3 +- + cli/mmcli-modem.c | 243 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + cli/mmcli.c | 23 ++++++ + cli/mmcli.h | 8 ++ + 4 files changed, 276 insertions(+), 1 deletion(-) + +commit 9e241b7062883a67a31500a6f095c9839c8666c8 +Author: Aleksander Morgado +Date: Thu Oct 27 17:12:20 2011 +0200 + + cli: port Manager actions to use the new libmm-glib + + The original command line interface was written based on a hand-made + libmm. This + commit ports the Manager interface handling to the new + gdbus-codegen-based + libmm-glib. + + cli/mmcli-manager.c | 269 + +++++++++++++++++++++++++++++++--------------------- + cli/mmcli.c | 12 ++- + cli/mmcli.h | 2 +- + 3 files changed, 170 insertions(+), 113 deletions(-) + +commit c37949d7ba20e33633951e57d89c6cfe3e968790 +Author: Aleksander Morgado +Date: Sat Aug 20 10:15:36 2011 +0200 + + cli: always perform a clean shutdown on successful operations + + cli/mmcli.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 96e07f7ab0d651fb80349e51f28207f038c91a2a +Author: Aleksander Morgado +Date: Sat Aug 20 09:28:37 2011 +0200 + + cli: prefix error messages with 'error: ' + + cli/mmcli-manager.c | 10 +++++----- + cli/mmcli.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit 387db2b2595c1c0d4432248c59c1b9df1c11c89d +Author: Aleksander Morgado +Date: Sat Aug 20 09:19:19 2011 +0200 + + cli: use capital letters for manager options + + cli/mmcli-manager.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit d8c2a6392728bba1e78389b23b56f848045f9236 +Author: Aleksander Morgado +Date: Fri Aug 19 23:43:45 2011 +0200 + + cli: split into different option groups, in different files + + cli/Makefile.am | 4 +- + cli/{main.c => mmcli-manager.c} | 265 + ++++++++++++++-------------------------- + cli/mmcli.c | 167 +++++++++++++++++++++++++ + cli/mmcli.h | 37 ++++++ + 4 files changed, 300 insertions(+), 173 deletions(-) + +commit 07ec1a2395c8b25ba8464b5d97026a368e14e1d2 +Author: Aleksander Morgado +Date: Wed Aug 17 18:27:31 2011 +0200 + + cli: add commands to change daemon logging level + + cli/main.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 7b0903cc57f0d67c7fac26527d3d8d3f8d66068b +Author: Aleksander Morgado +Date: Wed Aug 17 18:26:06 2011 +0200 + + cli: add commands to request a new scan + + cli/main.c | 60 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 59 insertions(+), 1 deletion(-) + +commit f58409e7c26a9c43010c51197150ad405bb22007 +Author: Aleksander Morgado +Date: Wed Aug 17 18:24:25 2011 +0200 + + cli: add command to monitor modem additions and removals + + cli/main.c | 66 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 66 insertions(+) + +commit cc7cd44cb84a4121d946edd10de9525035b58b90 +Author: Aleksander Morgado +Date: Wed Aug 17 18:19:32 2011 +0200 + + cli: add commands to list currently available modems + + cli/main.c | 159 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 159 insertions(+) + +commit 8f450d82b6c18b814c86b23e9cd44394be2a1a55 +Author: Aleksander Morgado +Date: Wed Aug 17 18:14:26 2011 +0200 + + cli: initial cli implementation + + .gitignore | 2 ++ + Makefile.am | 2 +- + cli/Makefile.am | 20 +++++++++++++++ + cli/main.c | 76 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 8 ++++++ + 5 files changed, 107 insertions(+), 1 deletion(-) + +commit 40b31d5a2702503108efd9864796298e7cf56caa +Author: Aleksander Morgado +Date: Mon Nov 21 10:30:04 2011 +0100 + + libmm-glib: get the MMSim object from the MMModem + + libmm-glib/mm-modem.c | 91 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem.h | 11 +++++++ + 2 files changed, 102 insertions(+) + +commit 72eef326b5dd2f05cbc68e9c301e233f6ef84622 +Author: Aleksander Morgado +Date: Sun Nov 20 18:17:05 2011 +0100 + + libmm-glib: new MMSim object + + libmm-glib/Makefile.am | 4 +- + libmm-glib/mm-modem.c | 2 + + libmm-glib/mm-modem.h | 11 + + libmm-glib/mm-sim.c | 609 + +++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-sim.h | 120 ++++++++++ + 5 files changed, 745 insertions(+), 1 deletion(-) + +commit b4dd84c2c93a5d12786d944ff2e8ef64d25396cb +Author: Aleksander Morgado +Date: Sun Nov 20 14:47:03 2011 +0100 + + libmm-glib: new `MMModem' object, handling the Modem interface + + libmm-glib/Makefile.am | 7 +- + libmm-glib/libmm-glib.h | 1 + + libmm-glib/mm-manager.h | 5 +- + libmm-glib/mm-modem.c | 1213 + +++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-modem.h | 166 +++++++ + 5 files changed, 1388 insertions(+), 4 deletions(-) + +commit ba0e4ca88ef947df11fe2a095cc16671402fdf93 +Author: Aleksander Morgado +Date: Wed Oct 26 21:08:21 2011 +0200 + + libmm-glib: setup build of the libmm-glib library + + The library will contain a small layer of code on top of the proxies + and object + manager client generated by gdbus-codegen. Therefore, the headers + auto-generated + from the DBus introspection XMLs need to be distributed along with the + libmm-glib specific headers. + + Makefile.am | 3 +- + configure.ac | 8 + + libmm-glib/Makefile.am | 31 +++ + libmm-glib/libmm-glib.h | 28 +++ + libmm-glib/mm-manager.c | 511 + ++++++++++++++++++++++++++++++++++++++++++++++++ + libmm-glib/mm-manager.h | 95 +++++++++ + 6 files changed, 675 insertions(+), 1 deletion(-) + +commit c58db4e015c1d6aeccccb167f7f2f68c211a3b86 +Author: Aleksander Morgado +Date: Wed Nov 23 12:36:47 2011 +0100 + + core: start using our newly defined errors + + plugins/mm-plugin-generic.c | 1 - + src/Makefile.am | 4 +- + src/mm-at-serial-port.c | 1 - + src/mm-base-modem.c | 2 - + src/mm-broadband-modem.c | 2 - + src/mm-callback-info.c | 8 +- + src/mm-error-helpers.c | 267 ++++++++++++++++++++++ + src/mm-error-helpers.h | 32 +++ + src/mm-errors.c | 463 + -------------------------------------- + src/mm-errors.h | 163 -------------- + src/mm-log.c | 11 +- + src/mm-manager.c | 7 +- + src/mm-modem-helpers.c | 20 +- + src/mm-plugin-base.c | 1 - + src/mm-plugin-manager.c | 4 +- + src/mm-port-probe-at-command.c | 6 +- + src/mm-port-probe.c | 6 +- + src/mm-qcdm-serial-port.c | 8 +- + src/mm-serial-parsers.c | 53 ++--- + src/mm-serial-port.c | 36 +-- + src/mm-sim.c | 1 - + src/mm-sms-utils.c | 41 ++-- + src/tests/test-qcdm-serial-port.c | 8 +- + 23 files changed, 414 insertions(+), 731 deletions(-) + +commit e4d8c4ace72e72c53951f80792d852ff4b043329 +Author: Aleksander Morgado +Date: Wed Nov 23 12:06:22 2011 +0100 + + core: disable all dbus-glib dependent code + + src/Makefile.am | 82 + +-------------------------------------------------------- + 1 file changed, 1 insertion(+), 81 deletions(-) + +commit 86aa9df84920d4dfdf50a7b7507bf82adc1056a5 +Author: Aleksander Morgado +Date: Wed Nov 23 11:58:54 2011 +0100 + + core: start using MMBroadbandModem objects + + We chain up the Generic plugin created MMBroadbandModem objects + within the + GDBusObjectManagerServer in MMManager, so that they get properly + exported in + DBus. + + plugins/mm-plugin-generic.c | 100 ++++++----------- + src/mm-manager.c | 264 + ++++++++++++++++++++++++-------------------- + src/mm-plugin-base.c | 8 +- + src/mm-plugin-base.h | 6 +- + src/mm-plugin-manager.c | 4 +- + src/mm-plugin-manager.h | 4 +- + src/mm-plugin.c | 6 +- + src/mm-plugin.h | 26 ++--- + 8 files changed, 206 insertions(+), 212 deletions(-) + +commit 4ad9374159551463e976c825a50685e27140b31f +Author: Aleksander Morgado +Date: Wed Nov 23 11:11:13 2011 +0100 + + plugin-base: explicitly request to probe for AT capabilities + + src/mm-plugin-base.c | 19 +++++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 20 insertions(+) + +commit fa01e7a6d31c77192d631ed656bb495a1e5b9d6a +Author: Aleksander Morgado +Date: Wed Nov 23 11:08:33 2011 +0100 + + core: no need to check Capabilities during port probing + + Capabilities checking is done during the Modem interface + initialization. + + src/mm-plugin-base.c | 25 --------- + src/mm-plugin-base.h | 1 - + src/mm-port-probe-at-command.c | 117 + ----------------------------------------- + src/mm-port-probe-at-command.h | 2 - + src/mm-port-probe.c | 41 +-------------- + src/mm-port-probe.h | 30 ++--------- + 6 files changed, 4 insertions(+), 212 deletions(-) + +commit 6552393c8eb90a7d0eb9b54df4e69108325881de +Author: Aleksander Morgado +Date: Wed Nov 23 10:38:22 2011 +0100 + + broadband-modem: implement UnlockRequired loading + + src/mm-broadband-modem.c | 132 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 132 insertions(+) + +commit 6ed6f861f06dc5616ed3466b9a9d02744ee91b6b +Author: Aleksander Morgado +Date: Wed Nov 23 10:37:57 2011 +0100 + + broadband-modem: implement DeviceIdentifier loading + + src/mm-broadband-modem.c | 140 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +commit 912318b5d9bb78ce69b3753543122e5ca9ea67ee +Author: Aleksander Morgado +Date: Wed Nov 23 10:37:03 2011 +0100 + + broadband-modem: implement EquipmentIdentifier loading + + src/mm-broadband-modem.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 43d09e63e1fb5a3ff0f7beb4fb4fe35fcb2a8345 +Author: Aleksander Morgado +Date: Wed Nov 23 10:36:16 2011 +0100 + + broadband-modem: implement Revision loading + + src/mm-broadband-modem.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 90ba94056b6f8f5969bddb20f35b9c2eeb919dc6 +Author: Aleksander Morgado +Date: Wed Nov 23 10:35:45 2011 +0100 + + broadband-modem: implement Model loading + + src/mm-broadband-modem.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 63163835a3c12f64ce991961bb6b8a0409535918 +Author: Aleksander Morgado +Date: Wed Nov 23 10:35:12 2011 +0100 + + broadband-modem: implement Manufacturer loading + + src/mm-broadband-modem.c | 64 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 64 insertions(+) + +commit 8303bed13347c2ad23ada45eed7db36e539c15fd +Author: Aleksander Morgado +Date: Wed Nov 23 10:33:43 2011 +0100 + + broadband-modem: implement Capabilities loading + + src/mm-broadband-modem.c | 188 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 188 insertions(+) + +commit 8647f3cbda099547fe02cf072bd0a460882e2a56 +Author: Aleksander Morgado +Date: Wed Nov 23 10:30:44 2011 +0100 + + broadband-modem: implement MMIfaceModem interface + + Currently just override the interface properties, and launch + initialization and + shutdown where appropriate. + + src/mm-broadband-modem.c | 160 + ++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 144 insertions(+), 16 deletions(-) + +commit a3a712f32f1229e92db55e04430422e2a8afdb90 +Author: Aleksander Morgado +Date: Wed Nov 23 10:23:11 2011 +0100 + + core: new MMBroadbandModem object, inherits from MMBaseModem + + New object to implement broadband modem specific behaviour. + + src/Makefile.am | 2 + + src/mm-broadband-modem.c | 173 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-broadband-modem.h | 55 +++++++++++++++ + 3 files changed, 230 insertions(+) + +commit 126332332b137c5ef3d5ee3bb71c6d4c58ab4b21 +Author: Aleksander Morgado +Date: Wed Nov 23 09:34:38 2011 +0100 + + iface-modem: allow requesting signal quality check + + The new `mm_iface_modem_signal_quality_check()' method will reload + the signal + quality value on demand, set the value of the `SignalQuality' + property in DBus, + and also return the results. + + src/mm-iface-modem.c | 121 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 20 +++++++++ + 2 files changed, 141 insertions(+) + +commit 59c37afae6849a639350d38eafc84b0cc42ed43e +Author: Aleksander Morgado +Date: Tue Nov 22 19:16:07 2011 +0100 + + iface-modem: handle SetAllowedModes() + + src/mm-iface-modem.c | 71 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 10 ++++++++ + 2 files changed, 79 insertions(+), 2 deletions(-) + +commit 1dcd20f18db2941f87a774ca58bfacf345ccec45 +Author: Aleksander Morgado +Date: Tue Nov 22 19:12:33 2011 +0100 + + iface-modem: handle SetAllowedBands() + + Also considering that playing with bands may not be supported. + + src/mm-iface-modem.c | 69 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 9 +++++++ + 2 files changed, 76 insertions(+), 2 deletions(-) + +commit b9d60d2de49e91c60eb2fcef779d769d39ee3c12 +Author: Aleksander Morgado +Date: Tue Nov 22 19:06:07 2011 +0100 + + iface-modem: handle FactoryReset() calls + + Also considering that reseting may not be implemented. + + src/mm-iface-modem.c | 70 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 9 +++++++ + 2 files changed, 77 insertions(+), 2 deletions(-) + +commit 03490d1171e87a59b04b052faf03f9381d43a51b +Author: Aleksander Morgado +Date: Tue Nov 22 19:03:25 2011 +0100 + + iface-modem: handle Reset() calls + + Also considering that reseting may not be implemented. + + src/mm-iface-modem.c | 98 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-iface-modem.h | 8 +++++ + 2 files changed, 104 insertions(+), 2 deletions(-) + +commit 2a1465bc917bcbb80c322036d8aa100c5e827284 +Author: Aleksander Morgado +Date: Tue Nov 22 18:57:09 2011 +0100 + + iface-modem: create MMSim object during init + + src/mm-iface-modem.c | 94 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 1 + + 2 files changed, 95 insertions(+) + +commit c2eac91b7865e83a4f62687bd6768c19d98a882b +Author: Aleksander Morgado +Date: Tue Nov 22 18:53:17 2011 +0100 + + sim: handle SendPin() and SendPuk() calls + + src/mm-sim.c | 168 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 168 insertions(+) + +commit 995e7ace07ce21e7e5918f74c3a2a56c75c3e8f6 +Author: Aleksander Morgado +Date: Tue Nov 22 18:52:02 2011 +0100 + + sim: handle EnablePin() calls + + src/mm-sim.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +commit b29a8ba44f7f9886a86a064e9e260800c5147509 +Author: Aleksander Morgado +Date: Tue Nov 22 18:51:25 2011 +0100 + + sim: handle ChangePin() calls + + src/mm-sim.c | 121 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 121 insertions(+) + +commit 23dd4d7e8227b2b1bd11eaee47aa3214c9ef688c +Author: Aleksander Morgado +Date: Tue Nov 22 18:47:00 2011 +0100 + + sim: allow re-launching initialization + + It may happen that we cannot load property values when the SIM is + locked, so + we need to enable re-launching initialization in the object API. + + src/mm-sim.c | 53 +++++++++++++++++++++++++++++++++++++++++------------ + src/mm-sim.h | 7 +++++++ + 2 files changed, 48 insertions(+), 12 deletions(-) + +commit ff0136ed04ca8b94de1de3b78bd63a22dd01e809 +Author: Aleksander Morgado +Date: Tue Nov 22 18:45:20 2011 +0100 + + sim: load OperatorName during init + + src/mm-sim.c | 136 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 136 insertions(+) + +commit e3e3b32b0a2586ab0d507b7cee4721fdc9257169 +Author: Aleksander Morgado +Date: Tue Nov 22 18:43:33 2011 +0100 + + sim: load OperatorIdentifier during init + + src/mm-sim.c | 154 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 154 insertions(+) + +commit bdd1d23ed25cf9539db13052547cce7a62db840c +Author: Aleksander Morgado +Date: Tue Nov 22 18:41:55 2011 +0100 + + sim: load IMSI during init + + src/mm-sim.c | 100 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 100 insertions(+) + +commit 87823387f458efc60afe1147f72ea6609006f180 +Author: Aleksander Morgado +Date: Tue Nov 22 18:32:19 2011 +0100 + + sim: load SIM Identifier during init + + src/mm-sim.c | 200 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 200 insertions(+) + +commit e40d32ac94382361b0c0e18cd81cc98ebb38bc44 +Author: Aleksander Morgado +Date: Tue Nov 22 18:16:17 2011 +0100 + + core: new MMSim object, inherits from MmGdbusSim + + src/Makefile.am | 2 + + src/mm-sim.c | 352 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sim.h | 63 ++++++++++ + 3 files changed, 417 insertions(+) + +commit 1453f352bca34f8592a33954d628acfec66d4336 +Author: Aleksander Morgado +Date: Wed Nov 23 13:16:28 2011 +0100 + + iface-modem: relaunch init when being unlocked + + src/mm-iface-modem.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit ca15a10629b4d977177bc8406e833b49a5f5aee2 +Author: Aleksander Morgado +Date: Tue Nov 22 18:01:09 2011 +0100 + + iface-modem: new `State' property, bound to the one in the + MmGDbusModem skeleton + + src/mm-iface-modem.c | 38 +++++++++++++++++++++++++++++++++++++- + src/mm-iface-modem.h | 1 + + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 48babcf97648e71b329bb5e809a08e1fd2c783d2 +Author: Aleksander Morgado +Date: Tue Nov 22 17:53:49 2011 +0100 + + iface-modem: load `SupportedModes' and `SupportedBands' during init + + src/mm-iface-modem.c | 34 ++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 16 ++++++++++++++++ + 2 files changed, 50 insertions(+) + +commit 7a20ad46d81ca8c87f0121af68f979a659fcd4ec +Author: Aleksander Morgado +Date: Tue Nov 22 17:47:46 2011 +0100 + + iface-modem: load `UnlockRequired' and `UnlockRetries' during init + + And also allow being loaded upon user request, with + `mm_iface_modem_unlock_check()'. + + src/mm-iface-modem.c | 198 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 26 +++++++ + 2 files changed, 224 insertions(+) + +commit 9852433095eca82cb6efd842c74be85bbacb7ea6 +Author: Aleksander Morgado +Date: Tue Nov 22 17:40:52 2011 +0100 + + iface-modem: load `EquipmentIdentifier' and `DeviceIdentifier' + during init + + src/mm-iface-modem.c | 34 ++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 16 ++++++++++++++++ + 2 files changed, 50 insertions(+) + +commit 7a9b0d9faced7c960b7e35d48df9d705feb1932b +Author: Aleksander Morgado +Date: Tue Nov 22 17:38:42 2011 +0100 + + iface-modem: load `Manufacturer', `Model' and `Revision' during init + + src/mm-iface-modem.c | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 24 +++++++++++++++++ + 2 files changed, 99 insertions(+) + +commit b35be6141500d69000956210292bb7094315b80f +Author: Aleksander Morgado +Date: Tue Nov 22 17:37:15 2011 +0100 + + iface-modem: load `MaxBearers' and `MaxActiveBearers' during init + + src/mm-iface-modem.c | 41 +++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 16 ++++++++++++++++ + 2 files changed, 57 insertions(+) + +commit b6539e9e132995aaef7a6026f06d7bf569891934 +Author: Aleksander Morgado +Date: Tue Nov 22 17:30:57 2011 +0100 + + iface-modem: load `ModemCapabilities' and `CurrentCapabilities' + during init + + When the interface gets initialized, start loading modem and current + capabilities. + + src/mm-iface-modem.c | 66 + ++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-iface-modem.h | 16 +++++++++++++ + 2 files changed, 78 insertions(+), 4 deletions(-) + +commit 88e6b0e4e64e87ea371e8dec5f1889254f220a56 +Author: Aleksander Morgado +Date: Tue Nov 22 17:33:47 2011 +0100 + + iface-modem: set `Device', `Driver' and `Plugin' during init + + Values taken from the MMBaseModem object, which are not expected + to change + during the lifetime of the Modem object. + + src/mm-iface-modem.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 9e7cd2a3450a56bd3af99e7d22146c66189774e2 +Author: Aleksander Morgado +Date: Thu Nov 3 14:55:00 2011 +0100 + + core: new MMIfaceModem interface + + This interface controls the availability of the DBus Modem interface, + and + implements the actions that may be performed in the interface. + + src/Makefile.am | 2 + + src/mm-iface-modem.c | 467 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-iface-modem.h | 49 ++++++ + 3 files changed, 518 insertions(+) + +commit 8069c751a04144478ce243ecaa9fdfd2b9794d02 +Author: Aleksander Morgado +Date: Wed Nov 23 10:03:34 2011 +0100 + + base-modem: new `enable()' and `disable()' async methods + + Users will be able to enable or disable modems using the DBus + interface. We will + chain up the `Enable(boolean)' call from the DBus interface to these + new methods + in the base modem class. + + src/mm-base-modem.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit b00c4099783cd4a994e7771ed275c7c61591a45b +Author: Aleksander Morgado +Date: Tue Nov 8 17:20:34 2011 +0100 + + base-modem: new virtual initialize() method + + Whenever the first AT port is grabbed, we launch the initialize() + method, which + must have been implemented by the corresponding modem subclass. + + src/mm-base-modem.c | 40 ++++++++++++++++++++++++---------------- + src/mm-base-modem.h | 10 ++++++++++ + 2 files changed, 34 insertions(+), 16 deletions(-) + +commit 677e04be95dbbac200a9ab3fab4aea64317547bf +Author: Aleksander Morgado +Date: Tue Nov 22 18:35:56 2011 +0100 + + base-modem: new property to keep the Connection object + + src/mm-base-modem.c | 22 ++++++++++++++++++++++ + src/mm-base-modem.h | 1 + + 2 files changed, 23 insertions(+) + +commit d32b006cce8c62a1f0e2d4cf9fe0121a4a541316 +Author: Aleksander Morgado +Date: Tue Nov 22 18:24:08 2011 +0100 + + base-modem: new properties for vendor and product IDs + + These will be set during modem object creation. + + src/mm-base-modem.c | 49 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-modem.h | 5 +++++ + 2 files changed, 54 insertions(+) + +commit d5a0efc659b01ed6aafe2d20f0c03f10c8fe11e3 +Author: Aleksander Morgado +Date: Sat Nov 12 15:50:22 2011 +0100 + + base-modem: getters for primary/secondary/qcdm ports + + src/mm-base-modem.c | 24 ++++++++++++++++++++++++ + src/mm-base-modem.h | 4 ++++ + 2 files changed, 28 insertions(+) + +commit 4a096c8c5677c82fcc0cdc2d4fc4ec9473e06d92 +Author: Aleksander Morgado +Date: Tue Nov 8 17:00:31 2011 +0100 + + base-modem: set v1 serial parser always + + CDMA modems used to use the v1_e1 serial parser; but we'll try to + setup a common + one in all modems. + + src/mm-base-modem.c | 25 ++++++++----------------- + 1 file changed, 8 insertions(+), 17 deletions(-) + +commit 0d53a72d415af348e6f8cd2a172afa632166ca92 +Author: Aleksander Morgado +Date: Tue Nov 8 15:18:31 2011 +0100 + + base-modem: new properties to handle Device, Driver and Plugin + + They will be set when constructing the object. + + src/mm-base-modem.c | 80 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-modem.h | 7 +++++ + 2 files changed, 87 insertions(+) + +commit b6cb5bd6daac1b434a57a34ec2e08121455f3397 +Author: Aleksander Morgado +Date: Fri Nov 4 12:43:06 2011 +0100 + + base-modem: ported all port grabbing/releasing logic to the base + object + + src/mm-base-modem.c | 292 + +++++++++++++++++++++++++++++++++++++--------------- + src/mm-base-modem.h | 22 ++-- + 2 files changed, 222 insertions(+), 92 deletions(-) + +commit f39923c97d33850cc1e70d23b2e8d808cda67fec +Author: Aleksander Morgado +Date: Thu Nov 3 12:21:48 2011 +0100 + + base-modem: expect a GDBusMethodInvocation as context of the auth + request + + src/mm-base-modem.c | 6 ++---- + src/mm-base-modem.h | 2 +- + 2 files changed, 3 insertions(+), 5 deletions(-) + +commit 9a72ac80d021f485b3811e49ae7a097990525a0e +Author: Aleksander Morgado +Date: Wed Nov 2 17:18:25 2011 +0100 + + core: new MMBaseModem abstract type + + Basically, a replacement of the MMModemBase type, being prepared + to handle + multimode devices. + + This object derives from a MmGdbusObjectSkeleton, which makes it + suitable to be + controlled within the GDBusObjectManagerServer. + + src/Makefile.am | 2 + + src/mm-base-modem.c | 414 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-base-modem.h | 82 +++++++++++ + 3 files changed, 498 insertions(+) + +commit f15daaf587ae296c6bec6f79a24cecb1860508bb +Author: Aleksander Morgado +Date: Tue Nov 22 16:52:19 2011 +0100 + + core: new AT command and sequence processors + + This setup, allows: + - Running a single command and processing its result. + - Running a set of N commands, providing a global result after + all have + been executed. + - Running a set of N commands out of M (N +Date: Tue Oct 25 17:27:30 2011 +0200 + + manager: make it export the Object Manager interface + + src/mm-manager.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +commit 0cc17ed82f8a2c3b5b12158bf138007459ef289f +Author: Aleksander Morgado +Date: Tue Oct 25 17:13:12 2011 +0200 + + manager: let it be initable + + The MMManager object creation may fail due to environment reasons + (i.e. no + plugins found, or problems exporting DBus interfaces), so we can + use the + initable interface to properly handle those situations. + + src/mm-manager.c | 91 + ++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 52 insertions(+), 39 deletions(-) + +commit bc78453d794e7e82d5cc726d716b1a84454763de +Author: Aleksander Morgado +Date: Tue Oct 25 16:59:59 2011 +0200 + + manager: keep the GDBus connection reference in a 'connection' + property + + src/mm-manager.c | 63 + +++++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-manager.h | 2 ++ + 2 files changed, 62 insertions(+), 3 deletions(-) + +commit 68fcfa4530eb47a1a2947aa29a18b49378a5c9be +Author: Aleksander Morgado +Date: Tue Oct 25 16:46:07 2011 +0200 + + manager: use G_TYPE_INSTANCE_GET_PRIVATE() just to create the + private struct + + A new 'priv' pointer is added in the MMManager struct, which will + contain the + address of the private structure. + + src/mm-manager.c | 68 + ++++++++++++++++++++++++-------------------------------- + src/mm-manager.h | 3 +++ + 2 files changed, 32 insertions(+), 39 deletions(-) + +commit 60c7f7d9ee4babfa21c485d526b1baf0b5c2d245 +Author: Aleksander Morgado +Date: Tue Oct 25 13:06:21 2011 +0200 + + core: implement the Manager1 DBus interface, based on GDBus + + The MMManager object now derives from the gdbus-codegen-generated + MmGdbusOrgFreedesktopModemManager1Skeleton object, and implements + the handlers + for the SetLogging() and ScanDevices() DBus methods. + + The main program is also modified to be based on GDBus. + + src/main.c | 137 ++++++++++-------------- + src/mm-manager.c | 312 + +++++++++++++++++++++++-------------------------------- + src/mm-manager.h | 19 ++-- + 3 files changed, 195 insertions(+), 273 deletions(-) + +commit a6d9bad4bdba542626984fabc8c851daec49cbe7 +Author: Aleksander Morgado +Date: Tue Nov 8 18:03:53 2011 +0100 + + plugin-base: properly handle Core errors + + src/mm-plugin-base.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 1e6b29bcca17c64818c1c49a1694b6caffde1611 +Author: Aleksander Morgado +Date: Mon Sep 19 19:23:52 2011 +0200 + + plugin-base: clear internally tracked probe if port unsupported + + If the port is supported by the plugin, leave the probe in the + internal HT until + the port gets grabbed afterwards. + + src/mm-plugin-base.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +commit d9b2b6f8ec450dbbdf2f738ab26ee78d357d2034 +Author: Aleksander Morgado +Date: Sun Sep 18 23:50:22 2011 +0200 + + manager: clear cached port probe when device is removed + + src/mm-manager.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 95ade9c6177c1d51093e81a3fa6b6c28fc48a937 +Author: Aleksander Morgado +Date: Sun Sep 18 23:23:18 2011 +0200 + + plugin-base: remove `MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS' status + + Support checks are fully asynchronous and result is always reported + when the + check is considered ready, so in-progress replies to + `mm_plugin_supports_port_finish()' don't make any sense. + + src/mm-plugin-manager.c | 5 ----- + src/mm-plugin.h | 1 - + 2 files changed, 6 deletions(-) + +commit 2b209554893b88443cb9295f8177c87b8ba6aa1f +Author: Aleksander Morgado +Date: Mon Sep 19 20:27:11 2011 +0200 + + plugin-base: don't report numeric support level in the [0-100] range + + There is no single case where more than one plugin may end up wanting + to support + a given port, and therefore there is no need to report the numeric + support level + when reporting SUPPORTED. + + src/mm-plugin-base.c | 1 - + src/mm-plugin-manager.c | 49 + +++++++++++++------------------------------------ + src/mm-plugin.c | 2 -- + src/mm-plugin.h | 2 -- + 4 files changed, 13 insertions(+), 41 deletions(-) + +commit a1d2f200214c7f691e4df535490f51c398ca32d4 +Author: Aleksander Morgado +Date: Sun Sep 18 23:23:18 2011 +0200 + + plugin-base: avoid trying to probe 'net' devices + + Some devices support 'net' devices, which cannot be AT or QCDM probed. + + If the port being checked for support corresponds to an already + existing modem, + the port will be reported as SUPPORTED. + + If this is the first port of the modem being checked for support, + we will just + DEFER the support check until we get a modem created. + + src/mm-plugin-base.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit db356bb20b5969c9680e9f11e21ad9bc51be30ec +Author: Aleksander Morgado +Date: Sun Sep 18 22:55:47 2011 +0200 + + plugin-base: keep a MMPluginSupportsResult in the async result + + Instead of just a boolean, provide a MMPluginSupportsResult, so that + we can pass + it as is during `supports_port_finish()'. + + src/mm-plugin-base.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +commit 2588c17ad3c9c83d9992dc49d4ab1420ac38fed7 +Author: Aleksander Morgado +Date: Thu Sep 15 21:46:23 2011 +0200 + + generic: rewrite the plugin to use the new port probing + + plugins/mm-plugin-generic.c | 153 + +++++++++++++++++--------------------------- + 1 file changed, 57 insertions(+), 96 deletions(-) + +commit afd386738d1ff74e578bd95433d089a9744c5b64 +Author: Aleksander Morgado +Date: Thu Sep 15 23:33:54 2011 +0200 + + plugin-base: improve the logic to check whether vendor or product + probing needed + + If the plugin does a Vendor ID check and it passes, it doesn't + need Vendor + string probing. + + If the plugin does a Vendor ID check and it fails: + - If Vendor strings reported, it needs Vendor probing. + - If Vendor strings not reported, fail as unsupported. + + If the plugin does a Product ID check and it passes, it doesn't + need Product + string probing. + + If the plugin does a Product ID check and it fails: + - If Product strings reported, it needs Product probing. + - If Product strings not reported, fail as unsupported. + + src/mm-plugin-base.c | 80 + +++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 60 insertions(+), 20 deletions(-) + +commit 0646fc9d99007dd4182a1d941d226305ba0774ea +Author: Aleksander Morgado +Date: Thu Sep 15 22:57:13 2011 +0200 + + plugin-base: apply post-probing filtering + + Once probing is finished, the plugin will check whether the port + is supported + or not based on the following filters: + - Capabilities + - Reported Vendor string + - Reported Product string + + src/mm-plugin-base.c | 124 + ++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 112 insertions(+), 12 deletions(-) + +commit f92fbcc906fe080afb29aeada8bbfe1beca060da +Author: Aleksander Morgado +Date: Thu Sep 15 22:30:12 2011 +0200 + + plugin-base: apply pre-probing filtering + + Before any real probing is launched in the port, the plugin will + check whether + it can skip the request based on the following filters: + - Subsystems + - Drivers + - udev-reported Vendor ID + - udev-reported Product ID + - udev-reported Tags + + src/mm-plugin-base.c | 102 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 102 insertions(+) + +commit a67d5dc1b84db6cc1517475b90a047d6d9a19968 +Author: Aleksander Morgado +Date: Thu Sep 15 21:27:11 2011 +0200 + + plugin-base: make the plugin base use the new port probing mechanism + + The previous 'MMPluginBaseSupportsTask' object is more or less + equivalent to the + new `MMPortProbe' in terms of what information it contains. The + main difference + being that the new `MMPortProbe' object handles internally the + whole probing + flow as needed: only the needed probing sequences are done. For + example, vendor + or product string probing will only be performed if a plugin + requests it. + + src/mm-plugin-base.c | 1285 + ++++---------------------------------------------- + src/mm-plugin-base.h | 125 +---- + 2 files changed, 99 insertions(+), 1311 deletions(-) + +commit 7b687b4aae5c1fc89b9203bd43602b4820042d7c +Author: Aleksander Morgado +Date: Tue Nov 8 17:57:33 2011 +0100 + + build: temporarily disable compilation of plugins + + plugins/Makefile.am | 486 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 239 insertions(+), 247 deletions(-) + +commit c112e19896921810fe469ef93a268f5431fad93d +Author: Aleksander Morgado +Date: Tue Nov 8 17:56:18 2011 +0100 + + port-probe: properly handle Core errors + + Fixes compilation of the Port Probe object. + + src/mm-port-probe.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 963eb873e10dd06b17363a08414c278d5e1ba7b3 +Author: Aleksander Morgado +Date: Sun Sep 18 22:20:11 2011 +0200 + + plugin-base: new 'allowed-udev-tags' property + + The plugins can set this property to filter support check requests + by the + availability of a given udev tag in the port. The value given to + the property + should be a NULL-terminated array of C strings, e.g.: + + const gchar *tags[] = { "ID_MM_X22X_TAGGED", NULL }; + + src/mm-plugin-base.c | 17 +++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 18 insertions(+) + +commit 18238ed50ee626bff10aa9dc86e06223a776c255 +Author: Aleksander Morgado +Date: Mon Sep 19 13:31:47 2011 +0200 + + plugin-base: new 'allowed-drivers' property + + The plugins can set this property to filter support check requests + by physical + device driver. The value given to the property should be a + NULL-terminated array + of C strings, e.g.: + + const gchar *drivers[] = { "qcserial", NULL }; + + src/mm-plugin-base.c | 17 +++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 18 insertions(+) + +commit 24ebb00ed2010ba3c724afd4d35f39bf02840b09 +Author: Aleksander Morgado +Date: Thu Sep 15 23:45:22 2011 +0200 + + plugin-base: new 'allowed-qcdm' property + + The plugins can set this boolean property to specify whether they + can handle + QCDM ports, and therefore probing for them is needed. + + src/mm-plugin-base.c | 17 +++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 18 insertions(+) + +commit 8f95a2d78d0f7d94597699095838d69b6f3b50d1 +Author: Aleksander Morgado +Date: Thu Sep 15 20:09:07 2011 +0200 + + plugin-base: new 'send-delay' property + + The plugins can set this property to provide a custom value for the + send delay + used for characters sent to the AT port during probing. + + The value given to the property should be a guint64 specifying the + delay in + microseconds. + + src/mm-plugin-base.c | 20 ++++++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 21 insertions(+) + +commit a935cd9fb68df10c3b824251a3335e02ba40c322 +Author: Aleksander Morgado +Date: Thu Sep 15 19:48:36 2011 +0200 + + plugin-base: new 'allowed-capabilities' property + + The plugins can set this property to filter support check requests + by probed + capabilities. + The value given to the property should be a guint built as a mask of + MM_PORT_PROBE_CAPABILITY flags, e.g.: + + const guint capabilities = (MM_PORT_PROBE_CAPABILITY_GSM | + MM_PORT_PROBE_CAPABILITY_CDMA); + + src/mm-plugin-base.c | 17 +++++++++++++++++ + src/mm-plugin-base.h | 1 + + 2 files changed, 18 insertions(+) + +commit 8ccb2229782a8a02306a61a382312d2e8bf206c7 +Author: Aleksander Morgado +Date: Thu Sep 15 19:40:56 2011 +0200 + + plugin-base: new 'allowed-vendor-strings' and + 'allowed-product-strings' properties + + The plugins can set these properties to filter support check + requests by + AT-reported Vendor string and Product string. + + The value given to the properties should be a NULL-terminated array + of strings, + e.g., + + static const gchar *vendor_strings[] = { "cinterion" , NULL }; + + src/mm-plugin-base.c | 35 +++++++++++++++++++++++++++++++++++ + src/mm-plugin-base.h | 14 ++++++++------ + 2 files changed, 43 insertions(+), 6 deletions(-) + +commit 2d8fb51c6b6669afa60594c04244f17653df0fb7 +Author: Aleksander Morgado +Date: Thu Sep 8 18:22:19 2011 +0200 + + plugin-base: new 'custom-init' property + + The plugins can set this property to provide custom initialization + commands that + should be issued to the modem before real probing starts. + + The value given to the property should be an array of + MMPortProbeAtCommand + variables finished with a last one exposing a NULL command, e.g.: + + static gboolean + parse_init (const gchar *response, + const GError *error, + GValue *result, + GError **result_error) + { + if (error) + return FALSE; + + /* If we didn't get any error, it is an AT port */ + g_value_init (result, G_TYPE_BOOLEAN); + g_value_set_boolean (result, TRUE); + return TRUE; + } + + static gboolean + parse_init_last (const gchar *response, + const GError *error, + GValue *result, + GError **result_error) + { + g_value_init (result, G_TYPE_BOOLEAN); + /* On last error, report as not being an AT port */ + g_value_set_boolean (result, error ? FALSE : TRUE); + return TRUE; + } + + static const MMPortProbeAtCommand custom_init[] = { + { "ATE1 E0", parse_init }, + { "ATE1 E0", parse_init }, + { "ATE1 E0", parse_init_last }, + { NULL } + }; + + src/mm-plugin-base.c | 19 +++++++++++++++++++ + src/mm-plugin-base.h | 12 ++++++++++++ + 2 files changed, 31 insertions(+) + +commit 806aabd22d725a329bdfe12ac258cb1db293fc3d +Author: Aleksander Morgado +Date: Wed Sep 7 18:28:28 2011 +0200 + + plugin-base: new 'allowed-vendor-ids' and 'allowed-product-ids' + properties + + The plugins can set these properties to filter support check + requests by + udev-reported Vendor ID and Product ID. + + The value given to the properties should be a 0-terminated array + of guint16s, + e.g., + + static const guint16 vendor_ids[] = { 0x0421 , 0 }; + + src/mm-plugin-base.c | 34 ++++++++++++++++++++++++++++++++++ + src/mm-plugin-base.h | 8 +++++--- + 2 files changed, 39 insertions(+), 3 deletions(-) + +commit 59c783eb614c0a56e2d1a2daeb0fef0decdf690e +Author: Aleksander Morgado +Date: Wed Sep 7 18:05:42 2011 +0200 + + plugin-base: new 'allowed-subsystems' property + + The plugins can set this property to filter support check requests + by subsystem. + The value given to the property should be a NULL-terminated array + of C strings, + e.g.: + + const gchar *subsystems[] = { "tty", NULL }; + + src/mm-plugin-base.c | 19 +++++++++++++++++++ + src/mm-plugin-base.h | 5 +++-- + 2 files changed, 22 insertions(+), 2 deletions(-) + +commit 27e1d97aca340877db8f2b2181406b3ed8c06a5f +Author: Aleksander Morgado +Date: Sun Sep 11 19:22:12 2011 +0200 + + port-probe: new cache of Port Probe results + + Whenever a plugin has probed for some information in a given port, + that data + should be available for any other plugin wanting it during its + own probing + process. This new cache of Port Probe results allows to easily + retrieve the + already probed information. + + src/Makefile.am | 2 ++ + src/mm-port-probe-cache.c | 80 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-port-probe-cache.h | 30 ++++++++++++++++++ + 3 files changed, 112 insertions(+) + +commit a3ace206b08998e80891e783abbd2d7ca5add297 +Author: Aleksander Morgado +Date: Sat Sep 10 18:38:29 2011 +0200 + + port-probe: add comment explaining the probing process flow + + src/mm-port-probe.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit fa3fa38e0db3475d6f4c0273d6855fce375d1be0 +Author: Aleksander Morgado +Date: Sat Sep 10 18:17:06 2011 +0200 + + port-probe: allow providing custom initialization AT commands + + src/mm-port-probe.c | 38 ++++++++++++++++++++++++++++++++++---- + src/mm-port-probe.h | 3 +++ + 2 files changed, 37 insertions(+), 4 deletions(-) + +commit 610bffc4e817fa04dcde19d31584b194038fdde6 +Author: Aleksander Morgado +Date: Sat Sep 10 16:20:11 2011 +0200 + + port-probe: enable probing for QCDM support + + src/mm-port-probe.c | 167 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-port-probe.h | 2 + + 2 files changed, 168 insertions(+), 1 deletion(-) + +commit b73fb8e8f27ac34ec5aa16e3e5a3605b03dbe740 +Author: Aleksander Morgado +Date: Sat Sep 10 11:40:23 2011 +0200 + + port-probe: enable probing for Product + + src/mm-port-probe-at-command.c | 30 ++++++++++++++++++++++++++++ + src/mm-port-probe-at-command.h | 1 + + src/mm-port-probe.c | 45 + +++++++++++++++++++++++++++++++++++++++--- + src/mm-port-probe.h | 2 ++ + 4 files changed, 75 insertions(+), 3 deletions(-) + +commit 1f9fd9e0beba7fd90c46d057c849fb007001b75f +Author: Aleksander Morgado +Date: Sat Sep 10 11:19:12 2011 +0200 + + port-probe: enable probing for Vendor + + src/mm-port-probe-at-command.c | 28 +++++++++++++++++++++++++ + src/mm-port-probe-at-command.h | 1 + + src/mm-port-probe.c | 46 + +++++++++++++++++++++++++++++++++++++++--- + src/mm-port-probe.h | 6 ++++-- + 4 files changed, 76 insertions(+), 5 deletions(-) + +commit 05f8493ee7baa43cb7ff1242eae4930fc85e6ee5 +Author: Aleksander Morgado +Date: Sat Sep 10 00:47:54 2011 +0200 + + port-probe: enable probing for Capabilities + + src/mm-port-probe-at-command.c | 121 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-port-probe-at-command.h | 1 + + src/mm-port-probe.c | 52 ++++++++++++++++-- + src/mm-port-probe.h | 28 +++++++++- + 4 files changed, 196 insertions(+), 6 deletions(-) + +commit 6816c2e61def241eb2a991a11c21da699b06b54f +Author: Aleksander Morgado +Date: Fri Sep 9 23:56:22 2011 +0200 + + port-probe: enable probing for AT support + + We will initially probe for AT support in the port. + + src/Makefile.am | 1 + + src/mm-port-probe-at-command.c | 71 ++++++++ + src/mm-port-probe-at-command.h | 3 + + src/mm-port-probe.c | 383 + ++++++++++++++++++++++++++++++++++++++++- + src/mm-port-probe.h | 8 + + 5 files changed, 461 insertions(+), 5 deletions(-) + +commit d7238403c485d040dc77b3c2e428b876c3b33bdf +Author: Aleksander Morgado +Date: Fri Sep 9 21:32:03 2011 +0200 + + port-probe: new type to define commands used during probing + + The new `MMPortProbeAtCommand' type defines what command will be + sent to the + serial AT port, and also a response processor method to parse + the string + returned by the port. + + The response processor gets as input either the text reply string + or an error, + and it should give as output either a GValue (type depends on the + probing kind + being done) or a new error (which will force the whole probing + process to be + aborted. + + src/Makefile.am | 1 + + src/mm-port-probe-at-command.h | 54 + ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 55 insertions(+) + +commit f7b1d99fa0ac00889a65b22905939e4f86061902 +Author: Aleksander Morgado +Date: Fri Sep 9 20:45:37 2011 +0200 + + port-probe: allow cancelling the probing operation + + The new `mm_port_probe_cancel()' will cancel the probing operation + currently in + progress, if any. Note that we don't need to pass any argument to + specify which + operation to cancel, as there can only be one. + + src/mm-port-probe.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-port-probe.h | 1 + + 2 files changed, 46 insertions(+), 2 deletions(-) + +commit f227572d8f1f8516e2ea2a38bf7a8a73387165d5 +Author: Aleksander Morgado +Date: Fri Sep 9 20:22:10 2011 +0200 + + port-probe: setup an asynchronous method for port probing + + The new method `mm_port_probe_run()' will run the whole probing + process + asynchronously. Result of the probing can be later obtained with + `mm_port_probe_run_finish()'. + + src/mm-port-probe.c | 87 + ++++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-port-probe.h | 9 ++++++ + 2 files changed, 95 insertions(+), 1 deletion(-) + +commit 1b84994febfdd9c821335157f0a8107f1842566f +Author: Aleksander Morgado +Date: Fri Sep 9 20:00:57 2011 +0200 + + port-probe: set port details when creating the object + + Each port probe is always associated to one specific port. + + src/mm-port-probe.c | 64 + +++++++++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-port-probe.h | 13 ++++++++++- + 2 files changed, 74 insertions(+), 3 deletions(-) + +commit 74145f5af7c4e80ea09b86654fd524b4cd4759a8 +Author: Aleksander Morgado +Date: Fri Sep 9 19:49:28 2011 +0200 + + port-probe: new MMPortProbe object + + src/Makefile.am | 2 ++ + src/mm-port-probe.c | 62 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-port-probe.h | 47 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 111 insertions(+) + +commit 916cf5dd3e5476c38b795ae2bfac7b31c9497196 +Author: Aleksander Morgado +Date: Tue Sep 6 22:00:12 2011 +0200 + + manager: integrate the Plugin Manager + + All plugin handling and port support checks now done by the Plugin + Manager. + + src/mm-manager.c | 754 + +++++++++++++++---------------------------------------- + 1 file changed, 200 insertions(+), 554 deletions(-) + +commit fad89b1d7e88f742ecd1f94d78401cd558ecb65c +Author: Aleksander Morgado +Date: Tue Sep 6 20:13:27 2011 +0200 + + plugin-manager: new methods to check for ongoing port support + operations + + The new mm_plugin_manager_is_finding_port_support() allows to check + whether the + Plugin Manager is looking for support in a specific port. + + The new mm_plugin_manager_is_checking_device_support() allows to + check whether + the Plugin Manager is looking for support in any port of a given + device. + + src/mm-plugin-manager.c | 50 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-manager.h | 13 +++++++++++++ + 2 files changed, 63 insertions(+) + +commit 5f2d0d474cf9b4308715f4ef811127410e874240 +Author: Aleksander Morgado +Date: Tue Sep 6 19:45:54 2011 +0200 + + plugin-manager: allow suggesting a plugin when launching support + checks + + The newly launched support check will start probing with the + suggested plugin + right away. + + src/mm-plugin-manager.c | 8 ++++++++ + src/mm-plugin-manager.h | 1 + + 2 files changed, 9 insertions(+) + +commit 8fed241767b65ca4a651057109324a81e7c20e0b +Author: Aleksander Morgado +Date: Tue Sep 6 19:30:19 2011 +0200 + + plugin-manager: propagate support check results to tasks in the + same device + + As soon as the first support check of a port in a given device + finishes with a + valid best plugin and level > 0, propagate the result to other + support tasks + corresponding to ports in the same physical device. + + Previously, this propagation of support check results was only done + once the + port was grabbed by a plugin, not just when the plugin reported + that it + supported it. This change in behaviour isn't probably a big deal, + as there + should not be any case where a plugin says it supports a port and + then cannot + grab it. + + src/mm-plugin-manager.c | 129 + ++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 108 insertions(+), 21 deletions(-) + +commit 0626de08796d4411c6c0e38e002b0ec3919893fd +Author: Aleksander Morgado +Date: Tue Sep 6 00:47:02 2011 +0200 + + plugin-manager: keep track of all launched support checks + + We will keep a reference to each of the support checks currently + in progress, + grouped by physical device path. The stored SupportsInfo structs as + well as + the support check operations, are guaranteed to be kept valid as + long as the + Plugin Manager exists. Or in other words, the Plugin Manager cannot + be disposed + if there is still an ongoing supports check operation. + + src/mm-plugin-manager.c | 86 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 1e3213970714e5d5144ba0a00ea47d0c9681cce4 +Author: Aleksander Morgado +Date: Tue Sep 6 00:12:57 2011 +0200 + + plugin-manager: new method to look for best plugin supporting a + given port + + The new `mm_plugin_manager_find_port_support()' method requests + the Plugin + Manager to iterate over the list of plugins internally handled, + launching + supports task for the given port in each of them. + + The method is fully asynchronous, and the result can be retrieved with + `mm_plugin_manager_find_port_support_finish()' once the operation + is ready. + + src/mm-plugin-manager.c | 203 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-manager.h | 16 ++++ + 2 files changed, 219 insertions(+) + +commit 7007825781122c1f1942a4135f39088ab75782f3 +Author: Aleksander Morgado +Date: Mon Sep 5 22:39:22 2011 +0200 + + plugin-manager: ensure we always print paths in UTF-8 + + There is little chance of having a PLUGINDIR which is not UTF-8, + but it may + happen, and g_log() won't like it. + + src/mm-plugin-manager.c | 56 + ++++++++++++++++++++++++++++++------------------- + 1 file changed, 34 insertions(+), 22 deletions(-) + +commit 035be287304515f53539b4d22f6e44712c06bdd7 +Author: Aleksander Morgado +Date: Mon Sep 5 22:30:13 2011 +0200 + + plugin-manager: find and load plugins when the manager object + is created + + Ported the plugin finding and loading code from the MMManager object. + + src/mm-plugin-manager.c | 179 + +++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-plugin-manager.h | 2 + + 2 files changed, 179 insertions(+), 2 deletions(-) + +commit 51a8dc6ff3d2d92dfe1e8fc99c73ec84e4948354 +Author: Aleksander Morgado +Date: Mon Sep 5 21:16:23 2011 +0200 + + plugin-manager: let it be initable + + Looking for plugins and loading them will be done during the object + creation, + so the operation may fail and we need to report it. + + src/mm-plugin-manager.c | 29 ++++++++++++++++++++++++++--- + src/mm-plugin-manager.h | 2 +- + 2 files changed, 27 insertions(+), 4 deletions(-) + +commit 03655fcf9fd34d1153d8c0f8ae9f306baf974da3 +Author: Aleksander Morgado +Date: Mon Sep 5 21:03:12 2011 +0200 + + plugin-manager: new MMPluginManager object + + src/Makefile.am | 2 ++ + src/mm-plugin-manager.c | 58 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-manager.h | 43 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 103 insertions(+) + +commit 62030debf261db70d6e0ae76c18178c860b24da6 +Author: Aleksander Morgado +Date: Mon Sep 5 00:05:27 2011 +0200 + + plugin-base: rename 'cancel_supports_port' to 'supports_port_cancel' + + We now have 'supports_port' (async method) and 'supports_port_finish' + (to get + the result of the async method), so it makes sense to rename the + method to + 'supports_port_cancel'. + + src/mm-manager.c | 12 +++++++++--- + src/mm-plugin-base.c | 4 ++-- + src/mm-plugin.c | 4 ++-- + src/mm-plugin.h | 4 ++-- + 4 files changed, 15 insertions(+), 9 deletions(-) + +commit dc30536456dbbface927e6c76ca3bf3e4647afa5 +Author: Aleksander Morgado +Date: Sun Sep 4 23:59:43 2011 +0200 + + plugin-base: rewrite port supports check as fully asynchronous + + Before this change, supports check was either synchronous (e.g. in + some + UNSUPPORTED cases) or asynchronous (when IN_PROGRESS was returned). + + With this fix, the supports check requested to the plugin will + always be + completed asynchronously; either directly in an idle before launching + any real + probing operation, or once the probing operation is finished. + + Therefore, it is not expected to get a IN_PROGRESS reply in + mm_plugin_supports_port_finish(), only UNSUPPORTED|SUPPORTED|DEFERRED. + + src/mm-manager.c | 75 ++++++++++++++-------- + src/mm-plugin-base.c | 176 + ++++++++++++++++++++++++++++++++++++--------------- + src/mm-plugin.c | 55 ++++++++++------ + src/mm-plugin.h | 56 +++++++++------- + 4 files changed, 244 insertions(+), 118 deletions(-) + +commit d47176a32c45da0f63ec5ab8024cf4e5f6467a7f +Author: Aleksander Morgado +Date: Fri Sep 2 20:28:12 2011 +0200 + + core: avoid using DBusGMethodInvocation in auth API + + While porting to GDBus, use opaque pointers. This allows us to + include either a + DBusGMethodInvocation or a GDBusMethodInvocation in the 'context' + pointer. + + Once fully ported to GDBus, we can safely change it back to make + the context be + a GDBusMethodInvocation. + + src/mm-auth-provider-polkit.c | 29 +++++++++++++++++++++-------- + src/mm-auth-provider.c | 4 ++-- + src/mm-auth-provider.h | 4 ++-- + src/mm-auth-request-polkit.c | 9 +++------ + src/mm-auth-request-polkit.h | 3 ++- + src/mm-auth-request.c | 4 ++-- + src/mm-auth-request.h | 7 +++++-- + src/mm-manager.c | 2 +- + src/mm-modem-cdma.c | 2 +- + src/mm-modem-firmware.c | 6 +++--- + src/mm-modem-gsm-card.c | 16 ++++++++-------- + src/mm-modem-gsm-network.c | 2 +- + src/mm-modem-gsm-sms.c | 16 ++++++++-------- + src/mm-modem-gsm-ussd.c | 6 +++--- + src/mm-modem-location.c | 4 ++-- + src/mm-modem.c | 4 ++-- + 16 files changed, 66 insertions(+), 52 deletions(-) + +commit 1e79a2d292e7e68430043d9741bfbbe01cd3206f +Author: Aleksander Morgado +Date: Tue Nov 22 14:00:09 2011 +0100 + + build: install DBus service and data files for the new API + + .gitignore | 4 + + data/Makefile.am | 18 +-- + data/org.freedesktop.ModemManager.conf.polkit | 154 + --------------------- + ...=> org.freedesktop.ModemManager1.conf.nopolkit} | 4 +- + data/org.freedesktop.ModemManager1.conf.polkit | 22 +++ + ....in => org.freedesktop.ModemManager1.policy.in} | 16 +-- + ...in => org.freedesktop.ModemManager1.service.in} | 2 +- + 7 files changed, 46 insertions(+), 174 deletions(-) + +commit 8d97538c72b4f475d0f5b0a7f7a23fc756979a0a +Author: Aleksander Morgado +Date: Tue Nov 22 13:36:48 2011 +0100 + + build: setup all data (polkit, icon, dbus...) in the same `data' + directory + + Also fixed dist when not using polkit, the icon was no longer included + in the + tarball. + + Makefile.am | 45 +--------------- + configure.ac | 2 +- + data/Makefile.am | 60 + +++++++++++++++++++++ + {policy => data}/modem-manager.png | Bin + .../org.freedesktop.ModemManager.conf.nopolkit | 0 + .../org.freedesktop.ModemManager.conf.polkit | 0 + .../org.freedesktop.ModemManager.service.in | 0 + .../org.freedesktop.modem-manager.policy.in | 0 + policy/Makefile.am | 15 ------ + 9 files changed, 63 insertions(+), 59 deletions(-) + +commit 6b696056333bbefa19fc5296f14d2f71e2a82594 +Author: Aleksander Morgado +Date: Tue Nov 22 13:07:50 2011 +0100 + + build: chain up new 0.6 API and link against libmm-common + + Also removed the MMSerialError implementation from + `src/mm-errors.[h|c]', as it + is now included in the new `include/ModemManager-errors.h' header + file. All the + other enums and errors without clashing names will be ported + afterwards to the + new base code. + + include/ModemManager.h | 292 + +------------------------------------------------ + plugins/Makefile.am | 5 +- + src/Makefile.am | 18 ++- + src/mm-errors.c | 33 ------ + src/mm-errors.h | 17 +-- + src/mm-manager.h | 3 - + src/tests/Makefile.am | 20 +++- + 7 files changed, 40 insertions(+), 348 deletions(-) + +commit 49bbaf8e31009227b5c5ff1abf95fe6afb40d496 +Author: Aleksander Morgado +Date: Tue Nov 22 12:37:20 2011 +0100 + + build: disable autogeneration of the 0.5 API header file + + But keep it around as a static file, while we do the migration to + the new + interface. + + .gitignore | 1 - + build-aux/Makefile.am | 1 - + build-aux/header-generator-new.xsl | 190 --------------- + build-aux/header-generator.xsl | 227 +++++------------- + include/Makefile.am | 14 +- + include/ModemManager.h | 460 + +++++++++++++++++++++++++++++++++++++ + 6 files changed, 520 insertions(+), 373 deletions(-) + +commit 3b976c439918262d40d5714390cc15f2218be90b +Author: Aleksander Morgado +Date: Tue Nov 22 12:17:12 2011 +0100 + + docs: added new man page for the modem-manager daemon + + .gitignore | 2 ++ + configure.ac | 2 ++ + docs/Makefile.am | 2 +- + docs/man/Makefile.am | 7 ++++++ + docs/man/modem-manager.8.in | 52 + +++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 64 insertions(+), 1 deletion(-) + +commit 09f40c836957fab37672d98fc6f3ca2611b94bbb +Author: Aleksander Morgado +Date: Tue Nov 22 11:33:35 2011 +0100 + + docs: setup generation of gtk-doc based DBus API documentation + + It includes gdbus-codegen generated API documentation, plus the + common Enums, + Flags and Errors, which will also be used in libmm-glib. + + .gitignore | 13 ++++ + Makefile.am | 2 +- + autogen.sh | 1 + + configure.ac | 21 ++++++ + docs/Makefile.am | 2 + + docs/reference/Makefile.am | 2 + + docs/reference/api/Makefile.am | 93 +++++++++++++++++++++++++ + docs/reference/api/mm-docs.xml | 138 + +++++++++++++++++++++++++++++++++++++ + docs/reference/api/mm-overview.xml | 56 +++++++++++++++ + docs/reference/api/mm-sections.txt | 32 +++++++++ + docs/reference/api/mm.types | 0 + docs/reference/api/version.xml.in | 1 + + 12 files changed, 360 insertions(+), 1 deletion(-) + +commit a57c3bcf36912f7c3822ed046a424af52f5b2bc4 +Author: Aleksander Morgado +Date: Tue Oct 18 19:04:36 2011 +0200 + + docs: remove generation of previous DBus API documentation + + Makefile.am | 23 +- + doc-generator.xsl | 691 + ------------------------------------------------------ + docs/plugins.txt | 0 + 3 files changed, 1 insertion(+), 713 deletions(-) + +commit 23367c718643e621a08922aaa5be0542fe9c47b7 +Author: Aleksander Morgado +Date: Tue Nov 22 11:03:03 2011 +0100 + + libmm-common: include Errors type information + + The code to handle the Errors type information is automatically + built with + `glib-mkenums' and the new templates kept under `build-aux'. + + build-aux/Makefile.am | 4 +- + build-aux/mm-errors-types.c.template | 43 +++++++ + build-aux/mm-errors-types.h.template | 27 +++++ + libmm-common/Makefile.am | 16 ++- + libmm-common/mm-errors-quarks.c | 216 + +++++++++++++++++++++++++++++++++++ + 5 files changed, 304 insertions(+), 2 deletions(-) + +commit 0e9ed6e5fed70c873c597b91a9b844df44f9ffc0 +Author: Aleksander Morgado +Date: Tue Nov 22 10:54:20 2011 +0100 + + libmm-common: include Enums and Flags type information + + The code to handle the Enums and Flags type information is + automatically built + with `glib-mkenums' and the new templates kept under `build-aux'. + + Note: We currently skip the type information of + `MMModemBand'. GFlagsValue + can hold only 32-bit types, and we're working with a 64-bit flag here. + See: https://bugzilla.gnome.org/show_bug.cgi?id=663054 + + build-aux/Makefile.am | 4 +++- + build-aux/mm-enums-types.c.template | 40 + +++++++++++++++++++++++++++++++++++++ + build-aux/mm-enums-types.h.template | 24 ++++++++++++++++++++++ + libmm-common/Makefile.am | 13 ++++++++++++ + 4 files changed, 80 insertions(+), 1 deletion(-) + +commit ade484826ccd5c93937d18563b478b75641c4ee7 +Author: Aleksander Morgado +Date: Tue Nov 22 10:49:03 2011 +0100 + + libmm-common: setup new library, with the gdbus-codegen generated code + + This library will not (probably) be installable, but will share + the GDBus + and new Enum/Flag/Error type support between the core daemon and + the new + libmm-glib library. + + .gitignore | 3 ++ + Makefile.am | 2 +- + configure.ac | 1 + + libmm-common/Makefile.am | 125 + +++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 130 insertions(+), 1 deletion(-) + +commit da99e8ddadecf0f5c8204b578a2dd9162a1ceee2 +Author: Aleksander Morgado +Date: Fri Oct 28 10:51:52 2011 +0200 + + build: use common CPPFLAGS and LDFLAGS for all plugins + + Also include $(top_srcdir)/generated and $(top_builddir)/generated + in the + common preprocessor flags. + + plugins/Makefile.am | 317 + ++++++++++------------------------------------------ + 1 file changed, 56 insertions(+), 261 deletions(-) + +commit bb7311f27c2e837ab89d45eec36c1ae6f36d2f42 +Author: Aleksander Morgado +Date: Wed Oct 12 00:15:11 2011 +0200 + + build: improve project bootstrapping + + Align autogen.sh with the one in NM: + * Just calling autoreconf once + * Using autopoint from GNU gettext + * Enabling the use of NOCONFIGURE + + .gitignore | 38 ++++++++++++++++++++++++++++++++++++++ + autogen.sh | 11 ++++++----- + configure.ac | 6 +++++- + 3 files changed, 49 insertions(+), 6 deletions(-) + +commit 7e0f016c25aec93a88412f47d7add155d2857a45 +Author: Aleksander Morgado +Date: Tue Oct 11 15:13:04 2011 +0200 + + build: improve configure output report + + configure.ac | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +commit 917a13217aef5f1e10f459e8d1e23c88997ba2a7 +Author: Aleksander Morgado +Date: Mon Oct 10 12:13:09 2011 +0200 + + build: avoid using -Wfloat-equal compilation option + + In order to compile code generated by gdbus-codegen. + + m4/compiler_warnings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bc8010f792571f6809b891dfc8e760b2ce5ea369 +Author: Aleksander Morgado +Date: Mon Oct 10 12:00:12 2011 +0200 + + build: avoid using -Wshadow compilation option + + In order to compile code generated by gdbus-codegen. + + m4/compiler_warnings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dbb06b6246c5488d20aae77a1ced268e01b62e58 +Author: Aleksander Morgado +Date: Mon Oct 10 11:58:28 2011 +0200 + + build: require GLib and GIO >= 2.30 + + gdbus-codegen is first available in the stable 2.30 release of + GLib, see + http://mail.gnome.org/archives/gtk-devel-list/2011-September/msg00218.html + + GIO and GIO-Unix are now required during the build. + + configure.ac | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit b5a1c38cc417972d911c86a52a6a692afdf2cf2a +Author: Aleksander Morgado +Date: Tue Nov 22 10:36:21 2011 +0100 + + api: new `include/ModemManager1.h' as main header of the new API + + Filename is temporary as we keep the old `include/ModemManager.h' + around during + the transition to the new codebase. + + include/Makefile.am | 3 +++ + include/ModemManager1.h | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 35 insertions(+) + +commit ff5ea7b76a633d91c94d495c522a0bc5d86c184d +Author: Aleksander Morgado +Date: Tue Oct 18 20:08:08 2011 +0200 + + build: setup autogeneration of names header for the new API + + The `include/ModemManager-names.h' autogenerated header includes + the list of + Interface, Method, Signal and Property names defined in the DBus API. + + .gitignore | 1 + + build-aux/Makefile.am | 3 +- + build-aux/header-generator-new.xsl | 190 + +++++++++++++++++++++++++++++++++++++ + include/Makefile.am | 15 ++- + new/all.xml | 18 ++++ + 5 files changed, 222 insertions(+), 5 deletions(-) + +commit 365b906a3e1bda05af10f92451a6b6ae60f8b879 +Author: Aleksander Morgado +Date: Tue Oct 18 19:57:17 2011 +0200 + + build: setup header generator in its own include/Makefile + + Also move helper files to the new `build-aux' directory. + + .gitignore | 3 ++- + Makefile.am | 11 +---------- + build-aux/Makefile.am | 3 +++ + header-generator.xsl => build-aux/header-generator.xsl | 0 + configure.ac | 2 ++ + include/Makefile.am | 14 + ++++++++++++++ + 6 files changed, 22 insertions(+), 11 deletions(-) + +commit 4643dca4a2bd70c71fb825f6d98334a5bf608b94 +Author: Aleksander Morgado +Date: Tue Nov 22 09:45:26 2011 +0100 + + api,errors: implement all errors from the new API + + Errors that will/may be reported via DBus are defined in the public + interface + header. + + include/ModemManager-errors.h | 259 +++++++++++++++++++++++++++++++++ + new/mm-mobile-error.xml | 318 + ----------------------------------------- + new/mm-modem-connect-error.xml | 30 ---- + new/mm-modem-error.xml | 36 ----- + new/mm-serial-error.xml | 24 ---- + 5 files changed, 259 insertions(+), 408 deletions(-) + +commit ff86bc9f4a33d3fbdfce22b4e6d580530278949d +Author: Aleksander Morgado +Date: Mon Nov 21 16:31:26 2011 +0100 + + api,enums: new enum for the USSD session state + + include/ModemManager-enums.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 55eb1f0c50bf51f452f314f28d0a0046c2b032e4 +Author: Aleksander Morgado +Date: Mon Nov 21 16:30:57 2011 +0100 + + api,enums: new enum for the 3GPP network availability + + include/ModemManager-enums.h | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 4cdbaa5de348e0f349df97e7a96e4949aef66534 +Author: Aleksander Morgado +Date: Mon Nov 21 16:27:48 2011 +0100 + + api,enums: implement all enums and flags from the new API + + include/ModemManager-enums.h | 455 + +++++++++++++++++++++ + new/org.freedesktop.ModemManager1.Bearer.xml | 21 - + new/org.freedesktop.ModemManager1.Modem.3gpp.xml | 38 -- + new/org.freedesktop.ModemManager1.Modem.Cdma.xml | 80 ---- + ...rg.freedesktop.ModemManager1.Modem.Contacts.xml | 23 -- + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 143 ------- + new/org.freedesktop.ModemManager1.Modem.xml | 403 + ------------------ + new/org.freedesktop.ModemManager1.Sms.xml | 35 -- + 8 files changed, 455 insertions(+), 743 deletions(-) + +commit 8763576a3488a91e09bb47fe89789ee858b09345 +Author: Aleksander Morgado +Date: Mon Nov 21 14:27:35 2011 +0100 + + api,dbus: rewrite Methods, Properties and Signals for gdbus-codegen + + new/org.freedesktop.ModemManager1.Bearer.xml | 308 +++++++---- + ...g.freedesktop.ModemManager1.Modem.3gpp.Ussd.xml | 132 +++-- + new/org.freedesktop.ModemManager1.Modem.3gpp.xml | 205 ++++--- + new/org.freedesktop.ModemManager1.Modem.Cdma.xml | 186 ++++--- + ...rg.freedesktop.ModemManager1.Modem.Contacts.xml | 262 +++++---- + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 149 +++-- + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 338 ++++++++---- + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 198 ++++--- + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 271 +++++---- + new/org.freedesktop.ModemManager1.Modem.xml | 611 + ++++++++++++--------- + new/org.freedesktop.ModemManager1.Sim.xml | 163 +++--- + new/org.freedesktop.ModemManager1.Sms.xml | 151 ++--- + new/org.freedesktop.ModemManager1.xml | 46 +- + 13 files changed, 1769 insertions(+), 1251 deletions(-) + +commit 793c65705fafb195d4c5fe98f64550c9eda6b9c4 +Author: Aleksander Morgado +Date: Mon Nov 21 14:17:52 2011 +0100 + + api,dbus: Bearer interface not implemented by modems + + Keep the Bearer interface out of the 'Modem' subtree in the interface + hierarchy, + as it will be specific for Bearer objects, not implemented by Modem + objects. + + ...nager1.Modem.Bearer.xml => org.freedesktop.ModemManager1.Bearer.xml} + | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3599e396b9b182f90002e462f0692724a7f75fc9 +Author: Aleksander Morgado +Date: Mon Nov 21 14:17:02 2011 +0100 + + api,dbus: SMS interface not implemented by modems + + Keep the SMS interface out of the 'Modem' subtree in the interface + hierarchy, + as it will be specific for SMS objects, not implemented by Modem + objects. + + ...odemManager1.Modem.SMS.xml => org.freedesktop.ModemManager1.Sms.xml} + | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 592cd21f6128080f79f74641615f293c1f11d66b +Author: Aleksander Morgado +Date: Mon Nov 21 17:28:59 2011 +0100 + + api,dbus: fix SignalQuality property signature so that it's a + (ub) tuple + + new/org.freedesktop.ModemManager1.Modem.xml | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4fbe13a73f8d7f05188292c211f7808ed5d6c632 +Author: Aleksander Morgado +Date: Mon Nov 21 17:25:07 2011 +0100 + + api,dbus: simplified the Manager API, as we will use the standard + ObjectManager + + The recent `org.freedesktop.DBus.ObjectManager' standard API defines + a common + way to handle a list of objects in the interface. It allows getting + all objects, + interfaces and properties in a single method call. + + See: + http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager + + new/org.freedesktop.ModemManager1.xml | 42 + ----------------------------------- + 1 file changed, 42 deletions(-) + +commit 89090013f20c8b7a5ca3e2d4e0e3ca54839dafd0 +Author: Aleksander Morgado +Date: Mon Nov 21 17:21:50 2011 +0100 + + api,dbus: let IMSI, OperatorIdentifier and OperatorName be properties + in the SIM interface + + new/org.freedesktop.ModemManager1.Sim.xml | 58 + ++++++++++--------------------- + 1 file changed, 18 insertions(+), 40 deletions(-) + +commit 35abbd6dd5fb74ae9890710912c7bc15fa5d243b +Author: Aleksander Morgado +Date: Mon Nov 21 17:17:26 2011 +0100 + + api,dbus: use long property names in the 3GPP DBus interface + + new/org.freedesktop.ModemManager1.Modem.3gpp.xml | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 432df3349f7df7d00d0dbc17eacdfc46965b372b +Author: Aleksander Morgado +Date: Mon Nov 21 17:15:02 2011 +0100 + + api,dbus: fix signature of the Scan() method in the 3GPP DBus + interface + + The Scan() method returns an array of dictionaries, where each + dictionary is + defined by a string key plus a variant data (not a string data). This + is to + handle the "status" and "access-tech" entries, which are given + as unsigned + integers. + + new/org.freedesktop.ModemManager1.Modem.3gpp.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f7390c328bfb8690802e317f503a5bff5116fd84 +Author: Aleksander Morgado +Date: Mon Nov 21 17:12:59 2011 +0100 + + api,dbus: use long property names in the CDMA DBus interface + + new/org.freedesktop.ModemManager1.Modem.Cdma.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 60e824bd5994a1c27df222219ef9a3837c143519 +Author: Aleksander Morgado +Date: Tue Nov 22 11:49:42 2011 +0100 + + api,dbus: let UnlockRequired property be an enum instead of a string + + We were already working with a fixed set of possible strings, so + better to have + an enumeration for that. + + new/org.freedesktop.ModemManager1.Modem.xml | 98 + ++++++++++++++++++++++++++--- + 1 file changed, 90 insertions(+), 8 deletions(-) + +commit 022ceae0d8fc915b58dd3c254e01026c7df5ec72 +Author: Aleksander Morgado +Date: Tue Nov 22 17:17:29 2011 +0100 + + api,dbus: new `Plugin' property in the Modem interface + + Will hold the name of the plugin managing the modem. + + new/org.freedesktop.ModemManager1.Modem.xml | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit c1642466425bfd253ca887eed5f6a3f07152ca81 +Author: Aleksander Morgado +Date: Wed Feb 29 15:13:35 2012 +0100 + + tests: serial port tests don't need errors header + + src/tests/test-at-serial-port.c | 1 - + 1 file changed, 1 deletion(-) + +commit 8f5cd493619cc8eff563492cb1f779422c98e52d +Author: Dan Williams +Date: Wed Mar 14 11:11:26 2012 -0500 + + release: bump version to 0.7.0 (devel for 0.8.x stable) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8e83a10c1e712030938fa226ab3f6829f2c1eb97 +Author: Aleksander Morgado +Date: Tue Mar 13 19:42:36 2012 +0100 + + hso: disable echo removal + + Built-in echo removal conflicts with _OWANCALL unsolicited messages, + which are + not coming prefixed with . + + Fixes LP#953294 + + plugins/mm-modem-hso.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 791e097ab54a79ff9c97488fabc33402cf155736 +Author: Aleksander Morgado +Date: Tue Mar 13 19:02:03 2012 +0100 + + at-serial-port: new property to control whether echo removal should + be applied + + src/mm-at-serial-port.c | 61 + ++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-at-serial-port.h | 2 ++ + 2 files changed, 60 insertions(+), 3 deletions(-) + +commit 7c9ba7faf2af1deabd22ed9e11ae19a209fda90a +Author: Aleksander Morgado +Date: Mon Mar 5 16:59:52 2012 +0100 + + samsung: remove unused variables + + plugins/mm-modem-samsung-gsm.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 5f6c65e7c1f23d3aa9f14580e5eb82c9ff4b8505 +Author: Dan Williams +Date: Thu Mar 1 17:22:56 2012 -0600 + + gsm: retry sending SMS in PDU mode if text fails and PDU is supported + + In the future we'll just default to PDU mode. + + src/mm-generic-gsm.c | 84 + ++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 58 insertions(+), 26 deletions(-) + +commit bc118aa1602b309101f1151805a2d8cdf0f916eb +Author: Aleksander Morgado +Date: Wed Feb 29 16:51:50 2012 +0100 + + modem-helpers: plug memleak + + g_match_info_fetch() returns always a heap-allocated string which + should be + freed by the caller. + + src/mm-modem-helpers.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 30e706309462f6b207753209649143902ee538fa +Author: Dan Williams +Date: Sat Feb 25 20:18:48 2012 -0600 + + iridium: convert to new port grabbing scheme + + plugins/mm-modem-iridium-gsm.c | 50 + ++++++++++-------------------------------- + plugins/mm-plugin-iridium.c | 6 +++-- + 2 files changed, 16 insertions(+), 40 deletions(-) + +commit 4dad94d5004f325e25dc3b09d87585eab38d4c3f +Author: Dan Williams +Date: Wed Feb 1 01:43:54 2012 -0600 + + core: rework port grabbing and organization + + Make port roles more flexible. We have modems that do PPP + on interfaces other than the primary interface, and that + wasn't possible with the old code. So clean up all that + logic and move the port organization code into the core + so we can reduce code in the plugins. + + In the new world order, the plugins say whether the port + is a QCDM port, an AT port, or ignored. If it's an AT + port the plugins get to tag it as primary, secondary, or + PPP, or any combination of the 3. This allows for modems + where PPP should really be done on the secondary port + (Huawei E220, Sierra devices) so that the primary port + stays open for command and status. + + Modem subclasses no longer get asked to handle port grabbing + themselves. Instead, that's now done by the generic classes + (MMGenericCdma and MMGenericGsm) and the plugins are notified + when a port is grabbed so they can add unsolicited response + handlers for it. After all ports are grabbed by the generic + classes, they get "organized", which assigns various ports + to the roles of PRIMARY, SECONDARY, DATA, and QCDM based + on specific rules and hints that the plugin provided (which + are expressed as MMAtPortFlags). The plugins then have + a chance to perform fixups on the primary port if they choose. + + The plugin code is responsible for determining the port + hints (ie MMAtPortFlags) at probe time, instead of having + a combination of the plugin and the modem class do the + job. This simplifies things greatly for the plugins at + the expense of more complicated logic in the core. + + plugins/mm-modem-anydata-cdma.c | 22 ++- + plugins/mm-modem-cinterion-gsm.c | 42 ++---- + plugins/mm-modem-hso.c | 97 ++++--------- + plugins/mm-modem-huawei-cdma.c | 39 ++--- + plugins/mm-modem-huawei-gsm.c | 75 +++------- + plugins/mm-modem-icera.c | 14 +- + plugins/mm-modem-linktop.c | 41 ++---- + plugins/mm-modem-mbm.c | 77 +++++----- + plugins/mm-modem-nokia.c | 42 ++---- + plugins/mm-modem-novatel-gsm.c | 53 +++---- + plugins/mm-modem-option-utils.c | 2 +- + plugins/mm-modem-option.c | 35 ++--- + plugins/mm-modem-samsung-gsm.c | 41 ++---- + plugins/mm-modem-sierra-cdma.c | 4 +- + plugins/mm-modem-sierra-gsm.c | 81 +++++------ + plugins/mm-modem-simtech-gsm.c | 40 ++---- + plugins/mm-modem-wavecom-gsm.c | 44 ++---- + plugins/mm-modem-zte.c | 43 ++---- + plugins/mm-plugin-anydata.c | 11 +- + plugins/mm-plugin-cinterion.c | 6 +- + plugins/mm-plugin-generic.c | 11 +- + plugins/mm-plugin-gobi.c | 8 +- + plugins/mm-plugin-hso.c | 26 +++- + plugins/mm-plugin-huawei.c | 93 +++++++----- + plugins/mm-plugin-linktop.c | 6 +- + plugins/mm-plugin-longcheer.c | 26 ++-- + plugins/mm-plugin-mbm.c | 6 +- + plugins/mm-plugin-moto-c.c | 8 +- + plugins/mm-plugin-nokia.c | 12 +- + plugins/mm-plugin-novatel.c | 11 +- + plugins/mm-plugin-option.c | 18 ++- + plugins/mm-plugin-samsung.c | 6 +- + plugins/mm-plugin-sierra.c | 41 ++++-- + plugins/mm-plugin-simtech.c | 26 ++-- + plugins/mm-plugin-wavecom.c | 6 +- + plugins/mm-plugin-x22x.c | 26 ++-- + plugins/mm-plugin-zte.c | 15 +- + src/mm-at-serial-port.c | 24 +++- + src/mm-at-serial-port.h | 25 +++- + src/mm-generic-cdma.c | 186 +++++++++++++----------- + src/mm-generic-cdma.h | 27 ++-- + src/mm-generic-gsm.c | 217 +++++++++++++++------------- + src/mm-generic-gsm.h | 26 +++- + src/mm-manager.c | 143 +++++++++++-------- + src/mm-modem-base.c | 289 + +++++++++++++++++++++++++++++--------- + src/mm-modem-base.h | 21 ++- + src/mm-modem.c | 15 +- + src/mm-modem.h | 19 ++- + src/mm-plugin-base.c | 14 +- + src/mm-plugin-base.h | 2 + + src/mm-port.c | 10 +- + src/mm-port.h | 3 +- + src/mm-qcdm-serial-port.c | 8 +- + src/mm-qcdm-serial-port.h | 4 +- + src/tests/test-qcdm-serial-port.c | 2 +- + 55 files changed, 1144 insertions(+), 1045 deletions(-) + +commit 36ee1b9c76a681b44516852372944b82c7616892 +Author: Aleksander Morgado +Date: Sun Feb 26 22:08:18 2012 +0100 + + build: include proper build dependencies for the polkit conf file + + So that the final conf file is updated if the original one gets + modified. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 86bfe96ddbc90a56fd1f7d7e65acebbb74169572 +Author: Tom Goetz +Date: Sat Feb 25 20:05:33 2012 -0600 + + cdma: fix crash on NULL error (bgo #670145) + + src/mm-generic-cdma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b42ce2d8e62dd12488c209fb2500a82009accdee +Author: Aleksander Morgado +Date: Sat Feb 18 10:47:44 2012 +0100 + + charsets: plug memleak + + The string passed to utils_bin2hexstr() needs to be freed afterwards. + + src/mm-charsets.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 2e99aa25577157275312739bea5dd75c3818cf92 +Author: Dan Williams +Date: Fri Feb 17 13:06:11 2012 -0600 + + qcdm: decode some more log items + + libqcdm/src/log-items.h | 36 ++++++++++++++++++++++++++++++++---- + 1 file changed, 32 insertions(+), 4 deletions(-) + +commit 7b8e9203f259b93bc3a5b6f94cb8cf0dbb39742c +Author: Aleksander Morgado +Date: Wed Dec 28 18:09:17 2011 +0100 + + gsm: don't query PS network registration status if not supported + + src/mm-generic-gsm.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit f2af208f05cbf56f8a44478615d70b7da46c3e42 +Author: Aleksander Morgado +Date: Wed Dec 28 09:47:41 2011 +0100 + + iridium: don't try to update signal quality if not registered + + Seems that launching AT+CSQF when not registered ends up timing + out. AT+CSQF + is meant to be the fast version to get the signal quality, and is + expected to + return instantly with the last cached signal quality value. But if + we never + got registered, there is no such cached value, so it probably waits + to get the + first one. + + plugins/mm-modem-iridium-gsm.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 5371cce11d5391a31272a6e85421e4d2c5bf43f6 +Author: Aleksander Morgado +Date: Wed Dec 28 09:14:56 2011 +0100 + + iridium: ensure cached capabilities get checked + + plugins/mm-plugin-iridium.c | 1 + + 1 file changed, 1 insertion(+) + +commit fc88c53fadf71ba032ecaac1a77a20cadd9935c5 +Author: Aleksander Morgado +Date: Mon Dec 26 17:12:47 2011 +0100 + + iridium: handle Motorola-branded Iridium modems + + plugins/mm-plugin-iridium.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 8b1016f4e1de4f058ce93c4dec1438cf8138317e +Author: Aleksander Morgado +Date: Mon Jun 20 11:43:41 2011 +0200 + + iridium: close and open the port during disconnection + + The Iridium modem doesn't seem to like only the port flashing + during the + disconnection, so we fully close and open again the port. + + plugins/mm-modem-iridium-gsm.c | 73 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + +commit d52b38b1f2ecdac84620d62c3fc0c8a5aa2ed496 +Author: Aleksander Morgado +Date: Fri Jun 10 12:13:58 2011 +0200 + + iridium: set bearer service type to 9600bps V.110 + + plugins/mm-modem-iridium-gsm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 707647da45423fb1f666d89df10b45d872540bc9 +Author: Aleksander Morgado +Date: Fri Jun 10 09:53:23 2011 +0200 + + iridium: override generic initialization + + We must send ATZ alone and once reply received, wait some time + before sending + the next initialization commands. Otherwise, the next commands + will receive + garbage as reply. The only way to handle this is to override the + whole generic + initialization phase. + + We will also avoid sending any power-up command, as not needed. + + plugins/mm-modem-iridium-gsm.c | 78 + +++++++++++++++++++++++++++++++++++++----- + 1 file changed, 70 insertions(+), 8 deletions(-) + +commit c0f390470ea3644b03b15defe33b0b237bd6a9c9 +Author: Aleksander Morgado +Date: Thu Jun 9 17:46:16 2011 +0200 + + iridium: allow up to 200s to configure IP + + plugins/mm-modem-iridium-gsm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 920fefa8e2c7660422a23d79fa45f7cd488e5198 +Author: Aleksander Morgado +Date: Thu Jun 9 17:45:33 2011 +0200 + + modem: new property to allow specifying longer timeouts when + configuring IP + + This IpTimeout property will be read by NetworkManager, and used as + the time to + wait for pppd to establish the IP configuration. + + introspection/org.freedesktop.ModemManager.Modem.xml | 6 ++++++ + src/mm-modem-base.c | 11 +++++++++++ + src/mm-modem.c | 10 ++++++++++ + src/mm-modem.h | 4 +++- + 4 files changed, 30 insertions(+), 1 deletion(-) + +commit e6d085246f3d47e162084234b1199b5ebb840cca +Author: Aleksander Morgado +Date: Tue Jun 7 15:45:55 2011 +0200 + + iridium: ensure 9600 baudrate is used + + plugins/mm-modem-iridium-gsm.c | 39 + +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 4b0cd28baf87a97c623bf25afcbeebc63a413344 +Author: Aleksander Morgado +Date: Tue Jun 7 14:19:24 2011 +0200 + + iridium: fix operator name and code to be reported + + plugins/mm-modem-iridium-gsm.c | 20 ++++++++++++++++++++ + src/mm-generic-gsm.c | 2 +- + 2 files changed, 21 insertions(+), 1 deletion(-) + +commit 3a7f9709314b6f82d0543f6e4b505ee32378c091 +Author: Aleksander Morgado +Date: Tue Jun 7 14:13:33 2011 +0200 + + gsm: let plugins override the operator name and code retrieval + + src/mm-generic-gsm.c | 153 + +++++++++++++++++++++++++++++++++++++++------------ + src/mm-generic-gsm.h | 9 +++ + 2 files changed, 126 insertions(+), 36 deletions(-) + +commit 26d69ca0f26405743de08cf9ed36aa9f28a8c647 +Author: Aleksander Morgado +Date: Tue Jun 7 13:22:48 2011 +0200 + + gsm: allow leading zeroes in numbers in CREG/CGREG responses + + src/mm-modem-helpers.c | 18 +++++++++--------- + src/tests/test-modem-helpers.c | 21 ++++++++++++++++++++- + 2 files changed, 29 insertions(+), 10 deletions(-) + +commit 4ed33918593b7c902d70e55f65c1442e6fec9589 +Author: Aleksander Morgado +Date: Mon Jun 6 13:32:50 2011 +0200 + + iridium: PS network is not supported + + plugins/mm-modem-iridium-gsm.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 40512451cc839534833c2b9ea51432a50deb2211 +Author: Aleksander Morgado +Date: Tue Jun 7 11:35:54 2011 +0200 + + generic: only send CGACT if PS network is supported + + src/mm-generic-gsm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 740680fd3be3c976db6f1612f3fd834ceb402632 +Author: Aleksander Morgado +Date: Mon Jun 6 12:54:36 2011 +0200 + + generic: query PS network registration status only if PS network + supported by the modem + + src/mm-generic-gsm.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-generic-gsm.h | 4 +++- + 2 files changed, 53 insertions(+), 5 deletions(-) + +commit 0c6eb6dcaa240adff5e49168e6b0f15086426640 +Author: Aleksander Morgado +Date: Mon Jun 6 11:33:21 2011 +0200 + + iridium: handle access technology + + plugins/mm-modem-iridium-gsm.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit 156a05afe0ecdbb8e98bcf55a846b06e0e4aeb97 +Author: Aleksander Morgado +Date: Mon Jun 6 11:08:51 2011 +0200 + + iridium: handle allowed mode + + plugins/mm-modem-iridium-gsm.c | 62 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 62 insertions(+) + +commit 85de9bbcc9146447153fe82cc22efbd1e45a44fd +Author: Aleksander Morgado +Date: Fri Jun 3 13:05:37 2011 +0200 + + iridium: override signal quality retrieval command + + plugins/mm-modem-iridium-gsm.c | 86 + +++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 85 insertions(+), 1 deletion(-) + +commit b7b37c4738180b589aabc904402657ec5cc518b9 +Author: Aleksander Morgado +Date: Fri Jun 3 12:28:14 2011 +0200 + + iridium: override SMS indications setup commands + + plugins/mm-modem-iridium-gsm.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit a87b4b46c8ac4b2ae9601e1807c9d79b6f01ae75 +Author: Aleksander Morgado +Date: Fri Jun 3 12:17:24 2011 +0200 + + gsm: set pin check flag before requesting ICCID check + + src/mm-generic-gsm.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 1c6e17857f3608bba23769b5c8bdb078b68911d5 +Author: Aleksander Morgado +Date: Fri Jun 3 11:34:52 2011 +0200 + + iridium: skip ICCID/IMSI query + + plugins/mm-modem-iridium-gsm.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 7cbc8f3b8057f0df6c6e22a2d28d393f5c27bbbb +Author: Aleksander Morgado +Date: Fri Jun 3 11:00:50 2011 +0200 + + gsm: allow no whitespaces before CPIN? reply value + + src/mm-generic-gsm.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit b714441272b75f85d09c155a79c176f230d0f5c0 +Author: Aleksander Morgado +Date: Fri Jun 3 10:52:24 2011 +0200 + + iridium: disable power up command and modify flow control setup + + plugins/mm-modem-iridium-gsm.c | 47 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +commit 670f560b3d2e1fdc622a078a333f96f73b960533 +Author: Aleksander Morgado +Date: Thu Jun 2 16:32:04 2011 +0200 + + iridium: add initial dummy plugin + + plugins/Makefile.am | 22 ++++- + plugins/mm-modem-iridium-gsm.c | 64 ++++++++++++ + plugins/mm-modem-iridium-gsm.h | 45 +++++++++ + plugins/mm-plugin-iridium.c | 218 + +++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-iridium.h | 48 +++++++++ + src/mm-plugin-base.c | 1 + + src/mm-plugin-base.h | 1 + + 7 files changed, 398 insertions(+), 1 deletion(-) + +commit 20693529ef9af82f74822745b8b85f5a534c793b +Author: Aleksander Morgado +Date: Thu Feb 16 18:20:31 2012 +0100 + + core: fix loop limits in echo removal + + -1 was actually correct, if data->len is 10, i goes from 0 to 8. + + src/mm-at-serial-port.c | 2 +- + src/tests/Makefile.am | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit 21162a366aa5cf802c00a13ccfd3719f72fef952 +Author: Aleksander Morgado +Date: Wed Jan 11 01:33:05 2012 +0100 + + at-serial-port: implement built-in echo/garbage removal + + We expect the responses to start always with . We just + remove anything + that comes before that. + + .gitignore | 1 + + src/mm-at-serial-port.c | 26 +++++++++++++ + src/mm-at-serial-port.h | 4 +- + src/tests/Makefile.am | 15 ++++++- + src/tests/test-at-serial-port.c | 86 + +++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 130 insertions(+), 2 deletions(-) + +commit 1db000403319e6380e438ce627155a29b926d68e +Author: Aleksander Morgado +Date: Wed Feb 8 16:29:27 2012 +0100 + + charsets: don't crash when passing a NULL string to the UTF-8 + converter + + src/mm-charsets.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7b4d6cf605fbf57a46fb1ef8777a6fdc49329c68 +Author: Dan Williams +Date: Tue Feb 7 14:08:23 2012 -0600 + + test: fix SMS testcase errors due to uninitialized GError + + src/tests/test-sms.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit 2104cd725a5f3f9aeacf4dfc4faa70dba293789d +Author: Dan Williams +Date: Tue Feb 7 13:59:32 2012 -0600 + + gsm: ensure text mode SMS list doesn't pick up too much text + + This likely has no effect, but just make sure the regex stops + grabbing message content when it hits the CF/LF that terminates + the message content in text mode. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c7f54a635a84d5861b1d5f819c25de97b8c0ac32 +Author: Dan Williams +Date: Tue Feb 7 13:48:47 2012 -0600 + + gsm: fix text mode SMS list regex for single messages + + We don't get a \r\n at the end for single messages. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ff31122ebaed9e3de32a61b53118c73199865800 +Author: Aleksander Morgado +Date: Tue Feb 7 12:56:45 2012 +0100 + + build: do not warn about using deprecated methods + + GValueArray is deprecated since GLib 2.31.14, but we need to use + it for + dbus-glib based code. + + We should re-enable deprecation warnings once we switch to GDBus. + + m4/compiler_warnings.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4af8483ae4e32ca3d815f14aaf5f012b0ed98eed +Author: Aleksander Morgado +Date: Tue Feb 7 19:05:10 2012 +0100 + + gsm: use new common charset converter when parsing operator name/code + + src/mm-generic-gsm.c | 31 +------------------------------ + 1 file changed, 1 insertion(+), 30 deletions(-) + +commit 03678df6fdfa32316dbac8b15d10da2ab16a42f7 +Author: Aleksander Morgado +Date: Tue Feb 7 18:01:28 2012 +0100 + + gsm: convert SMS text and number from current charset to UTF-8 + + src/mm-generic-gsm.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 00ce1d68744d6c69ea1f5fbb4d49a9d242208a7b +Author: Aleksander Morgado +Date: Tue Feb 7 17:50:49 2012 +0100 + + charsets: new method to do our best to convert from current charset + to UTF-8 + + This method will try to convert the input string to UTF-8. The input + string is + supposed to be in the given charset; or otherwise is supposed to be + the hex + representation of the string in the given charset. + + src/mm-charsets.c | 92 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-charsets.h | 4 ++- + 2 files changed, 95 insertions(+), 1 deletion(-) + +commit 9f6f80a63abc03bce6c1ef8a2ee963c0aa20f28a +Author: Aleksander Morgado +Date: Tue Feb 7 17:48:23 2012 +0100 + + charsets: don't warn if we couldn't convert from hex to utf8 + + src/mm-charsets.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 0c6e5e713e2a1e71e560d6a8d5ba058eea0b7ac9 +Author: Aleksander Morgado +Date: Tue Feb 7 11:42:06 2012 +0100 + + core: plug leaks when passing GValueArrays to dbus_g_method_return() + + The ownership of the GValueArray is not transferred. + + src/mm-modem-cdma.c | 2 ++ + src/mm-modem-gsm-network.c | 2 ++ + src/mm-modem.c | 4 ++++ + 3 files changed, 8 insertions(+) + +commit 4706ea488eb227d048a9a4021a875d87e8e7131b +Author: Dan Williams +Date: Thu Feb 2 21:12:44 2012 -0600 + + sms: handle text mode SMS listing + + Undoubtedly we'll need to adjust the regex but this works for now. + + src/mm-generic-gsm.c | 243 + ++++++++++++++++++++++++++++++++++++++++----------- + src/mm-sms-utils.c | 152 +++++++++++++++++++------------- + src/mm-sms-utils.h | 8 ++ + 3 files changed, 288 insertions(+), 115 deletions(-) + +commit 76c9b29415a89a1804fcc17be737a2b09fe1109f +Author: Dan Williams +Date: Thu Feb 2 21:12:17 2012 -0600 + + test: (sms-get.py) don't fail if we don't get an SMSC + + test/sms-get.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 681a24c8d87cad064696d1dcf17ec78a23823d0c +Author: Dan Williams +Date: Thu Feb 2 21:09:48 2012 -0600 + + novatel: override message storage and notification + + It seems that even though the firmware says it supports + specific CNMI notification values, it really doesn't. Also + set storage to the SIM until we support automatically + determining the right storage in MM. XU870 does not + support ME storage according to +CPMS=?. + + plugins/mm-modem-novatel-gsm.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 14a59c4384011ac1ff0793502fb8c2c8ae75d45c +Author: Dan Williams +Date: Wed Feb 1 11:21:20 2012 -0600 + + gsm: fix listing SMS messages in text mode + + Even though we don't parse them correctly yet, at least + send the right command for listing them. + + src/mm-generic-gsm.c | 94 + +++++++++++++++++++++++++++------------------------- + 1 file changed, 48 insertions(+), 46 deletions(-) + +commit d84214184ccb6f9dba3620d563adb42f7d155d7b +Author: Dan Williams +Date: Wed Feb 1 10:45:47 2012 -0600 + + gsm: fix setting PDU mode for SMS messages + + Stupid signed/unsigned mistake. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 70978d58a0db9691fa7583cf1d8df839ac18431b +Author: Dan Williams +Date: Wed Feb 1 10:45:28 2012 -0600 + + test: pretty-print SMS messages in sms-get.py + + test/sms-get.py | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +commit 20a1c412fdf9dcc85fe97aa8053286032677938f +Author: Dan Williams +Date: Wed Feb 1 01:43:04 2012 -0600 + + core: fix warning about MMModemTime interface initialization + + The MMModemTime interface was getting initialized more than once. + + src/mm-modem-time.c | 1 + + 1 file changed, 1 insertion(+) + +commit 4fd6264848944035b13047079a63fd29fc6a11d7 +Author: Dan Williams +Date: Fri Jan 27 15:13:42 2012 -0600 + + build: more libwmc and libqcdm standalone fixes + + Make it pass distcheck. + + configure.ac | 6 ++++++ + libqcdm/configure.ac | 9 ++++----- + libqcdm/tests/Makefile.am | 6 +++--- + libwmc/configure.ac | 11 +++++------ + libwmc/tests/Makefile.am | 6 +++--- + 5 files changed, 21 insertions(+), 17 deletions(-) + +commit 5fc4e866c2f6453dae546f9c78ef5aa32d67ef87 +Author: Thomas Tuttle +Date: Fri Jan 27 13:24:30 2012 -0500 + + time: implement in icera + + Signed-off-by: Thomas Tuttle + + plugins/mm-modem-icera.c | 91 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-icera.h | 21 ++++++++++ + plugins/mm-modem-samsung-gsm.c | 54 ++++++++++++++++++++++++- + 3 files changed, 165 insertions(+), 1 deletion(-) + +commit 0e246fb61db27e423539f400df4774c269929a7d +Author: Thomas Tuttle +Date: Fri Jan 27 13:24:13 2012 -0500 + + time: poll for timezone + + Signed-off-by: Thomas Tuttle + + src/mm-modem-base.c | 88 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-base.h | 3 ++ + src/mm-modem-time.c | 15 +++++++++ + src/mm-modem-time.h | 8 +++++ + 4 files changed, 114 insertions(+) + +commit 8121b8e31922e89e5429b8ffa8c388d84f65c1f0 +Author: Thomas Tuttle +Date: Fri Jan 27 13:23:51 2012 -0500 + + time: implement ModemTime in ModemBase + + Signed-off-by: Thomas Tuttle + + src/mm-modem-base.c | 72 + ++++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-base.h | 4 +++ + src/mm-modem.h | 3 ++- + 3 files changed, 77 insertions(+), 2 deletions(-) + +commit 346060efe87b43266326830af3c590052245a1ce +Author: Dan Williams +Date: Thu Jan 26 12:35:30 2012 -0600 + + test: add SMS get example/test + + test/Makefile.am | 1 + + test/sms-get.py | 55 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+) + +commit b9037d11504834cea5341ea48ddcdd3afc9952d1 +Author: Dan Williams +Date: Thu Jan 26 09:08:18 2012 -0600 + + test: add missing examples to Makefile.am + + test/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 13d2eee6f1223357bf48f1de60564ddc8bc574d0 +Author: Dan Williams +Date: Thu Jan 26 09:07:48 2012 -0600 + + test: rename SMS send example + + test/Makefile.am | 2 +- + test/{mm-send-sms.py => sms-send.py} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit accb3f0a58b6278788bc3e449ad97d5a4a80d96d +Author: Thomas Tuttle +Date: Fri Jan 20 15:20:12 2012 -0500 + + api: add Modem.Time introspection XML + + Signed-off-by: Thomas Tuttle + + introspection/Makefile.am | 3 +- + introspection/all.xml | 1 + + .../org.freedesktop.ModemManager.Modem.Time.xml | 56 + ++++++++++++++++++++++ + 3 files changed, 59 insertions(+), 1 deletion(-) + +commit 7f122014942e0ed5c7480967fe53573eccb08101 +Author: Thomas Tuttle +Date: Fri Jan 20 15:20:34 2012 -0500 + + time: implement MMModemTime boilerplate + + Signed-off-by: Thomas Tuttle + + src/Makefile.am | 9 +++- + src/mm-modem-time.c | 153 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-time.h | 52 ++++++++++++++++++ + 3 files changed, 212 insertions(+), 2 deletions(-) + +commit 835e14d8d55eff05865e348977d623bff13fb130 +Author: Thomas Tuttle +Date: Fri Jan 20 15:20:01 2012 -0500 + + api: add firmware interface XML file to introspection/Makefile.am + + Signed-off-by: Thomas Tuttle + + introspection/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit a1682fe3e5edbc499f58a9013b53cc583e97a149 +Author: Thomas Tuttle +Date: Fri Jan 20 15:19:49 2012 -0500 + + trivial: sort introspection/Makefile.am and all.xml + + To make things neater, sort the files listed in instrospection's + Makefile + alphabetically, and sort the files listed in all.xml alphabetically + within + logical groups. + + Signed-off-by: Thomas Tuttle + + introspection/Makefile.am | 14 +++++++------- + introspection/all.xml | 6 +++--- + 2 files changed, 10 insertions(+), 10 deletions(-) + +commit 38498e3c5d70cdfe484dd61d705bc88777942399 +Author: Dan Williams +Date: Tue Jan 24 11:32:20 2012 -0600 + + qcdm: fix some build errors when building standalone + + libqcdm/AUTHORS | 0 + libqcdm/ChangeLog | 0 + libqcdm/NEWS | 0 + libqcdm/README | 0 + libqcdm/configure.ac | 8 +++++--- + libqcdm/tests/Makefile.am | 16 ++++++++++------ + 6 files changed, 15 insertions(+), 9 deletions(-) + +commit 79cb265379685c057a6429718e2c11fa070f384c +Author: Dan Williams +Date: Tue Jan 24 11:28:46 2012 -0600 + + wmc: allow building libwmc standalone + + libwmc/AUTHORS | 0 + libwmc/ChangeLog | 0 + libwmc/NEWS | 0 + libwmc/README | 0 + libwmc/autogen.sh | 22 ++++++++++++++++++++++ + libwmc/configure.ac | 49 + ++++++++++++++++++++++++++++++++++++++++++++++++ + libwmc/tests/Makefile.am | 13 +++++++++---- + 7 files changed, 80 insertions(+), 4 deletions(-) + +commit 7d6d3fd47e32c3f1d4b3c011f85d896437b151f9 +Author: Dan Williams +Date: Mon Jan 23 18:53:04 2012 -0600 + + decode: update WMC for DEVICE_INFO changes + + decode/wmc.py | 46 +++++++++++++++++++++++++++------------------- + 1 file changed, 27 insertions(+), 19 deletions(-) + +commit dd1ed06c1474a84c926e99286f575ab5c0c53c15 +Author: Dan Williams +Date: Mon Jan 23 18:46:41 2012 -0600 + + wmc: harmonize buffer dumper with decode.py + + Makes it easier to compare the output. + + libwmc/tests/test-wmc-com.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c386efee9c7057a89a054d79b7abb4aec446a9a7 +Author: Dan Williams +Date: Mon Jan 23 18:06:04 2012 -0600 + + wmc: decode more of DEVICE_INFO + + CDMA MIN, home SID, PRL & ERI version + + libwmc/src/commands.c | 16 ++++++++++ + libwmc/src/commands.h | 5 ++++ + libwmc/src/protocol.h | 73 + +++++++++++++++++++++++++-------------------- + libwmc/tests/test-wmc-com.c | 35 +++++++++++++++++----- + 4 files changed, 89 insertions(+), 40 deletions(-) + +commit 704489d660776b679434d5426d5f50a061fb536c +Author: Dan Williams +Date: Mon Jan 23 17:46:01 2012 -0600 + + decode: fix WMC decoder for PC5740 dumps + + decode/wmc.py | 65 + ++++++++++++++++++++++++++++++++++------------------------- + 1 file changed, 38 insertions(+), 27 deletions(-) + +commit ccfdda523aa812d9ff894593068b61e902f27660 +Author: Dan Williams +Date: Mon Jan 23 17:20:57 2012 -0600 + + wmc: add FIELD_TEST command + + UML290 and UML190 both respond to the command but return all + zeros, while the PC5740 returns valid data. + + libwmc/src/protocol.h | 47 + +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +commit 1e6da54b45378a5438c5ed4eca4d009d36d517b9 +Author: Dan Williams +Date: Mon Jan 23 16:40:55 2012 -0600 + + decode: add another USB function + + decode/packet.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 8915f7964ab6a2656ad2f4992c708fefab5fdaa6 +Author: Dan Williams +Date: Mon Jan 23 15:52:47 2012 -0600 + + core: fix copy & paste error + + src/mm-generic-gsm.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit f1410bb8d7dac2c100af4ee9f8c62e1d68f68119 +Author: Dan Williams +Date: Mon Jan 23 15:50:24 2012 -0600 + + wmc: fix compile error + + libwmc/src/protocol.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 72e3f0457bb6ccdc9b0814278fa98621f0ba9e1a +Author: Dan Williams +Date: Mon Jan 23 11:11:03 2012 -0600 + + wmc: add LTE only global mode define + + libwmc/src/commands.h | 1 + + libwmc/src/protocol.h | 1 + + libwmc/tests/test-wmc-com.c | 2 ++ + 3 files changed, 4 insertions(+) + +commit f90fe1906856fd708f2f62f49486f94bfacf255f +Author: Dan Williams +Date: Mon Jan 23 10:23:37 2012 -0600 + + wmc: fix init command + + Actually read what struct tm contains and use it correctly, + and fix the init command struct size. + + libwmc/src/commands.c | 4 ++-- + libwmc/src/protocol.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 66b7ef018e983fb5f77624e2d119ded7cc24b6be +Author: Dan Williams +Date: Mon Jan 23 10:23:18 2012 -0600 + + wmc: fix segfault in testcase + + libwmc/tests/test-wmc-com.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 83b92ecebc3f44c5a2ebbdc34be9aee918504350 +Author: Aleksander Morgado +Date: Mon Jan 23 15:43:55 2012 +0100 + + ussd: ensure coded string is valid before stripping quotes + + src/mm-generic-gsm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 62e94727fef8da2620e8e49a0e705fcd6517bfc3 +Author: Aleksander Morgado +Date: Mon Jan 23 15:31:58 2012 +0100 + + ussd: plug a leak + + src/mm-generic-gsm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit a86a5c39ac194d7764c41f6e4d4a8c46ce39138f +Author: Aleksander Morgado +Date: Mon Jan 23 15:29:36 2012 +0100 + + wmc: fix compilation error in tests + + g_print() expects format + arguments; or compilation will fail when + -Werror=format-security being used. + + libwmc/tests/test-wmc-com.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4d4d6072a12677dca0e5fceb9a3be41c03cc72b0 +Author: Dan Williams +Date: Sat Jan 21 15:42:28 2012 -0600 + + wmc: fix up for recent INIT and DEVICE_INFO changes + + Send current time to modem during init, and don't try to + grab MCC/MNC where its not supported. + + libwmc/src/commands.c | 37 ++++++++++++++++++++++++++----------- + 1 file changed, 26 insertions(+), 11 deletions(-) + +commit 4c5ef98525bbd8348611c0206ae6b30b47322803 +Author: Dan Williams +Date: Sat Jan 21 15:12:34 2012 -0600 + + decode: fix some formatting + + decode/wmc.py | 88 + +++++++++++++++++++++++++++++------------------------------ + 1 file changed, 44 insertions(+), 44 deletions(-) + +commit 365666da01095dfb1529aaf6a5f08418677605ac +Author: Dan Williams +Date: Sat Jan 21 15:10:59 2012 -0600 + + decode: update for WMC timestamps + + decode/wmc.py | 96 + ++++++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 65 insertions(+), 31 deletions(-) + +commit fac80b70027f4c74b9552a8a48e61e388f455871 +Author: Dan Williams +Date: Sat Jan 21 15:09:40 2012 -0600 + + wmc: update INIT and NETWORK_INFO commands with timestamp + + libwmc/src/protocol.h | 56 + ++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 38 insertions(+), 18 deletions(-) + +commit 2838456e7a53ddcbf841735fdd4337485ec759c9 +Author: Dan Williams +Date: Sat Jan 21 13:26:08 2012 -0600 + + decode: parse URB timestamps too + + decode/packet.py | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit c37fdf5f94711ffbdf966f2ab366bbd047dfc147 +Author: Dan Williams +Date: Sat Jan 21 12:55:16 2012 -0600 + + decode: updates all around + + Rewrite packet handling so packets can span multiple USB URBs + (which sometimes happens with WMC) and also add a bunch more + WMC decoding stuff. + + decode/decode.py | 34 +++------ + decode/packet.py | 130 +++++++++++++++++++-------------- + decode/qmux.py | 6 +- + decode/wmc.py | 215 + +++++++++++++++++++++++++++++++++++++++---------------- + 4 files changed, 244 insertions(+), 141 deletions(-) + +commit a9d6b5a8b62fc0fc07d7c3fab99b25c67474c68d +Author: Dan Williams +Date: Sat Jan 21 12:50:12 2012 -0600 + + wmc: more protocol updates + + libwmc/src/commands.c | 2 +- + libwmc/src/commands.h | 3 +- + libwmc/src/protocol.h | 93 + +++++++++++++++++++++++++++++++++++++++++---------- + 3 files changed, 79 insertions(+), 19 deletions(-) + +commit 0737a24f4394490bdf25f629169f70a3cbe085da +Author: Dan Williams +Date: Sat Jan 21 11:23:17 2012 -0600 + + qcdm: clarify IMxI conversions a bit; fix up WCDMA L1 states + + libqcdm/src/commands.c | 20 ++++++++++---------- + libqcdm/src/commands.h | 18 +++++++++--------- + libqcdm/src/dm-commands.h | 12 ++++++++---- + libqcdm/tests/test-qcdm-com.c | 8 ++++---- + 4 files changed, 31 insertions(+), 27 deletions(-) + +commit d068cde8193963b4d6767a8ac97ece041841b1fb +Author: Dan Williams +Date: Fri Jan 20 17:20:37 2012 -0600 + + decode: decode more WMC commands and fix some command names + + decode/wmc.py | 64 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 59 insertions(+), 5 deletions(-) + +commit 110897c65d6a9e136c2410d8a7c22f0f0f66c5de +Author: Dan Williams +Date: Fri Jan 20 16:56:20 2012 -0600 + + wmc: add some more global mode defines + + libwmc/src/commands.h | 6 ++++-- + libwmc/src/protocol.h | 6 ++++-- + libwmc/tests/test-wmc-com.c | 10 +++++++--- + 3 files changed, 15 insertions(+), 7 deletions(-) + +commit 21052004dd8cdbdf4db6421d477dc7b47e416eac +Author: Dan Williams +Date: Fri Jan 20 16:54:59 2012 -0600 + + decode: add another ignored packet type + + decode/packet.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a75157859c3aafe40c2121665df869dbe70ffaa2 +Author: Dan Williams +Date: Fri Jan 20 14:54:16 2012 -0600 + + wmc: prettier printing of serial stream and WMC packets + + libwmc/tests/test-wmc-com.c | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +commit 85a7575717ae12ca42ee068eb1299cd55524205d +Author: Dan Williams +Date: Fri Jan 20 14:52:58 2012 -0600 + + wmc: global mode command is 3 bytes not 2 + + libwmc/src/commands.c | 6 +++--- + libwmc/tests/test-wmc-com.c | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 1ae2381e5a834a7173f0654b904c68f219af854a +Author: Dan Williams +Date: Thu Jan 19 19:09:52 2012 -0600 + + wmc: add some more commands and fix up network info + + Add operator commands, and fix up the network info response + handling for GSM/WCDMA capable devices like the UML190 when + it's in GSM/WCDMA mode. + + libwmc/src/commands.c | 150 + +++++++++++++++++++++++++++++++++++++++----- + libwmc/src/commands.h | 48 ++++++++++++-- + libwmc/src/protocol.h | 136 ++++++++++++++++++++++++++++++++++----- + libwmc/tests/test-wmc-com.c | 126 +++++++++++++++++++++++++++++++++---- + libwmc/tests/test-wmc-com.h | 4 +- + libwmc/tests/test-wmc.c | 3 +- + 6 files changed, 419 insertions(+), 48 deletions(-) + +commit 47fd967d614dcfdc3e216b90a32522e0a57bd28b +Author: Dan Williams +Date: Thu Jan 19 18:51:55 2012 -0600 + + wmc: make warn macros more useful + + libwmc/src/errors.h | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit d519f3e364804d1dbf103e5caef31dc5942a26fe +Author: Dan Williams +Date: Thu Jan 19 18:48:26 2012 -0600 + + wmc: fix stringification of wmc_xxx_if_fail() macros + + Actually reading about preprocessor concatenation and stringification + helps. + + libwmc/src/errors.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 337f4b2372412abeec2e7de15d4f31dacf73df52 +Author: Dan Williams +Date: Thu Jan 19 12:50:40 2012 -0600 + + wmc: add Access Technology/Service definitions and Global Mode stuff + + Comparing dumps from UML190 in different modes, UML290, and PC5740 + revealed what the 'service' bit was, which matches up nicely with + the SERVICE_* strings in the Windows connection manager DLLs if + you interpret them in reverse numerical order. + + For the global mode stuff, looking at USB wire captures shows that + C8 03 and C8 04 get used right before the NETWORK_INFO (C8 0B) + shows access technology changes, which means they are probably the + commands that switch global mode around. + + libwmc/src/protocol.h | 71 + +++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 69 insertions(+), 2 deletions(-) + +commit 4e7fb72d2d88b308384fb8c54d9a3a65ba6f7dc2 +Author: Dan Williams +Date: Thu Jan 19 11:55:12 2012 -0600 + + decode: fix tab/space confusion in analyze.py + + decode/analyze.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 285cd37f11b688cff53e338426917db58deaba4c +Author: Dan Williams +Date: Thu Jan 19 10:08:09 2012 -0600 + + wmc: STATUS is appears to be NETWORK_INFO + + So rename it in various places. + + libwmc/src/commands.c | 24 ++++++++++++------------ + libwmc/src/commands.h | 12 ++++++------ + libwmc/src/protocol.h | 14 +++++++------- + libwmc/tests/test-wmc-com.c | 12 ++++++------ + 4 files changed, 31 insertions(+), 31 deletions(-) + +commit c9a42d98c2a5a5cfe3015fa11838bfc432d1636f +Author: Dan Williams +Date: Thu Jan 19 09:52:06 2012 -0600 + + qcdm: add some mode prefs + + libqcdm/src/nv-items.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f9a32a47edd7b882b3522cb4e39a071c667ac73b +Author: Dan Williams +Date: Wed Jan 18 18:08:20 2012 -0600 + + gsm: fix return value of SMS send method + + The introspection data specified the Send() method to return + an array of unsigned integers, presumably the indexes of the + messages just sent. But the code wasn't doing that, leading + to a crash when dbus-glib tried to interpret garbage on the + return. + + The problem is that sms_send_auth_cb() gave async_call_done() + as the callback for sending the SMS, but that method just calls + dbus_g_method_return() with no return arguments. dbus-glib + interprets the arguments of dbus_g_method_return() according + to the XML introspection data, and thus it was attempting to + read the non-existent argument as an 'au' and getting garbage. + + Fix that by actually returning an array of message indexes from + the SMS send code, and propagate that back to the SMS dbus + code so it can return something sensible. + + src/mm-generic-gsm.c | 49 + ++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-modem-gsm-sms.c | 41 ++++++++++++++++++++++++++++++++++++----- + src/mm-modem-gsm-sms.h | 9 +++++++-- + 3 files changed, 89 insertions(+), 10 deletions(-) + +commit fc3fd7b983c564bc6d6523ad1232959734e04025 +Author: Dan Williams +Date: Wed Jan 18 18:07:45 2012 -0600 + + test: print sent SMS message index on success + + test/mm-send-sms.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 04e87e70ff629309413c7426d97457e5c58e19fe +Author: Dan Williams +Date: Wed Jan 18 17:02:48 2012 -0600 + + qcdm: some devices do implement SW_VERSION + + Like the MF627 for some reason. Also, the format appears to be + more like the DM_CMD_VERSION_INFO response where at least the + comp_date and comp_time fields are the same size as + VERSION_INFO, just with some padding between. + + libqcdm/src/commands.c | 2 +- + libqcdm/src/dm-commands.h | 4 +++- + libqcdm/tests/test-qcdm-com.c | 11 +++++------ + 3 files changed, 9 insertions(+), 8 deletions(-) + +commit e2306a0dd5958ee9fef7305c6e41a0595bbeb3cc +Author: Dan Williams +Date: Wed Jan 18 16:29:02 2012 -0600 + + gsm: change SMS send validity from 5-minute units to minutes + + Might as well keep it simple. + + .../org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 5 +-- + src/mm-modem-gsm-sms.c | 2 +- + src/mm-sms-utils.c | 46 + +++++++++++----------- + src/tests/test-sms.c | 33 +++++++++++++--- + test/mm-send-sms.py | 2 +- + 5 files changed, 56 insertions(+), 32 deletions(-) + +commit c437da20ffe1873b15c338f95be4bee26e26b401 +Author: Dan Williams +Date: Wed Jan 18 15:43:22 2012 -0600 + + test: enhance SMS send util to accept validity and SMSC address + + test/mm-send-sms.py | 44 ++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 36 insertions(+), 8 deletions(-) + +commit 5c561995aacdab2b29f8eabf38ad8703eec75cab +Author: Dan Williams +Date: Wed Jan 18 15:26:12 2012 -0600 + + gsm: fix CMGS PDU mode length calculation + + The first byte of the PDU is the SMSC length, but it's not + the padded SMSC length. So we need to subtract the actual + byte index of the start of the message from length of the + PDU, and since the PDU creation function knows all about + where the SMSC address stops and the message begins, just + have it return that length instead of making the callers + calculate it. + + src/mm-generic-gsm.c | 8 +++----- + src/mm-sms-utils.c | 6 ++++++ + src/mm-sms-utils.h | 1 + + src/tests/test-sms.c | 25 +++++++++++++++---------- + 4 files changed, 25 insertions(+), 15 deletions(-) + +commit d51ff9ac07973701ee790f57c82a99cc25d92ab1 +Author: Dan Williams +Date: Wed Jan 18 13:45:03 2012 -0600 + + gsm: use PDU modem when the modem doesn't support text mode + + Eventually we should be using PDU mode whenever the modem supports + it instead of defaulting to text mode, but there are still some + bugs. + + src/mm-generic-gsm.c | 122 + +++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 118 insertions(+), 4 deletions(-) + +commit 43e6039cee57f70b18119a8a68305ec8017f46fb +Author: Dan Williams +Date: Wed Jan 18 13:44:20 2012 -0600 + + qcdm: GSM MCC, MNC, LAC and CI don't seem to valid in WCDMA mode + + So don't bother trying to parse them. + + libqcdm/src/commands.c | 40 ++++++++++++++++++++++------------------ + 1 file changed, 22 insertions(+), 18 deletions(-) + +commit e08e46fb1a77c61c45cb4e350595fbfbb252d784 +Author: Dan Williams +Date: Wed Jan 18 13:25:00 2012 -0600 + + qcdm: let WCDMA/GSM devices pass CDMA-only tests + + Obviously they don't implement the CDMA-only commands. + + libqcdm/tests/test-qcdm-com.c | 34 +++++++++++++++++++++++++++++----- + 1 file changed, 29 insertions(+), 5 deletions(-) + +commit 1655b3d323d914f0ba45ebc438e66f655730dc2e +Author: Dan Williams +Date: Wed Jan 18 13:24:35 2012 -0600 + + test: print out error if sending SMS fails + + test/mm-send-sms.py | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 6789a87a5826638472b88d600b99414ce3daa5bd +Author: Dan Williams +Date: Wed Jan 18 13:00:50 2012 -0600 + + tests: better handling of encodings in SMS test tool + + Python usually uses Unicode, but often the shell encoding + will be in UTF-8, so Python needs some help converting the + message to Unicode. Use LANG to do that if we can. + + test/mm-send-sms.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 3f4056caab93ea4f208f5da4a8cd50de5fef52d8 +Author: Dan Williams +Date: Wed Jan 18 12:56:52 2012 -0600 + + tests: add a test for 25-character SMS messages + + Tests that the last septet (packed in an octet by itself) + doesn't get left off the message like the old code used to + do before "core: fix some bugs in GSM7 packing code". + + src/tests/test-sms.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 9bba24941b89bfdf308a241f67e08a441feee0ee +Author: Dan Williams +Date: Wed Jan 18 12:52:28 2012 -0600 + + api: change SMS save/send validity units + + Making clients pass the raw GSM PDU value isn't very useful + since it's not exactly trivial to create programmatically. + Instead, let's make validity be units of 5 minutes and MM + will automatically figure out how to map that to the PDU + value. + + introspection/org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 27b981237eff9ef6239609ed040dc8c088e943d8 +Author: Dan Williams +Date: Wed Jan 18 12:28:50 2012 -0600 + + core: fix some bugs in GSM7 packing code + + The existing gsm_pack() had a bug where if the last + septet should be in an octet by itself, that last + octet wouldn't be added. Plus, kinda pointless to + use a GByteArray here when we already know what the + length will be through simple arithmetic. + + We can also simplify the function too. + + Furthermore, there weren't any testcases for starting + packing at an offset other than zero, so add one. + + src/mm-charsets.c | 46 + +++++++++++++++++++++------------------------- + src/tests/test-charsets.c | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 66 insertions(+), 25 deletions(-) + +commit 178f30bdd3111ba645b92ae6511911cc6a9ece4c +Author: Dan Williams +Date: Tue Jan 17 18:49:18 2012 -0600 + + qcdm: fill in some GSM and WCDMA stuff + + libqcdm/src/commands.c | 149 ++++++++++++++++++++++++++ + libqcdm/src/commands.h | 69 ++++++++++++ + libqcdm/src/dm-commands.h | 44 ++++++++ + libqcdm/tests/test-qcdm-com.c | 239 + +++++++++++++++++++++++++++++++++++++----- + libqcdm/tests/test-qcdm-com.h | 4 + + libqcdm/tests/test-qcdm.c | 2 + + 6 files changed, 482 insertions(+), 25 deletions(-) + +commit 80a41ed11b8ba40a54cecf044c2957a70a249b4d +Author: Dan Williams +Date: Tue Jan 17 13:13:09 2012 -0600 + + gsm: add SMS PDU creation function + + Only for basic SMS-SUBMIT PDUs at the moment, and doesn't + support large SMSs yet. + + src/mm-charsets.c | 178 +++++++++++++++++++++++++++++- + src/mm-charsets.h | 5 + + src/mm-sms-utils.c | 303 + ++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-sms-utils.h | 15 +++ + src/tests/test-sms.c | 173 +++++++++++++++++++++++++++++ + 5 files changed, 671 insertions(+), 3 deletions(-) + +commit ad29e8dd885469887ee905fd7473ffdcfcb3d869 +Author: Dan Williams +Date: Tue Jan 17 13:12:31 2012 -0600 + + trivial: update .gitgnore + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit dec9cc66eb3a321af082df40a55e268415b759b7 +Author: Dan Williams +Date: Mon Jan 16 14:11:25 2012 -0600 + + core: register SMS errors with dbus-glib + + src/mm-manager.c | 1 + + 1 file changed, 1 insertion(+) + +commit bab6ae955274a878515e5fda3d4f758d2a345bf5 +Author: Dan Williams +Date: Mon Jan 16 12:22:18 2012 -0600 + + serial: handle CMS errors correctly + + src/mm-serial-parsers.c | 39 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) + +commit 7dea934844cba4505063ca318d7e8575db5156f9 +Author: Dan Williams +Date: Mon Jan 16 12:15:43 2012 -0600 + + core: add CMS errors + + src/mm-errors.c | 141 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-errors.h | 39 ++++++++++++++++ + 2 files changed, 180 insertions(+) + +commit b24561e99eab939d49c1a33c64a4b1af6a68faaf +Author: Dan Williams +Date: Fri Jan 13 14:56:04 2012 -0600 + + decode: don't try interpreting non-WMC data as WMC + + decode/wmc.py | 3 +++ + 1 file changed, 3 insertions(+) + +commit a6548ebe40145865aff925877d9ceabdc54c9b57 +Author: Dan Williams +Date: Thu Jan 12 13:00:52 2012 -0600 + + qcdm: start filling out log messages and items + + Log messages are enabled by LOG_CONFIG and are then reported + as unsolicited responses with code DM_CMD_LOG. Each log type + appears to have its own message format which are now being + added to log-items.h. + + libqcdm/src/Makefile.am | 1 + + libqcdm/src/dm-commands.h | 11 +++ + libqcdm/src/log-items.h | 161 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 4 ++ + 4 files changed, 177 insertions(+) + +commit 474d9136ba6b99cb8ec2dba54621b1ce2a69c144 +Author: Dan Williams +Date: Wed Jan 11 17:55:10 2012 -0600 + + qcdm: fix warning when no log codes are enabled + + libqcdm/src/commands.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit bf31764babdc4980b32b92792ca07fd06aa5cbfc +Author: Dan Williams +Date: Wed Jan 11 16:10:37 2012 -0600 + + qcdm: enhance LOG_CONFIG testcase + + libqcdm/tests/test-qcdm-com.c | 54 + +++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 50 insertions(+), 4 deletions(-) + +commit b14044bc9a43bce7f3f6248bb5278ab5a235ebad +Author: Dan Williams +Date: Wed Jan 11 16:10:02 2012 -0600 + + qcdm: only warn on unknown mode pref NV item values + + libqcdm/src/commands.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 29a1385e6ce7aee72cba32a0b47ae18e3994e9b5 +Author: Dan Williams +Date: Wed Jan 11 15:30:45 2012 -0600 + + qcdm: LOG_CONFIG fixups + + Fix some buffer overruns. Log codes are also 16-bit not 32. + + libqcdm/src/commands.c | 21 ++++++++++++--------- + libqcdm/src/commands.h | 2 +- + 2 files changed, 13 insertions(+), 10 deletions(-) + +commit f3208bf3a6a94ed2a5e3f87c703df9ee0896cabf +Author: Dan Williams +Date: Wed Jan 11 14:25:23 2012 -0600 + + qcdm: add support for Log Config command + + This appears to be a newer version of EXT_LOGMASK that also + works with GSM/UMTS and other subsystems. + + libqcdm/src/commands.c | 228 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 29 ++++++ + libqcdm/src/dm-commands.h | 32 ++++++ + libqcdm/src/errors.h | 1 + + libqcdm/tests/test-qcdm-com.c | 43 ++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 7 files changed, 336 insertions(+) + +commit b22b2d99db57e4cec8e6c3074dd20acd6845cb62 +Author: Dan Williams +Date: Wed Jan 11 14:24:43 2012 -0600 + + qcdm: add u16 arrays to results + + libqcdm/src/result-private.h | 5 +++ + libqcdm/src/result.c | 79 + +++++++++++++++++++++++++++++++++++++++++++- + libqcdm/src/result.h | 5 +++ + 3 files changed, 88 insertions(+), 1 deletion(-) + +commit 1804ae2fe52acfee52f70aba5fb0acb9888a9c8b +Author: Dan Williams +Date: Wed Jan 11 12:53:06 2012 -0600 + + qcdm: fix stringification of qcdm_xxx_if_fail() macros + + Actually reading about preprocessor concatenation and stringification + helps. + + libqcdm/src/errors.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 2e2c8ad7efb42924b2928af287be67f95b27b48f +Author: Dan Williams +Date: Tue Jan 10 19:11:57 2012 -0600 + + qcdm: add some more commands + + Found in CodeAurora diagchar_core.c driver. + + libqcdm/src/dm-commands.h | 5 +++++ + 1 file changed, 5 insertions(+) + +commit e98f2ebf4095708aa52d69a5a067f6cec9042d6d +Author: Dan Williams +Date: Tue Jan 10 19:01:40 2012 -0600 + + qcdm: clarify some subsystems + + libqcdm/src/dm-commands.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit d085e6c46741832bd6edc167077664d821c0a489 +Author: Dan Williams +Date: Tue Jan 10 18:15:11 2012 -0600 + + qcdm: fix up testcases for more expected error codes + + I'm bored and playing around with a Novatel E725... + + libqcdm/tests/test-qcdm-com.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit ff838972cfef660cabfe7224d50459d5148b5f64 +Author: Dan Williams +Date: Tue Jan 10 18:14:40 2012 -0600 + + qcdm: don't segfault getting number of log items + + Not sure how this worked before at all. + + libqcdm/src/commands.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 86e3ab154032cb2d348c7ee8be26628a8ef37554 +Author: Dan Williams +Date: Mon Jan 9 17:21:27 2012 -0600 + + sms: punt handling of 8-bit encoded SMSs to clients + + There's no encoding information about 8-bit SMS messages, + and they are often binary things like ringtones or voicemail + indicator commands. Since there's no point to our parsing + them just let clients deal with it. + + .../org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 4 +- + src/mm-sms-utils.c | 61 + ++++++++++++++-------- + src/tests/test-sms.c | 34 +++++++++++- + 3 files changed, 74 insertions(+), 25 deletions(-) + +commit 96210d1c5530aa623f49e1ef19eb44c88f137581 +Author: Dan Williams +Date: Mon Jan 9 16:26:27 2012 -0600 + + dbus: don't install introspection XML we don't really own + + MM implements the DBus properties interface and of course that + requires some XML on our side for dbus-glib. But we shouldn't + install that along with our ModemManager-specific XML. + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2f1d8f7fb334ba05fba0676f61333f8246b7e4a5 +Author: Dan Williams +Date: Mon Jan 9 14:53:39 2012 -0600 + + nokia: fix PPP port for CSxx Internet Sticks + + USB interface 0 isn't a serial interface; it's probably a custom + Nokia PhoNet port or a custom Icera pseudo-ethernet port. But + it's not a CDC-ACM serial port, at least on the CS17. + + Reported by Uwe Geuder. + + plugins/77-mm-nokia-port-types.rules | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit d52b4517271916fb3a6cc2a8df63b75829081d8d +Author: Aleksander Morgado +Date: Sat Jan 7 15:54:19 2012 +0100 + + policy: fix typo + + Reported at LP#913138 + + policy/org.freedesktop.modem-manager.policy.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 11fbcc901094dfe9f6395ce6a94e0faab57aabbd +Author: Dan Williams +Date: Thu Jan 5 12:31:13 2012 -0600 + + qcdm: fill out some operating modes + + libqcdm/src/commands.h | 9 ++++++++- + libqcdm/src/dm-commands.h | 11 +++++++++++ + libqcdm/tests/test-qcdm-com.c | 35 ++++++++++++++++++++++++++--------- + 3 files changed, 45 insertions(+), 10 deletions(-) + +commit 62d26479ff70f353bf81d0971397017ae2e353fc +Author: Dan Williams +Date: Thu Jan 5 12:29:03 2012 -0600 + + qcdm: better handle NV item read/write status codes + + libqcdm/src/commands.c | 30 +++++++++++++++++++++++++++--- + libqcdm/src/errors.h | 7 +++++++ + libqcdm/src/nv-items.h | 12 ++++++++++++ + libqcdm/tests/test-qcdm-com.c | 14 ++++++++++---- + 4 files changed, 56 insertions(+), 7 deletions(-) + +commit 6e961ddd83b9f5aea64ee73ecb1398a3466d5509 +Author: Dan Williams +Date: Thu Jan 5 11:05:32 2012 -0600 + + qcdm: fix up live testcase for recent changes + + And interpret all the recent mode preferences. + + libqcdm/src/commands.c | 16 ++++++++++++---- + libqcdm/src/commands.h | 11 ++++++++--- + libqcdm/tests/test-qcdm-com.c | 33 ++++++++++++++++++++++++--------- + 3 files changed, 44 insertions(+), 16 deletions(-) + +commit 30bb9e878fb3e5647fc3bcf8279e1de045325ae3 +Author: Dan Williams +Date: Tue Jan 3 00:30:59 2012 -0600 + + cdma: fixes for libqcdm changes + + plugins/mm-modem-novatel-cdma.c | 16 +++++------ + src/mm-generic-cdma.c | 58 + +++++++++++++++++++++++---------------- + src/mm-plugin-base.c | 22 ++++++--------- + src/mm-qcdm-serial-port.c | 14 ++++++++-- + src/tests/test-qcdm-serial-port.c | 20 ++++++-------- + 5 files changed, 69 insertions(+), 61 deletions(-) + +commit 7b14063f4676a51c3a0d8b9adc89a9490d6b5814 +Author: Dan Williams +Date: Tue Jan 3 00:14:32 2012 -0600 + + qcdm: remove usage of glib + + People have asked for this at various times. + + libqcdm/configure.ac | 5 +- + libqcdm/src/Makefile.am | 4 +- + libqcdm/src/com.c | 21 +- + libqcdm/src/com.h | 4 +- + libqcdm/src/commands.c | 838 + ++++++++++++++++++------------------- + libqcdm/src/commands.h | 244 +++++------ + libqcdm/src/dm-commands.h | 250 +++++------ + libqcdm/src/error.c | 88 ---- + libqcdm/src/error.h | 54 --- + libqcdm/src/errors.c | 60 +++ + libqcdm/src/errors.h | 94 +++++ + libqcdm/src/nv-items.h | 16 +- + libqcdm/src/result-private.h | 35 +- + libqcdm/src/result.c | 438 ++++++++++++------- + libqcdm/src/result.h | 26 +- + libqcdm/src/utils.c | 91 ++-- + libqcdm/src/utils.h | 53 ++- + libqcdm/tests/test-qcdm-com.c | 264 ++++++------ + libqcdm/tests/test-qcdm-escaping.c | 2 +- + libqcdm/tests/test-qcdm-result.c | 32 +- + libqcdm/tests/test-qcdm-result.h | 1 + + libqcdm/tests/test-qcdm-utils.c | 4 +- + libqcdm/tests/test-qcdm.c | 1 + + 23 files changed, 1365 insertions(+), 1260 deletions(-) + +commit 1e1c8a5ae4e5296bd6648feff9390a4692683a1f +Author: Dan Williams +Date: Tue Jan 3 00:12:36 2012 -0600 + + wmc: remove usage of glib + + People have asked for leaner builds and glib isn't strictly + required for the core library. + + libwmc/src/commands.c | 34 ++++----- + libwmc/src/result.c | 2 +- + libwmc/src/utils.c | 157 + ++++++++++++++++++++------------------- + libwmc/src/utils.h | 94 ++++++++++++----------- + libwmc/tests/test-wmc-com.c | 40 +++++----- + libwmc/tests/test-wmc-com.h | 4 +- + libwmc/tests/test-wmc-escaping.c | 14 ++-- + libwmc/tests/test-wmc-utils.c | 36 ++++----- + 8 files changed, 196 insertions(+), 185 deletions(-) + +commit 267b83ae27014d0d3bfee6f19ae3a5f0efad0b67 +Author: Dan Williams +Date: Sat Dec 31 11:43:42 2011 -0600 + + sierra: add support for Icera based devices (USB305, AT&T Lightning) + + plugins/Makefile.am | 3 + + plugins/mm-modem-sierra-gsm.c | 197 + +++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 186 insertions(+), 14 deletions(-) + +commit c9d0dea5b09f2b6ad3b6f199a32a5c282d3716bc +Author: Dan Williams +Date: Fri Dec 30 20:36:01 2011 -0600 + + decode: add some python tools to decode SniffUSB dumps + + decode.py will read SniffUSB logs of communication with + QMUX or WMC speaking devices. It will dump the packets + in both hex and ASCII. If you know something about the + device then you can tell it to decode the packets. For + example, we know the Pantech UML290's WMC port speaks + WMC using Bulk Transfers, so we can: + + decode.py --transfer=wmc + + or we know the UML290's "rmnet" port speaks raw IP in + the Bulk Transfers and QMUX in the Control Transfers, so: + + decode.py --control=qmux + + qmiprotgen.py takes a path to an Entities.txt file and + dumps out the protocol entities and services in + Python code which is used by qmux.py. + + xml2ascii.py and analyze.py dump out UsbSnoopy XML logs + but these are not as usable as the SniffUSB logs (they + do not provide good direction information). + + http://www.wingmanteam.com/usbsnoopy/ + http://www.pcausa.com/Utilities/UsbSnoop/ + + decode/analyze.py | 179 ++++ + decode/decode.py | 71 ++ + decode/defs.py | 20 + + decode/packet.py | 192 ++++ + decode/qmiprotgen.py | 494 +++++++++++ + decode/qmiprotocol.py | 2352 + +++++++++++++++++++++++++++++++++++++++++++++++++ + decode/qmux.py | 187 ++++ + decode/wmc.py | 211 +++++ + decode/xml2ascii.py | 82 ++ + 9 files changed, 3788 insertions(+) + +commit a2b578d755e51f820bbe015431ef02266454e66b +Author: Aleksander Morgado +Date: Fri Dec 30 19:32:30 2011 +0100 + + modem-helpers: plug a leak when parsing CREG responses + + src/mm-modem-helpers.c | 1 + + 1 file changed, 1 insertion(+) + +commit d38787c4608b14f64d695df4c41bb464f4c989c6 +Author: Aleksander Morgado +Date: Fri Dec 30 19:27:46 2011 +0100 + + modem-helpers: plug a leak when building device ID + + src/mm-modem-helpers.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 9ee88e82863c08dd9013732abf2e605cf078a347 +Author: Aleksander Morgado +Date: Fri Dec 30 18:33:32 2011 +0100 + + serial-parsers: plug small leak + + src/mm-serial-parsers.c | 1 + + 1 file changed, 1 insertion(+) + +commit 9f14d830472f77b89ed54d1269c741e787ca10c3 +Author: Dan Williams +Date: Wed Dec 14 14:19:10 2011 -0600 + + gsm: treat "no network" error as zero signal for Simple.GetStatus + + src/mm-generic-gsm.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 2af1a612e9187c0e2bf3a8e3d007f04aa023add9 +Author: Dan Williams +Date: Wed Dec 7 17:07:46 2011 -0600 + + core: don't crash on error if response is NULL + + Various bits of the code didn't check if response was valid + or not during error conditions, and when an error occurs + sometimes it'll be NULL (since not all errors are translated + errors from the modem, some are serial or general ones). We + have to make sure we don't try to use response->str when + response doesn't exist. + + Found in the generic CDMA code likely as a result of + d5d9eec2b52363a7460aeec0c020b1c6a7af6b03 but was a bug long + before that commit happened anyway. + + plugins/mm-modem-mbm.c | 4 +++- + plugins/mm-plugin-longcheer.c | 3 ++- + plugins/mm-plugin-x22x.c | 3 ++- + src/mm-generic-cdma.c | 5 +++-- + src/mm-generic-gsm.c | 2 +- + src/mm-modem-base.c | 3 ++- + 6 files changed, 13 insertions(+), 7 deletions(-) + +commit c1e64f1a33b8b877945e59bda58b1969cdc27614 +Author: Nathan Williams +Date: Wed Nov 30 17:33:39 2011 -0500 + + gsm: improve scan response regex construction error handling + + Change the error handling to be a bit more like what appears to have + been intended: if constructing the regex fails, report an error and + return. The existing code looked like it was set up to do this, but + wasn't quite wired together, and had process-terminating calls + (g_error()) followed by other code. + + Change-Id: I4a7cee8fe01291976edc2e343fcbeb73e882f20b + + src/mm-modem-helpers.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 58b2a79f83269dfb57479c244c517c7fb6ff8ace +Author: Nathan Williams +Date: Wed Nov 30 17:25:12 2011 -0500 + + sms: fix two bugs with multipart SMS handling: signals and listing + + First, arrange for received/complete signals to be sent by calling + cmti_received_has_sms() with the message properties even if the + message isn't complete yet. + + Second, make the operation of the List command's multipart message + handling independent of message order by doing one pass to insert the + messages into the cache and second pass to retrieve the complete + messages. + + Change-Id: I3dcae940d71aec3ddb65c508675f710d1567b0e2 + + src/mm-generic-gsm.c | 51 + +++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 37 insertions(+), 14 deletions(-) + +commit fc5eed79ee1b13471fb4d5bbfa1d2d62401dda4d +Author: Dan Williams +Date: Thu Dec 1 17:35:09 2011 -0600 + + mbm: add USB IDs for HP hs2340 + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit ae92c74a7752df0ae4ebc69b31beec4fac324e39 +Author: Vitaly Gimly +Date: Wed Nov 30 10:56:50 2011 -0600 + + trivial: remove unecessary semicolons + + src/mm-modem-gsm-ussd.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 65340bdf6ccafc4417c6166e07440ef961e01bd4 +Author: Jiří Klimeš +Date: Wed Nov 30 12:38:52 2011 +0100 + + cdma: free one more GError + + src/mm-generic-cdma.c | 1 + + 1 file changed, 1 insertion(+) + +commit 8d64d0fdda5699c566642fac1cbd735d40cf9225 +Author: Nathan Williams +Date: Tue Nov 29 11:31:37 2011 -0500 + + gsm/cdma: free up a couple of dangling GErrors + + Change-Id: I4f07e7e08bcbfc116114191c759cc0af4bb8ea23 + + src/mm-generic-cdma.c | 1 + + src/mm-generic-gsm.c | 1 + + 2 files changed, 2 insertions(+) + +commit d5d9eec2b52363a7460aeec0c020b1c6a7af6b03 +Author: Nathan Williams +Date: Wed Nov 23 16:16:20 2011 -0500 + + serial: report port-not-open in queueing commands via callback + + Reporting errors instead of just returning permits routines like + mm-generic-gsm.c:simple_get_status() to work again, as their callbacks + get the error they are expecting. To make this work, adapt + get_csq_done() + to handle a NULL response when error is set, and make sure that + multiple + errors don't step on each other in the mm_callback_info_chain() + sequence + created by simple_get_status(). + + Change-Id: Ie3a72b1ce71b7f117e8b1f3da7a406c4d2da9e02 + + src/mm-generic-gsm.c | 14 +++++++++++--- + src/mm-serial-port.c | 10 +++++++++- + 2 files changed, 20 insertions(+), 4 deletions(-) + +commit 44194ac04d7926cb80de03fe95ce98bd64a1c6c6 +Author: Dan Williams +Date: Thu Nov 17 12:48:36 2011 -0600 + + nokia: add port tags for CS-xx Internet Sticks + + They appear to always want PPP to happen on interface 0, according + to the Windows .INF files. + + plugins/77-mm-nokia-port-types.rules | 39 + ++++++++++++++++++++++++++++++++++++ + plugins/Makefile.am | 3 ++- + plugins/mm-plugin-nokia.c | 11 ++++++++-- + 3 files changed, 50 insertions(+), 3 deletions(-) + +commit 02aa10c72ab6f3bad24b0977268b0d9d56674311 +Author: Dan Williams +Date: Wed Nov 16 23:39:34 2011 -0600 + + gsm: check facility locks after unlocking PIN + + Some modems don't allow most commands when they are PIN locked, so + the initial facility lock check errors out. Check the locks again + after the SIM is unlocked. + + src/mm-generic-gsm.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +commit eede5bb621152eb1774495d9cd403b1e653c076c +Author: Eric Shienbrood +Date: Thu Aug 11 13:58:59 2011 -0400 + + gsm: add new property to track which facility locks are enabled + + The property EnabledFacilityLocks on the .Modem.Gsm.Card interface + is a bit mask that indicates which of the various personalization + codes from 3GPP TS 22.022, plus the SIM PIN lock and SIM PIN2 lock, + are enabled. The set of facility locks supported by the modem is + determined at the time the modem is initialized, and the state of + each supported lock (enabled or disabled) is determined. When the + state of a lock changes, a property-change signal is sent out. Note + that ModemManager only supports enabling and disabling SIM-PIN, via + the EnablePin method on Modem.Gsm.Card. + + ...org.freedesktop.ModemManager.Modem.Gsm.Card.xml | 6 + + .../org.freedesktop.ModemManager.Modem.Gsm.xml | 37 +++- + src/mm-generic-gsm.c | 214 + ++++++++++++++------- + src/mm-generic-gsm.h | 3 +- + src/mm-modem-gsm-card.c | 10 + + src/mm-modem-gsm-card.h | 3 + + src/mm-modem-helpers.c | 145 ++++++++++++++ + src/mm-modem-helpers.h | 7 + + 8 files changed, 357 insertions(+), 68 deletions(-) + +commit e7b6b2dc1c709ae877e3cd472d4134b918bb5fb7 +Author: Eric Shienbrood +Date: Wed Nov 16 17:42:50 2011 -0600 + + core: keep track of all PIN retry counts + + Added a PinRetryCounts property on org.freedesktop.ModemManager.Modem. + This is dictionary that records the number of PIN tries remaining + for each of the possible PIN code types for which the modem is + capable of reporting the count. Also, these counts are kept up + to date across ChangePin and EnablePin operations, not just when + an unlock is attempted. + + .../org.freedesktop.ModemManager.Modem.xml | 17 +++- + plugins/mm-modem-huawei-gsm.c | 65 ++++++-------- + plugins/mm-modem-mbm.c | 50 +++++------ + plugins/mm-modem-samsung-gsm.c | 95 + +++++---------------- + src/mm-callback-info.c | 20 +++++ + src/mm-callback-info.h | 4 + + src/mm-generic-gsm.c | 62 +++++++++----- + src/mm-modem-base.c | 98 + ++++++++++++++++------ + src/mm-modem-base.h | 11 ++- + src/mm-modem-gsm-card.c | 16 ++-- + src/mm-modem-gsm-card.h | 10 +-- + src/mm-modem.c | 10 +++ + src/mm-modem.h | 9 ++ + 13 files changed, 260 insertions(+), 207 deletions(-) + +commit 71598a628987162196b98124486ad8e728852ec5 +Author: Graham Inggs +Date: Tue Nov 15 11:27:57 2011 -0600 + + huawei: remove padding from USSD responses + + Probably needed in generic USSD code. + + plugins/mm-modem-huawei-gsm.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 262f0f5e81ae5b346090102acecf642ed0ee09f9 +Author: Dan Williams +Date: Mon Nov 14 17:38:02 2011 -0600 + + wmc: fix build after fixup of WMC field names + + libwmc/src/commands.c | 6 +++--- + libwmc/src/commands.h | 2 +- + libwmc/tests/test-wmc-com.c | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit add6131edfb4271748b5991f0ce6f447fef88f6d +Author: Graham Inggs +Date: Mon Nov 14 17:36:23 2011 -0600 + + huawei: pad USSD requests if necessary + + ModemManager currently encodes the USSD command *141*0# (for MTN South + Africa) as "AA182DA6828D00". + While this works on some modems, for example the E1820, other modems, + for example the E160, require USSD commands that are a multiple of 7 + characters long to be padded with 0x0d. + Huawei Mobile Partner dashboard software for Windows encodes *141*0# + as "AA182DA6828D1A" which works on both the E1820 and the E160. + + The attached patch pads the USSD command with 0x0d before encoding if + it is a multiple of 7 characters long. + + plugins/mm-modem-huawei-gsm.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit ef74d84b32b90131bc15cb0db1431840b460f08a +Author: Dan Williams +Date: Mon Nov 14 12:33:59 2011 -0600 + + wmc: demystify some fields in the IP info reply + + libwmc/src/protocol.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 61375a5fd6a932ca836d50d92770f3ffd16b7fd6 +Author: Dan Williams +Date: Mon Nov 14 12:24:56 2011 -0600 + + wmc: demystify some more fields of the device info response + + libwmc/src/protocol.h | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 1aa6d01d53f2034e85156c3d3fece4d198ba6035 +Author: Dan Williams +Date: Fri Nov 11 23:39:20 2011 -0600 + + wmc: protocol and testcase update + + libwmc/src/commands.c | 98 + ++++++++++++++++++++++++++++++++++++++++++++- + libwmc/src/commands.h | 15 +++++++ + libwmc/src/protocol.h | 85 ++++++++++++++++++++++++++++++++++++++- + libwmc/tests/test-wmc-com.c | 65 +++++++++++++++++++++++++++++- + libwmc/tests/test-wmc-com.h | 2 + + libwmc/tests/test-wmc.c | 1 + + 6 files changed, 262 insertions(+), 4 deletions(-) + +commit ae3f1cd578e59245a6bff5cfd19f64f0c47f5de9 +Author: Dan Williams +Date: Fri Nov 11 12:20:51 2011 -0600 + + libwmc: add testcases that talk to the device + + libwmc/src/commands.c | 70 ++++++++++++++++++++++++++-- + libwmc/src/commands.h | 5 ++ + libwmc/src/protocol.h | 17 +++++++ + libwmc/src/utils.c | 79 +++++++++++++++++++++++++++++++- + libwmc/src/utils.h | 26 ++++++++--- + libwmc/tests/test-wmc-com.c | 104 + +++++++++++++++++++++++++++++++++++++----- + libwmc/tests/test-wmc-com.h | 6 ++- + libwmc/tests/test-wmc-utils.c | 4 +- + libwmc/tests/test-wmc.c | 12 +++-- + 9 files changed, 293 insertions(+), 30 deletions(-) + +commit 83c905837693f095d9e7c1bf9ac56d8290510f45 +Author: Thomas Bechtold +Date: Mon Nov 7 00:03:11 2011 +0100 + + build: remove duplicate 'policy' directory entry from SUBDIRS + + It is already added when WITH_POLKIT is set. + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 128e9abcee26ed691317b33aaacb795609855dd7 +Author: Nathan Williams +Date: Thu Nov 3 16:21:45 2011 -0400 + + serial: reject new commands when the port is closed. + + Otherwise, we can schedule a main loop call to + mm_serial_port_queue_process() for an object that's about to + disappear, leading to a crash. + + Change-Id: I433a76855c52536eb2b99a5ecf26ac71afe1f8bb + + src/mm-serial-port.c | 1 + + 1 file changed, 1 insertion(+) + +commit a027d27da8bb723b344fc2805ae9f3e2489dac00 +Author: Nathan Williams +Date: Thu Nov 3 16:13:07 2011 -0400 + + gsm: finish all disable commands before returning + + Rearrange the primary and secondary-port disable operations so that + there's a linear chain of callbacks rather than a second dangling + callback chain for the secondary port; it's possible for the primary + port operations to complete, and for the callback to finish and start + tearing down the entire device, before the secondary port commands + run. + + Change-Id: Ia95a7eae574737cdec38b14d39786127be1b3184 + + src/mm-generic-gsm.c | 40 +++++++++++++++++++++++++--------------- + 1 file changed, 25 insertions(+), 15 deletions(-) + +commit 87ec5e09a537f3ede83238a35ccd37ccc38eff8e +Author: Nathan Williams +Date: Tue Aug 30 11:00:53 2011 -0400 + + gsm: multipart SMS support + + Keep a local cache of SMS message fragments when we perform a List or + Get command on the modem; use this cache to reassemble fragments into + complete messages, which are then what is returned by the Get and List + DBus commands. Similarly, cause Delete to delete all known parts of a + multipart message. + + While here, remove some extra whitespace in the SMS commands we send + to the modem. + + src/mm-generic-gsm.c | 470 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-sms-utils.c | 98 +++++++---- + 2 files changed, 512 insertions(+), 56 deletions(-) + +commit 889ae2fb4bae97b174fc0088b15427b1d035abc6 +Author: Dan Williams +Date: Thu Oct 27 16:38:11 2011 -0500 + + gsm: fix parsing of unsolicited CREG/CGREG response with RAC + + src/mm-modem-helpers.c | 48 + ++++++++++++++++++++++++++++++------------ + src/tests/test-modem-helpers.c | 11 +++++----- + 2 files changed, 40 insertions(+), 19 deletions(-) + +commit ccad4aaa9d151537d6fa421d17d676409a6f688b +Author: Dan Williams +Date: Thu Oct 27 15:13:30 2011 -0500 + + gsm: add regex for unsolicited CREG/CGREG response with RAC + + src/mm-modem-helpers.c | 11 +++++++++++ + src/tests/test-modem-helpers.c | 11 +++++++++++ + 2 files changed, 22 insertions(+) + +commit 58aa172b4e539605554dd300dca199b34fbf9186 +Author: Aleksander Morgado +Date: Mon Oct 24 21:31:37 2011 +0200 + + serial: use g_value_set_schar() and g_value_get_schar() when glib + >= 2.31 + + src/mm-serial-port.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 28f64090dfa15097587bbea69209df10b8ab8593 +Author: Aleksander Morgado +Date: Mon Oct 24 21:09:11 2011 +0200 + + core: don't include private headers from glib + + The "glib/gtypes.h" is now considered private, and only "glib.h" + should be + included directly. + + src/mm-at-serial-port.h | 1 - + src/mm-manager.h | 1 - + src/mm-modem-base.h | 1 - + src/mm-plugin-base.h | 1 - + src/mm-port.h | 1 - + src/mm-qcdm-serial-port.h | 1 - + src/mm-serial-port.h | 1 - + 7 files changed, 7 deletions(-) + +commit d40e0436234b625d3856841ba53f7b03aa59bd15 +Author: Dan Williams +Date: Tue Oct 18 13:13:21 2011 -0500 + + core: better handle NULL spew from serial ports during probing + + Observed on a generic ZTE device. + + src/mm-plugin-base.c | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 3bcbc7b644d51ef846d621e97674f903368f6a30 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:19 2011 +0200 + + api: Let MM_MODEM_MODE be a bitfield, and new PreferredMode property + + Supported and Allowed modes are modified to be bitmasks of + MM_MODEM_MODE values, + and preference of a specific mode is now given in the new + PreferredMode + property and as an extra argument to the SetAllowedModes() call. + + * Supported Modes: bitmask specifying which modes are supported by + the specific + hardware. For example, a modem may only support 1G/2G/3G connections + (not 4G). + + * Allowed Modes: bitmask specifying which modes, of the ones + Supported by the + modem, are allowed to use. For example, a modem may support 1G/2G/3G + connections + but only 1G and 2G connections are allowed by the user as 3G + involves more + expensive data rates. + + [Allowed] ⊆ [Supported] + + * Preferred Mode: specific mode which is preferred among the ones + defined in + the Allowed modes bitmask. For example, a modem may allow 1G/2G/3G + connections + but the user would like that if possible 2G be used, as 3G consumes + too much + battery. If 2G is not possible, 3G can be used. + + [Preferred] ∈ [Allowed] + + new/org.freedesktop.ModemManager1.Modem.xml | 56 + +++++++++++++++-------------- + 1 file changed, 29 insertions(+), 27 deletions(-) + +commit 0984dd9df886d3a5bf951d2bddfd1c7544352088 +Author: Aleksander Morgado +Date: Mon Oct 17 09:41:50 2011 +0200 + + build: ensure all needed files are included in dist + + Added all needed headers to libwmc_la_SOURCES, so that they get into + the dist + tarball. + + libwmc/src/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit 5f24703b126eabbc08b1f3fffc7831ff73455bd5 +Author: Aleksander Morgado +Date: Mon Oct 17 09:39:43 2011 +0200 + + build: mm-modem-gsm.h no longer exists + + src/Makefile.am | 1 - + 1 file changed, 1 deletion(-) + +commit fd9f2d2804a6ebffbc2365b56d34dcf18aaa9942 +Author: Aleksander Morgado +Date: Thu Oct 13 14:59:30 2011 +0200 + + serial: skip NUL bytes coming before real AT responses + + Some Cinterion modems send a NUL byte before the "CONNECTED" reply to + "ATD" + (only during the first ATD try anyway). + + This fix will ignore any NUL byte leading the real response. + + src/mm-serial-parsers.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 6e0e46e51e9b022577db6adeb986d3241da9bd4d +Author: Dan Williams +Date: Wed Oct 12 18:47:23 2011 -0500 + + huawei: Gobi devices should be driven by gobi not huawei (bgo #660998) + + plugins/mm-plugin-huawei.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit c61423f2cfb201a610a5708a7ea19175a2e20750 +Author: Dan Williams +Date: Tue Oct 4 11:16:00 2011 -0500 + + wmc: add initial command parsing and response handling + + libwmc/src/Makefile.am | 6 +- + libwmc/src/commands.c | 109 ++++++++++++++++ + libwmc/src/commands.h | 41 ++++++ + libwmc/src/errors.h | 6 +- + libwmc/src/protocol.h | 52 ++++++++ + libwmc/src/result-private.h | 38 ++++++ + libwmc/src/result.c | 298 + ++++++++++++++++++++++++++++++++++++++++++++ + libwmc/src/result.h | 42 +++++++ + 8 files changed, 590 insertions(+), 2 deletions(-) + +commit a7637ddf8786e54bd1bb7f667896abd168ceba08 +Author: Dan Williams +Date: Tue Oct 4 11:01:31 2011 -0500 + + qcdm: add more mode prefs + + It seems that various firmwares just pass values from eg AT^SYSCFG + straight through to the firmware so it's pretty easy to map them + to the actual response here. Note that the NV mode pref item uses + a different mapping than CM state info response. Yay. + + libqcdm/src/commands.h | 8 ++++++++ + libqcdm/src/nv-items.h | 2 ++ + 2 files changed, 10 insertions(+) + +commit a9f4ea9f812760dcc71a8381084c106e1f819787 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:18 2011 +0200 + + api: rename MM_MODEM_ALLOWED_MODE to MM_MODEM_MODE + + Makes more sense to have the enum named just as 'mode', as it applies + to both + Supported and Allowed. + + new/org.freedesktop.ModemManager1.Modem.xml | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 40406693b61cb0ca601815f1478c773d6bbe9233 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:17 2011 +0200 + + api: new SetAllowedBands() to be able to modify the allowed bands + in the modem + + Changing the allowed bands in a modem may fail, for example if trying + to set a + frequency band which is not in the bands mask reported as Supported + by the modem. + Therefore, we need an explicit SetAllowedBands() method with proper + error + reporting instead of making the property writable. + + new/org.freedesktop.ModemManager1.Modem.xml | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +commit b5393091de71b8a7fadd87f0762c4efebb6f5fd3 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:16 2011 +0200 + + api: new SetAllowedModes() to be able to modify the allowed mode in + the modem + + Changing the allowed mode of a modem may fail, for example if trying + to set a + mode which is not in the modes reported as Supported by the + modem. Therefore, we + need an explicit SetAllowedModes() method with proper error reporting + instead of + making the property writable. + + new/org.freedesktop.ModemManager1.Modem.xml | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +commit dbc64d83ba74990af73283a4650327b21c861d60 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:15 2011 +0200 + + api: let SignalQuality say if the given value was recently taken + + Modems which only expose a single port will not be able to update + the signal + quality value while in connected mode. The signal quality value + reported in this + case, while the modem is connected, will be the last signal quality + value read + before the connection. + + The additional boolean value proposed here in the SignalQuality + property will + just say if the given signal quality was recently taken (if TRUE) + or cached + some time ago (if FALSE). The time to assume the value was recently + taken or not + could depend on different things, for example: + + * If the modem always has an AT port, even if connected, we could + directly + query the current signal quality and report the value as being + fresh. + + * If the modem has a single port, we could report the value as not + being fresh + as soon as the modem gets in connected state. + + * For modems which report the signal quality updates in unsolicited + messages, + we could report the value as being fresh if the update was received + in the + last minute or so. + + new/org.freedesktop.ModemManager1.Modem.xml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit e9743f4b4992321c206bb33059c1f594142d3f92 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:14 2011 +0200 + + api: let the Modem expose a 'Sim' property to link to a specific + SIM object + + SIM objects will be listed as independent objects in the DBus API, + and the 'Sim' + property in a given modem object will specify which SIM object is + in use. + + new/org.freedesktop.ModemManager1.Modem.xml | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 588f9550ed1acd792ee09c2b43dbf13788ce7663 +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:13 2011 +0200 + + api: remove GetInfo() from the Modem API and use read-only properties + instead. + + New 'Manufacturer', 'Model' and 'Revision properties are added, + all being + read-only strings. + + new/org.freedesktop.ModemManager1.Modem.xml | 37 + ++++++++++++++--------------- + 1 file changed, 18 insertions(+), 19 deletions(-) + +commit 9d9a189026b060a7e2c2b838d759c23a782121df +Author: Aleksander Morgado +Date: Fri Sep 30 15:01:12 2011 +0200 + + api: include ScanDevices() and SetLogging() in the new manager API + + These methods were available in the old API, and are needed in the + new one. + + new/org.freedesktop.ModemManager1.xml | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 7a7014330cde29fedb64dff772f53e44c45516cd +Author: Dan Williams +Date: Fri Sep 30 14:38:11 2011 -0500 + + examples: add example of auto-enabling modems + + test/Makefile.am | 3 ++- + test/modem-autoenable.py | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 52 insertions(+), 1 deletion(-) + +commit 30a67862ecddf2ee9c29ea933d473567988b1769 +Author: Dan Williams +Date: Wed Sep 28 10:31:32 2011 -0500 + + zte: update port hints for Onda MSA110 and others + + plugins/77-mm-zte-port-types.rules | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit 368b80886912cf9f03ed535bba1c426466461195 +Author: Dan Williams +Date: Tue Sep 27 15:31:45 2011 -0500 + + libwmc: simpler logging and error handling + + libwmc/src/com.c | 15 ++++---- + libwmc/src/com.h | 12 +----- + libwmc/src/errors.c | 93 + ++++++++++----------------------------------- + libwmc/src/errors.h | 53 ++++++++++++-------------- + libwmc/tests/test-wmc-com.c | 17 +++------ + 5 files changed, 60 insertions(+), 130 deletions(-) + +commit 8710820156f51d1861b329e6fc12e706304ddda9 +Author: Nathan Williams +Date: Tue Sep 27 13:40:39 2011 -0500 + + core: ensure that GMatchInfo and GRegex objects are freed properly + + In particular, g_regex_match() and g_regex_match_full() allocate a + match_info structure on both success and failure, so calling + g_match_info_free() only in the success case is insufficient. + + BUG=None + TEST=Inspection + + Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8 + + plugins/mm-modem-anydata-cdma.c | 6 ++++++ + plugins/mm-modem-cinterion-gsm.c | 13 +++++++++---- + plugins/mm-modem-huawei-gsm.c | 4 ++-- + plugins/mm-modem-novatel-gsm.c | 3 +-- + plugins/mm-modem-samsung-gsm.c | 4 ++-- + plugins/mm-modem-sierra-gsm.c | 4 +++- + plugins/mm-modem-x22x-gsm.c | 3 +-- + plugins/mm-modem-zte.c | 6 +++--- + src/mm-generic-gsm.c | 33 ++++++++++++++++++--------------- + src/mm-modem-helpers.c | 15 ++++++--------- + src/mm-serial-parsers.c | 32 +++++++++++++------------------- + 11 files changed, 64 insertions(+), 59 deletions(-) + +commit 00670456ffb4b08af3620a95c73601bc15d84eb9 +Author: Nathan Williams +Date: Fri Sep 23 17:21:15 2011 -0400 + + sms: sanitize 8-bit data so that it is UTF8-clean + + When receiving a SMS message with raw 8-bit data, sanitize it by + replacing non-ASCII characters with \xNN escape sequences. This + prevents a problem further down the line where the body of the message + is passed into DBus as a string, and DBus requires strings to + be UTF-8. + + BUG=chrome-os-partner:5953 + TEST=Run network_ModemManagerSMS.py with the PDU from this bug. + + Change-Id: Ic33a365f9a065c49a325e047e4c3f5e81450fa1f + Reviewed-on: http://gerrit.chromium.org/gerrit/8232 + Reviewed-by: Eric Shienbrood + Tested-by: Nathan J. Williams + Commit-Ready: Nathan J. Williams + + src/mm-sms-utils.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +commit 18fc92ef7304d01c5ec11ced22ff82c4ab6dbbe1 +Author: Dan Williams +Date: Tue Sep 27 13:13:40 2011 -0500 + + libwmc: add more test code and start of com tests + + libwmc/src/Makefile.am | 23 ++--- + libwmc/src/com.c | 57 +++++++++++ + libwmc/src/com.h | 33 +++++++ + libwmc/src/errors.c | 109 ++++++++++++++++++++++ + libwmc/src/errors.h | 74 +++++++++++++++ + libwmc/src/utils.c | 14 ++- + libwmc/tests/Makefile.am | 2 + + libwmc/tests/test-wmc-com.c | 223 + ++++++++++++++++++++++++++++++++++++++++++++ + libwmc/tests/test-wmc-com.h | 27 ++++++ + libwmc/tests/test-wmc.c | 51 ++++++++++ + 10 files changed, 591 insertions(+), 22 deletions(-) + +commit 8250dee13177a164d61e31fe8d60900f9d5c6797 +Author: Dan Williams +Date: Mon Sep 19 13:42:00 2011 -0500 + + libwmc: add more tests including for UML290 quirks + + libwmc/src/utils.c | 20 ++++--- + libwmc/src/utils.h | 2 + + libwmc/tests/test-wmc-escaping.c | 41 +++++++++++++ + libwmc/tests/test-wmc-escaping.h | 2 + + libwmc/tests/test-wmc-utils.c | 120 + ++++++++++++++++++++++++++++++++++++++- + libwmc/tests/test-wmc-utils.h | 6 ++ + libwmc/tests/test-wmc.c | 4 ++ + 7 files changed, 186 insertions(+), 9 deletions(-) + +commit 46a5c77616a6fe22fa2a13a1f908b05a55e1ff31 +Author: Dan Williams +Date: Mon Sep 19 11:24:43 2011 -0500 + + libwmc: rename some test functions + + libwmc/tests/test-wmc-utils.c | 4 ++-- + libwmc/tests/test-wmc-utils.h | 4 ++-- + libwmc/tests/test-wmc.c | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit 3dd4cdaf2bb940988bf2f4e5147824dc4f1fb0b4 +Author: Dan Williams +Date: Sat Sep 17 13:27:54 2011 -0500 + + libwmc: beginning of bits for WMC-based devices like UML290 + + .gitignore | 1 + + Makefile.am | 2 +- + configure.ac | 3 + + libwmc/Makefile.am | 2 + + libwmc/src/Makefile.am | 28 +++ + libwmc/src/utils.c | 374 + +++++++++++++++++++++++++++++++++++++++ + libwmc/src/utils.h | 64 +++++++ + libwmc/tests/Makefile.am | 28 +++ + libwmc/tests/test-wmc-crc.c | 65 +++++++ + libwmc/tests/test-wmc-crc.h | 25 +++ + libwmc/tests/test-wmc-escaping.c | 124 +++++++++++++ + libwmc/tests/test-wmc-escaping.h | 26 +++ + libwmc/tests/test-wmc-utils.c | 107 +++++++++++ + libwmc/tests/test-wmc-utils.h | 28 +++ + libwmc/tests/test-wmc.c | 54 ++++++ + uml290.txt => libwmc/uml290.txt | 63 +++++-- + 16 files changed, 983 insertions(+), 11 deletions(-) + +commit 953701a6f8273b2f70f19466ed1ada48f7369715 +Author: Thomas Tuttle +Date: Thu Sep 1 18:53:25 2011 -0400 + + modem: add firmware interface + + introspection/all.xml | 2 + + ...org.freedesktop.ModemManager.Modem.Firmware.xml | 114 ++++++++ + ...rg.freedesktop.ModemManager1.Modem.Firmware.xml | 114 ++++++++ + policy/org.freedesktop.modem-manager.policy.in | 9 + + src/Makefile.am | 9 +- + src/mm-auth-provider.h | 1 + + src/mm-modem-firmware.c | 316 + +++++++++++++++++++++ + src/mm-modem-firmware.h | 72 +++++ + 8 files changed, 635 insertions(+), 2 deletions(-) + +commit 4c514bfd6d096b649c5ae2132a914044ef0f45cb +Author: Aleksander Morgado +Date: Tue Aug 30 11:53:05 2011 +0200 + + gsm/cdma: unsigned integers can't be < 0, so remove unnecessary + conditions + + It fixes compilation with the llvm/clang compiler as well. + + src/mm-generic-cdma.c | 2 +- + src/mm-generic-gsm.c | 6 ++---- + 2 files changed, 3 insertions(+), 5 deletions(-) + +commit 2a9a6ad79b4bfe5d83e938c929c229a930c513a8 +Author: Aleksander Morgado +Date: Sat Aug 20 17:22:28 2011 +0200 + + nokia: use E1 E0 when initializing the modem + + Passing E1 and E0 afterwards seems to properly disable the echo in + Nokia modems + (N900 and C7 at least) + + plugins/mm-modem-nokia.c | 9 +++++++++ + plugins/mm-plugin-nokia.c | 22 ++++++++++++++++++++++ + 2 files changed, 31 insertions(+) + +commit 7348b4c0c872a09103d32fe44cb4c2a086eaa66b +Author: Torgny Johansson +Date: Wed Aug 24 10:07:26 2011 +0200 + + mbm: add more Ericsson and Dell vid/pids + + Add the vid/pid for Ericsson H5321gw/w, F5321gw/w, C5621gw/w, C3304w + and Dell DW5560. + + plugins/77-mm-ericsson-mbm.rules | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +commit 7605ffec59290f8b675ed19eaca967457e0ef2ba +Author: Eric Shienbrood +Date: Sun Aug 21 09:04:08 2011 -0500 + + gsm: pass GSM registration errors up to caller + + Register was appearing to succeed even when it failed. + + src/mm-generic-gsm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit acc0928315f166708405f6c671a6fd58170a2c3c +Author: Nathan J. Williams +Date: Sun Aug 21 08:59:11 2011 -0500 + + sms: check for the correct return value from sscanf() in + sms_get_done() + + Remove an unused variable so it's more obvious what the correct + value is. + Fixes live (vs. list) SMS reception on ToT. + + BUG=none + TEST=Send SMS to device, see that it shows up in Chrome. + + Change-Id: I9c76fb15ef229fe83672e2eee8ae37d7e6ab7b9e + Reviewed-on: http://gerrit.chromium.org/gerrit/3216 + Reviewed-by: Nathan J. Williams + Tested-by: Nathan J. Williams + + src/mm-generic-gsm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 531fa05192d038d86207268d34d9837e7c0fbbcf +Author: Aleksander Morgado +Date: Sat Aug 20 00:06:14 2011 +0200 + + api: remove unneeded code from header generator + + header-generator.xsl | 17 ----------------- + 1 file changed, 17 deletions(-) + +commit ea238513263a2f514b65ba7f6f632e12a5663150 +Author: Aleksander Morgado +Date: Tue Aug 16 12:51:26 2011 +0200 + + api: use common ModemManager.h for API, core and plugins + + plugins/Makefile.am | 83 +++++++++++++++++++++++++++----------- + plugins/mm-modem-icera.h | 2 +- + src/Makefile.am | 4 +- + src/mm-generic-gsm.c | 13 +++--- + src/mm-generic-gsm.h | 2 +- + src/mm-modem-base.c | 12 +++--- + src/mm-modem-cdma.h | 10 +---- + src/mm-modem-gsm-card.c | 3 +- + src/mm-modem-gsm-network.c | 14 +++---- + src/mm-modem-gsm-network.h | 15 ++----- + src/mm-modem-gsm.h | 99 + ---------------------------------------------- + src/mm-modem-helpers.h | 3 +- + src/mm-modem-location.h | 9 ----- + src/mm-modem.c | 2 +- + src/mm-modem.h | 33 +--------------- + src/tests/Makefile.am | 23 +++++++---- + 16 files changed, 113 insertions(+), 214 deletions(-) + +commit c4a82913495fbaadc54088ed441d6348665e2dc6 +Author: Aleksander Morgado +Date: Wed Aug 17 15:58:24 2011 +0200 + + build: ensure common header is built first + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dee5b0ae05be9d4332bca20390a573367d79022 +Author: Aleksander Morgado +Date: Wed Aug 17 15:56:18 2011 +0200 + + api: rename common header to ModemManager.h + + Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e48648e40671325fd24398d224f1fa798989f5fc +Author: Aleksander Morgado +Date: Wed Aug 17 13:19:54 2011 +0200 + + api: generate enums instead of defines in common header + + header-generator.xsl | 150 + +++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 104 insertions(+), 46 deletions(-) + +commit 15f77d131a763fc6044ca1fa1e6adb8e93b36d31 +Author: Aleksander Morgado +Date: Wed Aug 17 11:15:20 2011 +0200 + + api: add license and header include guards + + header-generator.xsl | 31 +++++++++++++++++++++++++++---- + introspection/all.xml | 2 +- + 2 files changed, 28 insertions(+), 5 deletions(-) + +commit 6eb32c72dac22edf2d0e1841f9a040cab3cebb4a +Author: Aleksander Morgado +Date: Wed Aug 17 16:18:27 2011 +0200 + + introspection: renamed MM_MODEM_STATE_CHANGED_REASON to + MM_MODEM_STATE_REASON + + introspection/org.freedesktop.ModemManager.Modem.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 36dabababd32f84a454f678047b9e3808d71146c +Author: Aleksander Morgado +Date: Wed Aug 17 16:14:07 2011 +0200 + + introspection: rename changed reason UNKNOWN to NONE + + introspection/org.freedesktop.ModemManager.Modem.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 914ad628ab34eb62bcc66f80fd9230d451e71648 +Author: Aleksander Morgado +Date: Wed Aug 17 16:13:39 2011 +0200 + + introspection: define MM_MODEM_TYPE_UNKNOWN + + introspection/org.freedesktop.ModemManager.Modem.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 7e246f6018ffee5889f2a42638f28c460f18787e +Author: Aleksander Morgado +Date: Wed Aug 17 16:13:04 2011 +0200 + + introspection: use state type in StateChanged signal definition + + introspection/org.freedesktop.ModemManager.Modem.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 713c07290f5bad6ea60200dad1504baf43a91f0d +Author: Aleksander Morgado +Date: Mon Aug 15 16:08:57 2011 +0200 + + introspection: define type MM_MODEM_STATE + + .../org.freedesktop.ModemManager.Modem.xml | 60 + ++++++++++++++++++++-- + 1 file changed, 55 insertions(+), 5 deletions(-) + +commit 8799f4da1fdf0f0cad36dc6de68e3c35cc8177ae +Author: Dan Williams +Date: Sun Aug 14 16:02:41 2011 -0500 + + core: when probing mark ports as AT capable too + + On a ZTE MF626, sometimes the aux port will respond only with + "ERROR" to probing commands (while the SIM is starting up) and + previously we'd lose the port because we were only looking for + valid probe responses. But if the port returns ERROR or CME ERROR + etc we know it's an AT port and that we can use it once we've + gotten the type response (CDMA or GSM) from the main port. + + plugins/mm-plugin-zte.c | 2 ++ + src/mm-plugin-base.c | 24 ++++++++++++++++-------- + src/mm-plugin-base.h | 1 + + 3 files changed, 19 insertions(+), 8 deletions(-) + +commit 8ea17921e736d56f7d758f2f885326ea49e495d7 +Author: Dan Williams +Date: Sun Aug 14 15:37:38 2011 -0500 + + gsm: check both CS and PS registration state during poll + + When connecting, and the modem isn't yet registered or denied, poll + both CS and PS registration state instead of just CS state, because + we're really more interested in PS state anyway. If at least one + of the CS and PS state checks is successful then proceed with the + connection. + + src/mm-generic-gsm.c | 141 + +++++++++++++++++++++++++++++++-------------------- + 1 file changed, 87 insertions(+), 54 deletions(-) + +commit f683391169cf7f143df380779bf69d6b9b3947b8 +Author: Dan Williams +Date: Tue Aug 9 12:00:51 2011 +0200 + + test: allow modem numbers in addition to object paths + + If the command-line arg doesn't look like an object path, + treat it as the modem # and make the object path. + + test/disable.py | 5 ++++- + test/enable.py | 5 ++++- + test/info.py | 6 ++++-- + test/location.py | 5 ++++- + test/scan.py | 5 ++++- + test/send-pin.py | 6 +++++- + test/ussd.py | 6 +++++- + 7 files changed, 30 insertions(+), 8 deletions(-) + +commit 33a97cdb139059a8f4e2a1fefe9f2c237171caf1 +Author: Dan Williams +Date: Tue Aug 2 17:26:55 2011 -0500 + + core: log when serial port unexpectedly hangs up + + src/mm-serial-port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit da57b9a0eb72a685e6aacdb67c6780fddada4884 +Author: Dan Williams +Date: Tue Aug 2 16:58:26 2011 -0500 + + sierra: fix possible double-free + + Need to reset password to NULL after freeing it. + + plugins/mm-modem-sierra-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb2d14ab4a72d437d7fceb1bdddd1417be17c5c8 +Author: Dan Williams +Date: Tue Aug 2 16:54:47 2011 -0500 + + core: fix possible double-free + + If there was data waiting, the task freed it, but then the port + got closed, and the data callback might have freed the data again. + + src/mm-plugin-base.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 804cd7f07710362a6454fbf2cee689492b3060d4 +Author: Dan Williams +Date: Tue Aug 2 12:43:26 2011 -0500 + + gsm: work around Motorola Android phone modem bugs (bgo #637327) + + It seems the Motorola Flipout with Android 2.1 doesn't like to return + configured PDP contexts via AT+CGDCONT?; it returns an error. It + seems to accept the rest of the dial sequence though, so just ignore + the error when reading existing PDP contexts. + + src/mm-generic-gsm.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 7985a27321274e4087023e383276d3cbf73359bc +Author: Dan Williams +Date: Tue Aug 2 12:26:05 2011 -0500 + + doc: update README (bgo #652910) + + README | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b9c2180886dc759403c837564cf39a4d030fea52 +Author: Dan Williams +Date: Tue Aug 2 11:05:55 2011 -0500 + + core: fix serial port flashing after + d3c2228f7b55465f4433bedb36d47744b8d791f1 (bgo #650740) + + Fix one more possible memory leak (left un-fixed by d3c2228 but not + caused by it) and ensure that modems that do want flashing get it + by default by adding the missing G_PARAM_CONSTRUCT so FLASH_OK + defaults to TRUE. + + src/mm-serial-port.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 26debc1a9745ebc54d35569ba416a368f084a3f4 +Author: Dan Williams +Date: Tue Aug 2 10:47:25 2011 -0500 + + mbm: don't flash serial ports on disconnect (bgo #650740) + + The F5521gw resets various port properties like echo when the port + is flashed, which was happening on disconnect. Since MM had already + turned of echo with ATE0, and the AT parser in-use expected no + echo, this confused MM when the port magically started echoing + commands + back. We don't need flashing on the Ericsson devices because there + will always be a free AT port even if PPP is used for a secondary + PDP context, so we can just skip flashing entirely for these + devices. + + plugins/mm-modem-mbm.c | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +commit d3c2228f7b55465f4433bedb36d47744b8d791f1 +Author: Dan Williams +Date: Tue Aug 2 10:43:54 2011 -0500 + + core: allow ports to skip flash behavior (bgo #650740) + + Flashing is a technique to break out of the data/PPP stream and + re-enter command stream (like +++) and MM uses it in the generic + paths in various cases. But devices that don't need it (ie, ones + with at least one AT capable port that won't be used for data) + now sometimes appear to have side-effects. + + The Ericsson F5521gw firmware R2A07 resets port attributes like + echo and &C and such when the port is flashed, leading to + confusion on the part of MM. Since the Ericsson devices will + always have at least one free AT port they don't need flashing + anyway. + + src/mm-serial-port.c | 102 + ++++++++++++++++++++++++++++++++------------------- + src/mm-serial-port.h | 4 ++ + 2 files changed, 68 insertions(+), 38 deletions(-) + +commit 18231c9f8df809aacd4534d0a081125e8d6569df +Author: Dan Williams +Date: Mon Aug 1 17:47:38 2011 -0500 + + api: refine new API based on suggestions from Eric Shienbrood + + new/org.freedesktop.ModemManager1.Modem.Bearer.xml | 6 ++- + ...rg.freedesktop.ModemManager1.Modem.Contacts.xml | 45 + ++++++++++++++++++++-- + new/org.freedesktop.ModemManager1.Modem.xml | 26 +++++++++---- + new/org.freedesktop.ModemManager1.Sim.xml | 15 +++++++- + 4 files changed, 80 insertions(+), 12 deletions(-) + +commit e0eb7038af03e3891ec06d58f9b9690765d2a706 +Author: Dan Williams +Date: Mon Aug 1 17:18:08 2011 -0500 + + gsm: allow SIM operations while connected + + No point in requiring these to be done from the primary port. + + src/mm-generic-gsm.c | 54 + +++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 41 insertions(+), 13 deletions(-) + +commit 2db79a8b54c3b687ba709e70ab00c81f4cfbe55c +Author: Andrew Bird +Date: Thu Jul 28 17:44:12 2011 +0100 + + api: add new LTE constant to the MM_ACCESS_TECHs + + The 10.4 version of TS27.007 extends the range of values possible + from AT+COPS? + The range of values are as follows: + 3GPP TS 27.007 V10.4.0, +COPS + : integer type; access technology selected + 0 GSM + 1 GSM Compact + 2 UTRAN + 3 GSM w/EGPRS + 4 UTRAN w/HSDPA + 5 UTRAN w/HSUPA + 6 UTRAN w/HSDPA and HSUPA + 7 E-UTRAN + + All but the LTE (E-UTRAN) value can be represented in MM 0.5, this + patch adds a + new constant to correct that, until the MM API is redesigned later + for 0.6. + + Signed-off-by: Andrew Bird + + introspection/org.freedesktop.ModemManager.Modem.Gsm.xml | 3 +++ + 1 file changed, 3 insertions(+) + +commit b0a2c769079d4c28e55ec8fbc72244e386f2c6ac +Author: Dan Williams +Date: Wed Jul 27 21:37:35 2011 -0500 + + api: update proposed new SMS API + + Finish most of the stuff here. + + new/org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 120 + ------------------- + ...g.freedesktop.ModemManager1.Modem.Messaging.xml | 133 + +++++++++++++++++++++ + new/org.freedesktop.ModemManager1.Modem.SMS.xml | 110 + +++++++++++++++++ + 3 files changed, 243 insertions(+), 120 deletions(-) + +commit 30f848e7007154a33984cf843831955dfbcb25e5 +Author: Dan Williams +Date: Mon Jul 25 13:40:24 2011 -0500 + + cdma: don't blow away generic EVDO reg state if no specific state + is available + + Generic code (like the QCDM CM/HDR checks) would determine the EVDO + registration state, which would then get blown away by the + device-specific + registration state query method. Modems that have a more specific + check + were fine, but generic devices that don't have more specific reg + state checks can simply rely on the generic checks done earlier and + don't need to update the EVDO state from + real_query_registration_state(). + + src/mm-generic-cdma.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit f8934c21ceabef58d096ded41f1b3f3ea7de1800 +Author: Dan Williams +Date: Mon Jul 25 12:52:03 2011 -0500 + + option/hso: check generic access tech first, then specific tech + + During the explicit access technology check, the plugin would request + specific 2G (OCTI) and 3G (OWCTI) technologies explicitly. + Some devices + (like Nozomi) don't support the AT_OWCTI command, which leaves us with + only AT_OSSYS for determining whether the device is registered with + the 3G network or the 2G network. So like the unsolicited mode change + handling code, when requesting access technology explicitly, ask for + generic 2G/3G tech first, and then get the specific tech. If the + device doesn't support explicit 3G tech then at least we have the + generic 3G tech from OSSYS to use. + + plugins/mm-modem-option-utils.c | 130 + +++++++++++++++++++++++++++++++++------- + 1 file changed, 107 insertions(+), 23 deletions(-) + +commit 1df8dd7361d4afbaf3e0fa46529cdd2460fa503d +Author: Dan Williams +Date: Mon Jul 25 12:50:22 2011 -0500 + + option: plugin is supposed to support Nozomi devices too + + The Nozomi cards were early CardBus devices that used a direct PCI + interface (instead of the more usual PCI<->USB controller) and the + 'nozomi' kernel driver. They use the same command set as most other + early Option NV modems. Nozomi was always supposed to be driven + by the option plugin, but apparently that got broken when adding + some of the driver/vendor checks. + + plugins/mm-plugin-option.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit b02dc7f50fd918075c43d93d91f4bc3879b91b4c +Author: Dan Williams +Date: Mon Jul 25 12:49:54 2011 -0500 + + core: allow getting the result from the MMCallbackInfo + + src/mm-callback-info.c | 8 ++++++++ + src/mm-callback-info.h | 1 + + 2 files changed, 9 insertions(+) + +commit 061d4108886d2bdd4f5420515d1006b986fdfe95 +Author: Nathan Williams +Date: Mon Jul 25 00:48:14 2011 -0500 + + sms: calculate user-data bit padding correctly + + Fourth and final in a series. + + This fixes an off-by-one (septet) error in the calculation of the + amount of data to skip in the presence of a user data header, and adds + the test case from the wild that triggered it. + + src/mm-sms-utils.c | 6 +++++- + src/tests/test-sms.c | 29 +++++++++++++++++++++++++++++ + 2 files changed, 34 insertions(+), 1 deletion(-) + +commit e20173dc47beed79367ac904e25e7c12d67fce33 +Author: Nathan Williams +Date: Mon Jul 25 00:46:51 2011 -0500 + + sms: recognize more text encodings from GSM 03.38 + + Third in a series. This fixes the bug detected by the dcsf1 test in + the just-added unit tests, by more thoroughly parsing the TP-DCS + field. + + src/mm-sms-utils.c | 89 + ++++++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 77 insertions(+), 12 deletions(-) + +commit c717dbd9284f9b1baebd90864befa755dc95ef39 +Author: Nathan Williams +Date: Mon Jul 25 00:44:49 2011 -0500 + + sms: add unit tests + + Second in a series. Builds on the previous by actually unit-testing + the sms_parse_pdu() function. Note that the dcf1 test does not pass + as the code is currently written. + + .gitignore | 1 + + src/tests/Makefile.am | 14 +- + src/tests/test-sms.c | 400 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 414 insertions(+), 1 deletion(-) + +commit e5faa242e9c6ddcd5bcb976420483ead59f81239 +Author: Nathan Williams +Date: Mon Jul 25 00:42:08 2011 -0500 + + sms: split SMS parsing out into a separate file + + In preparation for adding tests. + + Change-Id: If1ebd0fdd6e7470c21538042ab1735357649155c + + src/Makefile.am | 4 +- + src/mm-generic-gsm.c | 266 ++---------------------------------------- + src/mm-sms-utils.c | 320 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-sms-utils.h | 25 ++++ + 4 files changed, 355 insertions(+), 260 deletions(-) + +commit 0cc813312f9bf446614d6aed6a85b1ee0b006451 +Author: Dan Williams +Date: Mon Jul 25 00:05:06 2011 -0500 + + gsm: don't clear operator name or number when at least one of PS or + CS is registered + + The operator name/number isn't really tied to CS or PS registration, + since + we retrieve it using AT+COPS. But when one of CS or PS became + unregistered + the operator name and number would get cleared out. We only want + to clear + it out when *both* CS and PS are unregistered. Fixes an issue + with the + location API where location would not be reported when one of CS or PS + became unregistered, because the location bits want an operator name + before they return the location. + + src/mm-generic-gsm.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 4267a15b4b318644531489fab91534acf7954d13 +Author: Dan Williams +Date: Sun Jul 24 23:15:05 2011 -0500 + + tests: fix access tech reporting in scan.py + + test/scan.py | 33 +++++++++------------------------ + 1 file changed, 9 insertions(+), 24 deletions(-) + +commit a57618b091faec24d22bfce5f384248c52cd2511 +Author: Guido Günther +Date: Thu Jul 21 15:15:44 2011 -0500 + + zte: skip hex encoding (bgo #652682) + + plugins/mm-modem-zte.c | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +commit 70715c1c124b3220969a432be5ad2ad6f44913fe +Author: Guido Günther +Date: Thu Jul 21 15:15:09 2011 -0500 + + huawei: implement ussd encoding/decoding + + Huawei wants the USSD as packed GSM. + + plugins/mm-modem-huawei-gsm.c | 51 + +++++++++++++++++++++++++++++++++++++++++-- + src/mm-generic-gsm.c | 2 +- + src/mm-modem-gsm-ussd.h | 4 ++++ + 3 files changed, 54 insertions(+), 3 deletions(-) + +commit b82cec8c7e0aaab04a855d64ac46b6244b6cd98c +Author: Guido Günther +Date: Thu Jul 21 15:14:23 2011 -0500 + + ussd: Add mm_modem_gsm_ussd_{de,en}code to the MMModemGsmUssd + interface + + since some some modems need different quirks to encode/decode USSD + messages. + + src/mm-generic-gsm.c | 69 + ++++++++++++++++++++++++++++++++++++++----------- + src/mm-modem-gsm-ussd.c | 26 +++++++++++++++++++ + src/mm-modem-gsm-ussd.h | 16 ++++++++++++ + 3 files changed, 96 insertions(+), 15 deletions(-) + +commit 94e717b85474881435f4f6a2f503ad23ab148d22 +Author: Guido Günther +Date: Thu Jul 21 15:09:15 2011 -0500 + + test: improve ussd.py help message + + test/ussd.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 26e7b3f8ce949ff3d8ba15626f8b59d92f13ff94 +Author: Guido Günther +Date: Thu Jul 21 15:08:22 2011 -0500 + + trivial: update .gitignore + + .gitignore | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit ec76518ea3a4fe1f32de4e11c6d3adf3021001e6 +Author: Dan Williams +Date: Thu Jul 21 15:06:36 2011 -0500 + + api: add missing in-progress proposed SMS API + + new/org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 120 + +++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +commit 3e2b6fb24c6f32f6b5898f4c703eed4fc609561d +Author: Dan Williams +Date: Tue Jul 19 15:29:44 2011 -0500 + + cdma: set Rm interface protocol if required (bgo #641661) + + Some providers (CDMA Ukraine) apparently require a specific Rm + interface + protocol, so add some Simple Connect dict settings for that and + use them + when dialing. Obviously requires the connection manager to also have + support for sending the right bits down to MM. + + .../org.freedesktop.ModemManager.Modem.Simple.xml | 5 +- + src/mm-generic-cdma.c | 153 + ++++++++++++++++++++- + 2 files changed, 153 insertions(+), 5 deletions(-) + +commit 85000adfe95f948773d4313e3207a1781dc87225 +Author: Dan Williams +Date: Mon Jul 18 18:27:18 2011 -0500 + + core: add another CnS string to the immediate ignore list + + Newer Sierra devices have this (ie 306); it's the CnS port so ignore + it immediately. + + src/mm-plugin-base.c | 1 + + 1 file changed, 1 insertion(+) + +commit c70d6d565d51a0b76e3e79f176176b146806265e +Author: Dan Williams +Date: Thu Jul 7 10:28:41 2011 -0500 + + Revert "cinterion: bail earlier if the plugin doesn't support + the port" + + This reverts commit 1e1bfbf1d808e557441afdae44447af457dae7ff. + + Aleksander says this might break RS232<->USB converter connected + Cinterion modems, so we'll need to handle this issue another way. + + plugins/mm-plugin-cinterion.c | 17 ----------------- + 1 file changed, 17 deletions(-) + +commit 1e1bfbf1d808e557441afdae44447af457dae7ff +Author: Dan Williams +Date: Wed Jul 6 15:36:18 2011 -0500 + + cinterion: bail earlier if the plugin doesn't support the port + + Caused a crash with the Sierra plugin due to an assertion failure; + the Cinterion plugin shouldn't claim to possibly support ports + it knows it won't support. In this case, it claimed to support + Sierra modems, so it would try to run probing after Sierra had + done so. Ideally this should work, but for now just make sure + the Cinterion plugin doesn't claim to support these ports when + it knows it doesn't. + + plugins/mm-plugin-cinterion.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 0f6d1b2b42afe48583c9c3e7c159be4353462d86 +Author: Dan Williams +Date: Wed Jul 6 13:15:42 2011 -0500 + + nokia: N900 doesn't really need additional inter-character time + + See 46d757faa768db7d7bb23d51cc2af3196f7a7e30: + + gsm: send init command twice to make the N900 happy (rh #583691) + (lp:765516) + + for what I think is the real workaround for this bug. + + plugins/mm-modem-nokia.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit 46d757faa768db7d7bb23d51cc2af3196f7a7e30 +Author: Dan Williams +Date: Wed Jul 6 13:13:41 2011 -0500 + + gsm: send init command twice to make the N900 happy (rh #583691) + (lp:765516) + + The N900 has some odd serial characteristics in that it appears to + send pieces of the commands back for whatever reason, until you've + sent + a few commands down to it. Almost like it's training on whatever + you send and needs a bit of input to figure out the characteristics. + Whatever. Just send the init command twice instead of failing when + the N900 barfs the first time. + + src/mm-generic-gsm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 2ca045f1781095ed652bc01d0f47cdbe6b0b9775 +Author: Dan Williams +Date: Wed Jul 6 13:08:18 2011 -0500 + + core: update some serial port settings + + 1) use cfsetispeed/cfsetospeed like the TTY manpage suggests + 2) ignore parity/framing errors since we're not using parity anyway + 3) double-check that all our TTY settings were successfully set + + src/mm-serial-port.c | 46 +++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 5 deletions(-) + +commit 50e9d6fc54da6900796cc6af957465120dc530d7 +Author: Aleksander Morgado +Date: Wed Jul 6 09:37:47 2011 +0200 + + cinterion, wavecom: update copyright info + + plugins/mm-modem-cinterion-gsm.c | 3 ++- + plugins/mm-modem-cinterion-gsm.h | 3 ++- + plugins/mm-modem-wavecom-gsm.c | 3 ++- + plugins/mm-modem-wavecom-gsm.h | 3 ++- + plugins/mm-plugin-cinterion.c | 3 ++- + plugins/mm-plugin-cinterion.h | 3 ++- + plugins/mm-plugin-wavecom.c | 3 ++- + plugins/mm-plugin-wavecom.h | 3 ++- + 8 files changed, 16 insertions(+), 8 deletions(-) + +commit 077a4004fd2c7b4005962d8e0aa7eac8b7edd0a9 +Author: Dan Williams +Date: Tue Jul 5 12:27:47 2011 -0500 + + gobi: support access technology reporting + + Obviously only works while disconnected since the Gobi devices only + provide one AT-compatible tty. + + plugins/mm-modem-gobi-gsm.c | 53 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +commit 3eaf753c7f5c21b8a6ef589b03d6181318b2b8eb +Author: Thomas Grenman +Date: Thu Jun 30 15:51:53 2011 -0500 + + gsm: set SMS storage location before enabling notifications + + Fixes a firmware hang on Option GlobeTrotter Express (GE0201 with + firmware 1.12.1Hd (Date: Feb 22 2007, Time: 09:20:28)) and makes + sense in general too. + + src/mm-generic-gsm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 7762d401e8201efc05d643b9da32f3e60a42c470 +Merge: 881f928c 7e69d2cf +Author: Aleksander Morgado +Date: Thu Jun 30 19:48:23 2011 +0200 + + Merge remote-tracking branch 'lanedo/power-up-check-needed' + +commit 881f928c40f1460bcb03fae3eaf96b23f40fca3f +Author: Eric Shienbrood +Date: Tue Jun 28 10:46:56 2011 -0400 + + samsung: add product ID for the Y3400 module. + + The Y3400 is functionally nearly identical to the Y3300. + + plugins/mm-plugin-samsung.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1b73fa154160a51634633a4bfd886aa1d27e72b3 +Author: Nathan Williams +Date: Thu Jun 23 17:33:30 2011 -0400 + + Add a DBus interface for setting the log level. + + Lifted almost entirely from similar code in NetworkManager. + + BUG=chromium-os:15197 + TEST='dbus-send --print-reply --system + --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager + org.freedesktop.ModemManager.SetLogging string:DEBUG' + Also try valid log levels 'ERR', 'WARN', 'INFO', and an invalid log + level, such as 'ABCDE'. + + Change-Id: I2bddcd0319f4966dd293b119f68e7cc1697949b7 + Reviewed-on: http://gerrit.chromium.org/gerrit/3134 + Tested-by: Nathan J. Williams + Reviewed-by: Eric Shienbrood + + introspection/org.freedesktop.ModemManager.xml | 12 +++++++++ + src/mm-log.c | 37 + ++++++++++++++------------ + src/mm-log.h | 2 ++ + src/mm-manager.c | 17 ++++++++++++ + 4 files changed, 51 insertions(+), 17 deletions(-) + +commit b7820cf6e15eb245d4726f8cfbe20ce24466188b +Author: Nathan Williams +Date: Thu Jun 23 18:01:46 2011 -0400 + + gsm: handle case of entirely empty SPN correctly + + BUG=none + TEST=Insert a SIM with a present but empty (all 0xFF) SPN and check + the system log for a (lack of) assertion errors from + mm_charset_gsm_unpacked_to_utf8(). + + Change-Id: I1250494b9757c9bfdce56402a4471c598f41223f + Reviewed-on: http://gerrit.chromium.org/gerrit/3139 + Reviewed-by: Eric Shienbrood + Tested-by: Nathan J. Williams + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7e69d2cf307efdb4ddec5ef0eef9f6141bf8fa65 +Author: Aleksander Morgado +Date: Wed Jun 22 16:00:58 2011 +0200 + + cinterion: always try to use RTS/CTS flow control + + Otherwise, power-up after going to standby will not work properly + + plugins/mm-modem-cinterion-gsm.c | 39 + +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 39abb023ed180d03ea8324285116e228b46cd411 +Author: Aleksander Morgado +Date: Wed Jun 22 15:53:37 2011 +0200 + + serial: new property to enable RTS/CTS flow control + + src/mm-serial-port.c | 21 +++++++++++++++++++++ + src/mm-serial-port.h | 1 + + 2 files changed, 22 insertions(+) + +commit eae5d6c41be6652bac384340c47d274164007ebb +Author: Aleksander Morgado +Date: Wed Jun 22 13:01:17 2011 +0200 + + cinterion: enable power-off command to go to sleep/standby mode + + AT+CFUN=4 will be used when available to go to standby mode. If + not supported, + (as in EGS5) AT+CFUN=7 will be used instead, which enables a CYCLIC + SLEEP mode. + + Flow control setup was updated to RCS/CTS so that waking up from + sleep mode + works properly. + + plugins/mm-modem-cinterion-gsm.c | 97 + +++++++++++++++++++++++++++++++++++++--- + 1 file changed, 92 insertions(+), 5 deletions(-) + +commit 56db81890120e63f251b899b0eac66dc8941d411 +Author: Aleksander Morgado +Date: Tue Jun 21 15:07:16 2011 +0200 + + sierra: do not send power-up command if not needed + + plugins/mm-modem-sierra-gsm.c | 60 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 60 insertions(+) + +commit 34b5635f84798005e93a4be4c84ebd5dbe9f5212 +Author: Aleksander Morgado +Date: Tue Jun 21 14:49:38 2011 +0200 + + wavecom: enable power-off command to go to sleep/standby mode + + AT+CFUN=4 will be used to go to standby mode. + + plugins/mm-modem-wavecom-gsm.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit ab485bd66a3dfe4fdafe6425f48417997784be21 +Author: Aleksander Morgado +Date: Tue Jun 21 14:41:56 2011 +0200 + + wavecom: try to power-up without rebooting + + Using AT+CFUN=1,0 so that we request to avoid resetting + (=0). Works + properly when powering up after having put the modem in standby + mode with + AT+CFUN=4. + + Note that the power-up command will only be sent if the check to + see if power-up + is needed requests it. + + plugins/mm-modem-wavecom-gsm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 255525a5a2d499ef7b4d01cea660502bd1dff6a5 +Author: Aleksander Morgado +Date: Tue Jun 21 14:39:23 2011 +0200 + + wavecom: do not send power-up command if not needed + + plugins/mm-modem-wavecom-gsm.c | 104 + +++++++++++++++++++++++++---------------- + 1 file changed, 63 insertions(+), 41 deletions(-) + +commit 6e9d980e8c29974f9b641a1f6bc3be5212500901 +Author: Aleksander Morgado +Date: Tue Jun 21 12:54:09 2011 +0200 + + gsm: allow plugins to check if they need to issue the power-up command + + Some modems only like the power-up command if not already in full + functionality + mode. If the power-up is sent while already in full functionality + mode, they get + rebooted and reseted. + + With this changes, plugins can check whether they need the power-up + and ask + the generic gsm code base to skip the command or not. + + By default, power-up command (if any given) is never skipped. + + src/mm-generic-gsm.c | 34 ++++++++++++++++++++++++++++------ + src/mm-generic-gsm.h | 11 ++++++++++- + 2 files changed, 38 insertions(+), 7 deletions(-) + +commit 895f0f2ea3868091baefa897d88a6fbc3a0ca897 +Author: Dan Williams +Date: Fri Jun 17 16:25:45 2011 -0500 + + doc: add notes about Pantech UML290 and the WMC protocol + + WMC is a proprietary protocol observed on various Verizon devices + and implemented by the UML290. + + uml290.txt | 163 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 163 insertions(+) + +commit 51c409d1eba77804d9e1709808c2eb5e5eb064e0 +Author: Dan Williams +Date: Thu Jun 9 16:33:43 2011 -0500 + + ussd: fix reception, network notifications, and network requests + + Because the code was sending the USSD request with a "notify me via + unsolicited result code" tag, the response could come from any port, + and in was coming from other ports on various devices. But the code + expected the response on the main port, thus it got lost. + + So turn the USSD response processing into an unsolicited command + handler + instead, which allows us to process the response no matter where it + comes from. This patch also enables network-initiated USSD + notifications and requests since that's easy to add once the first + thing + here is done. + + src/mm-generic-gsm.c | 243 + ++++++++++++++++++++++++++++++++++++++------------- + src/mm-generic-gsm.h | 2 + + 2 files changed, 184 insertions(+), 61 deletions(-) + +commit 77fa848820cabf8cbaf6ed0e986771f4907c4c36 +Author: Dan Williams +Date: Wed Jun 15 12:50:35 2011 -0500 + + serial: warn when open/close take longer than 7 seconds + + Due to kernel bugs and such. + + src/mm-serial-port.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 884ba2bb09e877d54847327cc4d511fa68e97c53 +Author: Aleksander Morgado +Date: Tue Jun 14 12:58:36 2011 +0200 + + build: place together samsung plugin compilation options + + plugins/Makefile.am | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit abcffd17538b9417ddc99fa5ae46de10378ad2db +Author: Aleksander Morgado +Date: Tue Jun 14 12:38:33 2011 +0200 + + cinterion: check probed caps from supports task + + plugins/mm-plugin-cinterion.c | 1 + + 1 file changed, 1 insertion(+) + +commit a35fc3a583e507d3c59e0d53a3f71aa8a6e59bb9 +Author: Eric Shienbrood +Date: Mon Jun 13 10:30:11 2011 -0500 + + icera: report connected access technology when connected + + The NWSTATE field reports both available access technology and the + actual access technology in-use when a PS connection is active, so + report the actual access tech when it's available. + + plugins/mm-modem-icera.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit 6657e45a1e7d836f8fee6610b225c59249a07c98 +Author: Dan Williams +Date: Thu Jun 9 16:53:05 2011 -0500 + + core: trivial whitespace cleanup + + Tabs -> spaces + + src/mm-manager.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit 9f8d42a994ae60efff46611a8fb88fe55a506c7f +Author: Nathan Williams +Date: Wed Jun 8 15:52:08 2011 -0400 + + core: handle udev 'change' events + + That's what the udev replay gives us these days (as of udev-152). + + src/mm-manager.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 509521d180e333a76233baf9c14e1a33ceca42b6 +Author: Eric Shienbrood +Date: Thu Jun 9 16:44:10 2011 -0500 + + icera: request specific network error codes on connect errors + + For connection failures, get additional error detail. Currently, + the only error codes that are mapped are the 3GPP TS 24.008 codes + for "Unknown or missing access point name" and "Requested service + option not subscribed" (which is sometimes returned for an invalid + APN). + + (random fixes and cleanups by dcbw) + + plugins/mm-modem-icera.c | 51 + +++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 42 insertions(+), 9 deletions(-) + +commit 57a14da144bdf7a7c5b3403e4cafc66c26783f24 +Author: Eric Shienbrood +Date: Thu Jun 9 16:41:09 2011 -0500 + + build: ensure Samsung plugin includes common Icera code + + Otherwise make can't find build-time dependencies. + + plugins/Makefile.am | 3 +++ + 1 file changed, 3 insertions(+) + +commit 92159d9b0d673b42ca8ceac0254fa2aa06d2f0ab +Author: Eric Shienbrood +Date: Thu Jun 9 16:40:11 2011 -0500 + + icera: add more access technology strings + + plugins/mm-modem-icera.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 85aae2d8f1fdb43709f1e5e7eef3b8387a75ba29 +Author: Eric Shienbrood +Date: Thu Jun 9 16:37:20 2011 -0500 + + samsung: disable should use CFUN=4 + + CFUN=4 disables the radios but still allows useful operations + like getting PIN lock status. So use that instead. + + plugins/mm-modem-samsung-gsm.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 63b29b79f9adf1fa4ff806671c6f1dad8f22de9e +Author: Dan Williams +Date: Thu Jun 9 15:01:20 2011 -0500 + + gsm: fix memory leak when grabbing a new port + + src/mm-generic-gsm.c | 1 + + 1 file changed, 1 insertion(+) + +commit e5c967508d40a008eb2809628da01ed36c96511b +Author: Dan Williams +Date: Thu Jun 9 14:46:03 2011 -0500 + + ussd: fix leaked callback info in error cases + + src/mm-generic-gsm.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit f9f6d1dfdb070bec05e5e7385f8d4eb95e573b6f +Author: Aleksander Morgado +Date: Thu Jun 2 12:33:09 2011 +0200 + + plugins: propagate cached probing result to supports task + + We need to ensure that the supports task always has the results of + the probing, + no matter if the probing was just launched by the plugin grabbing + the port, or + by a previous plugin. We do this during supports_port(), by + propagating to the + supports task any possible previously cached probing results. + + plugins/mm-plugin-anydata.c | 9 ++++--- + plugins/mm-plugin-cinterion.c | 62 + +++++++++++++++++++++++-------------------- + plugins/mm-plugin-generic.c | 9 ++++--- + plugins/mm-plugin-gobi.c | 9 ++++--- + plugins/mm-plugin-hso.c | 9 ++++--- + plugins/mm-plugin-huawei.c | 9 ++++--- + plugins/mm-plugin-linktop.c | 9 ++++--- + plugins/mm-plugin-longcheer.c | 9 ++++--- + plugins/mm-plugin-mbm.c | 9 ++++--- + plugins/mm-plugin-moto-c.c | 11 +++++--- + plugins/mm-plugin-nokia.c | 9 ++++--- + plugins/mm-plugin-novatel.c | 9 ++++--- + plugins/mm-plugin-option.c | 9 ++++--- + plugins/mm-plugin-sierra.c | 9 ++++--- + plugins/mm-plugin-simtech.c | 9 ++++--- + plugins/mm-plugin-wavecom.c | 9 ++++--- + plugins/mm-plugin-x22x.c | 9 ++++--- + plugins/mm-plugin-zte.c | 9 ++++--- + src/mm-plugin-base.c | 48 +++++++++++++++++++-------------- + src/mm-plugin-base.h | 11 ++++---- + 20 files changed, 169 insertions(+), 107 deletions(-) + +commit 39215599018a12817a853615ccbc4ee67c234858 +Author: Aleksander Morgado +Date: Thu May 12 17:01:57 2011 +0200 + + cinterion: set modem disabled if 3 consecutive AT commands get + timed out + + plugins/mm-modem-cinterion-gsm.c | 1 + + 1 file changed, 1 insertion(+) + +commit a2ba5c5e99b4200281fd1a57177676acd26a2cad +Author: Aleksander Morgado +Date: Tue May 10 11:42:04 2011 +0200 + + cinterion: enable reprobing on ports without cached capabilities + + plugins/mm-plugin-cinterion.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 4cb039e34a78a868a84a4e2299e6e0c1ca638cc9 +Author: Aleksander Morgado +Date: Thu May 5 13:20:02 2011 +0200 + + cinterion: always sort last the plugin + + This is because the cinterion plugin can handle RS232 modes, + and checking + support for them needs to have the vendor ID probed with AT + commands, so + probing is almost always issued in this plugin. By sorting last, + we let + other plugins check support first. + + plugins/mm-plugin-cinterion.c | 1 + + 1 file changed, 1 insertion(+) + +commit a9c93ec3ad6c7390afe33e8a317cb83007265881 +Author: Aleksander Morgado +Date: Thu May 5 10:41:07 2011 +0200 + + cinterion: handle RS232 modems + + plugins/mm-plugin-cinterion.c | 108 + ++++++++++++++++++++++++++++++------------ + 1 file changed, 77 insertions(+), 31 deletions(-) + +commit 22f15b87b53b60e627b00a51781234a27a677594 +Author: Aleksander Morgado +Date: Wed May 11 16:40:45 2011 +0200 + + base: disable the modem if up to N consecutive commands get timed out + + This feature is initially disabled for all modems, but plugins can + enable it by + setting a value greater than 0 for the "max-timeouts" property when + creating the + modem object. + + src/mm-modem-base.c | 69 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-base.h | 2 ++ + src/mm-serial-port.c | 43 +++++++++++++++++++++++++++++--- + src/mm-serial-port.h | 1 + + 4 files changed, 111 insertions(+), 4 deletions(-) + +commit f2ba435446a48407f4a491d0fa0eda6b7d4c22d9 +Author: Aleksander Morgado +Date: Tue May 10 16:06:29 2011 +0200 + + manager: protect ScanDevices() d-bus method with manager control + policy rule + + introspection/org.freedesktop.ModemManager.xml | 1 + + src/mm-manager.c | 55 + +++++++++++++++++++++++--- + 2 files changed, 50 insertions(+), 6 deletions(-) + +commit c67cbcabef276b5fcd01286208b5465d47949c68 +Author: Aleksander Morgado +Date: Tue May 10 16:03:02 2011 +0200 + + policy: new policy for manager control actions + + policy/org.freedesktop.modem-manager.policy.in | 9 +++++++++ + src/mm-auth-provider.h | 13 +++++++------ + 2 files changed, 16 insertions(+), 6 deletions(-) + +commit 3fb53d33489bb8efaf4d69ac1d8f6a23fc0c7b4b +Author: Aleksander Morgado +Date: Tue May 10 09:48:59 2011 +0200 + + manager: new ScanDevices() d-bus method to request a new device + scan loop + + introspection/org.freedesktop.ModemManager.xml | 8 ++++++++ + src/mm-manager.c | 14 ++++++++++++++ + 2 files changed, 22 insertions(+) + +commit df0d9b480c0db825126c7ebbb36bdd958bf59761 +Author: Aleksander Morgado +Date: Thu May 5 13:19:32 2011 +0200 + + plugin base: let plugins decide if they should be sorted last + + Note that even if a plugin says it wants to be sorted last, the + generic plugin + will always be the last one. Also, there is no order guaranteed + between two + plugins that request to be sorted last. + + src/mm-manager.c | 37 +++++++++++++++++++++++++++++++++++-- + src/mm-plugin-base.c | 25 +++++++++++++++++++++++++ + src/mm-plugin-base.h | 3 ++- + src/mm-plugin.c | 12 ++++++++++-- + src/mm-plugin.h | 9 ++++++++- + 5 files changed, 80 insertions(+), 6 deletions(-) + +commit 5a2078a2a5f012772612dea0921b147bf6d75d88 +Author: Aleksander Morgado +Date: Thu May 5 10:32:48 2011 +0200 + + plugin base: include vendor ID and product ID retrieval during AT + port probing + + Port probing is extended to also query for Vendor ID and Product + ID. This allows + plugins to check whether the reported IDs are expected, and thus + we enable + plugins to handle modems connected via RS232 ports (where udev + doesn't give any + vendor ID) or modems connected via a USB adapter (where udev gives + the vendor ID + of the adapter). + + Note that this effectively means that a plugin which expects these + kind of modem + connections will end up always launching port probing as they won't + only rely on + the vendor ID reported by udev. + + src/mm-plugin-base.c | 371 + ++++++++++++++++++++++++++++++++++++++------------- + src/mm-plugin-base.h | 12 +- + 2 files changed, 290 insertions(+), 93 deletions(-) + +commit 9578e1b9cab988b11bf9a4cd1af3842cdfb1eb28 +Author: Aleksander Morgado +Date: Mon May 16 16:12:12 2011 +0200 + + cinterion: override CMER enabling command + + plugins/mm-modem-cinterion-gsm.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit de5eb41a705c7ece08a4f5f6fdee8c2e3cfcedc0 +Author: Aleksander Morgado +Date: Mon May 16 15:50:37 2011 +0200 + + cinterion: override SMS indications setup commands + + plugins/mm-modem-cinterion-gsm.c | 46 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 0b8f86534acb3a6f1463fb9abe3059d032fb5f3b +Author: Aleksander Morgado +Date: Wed May 11 13:47:34 2011 +0200 + + cinterion: if modem removed don't process response + + plugins/mm-modem-cinterion-gsm.c | 59 + ++++++++++++++++++++++++++++++++++------ + 1 file changed, 51 insertions(+), 8 deletions(-) + +commit 998b62261158cc8e7f39af5224410b8c2bfcb9f5 +Author: Aleksander Morgado +Date: Thu Apr 14 19:49:30 2011 +0200 + + cinterion: set and get bands + + plugins/mm-modem-cinterion-gsm.c | 422 + ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 421 insertions(+), 1 deletion(-) + +commit ade9fe8d30e30c95e56381a18b2131f28c2172b4 +Author: Aleksander Morgado +Date: Mon Apr 25 13:58:26 2011 +0200 + + cinterion: set and get allowed mode + + The 2G-preferred and 3G-preferred modes are not supported on dual + 2G/3G cinterion modems. + + plugins/mm-modem-cinterion-gsm.c | 132 + ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 131 insertions(+), 1 deletion(-) + +commit 8d8888bc6309d5f6f36016e9afdec05b2a21c3b4 +Author: Aleksander Morgado +Date: Mon Apr 25 12:42:12 2011 +0200 + + cinterion: query supported networks to detect if 2G or 3G device + + plugins/mm-modem-cinterion-gsm.c | 97 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + +commit 795de120503af8474999f6ad0233a407e50ecf8d +Author: Aleksander Morgado +Date: Thu Apr 14 15:46:11 2011 +0200 + + cinterion: query network technology capabilities + + We try to look for 'psinfo' indication in AT^SIND? output (available + in 3G + devices from Cinterion), and if that is not available, we try to + use the + AT^SMONG GPRS monitor (available in 2G devices from Cinterion). + + plugins/mm-modem-cinterion-gsm.c | 205 + +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 205 insertions(+) + +commit c6060e8c0f4c384c49b1e0effb0e149ce9bf15c9 +Author: Aleksander Morgado +Date: Wed Apr 13 16:26:51 2011 +0200 + + cinterion: add initial dummy plugin + + plugins/Makefile.am | 21 ++++- + plugins/mm-modem-cinterion-gsm.c | 62 +++++++++++++++ + plugins/mm-modem-cinterion-gsm.h | 44 +++++++++++ + plugins/mm-plugin-cinterion.c | 164 + +++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-cinterion.h | 47 +++++++++++ + 5 files changed, 337 insertions(+), 1 deletion(-) + +commit 668726dbd7063ef8c17bd27054acfd37343b2f29 +Author: Aleksander Morgado +Date: Wed Apr 27 17:13:43 2011 +0200 + + charsets: new utf8_to_hex() method + + src/mm-charsets.c | 31 +++++++++++++++++++++++++++++++ + src/mm-charsets.h | 5 +++++ + 2 files changed, 36 insertions(+) + +commit 1e507824c62b7c512f57109ff9b0d395f7d2429f +Author: Aleksander Morgado +Date: Mon May 16 16:07:49 2011 +0200 + + gsm: let plugins use their own command for CMER enabling + + src/mm-generic-gsm.c | 29 ++++++++++++++++++++++++++--- + src/mm-generic-gsm.h | 2 ++ + 2 files changed, 28 insertions(+), 3 deletions(-) + +commit 85569f77e9328d753ffe1cc9937ef063f6a92bd5 +Author: Aleksander Morgado +Date: Mon May 16 15:22:23 2011 +0200 + + gsm: let plugins use their own commands for SMS indications and + storage configuration + + src/mm-generic-gsm.c | 39 ++++++++++++++++++++++++++++++++++++--- + src/mm-generic-gsm.h | 18 +++++++++++------- + 2 files changed, 47 insertions(+), 10 deletions(-) + +commit 8c1430763f52b7b297291808452d1bc53d3b5be1 +Author: Aleksander Morgado +Date: Tue May 10 12:13:06 2011 +0200 + + introspection: indentation fixes + + introspection/mm-mobile-error.xml | 2 +- + introspection/mm-modem-connect-error.xml | 2 +- + introspection/mm-modem-error.xml | 2 +- + introspection/mm-serial-error.xml | 2 +- + introspection/org.freedesktop.DBus.Properties.xml | 40 +++--- + .../org.freedesktop.ModemManager.Modem.Cdma.xml | 20 +-- + ...org.freedesktop.ModemManager.Modem.Gsm.Card.xml | 80 ++++++------ + ...freedesktop.ModemManager.Modem.Gsm.Contacts.xml | 72 +++++------ + .../org.freedesktop.ModemManager.Modem.Gsm.Hso.xml | 6 +- + ....freedesktop.ModemManager.Modem.Gsm.Network.xml | 128 + +++++++++--------- + .../org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 52 ++++---- + ...org.freedesktop.ModemManager.Modem.Gsm.Ussd.xml | 4 +- + .../org.freedesktop.ModemManager.Modem.Gsm.xml | 30 ++--- + ...org.freedesktop.ModemManager.Modem.Location.xml | 144 + ++++++++++----------- + .../org.freedesktop.ModemManager.Modem.Simple.xml | 66 +++++----- + .../org.freedesktop.ModemManager.Modem.xml | 78 +++++------ + introspection/org.freedesktop.ModemManager.xml | 22 ++-- + 17 files changed, 375 insertions(+), 375 deletions(-) + +commit c45df27ca0c6c2b6f626ef847f3164a8c23b5f17 +Author: Dan Williams +Date: Sun Jun 5 20:57:15 2011 -0500 + + x22x: add support for the Alcatel X200 + + Same USB IDs as the X060s which is driven by Longcheer, but uses the + X22X command set so we have to do a little dance and make sure we + don't claim the X060s here. + + plugins/77-mm-x22x-port-types.rules | 8 ++++++ + plugins/mm-plugin-x22x.c | 54 + +++++++++++++++++++++++++++++++++++-- + 2 files changed, 60 insertions(+), 2 deletions(-) + +commit 1936979f112f81ca7acad1e1512ca940502d25b5 +Author: Dan Williams +Date: Sun Jun 5 20:23:51 2011 -0500 + + longcheer: ensure the Alcatel X200 is not claimed + + The X200 shares the same USB VID and PID as the X060s but the X200 + does not use the same AT command set; it uses the X22X plugin + instead. Since both modems also report the same +GMM and +GMI + responses, we have to fall back to using +GMR even though that's + a pretty sketchy way to tell them apart if the firmware ever changes. + + plugins/mm-plugin-longcheer.c | 54 + +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 52 insertions(+), 2 deletions(-) + +commit b122938ab5fb6ff5be1d4575abb0ca81d2885ce3 +Author: Dan Williams +Date: Sun Jun 5 20:21:52 2011 -0500 + + core: allow plugins to stop probing and not support a modem + + Previously plugins could only stop probing, *or* stop probing and + indicate support for a device. For the Alcatel X200/X060s debacle + we need to stop probing and indicate that the plugin does not + support the device at all. + + plugins/mm-plugin-huawei.c | 4 ++-- + plugins/mm-plugin-zte.c | 2 +- + src/mm-plugin-base.c | 13 +++---------- + src/mm-plugin-base.h | 11 +++++------ + 4 files changed, 11 insertions(+), 19 deletions(-) + +commit d81fa43c1d721ed123401f4a89fd7b3771ab4463 +Author: Dan Williams +Date: Sun Jun 5 18:29:00 2011 -0500 + + x22x: support access technology reporting + + plugins/mm-modem-x22x-gsm.c | 46 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit da55d11e72d0f2d075aab57794cce47d0cb60655 +Author: Aleksander Morgado +Date: Tue May 17 09:35:23 2011 +0200 + + plugins: use MMCallbackInfo instead of custom DisableInfo + + Implemented using a custom invoke method which doesn't call the + callback, and + instead calls parent disable passing the callback as argument. + + This fix ensures that if a modem gets removed, no invalid modem + reference is + passed to the parent disable, as info->modem would be set to NULL + and we can + detect it in the custom invoke method. + + plugins/mm-modem-huawei-gsm.c | 43 + +++++++++++++++++++++++++--------------- + plugins/mm-modem-mbm.c | 43 + ++++++++++++++++++++++++++-------------- + plugins/mm-modem-samsung-gsm.c | 43 + ++++++++++++++++++++++++++-------------- + plugins/mm-modem-simtech-gsm.c | 43 + +++++++++++++++++++++++++--------------- + plugins/mm-modem-zte.c | 45 + ++++++++++++++++++++++++++---------------- + 5 files changed, 138 insertions(+), 79 deletions(-) + +commit d37dbaca2ad66beeeae6e52db1293a3e8a60b7d7 +Author: Aleksander Morgado +Date: Mon May 16 18:58:43 2011 +0200 + + core: ensure ERROR_REMOVED error is used in MMCallbackInfo when + detecting modem removal + + src/mm-callback-info.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 9323daec015ecad65c39b6020b62e864c027d858 +Author: Aleksander Morgado +Date: Mon May 16 12:16:04 2011 +0200 + + core, plugins: if modem removed don't process response + + We try to avoid a memory leak when info->error is reset, as well as + a second + re-schedule of the info. + + plugins/mm-modem-anydata-cdma.c | 10 + + plugins/mm-modem-gobi-gsm.c | 5 + + plugins/mm-modem-hso.c | 66 ++++-- + plugins/mm-modem-huawei-cdma.c | 5 + + plugins/mm-modem-huawei-gsm.c | 45 +++- + plugins/mm-modem-icera.c | 59 ++++- + plugins/mm-modem-linktop.c | 12 +- + plugins/mm-modem-longcheer-gsm.c | 20 +- + plugins/mm-modem-mbm.c | 70 +++++- + plugins/mm-modem-novatel-cdma.c | 19 +- + plugins/mm-modem-novatel-gsm.c | 20 +- + plugins/mm-modem-option-utils.c | 28 ++- + plugins/mm-modem-samsung-gsm.c | 42 +++- + plugins/mm-modem-sierra-cdma.c | 24 +- + plugins/mm-modem-sierra-gsm.c | 48 +++- + plugins/mm-modem-simtech-gsm.c | 43 +++- + plugins/mm-modem-wavecom-gsm.c | 89 ++++++- + plugins/mm-modem-x22x-gsm.c | 19 +- + plugins/mm-modem-zte.c | 46 +++- + src/mm-callback-info.c | 8 + + src/mm-callback-info.h | 2 + + src/mm-generic-cdma.c | 117 +++++++--- + src/mm-generic-gsm.c | 490 + +++++++++++++++++++++++++++------------ + src/mm-modem-base.c | 20 +- + src/mm-modem.c | 19 -- + src/mm-modem.h | 2 - + 26 files changed, 1029 insertions(+), 299 deletions(-) + +commit f7dff81eecd6694c2596200fc2c3226de0396b7d +Author: Nathan Williams +Date: Fri May 20 14:42:16 2011 -0400 + + gsm: free the string allocated by utils_hexstr2bin(). + + Change-Id: I1f7dabc8209d9757b573a59abb788a2346f72ad5 + + src/mm-generic-gsm.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit a1378ae8e82e4372ca2a7abf747ff5e418675907 +Author: Nathan Williams +Date: Fri May 20 17:31:34 2011 -0400 + + Spec out and implement a command to get a GSM SIM SPN value. + + Using a SIM with a SPN, run the following command: + dbus-send --system --dest=org.freedesktop.ModemManager + --print-reply /org/freedesktop/ModemManager/Modems/0 + org.freedesktop.ModemManager.Modem.Gsm.Card.GetSpn + + Change-Id: I8f36c8432f40fa4e3cb3f8c6ceef16b2bdadf2a1 + Reviewed-on: http://gerrit.chromium.org/gerrit/1464 + Reviewed-by: Nathan J. Williams + Tested-by: Nathan J. Williams + + ...org.freedesktop.ModemManager.Modem.Gsm.Card.xml | 13 +++ + src/mm-generic-gsm.c | 94 + ++++++++++++++++++++++ + src/mm-modem-gsm-card.c | 54 +++++++++++++ + src/mm-modem-gsm-card.h | 8 ++ + 4 files changed, 169 insertions(+) + +commit dfab00bf1ecc15d5df911496b375a77ecb7b7b79 +Author: Nathan Williams +Date: Tue May 31 13:50:17 2011 -0400 + + sms_decode_address(): Add a leading "+" on international numbers. + + BUG=chromium-os-partner:4278 + TEST=Send SMS from phone (to get +... format) and from AIM-SMS gateway + (to get raw-digit format). + + Change-Id: I36eb9f1432a432435578180dfdb315b0e7ee5744 + + src/mm-generic-gsm.c | 28 ++++++++++++++++++++++++---- + 1 file changed, 24 insertions(+), 4 deletions(-) + +commit 6d69432a858abf5b2c2297891858aac9eff57943 +Author: Aleksander Morgado +Date: Thu Jun 2 16:43:02 2011 +0200 + + serial-parser: allow 0 or more whitespaces before error code in + regular expresions + + src/mm-serial-parsers.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit b8cb764d080ac385f93cf17b77a0d41861d9670d +Author: Nathan Williams +Date: Wed May 25 17:08:15 2011 -0400 + + sms: use correct start and length for alphanumeric data + + sms_parse_pdu(): Protocol ID doesn't actually affect decoding, so + don't fret about its value. + + ChromeOS: + Change-Id: Ia4cb20c415aed1026bb7b8dd4daa8ae53dd749e8 + + src/mm-generic-gsm.c | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +commit 6e9b11a047b59e75a478113840e6705724759a30 +Author: Dan Williams +Date: Fri May 27 09:57:47 2011 -0500 + + simtech: tag ports on Prolink PH-300 + + plugins/77-mm-simtech-port-types.rules | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 52bd7646e8d5ce12e1d77cb831c6bd87f1897dff +Author: Nathan Williams +Date: Wed May 18 20:37:49 2011 -0400 + + gsm: correctly set registration status when disabling + + Chromium: + Change-Id: I0629706985f273832ac3662acb260388d0e6ed83 + + src/mm-generic-gsm.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 97ea7dca8a319f287ed355d43f33581f69827ccc +Author: Nathan Williams +Date: Thu May 12 15:23:33 2011 -0400 + + samsung: split initialization sequence to ensure echo is off + + Split the Samsung initialization sequence from "ATZ E0 V1" to "ATZ" + and "ATE0 V1" - the modem is allowed to ignore the rest of the line + after Z, so echoing was not being turned off, leading to getting + "AT+CIMI\n\n" as part of the IMSI when it is retrieved at startup. + + Chromium: + Change-Id: Icfd767174e779e472f8cde419acb163128e4715d + + plugins/mm-modem-samsung-gsm.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit e28946841d150d3a7c58b24281bfdfe396d72fd8 +Author: Dan Williams +Date: Thu May 19 10:44:03 2011 -0500 + + ussd: formatting and spacing cleanups + + src/mm-generic-gsm.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 7c70ad55bb08b1d30c3600cf3075040bab09f4d1 +Author: Dan Williams +Date: Wed May 18 21:59:42 2011 -0500 + + api: proposed new interface for MM 0.6 and later + + Main changes are cleaning up the API and allowing for multi-mode + devices that support two or more of CDMA/EVDO, GSM/UMTS, and LTE + at the same time. This provides a starting discussion point for + the new MM 0.6 API. + + new/mm-mobile-error.xml | 318 +++++++++++ + new/mm-modem-connect-error.xml | 30 + + new/mm-modem-error.xml | 36 ++ + new/mm-serial-error.xml | 24 + + new/org.freedesktop.DBus.Properties.xml | 45 ++ + ...g.freedesktop.ModemManager1.Modem.3gpp.Ussd.xml | 84 +++ + new/org.freedesktop.ModemManager1.Modem.3gpp.xml | 140 +++++ + new/org.freedesktop.ModemManager1.Modem.Bearer.xml | 137 +++++ + new/org.freedesktop.ModemManager1.Modem.Cdma.xml | 184 +++++++ + ...rg.freedesktop.ModemManager1.Modem.Contacts.xml | 139 +++++ + ...rg.freedesktop.ModemManager1.Modem.Location.xml | 253 +++++++++ + new/org.freedesktop.ModemManager1.Modem.Simple.xml | 116 ++++ + new/org.freedesktop.ModemManager1.Modem.xml | 601 + +++++++++++++++++++++ + new/org.freedesktop.ModemManager1.Sim.xml | 113 ++++ + new/org.freedesktop.ModemManager1.xml | 51 ++ + 15 files changed, 2271 insertions(+) + +commit b3f0ca92335736e6ea66b8a9e4773e3837c20de8 +Author: Dan Williams +Date: Mon May 16 18:44:11 2011 -0500 + + qcdm: add some more CDMA band classes + + libqcdm/src/commands.c | 14 ++++++++++++++ + libqcdm/src/commands.h | 33 ++++++++++++++++++++------------- + libqcdm/src/dm-commands.h | 33 ++++++++++++++++++++------------- + 3 files changed, 54 insertions(+), 26 deletions(-) + +commit fa15c50b297f98fb18ece73f80409f3c7adb6948 +Author: Nathan Williams +Date: Wed May 11 21:44:16 2011 -0500 + + sms: suppress duplicate SMS received notifications + + If the modem sends the same notification on more than one port, + make sure we don't send a signal out to clients more than once. + + src/mm-generic-gsm.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit d73673c265f1b920f743c3e1c1f3facd1a6b17f4 +Author: Aleksander Morgado +Date: Tue May 10 11:50:40 2011 +0200 + + build: add include dir to .gitignore + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit 673005e6021d6960dcb338ea83d2a21aa8080117 +Author: Aleksander Morgado +Date: Mon May 9 18:21:46 2011 +0200 + + manager: avoid assertion warning when enumerating devices + + src/mm-manager.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 1bc70be993a0f38bf8e4e7f6041927ad76316122 +Author: Dan Williams +Date: Mon May 9 11:05:28 2011 -0500 + + gsm: whitespace fixes + + src/mm-generic-gsm.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 00e00bf9e7ffd4b76adc3e30a6796e94da3ec1c9 +Author: Dan Williams +Date: Wed May 4 15:11:37 2011 -0500 + + longcheer: ensure the plugin on handles devices it's supposed to + + Other devices from the same vendor (x220) need to be handled by + the x22x plugin, so Longcheer can't just rely on the vendor ID + match to know whether it should handle the modem. + + plugins/mm-plugin-longcheer.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 1f86a85c1cf4d73571dd65f7029d503e0cce3315 +Author: Dan Williams +Date: Wed May 4 11:33:36 2011 -0500 + + build: bump version to 0.5.999 for 0.6 development + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 868129e37cd78a05e1ed00f742ebf7ab8200afe5 +Author: Dan Williams +Date: Wed May 4 11:20:31 2011 -0500 + + build: build docs during distcheck and fix up udev rules install base + + Makefile.am | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 82cee08875363ed58e6dc010dc4b190d063d7035 +Author: Dan Williams +Date: Mon May 2 18:34:37 2011 -0500 + + samsung: lock plugin to Y3300 to exclude other Samsung USB modems + + Like the SGH-Z810/SCH-U209 which are a different chipset, don't + have pseudo-ethernet ports, and just wouldn't work with this + plugin. + + plugins/mm-plugin-samsung.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 863dbca63132b820fca6c48a9c212f852752ee16 +Author: Aleksander Morgado +Date: Thu Apr 28 12:54:17 2011 +0200 + + wavecom: enable usage of MM_MODEM_GSM_BAND_ANY in SetBand() + + plugins/mm-modem-wavecom-gsm.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit fc1f35baf68742d187661d9d93deb17b5a1768ba +Author: Aleksander Morgado +Date: Thu Apr 28 12:49:32 2011 +0200 + + samsung: allow getting more than one band + + plugins/mm-modem-samsung-gsm.c | 49 + +++++++++++++++++++++--------------------- + 1 file changed, 24 insertions(+), 25 deletions(-) + +commit bb827c3ef7a57caa295eed92438e713f6f841dae +Author: Aleksander Morgado +Date: Thu Apr 28 12:46:24 2011 +0200 + + samsung: allow setting a single band only + + plugins/mm-modem-samsung-gsm.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit db7c11768a968913c783c05c27e06bcf249502c0 +Author: Aleksander Morgado +Date: Thu Apr 28 12:38:03 2011 +0200 + + utils: new utils_check_for_single_value() method + + It was being used in several places with different static + implementations + + src/mm-generic-gsm.c | 24 +++--------------------- + src/mm-modem-gsm-network.c | 21 ++------------------- + src/mm-utils.c | 17 +++++++++++++++++ + src/mm-utils.h | 2 ++ + 4 files changed, 24 insertions(+), 40 deletions(-) + +commit a0c902bdb5f03fc4d4b58ffbfb8bb36c06bfa55f +Author: Aleksander Morgado +Date: Thu Apr 28 12:36:25 2011 +0200 + + huawei: enable getting and setting more than one band + + plugins/mm-modem-huawei-gsm.c | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) + +commit 466b6edbf72e95bdc5b563ab2ea90df79f3796ea +Author: Aleksander Morgado +Date: Thu Apr 28 12:35:28 2011 +0200 + + gsm: allow setting more than one band + + .../org.freedesktop.ModemManager.Modem.Gsm.Network.xml | 12 + ++++++------ + src/mm-modem-gsm-network.c | + 10 ---------- + 2 files changed, 6 insertions(+), 16 deletions(-) + +commit 573dcd51c0dace9389f879a3cdd0230ec728dcb6 +Author: Aleksander Morgado +Date: Thu Apr 28 11:56:59 2011 +0200 + + introspection: add missing UMTS 2600 band reference + + introspection/org.freedesktop.ModemManager.Modem.Gsm.xml | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0cce1f4e4c108429aadc9db35236abd07aea55d2 +Author: Aleksander Morgado +Date: Thu Apr 28 11:49:32 2011 +0200 + + build: remove unneeded message in configure build report + + Location API is always built + + configure.ac | 2 -- + 1 file changed, 2 deletions(-) + +commit 83bbd0eb1159558bcd35d131c68c2559a9479daf +Author: Dan Williams +Date: Wed Apr 27 14:54:41 2011 -0500 + + build: only require gettext if enabling polkit + + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit c96db0c91b8c86f1c60e463f1ae133bef5cc2103 +Author: Dan Williams +Date: Wed Apr 27 14:47:00 2011 -0500 + + Revert "build: don't require intltool unless --with-polkit=yes" + + This reverts commit 0299cf51c4cf587f79771fe219c6154bf0d0139e. + + autogen.sh | 14 ++------------ + configure.ac | 11 +++++++---- + 2 files changed, 9 insertions(+), 16 deletions(-) + +commit 383bf8c9a3409fda655b18ba6ada503367b5d332 +Author: Dan Williams +Date: Wed Apr 27 14:46:52 2011 -0500 + + Revert "build: po shouldn't be built unless --with-polkit=yes" + + This reverts commit ba17060219f34b5bb8dbb965be9a5f224955777a. + + Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ba17060219f34b5bb8dbb965be9a5f224955777a +Author: Dan Williams +Date: Wed Apr 27 13:25:10 2011 -0500 + + build: po shouldn't be built unless --with-polkit=yes + + Since translations are only used with polkit. + + Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0299cf51c4cf587f79771fe219c6154bf0d0139e +Author: Dan Williams +Date: Wed Apr 27 13:00:51 2011 -0500 + + build: don't require intltool unless --with-polkit=yes + + autogen.sh | 14 ++++++++++++-- + configure.ac | 11 ++++------- + 2 files changed, 16 insertions(+), 9 deletions(-) + +commit dc89c0a42d826fc3302b3d790d5161945ff7078f +Author: Dan Williams +Date: Wed Apr 27 10:50:32 2011 -0500 + + huawei: rework probing and detection + + Long ago there were problems where certain Huawei devices would + stop responding on various ports, and sometimes would crash + randomly. The theory at the time was that touching the secondary + ports made the device angry, thus the plugin simply opened the + ports and listened for unsolicited messages. But if the device + didn't send any during that 7 second period, MM would not detect + and secondary ports at all. Plus, it was always a hack. + + Instead, the new theory is that the device crashes if unsolicited + messages are enabled (^CURC=1), the secondary port gets touched, + *and* then closed and left for a while. Fix that by turning + unsolicited messages off at probe time, on when the device is + enabled, and off again when the device is disabled like happens + for other modems. Thus when MM first detects the modem, it turns + off unsolicited messages and the serial buffer on the secondary + port doesn't fill up and crash the modem. + + Second, this allows us to simplify the probing logic quite a bit + so that we can probe all ports we find, but we still wait to probe + the first port so we can turn off unsolicited messages and get + hints about what port is the secondary. + + plugins/mm-modem-huawei-gsm.c | 67 ++++++++++++ + plugins/mm-plugin-huawei.c | 230 + +++++++++++++++++------------------------- + 2 files changed, 158 insertions(+), 139 deletions(-) + +commit 1cf7a4da4495fdd1d237b04bc35732a93f42fdf1 +Author: Dan Williams +Date: Tue Apr 26 23:44:56 2011 -0500 + + plugins: allow multiple custom init commands in sequence + + Huawei will need this. + + plugins/mm-plugin-zte.c | 2 +- + src/mm-plugin-base.c | 71 + +++++++++++++++++++++++++++++++++---------------- + src/mm-plugin-base.h | 2 +- + 3 files changed, 50 insertions(+), 25 deletions(-) + +commit 0befde3ce9bec9167a331e921da1f3e3dddda5af +Author: Dan Williams +Date: Tue Apr 26 19:41:30 2011 -0500 + + plugins: simplify custom init commands + + Instead of having two places that custom init stuff got processed + (a hook in the MMPluginBase class itself and a callback too) just + use a callback, and simplify it somewhat so that the plugin tracks + how many tries it cares about and what to do based on the response + or error. + + plugins/mm-plugin-zte.c | 22 +++++++++++++++- + src/mm-plugin-base.c | 70 + ++++++++++++++++++++++--------------------------- + src/mm-plugin-base.h | 28 +++++++++++++++----- + 3 files changed, 73 insertions(+), 47 deletions(-) + +commit 0b757465ffe6108066d32312ab4e895c372c8f72 +Author: Marius B. Kotsbak +Date: Mon Apr 18 10:21:02 2011 +0200 + + mbm: add MBM device IDs for Lenovo F5521gw module + + plugins/77-mm-ericsson-mbm.rules | 1 + + 1 file changed, 1 insertion(+) + +commit 2a5cf2978b60cbcb98a79cb5b7c2da8159a27f2f +Author: Dan Williams +Date: Tue Apr 19 11:07:46 2011 -0500 + + zte: only dispose Icera data once + + plugins/mm-modem-zte.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 76bdc658d31c8c64dd74a120ec68d8126dd273cf +Author: Dan Williams +Date: Mon Apr 18 22:48:05 2011 -0500 + + samsung: use common Icera code + + Port the differences over to the common Icera code (there were only + two) and remove the duplicate code from the Samsung plugin. The + Icera NWSTATE regex had to be adjusted to capture "-1" in the first + element which wasn't handled before but which I've seen on the + Samsung Y3300 before the card has registered. + + plugins/mm-modem-icera.c | 8 +- + plugins/mm-modem-samsung-gsm.c | 633 + ++++------------------------------------- + 2 files changed, 67 insertions(+), 574 deletions(-) + +commit 8333fb657ab6e30e51aec8f4449dc4c505fea6f4 +Author: Dan Williams +Date: Mon Apr 18 22:08:19 2011 -0500 + + icera: fix abuse of GInterface + + The GInterface structure for MMModemIcera isn't instance data, thus we + shouldn't be storing an instance pointer in it. Instead, make + implemtors + store the intstance data in their private structure, and have them + implement an accessor for the Icera-private data. This makes everone + (especially GObject) happy. It's a bit of additional indirection, but + we still get to use the MM_MODEM_ICERA_GET_PRIVATE() and we still + get to cast the passed-in GInterface MMModemIcera into the various + GSM MMModem subclasses, which is all we ever wanted anyway. + + plugins/mm-modem-icera.c | 44 + ++++++++++++++++++++++++-------------------- + plugins/mm-modem-icera.h | 8 ++++++-- + plugins/mm-modem-zte.c | 35 +++++++++++++++++++++++++---------- + 3 files changed, 55 insertions(+), 32 deletions(-) + +commit 74b1503c602e1268b5199ef36c9611d7cb08adc1 +Author: Dan Williams +Date: Mon Apr 18 17:39:59 2011 -0500 + + core: tear down all pending work when closing a port + + Make sure all pending work, if any, is torn down when closing + the port, since it's closed, and is likely going to get unreffed + soon and we don't want anything running after the port is dead. + + src/mm-serial-port.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit fca4d3aa37e9a22921d1b7cfb93325bf6cc91f4e +Author: Dan Williams +Date: Mon Apr 18 17:38:39 2011 -0500 + + gsm: return success if unlocked but doesn't allow subsequent CPIN + commands + + If the modem for some reason returns ERROR for a +CPIN when it's + unlocked, and subsequent PIN post-unlock pin checks return READY, + just treat the modem as unlocked don't return the +CPIN error. + + src/mm-generic-gsm.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit 5dadfa4c214be79e704eb61c135893f93a705d3a +Merge: 487972c1 765da63a +Author: Dan Williams +Date: Thu Apr 14 14:20:43 2011 -0500 + + Merge remote-tracking branch 'lanedo/plugin-wavecom' + +commit 487972c1ac40b057c35dac51958f04c13f6137d8 +Author: Nathan Williams +Date: Thu Apr 14 14:07:31 2011 -0500 + + gsm: implement basic SMS reception and PDU parsing + + .../org.freedesktop.ModemManager.Modem.Gsm.SMS.xml | 1 + + src/mm-charsets.c | 6 +- + src/mm-charsets.h | 2 +- + src/mm-generic-gsm.c | 487 + +++++++++++++++++++++ + src/mm-modem-gsm-sms.c | 150 ++++++- + src/mm-modem-gsm-sms.h | 47 ++ + src/mm-serial-parsers.c | 19 + + 7 files changed, 703 insertions(+), 9 deletions(-) + +commit 48c7dac00902ceab300bfaff82731bb2dadd77cc +Author: Aleksander Morgado +Date: Tue Apr 12 16:32:11 2011 +0200 + + serial: ensure response array is empty before setting cached reply + + src/mm-serial-port.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit d05c87e4c80f1a56a613241d14de4faeb0a8304a +Author: Nathan Williams +Date: Thu Apr 14 13:30:15 2011 -0500 + + charset: change GSM unpack to take number of characters rather + than octets + + Change interface to take the number of GSM characters + rather than the number of octets, so that it is possible to + distinguish the 7-character and 8-character cases. + + src/mm-charsets.c | 5 ++--- + src/mm-charsets.h | 2 +- + src/tests/test-charsets.c | 11 +++++------ + 3 files changed, 8 insertions(+), 10 deletions(-) + +commit 0a06dd324dbcb255d28795eb78901fca21cc52c0 +Author: Dan Williams +Date: Thu Apr 14 13:26:16 2011 -0500 + + serial: ensure spew control can be changed after port is created + + Since we don't allow properties to be passed into the serial port + create routines we don't want a construct-only property here. + + src/mm-serial-port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1c3101fbaf74cbb9d8d0eb52ad6f84dc01544cf0 +Author: Nathan Williams +Date: Thu Apr 14 13:22:54 2011 -0500 + + serial: allow spew control to be turned off + + It's only used during probing where some port types (Sierra CnS + and some Icera devices) may send streams of data that we can't + understand until we close the port. It interferes with some SMS + operations, so turn it off for ports opened after probing. + + src/mm-plugin-base.c | 1 + + src/mm-serial-port.c | 18 +++++++++++++++++- + src/mm-serial-port.h | 13 +++++++------ + 3 files changed, 25 insertions(+), 7 deletions(-) + +commit 765da63ad2ddb47d90ad8ffa5b2d0569301b2ba3 +Author: Aleksander Morgado +Date: Wed Apr 6 19:41:19 2011 +0200 + + wavecom: set and get bands + + Use AT+WMBS for devices in 2G mode, and AT+WUBS for devices in + 3G mode. + + plugins/mm-modem-wavecom-gsm.c | 339 + ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 334 insertions(+), 5 deletions(-) + +commit ade8c17f6a37d83cfa7cee5c1a6a370522a936ca +Author: Aleksander Morgado +Date: Wed Apr 6 19:40:53 2011 +0200 + + gsm: handle UMTS 2600 internal band + + src/mm-modem-gsm.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d1453b0e199588db20f8fef92922bdccfed46c66 +Author: Aleksander Morgado +Date: Wed Apr 6 13:36:10 2011 +0200 + + wavecom: ensure full functionality status + + Check the current functionality status with AT+CFUN? and make sure + its '1', + otherwise, RF may be switched off. + + plugins/mm-modem-wavecom-gsm.c | 54 + +++++++++++++++++++++++++++++++++--------- + 1 file changed, 43 insertions(+), 11 deletions(-) + +commit e93f01f2017ad7e05c90d6ae18eaab49bbc17e7e +Author: Aleksander Morgado +Date: Wed Apr 6 11:31:40 2011 +0200 + + wavecom: set and get allowed mode + + For 3G devices in Class A, AT+WWSM can be used to get or set the + allowed mode: + * +WWSM: 0 (2G only) + * +WWSM: 1 (3G only) + * +WWSM: 2,0 (Any) + * +WWSM: 2,1 (2G preferred) + * +WWSM: 2,2 (3G preferred) + + For 2G devices, there is no such command, so we will default to Any + and allow + 2G-only and 2G-preferred setups. + + plugins/mm-modem-wavecom-gsm.c | 224 + +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 224 insertions(+) + +commit c7119f0341670cc258292b5d39a9082485018fbf +Author: Aleksander Morgado +Date: Wed Apr 6 11:21:45 2011 +0200 + + wavecom: ensure the modem uses the highest possible mobile class + + These modems can be configured to use different mobile classes. For + each kind of + modem, the best mobile class is the highest one in the following + order: + - Class A (3G only mode) + - Class B (PS or CS, GPRS/EDGE or GSM) + - Class CG (PS only, GPRS/EDGE) + - Class CC (CS only, GSM) + + plugins/mm-modem-wavecom-gsm.c | 273 + +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 273 insertions(+) + +commit acf65de3b844cd13c2128275daca67ac630146bb +Author: Aleksander Morgado +Date: Mon Apr 4 13:09:14 2011 +0200 + + wavecom: query network technology capabilities + + plugins/mm-modem-wavecom-gsm.c | 75 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +commit 23649549bb5a6f4848656bd1ea3423401f771383 +Author: Aleksander Morgado +Date: Thu Mar 31 10:45:09 2011 +0200 + + wavecom: enable RTS/CTS flow control instead of XOFF/XON + + plugins/mm-modem-wavecom-gsm.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 1fb0b9d79b9fd2d2004653a316b2bbbcc0efcc1f +Author: Aleksander Morgado +Date: Thu Mar 31 09:23:29 2011 +0200 + + wavecom: disable default power up command + + plugins/mm-modem-wavecom-gsm.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +commit 262edb96d50138a724173840fc63ca93ede322c2 +Author: Aleksander Morgado +Date: Wed Mar 30 18:52:23 2011 +0200 + + wavecom: handle READY without OK in CPIN? reply + + plugins/mm-modem-wavecom-gsm.c | 51 + +++++++++++++++++++++++++++++++++++++----- + src/mm-serial-parsers.c | 3 ++- + 2 files changed, 48 insertions(+), 6 deletions(-) + +commit f91ee7af7d6a38eda226afb429b26ffe1408e08f +Author: Aleksander Morgado +Date: Wed Mar 30 17:22:53 2011 +0200 + + wavecom: add initial dummy plugin + + plugins/Makefile.am | 21 +++++- + plugins/mm-modem-wavecom-gsm.c | 74 +++++++++++++++++++ + plugins/mm-modem-wavecom-gsm.h | 44 +++++++++++ + plugins/mm-plugin-wavecom.c | 162 + +++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-wavecom.h | 47 ++++++++++++ + 5 files changed, 347 insertions(+), 1 deletion(-) + +commit f4a26ec2b6053c44f34f1ac5ee2a8645c4622cb7 +Author: Dan Williams +Date: Fri Apr 8 16:20:43 2011 -0500 + + hso: use zero send_delay since Option firmware is generally excellent + + plugins/mm-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ed5aefb3cb1d7db3a0b19678d4568d813719eb01 +Author: Dan Williams +Date: Fri Apr 8 16:19:36 2011 -0500 + + serial: allow plugins to specify probe-time send_delay + + Let modems we know don't suck use a zero send-delay at probe time, + which greatly reduces time required to probe AT-compatible ports. + + plugins/mm-plugin-anydata.c | 2 +- + plugins/mm-plugin-generic.c | 2 +- + plugins/mm-plugin-gobi.c | 2 +- + plugins/mm-plugin-hso.c | 2 +- + plugins/mm-plugin-huawei.c | 2 +- + plugins/mm-plugin-linktop.c | 2 +- + plugins/mm-plugin-longcheer.c | 2 +- + plugins/mm-plugin-mbm.c | 2 +- + plugins/mm-plugin-moto-c.c | 2 +- + plugins/mm-plugin-nokia.c | 2 +- + plugins/mm-plugin-novatel.c | 2 +- + plugins/mm-plugin-option.c | 2 +- + plugins/mm-plugin-samsung.c | 2 +- + plugins/mm-plugin-sierra.c | 2 +- + plugins/mm-plugin-simtech.c | 2 +- + plugins/mm-plugin-x22x.c | 2 +- + plugins/mm-plugin-zte.c | 2 +- + src/mm-plugin-base.c | 3 ++- + src/mm-plugin-base.h | 1 + + 19 files changed, 20 insertions(+), 18 deletions(-) + +commit 7d20acc5669ce9ecc0358d429c46f5928df95542 +Author: Dan Williams +Date: Fri Apr 8 16:00:36 2011 -0500 + + gsm: make sure verbose error reporting is enabled before checking PIN + + Otherwise we don't get the expected "Incorrect password" error if the + PIN is wrong, just a generic error. + + src/mm-generic-gsm.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 273f4203d4eeda3614d76bcdbda537ed76feef35 +Author: Dan Williams +Date: Fri Apr 8 15:42:28 2011 -0500 + + serial: send entire command in one write if send_delay is 0 + (chromium:13506) + + Avoids additional USB latency and groups the whole command into one + USB packet. + + BUG=chromium-os:13506 + + plugins/mm-modem-samsung-gsm.c | 5 ++++- + src/mm-serial-port.c | 24 +++++++++++++++++------- + 2 files changed, 21 insertions(+), 8 deletions(-) + +commit 2640baefa417612cd26fe3c826634c91d50e0917 +Author: Elly Jones +Date: Thu Apr 7 12:54:02 2011 -0400 + + samsung: add Reset and UnlockRetries. + + BUG=chromeos-partner:2999, chromeos-partner:3215 + TEST=network_LockedSIM + + Change-Id: I17c25c52fa5cf4cffa94e73bd827eaae9e687df0 + Signed-off-by: Elly Jones + Signed-off-by: Jason Glasgow + Signed-off-by: Jun Woo Lee + + plugins/mm-modem-samsung-gsm.c | 154 + ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 153 insertions(+), 1 deletion(-) + +commit dbf9e085d45c5135691a487cd947b9bd79195d86 +Author: Nathan Williams +Date: Thu Apr 7 17:48:03 2011 -0500 + + sms: don't try to destroy NULL hash tables + + src/mm-modem-gsm-sms.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 9435a937ced680fd2aaf3f19bfc8e7daaf579633 +Author: Aleksander Morgado +Date: Wed Mar 30 18:29:15 2011 +0200 + + serial: allow user to provide custom regex for successful and + error replies + + New mm_serial_parser_v1_set_custom_regex() method. + + src/mm-serial-parsers.c | 67 + +++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-serial-parsers.h | 16 ++++++------ + 2 files changed, 70 insertions(+), 13 deletions(-) + +commit cc5fcd195a26b0b09be8e47d95e54a92f78c8806 +Author: Aleksander Morgado +Date: Wed Apr 6 17:08:06 2011 +0200 + + modem-base: allow NULL ports in get_card_info() if port_error given + + So that cached values can be returned if querying while the port + is connected. + + src/mm-modem-base.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 49150ca3a69d8a65c63fc691ffcaabd15f49818d +Author: Dan Williams +Date: Wed Apr 6 13:00:55 2011 -0500 + + serial: don't let EAGAIN block sending commands until completion + + If a port returns EAGAIN on write attempts, previously the code would + spin and attempt to resend the failed byte after send_delay + microseconds. This resulted in up to 3 second hard blocks in + the serial code when sending to ports that don't respond. While + in this blocking loop no other events or dbus commands could be + processed. + + Instead, send each byte and reschedule sending the next byte in + send_delay microseconds, so that we can process other events in + between + attempts to write to stupid ports. + + This doesn't hugely decrease the amount of time that probing + requires, since we still need to probe all ports of the device + before exporting the modem to D-Bus, but it does let MM find + responsive ports much more quickly, and ensures that MM doesn't + block any D-Bus requests. + + src/mm-serial-port.c | 153 + +++++++++++++++++++++++++++++---------------------- + 1 file changed, 88 insertions(+), 65 deletions(-) + +commit e520c2d448eb44464e0c932ac71a4895f7c8ea32 +Author: Aleksander Morgado +Date: Thu Mar 31 10:39:43 2011 +0200 + + generic-gsm: make flow control setup command a property + + src/mm-generic-gsm.c | 21 +++++++++++++++++++-- + src/mm-generic-gsm.h | 2 ++ + 2 files changed, 21 insertions(+), 2 deletions(-) + +commit 95b0863f8751fe4fc80782f8232bce7ef5d1ca0c +Author: Aleksander Morgado +Date: Mon Mar 28 18:14:06 2011 +0200 + + build: use brackets in autoconf initialization macros + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 641ec51c8bef4d3a44a327b2ea95e9c99e3f7655 +Author: Aleksander Morgado +Date: Mon Mar 28 18:09:48 2011 +0200 + + build: use LT_INIT to initialize libtool, and require at least 2.2 + + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e68bf52bc36be361d54ec72cfa9b841b86ae8cb9 +Author: Aleksander Morgado +Date: Mon Mar 28 11:30:10 2011 +0200 + + build: require autoconf 2.60 and fix warnings + + AC_GNU_SOURCE is deprecated, AC_USE_SYSTEM_EXTENSIONS (introduced in + autoconf 2.60) should be used instead. + + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 10c981213c152e3c6f049bb9305d21ca09262bc1 +Author: Aleksander Morgado +Date: Mon Apr 4 21:36:34 2011 -0500 + + build: fix automake portability warnings + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dbca0baf853bea1df0723d3c8fb2f94dadf3eb3 +Author: Jason Glasgow +Date: Thu Mar 31 15:29:12 2011 -0500 + + core: make modem StateChanged signal consistent with API documentation + + The new and old state arguments were flipped. + + src/mm-modem.c | 2 +- + src/mm-modem.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 68038cb92627f6ea012ffca6f11ce9279432af07 +Author: Dan Williams +Date: Sun Mar 27 16:03:22 2011 -0500 + + samsung: fix style of samsung_call_control() name + + plugins/mm-modem-samsung-gsm.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 29b7ac3ddb17619a101d8bdb989286e786c3b475 +Author: Dan Williams +Date: Sun Mar 27 16:01:10 2011 -0500 + + samsung: fix up disconnect + + Two issues here, first we dont' need to chain up to the parent + because it's not doing anything we need (it's mainly for PPP-based + devices) and second we need to wait a bit for the disconnect command + to complete by specifying a callback, otherwise the command may get + discarded when the port is shut down afterward. + + plugins/mm-modem-samsung-gsm.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +commit 4b15737f8d3e5f96bc6c59f3735754800bd8b246 +Author: Dan Williams +Date: Sun Mar 27 15:59:27 2011 -0500 + + samsung: streamline enable/init process + + Don't need init retries since the modem seems pretty sane, and we + also don't need to call AT+CFUN=1 twice. Just once should be + fine. We also don't need any "flashing" since the modem doesn't + really do PPP and thus shouldn't need any of the serial port + carrier stuff to get its attention, since we'll never be using + PPP on any of its ports. + + plugins/mm-modem-samsung-gsm.c | 73 + ++++++++++++++++++------------------------ + 1 file changed, 31 insertions(+), 42 deletions(-) + +commit 3593094eb7cf84368abb30d72ab646e3b9018fd7 +Author: Dan Williams +Date: Sun Mar 27 15:47:08 2011 -0500 + + samsung: remove debug code + + plugins/mm-modem-samsung-gsm.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 7daad80242ebd67667c13d7175aedc0bd65fd334 +Author: Dan Williams +Date: Sun Mar 27 15:45:29 2011 -0500 + + samsung: fix access technology detection + + Need to send the MM allowed mode back to the caller, not the + Icera mode. Simple typo in original plugin patch I think. + + plugins/mm-modem-samsung-gsm.c | 27 +++++++++++++-------------- + 1 file changed, 13 insertions(+), 14 deletions(-) + +commit 791677ca400bda6a5e76744ff2c05ebddf4d1641 +Author: Dan Williams +Date: Sun Mar 27 15:41:47 2011 -0500 + + samsung: make a few local functions private + + No need for them to be public as they aren't used anywhere else. + + plugins/mm-modem-samsung-gsm.c | 76 + +++++++++++++++++------------------------- + plugins/mm-modem-samsung-gsm.h | 18 +++------- + 2 files changed, 35 insertions(+), 59 deletions(-) + +commit 9d1c02f55399d2959e25b5f56d60f52a0d8c9545 +Author: Dan Williams +Date: Sun Mar 27 15:26:55 2011 -0500 + + samsung: clean up modem detection + + Use standard vendor/device id detection mechanisms and handle the + net port like other net ports are handled, by just claiming it. Also + reject CDMA modems for now. + + plugins/mm-plugin-samsung.c | 77 + ++++++++++++++++++++------------------------- + 1 file changed, 34 insertions(+), 43 deletions(-) + +commit 35b3e348e66842f02e065b0ccb9c8ef1fd1abb99 +Author: Dan Williams +Date: Sun Mar 27 15:23:44 2011 -0500 + + samsung: drop PORT_TYPE_ECM + + Isn't really needed since it's just the same as any other net + device port type. + + plugins/mm-modem-samsung-gsm.c | 8 ++++---- + src/mm-port.c | 2 -- + src/mm-port.h | 1 - + 3 files changed, 4 insertions(+), 7 deletions(-) + +commit b76889c3585f43868e6de6f71bf6761543105a3f +Author: Dan Williams +Date: Sun Mar 27 15:18:09 2011 -0500 + + samsung: spacing, style, and build fixes + + Clean up the spacing and use more consistent styling. + + plugins/mm-modem-samsung-gsm.c | 68 + +++++++++++++----------------------------- + 1 file changed, 21 insertions(+), 47 deletions(-) + +commit d66bfc7b112e17aa4181f5c7471744c49103212b +Author: Aleksander Morgado +Date: Sun Mar 27 15:15:58 2011 -0500 + + samsung: fix compilation + + plugins/mm-plugin-samsung.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c38da2d2c1019b7130e50a5539a68df8a3e797f0 +Author: Dan Williams +Date: Sat Mar 26 12:28:29 2011 -0500 + + test: add test program to send SIM PIN + + test/Makefile.am | 3 ++- + test/send-pin.py | 65 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 67 insertions(+), 1 deletion(-) + +commit 3568f534c8eb811d58728a6bbebf5644a0802ad5 +Author: Dan Williams +Date: Sat Mar 26 12:20:46 2011 -0500 + + api: clarify SendPin documentation + + introspection/org.freedesktop.ModemManager.Modem.Gsm.Card.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 895aa99e6d34e5218281615726d0ef30f95b4d67 +Author: Elly Jones +Date: Thu Mar 24 12:22:51 2011 -0500 + + zte: fix build dependency race with Icera utils bits + (chromium-os:13398) + + plugins/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit d639155161549662ecd096513784f9b8d80bf7c4 +Author: Dan Williams +Date: Thu Mar 24 11:00:22 2011 -0500 + + qcdm: add standalone autogen and configure + + For building libqcdm separately from ModemManager. + + libqcdm/autogen.sh | 22 ++++++++++++++++++++++ + libqcdm/configure.ac | 48 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + +commit 4ad0c01be02029d8caf62e099ca34cb02e43b83e +Author: Jun Woo Lee +Date: Thu Mar 3 17:10:23 2011 -0500 + + modemmanager: Add support for Samsung Y3300 modem + + BUG=chrome-os-partner:2394 + TEST=gmerge modemmanager, watch logs, see detected as Samsung modem, + connect to AT&T network + + Review URL: http://codereview.chromium.org/6614026 + Patch from Jun Woo Lee . + + Change-Id: I913628ff4a1cd16c8180e3c808644b0134e69e31 + + plugins/Makefile.am | 21 +- + plugins/mm-modem-samsung-gsm.c | 1076 + ++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-samsung-gsm.h | 57 +++ + plugins/mm-plugin-samsung.c | 166 +++++++ + plugins/mm-plugin-samsung.h | 45 ++ + src/mm-port.c | 2 + + src/mm-port.h | 1 + + 7 files changed, 1367 insertions(+), 1 deletion(-) + +commit 0c4b94458ac0a71d278ce1b711a022fdf96b3abf +Author: Dan Williams +Date: Fri Mar 11 21:36:55 2011 -0600 + + gsm: fix for parsing malformed Gobi CREG response + + From an HP un2400; + + GMR: D1020-SUUAASFA-4352 1 [Apr 14 2008 18:00:00] + GMM: 88 + + src/mm-modem-helpers.c | 2 +- + src/tests/test-modem-helpers.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +commit b3b1d5309a4ead90e9a503586b9224d345680d7f +Author: Thomas Bechtold +Date: Fri Mar 11 20:25:22 2011 -0600 + + core: allow plugins to handle custom init responses + + plugins/mm-plugin-zte.c | 2 +- + src/mm-plugin-base.c | 28 +++++++++++++++++++++++++++- + src/mm-plugin-base.h | 10 +++++++++- + 3 files changed, 37 insertions(+), 3 deletions(-) + +commit 971600b9099e5d98c32b28cbb0a5305c48c76728 +Author: Dan Williams +Date: Sat Mar 5 00:04:58 2011 -0600 + + policy: loosen permissions somewhat for reading device info (kde + #266807) (novell #674022) + + policy/org.freedesktop.modem-manager.policy.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 871097327b4b302ce623a32d286fb44716ee4aad +Author: Michael Biebl +Date: Fri Feb 25 18:21:52 2011 -0600 + + logging: use glong for secs and usecs + + src/mm-log.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f340ce86cd92dd5a24fe3b91f6c135030899ee1b +Author: Dan Williams +Date: Fri Feb 25 12:26:30 2011 -0600 + + cdma: ensure the ActivationStateChanged signal exists + + It's part of the D-Bus API, so it needs to be implemented somewhere + even if it's not used yet. + + marshallers/mm-marshal.list | 2 +- + src/mm-modem-cdma.c | 12 ++++++++++++ + 2 files changed, 13 insertions(+), 1 deletion(-) + +commit 7707117862cefc95edaf9010bd2dc0f571825e96 +Author: Dan Williams +Date: Fri Feb 25 11:18:55 2011 -0600 + + log: fix spacing so messages line up + + src/mm-log.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit b0b9ea95cfb582ca5297ec7371c3414c9ee0383d +Author: Dan Williams +Date: Thu Feb 17 15:44:23 2011 -0600 + + simtech: add port tags for SCT U300 (Element Mobile) + + plugins/77-mm-simtech-port-types.rules | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 92e4127c7dc3726e0bdb4beea64246bd7c420d9f +Author: Tom Bechtold +Date: Thu Feb 10 12:07:54 2011 -0600 + + core: allow platform devices without a VID/PID + + Since platform devices don't usually have them. + + src/mm-plugin-base.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 8f223f45f9e0c81fc9267b830c7c05b9aa731f2a +Author: Dan Williams +Date: Tue Feb 1 22:52:34 2011 -0600 + + zte: fix handling of Icera simple connect process + + Yay for GInterface. + + plugins/mm-modem-zte.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit d1f4b07e0effa7f203ea56bd8120839a9d39b992 +Author: Dan Williams +Date: Tue Feb 1 22:48:55 2011 -0600 + + icera: fix username and password ordering for authentication + + plugins/mm-modem-icera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e208c5284672312c39adac70416b03b46a0b98ce +Author: Dan Williams +Date: Tue Feb 1 21:06:23 2011 -0600 + + api: don't install all.xml + + It's not really part of the API. + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 00b6cce4df7d4acbf3e580a03c2f044e18589d2c +Author: Dan Williams +Date: Mon Jan 24 14:36:24 2011 -0600 + + api: fix up StateChanged duplicate reason code + + And add new reason codes to the C headers. + + introspection/org.freedesktop.ModemManager.Modem.xml | 13 ++++--------- + src/mm-modem.h | 4 +++- + 2 files changed, 7 insertions(+), 10 deletions(-) + +commit 245b893e98d0d572f4285ee82cc8e2cb80eddad7 +Author: Dan Williams +Date: Mon Jan 24 14:13:28 2011 -0600 + + logging: make gcc 4.4.3 happy about ignored unused results + + src/mm-log.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 98ec26283a7833affdb2c1ef84ec1697eff7610a +Author: Dan Williams +Date: Mon Jan 24 14:05:07 2011 -0600 + + logging: shut up compiler warnings about unused result from write(2) + + We actually don't care about the result here. But we do in other + places, so we want to keep the warning in general. + + src/mm-log.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e3de8c4a1143815c021887cd825765d3fcbec4e5 +Author: Dan Williams +Date: Mon Jan 24 13:57:22 2011 -0600 + + api: fix up modem state changed reason enum description + + introspection/org.freedesktop.ModemManager.Modem.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2b2ca316a1ef9c9b30e68b44446abfe76cb1bbce +Merge: 12f1b351 f047ca66 +Author: Dan Williams +Date: Mon Jan 24 13:56:40 2011 -0600 + + Merge remote branch 'chromium/to-upstream' + +commit 12f1b351e83730c7d5fa882f0fbbaf4b19816a00 +Author: Dan Williams +Date: Mon Jan 24 12:39:13 2011 -0600 + + rules: blacklist some unlikely USB serial dongles (rh #544121) + + src/77-mm-usb-device-blacklist.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit d909c4876bc6cdc2d783b9641ac30025f89a01b4 +Author: Dan Williams +Date: Mon Jan 24 00:09:55 2011 -0600 + + core: minor code cleanups + + src/mm-modem-base.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +commit 3ee40ddbce7b0d5f5308b67b2d09f7d02c0e54ca +Author: Dan Williams +Date: Mon Jan 24 00:05:20 2011 -0600 + + core: add logging when ports get removed + + src/mm-manager.c | 6 ++++-- + src/mm-modem-base.c | 26 +++++++++++++++++++++++++- + 2 files changed, 29 insertions(+), 3 deletions(-) + +commit 44c11adadc8cb436c23eda67d2d2509550998487 +Author: Dan Williams +Date: Mon Jan 24 00:05:08 2011 -0600 + + core: add mm_port_subsys_to_name() + + src/mm-port.c | 14 ++++++++++++++ + src/mm-port.h | 2 ++ + 2 files changed, 16 insertions(+) + +commit 476cc44bc1c991b9ad940d1de9cb42baf93555ab +Author: Dan Williams +Date: Sun Jan 23 23:36:52 2011 -0600 + + gsm: enable unsolicited codes on secondary ports too (bgo #637140) + + We want to enable unsolicited responses on secondary ports too, + so that if the modem only sends unsolicited responses on the ports + on which they were enabled, that we can get resposnes off the + secondary port when the primary port is connected. But we can't + always trust devices to actually send them on the secondary port, + so we enable the unsolicited responses on both the primary and + secondary ports just in case. + + src/mm-generic-gsm.c | 106 + +++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 95 insertions(+), 11 deletions(-) + +commit 6f08206ac88ccd760afff38f096b1f8a0d51270f +Author: Dan Williams +Date: Sun Jan 23 23:21:58 2011 -0600 + + core: enable timestamps with legacy --debug option + + src/main.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 16039244bb08cb4f62754c710be2052eaef32549 +Author: Dan Williams +Date: Sun Jan 23 20:51:48 2011 -0600 + + core: rework logging + + Make it more flexible, add logging to a file, and absolute and + relative timestamps. + + plugins/mm-modem-anydata-cdma.c | 9 +- + plugins/mm-modem-huawei-cdma.c | 7 +- + plugins/mm-modem-huawei-gsm.c | 17 ++- + plugins/mm-modem-icera.c | 5 +- + plugins/mm-modem-mbm.c | 17 +-- + plugins/mm-plugin-generic.c | 9 +- + plugins/mm-plugin-huawei.c | 9 +- + plugins/mm-plugin-mbm.c | 2 +- + src/Makefile.am | 4 +- + src/main.c | 118 ++++++++----------- + src/mm-at-serial-port.c | 10 +- + src/mm-generic-cdma.c | 7 +- + src/mm-generic-gsm.c | 86 +++++--------- + src/mm-log.c | 227 + +++++++++++++++++++++++++++++++++++++ + src/mm-log.h | 61 ++++++++++ + src/mm-manager.c | 82 +++++++------- + src/mm-modem-base.c | 35 +++--- + src/mm-modem-helpers.c | 26 ++--- + src/mm-modem-helpers.h | 3 +- + src/mm-modem.c | 22 +--- + src/mm-options.c | 55 --------- + src/mm-options.h | 23 ---- + src/mm-plugin-base.c | 7 +- + src/mm-port.c | 16 +-- + src/mm-properties-changed-signal.c | 9 +- + src/mm-qcdm-serial-port.c | 10 +- + src/mm-serial-parsers.c | 5 +- + src/mm-serial-port.c | 50 +++----- + src/tests/test-modem-helpers.c | 13 ++- + src/tests/test-qcdm-serial-port.c | 11 +- + 30 files changed, 539 insertions(+), 416 deletions(-) + +commit f85b014d843ecb2259e9b2e21f44c24ff8ff5fdf +Author: Dan Williams +Date: Sun Jan 23 20:42:32 2011 -0600 + + build: fix distcheck + + plugins/Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit ef8d2263018c7f4ec5ee26a1f8d690d89443c9a6 +Author: Dan Williams +Date: Sun Jan 23 18:14:55 2011 -0600 + + qcdm: add some missing system modes + + libqcdm/src/commands.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit f69d888bae672d69b36f65d6c72397740dbd6ac8 +Author: Dan Williams +Date: Fri Jan 21 00:28:17 2011 -0600 + + qcdm: add call manager subsystem mode define for LTE + + Seen on the Pantech UML290 and another Qualcomm-based LTE device. + + libqcdm/src/commands.h | 3 ++- + libqcdm/tests/test-qcdm-com.c | 3 +++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 7613b46b5009b15efeeced5d0df043576beafbf8 +Author: Guido Günther +Date: Fri Jan 14 12:56:24 2011 -0600 + + test: handle cancel and distinguish between initiate and respond + (bgo #638038) + + test/ussd.py | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +commit d44ae44558b9d1da289372e8593263c7d2b025c8 +Author: Guido Günther +Date: Fri Jan 14 12:25:05 2011 -0600 + + gsm: wire up USSD Respond function (bgo #638038) + + src/mm-generic-gsm.c | 68 ++++++++++++++++++++++++++++++++++--------- + src/mm-modem-gsm-ussd.c | 77 + ++++++++++++++++++++++++++++++++++++++++++------- + src/mm-modem-gsm-ussd.h | 10 +++++++ + 3 files changed, 132 insertions(+), 23 deletions(-) + +commit 807120996f2eb9e3ddcac5ba6f9826feac440175 +Author: Guido Günther +Date: Fri Jan 14 12:22:57 2011 -0600 + + api: add reply parameter to USSD Respond method (bgo #638038) + + The network will usually send back the new sub menu to pick from. + + introspection/org.freedesktop.ModemManager.Modem.Gsm.Ussd.xml | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit d908389aff85a77757d3a86f0be6b47535991e3c +Author: Dan Williams +Date: Fri Jan 14 12:17:02 2011 -0600 + + core: add modem reset/power-cycle command + + Based on a patch by Elly Jones from Google. + + .../org.freedesktop.ModemManager.Modem.xml | 13 +++++- + plugins/mm-modem-anydata-cdma.c | 19 ++++++++ + plugins/mm-modem-mbm.c | 19 ++++++++ + src/mm-modem.c | 51 + ++++++++++++++++++++++ + src/mm-modem.h | 8 ++++ + 5 files changed, 109 insertions(+), 1 deletion(-) + +commit 12b144e120b7a275f4b1ffe5a51fc772304f4fa1 +Author: Dan Williams +Date: Wed Jan 12 15:30:23 2011 -0600 + + zte: add more ZTE port tags (LW272, others) + + plugins/77-mm-zte-port-types.rules | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit f4d4569cdd4441ea210297cf1ed14b8e7e77fd34 +Author: Michał Sroczyński +Date: Tue Jan 11 13:41:53 2011 -0600 + + gsm: correctly parse Samsung S8500 Wave CREG response + + (testcases by dcbw) + + src/mm-modem-helpers.c | 14 +++++++++++++- + src/tests/test-modem-helpers.c | 11 +++++++++++ + 2 files changed, 24 insertions(+), 1 deletion(-) + +commit 7a2031613aa2405c9414ff1f3a4d3d18362d4a52 +Author: Dan Williams +Date: Thu Jan 6 22:01:45 2011 -0600 + + qcdm: add HDR revision preference + + Not sure if that's exactly what the NV item is, but the UML290 uses + it for Rev0, RevA, and eHRPD preference. + + libqcdm/src/commands.c | 101 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 28 ++++++++++++ + libqcdm/src/nv-items.h | 20 +++++++-- + libqcdm/tests/test-qcdm-com.c | 56 +++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 205 insertions(+), 3 deletions(-) + +commit d19e55bb8ff2b3eb2ff03f5a57b62ec32cbe53f7 +Author: Dan Williams +Date: Thu Jan 6 00:48:54 2011 -0600 + + qcdm: add NV mode pref values for 1X/HDR Only, LTE Only, and + 1X/HDR/LTE Only + + Based on responses from Pantech UML290. + + libqcdm/src/nv-items.h | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 794353ebccb04ec00d87820d68e2d25c04d45d3e +Author: Dan Williams +Date: Wed Jan 5 11:12:08 2011 -0600 + + cdma: update reg state to HOME based on SPERI response + + If the SPERI response indicates the home network, then set + CDMA registration to HOME if it was REGISTERED (which is + less specific). + + src/mm-generic-cdma.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +commit 6c56db07fc3439f54ce6606e14be8963c62f12cc +Author: Dan Williams +Date: Tue Jan 4 17:21:41 2011 -0600 + + cdma: fix segfault by handling MEID property + + Also, MEID->Meid to follow standard D-Bus property semantics. + + introspection/org.freedesktop.ModemManager.Modem.Cdma.xml | 2 +- + src/mm-generic-cdma.c | 9 +++++++++ + src/mm-modem-cdma.c | 9 +++++++++ + src/mm-modem-cdma.h | 8 ++++++++ + 4 files changed, 27 insertions(+), 1 deletion(-) + +commit b0cd9288c260a821003a6259c78397d3ab7846a1 +Author: Dan Williams +Date: Tue Jan 4 14:06:03 2011 -0600 + + cdma: fix CDMA registration state retrieval on single AT port devices + + If the device only has one AT port that's being used for data and + thus we can't do more specific registration checking in MMGenericCdma + using AT commands, but generic registration checking was successful, + just use the less specific state. + + Previously, an error would be returned when no AT port was available + even though less specific QCDM registration checking worked. That + was just stupid. + + src/mm-generic-cdma.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 63cb7f29a97719acd0810b42b42e09dbab461284 +Author: Dan Williams +Date: Mon Jan 3 14:42:44 2011 -0600 + + huawei: quiet annoying log message + + plugins/mm-modem-huawei-gsm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 9733746dc10e1cf5d4929258aae6ab405b2f79cd +Author: Dan Williams +Date: Sat Jan 1 18:11:14 2011 -0600 + + icera: add complete support for generic Icera devices + + Implement connect, disconnect, and IP4 config stuff. + + Also fix handling of Icera private data. After creation we + need to use MM_MODEM_ICERA_GET_INTERFACE(m)->priv to get the + private data instead of just dereferencing the MMModemIcera, + for reasons that I don't know. If this isn't done, data + gets silently corrupted because writes to the private data + are going into a random location in the object. This a + side-effect of the slightly hack-ish way that MMModemIcera + is a GInterface with private data. + + plugins/mm-modem-icera.c | 516 + +++++++++++++++++++++++++++++++++++++++++++---- + plugins/mm-modem-icera.h | 26 ++- + plugins/mm-modem-zte.c | 94 ++++++++- + 3 files changed, 595 insertions(+), 41 deletions(-) + +commit ceb5cc29d6be2133c5e6ff428477e8da0422e8a2 +Author: Dan Williams +Date: Sat Jan 1 17:47:40 2011 -0600 + + core: signal property changes for IpMethod + + If the modem's IP Method changes after construction because the + modem's full capabilities were only discovered after it was created, + make sure the change notification gets emitted. + + src/mm-modem-base.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit af9adab9cd6a4f8455d5a32fd232ede011a94713 +Author: Dan Williams +Date: Sat Jan 1 14:12:07 2011 -0600 + + icera: convert to GInterface + + We'll need to store some private data later for authentication, and + this makes it easier and clearer to access that private data. + + plugins/Makefile.am | 4 +- + plugins/{mm-icera-utils.c => mm-modem-icera.c} | 119 + +++++++++++++++++-------- + plugins/{mm-icera-utils.h => mm-modem-icera.h} | 38 ++++++-- + plugins/mm-modem-zte.c | 29 ++++-- + 4 files changed, 134 insertions(+), 56 deletions(-) + +commit b8a74490b23ee51f17fc994b78650b4daea29ff7 +Author: Dan Williams +Date: Sat Jan 1 13:41:22 2011 -0600 + + zte: Icera devices use static IP configuration + + plugins/mm-modem-zte.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 9d777763a28dad942d56127a5431b6f61cd4955d +Author: Dan Williams +Date: Sat Jan 1 12:23:14 2011 -0600 + + icera: consolidate Icera check code into utility lib + + plugins/mm-icera-utils.c | 33 +++++++++++++++++++++++++++++++++ + plugins/mm-icera-utils.h | 4 ++++ + plugins/mm-modem-zte.c | 13 +++++++------ + 3 files changed, 44 insertions(+), 6 deletions(-) + +commit f84958933bb333394ff159778507cb53fb7f8c43 +Author: Dan Williams +Date: Sat Jan 1 12:08:46 2011 -0600 + + icera: move Icera utils into standalone utility library + + plugins/Makefile.am | 22 +++++++++++ + .../{mm-modem-icera-utils.c => mm-icera-utils.c} | 43 + +++++++++++++-------- + plugins/mm-icera-utils.h | 45 + ++++++++++++++++++++++ + plugins/mm-modem-zte.c | 15 ++++---- + 4 files changed, 100 insertions(+), 25 deletions(-) + +commit a502fd2b19551ce2c1e3cd82bca01de27f123ca5 +Author: Dan Williams +Date: Sat Jan 1 11:55:41 2011 -0600 + + gsm: add access technology support for HSPA+ + + .../org.freedesktop.ModemManager.Modem.Gsm.xml | 3 + + plugins/mm-modem-huawei-gsm.c | 68 + ++++++++++++---------- + src/mm-modem-gsm-network.c | 2 + + src/mm-modem-gsm.h | 3 +- + src/mm-modem-helpers.c | 4 +- + 5 files changed, 46 insertions(+), 34 deletions(-) + +commit 657e5ac7f6b84e0965f4a39c298daf3744368ee9 +Author: Dan Williams +Date: Fri Dec 31 00:30:47 2010 -0600 + + zte: partially support Icera-based devices like T-Mobile Rocket 2 + + plugins/Makefile.am | 3 +- + plugins/mm-modem-icera-utils.c | 256 + +++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-zte.c | 89 ++++++++++++-- + 3 files changed, 340 insertions(+), 8 deletions(-) + +commit adcc29fa6b62a86eb8d595a2836c3ea833b86af9 +Author: Dan Williams +Date: Thu Dec 30 16:43:04 2010 -0600 + + zte: really shut the device up + + The MF691 appears to ignore E0 on the same line as some other stuff, + so really shut it up by sending E0 by itself. + + plugins/mm-modem-zte.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 05d4876b20a6fa03421c77de53b74d1b81e5ea5f +Author: Dan Williams +Date: Thu Dec 30 16:36:47 2010 -0600 + + zte: add support for pseudo-ethernet data ports + + plugins/mm-plugin-zte.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +commit 36c87991c38188eefc184ee4780cac3517502840 +Author: Dan Williams +Date: Tue Dec 21 11:55:25 2010 -0600 + + build: fix distcheck after introspection XML renames + + Makefile.am | 1 + + introspection/Makefile.am | 26 +++++++++++++------------- + 2 files changed, 14 insertions(+), 13 deletions(-) + +commit 292c98029dd6107de2c5f592eac256c512764688 +Author: Dan Williams +Date: Tue Dec 21 11:54:47 2010 -0600 + + test: fix CIND test index checking + + CIND indexes returned from helper are 1-based, not 0-based, because + that makes it easier to match against the modem's unsolicited CIND + message. + + src/tests/test-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f047ca66a4c58bdfa69ce70026fc840d58a80ebe +Author: Elly Jones +Date: Wed Sep 15 13:22:25 2010 -0400 + + modemmanager: Add a reason to ConnectionStateChanged events. + + This can be used by a connection manager to decide to respond in a + different way + to certain kinds of disconnects (e.g. intentional versus unintentional + versus + suspension). + + TEST=None + This change introduces no additional code, so testing it in isolation + is not + possible. + + BUG=chromium-os:6744 + + Change-Id: Ie371e20ec7a003333eba013af3ad61c0e494a4ad + Signed-Off-By: Elly Jones + + Review URL: http://codereview.chromium.org/3413011 + (cherry picked from commit 29a9674b818fd64c19bad84f526f6fa68edec174) + + .../org.freedesktop.ModemManager.Modem.xml | 24 + ++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +commit d4b2be5f6b1a2e4e203dc6038bf31e63e4d80670 +Author: David Rochberg +Date: Mon Oct 11 17:14:32 2010 -0400 + + Replace ActivationCompleted with ActivationStateChanged, add CDMA + error enums. + + BUG=6885 + TEST=mm-modem.h is correct, cromo compiles + + Change-Id: I2b6a49bda5a6ff7bf6e4aac2e99914bf3c33c732 + + Review URL: http://codereview.chromium.org/3705001 + + Review URL: http://codereview.chromium.org/3702006 + + .../org.freedesktop.ModemManager.Modem.Cdma.xml | 79 + +++++++++++++++++++++- + 1 file changed, 77 insertions(+), 2 deletions(-) + +commit eb90498efdcf1cbb9a8ebab606b945263f25b6ce +Author: Elly Jones +Date: Mon Dec 20 14:51:39 2010 -0500 + + Add CDMA Activate and ActivateManual methods. + + BUG=6885 + TEST=built modemmanager and cromo + + Change-Id: Ib73a093b13da05948a2f1da8f051fe7c55682584 + + Review URL: http://codereview.chromium.org/3517013 + (cherry picked from commit f447c8e1a0062500e1171e031cf4c8fef76ffd59) + + Conflicts: + + src/mm-modem-cdma.c + + .../org.freedesktop.ModemManager.Modem.Cdma.xml | 28 +++++++++++++++++ + src/mm-modem-cdma.c | 35 + ++++++++++++++++++++++ + src/mm-modem-cdma.h | 18 +++++++++++ + 3 files changed, 81 insertions(+) + +commit b19b25f324eff63e63638c26210d3108308bbaf9 +Author: David Rochberg +Date: Mon Oct 4 09:35:25 2010 -0400 + + Add enums for activation state + + BUG=6885 + TEST=inspect mm-modem.h, build cromo et al against new mm-modem.h + + Change-Id: Id8c849b6cffbadb9d5d2aa4109257eb747cf9bb5 + + Review URL: http://codereview.chromium.org/3616004 + (cherry picked from commit 3a50b8c28d155060ce035a1c6d5eadf3d91297a5) + + introspection/org.freedesktop.ModemManager.Modem.Cdma.xml | 14 + ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 60725028affaa7405d022de8fe0dee7ad16f1a44 +Author: Elly Jones +Date: Mon Dec 20 14:40:35 2010 -0500 + + Add State property and StateChanged signal. + + Change-Id: I74451404361aa8bcc33ad0e66cbd5c6208222496 + + .../org.freedesktop.ModemManager.Modem.xml | 30 + ++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 74b49b8b4d7d87a5fcd871662c600a7c4cc10620 +Author: Eric Shienbrood +Date: Thu Aug 19 16:51:20 2010 -0400 + + Added MEID property to org.freedesktop.ModemManager.Cdma interface. + + BUG=chromium-os:4560 + TEST=tested using modified flimflam and cromo + + Change-Id: I385abf8df340c26259810ea44c43680cc420c015 + + Review URL: http://codereview.chromium.org/3136020 + + introspection/org.freedesktop.ModemManager.Modem.Cdma.xml | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 12600464e3e77e2eba3ba6997bb41d3df5ff6bc5 +Author: Elly Jones +Date: Mon Dec 20 13:26:41 2010 -0500 + + Fix include paths in introspection XML. + + Change-Id: I3af3ac8f60009f25b365c424d93258ded16f9212 + + introspection/all.xml | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit ac5f135a4ac9b0954d2142dd2f047bdcfe0fa8c9 +Author: Elly Jones +Date: Mon Dec 20 13:08:27 2010 -0500 + + Add org.freedesktop.ModemManager.Modem.Cdma.xml. + + Mea culpa. I moved it with 'mv', not 'git mv', thus resulting in + total loss. + + Change-Id: I94edfb9ca3b09d7956eea08971090ee022700d4d + + .../org.freedesktop.ModemManager.Modem.Cdma.xml | 97 + ++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + +commit 6c758103200c7a7c7634c637e516a2d4af766a3a +Author: Eric Shienbrood +Date: Thu Jun 17 10:28:02 2010 -0400 + + Clean up white space in the generated header file. + + Also, include the interface name in the method and signal names, to + avoid name collisions. I have corresponding changes in the flimflam + modemmgr plugin to accomodate the new names. + + For a sample of the output, see ~ers/mm-modem.h + + Review URL: http://codereview.chromium.org/2852010 + (cherry picked from commit f9dbea25b8ba4414c77d6dfc94545bf7b5c26e68) + + header-generator.xsl | 96 + ++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 63 insertions(+), 33 deletions(-) + +commit 48169926f47377c2a9a2201cd77294dff4876e28 +Author: Elly Jones +Date: Mon Dec 20 12:41:03 2010 -0500 + + Don't probe virtual devices before they exist + + Prevent ModemManager from probing virtual devices before their + associated files exist in /dev tree. + + Contributed by Nasser Grainawi + + Review URL: http://codereview.chromium.org/2118005 + (cherry picked from commit 617660e3572a7b79ed83f9fc0fda89b7efcb2d4d) + + Conflicts: + + src/mm-plugin-base.c + + Change-Id: Ie5e8b98fb6b6c69e294175523ef99c934092433b + + src/mm-plugin-base.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit 575ba873380af798225d732779ca581936b8adeb +Author: Jason Glasgow +Date: Wed Apr 14 15:54:22 2010 -0400 + + Add signals to generated header file + + Review URL: http://codereview.chromium.org/1508036 + (cherry picked from commit f3432ada6bf8cd55f9dbdf050d510c53ce9f6687) + + header-generator.xsl | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 245818de331608a10c2279a56c5feba86aa1a1ea +Author: Elly Jones +Date: Mon Dec 20 12:23:41 2010 -0500 + + Install xml files so they can be used by cromo (chromeos modem + manager) + + Amended: Install the files under their proper DBus names. + + Review URL: http://codereview.chromium.org/1618004 + (cherry picked from commit 89f7f05f1294485fa8b44cfdd3c9b0d924d45ac1) + + Conflicts: + + Makefile.am + + Change-Id: I65b2b0c1b5e579bb5b1d5d5b390c3be2ae49543c + + introspection/all.xml | 26 +++--- + introspection/mm-modem-cdma.xml | 97 + ---------------------- + ...ged.xml => org.freedesktop.DBus.Properties.xml} | 0 + ...rg.freedesktop.ModemManager.Modem.Gsm.Card.xml} | 0 + ...reedesktop.ModemManager.Modem.Gsm.Contacts.xml} | 0 + ...org.freedesktop.ModemManager.Modem.Gsm.Hso.xml} | 0 + ...freedesktop.ModemManager.Modem.Gsm.Network.xml} | 0 + ...org.freedesktop.ModemManager.Modem.Gsm.SMS.xml} | 0 + ...rg.freedesktop.ModemManager.Modem.Gsm.Ussd.xml} | 0 + ... => org.freedesktop.ModemManager.Modem.Gsm.xml} | 0 + ...rg.freedesktop.ModemManager.Modem.Location.xml} | 0 + ... org.freedesktop.ModemManager.Modem.Simple.xml} | 0 + ....xml => org.freedesktop.ModemManager.Modem.xml} | 0 + ...anager.xml => org.freedesktop.ModemManager.xml} | 0 + plugins/Makefile.am | 2 +- + src/Makefile.am | 20 ++--- + 16 files changed, 24 insertions(+), 121 deletions(-) + +commit 241bef544d45eded170ce8bfb94923bab9993720 +Author: Jason Glasgow +Date: Wed Apr 7 18:24:01 2010 -0400 + + Install xml introspection files for DBus interfaces. + + Review URL: http://codereview.chromium.org/1618004 + + Change-Id: Ib362c3dcdeb91472a64cf9edb6b4e0ddbcffe93a + + Makefile.am | 5 ++++- + introspection/mm-modem-cdma.xml | 4 ++-- + 2 files changed, 6 insertions(+), 3 deletions(-) + +commit 33c991f3adb1e4ad8339371331f8adbefe0c8521 +Author: Jason Glasgow +Date: Fri Mar 26 13:25:01 2010 -0400 + + Generate a header file for ModemManager + + Generate a header file for ModemManager with service names and paths, + method names and enums. + + Review URL: http://codereview.chromium.org/1409001 + + Makefile.am | 15 +++- + header-generator.xsl | 204 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 216 insertions(+), 3 deletions(-) + +commit d32eeec9eaeddb1e560499a1a1afda956b3a1114 +Author: Elly Jones +Date: Mon Dec 20 11:05:49 2010 -0500 + + Update from Qualcomm to support smd devices in Modem Manager + + Review URL: http://codereview.chromium.org/661471 + (cherry picked from commit 8475eb44b7ea41afa823919b017a39d82b07a5a2) + + Conflicts: + + src/mm-plugin-base.c + + Change-Id: I825886cad62a27acb39dfe74da7028d83adf692a + + src/mm-plugin-base.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 00b0b70f5dd7e6896cc533e7ac3e9584467858e6 +Author: Dan Williams +Date: Sun Dec 19 15:18:12 2010 -0600 + + bluetooth: tag 'moved' bluetooth ttys as candidates + + The kernel appears to add the device first without any parents, + then to move it to the correct place in the hierarchy, with its + immediate parent being the device's HCI controller. So we need + to capture the 'move' event too since that's when the rfcomm + device is finally usable. + + src/80-mm-candidate.rules | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit a4e620aca0a13b6630b587bc6ed21ec2454e86ec +Author: Dan Williams +Date: Sun Dec 19 15:07:56 2010 -0600 + + bluetooth: ensure bluetooth rfcomm devices get tagged as candidates + + src/80-mm-candidate.rules | 1 + + 1 file changed, 1 insertion(+) + +commit d2ce75b57a27a9feaddb25558e62ae7162ef7f9f +Author: Dan Williams +Date: Fri Dec 17 16:27:55 2010 -0600 + + core: separate PropertiesChanged signal XML + + Which requires that we turn it into a GInterface that MMModemBase + can implement, because dbus-glib does not allow attaching more + than one introspection glue structure to an object at a time. + + Also implement the standard D-Bus properties changed signal. + + introspection/Makefile.am | 3 +- + introspection/all.xml | 1 + + introspection/mm-modem.xml | 18 ------- + introspection/mm-properties-changed.xml | 45 +++++++++++++++++ + marshallers/mm-marshal.list | 1 + + src/Makefile.am | 6 ++- + src/mm-modem-base.c | 11 ++++- + src/mm-properties-changed-signal.c | 86 + ++++++++++++++++++++++++++------- + src/mm-properties-changed-signal.h | 13 ++++- + 9 files changed, 144 insertions(+), 40 deletions(-) + +commit 592d71ff76318b6389f6866d5394a844c7e35513 +Author: Dan Williams +Date: Wed Dec 8 17:04:59 2010 -0600 + + core: work around udev parallel startup race + + Ignore devices that aren't completely configured by udev yet. If + ModemManager is started in parallel with udev, explicitly requesting + devices may return devices for which not all udev rules have yet been + applied (a bug in udev/gudev). Since we often need those rules + to match + the device to a specific ModemManager driver, we need to ensure + that all + rules have been processed before handling a device. + + Do this by adding an item to the environment of each device that MM + might possibly be interested in, and ignoring devices that don't + have that. When the device is fully processed by udev, MM will get + an 'add' event and the device will have all rules applied. + + src/80-mm-candidate.rules | 16 ++++++++++++++++ + src/Makefile.am | 3 ++- + src/mm-manager.c | 13 ++++++++++++- + 3 files changed, 30 insertions(+), 2 deletions(-) + +commit 067490960a65781029e5c931a28d1f7497cc9b1e +Author: Amit Mendapara +Date: Wed Dec 8 11:05:28 2010 -0600 + + linktop: add plugin for Linktop/Teracom LW273 (bgo #636438) + + plugins/Makefile.am | 20 ++++- + plugins/mm-modem-linktop.c | 208 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-linktop.h | 45 ++++++++++ + plugins/mm-plugin-linktop.c | 164 ++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-linktop.h | 41 +++++++++ + 5 files changed, 477 insertions(+), 1 deletion(-) + +commit 26b96c515db5f8c65bd396785f3742465518b3cb +Author: Torgny Johansson +Date: Mon Dec 6 12:42:05 2010 -0600 + + mbm: add more MBM device IDs + + plugins/77-mm-ericsson-mbm.rules | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit b1e1668119905e077f82a1aa4346f69db4d41268 +Author: Dan Williams +Date: Thu Dec 2 11:31:09 2010 -0600 + + mbm: add tags for SonyEricsson MD400G + + Thanks to Niall Parker + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit ea0797cbec7cae4d93807e8ac3a796650ff209a9 +Author: Dan Williams +Date: Mon Nov 29 16:49:30 2010 -0600 + + gsm: prefer AT+CIND signal quality for modems that support it + (lp:682282) (bgo #636040) + + Some devices always reply with 99 for AT+CSQ when in UMTS mode + (Linktop LW273) + so if the modem supports it, use CIND/CIEV instead. + + src/mm-generic-gsm.c | 112 + ++++++++++++----------------------------- + src/mm-modem-helpers.c | 80 ++++++++++++++++++++++++++--- + src/mm-modem-helpers.h | 12 +++-- + src/tests/test-modem-helpers.c | 2 +- + 4 files changed, 115 insertions(+), 91 deletions(-) + +commit 586c9ec2c5ab66c16b934ef5f0b9b6803904ea84 +Author: Dan Williams +Date: Mon Nov 29 12:01:42 2010 -0600 + + gsm: don't poll signal quality if it was recently updated + + src/mm-generic-gsm.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit a00966d4aa0973aef9a520b966d6c5a93d094053 +Author: Dan Williams +Date: Mon Nov 29 11:50:55 2010 -0600 + + huawei: don't spam syslog with tx/rx stats (lp:673457) + + plugins/mm-modem-huawei-gsm.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 1df1ff38b0ad93d80647895115251033ffc38e65 +Author: Dan Williams +Date: Mon Nov 29 00:45:58 2010 -0600 + + sierra: support pseduo-ethernet interface on GSM devices + + Requires the sierra_net driver, which is included in the + 2.6.34 and later kernels. + + NEWS | 1 + + plugins/mm-modem-sierra-gsm.c | 182 + +++++++++++++++++++++++++++++++++++++++--- + plugins/mm-plugin-sierra.c | 36 ++++++--- + 3 files changed, 196 insertions(+), 23 deletions(-) + +commit 5419f1f1954a371e030a3e146628cf501a0ed64e +Author: Dan Williams +Date: Mon Nov 29 00:21:44 2010 -0600 + + core: allow setting IP method after construction + + Some modems might not know their IP method until after the + modem object has been created. + + src/mm-modem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c1232e2534334cacc929733e4d206f3deba5c545 +Author: Dan Williams +Date: Sun Nov 28 23:10:27 2010 -0600 + + serial: print debug data unsigned + + src/mm-at-serial-port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 888351f2a6f496cfb42c14184ded0adbae246ffb +Author: Dan Williams +Date: Sun Nov 28 22:50:22 2010 -0600 + + release: update NEWS file + + NEWS | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit dc95f531adc38166cb4ec0ec08e40527dd04385a +Author: Dan Williams +Date: Sun Nov 28 22:46:03 2010 -0600 + + gsm: query signal strength with +CIND if modem does not support +CSQ + (lp:682282) + + plugins/mm-modem-mbm.c | 32 +-------- + src/mm-generic-gsm.c | 188 + ++++++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 186 insertions(+), 34 deletions(-) + +commit 6d37c9b471a0813d18fec69f2c090434238a480e +Author: Dan Williams +Date: Sun Nov 28 21:46:27 2010 -0600 + + core: +CIND indexes start at 1 + + src/mm-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dd59c3dddb21eb5ca882735c5df6fce79802c4f +Author: Dan Williams +Date: Sun Nov 28 21:34:00 2010 -0600 + + core: add index to CIND helper + + src/mm-modem-helpers.c | 20 ++++++++++++++++---- + src/mm-modem-helpers.h | 9 +++++---- + src/tests/test-modem-helpers.c | 8 ++++---- + 3 files changed, 25 insertions(+), 12 deletions(-) + +commit 9479c04aec1504f775d7a940698fcaf4eb78b8b9 +Author: Dan Williams +Date: Sun Nov 28 19:45:53 2010 -0600 + + core: add +CIND parsing helpers + + src/mm-modem-helpers.c | 123 + +++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 6 ++ + src/tests/test-modem-helpers.c | 75 +++++++++++++++++++++++++ + 3 files changed, 204 insertions(+) + +commit 5b34f40d1da7eeb1fcb3662a0c0d039a835204be +Author: Dan Williams +Date: Tue Nov 23 16:17:12 2010 -0600 + + docs: bump doc version to current MM prerelease version + + introspection/all.xml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 71eeae01a76e0a2b45eb2e1bdc3639900021c7f3 +Author: Torgny Johansson +Date: Fri Nov 19 16:20:27 2010 -0600 + + mbm: add USB IDs for F5521gw + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 802a6f3a564d981f06042af0a3f36212805f599f +Author: Dan Williams +Date: Wed Nov 10 13:16:19 2010 -0600 + + gsm: fix up CID signed/unsigned confusion + + -1 = no APN set, so use modem default. We'll have to fix a few + more things up for modems like hso/mbm that don't use ATDT and + require CIDs, but this gets us halfway there for other devices. + + plugins/mm-modem-hso.c | 2 +- + plugins/mm-modem-mbm.c | 5 +---- + src/mm-generic-gsm.c | 2 +- + 3 files changed, 3 insertions(+), 6 deletions(-) + +commit bda86f553aefadb18a3dfa5795f1345c40a19738 +Author: Dan Williams +Date: Tue Nov 9 08:46:27 2010 -0600 + + mbm: fix handling of unsolicited CIEV response + + Rob McQueen saw a 10 here, which means SMS full. Handle that. + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d2ab1d7f781acaa542cd763215be5bcf752be1eb +Author: Dan Williams +Date: Mon Nov 8 10:24:26 2010 -0600 + + gsm: fix up USSD property exports + + If the base class advertises that it implements an interface, it + really does need to implement all that interface's properties too. + Otherwise dbus-glib gets mad and can't look up the property + information + for D-Bus Introspection. + + src/mm-generic-gsm.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 3c13d9aec86a310f7ac9ed2fef58500d5a3a720a +Author: Guido Günther +Date: Fri Nov 5 14:50:50 2010 -0500 + + gsm: add preliminary USSD support (bgo #590798) + + We currently convert to and from the modem's set charset and + always pass + '15' as the data coding scheme. Passing the correct data coding scheme + as third argument to CUSD only upsets the network. This contradicts + 3GPP + TS 23.038. Other tools like gsm-ussd handle it the same way. + + Network responses that require further actions are not yet + implemented. + + (some fixes and cleanups by Dan Williams) + + policy/org.freedesktop.modem-manager.policy.in | 9 + + src/Makefile.am | 8 +- + src/mm-auth-provider.h | 1 + + src/mm-generic-gsm.c | 233 +++++++++++++++++- + src/mm-generic-gsm.h | 3 + + src/mm-modem-gsm-ussd.c | 321 + +++++++++++++++++++++++++ + src/mm-modem-gsm-ussd.h | 65 +++++ + test/ussd.py | 27 +++ + 8 files changed, 665 insertions(+), 2 deletions(-) + +commit 2a98b2ae2d2541e78fad4d931a84094f3b00773a +Author: Dan Williams +Date: Fri Nov 5 14:44:20 2010 -0500 + + core: add bin -> hex string converter + + src/mm-utils.c | 14 ++++++++++++++ + src/mm-utils.h | 2 ++ + 2 files changed, 16 insertions(+) + +commit 6921a9f71d7d6b4cc60f7fa776d62ef8f814ec76 +Author: Dan Williams +Date: Fri Nov 5 14:03:44 2010 -0500 + + core: unconditionally enable the Location Services API + + This required dbus-glib 0.86 or later, which was released 2010-03-24. + + configure.ac | 14 +------------- + src/Makefile.am | 12 +++--------- + src/mm-generic-gsm.c | 33 --------------------------------- + src/mm-generic-gsm.h | 2 -- + 4 files changed, 4 insertions(+), 57 deletions(-) + +commit a2d54b1437ae3374b7c046d28186831051e44652 +Author: Dan Williams +Date: Wed Nov 3 10:03:51 2010 -0500 + + trivial: avoid build warning by using g_message() correctly + + src/tests/test-modem-helpers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d63dcd682d3449b021f205af67dd0071e91cc56f +Author: Dan Williams +Date: Sat Oct 30 12:31:08 2010 -0500 + + sierra: check for PS attach before dialing + + Some devices (8775 specifically) get angry if you don't check for + a PS attach before dialing. The next time they try to connect, + they'll continuously report "searching" as the registration status + and return CME ERROR 30 (No Network Service) for lots of requests. + So initiate a PS attach (which should return OK if the modem is + already attached) before dialing, and if that fails cancel the + dial attempt. + + See + http://mail.gnome.org/archives/networkmanager-list/2010-October/msg00072.html + + "I talked about this problem with a contact at SierraWireless. He + said that + a firmware upgrade will not help in this case. But what can help + is checking + for PS attach and dial only if PS attach status is attached. Dialing + without + PS attach can bring modem into unwanted condition that sometimes + restart is + needed to recover." + + plugins/mm-modem-sierra-gsm.c | 59 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 59 insertions(+) + +commit 7f7f03a662946a10b45e5ab3c3eae2568fcb01f9 +Author: Dan Williams +Date: Wed Oct 27 10:02:23 2010 -0500 + + release: update NEWS with changed stuff since 0.4 + + NEWS | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 610a907d5cf222fc69476f1cd059eb22e1c1a32a +Author: Dan Williams +Date: Mon Oct 25 21:18:10 2010 -0500 + + gsm: retry SIM ID if we didn't get it before card was enabled + + src/mm-generic-gsm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6f809b589bd8619bf2d0659581389ac3c135d08b +Author: Dan Williams +Date: Mon Oct 25 21:02:43 2010 -0500 + + gsm: request ICCID after checking the PIN status + + Checking PIN status makes sure the SIM is initialized, and + that has to happen before we try to read the SIM for the + ICCID. So move PIN checking before getting the ICCID, and + retry the ICCID at least once for odd cards like Gobi 1K + that seems to need one more try right after it's done + booting up. + + src/mm-generic-gsm.c | 309 + +++++++++++++++++++++++++++------------------------ + 1 file changed, 166 insertions(+), 143 deletions(-) + +commit f93e24dda3fa790ca9dd9a0471aa5fc26495a04c +Author: Dan Williams +Date: Mon Oct 25 21:00:26 2010 -0500 + + sierra: fix ICCID requests + + Depending on when the core requested the ICCID, the port may or may + not be open. Stuff that needs an open serial port needs to make sure + that the port gets opened itself. + + plugins/mm-modem-sierra-gsm.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +commit 1684d8b1734be69700a93a9995b99fac6ffb9763 +Author: Dan Williams +Date: Mon Oct 25 17:41:08 2010 -0500 + + gsm: add SimIdentifier property + + An obfuscated SimIdentifier that may be available before the PIN has + been entered, for use in auto-unlocking a device. If this value is + present, it should be used in preference to DeviceIdentifier as it + is SIM-specific like the PIN code. + + introspection/mm-modem-gsm-card.xml | 8 ++ + plugins/mm-modem-sierra-gsm.c | 74 ++++++++++++++ + src/mm-generic-gsm.c | 198 + +++++++++++++++++++++++++++++++++++- + src/mm-generic-gsm.h | 6 ++ + src/mm-modem-gsm-card.c | 8 ++ + src/mm-modem-gsm-card.h | 1 + + src/mm-serial-parsers.c | 7 ++ + test/info.py | 15 ++- + 8 files changed, 312 insertions(+), 5 deletions(-) + +commit 46106660fe6aae1018f6f6c45281ccef837e78f8 +Author: Dan Williams +Date: Fri Oct 22 11:34:55 2010 -0500 + + core: print out modem hardware VID/PID and subsystem + + src/mm-manager.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +commit 0ec4dbcc1aa5fdcfedb74619fab0fc93dc4c2f1d +Author: Dan Williams +Date: Fri Oct 22 11:25:03 2010 -0500 + + trivial: fix formatting + + src/tests/test-modem-helpers.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 91a58bbe3d6194abb3a92ba2e936c405ddc4ecdc +Author: Dan Williams +Date: Fri Oct 22 11:20:16 2010 -0500 + + core: detect PCMCIA manfid and cardid + + These aren't added to the udev device database by anything yet + (though they should be) so grab them manually. + + src/mm-plugin-base.c | 33 ++++++++++++++++++++++++--------- + 1 file changed, 24 insertions(+), 9 deletions(-) + +commit 7c410a8d08f146d983d360f7048f113aa8680cca +Author: Dan Williams +Date: Fri Oct 22 11:14:34 2010 -0500 + + core: strip "0x" off udev ID_VENDOR_ID and ID_MODEL_ID strings + + src/mm-plugin-base.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit 7ae8ffe21b9e3bb350dac2f2d34d0711b3255d26 +Author: Dan Williams +Date: Fri Oct 22 11:06:48 2010 -0500 + + core: use hardware IDs as part of DeviceIdentifier + + Pass the device's hardware IDs through modem creation and use them + when calculating the device's identifier. Add a bunch of testcases + for real hardware to ensure we don't break the device ID in the + future unless we really want to. + + plugins/mm-modem-anydata-cdma.c | 6 +- + plugins/mm-modem-anydata-cdma.h | 4 +- + plugins/mm-modem-gobi-gsm.c | 6 +- + plugins/mm-modem-gobi-gsm.h | 4 +- + plugins/mm-modem-hso.c | 6 +- + plugins/mm-modem-hso.h | 4 +- + plugins/mm-modem-huawei-cdma.c | 6 +- + plugins/mm-modem-huawei-cdma.h | 4 +- + plugins/mm-modem-huawei-gsm.c | 6 +- + plugins/mm-modem-huawei-gsm.h | 4 +- + plugins/mm-modem-longcheer-gsm.c | 6 +- + plugins/mm-modem-longcheer-gsm.h | 4 +- + plugins/mm-modem-mbm.c | 6 +- + plugins/mm-modem-mbm.h | 4 +- + plugins/mm-modem-moto-c-gsm.c | 6 +- + plugins/mm-modem-moto-c-gsm.h | 4 +- + plugins/mm-modem-nokia.c | 6 +- + plugins/mm-modem-nokia.h | 4 +- + plugins/mm-modem-novatel-cdma.c | 4 +- + plugins/mm-modem-novatel-cdma.h | 4 +- + plugins/mm-modem-novatel-gsm.c | 6 +- + plugins/mm-modem-novatel-gsm.h | 4 +- + plugins/mm-modem-option.c | 6 +- + plugins/mm-modem-option.h | 4 +- + plugins/mm-modem-sierra-cdma.c | 6 +- + plugins/mm-modem-sierra-cdma.h | 4 +- + plugins/mm-modem-sierra-gsm.c | 6 +- + plugins/mm-modem-sierra-gsm.h | 4 +- + plugins/mm-modem-simtech-gsm.c | 6 +- + plugins/mm-modem-simtech-gsm.h | 4 +- + plugins/mm-modem-x22x-gsm.c | 6 +- + plugins/mm-modem-x22x-gsm.h | 4 +- + plugins/mm-modem-zte.c | 6 +- + plugins/mm-modem-zte.h | 4 +- + plugins/mm-plugin-anydata.c | 10 +- + plugins/mm-plugin-generic.c | 14 +- + plugins/mm-plugin-gobi.c | 14 +- + plugins/mm-plugin-hso.c | 10 +- + plugins/mm-plugin-huawei.c | 14 +- + plugins/mm-plugin-longcheer.c | 14 +- + plugins/mm-plugin-mbm.c | 10 +- + plugins/mm-plugin-moto-c.c | 10 +- + plugins/mm-plugin-nokia.c | 14 +- + plugins/mm-plugin-novatel.c | 14 +- + plugins/mm-plugin-option.c | 10 +- + plugins/mm-plugin-sierra.c | 14 +- + plugins/mm-plugin-simtech.c | 14 +- + plugins/mm-plugin-x22x.c | 10 +- + plugins/mm-plugin-zte.c | 14 +- + src/mm-generic-cdma.c | 6 +- + src/mm-generic-cdma.h | 4 +- + src/mm-generic-gsm.c | 6 +- + src/mm-generic-gsm.h | 4 +- + src/mm-modem-base.c | 57 ++++++-- + src/mm-modem-helpers.c | 32 +++-- + src/mm-modem-helpers.h | 4 +- + src/mm-modem.c | 16 +++ + src/mm-modem.h | 8 +- + src/mm-plugin-base.c | 18 ++- + src/tests/test-modem-helpers.c | 301 + +++++++++++++++++++++++++++++++++++++++ + 60 files changed, 716 insertions(+), 94 deletions(-) + +commit 328d2369a9dadfae786e4c524b5ff2fd0d1a9e17 +Author: Dan Williams +Date: Thu Oct 21 16:57:37 2010 -0500 + + core: add DeviceIdentifier property + + This is computed before any PIN is entered, and thus before we can + usually get IMEI or MEID/ESN out of the device in many cases. It's + therefore not the same as EquipmentIdentifier. + + This is intended to be used by UI programs for matching devices with + PIN numbers for automatic unlocking. While the PIN number is actually + *SIM* specific, no modems allow access to the IMSI before the PIN is + entered, and thus we cannot actually match the PIN with the SIM. The + device ID is the next best thing we can use and should allow auto + unlocking in most cases. + + introspection/mm-modem.xml | 12 +++++++ + src/mm-generic-cdma.c | 44 ++++++++++++++++++++++++ + src/mm-generic-gsm.c | 62 +++++++++++++++++++++++++--------- + src/mm-modem-base.c | 83 + +++++++++++++++++++++++++++++++++++++--------- + src/mm-modem-helpers.c | 65 ++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 10 ++++++ + src/mm-modem.c | 8 +++++ + src/mm-modem.h | 4 ++- + test/info.py | 1 + + 9 files changed, 257 insertions(+), 32 deletions(-) + +commit 9fa20cd018ddbbcc95fd600ca140ac85661567bd +Author: Torgny Johansson +Date: Thu Oct 14 17:15:14 2010 -0500 + + mbm: add HP branded f3607gw and f3307 devices + + plugins/77-mm-ericsson-mbm.rules | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 4cdaba31618bcfefa7fc184a90155ebe8f57a893 +Author: Dan Williams +Date: Thu Oct 14 14:00:42 2010 -0500 + + cdma: clear error when getting state if no AT port is available + + We don't care about the error if we have a QCDM port. + + src/mm-generic-cdma.c | 1 + + 1 file changed, 1 insertion(+) + +commit dd8a061d28ecaf286bfba3bdbd2a495c45cfb4a4 +Author: Dan Williams +Date: Thu Oct 14 10:22:59 2010 -0500 + + serial: make QCDM frame parsing more robust + + Ensure that valid HDLC frames that are not valid QCDM frames + are correctly rejected, and that their data is correctly + discarded. + + The core bug was that Sierra CnS frames have leading and trailing + HDLC frame terminator bytes (0x7E), and the code was incorrectly + treating the leading terminator as the end of a frame, not the + beginning. Thus it would consider the outstanding serial request + finished without actually parsing the response packet. + + Now, we make sure we don't tell the serial receive code that + we have a full QCDM frame until we actually do have one, which is + at least 3 bytes + 0x7E. + + src/mm-qcdm-serial-port.c | 107 + ++++++++++++++++++++++++++++------------------ + 1 file changed, 66 insertions(+), 41 deletions(-) + +commit 8a4f621245c7b5a1a06471260f5f75422e9098cc +Author: Dan Williams +Date: Thu Oct 14 10:22:41 2010 -0500 + + core: add more QCDM frame marker testcases + + src/tests/test-qcdm-serial-port.c | 157 + +++++++++++++++++++++++++++----------- + 1 file changed, 112 insertions(+), 45 deletions(-) + +commit e16a58e54b18ac287d6e0596aff11386f02cb23b +Author: Dan Williams +Date: Thu Oct 14 00:10:46 2010 -0500 + + core: add basic QCDM serial port unit tests + + Test that a Version Info request/response works as expected, and + add a testcase for a bug where specific Sierra CnS responses to + the Version Info request do not properly return an error when + attempting to parse the response as a QCDM packet. Fix for the + second thing forthcoming. + + .gitignore | 1 + + src/tests/Makefile.am | 20 +- + src/tests/test-qcdm-serial-port.c | 410 + ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 430 insertions(+), 1 deletion(-) + +commit 1dae1034849bd7a5110966f54e85f33383561161 +Author: Dan Williams +Date: Thu Oct 14 00:10:18 2010 -0500 + + build: create convenience serial library + + For better unit testing. + + src/Makefile.am | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +commit 9956b06a4467a784f16a60b6fcfd5130e09591e6 +Author: Dan Williams +Date: Thu Oct 14 00:09:22 2010 -0500 + + core: add helper to create QCDM serial ports from a file descriptor + + Aids in unit testing + + src/mm-qcdm-serial-port.c | 17 +++++++++++++++++ + src/mm-qcdm-serial-port.h | 2 ++ + 2 files changed, 19 insertions(+) + +commit ad4e2fc65608d4f7d0bf829e5e618e4eb6f4ba01 +Author: Dan Williams +Date: Thu Oct 14 00:08:14 2010 -0500 + + serial: allow creating serial ports with a given file descriptor + + To enable better unit testing of MMSerialPort and subclasses + behavior. + + src/mm-serial-port.c | 26 ++++++++++++++++++++++---- + src/mm-serial-port.h | 1 + + 2 files changed, 23 insertions(+), 4 deletions(-) + +commit add7fa705caeba743742dbc0717dadaaf1274f73 +Author: Dan Williams +Date: Thu Oct 14 00:07:25 2010 -0500 + + build: enable tests for 'make distcheck' + + No idea why this wasn't done before... + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 79ae78a740dd3c41bd0e71984acceb9bdb1be2b2 +Author: Dan Williams +Date: Thu Oct 14 00:00:44 2010 -0500 + + qcdm: add testcase to ensure that parsing Sierra CnS fails + + Because CnS uses HDLC framing, but doesn't use CRC16, and thus + the decapsulation should fail because the CRC check fails. + + libqcdm/tests/test-qcdm-utils.c | 20 ++++++++++++++++++++ + libqcdm/tests/test-qcdm-utils.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 3 files changed, 23 insertions(+) + +commit a9152f21ff40f4515237c40c691e2b87511b0c41 +Author: Dan Williams +Date: Wed Oct 6 23:09:06 2010 -0500 + + huawei: fix potential double-free on error (rh #632516) + + plugins/mm-plugin-huawei.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit acc4541ab31196fa2b6bbc60997c6b0d7e93392e +Author: Dan Williams +Date: Wed Oct 6 22:55:12 2010 -0500 + + zte: add more port tags + + plugins/77-mm-zte-port-types.rules | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +commit 8935812da4bb468992876586215b68b159fcfdd4 +Author: Dan Williams +Date: Tue Sep 28 10:20:11 2010 -0500 + + serial: kill serial port closing wait + + This is the real fix for 81d0fd148f8c72a2e50b4e6fe82496daa28a91cc. + + Some devices don't interact well with the option driver or the + usb-serial + layer; they don't respond to the USB data requests and thus data never + gets written to that port. When close(2) is called, that data + is still + pending and so the tty layer waits 30 seconds before returning from + the close. This is the 'closing_wait' value, which unfortunately is + not able to be modified by ModemManager because most serial drivers + for 3G devices don't implement the .ioctl handler or its TCIOSSERIAL + option to change closing_wait. + + This goes along with a kernel patch to various drivers to enable + the TIOCSSERIAL ioctl to modify closing_wait which will be posted + soon. + + src/mm-serial-port.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 81d0fd148f8c72a2e50b4e6fe82496daa28a91cc +Author: Dan Williams +Date: Mon Sep 27 15:52:29 2010 -0500 + + core: better debugging of serial port open/close + + Some devices don't interact well with the option drivr or the + usb-serial + layer; they don't respond to the USB data requests and thus data never + gets written to that port. When close(2) is called, that data + is still + pending and so the tty layer waits 30 seconds before returning from + the close. This is the 'closing_wait' value, which unfortunately is + not able to be modified by ModemManager because most serial drivers + for 3G devices don't implement the .ioctl handler or its TCIOSSERIAL + option to change closing_wait. + + Print out open/close timestamps to help debug this issue and get a + list of modems that have this problem. + + src/mm-serial-port.c | 38 ++++++++++++++++++++++++++++++++------ + 1 file changed, 32 insertions(+), 6 deletions(-) + +commit 3c8c3f742525e045fee728a469c4da405f291f08 +Author: Dan Williams +Date: Mon Sep 27 14:48:46 2010 -0500 + + test: add CGREG repsonse test for X220D + + To test spaces between some members of the response. + + src/tests/test-modem-helpers.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 618dc063101370205097f19ae47f730499b8431b +Author: Dan Williams +Date: Wed Sep 22 16:07:58 2010 -0500 + + qcdm: remove shared-library-specific bits that aren't applicable + + Since at this time libqcdm is statically linked into ModemManager. + + libqcdm/src/Makefile.am | 3 --- + libqcdm/src/libqcdm.ver | 6 ------ + 2 files changed, 9 deletions(-) + +commit 79f05cbceca5638dbfef48e5a50bc406ecca5074 +Author: Dan Williams +Date: Wed Sep 22 16:04:25 2010 -0500 + + x22x: add simple plugin for Alcatel X220D + + And possibly the X225 as well. Can't tell much about the modem and + what commands it supports other than AT+SYSSEL for mode selection. + The driver software and connection manager for Windows/Mac OS X are + written by JRD Communication in China, which is a subsidiary of + TCT, which makes Alcatel-branded phones and data sticks. But it + doesn't appear to be the same firmware as other Alcatel/T&A modems + like X060S and such which are supported by the Longcheer plugin. + + plugins/77-mm-x22x-port-types.rules | 30 ++++++ + plugins/Makefile.am | 24 ++++- + plugins/mm-modem-x22x-gsm.c | 205 + ++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-x22x-gsm.h | 43 ++++++++ + plugins/mm-plugin-x22x.c | 184 + ++++++++++++++++++++++++++++++++ + plugins/mm-plugin-x22x.h | 41 ++++++++ + 6 files changed, 525 insertions(+), 2 deletions(-) + +commit 49097b6de5daa63de84f16386825de5b17590fcc +Author: Dan Williams +Date: Tue Sep 21 14:56:47 2010 -0500 + + core: prefer CDMA capabilities over GSM for dual-mode devices + (bgo #621815) + + For devices like the UMW190 that appear to be dual-mode without + needing a + firmware reload (unlike Gobis, which are dual-mode but require a + reboot with + different firwmare) prefer CDMA capabilities since that's where + these devices + will most likely be used more often. In the end we'll need to change + MM to + advertise a "capabilities" attribute on the modem class and modify + devices + such that they can implement both GSM and CDMA semantics at the + same time. + + plugins/mm-plugin-generic.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 674a9412fe634a0417328fd66d0803f80441264b +Author: Dan Williams +Date: Mon Sep 20 15:40:20 2010 -0500 + + gsm: allow use of GSM 03.38 character set (bgo #627935) + + It's only really used for phonebook and SMS PDU mode in the specs, + which we don't do yet, so if this is the only charset the device + supports we'll try to use it. + + src/mm-generic-gsm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 85f827ddffab7b320effdb02572e1751b62e2e60 +Author: Dan Williams +Date: Sat Sep 4 00:15:02 2010 -0500 + + trivial: remove unused code + + src/tests/test-charsets.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 34709e0c7b8a1e7db4221343091bb8662d9814a3 +Author: Dan Williams +Date: Sat Sep 4 00:07:09 2010 -0500 + + trivial: whitespace fixup + + src/tests/test-charsets.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit ee4166f66fe2516cd5a92181f5f0e5618a862ee3 +Author: Dan Williams +Date: Sat Sep 4 00:06:36 2010 -0500 + + gsm: add GSM 03.38 pack/unpack functions and testcases + + src/mm-charsets.c | 77 +++++++++++++++++ + src/mm-charsets.h | 10 +++ + src/tests/test-charsets.c | 205 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 292 insertions(+) + +commit 9e94dd5b6124d00cf10d6296c7c9aa80f8f68d80 +Author: Dan Williams +Date: Thu Sep 2 19:29:05 2010 -0500 + + gsm: add GSM 03.38 encoding/decoding functions and testcases + + .gitignore | 1 + + src/mm-charsets.c | 262 + ++++++++++++++++++++++++++++++++++++++++++++-- + src/mm-charsets.h | 6 +- + src/tests/Makefile.am | 13 ++- + src/tests/test-charsets.c | 119 +++++++++++++++++++++ + 5 files changed, 389 insertions(+), 12 deletions(-) + +commit 85ce5446759092968c6540b9d842c5bc777abb74 +Author: Dan Williams +Date: Wed Sep 1 17:31:49 2010 -0500 + + cdma: consolidate some code by ignoring +CMEE result + + Most modems don't support it and we're ignoring the error message + anyway, so don't bother with a callback for its result. + + src/mm-generic-cdma.c | 36 +++++++++++------------------------- + 1 file changed, 11 insertions(+), 25 deletions(-) + +commit 67d936e46cedfa3f9621946ac02156e8c15990e3 +Author: Dan Williams +Date: Wed Sep 1 17:20:57 2010 -0500 + + polkit: fix for polkit >= 0.97 (bgo #628105) + + configure.ac | 4 ++++ + src/mm-auth-provider-polkit.c | 27 ++++++++++++++++++++++++--- + 2 files changed, 28 insertions(+), 3 deletions(-) + +commit f3024b46b495ea81563d712059ca6fc0c40ea7c8 +Author: Dan Williams +Date: Wed Sep 1 10:51:22 2010 -0500 + + qcdm: add event reporting on/off command + + Doesn't parse any events yet since we don't know what any events + are. We also need to fix up ModemManager to handle unsolicited + responses in the QcdmSerialPort class. + + libqcdm/src/commands.c | 29 +++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 11 +++++++++++ + libqcdm/src/dm-commands.h | 14 ++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 43 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 100 insertions(+) + +commit 48aabcb60be8aed9822de373c14df01fead62ee3 +Author: Dan Williams +Date: Mon Aug 30 14:39:25 2010 -0500 + + test: add scan helper/tester + + test/scan.py | 101 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 101 insertions(+) + +commit 37e4a0b1a88911ad21a792cda663a3e16cc855ee +Author: Dan Williams +Date: Thu Aug 26 12:35:23 2010 -0500 + + gsm: ensure unlock retries is updated on incorrect PIN entry + + If the modem returns an error (like "+CME ERROR: incorrect password" + or even just ERROR) make sure we recheck PIN status and thus also + recheck the number of unlock retries instead of just returning the + error to the caller. + + src/mm-generic-gsm.c | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +commit 7657f138b3e635b0850e051064fd0323836dd7ec +Author: Dan Williams +Date: Thu Aug 26 12:34:57 2010 -0500 + + core: clean up unlock retries info message + + src/mm-modem-base.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit ee53c3c3c43f8af867808b39dd0ae44215535748 +Author: Dan Williams +Date: Wed Aug 25 19:57:58 2010 -0500 + + qcdm: add bits for getting/setting the log mask + + No code to actually start logging yet, just sets the mask. + + libqcdm/src/commands.c | 102 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 19 ++++++++ + libqcdm/src/dm-commands.h | 9 ++++ + libqcdm/tests/test-qcdm-com.c | 59 ++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 192 insertions(+) + +commit 319424ccb39680a8d67869cadd5d54cf96ed1d86 +Author: Dan Williams +Date: Wed Aug 18 16:12:53 2010 -0500 + + gsm: recognize Motorola EZX errors + + Nobody seems to know what the number means, but at least recognize + them as errors. + + src/mm-serial-parsers.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit d65c0269943a88821f0b57b03214efbe66923744 +Author: Dan Williams +Date: Wed Aug 18 15:37:45 2010 -0500 + + gsm: Motorola EZX models quote CPIN response + + src/mm-generic-gsm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 48b8826cbd31ae5103b6ccfa194061650de368b8 +Author: Dan Williams +Date: Mon Aug 16 12:12:41 2010 -0500 + + qcdm: add Status Snapshot enum + + libqcdm/src/commands.c | 8 +++++++ + libqcdm/src/commands.h | 26 ++++++++++++++++++++++ + libqcdm/src/dm-commands.h | 22 ++++++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 52 + +++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 108 insertions(+) + +commit 5388cf396e768e7c7d1b57f2c4fe67dc448d536f +Author: Dan Williams +Date: Wed Aug 11 15:59:35 2010 -0500 + + core: work around dbus-glib property access bug (CVE-2010-1172) + (rh #585394) + + More info: + https://bugzilla.redhat.com/show_bug.cgi?id=585394 + http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1172 + + dbus-glib was not properly enforcing the 'access' permissions on + object properties exported using its API. There were 2 specific bugs: + + 1) dbus-glib did not enforce the introspection read/write property + permissions, so if the GObject property definition allowed write + access (which is sometimes desirable), D-Bus clients could modify + that value even if the introspection said it was read-only + + 2) dbus-glib was not filtering out GObject properties that were + not listed in the introspection XML. Thus, if the GObject defined + more properties than were listed in the introspection XML (which is + also often useful, and MM uses this quite a bit) those properties + would also be exposed to D-Bus clients. + + To fix this completely, you need to: + + 1) get dbus-glib master when the patch is commited, OR grab the + patch from https://bugzilla.redhat.com/show_bug.cgi?id=585394 and + build a new dbus-glib + + 2) rebuild ModemManager against the new dbus-glib + + configure.ac | 6 ++++++ + src/main.c | 11 +++++++++++ + 2 files changed, 17 insertions(+) + +commit be28089dc4c1b07d9def45a3c763f432ae8322c4 +Author: Vincent Untz +Date: Mon Aug 9 10:31:45 2010 -0500 + + build: fix build with glib >= 2.25.12 (bgo #626421) + + Work around an API break in glib. + + libqcdm/tests/test-qcdm.c | 4 ++++ + src/tests/test-modem-helpers.c | 4 ++++ + 2 files changed, 8 insertions(+) + +commit ed9e056987a0d786178571aa859964badc043453 +Author: Dan Williams +Date: Fri Aug 6 01:32:03 2010 -0500 + + cdma: determine EVDO registration even when in 1X mode + + Sometimes the primary mode will be 1X (and thus the Call Manager + will report 1X system mode) but the HDR subsystem will be registered + and idle. Figure that out and report that EVDO is registered too + in that case, since the modem will just flip over to EVDO when + the data call starts. + + src/mm-generic-cdma.c | 149 + ++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 109 insertions(+), 40 deletions(-) + +commit a96e53368dfabf20f1bc3b8aecba2a64d60e198b +Author: Dan Williams +Date: Fri Aug 6 01:16:11 2010 -0500 + + tests: handle random failures of some tests more gracefully + + Not all devices support everything; a Huawei EC168C fails to + read the mode preference, and a Pantech PX-500 fails to read + the roam preference NV item. + + libqcdm/tests/test-qcdm-com.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit dbbac27f1ef518fca0b7aefe9c73cace82c3a5a4 +Author: Dan Williams +Date: Thu Aug 5 22:50:32 2010 -0500 + + qcdm: add generic status snapshot command support + + libqcdm/src/commands.c | 38 +++++++++++++++++++++++++++ + libqcdm/src/commands.h | 22 ++++++++++++++++ + libqcdm/src/dm-commands.h | 23 ++++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 61 + ++++++++++++++++++++++++++++++++++++++----- + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 140 insertions(+), 7 deletions(-) + +commit 52f9c721d3f7201ca2f8ad6461cbb5fd8e50d822 +Author: Dan Williams +Date: Thu Aug 5 22:13:51 2010 -0500 + + core: add SPC lock error + + libqcdm/src/commands.c | 7 +++++++ + libqcdm/src/error.c | 1 + + libqcdm/src/error.h | 1 + + 3 files changed, 9 insertions(+) + +commit b4d3ab014d5587b80858f314e53e596ed70ebdbf +Author: Dan Williams +Date: Thu Aug 5 22:10:33 2010 -0500 + + build: use automake silent rules + + configure.ac | 1 + + marshallers/Makefile.am | 4 ++-- + plugins/Makefile.am | 2 +- + src/Makefile.am | 16 ++++++++-------- + 4 files changed, 12 insertions(+), 11 deletions(-) + +commit 7e2d63d2c20a6ad540d4bb1e404f001b9f47a360 +Author: Dan Williams +Date: Wed Aug 4 02:18:37 2010 -0500 + + zte: add more port tags + + plugins/77-mm-zte-port-types.rules | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +commit 15a4592ef94ffd279282c7dc892cf4c49e170223 +Author: Dan Williams +Date: Tue Jul 20 12:53:05 2010 -0700 + + novatel: fix distcheck + + plugins/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d18fbaa1c73a88b6f36437fbf712134c8aad5238 +Author: Dan Williams +Date: Tue Jul 20 12:30:38 2010 -0700 + + gsm: ensure invalid operator names don't get used (rh #597088) + + Apparently g_convert() can still return garbage that's not valid in + the character set you're converting to (???). But even if we don't + need to convert the operator name, make sure it's valid UTF-8 before + we go shoving it through D-Bus. + + src/mm-charsets.c | 14 ++++++++++++-- + src/mm-generic-gsm.c | 22 ++++++++++++++++------ + 2 files changed, 28 insertions(+), 8 deletions(-) + +commit e239bf15bb9787d15c429824b1e1176c35e978b6 +Author: Dan Williams +Date: Mon Jul 19 16:19:59 2010 -0700 + + core: handle shadow properties on the MmPropertiesChanged interface + + Need to emit the D-Bus API property name, not the GObject property + name for a few things on the Location interface. + + src/mm-generic-gsm.c | 6 +++++ + src/mm-modem-base.c | 4 +++ + src/mm-properties-changed-signal.c | 55 + +++++++++++++++++++++++++++----------- + src/mm-properties-changed-signal.h | 5 ++-- + 4 files changed, 52 insertions(+), 18 deletions(-) + +commit 56665c19af431234ebe1b22cff9f0f9b9fb3d02f +Author: Dan Williams +Date: Fri Jul 9 12:35:36 2010 -0700 + + nokia: N900 appears to need a longer port delay (rh #583691) + + plugins/mm-modem-nokia.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit fe2145ddc407a81a0282e5729fd806ca8f80a735 +Author: Dan Williams +Date: Fri Jul 9 15:24:42 2010 -0700 + + test: add modem info helper + + test/Makefile.am | 8 +- + test/info.py | 248 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 255 insertions(+), 1 deletion(-) + +commit 6f40ecbed52645915f458dc0b2b3a5e8779d9b22 +Author: Dan Williams +Date: Fri Jul 2 16:57:28 2010 -0700 + + novatel: detect CDMA home/roaming status + + plugins/mm-modem-novatel-cdma.c | 115 + ++++++++++++++++++++++++++++++++++++++++ + src/mm-generic-cdma.c | 9 ++++ + src/mm-generic-cdma.h | 4 ++ + 3 files changed, 128 insertions(+) + +commit dbc7f3d2976cca680183aa4d6163b06445f07502 +Author: Dan Williams +Date: Fri Jul 2 15:34:05 2010 -0700 + + novatel: fix S720 signal quality reporting + + plugins/mm-modem-novatel-cdma.c | 29 +++++++++++++++++++++-------- + 1 file changed, 21 insertions(+), 8 deletions(-) + +commit 88ee478bb659e6660b3bca1e8f2bd45b667a603b +Author: Dan Williams +Date: Tue Jun 29 22:47:40 2010 -0700 + + gsm: implement location API + + Depends on dbus-glib 0.86 + this patch: + + https://bugs.freedesktop.org/show_bug.cgi?id=28835 + + Still have to do the bits that allow plugins to add other + location capabilities, but that can come later. + + src/mm-generic-gsm.c | 347 + +++++++++++++++++++++++++++++++++++++++++++----- + src/mm-generic-gsm.h | 20 ++- + src/mm-modem-location.c | 5 +- + src/mm-modem-location.h | 7 +- + test/location.py | 57 ++++++++ + 5 files changed, 400 insertions(+), 36 deletions(-) + +commit 655bf7a9faf6125760bc109d9f4f38ce9143a82b +Author: Dan Williams +Date: Tue Jun 29 22:36:11 2010 -0700 + + api: fix up location method flag name + + introspection/mm-modem-location.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1c2df96f8d5f768db3c63d70778be0f2da8f2ac0 +Author: Dan Williams +Date: Tue Jun 29 22:24:00 2010 -0700 + + test: add some simple testing utilities + + test/disable.py | 27 +++++++++++++++++++++++++++ + test/enable.py | 27 +++++++++++++++++++++++++++ + test/list-modems.py | 54 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 108 insertions(+) + +commit 6e79d153efc30fb2030536f7f795c19ad4a0661a +Merge: 72a1a6ca 5fc9f259 +Author: Dan Williams +Date: Thu Jun 24 11:09:33 2010 -0700 + + Merge remote branch 'origin/master' into creg + +commit 5fc9f259e253fc32510eca8fbd42416706fe0db6 +Author: Dan Williams +Date: Thu Jun 24 09:19:55 2010 -0700 + + trivial: print out useful debugging info before asserting + + src/mm-manager.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 48dbece33cb187196e69f4ff058c93a43a071ac4 +Author: Torgny Johansson +Date: Wed Jun 23 16:39:13 2010 -0700 + + mbm: add factory reset support + + plugins/mm-modem-mbm.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 54 insertions(+) + +commit 89c572e59d736e273576987ccde91f62ce6f4ce5 +Author: David Rochberg +Date: Tue Jun 22 17:47:07 2010 -0700 + + core: add FactoryReset method + + Cleanups and authorization checks by me (dcbw). + + introspection/mm-modem.xml | 11 +++++++++ + src/mm-modem.c | 57 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem.h | 10 ++++++++ + 3 files changed, 78 insertions(+) + +commit 88c538314aab99775c4b496170785d588e60ac6f +Author: Dan Williams +Date: Tue Jun 22 17:14:13 2010 -0700 + + core: EquipmentIdentity -> EquipmentIdentifier + + introspection/mm-modem.xml | 4 ++-- + src/mm-generic-cdma.c | 2 +- + src/mm-generic-gsm.c | 2 +- + src/mm-modem-base.c | 40 +++++++++++++++++++--------------------- + src/mm-modem-base.h | 6 +++--- + src/mm-modem.c | 6 +++--- + src/mm-modem.h | 4 ++-- + 7 files changed, 31 insertions(+), 33 deletions(-) + +commit 8873c0a7dc6cd02fa487092aeb889464b4dc752d +Author: Torgny Johansson +Date: Tue Jun 22 16:50:21 2010 -0700 + + gsm: add GetOperatorID method + + Returns the ID of the operator that issued the SIM card. + + Cleanups and get_mnc_length_done() by me (dcbw). + + introspection/mm-modem-gsm-card.xml | 14 +++++ + src/Makefile.am | 4 +- + src/mm-charsets.c | 57 +---------------- + src/mm-generic-gsm.c | 122 + +++++++++++++++++++++++++++++++++++- + src/mm-modem-gsm-card.c | 54 ++++++++++++++++ + src/mm-modem-gsm-card.h | 8 +++ + src/mm-plugin-base.c | 36 ++--------- + src/mm-utils.c | 78 +++++++++++++++++++++++ + src/mm-utils.h | 24 +++++++ + 9 files changed, 309 insertions(+), 88 deletions(-) + +commit e442b3b7f13c7a7277b15f0b0cdf5175f4da22f6 +Author: Dan Williams +Date: Tue Jun 22 14:37:20 2010 -0700 + + cdma: implement EquipmentIdentity for CDMA devices + + src/mm-generic-cdma.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 52929a2c926eee99e401765446c8f7a9168b38db +Author: Torgny Johansson +Date: Tue Jun 22 14:36:49 2010 -0700 + + core: add modem EquipmentIdentity property to report IMEI/ESN/MEID + + introspection/mm-modem.xml | 7 ++++++ + src/mm-generic-gsm.c | 43 ++++++++++++++++++++++++++++++++++++ + src/mm-modem-base.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-base.h | 5 +++++ + src/mm-modem.c | 8 +++++++ + src/mm-modem.h | 4 +++- + 6 files changed, 120 insertions(+), 1 deletion(-) + +commit c95216e575b1740bf8e28005b36d327da578c44d +Author: Dan Williams +Date: Tue Jun 22 14:06:13 2010 -0700 + + huawei: add support for UnlockRetries + + plugins/mm-modem-huawei-gsm.c | 147 + +++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 146 insertions(+), 1 deletion(-) + +commit f179a56908f62f59f5e1419d562e5b9219cfbe7d +Author: Torgny Johansson +Date: Tue Jun 22 14:05:09 2010 -0700 + + gsm: add UnlockRetries property + + Which reports the # of attempts remaining for the current PIN required + by the device or SIM. + + Some modifications/cleanups by dcbw. + + introspection/mm-modem.xml | 7 ++++ + plugins/mm-modem-mbm.c | 96 + +++++++++++++++++++++++++++++++++++++++++++++- + src/mm-generic-gsm.c | 38 ++++++++++++++++++ + src/mm-modem-base.c | 47 +++++++++++++++++++++++ + src/mm-modem-base.h | 6 +++ + src/mm-modem-gsm-card.c | 28 ++++++++++++++ + src/mm-modem-gsm-card.h | 17 ++++++++ + src/mm-modem.c | 8 ++++ + src/mm-modem.h | 4 +- + 9 files changed, 249 insertions(+), 2 deletions(-) + +commit adfe264b67ba28effd3fb8378cbcbe2081f6ed49 +Author: Dan Williams +Date: Tue Jun 22 01:58:54 2010 -0700 + + core: ensure claimed ports don't fall back to Generic (rh #597296) + + Found by jklimes. If some plugin already supports this port, it's + pointless to let Generic figure out if it supports the port since + we're just going to hand it to the other plugin anyway. + + src/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a60216f5f44d4ead2fd36a129dee789d2941b02e +Author: Dan Williams +Date: Tue Jun 22 01:58:41 2010 -0700 + + huawei: use g_timeout_add_seconds() + + plugins/mm-plugin-huawei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 597f691eb8b12450d8f895f7a25d724eeba6c277 +Author: Dan Williams +Date: Tue Jun 22 00:55:47 2010 -0700 + + gsm: fix handling of SMS options + + src/mm-modem-gsm-sms.c | 1 + + 1 file changed, 1 insertion(+) + +commit ea955f64c5ce562a1a73e05d227113e7383c8f58 +Author: Dan Williams +Date: Wed Jun 16 10:33:09 2010 -0700 + + release: bump version to 0.4 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 962a6b0939cd4b3ea7306492cb25f88b77668ef5 +Author: Dan Williams +Date: Thu Jun 10 10:41:10 2010 -0700 + + core: return errors to outstanding requests when serial ports + are closed + + Prevents crashes when the callback info completes when the modem is + removed, plus it's the right thing to do anyway... + + src/mm-serial-port.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit 164e5dfd498d2e746014cacbd3cc1a5bbf8528d1 +Author: Dan Williams +Date: Mon Jun 7 22:26:20 2010 -0700 + + release: bump version to 0.3.998 (0.4-beta2) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 72a1a6caf67a15655ade8dc5eed4f94f86107171 +Author: Dan Williams +Date: Mon Jun 7 22:21:01 2010 -0700 + + gsm: use PS registration status if CS isn't available + + Some devices (Blackberries) always respond to AT+CREG with ERROR, + but will respond to AT+CGREG normally. Ugh. Handle that by + using the PS registration status from AT+CGREG if we don't have + a valid CS registration status at all. + + src/mm-generic-gsm.c | 160 + ++++++++++++++++++++++++++++++++++++--------------- + src/mm-generic-gsm.h | 6 ++ + 2 files changed, 120 insertions(+), 46 deletions(-) + +commit f4bfd9410680f268bc739f46020a0adb5c41c8e3 +Author: Dan Williams +Date: Fri Jun 4 19:07:39 2010 -0700 + + api: fix U1900 flag description + + From David Rochberg + + introspection/mm-modem-gsm.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d5b8019d66870ed98d58095fa6b173a880fd3966 +Author: Dan Williams +Date: Wed May 26 11:43:06 2010 -0700 + + serial: fix cleanup of flash function (rh #591728) + + The flash function could be called when the port was closed, and since + the flash function would only be canceled when the port was open, + it could trigger after the port object was destroyed. + + src/mm-errors.c | 1 + + src/mm-errors.h | 1 + + src/mm-serial-port.c | 16 ++++++++++++---- + 3 files changed, 14 insertions(+), 4 deletions(-) + +commit 6c3ae7d8fd3665eab02aab014c5ea46809312a29 +Author: Dan Williams +Date: Tue May 25 15:24:47 2010 -0700 + + gsm: print simple connect state when debugging + + src/mm-generic-gsm.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit 437c4ea8d97157ab704befef223db2d5921e92df +Author: Dan Williams +Date: Tue May 25 15:24:27 2010 -0700 + + test: add a few more CREG/CGREG responses + + src/tests/test-modem-helpers.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit ccd2b7241cfc923fe90bb6e32bf6daf2137c50d7 +Author: Dan Williams +Date: Tue May 25 14:33:27 2010 -0700 + + gsm: list simple-connect properties when debugging + + src/mm-generic-gsm.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit d960a8677894355df0a40848878f8f45bbec362b +Author: Dan Williams +Date: Fri May 21 09:47:54 2010 -0700 + + release: bump version to 0.3.997 (0.4-beta1) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit afebde48683392ccf54f9bd901ab5ac471e94dcb +Author: Dan Williams +Date: Fri May 21 09:43:47 2010 -0700 + + build: print version on startup and add dist-version + + Distributions should set dist-version at build time with the + package version and revision, so for RPM-based distros you'd + + --with-dist-version=%{version}-%{release} + + which will be printed out on MM startup to help debugging. + + configure.ac | 8 ++++++++ + src/main.c | 9 +++++++-- + 2 files changed, 15 insertions(+), 2 deletions(-) + +commit c311c3419cce6cd6c9ce87fd321b4fbbe6666e6d +Author: Dan Williams +Date: Thu May 20 12:05:50 2010 -0700 + + simtech: fix unsolicited access technology parsing + + plugins/mm-modem-simtech-gsm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 481b6539b46d9d96cb0bf7f59c1238c4cb9f9620 +Author: Dan Williams +Date: Wed May 19 23:33:33 2010 -0700 + + api: revise and simplify Location spec + + Simplify the NMEA type and add GPS raw for generic GPS data. + + introspection/mm-modem-location.xml | 89 + +++++++++++++++++++++++++++---------- + 1 file changed, 65 insertions(+), 24 deletions(-) + +commit ef747c63855be5df3648057ad5fc161e9554bdba +Author: Dan Williams +Date: Tue May 18 13:17:49 2010 -0700 + + sierra: rework CDMA roaming and registration parsing + + There were a few problems: + + 1) If SysMode is present, the registration state it reports should + be authoritative, but if there was a valid SID the plugin would + report 'registered' even if SysMode was NO SRV + + 2) Turns out that some devices report the roaming values as ERIs, + not plain yes/no as we thought; reported ERI was being mis-parsed + as a boolean value. + + plugins/mm-modem-sierra-cdma.c | 102 + +++++++++++++++++++++++++---------------- + 1 file changed, 62 insertions(+), 40 deletions(-) + +commit 9cbd68e96ccd9bdb32d28548ec34027d3add88c5 +Author: Dan Williams +Date: Tue May 18 13:04:43 2010 -0700 + + cdma: return numeric ERI too + + src/mm-generic-cdma.c | 2 +- + src/mm-modem-helpers.c | 4 ++++ + src/mm-modem-helpers.h | 1 + + 3 files changed, 6 insertions(+), 1 deletion(-) + +commit 533ffaddc4f09ae2d75a7b092ffe0dd7f8151487 +Author: Dan Williams +Date: Tue May 18 12:24:42 2010 -0700 + + cdma: make ERI parsing generic + + src/mm-generic-cdma.c | 4 +++- + src/mm-modem-helpers.c | 10 ++++------ + src/mm-modem-helpers.h | 6 +++--- + 3 files changed, 10 insertions(+), 10 deletions(-) + +commit 40a4a1d774fc62a43d3b49bbaec728caf0ebba37 +Author: Dan Williams +Date: Tue May 18 10:13:04 2010 -0700 + + simtech: fix plugin build + + plugins/Makefile.am | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit bb4fdef18c1a016734208279895f651c06d11a38 +Author: Dan Williams +Date: Tue May 18 10:09:13 2010 -0700 + + build: default to ppp 2.4.5 headers + + 2.4.5 has been out for a long time and fixes a number of bugs + including + the DNS bug. Use it. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4fd85c14a12d08bac03c7955e70e904760a1348c +Author: Dan Williams +Date: Mon May 17 23:18:09 2010 -0700 + + simtech: add plugin for Simtech-based modems (like A-Link 3GU) + + plugins/77-mm-simtech-port-types.rules | 29 ++ + plugins/Makefile.am | 21 +- + plugins/mm-modem-simtech-gsm.c | 471 + +++++++++++++++++++++++++++++++++ + plugins/mm-modem-simtech-gsm.h | 43 +++ + plugins/mm-plugin-simtech.c | 189 +++++++++++++ + plugins/mm-plugin-simtech.h | 41 +++ + 6 files changed, 793 insertions(+), 1 deletion(-) + +commit 6a663c3a48ee3ce12cda2fa9ceeb1e15a90ae745 +Author: Torgny Johansson +Date: Mon May 17 21:59:58 2010 -0700 + + mbm: catch *E2NAP error codes too + + plugins/mm-modem-mbm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 15962279a333d60e3eda6001fb8c836eadd9f542 +Author: Dan Williams +Date: Mon May 17 21:56:45 2010 -0700 + + mbm: (trivial) line ending change? + + No idea what git thinks is different about these two lines, they + strcmp() the same. + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 03ae419b003f35eb1b4f4ba0955eb6586009ecd7 +Author: Dan Williams +Date: Wed May 12 12:48:02 2010 -0700 + + gsm: more leniency in +CGDCONT parsing (bgo #617873) + + See also d5ca82eade4c341a18a72e6f16c9db4ee34be4d5 + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 52f8ead7c08e95498096591800eab7558fe3353e +Author: Dan Williams +Date: Tue May 11 12:22:47 2010 -0700 + + trivial: fix comment + + plugins/mm-modem-longcheer-gsm.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b8f0f403499b185c7bd37a19e8bbf907344ac904 +Author: Dan Williams +Date: Fri May 7 13:56:23 2010 -0700 + + core: fix memory leaks + + Since MMModem is an interface and doesn't store stuff like the + modem's physdev internally (since it's an interface) these things + are handled via GObject properties. And since g_object_get() + returns allocated values, we need to free the returned value + from mm_modem_get_device() after we're done with it. + + src/mm-manager.c | 36 +++++++++++++++++++++--------------- + src/mm-modem-base.c | 7 +++++-- + src/mm-modem.c | 5 ++++- + 3 files changed, 30 insertions(+), 18 deletions(-) + +commit e855922b4b6f9f712e91732db1104dbb22faa0e8 +Author: Dan Williams +Date: Fri May 7 13:50:16 2010 -0700 + + cdma: fix handling of empty QCDM frames + + src/mm-qcdm-serial-port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d0d847c65a7073ecdced95b69548bf97c7af14f6 +Author: Dan Williams +Date: Fri May 7 13:36:56 2010 -0700 + + gsm: try PDP context deactivation on the second port first + + There are some cases where flashing the primary port doesn't work + either due to stupid modem firmware or crappy kernel drivers. So + if we have a secondary port, try sending the PDP deactivation + command to the secondary port first, and if that fails send it + to the primary port after the primary port gets flashed. This + increases the chances that the +CGACT request will be successful. + + Some modems (Huawei, ZTE) don't like +CGACT on the secondary port, + but when that fails, the code falls back to previous behavior of + flashing and sending CGACT to the primary port. + + src/mm-generic-gsm.c | 106 + +++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 86 insertions(+), 20 deletions(-) + +commit 0f6f381e87f81fca3e9808a1fbdfbdbe2fea42e0 +Author: Dan Williams +Date: Fri May 7 11:16:57 2010 -0700 + + qcdm: generic functions for band_class/prev conversion + + libqcdm/src/commands.c | 137 + ++++++++++++++++++++++++------------------------- + 1 file changed, 67 insertions(+), 70 deletions(-) + +commit d5ca82eade4c341a18a72e6f16c9db4ee34be4d5 +Author: Dan Williams +Date: Thu May 6 16:04:15 2010 -0700 + + gsm: be more lenient in +CGDCONT parsing (bgo #617873) + + Some phones like the T630 don't put a space after the ':'. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb965695eca76594b1717c2a25c66d456594509e +Author: Dan Williams +Date: Fri May 7 04:58:22 2010 -0700 + + qcdm: add Novatel Modem Snapshot command support + + libqcdm/src/commands.c | 154 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 68 +++++++++++++++++++ + libqcdm/src/dm-commands.h | 84 +++++++++++++++++++++-- + libqcdm/tests/test-qcdm-com.c | 138 ++++++++++++++++++++++++++++++++++++- + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 438 insertions(+), 9 deletions(-) + +commit 14442c1a5b00906986a8f703dda9eee8c6947514 +Author: Dan Williams +Date: Fri May 7 02:06:48 2010 -0700 + + qcdm: add comment + + libqcdm/src/dm-commands.h | 1 + + 1 file changed, 1 insertion(+) + +commit 425c28dfc1d24126feab432609f2c525069d577e +Author: Dan Williams +Date: Thu May 6 15:28:43 2010 -0700 + + longcheer: handle TAMobile/Alcatel X060s vendor ID too + + These are Longcheer-based devices, but the vendor ID is different. + We had tagged the X060s' ports in the rules but never updated the + plugin to handle the different vendor ID. + + plugins/mm-plugin-longcheer.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 246817fe546490df8e6f5e4e85cc93e01927bda4 +Author: Dan Williams +Date: Wed May 5 15:49:33 2010 -0700 + + serial: fix possible segfault handing port-full signals + + The argument passed to the handler is a GByteArray, not a + GString. Encountered with Option iCON Icera-based devices, + but could also be possible with Sierra devices. + + src/mm-plugin-base.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 9a6aa0c10d8354a646daf49db4ec2b99383839aa +Author: Dan Williams +Date: Wed May 5 15:47:14 2010 -0700 + + option/hso: eat +PACSP0 unsolicited response + + Interfered with initial PIN checking in some cases. + + plugins/mm-modem-hso.c | 4 ++++ + plugins/mm-modem-option.c | 10 +++++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +commit f63188eb261e631f929a6c47feb85b8ed9985856 +Author: Dan Williams +Date: Wed May 5 01:04:20 2010 -0700 + + core: log modem data port + + src/mm-manager.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 885bc90be91f44f4e2aeb837f40aafcce3089789 +Author: Dan Williams +Date: Tue May 4 17:33:04 2010 -0700 + + gsm/cdma: fix data port assignment (rh #587400) + + QCDM ports should never be the data port; 'net' ports take precedence + over AT ports too. Clarify that. + + src/mm-generic-cdma.c | 14 ++++++++++---- + src/mm-generic-gsm.c | 16 +++++++++++----- + 2 files changed, 21 insertions(+), 9 deletions(-) + +commit 26a3fe3f53b4a053035ea4f1c1a67eed7fe2761f +Author: Dan Williams +Date: Tue May 4 17:31:22 2010 -0700 + + trivial: use property name constant + + src/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 13b82e5d1c4d456fa1a0a4f6ee8f9adb0abb8a17 +Author: Dan Williams +Date: Tue May 4 17:31:01 2010 -0700 + + trivial: tweak debug message + + src/mm-modem-base.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 565d9343f6705b34d9f53c4a2404f681553dce19 +Author: Dan Williams +Date: Tue May 4 16:58:44 2010 -0700 + + core: print out port type when port is claimed + + src/mm-modem-base.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 0c3961441b0f7820a928e24c4063110494bdab9f +Author: Dan Williams +Date: Tue May 4 16:58:18 2010 -0700 + + core: add port type -> string conversion helper for debuggin messages + + src/mm-port.c | 20 ++++++++++++++++++++ + src/mm-port.h | 2 ++ + 2 files changed, 22 insertions(+) + +commit f0e0861aa4d823418695dc8096dffebb26c29849 +Author: Dan Williams +Date: Sat May 1 22:44:00 2010 -0700 + + longcheer: add support for access technology and allowed modes + + plugins/Makefile.am | 4 +- + plugins/mm-modem-longcheer-gsm.c | 222 + +++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-longcheer-gsm.h | 43 ++++++++ + plugins/mm-plugin-longcheer.c | 9 +- + 4 files changed, 273 insertions(+), 5 deletions(-) + +commit da8cf4a7c2931eee9c0ff44b07e4044bb796600b +Author: Dan Williams +Date: Sat May 1 22:42:58 2010 -0700 + + gsm: use generic string -> access technology helper + + plugins/mm-modem-novatel-gsm.c | 29 ++++++----------------------- + plugins/mm-modem-sierra-gsm.c | 29 ++++++----------------------- + plugins/mm-modem-zte.c | 30 ++---------------------------- + 3 files changed, 14 insertions(+), 74 deletions(-) + +commit 576992966857091c86d58a542dc991d1a44d7769 +Author: Dan Williams +Date: Sat May 1 22:41:33 2010 -0700 + + helpers: add generic helper for string -> access technology + + src/mm-modem-helpers.c | 31 +++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 3 +++ + 2 files changed, 34 insertions(+) + +commit de5f1bd4e99549e95b449c3e058a3db4808e31a7 +Author: Dan Williams +Date: Sat May 1 22:34:59 2010 -0700 + + core: clear error before use + + src/mm-serial-port.c | 1 + + 1 file changed, 1 insertion(+) + +commit 4c3eedd955e3389b5636243d0ca3d85e7aeb1273 +Author: Dan Williams +Date: Sat May 1 11:15:49 2010 -0700 + + longcheer: add more Zoom product tags (4595, 4596, etc) + + plugins/77-mm-longcheer-port-types.rules | 35 + ++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +commit c6cb5acfe172a9111d6ef111052e496a1f97d073 +Author: Dan Williams +Date: Fri Apr 30 00:44:24 2010 -0700 + + gsm: periodically poll access technology too + + Not all devices support unsolicited responses for access technology, + so lets poll it periodically along with registration state and + signal quality. + + src/mm-generic-gsm.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit de86b71b3d0376d7483dff2ac21cfe701f35ac42 +Author: Dan Williams +Date: Fri Apr 30 00:35:30 2010 -0700 + + zte: fix getting GSM allowed mode + + plugins/mm-modem-zte.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 30473ce7c9868528faf05923b676e23da9c19137 +Author: Dan Williams +Date: Fri Apr 30 00:32:54 2010 -0700 + + novatel: implement allowed modes and access technology + + plugins/mm-modem-novatel-gsm.c | 216 + ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 215 insertions(+), 1 deletion(-) + +commit bfe3dd49edb2c89fee01c141c8c7eec490b665d5 +Author: Dan Williams +Date: Thu Apr 29 21:15:17 2010 -0700 + + core: refcount serial port open/close + + This specifically fixes a regression with Novatel GSM secondary + AT port enablement, where the inital pin check closed the port + before the Novatel plugin could send the command to flip secondary + ports to AT mode. + + But it's useful elsewhere too, and simplifies a bunch of the PIN + checking code which had to use various ugly methods to track whether + to close the port or not after checking the PIN. + + plugins/mm-modem-novatel-gsm.c | 5 +-- + src/mm-generic-cdma.c | 6 ++-- + src/mm-generic-gsm.c | 80 + ++++++++++++++++------------------------- + src/mm-serial-port.c | 82 + +++++++++++++++++++++++++++++++----------- + src/mm-serial-port.h | 8 ++++- + 5 files changed, 106 insertions(+), 75 deletions(-) + +commit 26a51d6ab9a7bc70840e8a1d30f5e3bb777d9f25 +Author: Dan Williams +Date: Thu Apr 29 19:40:41 2010 -0700 + + gsm: try both CREG and CGREG during initial registration checking + + Some devices (Blackberries via DUN) appear to always return an error + for AT+CREG, which is valid in some cases. If that happens lets also + try AT+CGREG too, which on these devices responds with the correct + packet data registration state. + + src/mm-generic-gsm.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +commit a13becc225c8ed0347f00447d937804a6666f0bc +Author: Dan Williams +Date: Thu Apr 29 18:59:11 2010 -0700 + + core: timestamp debug statements + + src/mm-at-serial-port.c | 8 +++++++- + src/mm-modem.c | 21 +++++++++++++++++---- + src/mm-port.c | 11 +++++++++++ + src/mm-qcdm-serial-port.c | 8 +++++++- + 4 files changed, 42 insertions(+), 6 deletions(-) + +commit fbfb7f895362331532e9cc4d7f02c8ffcf6b061e +Author: Dan Williams +Date: Thu Apr 29 18:57:49 2010 -0700 + + novatel: let generic CDMA class handle signal strength while connected + + Instead of returning an unhelpful error when there isn't a second + AT port (which there never will be for Novatel CDMA devices) we should + let the superclass handle the request. + + plugins/mm-modem-novatel-cdma.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 1864d8da0766e615c37a13f30bcacb72d381aa69 +Author: Dan Williams +Date: Thu Apr 29 12:17:56 2010 -0700 + + core: add platform device support and whitelist + + src/77-mm-platform-serial-whitelist.rules | 14 ++++++++++++++ + src/Makefile.am | 3 ++- + src/mm-manager.c | 18 ++++++++++++++++-- + 3 files changed, 32 insertions(+), 3 deletions(-) + +commit 921048b12e1e8203cbff6dfbe43e833ea6bb8232 +Author: Torgny Johansson +Date: Thu Apr 29 11:28:19 2010 -0700 + + mbm: add Dell 5541 and 5542 + + plugins/77-mm-ericsson-mbm.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +commit a4c094c340e0c93149a4e9042db4a88f9800467f +Author: Dan Williams +Date: Sat Apr 24 23:44:35 2010 -0700 + + core: fix serial error #defines + + Should have ERROR in them. + + plugins/mm-modem-hso.c | 2 +- + plugins/mm-modem-mbm.c | 6 ++---- + plugins/mm-modem-zte.c | 2 +- + src/mm-errors.c | 10 +++++----- + src/mm-errors.h | 8 ++++---- + src/mm-plugin-base.c | 6 +++--- + src/mm-serial-port.c | 16 ++++++++-------- + 7 files changed, 24 insertions(+), 26 deletions(-) + +commit b9bb12a01e0fd0251475622cf2adc3ca04ba7bd0 +Author: Dan Williams +Date: Sat Apr 24 23:40:24 2010 -0700 + + core: flash failure on disconnect shouldn't be a hard error (rh + #578280) + + plugins/mm-modem-zte.c | 2 +- + src/mm-errors.c | 1 + + src/mm-errors.h | 3 ++- + src/mm-generic-cdma.c | 6 +++--- + src/mm-generic-gsm.c | 6 +++--- + src/mm-plugin-base.c | 2 +- + src/mm-serial-port.c | 18 ++++++++++++++---- + src/mm-serial-port.h | 1 + + 8 files changed, 26 insertions(+), 13 deletions(-) + +commit 411051b1f37d16d8fa0866e7a1bee0a553029956 +Author: Dan Williams +Date: Sat Apr 24 23:16:45 2010 -0700 + + mbm: add Sony Ericsson MD400 device IDs + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 01cb6360f8bdf9b7d844257938f7bb2a016f404c +Author: Dan Williams +Date: Sat Apr 24 23:12:16 2010 -0700 + + cdma: prevent crash on modem removal (rh #571921) + + src/mm-generic-cdma.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 44deca2c5a9b7414d2e65fc62f87f67df3066810 +Author: Dan Williams +Date: Fri Apr 9 19:38:22 2010 -0700 + + core: blacklist Gemplus smarcard reader (bgo #608022) + + src/77-mm-pcmcia-device-blacklist.rules | 10 ++++++++++ + src/Makefile.am | 3 ++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +commit 78c232c2d1901aee15a2d304e838443c9b1d37ba +Author: Dan Williams +Date: Fri Apr 9 19:32:47 2010 -0700 + + core: actually ignore blacklisted devices + + src/mm-manager.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 387b64a92bc480f949e647509772644a72e93e5a +Author: Dan Williams +Date: Fri Apr 9 19:22:19 2010 -0700 + + core: allow blacklisting various devices (rh #544121) (bgo #608022) + + src/77-mm-usb-device-blacklist.rules | 66 + ++++++++++++++++++++++++++++++++++++ + src/Makefile.am | 9 ++++- + 2 files changed, 74 insertions(+), 1 deletion(-) + +commit c96e7367001032b83a1f8313bf88c76623b68fc9 +Author: Dan Williams +Date: Fri Apr 9 19:03:03 2010 -0700 + + test: fix lsudev crash + + test/lsudev.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit 41ca10e92d08c06602ae08790329878c2152b9b3 +Author: Dan Williams +Date: Fri Apr 9 17:33:22 2010 -0700 + + core: get correct PCMCIA master device + + The master device of PCMCIA-provided ports is typically the + last device in the PCMCIA subsystem, because the PCMCIA + controller is usually a PCI device or some other subsystem. + + src/mm-manager.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +commit da74f6d8ec1c6dbec227f3c0679eb3e25a510277 +Author: Dan Williams +Date: Fri Apr 9 17:10:57 2010 -0700 + + gsm: recheck modem lock status a few times after sending unlock + request (bgo #613490) + + Some devices (ZTE MF110 for example) respond immediately to the unlock + request, but in reality take a bit of time before they are actually + unlocked. Check PIN status a few times after sending the unlock. + + src/mm-generic-gsm.c | 54 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 53 insertions(+), 1 deletion(-) + +commit 0d381e2f11cbc3bdb7c7e69bc4c7169a9d247d3c +Author: Dan Williams +Date: Fri Apr 9 13:50:45 2010 -0700 + + gsm: fix CSCS=? parsing and add testcases + + Some devices (at least one Blackberry we know about) don't include + the () around the response. Handle that and add testcases for it. + + src/Makefile.am | 6 ++-- + src/mm-charsets.c | 21 ++++++------ + src/mm-generic-gsm.c | 37 ++-------------------- + src/mm-modem-helpers.c | 72 + ++++++++++++++++++++++++++++++++++++------ + src/mm-modem-helpers.h | 4 +++ + src/tests/test-modem-helpers.c | 66 + ++++++++++++++++++++++++++++++++++++++ + 6 files changed, 151 insertions(+), 55 deletions(-) + +commit b51a9d27e5a793b4e33bfdd7999e7204c408f154 +Author: Dan Williams +Date: Wed Apr 7 15:11:32 2010 -0700 + + gsm: don't require +CMEE=1 success + + Some devices apparently don't like it (even though it's required + in the standards) and since we can deal without it, don't require + +CMEE=1 to complete successfully. + + src/mm-generic-gsm.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 7aeac2f64628cb99ad35e113c36cc69df6aa9a07 +Author: Dan Williams +Date: Wed Apr 7 15:04:32 2010 -0700 + + mbm: fix getting current allowed mode + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f3dd034aadd16d42f93a682b15a7801537e89d7d +Author: Dan Williams +Date: Mon Apr 5 18:46:53 2010 -0700 + + cdma: fix subclass registration state checking in error paths + (rh #569067) + + The generic CDMA superclass already checks minimal registration state, + and when some of the additional query_registration_state() subclass + checks + were being performed, if the device returned an error (if it didn't + support + the subclass' specific registration command like *STATE or ^SYSINFO) + the + superclass' registration state checks would be thrown away. + + Fix that by specifying the behavior of the subclass' + query_registration_state() methods to ignore most errors and leave the + superclass' registration state intact if a non-critical error occurs. + + plugins/mm-modem-anydata-cdma.c | 45 +++-------- + plugins/mm-modem-huawei-cdma.c | 26 +++---- + plugins/mm-modem-sierra-cdma.c | 8 +- + src/mm-generic-cdma.c | 168 + ++++++++++++++++++++++++---------------- + src/mm-generic-cdma.h | 26 +++++++ + 5 files changed, 153 insertions(+), 120 deletions(-) + +commit 49c363d83af84021f74f04c8141313d21e75821b +Author: Dan Williams +Date: Mon Apr 5 12:26:12 2010 -0700 + + core: fix handling of deferred ports during probe + + The next plugin logic was wrong when a previous plugin had already + claimed support for the port and the Generic plugin was next. In + that case, the code failed to call the functions to actually grab + the port. + + src/mm-manager.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 0108a36d27b84dee2bf1934f6d5403b7d683099a +Author: Dan Williams +Date: Mon Apr 5 12:01:54 2010 -0700 + + serial: let port subclasses handle their own debug logging + + We want to print out QCDM messages as hex, not ASCII. So let + each port type print out it's own communication as it wants to. + + src/mm-at-serial-port.c | 32 ++++++++++++++++++++++++++++++++ + src/mm-qcdm-serial-port.c | 19 +++++++++++++++++++ + src/mm-serial-port.c | 36 ++++-------------------------------- + src/mm-serial-port.h | 5 +++++ + 4 files changed, 60 insertions(+), 32 deletions(-) + +commit bac945a8e4c1176d75f6c7d6622a516f673aaf65 +Author: Dan Williams +Date: Mon Apr 5 11:15:09 2010 -0700 + + core: fix supports check for last plugin (rh #579247) + + Since Generic is always last, it was getting ignored by this + off-by-one bug caused by a previous patch. + + src/mm-manager.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a55265f03a378dd34df1e509b76888a18e0b434f +Author: Dan Williams +Date: Mon Apr 5 10:47:14 2010 -0700 + + gsm: clean up periodic poll start/stop and poll signal strength + + src/mm-generic-gsm.c | 41 +++++++++++++++++++++++++++++++++++++---- + 1 file changed, 37 insertions(+), 4 deletions(-) + +commit 7da2b5cb6aa16531f1d6b9ea905442338c858ebd +Author: Dan Williams +Date: Mon Apr 5 10:38:39 2010 -0700 + + cdma: clean up periodic poll start/stop + + And fix a small bug where polling wasn't started for the ENABLED + state. + + src/mm-generic-cdma.c | 27 +++++---------------------- + 1 file changed, 5 insertions(+), 22 deletions(-) + +commit 9112180f8ad36ee7da5eeb6012709c278a4e113b +Author: Dan Williams +Date: Mon Apr 5 09:58:12 2010 -0700 + + cdma: periodically poll registration state and quality + + src/mm-generic-cdma.c | 70 + +++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 62 insertions(+), 8 deletions(-) + +commit 2f1fbfb52039813283add147f79f287d6dc3f3df +Author: Dan Williams +Date: Sun Apr 4 09:17:08 2010 -0700 + + core: only enable location API for dbus-glib >= 0.86 + + configure.ac | 15 +++++++++++++++ + src/Makefile.am | 23 ++++++++++++++++------- + src/mm-modem-location.c | 10 ++++++++++ + 3 files changed, 41 insertions(+), 7 deletions(-) + +commit f39afdd5f7c5d6ed56dd7a00ddb13de12dcda5b8 +Author: Dan Williams +Date: Wed Mar 31 20:24:12 2010 -0700 + + qcdm: fix endian issues for BE platforms + + And add a testcase for packet encapsulation to ensure we don't + have further endian issues in the future. + + libqcdm/src/utils.c | 8 +++++--- + libqcdm/tests/test-qcdm-utils.c | 27 +++++++++++++++++++++++++-- + libqcdm/tests/test-qcdm-utils.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 4 files changed, 33 insertions(+), 5 deletions(-) + +commit 4d89b519b4c889859a84780a18dbb2f12c9a9438 +Author: Dan Williams +Date: Wed Mar 31 03:05:22 2010 -0700 + + core: don't advance to next plugin until needed + + Otherwise info->cur_plugin is wrong (and therefore we left uncleared + supports tasks in MMPluginBase) when the port isn't supported by + the plugin, but it's parent modem device was supported by the plugin. + Like when all probing of the port fails but one of it's siblings has + already been claimed by a modem; in this case we just drop the port + (so that no other plugin could try to claim it, because only one + plugin is allowed to handle all a modem's ports) but we still need + to tell the parent modem's plugin to clean up the supports task. + + src/mm-manager.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 40a713be6f8e8a40be7a72f674db5f105c59e8a2 +Author: Dan Williams +Date: Tue Mar 30 23:36:08 2010 -0700 + + core: pass try_supports_port() the existing modem + + src/mm-manager.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 4753f7360b7809e4efc62bcff6d5d1194524b83f +Author: Dan Williams +Date: Tue Mar 30 23:28:26 2010 -0700 + + core: don't re-export modems after + db413acc4e9d364e1c4ecdde0da3fade012912ab + + If a port is found by the kernel after the modem is already exported, + make sure we don't re-export the modem after the tardy port is + handled. + + src/mm-manager.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit d2e12742c4bbeb093634f8257f7c009722e633cf +Author: Dan Williams +Date: Tue Mar 30 17:28:13 2010 -0700 + + cdma: use best active pilot EC/IO for signal strength when connected + + If the modem doesn't have two AT ports (so one can be used for AT+CSQ + while connected) get the 1x active pilot's EC/IO and use that for + signal strength. + + src/mm-generic-cdma.c | 81 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 77 insertions(+), 4 deletions(-) + +commit db413acc4e9d364e1c4ecdde0da3fade012912ab +Author: Dan Williams +Date: Tue Mar 30 16:06:55 2010 -0700 + + core: only export modems when all ports are handled + + A modem is now only exported to D-Bus when both of the following + are true: + + 1) the modem is valid + 2) all ports the modem provides have been handled by appropriate + plugins + + This ensures that all the modem's ports are completely ready before + any clients can do anything with it. In the case of CDMA modems with + QCDM ports, this allows the QCDM ports to be detected before exporting + the modem. Since the QCDM detection comes after AT probing, + previously + this resulted in a CDMA modem getting exported to clients before + we had + a QCDM port to query for registration status. + + src/mm-manager.c | 196 + ++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 152 insertions(+), 44 deletions(-) + +commit df08f6a43ff8acc617f7330d25450a3a62809ffb +Author: Dan Williams +Date: Tue Mar 30 15:03:35 2010 -0700 + + core: find the existing modem for a port in the manager + + src/mm-manager.c | 10 +++++++++- + src/mm-plugin-base.c | 50 + ++++---------------------------------------------- + src/mm-plugin-base.h | 3 --- + src/mm-plugin.c | 5 ++++- + src/mm-plugin.h | 4 ++++ + 5 files changed, 21 insertions(+), 51 deletions(-) + +commit 720e38aec0a50aa2136f01b7f3620a4e261c0406 +Author: Dan Williams +Date: Tue Mar 30 14:50:40 2010 -0700 + + core: move physical device checking into the manager + + It turns out that the manager needs to know about the physical + device so we can prevent multiple plugins from claiming ports on + the same modem. + + plugins/mm-plugin-anydata.c | 11 +---- + plugins/mm-plugin-generic.c | 11 +---- + plugins/mm-plugin-gobi.c | 11 +---- + plugins/mm-plugin-hso.c | 11 +---- + plugins/mm-plugin-huawei.c | 11 +---- + plugins/mm-plugin-longcheer.c | 11 +---- + plugins/mm-plugin-mbm.c | 34 ++++++++----- + plugins/mm-plugin-moto-c.c | 11 +---- + plugins/mm-plugin-nokia.c | 11 +---- + plugins/mm-plugin-novatel.c | 11 +---- + plugins/mm-plugin-option.c | 11 +---- + plugins/mm-plugin-sierra.c | 11 +---- + plugins/mm-plugin-zte.c | 11 +---- + src/mm-manager.c | 109 + +++++++++++++++++++++++++++++++++++------- + src/mm-plugin-base.c | 77 +++++++---------------------- + src/mm-plugin-base.h | 9 +--- + src/mm-plugin.c | 9 +++- + src/mm-plugin.h | 2 + + 18 files changed, 164 insertions(+), 208 deletions(-) + +commit 39326f249105b7d71c63125f29e3bee2143a82d2 +Author: Dan Williams +Date: Tue Mar 30 01:01:53 2010 -0700 + + cdma: use DM for serving system if possible + + src/mm-generic-cdma.c | 85 + +++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 72 insertions(+), 13 deletions(-) + +commit a7e7854171e5029e43b2442c9e25814b59cd7c67 +Author: Dan Williams +Date: Tue Mar 30 00:57:15 2010 -0700 + + qcdm: don't fail testcase on unknown mode pref values + + EC168C has a value of 0x16 for mode pref, which is unknown. But + that shouldn't fail the testcases. + + libqcdm/tests/test-qcdm-com.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 41c2e0a946f6d0d14805cdea60d5d03ec67f3fb2 +Author: Dan Williams +Date: Tue Mar 30 00:48:55 2010 -0700 + + qcdm: add CM subsystem digital only mode preference + + Found on the Huawei EC121. + + libqcdm/src/commands.h | 1 + + libqcdm/tests/test-qcdm-com.c | 3 +++ + 2 files changed, 4 insertions(+) + +commit fc33616ae2101f679f9be6c58e0a8e620d63d8f3 +Author: Dan Williams +Date: Tue Mar 30 00:38:14 2010 -0700 + + qcdm: fix testcases for various devices + + Huawei EC121 doesn't implement the MDN NV item, and we're also missing + some values for the CM subsystem mode pref enum. + + libqcdm/tests/test-qcdm-com.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 0ae176c63c8686cd3a86b7933be5ae3546782475 +Author: Dan Williams +Date: Tue Mar 30 00:32:05 2010 -0700 + + qcdm: add Pilot Set retrieval for signal strength calculations + + Determined from various sources including RTManager and + "Technical Introduction to CDMA" (Course RF100 Chapter 7). + + libqcdm/src/commands.c | 122 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 28 ++++++++++ + libqcdm/src/dm-commands.h | 16 ++++++ + libqcdm/tests/test-qcdm-com.c | 54 +++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 223 insertions(+) + +commit cff40ac4724780e73f47af4f17cba952ab1ed680 +Author: Dan Williams +Date: Tue Mar 30 00:29:31 2010 -0700 + + qcdm: allow result objects to hold boxed types + + libqcdm/src/result-private.h | 10 ++++++++++ + libqcdm/src/result.c | 44 + +++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 53 insertions(+), 1 deletion(-) + +commit 71c6fa79f77a5475d03e276ddd782decf1f00fa4 +Author: Dan Williams +Date: Mon Mar 29 16:42:53 2010 -0700 + + qcdm: fix CRC checking on some packets + + Should be pointing to the CRC location in the *unescaped* packet + buffer since the CRC is subject to escaping/unescaping. Previous + code pointed to the wrong location in the escaped packet buffer, + which was often pointing to the write place if there weren't many + escaped bytes in the input buffer, but was still wrong. + + libqcdm/src/utils.c | 2 +- + libqcdm/tests/Makefile.am | 2 ++ + libqcdm/tests/test-qcdm-utils.c | 63 + +++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-utils.h | 24 ++++++++++++++++ + libqcdm/tests/test-qcdm.c | 2 ++ + 5 files changed, 92 insertions(+), 1 deletion(-) + +commit 2f099e2964040e5499f332a892352f148f5b0177 +Author: Dan Williams +Date: Mon Mar 29 00:23:07 2010 -0700 + + qcdm: complete Version Info command fields + + Found in RTManager + + libqcdm/src/dm-commands.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit a98fa8a4b3419a233b80ff88da40b515afa9cb1c +Author: Dan Williams +Date: Mon Mar 29 00:08:46 2010 -0700 + + qcdm: fix up CDMA Status command fields and values + + Found in two sources: + a) Руководство пользования тестером + CDMA-450 + b) RTManager + + libqcdm/src/commands.c | 3 +++ + libqcdm/src/commands.h | 22 +++++++++++++---- + libqcdm/src/dm-commands.h | 18 ++++++++++---- + libqcdm/tests/test-qcdm-com.c | 56 + +++++++++++++++++++++++++++++++++++++++++-- + 4 files changed, 87 insertions(+), 12 deletions(-) + +commit 98e8108ac2a2fe4d5fab254b07170ae3ffeb0ad4 +Author: Dan Williams +Date: Sun Mar 28 23:39:19 2010 -0700 + + qcdm: update CM subsys system modes + + libqcdm/src/commands.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 4d426ebbbd210795e31869225f895257c3546112 +Author: Dan Williams +Date: Sun Mar 28 09:30:16 2010 -0700 + + gsm: only set auto registration if the modem isn't idle (related: + bgo #591047) + + Some modems (Huawei E1552) appear to have problems with auto + registration + in some circumstances that we don't yet fully understand, such + that when + AT+COPS=0 is sent they never end up registering with the correct + network. + As a minor workaround, if the modem is already registered with + a provider + and the user hasn't specified manual registration, don't set auto + registration but let the modem figure it out itself. + + See (bgo #591047) for more details. + + src/mm-generic-gsm.c | 33 ++++++++++++++++++++++++++++----- + 1 file changed, 28 insertions(+), 5 deletions(-) + +commit fe69ab4210bfacda97257b6a08e85f6ce433f7d0 +Author: Dan Williams +Date: Sun Mar 28 09:12:17 2010 -0700 + + huawei: ensure modem ports get claimed even if probe fails + + Previously there was an issue where if the probe failed, because + we can't really probe huawei secondary ports for various reasons, + the Generic plugin would eventually come around and try actively + probing the secondary port after the Huawei plugin said "I don't + support this port". Which resulted (potentially) in two MMModem + objects for the same device (one driven by Huawei, the other by + Generic). + + plugins/mm-plugin-huawei.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit b876182fe60401eae86267f8cf1c6726a7a0eddc +Author: Dan Williams +Date: Fri Mar 26 01:27:49 2010 -0700 + + zte: implement GSM solicited access technology request + + plugins/mm-modem-zte.c | 97 + +++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 77 insertions(+), 20 deletions(-) + +commit 23986f8b0e8ff10ac2946e30290b79f3b4e4af8e +Author: Dan Williams +Date: Fri Mar 26 01:15:20 2010 -0700 + + huawei: implement GSM solicited access technology request + + plugins/mm-modem-huawei-gsm.c | 91 + +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 91 insertions(+) + +commit a50708dbeaea06e71ac96d2cc9d48257ed12f993 +Author: Dan Williams +Date: Fri Mar 26 00:27:30 2010 -0700 + + sierra: implement GSM solicited access technology request + + plugins/mm-modem-sierra-gsm.c | 64 + ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 63 insertions(+), 1 deletion(-) + +commit 3d12055818d31b0fa08425d33cf43f50e0439333 +Author: Dan Williams +Date: Fri Mar 26 00:16:24 2010 -0700 + + gsm: ensure solicited access technology is valid before using it + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 843a772b4c1f65f4c04d1382a4b1ee69e8fcf22c +Author: Dan Williams +Date: Fri Mar 26 00:14:47 2010 -0700 + + option/hso: implement solicited access technology request + + plugins/mm-modem-hso.c | 9 +++ + plugins/mm-modem-option-utils.c | 130 + ++++++++++++++++++++++++++++++++-------- + plugins/mm-modem-option.c | 9 +++ + 3 files changed, 124 insertions(+), 24 deletions(-) + +commit a83dcdba8a154e32e7112434a96f588dac3303f1 +Author: Dan Williams +Date: Fri Mar 26 00:14:23 2010 -0700 + + gsm: update access technology on successful registration + + src/mm-generic-gsm.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 4dbc2f2e9b840e34c23a56ab698799a9b9c3195b +Author: Dan Williams +Date: Thu Mar 25 13:47:30 2010 -0700 + + gsm: fix wrong comparison + + Bug didn't have much of an effect, but should be fixed anyway. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0b9c173fe97cca9f57ef9fe3b9fcbd08e10becbc +Author: Dan Williams +Date: Tue Mar 23 14:37:01 2010 -0700 + + core: assume +CPIN "READY" response indicates GSM capability + (rh #573510) + + Assume (for now) that devices that respond to AT+CPIN without an + error are GSM devices. This may not be 100% true as some devices + in Asia (where CDMA devices use RUIMs which are basically SIMs) + support + +CPIN for unlocking the RUIM, but since CDMA devices more consistently + implement AT+GCAP and ATI than we should be safe for a while. + + src/mm-plugin-base.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e7d1e4adb9bf984736ae2bfadbdd616ebc6ade80 +Author: Dan Williams +Date: Tue Mar 23 02:10:58 2010 -0700 + + cdma: use DM Call Manager for registration status if available + + This should solve problems with users who's providers are EVDO + only and thus the device isn't in 1X mode, but who's modems + don't set anything meaningful for CAD or CSS when the 1X radio + isn't registered. Previously, MM would just spin thinking it + wasn't registered when trying to connect. + + This was mostly found with AnyDATA, Huawei, and some ZTE devices + from Russia and India. + + src/mm-generic-cdma.c | 84 + +++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 82 insertions(+), 2 deletions(-) + +commit bcfb75d88de4679d1ca2dfc65395c49315534ec0 +Author: Dan Williams +Date: Tue Mar 23 01:36:00 2010 -0700 + + core: grab probed QCDM ports for plugins where they are useful + + plugins/mm-plugin-anydata.c | 19 ++++++++++++------- + plugins/mm-plugin-generic.c | 17 +++++++++++------ + plugins/mm-plugin-gobi.c | 10 ++++------ + plugins/mm-plugin-huawei.c | 4 ++++ + plugins/mm-plugin-longcheer.c | 15 +++++++++------ + plugins/mm-plugin-moto-c.c | 20 ++++++++++++-------- + plugins/mm-plugin-nokia.c | 10 ++++------ + plugins/mm-plugin-novatel.c | 17 +++++++++++------ + plugins/mm-plugin-option.c | 13 +++++++------ + plugins/mm-plugin-sierra.c | 11 ++++------- + plugins/mm-plugin-zte.c | 17 ++++++++++------- + src/mm-generic-cdma.c | 26 +++++++++++++++++++++++--- + src/mm-generic-gsm.c | 13 +++++++++++-- + src/mm-modem-base.c | 10 +++++++--- + src/mm-plugin-base.c | 4 ++-- + src/mm-port.h | 3 ++- + 16 files changed, 133 insertions(+), 76 deletions(-) + +commit c36aacee0a287f1d9b7365fd79a48555b92e1356 +Author: Dan Williams +Date: Mon Mar 22 22:28:36 2010 -0700 + + qcdm: use tcsetattr/tcgetattr for better compatibility + + With Alpha, mainly. + + libqcdm/src/com.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +commit 76130862ed0aefce244e98a740c826a3452857e6 +Author: Dan Williams +Date: Mon Mar 22 15:41:14 2010 -0700 + + core: cleanly disable modems on shutdown + + src/main.c | 10 +++++++++ + src/mm-manager.c | 65 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-manager.h | 4 ++++ + 3 files changed, 79 insertions(+) + +commit 9e8a0fda9fb63e7db824e5d86fd3b99d52974327 +Author: Dan Williams +Date: Mon Mar 22 15:05:45 2010 -0700 + + option/hso: ensure unsolicited messages get turned off on disable + + plugins/mm-modem-hso.c | 42 +++++++++++++++++++++++++--------- + plugins/mm-modem-option-utils.c | 31 ++++++++++++++++++++----- + plugins/mm-modem-option.c | 50 + ++++++++++++++++++++++++++++++++++++----- + 3 files changed, 102 insertions(+), 21 deletions(-) + +commit 7a5ba2e0990753b3e41a9fc3a95f743dec4f7160 +Author: Dan Williams +Date: Mon Mar 22 15:03:58 2010 -0700 + + option/hso: make use of unsolicited access technology signals + + plugins/mm-modem-option-utils.c | 141 + +++++++++++++++++++++++++++------------- + 1 file changed, 96 insertions(+), 45 deletions(-) + +commit 282ba6561e078b533ed4a38b77a36e23181c04ca +Author: Dan Williams +Date: Mon Mar 22 14:56:47 2010 -0700 + + gsm: fix argument validation in SetAllowedMode + + src/mm-modem-gsm-network.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 6ab36bacf3a940beb9c452197726650f53842329 +Author: Dan Williams +Date: Mon Mar 22 13:03:53 2010 -0700 + + qcdm: add ZTE signal strength request + + libqcdm/src/commands.c | 37 +++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 12 ++++++++++++ + libqcdm/src/dm-commands.h | 15 +++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 36 ++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 103 insertions(+) + +commit 7fbe4d83830ded45d7e2c2d71f22fa78e221226c +Author: Dan Williams +Date: Mon Mar 22 00:28:21 2010 -0700 + + cdma: check SPSERVICE and SPERI when getting registration state + + src/mm-generic-cdma.c | 130 +++++++++++++++++++++------ + src/mm-modem-helpers.c | 233 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 4 + + 3 files changed, 342 insertions(+), 25 deletions(-) + +commit 3b32e2a679f37b3913a12097581b065013d91f47 +Author: Dan Williams +Date: Sun Mar 21 17:50:45 2010 -0700 + + cdma: check for +SPSERVICE and $SPERI + + Which are Sprint-specific commands which appear to be implemented by + various phones for getting access technology and roaming status. + + src/mm-generic-cdma.c | 26 ++++++++++++++++++++++++++ + src/mm-modem-helpers.c | 37 +++++++++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 6 ++++++ + 3 files changed, 69 insertions(+) + +commit 6598d2ef7f501feb799652db0ebaf25e4cba1a45 +Author: Dan Williams +Date: Sun Mar 21 17:48:19 2010 -0700 + + core: parse the right thing on QCDM version info response + + src/mm-plugin-base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 96f5400cc92589f6419b9dc961d7c3cff97f7f2a +Author: Dan Williams +Date: Sun Mar 21 17:47:15 2010 -0700 + + core: fix error when unescaping QCDM packet fails + + src/mm-qcdm-serial-port.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit f3e660444c70ea35bdb7f6358301450ec15d0140 +Author: Dan Williams +Date: Sat Mar 20 00:58:14 2010 -0700 + + core: fix 64-bit build error in QCDM packet decapsulation + + src/mm-qcdm-serial-port.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 88c1423838938397d983823b57b614b386d0b5b3 +Author: Dan Williams +Date: Sat Mar 20 03:53:44 2010 -0700 + + qcdm: clarify note about CM state vs. roam/mode pref values + + libqcdm/src/commands.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit c03556f820797584a4657e7c214afa0b7762bd7d +Author: Dan Williams +Date: Sat Mar 20 03:53:31 2010 -0700 + + qcdm: fix up testcase output + + libqcdm/tests/test-qcdm-com.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit 2e62a2e0a61d3de8ce809203c98b3890f627b9b9 +Author: Dan Williams +Date: Sat Mar 20 03:39:10 2010 -0700 + + core: probe ports for QCDM capability too + + src/mm-plugin-base.c | 141 + +++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-plugin-base.h | 1 + + 2 files changed, 131 insertions(+), 11 deletions(-) + +commit 418ba174dc4aa1a3b34d191684cf04dbe9d45b2f +Author: Dan Williams +Date: Sat Mar 20 03:38:54 2010 -0700 + + qcdm: fix decapsulation buffer size calculation + + src/mm-qcdm-serial-port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ff2182fe1d1fdc6817835839c062129d1adb629d +Author: Dan Williams +Date: Sat Mar 20 02:57:33 2010 -0700 + + core: let partial serial responses be consumed by the handlers + + src/mm-at-serial-port.c | 4 +++- + src/mm-qcdm-serial-port.c | 32 +++++++++++++++++++++++++------- + src/mm-serial-port.c | 18 ++++++++++-------- + src/mm-serial-port.h | 5 +++-- + 4 files changed, 41 insertions(+), 18 deletions(-) + +commit 4006ca4decaec051aa4449977d92f96545b3aa88 +Author: Dan Williams +Date: Sat Mar 20 02:28:01 2010 -0700 + + qcdm: better checking of NV read/write command results + + libqcdm/src/commands.c | 51 + +++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 40 insertions(+), 11 deletions(-) + +commit c4a1a78c43a1c207f1b2d38411912fe4883025e1 +Author: Dan Williams +Date: Sat Mar 20 00:09:38 2010 -0700 + + qcdm: complete mode preference implementation + + libqcdm/src/commands.c | 102 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 33 ++++++++++++++ + libqcdm/src/nv-items.h | 1 - + libqcdm/tests/test-qcdm-com.c | 56 +++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 194 insertions(+), 1 deletion(-) + +commit 26c1402aaee740cd27bd477d2ecf10ee3e8377b7 +Author: Dan Williams +Date: Fri Mar 19 19:18:02 2010 -0700 + + qcdm: add initial roaming and mode preference bits + + libqcdm/src/commands.c | 127 + +++++++++++++++++++++++++++++++++++++++++- + libqcdm/src/commands.h | 43 ++++++++++++++ + libqcdm/src/error.c | 1 + + libqcdm/src/error.h | 3 +- + libqcdm/src/nv-items.h | 30 ++++++++++ + libqcdm/tests/test-qcdm-com.c | 74 +++++++++++++++++++++++- + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 8 files changed, 276 insertions(+), 5 deletions(-) + +commit 5897d8f27516ba7510c3828eab9a9374fac9020f +Author: Dan Williams +Date: Fri Mar 19 11:09:43 2010 -0700 + + gsm: PIN2 doesn't block enabling either + + Again, only required for various dialing features we don't deal with + yet. + + src/mm-generic-gsm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit f5f388c7fd6d41a03447b710fc644d98efcabb0a +Author: Dan Williams +Date: Fri Mar 19 11:05:05 2010 -0700 + + gsm: use new callback info chain functions for simple status + + src/mm-generic-gsm.c | 27 ++++----------------------- + 1 file changed, 4 insertions(+), 23 deletions(-) + +commit 85fc71818e3f3058cf256aaab1ba269a424a27f8 +Author: Dan Williams +Date: Fri Mar 19 11:01:19 2010 -0700 + + core: have modem base class handle card information + + src/mm-generic-cdma.c | 115 +++++---------------------- + src/mm-generic-gsm.c | 103 +++++-------------------- + src/mm-modem-base.c | 209 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem-base.h | 17 ++++ + 4 files changed, 266 insertions(+), 178 deletions(-) + +commit 4558df894bb20a121ee1d2942c206b5bfde2c030 +Author: Dan Williams +Date: Fri Mar 19 10:57:01 2010 -0700 + + helpers: add generic response stripping function + + src/mm-modem-helpers.c | 16 ++++++++++++++++ + src/mm-modem-helpers.h | 2 ++ + 2 files changed, 18 insertions(+) + +commit 6ca5765eb63e1cb0374489607b255feeca8e2ba7 +Author: Dan Williams +Date: Fri Mar 19 10:54:10 2010 -0700 + + core: add chaining helper functions to callback info + + Helpful when chaining a number of commands together when you want + to schedule the callback info only after all of them complete. + + src/mm-callback-info.c | 23 +++++++++++++++++++++++ + src/mm-callback-info.h | 6 ++++++ + 2 files changed, 29 insertions(+) + +commit bb62cfe07a47189645da985cc02b47549611aa01 +Author: Dan Williams +Date: Thu Mar 18 18:08:23 2010 -0700 + + core: add base location API implementation + + policy/org.freedesktop.modem-manager.policy.in | 9 + + src/Makefile.am | 7 +- + src/mm-auth-provider.h | 1 + + src/mm-modem-location.c | 320 + +++++++++++++++++++++++++ + src/mm-modem-location.h | 73 ++++++ + 5 files changed, 409 insertions(+), 1 deletion(-) + +commit 1df244f3079548d371a10c5d35b6ad00d04d8701 +Author: Dan Williams +Date: Thu Mar 18 08:47:14 2010 -0700 + + api: fix syntax error + + introspection/mm-modem-location.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb2b80f11a081128ecf966eae5454534fbacc89c +Author: Dan Williams +Date: Wed Mar 17 12:05:31 2010 -0700 + + serial: flush I/O right after open + + We don't really care about anything that came before. + + src/mm-serial-port.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 857dcd7bcfd909a9c4dad8dcbe562e75c8a66116 +Author: Michael Biebl +Date: Wed Mar 17 11:59:29 2010 -0700 + + serial: use termios instead of old terminal ioctls + + Makes sure we build on Alpha, plus the right thing to do. + + src/mm-serial-port.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit 0815597d8db7f59ed6030ff11ce070b2a8eb4f11 +Author: Dan Williams +Date: Wed Mar 17 00:40:13 2010 -0700 + + qcdm: fix command buffer initialization + + Use the right buffer size to initialize. + + libqcdm/src/commands.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit d7a0ad768682c5fe9d4b014578f4eaea85f91a63 +Author: Dan Williams +Date: Tue Mar 16 22:44:09 2010 -0700 + + gsm: implement roaming triggers + + src/mm-generic-gsm.c | 101 + ++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 79 insertions(+), 22 deletions(-) + +commit 2c65e0ceaa40f103d9176f483469e38455bdba1c +Author: Dan Williams +Date: Tue Mar 16 17:19:21 2010 -0700 + + gsm: ignore SIM-PUK2 unlock required + + Device is functional without it; it's only required for stuff + we don't do yet. + + src/mm-generic-gsm.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 79bca53f21abcb4ec22e41e0f21b2af2df9d830a +Author: Dan Williams +Date: Tue Mar 16 17:03:55 2010 -0700 + + cdma: simplify finding the right serial port for commands + + plugins/mm-modem-anydata-cdma.c | 19 ++---- + plugins/mm-modem-huawei-cdma.c | 19 ++---- + plugins/mm-modem-novatel-cdma.c | 20 ++----- + plugins/mm-modem-sierra-cdma.c | 18 ++---- + src/mm-generic-cdma.c | 129 + ++++++++++++++++++++-------------------- + src/mm-generic-cdma.h | 3 + + 6 files changed, 87 insertions(+), 121 deletions(-) + +commit 6266f949ba5e745c385d674b2aa934f42b0fb17c +Author: Dan Williams +Date: Tue Mar 16 16:45:32 2010 -0700 + + gsm: fix operator name on Option devices with UCS2 charset + + src/mm-charsets.c | 92 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-charsets.h | 5 +++ + src/mm-generic-gsm.c | 43 ++++++++++++++++++++++-- + 3 files changed, 137 insertions(+), 3 deletions(-) + +commit c18dfa67d81d5a16acf78c2267bccae352fe06c6 +Author: Dan Williams +Date: Tue Mar 16 15:53:09 2010 -0700 + + gsm: turn off unsolicited messages on disable + + src/mm-generic-gsm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit bdefdac2dce29361c584098ae457f5d8a92ed8dc +Author: Dan Williams +Date: Tue Mar 16 15:51:27 2010 -0700 + + hso: add allowed mode and unsolicited response handling + + plugins/mm-modem-hso.c | 51 + ++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 49 insertions(+), 2 deletions(-) + +commit ad9fe9da28ef5a924e66a834b8601eb87cb2aa52 +Author: Dan Williams +Date: Tue Mar 16 15:50:58 2010 -0700 + + option: generalize common Option/HSO mode and unsolicited response + handling + + plugins/Makefile.am | 3 +- + plugins/mm-modem-option-utils.c | 297 + ++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-option.c | 151 +++++++------------- + 3 files changed, 348 insertions(+), 103 deletions(-) + +commit 4d5f4f9a827e48ae2f2b29b97b8f719bb1b6fde6 +Author: Dan Williams +Date: Tue Mar 16 15:16:01 2010 -0700 + + gsm: only change allowed mode during Simple.Connect when needed + + src/mm-generic-gsm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 6744e08104708ccc97fbab787629685f0d28689e +Author: Dan Williams +Date: Tue Mar 16 13:17:14 2010 -0700 + + gsm: simplify finding the right serial port for commands + + plugins/mm-modem-gobi-gsm.c | 11 +-- + plugins/mm-modem-huawei-gsm.c | 76 +++++++++----------- + plugins/mm-modem-mbm.c | 29 ++++---- + plugins/mm-modem-option.c | 24 ++++--- + plugins/mm-modem-sierra-gsm.c | 21 +++++- + plugins/mm-modem-zte.c | 36 ++++++---- + src/mm-generic-gsm.c | 161 + +++++++++++++++++++++--------------------- + src/mm-generic-gsm.h | 3 + + 8 files changed, 197 insertions(+), 164 deletions(-) + +commit b002e54cf4c6edf1858eb82de7cf41a5c9a9d29b +Author: Dan Williams +Date: Tue Mar 16 13:03:13 2010 -0700 + + core: immediately reject Sierra CnS ports during probe + + For now; until Sierra releases their CnS documentation. + + src/mm-plugin-base.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 882a86040ed611377191ddb4510ffb1bcf60e0e2 +Author: Dan Williams +Date: Tue Mar 16 11:52:01 2010 -0700 + + gsm: make mm_generic_gsm_check_pin() static + + No more external users of it. + + src/mm-generic-gsm.c | 16 ++++++++-------- + src/mm-generic-gsm.h | 4 ---- + 2 files changed, 8 insertions(+), 12 deletions(-) + +commit eff1bcc7f34cbc8d215941625b24eda18343f4f4 +Author: Dan Williams +Date: Tue Mar 16 11:42:57 2010 -0700 + + huawei: simplify setting allowed mode + + plugins/mm-modem-huawei-gsm.c | 104 + ++++++++++++++++++------------------------ + 1 file changed, 44 insertions(+), 60 deletions(-) + +commit 8af469ccad79a2d27bf445c35b235af3a62d89b2 +Author: Dan Williams +Date: Tue Mar 16 11:38:34 2010 -0700 + + huawei: clean up and simplify band handling + + plugins/mm-modem-huawei-gsm.c | 174 + +++++++++++++++++++++++------------------- + 1 file changed, 95 insertions(+), 79 deletions(-) + +commit e3aa8d50085f0d7d2667170326c7897995ed7466 +Author: Dan Williams +Date: Tue Mar 16 11:04:12 2010 -0700 + + api: add UMTS 1900MHz (Class II) band + + introspection/mm-modem-gsm.xml | 3 +++ + src/mm-modem-gsm.h | 3 ++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 19257f540c0de61043492af5bec94e5319749b3e +Author: Dan Williams +Date: Tue Mar 16 11:02:35 2010 -0700 + + gsm: handle allowed mode during Simple.Connect() + + plugins/mm-modem-mbm.c | 82 +++++++++--------------------------- + src/mm-generic-gsm.c | 111 + +++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-modem-gsm.h | 4 +- + 3 files changed, 124 insertions(+), 73 deletions(-) + +commit e0c3052b0ff274d055a7bd3a380dca7da5eabb8c +Author: Dan Williams +Date: Tue Mar 16 10:29:47 2010 -0700 + + huawei: handle unsolicited unregistered mode change + + plugins/mm-modem-huawei-gsm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 70d9d60d0c3cb3a9d60c1c501f9053a1a7485c99 +Author: Dan Williams +Date: Mon Mar 15 14:52:21 2010 -0700 + + mbm: send internet account username/password in modem character set + + Apparently at least the F3507g wants the username and password in + the modem's current character set, otherwise it sends the wrong + thing over-the-air. + + plugins/mm-modem-mbm.c | 53 + +++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 39 insertions(+), 14 deletions(-) + +commit d9a47ef2e81fe0b7c3aa9f05af3233181e5a73a1 +Author: Dan Williams +Date: Mon Mar 15 14:51:18 2010 -0700 + + core: fix serial port base class callback types + + src/mm-at-serial-port.c | 4 ++-- + src/mm-qcdm-serial-port.c | 4 ++-- + src/mm-serial-port.c | 22 ++++++++++++++++++---- + src/mm-serial-port.h | 10 ++++++++-- + 4 files changed, 30 insertions(+), 10 deletions(-) + +commit 3151e0e2987d8505a56c5a6a0f486e3a7e8ada71 +Author: Dan Williams +Date: Mon Mar 15 14:25:49 2010 -0700 + + core: add command helper that handles character set conversion + + src/mm-charsets.c | 90 + ++++++++++++++++++++++++++++++++++++++++++++++--------- + src/mm-charsets.h | 9 ++++++ + 2 files changed, 85 insertions(+), 14 deletions(-) + +commit 2dd7e12f721215e6cc3a809542408bd65c1fbd04 +Author: Dan Williams +Date: Mon Mar 15 14:24:59 2010 -0700 + + gsm: allow subclasses to retrieve current character set + + src/mm-generic-gsm.c | 9 +++++++++ + src/mm-generic-gsm.h | 3 +++ + 2 files changed, 12 insertions(+) + +commit a872107cfcb497dabcd48186ca860dae60c370b3 +Author: Dan Williams +Date: Mon Mar 15 11:57:01 2010 -0700 + + api: better define Scan() command results + + introspection/mm-modem-gsm-network.xml | 33 + ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +commit 2a94d38edcc476022333a93dc979cc2bcf9ba5a2 +Author: Dan Williams +Date: Sat Mar 13 16:37:24 2010 -0800 + + core: move charset enum/string conversion to it's own file + + src/Makefile.am | 2 ++ + src/mm-charsets.c | 71 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-charsets.h | 38 +++++++++++++++++++++++++++++ + src/mm-modem.c | 48 ------------------------------------- + src/mm-modem.h | 17 +------------ + 5 files changed, 112 insertions(+), 64 deletions(-) + +commit ac7310ab1050701c07705e548c408d97aea76636 +Author: Dan Williams +Date: Sat Mar 13 16:26:46 2010 -0800 + + gsm: add character set get/set support + + configure.ac | 3 + + src/mm-errors.c | 1 + + src/mm-errors.h | 3 +- + src/mm-generic-gsm.c | 354 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-modem.c | 93 ++++++++++++++ + src/mm-modem.h | 35 +++++ + 6 files changed, 469 insertions(+), 20 deletions(-) + +commit 429c7cc661780d2848a97b092e1a0023e8c4d603 +Author: Dan Williams +Date: Fri Mar 12 17:06:04 2010 -0800 + + sierra: implement GSM mode preference handling + + plugins/mm-modem-sierra-gsm.c | 132 + ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 132 insertions(+) + +commit 2777f9f4884f04e0abc23e4df62391c3f0a3e0bd +Author: Dan Williams +Date: Fri Mar 12 16:59:39 2010 -0800 + + trivial: spacing fixes + + plugins/mm-modem-zte.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4202bfb86e2ff6986d3aebdc38946367f09c2a9f +Author: Dan Williams +Date: Fri Mar 12 16:49:22 2010 -0800 + + zte: implement GSM mode preference handling + + plugins/mm-modem-zte.c | 140 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +commit c11c0431ff3bc39a0d7f2d74727a4cafbede096e +Author: Dan Williams +Date: Fri Mar 12 15:34:27 2010 -0800 + + trivial: gitignore updates + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit 179604d6cb0d5b78dfd8907bad4f64d8045958a8 +Author: Dan Williams +Date: Fri Mar 12 15:33:46 2010 -0800 + + build: another distcheck fix + + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit ef749399fd25be858ad64a65815b5f4525b603b3 +Author: Dan Williams +Date: Fri Mar 12 15:31:29 2010 -0800 + + build: fix distcheck error + + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 936533cfcc34b1bba797688049316bb8994443bd +Merge: 9d915013 3e760488 +Author: Dan Williams +Date: Fri Mar 12 12:40:00 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 3e760488b60bc8511cad97c90ae358ba626604cb +Author: Dan Williams +Date: Fri Mar 12 12:38:53 2010 -0800 + + cdma: make previous state tag private + + src/mm-generic-cdma.c | 2 ++ + src/mm-generic-cdma.h | 2 -- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 9d91501330514d8bbd83c8f729ec5231e862e226 +Merge: 4d1e00c4 7aa6d03d +Author: Dan Williams +Date: Fri Mar 12 12:21:29 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 7aa6d03d95dcf7677a576ac5c562c04d75cffa06 +Author: Dan Williams +Date: Fri Mar 12 12:13:21 2010 -0800 + + novatel: add CDMA plugin for signal quality parsing + + Some Novatel devices reply with the normal units to +CSQ and it + doesn't look quite like the +CSQ reply is in dBm either; so + use the custom Novatel command for RSSI. + + plugins/Makefile.am | 4 +- + plugins/mm-modem-novatel-cdma.c | 190 + ++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-novatel-cdma.h | 45 ++++++++++ + plugins/mm-plugin-novatel.c | 12 +-- + 4 files changed, 244 insertions(+), 7 deletions(-) + +commit cda38d390adbb78fb9fc644a205278747aa27818 +Author: Dan Williams +Date: Fri Mar 12 12:07:08 2010 -0800 + + cdma: fix Simple.GetStatus to actually work + + src/mm-generic-cdma.c | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit 7a0c5030364689620d0ef03573f3ab53e0727be3 +Author: Dan Williams +Date: Fri Mar 12 10:16:24 2010 -0800 + + cdma: use E1 parser to ignore re-echoed commands + + Some modems turn E1 on and off random (Huawei EC168C) and sometimes + the echoed command confuses things. We have a parser just for that, + so let's use it. It should be safe to use with devices that repect + E0 too. + + src/mm-generic-cdma.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e055bd72db9430a389ce91931f740ebc6dbe863d +Author: Dan Williams +Date: Fri Mar 12 08:57:55 2010 -0800 + + hso: fix connections with username/password after + e3c87e4e1418a25bb8da9e64eba882d8fa335265 + + e3c87e4e1418a25bb8da9e64eba882d8fa335265 introduced a use-after-free + bug that causes passwords and usernames to be corrupted. + + plugins/mm-modem-hso.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 4d1e00c49610b69b2446562880bef4f82b18d546 +Author: Dan Williams +Date: Thu Mar 11 16:02:12 2010 -0800 + + core: fix merge damage + + src/mm-generic-gsm.c | 8 ++++---- + src/mm-plugin-base.c | 4 ++-- + src/mm-serial-port.h | 1 - + 3 files changed, 6 insertions(+), 7 deletions(-) + +commit 3ec7e89f112cb65a584de84b76e207d7a804bd6f +Merge: 479937cb 749f9c0e +Author: Dan Williams +Date: Thu Mar 11 13:43:06 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 749f9c0eb569b29772dde9561b9856e4f878d9ef +Author: Dan Williams +Date: Thu Mar 11 13:20:43 2010 -0800 + + core: stop probing known-unusable ports early + + Some ports we know we shouldn't use when we get certain responses + from them. Reading from these ports triggers kernel bugs (at least + on 2.6.31 and 2.6.32) relating to flow control in some drivers + (*cough* hso *cough*), so lets try not to aggravate the kernel too + much. This happens on Icera-based Option devices like the GI0322 + (AT&T Quicksilver) for example. + + (note: AFAICT this doesn't have any relation to the recent XON/XOFF + patch, since I get this problem without the XON/XOFF patch on both + 2.6.31 and 2.6.32 as well) + + --- + + BUG: sleeping function called from invalid context at + kernel/mutex.c:94 + in_atomic(): 1, irqs_disabled(): 1, pid: 9295, name: modem-manager + Pid: 9295, comm: modem-manager Not tainted 2.6.32.9-67.fc12.x86_64 #1 + Call Trace: + [] __might_sleep+0xed/0xef + [] mutex_lock+0x24/0x50 + [] ? enqueue_task_fair+0x2a/0x6d + [] tty_throttle+0x1b/0x49 + [] n_tty_receive_buf+0xdbb/0xe12 + [] ? task_rq_unlock+0x11/0x13 + [] ? try_to_wake_up+0x2f3/0x305 + [] ? __kmalloc+0x37/0x15e + [] ? __kmalloc+0x6d/0x15e + [] flush_to_ldisc+0xf8/0x18d + [] tty_flip_buffer_push+0x50/0x61 + [] put_rxbuf_data+0xea/0x124 [hso] + [] put_rxbuf_data_and_resubmit_bulk_urb+0x21/0x6b + [hso] + [] hso_std_serial_read_bulk_callback+0x14d/0x15f + [hso] + [] ? dma_unmap_single_attrs.clone.0+0x38/0x3a + [] usb_hcd_giveback_urb+0x91/0xc5 + [] ehci_urb_done+0x7b/0x90 + [] ? try_to_wake_up+0x2f3/0x305 + [] qh_completions+0x368/0x4b9 + [] ? __wake_up_common+0x4e/0x84 + [] ehci_work+0x95/0x732 + [] ? __wake_up+0x44/0x4d + [] ? insert_work+0x8e/0x9b + [] ehci_irq+0x2be/0x420 + [] ? __queue_work+0x3a/0x41 + [] ? resched_cpu+0x6e/0x77 + [] ? delayed_work_timer_fn+0x3c/0x3e + [] ? __rcu_process_callbacks+0x7d/0x28a + [] usb_hcd_irq+0x3f/0x7b + [] handle_IRQ_event+0x60/0x121 + [] handle_fasteoi_irq+0x8b/0xc7 + [] handle_irq+0x8b/0x96 + [] do_IRQ+0x5c/0xbc + [] ret_from_intr+0x0/0x11 + + src/mm-plugin-base.c | 55 + +++++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-serial-port.c | 29 ++++++++++++++++++++------- + src/mm-serial-port.h | 3 +++ + 3 files changed, 79 insertions(+), 8 deletions(-) + +commit c7739979ed4a8be97d03ab7ed0087d63dc218cf4 +Author: Dan Williams +Date: Thu Mar 11 13:15:33 2010 -0800 + + api: update and clarify Location API + + introspection/mm-modem-location.xml | 112 + ++++++++++++++++++++++++++++++++---- + 1 file changed, 101 insertions(+), 11 deletions(-) + +commit 79aef47b25dcf33ff9ff49d6f0962a8ee32d73d4 +Author: Dan Williams +Date: Thu Mar 11 10:22:37 2010 -0800 + + api: clarify registration info items + + introspection/mm-modem-gsm-network.xml | 47 + +++++++++++++++++++++++++++++----- + 1 file changed, 40 insertions(+), 7 deletions(-) + +commit 13bc593a291a5bb5ff004b553268443b5d2c83aa +Author: Dan Williams +Date: Wed Mar 10 16:30:58 2010 -0800 + + gsm: ensure PDP context deactivation happens on disconnect + + The port is still connected until disconnect_done() runs, but by + this point we already know it's been disconnected so it's safe to + run the CGACT commands. + + src/mm-generic-gsm.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 8f50dd319189c0a9aef4d41957450096029f4b60 +Author: Dan Williams +Date: Wed Mar 10 15:56:27 2010 -0800 + + gsm: close open ports on Enable errors + + src/mm-generic-gsm.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit c0c8954828788033ad43f07d7915101378ee2605 +Author: Dan Williams +Date: Wed Mar 10 15:45:50 2010 -0800 + + gsm: fix PUK2 and other PIN unlock code recognition + + Longer entries first so we catch them before matching shorter + substrings. Previously, the strcmp() would have treated + PUK2 and PUK unlocks the same. + + src/mm-generic-gsm.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 479937cbbba560c77ec37ebf6468fe0e568986bd +Merge: 6a32d374 e3c87e4e +Author: Dan Williams +Date: Wed Mar 10 15:04:49 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 6a32d374cd7d0fb23785c974bf8d8b1ba64e97b5 +Author: Dan Williams +Date: Wed Mar 10 14:57:23 2010 -0800 + + serial: not all commands have response callbacks + + So don't crash if they don't. + + src/mm-serial-port.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 1979512d8dfb6428353e6bf358f908973a318095 +Merge: 8dde6bb8 b7858ba2 +Author: Dan Williams +Date: Wed Mar 10 14:50:41 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit e3c87e4e1418a25bb8da9e64eba882d8fa335265 +Author: Dan Williams +Date: Wed Mar 10 14:42:53 2010 -0800 + + hso: clean up connect and disconnect + + Disconnect didn't actually work for HSO since it overrode the parent + class's connect handler and thus didn't set the right state after + the connection was made. It turns out we can use the same logic + that 'mbm' does for connection and not have to override quite so + much of the parent class. + + This also splits the authentication and connection parts into two + distinct stages, which wasn't the case before but was what was + intended. + + plugins/mm-modem-hso.c | 470 + ++++++++++++++++++++++++++----------------------- + 1 file changed, 253 insertions(+), 217 deletions(-) + +commit 461de7ea0eeab4dfa5827dcce490eded3d729f6e +Author: Dan Williams +Date: Wed Mar 10 14:42:34 2010 -0800 + + mbm: use new disconnect handling helper + + plugins/mm-modem-mbm.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +commit 59b75b5194c6f2a649ca2a4bd6747f74b220d773 +Author: Dan Williams +Date: Wed Mar 10 14:39:10 2010 -0800 + + gsm: clean up disconnect handling + + Allow subclasses to override disconnect more cleanly so that + modem state gets handled correctly when the disconnect is complete. + Also fix up PDP Context ID handle (cid) so that subclasses can + get the previously-activated context ID when disconnecting, and let + the cid be an int since '0' is a valid context number. + + For the generic devices, this also attempts to actually deactivate + the PDP context to ensure that the data session is terminated. + + src/mm-generic-gsm.c | 118 + +++++++++++++++++++++++++++++++++++++-------------- + src/mm-generic-gsm.h | 12 ++++-- + 2 files changed, 94 insertions(+), 36 deletions(-) + +commit b7858ba235c046a514fbc79e18ac9faa75982032 +Author: Dan Williams +Date: Wed Mar 10 10:58:27 2010 -0800 + + novatel: fix GSM secondary port enabling after PIN changes + + With the PIN changes, the primary port would already be closed + by the time the Novatel modem class was able to send the DMAT + command to enable the secondary ports. Just try again later. + + plugins/mm-modem-novatel-gsm.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +commit 611e832d0ed509f862c8ab047cd8faca98f5aec9 +Author: Dan Williams +Date: Wed Mar 10 10:17:26 2010 -0800 + + api: add 'reply' parameter to USSD Initiate() command + + introspection/mm-modem-gsm-ussd.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 05dde9a3152368d40f1a82ece9d296e2ccbac428 +Author: Dan Williams +Date: Wed Mar 10 00:15:53 2010 -0800 + + gsm: revert part of d2e69d34f86e8994f74fb209082fcfb7573b2ea2 + + Reg status returned here is cached reg status, so it's pointless to + set it here again. + + src/mm-generic-gsm.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit d2e69d34f86e8994f74fb209082fcfb7573b2ea2 +Author: Dan Williams +Date: Wed Mar 10 00:02:56 2010 -0800 + + gsm: make registration status change handling consistent + + Ensure we send out signals when anything changes. + + src/mm-generic-gsm.c | 118 + +++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 82 insertions(+), 36 deletions(-) + +commit 46ec3bdb47cbc0c40f39bb139783dedc5d3c9986 +Author: Dan Williams +Date: Tue Mar 9 23:34:19 2010 -0800 + + gsm: fix CREG/CGREG parsing with multiple responses + + When a modem sends both CREG and CGREG in the same response packet, + the parser was failing to correctly distinguish which response + was being parsed, since the string passed to g_regex_match() is + the whole response including both CREG + CGREG. + + src/mm-modem-helpers.c | 67 + +++++++++++++++++++++--------------------- + src/mm-modem-helpers.h | 2 +- + src/tests/test-modem-helpers.c | 22 ++++++++++++++ + 3 files changed, 57 insertions(+), 34 deletions(-) + +commit 658d3d572dc5313d815d9b8ab09c6b563fcbc8bf +Author: Dan Williams +Date: Tue Mar 9 22:12:46 2010 -0800 + + zte: handle access technology changes + + plugins/mm-modem-zte.c | 37 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 35 insertions(+), 2 deletions(-) + +commit b0598738f1e99d3902a2aa79d5c3f74b686310f1 +Author: Dan Williams +Date: Tue Mar 9 22:12:21 2010 -0800 + + gsm: only update access technology when enabled + + src/mm-generic-gsm.c | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit ce1c72152b3488c06e5f01aa6b0dbd9ffcb918a4 +Author: Dan Williams +Date: Tue Mar 9 21:56:57 2010 -0800 + + mbm: fix memory leak in connection state processing + + plugins/mm-modem-mbm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 82abd5595e41f8a2739590bfa52e687de98d9808 +Author: Dan Williams +Date: Tue Mar 9 21:55:51 2010 -0800 + + mbm: fix memory leak in unsolicited signal strength processing + + plugins/mm-modem-mbm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 59605936d0e7d5947d1b888778fd993454db3b07 +Author: Dan Williams +Date: Tue Mar 9 21:55:19 2010 -0800 + + mbm: use unsolicited access technology updates + + plugins/mm-modem-mbm.c | 110 + ++++++++++++++++++++++--------------------------- + 1 file changed, 50 insertions(+), 60 deletions(-) + +commit 38514db896ea8706375c222e1262fa10b830c4c6 +Author: Dan Williams +Date: Tue Mar 9 21:31:57 2010 -0800 + + gsm: let generic class handle signal quality caching and updates + + plugins/mm-modem-huawei-gsm.c | 39 +++----------- + plugins/mm-modem-mbm.c | 14 ++--- + src/mm-generic-gsm.c | 123 + ++++++++++++++++++++++++++++++++++-------- + src/mm-generic-gsm.h | 5 ++ + 4 files changed, 121 insertions(+), 60 deletions(-) + +commit 07fc116d5a16b1f168c120c298b747b9d9bbe8d8 +Author: Dan Williams +Date: Tue Mar 9 18:10:34 2010 -0800 + + api: add USSD API proposal + + Loosely based on oFono, from Pablo Marti. + + introspection/Makefile.am | 3 +- + introspection/all.xml | 1 + + introspection/mm-modem-gsm-ussd.xml | 73 + +++++++++++++++++++++++++++++++++++++ + 3 files changed, 76 insertions(+), 1 deletion(-) + +commit d01a3ae328afe22552933b1d297b3cf92475b9de +Author: Dan Williams +Date: Tue Mar 9 11:47:13 2010 -0800 + + cdma: tell the modem we're using XON/XOFF too + + src/mm-generic-cdma.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 81dc2dde459ca91a8fce3c19a3aec79734179dfa +Author: Dan Williams +Date: Tue Mar 9 11:44:25 2010 -0800 + + serial: default to XON/XOFF flow control + + This seems to help with Huawei and ZTE devices which often + appeared to stop responding on either primary or secondary ports + at various times. We had this problem a long time ago, but it was + fixed then by always picking the right serial port via the USB + interface number (Huawei) or udev rules files (ZTE). Now that we're + using the second serial port more extensively the problem came + up again, so lets try to fix it for real. + + src/mm-generic-gsm.c | 3 +++ + src/mm-serial-port.c | 10 ++++++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit fbf3efc1e3feac3acb340bbd70617a702b33a42c +Author: Dan Williams +Date: Tue Mar 9 11:43:30 2010 -0800 + + gsm: only use CREG responses for authoritative registration state + + For now... + + src/mm-generic-gsm.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +commit 076b5df1bcc880555606375ac2af9db488bfda3d +Author: Dan Williams +Date: Tue Mar 9 11:29:04 2010 -0800 + + gsm: fix inifinite in ETSI tech -> MM tech conversion function + + src/mm-generic-gsm.c | 1 + + 1 file changed, 1 insertion(+) + +commit 2f925599c089484286a08ce84885b0385bcd64d2 +Author: Dan Williams +Date: Tue Mar 9 10:20:32 2010 -0800 + + gsm: fix crash in Simple API's GetStatus handling + + Can't schedule the info completion until we're sure all the + requests have completed. They won't necessarily be completed + in the same order they were issued since some of the data the + requests pull from could be cached and thus we don't have to + wait in the queue to hit up the modem. + + src/mm-generic-gsm.c | 71 + ++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 49 insertions(+), 22 deletions(-) + +commit 783de3bc10ba8b6fe934887efaeb229da6ad9d06 +Author: Dan Williams +Date: Tue Mar 9 09:55:04 2010 -0800 + + core: fix SIGTERM before mainloop has started + + src/main.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 8dde6bb8dd2c063f5740ae78b980343be8e5d669 +Author: Dan Williams +Date: Mon Mar 8 20:01:42 2010 -0800 + + core: don't try to remove 0 characters after matching responses + + src/mm-at-serial-port.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit f3721a5674ef7899d9a6ef0f4c5b356720bb9833 +Merge: f6c51489 9e231c3d +Author: Dan Williams +Date: Mon Mar 8 20:01:22 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 9e231c3d4b463c32e17c7d2b1c50cea4e19d03ac +Author: Dan Williams +Date: Mon Mar 8 18:06:10 2010 -0800 + + huawei: attach unsolicited message handlers to the primary port too + + plugins/mm-modem-huawei-gsm.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +commit 29a67e9d89f2f4538ae9b0e3e09db6d087b84f61 +Author: Dan Williams +Date: Mon Mar 8 18:04:14 2010 -0800 + + huawei: unify GSM device probing + + Using the USB product ID to direct certain modems to the generic + driver is wrong since even new modems like the E1550 are 0x1001 + after the modeswitch. Instead, lets assume that most current modes + use the Huawei-specific AT command set. + + plugins/mm-plugin-huawei.c | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +commit cdf9279ee8cb52d13242dbfad0e8c07c6d7270f3 +Author: Dan Williams +Date: Mon Mar 8 18:02:14 2010 -0800 + + api+gsm: split out access technology + + As with allowed modes, make things clearer and simpler by giving + access technology it's own values. + + introspection/mm-modem-gsm-network.xml | 10 ++-- + introspection/mm-modem-gsm.xml | 34 ++++++++++++ + plugins/mm-modem-huawei-gsm.c | 36 +++++++------ + src/mm-generic-gsm.c | 96 + +++++++++++++--------------------- + src/mm-generic-gsm.h | 2 +- + src/mm-modem-gsm-network.c | 36 ++++++------- + src/mm-modem-gsm-network.h | 2 +- + src/mm-modem-gsm.h | 39 +++++++++----- + 8 files changed, 140 insertions(+), 115 deletions(-) + +commit c5a897d0ae1e4609cc2f9d3e127c1e50be9a84c1 +Author: Dan Williams +Date: Mon Mar 8 17:27:56 2010 -0800 + + api+gsm: clean up AllowedMode values + + Instead of trying to stuff everything into the mode bitfield it + turns out it's just easier, clearer, and simpler to use different + values for each of the following: + + 1) the device's supported access technologies and allowed modes + 2) the device's current access technology + 3) the device's allowed mode preference + + Since none of the AccessTechnology or AllowedMode stuff has hit a + release yet, let's make sure we're doing it the right way early on. + + introspection/mm-modem-gsm-network.xml | 16 ++++------ + introspection/mm-modem-gsm.xml | 29 +++++++++++++++-- + plugins/mm-modem-huawei-gsm.c | 58 + ++++++++++++++-------------------- + plugins/mm-modem-mbm.c | 39 ++++++++++++++++------- + plugins/mm-modem-option.c | 22 ++++++------- + src/mm-generic-gsm.c | 42 ++++++++++++++---------- + src/mm-generic-gsm.h | 4 +-- + src/mm-modem-gsm-network.c | 46 ++++++++++----------------- + src/mm-modem-gsm-network.h | 17 +++------- + src/mm-modem-gsm.h | 10 ++++++ + 10 files changed, 153 insertions(+), 130 deletions(-) + +commit aeac17a81edfb3304de405127bb06d100c8a5522 +Author: Dan Williams +Date: Mon Mar 8 15:13:14 2010 -0800 + + gsm: implement allowed mode + + plugins/mm-modem-huawei-gsm.c | 101 + ++++++++++++++++------------------------ + plugins/mm-modem-mbm.c | 65 +++++++++++++++++++------- + plugins/mm-modem-option.c | 46 +++++++----------- + src/mm-generic-gsm.c | 106 + ++++++++++++++++++++++++++++++++++++++---- + src/mm-generic-gsm.h | 21 +++++++++ + src/mm-modem-gsm-network.c | 92 +++++++++++++++++++----------------- + src/mm-modem-gsm-network.h | 22 ++++----- + src/mm-modem-gsm.h | 2 - + 8 files changed, 283 insertions(+), 172 deletions(-) + +commit d298885faa72398368a67a7738a6208dae0c6f0a +Author: Dan Williams +Date: Mon Mar 8 14:50:07 2010 -0800 + + gsm: fix GObject property maximums for SupportedModes and + SupportedBands + + Since the values they carry are bitfields, using the highest value + as the maximum isn't the right thing to do. + + src/mm-modem-gsm-card.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e2c487472e52bc14acd04e93a6d5b7d54a2bcfa5 +Author: Dan Williams +Date: Mon Mar 8 14:34:30 2010 -0800 + + api: s/AllowedModes/AllowedMode in Gsm.Network + + Only one mode is going to be stored here so it shouldn't be plural. + + introspection/mm-modem-gsm-network.xml | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 5e2983484e4ab3a594e63b03d34804d57c0dc292 +Author: Dan Williams +Date: Mon Mar 8 14:15:25 2010 -0800 + + api: make HSPA a standalone network mode again + + It's just easier this way. It makes little sense to allow + selecting mode combinations for anything other than + (HSDPA | HSUPA). Most radios don't allow fine-grained control + of the different technologies within each 2G or 3G class anyway + thus combinations like (GPRS | UMTS) are pointless since the + device wouldn't be able to use GPRS but not use EDGE. + + introspection/mm-modem-gsm.xml | 7 +++++-- + src/mm-modem-gsm.h | 6 +++--- + 2 files changed, 8 insertions(+), 5 deletions(-) + +commit 343245fc2179a6d05ba131771def84c84b1be639 +Author: Dan Williams +Date: Mon Mar 8 11:40:54 2010 -0800 + + gsm: add AccessTechnology property and associated infrastructure + + AccessTechnology takes over half of what NetworkMode was supposed to + do, but we'll keep NetworkMode around for a while for compatibility + anyway. Create async updaters that subclasses can use to update + the access tech when they get unsolicited messages. + + plugins/mm-modem-huawei-gsm.c | 20 +++--- + src/mm-generic-gsm.c | 144 + +++++++++++++++++++++++++++++++++++------- + src/mm-generic-gsm.h | 19 +++++- + src/mm-modem-gsm-network.c | 85 +++++++++++++++++++++++++ + src/mm-modem-gsm-network.h | 16 ++++- + src/mm-modem-gsm.h | 15 +++++ + 6 files changed, 263 insertions(+), 36 deletions(-) + +commit 82d7c8342d749c827161fbcbc5db670b671282d9 +Author: Dan Williams +Date: Sun Mar 7 14:46:38 2010 -0800 + + gsm: fix crash getting initial registration state + + src/mm-generic-gsm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 74ed9baefa0e1b10d1bec184e2dcfca4dc718eff +Author: Dan Williams +Date: Sun Mar 7 11:01:08 2010 -0800 + + gsm: add missing 27.007 access technologies + + src/mm-modem-gsm.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 45fd96132f4568c97a85524b530c2b682fa07c14 +Author: Dan Williams +Date: Sun Mar 7 09:58:30 2010 -0800 + + api: add new AllowedModes and AccessTechnology API + + This adds split properties and functions for the allowed modes and the + current access technology used by the device when connected to the + mobile network. + + introspection/mm-modem-gsm-network.xml | 38 + +++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +commit 8fcc5b7fe2458eee7b1ca0a7a39cbc710ea48b60 +Author: Dan Williams +Date: Sun Mar 7 09:53:28 2010 -0800 + + api: more clearly document modes and bands + + introspection/mm-modem-gsm.xml | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit e7dd2926a3ba1cf6129996ec63accee7fa1ad155 +Author: Dan Williams +Date: Sun Mar 7 09:53:03 2010 -0800 + + api: revert parts of 2d194a5798fb06f41b018c2d8c2216f45bfc41a4 + + MM hadn't implemented it yet, but Wader already implemented an earlier + version that didn't use a bitfield but an enum. Unfortunately the + network mode stuff doesn't allow for distinguishing between the + device's + mode preference and the current access technology. So deprecate the + current network mode stuff in the API in preparation for improved API. + + introspection/mm-modem-gsm-network.xml | 56 + ++++++++++++++++++++++++++++------ + 1 file changed, 47 insertions(+), 9 deletions(-) + +commit ba977cd52966a15b74b261bf6cf370f535ed8d29 +Author: Dan Williams +Date: Sun Mar 7 09:52:48 2010 -0800 + + api: readability fixes + + introspection/mm-modem-gsm-card.xml | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 547a9eb9c016dd528a4a275a52da39a24f775a13 +Author: Dan Williams +Date: Sun Mar 7 07:35:11 2010 -0800 + + introspection: add missing 27.007 access technologies + + introspection/mm-modem-gsm.xml | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 7701478703d6c119c13d544bd594a6ff7b7100d1 +Author: Dan Williams +Date: Sun Mar 7 07:13:43 2010 -0800 + + gsm: simplify registration state polling code + + src/mm-generic-gsm.c | 94 + ++++++++++++++++++++-------------------------------- + 1 file changed, 36 insertions(+), 58 deletions(-) + +commit 201295b65e4e9cf3686ee29673f7738d2810dd16 +Author: Dan Williams +Date: Sat Mar 6 10:43:54 2010 -0800 + + gsm: use secondary serial port while connected + + For registration updates and signal strength. + + src/mm-generic-gsm.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 54c1d069eb688f60cc721fb435953dfaebcfa6d7 +Author: Dan Williams +Date: Sat Mar 6 10:28:11 2010 -0800 + + gsm: rework registration handling + + First, generically handle registration polling if the device does + not support unsolicited registration. Second, using the new + creg/cgreg parsing functions from mm-modem-helpers.c, handle + CREG=2 unsolicited registration replies to capture the GSM LAC/CI + for the location information API. + + Because of these changes we can simplify the registration polling + during connection as well by using the common registration parsing + code and the cached registration state. + + plugins/mm-modem-hso.c | 2 - + plugins/mm-modem-huawei-gsm.c | 2 - + plugins/mm-modem-mbm.c | 2 - + plugins/mm-modem-zte.c | 1 - + src/mm-generic-gsm.c | 428 + ++++++++++++++++++++++++++++++++---------- + src/mm-generic-gsm.h | 5 +- + 6 files changed, 334 insertions(+), 106 deletions(-) + +commit 31fb97919cd7d95d1f9b23bd0c2428d8a19dc3e4 +Author: Dan Williams +Date: Sat Mar 6 00:26:54 2010 -0800 + + gsm: fix simple state machine network registration after + 407abc65c6ccd802ce8456e5a63e68fab1c7d0a1 + + Got the logic wrong in that commit. Fix it. Network registration + should always be run since it handles polling for registration + state if needed before continuing. + + src/mm-generic-gsm.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 3232a3f7d6d01400c4ed9acb6692fa119b7720b2 +Author: Dan Williams +Date: Fri Mar 5 18:17:51 2010 -0800 + + api: better handling of Location API security issues + + Since D-Bus signals cannot by nature be restricted to authenticated + clients (unless using private D-Bus connections) we can handle the + security a bit differently here. Since the Enable() call can be + authenticated, we'll trust the client to say whether higher + security should be used by disallowing location update signals. This + does mean the client will have to poll for location updates, but at + least then clients requesting location information can be + authenticated. + + introspection/mm-modem-location.xml | 58 + +++++++++++++++++++++++++++++++++++-- + 1 file changed, 55 insertions(+), 3 deletions(-) + +commit 2950f3106859fb8bb90f6eab8a8de5298fd5d297 +Author: Dan Williams +Date: Fri Mar 5 17:55:48 2010 -0800 + + api: clarify some Location API bits + + introspection/mm-modem-location.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 12a8a63fc1510d1af79581dc66e2b48a8eefcdb6 +Author: Dan Williams +Date: Fri Mar 5 17:52:55 2010 -0800 + + api: first draft of Location information API + + NOT FINAL; need to discuss with Pablo and others and actually + implement + it before declaring it final. + + introspection/Makefile.am | 3 +- + introspection/all.xml | 1 + + introspection/mm-modem-location.xml | 70 + +++++++++++++++++++++++++++++++++++++ + 3 files changed, 73 insertions(+), 1 deletion(-) + +commit ad7bbb2f160d52ff581c334ac85c29d10b3e4451 +Author: Dan Williams +Date: Fri Mar 5 14:08:40 2010 -0800 + + gsm: indicate CREG vs. CGREG + + src/mm-modem-helpers.c | 6 +++++ + src/mm-modem-helpers.h | 1 + + src/tests/test-modem-helpers.c | 55 + ++++++++++++++++++++++++++++++------------ + 3 files changed, 47 insertions(+), 15 deletions(-) + +commit e4350152c86099e908921df64ba2e16f81ade5cb +Author: Dan Williams +Date: Fri Mar 5 11:47:23 2010 -0800 + + gsm: common CREG/CGREG parsing function and testcases + + src/mm-modem-helpers.c | 222 ++++++++++++++++++++++++++++++ + src/mm-modem-helpers.h | 11 ++ + src/tests/test-modem-helpers.c | 298 + ++++++++++++++++++++++++++++++++++++----- + 3 files changed, 500 insertions(+), 31 deletions(-) + +commit e6e3784c028f8d55bc9d2bd3fd207d958eba5ff4 +Author: Dan Williams +Date: Thu Mar 4 20:45:30 2010 -0800 + + hso: remove PIN checking code + + This is handled by the generic class before the modem is even exported + over D-Bus. + + plugins/mm-modem-hso.c | 35 ----------------------------------- + 1 file changed, 35 deletions(-) + +commit 6c760464d4545d5bedaef01dbbdd8fba5617aa26 +Author: Dan Williams +Date: Thu Mar 4 20:43:22 2010 -0800 + + zte: remove PIN checking code + + This is handled by the generic class before the modem is even exported + over D-Bus. + + plugins/mm-modem-zte.c | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +commit c02835722fda93e3f796d183b2994c89dc817baf +Author: Dan Williams +Date: Thu Mar 4 20:37:36 2010 -0800 + + novatel: remove PIN checking code + + This is handled by the generic class before the modem is even exported + over D-Bus. + + plugins/mm-modem-novatel-gsm.c | 76 + ------------------------------------------ + 1 file changed, 76 deletions(-) + +commit a40d3dbead026db43b62d8e859b29f6e564d24f9 +Author: Dan Williams +Date: Thu Mar 4 20:27:44 2010 -0800 + + option: fix power-on delay + + Since the modem states patch the delay for power-on wasn't honored + for Option devices. Fix that using the new power-on-done handler + and also fix the bug where if the modem was removed, the plugin + would crash because it wasn't handling the timeout removal. + + Also remove the explicit PIN check since that's now handled by the + generic GSM code before the modem is even exported over DBus. + + plugins/mm-modem-option.c | 86 + ++++++++++++++++++++++++----------------------- + 1 file changed, 44 insertions(+), 42 deletions(-) + +commit d94ca3d310f11d98589a76a3d864efe613f4d515 +Author: Dan Williams +Date: Thu Mar 4 20:09:54 2010 -0800 + + sierra: fix power-on delay + + Since the modem states patch the delay for power-on wasn't honored + for Sierra devices. Fix that using the new power-on-done handler + and also fix the bug where if the modem was removed, the plugin + would crash because it wasn't handling the timeout removal. + + Also remove the explicit PIN check since that's now handled by the + generic GSM code before the modem is even exported over DBus. + + plugins/mm-modem-sierra-gsm.c | 73 + +++++++++++++++++++++++++------------------ + 1 file changed, 42 insertions(+), 31 deletions(-) + +commit c915de5512f69678d0062ceec4cc69fefcdf8fd3 +Author: Dan Williams +Date: Thu Mar 4 20:06:17 2010 -0800 + + gsm: add ability for subclasses to handle power-on response + + This lets subclasses handle errors when they know the device supports + the power-up command. Also will let us simplify a number of plugins. + + src/mm-generic-gsm.c | 28 +++++++++++++++++++--------- + src/mm-generic-gsm.h | 11 +++++++++++ + 2 files changed, 30 insertions(+), 9 deletions(-) + +commit 3f7b173932bfb23ce83bfab8a74490f7dc85a7f7 +Author: Dan Williams +Date: Thu Mar 4 19:40:33 2010 -0800 + + sierra: fix comment about CFUN=1 delay + + plugins/mm-modem-sierra-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 407abc65c6ccd802ce8456e5a63e68fab1c7d0a1 +Author: Dan Williams +Date: Thu Mar 4 19:30:54 2010 -0800 + + gsm: handle PINs better during modem enable and simple state machine + + First, short-circuit the Enable process if the device requires a PIN + or PUK since for many devices the enable is going to fail anyway + until the PIN is sent. + + Second, send the PIN first during the simple state machine for the + same reason; we need the device unlocked before we want to try + to enable it. This also reworks the simple state machine to be a + bit clearer and make each state step correspond to the action it's + actually doing instead of being off-by-one visually (but not + logically). + + src/mm-generic-gsm.c | 159 + ++++++++++++++++++++++++++++++++------------------- + 1 file changed, 99 insertions(+), 60 deletions(-) + +commit 021ca1244e2be8afcf6bdb552866263dc20c9285 +Author: Dan Williams +Date: Thu Mar 4 19:01:13 2010 -0800 + + gsm: postpone PIN/PUK success reply until we know updated unlock + status + + Don't return until we know what the updated lock status is. Fixes an + issue where callers that send the PIN before the modem is enabled + (remember, some modems can't be enabled until the PIN is entered, so + sometimes we have to send the PIN before it's enabled) would get + the reply too early and get failures from other operations. + + src/mm-generic-gsm.c | 45 ++++++++++++++++++++++++--------------------- + 1 file changed, 24 insertions(+), 21 deletions(-) + +commit 3457adefefa8bedd0349e6ac3d5cebcacf958000 +Author: Dan Williams +Date: Thu Mar 4 17:28:36 2010 -0800 + + gsm: clarify generic GSM subclass API a bit + + src/mm-generic-gsm.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 6dd751bf3f7bf515767ac6864b7eaf126e01fb3d +Author: Torgny Johansson +Date: Thu Mar 4 17:19:28 2010 -0800 + + mbm: handle E2NAP disconnect notification during connection attempt + + If E2NAP:0 is received during a connection attempt the connection + attempt has failed or will fail. So stop polling for connection + success for another 50 seconds and abort the connection attempt + immediately. Also moves the E2NAP request call a bit earlier to + ensure that no E2NAP unsolicited messages are lost. + + plugins/mm-modem-mbm.c | 36 ++++++++++++++++++++++++------------ + 1 file changed, 24 insertions(+), 12 deletions(-) + +commit 3b9b7920f5157c62715f7450574335b3c1ca4d64 +Author: Dan Williams +Date: Thu Mar 4 10:29:42 2010 -0800 + + core: register Modem UnlockRequired property for changed signals too + + src/mm-modem-base.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit a9ef8cb1759f25ee26f8015aa2e45a2bd3cd2da7 +Author: Dan Williams +Date: Mon Mar 1 09:15:01 2010 -0800 + + policy: split Device into Info and Control + + It's useful to let distros and admins set policy differently for + device + information (for support, inventory, etc) than for actually + controlling + the device like PIN/PUK unlocks. + + policy/org.freedesktop.modem-manager.policy.in | 15 ++++++++++++--- + src/mm-auth-provider.h | 7 ++++--- + src/mm-modem-cdma.c | 2 +- + src/mm-modem-gsm-card.c | 12 ++++++------ + src/mm-modem-gsm-network.c | 2 +- + 5 files changed, 24 insertions(+), 14 deletions(-) + +commit f6c514897e40e768b180963f2782ed60527ffaa6 +Merge: 7a0373af 9d7cb0dd +Author: Dan Williams +Date: Mon Mar 1 09:07:05 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 9d7cb0ddcf69993903c5bc51bbbfbd3a57f55413 +Author: Dan Williams +Date: Sun Feb 28 22:11:47 2010 -0800 + + gsm: fix direct registration info requests + + src/mm-generic-gsm.c | 58 + +++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 39 insertions(+), 19 deletions(-) + +commit 27ede83bd33f570504d25d370422e23034c8f529 +Author: Dan Williams +Date: Sun Feb 28 21:15:22 2010 -0800 + + trivial: rearrange some code + + src/mm-generic-gsm.c | 67 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 34 insertions(+), 33 deletions(-) + +commit 28d065c1f15a7ebf9109abbdca2ba8e831291f13 +Author: Dan Williams +Date: Sat Feb 27 12:51:13 2010 -0800 + + core: implement optional PolicyKit-based authentication + + org.freedesktop.ModemManager.conf.polkit | 7 ++ + src/Makefile.am | 29 ++--- + src/mm-auth-provider-polkit.c | 153 + +++++++++++++++++++++++++++ + src/mm-auth-provider-polkit.h | 43 ++++++++ + src/mm-auth-provider.c | 133 ++++++++++++----------- + src/mm-auth-provider.h | 10 +- + src/mm-auth-request-polkit.c | 175 + +++++++++++++++++++++++++++++++ + src/mm-auth-request-polkit.h | 53 ++++++++++ + src/mm-modem-base.c | 2 + + src/mm-modem-cdma.c | 9 +- + src/mm-modem-gsm-card.c | 71 ++++++++----- + src/mm-modem-gsm-network.c | 9 +- + src/mm-modem-gsm-sms.c | 131 +++++++++++++---------- + src/mm-modem.c | 3 + + src/mm-modem.h | 3 + + 15 files changed, 664 insertions(+), 167 deletions(-) + +commit aed5f3765d4b8e421888f6cc87800d76853b67d4 +Author: Dan Williams +Date: Sat Feb 27 12:51:03 2010 -0800 + + core: add missing MMAuthRequest class + + src/mm-auth-request.c | 182 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-auth-request.h | 72 ++++++++++++++++++++ + 2 files changed, 254 insertions(+) + +commit 588bb65ea654371cabab1cfd6770d845e961f097 +Author: Dan Williams +Date: Sat Feb 27 12:49:07 2010 -0800 + + trivial: add policy file to gitignore + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit 3b6a58145ff29d28bc026d4cec59aec076a99aba +Author: Dan Williams +Date: Sat Feb 27 10:29:34 2010 -0800 + + core: simply authentication request objects + + src/Makefile.am | 12 ++- + src/mm-auth-provider.c | 254 + +++++++++++++-------------------------------- + src/mm-auth-provider.h | 65 +++++------- + src/mm-modem-base.c | 72 +------------ + src/mm-modem-cdma.c | 9 +- + src/mm-modem-gsm-card.c | 54 ++++------ + src/mm-modem-gsm-network.c | 9 +- + src/mm-modem-gsm-sms.c | 72 +++++-------- + src/mm-modem.c | 7 +- + src/mm-modem.h | 6 +- + 10 files changed, 159 insertions(+), 401 deletions(-) + +commit 20796148cee8021766dacf519bd3953fe8d8416c +Author: Dan Williams +Date: Sat Feb 27 07:49:57 2010 -0800 + + build: fix build after bffb332481e2fd665a686e46419e2ddfb28529f1 + + Makefile.am | 1 + + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit 27ffa6b272132c6c92c07cb99e0f213521874475 +Author: Dan Williams +Date: Sat Feb 27 07:19:37 2010 -0800 + + core: authenticate SMS operations + + org.freedesktop.ModemManager.conf.polkit | 8 + + src/mm-modem-gsm-sms.c | 388 + +++++++++++++++++++++++++++++-- + 2 files changed, 376 insertions(+), 20 deletions(-) + +commit bffb332481e2fd665a686e46419e2ddfb28529f1 +Author: Dan Williams +Date: Sat Feb 27 06:25:45 2010 -0800 + + core: install correct dbus permissions for with-polkit/without-polkit + + .gitignore | 1 + + Makefile.am | 14 + ++++++++++++-- + org.freedesktop.ModemManager.conf.nopolkit | 17 + +++++++++++++++++ + ...ger.conf => org.freedesktop.ModemManager.conf.polkit | 0 + 4 files changed, 30 insertions(+), 2 deletions(-) + +commit 438a047935f941e8f7d8df27a0069c70e4b4ea05 +Author: Dan Williams +Date: Fri Feb 26 18:01:55 2010 -0800 + + core: add authorization providers and optional PolicyKit support + + When the support is complete, use --with-polkit to enable + PolicyKit support. It's not there yet, but this commit adds an + authorization provider framework which will be extended to allow + hooking into PolicyKit. + + Makefile.am | 6 +- + configure.ac | 18 ++ + marshallers/mm-marshal.list | 1 + + org.freedesktop.ModemManager.conf | 127 +++++++++++- + src/Makefile.am | 19 +- + src/mm-auth-provider-factory.c | 45 +++++ + src/mm-auth-provider.c | 405 + ++++++++++++++++++++++++++++++++++++++ + src/mm-auth-provider.h | 99 ++++++++++ + src/mm-errors.c | 1 + + src/mm-errors.h | 3 +- + src/mm-modem-base.c | 108 ++++++++++ + src/mm-modem-cdma.c | 35 +++- + src/mm-modem-gsm-card.c | 262 ++++++++++++++++++++++-- + src/mm-modem-gsm-network.c | 32 ++- + src/mm-modem.c | 46 +++++ + src/mm-modem.h | 32 +++ + 16 files changed, 1218 insertions(+), 21 deletions(-) + +commit 7a0373afee63eeb9e677f61ccd19fd4aed549ac9 +Author: Dan Williams +Date: Tue Feb 23 11:41:40 2010 -0800 + + qcdm: add serial port subclass skeleton + + src/Makefile.am | 4 ++ + src/mm-qcdm-serial-port.c | 176 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-qcdm-serial-port.h | 66 +++++++++++++++++ + 3 files changed, 246 insertions(+) + +commit bc3ac7bae507f2b264a5f616613c051fa0378d8b +Author: Dan Williams +Date: Mon Feb 22 21:43:42 2010 -0800 + + qcdm: testcase output cleanup + + libqcdm/tests/test-qcdm-com.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +commit d694cebdfe374ae8fbc01d2b787430585e8485e1 +Author: Dan Williams +Date: Mon Feb 22 19:00:31 2010 -0800 + + qcdm: add more HDR subsystem protocol enums + + Found in TIA-856-A section 9. Assuming that the modem firmware just + passes the protocol states right through. + + libqcdm/src/commands.h | 39 ++++++++++++++++++- + libqcdm/tests/test-qcdm-com.c | 91 + ++++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 124 insertions(+), 6 deletions(-) + +commit 06415201cb8ece13760e98e07fe496ec2415e3ad +Author: Dan Williams +Date: Mon Feb 22 18:34:12 2010 -0800 + + qcdm: add HDR State Info command + + libqcdm/src/commands.c | 45 ++++++++++++++ + libqcdm/src/commands.h | 50 ++++++++++++++- + libqcdm/src/dm-commands.h | 15 +++++ + libqcdm/tests/test-qcdm-com.c | 138 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 249 insertions(+), 2 deletions(-) + +commit 928f8a9ff20934ad1e4383c5db6cb0b610a9fa4d +Author: Dan Williams +Date: Mon Feb 22 17:35:28 2010 -0800 + + qcdm: add Call Manager subsystem STATE_INFO command + + libqcdm/src/commands.c | 68 +++++++++++++++++++++++++++- + libqcdm/src/commands.h | 37 ++++++++++++++++ + libqcdm/src/dm-commands.h | 16 +++++++ + libqcdm/tests/test-qcdm-com.c | 100 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 + + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 223 insertions(+), 1 deletion(-) + +commit bf0157162240134dbe18ad4ac70c842ca952483d +Author: Dan Williams +Date: Mon Feb 22 16:45:50 2010 -0800 + + qcdm: add enums for STATUS rx_state values + + libqcdm/src/commands.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit c937d1399bd5185c813ef02109834fcac2dc2898 +Author: Dan Williams +Date: Mon Feb 22 16:15:19 2010 -0800 + + qcdm: add SW_VERSION command + + libqcdm/src/commands.c | 49 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 18 ++++++++++++++++ + libqcdm/src/dm-commands.h | 8 +++++++ + libqcdm/tests/test-qcdm-com.c | 46 + ++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 2 ++ + libqcdm/tests/test-qcdm.c | 1 + + 6 files changed, 124 insertions(+) + +commit b50638dcbe7dda084b542cf47c652e95c97aa037 +Author: Dan Williams +Date: Mon Feb 22 15:53:19 2010 -0800 + + qcdm: fix up DIAG_CMD_STATUS structure + + There's some junk in between the fields, apparently. + + libqcdm/src/dm-commands.h | 5 +++++ + 1 file changed, 5 insertions(+) + +commit bdfddd57e772fa86825661b6074f7909106c1569 +Author: Dan Williams +Date: Mon Feb 22 15:53:06 2010 -0800 + + qcdm: fix STATUS command SID & NID reporting + + libqcdm/src/commands.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 98ec1bdfea443c58e938a0adf435f396212cc092 +Author: Dan Williams +Date: Mon Feb 22 15:23:34 2010 -0800 + + qcdm: add testcases for QCDMResult objects + + libqcdm/src/result.c | 2 ++ + libqcdm/tests/Makefile.am | 2 ++ + libqcdm/tests/test-qcdm-result.c | 71 + ++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-result.h | 26 +++++++++++++++ + libqcdm/tests/test-qcdm.c | 4 +++ + 5 files changed, 105 insertions(+) + +commit c0e227a16bb320790e0cd10683abb3262f87d04f +Author: Dan Williams +Date: Mon Feb 22 13:27:25 2010 -0800 + + qcdm: add status command and rework testcases a bit + + Status command not completely working yet. + + libqcdm/src/commands.c | 68 +++++++++++++++++++++++++ + libqcdm/src/commands.h | 19 +++++++ + libqcdm/src/dm-commands.h | 16 ++++++ + libqcdm/tests/test-qcdm-com.c | 112 + +++++++++++++++++++++++++++++++++++++----- + libqcdm/tests/test-qcdm-com.h | 10 +++- + libqcdm/tests/test-qcdm.c | 9 +++- + 6 files changed, 220 insertions(+), 14 deletions(-) + +commit cb59d2e64d8bb79cb7147e7ce2128c83ec66ef1c +Author: Dan Williams +Date: Mon Feb 22 13:08:19 2010 -0800 + + qcdm: fix guint8 result member retrieval + + libqcdm/src/result.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 3d617b7bf62bd35811cd7be6cbd7848e1835ec5e +Author: Dan Williams +Date: Mon Feb 22 12:17:27 2010 -0800 + + qcdm: add command to get MDN (ie, phone number) + + libqcdm/src/Makefile.am | 1 + + libqcdm/src/commands.c | 53 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 14 ++++++++++++ + libqcdm/src/nv-items.h | 35 ++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.c | 29 +++++++++++++++++++++-- + 5 files changed, 130 insertions(+), 2 deletions(-) + +commit 7d151e6ae005cdac451b3e24697c7dc1e2c1e462 +Author: Dan Williams +Date: Mon Feb 22 11:33:44 2010 -0800 + + qcdm: add DIAG_CMD_ESN + + libqcdm/src/commands.c | 79 + +++++++++++++++++++++++++++++++++++++++++++ + libqcdm/src/commands.h | 22 ++++++++++-- + libqcdm/src/dm-commands.h | 7 ++++ + libqcdm/tests/test-qcdm-com.c | 24 +++++++++++++ + 4 files changed, 129 insertions(+), 3 deletions(-) + +commit 4c297935efcceb2d764077144757da57a48bd725 +Author: Dan Williams +Date: Mon Feb 22 11:21:48 2010 -0800 + + qcdm: fix unref-ing result objects + + libqcdm/src/result.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 10e5e6561f0d0cef5dfa52744fe3ca3abf062684 +Author: Dan Williams +Date: Mon Feb 22 11:06:50 2010 -0800 + + qcdm: handle more command error responses + + libqcdm/src/commands.c | 32 +++++++++++++++++++++++++++++++- + libqcdm/src/error.c | 4 ++++ + libqcdm/src/error.h | 4 ++++ + 3 files changed, 39 insertions(+), 1 deletion(-) + +commit 0f9d4d2a1ac3414b25c71f736c5b1293e1595721 +Author: Dan Williams +Date: Mon Feb 22 10:52:59 2010 -0800 + + qcdm: fix QCDM packet decapsulation + + Rename and document the encapsulate/decapsulate functions, CRC-check + the incoming packet, and make callers aware of the difference in how + big the decapsulated packet is versus how many bytes they should + discard from the buffer (since the decapsulated packet is at least + 3 bytes shorter than the incoming packet due to the CRC + framing). + + libqcdm/src/commands.c | 2 +- + libqcdm/src/utils.c | 125 + ++++++++++++++++++++++++++++++++++++++++-- + libqcdm/src/utils.h | 18 ++++-- + libqcdm/tests/test-qcdm-com.c | 33 ++++++++--- + 4 files changed, 158 insertions(+), 20 deletions(-) + +commit f5d1a9b40038c4c81b361a089b0753d149b3107c +Author: Dan Williams +Date: Sun Feb 21 11:22:16 2010 -0800 + + serial: allow file descriptor configuration to be handled by + subclasses + + src/mm-serial-port.c | 11 +++++++---- + src/mm-serial-port.h | 5 +++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +commit 2cdefeb6dafa9d8405ddd1247967ca6e3267b1a7 +Merge: a8c7bba1 b9958e6e +Author: Dan Williams +Date: Sat Feb 20 14:58:04 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit b9958e6ec5115822b1c2112da5ef2652aa847a51 +Author: Dan Williams +Date: Sat Feb 20 14:56:37 2010 -0800 + + policy: add missing Makefile.am and icon + + policy/Makefile.am | 15 +++++++++++++++ + policy/modem-manager.png | Bin 0 -> 817 bytes + 2 files changed, 15 insertions(+) + +commit a8c7bba19ea486bd21f4fd1f2050bf899478fdaa +Author: Dan Williams +Date: Sat Feb 20 14:55:10 2010 -0800 + + serial: refactor MMSerialPort into a base class and an AT-capable + serial port + + For QCDM devices we want most of what MMSerialPort does, but not + the AT command handling stuff since the commands and responses + aren't AT commands nor are they even strings. So convert everything + that MMSerialPort does into a GByteArray, and let MMAtSerialPort + handle the conversion to strings when necessary. + + plugins/mm-modem-anydata-cdma.c | 28 ++-- + plugins/mm-modem-gobi-gsm.c | 9 +- + plugins/mm-modem-hso.c | 36 ++--- + plugins/mm-modem-huawei-cdma.c | 24 +-- + plugins/mm-modem-huawei-gsm.c | 62 ++++---- + plugins/mm-modem-mbm.c | 113 +++++++------- + plugins/mm-modem-nokia.c | 14 +- + plugins/mm-modem-novatel-gsm.c | 30 ++-- + plugins/mm-modem-option.c | 16 +- + plugins/mm-modem-sierra-cdma.c | 26 ++-- + plugins/mm-modem-sierra-gsm.c | 8 +- + plugins/mm-modem-zte.c | 48 +++--- + plugins/mm-plugin-huawei.c | 21 +-- + src/Makefile.am | 6 +- + src/mm-at-serial-port.c | 323 + ++++++++++++++++++++++++++++++++++++++ + src/mm-at-serial-port.h | 85 ++++++++++ + src/mm-generic-cdma.c | 94 ++++++------ + src/mm-generic-cdma.h | 4 +- + src/mm-generic-gsm.c | 182 +++++++++++----------- + src/mm-generic-gsm.h | 6 +- + src/mm-modem-base.c | 4 +- + src/mm-plugin-base.c | 54 +++---- + src/mm-serial-port.c | 333 + +++++++++++++++++----------------------- + src/mm-serial-port.h | 73 +++++---- + 24 files changed, 982 insertions(+), 617 deletions(-) + +commit a431455059414b4a1cad854776c7fc0572e8c7fc +Author: Dan Williams +Date: Sat Feb 20 14:53:43 2010 -0800 + + core: fix memory leak on startup + + src/mm-manager.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 9d8e892ffe602a123697a5f65393b5752129de09 +Merge: c916ea7b 9185ce98 +Author: Dan Williams +Date: Sat Feb 20 12:49:22 2010 -0800 + + Merge remote branch 'origin/master' into qcdm + +commit 9185ce987d254aab07b0e8439a2788ce0670e59d +Author: Dan Williams +Date: Fri Feb 19 18:23:19 2010 -0800 + + po: add translatable + + po/POTFILES.in | 1 + + 1 file changed, 1 insertion(+) + +commit 16b2f40f1cd83ab37eb079b41a0f35bbcf877c93 +Author: Dan Williams +Date: Fri Feb 19 18:21:07 2010 -0800 + + policy: add basic PolicyKit authorizations + + Makefile.am | 2 +- + configure.ac | 1 + + policy/org.freedesktop.modem-manager.policy.in | 39 + ++++++++++++++++++++++++++ + 3 files changed, 41 insertions(+), 1 deletion(-) + +commit dcedb5273c059476813dc68d0617210d0835710b +Author: Dan Williams +Date: Fri Feb 19 11:34:47 2010 -0800 + + mbm: add new C3607w device ID + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 9c958c99bc7621fc800617246e5a9fa4bc4d48c8 +Author: Dan Williams +Date: Tue Feb 16 11:03:16 2010 -0800 + + build: add intltool support for PolicyKit policy translations + + .gitignore | 5 +++++ + Makefile.am | 17 +++++++++++++---- + autogen.sh | 1 + + configure.ac | 10 ++++++++++ + po/LINGUAS | 0 + po/POTFILES.in | 4 ++++ + 6 files changed, 33 insertions(+), 4 deletions(-) + +commit c916ea7b4b0bb56820a08b7d51f46f5357b27bfe +Author: Dan Williams +Date: Tue Feb 16 10:04:26 2010 -0800 + + qcdm: whitespace fixes + + libqcdm/src/result.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit 6239d2e3510bc136a14fdcf7d87e6d85c344bf5a +Author: Dan Williams +Date: Tue Feb 16 09:58:47 2010 -0800 + + qcdm: implement command handling and minimal infrastructure + + libqcdm/src/Makefile.am | 10 ++ + libqcdm/src/com.c | 62 +++++++++++ + libqcdm/src/com.h | 25 +++++ + libqcdm/src/commands.c | 108 +++++++++++++++++++ + libqcdm/src/commands.h | 39 +++++++ + libqcdm/src/dm-commands.h | 187 ++++++++++++++++++++++++++++++++ + libqcdm/src/error.c | 82 ++++++++++++++ + libqcdm/src/error.h | 48 +++++++++ + libqcdm/src/result-private.h | 41 +++++++ + libqcdm/src/result.c | 204 +++++++++++++++++++++++++++++++++++ + libqcdm/src/result.h | 42 ++++++++ + libqcdm/src/utils.c | 27 ++++- + libqcdm/src/utils.h | 9 ++ + libqcdm/tests/Makefile.am | 2 + + libqcdm/tests/test-qcdm-com.c | 241 + ++++++++++++++++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-com.h | 27 +++++ + libqcdm/tests/test-qcdm.c | 53 +++++++++- + 17 files changed, 1205 insertions(+), 2 deletions(-) + +commit 1a7be4a379e95a0ceb5ed1d30540eaf75354f27f +Author: Dan Williams +Date: Thu Feb 11 08:12:41 2010 -0800 + + huawei: ignore CSS on EVDO-capable modems (rh #553199) + + Since CSS doesn't reliably determine EVDO-only registration state. + + plugins/mm-modem-huawei-cdma.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit d8ea5ea003f6e06520ec1254d89ec5fec5438d18 +Author: Dan Williams +Date: Tue Feb 9 23:44:23 2010 -0800 + + gsm: fix initial PIN checking for devices that echo by default + + If the modem echoed commands by default (since we may not have + initialized the modem yet), the echoed command would confuse + the PIN check reply parser. + + src/mm-generic-gsm.c | 8 +++++--- + src/mm-modem-base.c | 12 +++++++++++- + src/mm-modem-base.h | 2 ++ + 3 files changed, 18 insertions(+), 4 deletions(-) + +commit 95dd4b5be1ebb0408be6e282eb20e2c45df1f253 +Author: Dan Williams +Date: Tue Feb 9 22:58:44 2010 -0800 + + gsm: try initial PIN check a few times in case SIM is busy + + src/mm-generic-gsm.c | 33 ++++++++++++++++++++++++++++++--- + 1 file changed, 30 insertions(+), 3 deletions(-) + +commit 953095466d210b76d785175957af0cb686fc5c04 +Author: Dan Williams +Date: Tue Feb 9 22:14:06 2010 -0800 + + sierra: ignore +PACSP0 on GSM devices + + plugins/mm-modem-sierra-gsm.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 33c63a6681f439012524e5a68f6aa7220f38d120 +Author: Dan Williams +Date: Mon Feb 8 12:37:06 2010 -0800 + + zte: quite ZUSIMR messages for PIN-enabled devices too + + Normally this would get done by the prober, but if the device + has a PIN enabled it'll reject almost all commands so the +CPMS? + in the prober will fail. Thus we have to do it after we've unlocked + the device. + + plugins/mm-modem-zte.c | 66 + +++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 65 insertions(+), 1 deletion(-) + +commit 7fdacfc89bb233ee0018a9ae64ce1ffa5a23f5d3 +Author: Dan Williams +Date: Mon Feb 8 11:45:50 2010 -0800 + + test: add SE K600i COPS response testcase + + src/tests/test-modem-helpers.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 626f2953bf394eff4361a6d06a608349605fb5aa +Author: Dan Williams +Date: Mon Feb 8 09:25:58 2010 -0800 + + qcdm: fix licensing of testcases + + libqcdm/tests/test-qcdm-crc.c | 17 ++++++----------- + libqcdm/tests/test-qcdm-escaping.c | 17 ++++++----------- + libqcdm/tests/test-qcdm.c | 17 ++++++----------- + 3 files changed, 18 insertions(+), 33 deletions(-) + +commit 704d6e90b635305510673dcf5e9933a65376986e +Author: Dan Williams +Date: Mon Feb 8 09:13:17 2010 -0800 + + qcdm: add DM protocol utilities and testcases + + Bits for CRC calculation and frame escaping/unescaping. + + .gitignore | 2 + + Makefile.am | 2 +- + configure.ac | 3 + + libqcdm/Makefile.am | 2 + + libqcdm/src/Makefile.am | 31 +++++++ + libqcdm/src/libqcdm.ver | 6 ++ + libqcdm/src/utils.c | 169 + +++++++++++++++++++++++++++++++++++++ + libqcdm/src/utils.h | 37 ++++++++ + libqcdm/tests/Makefile.am | 26 ++++++ + libqcdm/tests/test-qcdm-crc.c | 70 +++++++++++++++ + libqcdm/tests/test-qcdm-crc.h | 25 ++++++ + libqcdm/tests/test-qcdm-escaping.c | 129 ++++++++++++++++++++++++++++ + libqcdm/tests/test-qcdm-escaping.h | 26 ++++++ + libqcdm/tests/test-qcdm.c | 49 +++++++++++ + 14 files changed, 576 insertions(+), 1 deletion(-) + +commit 9eb376d782e1f40d430807794c5b0f60a91e058b +Author: Dan Williams +Date: Wed Feb 3 18:37:24 2010 -0800 + + longcheer: add more port tags + + plugins/77-mm-longcheer-port-types.rules | 94 + ++++++++++++++++++++++++++++++++ + 1 file changed, 94 insertions(+) + +commit 8e3406bf740144ac657d13c69bff0f3407311b14 +Author: Dan Williams +Date: Wed Feb 3 15:19:36 2010 -0800 + + longcheer: tag ChinaBird PL68 (pid 0x9000) ports (bgo #608668) + + plugins/77-mm-longcheer-port-types.rules | 5 +++++ + 1 file changed, 5 insertions(+) + +commit a9918d59427eae2b00da8fbe92c556a90db38b43 +Author: Martin Pitt +Date: Tue Feb 2 10:02:53 2010 -0800 + + core: ignore VTs + + Even just walking sysfs for driver and parent devices takes + time for ports we know we'll never use, so take a short-cut + and save some startup time. This reduces the startup + overhead to some 15%. + + src/mm-manager.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 469e54c364de5776b1b41db0f5eaa9cb3f34f6b0 +Author: Dan Williams +Date: Sun Jan 31 22:33:38 2010 -0800 + + gsm: update UnlockRequired status on PIN/PUK entry result + + src/mm-generic-gsm.c | 82 + ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 80 insertions(+), 2 deletions(-) + +commit c85e61753000514ae140cf745e47e835edb934cb +Author: Dan Williams +Date: Sun Jan 31 22:32:33 2010 -0800 + + serial: handle string CME error codes too + + Some devices won't get to the initialization stage where we send + CMEE=1 (for numeric error codes) before they return some errors, + so handle the string representation of CME error codes too. + + src/mm-serial-parsers.c | 102 + ++++++++++++++++++++++++++++-------------------- + 1 file changed, 60 insertions(+), 42 deletions(-) + +commit 27d1c8f936379ec88a0098388067d02571a6974d +Author: Dan Williams +Date: Sun Jan 31 21:52:29 2010 -0800 + + errors: rework error conversion + + Use the same error structure for parsing numeric and string-based + errors. + + src/mm-errors.c | 173 + ++++++++++++++++++++++++++++++++++++++------------------ + src/mm-errors.h | 4 +- + 2 files changed, 120 insertions(+), 57 deletions(-) + +commit ba9634ae4fe0a3685cb9ccbc1d68fd05e0ebc1ac +Author: Dan Williams +Date: Sun Jan 31 12:04:53 2010 -0800 + + serial: add mm_serial_port_is_open() + + src/mm-serial-port.c | 9 +++++++++ + src/mm-serial-port.h | 2 ++ + 2 files changed, 11 insertions(+) + +commit 765920803744c6b1326ed44894f73cb9b7481e38 +Author: Dan Williams +Date: Sun Jan 31 12:00:26 2010 -0800 + + core: log when unlock state changes + + src/mm-modem-base.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 42a20ab1872ad8b570ddf97a920d83bc63defd9e +Author: Dan Williams +Date: Sun Jan 31 11:57:05 2010 -0800 + + core: whitespace fixup + + src/mm-modem-base.c | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +commit 1561436788fc26b82f803ca818ec025253ca9d63 +Author: Norbert Frese +Date: Sun Jan 31 11:43:52 2010 -0800 + + core: check modem PIN state before exporting it (bgo #604551) + + And set UnlockRequired accordingly. Large cleanups and rework by + dcbw. + + src/mm-generic-gsm.c | 109 + +++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 84 insertions(+), 25 deletions(-) + +commit 3d0f2ecf126734e96ad1f18d7e069ded3711b9f8 +Author: Norbert Frese +Date: Sun Jan 31 11:06:55 2010 -0800 + + core: add an UnlockRequired property that provides lock status + (bgo #604551) + + Clients can check the property to determine lock/unlock status + and thus + unlock the modem before trying to connect if required. + + Bits of the patch by dcbw (see the bug). + + introspection/mm-modem.xml | 12 ++++++++++++ + src/mm-modem-base.c | 30 ++++++++++++++++++++++++++++++ + src/mm-modem-base.h | 3 +++ + src/mm-modem.c | 9 +++++++++ + src/mm-modem.h | 4 +++- + 5 files changed, 57 insertions(+), 1 deletion(-) + +commit 649b7e25a038cd6df735b2558bf22ee9d379924b +Author: Dan Williams +Date: Wed Jan 27 15:50:53 2010 -0800 + + build: update .gitignore + + .gitignore | 3 +++ + 1 file changed, 3 insertions(+) + +commit aab913049b3f297397901ad1259c321975675666 +Author: Michael Biebl +Date: Wed Jan 27 15:49:28 2010 -0800 + + build: update .gitignore file for m4 macros + + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 22e687833cda89855e6dba9b3771ab403771738d +Author: Michael Biebl +Date: Wed Jan 27 15:48:55 2010 -0800 + + build: unify compiler warnings + + configure.ac | 31 ++----------------------------- + m4/compiler_warnings.m4 | 31 +++++++++++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 29 deletions(-) + +commit 22f6ab4dc604eba85271a10cdb5a1b987db6490f +Author: Michael Biebl +Date: Wed Jan 27 15:48:10 2010 -0800 + + build: use separate directory for m4 macros + + Makefile.am | 2 ++ + configure.ac | 2 ++ + 2 files changed, 4 insertions(+) + +commit 053db1d27ca5147e7d434ce660fa26ef83d3ed11 +Author: Dan Williams +Date: Fri Jan 22 14:11:24 2010 -0800 + + misc: fix FSF address in license headers + + plugins/mm-modem-mbm.c | 4 ---- + plugins/mm-modem-mbm.h | 4 ---- + plugins/mm-plugin-mbm.c | 4 ---- + plugins/mm-plugin-mbm.h | 4 ---- + 4 files changed, 16 deletions(-) + +commit ed885b7595294115b5cde8755c754515294f27cc +Merge: a919c835 e9840144 +Author: Dan Williams +Date: Tue Jan 19 15:07:03 2010 -0800 + + Merge commit 'origin/anydata' + +commit a919c8358284e948717c83d9d6c143281295390b +Author: Dan Williams +Date: Tue Jan 19 15:03:20 2010 -0800 + + release: bump version to 0.3 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fabc1eba2339d28b74747e397ec2e9cad9dc34d2 +Author: Dan Williams +Date: Tue Jan 19 15:02:30 2010 -0800 + + doc: build and completeness fixes + + introspection/Makefile.am | 1 + + introspection/all.xml | 1 + + 2 files changed, 2 insertions(+) + +commit 564d054e8e52e154dbf9996d5efc53260d4f3e09 +Author: Dan Williams +Date: Tue Jan 19 14:35:48 2010 -0800 + + cdma: increase data call initiation timeout + + Some cards (Novatel S720 for example) can take a long time to start + a data call if the device isn't activated on the network or the + signal strength is low. + + src/mm-generic-cdma.c | 2 +- + test/mm-test.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c6694a06b546d04a528a3e97c7d1ff696a3c2756 +Author: Dan Williams +Date: Tue Jan 19 14:23:05 2010 -0800 + + core: fix mm_modem_check_removed() to return errors correctly + + Make sure all errors actually get returned, not just removal errors. + + src/mm-modem.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit e98401440475a1a82486fcb9ce4d02f092e627c5 +Author: Dan Williams +Date: Tue Jan 19 13:56:53 2010 -0800 + + anydata: whitespace cleanup + + plugins/mm-modem-anydata-cdma.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit e4439d399a055055b01306457b4541103d5c9b92 +Author: Dan Williams +Date: Tue Jan 19 13:56:07 2010 -0800 + + anydata: capture some unsolicited messages + + plugins/mm-modem-anydata-cdma.c | 68 + ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 67 insertions(+), 1 deletion(-) + +commit 7fc53d29cce23347b12d9c3be7a753a506a88c11 +Author: Dan Williams +Date: Tue Jan 19 13:48:21 2010 -0800 + + anydata: remove unused code + + plugins/mm-modem-anydata-cdma.c | 19 ------------------- + 1 file changed, 19 deletions(-) + +commit f6a09050af45a0bdbf3ddcd27e8e6197040671f3 +Author: Dan Williams +Date: Tue Jan 19 13:46:07 2010 -0800 + + cdma: allow plugins to override AT+CSS? during registration checking + (rh #547294) + + Some modems key the AT+CSS? response off their 1X state, so if the + modem has EVDO service but no 1X service, AT+CSS? will provide + incorrect + registration state information and the registration checking will + end too early. Allow modems that can handle more specific + registration + checking to skip the AT+CSS? part. + + plugins/mm-modem-anydata-cdma.c | 1 + + src/mm-generic-cdma.c | 73 + +++++++++++++++++++++++++++++++---------- + src/mm-generic-cdma.h | 6 ++-- + 3 files changed, 61 insertions(+), 19 deletions(-) + +commit 19c988d92b67b56d7c87993f7a8efd984124df39 +Author: Dan Williams +Date: Tue Jan 19 13:19:55 2010 -0800 + + anydata: add plugin for AnyData CDMA devices (rh #547294) + + plugins/Makefile.am | 21 ++- + plugins/mm-modem-anydata-cdma.c | 336 + ++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-anydata-cdma.h | 45 ++++++ + plugins/mm-plugin-anydata.c | 179 +++++++++++++++++++++ + plugins/mm-plugin-anydata.h | 41 +++++ + 5 files changed, 621 insertions(+), 1 deletion(-) + +commit f4d2e30525055591d0f3bddd99936be4a5e3d444 +Author: Dan Williams +Date: Tue Jan 19 12:27:54 2010 -0800 + + huawei-cdma: robustify SYSINFO parsing + + Shouldn't happen since the number of matches was already + verified, but doesn't hurt to make sure we don't pass NULL + to strtol(). + + plugins/mm-modem-huawei-cdma.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 82eecfca923a3b4dec6c363e756516f6aaa47486 +Author: Dan Williams +Date: Tue Jan 19 11:53:45 2010 -0800 + + sierra: prefer primary port for status + + plugins/mm-modem-sierra-cdma.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +commit 28eca600f7f1a0387a99c51d35179d81dc3fec59 +Merge: 50ad39b2 b1992f90 +Author: Dan Williams +Date: Tue Jan 19 00:21:10 2010 -0800 + + Merge commit 'origin/probe-cpin' + +commit 50ad39b28e61adb3d9da178c47e41100f554adeb +Author: Dan Williams +Date: Tue Jan 19 03:16:34 2010 -0800 + + core: protect against modem removal in critical callbacks (rh #553953) + + There are more places to handle, but these are the most critical. If + the modem is removed while a command is in-progress, the + mm-callback-info + code will set info->modem to NULL. Make sure we check for that in + callbacks and return a reasonable error. Previous code would just + blindly forge ahead and die on a null dereference. + + src/mm-callback-info.c | 5 ++-- + src/mm-errors.c | 3 +- + src/mm-errors.h | 3 +- + src/mm-generic-cdma.c | 77 + +++++++++++++++++++++++++++----------------------- + src/mm-generic-gsm.c | 69 +++++++++++++++++++++++--------------------- + src/mm-modem.c | 46 +++++++++++++++++++++++++++--- + src/mm-modem.h | 2 ++ + 7 files changed, 129 insertions(+), 76 deletions(-) + +commit 73e10c77d37791ed4a1f51ee8c1007600ef24bde +Author: Dan Williams +Date: Mon Jan 18 23:59:54 2010 -0800 + + cdma: prefer primary port unless it's connected + + plugins/mm-modem-huawei-cdma.c | 23 ++++---- + src/mm-generic-cdma.c | 119 + ++++++++++++++++++++++------------------- + 2 files changed, 78 insertions(+), 64 deletions(-) + +commit b1992f903b27f2a0b8190daaedcbe76790180c3c +Author: Dan Williams +Date: Mon Jan 18 23:22:02 2010 -0800 + + probe: add note about Onda MT503HS (rh #551376) + + src/mm-plugin-base.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit a1520465fd5b5ad6a75508f5b776a77404425daa +Author: Dan Williams +Date: Mon Jan 18 15:37:06 2010 -0800 + + build: fix 'make clean' + + Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 0cc9c1731ce6250a5538b1f24ddce5dc4298f717 +Author: Dan Williams +Date: Sun Jan 17 17:37:41 2010 -0800 + + probe: add CPIN request during the probing process (bgo #604369) + + Some devices (ZTE MF628) respond to everything except CPIN? with + ERROR unless the PIN has been sent. Since no known CDMA devices + support AT+CPIN, assume that devices that return a CPIN response + are GSM devices. + + src/mm-plugin-base.c | 99 + ++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 73 insertions(+), 26 deletions(-) + +commit 4cb58b8f5f373f5717005a5216d1b4ee8802839c +Author: Dan Williams +Date: Sat Jan 16 15:59:29 2010 -0800 + + zte: ignore SIM Build Main Menu requests (rh #551376) + + plugins/mm-modem-zte.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 23727a5b106abfef53ccb5929bf2353adf474889 +Author: Dan Williams +Date: Fri Jan 15 11:48:35 2010 -0800 + + longcheer: install udev rules + + plugins/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 621d9e8751dca6d93bf50e5a8c86dab686bf57d4 +Author: Dan Williams +Date: Fri Jan 15 11:45:43 2010 -0800 + + longcheer: don't try to use untagged ports on known devices + + plugins/77-mm-longcheer-port-types.rules | 3 +++ + plugins/mm-plugin-longcheer.c | 13 ++++++++++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit 471d8a70a931bd4571ca025dbe0481510d619f2c +Author: Dan Williams +Date: Fri Jan 15 01:37:26 2010 -0800 + + longcheer: new plugin for Longcheer (Alcatel etc) devices (bgo + #606550) + + Anything with vendor ID 0x1c9e really; like Alcatel X020, X030, + X060s, etc. Longcheer appears to make the actual hardware that all + the devices with vendor ID 0x1c9e use. You'll see it in .INF files + with "CMLONG" as part of the USB interface definition. + + If the ports are not correctly detected, we need to get the driver's + .INF files to determine what the ports should be, and add them to + the udev rules file. + + plugins/77-mm-longcheer-port-types.rules | 42 ++++++++ + plugins/Makefile.am | 19 +++- + plugins/mm-plugin-longcheer.c | 180 + +++++++++++++++++++++++++++++++ + plugins/mm-plugin-longcheer.h | 41 +++++++ + 4 files changed, 281 insertions(+), 1 deletion(-) + +commit a4fee864c21a0c12d391e764f648bae1c38a22e7 +Author: Dan Williams +Date: Tue Jan 12 09:29:36 2010 -0800 + + release: bump version to 0.2.998 (0.3-rc2) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eeb780704455003ec233714ad346963f8ed26b7d +Author: Dan Williams +Date: Tue Jan 5 23:24:59 2010 -0600 + + test: add Gobi COPS response testcase + + src/tests/test-modem-helpers.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit d3b5688d4374a9ca39a11453a7b2d143274b2725 +Author: Dan Williams +Date: Tue Jan 5 21:54:05 2010 -0600 + + test: add Nokia 2720 COPS response testcase + + src/tests/test-modem-helpers.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 008c7e322d91ebe7995b57e77ac48162655556e1 +Author: Dan Williams +Date: Tue Jan 5 21:47:40 2010 -0600 + + test: add Novatel XU870 and Option GT Ultra Express COPS response + testcases + + src/tests/test-modem-helpers.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +commit f444533a74884dcd545591035b1c58ec2708be9a +Author: Dan Williams +Date: Tue Jan 5 18:07:29 2010 -0600 + + test: add +COPS response testcases for E1550, MF622, and E226 + + src/tests/test-modem-helpers.c | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 1faead71aa79c148288470b9837e50a36746d6bf +Author: Dan Williams +Date: Tue Jan 5 18:07:12 2010 -0600 + + test: handle various missing operator strings if the modem doesn't + report them + + test/mm-test.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit c30f23e02c0759ddd333699c7d39fe53bdf159ac +Author: Dan Williams +Date: Tue Jan 5 15:03:06 2010 -0600 + + gsm: add testcase for invalid +COPS response + + src/mm-modem-helpers.c | 3 +++ + src/tests/test-modem-helpers.c | 26 ++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+) + +commit 3988f53d2e9b9aae7eb4f6fb8c46dca55373ba6f +Author: Dan Williams +Date: Tue Jan 5 14:57:30 2010 -0600 + + gsm: correctly parse Nokia N80 +COPS response + + src/mm-modem-helpers.c | 108 + ++++++++++++++++++++++++++++++++--------- + src/tests/test-modem-helpers.c | 46 ++++++------------ + 2 files changed, 100 insertions(+), 54 deletions(-) + +commit 216e49f8d8bbfbc0b7d2fbd00ac712a2de41b33a +Author: Dan Williams +Date: Tue Jan 5 14:29:19 2010 -0600 + + gsm: split out +COPS response parsing and add testcases + + configure.ac | 15 ++ + src/Makefile.am | 18 +- + src/mm-generic-gsm.c | 113 +------------ + src/mm-modem-helpers.c | 140 ++++++++++++++++ + src/mm-modem-helpers.h | 31 ++++ + src/tests/Makefile.am | 22 +++ + src/tests/test-modem-helpers.c | 371 + +++++++++++++++++++++++++++++++++++++++++ + 7 files changed, 601 insertions(+), 109 deletions(-) + +commit a06b3f20cafab2ff2d1de16553f7ff578a9b761b +Author: Dan Williams +Date: Fri Jan 1 20:52:15 2010 -0600 + + serial: prevent "hangs" by limiting EAGAIN retries on serial writes + + MM would appear to hang sometimes when writing to serial devices but + in reality was just retrying the write too many times. Make the + retry limit time-based so MM doesn't hang but times the attempt out + instead. + + src/mm-serial-port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 5eed83cd753679acae1070893052243299330200 +Author: Dan Williams +Date: Wed Dec 23 02:19:26 2009 -0800 + + gsm: ensure registration state is reset when disabling the modem + + src/mm-generic-gsm.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit b94627572fa09ed71bfcc633e9b5a40f5e49c596 +Author: Dan Williams +Date: Tue Dec 22 16:58:23 2009 -0800 + + core: implement a PropertiesChanged signal for the MMModem class + + At the moment only the Enabled property is exported. + + introspection/mm-modem.xml | 19 +++ + marshallers/mm-marshal.list | 1 + + src/Makefile.am | 4 +- + src/mm-modem-base.c | 20 ++- + src/mm-modem.h | 2 + + src/mm-properties-changed-signal.c | 276 + +++++++++++++++++++++++++++++++++++++ + src/mm-properties-changed-signal.h | 28 ++++ + 7 files changed, 348 insertions(+), 2 deletions(-) + +commit 710986bd4b630095eff7b53bc5d46d0bed94495e +Author: Dan Williams +Date: Mon Dec 21 11:37:36 2009 -0800 + + core: add Enabled property to org.freedesktop.ModemManager.Modem + interface + + introspection/mm-modem.xml | 6 ++++++ + src/mm-modem-base.c | 8 ++++++++ + src/mm-modem.c | 8 ++++++++ + src/mm-modem.h | 2 ++ + 4 files changed, 24 insertions(+) + +commit 71cbcb834c77025d82d91dadcb2c19bd58dd7b85 +Author: Dan Williams +Date: Mon Dec 21 11:18:38 2009 -0800 + + build: don't require pppd headers to build + + If they're not there, just ignore them and don't build the PPP-enabled + bits of the test tool. + + configure.ac | 25 ++++++++++++++++++++++++- + test/Makefile.am | 4 ++++ + 2 files changed, 28 insertions(+), 1 deletion(-) + +commit 791faca8fa1174020052b4dea05b7063946f8c79 +Author: Dan Williams +Date: Mon Dec 21 11:17:59 2009 -0800 + + introspection: add missing mm-modem-gsm.xml + + introspection/all.xml | 1 + + 1 file changed, 1 insertion(+) + +commit 36d8d328c73bfcfb4d52bfcaa3b8c334da952d0e +Author: Dan Williams +Date: Mon Dec 21 10:02:57 2009 -0800 + + test: add support for static IP configured devices (ie, 'hso') + + test/mm-test.py | 126 + +++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 98 insertions(+), 28 deletions(-) + +commit a8fc7ecd77cc5e2bf63d457fa30cca605ff63a8c +Author: Dan Williams +Date: Sun Dec 20 00:17:12 2009 -0800 + + test: add ability to drive ppp for connection tests + + configure.ac | 7 ++ + test/Makefile.am | 16 +++ + test/mm-test-pppd-plugin.c | 264 + +++++++++++++++++++++++++++++++++++++++++++++ + test/mm-test.py | 154 ++++++++++++++++++++++++-- + 4 files changed, 432 insertions(+), 9 deletions(-) + +commit 87ee623923ec527aa1158387901aab19e64dc22b +Author: Dan Williams +Date: Sun Dec 20 00:16:45 2009 -0800 + + test: fix build warning + + test/lsudev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit db7214c202b7ed9d9cf12f49ff70ceba020f6f33 +Author: Dan Williams +Date: Fri Dec 18 19:44:48 2009 -0800 + + sierra: fix CDMA registration detection in some cases + + It turns out that "Modem is [NOT] registered" is not a good indicator + of whether the card has service or not; instead some of the AT!STATUS + response is needed to really determine registration state or not. + + plugins/mm-modem-sierra-cdma.c | 72 + ++++++++++++++++++++++++++++++++++-------- + 1 file changed, 59 insertions(+), 13 deletions(-) + +commit 8d42094608e68eccbcf5838d87fd59aa605a18be +Author: Dan Williams +Date: Wed Dec 16 15:26:05 2009 -0800 + + zte: handle unsolicited messages during probe + + This implements the same fixes that NetworkManager's 0.7 branch + implemented in commits f38ad328acfdc6ce29dd1380602c546b064161ae and + 1235f71b20c92cded4abd976ccc5010649aae1a0. Many ZTE devices will + spam the port with messages about waiting voicemail/SMS which buffer + up and cause the device to eventually crash if not suppressed. + + plugins/mm-plugin-zte.c | 9 ++++++ + src/mm-plugin-base.c | 76 + ++++++++++++++++++++++++++++++++++++++++++++++++- + src/mm-plugin-base.h | 5 ++++ + 3 files changed, 89 insertions(+), 1 deletion(-) + +commit 3ad172d1504b20949049cf47783e1fe7287c9b95 +Author: Dan Williams +Date: Wed Dec 16 14:34:29 2009 -0800 + + cdma: fix quality parsing if modem doesn't prepend +CSQ: + + Which some Huawei modems (EC168C) don't do. + + src/mm-generic-cdma.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit 30a2a202073bb7c9ac56326fff01517850894774 +Author: Dan Williams +Date: Wed Dec 16 14:20:24 2009 -0800 + + sierra: use at!pcstate on CDMA modems for power control + + at!pcstate is what Sierra CDMA modems use instead of AT+CFUN for + powering the radio on and off. It doesn't turn the modem off + completely + like AT+CFUN=0 does for many GSM devices though, so it's quite a + lot nicer. + + plugins/mm-modem-sierra-cdma.c | 46 +++++++++++++++++++ + src/mm-generic-cdma.c | 100 + ++++++++++++++++++++++++++++++----------- + src/mm-generic-cdma.h | 14 ++++++ + 3 files changed, 133 insertions(+), 27 deletions(-) + +commit 2fc0c039e65173123a39a0fb6c8f44804cbd773a +Author: Dan Williams +Date: Fri Dec 11 16:30:25 2009 -0800 + + option: always pick the right data port + + This is the MM equivalent of NM commit + 9d7f5b3d084eee2ccfff721c4beca3e3f34bdc50; + Genuine Option NV devices are always supposed to use USB interface + 0 as + the modem/data port, per mail with Option engineers. Only this port + will emit responses to dialing commands. + + plugins/mm-plugin-option.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 488baa13302c6d1e839db6afc9fed088e9d5dbba +Author: Dan Williams +Date: Fri Dec 11 13:19:21 2009 -0800 + + mbm: ensure various unsolicited responses are turned off when + disabling + + If the modem wasn't connected when disable is called, the generic GSM + code doesn't need to shut anything down and thus closes the serial + port immediately. That means the mbm plugin's CREG=0 and CMER=0 won't + get sent because the port is closed. mbm needs to ensure that it's + commands actually get sent to the modem by really sending them and + waiting for the response before chaining up to the parent's disable. + + plugins/mm-modem-mbm.c | 36 +++++++++++++++++++++++++++++------- + 1 file changed, 29 insertions(+), 7 deletions(-) + +commit eaf167bebdc24c992b0a7b130432064eb5c537b7 +Author: Dan Williams +Date: Fri Dec 11 12:53:50 2009 -0800 + + test: argument parsing and connect improvements + + test/mm-test.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 41ea9a0e4bc3817fa060d54c7c7df7a8606eb9d1 +Author: Dan Williams +Date: Fri Dec 11 10:48:23 2009 -0800 + + cdma: try +CSQ? if CSQ fails + + Some modems want one, some modems want the other. Try both. + + src/mm-generic-cdma.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +commit 3d852435c6032cdae09659e103561a0ecac62b7e +Author: Dan Williams +Date: Fri Dec 11 09:30:51 2009 -0800 + + cdma: accept SID 0 in some cases + + Most AT command references allow modems to report SID 0, even though + SID 0 is not a valid SID and is not assigned to any CDMA network. + Some Sierra 5725 cards have been seen to report valid class and band + from the +CSS response but a SID 0. Accept SID 0 when at least one + other element of the +CSS response indicates that the modem has + service. + Otherwise, report "no service" as before. + + src/mm-generic-cdma.c | 32 +++++++++++++++++++++++++++----- + 1 file changed, 27 insertions(+), 5 deletions(-) + +commit 07114d4f43c6e724d22294108b1e73785e7aab2a +Author: Dan Williams +Date: Mon Dec 7 22:07:58 2009 -0800 + + release: bump version to 0.2.997 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dd057d28e4ab3812eebd41a7df1c2f80d90d8600 +Merge: f715e0d4 a9e06244 +Author: Dan Williams +Date: Mon Dec 7 22:04:28 2009 -0800 + + Merge commit 'origin/states' + +commit a9e0624426632a38c2d208e7a28fac3bca51d857 +Author: Dan Williams +Date: Mon Dec 7 18:40:04 2009 -0800 + + gsm: handle different +COPS response behavior + + Some modems delay the +COPS response until registration is complete, + others return right away. Make sure that both behaviors work + correctly. + + src/mm-generic-gsm.c | 61 + +++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 53 insertions(+), 8 deletions(-) + +commit 5a4a9a6239ac771e8ddc343d041f643d848a7ad2 +Author: Dan Williams +Date: Mon Dec 7 18:39:18 2009 -0800 + + core: add refcounts to MMCallbackInfo + + src/mm-callback-info.c | 39 +++++++++++++++++++++++++++++++-------- + src/mm-callback-info.h | 6 ++++++ + 2 files changed, 37 insertions(+), 8 deletions(-) + +commit 1157b59a18ee4e5da109977947181f8596f100ff +Author: Dan Williams +Date: Wed Dec 2 14:59:26 2009 -0800 + + core: pretty-print state changes + + src/mm-manager.c | 2 -- + src/mm-modem.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + src/mm-modem.h | 2 ++ + 3 files changed, 44 insertions(+), 3 deletions(-) + +commit 5bdabaabec5ecb64986036bf783196eeee3756e7 +Author: Dan Williams +Date: Wed Dec 2 14:43:09 2009 -0800 + + gsm: implement enable/connecting/disconnecting state handling + + And consolidate generic port enable code in one place since pretty + much every modem needs that. + + plugins/mm-modem-hso.c | 33 ++++---- + plugins/mm-modem-mbm.c | 165 + +++++++++++++++++++-------------------- + plugins/mm-modem-novatel-gsm.c | 67 +++++++--------- + plugins/mm-modem-option.c | 21 +++-- + plugins/mm-modem-sierra-gsm.c | 25 +++--- + plugins/mm-modem-zte.c | 58 +++++--------- + src/mm-generic-gsm.c | 170 + ++++++++++++++++++++++++++++------------- + src/mm-generic-gsm.h | 28 +++++++ + 8 files changed, 309 insertions(+), 258 deletions(-) + +commit 872fe9bf6bb0555f7e4df85fc06314a013404428 +Author: Dan Williams +Date: Wed Dec 2 14:42:58 2009 -0800 + + test: give some time before disconnecting + + test/mm-test.py | 3 +++ + 1 file changed, 3 insertions(+) + +commit bb6f997fb8b6acad6af62cae081b55e6d94cc1b6 +Author: Dan Williams +Date: Tue Dec 1 16:46:23 2009 -0800 + + gsm: update for new states and state flow fixes + + plugins/mm-modem-mbm.c | 1 + + src/mm-generic-gsm.c | 74 + ++++++++++++++++++++++++++++++++++++++++++++++---- + src/mm-generic-gsm.h | 10 +++++++ + 3 files changed, 80 insertions(+), 5 deletions(-) + +commit 7f1951fec867de5553b130c21df4eb5f447889a1 +Author: Dan Williams +Date: Tue Dec 1 16:44:07 2009 -0800 + + core: fix ordering of DISABLING and DISABLED states + + src/mm-modem.c | 2 +- + src/mm-modem.h | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit bf13b4698f8d94119f42e5cdf5df6a3dbfe354fd +Author: Dan Williams +Date: Tue Dec 1 16:33:44 2009 -0800 + + cdma: reset previous state if disconnect failed + + src/mm-generic-cdma.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +commit c169396c1bbb1238e3c405bb9c53eb12712acb9b +Author: Dan Williams +Date: Tue Dec 1 16:19:27 2009 -0800 + + cdma: correctly handle state update after disconnection + + We only want to ignore connected/connecting/disconnecting states + and update the state based on registration for unsolicited + registration changes. Basically, when disconnecting, the modem + will be in DISCONNECTING state, but after the disconnect has finished + we want to update the modem's state based on the current + registration status. But the previous check for >= DISCONNECTING + would prevent that from happening, so we need a slightly more specific + check in update_enabled_state(). + + src/mm-generic-cdma.c | 29 +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +commit d438012f63dac7e4819f09b520658abb42234082 +Author: Dan Williams +Date: Tue Dec 1 16:01:20 2009 -0800 + + cdma: s/GSM/CDMA + + Oops. + + src/mm-generic-cdma.c | 4 ++-- + src/mm-generic-cdma.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 02c7db7fcfc7af226c2677793685528928d6f7f5 +Author: Dan Williams +Date: Tue Dec 1 15:58:11 2009 -0800 + + cdma: handle interim enabling/disabling states better + + Have to fall back to the previous state if the enable/disable + operation fails since we cannot assume anything about the new + modem state when a failure occurs. + + src/mm-generic-cdma.c | 36 ++++++++++++++++++++++++++++++++++-- + src/mm-generic-cdma.h | 2 ++ + 2 files changed, 36 insertions(+), 2 deletions(-) + +commit a295afdd2ddd99dea8435d95a72f02d0ade2b2b7 +Author: Dan Williams +Date: Tue Dec 1 15:39:06 2009 -0800 + + cdma: update for new modem states and make connect actually work + + src/mm-generic-cdma.c | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +commit e9964231e931f283ecf232f23f45282a22e3471a +Author: Dan Williams +Date: Tue Dec 1 15:38:11 2009 -0800 + + core: use modem states to protect against double operations + + src/mm-modem.c | 111 + +++++++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 105 insertions(+), 6 deletions(-) + +commit 0f19bbff0f7b29c5922307526c3a7770fe8718e1 +Author: Dan Williams +Date: Tue Dec 1 15:37:37 2009 -0800 + + core: add a few more interim modem states + + src/mm-modem.h | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +commit 015da49d06fd7f19c444ba7b9e98baeb31c72c4d +Author: Dan Williams +Date: Tue Dec 1 14:19:25 2009 -0800 + + core: set modem state before potentially destroying the modem + + src/mm-modem-base.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d269a9a278687c82e5a6ec3f1bba0f91161a05c7 +Author: Dan Williams +Date: Tue Dec 1 12:58:57 2009 -0800 + + core: state should always be reset to DISABLED when validity changes + + When the modem becomes valid, it should initially be in disabled + state, + and when it becomes invalid, it should also go to disabled. + + src/mm-modem-base.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 76facd689188029cd9fe01be837f86b895231ded +Author: Dan Williams +Date: Tue Dec 1 12:58:25 2009 -0800 + + mbm: update state after enabling the device + + plugins/mm-modem-mbm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 231d2ca90b6d197d4594407fc3e6b6ee2c7fb850 +Author: Dan Williams +Date: Tue Dec 1 12:57:39 2009 -0800 + + core: schedule enabled/disabled callbacks to avoid infinite recursion + + src/mm-modem.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 3350a3aeea6ceeb959d7622b62f53ab86bb2ab48 +Author: Dan Williams +Date: Tue Dec 1 12:57:18 2009 -0800 + + cdma: set correct modem state on connect failure + + src/mm-generic-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f715e0d498930409d97a8097b37731aadbc11a72 +Author: Dan Williams +Date: Tue Dec 1 11:25:28 2009 -0800 + + build: require glib-2.0 >= 2.6.18 for g_set_error_literal() + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 881a725ea47e059023a268404368346d232dd15a +Merge: 909b8b7c b46ac89f +Author: Dan Williams +Date: Tue Dec 1 11:22:00 2009 -0800 + + Merge commit 'origin/master' into states + +commit b46ac89ff68d1e1211f7aa21ca816c23eed6316e +Author: Dan Williams +Date: Tue Dec 1 10:02:47 2009 -0800 + + zte: add missing ZTE device aux port tags + + plugins/77-mm-zte-port-types.rules | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 35daaff983ec4c0435066bc5776b664a91359909 +Author: Dan Williams +Date: Mon Nov 30 20:17:43 2009 -0800 + + gsm: more complete parsing of PIN responses + + Need to handle ex PH-NET PIN from a subsidy-locked device for + example. + + src/mm-generic-gsm.c | 50 + ++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 42 insertions(+), 8 deletions(-) + +commit c87b4dcc7796f9c8b0980c47796b3f2fad8477ec +Author: Dan Williams +Date: Mon Nov 30 17:42:37 2009 -0800 + + zte: add additional device port tags + + Don't know the aux port yet but we'll figure that out; + and in the mean time the autoprobing should tag the + port as a secondary port anyway. + + plugins/77-mm-zte-port-types.rules | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +commit 909b8b7c8dbe2de97d9550004641c70411d92c56 +Merge: c463b5a4 0f595adb +Author: Dan Williams +Date: Mon Nov 30 15:44:20 2009 -0800 + + Merge commit 'origin/master' into states + +commit 0f595adb7f07f575627667480f23775b21f9efb2 +Author: Dan Williams +Date: Mon Nov 30 15:41:09 2009 -0800 + + gsm: fix unsolicited registration segfaults + + By decoupling the solicited registration callback from unsolicited + replies, we can be sure of the call flow and avoid issues where + unsolicited registration will be processed when an explicit + registration request is no longer in progress. + + Also ups the timeout on CREG=0,, to 120 seconds because that + appears to trigger an internal scan on some of the 'hso' devices + that I have, and can take up to 60 or more seconds to complete + or fail. + + src/mm-generic-gsm.c | 124 + ++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 83 insertions(+), 41 deletions(-) + +commit f205c814b58d37b3865c42e7f8b5112ce0f78aa0 +Author: Dan Williams +Date: Mon Nov 30 09:47:39 2009 -0800 + + hso: ensure authentication works again after auth errors + + plugins/mm-modem-hso.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit d06f8f46c68bd561b349f2db78d3caca531d3a4f +Author: Dan Williams +Date: Sun Nov 29 22:46:48 2009 -0800 + + serial: don't run commands when there's already one in-progress + + If there's already a command in-progress don't try to send + another until the previous one has timed out. Also use + g_timeout_add_seconds() since precision doesn't really matter for + command timeouts. + + src/mm-serial-port.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit 028c6a5e4eaf487bbb18debacbc0c56c32f8f52b +Author: Dan Williams +Date: Sun Nov 29 22:45:28 2009 -0800 + + hso: fix up connection issues and error ignorance + + Should have ignored errors when cleaning up old contexts that + may or may not exist. Rename hso_disable() to something more + appropriate since it's actually part of the enable/connect path, + not the disable path. + + plugins/mm-modem-hso.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 3890009bcc15a9524fdd17cdb6c8ec7f1b879f31 +Author: Dan Williams +Date: Sun Nov 29 22:45:03 2009 -0800 + + test: actually send username and password when connecting + + test/mm-test.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 01db3f1c2fad716088563fb7e91720691fd962d4 +Author: Dan Williams +Date: Sun Nov 29 21:49:46 2009 -0800 + + test: give connect a bit more time + + Registration can be part of the connect process, which can take + quite a while. + + test/mm-test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c8fdb592e3500177c3267b9eefd4afebed58bb64 +Author: Dan Williams +Date: Sun Nov 29 18:58:56 2009 -0800 + + hso: send authentication info correctly for Icera-based Option modems + + Icera-based modems use AT_OPDPP instead of AT$QCPDPP. + + plugins/mm-modem-hso.c | 86 + ++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 63 insertions(+), 23 deletions(-) + +commit 9dbf8f22c06a204dd3cd9521c52cc5afafe8d278 +Author: Dan Williams +Date: Sun Nov 29 18:58:21 2009 -0800 + + gsm: allow unsolicted registration updates to actually update + reg state + + src/mm-generic-gsm.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +commit d5b0574f587ddab904d3a1f1af3cb2c354486f66 +Author: Dan Williams +Date: Sun Nov 29 18:56:29 2009 -0800 + + test: handle scan errors more gracefully + + test/mm-test.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit aea0be5b9a02926a1f8f72104ce32c7dabae3f84 +Author: Dan Williams +Date: Thu Nov 26 13:54:47 2009 -0800 + + nozomi: fix detection (lp:425312) + + Nozomi devices aren't quite ready when the ports show up, so + we have to keep trying to open the port for a few seconds and + eventually it'll succeed. Should really be fixed in the driver + (ie, don't create the ttys until they can actually be used) but + whatever. + + src/mm-errors.c | 1 + + src/mm-errors.h | 3 ++- + src/mm-plugin-base.c | 67 + ++++++++++++++++++++++++++++++++++++++++++++-------- + src/mm-serial-port.c | 9 ++++++- + 4 files changed, 68 insertions(+), 12 deletions(-) + +commit 15595b33dc88724253a147b7894c953a5d3110e6 +Author: Dan Williams +Date: Thu Nov 26 13:52:50 2009 -0800 + + gsm: CGDCONT parsing fixes (bgo #602552) + + Ignore spaces and account for random parentheses in the CGDCONT + response. Also fixes parsing CGDCONT=? on nozomi. + + src/mm-generic-gsm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8dd2421e9c7c2d8afa5af4080eabed41c5689d81 +Author: Dan Williams +Date: Thu Nov 26 13:40:32 2009 -0800 + + core: don't allow double-scheduled callbacks + + If the modem becomes invalid (it crashes and resets, for example) + the callback-info's modem_destroyed_cb() function will handle + cleanup. Buf if the callback-info's callback does more work than + just returning the result (like simple_state_machine) it could + double-schedule the callback. Don't let that happen. + + We need better modem-removal handling, but this fixes a crash for + now. + + src/mm-callback-info.c | 2 ++ + src/mm-callback-info.h | 1 + + 2 files changed, 3 insertions(+) + +commit 19e9c0cb480851a6e64ff9b5ce33861765a6e6ee +Author: Jeroen Elebaut +Date: Tue Nov 24 15:36:32 2009 -0800 + + serial: handle arbitrary amounts of padding in responses + + Firmware on some Option devices (iCON 505) likes to spray newlines + all over the place. Some fixes and boundary checks by me (dcbw). + + src/mm-serial-parsers.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit 50412ba3f9fe6b3ee33a83d452155b7f224ff719 +Author: Dan Williams +Date: Tue Nov 24 15:16:58 2009 -0800 + + test: handle signal quality exceptions + + test/mm-test.py | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 8bd10ebda2a29614319a14344294f495fede0baa +Author: Dan Williams +Date: Tue Nov 24 13:04:21 2009 -0800 + + huawei: sometimes reports BOOT with two LFs, not LF+CR + + plugins/mm-plugin-huawei.c | 1 + + 1 file changed, 1 insertion(+) + +commit 3218b94376de9598ef4530800584c30acf350810 +Author: Dan Williams +Date: Tue Nov 24 12:57:44 2009 -0800 + + cdma: handle 1x and EVDO quality separately + + plugins/mm-modem-huawei-cdma.c | 67 + ++++++++++++++++++++++++++++++++++-------- + src/mm-generic-cdma.c | 39 +++++++++++++++++++----- + src/mm-generic-cdma.h | 3 +- + 3 files changed, 88 insertions(+), 21 deletions(-) + +commit ac9cae2bc8bc0c7ae7ae0d0cf08d4872dcd9fb60 +Author: Dan Williams +Date: Tue Nov 24 12:16:14 2009 -0800 + + zte: retry init strings once on timeout + + Some ZTE devices (MF626 for example) will emit the ZPASR unsolicited + response right after MM opens the port, and they will just throw the + init string away. So retry the init string once; the ZTE devices will + see it the second time and continue as normal. + + This is the MM version of NM commit + 861e9689c513cbd61fa75205a681a69d4ba8236c + + plugins/mm-modem-zte.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 42 insertions(+), 2 deletions(-) + +commit 5175c2accb5bff5e2c78e906d00658bd9b70c07e +Author: Jeroen Elebaut +Date: Tue Nov 24 11:31:22 2009 -0800 + + gsm: some modems dislike spaces in AT+CGDCONT + + 0.7 hasn't used spaces for over a year, so this is a pretty safe + change. Some modems just don't like it. + + 0.7 commit to remove spaces: + + commit 0265bfe52dcc93372aff6064e849044ccb72aa1e + Author: Dan Williams + Date: Fri Oct 24 15:15:06 2008 +0000 + + 2008-10-24 Dan Williams + + * src/nm-gsm-device.c + - (set_apn): remove erroneous spaces in AT+CGDCONT + command (Jerone Young) + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5ceb3a2106612ededa481c4e723626d00722d8da +Author: Jeroen Elebaut +Date: Tue Nov 24 00:43:20 2009 -0800 + + gsm: allow longer timeout for registration + + Often modems will scan before registering with +COPS. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c463b5a4005b9e55d0faeb887debe327118ef230 +Merge: 3be4a151 9e92bceb +Author: Dan Williams +Date: Tue Nov 24 00:20:52 2009 -0800 + + Merge commit 'origin/master' into states + +commit 9e92bceb0750752bf4761d55a1538d20dc017bea +Author: Dan Williams +Date: Tue Nov 24 00:19:27 2009 -0800 + + hso: consolidate PDP context activate/deactivate operations + + And rename the function to make it clearer. disable() wasn't using + the common activate/deactivate code so switch it to do so. + + plugins/mm-modem-hso.c | 52 + +++++++++++++++++++------------------------------- + 1 file changed, 20 insertions(+), 32 deletions(-) + +commit 3be4a15189aef361187b86df64f62ca70284dee3 +Merge: d8ff5f74 e5b5c833 +Author: Dan Williams +Date: Mon Nov 23 23:48:26 2009 -0800 + + Merge commit 'origin/master' into states + +commit e5b5c8339472a37d3a44ac6239fc3d9bdb9ce5cc +Author: Dan Williams +Date: Mon Nov 23 23:32:01 2009 -0800 + + hso: disconnect the PDP context that was active (if any) + + Instead of always disconnecting context #1. + + plugins/mm-modem-hso.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit d8ff5f74e008289ad512bb15f2c4cb1576752221 +Author: Dan Williams +Date: Mon Nov 23 23:30:30 2009 -0800 + + core: state -> DISABLED when the modem becomes invalid + + src/mm-modem-base.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 500fb5f29aebb583f2f8c27fed11a5cd394c9958 +Author: Dan Williams +Date: Mon Nov 23 23:30:04 2009 -0800 + + gsm: don't regress states on registration change if still registered + + src/mm-generic-gsm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 1fe9150f5c9187d5f53db076ab2224bc9dcf7d45 +Author: Dan Williams +Date: Tue Nov 17 15:24:52 2009 -0800 + + test: add lsudev.c since I don't know where else to put it + + A helpful little tool to debug udev device relationships. + + test/lsudev.c | 180 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 180 insertions(+) + +commit 3193e97bb809d10367ece12e91245eeecca711b9 +Author: Dan Williams +Date: Tue Nov 17 14:16:24 2009 -0800 + + probe: fix probing on PPC due to missing cast + + gcc will interpret the constant value as a uint32 but + the port's set_property() was taking it as a uint64. Thus + the top 32 bits were probably garbage, and messed up + on big-endian architectures leading to random large + probe delays. + + src/mm-plugin-base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3c6e4056e7cded28e612a76d9321f54fb1b51ce2 +Merge: 9bbc6ab5 74f679ac +Author: Dan Williams +Date: Fri Nov 6 15:11:01 2009 -0800 + + Merge commit 'origin/master' into states + +commit 74f679acdb8caa15c59b6b84b6a117a144426720 +Author: Torgny Johansson +Date: Wed Nov 4 13:11:23 2009 -0800 + + mbm: add USB IDs for C3607w + + plugins/77-mm-ericsson-mbm.rules | 3 +++ + 1 file changed, 3 insertions(+) + +commit 107f950a9e93735fa3ef03f7a522f08f56570f19 +Author: Dan Williams +Date: Fri Oct 30 17:11:31 2009 -0700 + + gsm: tighter signal strength validation + + The standard dictates CSQ response strength value to be [0 - 31] + inclusive, and 99 means "unknown" or "no service". Make that + apparent and don't treat 99 as 99% which it clearly isn't. Also, + allow spaces in the CSQ response. + + src/mm-generic-gsm.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 122aa62afabab2636691ba338508c9ab7da2ff2b +Author: Dan Williams +Date: Fri Oct 30 17:11:22 2009 -0700 + + trivial: spacing fix + + src/mm-generic-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 07cf870937c981e9c7ac8e9937839a103c1c951e +Author: Dan Williams +Date: Fri Oct 30 16:55:56 2009 -0700 + + gsm: give a network scan 2 minutes instead of 1 + + On many modems that support 7 or more bands (quad-band 2G, tri-band + or more for 3G) scans take quite a while. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 54901933fea26d17ec7fac5e326f6478770b059d +Author: Dan Williams +Date: Fri Oct 30 16:55:04 2009 -0700 + + gsm: make "X4 &C1" init arguments optional (lp:455031) + + At least don't error out of the fail since they aren't really + necessary, just nice to have. + + src/mm-generic-gsm.c | 18 +++++++++++++++++- + src/mm-generic-gsm.h | 10 +++++----- + 2 files changed, 22 insertions(+), 6 deletions(-) + +commit 678f07a1e28e0b7bb74319418c215e9e5ed9b8bb +Author: Dan Williams +Date: Fri Oct 30 16:16:36 2009 -0700 + + gobi: don't override generic init commands + + The default ones seem to work just fine. + + plugins/mm-modem-gobi-gsm.c | 32 -------------------------------- + 1 file changed, 32 deletions(-) + +commit 9bbc6ab53b14097c510548dde4818a596e551617 +Author: Dan Williams +Date: Tue Oct 27 15:01:00 2009 -0700 + + core: initial implementation of modem states + + Needs more work for GSM, but should be reasonably complete for CDMA. + + marshallers/mm-marshal.list | 2 ++ + src/mm-generic-cdma.c | 50 +++++++++++++++++++++++++++------- + src/mm-generic-gsm.c | 35 +++++++++++++++++++++++- + src/mm-generic-gsm.h | 3 +++ + src/mm-modem-base.c | 11 ++++++++ + src/mm-modem.c | 65 + +++++++++++++++++++++++++++++++++++++++++++++ + src/mm-modem.h | 30 +++++++++++++++++++++ + 7 files changed, 186 insertions(+), 10 deletions(-) + +commit 4e74953b9159de688a05bd8abcb90204d08aaff2 +Author: Dan Williams +Date: Mon Oct 26 17:59:33 2009 -0700 + + cdma: return registration state, not error, when unregistered + + src/mm-generic-cdma.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 49b5ffd076001ad56647d3357f2d3cb94c1abb8b +Author: Dan Williams +Date: Mon Oct 26 17:56:48 2009 -0700 + + core: use G_DEFINE_TYPE_* instead of rolling our own + + Use the macro; save some trees. + + plugins/mm-modem-gobi-gsm.c | 43 ++----------- + plugins/mm-modem-hso.c | 43 ++----------- + plugins/mm-modem-huawei-cdma.c | 37 +---------- + plugins/mm-modem-huawei-gsm.c | 41 ++---------- + plugins/mm-modem-mbm.c | 50 +++------------ + plugins/mm-modem-moto-c-gsm.c | 43 ++----------- + plugins/mm-modem-nokia.c | 35 ++-------- + plugins/mm-modem-novatel-gsm.c | 36 ++--------- + plugins/mm-modem-option.c | 42 ++---------- + plugins/mm-modem-sierra-cdma.c | 25 +------- + plugins/mm-modem-sierra-gsm.c | 34 ++-------- + plugins/mm-modem-zte.c | 33 ++-------- + src/mm-generic-cdma.c | 118 +++------------------------------- + src/mm-generic-gsm.c | 124 ++++------------------------------- + src/mm-modem-base.c | 142 + ++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-base.h | 5 ++ + 16 files changed, 234 insertions(+), 617 deletions(-) + +commit 2887a50b232714702c0eb9009c32d9a6b850888b +Author: Dan Williams +Date: Mon Oct 26 15:39:34 2009 -0700 + + gsm: ignore errors from power-on command + + Phones especially don't seem to consistently implement this. For now, + we'll hack it out, but later, we'll want to have a class method for + power-on instead of just a property so that subclasses can decided for + themselves (since they know their hardware better) whether failure + of the power-on command is fatal or not. + + src/mm-generic-gsm.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 6bc4f0ae8cad621e11d882d2b3813765c86156c2 +Author: Jeroen Elebaut +Date: Fri Oct 16 14:41:12 2009 -0700 + + hso: handle OWANCALL response better + + plugins/mm-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 16f3e00f3438507aee06ffcaee560e337b8e8279 +Author: Alexander Sack +Date: Wed Oct 14 23:33:52 2009 +0200 + + gsm: fix unsolicited registration by calling the statemachine callback + info - lp:416893 + + src/mm-generic-gsm.c | 77 + ++++++++++++++++++++++++++++------------------------ + 1 file changed, 42 insertions(+), 35 deletions(-) + +commit acd785bfa40245879c7c90f8a0209141202fb44f +Author: Alexander Sack +Date: Wed Oct 14 21:58:30 2009 +0200 + + mbm: use generic get_signal_quality implementation rather than our + own CIND based one + + plugins/mm-modem-mbm.c | 35 ----------------------------------- + 1 file changed, 35 deletions(-) + +commit 139741d140b18938a14075e22368364dd8b4168f +Author: Alexander Sack +Date: Wed Oct 14 21:07:36 2009 +0200 + + mbm: implement AT*ENAP polling + + plugins/mm-modem-mbm.c | 46 + +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 45 insertions(+), 1 deletion(-) + +commit 6885505deac1390694b00f3207801f4cb8a0eaa9 +Author: Alexander Sack +Date: Wed Oct 14 18:41:25 2009 +0200 + + mbm: flip order in which we send enap/e2nap to modem to make f3507g + happier + + plugins/mm-modem-mbm.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit 6ddd97e81cc2a9412ccc464ba062ec49a258e06c +Author: Alexander Sack +Date: Wed Oct 14 11:32:55 2009 +0200 + + mbm: send ENAP=0 on init to set modem back to sane state and ignore + CIND errors + + plugins/mm-modem-mbm.c | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit 3d86a3e89a18ccd98b9f65b389f70ba19f100004 +Author: Dan Williams +Date: Wed Oct 14 13:47:21 2009 -0700 + + gsm: don't issue CFUN=0 by default + + Let plugins do it when they know it's OK. + + src/mm-generic-gsm.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit ea29dc8044e649f59f47442a40b999f7998994ab +Author: Dan Williams +Date: Wed Oct 14 13:36:59 2009 -0700 + + mbm: fix disable after 3b19a85727458821f5df20153f8c04bc7717ba30 + + C & P error in enable/disable split. + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c77dbb7a947f776f2dbb0ee800fb4a1cbac75fe0 +Author: Dan Williams +Date: Tue Oct 13 16:05:02 2009 -0700 + + cdma: give cards more time to register + + 5 was left-over from debugging unplug-while-registering issues, + was meant to be 15 (ie, 60 seconds) anyway. + + src/mm-generic-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0bcdf6a7c105471b195203a4a9f065c3f7fbbc7e +Author: Alexander Sack +Date: Tue Oct 13 15:14:14 2009 +0200 + + nokia: fix class property overrides to stop modemmanager from sending + AT+CFUN (lp:450256) + + plugins/mm-modem-nokia.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit f4ada20709904ac563457bf0e155ab83958975bf +Author: Dan Williams +Date: Mon Oct 12 22:44:03 2009 -0700 + + cdma: implement registration in Simple.Connect path + + Wait a bit for the modem to register before trying to dial. + + src/mm-generic-cdma.c | 229 + ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 214 insertions(+), 15 deletions(-) + +commit f916d939f3a7e201ef0d99e8eb155e31c7e1e1f5 +Author: Dan Williams +Date: Mon Oct 12 22:43:46 2009 -0700 + + test: add connect ability + + test/mm-test.py | 53 + +++++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 47 insertions(+), 6 deletions(-) + +commit c0253c7c293148a0bdb6c20d4b38a08401d8e34d +Author: Dan Williams +Date: Mon Oct 12 19:51:10 2009 -0700 + + core: convert MMCallbackInfo modem refs to weak refs + + Full references prevented destruction of the modem object if + it was unplugged or somehow removed. To fix that using full + references on the modems would require that all usage of + MMCallbackInfo to be aware of the validity of the modem and to + ensure the callback was called whenever the modem became invalid. + That, needless to say, would suck. Since any in-progress calls + can't complete when the modem is invalid anyway, just have the + MMCallbackInfo object return a generic error when the modem goes + away and the call is still in-progress. + + src/mm-callback-info.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +commit 6f65ad768238395a3bfc3e02fd946843282492d2 +Author: Dan Williams +Date: Mon Oct 12 11:45:20 2009 -0700 + + sierra: handle non-EVDO roaming indication for older cards + + Like the AC580 + + plugins/mm-modem-sierra-cdma.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 942b5ff826d5d0a4ce7c6923e92206467736f9af +Author: Dan Williams +Date: Mon Oct 12 10:56:53 2009 -0700 + + sierra: add CDMA device subclass and implement registration state + handling + + plugins/Makefile.am | 4 +- + plugins/mm-modem-sierra-cdma.c | 298 + +++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-sierra-cdma.h | 45 +++++++ + plugins/mm-plugin-sierra.c | 12 +- + 4 files changed, 352 insertions(+), 7 deletions(-) + +commit 3245ea319369d3198582ad1ee54c0b862447215a +Author: Dan Williams +Date: Mon Oct 12 10:56:11 2009 -0700 + + huawei: don't need AT prefix + + plugins/mm-modem-huawei-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 958b9048a38cdb21063c8333748041131ba98396 +Author: Dan Williams +Date: Mon Oct 12 10:05:27 2009 -0700 + + cdma: split 1x and EVDO registration states + + Like UMTS vs. GSM, EVDO and 1x are separate networks and technologies + and have separate registration state. You can even be roaming on + EVDO while in your home 1x network. Handle that. + + introspection/mm-modem-cdma.xml | 14 ++- + marshallers/mm-marshal.list | 1 + + plugins/mm-modem-huawei-cdma.c | 37 +++++-- + plugins/mm-modem-huawei-cdma.h | 4 +- + plugins/mm-plugin-generic.c | 4 +- + plugins/mm-plugin-gobi.c | 4 +- + plugins/mm-plugin-huawei.c | 4 +- + plugins/mm-plugin-nokia.c | 4 +- + plugins/mm-plugin-novatel.c | 4 +- + plugins/mm-plugin-sierra.c | 4 +- + plugins/mm-plugin-zte.c | 4 +- + src/mm-generic-cdma.c | 238 + +++++++++++++++++++++++++++++++++++----- + src/mm-generic-cdma.h | 36 +++++- + src/mm-modem-cdma.c | 48 ++++++-- + src/mm-modem-cdma.h | 16 ++- + test/mm-test.py | 5 +- + 16 files changed, 355 insertions(+), 72 deletions(-) + +commit 3f51cf421ee19804503d5636b7399cfad4fa05ef +Author: Alexander Sack +Date: Mon Oct 12 12:19:12 2009 +0200 + + huawei: adjust printf-style format to fix 32-bit gcc-4.4 builds + + plugins/mm-modem-huawei-cdma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1f0be4a2e96dc4b5d5eb45f8a29fd78314f073b5 +Author: Dan Williams +Date: Sun Oct 11 11:44:34 2009 -0700 + + huawei: remove debugging stuff + + plugins/mm-modem-huawei-cdma.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit f0dc449c502cd1009a4f1930624be9a730dfdcf1 +Author: Dan Williams +Date: Sun Oct 11 11:39:18 2009 -0700 + + sierra: rename MMModemSierra -> MMModemSierraGsm + + plugins/Makefile.am | 4 +- + .../{mm-modem-sierra.c => mm-modem-sierra-gsm.c} | 40 + ++++++++++---------- + plugins/mm-modem-sierra-gsm.h | 43 + ++++++++++++++++++++++ + plugins/mm-modem-sierra.h | 43 + ---------------------- + plugins/mm-plugin-sierra.c | 8 ++-- + 5 files changed, 69 insertions(+), 69 deletions(-) + +commit bdd60a4941b5e8948dd6397208f1ac4cfee61907 +Author: Dan Williams +Date: Sun Oct 11 11:31:23 2009 -0700 + + cdma: fix memory leak parsing serving system results + + src/mm-generic-cdma.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +commit 81163b3032e623e46ef2f60f661ef0306680c241 +Author: Dan Williams +Date: Sun Oct 11 11:27:29 2009 -0700 + + huawei: add CDMA device subclass and implement registration state + handling + + plugins/Makefile.am | 4 +- + plugins/mm-modem-huawei-cdma.c | 288 + +++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-huawei-cdma.h | 43 ++++++ + plugins/mm-plugin-huawei.c | 7 +- + 4 files changed, 338 insertions(+), 4 deletions(-) + +commit 0c5c94b6912024efd80b8ce546e8dee99a72f25a +Author: Dan Williams +Date: Sun Oct 11 11:25:43 2009 -0700 + + cdma: add signal quality update helper for subclasses + + src/mm-generic-cdma.c | 10 ++++++++++ + src/mm-generic-cdma.h | 2 ++ + 2 files changed, 12 insertions(+) + +commit 19b7c8fef19747ece136681237eb48833076f8e2 +Author: Dan Williams +Date: Sun Oct 11 11:24:41 2009 -0700 + + cdma: use consistent terminology for registration + + src/mm-generic-cdma.c | 12 ++++++------ + src/mm-generic-cdma.h | 6 +++--- + 2 files changed, 9 insertions(+), 9 deletions(-) + +commit 665d1847a8917a94b4260f211e391fc67b62e53a +Author: Dan Williams +Date: Sun Oct 11 11:23:50 2009 -0700 + + cdma: add port accessors for subclasses + + src/mm-generic-cdma.c | 43 ++++++++++++++++++++++++++++++++++--------- + src/mm-generic-cdma.h | 11 +++++++++++ + 2 files changed, 45 insertions(+), 9 deletions(-) + +commit b7dc5f00da4a5bdcd0f70d5d5177a01197958706 +Author: Dan Williams +Date: Sun Oct 11 11:20:36 2009 -0700 + + mm-test: fix cdma registration state parsing + + test/mm-test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 21391286fc166901041de09abcb317dda2efc5e4 +Author: Dan Williams +Date: Sun Oct 11 11:19:00 2009 -0700 + + huawei: rename MMModemHuawei -> MMModemHuaweiGsm + + plugins/Makefile.am | 4 +- + .../{mm-modem-huawei.c => mm-modem-huawei-gsm.c} | 86 + +++++++++++----------- + plugins/mm-modem-huawei-gsm.h | 43 +++++++++++ + plugins/mm-modem-huawei.h | 43 ----------- + plugins/mm-plugin-huawei.c | 8 +- + 5 files changed, 92 insertions(+), 92 deletions(-) + +commit e1d757ea763ebb72ea8d7ff979ef0041181d7bd1 +Author: Dan Williams +Date: Sun Oct 11 11:15:46 2009 -0700 + + cdma: use secondary port more aggressively where one exists + + Like on the Huawei EC121 and EC168C (Reliance India). + + src/mm-generic-cdma.c | 33 ++++++++++++++++++++++++++------- + 1 file changed, 26 insertions(+), 7 deletions(-) + +commit 91171cdae295352011252d28d3d777960d0d876a +Author: Dan Williams +Date: Fri Oct 9 16:17:13 2009 -0700 + + cdma: implement generic registration state handling + + introspection/mm-modem-cdma.xml | 34 +++++++ + src/mm-generic-cdma.c | 194 + ++++++++++++++++++++++++++++++++++++---- + src/mm-generic-cdma.h | 11 +++ + src/mm-modem-cdma.c | 46 +++++++++- + src/mm-modem-cdma.h | 34 +++++-- + test/mm-test.py | 18 +++- + 6 files changed, 308 insertions(+), 29 deletions(-) + +commit a088f12956763eb99a8f8b37934cf038a0b14cc0 +Author: Dan Williams +Date: Thu Oct 8 10:16:25 2009 -0700 + + cdma: better CSS response parsing + + src/mm-generic-cdma.c | 100 + ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 93 insertions(+), 7 deletions(-) + +commit 01100c1008ffe6b74cf0fdb9cc646503f8c39b1c +Author: Dan Williams +Date: Tue Oct 6 12:38:21 2009 -0700 + + gsm: strip command response bits from mfg/model/revision responses + + src/mm-generic-gsm.c | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +commit 5079b32a09acba15cb0107bbb64c51a16f11b658 +Author: Dan Williams +Date: Tue Oct 6 11:45:07 2009 -0700 + + hso: fix disable + + plugins/mm-modem-hso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d867b1fe6a11302c0efcd40bba2a898bc9080b1c +Author: Dan Williams +Date: Tue Oct 6 11:39:40 2009 -0700 + + gsm: add cell access technology reporting to Scan() + + introspection/mm-modem-gsm-network.xml | 2 +- + src/mm-generic-gsm.c | 62 + +++++++++++++++++++++++++++++----- + test/mm-test.py | 26 ++++++++++++-- + 3 files changed, 77 insertions(+), 13 deletions(-) + +commit 912b98723b2965b9aaf1f0328781a2730d7cc178 +Merge: 3b19a857 aa78b5f5 +Author: Dan Williams +Date: Mon Oct 5 09:52:01 2009 -0700 + + Merge commit 'origin/master' into enable-split + +commit aa78b5f5e5319e04f5b57f928bfab69dd4b93d88 +Author: Dan Williams +Date: Fri Oct 2 23:33:18 2009 -0700 + + bluetooth: handle rfcomm device moves + + rfcomm devices seem to be created as 'virtual' devices first, without + any parents, then moved to the right place in the device tree. So + handle moves too; if the modem was already found in the 'add' phase + it'll be ignored in the move phase. + + src/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ed059286c5361bf4dfa849088ee16c04cd075e51 +Author: Dan Williams +Date: Fri Oct 2 23:32:57 2009 -0700 + + bluetooth: physical device is a bit higher up the tree + + src/mm-plugin-base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e5441115a2dda5d81de2e9a336fc34e23d20b309 +Author: Dan Williams +Date: Fri Oct 2 22:31:16 2009 -0700 + + bluetooth: recognize rfcomm devices + + Two hacks here: + 1) rfcomm ports don't have an easily accessible driver name, so + we just + match the parent's subsystem to 'bluetooth' and use that + + 2) libgudev doesn't seem be be able to get the rfcomm device's + device file, + which would normally be /dev/rfcommX. Oh well, we don't use the + device file + yet anyway + + plugins/mm-plugin-generic.c | 20 ++++++++++++++------ + src/mm-plugin-base.c | 11 ++++++++++- + 2 files changed, 24 insertions(+), 7 deletions(-) + +commit 3b19a85727458821f5df20153f8c04bc7717ba30 +Author: Dan Williams +Date: Wed Sep 23 16:04:25 2009 -0700 + + core: split generic modem enable/disable operations + + plugins/mm-modem-hso.c | 52 +++++++++++++++------------ + plugins/mm-modem-mbm.c | 79 + +++++++++++++++++------------------------- + plugins/mm-modem-novatel-gsm.c | 44 ++++------------------- + plugins/mm-modem-option.c | 13 +++---- + plugins/mm-modem-sierra.c | 62 +++------------------------------ + plugins/mm-modem-zte.c | 44 ++++------------------- + src/mm-generic-cdma.c | 41 +++++++++++++++++----- + src/mm-generic-gsm.c | 55 +++++++++++++++++------------ + src/mm-modem.c | 22 ++++++++++-- + src/mm-modem.h | 10 ++++-- + 10 files changed, 175 insertions(+), 247 deletions(-) + +commit f2a3825f9d10ecebc63ce3c8602473cbbb6ab72c +Author: Dan Williams +Date: Wed Sep 23 01:38:42 2009 -0700 + + generic: match CONNECT even if we get PPP spew + + Found by Eugene Crosser + + src/mm-serial-parsers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2bad09403aae95dd25ce03790fce45a85578f677 +Author: Eugene Crosser +Date: Tue Sep 22 22:56:58 2009 -0700 + + nokia: don't use CFUN at all (lp430576) + + CFUN=0 actually powers off the phone; CFUN=1 isn't really supported + on some phones either. So just don't use CFUN at all. + + plugins/mm-modem-nokia.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +commit feb00e455337850aa77c1014d4e73fef51953636 +Author: Alexander Sack +Date: Mon Sep 21 15:42:30 2009 -0700 + + mbm: more permissive ESTKSMENU regexp + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3d178fafcf3e0fc0dbe852d0c6f2d2184f7afae7 +Author: Torgny Johansson +Date: Sat Sep 19 11:42:10 2009 -0700 + + mbm: handle *EMWI unsolicited responses + + plugins/mm-modem-mbm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1f7bb908ebc40d42f5e83d6cf5671e168577b87e +Author: Torgny Johansson +Date: Sat Sep 19 11:37:16 2009 -0700 + + mbm: fix up +PACSP0 unsolicited response matching + + plugins/mm-modem-mbm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 64b7be7460c3a9dbb3c9981de5754b330a8d2cdd +Author: Dan Williams +Date: Wed Sep 9 07:28:54 2009 -0700 + + serial: use connected notifier only when needed + + It's only relevant when the port is open anyway, and marking the port + disconnected in nm_serial_port_close(), which used to be called from + the finalize() function, would trigger the notifier when stuff was + already cleaned up. So move the nm_serial_port_close() call to + dispose() and remove the connected notifier before we clean the + port up. + + src/mm-serial-port.c | 86 + ++++++++++++++++++++++++++++++---------------------- + 1 file changed, 50 insertions(+), 36 deletions(-) + +commit c02adee8023a023c6f0fd9777d0908e17eb9d89c +Author: Dan Williams +Date: Tue Sep 8 17:41:25 2009 -0700 + + serial: mark port disconnected on close + + Otherwise it could still be connected when the port was opened again, + and subsequent calls for stuff could fail. + + src/mm-serial-port.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 14e5c52f78e7ad23b18b111e3271cbecad6acf3f +Author: Dan Williams +Date: Tue Sep 8 17:31:54 2009 -0700 + + core: don't allow concurrent flashes on the same device + + Previously, a few operations (like disable) could trigger a modem + flash in parallel with another flash. That's wrong, don't allow + that. At the same time, add in finer-grained error checking on + serial port speed operations, and fix a GSM generic bug that would + send the POWER_UP string on disable. + + introspection/mm-modem-error.xml | 18 +++ + plugins/mm-modem-mbm.c | 30 +++-- + plugins/mm-modem-novatel-gsm.c | 32 +++-- + plugins/mm-modem-sierra.c | 34 ++++-- + plugins/mm-modem-zte.c | 32 +++-- + src/mm-errors.c | 2 + + src/mm-errors.h | 4 +- + src/mm-generic-cdma.c | 34 ++++-- + src/mm-generic-gsm.c | 42 +++++-- + src/mm-plugin-base.c | 11 +- + src/mm-serial-port.c | 252 + +++++++++++++++++++++++++++++++++------ + src/mm-serial-port.h | 4 +- + 12 files changed, 403 insertions(+), 92 deletions(-) + +commit 6cf01d2ab698d05eb58bffa7e85f41024f5c0546 +Author: Dan Williams +Date: Tue Sep 8 16:43:20 2009 -0700 + + test: allow up to 60 seconds for Scan to complete + + test/mm-test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 53af144f49b0d81bd4dc1f5ee9eea6d61ccae992 +Author: Noel J. Bergman +Date: Wed Sep 9 01:17:20 2009 +0200 + + udev: handle removal of parent usb devices + + fix device removal event handling to remove modems + if the associated parent usb device is removed + + src/mm-manager.c | 57 + +++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 50 insertions(+), 7 deletions(-) + +commit d317254a3b47350332563c9cf7d97b0a47d12794 +Author: Dan Williams +Date: Fri Sep 4 14:26:53 2009 -0500 + + patches: rename directory to avoid conflicts with .deb build mechanism + + .../NetworkManager-r4359-use-modem-manager.patch + | 0 + {patches => obsolete-patches}/nm-applet-r1053-use-modem-manager.patch + | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) + +commit 63dcc3e189025b463f35d047a1b87cf9060641db +Author: Dan Williams +Date: Mon Aug 31 14:30:23 2009 -0500 + + cdma: handle older AT+CSS response format + + src/mm-generic-cdma.c | 34 ++++++++++++++++++++++++---------- + 1 file changed, 24 insertions(+), 10 deletions(-) + +commit a479b58f50f65a736e05e5abe7278b6feb6be899 +Author: Dan Williams +Date: Mon Aug 31 14:30:06 2009 -0500 + + test: don't bail out on errors parsing CDMA serving system results + + test/mm-test.py | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 09fc288f2bec6f54d300a916a6238c1533e0daa7 +Author: Dan Williams +Date: Mon Aug 31 14:07:10 2009 -0500 + + test: make mm-test executable again + + test/mm-test.py | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 8a6cbdfb88f8925261b08030830a38557c92e5ff +Author: Bryan Duff +Date: Wed Aug 26 11:28:14 2009 -0500 + + core: fix uninitialized variable + + src/mm-plugin-base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 180ad403b8773607bd3edf624983196cc47db755 +Author: Alexander Sack +Date: Fri Aug 21 21:41:48 2009 +0200 + + mbm: parse and ignore unsolicited *ESTKSMENU message - lp:416418 + + plugins/mm-modem-mbm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit cd750230687177b45c2b8e507a0f0b22095aeb02 +Author: Alexander Sack +Date: Thu Aug 20 20:32:37 2009 +0200 + + gsm: handle "net" device removal properly in release_port + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9e106eae1a01cfe15343d407b2282666d623076d +Author: Torgny Johansson +Date: Thu Aug 20 20:27:32 2009 +0200 + + mbm: add more USB IDs + + plugins/77-mm-ericsson-mbm.rules | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 1a75d8d010e76efb44af6e1d2d26f5a2d7808647 +Author: Dan Williams +Date: Wed Aug 19 17:08:13 2009 -0500 + + moto-c: claim Motorola C380 too (bgo #591978) + + plugins/mm-plugin-moto-c.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ca767e4037ce08ab23d188341ed31139dee0bd09 +Author: Dan Williams +Date: Mon Aug 17 13:16:41 2009 -0500 + + gsm: update for D-Bus interface specification changes + + Specifically, SupportedModes, SupportedBands, and SMS completeness + changes. + + marshallers/mm-marshal.list | 1 + + src/mm-generic-gsm.c | 16 ++++++++++++++++ + src/mm-generic-gsm.h | 2 ++ + src/mm-modem-gsm-card.c | 29 ++++++++++++++++++++++++++++- + src/mm-modem-gsm-card.h | 3 +++ + src/mm-modem-gsm-sms.c | 15 ++++++++++++--- + src/mm-modem-gsm-sms.h | 6 +++++- + 7 files changed, 67 insertions(+), 5 deletions(-) + +commit dc7bdd0494a80d6474fc61864a93251aa2d41eb3 +Author: Dan Williams +Date: Mon Aug 17 13:15:59 2009 -0500 + + test: obscure IMSI/IMEI/ESN by default + + Pass --private to see these values if required. + + test/mm-test.py | 100 + ++++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 69 insertions(+), 31 deletions(-) + +commit 354a4cb07fde0a6604086bf705d94b042a735cbd +Author: Alexander Sack +Date: Thu Aug 6 12:59:32 2009 +0200 + + license: use GPLv2 as top level COPYING for now to reflect the + license actually used by source files + + COPYING | 666 + ++++++++++++++++++++++++---------------------------------------- + 1 file changed, 251 insertions(+), 415 deletions(-) + +commit 12ac98e9f61186a6b5c52409e3fac7d2bcb002f7 +Author: Alexander Sack +Date: Wed Jul 22 14:52:44 2009 +0200 + + license: add license header to all files and set copyright based on + git log + + plugins/mm-plugin-generic.h | 13 +++++++++++++ + src/mm-callback-info.c | 13 +++++++++++++ + src/mm-callback-info.h | 13 +++++++++++++ + src/mm-errors.c | 14 ++++++++++++++ + src/mm-errors.h | 14 ++++++++++++++ + src/mm-generic-cdma.c | 14 ++++++++++++++ + src/mm-generic-cdma.h | 14 ++++++++++++++ + src/mm-generic-gsm.c | 15 +++++++++++++++ + src/mm-generic-gsm.h | 14 ++++++++++++++ + src/mm-manager.c | 14 ++++++++++++++ + src/mm-manager.h | 14 ++++++++++++++ + src/mm-modem-cdma.c | 14 ++++++++++++++ + src/mm-modem-cdma.h | 14 ++++++++++++++ + src/mm-modem-gsm-card.c | 14 ++++++++++++++ + src/mm-modem-gsm-card.h | 14 ++++++++++++++ + src/mm-modem-gsm-network.c | 13 +++++++++++++ + src/mm-modem-gsm-network.h | 14 ++++++++++++++ + src/mm-modem-gsm-sms.c | 13 +++++++++++++ + src/mm-modem-gsm-sms.h | 13 +++++++++++++ + src/mm-modem-simple.c | 14 ++++++++++++++ + src/mm-modem-simple.h | 13 +++++++++++++ + src/mm-modem.c | 14 ++++++++++++++ + src/mm-modem.h | 14 ++++++++++++++ + src/mm-options.c | 13 +++++++++++++ + src/mm-options.h | 13 +++++++++++++ + src/mm-plugin.c | 14 ++++++++++++++ + src/mm-plugin.h | 14 ++++++++++++++ + src/mm-serial-parsers.c | 14 ++++++++++++++ + src/mm-serial-parsers.h | 13 +++++++++++++ + test/mm-send-sms.py | 13 +++++++++++++ + test/mm-test.py | 14 ++++++++++++++ + 31 files changed, 424 insertions(+) + +commit 2d194a5798fb06f41b018c2d8c2216f45bfc41a4 +Author: Dan Williams +Date: Wed Aug 5 13:03:59 2009 -0400 + + gsm: harmonize band/mode enums + + Use the same enum for set/get of band and mode, as for exposing the + device's capabilities. + + introspection/Makefile.am | 1 + + introspection/mm-modem-gsm-card.xml | 48 +--------- + introspection/mm-modem-gsm-network.xml | 163 + +++++---------------------------- + introspection/mm-modem-gsm.xml | 86 +++++++++++++++++ + plugins/mm-modem-huawei.c | 115 ++++++++++++----------- + plugins/mm-modem-mbm.c | 32 ++++--- + plugins/mm-modem-option.c | 34 +++---- + src/Makefile.am | 1 + + src/mm-generic-gsm.h | 1 + + src/mm-modem-gsm-network.c | 52 +++++++++-- + src/mm-modem-gsm-network.h | 46 ++-------- + src/mm-modem-gsm.h | 57 ++++++++++++ + 12 files changed, 320 insertions(+), 316 deletions(-) + +commit 356f8f097e5fe012ac762157c903bd9b51fa982d +Author: Dan Williams +Date: Thu Jul 23 14:25:48 2009 -0400 + + gsm: add SupportedBands property + + introspection/mm-modem-gsm-card.xml | 46 + +++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit 71e2e930fd230f9f8567b2028387197d69e688fb +Author: Dan Williams +Date: Thu Jul 23 13:52:57 2009 -0400 + + sms: add additional API for multi-part SMS + + introspection/mm-modem-gsm-sms.xml | 43 + ++++++++++++++++++++++++++++++++++++-- + 1 file changed, 41 insertions(+), 2 deletions(-) + +commit c307606e747faf1c736eade8c839a7a3ca7fa213 +Author: Dan Williams +Date: Wed Jul 22 07:42:05 2009 -0400 + + cdma: fix serving-system parsing for oddly-placed spaces + + Sierra 580 returns "+CSS: 0, Z , 0" when not associated. Handle that. + + src/mm-generic-cdma.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit 354785f440e3b9939606710264c552fb99b3637f +Author: Dan Williams +Date: Fri Jul 17 23:03:16 2009 -0400 + + cdma: handle devices that don't prefix CSS result with +CSS: + + Like the Sanyo SCP-3800 (Sprint Katana LX). Make up your freakin' + mind people, either prefix *all* responses with the command stem, + or don't. But just pick one dammit. + + src/mm-generic-cdma.c | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +commit 482053ce76335b5fadb6a9c0f56e21ec7690b2bc +Author: Dan Williams +Date: Wed Jul 15 22:00:36 2009 -0400 + + zte: fix udev rules + + plugins/77-mm-zte-port-types.rules | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit d105ac8fd6fed33cfbe3f6e828224e42f29a7411 +Author: Dan Williams +Date: Tue Jul 14 08:47:13 2009 -0400 + + mbm: fix brand of some 'mbm' devices in udev rules + + Should be just Ericsson, not Sony-Ericsson. The MD300 is SE though. + + plugins/77-mm-ericsson-mbm.rules | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 6610ded40711ea88266beb68d40b00f00933a630 +Author: Dan Williams +Date: Fri Jul 10 12:19:20 2009 -0400 + + mbm: add more USB IDs + + plugins/77-mm-ericsson-mbm.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 3cdfba2bad6efc736d6a74b520601edd30f4b2e2 +Author: Dan Williams +Date: Thu Jul 9 11:22:10 2009 -0400 + + build: sane automake options + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 50105ae28883f21761887beed180ce9ad0755016 +Author: Dan Williams +Date: Tue Jul 7 10:45:44 2009 -0400 + + build: make distcheck actually work + + Makefile.am | 2 ++ + autogen.sh | 2 +- + configure.in => configure.ac | 9 +++++++++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +commit 34f3117a829d7575f5a748455d5105a219d1c7d7 +Author: Dan Williams +Date: Tue Jul 7 17:34:04 2009 -0400 + + cdma: fix 32-bit compile issues + + src/mm-generic-cdma.c | 6 +++--- + src/mm-modem-cdma.c | 2 +- + src/mm-modem-cdma.h | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 5f25d3a60bbe4b03b5a412443271e6e094e546f1 +Author: Dan Williams +Date: Tue Jul 7 17:30:17 2009 -0400 + + remove old pre-udev bits + + configure.in | 1 - + 1 file changed, 1 deletion(-) + +commit 736aa0d2d63cf62e7e2fe3c6e25ddf6b57f6ff05 +Author: Dan Williams +Date: Mon Jul 6 11:40:22 2009 -0400 + + serial: rework 'connected' logic + + So many modems just don't implement carrier detect that it makes + the previous 'connected' logic useless, so base it off + connect/disconnect + and fix up a few places that didn't check connect status before + trying to send commands. Also ensure the serial port is unlocked + for PPP to use when connected. + + plugins/mm-modem-mbm.c | 2 +- + plugins/mm-modem-novatel-gsm.c | 2 +- + plugins/mm-modem-sierra.c | 2 +- + plugins/mm-modem-zte.c | 2 +- + src/mm-errors.c | 1 + + src/mm-errors.h | 3 ++- + src/mm-generic-cdma.c | 46 + ++++++++++++++++++++++++++++++++++++++++- + src/mm-generic-gsm.c | 22 ++++++++++++-------- + src/mm-port.c | 40 +++++++++++++++++++++++++++++++++++ + src/mm-port.h | 5 +++++ + src/mm-serial-port.c | 47 + +++++++++++++++++++++++++++--------------- + src/mm-serial-port.h | 2 -- + 12 files changed, 140 insertions(+), 34 deletions(-) + +commit 869c69e223208564302ba3be074dafbdf1b02cc2 +Author: Dan Williams +Date: Thu Jul 2 16:08:54 2009 -0400 + + zte: fix port tagging rules to actually work + + plugins/77-mm-zte-port-types.rules | 100 + +++++++++++++++++++------------------ + 1 file changed, 52 insertions(+), 48 deletions(-) + +commit 52da9990eef279bbc349685a7558d26cf4b7893b +Author: Dan Williams +Date: Thu Jul 2 13:48:30 2009 -0400 + + plugins: allow plugins to more easily suggest port types + + ZTE modems need to use udev rules to assign port type hints, + so generalize that and port all the plugins over to suggested + port types in the MMModem interface's grab_port() function. + + plugins/77-mm-zte-port-types.rules | 75 + ++++++++++++++++++++++++++++++++++++++ + plugins/Makefile.am | 4 +- + plugins/mm-modem-hso.c | 3 +- + plugins/mm-modem-huawei.c | 8 ++-- + plugins/mm-modem-mbm.c | 17 +++++---- + plugins/mm-modem-nokia.c | 12 ++++-- + plugins/mm-modem-novatel-gsm.c | 17 +++++---- + plugins/mm-modem-sierra.c | 12 +++--- + plugins/mm-modem-zte.c | 12 ++++-- + plugins/mm-plugin-generic.c | 4 +- + plugins/mm-plugin-gobi.c | 4 +- + plugins/mm-plugin-hso.c | 4 +- + plugins/mm-plugin-huawei.c | 10 ++--- + plugins/mm-plugin-mbm.c | 4 +- + plugins/mm-plugin-moto-c.c | 4 +- + plugins/mm-plugin-nokia.c | 4 +- + plugins/mm-plugin-novatel.c | 4 +- + plugins/mm-plugin-option.c | 4 +- + plugins/mm-plugin-sierra.c | 13 ++++--- + plugins/mm-plugin-zte.c | 11 +++++- + src/mm-generic-cdma.c | 19 ++++++---- + src/mm-generic-gsm.c | 18 ++++++--- + src/mm-modem.c | 3 +- + src/mm-modem.h | 4 ++ + 24 files changed, 191 insertions(+), 79 deletions(-) + +commit 4e7548e496d580f26a763bcdaeca7e7af75d5141 +Author: Dan Williams +Date: Mon Jun 29 23:11:43 2009 -0400 + + gsm: fix init for modems for which ATZ does not play well with others + + src/mm-generic-gsm.c | 5 +++++ + src/mm-generic-gsm.h | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit 5298be26ddf580681a4a506cf0379996d7eb9d4d +Merge: 5a563d56 8e3da635 +Author: Dan Williams +Date: Mon Jun 29 22:54:32 2009 -0400 + + Merge branch 'master' into udev + +commit 8e3da63599020a8ec9e4b8be6451a5e333a8056c +Author: Dan Williams +Date: Mon Jun 29 22:53:20 2009 -0400 + + gsm: increase COPS manual registration timeout; it just takes longer + sometimes + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5a563d56d125d28a021442bec967575310819d0e +Author: Dan Williams +Date: Mon Jun 29 22:50:58 2009 -0400 + + sierra: handle APP[x] ports being recognized before the master port + + plugins/mm-plugin-sierra.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 2730fe4539b3ecde797078ba2dae6745a371a9e7 +Author: Dan Williams +Date: Mon Jun 29 22:50:37 2009 -0400 + + moto-c: fix port grabbing; remove dead code + + plugins/mm-plugin-moto-c.c | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +commit 36ee982b61e5350d643cd7d8701d8f719b89509f +Author: Dan Williams +Date: Mon Jun 29 22:50:16 2009 -0400 + + sierra: ensure port is valid before doing stuff to it + + plugins/mm-modem-sierra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 78633192d2a02693f17df162eba0a73478ebbcaa +Author: Dan Williams +Date: Mon Jun 29 22:49:19 2009 -0400 + + plugin-base: better Huawei detection; don't drop BUSlink response + + src/mm-plugin-base.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit d929eb859b99f750e174358e5e39bd561af28265 +Author: Dan Williams +Date: Mon Jun 29 17:35:15 2009 -0400 + + errors: fix typo + + src/mm-errors.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b38c3160ae80381b81641776c0d36ca10e084340 +Author: Dan Williams +Date: Mon Jun 29 16:53:23 2009 -0400 + + plugin-base: don't scribble on memory when looking up cached + capabilities + + src/mm-plugin-base.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +commit 7b7df91eb879b1070ed7fe99b5e201835eff53f6 +Author: Dan Williams +Date: Mon Jun 29 16:51:25 2009 -0400 + + manager: do modem creation from an idle handler + + It helps make the supports/grab callchain less crappy to look at + in gdb by ensuring that the supports chain unwinds before the grab + happens, and also ensures that we use the right subsys/name variables + rather than depending on ones the plugin provided to + supports_callback, + that may go be freed by the plugin somewhere in grab_port(). + + src/mm-manager.c | 86 + ++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 50 insertions(+), 36 deletions(-) + +commit e3eef316a570e36d45ca582bf54aef4db9c2eb8d +Author: Dan Williams +Date: Mon Jun 29 16:51:06 2009 -0400 + + generic: remove unused code + + plugins/mm-plugin-generic.c | 8 -------- + 1 file changed, 8 deletions(-) + +commit ef1e709c126d30d22e26135bba3b05d0339c2238 +Author: Dan Williams +Date: Mon Jun 29 16:50:50 2009 -0400 + + serial-port: shut valgrind up + + src/mm-serial-port.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 853af00142256d2eeae7039a1b7e8dd64cf9105e +Author: Dan Williams +Date: Mon Jun 29 14:24:43 2009 -0400 + + plugin-base: fix finding the physical device again + + Don't mis-use udev's ID_BUS key. + + src/mm-plugin-base.c | 53 + +++++++++++++++++++++------------------------------- + src/mm-plugin-base.h | 4 ++++ + 2 files changed, 25 insertions(+), 32 deletions(-) + +commit c106368ce7c06e0ae5b64cc6146ad05c3b9fa819 +Merge: ff58936f c397247c +Author: Dan Williams +Date: Mon Jun 29 13:14:11 2009 -0400 + + Merge commit 'origin/master' into udev + +commit c397247c05dbefb33edccc0987734eb715312b85 +Author: Dan Williams +Date: Mon Jun 29 13:00:58 2009 -0400 + + gsm: attempt to fix registration crashes due to mishandled timeouts + + src/mm-generic-gsm.c | 137 + +++++++++++++++++++++++++-------------------------- + 1 file changed, 67 insertions(+), 70 deletions(-) + +commit 04540bddb4d9345a2c480d5abfe87fb96317d170 +Author: Dan Williams +Date: Mon Jun 29 12:59:59 2009 -0400 + + mbm: remove dead code + + plugins/mm-modem-mbm.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 3f5501906ba61f55948c912617e75cf91560a3cf +Author: Torgny Johansson +Date: Mon Jun 29 10:34:33 2009 -0400 + + mbm: fix +CIND quality parsing + + Broken by Dan with ef0a604dc2fb6c6fe3e9231a8ee85890c6ef6e85 + + plugins/mm-modem-mbm.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +commit ff58936f1f7ef1645be9062095c35de2b03c0cc1 +Author: Dan Williams +Date: Mon Jun 29 10:15:52 2009 -0400 + + mbm: port to udev and new plugin API + + plugins/77-mm-ericsson-mbm.rules | 22 +++ + plugins/Makefile.am | 19 ++- + plugins/mm-modem-mbm.c | 343 + +++++++++++++++++++-------------------- + plugins/mm-modem-mbm.h | 8 +- + plugins/mm-plugin-mbm.c | 278 ++++++++++++------------------- + plugins/mm-plugin-mbm.h | 10 +- + 6 files changed, 309 insertions(+), 371 deletions(-) + +commit b79ebbac352e581c5a9d6eea2a5000f4cdc62188 +Author: Dan Williams +Date: Mon Jun 29 10:15:14 2009 -0400 + + gsm/cdma: mark netdev as data device if it was found first + + src/mm-generic-cdma.c | 2 +- + src/mm-generic-gsm.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 8ae41eeee3cdafaebc9eca7f5e8f0d8415a5a76d +Author: Dan Williams +Date: Mon Jun 29 10:09:26 2009 -0400 + + hso: always mark netdev as supported + + plugins/mm-plugin-hso.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit fe7acaf45750d4f801acbfee98048453c10c7308 +Author: Dan Williams +Date: Mon Jun 29 10:08:56 2009 -0400 + + plugin-base: better detection of physical device + + src/mm-plugin-base.c | 43 +++++++++++++++++++++++++++++-------------- + 1 file changed, 29 insertions(+), 14 deletions(-) + +commit c6d0174b41524c84ba756472e47c810239be0886 +Author: Dan Williams +Date: Mon Jun 29 09:00:25 2009 -0400 + + hso: fix grab of netdev port + + plugins/mm-plugin-hso.c | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +commit 504b4991cd3aecd358d92a9c39233e6ca09036fa +Merge: 6077763d ef0a604d +Author: Dan Williams +Date: Mon Jun 29 07:29:57 2009 -0400 + + Merge commit 'origin/master' into udev + +commit ef0a604dc2fb6c6fe3e9231a8ee85890c6ef6e85 +Author: Torgny Johansson +Date: Mon Jun 29 07:26:20 2009 -0400 + + mbm: merge updated Ericsson 'mbm' driver from + git://gitorious.org/~torgny_j/modemmanager/mbm-mainline.git + + And other cleanups by Dan. + + plugins/mm-modem-mbm.c | 795 + +++++++++++++++++++++++++++++++++--------------- + plugins/mm-modem-mbm.h | 46 +-- + plugins/mm-plugin-mbm.c | 42 ++- + plugins/mm-plugin-mbm.h | 40 ++- + src/mm-generic-gsm.c | 2 +- + 5 files changed, 610 insertions(+), 315 deletions(-) + +commit 6077763d90b69cfc60b23f383c4529f966facaaf +Author: Dan Williams +Date: Sun Jun 28 14:05:05 2009 -0400 + + asynchronous and deferred port detection + + Allow plugins to perform asynchronous port detection, and to defer + port detection + until later. This moves the prober bits into MMPluginBase so that + all plugins + can take adavantage of it only when needed; the probing is not done + at udev time. + Furthermore, plugins like Novatel can flip the secondary ports over + the AT mode + through deferred detection, by deferring the secondary ports until + the main port + has been detected and AT$NWDMAT has been sent. + + This commit also finishes the port of the rest of the plugins + (except mbm) over + to the new port detection methods and plugin API. + + Makefile.am | 2 +- + callouts/77-mm-modem-probe-capabilities.rules | 23 - + callouts/Makefile.am | 13 - + callouts/mm-modem-probe.c | 639 --------------------- + marshallers/mm-marshal.list | 1 + + plugins/Makefile.am | 66 ++- + plugins/mm-modem-hso.c | 1 + + plugins/mm-modem-huawei.c | 6 +- + plugins/mm-modem-nokia.c | 69 ++- + plugins/mm-modem-nokia.h | 19 +- + plugins/mm-modem-novatel-cdma.c | 73 --- + plugins/mm-modem-novatel-cdma.h | 28 - + plugins/mm-modem-novatel-gsm.c | 103 +++- + plugins/mm-modem-novatel-gsm.h | 19 +- + plugins/mm-modem-option.c | 42 +- + plugins/mm-modem-option.h | 19 +- + plugins/mm-modem-sierra.c | 80 ++- + plugins/mm-modem-sierra.h | 19 +- + plugins/mm-modem-zte.c | 129 +++-- + plugins/mm-modem-zte.h | 19 +- + plugins/mm-plugin-generic.c | 288 +++------- + plugins/mm-plugin-gobi.c | 298 +++------- + plugins/mm-plugin-hso.c | 240 +++----- + plugins/mm-plugin-huawei.c | 405 +++++++------ + plugins/mm-plugin-moto-c.c | 241 +++----- + plugins/mm-plugin-nokia.c | 223 ++++---- + plugins/mm-plugin-nokia.h | 21 +- + plugins/mm-plugin-novatel.c | 253 ++++---- + plugins/mm-plugin-novatel.h | 20 +- + plugins/mm-plugin-option.c | 219 +++---- + plugins/mm-plugin-option.h | 20 +- + plugins/mm-plugin-sierra.c | 246 ++++---- + plugins/mm-plugin-sierra.h | 20 +- + plugins/mm-plugin-zte.c | 219 +++---- + plugins/mm-plugin-zte.h | 20 +- + src/mm-generic-cdma.c | 1 + + src/mm-generic-gsm.c | 1 + + src/mm-manager.c | 313 ++++++++-- + src/mm-modem-base.c | 2 +- + src/mm-modem.c | 3 +- + src/mm-modem.h | 2 + + src/mm-plugin-base.c | 796 + ++++++++++++++++++++++++-- + src/mm-plugin-base.h | 89 ++- + src/mm-plugin.c | 21 +- + src/mm-plugin.h | 61 +- + src/mm-serial-parsers.c | 8 +- + src/mm-serial-port.c | 1 + + 47 files changed, 2888 insertions(+), 2513 deletions(-) + +commit 112f2da19dbe8dcd8f32b998459298e7c1884c67 +Author: Dan Williams +Date: Thu Jun 25 16:45:49 2009 -0400 + + serial-port: open port exclusively + + src/mm-serial-port.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit bb50295e5efabf3f8dcbee1102bf3856343f04d9 +Author: Dan Williams +Date: Thu Jun 25 14:14:10 2009 -0400 + + serial-port: if 0 bytes are read, just return + + Otherwise, if something else is mistakenly holding the serial port + open at + the same time as this MMSerialPort, you get a stream of reads of + size 0 and + effectively hang modem-manager. + + src/mm-serial-port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 742bf7d17cef714a7fa456061b80e239761c4fed +Author: Dan Williams +Date: Thu Jun 25 06:14:11 2009 -0400 + + serial-port: print port name in debug messages + + src/mm-serial-port.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 05ab7b2a7c647777231e8b92bcf4ec51036702e4 +Author: Dan Williams +Date: Sat Jun 20 18:18:08 2009 -0400 + + plugins: implement mm_plugin_base_get_device_ids() + + We'll need it in more than one place, so make it generic. + + plugins/mm-plugin-huawei.c | 86 + +++----------------------------------------- + src/mm-plugin-base.c | 89 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-base.h | 6 ++++ + 3 files changed, 99 insertions(+), 82 deletions(-) + +commit d5a43aa862cc527c5d3a86ba6ec9401c029547c0 +Author: Dan Williams +Date: Sat Jun 20 10:49:09 2009 -0400 + + udev: modem port refactor; convert 'hso' to udev + + Create a base MMPort class to handle both tty and net ports + generically, + and move plugins over to that. Also port the 'hso' plugin to udev. + + plugins/Makefile.am | 12 +- + plugins/mm-modem-gobi-gsm.c | 13 +- + plugins/mm-modem-hso.c | 212 ++++++++++++++++--------- + plugins/mm-modem-hso.h | 32 ++-- + plugins/mm-modem-huawei.c | 57 +++---- + plugins/mm-plugin-gobi.c | 2 +- + plugins/mm-plugin-hso.c | 365 + ++++++++++++++++++++++++-------------------- + plugins/mm-plugin-hso.h | 31 +++- + plugins/mm-plugin-huawei.c | 2 +- + plugins/mm-plugin-moto-c.c | 2 +- + src/Makefile.am | 6 +- + src/mm-generic-cdma.c | 103 +++++++------ + src/mm-generic-cdma.h | 6 +- + src/mm-generic-gsm.c | 109 +++++++------ + src/mm-generic-gsm.h | 19 +-- + src/mm-modem-base.c | 156 +++++++++++++++++++ + src/mm-modem-base.h | 59 +++++++ + src/mm-port.c | 238 +++++++++++++++++++++++++++++ + src/mm-port.h | 74 +++++++++ + src/mm-serial-port.c | 99 +++--------- + src/mm-serial-port.h | 17 +-- + src/mm-serial.c | 154 ------------------- + src/mm-serial.h | 57 ------- + 23 files changed, 1121 insertions(+), 704 deletions(-) + +commit 73e536c3c35de6020b6b6a1aeb9deac522e21cb4 +Author: Dan Williams +Date: Fri Jun 19 22:59:43 2009 -0400 + + huawei: convert to udev and new API + + plugins/Makefile.am | 12 +- + plugins/mm-modem-huawei.c | 230 ++++++++++++++++++++-------- + plugins/mm-modem-huawei.h | 32 ++-- + plugins/mm-plugin-huawei.c | 371 + +++++++++++++++++++++++++++++++-------------- + plugins/mm-plugin-huawei.h | 32 ++-- + src/mm-generic-gsm.c | 43 ++++-- + src/mm-generic-gsm.h | 6 + + 7 files changed, 514 insertions(+), 212 deletions(-) + +commit c3dd2eb070ce1fc37863d4eda5e318c9cc44116d +Author: Dan Williams +Date: Fri Jun 19 14:33:24 2009 -0400 + + moto-c: rebase onto MMPluginBase + + plugins/mm-plugin-moto-c.c | 41 ++++------------------------------------- + plugins/mm-plugin-moto-c.h | 5 +++-- + 2 files changed, 7 insertions(+), 39 deletions(-) + +commit af4ecc3e6dce5a3ad6bad3f6276151a2d783f1ac +Author: Dan Williams +Date: Fri Jun 19 13:55:00 2009 -0400 + + cdma: implement GetServingSystem + + introspection/mm-modem-cdma.xml | 13 ++++++ + src/mm-generic-cdma.c | 84 + +++++++++++++++++++++++++++++++++++++++ + src/mm-modem-cdma.c | 88 + ++++++++++++++++++++++++++++++++++++++++- + src/mm-modem-cdma.h | 15 +++++++ + test/mm-test.py | 14 ++++++- + 5 files changed, 212 insertions(+), 2 deletions(-) + +commit f50a762763f7060cdd1c3417a4e68918bfef101b +Author: Dan Williams +Date: Fri Jun 19 13:02:16 2009 -0400 + + cdma: fix up quality reporting + + src/mm-generic-cdma.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 9be1d66ef01123e5d74a12e20f6c71e670a59831 +Author: Dan Williams +Date: Fri Jun 19 12:54:07 2009 -0400 + + cdma: implement GetEsn() + + introspection/mm-modem-cdma.xml | 13 +++++++++ + src/mm-generic-cdma.c | 64 + +++++++++++++++++++++++++++++++---------- + src/mm-modem-cdma.c | 48 +++++++++++++++++++++++++++++++ + src/mm-modem-cdma.h | 8 ++++++ + test/mm-test.py | 6 ++++ + 5 files changed, 124 insertions(+), 15 deletions(-) + +commit 6d4616c1d3641d5074e3df6b04c99a593bbfe2bc +Author: Dan Williams +Date: Fri Jun 19 12:43:37 2009 -0400 + + modem: move GetInfo from GsmCard -> Modem interface + + It's generic, everything implements some variant of +GMM, +GMR, + and +GMI. + + introspection/mm-modem-gsm-card.xml | 13 ----- + introspection/mm-modem.xml | 13 +++++ + src/mm-generic-cdma.c | 95 + +++++++++++++++++++++++++++++++++++++ + src/mm-generic-gsm.c | 14 +++--- + src/mm-modem-gsm-card.c | 86 + --------------------------------- + src/mm-modem-gsm-card.h | 15 ------ + src/mm-modem.c | 83 ++++++++++++++++++++++++++++++++ + src/mm-modem.h | 15 ++++++ + test/mm-test.py | 8 ++-- + 9 files changed, 218 insertions(+), 124 deletions(-) + +commit 88bdb5d29ac291589489f9b646f95fed0b87d281 +Author: Dan Williams +Date: Fri Jun 19 11:55:31 2009 -0400 + + plugin: add a base class to handle modem tracking + + plugins/mm-plugin-generic.c | 42 ++------------- + plugins/mm-plugin-generic.h | 17 +++--- + plugins/mm-plugin-gobi.c | 42 ++------------- + plugins/mm-plugin-gobi.h | 6 ++- + src/Makefile.am | 4 +- + src/mm-plugin-base.c | 127 + ++++++++++++++++++++++++++++++++++++++++++++ + src/mm-plugin-base.h | 52 ++++++++++++++++++ + 7 files changed, 203 insertions(+), 87 deletions(-) + +commit 018e9e58312863611390c42ba242d894dc30ee05 +Author: Dan Williams +Date: Fri Jun 19 11:51:04 2009 -0400 + + test: refactor + + test/mm-test.py | 84 + +++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 46 insertions(+), 38 deletions(-) + +commit 10b8674e5c4550517bd1e1ae887b5dc495112d88 +Author: Dan Williams +Date: Thu Jun 18 23:32:08 2009 -0400 + + gobi: add plugin for Qualcomm Gobi devices + + plugins/Makefile.am | 19 +++ + plugins/mm-modem-gobi-gsm.c | 177 +++++++++++++++++++++++ + plugins/mm-modem-gobi-gsm.h | 43 ++++++ + plugins/mm-plugin-gobi.c | 343 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-gobi.h | 42 ++++++ + src/mm-generic-gsm.c | 1 + + 6 files changed, 625 insertions(+) + +commit 983e3c994750e1fdeb439ce6dd9d430e2f6f3f84 +Author: Dan Williams +Date: Thu Jun 18 23:22:07 2009 -0400 + + core: gracefully handle SIGTERM and SIGINT by shutting down cleanly + + src/main.c | 32 +++++++++++++++++++++++++++----- + src/mm-manager.c | 2 +- + 2 files changed, 28 insertions(+), 6 deletions(-) + +commit aa8d3241e51c32b0582a339eb200ca4fa1bae574 +Author: Dan Williams +Date: Thu Jun 18 22:48:51 2009 -0400 + + moto-c: add plugin for Motorola C-series phones and BUSlink SCWi275u + + plugins/Makefile.am | 19 +++ + plugins/mm-modem-moto-c-gsm.c | 158 +++++++++++++++++++++ + plugins/mm-modem-moto-c-gsm.h | 43 ++++++ + plugins/mm-plugin-moto-c.c | 309 + ++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-moto-c.h | 42 ++++++ + src/mm-generic-gsm.c | 86 +++++++++++- + src/mm-generic-gsm.h | 18 +++ + 7 files changed, 669 insertions(+), 6 deletions(-) + +commit 53d6ca970c0a670a14492033674d5e7f93772e8d +Author: Dan Williams +Date: Thu Jun 18 22:36:31 2009 -0400 + + test: allow IMEI request to fail + + test/mm-test.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 832b43cab5e3cef6b755d8651fa4b715e3e63fd7 +Author: Dan Williams +Date: Thu Jun 18 22:35:58 2009 -0400 + + generic: misc fixes + + plugins/mm-plugin-generic.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 4eb2e75ca386b19b6b099d95b8817b43319052fe +Author: Dan Williams +Date: Thu Jun 18 14:39:40 2009 -0400 + + plugin: bump required plugin major version for udev changes + + src/mm-plugin.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 924814c101da42fcb53005691d136852653f0eae +Author: Dan Williams +Date: Thu Jun 18 14:25:30 2009 -0400 + + udev: move device probing and detection to udev + + Get rid of dependency on HAL, using libgudev instead. Fix up the + plugin API + to no longer use either HAL or udev defines, but let plugins use + whatever + mechanism they want for getting more information out of the device + given the + subsystem and device node name. + + Modems are now defined as "master" devices which "own" a one or + more ports. + A port could be a serial tty device or a network device or whatever. + The + plugin figures out whether it supports a given port or not and + then assigns + it to a new or existing modem. Modems now have a 'valid' property + that + should be set to TRUE when the modem has enough ports to operate + correctly. + For devices (ex. 'hso') that use a network device for data transfer, + the + modem would need to grab at least one TTY and the network device + associated + with that physical device to be 'valid'. + + Also move the generic modem support code to a plugin like other + modem plugins, + and change the I-support-this-device mechanism to return a number + indicating + the level of support. For example, the generic plugin would return + a quite + low number if the device indicates via probing that it can do GSM + or CDMA, but + a more specific plugin can indicate better support for the device, + and thus + the more specific plugin would win control. + + .gitignore | 2 + + Makefile.am | 2 +- + callouts/77-mm-modem-probe-capabilities.rules | 23 + + callouts/Makefile.am | 13 + + callouts/mm-modem-probe.c | 639 ++++++++++++++ + configure.in | 7 +- + introspection/mm-modem.xml | 10 +- + marshallers/mm-marshal.list | 1 + + plugins/Makefile.am | 17 + + plugins/mm-plugin-generic.c | 350 ++++++++ + plugins/mm-plugin-generic.h | 27 + + src/Makefile.am | 22 +- + src/main.c | 93 +-- + src/mm-generic-cdma.c | 217 ++++- + src/mm-generic-cdma.h | 17 +- + src/mm-generic-gsm.c | 457 +++++++--- + src/mm-generic-gsm.h | 17 +- + src/mm-manager.c | 376 ++++----- + src/mm-manager.h | 6 +- + src/mm-modem.c | 97 ++- + src/mm-modem.h | 54 +- + src/mm-plugin.c | 48 +- + src/mm-plugin.h | 58 +- + src/mm-serial-port.c | 1107 + +++++++++++++++++++++++++ + src/mm-serial-port.h | 114 +++ + src/mm-serial.c | 1024 + ++--------------------- + src/mm-serial.h | 80 +- + 27 files changed, 3280 insertions(+), 1598 deletions(-) + +commit 0555cc1824aabbdda77cf1440c4e7be4ef8cc69e +Author: Dan Williams +Date: Thu Jun 18 13:28:09 2009 -0400 + + test: fix up test program for current API + + test/mm-test.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 440cd967e25f931dd4ed8684e27a72791e4d40f0 +Author: Tambet Ingo +Date: Tue Jun 9 14:34:12 2009 +0300 + + Fix a typo. + + Thanks to Pablo Martí Gamboa. + + introspection/mm-modem-connect-error.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 911a105408f9809a62a01e1ea2462f2464dfdafe +Author: Tambet Ingo +Date: Mon May 25 10:17:11 2009 +0300 + + Fix a typo. + + test/mm-send-sms.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9b5425cdd913ec66ee56ec9acfc1626f2e6957fa +Author: Tambet Ingo +Date: Mon May 25 10:16:12 2009 +0300 + + Turn off carrier detection for all Huawei modems. + + Find the monitoring device for Huawei modems by usb interface number. + + plugins/mm-modem-huawei.c | 1 + + plugins/mm-plugin-huawei.c | 17 +++++++---------- + 2 files changed, 8 insertions(+), 10 deletions(-) + +commit f7e9e61cf9ecff3af2ef0d69c696da0ce5722d69 +Author: Tambet Ingo +Date: Mon May 18 14:10:31 2009 +0300 + + Handle the case where there's no APNs set up on the card. + + Based on patch from Torgny Johansson . + + src/mm-generic-gsm.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit ddbeb418292c9ddf05e15a107904ca2c35219f3e +Author: Tambet Ingo +Date: Thu May 14 13:14:45 2009 +0300 + + Make pending_registration_stop() accessible to inherited + implementations. + + src/mm-generic-gsm.c | 13 ++++++------- + src/mm-generic-gsm.h | 2 ++ + 2 files changed, 8 insertions(+), 7 deletions(-) + +commit 92041d5f750ab440d278c95c1f65483aa8ebf192 +Merge: 2a3acc7a 58a48405 +Author: Dan Williams +Date: Mon May 11 06:43:43 2009 -0400 + + Merge branch 'gsm-mode-cleanup' + +commit 2a3acc7a3d13e6c359f6b280a9e7718d7b2d42bd +Author: Tambet Ingo +Date: Wed Apr 22 16:10:32 2009 +0300 + + Handle "Call setup failed" case for HSO modems to speed up error + reporting. + + plugins/mm-modem-hso.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 58a48405cf95e3d74633ac4d5d4e0d4d0ab491f4 +Author: Dan Williams +Date: Wed Apr 15 10:44:09 2009 -0400 + + gsm: clean up network modes + + Add specific modes for HSUPA and HSPA; add modes for 2G and 3G + only, and + update plugins to use the right modes. + + introspection/mm-modem-gsm-network.xml | 30 + +++++++++++++++++++++++++----- + plugins/mm-modem-huawei.c | 34 + +++++++++++++++++++++++----------- + plugins/mm-modem-mbm.c | 29 +++++++++++++++++++++-------- + plugins/mm-modem-option.c | 20 +++++++++++++------- + src/mm-modem-gsm-network.h | 22 +++++++++++++--------- + 5 files changed, 95 insertions(+), 40 deletions(-) + +commit 8eb9fa50b40658d267da8763e7eef3680cad4b0b +Author: Tambet Ingo +Date: Tue Apr 14 11:42:00 2009 +0300 + + Handle cases where HAL is not running/disappears/reappears. + + src/main.c | 156 + +++++++++++++++++++++++++++++++++++++++++++++---------- + src/mm-manager.c | 99 ++++++++++++++++++++++++----------- + src/mm-manager.h | 9 +++- + 3 files changed, 206 insertions(+), 58 deletions(-) + +commit b79a3c0a6533092a82da49bffc603fbd84536cf0 +Author: Tambet Ingo +Date: Fri Apr 3 13:45:17 2009 +0300 + + Fix a typo. + + plugins/mm-modem-zte.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d37820474201ea46e574c13c86fb015698d0cab9 +Author: Tambet Ingo +Date: Thu Apr 2 15:19:34 2009 +0300 + + Fix a typo (thanks to Torgny Johansson). + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 636fe2921c39293a8e2e121f134a764151b4799e +Author: Tambet Ingo +Date: Thu Apr 2 14:48:12 2009 +0300 + + Implement a plugin for ZTE modems. + + Contributed by Jesse Sung (jsung@novell.com). + + plugins/Makefile.am | 17 ++++- + plugins/mm-modem-zte.c | 191 + ++++++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-zte.h | 28 +++++++ + plugins/mm-plugin-zte.c | 148 +++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-zte.h | 27 +++++++ + 5 files changed, 410 insertions(+), 1 deletion(-) + +commit 1ca34cfc0cb126f5f824a10720b6ed24fd1f4a8d +Author: Tambet Ingo +Date: Thu Apr 2 12:41:59 2009 +0300 + + Implement Nokia plugin. + + plugins/Makefile.am | 17 +++++- + plugins/mm-modem-nokia.c | 65 ++++++++++++++++++++ + plugins/mm-modem-nokia.h | 28 +++++++++ + plugins/mm-plugin-nokia.c | 148 + ++++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-nokia.h | 28 +++++++++ + 5 files changed, 285 insertions(+), 1 deletion(-) + +commit eae902db41879551945200c61e2148a78f4caa11 +Author: Tambet Ingo +Date: Thu Apr 2 12:31:40 2009 +0300 + + Implement 'V1 E1' parser to work with modems which refuse to turn + their echo off. + + src/mm-serial-parsers.c | 51 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-serial-parsers.h | 8 ++++++++ + 2 files changed, 59 insertions(+) + +commit cf6aeffd6363fdab5ab5526f0bca47919f38ba2f +Author: Tambet Ingo +Date: Wed Apr 1 16:20:19 2009 +0300 + + Fix a compilation error (with certain warning flags). + + src/mm-serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 83ba035aad0dc04d0c1ed9a4ded90e02b2a291bd +Author: Tambet Ingo +Date: Fri Mar 27 09:10:23 2009 +0200 + + Fix the use of uninitialized variables. + + src/mm-modem-gsm-sms.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 45f32e7e09aa3e35ff89b224df55c89c7beaa026 +Author: Tambet Ingo +Date: Mon Mar 23 13:28:22 2009 +0200 + + Implement sending SMS messages. + + Add a test program to use the newly added method. + + introspection/mm-modem-gsm-sms.xml | 18 +++ + src/Makefile.am | 8 +- + src/mm-generic-gsm.c | 52 +++++++ + src/mm-modem-gsm-sms.c | 298 + +++++++++++++++++++++++++++++++++++++ + src/mm-modem-gsm-sms.h | 45 ++++++ + test/mm-send-sms.py | 39 +++++ + 6 files changed, 459 insertions(+), 1 deletion(-) + +commit 697b5f0364cee038a685ac82b211993e2809eb75 +Author: Tambet Ingo +Date: Thu Mar 12 15:43:27 2009 +0200 + + Add the NM patch back. Create a directory for patches. + + .../NetworkManager-r4359-use-modem-manager.patch | 5691 + ++++++++++++++++++++ + .../nm-applet-r1053-use-modem-manager.patch | 69 +- + 2 files changed, 5729 insertions(+), 31 deletions(-) + +commit 8750037fafbf27bd4218b6ea37e17dbc85102dcc +Author: Tambet Ingo +Date: Mon Mar 2 10:13:54 2009 +0200 + + Implement MMModemNovatelCdma class for Novatel CDMA devices. + + Rename MMModemNovatel to MMModemNovatelGsm. + + plugins/Makefile.am | 6 +- + plugins/mm-modem-novatel-cdma.c | 73 + ++++++++++++++++++++++ + plugins/mm-modem-novatel-cdma.h | 28 +++++++++ + .../{mm-modem-novatel.c => mm-modem-novatel-gsm.c} | 40 ++++++------ + plugins/mm-modem-novatel-gsm.h | 28 +++++++++ + plugins/mm-modem-novatel.h | 28 --------- + plugins/mm-plugin-novatel.c | 12 ++-- + 7 files changed, 159 insertions(+), 56 deletions(-) + +commit 6606e15a9b6877d91a7125a31510c011522217b7 +Author: Tambet Ingo +Date: Fri Feb 27 10:21:23 2009 +0200 + + Handle CDMA modems in Novatel plugin. + + plugins/mm-plugin-novatel.c | 64 + ++++++++++++++++++++++++++++++++------------- + 1 file changed, 46 insertions(+), 18 deletions(-) + +commit a7f9033611290a3fe87d89c1a7ae30c47c04e87a +Author: Tambet Ingo +Date: Thu Feb 26 11:28:00 2009 +0200 + + Probe HSO modems, don't trust (often incorrect) HAL modem properties. + + plugins/mm-plugin-hso.c | 30 +++++++++++++++++++----------- + 1 file changed, 19 insertions(+), 11 deletions(-) + +commit d8fa8d7d1bcfc29a0711c024e9e68bd6a9e1eeda +Author: Tambet Ingo +Date: Fri Feb 20 12:10:12 2009 +0200 + + Eat "^BOOT:..." messages in Huawei plugin. + + plugins/mm-modem-huawei.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 469529985d8f6f79739a69efb020be1b36489666 +Author: Tambet Ingo +Date: Fri Feb 20 12:09:47 2009 +0200 + + Use cached commands for things that never change (while the card + is plugged). + + src/mm-generic-gsm.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 9e6aa4ec96c2b3c56b0d927db05890ba843e840d +Author: Tambet Ingo +Date: Fri Feb 20 12:09:15 2009 +0200 + + Implement cached commands. + + src/mm-serial.c | 76 + ++++++++++++++++++++++++++++++++++++++++++++++++++++----- + src/mm-serial.h | 6 +++++ + 2 files changed, 76 insertions(+), 6 deletions(-) + +commit 1215bd6a9d607018e0af7ad7afa85bc35cb713a0 +Author: Tambet Ingo +Date: Wed Feb 18 14:48:08 2009 +0200 + + Rework unsolicited message handling. + + Implement registration using unsolicited messages for generic GSM + class (which + is disabled by default, HSO and Huawei plugins enable it). + + Modify all GSM modem subclasses that used unsolicited messages to + use the new + method. + + plugins/mm-modem-hso.c | 46 +++---- + plugins/mm-modem-huawei.c | 342 + ++++++++-------------------------------------- + plugins/mm-modem-mbm.c | 71 ++++------ + src/Makefile.am | 4 +- + src/mm-generic-gsm.c | 273 +++++++++++++++++++++++------------- + src/mm-generic-gsm.h | 3 + + src/mm-serial.c | 97 +++++++++++++ + src/mm-serial.h | 11 ++ + src/mm-util.c | 57 -------- + src/mm-util.h | 20 --- + 10 files changed, 384 insertions(+), 540 deletions(-) + +commit 13facad4fa3be24d07768892135caebd88e95fcc +Author: Tambet Ingo +Date: Fri Feb 13 10:54:21 2009 +0200 + + Close the serial device on HUP. + + src/mm-serial.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 28fd7f7820bc0da1e0a6b7c75d3273e6d63fcbf7 +Author: Tambet Ingo +Date: Tue Feb 10 15:26:51 2009 +0200 + + Implement the spec correctly for DeviceAdded and DeviceRemoved + signals. + + src/mm-manager.c | 14 +++++++------- + src/mm-manager.h | 4 ++-- + 2 files changed, 9 insertions(+), 9 deletions(-) + +commit 1f08d4c4087282f12039da08ae59e9563a6c6e0d +Author: Tambet Ingo +Date: Tue Feb 10 15:26:18 2009 +0200 + + Fix a compilation warning/error. + + plugins/mm-modem-mbm.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 2adf9a0088f681c7c180f04383c5e0051689fc71 +Author: Dan Williams +Date: Tue Feb 10 06:53:09 2009 -0500 + + remove NetworkManager patch; no longer necessary + + NetworkManager-r4241-use-modem-manager.patch | 5569 + -------------------------- + 1 file changed, 5569 deletions(-) + +commit bef9c48ffc926b97a7c0b1d56b9de751e37efe69 +Author: Dan Williams +Date: Tue Feb 10 06:48:56 2009 -0500 + + add --enable-more-warnings=yes/no and fix up resulting errors + + configure.in | 29 ++++++++++++++++++++++++++++ + plugins/mm-modem-hso.c | 47 + +++++++++++++++++++++++---------------------- + plugins/mm-modem-huawei.c | 8 ++++---- + plugins/mm-modem-mbm.c | 4 ++-- + plugins/mm-modem-novatel.c | 4 ++-- + plugins/mm-modem-option.c | 6 +++--- + plugins/mm-modem-sierra.c | 6 +++--- + plugins/mm-plugin-hso.h | 2 ++ + plugins/mm-plugin-huawei.h | 2 ++ + plugins/mm-plugin-mbm.h | 2 ++ + plugins/mm-plugin-novatel.h | 2 ++ + plugins/mm-plugin-option.h | 2 ++ + plugins/mm-plugin-sierra.h | 2 ++ + src/main.c | 1 + + src/mm-generic-cdma.c | 4 ++-- + src/mm-generic-gsm.c | 4 ++-- + src/mm-modem-simple.c | 2 +- + src/mm-serial-parsers.c | 3 ++- + 18 files changed, 87 insertions(+), 43 deletions(-) + +commit 618db2dd8ab255271f388c3c4a7ccbe8ad9a0ae4 +Author: Tambet Ingo +Date: Mon Feb 9 10:48:26 2009 +0200 + + Bump the version. + + Remove a leftover include from mbm modem implementation to make + it compile + again. + + configure.in | 2 +- + plugins/mm-modem-mbm.c | 2 -- + 2 files changed, 1 insertion(+), 3 deletions(-) + +commit fd5f4222d7c18a3279085edd4ca6ed36247923e6 +Author: Tambet Ingo +Date: Fri Feb 6 13:34:02 2009 +0200 + + Extend org.freedesktop.ModemManager.Modem interface. + + * Add IpMethod property with known values ppp (default), static, DHCP. + * Rename DataDevice property to Device. + * Add GetIP4Config method. It should be implemented only when + IpMethod==static. + * Update org.freedesktop.ModemManager.Modem.Gsm.Sms interface based on + Pablo Martí Gamboa's suggestions. + * Adjust MBM and HSO interfaces to take advantage of the generic Modem + interface. + + introspection/Makefile.am | 1 - + introspection/mm-modem-gsm-hso.xml | 21 --- + introspection/mm-modem-gsm-sms.xml | 36 ++++-- + introspection/mm-modem.xml | 41 +++++- + plugins/Makefile.am | 7 +- + plugins/mm-modem-hso.c | 259 + +++++++++++++++---------------------- + plugins/mm-modem-hso.h | 14 -- + plugins/mm-modem-huawei.c | 3 +- + plugins/mm-modem-mbm.c | 71 +++------- + plugins/mm-modem-mbm.h | 19 --- + plugins/mm-modem-novatel.c | 3 +- + plugins/mm-modem-option.c | 1 + + plugins/mm-modem-sierra.c | 1 + + src/mm-generic-cdma.c | 17 ++- + src/mm-generic-gsm.c | 30 ++++- + src/mm-modem.c | 108 +++++++++++++++- + src/mm-modem.h | 30 ++++- + src/mm-serial.h | 2 +- + 18 files changed, 356 insertions(+), 308 deletions(-) + +commit 19bd7d7e7f9e6128f29de8888ba23071f8f4e4d8 +Author: Tambet Ingo +Date: Fri Feb 6 13:32:45 2009 +0200 + + Fix DBus permissions. + + README | 2 +- + introspection/mm-modem-gsm-mbm.xml | 12 ------------ + org.freedesktop.ModemManager.conf | 19 +++++++------------ + 3 files changed, 8 insertions(+), 25 deletions(-) + +commit d4e1d7dc8c6f3b766cac148e13c84d51e10c07f3 +Author: Tambet Ingo +Date: Wed Feb 4 15:24:39 2009 +0200 + + Fix a typo in error message when MM couldn't acquire it's DBus + service name. + + src/main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2226bb8752987d210a5e7dd673dd9426a3d2701f +Author: Tambet Ingo +Date: Mon Jan 26 11:54:10 2009 +0200 + + Implement Novatel plugin. + + plugins/Makefile.am | 19 ++++- + plugins/mm-modem-novatel.c | 170 + ++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-novatel.h | 28 ++++++++ + plugins/mm-plugin-novatel.c | 148 ++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-novatel.h | 26 +++++++ + 5 files changed, 389 insertions(+), 2 deletions(-) + +commit 6b14ebe6ab2b94066c797696748a4d06abbff259 +Author: Tambet Ingo +Date: Fri Jan 23 11:58:38 2009 +0200 + + Relax the "CONNECT" string regex a bit. + + src/mm-serial-parsers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d8fada178591a77bbf8a7a67d6f10da703cf0c1f +Author: Tambet Ingo +Date: Thu Jan 22 12:30:25 2009 +0200 + + Don't require 'number' property, it's not always needed. + + src/mm-generic-gsm.c | 6 ------ + 1 file changed, 6 deletions(-) + +commit 8bf265f349f531c3204efce1c88eb1f153b7097c +Author: Tambet Ingo +Date: Thu Jan 22 12:30:09 2009 +0200 + + Implement 'Simple' interface for HSO modems. + + plugins/mm-modem-hso.c | 100 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 100 insertions(+) + +commit b4c861540951afccf0498092b9d6dd4aa6b56994 +Author: Tambet Ingo +Date: Thu Jan 22 12:29:45 2009 +0200 + + Implement 'Simple' interface for CDMA devices. + + src/mm-generic-cdma.c | 160 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 160 insertions(+) + +commit 17b739c73d5e054cf110049d09d8ec56b3b6af91 +Author: Tambet Ingo +Date: Tue Jan 13 11:01:48 2009 +0200 + + Implement simple interface. + + introspection/Makefile.am | 1 + + introspection/mm-modem-simple.xml | 58 +++++++++ + src/Makefile.am | 6 + + src/mm-generic-gsm.c | 260 + ++++++++++++++++++++++++++++++++++++++ + src/mm-modem-simple.c | 142 +++++++++++++++++++++ + src/mm-modem-simple.h | 46 +++++++ + 6 files changed, 513 insertions(+) + +commit 423637272a9a021742c070930f3b3a2c96c31695 +Author: Tambet Ingo +Date: Tue Jan 13 11:29:44 2009 +0200 + + Fix the "Option" plugin to not steal modems from "HSO" plugin. + + plugins/mm-plugin-option.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 6018ff81babf1296f13fa0f45a60faae4fd7e0d5 +Author: Tambet Ingo +Date: Tue Jan 13 11:27:41 2009 +0200 + + Implement DCD disabling for serial base class. + + Turn DCD detection off for certain Huawei modems that don't report it + correctly. + + plugins/mm-plugin-huawei.c | 31 +++++++++++++++++++++++++------ + src/mm-serial.c | 29 +++++++++++++++++++++++++---- + src/mm-serial.h | 1 + + 3 files changed, 51 insertions(+), 10 deletions(-) + +commit 50d2a8b80c25f25e3327127d725277c70570cff3 +Author: Tambet Ingo +Date: Tue Jan 13 11:23:02 2009 +0200 + + If none of the HSO serial device parents match none of the network + device + parents, try to match "grandparents" as well. + + plugins/mm-plugin-hso.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 9804a216860e04c6e6f98b5bbced9213bf49aadb +Author: Tambet Ingo +Date: Tue Jan 13 11:18:16 2009 +0200 + + Explicitly disable unsolicited messages for generic GSM modems. + + src/mm-generic-gsm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 56bd8994eeeb70eb22c45b59603c42cddc2e68a8 +Author: Tambet Ingo +Date: Wed Dec 17 13:37:57 2008 +0200 + + Implement Huawei modem registration with unsolicited messages + (no polling). + + Keep registration info in sync correctly. Emit signal when it changes. + + plugins/mm-modem-huawei.c | 204 + ++++++++++++++++++++++++++++++++++++++-------- + src/mm-generic-gsm.c | 81 ++++++++---------- + src/mm-generic-gsm.h | 4 - + 3 files changed, 204 insertions(+), 85 deletions(-) + +commit a1223a9eaf35e7f198b46061ebb7d0ca567886fb +Author: Tambet Ingo +Date: Wed Dec 17 13:35:22 2008 +0200 + + Convert multiple return values to structs. + + Python DBus bindings are unable to implement methods that return + multiple + values. + + introspection/mm-modem-gsm-card.xml | 14 ++------------ + introspection/mm-modem-gsm-contacts.xml | 14 ++------------ + introspection/mm-modem-gsm-network.xml | 17 +++++------------ + introspection/mm-modem-gsm-sms.xml | 19 ++----------------- + src/mm-modem-gsm-card.c | 28 ++++++++++++++++++++++++++-- + src/mm-modem-gsm-network.c | 31 + +++++++++++++++++++++++++++---- + 6 files changed, 64 insertions(+), 59 deletions(-) + +commit 614aa0316a4c0801d187949b0ab2e6816c82328e +Author: Tambet Ingo +Date: Mon Dec 15 14:03:27 2008 +0200 + + Clean up generic registration code. + + src/mm-generic-gsm.c | 27 ++++++++------------------- + 1 file changed, 8 insertions(+), 19 deletions(-) + +commit e4efbc5c841407b5c5017caf55c80c10e065b7b2 +Author: Tambet Ingo +Date: Mon Dec 15 13:56:53 2008 +0200 + + Cache data in Huawei modem. + + plugins/mm-modem-huawei.c | 334 + +++++++++++++++++++++++++++++----------------- + 1 file changed, 214 insertions(+), 120 deletions(-) + +commit 4bf6681800dd502a3e341f3d6b7bba101bfd8dc7 +Author: Tambet Ingo +Date: Mon Dec 15 11:50:31 2008 +0200 + + Parse Huawei flow report. + + plugins/mm-modem-huawei.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 4e94acfbc3b73471b235b2be18177475d1af53a4 +Author: Tambet Ingo +Date: Fri Dec 12 10:14:41 2008 +0200 + + Don't ever disable radio of Sierra GSM modems. + + Based on patch from Stefan Seyfried . + + plugins/mm-modem-sierra.c | 48 + +++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 38 insertions(+), 10 deletions(-) + +commit d1d94de6a1235a36a6e40652efd4d86911eec3b2 +Author: Tambet Ingo +Date: Tue Dec 9 15:41:51 2008 +0200 + + Lots of random fixes: + + Rework the MMCallbackInfo callback invocation. + Always use g_error_literal() where it makes sense. + Replace sleep() calls, with timeouts to not block the whole MM. + + plugins/mm-modem-hso.c | 21 ++++------- + plugins/mm-modem-huawei.c | 25 ++++++------- + plugins/mm-modem-mbm.c | 4 +-- + plugins/mm-modem-option.c | 22 ++++++++---- + plugins/mm-modem-sierra.c | 25 ++++++++++++- + src/mm-callback-info.c | 89 + +++++++++++++++++++++++++++++++--------------- + src/mm-callback-info.h | 18 +++++++--- + src/mm-generic-gsm.c | 87 + +++++++++++++++++++------------------------- + src/mm-modem-cdma.c | 4 +-- + src/mm-modem-gsm-card.c | 40 ++++++--------------- + src/mm-modem-gsm-network.c | 42 +++++++++------------- + src/mm-modem.c | 4 +-- + 12 files changed, 199 insertions(+), 182 deletions(-) + +commit a504fb408aa2ba3bb495a08d948ae97bdcb1cdd6 +Merge: 793044b5 1673c6c9 +Author: Tambet Ingo +Date: Fri Dec 5 15:57:55 2008 +0200 + + Merge branch 'master' of git://gitorious.org/modemmanager/asacs-mbm + +commit 1673c6c998ccca73097c7d032b14ff15883d053b +Author: Alexander Sack +Date: Fri Nov 28 23:51:26 2008 +0100 + + Implement SendPuk feature + * introspection/mm-modem-gsm-card.xml: add SendPuk method + Gsm.Card interface + + * src/mm-generic-gsm.c (send_puk_done, send_puk): + - implement generic SendPuk with +CPIN="," + + * src/mm-modem-gsm-card.h, + src/mm-modem-gsm-card.c (mm_modem_gsm_card_send_pin, + impl_gsm_modem_send_pin): implement SendPuk glue. + + introspection/mm-modem-gsm-card.xml | 18 ++++++++++++++++++ + src/mm-generic-gsm.c | 30 ++++++++++++++++++++++++++++++ + src/mm-modem-gsm-card.c | 32 ++++++++++++++++++++++++++++++++ + src/mm-modem-gsm-card.h | 12 ++++++++++++ + 4 files changed, 92 insertions(+) + +commit 793044b577c18d3b9028276fdec629981c75f5ed +Author: Tambet Ingo +Date: Thu Dec 4 17:39:15 2008 +0200 + + Add support for the HP branded version of the sierra mc8775. + + Patch from Stefan Seyfried . + + plugins/mm-plugin-sierra.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 3d84a60ab1efade2ef7ae0885abfa4400d6b386b +Author: Tambet Ingo +Date: Mon Dec 1 12:04:08 2008 +0200 + + Fix HSO modem plugin. + + plugins/mm-modem-hso.c | 200 + +++++++++++++++++++++++++++++++++++++++------- + plugins/mm-modem-option.c | 23 +----- + src/mm-generic-gsm.c | 43 ++++++++++ + src/mm-generic-gsm.h | 4 + + 4 files changed, 220 insertions(+), 50 deletions(-) + +commit 929c1a8a54fdc6f24bc058b0ea2b1d0556bda2ce +Author: Tambet Ingo +Date: Mon Dec 1 11:34:52 2008 +0200 + + Make the MBM plugin's HAL UDI checking more strict, it caught HSO + modems too. + + plugins/mm-plugin-mbm.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +commit 1c67b9327e3d4b1c9eb7e5b4eef012736a23e68d +Author: Tambet Ingo +Date: Fri Nov 28 13:25:26 2008 +0200 + + Fix the bug where HSO plugin would create a modem instance for each + serial device. + + plugins/mm-plugin-hso.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +commit c44079b3126825564ec13923ccb6e09e85ca3162 +Author: Tambet Ingo +Date: Mon Nov 24 16:41:23 2008 +0200 + + Always print out which plugin created the modem. + + src/mm-manager.c | 8 +++++--- + src/mm-plugin.c | 10 +++++++++- + 2 files changed, 14 insertions(+), 4 deletions(-) + +commit 157da2be755fbc954cf53f4ab9fc415139ea155c +Author: Tambet Ingo +Date: Tue Nov 18 13:04:21 2008 +0200 + + Implement plugin for Sierra Wireless modems. + + For now, it only waits a bit after CFUN=1 call. + + plugins/Makefile.am | 17 +++++- + plugins/mm-modem-sierra.c | 104 +++++++++++++++++++++++++++++++ + plugins/mm-modem-sierra.h | 28 +++++++++ + plugins/mm-plugin-sierra.c | 148 + +++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-plugin-sierra.h | 26 ++++++++ + 5 files changed, 322 insertions(+), 1 deletion(-) + +commit cf2344381ceabd9ac15bfea1ddd57c81a62b16da +Author: Tambet Ingo +Date: Tue Nov 18 12:35:34 2008 +0200 + + Make +CMEE optional for CDMA modems. + + It's mandatory by spec, so it really shouldn't be optional. Need + to figure + out which CDMA modems have problems with it and implement plugin + for them. + + src/mm-generic-cdma.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit ca4de81fa3bcd54cef3a9c3c4a72ec4d79ceec85 +Author: Tambet Ingo +Date: Fri Oct 31 12:30:39 2008 +0200 + + Update the NM and nm-applet patches to latest SVN revision. + + ...=> NetworkManager-r4241-use-modem-manager.patch | 56 + +++++++++++++++------- + ...patch => nm-applet-r994-use-modem-manager.patch | 0 + 2 files changed, 38 insertions(+), 18 deletions(-) + +commit 00c79d7fa153895dd9cddaeda8cadcaa50005223 +Author: Tambet Ingo +Date: Thu Oct 30 17:00:15 2008 +0200 + + Explicitly check the PIN after modem is enabled. + + plugins/mm-modem-option.c | 85 + +++++++++++++++++++---------------------------- + 1 file changed, 34 insertions(+), 51 deletions(-) + +commit 0b9badee75d162f23d7f462eb5a5ccbcb73bef3a +Author: Tambet Ingo +Date: Thu Oct 30 16:55:06 2008 +0200 + + Hope the card will eventually start searching after it replied OK + to registration request. + + src/mm-generic-gsm.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit de6c6cd561a0a10342f9f5ff50168ac92f0d0282 +Author: Tambet Ingo +Date: Thu Oct 30 15:15:23 2008 +0200 + + Implement Option plugin. + + plugins/Makefile.am | 18 ++- + plugins/mm-modem-option.c | 275 + +++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-option.h | 28 +++++ + plugins/mm-plugin-option.c | 148 ++++++++++++++++++++++++ + plugins/mm-plugin-option.h | 26 +++++ + 5 files changed, 494 insertions(+), 1 deletion(-) + +commit fe4e7ee62b1956694aef2ceeeef63c57d4a865cc +Author: Tambet Ingo +Date: Thu Oct 30 15:13:51 2008 +0200 + + Enable/disable debugging on SIGUSR1. + + src/main.c | 128 + ++++++++++++++++++++++++++++++++----------------------- + src/mm-options.c | 6 +++ + src/mm-options.h | 5 ++- + src/mm-serial.c | 19 ++++++--- + 4 files changed, 97 insertions(+), 61 deletions(-) + +commit ced49a6a10def8c7207173cf08b518e519f634b5 +Author: Tambet Ingo +Date: Thu Oct 30 10:46:46 2008 +0200 + + Add the device path to mbm modem creator in NM patch. + + NetworkManager-r4232-use-modem-manager.patch | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f8c2f2af6579796123e32dd83570d21107c830a4 +Author: Tambet Ingo +Date: Thu Oct 30 10:33:16 2008 +0200 + + Implement unsolicited message parsers for MBM modem. + + Patch from Per Hallsmark . + + plugins/mm-modem-mbm.c | 109 + ++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 95 insertions(+), 14 deletions(-) + +commit 65992e69c3bead44f12c21ee2f296af5c26280e2 +Author: Tambet Ingo +Date: Wed Oct 29 12:15:43 2008 +0200 + + Update NetworkManager and nm-applet patches. + + ...=> NetworkManager-r4232-use-modem-manager.patch | 141 + +++++++++++++-------- + ...patch => nm-applet-r988-use-modem-manager.patch | 73 +++++++---- + 2 files changed, 131 insertions(+), 83 deletions(-) + +commit d7c7ab27321d7be4e902aed7995f956e8e70cbb1 +Author: Tambet Ingo +Date: Tue Oct 28 09:28:37 2008 +0200 + + Implement signal quality and network mode querying for MBM modem. + + Patch from Bjorn Runaker . + + plugins/mm-modem-mbm.c | 115 + +++++++++++++++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-mbm.h | 1 + + 2 files changed, 116 insertions(+) + +commit 128021dc16729233a8e2542206d53c3e05091f20 +Author: Tambet Ingo +Date: Fri Oct 24 17:46:01 2008 +0300 + + Add guards to public functions to validate passed arguments. + + src/mm-serial-parsers.c | 10 ++++++++++ + src/mm-util.c | 3 +++ + 2 files changed, 13 insertions(+) + +commit 705aa1c4041e4d12146628c07d2e808ea0d31fa2 +Author: Tambet Ingo +Date: Fri Oct 24 16:22:50 2008 +0300 + + Update the NM and nm-applet patches. + + ...=> NetworkManager-r4209-use-modem-manager.patch | 41 + +++++++++++++--------- + ...patch => nm-applet-r965-use-modem-manager.patch | 0 + 2 files changed, 24 insertions(+), 17 deletions(-) + +commit f82b187c2bb3efb117f96e5b6062128f20ab2f39 +Author: Tambet Ingo +Date: Fri Oct 24 16:20:22 2008 +0300 + + Move the string parser with regexp from huawei plugin to generic + utility function. + + It's useful for other modems too that need to strip unsolicited + messages from + responses. + + plugins/mm-modem-huawei.c | 55 + +++-------------------------------------------- + src/Makefile.am | 4 +++- + src/mm-util.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/mm-util.h | 20 +++++++++++++++++ + 4 files changed, 80 insertions(+), 53 deletions(-) + +commit 0bd4f4a6049838dd7b09320c18c1991196ae80ee +Author: Tambet Ingo +Date: Fri Oct 24 10:04:42 2008 +0300 + + More work with MBM plugin. + + Author: Per Hallsmark. + + plugins/mm-modem-mbm.c | 177 + +++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 149 insertions(+), 28 deletions(-) + +commit f7aeeafec8cde16268abe2d15a75bbc2ed2b8132 +Author: Tambet Ingo +Date: Wed Oct 22 16:36:25 2008 +0300 + + Use only one serial device in Huawei plugin. + + plugins/mm-modem-huawei.c | 322 + +++++++++++++++++++++++----------------------- + plugins/mm-modem-huawei.h | 2 - + src/mm-generic-gsm.c | 20 ++- + 3 files changed, 176 insertions(+), 168 deletions(-) + +commit fd4e78fe920492099a45dbf42ba9d4f1e9b0899b +Author: Tambet Ingo +Date: Wed Oct 22 16:34:34 2008 +0300 + + Add a default send delay to the serial class. + + Show the correct error in case of write errors (EAGAIN). + + src/mm-serial.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 3201a1e6b7913577690ff059a4ac0d5fb7f23094 +Author: Tambet Ingo +Date: Mon Oct 20 18:39:19 2008 +0300 + + Don't loop forever on EAGAIN (copied from NM). + + src/mm-serial.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 2b76d6885494601c97db5826f178597b8cf872bc +Author: Tambet Ingo +Date: Mon Oct 20 17:13:18 2008 +0300 + + Update NM patch. + + NetworkManager-r4160-use-modem-manager.patch | 5 +++-- + src/mm-generic-cdma.c | 1 + + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 4d27cef5ed1304ea01750e1cee11c76838bf1383 +Author: Tambet Ingo +Date: Mon Oct 20 14:37:56 2008 +0300 + + Add a response parser to the generic CDMA implementation. + + src/mm-generic-cdma.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 446a4752d654b9169c26aee2f0e36a0b1894af21 +Author: Tambet Ingo +Date: Mon Oct 20 12:25:14 2008 +0300 + + Remove the fancy init string options, these do not seem to work + very well. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 096246e2fd0f64b3aea2a7ac8ac3b600645ee92f +Author: Tambet Ingo +Date: Mon Oct 20 12:12:55 2008 +0300 + + Fix mm-test.py. + + test/mm-test.py | 147 + +++++++++++++++++++++++--------------------------------- + 1 file changed, 61 insertions(+), 86 deletions(-) + +commit cdccfa8ac10ec0dabd7c46f6d6e537d5cc457c03 +Author: Tambet Ingo +Date: Mon Oct 20 11:54:02 2008 +0300 + + Return an error ig scan results can not be parsed (fixes a segfault). + + src/mm-generic-gsm.c | 36 +++++++++++++++++++----------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +commit 94501f08542052c064065058b9d58fe29f310e47 +Author: Tambet Ingo +Date: Mon Oct 20 11:23:50 2008 +0300 + + Update NetworkManager patch. + + NetworkManager-r4160-use-modem-manager.patch | 346 + ++++++++++++++++++++++++++- + 1 file changed, 339 insertions(+), 7 deletions(-) + +commit ed5d81da8f7978a6213bf7cd1d9d182d36161ebf +Author: Tambet Ingo +Date: Mon Oct 20 11:11:23 2008 +0300 + + Implement a plugin for Ericsson MBM modems (like F3507g) (Author + Per Hallsmark). + + introspection/Makefile.am | 2 +- + introspection/mm-modem-gsm-mbm.xml | 12 ++ + plugins/Makefile.am | 24 +++- + plugins/mm-modem-mbm.c | 267 + +++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-mbm.h | 70 ++++++++++ + plugins/mm-plugin-mbm.c | 244 + +++++++++++++++++++++++++++++++++ + plugins/mm-plugin-mbm.h | 48 +++++++ + 7 files changed, 664 insertions(+), 3 deletions(-) + +commit 4c8088d8ba58ec6a939f66863ba73a3b5fd19861 +Author: Tambet Ingo +Date: Mon Oct 20 10:29:53 2008 +0300 + + Fix a typo in 'SetApn' command in NetworkManager patch. + + NetworkManager-r4160-use-modem-manager.patch | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ba166485e3eabe90807ea3c466a8df341e01744e +Author: Tambet Ingo +Date: Mon Oct 13 09:40:46 2008 +0300 + + Update the NetworkManager and nm-applet patches. + + ...=> NetworkManager-r4160-use-modem-manager.patch | 816 + +++++++++-------- + ...patch => nm-applet-r938-use-modem-manager.patch | 995 + ++++++++++++++++++--- + 2 files changed, 1270 insertions(+), 541 deletions(-) + +commit 5853f2216c81e693db06eaa8469ce7d61fd687ec +Author: Tambet Ingo +Date: Thu Sep 18 14:31:45 2008 +0300 + + Specify call mode in the modem init string. + + src/mm-generic-gsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5c403fb223a340ad5f4a9010892db7759a9b4dba +Author: Tambet Ingo +Date: Thu Sep 18 12:39:46 2008 +0300 + + Reset the CID when the modem is enabled/disabled and disconnected. + + src/mm-generic-gsm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 447bca91b00fb6be9bf572d7adaf2adc87036bfa +Author: Tambet Ingo +Date: Thu Sep 18 12:33:25 2008 +0300 + + Reduce the amount of power used to minimum when modem is disabled. + + src/mm-generic-gsm.c | 38 ++++++++++++++++++++++++++++++-------- + 1 file changed, 30 insertions(+), 8 deletions(-) + +commit 36acdcb70e5f7cf5c295010e89008ade51bc778d +Author: Tambet Ingo +Date: Wed Sep 17 13:37:35 2008 +0300 + + Finish the non-verbose (V0) mode parser. + + src/mm-serial-parsers.c | 75 + +++++++++++++++++++++++++++++++++++-------------- + src/mm-serial-parsers.h | 3 -- + 2 files changed, 54 insertions(+), 24 deletions(-) + +commit 341c28de2f5b1199ba287ccad549ef3f3c6e9555 +Author: Tambet Ingo +Date: Wed Sep 17 12:37:27 2008 +0300 + + Add correct message to mobile (+CMEE) errors. + + src/mm-errors.c | 110 + +++++++++++++++++++++++++++----------------------------- + 1 file changed, 52 insertions(+), 58 deletions(-) + +commit 6f9adb1980cd0661390ad53b928236ff7b8df235 +Author: Tambet Ingo +Date: Wed Sep 17 11:54:46 2008 +0300 + + Get the monitoring device from HAL. + + plugins/mm-plugin-huawei.c | 62 + +++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 58 insertions(+), 4 deletions(-) + +commit 07f1b3cc3a15bf3bdf946521eb88b43ef7a905cb +Author: Tambet Ingo +Date: Tue Sep 16 14:00:10 2008 +0300 + + Document DBus error codes and messages. + + introspection/Makefile.am | 6 +- + introspection/all.xml | 5 + + introspection/mm-mobile-error.xml | 318 + +++++++++++++++++++++++++++++++ + introspection/mm-modem-connect-error.xml | 30 +++ + introspection/mm-modem-error.xml | 18 ++ + introspection/mm-serial-error.xml | 24 +++ + src/mm-errors.c | 112 +++++------ + src/mm-errors.h | 2 +- + src/mm-manager.c | 1 - + 9 files changed, 457 insertions(+), 59 deletions(-) + +commit da3bbdc893b43c52dec20216945a572632c56806 +Author: Tambet Ingo +Date: Tue Sep 16 13:03:38 2008 +0300 + + Add marshallers so that RegistrationInfo signal can be enabled. + + .gitignore | 3 ++- + Makefile.am | 2 +- + configure.in | 4 ++++ + marshallers/Makefile.am | 21 +++++++++++++++++++++ + marshallers/mm-marshal-main.c | 2 ++ + marshallers/mm-marshal.list | 1 + + src/Makefile.am | 4 +++- + src/mm-modem-gsm-network.c | 4 +--- + src/mm-serial.c | 2 +- + test/mm-test.py | 2 ++ + 10 files changed, 38 insertions(+), 7 deletions(-) + +commit e0c720e19c02c43c56f09be9de09cc90d46543a3 +Author: Tambet Ingo +Date: Tue Sep 16 12:42:14 2008 +0300 + + Fix the loadable module name checking. + + src/mm-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f1acf5aaec1d2ca79858a4e472b458f43a1caead +Author: Tambet Ingo +Date: Tue Sep 16 12:18:19 2008 +0300 + + Disconnect modem if it's connected while disabling. + + src/mm-generic-gsm.c | 30 ++++++++++++++++++++---------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +commit 8e1cabbefce757c071544d878f4a060a080ed25d +Author: Tambet Ingo +Date: Mon Sep 15 17:20:00 2008 +0300 + + Make sure the device is enabled before trying to send commands to it. + + src/mm-serial.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f570e1517dcf293583614d671b6dd7aae93f028f +Author: Tambet Ingo +Date: Mon Sep 15 17:08:46 2008 +0300 + + Implement PIN changing and enabling/disabling. + + introspection/mm-modem-gsm-card.xml | 2 +- + src/mm-generic-gsm.c | 60 + +++++++++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+), 1 deletion(-) + +commit 1455c424c2a5b2fcb61163b2feb3a2aadc0bfad0 +Author: Tambet Ingo +Date: Mon Sep 15 13:07:03 2008 +0300 + + Implement smarter APN choosing. + + If the APN chosen by user is already configured in card, use + that. If not, + find the highest used CID, the allowed range of CIDs and add new + (or overwrite + the highest one). + + src/mm-generic-gsm.c | 157 + ++++++++++++++++++++++++++++++++++++++++++++++++--- + src/mm-generic-gsm.h | 3 + + 2 files changed, 153 insertions(+), 7 deletions(-) + +commit b4176325e5c51bc920366e4475c3c75bf1bc3757 +Author: Tambet Ingo +Date: Fri Sep 12 17:05:43 2008 +0300 + + Update the patches for NetworkManager and nm-applet. + + Implement modem properties dialog for the applet which shows all + sorts of + information about the modem, allows to scan for visible networks + and create + NMConnections based on scan results. + + ...=> NetworkManager-r4060-use-modem-manager.patch | 112 +- + nm-applet-r874-use-modem-manager.patch | 427 ------ + nm-applet-r884-use-modem-manager.patch | 1524 + ++++++++++++++++++++ + 3 files changed, 1620 insertions(+), 443 deletions(-) + +commit 567278d19dc95880d1091794fd9fa0c3f77fb99d +Author: Tambet Ingo +Date: Thu Sep 11 16:55:44 2008 +0300 + + Make sure the response buffer doesn't grow without bounds. + + src/mm-serial.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 675964a6b278d5fcbef19b3518e519dfd2e544de +Author: Tambet Ingo +Date: Thu Sep 11 16:37:01 2008 +0300 + + Fix device added and removed signals. + + The device argument was a MMModem object, which conflicted with + the spec. + Changed it to the modem's udi. + + src/mm-manager.c | 22 ++++++++++------------ + src/mm-manager.h | 4 ++-- + 2 files changed, 12 insertions(+), 14 deletions(-) + +commit e0b3d478b42654a338d9d9b7f271ef1a96d73af9 +Author: Tambet Ingo +Date: Thu Sep 11 16:36:41 2008 +0300 + + Fix the typos. + + src/mm-errors.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 37b716de8aa06833c1bea1066111f6268e08d440 +Author: Tambet Ingo +Date: Thu Sep 11 15:12:07 2008 +0300 + + Fix error codes. + + src/mm-errors.c | 225 + +++++++++++++++++++++++++++++++++++------------- + src/mm-errors.h | 10 ++- + src/mm-generic-gsm.c | 7 +- + src/mm-manager.c | 2 +- + src/mm-serial-parsers.c | 45 ++++------ + src/mm-serial.c | 8 +- + 6 files changed, 196 insertions(+), 101 deletions(-) + +commit 29387c24b08f4fb3d9d265a3f054ca78a90be54f +Author: Tambet Ingo +Date: Thu Sep 11 11:41:36 2008 +0300 + + Fix a bug where the serial command queue sent the same command + multiple times. + + src/mm-generic-gsm.c | 1 - + src/mm-serial.c | 24 ++++++++++++++++++++++-- + 2 files changed, 22 insertions(+), 3 deletions(-) + +commit 55bc5300db97295ed2ac23b0c82f7132435b6604 +Author: Tambet Ingo +Date: Thu Sep 11 11:22:04 2008 +0300 + + Cache signal quality after successful registration. + + If trying to get signal quality when connected, use the cached value. + + src/mm-generic-gsm.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +commit 40e4d2fed0bdaeb7602a9b18ac74c116d4b18fc7 +Author: Tambet Ingo +Date: Thu Sep 11 11:21:04 2008 +0300 + + Don't try to send commands to the serial device if it's connected. + + Implement mm_serial_is_connected() function and call it before trying + to write + anything to the serial port. + + src/mm-serial.c | 40 +++++++++++++++++++++++++++++++--------- + src/mm-serial.h | 1 + + 2 files changed, 32 insertions(+), 9 deletions(-) + +commit ac4409e7cea29e03d311e6b805a084837d8bb70f +Author: Tambet Ingo +Date: Thu Sep 11 08:35:32 2008 +0300 + + Rewrite serial device communications. + + Instead of vague "send something, wait something" the responses + are now + analyzed by (overridable) parsers. Makes all the modem implementations + much + easier since each caller knows without any code whether the call + succeeded + or failed. + + Another thing that makes modem code simpler (and the whole thing + more robust), + is the queueing of sent commands. Each queued command has a command + and a + callback which is quaranteed to get called, even if sending failed. + + Define and implement error reporting. + + plugins/mm-modem-hso.c | 80 ++--- + plugins/mm-modem-huawei.c | 354 ++++++++++------------ + src/Makefile.am | 10 +- + src/main.c | 23 +- + src/mm-callback-info.c | 16 +- + src/mm-callback-info.h | 2 - + src/mm-errors.c | 175 +++++++++++ + src/mm-errors.h | 110 +++++++ + src/mm-generic-cdma.c | 118 ++------ + src/mm-generic-gsm.c | 737 + +++++++++++++++++---------------------------- + src/mm-manager.c | 8 +- + src/mm-modem-cdma.c | 2 +- + src/mm-modem-error.c | 37 --- + src/mm-modem-error.h | 22 -- + src/mm-modem-gsm-card.c | 2 +- + src/mm-modem-gsm-network.c | 2 +- + src/mm-modem.c | 2 +- + src/mm-options.c | 36 +++ + src/mm-options.h | 9 + + src/mm-serial-parsers.c | 266 ++++++++++++++++ + src/mm-serial-parsers.h | 26 ++ + src/mm-serial.c | 708 + ++++++++++++++----------------------------- + src/mm-serial.h | 91 +++--- + 23 files changed, 1401 insertions(+), 1435 deletions(-) + +commit bb874acea0c8552f86932084e222b45a94119f29 +Author: Tambet Ingo +Date: Tue Sep 2 09:51:23 2008 +0300 + + Update the NetworkManager and nm-applet patches. + + ...=> NetworkManager-r4027-use-modem-manager.patch | 501 + +++++++++++++++++++-- + ...patch => nm-applet-r874-use-modem-manager.patch | 12 +- + 2 files changed, 466 insertions(+), 47 deletions(-) + +commit 9c9de2d6261c145fc24c1c855b3e122ee6eedab9 +Author: Tambet Ingo +Date: Mon Sep 1 18:54:28 2008 +0300 + + License ModemManager with GNU Lesser General Public License, + version 2.1. + + COPYING | 505 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 504 insertions(+), 1 deletion(-) + +commit ebd99af6a0b463e3e681bded03e39e7ea6b0afcc +Author: Tambet Ingo +Date: Mon Sep 1 18:51:48 2008 +0300 + + Disable the HSO modem in addition to just closing the device on + Enable(False). + + plugins/mm-modem-hso.c | 46 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +commit c56d5a257b35a8f1072a250df68437cf4ec50bf9 +Author: Tambet Ingo +Date: Mon Sep 1 16:01:55 2008 +0300 + + Handle reading failure replies correctly everywhere. + + plugins/mm-modem-huawei.c | 2 +- + src/mm-generic-gsm.c | 10 +++++++--- + 2 files changed, 8 insertions(+), 4 deletions(-) + +commit 1bb60347b503e1aaf043548b853f19156a31b5e4 +Author: Tambet Ingo +Date: Mon Sep 1 15:45:55 2008 +0300 + + Implement reading IMEI, IMSI, manufacturer, model, and version + (revision). + + plugins/mm-modem-huawei.c | 28 ++++---- + src/mm-callback-info.c | 91 +++++++++++++++--------- + src/mm-callback-info.h | 22 ++++-- + src/mm-generic-cdma.c | 2 +- + src/mm-generic-gsm.c | 172 + ++++++++++++++++++++++++++++++++++++++++++---- + 5 files changed, 251 insertions(+), 64 deletions(-) + +commit 209a6390cb5a3aaa3aeee4c8e6a23a59e705316c +Author: Tambet Ingo +Date: Mon Sep 1 11:27:35 2008 +0300 + + Fix up HSO modem plugin. + + introspection/Makefile.am | 2 +- + introspection/all.xml | 1 + + .../{mm-gsm-modem-hso.xml => mm-modem-gsm-hso.xml} | 29 ++- + plugins/Makefile.am | 8 +- + plugins/mm-modem-hso.c | 248 + +++++++++------------ + 5 files changed, 126 insertions(+), 162 deletions(-) + +commit 2087ca49b6a162462e0006b01089ecf8ff0dc8e0 +Author: Tambet Ingo +Date: Fri Aug 29 18:09:23 2008 +0300 + + Fix another upper case inconsistency in the public API (SetApn). + + NetworkManager-r4012-use-modem-manager.patch | 2 +- + introspection/mm-modem-gsm-network.xml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c71ae54f887fb337eab7d7822cd2d8654b085744 +Author: Tambet Ingo +Date: Fri Aug 29 14:29:26 2008 +0300 + + Include the missing mm-gsm-modem-hso.xml to EXTRA_DIST. + + introspection/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 3d9fc420d259a66880ad29987af31d1036185cab +Author: Tambet Ingo +Date: Fri Aug 29 13:13:00 2008 +0300 + + Update the NetworkManager and nm-applet patches. + + Update the NetworkManager and nm-applet patches to work with the + DBus API reorganization. + + NetworkManager-r4012-use-modem-manager.patch | 499 + +++++++++------------------ + nm-applet-r866-use-modem-manager.patch | 4 +- + 2 files changed, 161 insertions(+), 342 deletions(-) + +commit 424f514b02494e62097d0a15fb17be4b7e92262f +Author: Tambet Ingo +Date: Fri Aug 29 11:43:36 2008 +0300 + + Implement the more granular GSM interfaces as agreed on NM mailing + list. + + Convert all exisiting code over to new DBus interfaces. + + introspection/Makefile.am | 9 +- + introspection/all.xml | 8 +- + .../{mm-cdma-modem.xml => mm-modem-cdma.xml} | 2 +- + introspection/mm-modem-gsm-card.xml | 104 +++++ + introspection/mm-modem-gsm-contacts.xml | 114 +++++ + .../{mm-gsm-modem.xml => mm-modem-gsm-network.xml} | 77 ++-- + introspection/mm-modem-gsm-sms.xml | 98 ++++ + plugins/mm-modem-hso.c | 18 +- + plugins/mm-modem-huawei.c | 86 ++-- + src/Makefile.am | 29 +- + src/mm-cdma-modem.h | 39 -- + src/mm-generic-cdma.c | 12 +- + src/mm-generic-gsm.c | 127 +++--- + src/mm-generic-gsm.h | 4 +- + src/mm-gsm-modem.c | 470 + ------------------- + src/mm-gsm-modem.h | 186 -------- + src/{mm-cdma-modem.c => mm-modem-cdma.c} | 36 +- + src/mm-modem-cdma.h | 39 ++ + src/mm-modem-gsm-card.c | 319 +++++++++++++ + src/mm-modem-gsm-card.h | 87 ++++ + src/mm-modem-gsm-network.c | 507 + +++++++++++++++++++++ + src/mm-modem-gsm-network.h | 178 ++++++++ + src/mm-modem.h | 5 + + 23 files changed, 1664 insertions(+), 890 deletions(-) + +commit 2d00b7534137f6fa6ccf9b951efff699fcf75044 +Author: Tambet Ingo +Date: Thu Aug 28 10:52:00 2008 +0300 + + Make the timeout handling simpler in the NMSerial class. + + src/mm-serial.c | 54 + +++++++----------------------------------------------- + 1 file changed, 7 insertions(+), 47 deletions(-) + +commit 9d5b29203e7589cb4e36d0548a9df3737c9cbbbe +Author: Tambet Ingo +Date: Tue Aug 26 15:08:57 2008 +0300 + + Update the NetworkManager and nm-applet patches. + + ...patch => NetworkManager-r4012-use-modem-manager.patch | 16 + ++++++++-------- + ...nager.patch => nm-applet-r866-use-modem-manager.patch | 0 + 2 files changed, 8 insertions(+), 8 deletions(-) + +commit 64b4827c4c2e6fbb68682d249cfb642650789e81 +Author: Tambet Ingo +Date: Tue Aug 26 14:40:20 2008 +0300 + + Implement HSO modem driver. + + introspection/Makefile.am | 1 + + introspection/all.xml | 1 + + introspection/mm-gsm-modem-hso.xml | 41 +++ + plugins/Makefile.am | 30 ++- + plugins/mm-modem-hso.c | 500 + +++++++++++++++++++++++++++++++++++++ + plugins/mm-modem-hso.h | 49 ++++ + plugins/mm-plugin-hso.c | 183 ++++++++++++++ + plugins/mm-plugin-hso.h | 26 ++ + src/mm-generic-gsm.c | 18 +- + src/mm-gsm-modem.c | 14 ++ + src/mm-gsm-modem.h | 8 + + 11 files changed, 862 insertions(+), 9 deletions(-) + +commit fc992ce8abe8e7c8b07b5a0645348073af0cc708 +Author: Tambet Ingo +Date: Fri Aug 22 14:54:42 2008 +0300 + + Add a patch for the current nm-applet to make it use ModemManager. + + nm-applet-r861-use-modem-manager.patch | 427 + +++++++++++++++++++++++++++++++++ + 1 file changed, 427 insertions(+) + +commit 36b1ba72d4180e8bf5e2ffef51af23efdc6f8530 +Author: Tambet Ingo +Date: Fri Aug 22 14:50:02 2008 +0300 + + Grab the registration information right after a successful + registration. + + The registration information is stored now because in the generic + case, it + is not possible to issue AT commands when the device is connected. + + src/mm-generic-gsm.c | 297 + +++++++++++++++++++++++++++++---------------------- + src/mm-generic-gsm.h | 8 +- + src/mm-gsm-modem.c | 2 +- + src/mm-gsm-modem.h | 4 +- + 4 files changed, 181 insertions(+), 130 deletions(-) + +commit 91ac2260b75236f87f3c4d9b101656acef27c311 +Author: Tambet Ingo +Date: Fri Aug 22 14:49:12 2008 +0300 + + Remove the pkg-config file, we're not a library. + + Makefile.am | 5 ----- + ModemManager.pc.in | 12 ------------ + configure.in | 1 - + 3 files changed, 18 deletions(-) + +commit d6be2af93f3b5f7dde9761b8533ce187c30377b3 +Author: Tambet Ingo +Date: Thu Aug 21 17:18:38 2008 +0300 + + Implement registration information retrieving for GSM modems. + + introspection/mm-gsm-modem.xml | 56 ++++++++++ + src/mm-generic-gsm.c | 226 + ++++++++++++++++++++++++++++++++++++----- + src/mm-gsm-modem.c | 60 +++++++++++ + src/mm-gsm-modem.h | 24 +++++ + 4 files changed, 341 insertions(+), 25 deletions(-) + +commit 9afafdf46dbd9ded0df4f99505ed5107242b4883 +Author: Tambet Ingo +Date: Thu Aug 21 09:48:11 2008 +0300 + + Add a patch to make the latest NetworkManager use ModemManager. + + NetworkManager-r3989-use-modem-manager.patch | 4835 + ++++++++++++++++++++++++++ + 1 file changed, 4835 insertions(+) + +commit 149b41f2205948a8446bf2d9f8c8b7b9dfa0e1d1 +Author: Tambet Ingo +Date: Thu Aug 21 09:11:17 2008 +0300 + + Implement per modem type DBus interfaces. + + A major code reorganization. + + introspection/Makefile.am | 5 +- + introspection/all.xml | 2 + + introspection/mm-cdma-modem.xml | 31 ++++ + introspection/mm-gsm-modem.xml | 243 ++++++++++++++++++++++++ + introspection/mm-modem.xml | 232 +---------------------- + plugins/mm-modem-huawei.c | 252 ++++++++++++++----------- + src/Makefile.am | 12 ++ + src/mm-cdma-modem.c | 128 +++++++++++++ + src/mm-cdma-modem.h | 39 ++++ + src/mm-generic-cdma.c | 102 ++++++++++- + src/mm-generic-gsm.c | 224 +++++++++++++---------- + src/mm-generic-gsm.h | 2 + + src/mm-gsm-modem.c | 396 + ++++++++++++++++++++++++++++++++++++++++ + src/mm-gsm-modem.h | 154 ++++++++++++++++ + src/mm-manager.c | 35 ++-- + src/mm-modem.c | 296 +----------------------------- + src/mm-modem.h | 122 ------------- + 17 files changed, 1405 insertions(+), 870 deletions(-) + +commit 751a9f8273a063b7d5bb99093ed4583b34614643 +Author: Tambet Ingo +Date: Wed Aug 13 10:05:45 2008 +0300 + + Fix a typo. + + introspection/mm-modem.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a93f08429c142e1be5b1a4b0454d6a6051a7af3c +Author: Tambet Ingo +Date: Wed Aug 13 10:05:31 2008 +0300 + + Fix distcheck. + + configure.in | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit be059f7a73fceda95bf5504634ed03b5de085ab2 +Author: Tambet Ingo +Date: Thu Jul 31 17:14:50 2008 +0300 + + Document the public DBus API. + + .gitignore | 1 + + Makefile.am | 23 ++ + configure.in | 9 + + doc-generator.xsl | 691 + +++++++++++++++++++++++++++++++++++++++++++ + docs/plugins.txt | 0 + introspection/all.xml | 27 ++ + introspection/mm-manager.xml | 29 +- + introspection/mm-modem.xml | 250 ++++++++++++++-- + 8 files changed, 1009 insertions(+), 21 deletions(-) + +commit 135fad9e6ddbdd3819ae9332cc6b526eb960a655 +Author: Tambet Ingo +Date: Thu Jul 31 15:45:07 2008 +0300 + + Fix typos. + + README | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit cf815d39523c2f52a964a074c35b872e97d54468 +Author: Tambet Ingo +Date: Thu Jul 31 15:43:25 2008 +0300 + + Write README. + + README | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +commit c375992cc2c9a7a75f39c71aed776b214ed73d78 +Author: Tambet Ingo +Date: Thu Jul 31 15:01:01 2008 +0300 + + Enable the device before trying to operate on it. + + test/mm-test.py | 45 ++++++++++++++++++++++++++------------------- + 1 file changed, 26 insertions(+), 19 deletions(-) + +commit 710df6f66bc215d3a654d0177382c874f5e33a1a +Author: Tambet Ingo +Date: Thu Jul 31 15:00:03 2008 +0300 + + Handle Enable() method correctly when it's already been called. + + plugins/mm-modem-huawei.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +commit 911b2b69260aee6450a16d406e5c79d97255c725 +Author: Tambet Ingo +Date: Thu Jul 31 14:58:38 2008 +0300 + + Handle serial device opening when it's already open. + + src/mm-serial.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit f0a2dc606c20a65a45152127b0450ae31476adbf +Author: Tambet Ingo +Date: Thu Jul 31 14:03:37 2008 +0300 + + Add an example testing program. + + .gitignore | 1 + + Makefile.am | 2 +- + configure.in | 1 + + test/Makefile.am | 3 ++ + test/mm-test.py | 141 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 147 insertions(+), 1 deletion(-) + +commit fa9c303d98cc933f0daa35f0e2182dd63f361d90 +Author: Tambet Ingo +Date: Thu Jul 31 12:24:12 2008 +0300 + + Merge fixes from NetworkManager SVN. + + src/mm-generic-gsm.c | 16 ++++++++++------ + src/mm-serial.c | 2 +- + 2 files changed, 11 insertions(+), 7 deletions(-) + +commit c7e8eacb1c7a974466729bec3726395e31d62c73 +Author: Tambet Ingo +Date: Thu Jul 31 09:49:25 2008 +0300 + + Add .gitignore. + + .gitignore | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +commit cc31458b18e8c274641cf124f5bf7ec6fe506dfb +Author: Tambet Ingo +Date: Thu Jul 31 09:43:00 2008 +0300 + + Initial commit. + + AUTHORS | 2 + + COPYING | 1 + + ChangeLog | 0 + Makefile.am | 30 + + ModemManager.pc.in | 12 + + NEWS | 0 + README | 0 + autogen.sh | 20 + + configure.in | 24 + + introspection/Makefile.am | 4 + + introspection/mm-manager.xml | 19 + + introspection/mm-modem.xml | 85 +++ + org.freedesktop.ModemManager.conf | 19 + + org.freedesktop.ModemManager.service.in | 4 + + plugins/Makefile.am | 14 + + plugins/mm-modem-huawei.c | 556 +++++++++++++++ + plugins/mm-modem-huawei.h | 31 + + plugins/mm-plugin-huawei.c | 155 +++++ + plugins/mm-plugin-huawei.h | 26 + + src/Makefile.am | 39 ++ + src/main.c | 166 +++++ + src/mm-callback-info.c | 98 +++ + src/mm-callback-info.h | 38 ++ + src/mm-generic-cdma.c | 259 +++++++ + src/mm-generic-cdma.h | 29 + + src/mm-generic-gsm.c | 705 +++++++++++++++++++ + src/mm-generic-gsm.h | 29 + + src/mm-manager.c | 457 +++++++++++++ + src/mm-manager.h | 36 + + src/mm-modem-error.c | 37 + + src/mm-modem-error.h | 22 + + src/mm-modem.c | 460 +++++++++++++ + src/mm-modem.h | 196 ++++++ + src/mm-plugin.c | 81 +++ + src/mm-plugin.h | 55 ++ + src/mm-serial.c | 1117 + +++++++++++++++++++++++++++++++ + src/mm-serial.h | 85 +++ + 37 files changed, 4911 insertions(+) diff -Nru modemmanager-1.6.8/cli/Makefile.am modemmanager-1.10.0/cli/Makefile.am --- modemmanager-1.6.8/cli/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -13,8 +13,8 @@ mmcli_SOURCES = \ mmcli.h \ mmcli.c \ - mmcli-common.h \ - mmcli-common.c \ + mmcli-common.h mmcli-common.c \ + mmcli-output.h mmcli-output.c \ mmcli-manager.c \ mmcli-modem.c \ mmcli-modem-3gpp.c \ @@ -38,6 +38,11 @@ $(top_builddir)/libmm-glib/libmm-glib.la \ $(NULL) +if WITH_UDEV +mmcli_CPPFLAGS += $(GUDEV_CFLAGS) +mmcli_LDADD += $(GUDEV_LIBS) +endif + completiondir = $(datadir)/bash-completion/completions install-data-hook: diff -Nru modemmanager-1.6.8/cli/Makefile.in modemmanager-1.10.0/cli/Makefile.in --- modemmanager-1.6.8/cli/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/cli/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -89,20 +89,21 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mmcli$(EXEEXT) +@WITH_UDEV_TRUE@am__append_1 = $(GUDEV_CFLAGS) +@WITH_UDEV_TRUE@am__append_2 = $(GUDEV_LIBS) subdir = cli ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -113,8 +114,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_mmcli_OBJECTS = mmcli-mmcli.$(OBJEXT) mmcli-mmcli-common.$(OBJEXT) \ - mmcli-mmcli-manager.$(OBJEXT) mmcli-mmcli-modem.$(OBJEXT) \ - mmcli-mmcli-modem-3gpp.$(OBJEXT) \ + mmcli-mmcli-output.$(OBJEXT) mmcli-mmcli-manager.$(OBJEXT) \ + mmcli-mmcli-modem.$(OBJEXT) mmcli-mmcli-modem-3gpp.$(OBJEXT) \ mmcli-mmcli-modem-cdma.$(OBJEXT) \ mmcli-mmcli-modem-simple.$(OBJEXT) \ mmcli-mmcli-modem-location.$(OBJEXT) \ @@ -128,8 +129,9 @@ mmcli-mmcli-call.$(OBJEXT) mmcli_OBJECTS = $(am_mmcli_OBJECTS) am__DEPENDENCIES_1 = +@WITH_UDEV_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) mmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(top_builddir)/libmm-glib/libmm-glib.la + $(top_builddir)/libmm-glib/libmm-glib.la $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -148,7 +150,25 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/mmcli-mmcli-bearer.Po \ + ./$(DEPDIR)/mmcli-mmcli-call.Po \ + ./$(DEPDIR)/mmcli-mmcli-common.Po \ + ./$(DEPDIR)/mmcli-mmcli-manager.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-3gpp.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-cdma.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-firmware.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-location.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-messaging.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-oma.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-signal.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-simple.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-time.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem-voice.Po \ + ./$(DEPDIR)/mmcli-mmcli-modem.Po \ + ./$(DEPDIR)/mmcli-mmcli-output.Po \ + ./$(DEPDIR)/mmcli-mmcli-sim.Po ./$(DEPDIR)/mmcli-mmcli-sms.Po \ + ./$(DEPDIR)/mmcli-mmcli.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -197,7 +217,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -250,14 +269,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -378,8 +389,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -399,21 +408,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -mmcli_CPPFLAGS = \ - $(MMCLI_CFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ +mmcli_CPPFLAGS = $(MMCLI_CFLAGS) -I$(top_srcdir) \ + -I$(top_srcdir)/include -I$(top_builddir)/include \ -I$(top_srcdir)/libmm-glib \ -I${top_srcdir}/libmm-glib/generated \ - -I${top_builddir}/libmm-glib/generated \ - $(NULL) - + -I${top_builddir}/libmm-glib/generated $(NULL) $(am__append_1) mmcli_SOURCES = \ mmcli.h \ mmcli.c \ - mmcli-common.h \ - mmcli-common.c \ + mmcli-common.h mmcli-common.c \ + mmcli-output.h mmcli-output.c \ mmcli-manager.c \ mmcli-modem.c \ mmcli-modem-3gpp.c \ @@ -432,11 +436,8 @@ mmcli-call.c \ $(NULL) -mmcli_LDADD = \ - $(MMCLI_LIBS) \ - $(top_builddir)/libmm-glib/libmm-glib.la \ - $(NULL) - +mmcli_LDADD = $(MMCLI_LIBS) $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) $(am__append_2) completiondir = $(datadir)/bash-completion/completions EXTRA_DIST = mmcli-completion all: all-am @@ -460,8 +461,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,24 +533,31 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-bearer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-call.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-manager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-3gpp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-cdma.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-firmware.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-location.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-messaging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-oma.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-simple.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-voice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-sim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-sms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-bearer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-call.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-common.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-manager.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-3gpp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-cdma.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-firmware.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-location.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-messaging.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-oma.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem-voice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-modem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-output.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-sim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli-sms.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcli-mmcli.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -603,6 +611,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmcli-mmcli-common.obj `if test -f 'mmcli-common.c'; then $(CYGPATH_W) 'mmcli-common.c'; else $(CYGPATH_W) '$(srcdir)/mmcli-common.c'; fi` +mmcli-mmcli-output.o: mmcli-output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmcli-mmcli-output.o -MD -MP -MF $(DEPDIR)/mmcli-mmcli-output.Tpo -c -o mmcli-mmcli-output.o `test -f 'mmcli-output.c' || echo '$(srcdir)/'`mmcli-output.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmcli-mmcli-output.Tpo $(DEPDIR)/mmcli-mmcli-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmcli-output.c' object='mmcli-mmcli-output.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmcli-mmcli-output.o `test -f 'mmcli-output.c' || echo '$(srcdir)/'`mmcli-output.c + +mmcli-mmcli-output.obj: mmcli-output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmcli-mmcli-output.obj -MD -MP -MF $(DEPDIR)/mmcli-mmcli-output.Tpo -c -o mmcli-mmcli-output.obj `if test -f 'mmcli-output.c'; then $(CYGPATH_W) 'mmcli-output.c'; else $(CYGPATH_W) '$(srcdir)/mmcli-output.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmcli-mmcli-output.Tpo $(DEPDIR)/mmcli-mmcli-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmcli-output.c' object='mmcli-mmcli-output.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmcli-mmcli-output.obj `if test -f 'mmcli-output.c'; then $(CYGPATH_W) 'mmcli-output.c'; else $(CYGPATH_W) '$(srcdir)/mmcli-output.c'; fi` + mmcli-mmcli-manager.o: mmcli-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmcli-mmcli-manager.o -MD -MP -MF $(DEPDIR)/mmcli-mmcli-manager.Tpo -c -o mmcli-mmcli-manager.o `test -f 'mmcli-manager.c' || echo '$(srcdir)/'`mmcli-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmcli-mmcli-manager.Tpo $(DEPDIR)/mmcli-mmcli-manager.Po @@ -885,7 +907,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -957,7 +982,25 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/mmcli-mmcli-bearer.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-call.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-common.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-manager.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-3gpp.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-cdma.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-firmware.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-location.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-messaging.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-oma.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-signal.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-simple.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-time.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-voice.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-output.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-sim.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-sms.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1004,7 +1047,25 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/mmcli-mmcli-bearer.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-call.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-common.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-manager.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-3gpp.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-cdma.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-firmware.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-location.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-messaging.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-oma.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-signal.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-simple.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-time.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem-voice.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-modem.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-output.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-sim.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli-sms.Po + -rm -f ./$(DEPDIR)/mmcli-mmcli.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1026,7 +1087,7 @@ $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ diff -Nru modemmanager-1.6.8/cli/mmcli-bearer.c modemmanager-1.10.0/cli/mmcli-bearer.c --- modemmanager-1.6.8/cli/mmcli-bearer.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-bearer.c 2019-01-15 15:57:35.000000000 +0100 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2011-2018 Aleksander Morgado */ #include "config.h" @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -132,148 +133,143 @@ static void print_bearer_info (MMBearer *bearer) { - MMBearerIpConfig *ipv4_config; - MMBearerIpConfig *ipv6_config; + MMBearerIpConfig *ipv4_config; + MMBearerIpConfig *ipv6_config; MMBearerProperties *properties; - MMBearerStats *stats; + MMBearerStats *stats; ipv4_config = mm_bearer_get_ipv4_config (bearer); ipv6_config = mm_bearer_get_ipv6_config (bearer); - properties = mm_bearer_get_properties (bearer); - stats = mm_bearer_get_stats (bearer); + properties = mm_bearer_get_properties (bearer); + stats = mm_bearer_get_stats (bearer); - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE_UNKNOWN -#define VALIDATE_UNKNOWN(str) (str ? str : "unknown") -#undef VALIDATE_NONE -#define VALIDATE_NONE(str) (str ? str : "none") - - g_print ("Bearer '%s'\n", - mm_bearer_get_path (bearer)); - g_print (" -------------------------\n" - " Status | connected: '%s'\n" - " | suspended: '%s'\n" - " | interface: '%s'\n" - " | IP timeout: '%u'\n", - mm_bearer_get_connected (bearer) ? "yes" : "no", - mm_bearer_get_suspended (bearer) ? "yes" : "no", - VALIDATE_UNKNOWN (mm_bearer_get_interface (bearer)), - mm_bearer_get_ip_timeout (bearer)); - - if (properties) { - gchar *ip_family_str; - - ip_family_str = (mm_bearer_ip_family_build_string_from_mask ( - mm_bearer_properties_get_ip_type (properties))); - g_print (" -------------------------\n" - " Properties | apn: '%s'\n" - " | roaming: '%s'\n" - " | IP type: '%s'\n" - " | user: '%s'\n" - " | password: '%s'\n" - " | number: '%s'\n" - " | Rm protocol: '%s'\n", - VALIDATE_NONE (mm_bearer_properties_get_apn (properties)), - mm_bearer_properties_get_allow_roaming (properties) ? "allowed" : "forbidden", - VALIDATE_UNKNOWN (ip_family_str), - VALIDATE_NONE (mm_bearer_properties_get_user (properties)), - VALIDATE_NONE (mm_bearer_properties_get_password (properties)), - VALIDATE_NONE (mm_bearer_properties_get_number (properties)), - VALIDATE_UNKNOWN (mm_modem_cdma_rm_protocol_get_string ( - mm_bearer_properties_get_rm_protocol (properties)))); - g_free (ip_family_str); - } + mmcli_output_string (MMC_F_BEARER_GENERAL_DBUS_PATH, mm_bearer_get_path (bearer)); + mmcli_output_string (MMC_F_BEARER_GENERAL_TYPE, mm_bearer_type_get_string (mm_bearer_get_bearer_type (bearer))); - /* IPv4 */ - g_print (" -------------------------\n" - " IPv4 configuration | method: '%s'\n", - (ipv4_config ? - mm_bearer_ip_method_get_string (mm_bearer_ip_config_get_method (ipv4_config)) : - "none")); - if (ipv4_config && - mm_bearer_ip_config_get_method (ipv4_config) != MM_BEARER_IP_METHOD_UNKNOWN) { - const gchar **dns = mm_bearer_ip_config_get_dns (ipv4_config); - guint i, mtu; - - g_print (" | address: '%s'\n" - " | prefix: '%u'\n" - " | gateway: '%s'\n", - VALIDATE_UNKNOWN (mm_bearer_ip_config_get_address (ipv4_config)), - mm_bearer_ip_config_get_prefix (ipv4_config), - VALIDATE_UNKNOWN (mm_bearer_ip_config_get_gateway (ipv4_config))); - - if (dns && dns[0]) { - g_print ( - " | DNS: '%s'", dns[0]); - /* Additional DNS addresses */ - for (i = 1; dns[i]; i++) - g_print (", '%s'", dns[i]); - } else { - g_print ( - " | DNS: none"); + mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no"); + mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (bearer) ? "yes" : "no"); + mmcli_output_string (MMC_F_BEARER_STATUS_INTERFACE, mm_bearer_get_interface (bearer)); + mmcli_output_string_take (MMC_F_BEARER_STATUS_IP_TIMEOUT, g_strdup_printf ("%u", mm_bearer_get_ip_timeout (bearer))); + + /* Properties */ + { + const gchar *apn = NULL; + const gchar *roaming = NULL; + gchar *ip_family_str = NULL; + const gchar *user = NULL; + const gchar *password = NULL; + const gchar *rm_protocol = NULL; + + if (properties) { + apn = mm_bearer_properties_get_apn (properties); + ip_family_str = (properties ? mm_bearer_ip_family_build_string_from_mask (mm_bearer_properties_get_ip_type (properties)) : NULL); + user = mm_bearer_properties_get_user (properties); + password = mm_bearer_properties_get_password (properties); + if (mm_bearer_get_bearer_type (bearer) != MM_BEARER_TYPE_DEFAULT_ATTACH) { + roaming = mm_bearer_properties_get_allow_roaming (properties) ? "allowed" : "forbidden"; + rm_protocol = mm_modem_cdma_rm_protocol_get_string (mm_bearer_properties_get_rm_protocol (properties)); + } } - g_print ("\n"); - mtu = mm_bearer_ip_config_get_mtu (ipv4_config); - if (mtu) - g_print (" | MTU: '%u'\n", mtu); + mmcli_output_string (MMC_F_BEARER_PROPERTIES_APN, apn); + mmcli_output_string (MMC_F_BEARER_PROPERTIES_ROAMING, roaming); + mmcli_output_string_take (MMC_F_BEARER_PROPERTIES_IP_TYPE, ip_family_str); + mmcli_output_string (MMC_F_BEARER_PROPERTIES_USER, user); + mmcli_output_string (MMC_F_BEARER_PROPERTIES_PASSWORD, password); + mmcli_output_string (MMC_F_BEARER_PROPERTIES_RM_PROTOCOL, rm_protocol); } - /* IPv6 */ - g_print (" -------------------------\n" - " IPv6 configuration | method: '%s'\n", - (ipv6_config ? - mm_bearer_ip_method_get_string (mm_bearer_ip_config_get_method (ipv6_config)) : - "none")); - if (ipv6_config && - mm_bearer_ip_config_get_method (ipv6_config) != MM_BEARER_IP_METHOD_UNKNOWN) { - const gchar **dns = mm_bearer_ip_config_get_dns (ipv6_config); - guint i, mtu; - - g_print (" | address: '%s'\n" - " | prefix: '%u'\n" - " | gateway: '%s'\n", - VALIDATE_UNKNOWN(mm_bearer_ip_config_get_address (ipv6_config)), - mm_bearer_ip_config_get_prefix (ipv6_config), - VALIDATE_UNKNOWN(mm_bearer_ip_config_get_gateway (ipv6_config))); - - if (dns && dns[0]) { - g_print ( - " | DNS: '%s'", dns[0]); - /* Additional DNS addresses */ - for (i = 1; dns[i]; i++) - g_print (", '%s'", dns[i]); - } else { - g_print ( - " | DNS: none"); + /* IPv4 config */ + { + const gchar *method = NULL; + const gchar *address = NULL; + gchar *prefix = NULL; + const gchar *gateway = NULL; + const gchar **dns = NULL; + gchar *mtu = NULL; + + if (ipv4_config) { + method = mm_bearer_ip_method_get_string (mm_bearer_ip_config_get_method (ipv4_config)); + if (mm_bearer_ip_config_get_method (ipv4_config) != MM_BEARER_IP_METHOD_UNKNOWN) { + guint mtu_n; + + address = mm_bearer_ip_config_get_address (ipv4_config); + prefix = g_strdup_printf ("%u", mm_bearer_ip_config_get_prefix (ipv4_config)); + gateway = mm_bearer_ip_config_get_gateway (ipv4_config); + dns = mm_bearer_ip_config_get_dns (ipv4_config); + mtu_n = mm_bearer_ip_config_get_mtu (ipv4_config); + if (mtu_n) + mtu = g_strdup_printf ("%u", mtu_n); + } } - g_print ("\n"); - mtu = mm_bearer_ip_config_get_mtu (ipv6_config); - if (mtu) - g_print (" | MTU: '%u'\n", mtu); + mmcli_output_string (MMC_F_BEARER_IPV4_CONFIG_METHOD, method); + mmcli_output_string (MMC_F_BEARER_IPV4_CONFIG_ADDRESS, address); + mmcli_output_string_take (MMC_F_BEARER_IPV4_CONFIG_PREFIX, prefix); + mmcli_output_string (MMC_F_BEARER_IPV4_CONFIG_GATEWAY, gateway); + mmcli_output_string_array (MMC_F_BEARER_IPV4_CONFIG_DNS, dns, FALSE); + mmcli_output_string_take (MMC_F_BEARER_IPV4_CONFIG_MTU, mtu); } - if (stats) { - guint64 val; + /* IPv6 config */ + { + const gchar *method = NULL; + const gchar *address = NULL; + gchar *prefix = NULL; + const gchar *gateway = NULL; + const gchar **dns = NULL; + gchar *mtu = NULL; + + if (ipv6_config) { + method = mm_bearer_ip_method_get_string (mm_bearer_ip_config_get_method (ipv6_config)); + if (mm_bearer_ip_config_get_method (ipv6_config) != MM_BEARER_IP_METHOD_UNKNOWN) { + guint mtu_n; + + address = mm_bearer_ip_config_get_address (ipv6_config); + prefix = g_strdup_printf ("%u", mm_bearer_ip_config_get_prefix (ipv6_config)); + gateway = mm_bearer_ip_config_get_gateway (ipv6_config); + dns = mm_bearer_ip_config_get_dns (ipv6_config); + mtu_n = mm_bearer_ip_config_get_mtu (ipv6_config); + if (mtu_n) + mtu = g_strdup_printf ("%u", mtu_n); + } + } + + mmcli_output_string (MMC_F_BEARER_IPV6_CONFIG_METHOD, method); + mmcli_output_string (MMC_F_BEARER_IPV6_CONFIG_ADDRESS, address); + mmcli_output_string_take (MMC_F_BEARER_IPV6_CONFIG_PREFIX, prefix); + mmcli_output_string (MMC_F_BEARER_IPV6_CONFIG_GATEWAY, gateway); + mmcli_output_string_array (MMC_F_BEARER_IPV6_CONFIG_DNS, dns, FALSE); + mmcli_output_string_take (MMC_F_BEARER_IPV6_CONFIG_MTU, mtu); + } - g_print (" -------------------------\n" - " Stats | Duration: '%u'\n", mm_bearer_stats_get_duration (stats)); + /* Stats */ + { + gchar *duration = NULL; + gchar *bytes_rx = NULL; + gchar *bytes_tx = NULL; + + if (stats) { + guint64 val; + + val = mm_bearer_stats_get_duration (stats); + if (val) + duration = g_strdup_printf ("%" G_GUINT64_FORMAT, val); + val = mm_bearer_stats_get_rx_bytes (stats); + if (val) + bytes_rx = g_strdup_printf ("%" G_GUINT64_FORMAT, val); + val = mm_bearer_stats_get_tx_bytes (stats); + if (val) + bytes_tx = g_strdup_printf ("%" G_GUINT64_FORMAT, val); + } - val = mm_bearer_stats_get_rx_bytes (stats); - if (val > 0) - g_print (" | Bytes received: '%" G_GUINT64_FORMAT "'\n", val); - else - g_print (" | Bytes received: 'N/A'\n"); - - val = mm_bearer_stats_get_tx_bytes (stats); - if (val > 0) - g_print (" | Bytes transmitted: '%" G_GUINT64_FORMAT "'\n", val); - else - g_print (" | Bytes transmitted: 'N/A'\n"); + mmcli_output_string_take (MMC_F_BEARER_STATS_DURATION, duration); + mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_RX, bytes_rx); + mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_TX, bytes_tx); } + mmcli_output_dump (); + g_clear_object (&stats); g_clear_object (&properties); g_clear_object (&ipv4_config); diff -Nru modemmanager-1.6.8/cli/mmcli.c modemmanager-1.10.0/cli/mmcli.c --- modemmanager-1.6.8/cli/mmcli.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" #define PROGRAM_NAME "mmcli" #define PROGRAM_VERSION PACKAGE_VERSION @@ -43,12 +44,17 @@ static GCancellable *cancellable; /* Context */ +static gboolean output_keyvalue_flag; static gboolean verbose_flag; static gboolean version_flag; static gboolean async_flag; static gint timeout = 30; /* by default, use 30s for all operations */ static GOptionEntry main_entries[] = { + { "output-keyvalue", 'K', 0, G_OPTION_ARG_NONE, &output_keyvalue_flag, + "Run action with machine-friendly key-value output", + NULL + }, { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_flag, "Run action with verbose logs", NULL @@ -132,7 +138,7 @@ { g_print ("\n" PROGRAM_NAME " " PROGRAM_VERSION "\n" - "Copyright (2011 - 2016) Aleksander Morgado\n" + "Copyright (2011 - 2019) Aleksander Morgado\n" "License GPLv2+: GNU GPL version 2 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" @@ -184,8 +190,6 @@ setlocale (LC_ALL, ""); - g_type_init (); - /* Setup option context, process it and destroy it */ context = g_option_context_new ("- Control and monitor the ModemManager"); g_option_context_add_group (context, @@ -232,6 +236,16 @@ if (verbose_flag) g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK, log_handler, NULL); + /* Setup output */ + if (output_keyvalue_flag) { + if (verbose_flag) { + g_printerr ("error: cannot set verbose output in keyvalue output type\n"); + exit (EXIT_FAILURE); + } + mmcli_output_set (MMC_OUTPUT_TYPE_KEYVALUE); + } else + mmcli_output_set (MMC_OUTPUT_TYPE_HUMAN); + /* Setup signals */ signal (SIGINT, signals_handler); signal (SIGHUP, signals_handler); @@ -394,7 +408,7 @@ } else if (mmcli_modem_messaging_options_enabled ()) { mmcli_modem_messaging_shutdown (); } else if (mmcli_modem_voice_options_enabled ()) { - mmcli_modem_voice_shutdown (); + mmcli_modem_voice_shutdown (); } else if (mmcli_modem_time_options_enabled ()) { mmcli_modem_time_shutdown (); } else if (mmcli_modem_firmware_options_enabled ()) { diff -Nru modemmanager-1.6.8/cli/mmcli-call.c modemmanager-1.10.0/cli/mmcli-call.c --- modemmanager-1.6.8/cli/mmcli-call.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-call.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -145,22 +146,31 @@ static void print_call_info (MMCall *call) { - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "unknown") - - g_print ("CALL '%s'\n", mm_call_get_path (call)); - g_print (" -------------------------------\n" - " Global | number: '%s'\n", VALIDATE (mm_call_get_number (call))); - g_print (" | direction: '%s'\n", mm_call_direction_get_string (mm_call_get_direction (call)) ); - - g_print (" -------------------------------\n" - " Properties | state: '%s'\n", mm_call_state_get_string (mm_call_get_state (call))); - - if (mm_call_get_state_reason(call) != MM_CALL_STATE_REASON_UNKNOWN) - g_print (" | state reason: '%s'\n", - mm_call_state_reason_get_string(mm_call_get_state_reason (call))); + MMCallAudioFormat *audio_format; + const gchar *encoding = NULL; + const gchar *resolution = NULL; + gchar *rate = NULL; + + audio_format = mm_call_peek_audio_format (call); + + mmcli_output_string (MMC_F_CALL_GENERAL_DBUS_PATH, mm_call_get_path (call)); + mmcli_output_string (MMC_F_CALL_PROPERTIES_NUMBER, mm_call_get_number (call)); + mmcli_output_string (MMC_F_CALL_PROPERTIES_DIRECTION, mm_call_direction_get_string (mm_call_get_direction (call))); + mmcli_output_string (MMC_F_CALL_PROPERTIES_STATE, mm_call_state_get_string (mm_call_get_state (call))); + mmcli_output_string (MMC_F_CALL_PROPERTIES_STATE_REASON, mm_call_state_reason_get_string (mm_call_get_state_reason (call))); + mmcli_output_string (MMC_F_CALL_PROPERTIES_AUDIO_PORT, mm_call_get_audio_port (call)); + + if (audio_format) { + rate = g_strdup_printf ("%u", mm_call_audio_format_get_rate (audio_format)); + encoding = mm_call_audio_format_get_encoding (audio_format); + resolution = mm_call_audio_format_get_resolution (audio_format); + } + + mmcli_output_string (MMC_F_CALL_AUDIO_FORMAT_ENCODING, encoding); + mmcli_output_string (MMC_F_CALL_AUDIO_FORMAT_RESOLUTION, resolution); + mmcli_output_string_take (MMC_F_CALL_AUDIO_FORMAT_RATE, rate); + + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/cli/mmcli-common.c modemmanager-1.10.0/cli/mmcli-common.c --- modemmanager-1.6.8/cli/mmcli-common.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-common.c 2019-01-15 15:57:35.000000000 +0100 @@ -26,14 +26,23 @@ #include "mmcli-common.h" +/******************************************************************************/ +/* Manager */ + +MMManager * +mmcli_get_manager_finish (GAsyncResult *res) +{ + return g_task_propagate_pointer (G_TASK (res), NULL); +} + static void manager_new_ready (GDBusConnection *connection, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { MMManager *manager; - gchar *name_owner; - GError *error = NULL; + gchar *name_owner; + GError *error = NULL; manager = mm_manager_new_finish (res, &error); if (!manager) { @@ -51,36 +60,25 @@ g_debug ("ModemManager process found at '%s'", name_owner); g_free (name_owner); - - - g_simple_async_result_set_op_res_gpointer (simple, manager, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, manager, g_object_unref); + g_object_unref (task); } -MMManager * -mmcli_get_manager_finish (GAsyncResult *res) +void +mmcli_get_manager (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); -} + GTask *task; + + task = g_task_new (connection, cancellable, callback, user_data); -void -mmcli_get_manager (GDBusConnection *connection, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_manager); mm_manager_new (connection, G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START, cancellable, (GAsyncReadyCallback)manager_new_ready, - result); + task); } MMManager * @@ -112,27 +110,46 @@ return manager; } +/******************************************************************************/ +/* Modem */ + static MMObject * -find_modem (MMManager *manager, - const gchar *modem_path) +find_modem (MMManager *manager, + const gchar *modem_path, + const gchar *modem_uid) { GList *modems; GList *l; MMObject *found = NULL; + g_assert (modem_path || modem_uid); + g_assert (!(modem_path && modem_uid)); + modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (manager)); for (l = modems; l; l = g_list_next (l)) { - MMObject *modem = MM_OBJECT (l->data); + MMObject *obj; + MMModem *modem; - if (g_str_equal (mm_object_get_path (modem), modem_path)) { - found = g_object_ref (modem); + obj = MM_OBJECT (l->data); + modem = MM_MODEM (mm_object_get_modem (obj)); + + if (modem_path && g_str_equal (mm_object_get_path (obj), modem_path)) { + found = g_object_ref (obj); + break; + } + + if (modem_uid && g_str_equal (mm_modem_get_device (modem), modem_uid)) { + found = g_object_ref (obj); break; } } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); if (!found) { - g_printerr ("error: couldn't find modem at '%s'\n", modem_path); + if (modem_path) + g_printerr ("error: couldn't find modem at '%s'\n", modem_path); + else if (modem_uid) + g_printerr ("error: couldn't find modem identified by uid '%s'\n", modem_uid); exit (EXIT_FAILURE); } @@ -142,14 +159,13 @@ } typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; gchar *modem_path; + gchar *modem_uid; } GetModemContext; typedef struct { MMManager *manager; - MMObject *object; + MMObject *object; } GetModemResults; static void @@ -161,174 +177,202 @@ } static void -get_modem_context_complete_and_free (GetModemContext *ctx) +get_modem_context_free (GetModemContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_free (ctx->modem_path); + g_free (ctx->modem_uid); g_free (ctx); } MMObject * -mmcli_get_modem_finish (GAsyncResult *res, - MMManager **o_manager) +mmcli_get_modem_finish (GAsyncResult *res, + MMManager **o_manager) { GetModemResults *results; + MMObject *obj; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + results = g_task_propagate_pointer (G_TASK (res), NULL); + g_assert (results); if (o_manager) *o_manager = g_object_ref (results->manager); - - return g_object_ref (results->object); + obj = g_object_ref (results->object); + get_modem_results_free (results); + return obj; } static void get_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetModemContext *ctx) + GAsyncResult *res, + GTask *task) { GetModemResults *results; + GetModemContext *ctx; + + ctx = g_task_get_task_data (task); results = g_new (GetModemResults, 1); results->manager = mmcli_get_manager_finish (res); - results->object = find_modem (results->manager, ctx->modem_path); - - /* Set operation results */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - results, - (GDestroyNotify)get_modem_results_free); - - get_modem_context_complete_and_free (ctx); + results->object = find_modem (results->manager, ctx->modem_path, ctx->modem_uid); + g_task_return_pointer (task, results, (GDestroyNotify)get_modem_results_free); + g_object_unref (task); } -static gchar * -get_modem_path (const gchar *path_or_index) +static void +get_modem_path_or_uid (const gchar *str, + gchar **modem_path, + gchar **modem_uid) { - gchar *modem_path; + gboolean all_numeric; + guint i; /* We must have a given modem specified */ - if (!path_or_index) { + if (!str || !str[0]) { g_printerr ("error: no modem was specified\n"); exit (EXIT_FAILURE); } - /* Modem path may come in two ways: full DBus path or just modem index. - * If it is a modem index, we'll need to generate the DBus path ourselves */ - if (g_str_has_prefix (path_or_index, MM_DBUS_MODEM_PREFIX)) { - g_debug ("Assuming '%s' is the full modem path", path_or_index); - modem_path = g_strdup (path_or_index); - } else if (g_ascii_isdigit (path_or_index[0])) { - g_debug ("Assuming '%s' is the modem index", path_or_index); - modem_path = g_strdup_printf (MM_DBUS_MODEM_PREFIX "/%s", path_or_index); - } else { - g_printerr ("error: invalid path or index string specified: '%s'\n", - path_or_index); - exit (EXIT_FAILURE); + /* Modem path may come in three ways: + * a) full DBus path + * b) modem index + * c) uid + */ + + *modem_path = NULL; + *modem_uid = NULL; + + /* If we have DBus prefix, we have the modem DBus path */ + if (g_str_has_prefix (str, MM_DBUS_MODEM_PREFIX)) { + g_debug ("Assuming '%s' is the full modem path", str); + *modem_path = g_strdup (str); + return; } - return modem_path; + /* If all numeric, we have the modem index */ + all_numeric = TRUE; + for (i = 0; str[i]; i++) { + if (!g_ascii_isdigit (str[i])) { + all_numeric = FALSE; + break; + } + } + if (all_numeric) { + g_debug ("Assuming '%s' is the modem index", str); + *modem_path = g_strdup_printf (MM_DBUS_MODEM_PREFIX "/%s", str); + return; + } + + /* Otherwise we have the UID */ + *modem_uid = g_strdup (str); } void -mmcli_get_modem (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mmcli_get_modem (GDBusConnection *connection, + const gchar *modem_str, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; GetModemContext *ctx; + task = g_task_new (connection, cancellable, callback, user_data); + ctx = g_new0 (GetModemContext, 1); - ctx->modem_path = get_modem_path (path_or_index); - ctx->result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_modem); + get_modem_path_or_uid (modem_str, &ctx->modem_path, &ctx->modem_uid); + g_assert (ctx->modem_path || ctx->modem_uid); + g_task_set_task_data (task, ctx, (GDestroyNotify) get_modem_context_free); mmcli_get_manager (connection, cancellable, (GAsyncReadyCallback)get_manager_ready, - ctx); + task); } MMObject * -mmcli_get_modem_sync (GDBusConnection *connection, - const gchar *modem_str, - MMManager **o_manager) +mmcli_get_modem_sync (GDBusConnection *connection, + const gchar *modem_str, + MMManager **o_manager) { MMManager *manager; MMObject *found; - gchar *modem_path; + gchar *modem_path = NULL; + gchar *modem_uid = NULL; manager = mmcli_get_manager_sync (connection); - modem_path = get_modem_path (modem_str); - found = find_modem (manager, modem_path); + get_modem_path_or_uid (modem_str, &modem_path, &modem_uid); + g_assert (modem_path || modem_uid); + found = find_modem (manager, modem_path, modem_uid); if (o_manager) *o_manager = manager; else g_object_unref (manager); g_free (modem_path); + g_free (modem_uid); return found; } +/******************************************************************************/ +/* Bearer */ + typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; - gchar *bearer_path; + gchar *bearer_path; MMManager *manager; - GList *modems; - MMObject *current; - MMBearer *bearer; + GList *modems; + MMObject *current; } GetBearerContext; +typedef struct { + MMManager *manager; + MMObject *object; + MMBearer *bearer; +} GetBearerResults; + +static void +get_bearer_results_free (GetBearerResults *results) +{ + g_object_unref (results->manager); + g_object_unref (results->object); + g_object_unref (results->bearer); + g_free (results); +} + static void get_bearer_context_free (GetBearerContext *ctx) { if (ctx->current) g_object_unref (ctx->current); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); if (ctx->manager) g_object_unref (ctx->manager); - if (ctx->bearer) - g_object_unref (ctx->bearer); - g_list_free_full (ctx->modems, (GDestroyNotify) g_object_unref); + g_list_free_full (ctx->modems, g_object_unref); g_free (ctx->bearer_path); g_free (ctx); } -static void -get_bearer_context_complete (GetBearerContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - ctx->result = NULL; -} - MMBearer * -mmcli_get_bearer_finish (GAsyncResult *res, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_bearer_finish (GAsyncResult *res, + MMManager **o_manager, + MMObject **o_object) { - GetBearerContext *ctx; + GetBearerResults *results; + MMBearer *obj; - ctx = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + results = g_task_propagate_pointer (G_TASK (res), NULL); + g_assert (results); if (o_manager) - *o_manager = g_object_ref (ctx->manager); + *o_manager = g_object_ref (results->manager); if (o_object) - *o_object = g_object_ref (ctx->current); - return g_object_ref (ctx->bearer); + *o_object = g_object_ref (results->object); + obj = g_object_ref (results->bearer); + get_bearer_results_free (results); + return obj; } -static void look_for_bearer_in_modem (GetBearerContext *ctx); +static void look_for_bearer_in_modem (GTask *task); static MMBearer * -find_bearer_in_list (GList *list, +find_bearer_in_list (GList *list, const gchar *bearer_path) { GList *l; @@ -346,12 +390,17 @@ } static void -list_bearers_ready (MMModem *modem, +list_bearers_ready (MMModem *modem, GAsyncResult *res, - GetBearerContext *ctx) + GTask *task) { - GList *bearers; - GError *error = NULL; + GetBearerContext *ctx; + GetBearerResults *results; + MMBearer *found; + GList *bearers; + GError *error = NULL; + + ctx = g_task_get_task_data (task); bearers = mm_modem_list_bearers_finish (modem, res, &error); if (error) { @@ -361,27 +410,99 @@ exit (EXIT_FAILURE); } - ctx->bearer = find_bearer_in_list (bearers, ctx->bearer_path); - g_list_free_full (bearers, (GDestroyNotify) g_object_unref); + found = find_bearer_in_list (bearers, ctx->bearer_path); + g_list_free_full (bearers, g_object_unref); + + if (!found) { + /* Not found, try with next modem */ + look_for_bearer_in_modem (task); + return; + } + + /* Found! */ + results = g_new (GetBearerResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->bearer = found; + g_task_return_pointer (task, results, (GDestroyNotify) get_bearer_results_free); + g_object_unref (task); +} + +static void +look_for_bearer_in_modem_bearer_list (GTask *task) +{ + GetBearerContext *ctx; + MMModem *modem; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->current); + modem = mm_object_get_modem (ctx->current); + mm_modem_list_bearers (modem, + g_task_get_cancellable (task), + (GAsyncReadyCallback)list_bearers_ready, + task); + g_object_unref (modem); +} + +static void +get_initial_eps_bearer_ready (MMModem3gpp *modem3gpp, + GAsyncResult *res, + GTask *task) +{ + GetBearerContext *ctx; + MMBearer *bearer; + GetBearerResults *results; + + ctx = g_task_get_task_data (task); + + bearer = mm_modem_3gpp_get_initial_eps_bearer_finish (modem3gpp, res, NULL); + if (!bearer) { + look_for_bearer_in_modem_bearer_list (task); + return; + } /* Found! */ - if (ctx->bearer) { - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - ctx, - (GDestroyNotify)get_bearer_context_free); - get_bearer_context_complete (ctx); + results = g_new (GetBearerResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->bearer = bearer; + g_task_return_pointer (task, results, (GDestroyNotify) get_bearer_results_free); + g_object_unref (task); +} + +static void +look_for_bearer_in_modem_3gpp_eps_initial_bearer (GTask *task) +{ + GetBearerContext *ctx; + MMModem3gpp *modem3gpp; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->current); + modem3gpp = mm_object_get_modem_3gpp (ctx->current); + if (!modem3gpp) { + look_for_bearer_in_modem_bearer_list (task); return; } - /* Not found, try with next modem */ - look_for_bearer_in_modem (ctx); + if (!g_strcmp0 (mm_modem_3gpp_get_initial_eps_bearer_path (modem3gpp), ctx->bearer_path)) + mm_modem_3gpp_get_initial_eps_bearer (modem3gpp, + g_task_get_cancellable (task), + (GAsyncReadyCallback)get_initial_eps_bearer_ready, + task); + else + look_for_bearer_in_modem_bearer_list (task); + g_object_unref (modem3gpp); } static void -look_for_bearer_in_modem (GetBearerContext *ctx) +look_for_bearer_in_modem (GTask *task) { - MMModem *modem; + GetBearerContext *ctx; + MMModem *modem; + + ctx = g_task_get_task_data (task); if (!ctx->modems) { g_printerr ("error: couldn't find bearer at '%s': 'not found in any modem'\n", @@ -400,27 +521,26 @@ g_debug ("Skipping modem '%s' when looking for bearers " "(not fully initialized)", mm_object_get_path (ctx->current)); - g_object_unref (modem); - look_for_bearer_in_modem (ctx); - return; + look_for_bearer_in_modem (task); + } else { + g_debug ("Looking for bearer '%s' in modem '%s'...", + ctx->bearer_path, + mm_object_get_path (ctx->current)); + look_for_bearer_in_modem_3gpp_eps_initial_bearer (task); } - g_debug ("Looking for bearer '%s' in modem '%s'...", - ctx->bearer_path, - mm_object_get_path (ctx->current)); - - mm_modem_list_bearers (modem, - ctx->cancellable, - (GAsyncReadyCallback)list_bearers_ready, - ctx); g_object_unref (modem); } static void get_bearer_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetBearerContext *ctx) + GAsyncResult *res, + GTask *task) { + GetBearerContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->manager = mmcli_get_manager_finish (res); ctx->modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (ctx->manager)); if (!ctx->modems) { @@ -429,7 +549,7 @@ exit (EXIT_FAILURE); } - look_for_bearer_in_modem (ctx); + look_for_bearer_in_modem (task); } static gchar * @@ -461,33 +581,32 @@ } void -mmcli_get_bearer (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mmcli_get_bearer (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; GetBearerContext *ctx; + task = g_task_new (connection, cancellable, callback, user_data); + ctx = g_new0 (GetBearerContext, 1); ctx->bearer_path = get_bearer_path (path_or_index); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_bearer); + g_task_set_task_data (task, ctx, (GDestroyNotify) get_bearer_context_free); + mmcli_get_manager (connection, cancellable, (GAsyncReadyCallback)get_bearer_manager_ready, - ctx); + task); } MMBearer * -mmcli_get_bearer_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_bearer_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **o_manager, + MMObject **o_object) { MMManager *manager; GList *modems; @@ -506,38 +625,52 @@ } for (l = modems; !found && l; l = g_list_next (l)) { - GError *error = NULL; - MMObject *object; - MMModem *modem; - GList *bearers; + GError *error = NULL; + MMObject *object; + MMModem *modem; + MMModem3gpp *modem3gpp; object = MM_OBJECT (l->data); modem = mm_object_get_modem (object); + modem3gpp = mm_object_get_modem_3gpp (object); /* Don't look for bearers in modems which are not fully initialized */ if (mm_modem_get_state (modem) < MM_MODEM_STATE_DISABLED) { g_debug ("Skipping modem '%s' when looking for bearers " "(not fully initialized)", mm_object_get_path (object)); - g_object_unref (modem); - continue; + goto next; } - bearers = mm_modem_list_bearers_sync (modem, NULL, &error); - if (error) { - g_printerr ("error: couldn't list bearers at '%s': '%s'\n", - mm_modem_get_path (modem), - error->message); - exit (EXIT_FAILURE); - } + if (modem3gpp && !g_strcmp0 (mm_modem_3gpp_get_initial_eps_bearer_path (modem3gpp), bearer_path)) { + found = mm_modem_3gpp_get_initial_eps_bearer_sync (modem3gpp, NULL, &error); + if (!found) { + g_printerr ("error: couldn't get initial EPS bearer object at '%s': '%s'\n", + mm_modem_get_path (modem), + error->message); + exit (EXIT_FAILURE); + } + } else { + GList *bearers; - found = find_bearer_in_list (bearers, bearer_path); - g_list_free_full (bearers, (GDestroyNotify) g_object_unref); + bearers = mm_modem_list_bearers_sync (modem, NULL, &error); + if (error) { + g_printerr ("error: couldn't list bearers at '%s': '%s'\n", + mm_modem_get_path (modem), + error->message); + exit (EXIT_FAILURE); + } + + found = find_bearer_in_list (bearers, bearer_path); + g_list_free_full (bearers, g_object_unref); + } if (found && o_object) *o_object = g_object_ref (object); - g_object_unref (modem); + next: + g_clear_object (&modem); + g_clear_object (&modem3gpp); } if (!found) { @@ -546,7 +679,7 @@ exit (EXIT_FAILURE); } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); g_free (bearer_path); if (o_manager) @@ -557,61 +690,73 @@ return found; } +/******************************************************************************/ +/* SIM */ + typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; - gchar *sim_path; + gchar *sim_path; MMManager *manager; - MMObject *modem; - MMSim *sim; + MMObject *current; } GetSimContext; +typedef struct { + MMManager *manager; + MMObject *object; + MMSim *sim; +} GetSimResults; + +static void +get_sim_results_free (GetSimResults *results) +{ + g_object_unref (results->manager); + g_object_unref (results->object); + g_object_unref (results->sim); + g_free (results); +} + static void get_sim_context_free (GetSimContext *ctx) { - if (ctx->modem) - g_object_unref (ctx->modem); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); + if (ctx->current) + g_object_unref (ctx->current); if (ctx->manager) g_object_unref (ctx->manager); - if (ctx->sim) - g_object_unref (ctx->sim); g_free (ctx->sim_path); g_free (ctx); } -static void -get_sim_context_complete (GetSimContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - ctx->result = NULL; -} - MMSim * -mmcli_get_sim_finish (GAsyncResult *res, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_sim_finish (GAsyncResult *res, + MMManager **o_manager, + MMObject **o_object) { - GetSimContext *ctx; + GetSimResults *results; + MMSim *obj; - ctx = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + results = g_task_propagate_pointer (G_TASK (res), NULL); + g_assert (results); if (o_manager) - *o_manager = g_object_ref (ctx->manager); + *o_manager = g_object_ref (results->manager); if (o_object) - *o_object = g_object_ref (ctx->modem); - return g_object_ref (ctx->sim); + *o_object = g_object_ref (results->object); + obj = g_object_ref (results->sim); + get_sim_results_free (results); + return obj; } static void -get_sim_ready (MMModem *modem, +get_sim_ready (MMModem *modem, GAsyncResult *res, - GetSimContext *ctx) + GTask *task) { - GError *error = NULL; + GetSimContext *ctx; + GetSimResults *results; + MMSim *sim; + GError *error = NULL; - ctx->sim = mm_modem_get_sim_finish (modem, res, &error); + ctx = g_task_get_task_data (task); + + sim = mm_modem_get_sim_finish (modem, res, &error); if (error) { g_printerr ("error: couldn't get sim '%s' at '%s': '%s'\n", ctx->sim_path, @@ -620,20 +765,25 @@ exit (EXIT_FAILURE); } - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - ctx, - (GDestroyNotify)get_sim_context_free); - get_sim_context_complete (ctx); + /* Found! */ + results = g_new (GetSimResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->sim = sim; + g_task_return_pointer (task, results, (GDestroyNotify) get_sim_results_free); + g_object_unref (task); } static void get_sim_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetSimContext *ctx) + GAsyncResult *res, + GTask *task) { - GList *l; - GList *modems; + GetSimContext *ctx; + GList *l; + GList *modems; + + ctx = g_task_get_task_data (task); ctx->manager = mmcli_get_manager_finish (res); @@ -644,30 +794,28 @@ exit (EXIT_FAILURE); } - for (l = modems; l; l = g_list_next (l)) { + for (l = modems; l && !ctx->current; l = g_list_next (l)) { MMObject *object; - MMModem *modem; + MMModem *modem; object = MM_OBJECT (l->data); modem = mm_object_get_modem (object); if (g_str_equal (ctx->sim_path, mm_modem_get_sim_path (modem))) { - ctx->modem = g_object_ref (object); + ctx->current = g_object_ref (object); mm_modem_get_sim (modem, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)get_sim_ready, - ctx); - break; + task); } g_object_unref (modem); } + g_list_free_full (modems, g_object_unref); - if (!ctx->modem) { + if (!ctx->current) { g_printerr ("error: couldn't find sim at '%s'\n", ctx->sim_path); exit (EXIT_FAILURE); } - - g_list_free_full (modems, (GDestroyNotify) g_object_unref); } static gchar * @@ -699,33 +847,32 @@ } void -mmcli_get_sim (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mmcli_get_sim (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; GetSimContext *ctx; + task = g_task_new (connection, cancellable, callback, user_data); + ctx = g_new0 (GetSimContext, 1); ctx->sim_path = get_sim_path (path_or_index); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_sim); + g_task_set_task_data (task, ctx, (GDestroyNotify) get_sim_context_free); + mmcli_get_manager (connection, cancellable, (GAsyncReadyCallback)get_sim_manager_ready, - ctx); + task); } MMSim * -mmcli_get_sim_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_sim_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **o_manager, + MMObject **o_object) { MMManager *manager; GList *modems; @@ -772,7 +919,7 @@ exit (EXIT_FAILURE); } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); g_free (sim_path); if (o_manager) @@ -783,59 +930,66 @@ return found; } +/******************************************************************************/ +/* SMS */ + typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; - gchar *sms_path; + gchar *sms_path; MMManager *manager; - GList *modems; - MMObject *current; - MMSms *sms; + GList *modems; + MMObject *current; } GetSmsContext; +typedef struct { + MMManager *manager; + MMObject *object; + MMSms *sms; +} GetSmsResults; + +static void +get_sms_results_free (GetSmsResults *results) +{ + g_object_unref (results->manager); + g_object_unref (results->object); + g_object_unref (results->sms); + g_free (results); +} + static void get_sms_context_free (GetSmsContext *ctx) { if (ctx->current) g_object_unref (ctx->current); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); if (ctx->manager) g_object_unref (ctx->manager); - if (ctx->sms) - g_object_unref (ctx->sms); - g_list_free_full (ctx->modems, (GDestroyNotify) g_object_unref); + g_list_free_full (ctx->modems, g_object_unref); g_free (ctx->sms_path); g_free (ctx); } -static void -get_sms_context_complete (GetSmsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - ctx->result = NULL; -} - MMSms * -mmcli_get_sms_finish (GAsyncResult *res, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_sms_finish (GAsyncResult *res, + MMManager **o_manager, + MMObject **o_object) { - GetSmsContext *ctx; + GetSmsResults *results; + MMSms *obj; - ctx = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + results = g_task_propagate_pointer (G_TASK (res), NULL); + g_assert (results); if (o_manager) - *o_manager = g_object_ref (ctx->manager); + *o_manager = g_object_ref (results->manager); if (o_object) - *o_object = g_object_ref (ctx->current); - return g_object_ref (ctx->sms); + *o_object = g_object_ref (results->object); + obj = g_object_ref (results->sms); + get_sms_results_free (results); + return obj; } -static void look_for_sms_in_modem (GetSmsContext *ctx); +static void look_for_sms_in_modem (GTask *task); static MMSms * -find_sms_in_list (GList *list, +find_sms_in_list (GList *list, const gchar *sms_path) { GList *l; @@ -854,11 +1008,16 @@ static void list_sms_ready (MMModemMessaging *modem, - GAsyncResult *res, - GetSmsContext *ctx) + GAsyncResult *res, + GTask *task) { - GList *sms_list; - GError *error = NULL; + GetSmsContext *ctx; + GetSmsResults *results; + MMSms *found; + GList *sms_list; + GError *error = NULL; + + ctx = g_task_get_task_data (task); sms_list = mm_modem_messaging_list_finish (modem, res, &error); if (error) { @@ -868,28 +1027,32 @@ exit (EXIT_FAILURE); } - ctx->sms = find_sms_in_list (sms_list, ctx->sms_path); - g_list_free_full (sms_list, (GDestroyNotify) g_object_unref); + found = find_sms_in_list (sms_list, ctx->sms_path); + g_list_free_full (sms_list, g_object_unref); - /* Found! */ - if (ctx->sms) { - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - ctx, - (GDestroyNotify)get_sms_context_free); - get_sms_context_complete (ctx); + if (!found) { + /* Not found, try with next modem */ + look_for_sms_in_modem (task); return; } - /* Not found, try with next modem */ - look_for_sms_in_modem (ctx); + /* Found! */ + results = g_new (GetSmsResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->sms = found; + g_task_return_pointer (task, results, (GDestroyNotify) get_sms_results_free); + g_object_unref (task); } static void -look_for_sms_in_modem (GetSmsContext *ctx) +look_for_sms_in_modem (GTask *task) { + GetSmsContext *ctx; MMModemMessaging *modem; + ctx = g_task_get_task_data (task); + if (!ctx->modems) { g_printerr ("error: couldn't find SMS at '%s': 'not found in any modem'\n", ctx->sms_path); @@ -901,27 +1064,31 @@ ctx->modems = g_list_delete_link (ctx->modems, ctx->modems); modem = mm_object_get_modem_messaging (ctx->current); - if (modem) { - g_debug ("Looking for sms '%s' in modem '%s'...", - ctx->sms_path, - mm_object_get_path (ctx->current)); - mm_modem_messaging_list (modem, - ctx->cancellable, - (GAsyncReadyCallback)list_sms_ready, - ctx); - g_object_unref (modem); + if (!modem) { + /* Current modem has no messaging capabilities, try with next modem */ + look_for_sms_in_modem (task); return; } - /* Current modem has no messaging capabilities, try with next modem */ - look_for_sms_in_modem (ctx); + g_debug ("Looking for sms '%s' in modem '%s'...", + ctx->sms_path, + mm_object_get_path (ctx->current)); + mm_modem_messaging_list (modem, + g_task_get_cancellable (task), + (GAsyncReadyCallback)list_sms_ready, + task); + g_object_unref (modem); } static void get_sms_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetSmsContext *ctx) + GAsyncResult *res, + GTask *task) { + GetSmsContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->manager = mmcli_get_manager_finish (res); ctx->modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (ctx->manager)); if (!ctx->modems) { @@ -930,7 +1097,7 @@ exit (EXIT_FAILURE); } - look_for_sms_in_modem (ctx); + look_for_sms_in_modem (task); } static gchar * @@ -962,33 +1129,32 @@ } void -mmcli_get_sms (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mmcli_get_sms (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; GetSmsContext *ctx; + task = g_task_new (connection, cancellable, callback, user_data); + ctx = g_new0 (GetSmsContext, 1); ctx->sms_path = get_sms_path (path_or_index); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_sms); + g_task_set_task_data (task, ctx, (GDestroyNotify) get_sms_context_free); + mmcli_get_manager (connection, cancellable, (GAsyncReadyCallback)get_sms_manager_ready, - ctx); + task); } MMSms * -mmcli_get_sms_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_sms_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **o_manager, + MMObject **o_object) { MMManager *manager; GList *modems; @@ -1028,7 +1194,7 @@ } found = find_sms_in_list (sms_list, sms_path); - g_list_free_full (sms_list, (GDestroyNotify) g_object_unref); + g_list_free_full (sms_list, g_object_unref); if (found && o_object) *o_object = g_object_ref (object); @@ -1042,7 +1208,7 @@ exit (EXIT_FAILURE); } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); g_free (sms_path); if (o_manager) @@ -1053,63 +1219,66 @@ return found; } -const gchar * -mmcli_get_state_reason_string (MMModemStateChangeReason reason) -{ - switch (reason) { - case MM_MODEM_STATE_CHANGE_REASON_UNKNOWN: - return "None or unknown"; - case MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED: - return "User request"; - case MM_MODEM_STATE_CHANGE_REASON_SUSPEND: - return "Suspend"; - case MM_MODEM_STATE_CHANGE_REASON_FAILURE: - return "Failure"; - } +/******************************************************************************/ +/* Call */ - g_warn_if_reached (); - return NULL; -} +typedef struct { + gchar *call_path; + MMManager *manager; + GList *modems; + MMObject *current; +} GetCallContext; typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; - gchar *call_path; MMManager *manager; - GList *modems; - MMObject *current; - MMCall *call; -} GetVoiceContext; + MMObject *object; + MMCall *call; +} GetCallResults; static void -get_voice_context_free (GetVoiceContext *ctx) +get_call_results_free (GetCallResults *results) +{ + g_object_unref (results->manager); + g_object_unref (results->object); + g_object_unref (results->call); + g_free (results); +} + +static void +get_call_context_free (GetCallContext *ctx) { if (ctx->current) g_object_unref (ctx->current); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); if (ctx->manager) g_object_unref (ctx->manager); - if (ctx->call) - g_object_unref (ctx->call); - g_list_free_full (ctx->modems, (GDestroyNotify) g_object_unref); + g_list_free_full (ctx->modems, g_object_unref); g_free (ctx->call_path); g_free (ctx); } -static void -get_voice_context_complete (GetVoiceContext *ctx) +MMCall * +mmcli_get_call_finish (GAsyncResult *res, + MMManager **o_manager, + MMObject **o_object) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - ctx->result = NULL; -} + GetCallResults *results; + MMCall *obj; + results = g_task_propagate_pointer (G_TASK (res), NULL); + g_assert (results); + if (o_manager) + *o_manager = g_object_ref (results->manager); + if (o_object) + *o_object = g_object_ref (results->object); + obj = g_object_ref (results->call); + get_call_results_free (results); + return obj; +} -static void look_for_call_in_modem (GetVoiceContext *ctx); +static void look_for_call_in_modem (GTask *task); static MMCall * -find_call_in_list (GList *list, +find_call_in_list (GList *list, const gchar *call_path) { GList *l; @@ -1127,12 +1296,17 @@ } static void -list_call_ready (MMModemVoice *modem, - GAsyncResult *res, - GetVoiceContext *ctx) -{ - GList *call_list; - GError *error = NULL; +list_calls_ready (MMModemVoice *modem, + GAsyncResult *res, + GTask *task) +{ + GetCallContext *ctx; + GetCallResults *results; + MMCall *found; + GList *call_list; + GError *error = NULL; + + ctx = g_task_get_task_data (task); call_list = mm_modem_voice_list_calls_finish (modem, res, &error); if (error) { @@ -1142,27 +1316,31 @@ exit (EXIT_FAILURE); } - ctx->call = find_call_in_list (call_list, ctx->call_path); - g_list_free_full (call_list, (GDestroyNotify) g_object_unref); + found = find_call_in_list (call_list, ctx->call_path); + g_list_free_full (call_list, g_object_unref); - /* Found! */ - if (ctx->call) { - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - ctx, - (GDestroyNotify)get_voice_context_free); - get_voice_context_complete (ctx); + if (!found) { + /* Not found, try with next modem */ + look_for_call_in_modem (task); return; } - /* Not found, try with next modem */ - look_for_call_in_modem (ctx); + /* Found! */ + results = g_new (GetCallResults, 1); + results->manager = g_object_ref (ctx->manager); + results->object = g_object_ref (ctx->current); + results->call = found; + g_task_return_pointer (task, results, (GDestroyNotify) get_call_results_free); + g_object_unref (task); } static void -look_for_call_in_modem (GetVoiceContext *ctx) +look_for_call_in_modem (GTask *task) { - MMModemVoice *modem; + GetCallContext *ctx; + MMModemVoice *modem; + + ctx = g_task_get_task_data (task); if (!ctx->modems) { g_printerr ("error: couldn't find call at '%s': 'not found in any modem'\n", @@ -1175,27 +1353,31 @@ ctx->modems = g_list_delete_link (ctx->modems, ctx->modems); modem = mm_object_get_modem_voice (ctx->current); - if (modem) { - g_debug ("Looking for call '%s' in modem '%s'...", - ctx->call_path, - mm_object_get_path (ctx->current)); - mm_modem_voice_list_calls (modem, - ctx->cancellable, - (GAsyncReadyCallback)list_call_ready, - ctx); - g_object_unref (modem); + if (!modem) { + /* Current modem has no messaging capabilities, try with next modem */ + look_for_call_in_modem (task); return; } - /* Current modem has no messaging capabilities, try with next modem */ - look_for_call_in_modem (ctx); + g_debug ("Looking for call '%s' in modem '%s'...", + ctx->call_path, + mm_object_get_path (ctx->current)); + mm_modem_voice_list_calls (modem, + g_task_get_cancellable (task), + (GAsyncReadyCallback)list_calls_ready, + task); + g_object_unref (modem); } static void -get_voice_manager_ready (GDBusConnection *connection, - GAsyncResult *res, - GetVoiceContext *ctx) +get_call_manager_ready (GDBusConnection *connection, + GAsyncResult *res, + GTask *task) { + GetCallContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->manager = mmcli_get_manager_finish (res); ctx->modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (ctx->manager)); if (!ctx->modems) { @@ -1204,7 +1386,7 @@ exit (EXIT_FAILURE); } - look_for_call_in_modem (ctx); + look_for_call_in_modem (task); } static gchar * @@ -1235,49 +1417,33 @@ return call_path; } -MMCall * -mmcli_get_call_finish (GAsyncResult *res, - MMManager **o_manager, - MMObject **o_object) -{ - GetVoiceContext *ctx; - - ctx = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - if (o_manager) - *o_manager = g_object_ref (ctx->manager); - if (o_object) - *o_object = g_object_ref (ctx->current); - return g_object_ref (ctx->call); -} - void -mmcli_get_call (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mmcli_get_call (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { - GetVoiceContext *ctx; + GTask *task; + GetCallContext *ctx; - ctx = g_new0 (GetVoiceContext, 1); + task = g_task_new (connection, cancellable, callback, user_data); + + ctx = g_new0 (GetCallContext, 1); ctx->call_path = get_call_path (path_or_index); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (connection), - callback, - user_data, - mmcli_get_call); + g_task_set_task_data (task, ctx, (GDestroyNotify) get_call_context_free); + mmcli_get_manager (connection, cancellable, - (GAsyncReadyCallback)get_voice_manager_ready, - ctx); + (GAsyncReadyCallback)get_call_manager_ready, + task); } MMCall * -mmcli_get_call_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager, - MMObject **o_object) +mmcli_get_call_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **o_manager, + MMObject **o_object) { MMManager *manager; GList *modems; @@ -1317,7 +1483,7 @@ } found = find_call_in_list (call_list, call_path); - g_list_free_full (call_list, (GDestroyNotify) g_object_unref); + g_list_free_full (call_list, g_object_unref); if (found && o_object) *o_object = g_object_ref (object); @@ -1331,7 +1497,7 @@ exit (EXIT_FAILURE); } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); g_free (call_path); if (o_manager) @@ -1342,6 +1508,26 @@ return found; } +/******************************************************************************/ + +const gchar * +mmcli_get_state_reason_string (MMModemStateChangeReason reason) +{ + switch (reason) { + case MM_MODEM_STATE_CHANGE_REASON_UNKNOWN: + return "None or unknown"; + case MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED: + return "User request"; + case MM_MODEM_STATE_CHANGE_REASON_SUSPEND: + return "Suspend"; + case MM_MODEM_STATE_CHANGE_REASON_FAILURE: + return "Failure"; + } + + g_warn_if_reached (); + return NULL; +} + /* Common options */ static gchar *modem_str; static gchar *bearer_str; diff -Nru modemmanager-1.6.8/cli/mmcli-common.h modemmanager-1.10.0/cli/mmcli-common.h --- modemmanager-1.6.8/cli/mmcli-common.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-common.h 2018-11-15 09:55:53.000000000 +0100 @@ -26,77 +26,75 @@ #define _LIBMM_INSIDE_MMCLI #include -void mmcli_get_manager (GDBusConnection *connection, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMManager *mmcli_get_manager_finish (GAsyncResult *res); -MMManager *mmcli_get_manager_sync (GDBusConnection *connection); - - -void mmcli_get_modem (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMObject *mmcli_get_modem_finish (GAsyncResult *res, - MMManager **o_manager); -MMObject *mmcli_get_modem_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **o_manager); - -void mmcli_get_bearer (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMBearer *mmcli_get_bearer_finish (GAsyncResult *res, - MMManager **manager, - MMObject **object); -MMBearer *mmcli_get_bearer_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **manager, - MMObject **object); - -void mmcli_get_sim (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMSim *mmcli_get_sim_finish (GAsyncResult *res, - MMManager **manager, - MMObject **object); -MMSim *mmcli_get_sim_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **manager, - MMObject **object); - -void mmcli_get_sms (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMSms *mmcli_get_sms_finish (GAsyncResult *res, - MMManager **manager, - MMObject **object); -MMSms *mmcli_get_sms_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **manager, - MMObject **object); - -void mmcli_get_call (GDBusConnection *connection, - const gchar *path_or_index, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMCall *mmcli_get_call_finish (GAsyncResult *res, - MMManager **manager, - MMObject **object); -MMCall *mmcli_get_call_sync (GDBusConnection *connection, - const gchar *path_or_index, - MMManager **manager, - MMObject **object); - +void mmcli_get_manager (GDBusConnection *connection, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMManager *mmcli_get_manager_finish (GAsyncResult *res); +MMManager *mmcli_get_manager_sync (GDBusConnection *connection); + +void mmcli_get_modem (GDBusConnection *connection, + const gchar *modem_str, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMObject *mmcli_get_modem_finish (GAsyncResult *res, + MMManager **o_manager); +MMObject *mmcli_get_modem_sync (GDBusConnection *connection, + const gchar *modem_str, + MMManager **o_manager); + +void mmcli_get_bearer (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBearer *mmcli_get_bearer_finish (GAsyncResult *res, + MMManager **manager, + MMObject **object); +MMBearer *mmcli_get_bearer_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **manager, + MMObject **object); + +void mmcli_get_sim (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMSim *mmcli_get_sim_finish (GAsyncResult *res, + MMManager **manager, + MMObject **object); +MMSim *mmcli_get_sim_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **manager, + MMObject **object); + +void mmcli_get_sms (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMSms *mmcli_get_sms_finish (GAsyncResult *res, + MMManager **manager, + MMObject **object); +MMSms *mmcli_get_sms_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **manager, + MMObject **object); + +void mmcli_get_call (GDBusConnection *connection, + const gchar *path_or_index, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMCall *mmcli_get_call_finish (GAsyncResult *res, + MMManager **manager, + MMObject **object); +MMCall *mmcli_get_call_sync (GDBusConnection *connection, + const gchar *path_or_index, + MMManager **manager, + MMObject **object); const gchar *mmcli_get_state_reason_string (MMModemStateChangeReason reason); diff -Nru modemmanager-1.6.8/cli/mmcli-manager.c modemmanager-1.10.0/cli/mmcli-manager.c --- modemmanager-1.6.8/cli/mmcli-manager.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-manager.c 2019-01-15 15:57:35.000000000 +0100 @@ -15,8 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2011 Aleksander Morgado * Copyright (C) 2011 Google, Inc. + * Copyright (C) 2011-2016 Aleksander Morgado */ #include "config.h" @@ -29,26 +29,45 @@ #include #include +#if defined WITH_UDEV +# include +#endif + #define _LIBMM_INSIDE_MMCLI #include "libmm-glib.h" #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { MMManager *manager; GCancellable *cancellable; +#if defined WITH_UDEV + GUdevClient *udev; +#endif } Context; static Context *ctx; /* Options */ +static gboolean get_daemon_version_flag; static gboolean list_modems_flag; static gboolean monitor_modems_flag; static gboolean scan_modems_flag; static gchar *set_logging_str; +static gchar *inhibit_device_str; +static gchar *report_kernel_event_str; + +#if defined WITH_UDEV +static gboolean report_kernel_event_auto_scan; +#endif static GOptionEntry entries[] = { + { "get-daemon-version", 'B', 0, G_OPTION_ARG_NONE, &get_daemon_version_flag, + "Get ModemManager daemon version", + NULL + }, { "set-logging", 'G', 0, G_OPTION_ARG_STRING, &set_logging_str, "Set logging level in the ModemManager daemon", "[ERR,WARN,INFO,DEBUG]", @@ -65,6 +84,20 @@ "Request to re-scan looking for modems", NULL }, + { "inhibit-device", 'I', 0, G_OPTION_ARG_STRING, &inhibit_device_str, + "Inhibit device given a unique device identifier", + "[UID]" + }, + { "report-kernel-event", 'K', 0, G_OPTION_ARG_STRING, &report_kernel_event_str, + "Report kernel event", + "[\"key=value,...\"]" + }, +#if defined WITH_UDEV + { "report-kernel-event-auto-scan", 0, 0, G_OPTION_ARG_NONE, &report_kernel_event_auto_scan, + "Automatically report kernel events based on udev notifications", + NULL + }, +#endif { NULL } }; @@ -93,18 +126,38 @@ if (checked) return !!n_actions; - n_actions = (list_modems_flag + + n_actions = (get_daemon_version_flag + + list_modems_flag + monitor_modems_flag + scan_modems_flag + - !!set_logging_str); + !!set_logging_str + + !!inhibit_device_str + + !!report_kernel_event_str); + +#if defined WITH_UDEV + n_actions += report_kernel_event_auto_scan; +#endif if (n_actions > 1) { g_printerr ("error: too many manager actions requested\n"); exit (EXIT_FAILURE); } - if (monitor_modems_flag) + if (get_daemon_version_flag) + mmcli_force_sync_operation (); + else if (monitor_modems_flag) { + if (mmcli_output_get () != MMC_OUTPUT_TYPE_HUMAN) { + g_printerr ("error: modem monitoring not available in keyvalue output\n"); + exit (EXIT_FAILURE); + } + mmcli_force_async_operation (); + } else if (inhibit_device_str) + mmcli_force_async_operation (); + +#if defined WITH_UDEV + if (report_kernel_event_auto_scan) mmcli_force_async_operation (); +#endif checked = TRUE; return !!n_actions; @@ -116,6 +169,11 @@ if (!ctx) return; +#if defined WITH_UDEV + if (ctx->udev) + g_object_unref (ctx->udev); +#endif + if (ctx->manager) g_object_unref (ctx->manager); if (ctx->cancellable) @@ -130,6 +188,82 @@ } static void +inhibition_cancelled (GCancellable *cancellable) +{ + GError *error = NULL; + + if (!mm_manager_uninhibit_device_sync (ctx->manager, inhibit_device_str, NULL, &error)) { + g_printerr ("error: couldn't uninhibit device: '%s'\n", + error ? error->message : "unknown error"); + } else + g_print ("successfully uninhibited device with uid '%s'\n", inhibit_device_str); + + mmcli_async_operation_done (); +} + +static void +inhibit_device_ready (MMManager *manager, + GAsyncResult *result) +{ + GError *error = NULL; + + if (!mm_manager_inhibit_device_finish (manager, result, &error)) { + g_printerr ("error: couldn't inhibit device: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("successfully inhibited device with uid '%s'\n", inhibit_device_str); + g_print ("type Ctrl+C to abort this program and remove the inhibition\n"); + + g_cancellable_connect (ctx->cancellable, + G_CALLBACK (inhibition_cancelled), + NULL, + NULL); +} + +static void +report_kernel_event_process_reply (gboolean result, + const GError *error) +{ + if (!result) { + g_printerr ("error: couldn't report kernel event: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("successfully reported kernel event\n"); +} + +static void +report_kernel_event_ready (MMManager *manager, + GAsyncResult *result) +{ + gboolean operation_result; + GError *error = NULL; + + operation_result = mm_manager_report_kernel_event_finish (manager, result, &error); + report_kernel_event_process_reply (operation_result, error); + + mmcli_async_operation_done (); +} + +static MMKernelEventProperties * +build_kernel_event_properties_from_input (const gchar *properties_string) +{ + GError *error = NULL; + MMKernelEventProperties *properties; + + properties = mm_kernel_event_properties_new_from_string (properties_string, &error); + if (!properties) { + g_printerr ("error: cannot parse properties string: '%s'\n", error->message); + exit (EXIT_FAILURE); + } + + return properties; +} + +static void set_logging_process_reply (gboolean result, const GError *error) { @@ -187,58 +321,56 @@ mmcli_async_operation_done (); } -static void -print_modem_short_info (MMObject *modem) -{ - const gchar *manufacturer, *model; - - manufacturer = mm_modem_get_manufacturer (mm_object_peek_modem (modem)); - model = mm_modem_get_model (mm_object_peek_modem (modem)); - - g_print ("\t%s [%s] %s\n", - mm_object_get_path (modem), - manufacturer ? manufacturer : "unknown", - model ? model : "unknown"); +#define FOUND_ACTION_PREFIX " " +#define ADDED_ACTION_PREFIX "(+) " +#define REMOVED_ACTION_PREFIX "(-) " + +static void +output_modem_info (MMObject *obj, + const gchar *prefix) +{ + gchar *extra; + const gchar *manufacturer; + const gchar *model; + + manufacturer = mm_modem_get_manufacturer (mm_object_peek_modem (obj)); + model = mm_modem_get_model (mm_object_peek_modem (obj)); + extra = g_strdup_printf ("[%s] %s", + manufacturer ? manufacturer : "manufacturer unknown", + model ? model : "model unknown"); + mmcli_output_listitem (MMC_F_MODEM_LIST_DBUS_PATH, + prefix, + mm_object_get_path (obj), + extra); + g_free (extra); } static void device_added (MMManager *manager, MMObject *modem) { - g_print ("Added modem:\n"); - print_modem_short_info (modem); - fflush (stdout); + output_modem_info (modem, ADDED_ACTION_PREFIX); + mmcli_output_list_dump (MMC_F_MODEM_LIST_DBUS_PATH); } static void device_removed (MMManager *manager, MMObject *modem) { - g_print ("Removed modem:\n"); - print_modem_short_info (modem); - fflush (stdout); + output_modem_info (modem, REMOVED_ACTION_PREFIX); + mmcli_output_list_dump (MMC_F_MODEM_LIST_DBUS_PATH); } static void list_current_modems (MMManager *manager) { GList *modems; + GList *l; modems = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (ctx->manager)); - - g_print ("\n"); - if (!modems) - g_print ("No modems were found\n"); - else { - GList *l; - - g_print ("Found %u modems:\n", g_list_length (modems)); - for (l = modems; l; l = g_list_next (l)) { - print_modem_short_info (MM_OBJECT (l->data)); - } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); - } - g_print ("\n"); + for (l = modems; l; l = g_list_next (l)) + output_modem_info ((MMObject *)(l->data), FOUND_ACTION_PREFIX); + mmcli_output_list_dump (MMC_F_MODEM_LIST_DBUS_PATH); } static void @@ -247,6 +379,26 @@ mmcli_async_operation_done (); } +#if defined WITH_UDEV + +static void +handle_uevent (GUdevClient *client, + const char *action, + GUdevDevice *device, + gpointer none) +{ + MMKernelEventProperties *properties; + + properties = mm_kernel_event_properties_new (); + mm_kernel_event_properties_set_action (properties, action); + mm_kernel_event_properties_set_subsystem (properties, g_udev_device_get_subsystem (device)); + mm_kernel_event_properties_set_name (properties, g_udev_device_get_name (device)); + mm_manager_report_kernel_event (ctx->manager, properties, NULL, NULL, NULL); + g_object_unref (properties); +} + +#endif + static void get_manager_ready (GObject *source, GAsyncResult *result, @@ -276,6 +428,56 @@ return; } + /* Request to report kernel event? */ + if (report_kernel_event_str) { + MMKernelEventProperties *properties; + + properties = build_kernel_event_properties_from_input (report_kernel_event_str); + mm_manager_report_kernel_event (ctx->manager, + properties, + ctx->cancellable, + (GAsyncReadyCallback)report_kernel_event_ready, + NULL); + g_object_unref (properties); + return; + } + +#if defined WITH_UDEV + if (report_kernel_event_auto_scan) { + const gchar *subsys[] = { "tty", "usbmisc", "net", NULL }; + guint i; + + ctx->udev = g_udev_client_new (subsys); + g_signal_connect (ctx->udev, "uevent", G_CALLBACK (handle_uevent), NULL); + + for (i = 0; subsys[i]; i++) { + GList *list, *iter; + + list = g_udev_client_query_by_subsystem (ctx->udev, subsys[i]); + for (iter = list; iter; iter = g_list_next (iter)) { + MMKernelEventProperties *properties; + GUdevDevice *device; + + device = G_UDEV_DEVICE (iter->data); + properties = mm_kernel_event_properties_new (); + mm_kernel_event_properties_set_action (properties, "add"); + mm_kernel_event_properties_set_subsystem (properties, subsys[i]); + mm_kernel_event_properties_set_name (properties, g_udev_device_get_name (device)); + mm_manager_report_kernel_event (ctx->manager, properties, NULL, NULL, NULL); + g_object_unref (properties); + } + g_list_free_full (list, g_object_unref); + } + + /* If we get cancelled, operation done */ + g_cancellable_connect (ctx->cancellable, + G_CALLBACK (cancelled), + NULL, + NULL); + return; + } +#endif + /* Request to monitor modems? */ if (monitor_modems_flag) { g_signal_connect (ctx->manager, @@ -303,6 +505,16 @@ return; } + /* Request to inhibit device? */ + if (inhibit_device_str) { + mm_manager_inhibit_device (ctx->manager, + inhibit_device_str, + ctx->cancellable, + (GAsyncReadyCallback)inhibit_device_ready, + NULL); + return; + } + g_warn_if_reached (); } @@ -332,10 +544,23 @@ exit (EXIT_FAILURE); } +#if defined WITH_UDEV + if (report_kernel_event_auto_scan) { + g_printerr ("error: monitoring udev events cannot be done synchronously\n"); + exit (EXIT_FAILURE); + } +#endif + /* Initialize context */ ctx = g_new0 (Context, 1); ctx->manager = mmcli_get_manager_sync (connection); + /* Get daemon version? */ + if (get_daemon_version_flag) { + g_print ("ModemManager daemon %s running\n", mm_manager_get_version (ctx->manager)); + return; + } + /* Setup operation timeout */ mmcli_force_operation_timeout (mm_manager_peek_proxy (ctx->manager)); @@ -362,6 +587,20 @@ return; } + /* Request to report kernel event? */ + if (report_kernel_event_str) { + MMKernelEventProperties *properties; + gboolean result; + + properties = build_kernel_event_properties_from_input (report_kernel_event_str); + result = mm_manager_report_kernel_event_sync (ctx->manager, + properties, + NULL, + &error); + report_kernel_event_process_reply (result, error); + return; + } + /* Request to list modems? */ if (list_modems_flag) { list_current_modems (ctx->manager); diff -Nru modemmanager-1.6.8/cli/mmcli-modem-3gpp.c modemmanager-1.10.0/cli/mmcli-modem-3gpp.c --- modemmanager-1.6.8/cli/mmcli-modem-3gpp.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-3gpp.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -49,6 +50,8 @@ static gboolean scan_flag; static gboolean register_home_flag; static gchar *register_in_operator_str; +static gchar *set_eps_ue_mode_operation_str; +static gchar *set_initial_eps_bearer_settings_str; static gboolean ussd_status_flag; static gchar *ussd_initiate_str; static gchar *ussd_respond_str; @@ -67,6 +70,14 @@ "Request a given modem to register in the network of the given operator", "[MCCMNC]" }, + { "3gpp-set-eps-ue-mode-operation", 0, 0, G_OPTION_ARG_STRING, &set_eps_ue_mode_operation_str, + "Set the UE mode of operation for EPS", + "[ps-1|ps-2|csps-1|csps-2]" + }, + { "3gpp-set-initial-eps-bearer-settings", 0, 0, G_OPTION_ARG_STRING, &set_initial_eps_bearer_settings_str, + "Set the initial EPS bearer settings", + "[\"key=value,...\"]" + }, { "3gpp-ussd-status", 0, 0, G_OPTION_ARG_NONE, &ussd_status_flag, "Show status of any ongoing USSD session", NULL @@ -113,6 +124,8 @@ n_actions = (scan_flag + register_home_flag + !!register_in_operator_str + + !!set_eps_ue_mode_operation_str + + !!set_initial_eps_bearer_settings_str + ussd_status_flag + !!ussd_initiate_str + !!ussd_respond_str + @@ -198,34 +211,6 @@ } static void -print_network_info (MMModem3gppNetwork *network) -{ - const gchar *name; - gchar *access_technologies; - - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "unknown") - - access_technologies = (mm_modem_access_technology_build_string_from_mask ( - mm_modem_3gpp_network_get_access_technology (network))); - - /* Prefer long name */ - name = mm_modem_3gpp_network_get_operator_long (network); - if (!name) - name = mm_modem_3gpp_network_get_operator_short (network); - - g_print ("%s - %s (%s, %s)\n", - VALIDATE (mm_modem_3gpp_network_get_operator_code (network)), - VALIDATE (name), - access_technologies, - mm_modem_3gpp_network_availability_get_string ( - mm_modem_3gpp_network_get_availability (network))); - g_free (access_technologies); -} - -static void scan_process_reply (GList *result, const GError *error) { @@ -235,19 +220,10 @@ exit (EXIT_FAILURE); } - g_print ("\n"); - if (!result) - g_print ("No networks were found\n"); - else { - GList *l; - - g_print ("Found %u networks:\n", g_list_length (result)); - for (l = result; l; l = g_list_next (l)) { - print_network_info ((MMModem3gppNetwork *)(l->data)); - } - g_list_free_full (result, (GDestroyNotify) mm_modem_3gpp_network_free); - } - g_print ("\n"); + mmcli_output_scan_networks (result); + mmcli_output_dump (); + + g_list_free_full (result, (GDestroyNotify) mm_modem_3gpp_network_free); } static void @@ -292,24 +268,79 @@ } static void +set_initial_eps_bearer_settings_process_reply (gboolean result, + const GError *error) +{ + if (!result) { + g_printerr ("error: couldn't set initial EPS bearer properties: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("Successfully set initial EPS bearer properties\n"); +} + +static void +set_initial_eps_bearer_settings_ready (MMModem3gpp *modem, + GAsyncResult *res) +{ + gboolean result; + GError *error = NULL; + + result = mm_modem_3gpp_set_initial_eps_bearer_settings_finish (modem, res, &error); + set_initial_eps_bearer_settings_process_reply (result, error); + + mmcli_async_operation_done (); +} + +static void +set_eps_ue_mode_operation_process_reply (gboolean result, + const GError *error) +{ + if (!result) { + g_printerr ("error: couldn't set UE mode of operation for EPS: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("successfully set UE mode of operation for EPS\n"); +} + +static void +set_eps_ue_mode_operation_ready (MMModem3gpp *modem, + GAsyncResult *result) +{ + gboolean operation_result; + GError *error = NULL; + + operation_result = mm_modem_3gpp_set_eps_ue_mode_operation_finish (modem, result, &error); + set_eps_ue_mode_operation_process_reply (operation_result, error); + + mmcli_async_operation_done (); +} + +static void +parse_eps_ue_mode_operation (MMModem3gppEpsUeModeOperation *uemode) +{ + GError *error = NULL; + + *uemode = mm_common_get_eps_ue_mode_operation_from_string (set_eps_ue_mode_operation_str, &error); + if (error) { + g_printerr ("error: couldn't parse UE mode of operation for EPS: '%s'\n", + error->message); + exit (EXIT_FAILURE); + } +} + +static void print_ussd_status (void) { - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "none") - - g_print ("\n" - "%s\n" - " ----------------------------\n" - " USSD | status: '%s'\n" - " | network request: '%s'\n" - " | network notification: '%s'\n", - mm_modem_3gpp_ussd_get_path (ctx->modem_3gpp_ussd), - mm_modem_3gpp_ussd_session_state_get_string ( - mm_modem_3gpp_ussd_get_state (ctx->modem_3gpp_ussd)), - VALIDATE (mm_modem_3gpp_ussd_get_network_request (ctx->modem_3gpp_ussd)), - VALIDATE (mm_modem_3gpp_ussd_get_network_notification (ctx->modem_3gpp_ussd))); + mmcli_output_string (MMC_F_GENERAL_DBUS_PATH, mm_modem_3gpp_ussd_get_path (ctx->modem_3gpp_ussd)); + mmcli_output_string (MMC_F_3GPP_USSD_STATUS, mm_modem_3gpp_ussd_session_state_get_string ( + mm_modem_3gpp_ussd_get_state (ctx->modem_3gpp_ussd))); + mmcli_output_string (MMC_F_3GPP_USSD_NETWORK_REQUEST, mm_modem_3gpp_ussd_get_network_request (ctx->modem_3gpp_ussd)); + mmcli_output_string (MMC_F_3GPP_USSD_NETWORK_NOTIFICATION, mm_modem_3gpp_ussd_get_network_notification (ctx->modem_3gpp_ussd)); + mmcli_output_dump (); } static void @@ -438,6 +469,43 @@ return; } + /* Request to set UE mode of operation for EPS? */ + if (set_eps_ue_mode_operation_str) { + MMModem3gppEpsUeModeOperation uemode; + + parse_eps_ue_mode_operation (&uemode); + + g_debug ("Asynchronously setting UE mode of operation for EPS..."); + mm_modem_3gpp_set_eps_ue_mode_operation (ctx->modem_3gpp, + uemode, + ctx->cancellable, + (GAsyncReadyCallback)set_eps_ue_mode_operation_ready, + NULL); + return; + } + + /* Request to set initial EPS bearer properties? */ + if (set_initial_eps_bearer_settings_str) { + GError *error = NULL; + MMBearerProperties *config; + + config = mm_bearer_properties_new_from_string (set_initial_eps_bearer_settings_str, &error); + if (!config) { + g_printerr ("Error parsing properties string: '%s'\n", error->message); + exit (EXIT_FAILURE); + } + + g_debug ("Asynchronously setting initial EPS bearer properties..."); + mm_modem_3gpp_set_initial_eps_bearer_settings (ctx->modem_3gpp, + config, + ctx->cancellable, + (GAsyncReadyCallback)set_initial_eps_bearer_settings_ready, + NULL); + g_object_unref (config); + return; + + } + /* Request to initiate USSD session? */ if (ussd_initiate_str) { ensure_modem_3gpp_ussd (); @@ -538,6 +606,44 @@ return; } + /* Request to set UE mode of operation for EPS? */ + if (set_eps_ue_mode_operation_str) { + MMModem3gppEpsUeModeOperation uemode; + gboolean result; + + parse_eps_ue_mode_operation (&uemode); + + g_debug ("Synchronously setting UE mode of operation for EPS..."); + result = mm_modem_3gpp_set_eps_ue_mode_operation_sync (ctx->modem_3gpp, + uemode, + NULL, + &error); + set_eps_ue_mode_operation_process_reply (result, error); + return; + } + + /* Request to set initial EPS bearer properties? */ + if (set_initial_eps_bearer_settings_str) { + GError *error = NULL; + gboolean result; + MMBearerProperties *config; + + config = mm_bearer_properties_new_from_string (set_initial_eps_bearer_settings_str, &error); + if (!config) { + g_printerr ("Error parsing properties string: '%s'\n", error->message); + exit (EXIT_FAILURE); + } + + g_debug ("Synchronously setting initial EPS bearer properties..."); + result = mm_modem_3gpp_set_initial_eps_bearer_settings_sync (ctx->modem_3gpp, + config, + NULL, + &error); + set_initial_eps_bearer_settings_process_reply (result, error); + g_object_unref (config); + return; + } + /* Request to show USSD status? */ if (ussd_status_flag) { ensure_modem_3gpp_ussd (); diff -Nru modemmanager-1.6.8/cli/mmcli-modem.c modemmanager-1.10.0/cli/mmcli-modem.c --- modemmanager-1.6.8/cli/mmcli-modem.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem.c 2019-01-15 15:57:35.000000000 +0100 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2011-2018 Aleksander Morgado */ #include "config.h" @@ -32,6 +32,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -56,13 +57,13 @@ static gboolean reset_flag; static gchar *factory_reset_str; static gchar *command_str; -static gboolean list_bearers_flag; static gchar *create_bearer_str; static gchar *delete_bearer_str; static gchar *set_current_capabilities_str; static gchar *set_allowed_modes_str; static gchar *set_preferred_mode_str; static gchar *set_current_bands_str; +static gboolean inhibit_flag; static GOptionEntry entries[] = { { "monitor-state", 'w', 0, G_OPTION_ARG_NONE, &monitor_state_flag, @@ -101,10 +102,6 @@ "Send an AT command to the modem", "[COMMAND]" }, - { "list-bearers", 0, 0, G_OPTION_ARG_NONE, &list_bearers_flag, - "List packet data bearers available in a given modem", - NULL - }, { "create-bearer", 0, 0, G_OPTION_ARG_STRING, &create_bearer_str, "Create a new packet data bearer in a given modem", "[\"key=value,...\"]" @@ -129,6 +126,10 @@ "Set bands to be used by a given modem.", "[BAND1|BAND2...]" }, + { "inhibit", 0, 0, G_OPTION_ARG_NONE, &inhibit_flag, + "Inhibit the modem", + NULL + }, { NULL } }; @@ -164,7 +165,6 @@ set_power_state_low_flag + set_power_state_off_flag + reset_flag + - list_bearers_flag + !!create_bearer_str + !!delete_bearer_str + !!factory_reset_str + @@ -172,7 +172,8 @@ !!set_current_capabilities_str + !!set_allowed_modes_str + !!set_preferred_mode_str + - !!set_current_bands_str); + !!set_current_bands_str + + inhibit_flag); if (n_actions == 0 && mmcli_get_common_modem_string ()) { /* default to info */ @@ -193,7 +194,7 @@ exit (EXIT_FAILURE); } - if (monitor_state_flag) + if (monitor_state_flag || inhibit_flag) mmcli_force_async_operation (); if (info_flag) @@ -233,6 +234,42 @@ } static void +inhibition_cancelled (GCancellable *cancellable, + const gchar *uid) +{ + GError *error = NULL; + + if (!mm_manager_uninhibit_device_sync (ctx->manager, uid, NULL, &error)) { + g_printerr ("error: couldn't uninhibit device: '%s'\n", + error ? error->message : "unknown error"); + } else + g_print ("successfully uninhibited device with uid '%s'\n", uid); + + mmcli_async_operation_done (); +} + +static void +inhibit_device_ready (MMManager *manager, + GAsyncResult *result, + gchar *uid) +{ + GError *error = NULL; + + if (!mm_manager_inhibit_device_finish (manager, result, &error)) { + g_printerr ("error: couldn't inhibit device: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("successfully inhibited device with uid '%s'\n", uid); + g_print ("type Ctrl+C to abort this program and remove the inhibition\n"); + + g_cancellable_connect (ctx->cancellable, + G_CALLBACK (inhibition_cancelled), + uid, g_free); +} + +static void cancelled (GCancellable *cancellable) { mmcli_async_operation_done (); @@ -248,8 +285,6 @@ static void print_modem_info (void) { - gchar *drivers_string; - gchar *prefixed_revision; gchar *supported_capabilities_string; MMModemCapability *capabilities = NULL; guint n_capabilities = 0; @@ -266,7 +301,6 @@ gchar *current_bands_string; gchar *supported_ip_families_string; gchar *unlock_retries_string; - gchar *own_numbers_string; MMModemBand *bands = NULL; guint n_bands = 0; MMModemPortInfo *ports = NULL; @@ -275,14 +309,8 @@ MMUnlockRetries *unlock_retries; guint signal_quality = 0; gboolean signal_quality_recent = FALSE; - gchar *bearer_paths_string; - - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE_UNKNOWN -#define VALIDATE_UNKNOWN(str) (str ? str : "unknown") -#undef VALIDATE_PATH -#define VALIDATE_PATH(str) ((str && !g_str_equal (str, "/")) ? str : "none") + const gchar *sim_path; + const gchar **bearer_paths; /* Strings in heap */ mm_modem_get_supported_capabilities (ctx->modem, &capabilities, &n_capabilities); @@ -315,215 +343,141 @@ unlock_retries_string = mm_unlock_retries_build_string (unlock_retries); g_object_unref (unlock_retries); - if (mm_modem_get_own_numbers (ctx->modem)) { - own_numbers_string = g_strjoinv (", ", (gchar **)mm_modem_get_own_numbers (ctx->modem)); - if (!own_numbers_string[0]) { - g_free (own_numbers_string); - own_numbers_string = NULL; - } - } else - own_numbers_string = NULL; + signal_quality = mm_modem_get_signal_quality (ctx->modem, &signal_quality_recent); - if (mm_modem_get_drivers (ctx->modem)) { - drivers_string = g_strjoinv (", ", (gchar **)mm_modem_get_drivers (ctx->modem)); - if (!drivers_string[0]) { - g_free (drivers_string); - drivers_string = NULL; - } - } else - drivers_string = NULL; + mmcli_output_string (MMC_F_GENERAL_DBUS_PATH, mm_modem_get_path (ctx->modem)); + mmcli_output_string (MMC_F_GENERAL_DEVICE_ID, mm_modem_get_device_identifier (ctx->modem)); - /* Rework possible multiline strings */ - if (mm_modem_get_revision (ctx->modem)) - prefixed_revision = mmcli_prefix_newlines (" | ", - mm_modem_get_revision (ctx->modem)); - else - prefixed_revision = NULL; + mmcli_output_string (MMC_F_HARDWARE_MANUFACTURER, mm_modem_get_manufacturer (ctx->modem)); + mmcli_output_string (MMC_F_HARDWARE_MODEL, mm_modem_get_model (ctx->modem)); + mmcli_output_string (MMC_F_HARDWARE_REVISION, mm_modem_get_revision (ctx->modem)); + mmcli_output_string (MMC_F_HARDWARE_HW_REVISION, mm_modem_get_hardware_revision (ctx->modem)); + mmcli_output_string_multiline (MMC_F_HARDWARE_SUPPORTED_CAPABILITIES, supported_capabilities_string); + mmcli_output_string_multiline (MMC_F_HARDWARE_CURRENT_CAPABILITIES, current_capabilities_string); + mmcli_output_string (MMC_F_HARDWARE_EQUIPMENT_ID, mm_modem_get_equipment_identifier (ctx->modem)); + + mmcli_output_string (MMC_F_SYSTEM_DEVICE, mm_modem_get_device (ctx->modem)); + mmcli_output_string_array (MMC_F_SYSTEM_DRIVERS, (const gchar **) mm_modem_get_drivers (ctx->modem), FALSE); + mmcli_output_string (MMC_F_SYSTEM_PLUGIN, mm_modem_get_plugin (ctx->modem)); + mmcli_output_string (MMC_F_SYSTEM_PRIMARY_PORT, mm_modem_get_primary_port (ctx->modem)); + mmcli_output_string_list (MMC_F_SYSTEM_PORTS, ports_string); + + mmcli_output_string_array (MMC_F_NUMBERS_OWN, (const gchar **) mm_modem_get_own_numbers (ctx->modem), FALSE); + + mmcli_output_string (MMC_F_STATUS_LOCK, mm_modem_lock_get_string (mm_modem_get_unlock_required (ctx->modem))); + mmcli_output_string_list (MMC_F_STATUS_UNLOCK_RETRIES, unlock_retries_string); + mmcli_output_state (mm_modem_get_state (ctx->modem), mm_modem_get_state_failed_reason (ctx->modem)); + mmcli_output_string (MMC_F_STATUS_POWER_STATE, mm_modem_power_state_get_string (mm_modem_get_power_state (ctx->modem))); + mmcli_output_string_list (MMC_F_STATUS_ACCESS_TECH, access_technologies_string); + mmcli_output_signal_quality (signal_quality, signal_quality_recent); + + mmcli_output_string_multiline (MMC_F_MODES_SUPPORTED, supported_modes_string); + mmcli_output_string_take (MMC_F_MODES_CURRENT, g_strdup_printf ("allowed: %s; preferred: %s", + allowed_modes_string, preferred_mode_string)); + + mmcli_output_string_list (MMC_F_BANDS_SUPPORTED, supported_bands_string); + mmcli_output_string_list (MMC_F_BANDS_CURRENT, current_bands_string); + + mmcli_output_string_list (MMC_F_IP_SUPPORTED, supported_ip_families_string); + + /* 3GPP */ + { + const gchar *imei = NULL; + gchar *facility_locks = NULL; + const gchar *operator_code = NULL; + const gchar *operator_name = NULL; + const gchar *registration = NULL; + const gchar *eps_ue_mode = NULL; + GList *pco_list = NULL; + const gchar *initial_eps_bearer_path = NULL; + const gchar *initial_eps_bearer_apn = NULL; + gchar *initial_eps_bearer_ip_family_str = NULL; + const gchar *initial_eps_bearer_user = NULL; + const gchar *initial_eps_bearer_password = NULL; + + if (ctx->modem_3gpp) { + imei = mm_modem_3gpp_get_imei (ctx->modem_3gpp); + facility_locks = mm_modem_3gpp_facility_build_string_from_mask (mm_modem_3gpp_get_enabled_facility_locks (ctx->modem_3gpp)); + operator_code = mm_modem_3gpp_get_operator_code (ctx->modem_3gpp); + operator_name = mm_modem_3gpp_get_operator_name (ctx->modem_3gpp); + registration = mm_modem_3gpp_registration_state_get_string (mm_modem_3gpp_get_registration_state (ctx->modem_3gpp)); + eps_ue_mode = mm_modem_3gpp_eps_ue_mode_operation_get_string (mm_modem_3gpp_get_eps_ue_mode_operation (ctx->modem_3gpp)); + pco_list = mm_modem_3gpp_get_pco (ctx->modem_3gpp); + initial_eps_bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (ctx->modem_3gpp); + + if (mm_modem_get_current_capabilities (ctx->modem) & (MM_MODEM_CAPABILITY_LTE | MM_MODEM_CAPABILITY_LTE_ADVANCED)) { + MMBearerProperties *initial_eps_bearer_properties; + + initial_eps_bearer_properties = mm_modem_3gpp_peek_initial_eps_bearer_settings (ctx->modem_3gpp); + if (initial_eps_bearer_properties) { + initial_eps_bearer_apn = mm_bearer_properties_get_apn (initial_eps_bearer_properties); + initial_eps_bearer_ip_family_str = mm_bearer_ip_family_build_string_from_mask (mm_bearer_properties_get_ip_type (initial_eps_bearer_properties)); + initial_eps_bearer_user = mm_bearer_properties_get_user (initial_eps_bearer_properties); + initial_eps_bearer_password = mm_bearer_properties_get_password (initial_eps_bearer_properties); + } + } + } - if (supported_modes_string) { - gchar *prefixed; + mmcli_output_string (MMC_F_3GPP_IMEI, imei); + mmcli_output_string_list (MMC_F_3GPP_ENABLED_LOCKS, facility_locks); + mmcli_output_string (MMC_F_3GPP_OPERATOR_ID, operator_code); + mmcli_output_string (MMC_F_3GPP_OPERATOR_NAME, operator_name); + mmcli_output_string (MMC_F_3GPP_REGISTRATION, registration); + mmcli_output_string (MMC_F_3GPP_EPS_UE_MODE, eps_ue_mode); + mmcli_output_string (MMC_F_3GPP_EPS_INITIAL_BEARER_PATH, g_strcmp0 (initial_eps_bearer_path, "/") != 0 ? initial_eps_bearer_path : NULL); + mmcli_output_string (MMC_F_3GPP_EPS_BEARER_SETTINGS_APN, initial_eps_bearer_apn); + mmcli_output_string_take (MMC_F_3GPP_EPS_BEARER_SETTINGS_IP_TYPE, initial_eps_bearer_ip_family_str); + mmcli_output_string (MMC_F_3GPP_EPS_BEARER_SETTINGS_USER, initial_eps_bearer_user); + mmcli_output_string (MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD, initial_eps_bearer_password); + mmcli_output_pco_list (pco_list); - prefixed = mmcli_prefix_newlines (" | ", - supported_modes_string); - g_free (supported_modes_string); - supported_modes_string = prefixed; + g_free (facility_locks); + mm_pco_list_free (pco_list); } - if (supported_capabilities_string) { - gchar *prefixed; + /* CDMA */ + { + const gchar *meid = NULL; + const gchar *esn = NULL; + gchar *sid = NULL; + gchar *nid = NULL; + const gchar *registration_cdma1x = NULL; + const gchar *registration_evdo = NULL; + const gchar *activation = NULL; + + if (ctx->modem_cdma) { + guint sid_n; + guint nid_n; + + meid = mm_modem_cdma_get_meid (ctx->modem_cdma); + esn = mm_modem_cdma_get_esn (ctx->modem_cdma); + sid_n = mm_modem_cdma_get_sid (ctx->modem_cdma); + if (sid_n != MM_MODEM_CDMA_SID_UNKNOWN) + sid = g_strdup_printf ("%u", sid_n); + nid_n = mm_modem_cdma_get_nid (ctx->modem_cdma); + if (nid_n != MM_MODEM_CDMA_NID_UNKNOWN) + nid = g_strdup_printf ("%u", nid_n); + registration_cdma1x = mm_modem_cdma_registration_state_get_string (mm_modem_cdma_get_cdma1x_registration_state (ctx->modem_cdma)); + registration_evdo = mm_modem_cdma_registration_state_get_string (mm_modem_cdma_get_evdo_registration_state (ctx->modem_cdma)); + activation = mm_modem_cdma_activation_state_get_string (mm_modem_cdma_get_activation_state (ctx->modem_cdma)); + } - prefixed = mmcli_prefix_newlines (" | ", - supported_capabilities_string); - g_free (supported_capabilities_string); - supported_capabilities_string = prefixed; + mmcli_output_string (MMC_F_CDMA_MEID, meid); + mmcli_output_string (MMC_F_CDMA_ESN, esn); + mmcli_output_string_take (MMC_F_CDMA_SID, sid); + mmcli_output_string_take (MMC_F_CDMA_NID, nid); + mmcli_output_string (MMC_F_CDMA_REGISTRATION_CDMA1X, registration_cdma1x); + mmcli_output_string (MMC_F_CDMA_REGISTRATION_EVDO, registration_evdo); + mmcli_output_string (MMC_F_CDMA_ACTIVATION, activation); } - /* Get signal quality info */ - signal_quality = mm_modem_get_signal_quality (ctx->modem, &signal_quality_recent); + sim_path = mm_modem_get_sim_path (ctx->modem); + mmcli_output_string (MMC_F_SIM_PATH, g_strcmp0 (sim_path, "/") != 0 ? sim_path : NULL); - if (mm_modem_get_bearer_paths (ctx->modem)) { - bearer_paths_string = g_strjoinv (", ", (gchar **)mm_modem_get_bearer_paths (ctx->modem)); - if (!bearer_paths_string[0]) { - g_free (bearer_paths_string); - bearer_paths_string = NULL; - } - } else - bearer_paths_string = NULL; - - /* Global IDs */ - g_print ("\n" - "%s (device id '%s')\n", - VALIDATE_UNKNOWN (mm_modem_get_path (ctx->modem)), - VALIDATE_UNKNOWN (mm_modem_get_device_identifier (ctx->modem))); - - /* Hardware related stuff */ - g_print (" -------------------------\n" - " Hardware | manufacturer: '%s'\n" - " | model: '%s'\n" - " | revision: '%s'\n" - " | supported: '%s'\n" - " | current: '%s'\n" - " | equipment id: '%s'\n", - VALIDATE_UNKNOWN (mm_modem_get_manufacturer (ctx->modem)), - VALIDATE_UNKNOWN (mm_modem_get_model (ctx->modem)), - VALIDATE_UNKNOWN (prefixed_revision), - VALIDATE_UNKNOWN (supported_capabilities_string), - VALIDATE_UNKNOWN (current_capabilities_string), - VALIDATE_UNKNOWN (mm_modem_get_equipment_identifier (ctx->modem))); - - /* System related stuff */ - g_print (" -------------------------\n" - " System | device: '%s'\n" - " | drivers: '%s'\n" - " | plugin: '%s'\n" - " | primary port: '%s'\n" - " | ports: '%s'\n", - VALIDATE_UNKNOWN (mm_modem_get_device (ctx->modem)), - VALIDATE_UNKNOWN (drivers_string), - VALIDATE_UNKNOWN (mm_modem_get_plugin (ctx->modem)), - VALIDATE_UNKNOWN (mm_modem_get_primary_port (ctx->modem)), - VALIDATE_UNKNOWN (ports_string)); - - /* Numbers related stuff */ - g_print (" -------------------------\n" - " Numbers | own : '%s'\n", - VALIDATE_UNKNOWN (own_numbers_string)); - - /* Status related stuff */ - g_print (" -------------------------\n" - " Status | lock: '%s'\n" - " | unlock retries: '%s'\n" - " | state: '%s'\n", - mm_modem_lock_get_string (mm_modem_get_unlock_required (ctx->modem)), - VALIDATE_UNKNOWN (unlock_retries_string), - VALIDATE_UNKNOWN (mm_modem_state_get_string (mm_modem_get_state (ctx->modem)))); - - if (mm_modem_get_state (ctx->modem) == MM_MODEM_STATE_FAILED) - g_print (" | failed reason: '%s'\n", - VALIDATE_UNKNOWN (mm_modem_state_failed_reason_get_string (mm_modem_get_state_failed_reason (ctx->modem)))); - - g_print (" | power state: '%s'\n" - " | access tech: '%s'\n" - " | signal quality: '%u' (%s)\n", - VALIDATE_UNKNOWN (mm_modem_power_state_get_string (mm_modem_get_power_state (ctx->modem))), - VALIDATE_UNKNOWN (access_technologies_string), - signal_quality, signal_quality_recent ? "recent" : "cached"); - - /* Modes */ - g_print (" -------------------------\n" - " Modes | supported: '%s'\n" - " | current: 'allowed: %s; preferred: %s'\n", - VALIDATE_UNKNOWN (supported_modes_string), - VALIDATE_UNKNOWN (allowed_modes_string), - VALIDATE_UNKNOWN (preferred_mode_string)); - - /* Band related stuff */ - g_print (" -------------------------\n" - " Bands | supported: '%s'\n" - " | current: '%s'\n", - VALIDATE_UNKNOWN (supported_bands_string), - VALIDATE_UNKNOWN (current_bands_string)); - - /* IP families */ - g_print (" -------------------------\n" - " IP | supported: '%s'\n", - VALIDATE_UNKNOWN (supported_ip_families_string)); - - /* If available, 3GPP related stuff */ - if (ctx->modem_3gpp) { - gchar *facility_locks; - - facility_locks = (mm_modem_3gpp_facility_build_string_from_mask ( - mm_modem_3gpp_get_enabled_facility_locks (ctx->modem_3gpp))); - g_print (" -------------------------\n" - " 3GPP | imei: '%s'\n" - " | enabled locks: '%s'\n" - " | operator id: '%s'\n" - " | operator name: '%s'\n" - " | subscription: '%s'\n" - " | registration: '%s'\n", - VALIDATE_UNKNOWN (mm_modem_3gpp_get_imei (ctx->modem_3gpp)), - facility_locks, - VALIDATE_UNKNOWN (mm_modem_3gpp_get_operator_code (ctx->modem_3gpp)), - VALIDATE_UNKNOWN (mm_modem_3gpp_get_operator_name (ctx->modem_3gpp)), - mm_modem_3gpp_subscription_state_get_string ( - mm_modem_3gpp_get_subscription_state ((ctx->modem_3gpp))), - mm_modem_3gpp_registration_state_get_string ( - mm_modem_3gpp_get_registration_state ((ctx->modem_3gpp)))); - - g_free (facility_locks); - } + bearer_paths = (const gchar **) mm_modem_get_bearer_paths (ctx->modem); + mmcli_output_string_array (MMC_F_BEARER_PATHS, (bearer_paths && bearer_paths[0]) ? bearer_paths : NULL, TRUE); - /* If available, CDMA related stuff */ - if (ctx->modem_cdma) { - guint sid; - guint nid; - gchar *sid_str; - gchar *nid_str; - - sid = mm_modem_cdma_get_sid (ctx->modem_cdma); - sid_str = (sid != MM_MODEM_CDMA_SID_UNKNOWN ? - g_strdup_printf ("%u", sid) : - NULL); - nid = mm_modem_cdma_get_nid (ctx->modem_cdma); - nid_str = (nid != MM_MODEM_CDMA_NID_UNKNOWN ? - g_strdup_printf ("%u", nid) : - NULL); - - g_print (" -------------------------\n" - " CDMA | meid: '%s'\n" - " | esn: '%s'\n" - " | sid: '%s'\n" - " | nid: '%s'\n" - " | registration: CDMA1x '%s'\n" - " | EV-DO '%s'\n" - " | activation: '%s'\n", - VALIDATE_UNKNOWN (mm_modem_cdma_get_meid (ctx->modem_cdma)), - VALIDATE_UNKNOWN (mm_modem_cdma_get_esn (ctx->modem_cdma)), - VALIDATE_UNKNOWN (sid_str), - VALIDATE_UNKNOWN (nid_str), - mm_modem_cdma_registration_state_get_string ( - mm_modem_cdma_get_cdma1x_registration_state (ctx->modem_cdma)), - mm_modem_cdma_registration_state_get_string ( - mm_modem_cdma_get_evdo_registration_state (ctx->modem_cdma)), - mm_modem_cdma_activation_state_get_string ( - mm_modem_cdma_get_activation_state (ctx->modem_cdma))); - - g_free (sid_str); - g_free (nid_str); - } - - /* SIM */ - g_print (" -------------------------\n" - " SIM | path: '%s'\n", - VALIDATE_PATH (mm_modem_get_sim_path (ctx->modem))); - g_print ("\n"); - - /* Bearers */ - g_print (" -------------------------\n" - " Bearers | paths: '%s'\n", - VALIDATE_PATH (bearer_paths_string)); - g_print ("\n"); + mmcli_output_dump (); g_free (ports_string); g_free (supported_ip_families_string); @@ -532,14 +486,10 @@ g_free (access_technologies_string); g_free (supported_capabilities_string); g_free (current_capabilities_string); - g_free (prefixed_revision); g_free (allowed_modes_string); g_free (preferred_mode_string); g_free (supported_modes_string); g_free (unlock_retries_string); - g_free (own_numbers_string); - g_free (drivers_string); - g_free (bearer_paths_string); } static void @@ -722,48 +672,6 @@ } static void -list_bearers_process_reply (GList *result, - const GError *error) -{ - if (error) { - g_printerr ("error: couldn't list bearers: '%s'\n", - error->message); - exit (EXIT_FAILURE); - } - - g_print ("\n"); - if (!result) { - g_print ("No bearers were found\n"); - } else { - GList *l; - - g_print ("Found %u bearers:\n", g_list_length (result)); - for (l = result; l; l = g_list_next (l)) { - MMBearer *bearer = MM_BEARER (l->data); - - g_print ("\n"); - print_bearer_short_info (bearer); - g_object_unref (bearer); - } - g_list_free (result); - } -} - -static void -list_bearers_ready (MMModem *modem, - GAsyncResult *result, - gpointer nothing) -{ - GList *operation_result; - GError *error = NULL; - - operation_result = mm_modem_list_bearers_finish (modem, result, &error); - list_bearers_process_reply (operation_result, error); - - mmcli_async_operation_done (); -} - -static void create_bearer_process_reply (MMBearer *bearer, const GError *error) { @@ -1127,16 +1035,6 @@ return; } - /* Request to list bearers? */ - if (list_bearers_flag) { - g_debug ("Asynchronously listing bearers in modem..."); - mm_modem_list_bearers (ctx->modem, - ctx->cancellable, - (GAsyncReadyCallback)list_bearers_ready, - NULL); - return; - } - /* Request to create a new bearer? */ if (create_bearer_str) { GError *error = NULL; @@ -1212,6 +1110,21 @@ return; } + /* Request to inhibit the modem? */ + if (inhibit_flag) { + gchar *uid; + + g_debug ("Asynchronously inhibiting modem..."); + uid = mm_modem_dup_device (ctx->modem); + + mm_manager_inhibit_device (ctx->manager, + uid, + ctx->cancellable, + (GAsyncReadyCallback)inhibit_device_ready, + uid); + return; + } + g_warn_if_reached (); } @@ -1238,7 +1151,7 @@ { GError *error = NULL; - if (monitor_state_flag) + if (monitor_state_flag || inhibit_flag) g_assert_not_reached (); /* Initialize context */ @@ -1358,16 +1271,6 @@ return; } - /* Request to list the bearers? */ - if (list_bearers_flag) { - GList *result; - - g_debug ("Synchronously listing bearers..."); - result = mm_modem_list_bearers_sync (ctx->modem, NULL, &error); - list_bearers_process_reply (result, error); - return; - } - /* Request to create a new bearer? */ if (create_bearer_str) { MMBearer *bearer; diff -Nru modemmanager-1.6.8/cli/mmcli-modem-firmware.c modemmanager-1.10.0/cli/mmcli-modem-firmware.c --- modemmanager-1.6.8/cli/mmcli-modem-firmware.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-firmware.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -44,10 +45,15 @@ static Context *ctx; /* Options */ +static gboolean status_flag; static gboolean list_flag; static gchar *select_str; static GOptionEntry entries[] = { + { "firmware-status", 0, 0, G_OPTION_ARG_NONE, &status_flag, + "Show status of firmware management.", + NULL + }, { "firmware-list", 0, 0, G_OPTION_ARG_NONE, &list_flag, "List firmware images installed in a given modem", NULL @@ -83,7 +89,8 @@ if (checked) return !!n_actions; - n_actions = (list_flag + + n_actions = (status_flag + + list_flag + !!select_str); if (n_actions > 1) { @@ -91,6 +98,9 @@ exit (EXIT_FAILURE); } + if (status_flag) + mmcli_force_sync_operation (); + checked = TRUE; return !!n_actions; } @@ -130,6 +140,49 @@ } static void +print_firmware_status (void) +{ + MMFirmwareUpdateSettings *update_settings; + gchar *method = NULL; + const gchar **device_ids = NULL; + const gchar *version = NULL; + const gchar *fastboot_at = NULL; + + update_settings = mm_modem_firmware_peek_update_settings (ctx->modem_firmware); + if (update_settings) { + MMModemFirmwareUpdateMethod m; + + m = mm_firmware_update_settings_get_method (update_settings); + if (m != MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE) { + method = mm_modem_firmware_update_method_build_string_from_mask (m); + device_ids = mm_firmware_update_settings_get_device_ids (update_settings); + version = mm_firmware_update_settings_get_version (update_settings); + } + + if (m & MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT) + fastboot_at = mm_firmware_update_settings_get_fastboot_at (update_settings); + } + + /* There's not much to print in this status info, and if the modem + * does not support any firmware update method, we would just be returning + * an empty response to the --firmware-status action. So, instead, just + * return an error message explicitly when in human output type. + * We can remove this error message as soon as there is some parameter + * that will always be printed. + */ + if (!method && !fastboot_at && mmcli_output_get () == MMC_OUTPUT_TYPE_HUMAN) { + g_printerr ("error: firmware status unsupported\n"); + exit (EXIT_FAILURE); + } + + mmcli_output_string_list_take (MMC_F_FIRMWARE_METHOD, method); + mmcli_output_string_array (MMC_F_FIRMWARE_DEVICE_IDS, device_ids, TRUE); + mmcli_output_string (MMC_F_FIRMWARE_VERSION, version); + mmcli_output_string (MMC_F_FIRMWARE_FASTBOOT_AT, fastboot_at); + mmcli_output_dump (); +} + +static void list_process_reply (MMFirmwareProperties *selected, GList *result, const GError *error) @@ -143,48 +196,11 @@ exit (EXIT_FAILURE); } - g_print ("\n"); - if (!result) { - g_print ("No firmware images were found\n"); - } else { - GList *l; - guint i; - - g_print ("Found %u firmware images:\n", g_list_length (result)); - for (l = result, i = 0; l; l = g_list_next (l), i++) { - MMFirmwareProperties *props = MM_FIRMWARE_PROPERTIES (l->data); - - g_print ("\t[%u] %s%s\n" - "\t\tType: '%s'\n", - i, - mm_firmware_properties_get_unique_id (props), - ((selected && - g_str_equal (mm_firmware_properties_get_unique_id (props), - mm_firmware_properties_get_unique_id (selected))) ? - " (CURRENT)" : ""), - mm_firmware_image_type_get_string ( - mm_firmware_properties_get_image_type (props))); - - if (mm_firmware_properties_get_image_type (props) == MM_FIRMWARE_IMAGE_TYPE_GOBI) { - g_print ("\t\t[Gobi] PRI version: '%s'\n" - "\t\t[Gobi] PRI info: '%s'\n" - "\t\t[Gobi] Boot version: '%s'\n" - "\t\t[Gobi] PRI Unique ID: '%s'\n" - "\t\t[Gobi] Modem Unique ID: '%s'\n", - VALIDATE_UNKNOWN (mm_firmware_properties_get_gobi_pri_version (props)), - VALIDATE_UNKNOWN (mm_firmware_properties_get_gobi_pri_info (props)), - VALIDATE_UNKNOWN (mm_firmware_properties_get_gobi_boot_version (props)), - VALIDATE_UNKNOWN (mm_firmware_properties_get_gobi_pri_unique_id (props)), - VALIDATE_UNKNOWN (mm_firmware_properties_get_gobi_modem_unique_id (props))); - } + mmcli_output_firmware_list (result, selected); + mmcli_output_dump (); - g_object_unref (props); - } - g_list_free (result); - } - - if (selected) - g_object_unref (selected); + g_list_free_full (result, g_object_unref); + g_clear_object (&selected); } static void @@ -241,6 +257,9 @@ ensure_modem_firmware (); + if (status_flag) + g_assert_not_reached (); + /* Request to list images? */ if (list_flag) { g_debug ("Asynchronously listing firmware images in modem..."); @@ -300,6 +319,13 @@ ensure_modem_firmware (); + /* Request to get firmware status? */ + if (status_flag) { + g_debug ("Printing firmware status..."); + print_firmware_status (); + return; + } + /* Request to list firmware images? */ if (list_flag) { GList *installed = NULL; diff -Nru modemmanager-1.6.8/cli/mmcli-modem-location.c modemmanager-1.10.0/cli/mmcli-modem-location.c --- modemmanager-1.6.8/cli/mmcli-modem-location.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-location.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -48,24 +49,21 @@ static gboolean status_flag; static gboolean enable_3gpp_flag; static gboolean disable_3gpp_flag; -static gboolean get_3gpp_flag; static gboolean enable_agps_flag; static gboolean disable_agps_flag; static gboolean enable_gps_nmea_flag; static gboolean disable_gps_nmea_flag; -static gboolean get_gps_nmea_flag; static gboolean enable_gps_raw_flag; static gboolean disable_gps_raw_flag; -static gboolean get_gps_raw_flag; static gboolean enable_cdma_bs_flag; static gboolean disable_cdma_bs_flag; -static gboolean get_cdma_bs_flag; static gboolean enable_gps_unmanaged_flag; static gboolean disable_gps_unmanaged_flag; static gboolean set_enable_signal_flag; static gboolean set_disable_signal_flag; -static gboolean get_all_flag; +static gboolean get_flag; static gchar *set_supl_server_str; +static gchar *inject_assistance_data_str; static gchar *set_gps_refresh_rate_str; static GOptionEntry entries[] = { @@ -73,7 +71,7 @@ "Show status of location gathering.", NULL }, - { "location-get", 0, 0, G_OPTION_ARG_NONE, &get_all_flag, + { "location-get", 0, 0, G_OPTION_ARG_NONE, &get_flag, "Get all available location information.", NULL }, @@ -85,10 +83,6 @@ "Disable 3GPP location gathering.", NULL }, - { "location-get-3gpp", 0, 0, G_OPTION_ARG_NONE, &get_3gpp_flag, - "Get 3GPP-based location.", - NULL - }, { "location-enable-agps", 0, 0, G_OPTION_ARG_NONE, &enable_agps_flag, "Enable A-GPS location gathering.", NULL @@ -105,10 +99,6 @@ "Disable NMEA-based GPS location gathering.", NULL }, - { "location-get-gps-nmea", 0, 0, G_OPTION_ARG_NONE, &get_gps_nmea_flag, - "Get NMEA GPS traces.", - NULL - }, { "location-enable-gps-raw", 0, 0, G_OPTION_ARG_NONE, &enable_gps_raw_flag, "Enable raw GPS location gathering.", NULL @@ -117,10 +107,6 @@ "Disable raw GPS location gathering.", NULL }, - { "location-get-gps-raw", 0, 0, G_OPTION_ARG_NONE, &get_gps_raw_flag, - "Get raw GPS location.", - NULL - }, { "location-enable-cdma-bs", 0, 0, G_OPTION_ARG_NONE, &enable_cdma_bs_flag, "Enable CDMA base station location gathering.", NULL @@ -129,10 +115,6 @@ "Disable CDMA base station location gathering.", NULL }, - { "location-get-cdma-bs", 0, 0, G_OPTION_ARG_NONE, &get_cdma_bs_flag, - "Get CDMA base station location.", - NULL - }, { "location-enable-gps-unmanaged", 0, 0, G_OPTION_ARG_NONE, &enable_gps_unmanaged_flag, "Enable unmanaged GPS location gathering.", NULL @@ -143,7 +125,11 @@ }, { "location-set-supl-server", 0, 0, G_OPTION_ARG_STRING, &set_supl_server_str, "Set SUPL server address", - "[IP:PORT] or [URL]" + "[IP:PORT] or [FQDN:PORT]" + }, + { "location-inject-assistance-data", 0, 0, G_OPTION_ARG_FILENAME, &inject_assistance_data_str, + "Inject assistance data in the GNSS module", + "[PATH]" }, { "location-set-gps-refresh-rate", 0, 0, G_OPTION_ARG_STRING, &set_gps_refresh_rate_str, "Set GPS refresh rate in seconds, or 0 disable the explicit rate.", @@ -199,13 +185,6 @@ exit (EXIT_FAILURE); } - if (get_all_flag) { - get_3gpp_flag = TRUE; - get_gps_nmea_flag = TRUE; - get_gps_raw_flag = TRUE; - get_cdma_bs_flag = TRUE; - } - n_actions = (status_flag + !!(enable_3gpp_flag + disable_3gpp_flag + @@ -221,11 +200,9 @@ disable_gps_unmanaged_flag + set_enable_signal_flag + set_disable_signal_flag) + - !!(get_3gpp_flag + - get_gps_nmea_flag + - get_gps_raw_flag + - get_cdma_bs_flag) + + get_flag + !!set_supl_server_str + + !!inject_assistance_data_str + !!set_gps_refresh_rate_str); if (n_actions > 1) { @@ -282,49 +259,46 @@ static void print_location_status (void) { - gchar *capabilities_str; - gchar *enabled_str; - - capabilities_str = (mm_modem_location_source_build_string_from_mask ( - mm_modem_location_get_capabilities (ctx->modem_location))); - enabled_str = (mm_modem_location_source_build_string_from_mask ( - mm_modem_location_get_enabled (ctx->modem_location))); - g_print ("\n" - "%s\n" - " ----------------------------\n" - " Location | capabilities: '%s'\n" - " | enabled: '%s'\n" - " | signals: '%s'\n", - mm_modem_location_get_path (ctx->modem_location), - capabilities_str, - enabled_str, - mm_modem_location_signals_location (ctx->modem_location) ? "yes" : "no"); - - /* If A-GPS supported, show SUPL server setup */ - if (mm_modem_location_get_capabilities (ctx->modem_location) & MM_MODEM_LOCATION_SOURCE_AGPS) { - const gchar *supl_server; - - supl_server = mm_modem_location_get_supl_server (ctx->modem_location); - g_print (" ----------------------------\n" - " A-GPS | SUPL server: '%s'\n", - supl_server ? supl_server : "unset"); - } - - /* If GPS supported, show GPS refresh rate */ - if (mm_modem_location_get_capabilities (ctx->modem_location) & (MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_NMEA)) { - guint rate; + gchar *capabilities; + gchar *enabled; + gchar *gps_refresh_rate = NULL; + const gchar *gps_supl_server = NULL; + gchar *gps_assistance = NULL; + const gchar **gps_assistance_servers = NULL; + + capabilities = (mm_modem_location_source_build_string_from_mask ( + mm_modem_location_get_capabilities (ctx->modem_location))); + enabled = (mm_modem_location_source_build_string_from_mask ( + mm_modem_location_get_enabled (ctx->modem_location))); + + /* If GPS supported, show GPS refresh rate and supported assistance data */ + if (mm_modem_location_get_capabilities (ctx->modem_location) & (MM_MODEM_LOCATION_SOURCE_GPS_RAW | MM_MODEM_LOCATION_SOURCE_GPS_NMEA)) { + guint rate; + MMModemLocationAssistanceDataType mask; rate = mm_modem_location_get_gps_refresh_rate (ctx->modem_location); - g_print (" ----------------------------\n"); - if (rate > 0) - g_print (" GPS | refresh rate: '%u'\n", rate); - else - g_print (" GPS | refresh rate: disabled\n"); - } + gps_refresh_rate = g_strdup_printf ("%u", rate); - g_free (capabilities_str); - g_free (enabled_str); + /* If A-GPS supported, show SUPL server setup */ + if (mm_modem_location_get_capabilities (ctx->modem_location) & MM_MODEM_LOCATION_SOURCE_AGPS) + gps_supl_server = mm_modem_location_get_supl_server (ctx->modem_location); + + mask = mm_modem_location_get_supported_assistance_data (ctx->modem_location); + gps_assistance = mm_modem_location_assistance_data_type_build_string_from_mask (mask); + + /* If any assistance data supported, show server list */ + if (mask != MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE) + gps_assistance_servers = mm_modem_location_get_assistance_data_servers (ctx->modem_location); + } + + mmcli_output_string_list_take (MMC_F_LOCATION_CAPABILITIES, capabilities); + mmcli_output_string_list_take (MMC_F_LOCATION_ENABLED, enabled); + mmcli_output_string (MMC_F_LOCATION_SIGNALS, mm_modem_location_signals_location (ctx->modem_location) ? "yes" : "no"); + mmcli_output_string_take_typed (MMC_F_LOCATION_GPS_REFRESH_RATE, gps_refresh_rate, "seconds"); + mmcli_output_string (MMC_F_LOCATION_GPS_SUPL_SERVER, gps_supl_server); + mmcli_output_string_list_take (MMC_F_LOCATION_GPS_ASSISTANCE, gps_assistance); + mmcli_output_string_array (MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS, gps_assistance_servers, TRUE); + mmcli_output_dump (); } static void @@ -379,6 +353,65 @@ mmcli_async_operation_done (); } +static gboolean +parse_inject_assistance_data (guint8 **o_data, + gsize *o_data_size) +{ + gboolean result = FALSE; + GFile *file = NULL; + gchar *data; + gsize data_size; + GError *error = NULL; + + file = g_file_new_for_commandline_arg (inject_assistance_data_str); + + if (!g_file_load_contents (file, NULL, &data, &data_size, NULL, &error)) { + g_printerr ("error: cannot load file contents: %s\n", error->message); + goto out; + } + + if (data_size == 0) { + g_printerr ("error: file is empty\n"); + goto out; + } + + *o_data = (guint8 *)data; + *o_data_size = data_size; + result = TRUE; + +out: + if (error) + g_error_free (error); + g_object_unref (file); + return result; +} + +static void +inject_assistance_data_process_reply (gboolean result, + const GError *error) +{ + if (!result) { + g_printerr ("error: couldn't inject assistance data: '%s'\n", + error ? error->message : "unknown error"); + exit (EXIT_FAILURE); + } + + g_print ("successfully injected assistance data\n"); +} + +static void +inject_assistance_data_ready (MMModemLocation *modem_location, + GAsyncResult *result) +{ + gboolean operation_result; + GError *error = NULL; + + operation_result = mm_modem_location_inject_assistance_data_finish (modem_location, result, &error); + inject_assistance_data_process_reply (operation_result, error); + + mmcli_async_operation_done (); +} + static void set_gps_refresh_rate_process_reply (gboolean result, const GError *error) @@ -463,123 +496,71 @@ MMLocationCdmaBs *location_cdma_bs, const GError *error) { - /* First, check for failures */ - if (!get_all_flag) { - gboolean exit_error = FALSE; - - if (get_3gpp_flag && !location_3gpp) { - g_printerr ("error: couldn't get 3GPP-based location from the modem: '%s'\n", - error ? error->message : "not available"); - exit_error = TRUE; - } - - if (get_gps_nmea_flag && !location_gps_nmea) { - g_printerr ("error: couldn't get NMEA GPS traces from the modem: '%s'\n", - error ? error->message : "not available"); - exit_error = TRUE; - } - - if (get_gps_raw_flag && !location_gps_raw) { - g_printerr ("error: couldn't get raw GPS location from the modem: '%s'\n", - error ? error->message : "not available"); - exit_error = TRUE; - } - - if (get_cdma_bs_flag && !location_cdma_bs) { - g_printerr ("error: couldn't get CDMA base station location from the modem: '%s'\n", - error ? error->message : "not available"); - exit_error = TRUE; - } + gchar *nmea = NULL; + gchar *mcc = NULL; + gchar *mnc = NULL; + gchar *lac = NULL; + gchar *tac = NULL; + gchar *cid = NULL; + const gchar *gps_utc = NULL; + gchar *gps_longitude = NULL; + gchar *gps_latitude = NULL; + gchar *gps_altitude = NULL; + gchar *cdma_bs_longitude = NULL; + gchar *cdma_bs_latitude = NULL; - if (exit_error) - exit (EXIT_FAILURE); - } else if (error) { + if (error) { g_printerr ("error: couldn't get location from the modem: '%s'\n", error ? error->message : "unknown error"); exit (EXIT_FAILURE); } - g_print ("\n" - "%s\n", - mm_modem_location_get_path (ctx->modem_location)); - - if (get_3gpp_flag) { - if (location_3gpp) - g_print (" -------------------------\n" - " 3GPP location | Mobile country code: '%u'\n" - " | Mobile network code: '%u'\n" - " | Location area code: '%lu'\n" - " | Cell ID: '%lu'\n", - mm_location_3gpp_get_mobile_country_code (location_3gpp), - mm_location_3gpp_get_mobile_network_code (location_3gpp), - mm_location_3gpp_get_location_area_code (location_3gpp), - mm_location_3gpp_get_cell_id (location_3gpp)); - else - g_print (" -------------------------\n" - " 3GPP location | Not available\n"); - } - - if (get_gps_nmea_flag) { - gchar *full = NULL; - - if (location_gps_nmea) - full = mm_location_gps_nmea_build_full (location_gps_nmea); - - if (full) { - gchar *prefixed; - - prefixed = mmcli_prefix_newlines (" | ", full); - g_print (" -------------------------\n" - " GPS NMEA traces | %s\n", - prefixed); - g_free (prefixed); - g_free (full); - } else - g_print (" -------------------------\n" - " GPS NMEA traces | Not available\n"); - } - - if (get_gps_raw_flag) { - if (location_gps_raw) - g_print (" -------------------------\n" - " Raw GPS | UTC time: '%s'\n" - " | Longitude: '%lf'\n" - " | Latitude: '%lf'\n" - " | Altitude: '%lf'\n", - mm_location_gps_raw_get_utc_time (location_gps_raw), - mm_location_gps_raw_get_longitude (location_gps_raw), - mm_location_gps_raw_get_latitude (location_gps_raw), - mm_location_gps_raw_get_altitude (location_gps_raw)); - else - g_print (" -------------------------\n" - " Raw GPS | Not available\n"); - } - - if (get_cdma_bs_flag) { - if (location_cdma_bs) - g_print (" -------------------------\n" - " CDMA BS | Longitude: '%lf'\n" - " | Latitude: '%lf'\n", - mm_location_cdma_bs_get_longitude (location_cdma_bs), - mm_location_cdma_bs_get_latitude (location_cdma_bs)); - else - g_print (" -------------------------\n" - " CDMA BS | Not available\n"); + if (location_3gpp) { + mcc = g_strdup_printf ("%u", mm_location_3gpp_get_mobile_country_code (location_3gpp)); + mnc = g_strdup_printf ("%u", mm_location_3gpp_get_mobile_network_code (location_3gpp)); + lac = g_strdup_printf ("%04lX", mm_location_3gpp_get_location_area_code (location_3gpp)); + tac = g_strdup_printf ("%04lX", mm_location_3gpp_get_tracking_area_code (location_3gpp)); + cid = g_strdup_printf ("%08lX", mm_location_3gpp_get_cell_id (location_3gpp)); } - if (location_3gpp) - g_object_unref (location_3gpp); if (location_gps_nmea) - g_object_unref (location_gps_nmea); - if (location_gps_raw) - g_object_unref (location_gps_raw); - if (location_cdma_bs) - g_object_unref (location_cdma_bs); + nmea = mm_location_gps_nmea_build_full (location_gps_nmea); + + if (location_gps_raw) { + gps_utc = mm_location_gps_raw_get_utc_time (location_gps_raw); + gps_longitude = g_strdup_printf ("%lf", mm_location_gps_raw_get_longitude (location_gps_raw)); + gps_latitude = g_strdup_printf ("%lf", mm_location_gps_raw_get_latitude (location_gps_raw)); + gps_altitude = g_strdup_printf ("%lf", mm_location_gps_raw_get_altitude (location_gps_raw)); + } + + if (location_cdma_bs) { + cdma_bs_longitude = g_strdup_printf ("%lf", mm_location_cdma_bs_get_longitude (location_cdma_bs)); + cdma_bs_latitude = g_strdup_printf ("%lf", mm_location_cdma_bs_get_latitude (location_cdma_bs)); + } + + mmcli_output_string_take (MMC_F_LOCATION_3GPP_MCC, mcc); + mmcli_output_string_take (MMC_F_LOCATION_3GPP_MNC, mnc); + mmcli_output_string_take (MMC_F_LOCATION_3GPP_LAC, lac); + mmcli_output_string_take (MMC_F_LOCATION_3GPP_TAC, tac); + mmcli_output_string_take (MMC_F_LOCATION_3GPP_CID, cid); + mmcli_output_string_multiline_take (MMC_F_LOCATION_GPS_NMEA, nmea); + mmcli_output_string (MMC_F_LOCATION_GPS_UTC, gps_utc); + mmcli_output_string_take (MMC_F_LOCATION_GPS_LONG, gps_longitude); + mmcli_output_string_take (MMC_F_LOCATION_GPS_LAT, gps_latitude); + mmcli_output_string_take (MMC_F_LOCATION_GPS_ALT, gps_altitude); + mmcli_output_string_take (MMC_F_LOCATION_CDMABS_LONG, cdma_bs_longitude); + mmcli_output_string_take (MMC_F_LOCATION_CDMABS_LAT, cdma_bs_latitude); + mmcli_output_dump (); + + g_clear_object (&location_3gpp); + g_clear_object (&location_gps_nmea); + g_clear_object (&location_gps_raw); + g_clear_object (&location_cdma_bs); } static void -get_location_ready (MMModemLocation *modem_location, - GAsyncResult *result) +get_location_ready (MMModemLocation *modem_location, + GAsyncResult *result) { MMLocation3gpp *location_3gpp = NULL; MMLocationGpsNmea *location_gps_nmea = NULL; @@ -589,13 +570,12 @@ mm_modem_location_get_full_finish (modem_location, result, - get_3gpp_flag ? &location_3gpp : NULL, - get_gps_nmea_flag ? &location_gps_nmea : NULL, - get_gps_raw_flag ? &location_gps_raw : NULL, - get_cdma_bs_flag ? &location_cdma_bs : NULL, + &location_3gpp, + &location_gps_nmea, + &location_gps_raw, + &location_cdma_bs, &error); get_location_process_reply (location_3gpp, location_gps_nmea, location_gps_raw, location_cdma_bs, error); - mmcli_async_operation_done (); } @@ -642,10 +622,7 @@ } /* Request to get location from the modem? */ - if (get_3gpp_flag || - get_gps_nmea_flag || - get_gps_raw_flag || - get_cdma_bs_flag) { + if (get_flag) { g_debug ("Asynchronously getting location from the modem..."); mm_modem_location_get_full (ctx->modem_location, ctx->cancellable, @@ -665,6 +642,27 @@ return; } + /* Request to inject assistance data? */ + if (inject_assistance_data_str) { + guint8 *data; + gsize data_size; + + if (!parse_inject_assistance_data (&data, &data_size)) { + g_printerr ("error: couldn't inject assistance data: invalid parameters given: '%s'\n", + inject_assistance_data_str); + exit (EXIT_FAILURE); + } + + g_debug ("Asynchronously injecting assistance data..."); + mm_modem_location_inject_assistance_data (ctx->modem_location, + data, data_size, + ctx->cancellable, + (GAsyncReadyCallback)inject_assistance_data_ready, + NULL); + g_free (data); + return; + } + /* Request to set GPS refresh rate? */ if (set_gps_refresh_rate_str) { guint rate; @@ -756,10 +754,7 @@ } /* Request to get location from the modem? */ - if (get_3gpp_flag || - get_gps_nmea_flag || - get_gps_raw_flag || - get_cdma_bs_flag) { + if (get_flag) { MMLocation3gpp *location_3gpp = NULL; MMLocationGpsNmea *location_gps_nmea = NULL; MMLocationGpsRaw *location_gps_raw = NULL; @@ -767,10 +762,10 @@ g_debug ("Synchronously getting location from the modem..."); mm_modem_location_get_full_sync (ctx->modem_location, - get_3gpp_flag ? &location_3gpp : NULL, - get_gps_nmea_flag ? &location_gps_nmea : NULL, - get_gps_raw_flag ? &location_gps_raw : NULL, - get_cdma_bs_flag ? &location_cdma_bs : NULL, + &location_3gpp, + &location_gps_nmea, + &location_gps_raw, + &location_cdma_bs, NULL, &error); get_location_process_reply (location_3gpp, location_gps_nmea, location_gps_raw, location_cdma_bs, error); @@ -790,6 +785,28 @@ return; } + /* Request to inject assistance data? */ + if (inject_assistance_data_str) { + gboolean result; + guint8 *data; + gsize data_size; + + if (!parse_inject_assistance_data (&data, &data_size)) { + g_printerr ("error: couldn't inject assistance data: invalid parameters given: '%s'\n", + inject_assistance_data_str); + exit (EXIT_FAILURE); + } + + g_debug ("Synchronously setting assistance data..."); + result = mm_modem_location_inject_assistance_data_sync (ctx->modem_location, + data, data_size, + NULL, + &error); + inject_assistance_data_process_reply (result, error); + g_free (data); + return; + } + /* Request to set GPS refresh rate? */ if (set_gps_refresh_rate_str) { gboolean result; diff -Nru modemmanager-1.6.8/cli/mmcli-modem-messaging.c modemmanager-1.10.0/cli/mmcli-modem-messaging.c --- modemmanager-1.6.8/cli/mmcli-modem-messaging.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-messaging.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -208,64 +209,47 @@ print_messaging_status (void) { MMSmsStorage *supported = NULL; - guint supported_len = 0; - gchar *supported_str = NULL; + guint supported_len = 0; + gchar *supported_str = NULL; - mm_modem_messaging_get_supported_storages (ctx->modem_messaging, - &supported, - &supported_len); + mm_modem_messaging_get_supported_storages (ctx->modem_messaging, &supported, &supported_len); if (supported) supported_str = mm_common_build_sms_storages_string (supported, supported_len); -#undef VALIDATE_UNKNOWN -#define VALIDATE_UNKNOWN(str) (str ? str : "unknown") - - g_print ("\n" - "%s\n" - " ----------------------------\n" - " Messaging | supported storages: '%s'\n" - " | default storage: '%s'\n", - mm_modem_messaging_get_path (ctx->modem_messaging), - VALIDATE_UNKNOWN (supported_str), - VALIDATE_UNKNOWN (mm_sms_storage_get_string ( - mm_modem_messaging_get_default_storage ( - ctx->modem_messaging)))); - g_free (supported_str); + mmcli_output_string_take (MMC_F_MESSAGING_SUPPORTED_STORAGES, supported_str); + mmcli_output_string (MMC_F_MESSAGING_DEFAULT_STORAGES, mm_sms_storage_get_string ( + mm_modem_messaging_get_default_storage (ctx->modem_messaging))); + mmcli_output_dump (); } static void -print_sms_short_info (MMSms *sms) +output_sms_info (MMSms *sms) { - g_print ("\t%s (%s)\n", - mm_sms_get_path (sms), - mm_sms_state_get_string (mm_sms_get_state (sms))); + gchar *extra; + + extra = g_strdup_printf ("(%s)", mm_sms_state_get_string (mm_sms_get_state (sms))); + mmcli_output_listitem (MMC_F_SMS_LIST_DBUS_PATH, + " ", + mm_sms_get_path (sms), + extra); + g_free (extra); } static void list_process_reply (GList *result, const GError *error) { + GList *l; + if (error) { g_printerr ("error: couldn't list SMS: '%s'\n", error->message); exit (EXIT_FAILURE); } - g_print ("\n"); - if (!result) { - g_print ("No SMS messages were found\n"); - } else { - GList *l; - - g_print ("Found %u SMS messages:\n", g_list_length (result)); - for (l = result; l; l = g_list_next (l)) { - MMSms *sms = MM_SMS (l->data); - - print_sms_short_info (sms); - g_object_unref (sms); - } - g_list_free (result); - } + for (l = result; l; l = g_list_next (l)) + output_sms_info (MM_SMS (l->data)); + mmcli_output_list_dump (MMC_F_SMS_LIST_DBUS_PATH); } static void @@ -292,8 +276,7 @@ exit (EXIT_FAILURE); } - g_print ("Successfully created new SMS:\n"); - print_sms_short_info (sms); + g_print ("Successfully created new SMS: %s\n", mm_sms_get_path (sms)); g_object_unref (sms); } diff -Nru modemmanager-1.6.8/cli/mmcli-modem-oma.c modemmanager-1.10.0/cli/mmcli-modem-oma.c --- modemmanager-1.6.8/cli/mmcli-modem-oma.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-oma.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -160,32 +161,19 @@ static void print_oma_status (void) { - gchar *features_str; + gchar *features_str; const MMOmaPendingNetworkInitiatedSession *pending_sessions; - guint n_pending_sessions; - -#undef VALIDATE_UNKNOWN -#define VALIDATE_UNKNOWN(str) (str ? str : "unknown") + guint n_pending_sessions; + const gchar *current_session_type = NULL; + const gchar *current_session_state = NULL; + GPtrArray *aux = NULL; features_str = mm_oma_feature_build_string_from_mask (mm_modem_oma_get_features (ctx->modem_oma)); - /* Global IDs */ - g_print ("\n" - "%s\n", - VALIDATE_UNKNOWN (mm_modem_oma_get_path (ctx->modem_oma))); - - /* Overall setup */ - g_print (" -------------------------\n" - " Setup | features: '%s'\n", - VALIDATE_UNKNOWN (features_str)); - /* Current session */ if (mm_modem_oma_get_session_type (ctx->modem_oma) != MM_OMA_SESSION_TYPE_UNKNOWN) { - g_print (" -------------------------\n" - " Current session | type: '%s'\n" - " | state: '%s'\n", - VALIDATE_UNKNOWN (mm_oma_session_type_get_string (mm_modem_oma_get_session_type (ctx->modem_oma))), - VALIDATE_UNKNOWN (mm_oma_session_state_get_string (mm_modem_oma_get_session_state (ctx->modem_oma)))); + current_session_type = mm_oma_session_type_get_string (mm_modem_oma_get_session_type (ctx->modem_oma)); + current_session_state = mm_oma_session_state_get_string (mm_modem_oma_get_session_state (ctx->modem_oma)); } /* If 1 or more pending sessions... */ @@ -193,18 +181,24 @@ n_pending_sessions > 0) { guint i; - g_print (" -------------------------\n" - " Pending sessions |\n"); + aux = g_ptr_array_new (); + for (i = 0; i < n_pending_sessions; i++) { - g_print (" [%u] | type: '%s'\n" - " | id: '%u'\n", - i, - VALIDATE_UNKNOWN (mm_oma_session_type_get_string (pending_sessions[i].session_type)), - pending_sessions[i].session_id); + gchar *info; + + info = g_strdup_printf ("id: %u, type: %s", + pending_sessions[i].session_id, + mm_oma_session_type_get_string (pending_sessions[i].session_type)); + g_ptr_array_add (aux, info); } + g_ptr_array_add (aux, NULL); } - g_free (features_str); + mmcli_output_string_take (MMC_F_OMA_FEATURES, features_str); + mmcli_output_string (MMC_F_OMA_CURRENT_TYPE, current_session_type); + mmcli_output_string (MMC_F_OMA_CURRENT_STATE, current_session_state); + mmcli_output_string_array_take (MMC_F_OMA_PENDING_SESSIONS, aux ? (gchar **) g_ptr_array_free (aux, FALSE) : NULL, TRUE); + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/cli/mmcli-modem-signal.c modemmanager-1.10.0/cli/mmcli-modem-signal.c --- modemmanager-1.6.8/cli/mmcli-modem-signal.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-signal.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -136,66 +137,89 @@ print_signal_info (void) { MMSignal *signal; + gdouble value; + gchar *refresh_rate; + gchar *cdma1x_rssi = NULL; + gchar *cdma1x_ecio = NULL; + gchar *evdo_rssi = NULL; + gchar *evdo_ecio = NULL; + gchar *evdo_sinr = NULL; + gchar *evdo_io = NULL; + gchar *gsm_rssi = NULL; + gchar *umts_rssi = NULL; + gchar *umts_rscp = NULL; + gchar *umts_ecio = NULL; + gchar *lte_rssi = NULL; + gchar *lte_rsrp = NULL; + gchar *lte_rsrq = NULL; + gchar *lte_snr = NULL; - g_print ("\n" - "%s\n" - " -------------------------\n" - " Refresh rate: '%u' seconds\n", - mm_modem_signal_get_path (ctx->modem_signal), - mm_modem_signal_get_rate (ctx->modem_signal)); + refresh_rate = g_strdup_printf ("%u", mm_modem_signal_get_rate (ctx->modem_signal)); - /* CDMA */ signal = mm_modem_signal_peek_cdma (ctx->modem_signal); - if (signal) - g_print (" -------------------------\n" - " CDMA1x | RSSI: '%.2lf' dBm\n" - " | EcIo: '%.2lf' dBm\n", - mm_signal_get_rssi (signal), - mm_signal_get_ecio (signal)); + if (signal) { + if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN) + cdma1x_rssi = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN) + cdma1x_ecio = g_strdup_printf ("%.2lf", value); + } - /* EVDO */ signal = mm_modem_signal_peek_evdo (ctx->modem_signal); - if (signal) - g_print (" -------------------------\n" - " EV-DO | RSSI: '%.2lf' dBm\n" - " | EcIo: '%.2lf' dBm\n" - " | SINR: '%.2lf' dBm\n" - " | Io: '%.2lf' dB\n", - mm_signal_get_rssi (signal), - mm_signal_get_ecio (signal), - mm_signal_get_sinr (signal), - mm_signal_get_io (signal)); + if (signal) { + if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN) + evdo_rssi = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN) + evdo_ecio = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_sinr (signal)) != MM_SIGNAL_UNKNOWN) + evdo_sinr = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_io (signal)) != MM_SIGNAL_UNKNOWN) + evdo_io = g_strdup_printf ("%.2lf", value); + } - /* GSM */ signal = mm_modem_signal_peek_gsm (ctx->modem_signal); - if (signal) - g_print (" -------------------------\n" - " GSM | RSSI: '%.2lf' dBm\n", - mm_signal_get_rssi (signal)); + if (signal) { + if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN) + gsm_rssi = g_strdup_printf ("%.2lf", value); + } - /* UMTS */ signal = mm_modem_signal_peek_umts (ctx->modem_signal); - if (signal) - g_print (" -------------------------\n" - " UMTS | RSSI: '%.2lf' dBm\n" - " | RSCP: '%.2lf' dBm\n" - " | EcIo: '%.2lf' dB\n", - mm_signal_get_rssi (signal), - mm_signal_get_rscp (signal), - mm_signal_get_ecio (signal)); + if (signal) { + if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN) + umts_rssi = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_rscp (signal)) != MM_SIGNAL_UNKNOWN) + umts_rscp = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN) + umts_ecio = g_strdup_printf ("%.2lf", value); + } - /* LTE */ signal = mm_modem_signal_peek_lte (ctx->modem_signal); - if (signal) - g_print (" -------------------------\n" - " LTE | RSSI: '%.2lf' dBm\n" - " | RSRQ: '%.2lf' dB\n" - " | RSRP: '%.2lf' dBm\n" - " | SNR: '%.2lf' dB\n", - mm_signal_get_rssi (signal), - mm_signal_get_rsrq (signal), - mm_signal_get_rsrp (signal), - mm_signal_get_snr (signal)); + if (signal) { + if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN) + lte_rssi = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_rsrq (signal)) != MM_SIGNAL_UNKNOWN) + lte_rsrq = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_rsrp (signal)) != MM_SIGNAL_UNKNOWN) + lte_rsrp = g_strdup_printf ("%.2lf", value); + if ((value = mm_signal_get_snr (signal)) != MM_SIGNAL_UNKNOWN) + lte_snr = g_strdup_printf ("%.2lf", value); + } + + mmcli_output_string_take_typed (MMC_F_SIGNAL_REFRESH_RATE, refresh_rate, "seconds"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_RSSI, cdma1x_rssi, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_ECIO, cdma1x_ecio, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_RSSI, evdo_rssi, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_ECIO, evdo_ecio, "dB"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_SINR, evdo_sinr, "dB"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_IO, evdo_io, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_GSM_RSSI, gsm_rssi, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSSI, umts_rssi, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSCP, umts_rscp, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_ECIO, umts_ecio, "dB"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSSI, lte_rssi, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRQ, lte_rsrq, "dB"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRP, lte_rsrp, "dBm"); + mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_SNR, lte_snr, "dB"); + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/cli/mmcli-modem-simple.c modemmanager-1.10.0/cli/mmcli-modem-simple.c --- modemmanager-1.6.8/cli/mmcli-modem-simple.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-simple.c 2019-01-15 15:57:35.000000000 +0100 @@ -46,7 +46,6 @@ /* Options */ static gchar *connect_str; static gboolean disconnect_flag; -static gboolean status_flag; static GOptionEntry entries[] = { { "simple-connect", 0, 0, G_OPTION_ARG_STRING, &connect_str, @@ -57,10 +56,6 @@ "Disconnect all connected bearers.", NULL }, - { "simple-status", 0, 0, G_OPTION_ARG_NONE, &status_flag, - "Show compilation of status properties.", - NULL - }, { NULL } }; @@ -89,8 +84,7 @@ return !!n_actions; n_actions = (!!connect_str + - disconnect_flag + - status_flag); + disconnect_flag); if (n_actions > 1) { g_printerr ("error: too many Simple actions requested\n"); @@ -196,136 +190,6 @@ } static void -status_process_reply (MMSimpleStatus *result, - const GError *error) -{ - MMModemState state; - - if (!result) { - g_printerr ("error: couldn't get status from the modem: '%s'\n", - error ? error->message : "unknown error"); - exit (EXIT_FAILURE); - } - - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE_UNKNOWN -#define VALIDATE_UNKNOWN(str) (str ? str : "unknown") - - g_print ("\n" - "%s\n", - VALIDATE_UNKNOWN (mm_modem_simple_get_path (ctx->modem_simple))); - - state = mm_simple_status_get_state (result); - - - g_print (" -------------------------\n" - " Status | state: '%s'\n", - mm_modem_state_get_string (state)); - - if (state >= MM_MODEM_STATE_REGISTERED) { - const MMModemBand *bands = NULL; - guint n_bands = 0; - gchar *bands_str; - gchar *access_tech_str; - guint signal_quality; - gboolean signal_quality_recent = FALSE; - - signal_quality = (mm_simple_status_get_signal_quality ( - result, - &signal_quality_recent)); - mm_simple_status_get_current_bands (result, &bands, &n_bands); - bands_str = mm_common_build_bands_string (bands, n_bands); - access_tech_str = (mm_modem_access_technology_build_string_from_mask ( - mm_simple_status_get_access_technologies (result))); - - g_print (" | signal quality: '%u' (%s)\n" - " | bands: '%s'\n" - " | access tech: '%s'\n", - signal_quality, signal_quality_recent ? "recent" : "cached", - VALIDATE_UNKNOWN (bands_str), - VALIDATE_UNKNOWN (access_tech_str)); - - if ((mm_simple_status_get_3gpp_registration_state (result) == - MM_MODEM_3GPP_REGISTRATION_STATE_HOME) || - (mm_simple_status_get_3gpp_registration_state (result) == - MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING)) { - g_print (" -------------------------\n" - " 3GPP | registration: '%s'\n" - " | operator code: '%s'\n" - " | operator name: '%s'\n" - " | subscription: '%s'\n", - mm_modem_3gpp_registration_state_get_string ( - mm_simple_status_get_3gpp_registration_state (result)), - VALIDATE_UNKNOWN (mm_simple_status_get_3gpp_operator_code (result)), - VALIDATE_UNKNOWN (mm_simple_status_get_3gpp_operator_name (result)), - mm_modem_3gpp_subscription_state_get_string ( - mm_simple_status_get_3gpp_subscription_state (result))); - } - - if ((mm_simple_status_get_cdma_cdma1x_registration_state (result) != - MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) || - (mm_simple_status_get_cdma_evdo_registration_state (result) != - MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN)) { - guint sid; - guint nid; - gchar *sid_str = NULL; - gchar *nid_str = NULL; - - sid = mm_simple_status_get_cdma_sid (result); - sid_str = (sid != MM_MODEM_CDMA_SID_UNKNOWN ? - g_strdup_printf ("%u", sid) : - NULL); - nid = mm_simple_status_get_cdma_nid (result); - nid_str = (nid != MM_MODEM_CDMA_NID_UNKNOWN ? - g_strdup_printf ("%u", nid) : - NULL); - - g_print (" -------------------------\n" - " CDMA | sid: '%s'\n" - " | nid: '%s'\n" - " | registration: CDMA1x '%s'\n" - " | EV-DO '%s'\n", - VALIDATE_UNKNOWN (sid_str), - VALIDATE_UNKNOWN (nid_str), - mm_modem_cdma_registration_state_get_string ( - mm_simple_status_get_cdma_cdma1x_registration_state (result)), - mm_modem_cdma_registration_state_get_string ( - mm_simple_status_get_cdma_evdo_registration_state (result))); - - g_free (sid_str); - g_free (nid_str); - } - - g_free (access_tech_str); - g_free (bands_str); - } else { - g_print (" -------------------------\n" - " 3GPP | subscription: '%s'\n", - mm_modem_3gpp_subscription_state_get_string ( - mm_simple_status_get_3gpp_subscription_state (result))); - } - - - g_print ("\n"); - g_object_unref (result); -} - -static void -status_ready (MMModemSimple *modem_simple, - GAsyncResult *result, - gpointer nothing) -{ - MMSimpleStatus *operation_result; - GError *error = NULL; - - operation_result = mm_modem_simple_get_status_finish (modem_simple, result, &error); - status_process_reply (operation_result, error); - - mmcli_async_operation_done (); -} - -static void get_modem_ready (GObject *source, GAsyncResult *result, gpointer none) @@ -373,17 +237,6 @@ return; } - /* Request to get status from the modem? */ - if (status_flag) { - g_debug ("Asynchronously getting status from the modem..."); - - mm_modem_simple_get_status (ctx->modem_simple, - ctx->cancellable, - (GAsyncReadyCallback)status_ready, - NULL); - return; - } - g_warn_if_reached (); } @@ -439,18 +292,5 @@ return; } - /* Request to get status from the modem? */ - if (status_flag) { - MMSimpleStatus *result; - - g_debug ("Synchronously getting status from the modem..."); - - result = mm_modem_simple_get_status_sync (ctx->modem_simple, - NULL, - &error); - status_process_reply (result, error); - return; - } - g_warn_if_reached (); } diff -Nru modemmanager-1.6.8/cli/mmcli-modem-time.c modemmanager-1.10.0/cli/mmcli-modem-time.c --- modemmanager-1.6.8/cli/mmcli-modem-time.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-time.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -137,14 +138,11 @@ gchar *dst_offset = NULL; gchar *leap_seconds = NULL; - if (error) + if (error) { g_printerr ("error: couldn't get current network time: '%s'\n", error->message); - - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "not available") + exit (EXIT_FAILURE); + } if (timezone) { if (mm_network_timezone_get_offset (timezone) != MM_NETWORK_TIMEZONE_OFFSET_UNKNOWN) @@ -157,27 +155,11 @@ leap_seconds = g_strdup_printf ("%" G_GINT32_FORMAT, mm_network_timezone_get_leap_seconds (timezone)); } - g_print ("\n" - "%s\n" - " ----------------------------\n" - " Time | Current: '%s'\n" - " ----------------------------\n" - " Timezone | Offset: '%s'\n" - " | DST offset: '%s'\n" - " | Leap seconds: '%s'\n", - mm_modem_time_get_path (ctx->modem_time), - VALIDATE (time_string), - VALIDATE (offset), - VALIDATE (dst_offset), - VALIDATE (leap_seconds)); - - g_free (offset); - g_free (dst_offset); - g_free (leap_seconds); - g_free (time_string); - - if (error) - exit (EXIT_FAILURE); + mmcli_output_string_take (MMC_F_TIME_CURRENT, time_string); + mmcli_output_string_take (MMC_F_TIMEZONE_CURRENT, offset); + mmcli_output_string_take (MMC_F_TIMEZONE_DST_OFFSET, dst_offset); + mmcli_output_string_take (MMC_F_TIMEZONE_LEAP_SECONDS, leap_seconds); + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/cli/mmcli-modem-voice.c modemmanager-1.10.0/cli/mmcli-modem-voice.c --- modemmanager-1.6.8/cli/mmcli-modem-voice.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-modem-voice.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -160,39 +161,35 @@ } static void -print_call_short_info (MMCall *call) +output_call_info (MMCall *call) { - g_print ("\t%s %s (%s)\n", - mm_call_get_path (call), - mm_call_direction_get_string (mm_call_get_direction (call)), - mm_call_state_get_string (mm_call_get_state (call))); + gchar *extra; + + extra = g_strdup_printf ("%s (%s)", + mm_call_direction_get_string (mm_call_get_direction (call)), + mm_call_state_get_string (mm_call_get_state (call))); + mmcli_output_listitem (MMC_F_CALL_LIST_DBUS_PATH, + " ", + mm_call_get_path (call), + extra); + g_free (extra); } static void list_process_reply (GList *result, const GError *error) { + GList *l; + if (error) { g_printerr ("error: couldn't list call: '%s'\n", error->message); exit (EXIT_FAILURE); } - g_print ("\n"); - if (!result) { - g_print ("No calls were found\n"); - } else { - GList *l; - - g_print ("Found %u calls:\n", g_list_length (result)); - for (l = result; l; l = g_list_next (l)) { - MMCall *call = MM_CALL (l->data); - - print_call_short_info (call); - g_object_unref (call); - } - g_list_free (result); - } + for (l = result; l; l = g_list_next (l)) + output_call_info (MM_CALL (l->data)); + mmcli_output_list_dump (MMC_F_CALL_LIST_DBUS_PATH); } static void @@ -219,8 +216,7 @@ exit (EXIT_FAILURE); } - g_print ("Successfully created new call:\n"); - print_call_short_info (call); + g_print ("Successfully created new call: %s\n", mm_call_get_path (call)); g_object_unref (call); } diff -Nru modemmanager-1.6.8/cli/mmcli-output.c modemmanager-1.10.0/cli/mmcli-output.c --- modemmanager-1.6.8/cli/mmcli-output.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/cli/mmcli-output.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1112 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * mmcli -- Control modem status & access information from the command line + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include + +#include +#include "mm-common-helpers.h" +#include "mmcli-output.h" + +/******************************************************************************/ +/* List of sections (grouped fields) displayed in the human-friendly output */ + +typedef struct { + const gchar *name; +} SectionInfo; + +static SectionInfo section_infos[] = { + [MMC_S_MODEM_GENERAL] = { "General" }, + [MMC_S_MODEM_HARDWARE] = { "Hardware" }, + [MMC_S_MODEM_SYSTEM] = { "System" }, + [MMC_S_MODEM_NUMBERS] = { "Numbers" }, + [MMC_S_MODEM_STATUS] = { "Status" }, + [MMC_S_MODEM_MODES] = { "Modes" }, + [MMC_S_MODEM_BANDS] = { "Bands" }, + [MMC_S_MODEM_IP] = { "IP" }, + [MMC_S_MODEM_3GPP] = { "3GPP" }, + [MMC_S_MODEM_3GPP_EPS] = { "3GPP EPS" }, + [MMC_S_MODEM_3GPP_SCAN] = { "3GPP scan" }, + [MMC_S_MODEM_3GPP_USSD] = { "3GPP USSD" }, + [MMC_S_MODEM_CDMA] = { "CDMA" }, + [MMC_S_MODEM_SIM] = { "SIM" }, + [MMC_S_MODEM_BEARER] = { "Bearer" }, + [MMC_S_MODEM_TIME] = { "Time" }, + [MMC_S_MODEM_TIMEZONE] = { "Timezone" }, + [MMC_S_MODEM_MESSAGING] = { "Messaging" }, + [MMC_S_MODEM_SIGNAL] = { "Signal" }, + [MMC_S_MODEM_SIGNAL_CDMA1X] = { "CDMA1x" }, + [MMC_S_MODEM_SIGNAL_EVDO] = { "EV-DO" }, + [MMC_S_MODEM_SIGNAL_GSM] = { "GSM" }, + [MMC_S_MODEM_SIGNAL_UMTS] = { "UMTS" }, + [MMC_S_MODEM_SIGNAL_LTE] = { "LTE" }, + [MMC_S_MODEM_OMA] = { "OMA" }, + [MMC_S_MODEM_OMA_CURRENT] = { "Current session" }, + [MMC_S_MODEM_OMA_PENDING] = { "Pending sessions" }, + [MMC_S_MODEM_LOCATION] = { "Location" }, + [MMC_S_MODEM_LOCATION_3GPP] = { "3GPP" }, + [MMC_S_MODEM_LOCATION_GPS] = { "GPS" }, + [MMC_S_MODEM_LOCATION_CDMABS] = { "CDMA BS" }, + [MMC_S_MODEM_FIRMWARE] = { "Firmware" }, + [MMC_S_MODEM_FIRMWARE_FASTBOOT] = { "Fastboot settings" }, + [MMC_S_BEARER_GENERAL] = { "General" }, + [MMC_S_BEARER_STATUS] = { "Status" }, + [MMC_S_BEARER_PROPERTIES] = { "Properties" }, + [MMC_S_BEARER_IPV4_CONFIG] = { "IPv4 configuration" }, + [MMC_S_BEARER_IPV6_CONFIG] = { "IPv6 configuration" }, + [MMC_S_BEARER_STATS] = { "Statistics" }, + [MMC_S_CALL_GENERAL] = { "General" }, + [MMC_S_CALL_PROPERTIES] = { "Properties" }, + [MMC_S_CALL_AUDIO_FORMAT] = { "Audio format" }, + [MMC_S_SMS_GENERAL] = { "General" }, + [MMC_S_SMS_CONTENT] = { "Content" }, + [MMC_S_SMS_PROPERTIES] = { "Properties" }, + [MMC_S_SIM_GENERAL] = { "General" }, + [MMC_S_SIM_PROPERTIES] = { "Properties" }, +}; + +/******************************************************************************/ +/* List of fields */ + +typedef struct { + const gchar *key; + const gchar *name; + MmcS section; +} FieldInfo; + +static FieldInfo field_infos[] = { + [MMC_F_GENERAL_DBUS_PATH] = { "modem.dbus-path", "dbus path", MMC_S_MODEM_GENERAL, }, + [MMC_F_GENERAL_DEVICE_ID] = { "modem.generic.device-identifier", "device id", MMC_S_MODEM_GENERAL, }, + [MMC_F_HARDWARE_MANUFACTURER] = { "modem.generic.manufacturer", "manufacturer", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_MODEL] = { "modem.generic.model", "model", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_REVISION] = { "modem.generic.revision", "revision", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_HW_REVISION] = { "modem.generic.hardware-revision", "h/w revision", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_SUPPORTED_CAPABILITIES] = { "modem.generic.supported-capabilities", "supported", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_CURRENT_CAPABILITIES] = { "modem.generic.current-capabilities", "current", MMC_S_MODEM_HARDWARE, }, + [MMC_F_HARDWARE_EQUIPMENT_ID] = { "modem.generic.equipment-identifier", "equipment id", MMC_S_MODEM_HARDWARE, }, + [MMC_F_SYSTEM_DEVICE] = { "modem.generic.device", "device", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_DRIVERS] = { "modem.generic.drivers", "drivers", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, }, + [MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, }, + [MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, }, + [MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_STATE] = { "modem.generic.state", "state", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_FAILED_REASON] = { "modem.generic.state-failed-reason", "failed reason", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_POWER_STATE] = { "modem.generic.power-state", "power state", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_ACCESS_TECH] = { "modem.generic.access-technologies", "access tech", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_SIGNAL_QUALITY_VALUE] = { "modem.generic.signal-quality.value", "signal quality", MMC_S_MODEM_STATUS, }, + [MMC_F_STATUS_SIGNAL_QUALITY_RECENT] = { "modem.generic.signal-quality.recent", NULL, MMC_S_UNKNOWN, }, + [MMC_F_MODES_SUPPORTED] = { "modem.generic.supported-modes", "supported", MMC_S_MODEM_MODES, }, + [MMC_F_MODES_CURRENT] = { "modem.generic.current-modes", "current", MMC_S_MODEM_MODES, }, + [MMC_F_BANDS_SUPPORTED] = { "modem.generic.supported-bands", "supported", MMC_S_MODEM_BANDS, }, + [MMC_F_BANDS_CURRENT] = { "modem.generic.current-bands", "current", MMC_S_MODEM_BANDS, }, + [MMC_F_IP_SUPPORTED] = { "modem.generic.supported-ip-families", "supported", MMC_S_MODEM_IP, }, + [MMC_F_3GPP_IMEI] = { "modem.3gpp.imei", "imei", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_ENABLED_LOCKS] = { "modem.3gpp.enabled-locks", "enabled locks", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_OPERATOR_ID] = { "modem.3gpp.operator-code", "operator id", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_OPERATOR_NAME] = { "modem.3gpp.operator-name", "operator name", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_REGISTRATION] = { "modem.3gpp.registration-state", "registration", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_PCO] = { "modem.3gpp.pco", "pco", MMC_S_MODEM_3GPP, }, + [MMC_F_3GPP_EPS_UE_MODE] = { "modem.3gpp.eps.ue-mode-operation", "ue mode of operation", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_INITIAL_BEARER_PATH] = { "modem.3gpp.eps.initial-bearer.dbus-path", "initial bearer dbus path", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_BEARER_SETTINGS_APN] = { "modem.3gpp.eps.initial-bearer.settings.apn", "initial bearer apn", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_BEARER_SETTINGS_IP_TYPE] = { "modem.3gpp.eps.initial-bearer.settings.ip-type", "initial bearer ip type", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_BEARER_SETTINGS_USER] = { "modem.3gpp.eps.initial-bearer.settings.user", "initial bearer user", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD] = { "modem.3gpp.eps.initial-bearer.settings.password", "initial bearer password", MMC_S_MODEM_3GPP_EPS, }, + [MMC_F_3GPP_SCAN_NETWORKS] = { "modem.3gpp.scan-networks", "networks", MMC_S_MODEM_3GPP_SCAN, }, + [MMC_F_3GPP_USSD_STATUS] = { "modem.3gpp.ussd.status", "status", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_3GPP_USSD_NETWORK_REQUEST] = { "modem.3gpp.ussd.network-request", "network request", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_3GPP_USSD_NETWORK_NOTIFICATION] = { "modem.3gpp.ussd.network-notification", "network notification", MMC_S_MODEM_3GPP_USSD, }, + [MMC_F_CDMA_MEID] = { "modem.cdma.meid", "meid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_ESN] = { "modem.cdma.esn", "esn", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_SID] = { "modem.cdma.sid", "sid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_NID] = { "modem.cdma.nid", "nid", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_REGISTRATION_CDMA1X] = { "modem.cdma.cdma1x-registration-state", "registration cdma1x", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_REGISTRATION_EVDO] = { "modem.cdma.evdo-registration-state", "registration evdo", MMC_S_MODEM_CDMA, }, + [MMC_F_CDMA_ACTIVATION] = { "modem.cdma.activation-state", "activation", MMC_S_MODEM_CDMA, }, + [MMC_F_SIM_PATH] = { "modem.generic.sim", "dbus path", MMC_S_MODEM_SIM, }, + [MMC_F_BEARER_PATHS] = { "modem.generic.bearers", "dbus path", MMC_S_MODEM_BEARER, }, + [MMC_F_TIME_CURRENT] = { "modem.time.current", "current", MMC_S_MODEM_TIME, }, + [MMC_F_TIMEZONE_CURRENT] = { "modem.timezone.current", "current", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_TIMEZONE_DST_OFFSET] = { "modem.time.dst-offset", "dst offset", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, }, + [MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, }, + [MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, }, + [MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, }, + [MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, }, + [MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, }, + [MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, }, + [MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, }, + [MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, }, + [MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, }, + [MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, }, + [MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, }, + [MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, }, + [MMC_F_OMA_PENDING_SESSIONS] = { "modem.oma.pending-sessions", "sessions", MMC_S_MODEM_OMA_PENDING, }, + [MMC_F_LOCATION_CAPABILITIES] = { "modem.location.capabilities", "capabilities", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_ENABLED] = { "modem.location.enabled", "enabled", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_SIGNALS] = { "modem.location.signals", "signals", MMC_S_MODEM_LOCATION, }, + [MMC_F_LOCATION_GPS_REFRESH_RATE] = { "modem.location.gps.refresh-rate", "refresh rate", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_SUPL_SERVER] = { "modem.location.gps.supl-server", "a-gps supl server", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ASSISTANCE] = { "modem.location.gps.assistance", "supported assistance", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS] = { "modem.location.gps.assistance-servers", "assistance servers", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_3GPP_MCC] = { "modem.location.3gpp.mcc", "operator code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_MNC] = { "modem.location.3gpp.mnc", "operator name", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_LAC] = { "modem.location.3gpp.lac", "location area code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_TAC] = { "modem.location.3gpp.tac", "tracking area code", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_3GPP_CID] = { "modem.location.3gpp.cid", "cell id", MMC_S_MODEM_LOCATION_3GPP, }, + [MMC_F_LOCATION_GPS_NMEA] = { "modem.location.gps.nmea", "nmea", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_UTC] = { "modem.location.gps.utc", "utc", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_LONG] = { "modem.location.gps.longitude", "longitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_LAT] = { "modem.location.gps.latitude", "latitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_GPS_ALT] = { "modem.location.gps.altitude", "altitude", MMC_S_MODEM_LOCATION_GPS, }, + [MMC_F_LOCATION_CDMABS_LONG] = { "modem.location.cdma-bs.longitude", "longitude", MMC_S_MODEM_LOCATION_CDMABS, }, + [MMC_F_LOCATION_CDMABS_LAT] = { "modem.location.cdma-bs.latitude", "latitude", MMC_S_MODEM_LOCATION_CDMABS, }, + [MMC_F_FIRMWARE_LIST] = { "modem.firmware.list", "list", MMC_S_MODEM_FIRMWARE, }, + [MMC_F_FIRMWARE_METHOD] = { "modem.firmware.method", "method", MMC_S_MODEM_FIRMWARE, }, + [MMC_F_FIRMWARE_DEVICE_IDS] = { "modem.firmware.device-ids", "device ids", MMC_S_MODEM_FIRMWARE, }, + [MMC_F_FIRMWARE_VERSION] = { "modem.firmware.version", "version", MMC_S_MODEM_FIRMWARE, }, + [MMC_F_FIRMWARE_FASTBOOT_AT] = { "modem.firmware.fastboot.at", "at command", MMC_S_MODEM_FIRMWARE_FASTBOOT, }, + [MMC_F_BEARER_GENERAL_DBUS_PATH] = { "bearer.dbus-path", "dbus path", MMC_S_BEARER_GENERAL, }, + [MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, }, + [MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, }, + [MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_IP_TYPE] = { "bearer.properties.ip-type", "ip type", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, }, + [MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_GATEWAY] = { "bearer.ipv4-config.gateway", "gateway", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_DNS] = { "bearer.ipv4-config.dns", "dns", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV4_CONFIG_MTU] = { "bearer.ipv4-config.mtu", "mtu", MMC_S_BEARER_IPV4_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_METHOD] = { "bearer.ipv6-config.method", "method", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_ADDRESS] = { "bearer.ipv6-config.address", "address", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_PREFIX] = { "bearer.ipv6-config.prefix", "prefix", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_GATEWAY] = { "bearer.ipv6-config.gateway", "gateway", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_DNS] = { "bearer.ipv6-config.dns", "dns", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, }, + [MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, }, + [MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, }, + [MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, }, + [MMC_F_CALL_GENERAL_DBUS_PATH] = { "call.dbus-path", "dbus path", MMC_S_CALL_GENERAL, }, + [MMC_F_CALL_PROPERTIES_NUMBER] = { "call.properties.number", "number", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_DIRECTION] = { "call.properties.direction", "direction", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_STATE] = { "call.properties.state", "state", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_STATE_REASON] = { "call.properties.state-reason", "state reason", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_PROPERTIES_AUDIO_PORT] = { "call.properties.audio-port", "audio port", MMC_S_CALL_PROPERTIES, }, + [MMC_F_CALL_AUDIO_FORMAT_ENCODING] = { "call.audio-format.encoding", "encoding", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_CALL_AUDIO_FORMAT_RESOLUTION] = { "call.audio-format.resolution", "resolution", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_CALL_AUDIO_FORMAT_RATE] = { "call.audio-format.rate", "rate", MMC_S_CALL_AUDIO_FORMAT, }, + [MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "dbus path", MMC_S_SMS_GENERAL, }, + [MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_CONTENT_DATA] = { "sms.content.data", "data", MMC_S_SMS_CONTENT, }, + [MMC_F_SMS_PROPERTIES_PDU_TYPE] = { "sms.properties.pdu-type", "pdu type", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_STATE] = { "sms.properties.state", "state", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_VALIDITY] = { "sms.properties.validity", "validity", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_STORAGE] = { "sms.properties.storage", "storage", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_SMSC] = { "sms.properties.smsc", "smsc", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_CLASS] = { "sms.properties.class", "class", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_TELESERVICE_ID] = { "sms.properties.teleservice-id", "teleservice id", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY] = { "sms.properties.service-category", "service category", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DELIVERY_REPORT] = { "sms.properties.delivery-report", "delivery report", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_MSG_REFERENCE] = { "sms.properties.message-reference", "message reference", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_TIMESTAMP] = { "sms.properties.timestamp", "timestamp", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, }, + [MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "dbus path", MMC_S_SIM_GENERAL, }, + [MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, }, + [MMC_F_SIM_PROPERTIES_OPERATOR_NAME] = { "sim.properties.operator-name", "operator name", MMC_S_SIM_PROPERTIES, }, + [MMC_F_MODEM_LIST_DBUS_PATH] = { "modem-list", "modems", MMC_S_UNKNOWN, }, + [MMC_F_SMS_LIST_DBUS_PATH] = { "modem.messaging.sms", "sms messages", MMC_S_UNKNOWN, }, + [MMC_F_CALL_LIST_DBUS_PATH] = { "modem.voice.call", "calls", MMC_S_UNKNOWN, }, +}; + +/******************************************************************************/ +/* Output type selection */ + +static MmcOutputType selected_type = MMC_OUTPUT_TYPE_NONE; + +void +mmcli_output_set (MmcOutputType type) +{ + selected_type = type; +} + +MmcOutputType +mmcli_output_get (void) +{ + return selected_type; +} + +/******************************************************************************/ +/* Generic output management */ + +typedef enum { + VALUE_TYPE_SINGLE, + VALUE_TYPE_MULTIPLE, + VALUE_TYPE_LISTITEM, +} ValueType; + +typedef struct { + MmcF field; + ValueType type; +} OutputItem; + +typedef struct { + OutputItem base; + gchar *value; +} OutputItemSingle; + +typedef struct { + OutputItem base; + gchar **values; + gboolean multiline; +} OutputItemMultiple; + +typedef struct { + OutputItem base; + gchar *prefix; + gchar *value; + gchar *extra; +} OutputItemListitem; + +static GList *output_items; + +static void +output_item_free (OutputItem *item) +{ + switch (item->type) { + case VALUE_TYPE_SINGLE: + g_free (((OutputItemSingle *)item)->value); + g_slice_free (OutputItemSingle, (OutputItemSingle *)item); + break; + case VALUE_TYPE_MULTIPLE: + g_strfreev (((OutputItemMultiple *)item)->values); + g_slice_free (OutputItemMultiple, (OutputItemMultiple *)item); + break; + case VALUE_TYPE_LISTITEM: + g_free (((OutputItemListitem *)item)->prefix); + g_free (((OutputItemListitem *)item)->value); + g_free (((OutputItemListitem *)item)->extra); + break; + } +} + +static gboolean +filter_out_value (const gchar *value) +{ + return (!g_strcmp0 (value, "unknown") || !g_strcmp0 (value, "none")); +} + +static void +output_item_new_take_single (MmcF field, + gchar *value) +{ + OutputItemSingle *item; + + item = g_slice_new0 (OutputItemSingle); + item->base.field = field; + item->base.type = VALUE_TYPE_SINGLE; + + if (filter_out_value (value)) + g_free (value); + else + item->value = value; + + output_items = g_list_prepend (output_items, item); +} + +static void +output_item_new_take_multiple (MmcF field, + gchar **values, + gboolean multiline) +{ + OutputItemMultiple *item; + + item = g_slice_new0 (OutputItemMultiple); + item->base.field = field; + item->base.type = VALUE_TYPE_MULTIPLE; + item->multiline = multiline; + + if (values && (g_strv_length (values) == 1) && filter_out_value (values[0])) + g_strfreev (values); + else + item->values = values; + + output_items = g_list_prepend (output_items, item); +} + +static void +output_item_new_take_listitem (MmcF field, + gchar *prefix, + gchar *value, + gchar *extra) +{ + OutputItemListitem *item; + + item = g_slice_new0 (OutputItemListitem); + item->base.field = field; + item->base.type = VALUE_TYPE_LISTITEM; + item->prefix = prefix; + item->value = value; + item->extra = extra; + + output_items = g_list_prepend (output_items, item); +} + +void +mmcli_output_string_list (MmcF field, + const gchar *str) +{ + gchar **split; + + split = str ? g_strsplit (str, ",", -1) : NULL; + if (split) { + guint i; + for (i = 0; split[i]; i++) + g_strstrip (split[i]); + } + + output_item_new_take_multiple (field, split, FALSE); +} + +void +mmcli_output_string_list_take (MmcF field, + gchar *str) +{ + mmcli_output_string_list (field, str); + g_free (str); +} + +void +mmcli_output_string_multiline (MmcF field, + const gchar *str) +{ + gchar **split; + + split = str ? g_strsplit (str, "\n", -1) : NULL; + if (split) { + guint i; + for (i = 0; split[i]; i++) + g_strstrip (split[i]); + } + + output_item_new_take_multiple (field, split, TRUE); +} + +void +mmcli_output_string_multiline_take (MmcF field, + gchar *str) +{ + mmcli_output_string_multiline (field, str); + g_free (str); +} + +void +mmcli_output_string_array (MmcF field, + const gchar **strv, + gboolean multiline) +{ + output_item_new_take_multiple (field, g_strdupv ((gchar **)strv), multiline); +} + +void +mmcli_output_string_array_take (MmcF field, + gchar **strv, + gboolean multiline) +{ + output_item_new_take_multiple (field, strv, multiline); +} + +void +mmcli_output_string (MmcF field, + const gchar *str) +{ + output_item_new_take_single (field, g_strdup (str)); +} + +void +mmcli_output_string_take (MmcF field, + gchar *str) +{ + output_item_new_take_single (field, str); +} + +void +mmcli_output_string_take_typed (MmcF field, + gchar *value, + const gchar *type) +{ + if (value && selected_type == MMC_OUTPUT_TYPE_HUMAN) { + gchar *aux; + + aux = g_strdup_printf ("%s %s", value, type); + g_free (value); + output_item_new_take_single (field, aux); + return; + } + + output_item_new_take_single (field, value); +} + +void +mmcli_output_listitem (MmcF field, + const gchar *prefix, + const gchar *value, + const gchar *extra) +{ + output_item_new_take_listitem (field, g_strdup (prefix), g_strdup (value), g_strdup (extra)); +} + +/******************************************************************************/ +/* (Custom) Signal quality output */ + +void +mmcli_output_signal_quality (guint value, + gboolean recent) +{ + /* Merge value and recent flag in a single item in human output */ + if (selected_type == MMC_OUTPUT_TYPE_HUMAN) { + output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_VALUE, + g_strdup_printf ("%u%% (%s)", value, recent ? "recent" : "cached")); + return; + } + + output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_VALUE, + g_strdup_printf ("%u", value)); + output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_RECENT, + g_strdup_printf ("%s", recent ? "yes" : "no")); +} + +/******************************************************************************/ +/* (Custom) State output */ + +void +mmcli_output_state (MMModemState state, + MMModemStateFailedReason reason) +{ +#define KNRM "\x1B[0m" +#define KRED "\x1B[31m" +#define KGRN "\x1B[32m" +#define KYEL "\x1B[33m" + + if (selected_type == MMC_OUTPUT_TYPE_HUMAN) { + if (state == MM_MODEM_STATE_FAILED) + output_item_new_take_single (MMC_F_STATUS_STATE, g_strdup_printf (KRED "%s" KNRM, mm_modem_state_get_string (state))); + else if (state == MM_MODEM_STATE_CONNECTED) + output_item_new_take_single (MMC_F_STATUS_STATE, g_strdup_printf (KGRN "%s" KNRM, mm_modem_state_get_string (state))); + else if (state == MM_MODEM_STATE_CONNECTING) + output_item_new_take_single (MMC_F_STATUS_STATE, g_strdup_printf (KYEL "%s" KNRM, mm_modem_state_get_string (state))); + else + output_item_new_take_single (MMC_F_STATUS_STATE, g_strdup (mm_modem_state_get_string (state))) ; + + if (state == MM_MODEM_STATE_FAILED) + output_item_new_take_single (MMC_F_STATUS_FAILED_REASON, + g_strdup_printf (KRED "%s" KNRM, mm_modem_state_failed_reason_get_string (reason))); + return; + } + + output_item_new_take_single (MMC_F_STATUS_STATE, g_strdup (mm_modem_state_get_string (state))); + output_item_new_take_single (MMC_F_STATUS_FAILED_REASON, + (state == MM_MODEM_STATE_FAILED) ? + g_strdup (mm_modem_state_failed_reason_get_string (reason)) : + NULL); +} + +/******************************************************************************/ +/* (Custom) Network scan output */ + +static gchar * +build_network_info (MMModem3gppNetwork *network) +{ + const gchar *operator_code; + const gchar *operator_name; + gchar *access_technologies; + const gchar *availability; + gchar *out; + + operator_code = mm_modem_3gpp_network_get_operator_code (network); + operator_name = mm_modem_3gpp_network_get_operator_long (network); + if (!operator_name) + operator_name = mm_modem_3gpp_network_get_operator_short (network); + access_technologies = mm_modem_access_technology_build_string_from_mask (mm_modem_3gpp_network_get_access_technology (network)); + availability = mm_modem_3gpp_network_availability_get_string (mm_modem_3gpp_network_get_availability (network)); + + if (selected_type == MMC_OUTPUT_TYPE_HUMAN) + out = g_strdup_printf ("%s - %s (%s, %s)", + operator_code ? operator_code : "code n/a", + operator_name ? operator_name : "name n/a", + access_technologies, + availability); + else + out = g_strdup_printf ("operator-code: %s, operator-name: %s, access-technologies: %s, availability: %s", + operator_code ? operator_code : "--", + operator_name ? operator_name : "--", + access_technologies, + availability); + g_free (access_technologies); + + return out; +} + +void +mmcli_output_scan_networks (GList *network_list) +{ + gchar **networks = NULL; + + if (network_list) { + GPtrArray *aux; + GList *l; + + aux = g_ptr_array_new (); + for (l = network_list; l; l = g_list_next (l)) + g_ptr_array_add (aux, build_network_info ((MMModem3gppNetwork *)(l->data))); + g_ptr_array_add (aux, NULL); + networks = (gchar **) g_ptr_array_free (aux, FALSE); + } + + /* When printing human result, we want to show some result even if no networks + * are found, so we force a explicit string result. */ + if (selected_type == MMC_OUTPUT_TYPE_HUMAN && !networks) + output_item_new_take_single (MMC_F_3GPP_SCAN_NETWORKS, g_strdup ("n/a")); + else + output_item_new_take_multiple (MMC_F_3GPP_SCAN_NETWORKS, networks, TRUE); +} + +/******************************************************************************/ +/* (Custom) Firmware list output */ + +static void +build_firmware_info_human (GPtrArray *array, + MMFirmwareProperties *props, + gboolean selected) +{ + g_ptr_array_add (array, g_strdup (mm_firmware_properties_get_unique_id (props))); + g_ptr_array_add (array, g_strdup_printf ("\tcurrent: %s", selected ? "yes" : "no")); + + if (mm_firmware_properties_get_image_type (props) == MM_FIRMWARE_IMAGE_TYPE_GOBI) { + const gchar *aux; + + if ((aux = mm_firmware_properties_get_gobi_pri_version (props)) != NULL) + g_ptr_array_add (array, g_strdup_printf ("\tgobi pri version: %s", aux)); + if ((aux = mm_firmware_properties_get_gobi_pri_info (props)) != NULL) + g_ptr_array_add (array, g_strdup_printf ("\tgobi pri info: %s", aux)); + if ((aux = mm_firmware_properties_get_gobi_boot_version (props)) != NULL) + g_ptr_array_add (array, g_strdup_printf ("\tgobi boot version: %s", aux)); + if ((aux = mm_firmware_properties_get_gobi_pri_unique_id (props)) != NULL) + g_ptr_array_add (array, g_strdup_printf ("\tgobi pri unique id: %s", aux)); + if ((aux = mm_firmware_properties_get_gobi_modem_unique_id (props)) != NULL) + g_ptr_array_add (array, g_strdup_printf ("\tgobi modem unique id: %s", aux)); + } +} + +static void +build_firmware_info_keyvalue (GPtrArray *array, + MMFirmwareProperties *props, + gboolean selected) +{ + GString *str; + + str = g_string_new (""); + g_string_append_printf (str, "unique-id: %s", mm_firmware_properties_get_unique_id (props)); + g_string_append_printf (str, ", current: %s", selected ? "yes" : "no"); + + if (mm_firmware_properties_get_image_type (props) == MM_FIRMWARE_IMAGE_TYPE_GOBI) { + const gchar *aux; + + if ((aux = mm_firmware_properties_get_gobi_pri_version (props)) != NULL) + g_string_append_printf (str, ", gobi-pri-version: %s", aux); + if ((aux = mm_firmware_properties_get_gobi_pri_info (props)) != NULL) + g_string_append_printf (str, ", gobi-pri-info: %s", aux); + if ((aux = mm_firmware_properties_get_gobi_boot_version (props)) != NULL) + g_string_append_printf (str, ", gobi-boot-version: %s", aux); + if ((aux = mm_firmware_properties_get_gobi_pri_unique_id (props)) != NULL) + g_string_append_printf (str, ", gobi-pri-unique id: %s", aux); + if ((aux = mm_firmware_properties_get_gobi_modem_unique_id (props)) != NULL) + g_string_append_printf (str, ", gobi-modem-unique id: %s", aux); + } + + g_ptr_array_add (array, g_string_free (str, FALSE)); +} + +void +mmcli_output_firmware_list (GList *firmware_list, + MMFirmwareProperties *selected) +{ + gchar **firmwares = NULL; + + if (firmware_list) { + GPtrArray *aux; + GList *l; + + aux = g_ptr_array_new (); + for (l = firmware_list; l; l = g_list_next (l)) { + MMFirmwareProperties *props = (MMFirmwareProperties *)(l->data); + gboolean current_selected; + + current_selected = (selected && + g_str_equal (mm_firmware_properties_get_unique_id (props), + mm_firmware_properties_get_unique_id (selected))); + + if (selected_type == MMC_OUTPUT_TYPE_HUMAN) + build_firmware_info_human (aux, props, current_selected); + else + build_firmware_info_keyvalue (aux, props, current_selected); + } + g_ptr_array_add (aux, NULL); + firmwares = (gchar **) g_ptr_array_free (aux, FALSE); + } + + /* When printing human result, we want to show some result even if no firmwares + * are found, so we force a explicit string result. */ + if (selected_type == MMC_OUTPUT_TYPE_HUMAN && !firmwares) + output_item_new_take_single (MMC_F_FIRMWARE_LIST, g_strdup ("n/a")); + else + output_item_new_take_multiple (MMC_F_FIRMWARE_LIST, firmwares, TRUE); +} + +/******************************************************************************/ +/* (Custom) PCO list output */ + +void +mmcli_output_pco_list (GList *pco_list) +{ + GPtrArray *aux; + GList *l; + + if (!pco_list) { + output_item_new_take_single (MMC_F_3GPP_PCO, NULL); + return; + } + + aux = g_ptr_array_new (); + for (l = pco_list; l; l = g_list_next (l)) { + MMPco *pco; + gchar *pco_data_hex; + const guint8 *pco_data; + gsize pco_data_size; + + pco = MM_PCO (l->data); + pco_data = mm_pco_get_data (pco, &pco_data_size); + pco_data_hex = (pco_data ? mm_utils_bin2hexstr (pco_data, pco_data_size) : NULL); + + if (selected_type == MMC_OUTPUT_TYPE_HUMAN) + g_ptr_array_add (aux, g_strdup_printf ("%u: (%s) '%s'\n", + mm_pco_get_session_id (pco), + mm_pco_is_complete (pco) ? "complete" : "partial", + pco_data_hex ? pco_data_hex : "")); + else + g_ptr_array_add (aux, g_strdup_printf ("session-id: %u, complete: %s, data: %s\n", + mm_pco_get_session_id (pco), + mm_pco_is_complete (pco) ? "yes" : "no", + pco_data_hex ? pco_data_hex : "")); + g_free (pco_data_hex); + } + g_ptr_array_add (aux, NULL); + + output_item_new_take_multiple (MMC_F_3GPP_PCO, (gchar **) g_ptr_array_free (aux, FALSE), TRUE); +} + +/******************************************************************************/ +/* Human-friendly output */ + +#define HUMAN_MAX_VALUE_LENGTH 60 + +static gint +list_sort_human (const OutputItem *item_a, + const OutputItem *item_b) +{ + if (field_infos[item_a->field].section < field_infos[item_b->field].section) + return -1; + if (field_infos[item_a->field].section > field_infos[item_b->field].section) + return 1; + return item_a->field - item_b->field; +} + +static void +dump_output_human (void) +{ + GList *l; + MmcS current_section = MMC_S_UNKNOWN; + guint longest_section_name = 0; + guint longest_field_name = 0; + + output_items = g_list_sort (output_items, (GCompareFunc) list_sort_human); + + /* First pass to process */ + for (l = output_items; l; l = g_list_next (l)) { + OutputItem *item_l; + guint aux; + gboolean ignore = FALSE; + + item_l = (OutputItem *)(l->data); + + /* Post-process values */ + if (item_l->type == VALUE_TYPE_SINGLE) { + OutputItemSingle *single = (OutputItemSingle *)item_l; + + if (!single->value) + ignore = TRUE; + } else if (item_l->type == VALUE_TYPE_MULTIPLE) { + OutputItemMultiple *multiple = (OutputItemMultiple *)item_l; + + if (!multiple->values) + ignore = TRUE; + } + + /* Compute max lengths */ + if (!ignore) { + aux = strlen (section_infos[field_infos[item_l->field].section].name); + if (aux > longest_section_name) + longest_section_name = aux; + aux = strlen (field_infos[item_l->field].name); + if (aux > longest_field_name) + longest_field_name = aux; + } + } + + /* Second pass to print */ + for (l = output_items; l; l = g_list_next (l)) { + OutputItem *item_l; + OutputItemSingle *single = NULL; + OutputItemMultiple *multiple = NULL; + + item_l = (OutputItem *)(l->data); + if (item_l->type == VALUE_TYPE_SINGLE) + single = (OutputItemSingle *)item_l; + else if (item_l->type == VALUE_TYPE_MULTIPLE) + multiple = (OutputItemMultiple *)item_l; + else + g_assert_not_reached (); + + /* Ignore items without a value set */ + if ((single && (!single->value || !single->value[0])) || + (multiple && !multiple->values)) + continue; + + /* Section change? */ + if (field_infos[item_l->field].section != current_section) { + current_section = field_infos[item_l->field].section; + g_print (" %.*s\n", + longest_section_name + longest_field_name + 4, + "------------------------------------------------------------"); + g_print (" %-*.*s | ", + longest_section_name, + longest_section_name, + section_infos[field_infos[item_l->field].section].name); + } else + g_print (" %*.*s | ", + longest_section_name, + longest_section_name, + ""); + + g_print ("%*.*s: ", + longest_field_name, longest_field_name, field_infos[item_l->field].name); + + if (single) { + gchar **split_lines; + guint i; + + split_lines = g_strsplit (single->value, "\n", -1); + for (i = 0; split_lines[i]; i++) { + if (i != 0) { + g_print (" %*.*s | %*.*s ", + longest_section_name, longest_section_name, "", + longest_field_name, longest_field_name, ""); + } + g_print ("%s\n", split_lines[i]); + } + g_strfreev (split_lines); + } else if (multiple) { + guint line_length = 0; + guint n, i; + + n = multiple->values ? g_strv_length (multiple->values) : 0; + for (i = 0; i < n; i++) { + const gchar *value; + guint value_length; + + value = multiple->values[i]; + value_length = strlen (value) + ((i < (n - 1)) ? 2 : 0); + if ((multiple->multiline && i != 0) || ((line_length + value_length) > HUMAN_MAX_VALUE_LENGTH)) { + line_length = 0; + g_print ("\n" + " %*.*s | %*.*s ", + longest_section_name, longest_section_name, "", + longest_field_name, longest_field_name, ""); + } else + line_length += value_length; + g_print ("%s%s", value, (!multiple->multiline && i < (n - 1)) ? ", " : ""); + } + g_print ("\n"); + } + } +} + +static void +dump_output_list_human (MmcF field) +{ + GList *l; + guint n; + + g_assert (field != MMC_F_UNKNOWN); + + /* First pass to process */ + for (n = 0, l = output_items; l; l = g_list_next (l), n++) { + OutputItem *item_l; + OutputItemListitem *listitem; + + item_l = (OutputItem *)(l->data); + g_assert (item_l->type == VALUE_TYPE_LISTITEM); + listitem = (OutputItemListitem *)item_l; + g_assert (listitem->value); + + /* All items must be of same type */ + g_assert_cmpint (item_l->field, ==, field); + } + + /* Second pass to print */ + if (n == 0) { + g_print ("No %s were found\n", field_infos[field].name); + return; + } + for (l = output_items; l; l = g_list_next (l)) { + OutputItemListitem *listitem; + + listitem = (OutputItemListitem *)(l->data); + g_print ("%s%s %s\n", listitem->prefix, listitem->value, listitem->extra); + } +} + +/******************************************************************************/ +/* Key-value output */ + +#define KEY_ARRAY_LENGTH_SUFFIX ".length" +#define KEY_ARRAY_VALUE_SUFFIX ".value" + +static gint +list_sort_keyvalue (const OutputItem *item_a, + const OutputItem *item_b) +{ + return item_a->field - item_b->field; +} + +static void +dump_output_keyvalue (void) +{ + GList *l; + guint longest_field_key = 0; + + output_items = g_list_sort (output_items, (GCompareFunc) list_sort_keyvalue); + + /* First pass to process */ + for (l = output_items; l; l = g_list_next (l)) { + OutputItem *item_l; + OutputItemMultiple *multiple = NULL; + guint key_length; + + item_l = (OutputItem *)(l->data); + if (item_l->type == VALUE_TYPE_MULTIPLE) + multiple = (OutputItemMultiple *)item_l; + + key_length = strlen (field_infos[item_l->field].key); + + /* when printing array contents, each item is given with an index, + * e.g.: something.value[1] + * The max length of the field will need to consider the array length + * in order to accommodate the length of the index. + */ + if (multiple) { + guint n; + + n = multiple->values ? g_strv_length (multiple->values) : 0; + if (n > 0) { + key_length += ((strlen (KEY_ARRAY_VALUE_SUFFIX)) + 3); + if (n > 10) + key_length++; + } + } + + if (key_length > longest_field_key) + longest_field_key = key_length; + } + + /* Second pass to print */ + for (l = output_items; l; l = g_list_next (l)) { + OutputItem *item_l; + OutputItemSingle *single = NULL; + OutputItemMultiple *multiple = NULL; + + item_l = (OutputItem *)(l->data); + if (item_l->type == VALUE_TYPE_SINGLE) + single = (OutputItemSingle *)item_l; + else if (item_l->type == VALUE_TYPE_MULTIPLE) + multiple = (OutputItemMultiple *)item_l; + else + g_assert_not_reached (); + + if (single) { + gchar *escaped = NULL; + + if (single->value) + escaped = g_strescape (single->value, NULL); + g_print ("%-*.*s : %s\n", + longest_field_key, longest_field_key, field_infos[item_l->field].key, + escaped ? escaped : "--"); + g_free (escaped); + } else if (multiple) { + guint n; + + n = multiple->values ? g_strv_length (multiple->values) : 0; + if (n > 0) { + guint i; + gchar *new_key; + + new_key = g_strdup_printf ("%s" KEY_ARRAY_LENGTH_SUFFIX, field_infos[item_l->field].key); + g_print ("%-*.*s : %u\n", longest_field_key, longest_field_key, new_key, n); + g_free (new_key); + + for (i = 0; i < n; i++) { + gchar *escaped = NULL; + + /* Printed indices start at 1 */ + new_key = g_strdup_printf ("%s" KEY_ARRAY_VALUE_SUFFIX "[%u]", field_infos[item_l->field].key, i + 1); + escaped = g_strescape (multiple->values[i], NULL); + g_print ("%-*.*s : %s\n", longest_field_key, longest_field_key, new_key, escaped); + g_free (escaped); + g_free (new_key); + } + } else + g_print ("%-*.*s : --\n", + longest_field_key, longest_field_key, field_infos[item_l->field].key); + } + } +} + +static void +dump_output_list_keyvalue (MmcF field) +{ + GList *l; + guint key_length; + guint n; + gchar *new_key; + + g_assert (field != MMC_F_UNKNOWN); + key_length = strlen (field_infos[field].key); + + /* First pass to process */ + for (n = 0, l = output_items; l; l = g_list_next (l), n++) { + OutputItem *item_l; + OutputItemListitem *listitem; + + item_l = (OutputItem *)(l->data); + g_assert (item_l->type == VALUE_TYPE_LISTITEM); + listitem = (OutputItemListitem *)item_l; + g_assert (listitem->value); + + /* All items must be of same type */ + g_assert_cmpint (item_l->field, ==, field); + } + + if (n > 0) { + key_length += ((strlen (KEY_ARRAY_VALUE_SUFFIX)) + 3); + if (n > 10) + key_length++; + } + + new_key = g_strdup_printf ("%s" KEY_ARRAY_LENGTH_SUFFIX, field_infos[field].key); + g_print ("%-*.*s : %u\n", key_length, key_length, new_key, n); + g_free (new_key); + + /* Second pass to print */ + for (n = 0, l = output_items; l; l = g_list_next (l), n++) { + OutputItemListitem *listitem; + + listitem = (OutputItemListitem *)(l->data); + new_key = g_strdup_printf ("%s" KEY_ARRAY_VALUE_SUFFIX "[%u]", field_infos[field].key, n + 1); + g_print ("%-*.*s : %s\n", + key_length, key_length, new_key, + listitem->value); + g_free (new_key); + } +} + +/******************************************************************************/ +/* Dump output */ + +void +mmcli_output_dump (void) +{ + switch (selected_type) { + case MMC_OUTPUT_TYPE_NONE: + break; + case MMC_OUTPUT_TYPE_HUMAN: + dump_output_human (); + break; + case MMC_OUTPUT_TYPE_KEYVALUE: + dump_output_keyvalue (); + break; + } + + g_list_free_full (output_items, (GDestroyNotify) output_item_free); + output_items = NULL; + + fflush (stdout); +} + +void +mmcli_output_list_dump (MmcF field) +{ + switch (selected_type) { + case MMC_OUTPUT_TYPE_NONE: + break; + case MMC_OUTPUT_TYPE_HUMAN: + dump_output_list_human (field); + break; + case MMC_OUTPUT_TYPE_KEYVALUE: + dump_output_list_keyvalue (field); + break; + } + + g_list_free_full (output_items, (GDestroyNotify) output_item_free); + output_items = NULL; + + fflush (stdout); +} diff -Nru modemmanager-1.6.8/cli/mmcli-output.h modemmanager-1.10.0/cli/mmcli-output.h --- modemmanager-1.6.8/cli/mmcli-output.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/cli/mmcli-output.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,337 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * mmcli -- Control modem status & access information from the command line + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MMCLI_OUTPUT_H +#define MMCLI_OUTPUT_H + +#define _LIBMM_INSIDE_MMCLI +#include + +/******************************************************************************/ +/* List of sections (grouped fields) displayed in the human-friendly output */ + +typedef enum { + MMC_S_UNKNOWN = -1, + /* Modem object related sections */ + MMC_S_MODEM_GENERAL = 0, + MMC_S_MODEM_HARDWARE, + MMC_S_MODEM_SYSTEM, + MMC_S_MODEM_NUMBERS, + MMC_S_MODEM_STATUS, + MMC_S_MODEM_MODES, + MMC_S_MODEM_BANDS, + MMC_S_MODEM_IP, + MMC_S_MODEM_3GPP, + MMC_S_MODEM_3GPP_EPS, + MMC_S_MODEM_3GPP_SCAN, + MMC_S_MODEM_3GPP_USSD, + MMC_S_MODEM_CDMA, + MMC_S_MODEM_SIM, + MMC_S_MODEM_BEARER, + MMC_S_MODEM_TIME, + MMC_S_MODEM_TIMEZONE, + MMC_S_MODEM_MESSAGING, + MMC_S_MODEM_SIGNAL, + MMC_S_MODEM_SIGNAL_CDMA1X, + MMC_S_MODEM_SIGNAL_EVDO, + MMC_S_MODEM_SIGNAL_GSM, + MMC_S_MODEM_SIGNAL_UMTS, + MMC_S_MODEM_SIGNAL_LTE, + MMC_S_MODEM_OMA, + MMC_S_MODEM_OMA_CURRENT, + MMC_S_MODEM_OMA_PENDING, + MMC_S_MODEM_LOCATION, + MMC_S_MODEM_LOCATION_3GPP, + MMC_S_MODEM_LOCATION_GPS, + MMC_S_MODEM_LOCATION_CDMABS, + MMC_S_MODEM_FIRMWARE, + MMC_S_MODEM_FIRMWARE_FASTBOOT, + MMC_S_BEARER_GENERAL, + MMC_S_BEARER_STATUS, + MMC_S_BEARER_PROPERTIES, + MMC_S_BEARER_IPV4_CONFIG, + MMC_S_BEARER_IPV6_CONFIG, + MMC_S_BEARER_STATS, + MMC_S_CALL_GENERAL, + MMC_S_CALL_PROPERTIES, + MMC_S_CALL_AUDIO_FORMAT, + MMC_S_SMS_GENERAL, + MMC_S_SMS_CONTENT, + MMC_S_SMS_PROPERTIES, + MMC_S_SIM_GENERAL, + MMC_S_SIM_PROPERTIES, +} MmcS; + +/******************************************************************************/ +/* List of fields */ + +typedef enum { + MMC_F_UNKNOWN = -1, + /* General section */ + MMC_F_GENERAL_DBUS_PATH = 0, + MMC_F_GENERAL_DEVICE_ID, + /* Hardware section */ + MMC_F_HARDWARE_MANUFACTURER, + MMC_F_HARDWARE_MODEL, + MMC_F_HARDWARE_REVISION, + MMC_F_HARDWARE_HW_REVISION, + MMC_F_HARDWARE_SUPPORTED_CAPABILITIES, + MMC_F_HARDWARE_CURRENT_CAPABILITIES, + MMC_F_HARDWARE_EQUIPMENT_ID, + /* System section */ + MMC_F_SYSTEM_DEVICE, + MMC_F_SYSTEM_DRIVERS, + MMC_F_SYSTEM_PLUGIN, + MMC_F_SYSTEM_PRIMARY_PORT, + MMC_F_SYSTEM_PORTS, + /* Numbers section */ + MMC_F_NUMBERS_OWN, + /* Status section */ + MMC_F_STATUS_LOCK, + MMC_F_STATUS_UNLOCK_RETRIES, + MMC_F_STATUS_STATE, + MMC_F_STATUS_FAILED_REASON, + MMC_F_STATUS_POWER_STATE, + MMC_F_STATUS_ACCESS_TECH, + MMC_F_STATUS_SIGNAL_QUALITY_VALUE, + MMC_F_STATUS_SIGNAL_QUALITY_RECENT, + /* Modes section */ + MMC_F_MODES_SUPPORTED, + MMC_F_MODES_CURRENT, + /* Bands section */ + MMC_F_BANDS_SUPPORTED, + MMC_F_BANDS_CURRENT, + /* IP section */ + MMC_F_IP_SUPPORTED, + /* 3GPP section */ + MMC_F_3GPP_IMEI, + MMC_F_3GPP_ENABLED_LOCKS, + MMC_F_3GPP_OPERATOR_ID, + MMC_F_3GPP_OPERATOR_NAME, + MMC_F_3GPP_REGISTRATION, + MMC_F_3GPP_PCO, + /* 3GPP EPS section */ + MMC_F_3GPP_EPS_UE_MODE, + MMC_F_3GPP_EPS_INITIAL_BEARER_PATH, + MMC_F_3GPP_EPS_BEARER_SETTINGS_APN, + MMC_F_3GPP_EPS_BEARER_SETTINGS_IP_TYPE, + MMC_F_3GPP_EPS_BEARER_SETTINGS_USER, + MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD, + /* 3GPP scan section */ + MMC_F_3GPP_SCAN_NETWORKS, + /* USSD section */ + MMC_F_3GPP_USSD_STATUS, + MMC_F_3GPP_USSD_NETWORK_REQUEST, + MMC_F_3GPP_USSD_NETWORK_NOTIFICATION, + /* CDMA section */ + MMC_F_CDMA_MEID, + MMC_F_CDMA_ESN, + MMC_F_CDMA_SID, + MMC_F_CDMA_NID, + MMC_F_CDMA_REGISTRATION_CDMA1X, + MMC_F_CDMA_REGISTRATION_EVDO, + MMC_F_CDMA_ACTIVATION, + /* SIM section */ + MMC_F_SIM_PATH, + /* Bearer section */ + MMC_F_BEARER_PATHS, + /* Time section */ + MMC_F_TIME_CURRENT, + MMC_F_TIMEZONE_CURRENT, + MMC_F_TIMEZONE_DST_OFFSET, + MMC_F_TIMEZONE_LEAP_SECONDS, + /* Messaging section */ + MMC_F_MESSAGING_SUPPORTED_STORAGES, + MMC_F_MESSAGING_DEFAULT_STORAGES, + /* Signal section */ + MMC_F_SIGNAL_REFRESH_RATE, + MMC_F_SIGNAL_CDMA1X_RSSI, + MMC_F_SIGNAL_CDMA1X_ECIO, + MMC_F_SIGNAL_EVDO_RSSI, + MMC_F_SIGNAL_EVDO_ECIO, + MMC_F_SIGNAL_EVDO_SINR, + MMC_F_SIGNAL_EVDO_IO, + MMC_F_SIGNAL_GSM_RSSI, + MMC_F_SIGNAL_UMTS_RSSI, + MMC_F_SIGNAL_UMTS_RSCP, + MMC_F_SIGNAL_UMTS_ECIO, + MMC_F_SIGNAL_LTE_RSSI, + MMC_F_SIGNAL_LTE_RSRQ, + MMC_F_SIGNAL_LTE_RSRP, + MMC_F_SIGNAL_LTE_SNR, + /* OMA section */ + MMC_F_OMA_FEATURES, + MMC_F_OMA_CURRENT_TYPE, + MMC_F_OMA_CURRENT_STATE, + MMC_F_OMA_PENDING_SESSIONS, + /* Location status section */ + MMC_F_LOCATION_CAPABILITIES, + MMC_F_LOCATION_ENABLED, + MMC_F_LOCATION_SIGNALS, + MMC_F_LOCATION_GPS_REFRESH_RATE, + MMC_F_LOCATION_GPS_SUPL_SERVER, + MMC_F_LOCATION_GPS_ASSISTANCE, + MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS, + MMC_F_LOCATION_3GPP_MCC, + MMC_F_LOCATION_3GPP_MNC, + MMC_F_LOCATION_3GPP_LAC, + MMC_F_LOCATION_3GPP_TAC, + MMC_F_LOCATION_3GPP_CID, + MMC_F_LOCATION_GPS_NMEA, + MMC_F_LOCATION_GPS_UTC, + MMC_F_LOCATION_GPS_LONG, + MMC_F_LOCATION_GPS_LAT, + MMC_F_LOCATION_GPS_ALT, + MMC_F_LOCATION_CDMABS_LONG, + MMC_F_LOCATION_CDMABS_LAT, + /* Firmware status section */ + MMC_F_FIRMWARE_LIST, + MMC_F_FIRMWARE_METHOD, + MMC_F_FIRMWARE_DEVICE_IDS, + MMC_F_FIRMWARE_VERSION, + MMC_F_FIRMWARE_FASTBOOT_AT, + /* Bearer general section */ + MMC_F_BEARER_GENERAL_DBUS_PATH, + MMC_F_BEARER_GENERAL_TYPE, + /* Bearer status section */ + MMC_F_BEARER_STATUS_CONNECTED, + MMC_F_BEARER_STATUS_SUSPENDED, + MMC_F_BEARER_STATUS_INTERFACE, + MMC_F_BEARER_STATUS_IP_TIMEOUT, + /* Bearer properties section */ + MMC_F_BEARER_PROPERTIES_APN, + MMC_F_BEARER_PROPERTIES_ROAMING, + MMC_F_BEARER_PROPERTIES_IP_TYPE, + MMC_F_BEARER_PROPERTIES_USER, + MMC_F_BEARER_PROPERTIES_PASSWORD, + MMC_F_BEARER_PROPERTIES_NUMBER, + MMC_F_BEARER_PROPERTIES_RM_PROTOCOL, + MMC_F_BEARER_IPV4_CONFIG_METHOD, + MMC_F_BEARER_IPV4_CONFIG_ADDRESS, + MMC_F_BEARER_IPV4_CONFIG_PREFIX, + MMC_F_BEARER_IPV4_CONFIG_GATEWAY, + MMC_F_BEARER_IPV4_CONFIG_DNS, + MMC_F_BEARER_IPV4_CONFIG_MTU, + MMC_F_BEARER_IPV6_CONFIG_METHOD, + MMC_F_BEARER_IPV6_CONFIG_ADDRESS, + MMC_F_BEARER_IPV6_CONFIG_PREFIX, + MMC_F_BEARER_IPV6_CONFIG_GATEWAY, + MMC_F_BEARER_IPV6_CONFIG_DNS, + MMC_F_BEARER_IPV6_CONFIG_MTU, + MMC_F_BEARER_STATS_DURATION, + MMC_F_BEARER_STATS_BYTES_RX, + MMC_F_BEARER_STATS_BYTES_TX, + MMC_F_CALL_GENERAL_DBUS_PATH, + MMC_F_CALL_PROPERTIES_NUMBER, + MMC_F_CALL_PROPERTIES_DIRECTION, + MMC_F_CALL_PROPERTIES_STATE, + MMC_F_CALL_PROPERTIES_STATE_REASON, + MMC_F_CALL_PROPERTIES_AUDIO_PORT, + MMC_F_CALL_AUDIO_FORMAT_ENCODING, + MMC_F_CALL_AUDIO_FORMAT_RESOLUTION, + MMC_F_CALL_AUDIO_FORMAT_RATE, + MMC_F_SMS_GENERAL_DBUS_PATH, + MMC_F_SMS_CONTENT_NUMBER, + MMC_F_SMS_CONTENT_TEXT, + MMC_F_SMS_CONTENT_DATA, + MMC_F_SMS_PROPERTIES_PDU_TYPE, + MMC_F_SMS_PROPERTIES_STATE, + MMC_F_SMS_PROPERTIES_VALIDITY, + MMC_F_SMS_PROPERTIES_STORAGE, + MMC_F_SMS_PROPERTIES_SMSC, + MMC_F_SMS_PROPERTIES_CLASS, + MMC_F_SMS_PROPERTIES_TELESERVICE_ID, + MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY, + MMC_F_SMS_PROPERTIES_DELIVERY_REPORT, + MMC_F_SMS_PROPERTIES_MSG_REFERENCE, + MMC_F_SMS_PROPERTIES_TIMESTAMP, + MMC_F_SMS_PROPERTIES_DELIVERY_STATE, + MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP, + MMC_F_SIM_GENERAL_DBUS_PATH, + MMC_F_SIM_PROPERTIES_IMSI, + MMC_F_SIM_PROPERTIES_ICCID, + MMC_F_SIM_PROPERTIES_OPERATOR_ID, + MMC_F_SIM_PROPERTIES_OPERATOR_NAME, + /* Lists */ + MMC_F_MODEM_LIST_DBUS_PATH, + MMC_F_SMS_LIST_DBUS_PATH, + MMC_F_CALL_LIST_DBUS_PATH, +} MmcF; + +/******************************************************************************/ +/* Output type selection */ + +typedef enum { + MMC_OUTPUT_TYPE_NONE, + MMC_OUTPUT_TYPE_HUMAN, + MMC_OUTPUT_TYPE_KEYVALUE, +} MmcOutputType; + +void mmcli_output_set (MmcOutputType type); +MmcOutputType mmcli_output_get (void); + +/******************************************************************************/ +/* Generic output management */ + +void mmcli_output_string (MmcF field, + const gchar *str); +void mmcli_output_string_take (MmcF field, + gchar *str); +void mmcli_output_string_list (MmcF field, + const gchar *str); +void mmcli_output_string_list_take (MmcF field, + gchar *str); +void mmcli_output_string_multiline (MmcF field, + const gchar *str); +void mmcli_output_string_multiline_take (MmcF field, + gchar *str); +void mmcli_output_string_array (MmcF field, + const gchar **strv, + gboolean multiline); +void mmcli_output_string_array_take (MmcF field, + gchar **strv, + gboolean multiline); +void mmcli_output_string_take_typed (MmcF field, + gchar *value, + const gchar *type); +void mmcli_output_listitem (MmcF field, + const gchar *prefix, + const gchar *value, + const gchar *extra); + +/******************************************************************************/ +/* Custom output management */ + +void mmcli_output_signal_quality (guint value, + gboolean recent); +void mmcli_output_state (MMModemState state, + MMModemStateFailedReason reason); +void mmcli_output_scan_networks (GList *network_list); +void mmcli_output_firmware_list (GList *firmware_list, + MMFirmwareProperties *selected); +void mmcli_output_pco_list (GList *pco_list); + +/******************************************************************************/ +/* Dump output */ + +void mmcli_output_dump (void); +void mmcli_output_list_dump (MmcF field); + +#endif /* MMCLI_OUTPUT_H */ diff -Nru modemmanager-1.6.8/cli/mmcli-sim.c modemmanager-1.10.0/cli/mmcli-sim.c --- modemmanager-1.6.8/cli/mmcli-sim.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-sim.c 2019-01-15 15:57:35.000000000 +0100 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2011-2018 Aleksander Morgado */ #include "config.h" @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -124,6 +125,9 @@ exit (EXIT_FAILURE); } + if (info_flag) + mmcli_force_sync_operation (); + checked = TRUE; return !!n_actions; } @@ -154,22 +158,12 @@ static void print_sim_info (MMSim *sim) { - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "unknown") - - g_print ("SIM '%s'\n", - mm_sim_get_path (sim)); - g_print (" -------------------------\n" - " Properties | imsi : '%s'\n" - " | id : '%s'\n" - " | operator id : '%s'\n" - " | operator name : '%s'\n", - VALIDATE (mm_sim_get_imsi (sim)), - VALIDATE (mm_sim_get_identifier (sim)), - VALIDATE (mm_sim_get_operator_identifier (sim)), - VALIDATE (mm_sim_get_operator_name (sim))); + mmcli_output_string (MMC_F_SIM_GENERAL_DBUS_PATH, mm_sim_get_path (sim)); + mmcli_output_string (MMC_F_SIM_PROPERTIES_IMSI, mm_sim_get_imsi (sim)); + mmcli_output_string (MMC_F_SIM_PROPERTIES_ICCID, mm_sim_get_identifier (sim)); + mmcli_output_string (MMC_F_SIM_PROPERTIES_OPERATOR_ID, mm_sim_get_operator_identifier (sim)); + mmcli_output_string (MMC_F_SIM_PROPERTIES_OPERATOR_NAME, mm_sim_get_operator_name (sim)); + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/cli/mmcli-sms.c modemmanager-1.10.0/cli/mmcli-sms.c --- modemmanager-1.6.8/cli/mmcli-sms.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/cli/mmcli-sms.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include "mmcli.h" #include "mmcli-common.h" +#include "mmcli-output.h" /* Context */ typedef struct { @@ -147,89 +148,49 @@ static void print_sms_info (MMSms *sms) { - MMSmsPduType pdu_type; - const guint8 *data; - gsize data_size; - - /* Not the best thing to do, as we may be doing _get() calls twice, but - * easiest to maintain */ -#undef VALIDATE -#define VALIDATE(str) (str ? str : "unknown") - - pdu_type = mm_sms_get_pdu_type (sms); - - g_print ("SMS '%s'\n", - mm_sms_get_path (sms)); - g_print (" -----------------------------------\n" - " Content | number: '%s'\n", - VALIDATE (mm_sms_get_number (sms))); - - if (mm_sms_get_text (sms)) - g_print (" | text: '%s'\n", - VALIDATE (mm_sms_get_text (sms))); - - data = mm_sms_get_data (sms, &data_size); - if (data) { - gchar *data_hex; - - data_hex = mm_utils_bin2hexstr (data, data_size); - g_print (" | data: '%s'\n", - VALIDATE (data_hex)); - g_free (data_hex); - } - - g_print (" -----------------------------------\n" - " Properties | PDU type: '%s'\n" - " | state: '%s'\n", - mm_sms_pdu_type_get_string (pdu_type), - mm_sms_state_get_string (mm_sms_get_state (sms))); - + MMSmsPduType pdu_type; + gchar *data = NULL; + const guint8 *databin; + gsize databin_size; + gchar *validity = NULL; + gchar *class = NULL; + const gchar *delivery_report = NULL; + gchar *message_reference = NULL; + const gchar *delivery_state = NULL; + + databin = mm_sms_get_data (sms, &databin_size); + if (databin) + data = mm_utils_bin2hexstr (databin, databin_size); if (mm_sms_get_validity_type (sms) == MM_SMS_VALIDITY_TYPE_RELATIVE) - g_print (" | validity (relative): '%u'\n", - mm_sms_get_validity_relative (sms)); - - g_print (" | storage: '%s'\n", - mm_sms_storage_get_string (mm_sms_get_storage (sms))); - - /* Print properties which are set, regardless of the pdu type */ - - if (mm_sms_get_smsc (sms)) - g_print (" | smsc: '%s'\n", - mm_sms_get_smsc (sms)); - + validity = g_strdup_printf ("%u", mm_sms_get_validity_relative (sms)); if (mm_sms_get_class (sms) >= 0) - g_print (" | class: '%d'\n", - mm_sms_get_class (sms)); - - if (mm_sms_get_teleservice_id (sms) != MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN) - g_print (" | teleservice id: '%s'\n", - mm_sms_cdma_teleservice_id_get_string (mm_sms_get_teleservice_id (sms))); - - if (mm_sms_get_service_category (sms) != MM_SMS_CDMA_SERVICE_CATEGORY_UNKNOWN) - g_print (" | service category: '%s'\n", - mm_sms_cdma_service_category_get_string (mm_sms_get_service_category (sms))); - - /* Delivery report request just in 3GPP submit PDUs */ + class = g_strdup_printf ("%d", mm_sms_get_class (sms)); + pdu_type = mm_sms_get_pdu_type (sms); if (pdu_type == MM_SMS_PDU_TYPE_SUBMIT) - g_print (" | delivery report: '%s'\n", - mm_sms_get_delivery_report_request (sms) ? "requested" : "not requested"); - + delivery_report = mm_sms_get_delivery_report_request (sms) ? "requested" : "not requested"; if (mm_sms_get_message_reference (sms) != 0) - g_print (" | message reference: '%u'\n", - mm_sms_get_message_reference (sms)); - - if (mm_sms_get_timestamp (sms)) - g_print (" | timestamp: '%s'\n", - mm_sms_get_timestamp (sms)); - + message_reference = g_strdup_printf ("%u", mm_sms_get_message_reference (sms)); if (mm_sms_get_delivery_state (sms) != MM_SMS_DELIVERY_STATE_UNKNOWN) - g_print (" | delivery state: '%s' (0x%X)\n", - VALIDATE (mm_sms_delivery_state_get_string_extended (mm_sms_get_delivery_state (sms))), - mm_sms_get_delivery_state (sms)); - - if (mm_sms_get_discharge_timestamp (sms)) - g_print (" | discharge timestamp: '%s'\n", - mm_sms_get_discharge_timestamp (sms)); + delivery_state = mm_sms_delivery_state_get_string_extended (mm_sms_get_delivery_state (sms)); + + mmcli_output_string (MMC_F_SMS_GENERAL_DBUS_PATH, mm_sms_get_path (sms)); + mmcli_output_string (MMC_F_SMS_CONTENT_NUMBER, mm_sms_get_number (sms)); + mmcli_output_string (MMC_F_SMS_CONTENT_TEXT, mm_sms_get_text (sms)); + mmcli_output_string_take (MMC_F_SMS_CONTENT_DATA, data); + mmcli_output_string (MMC_F_SMS_PROPERTIES_PDU_TYPE, mm_sms_pdu_type_get_string (pdu_type)); + mmcli_output_string (MMC_F_SMS_PROPERTIES_STATE, mm_sms_state_get_string (mm_sms_get_state (sms))); + mmcli_output_string_take (MMC_F_SMS_PROPERTIES_VALIDITY, validity); + mmcli_output_string (MMC_F_SMS_PROPERTIES_STORAGE, mm_sms_storage_get_string (mm_sms_get_storage (sms))); + mmcli_output_string (MMC_F_SMS_PROPERTIES_SMSC, mm_sms_get_smsc (sms)); + mmcli_output_string_take (MMC_F_SMS_PROPERTIES_CLASS, class); + mmcli_output_string (MMC_F_SMS_PROPERTIES_TELESERVICE_ID, mm_sms_cdma_teleservice_id_get_string (mm_sms_get_teleservice_id (sms))); + mmcli_output_string (MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY, mm_sms_cdma_service_category_get_string (mm_sms_get_service_category (sms))); + mmcli_output_string (MMC_F_SMS_PROPERTIES_DELIVERY_REPORT, delivery_report); + mmcli_output_string (MMC_F_SMS_PROPERTIES_MSG_REFERENCE, message_reference); + mmcli_output_string (MMC_F_SMS_PROPERTIES_TIMESTAMP, mm_sms_get_timestamp (sms)); + mmcli_output_string (MMC_F_SMS_PROPERTIES_DELIVERY_STATE, delivery_state); + mmcli_output_string (MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP, mm_sms_get_discharge_timestamp (sms)); + mmcli_output_dump (); } static void diff -Nru modemmanager-1.6.8/compile modemmanager-1.10.0/compile --- modemmanager-1.6.8/compile 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/compile 2019-01-17 16:15:48.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru modemmanager-1.6.8/config.guess modemmanager-1.10.0/config.guess --- modemmanager-1.6.8/config.guess 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/config.guess 2019-01-17 16:15:48.000000000 +0100 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2014-11-04' +timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -107,9 +107,9 @@ dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -168,21 +175,31 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,44 +214,67 @@ os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,63 +291,54 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -319,7 +350,7 @@ echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -346,38 +377,38 @@ sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + eval "$set_cc_for_build" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -386,25 +417,25 @@ ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -415,44 +446,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -461,23 +492,23 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -503,17 +534,17 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -530,7 +561,7 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -542,14 +573,14 @@ if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -560,7 +591,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -574,7 +605,7 @@ exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -583,18 +614,18 @@ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -609,28 +640,28 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -663,13 +694,13 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -680,23 +711,23 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -721,11 +752,11 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -734,7 +765,7 @@ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -742,9 +773,9 @@ exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -769,127 +800,109 @@ echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -902,58 +915,64 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -967,64 +986,70 @@ #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1038,34 +1063,34 @@ # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1075,12 +1100,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1090,9 +1115,9 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1100,7 +1125,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1112,9 +1137,9 @@ exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1134,9 +1159,9 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1145,28 +1170,28 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1177,7 +1202,7 @@ *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1197,23 +1222,23 @@ exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1232,46 +1257,56 @@ echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1282,27 +1317,33 @@ # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1311,18 +1352,18 @@ echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1343,14 +1384,14 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1359,34 +1400,48 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1405,16 +1460,16 @@ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru modemmanager-1.6.8/config.h.in modemmanager-1.10.0/config.h.in --- modemmanager-1.6.8/config.h.in 2017-06-17 10:24:55.000000000 +0200 +++ modemmanager-1.10.0/config.h.in 2019-01-17 16:15:47.000000000 +0100 @@ -119,8 +119,14 @@ /* Define if you want QMI support */ #undef WITH_QMI -/* Define if you have suspend-resume support */ -#undef WITH_SUSPEND_RESUME +/* Define if you want systemd journal support */ +#undef WITH_SYSTEMD_JOURNAL + +/* Define if you have systemd suspend-resume support */ +#undef WITH_SYSTEMD_SUSPEND_RESUME + +/* Define if you want udev support */ +#undef WITH_UDEV /* Define to 1 if on MINIX. */ #undef _MINIX diff -Nru modemmanager-1.6.8/config.rpath modemmanager-1.10.0/config.rpath --- modemmanager-1.6.8/config.rpath 2017-06-17 10:24:35.000000000 +0200 +++ modemmanager-1.10.0/config.rpath 2019-01-17 16:15:34.000000000 +0100 @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2014 Free Software Foundation, Inc. +# Copyright 1996-2016 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # diff -Nru modemmanager-1.6.8/config.sub modemmanager-1.10.0/config.sub --- modemmanager-1.6.8/config.sub 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/config.sub 2019-01-17 16:15:48.000000000 +0100 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2014-12-03' +timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -95,7 +94,7 @@ *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -113,24 +112,24 @@ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -179,44 +178,44 @@ ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 @@ -228,10 +227,7 @@ os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -255,15 +251,16 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -299,13 +296,14 @@ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -314,7 +312,7 @@ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ - | we32k \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -335,7 +333,7 @@ basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -364,7 +362,7 @@ ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -376,17 +374,18 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -427,13 +426,15 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -442,6 +443,7 @@ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -455,7 +457,7 @@ # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -489,7 +491,7 @@ basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -518,6 +520,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -531,7 +536,7 @@ os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -539,13 +544,13 @@ os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -634,10 +639,18 @@ basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -727,9 +740,6 @@ hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; hppaosf) basic_machine=hppa1.1-hp os=-osf @@ -742,26 +752,26 @@ basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -780,19 +790,16 @@ os=-sysv ;; leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -824,10 +831,10 @@ os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -846,7 +853,7 @@ os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc @@ -888,7 +895,7 @@ basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -933,6 +940,12 @@ nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -965,7 +978,7 @@ os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -981,7 +994,7 @@ basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -996,16 +1009,16 @@ basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -1015,23 +1028,23 @@ ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1085,17 +1098,10 @@ sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1114,7 +1120,7 @@ os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1236,6 +1242,9 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1244,20 +1253,12 @@ basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1286,10 +1287,6 @@ vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1299,9 +1296,6 @@ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1321,7 +1315,7 @@ # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1329,10 +1323,10 @@ # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1343,8 +1337,8 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1355,45 +1349,48 @@ -solaris) os=-solaris2 ;; - -svr4*) - os=-sysv4 - ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1410,12 +1407,12 @@ -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1424,10 +1421,10 @@ os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1438,12 +1435,6 @@ -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1468,7 +1459,7 @@ -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1490,7 +1481,7 @@ -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1505,32 +1496,38 @@ -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; + -ios) + ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1620,12 +1617,12 @@ sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1665,7 +1662,7 @@ m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1680,9 +1677,6 @@ i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1792,15 +1786,15 @@ vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru modemmanager-1.6.8/configure modemmanager-1.10.0/configure --- modemmanager-1.6.8/configure 2017-06-17 10:24:54.000000000 +0200 +++ modemmanager-1.10.0/configure 2019-01-17 16:15:46.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ModemManager 1.6.8. +# Generated by GNU Autoconf 2.69 for ModemManager 1.10.0. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='ModemManager' PACKAGE_TARNAME='ModemManager' -PACKAGE_VERSION='1.6.8' -PACKAGE_STRING='ModemManager 1.6.8' +PACKAGE_VERSION='1.10.0' +PACKAGE_STRING='ModemManager 1.10.0' PACKAGE_BUGREPORT='modemmanager-devel@lists.freedesktop.org' PACKAGE_URL='' @@ -653,12 +653,18 @@ MM_DEFAULT_USER_POLICY POLKIT_LIBS POLKIT_CFLAGS -SUSPEND_RESUME_SYSTEMD_FALSE -SUSPEND_RESUME_SYSTEMD_TRUE +WITH_SYSTEMD_JOURNAL_FALSE +WITH_SYSTEMD_JOURNAL_TRUE +WITH_SYSTEMD_SUSPEND_RESUME_FALSE +WITH_SYSTEMD_SUSPEND_RESUME_TRUE LIBSYSTEMD_LOGIN_LIBS LIBSYSTEMD_LOGIN_CFLAGS LIBSYSTEMD_LIBS LIBSYSTEMD_CFLAGS +GUDEV_LIBS +GUDEV_CFLAGS +WITH_UDEV_FALSE +WITH_UDEV_TRUE HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE SYSTEMD_UNIT_DIR @@ -690,8 +696,6 @@ CODE_COVERAGE_ENABLED_TRUE GDBUS_CODEGEN GLIB_MKENUMS -GUDEV_LIBS -GUDEV_CFLAGS MMCLI_LIBS MMCLI_CFLAGS LIBMM_GLIB_LIBS @@ -707,44 +711,14 @@ LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS +MSGMERGE XGETTEXT_015 +XGETTEXT GMSGFMT_015 MSGFMT_015 -GETTEXT_MACRO_VERSION -ALL_LINGUAS -INTLTOOL_PERL GMSGFMT MSGFMT -MSGMERGE -XGETTEXT -INTLTOOL_POLICY_RULE -INTLTOOL_SERVICE_RULE -INTLTOOL_THEME_RULE -INTLTOOL_SCHEMAS_RULE -INTLTOOL_CAVES_RULE -INTLTOOL_XML_NOMERGE_RULE -INTLTOOL_XML_RULE -INTLTOOL_KBD_RULE -INTLTOOL_XAM_RULE -INTLTOOL_UI_RULE -INTLTOOL_SOUNDLIST_RULE -INTLTOOL_SHEET_RULE -INTLTOOL_SERVER_RULE -INTLTOOL_PONG_RULE -INTLTOOL_OAF_RULE -INTLTOOL_PROP_RULE -INTLTOOL_KEYS_RULE -INTLTOOL_DIRECTORY_RULE -INTLTOOL_DESKTOP_RULE -intltool__v_merge_options_0 -intltool__v_merge_options_ -INTLTOOL_V_MERGE_OPTIONS -INTLTOOL__v_MERGE_0 -INTLTOOL__v_MERGE_ -INTLTOOL_V_MERGE -INTLTOOL_EXTRACT -INTLTOOL_MERGE -INTLTOOL_UPDATE +GETTEXT_MACRO_VERSION USE_NLS GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE @@ -813,7 +787,6 @@ AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -890,7 +863,8 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -920,7 +894,9 @@ with_dbus_sys_dir with_udev_base_dir with_systemdsystemunitdir -with_suspend_resume +with_udev +with_systemd_suspend_resume +with_systemd_journal with_polkit with_mbim with_qmi @@ -1500,7 +1476,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ModemManager 1.6.8 to adapt to many kinds of systems. +\`configure' configures ModemManager 1.10.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1570,7 +1546,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ModemManager 1.6.8:";; + short | recursive ) echo "Configuration of ModemManager 1.10.0:";; esac cat <<\_ACEOF @@ -1602,7 +1578,7 @@ Enable introspection for this build --enable-vala=[no/auto/yes] build Vala bindings [default=auto] - --enable-more-warnings Maximum compiler warnings + --enable-more-warnings Possible values: no/yes/error Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1627,8 +1603,12 @@ where udev base directory is --with-systemdsystemunitdir=DIR where systemd service files are - --with-suspend-resume=no|systemd - Enable suspend/resume support [[default=auto]] + --without-udev Build without udev support + --with-systemd-suspend-resume=no|yes + Enable systemd suspend/resume support + [[default=auto]] + --with-systemd-journal=no|yes|auto + Enable systemd journal support [[default=auto]] --with-polkit=(strict|permissive|no) Enable PolicyKit support [[default=auto]] --without-mbim Build without MBIM support @@ -1751,7 +1731,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ModemManager configure 1.6.8 +ModemManager configure 1.10.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2120,7 +2100,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ModemManager $as_me 1.6.8, which was +It was created by ModemManager $as_me 1.10.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2469,7 +2449,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.15' +am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2984,7 +2964,7 @@ # Define the identity of the package. PACKAGE='ModemManager' - VERSION='1.6.8' + VERSION='1.10.0' cat >>confdefs.h <<_ACEOF @@ -3014,8 +2994,8 @@ # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3182,7 +3162,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3306,45 +3286,45 @@ ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -5531,6 +5511,7 @@ + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -5539,8 +5520,8 @@ -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.6.42-b88ce' +macro_revision='2.4.6.42' @@ -7072,13 +7053,29 @@ fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -7527,7 +7524,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -8796,8 +8793,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -9192,8 +9189,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -10120,15 +10117,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -10292,6 +10289,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -10509,7 +10507,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10776,12 +10774,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10822,7 +10820,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -11146,6 +11144,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11853,8 +11852,8 @@ dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11910,7 +11909,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -13089,30 +13088,41 @@ old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if test -z "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -13204,17 +13214,17 @@ MM_MAJOR_VERSION=1 -MM_MINOR_VERSION=6 -MM_MICRO_VERSION=8 -MM_VERSION=1.6.8 +MM_MINOR_VERSION=10 +MM_MICRO_VERSION=0 +MM_VERSION=1.10.0 -MM_GLIB_LT_CURRENT=3 +MM_GLIB_LT_CURRENT=4 MM_GLIB_LT_REVISION=0 -MM_GLIB_LT_AGE=3 +MM_GLIB_LT_AGE=4 @@ -13566,8 +13576,8 @@ if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" >&5 -$as_echo_n "checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +$as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" @@ -13607,7 +13617,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -13625,7 +13635,7 @@ : elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else @@ -13728,534 +13738,6 @@ -case "$am__api_version" in - 1.01234) - as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 - ;; - *) - ;; -esac - -INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.40.0 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` -INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` -INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` -if test -n "0.40.0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.40.0" >&5 -$as_echo_n "checking for intltool >= 0.40.0... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 -$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } - test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || - as_fn_error $? "Your intltool is too old. You need intltool 0.40.0 or later." "$LINENO" 5 -fi - -# Extract the first word of "intltool-update", so it can be a program name with args. -set dummy intltool-update; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INTLTOOL_UPDATE in - [\\/]* | ?:[\\/]*) - ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE -if test -n "$INTLTOOL_UPDATE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 -$as_echo "$INTLTOOL_UPDATE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "intltool-merge", so it can be a program name with args. -set dummy intltool-merge; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INTLTOOL_MERGE in - [\\/]* | ?:[\\/]*) - ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE -if test -n "$INTLTOOL_MERGE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 -$as_echo "$INTLTOOL_MERGE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "intltool-extract", so it can be a program name with args. -set dummy intltool-extract; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INTLTOOL_EXTRACT in - [\\/]* | ?:[\\/]*) - ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT -if test -n "$INTLTOOL_EXTRACT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 -$as_echo "$INTLTOOL_EXTRACT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then - as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 -fi - -if test -z "$AM_DEFAULT_VERBOSITY"; then - AM_DEFAULT_VERBOSITY=1 -fi - - -INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' -INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' -INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' - - - - -INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' -intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' -intltool__v_merge_options_0='-q' - - - - - INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' -INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' - INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' -INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' -if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then - INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' -else - INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' -fi - INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Check the gettext tools to make sure they are GNU -# Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XGETTEXT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XGETTEXT in - [\\/]* | ?:[\\/]*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XGETTEXT=$ac_cv_path_XGETTEXT -if test -n "$XGETTEXT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 -$as_echo "$XGETTEXT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGMERGE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MSGMERGE in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MSGMERGE=$ac_cv_path_MSGMERGE -if test -n "$MSGMERGE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 -$as_echo "$MSGMERGE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MSGFMT=$ac_cv_path_MSGFMT -if test -n "$MSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -$as_echo "$MSGFMT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GMSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 -$as_echo "$GMSGFMT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then - as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 -fi -xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" -mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" -mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" -if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then - as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 -fi - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_INTLTOOL_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $INTLTOOL_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL -if test -n "$INTLTOOL_PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 -$as_echo "$INTLTOOL_PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test -z "$INTLTOOL_PERL"; then - as_fn_error $? "perl not found" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 -$as_echo_n "checking for perl >= 5.8.1... " >&6; } -$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 -if test $? -ne 0; then - as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 -else - IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 -$as_echo "$IT_PERL_VERSION" >&6; } -fi -if test "x" != "xno-xml"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 -$as_echo_n "checking for XML::Parser... " >&6; } - if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - else - as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 - fi -fi - -# Substitute ALL_LINGUAS so we can use it in po/Makefile - - - - - - - - GETTEXT_MACRO_VERSION=0.19 @@ -15378,16 +14860,21 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -15507,36 +14994,42 @@ if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - if test "$cross_compiling" = yes; then : - - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac - + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -int main () + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main () { - int result = 0; +int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; @@ -15549,14 +15042,14 @@ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; @@ -15568,14 +15061,14 @@ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304"; + static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; @@ -15588,14 +15081,14 @@ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; @@ -15615,17 +15108,20 @@ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; + + ; + return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes -else - am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" fi @@ -16131,20 +15627,25 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -16163,20 +15664,25 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -16315,20 +15821,12 @@ GLIB_MIN_VERSION=2.36.0 -GUDEV_MIN_VERSION=147 +GLIB_BUILD_SYMBOLS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36 -DGLIB_DISABLE_DEPRECATION_WARNINGS" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= $GLIB_MIN_VERSION - gmodule-2.0 - gobject-2.0 - gio-2.0 - gio-unix-2.0" >&5 -$as_echo_n "checking for glib-2.0 >= $GLIB_MIN_VERSION - gmodule-2.0 - gobject-2.0 - gio-2.0 - gio-unix-2.0... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MM" >&5 +$as_echo_n "checking for MM... " >&6; } if test -n "$MM_CFLAGS"; then pkg_cv_MM_CFLAGS="$MM_CFLAGS" @@ -16392,7 +15890,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -16431,7 +15929,7 @@ and MM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -16452,20 +15950,14 @@ $as_echo "yes" >&6; } fi -MM_FLAGS="$MM_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" +MM_CFLAGS="$MM_CFLAGS $GLIB_BUILD_SYMBOLS" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= $GLIB_MIN_VERSION - gobject-2.0 - gio-2.0 - gio-unix-2.0" >&5 -$as_echo_n "checking for glib-2.0 >= $GLIB_MIN_VERSION - gobject-2.0 - gio-2.0 - gio-unix-2.0... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBMM_GLIB" >&5 +$as_echo_n "checking for LIBMM_GLIB... " >&6; } if test -n "$LIBMM_GLIB_CFLAGS"; then pkg_cv_LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS" @@ -16523,7 +16015,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -16559,7 +16051,7 @@ and LIBMM_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -16580,18 +16072,14 @@ $as_echo "yes" >&6; } fi -LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" +LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS $GLIB_BUILD_SYMBOLS" pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= $GLIB_MIN_VERSION - gobject-2.0 - gio-2.0" >&5 -$as_echo_n "checking for glib-2.0 >= $GLIB_MIN_VERSION - gobject-2.0 - gio-2.0... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMCLI" >&5 +$as_echo_n "checking for MMCLI... " >&6; } if test -n "$MMCLI_CFLAGS"; then pkg_cv_MMCLI_CFLAGS="$MMCLI_CFLAGS" @@ -16643,7 +16131,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -16676,7 +16164,7 @@ and MMCLI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -16697,101 +16185,7 @@ $as_echo "yes" >&6; } fi -MMCLI_CFLAGS="$MMCLI_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" - - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gudev-1.0 >= $GUDEV_MIN_VERSION" >&5 -$as_echo_n "checking for gudev-1.0 >= $GUDEV_MIN_VERSION... " >&6; } - -if test -n "$GUDEV_CFLAGS"; then - pkg_cv_GUDEV_CFLAGS="$GUDEV_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0 >= \$GUDEV_MIN_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gudev-1.0 >= $GUDEV_MIN_VERSION") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GUDEV_CFLAGS=`$PKG_CONFIG --cflags "gudev-1.0 >= $GUDEV_MIN_VERSION" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GUDEV_LIBS"; then - pkg_cv_GUDEV_LIBS="$GUDEV_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0 >= \$GUDEV_MIN_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gudev-1.0 >= $GUDEV_MIN_VERSION") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GUDEV_LIBS=`$PKG_CONFIG --libs "gudev-1.0 >= $GUDEV_MIN_VERSION" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gudev-1.0 >= $GUDEV_MIN_VERSION" 2>&1` - else - GUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gudev-1.0 >= $GUDEV_MIN_VERSION" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GUDEV_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gudev-1.0 >= $GUDEV_MIN_VERSION) were not met: - -$GUDEV_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables GUDEV_CFLAGS -and GUDEV_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables GUDEV_CFLAGS -and GUDEV_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - GUDEV_CFLAGS=$pkg_cv_GUDEV_CFLAGS - GUDEV_LIBS=$pkg_cv_GUDEV_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi +MMCLI_CFLAGS="$MMCLI_CFLAGS $GLIB_BUILD_SYMBOLS" @@ -17562,10 +16956,117 @@ +GUDEV_VERSION=147 + + +# Check whether --with-udev was given. +if test "${with_udev+set}" = set; then : + withval=$with_udev; +else + with_udev=yes +fi + + if test "x$with_udev" = "xyes"; then + WITH_UDEV_TRUE= + WITH_UDEV_FALSE='#' +else + WITH_UDEV_TRUE='#' + WITH_UDEV_FALSE= +fi + +case $with_udev in + yes) pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd >= 209" >&5 -$as_echo_n "checking for libsystemd >= 209... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUDEV" >&5 +$as_echo_n "checking for GUDEV... " >&6; } + +if test -n "$GUDEV_CFLAGS"; then + pkg_cv_GUDEV_CFLAGS="$GUDEV_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0 >= \$GUDEV_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gudev-1.0 >= $GUDEV_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GUDEV_CFLAGS=`$PKG_CONFIG --cflags "gudev-1.0 >= $GUDEV_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GUDEV_LIBS"; then + pkg_cv_GUDEV_LIBS="$GUDEV_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0 >= \$GUDEV_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gudev-1.0 >= $GUDEV_VERSION") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GUDEV_LIBS=`$PKG_CONFIG --libs "gudev-1.0 >= $GUDEV_VERSION" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gudev-1.0 >= $GUDEV_VERSION" 2>&1` + else + GUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gudev-1.0 >= $GUDEV_VERSION" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GUDEV_PKG_ERRORS" >&5 + + have_gudev=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_gudev=no +else + GUDEV_CFLAGS=$pkg_cv_GUDEV_CFLAGS + GUDEV_LIBS=$pkg_cv_GUDEV_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_gudev=yes +fi + if test "x$have_gudev" = "xno"; then + as_fn_error $? "Couldn't find gudev >= $GUDEV_VERSION. Install it, or otherwise configure using --without-udev to disable udev support." "$LINENO" 5 + else + +$as_echo "#define WITH_UDEV 1" >>confdefs.h + + + + fi + ;; + *) + with_udev=no + ;; +esac + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD" >&5 +$as_echo_n "checking for LIBSYSTEMD... " >&6; } if test -n "$LIBSYSTEMD_CFLAGS"; then pkg_cv_LIBSYSTEMD_CFLAGS="$LIBSYSTEMD_CFLAGS" @@ -17605,7 +17106,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -17623,7 +17124,7 @@ have_libsystemd=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libsystemd=no else @@ -17635,8 +17136,8 @@ fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd-login >= 183" >&5 -$as_echo_n "checking for libsystemd-login >= 183... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD_LOGIN" >&5 +$as_echo_n "checking for LIBSYSTEMD_LOGIN... " >&6; } if test -n "$LIBSYSTEMD_LOGIN_CFLAGS"; then pkg_cv_LIBSYSTEMD_LOGIN_CFLAGS="$LIBSYSTEMD_LOGIN_CFLAGS" @@ -17676,7 +17177,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -17694,7 +17195,7 @@ have_libsystemd_login=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libsystemd_login=no else @@ -17705,55 +17206,91 @@ have_libsystemd_login=yes fi -# Check whether --with-suspend-resume was given. -if test "${with_suspend_resume+set}" = set; then : - withval=$with_suspend_resume; +# Check whether --with-systemd-suspend-resume was given. +if test "${with_systemd_suspend_resume+set}" = set; then : + withval=$with_systemd_suspend_resume; else - with_suspend_resume=auto + with_systemd_suspend_resume=auto fi -if test "x$with_suspend_resume" = "xauto"; then +if test "x$with_systemd_suspend_resume" = "xauto"; then if test "x$have_libsystemd" = "xyes" || test "x$have_libsystemd_login" = "xyes"; then - with_suspend_resume=systemd + with_systemd_suspend_resume=yes else - with_suspend_resume=no + with_systemd_suspend_resume=no fi fi -case $with_suspend_resume in - no) - -$as_echo "#define WITH_SUSPEND_RESUME 0" >>confdefs.h - - ;; - systemd) +case $with_systemd_suspend_resume in + yes) if test "x$have_libsystemd" = "xno" && test "x$have_libsystemd_login" = "xno"; then as_fn_error $? "libsystemd or libsystemd-login development headers are required" "$LINENO" 5 fi -$as_echo "#define WITH_SUSPEND_RESUME 1" >>confdefs.h +$as_echo "#define WITH_SYSTEMD_SUSPEND_RESUME 1" >>confdefs.h + + ;; + *) + with_systemd_suspend_resume=no + ;; +esac + + if test "x$with_systemd_suspend_resume" = "xyes"; then + WITH_SYSTEMD_SUSPEND_RESUME_TRUE= + WITH_SYSTEMD_SUSPEND_RESUME_FALSE='#' +else + WITH_SYSTEMD_SUSPEND_RESUME_TRUE='#' + WITH_SYSTEMD_SUSPEND_RESUME_FALSE= +fi + + + + +# Check whether --with-systemd-journal was given. +if test "${with_systemd_journal+set}" = set; then : + withval=$with_systemd_journal; +else + with_systemd_journal=auto +fi + + +if test "x$with_systemd_journal" = "xauto"; then + if test "x$have_libsystemd" = "xyes"; then + with_systemd_journal=yes + else + with_systemd_journal=no + fi +fi + +case $with_systemd_journal in + yes) + if test "x$have_libsystemd" = "xno"; then + as_fn_error $? "libsystemd development headers are required" "$LINENO" 5 + fi + +$as_echo "#define WITH_SYSTEMD_JOURNAL 1" >>confdefs.h ;; *) - as_fn_error $? "Wrong value for --with-suspend-resume: $with_suspend_resume" "$LINENO" 5 + with_systemd_journal=no ;; esac - if test "x$with_suspend_resume" = "xsystemd"; then - SUSPEND_RESUME_SYSTEMD_TRUE= - SUSPEND_RESUME_SYSTEMD_FALSE='#' + if test "x$with_systemd_journal" = "xyes"; then + WITH_SYSTEMD_JOURNAL_TRUE= + WITH_SYSTEMD_JOURNAL_FALSE='#' else - SUSPEND_RESUME_SYSTEMD_TRUE='#' - SUSPEND_RESUME_SYSTEMD_FALSE= + WITH_SYSTEMD_JOURNAL_TRUE='#' + WITH_SYSTEMD_JOURNAL_FALSE= fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for polkit-gobject-1 >= 0.97" >&5 -$as_echo_n "checking for polkit-gobject-1 >= 0.97... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POLKIT" >&5 +$as_echo_n "checking for POLKIT... " >&6; } if test -n "$POLKIT_CFLAGS"; then pkg_cv_POLKIT_CFLAGS="$POLKIT_CFLAGS" @@ -17793,7 +17330,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -17811,7 +17348,7 @@ have_polkit=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_polkit=no else @@ -17840,11 +17377,7 @@ with_polkit=strict fi -if test "x$with_polkit" = "xno"; then - -$as_echo "#define WITH_POLKIT 0" >>confdefs.h - -else +if test "x$with_polkit" != "xno"; then if test "x$have_polkit" = "xno"; then as_fn_error $? "PolicyKit development headers are required" "$LINENO" 5 fi @@ -17879,7 +17412,7 @@ -LIBMBIM_VERSION=1.14.0 +LIBMBIM_VERSION=1.18.0 # Check whether --with-mbim was given. @@ -17901,8 +17434,8 @@ yes) pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbim-glib >= $LIBMBIM_VERSION" >&5 -$as_echo_n "checking for mbim-glib >= $LIBMBIM_VERSION... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MBIM" >&5 +$as_echo_n "checking for MBIM... " >&6; } if test -n "$MBIM_CFLAGS"; then pkg_cv_MBIM_CFLAGS="$MBIM_CFLAGS" @@ -17942,7 +17475,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -17960,7 +17493,7 @@ have_mbim=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_mbim=no else @@ -17986,7 +17519,7 @@ esac -LIBQMI_VERSION=1.16.0 +LIBQMI_VERSION=1.22.0 # Check whether --with-qmi was given. @@ -18008,8 +17541,8 @@ yes) pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for qmi-glib >= $LIBQMI_VERSION" >&5 -$as_echo_n "checking for qmi-glib >= $LIBQMI_VERSION... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for QMI" >&5 +$as_echo_n "checking for QMI... " >&6; } if test -n "$QMI_CFLAGS"; then pkg_cv_QMI_CFLAGS="$QMI_CFLAGS" @@ -18049,7 +17582,7 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -18067,7 +17600,7 @@ have_qmi=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_qmi=no else @@ -18096,7 +17629,7 @@ if test "${enable_more_warnings+set}" = set; then : enableval=$enable_more_warnings; set_more_warnings="$enableval" else - set_more_warnings=yes + set_more_warnings=error fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for more warnings" >&5 @@ -18104,7 +17637,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" + CFLAGS="-Wall -std=gnu89 $CFLAGS" for option in -Wmissing-declarations -Wmissing-prototypes \ -Wdeclaration-after-statement -Wstrict-prototypes \ @@ -18141,6 +17674,9 @@ unset SAVE_CFLAGS done unset option + if test "x$set_more_warnings" = xerror; then + CFLAGS="$CFLAGS -Werror" + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -18182,7 +17718,7 @@ -ac_config_files="$ac_config_files Makefile data/Makefile data/ModemManager.pc data/mm-glib.pc data/org.freedesktop.ModemManager1.policy.in data/tests/Makefile data/tests/org.freedesktop.ModemManager1.service include/Makefile include/ModemManager-version.h build-aux/Makefile libqcdm/Makefile libqcdm/src/Makefile libqcdm/tests/Makefile libwmc/Makefile libwmc/src/Makefile libwmc/tests/Makefile src/Makefile src/tests/Makefile plugins/Makefile uml290/Makefile test/Makefile introspection/Makefile introspection/tests/Makefile po/Makefile.in docs/Makefile docs/man/Makefile docs/reference/Makefile docs/reference/api/Makefile docs/reference/api/version.xml docs/reference/libmm-glib/Makefile docs/reference/libmm-glib/version.xml libmm-glib/Makefile libmm-glib/generated/Makefile libmm-glib/generated/tests/Makefile libmm-glib/tests/Makefile vapi/Makefile cli/Makefile examples/Makefile examples/modem-watcher-python/Makefile examples/modem-watcher-javascript/Makefile examples/sms-python/Makefile" +ac_config_files="$ac_config_files Makefile data/Makefile data/ModemManager.pc data/mm-glib.pc data/tests/Makefile data/tests/org.freedesktop.ModemManager1.service include/Makefile include/ModemManager-version.h build-aux/Makefile libqcdm/Makefile libqcdm/src/Makefile libqcdm/tests/Makefile libwmc/Makefile libwmc/src/Makefile libwmc/tests/Makefile src/Makefile src/tests/Makefile plugins/Makefile uml290/Makefile test/Makefile introspection/Makefile introspection/tests/Makefile po/Makefile.in docs/Makefile docs/man/Makefile docs/reference/Makefile docs/reference/api/Makefile docs/reference/api/version.xml docs/reference/libmm-glib/Makefile docs/reference/libmm-glib/version.xml libmm-glib/Makefile libmm-glib/generated/Makefile libmm-glib/generated/tests/Makefile libmm-glib/tests/Makefile vapi/Makefile cli/Makefile examples/Makefile examples/modem-watcher-python/Makefile examples/modem-watcher-javascript/Makefile examples/sms-python/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -18349,10 +17885,6 @@ as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi - - ac_config_commands="$ac_config_commands po/stamp-it" - - if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18369,8 +17901,16 @@ as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${SUSPEND_RESUME_SYSTEMD_TRUE}" && test -z "${SUSPEND_RESUME_SYSTEMD_FALSE}"; then - as_fn_error $? "conditional \"SUSPEND_RESUME_SYSTEMD\" was never defined. +if test -z "${WITH_UDEV_TRUE}" && test -z "${WITH_UDEV_FALSE}"; then + as_fn_error $? "conditional \"WITH_UDEV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_SYSTEMD_SUSPEND_RESUME_TRUE}" && test -z "${WITH_SYSTEMD_SUSPEND_RESUME_FALSE}"; then + as_fn_error $? "conditional \"WITH_SYSTEMD_SUSPEND_RESUME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_SYSTEMD_JOURNAL_TRUE}" && test -z "${WITH_SYSTEMD_JOURNAL_FALSE}"; then + as_fn_error $? "conditional \"WITH_SYSTEMD_JOURNAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_POLKIT_TRUE}" && test -z "${WITH_POLKIT_FALSE}"; then @@ -18790,7 +18330,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ModemManager $as_me 1.6.8, which was +This file was extended by ModemManager $as_me 1.10.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18856,7 +18396,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ModemManager config.status 1.6.8 +ModemManager config.status 1.10.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -18975,7 +18515,7 @@ # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -19027,6 +18567,7 @@ DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -19155,7 +18696,6 @@ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -19283,7 +18823,6 @@ "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "data/ModemManager.pc") CONFIG_FILES="$CONFIG_FILES data/ModemManager.pc" ;; "data/mm-glib.pc") CONFIG_FILES="$CONFIG_FILES data/mm-glib.pc" ;; - "data/org.freedesktop.ModemManager1.policy.in") CONFIG_FILES="$CONFIG_FILES data/org.freedesktop.ModemManager1.policy.in" ;; "data/tests/Makefile") CONFIG_FILES="$CONFIG_FILES data/tests/Makefile" ;; "data/tests/org.freedesktop.ModemManager1.service") CONFIG_FILES="$CONFIG_FILES data/tests/org.freedesktop.ModemManager1.service" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; @@ -19320,7 +18859,6 @@ "examples/modem-watcher-python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/modem-watcher-python/Makefile" ;; "examples/modem-watcher-javascript/Makefile") CONFIG_FILES="$CONFIG_FILES examples/modem-watcher-javascript/Makefile" ;; "examples/sms-python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/sms-python/Makefile" ;; - "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -19920,29 +19458,35 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19960,53 +19504,48 @@ q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) @@ -20168,8 +19707,11 @@ # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -20666,26 +20208,6 @@ ;; esac done ;; - "po/stamp-it":C) - if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then - as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 - fi - rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" - >"po/stamp-it.tmp" - sed '/^#/d - s/^[[].*] *// - /^[ ]*$/d - '"s|^| $ac_top_srcdir/|" \ - "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" - - sed '/^POTFILES =/,/[^\\]$/ { - /^POTFILES =/!d - r po/POTFILES - } - ' "po/Makefile.in" >"po/Makefile" - rm -f "po/Makefile.tmp" - mv "po/stamp-it.tmp" "po/stamp-it" - ;; esac done # for ac_tag @@ -20742,10 +20264,12 @@ systemd unit directory: ${with_systemdsystemunitdir} Features: - policykit support: ${with_polkit} - mbim support: ${with_mbim} - qmi support: ${with_qmi} - suspend/resume support: ${with_suspend_resume} + udev: ${with_udev} + policykit: ${with_polkit} + mbim: ${with_mbim} + qmi: ${with_qmi} + systemd suspend/resume: ${with_systemd_suspend_resume} + systemd journal: ${with_systemd_journal} Miscellaneous: gobject introspection: ${found_introspection} diff -Nru modemmanager-1.6.8/configure.ac modemmanager-1.10.0/configure.ac --- modemmanager-1.6.8/configure.ac 2017-06-17 10:24:04.000000000 +0200 +++ modemmanager-1.10.0/configure.ac 2019-01-17 16:12:39.000000000 +0100 @@ -5,8 +5,8 @@ dnl m4_define([mm_major_version], [1]) -m4_define([mm_minor_version], [6]) -m4_define([mm_micro_version], [8]) +m4_define([mm_minor_version], [10]) +m4_define([mm_micro_version], [0]) m4_define([mm_version], [mm_major_version.mm_minor_version.mm_micro_version]) @@ -18,15 +18,15 @@ dnl with old code), increment a. dnl If the interface has changed in an incompatible way (that is, dnl functions have changed or been removed), then zero a. -m4_define([mm_glib_lt_current], [3]) +m4_define([mm_glib_lt_current], [4]) m4_define([mm_glib_lt_revision], [0]) -m4_define([mm_glib_lt_age], [3]) +m4_define([mm_glib_lt_age], [4]) dnl----------------------------------------------------------------------------- dnl autoconf, automake, libtool initialization dnl AC_INIT([ModemManager],[mm_version],[modemmanager-devel@lists.freedesktop.org],[ModemManager]) -AM_INIT_AUTOMAKE([1.11 subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability]) +AM_INIT_AUTOMAKE([1.11.2 subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_MAINTAINER_MODE([enable]) @@ -44,6 +44,7 @@ AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL +AC_PROG_MKDIR_P dnl Initialize libtool LT_PREREQ([2.2]) @@ -81,10 +82,8 @@ dnl i18n dnl -IT_PROG_INTLTOOL([0.40.0]) - AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.19.3]) +AM_GNU_GETTEXT_VERSION([0.19.8]) GETTEXT_PACKAGE=ModemManager AC_SUBST(GETTEXT_PACKAGE) @@ -95,7 +94,7 @@ dnl GLIB_MIN_VERSION=2.36.0 -GUDEV_MIN_VERSION=147 +GLIB_BUILD_SYMBOLS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36 -DGLIB_DISABLE_DEPRECATION_WARNINGS" PKG_CHECK_MODULES(MM, glib-2.0 >= $GLIB_MIN_VERSION @@ -103,7 +102,7 @@ gobject-2.0 gio-2.0 gio-unix-2.0) -MM_FLAGS="$MM_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" +MM_CFLAGS="$MM_CFLAGS $GLIB_BUILD_SYMBOLS" AC_SUBST(MM_CFLAGS) AC_SUBST(MM_LIBS) @@ -112,7 +111,7 @@ gobject-2.0 gio-2.0 gio-unix-2.0) -LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" +LIBMM_GLIB_CFLAGS="$LIBMM_GLIB_CFLAGS $GLIB_BUILD_SYMBOLS" AC_SUBST(LIBMM_GLIB_CFLAGS) AC_SUBST(LIBMM_GLIB_LIBS) @@ -120,14 +119,10 @@ glib-2.0 >= $GLIB_MIN_VERSION gobject-2.0 gio-2.0) -MMCLI_CFLAGS="$MMCLI_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36" +MMCLI_CFLAGS="$MMCLI_CFLAGS $GLIB_BUILD_SYMBOLS" AC_SUBST(MMCLI_CFLAGS) AC_SUBST(MMCLI_LIBS) -PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= $GUDEV_MIN_VERSION) -AC_SUBST(GUDEV_CFLAGS) -AC_SUBST(GUDEV_LIBS) - dnl Some required utilities GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) @@ -186,40 +181,92 @@ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$SYSTEMD_UNIT_DIR" -a "$SYSTEMD_UNIT_DIR" != xno ]) dnl----------------------------------------------------------------------------- +dnl udev support (enabled by default) +dnl + +GUDEV_VERSION=147 + +AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev], [Build without udev support]), [], [with_udev=yes]) +AM_CONDITIONAL(WITH_UDEV, test "x$with_udev" = "xyes") +case $with_udev in + yes) + PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= $GUDEV_VERSION], [have_gudev=yes],[have_gudev=no]) + if test "x$have_gudev" = "xno"; then + AC_MSG_ERROR([Couldn't find gudev >= $GUDEV_VERSION. Install it, or otherwise configure using --without-udev to disable udev support.]) + else + AC_DEFINE(WITH_UDEV, 1, [Define if you want udev support]) + AC_SUBST(GUDEV_CFLAGS) + AC_SUBST(GUDEV_LIBS) + fi + ;; + *) + with_udev=no + ;; +esac + +dnl----------------------------------------------------------------------------- dnl Suspend/resume support dnl PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd >= 209],[have_libsystemd=yes],[have_libsystemd=no]) PKG_CHECK_MODULES(LIBSYSTEMD_LOGIN, [libsystemd-login >= 183],[have_libsystemd_login=yes],[have_libsystemd_login=no]) -AC_ARG_WITH(suspend-resume, - AS_HELP_STRING([--with-suspend-resume=no|systemd], - [Enable suspend/resume support [[default=auto]]]),, - [with_suspend_resume=auto]) +AC_ARG_WITH(systemd-suspend-resume, + AS_HELP_STRING([--with-systemd-suspend-resume=no|yes], + [Enable systemd suspend/resume support [[default=auto]]]),, + [with_systemd_suspend_resume=auto]) -if test "x$with_suspend_resume" = "xauto"; then +if test "x$with_systemd_suspend_resume" = "xauto"; then if test "x$have_libsystemd" = "xyes" || test "x$have_libsystemd_login" = "xyes"; then - with_suspend_resume=systemd + with_systemd_suspend_resume=yes else - with_suspend_resume=no + with_systemd_suspend_resume=no fi fi -case $with_suspend_resume in - no) - AC_DEFINE(WITH_SUSPEND_RESUME, 0, [Define if you have suspend-resume support]) - ;; - systemd) +case $with_systemd_suspend_resume in + yes) if test "x$have_libsystemd" = "xno" && test "x$have_libsystemd_login" = "xno"; then AC_MSG_ERROR(libsystemd or libsystemd-login development headers are required) fi - AC_DEFINE(WITH_SUSPEND_RESUME, 1, [Define if you have suspend-resume support]) + AC_DEFINE(WITH_SYSTEMD_SUSPEND_RESUME, 1, [Define if you have systemd suspend-resume support]) ;; *) - AC_MSG_ERROR([Wrong value for --with-suspend-resume: $with_suspend_resume]) + with_systemd_suspend_resume=no ;; esac -AM_CONDITIONAL(SUSPEND_RESUME_SYSTEMD, test "x$with_suspend_resume" = "xsystemd") +AM_CONDITIONAL(WITH_SYSTEMD_SUSPEND_RESUME, test "x$with_systemd_suspend_resume" = "xyes") + +dnl----------------------------------------------------------------------------- +dnl systemd journal support +dnl + +AC_ARG_WITH(systemd-journal, + AS_HELP_STRING([--with-systemd-journal=no|yes|auto], + [Enable systemd journal support [[default=auto]]]),, + [with_systemd_journal=auto]) + +if test "x$with_systemd_journal" = "xauto"; then + if test "x$have_libsystemd" = "xyes"; then + with_systemd_journal=yes + else + with_systemd_journal=no + fi +fi + +case $with_systemd_journal in + yes) + if test "x$have_libsystemd" = "xno"; then + AC_MSG_ERROR(libsystemd development headers are required) + fi + AC_DEFINE(WITH_SYSTEMD_JOURNAL, 1, [Define if you want systemd journal support]) + ;; + *) + with_systemd_journal=no + ;; +esac + +AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, test "x$with_systemd_journal" = "xyes") dnl----------------------------------------------------------------------------- dnl PolicyKit @@ -241,9 +288,7 @@ with_polkit=strict fi -if test "x$with_polkit" = "xno"; then - AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support]) -else +if test "x$with_polkit" != "xno"; then if test "x$have_polkit" = "xno"; then AC_MSG_ERROR(PolicyKit development headers are required) fi @@ -272,7 +317,7 @@ dnl MBIM support (enabled by default) dnl -LIBMBIM_VERSION=1.14.0 +LIBMBIM_VERSION=1.18.0 AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes]) AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes") @@ -296,7 +341,7 @@ dnl QMI support (enabled by default) dnl -LIBQMI_VERSION=1.16.0 +LIBQMI_VERSION=1.22.0 AC_ARG_WITH(qmi, AS_HELP_STRING([--without-qmi], [Build without QMI support]), [], [with_qmi=yes]) AM_CONDITIONAL(WITH_QMI, test "x$with_qmi" = "xyes") @@ -342,7 +387,6 @@ data/Makefile data/ModemManager.pc data/mm-glib.pc -data/org.freedesktop.ModemManager1.policy.in data/tests/Makefile data/tests/org.freedesktop.ModemManager1.service include/Makefile @@ -399,10 +443,12 @@ systemd unit directory: ${with_systemdsystemunitdir} Features: - policykit support: ${with_polkit} - mbim support: ${with_mbim} - qmi support: ${with_qmi} - suspend/resume support: ${with_suspend_resume} + udev: ${with_udev} + policykit: ${with_polkit} + mbim: ${with_mbim} + qmi: ${with_qmi} + systemd suspend/resume: ${with_systemd_suspend_resume} + systemd journal: ${with_systemd_journal} Miscellaneous: gobject introspection: ${found_introspection} diff -Nru modemmanager-1.6.8/data/its/polkit.its modemmanager-1.10.0/data/its/polkit.its --- modemmanager-1.6.8/data/its/polkit.its 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/data/its/polkit.its 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,8 @@ + + + + + diff -Nru modemmanager-1.6.8/data/its/polkit.loc modemmanager-1.10.0/data/its/polkit.loc --- modemmanager-1.6.8/data/its/polkit.loc 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/data/its/polkit.loc 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -Nru modemmanager-1.6.8/data/Makefile.am modemmanager-1.10.0/data/Makefile.am --- modemmanager-1.6.8/data/Makefile.am 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/data/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -59,15 +59,22 @@ ModemManager-interface-initialization-sequence.png \ ModemManager-interface-initialization-sequence-subclassed.png - # Polkit -polkit_policy_in_in_files = org.freedesktop.ModemManager1.policy.in.in + +# build file with translations, which we will include in dist +org.freedesktop.ModemManager1.policy.in: org.freedesktop.ModemManager1.policy.in.in + $(AM_V_GEN) GETTEXTDATADIR=$(top_srcdir)/data $(MSGFMT) --xml -d $(top_srcdir)/po/ -o $@ --template $< + if WITH_POLKIT + +# build with requested user policy +org.freedesktop.ModemManager1.policy: org.freedesktop.ModemManager1.policy.in + $(AM_V_GEN) sed -e s,@MM_DEFAULT_USER_POLICY\@,$(MM_DEFAULT_USER_POLICY), $< > $@.tmp && mv $@.tmp $@ + polkit_policydir = $(datadir)/polkit-1/actions -polkit_policy_DATA = $(polkit_policy_in_in_files:.policy.in.in=.policy) -@INTLTOOL_POLICY_RULE@ -endif +polkit_policy_DATA = org.freedesktop.ModemManager1.policy +endif # Set up pkg-config .pc files for exported libraries pkgconfigdir = $(libdir)/pkgconfig @@ -75,23 +82,26 @@ ModemManager.pc \ mm-glib.pc +MAINTAINERCLEANFILES = \ + org.freedesktop.ModemManager1.policy.in DISTCLEANFILES = \ + org.freedesktop.ModemManager1.policy \ $(dbusactivation_DATA) \ - $(dbusservice_DATA) \ - $(polkit_policy_DATA) + $(dbusservice_DATA) if HAVE_SYSTEMD DISTCLEANFILES += $(systemdsystemunit_DATA) endif - EXTRA_DIST = \ + its \ + org.freedesktop.ModemManager1.policy.in.in \ + org.freedesktop.ModemManager1.policy.in \ $(systemdsystemunit_in_files) \ $(dbusactivation_in_files) \ $(dbusservice_file_polkit) \ $(dbusservice_file_nopolkit) \ $(icon_DATA) \ - $(polkit_policy_in_in_files) \ $(logos) \ $(diagrams) diff -Nru modemmanager-1.6.8/data/Makefile.in modemmanager-1.10.0/data/Makefile.in --- modemmanager-1.6.8/data/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/data/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -95,21 +95,19 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = ModemManager.pc mm-glib.pc \ - org.freedesktop.ModemManager1.policy.in +CONFIG_CLEAN_FILES = ModemManager.pc mm-glib.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -179,7 +177,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -201,8 +199,7 @@ CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ModemManager.pc.in \ - $(srcdir)/mm-glib.pc.in \ - $(srcdir)/org.freedesktop.ModemManager1.policy.in.in + $(srcdir)/mm-glib.pc.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -230,7 +227,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -283,14 +279,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -411,8 +399,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -473,11 +459,8 @@ ModemManager-interface-initialization-sequence.png \ ModemManager-interface-initialization-sequence-subclassed.png - -# Polkit -polkit_policy_in_in_files = org.freedesktop.ModemManager1.policy.in.in @WITH_POLKIT_TRUE@polkit_policydir = $(datadir)/polkit-1/actions -@WITH_POLKIT_TRUE@polkit_policy_DATA = $(polkit_policy_in_in_files:.policy.in.in=.policy) +@WITH_POLKIT_TRUE@polkit_policy_DATA = org.freedesktop.ModemManager1.policy # Set up pkg-config .pc files for exported libraries pkgconfigdir = $(libdir)/pkgconfig @@ -485,15 +468,20 @@ ModemManager.pc \ mm-glib.pc -DISTCLEANFILES = $(dbusactivation_DATA) $(dbusservice_DATA) \ - $(polkit_policy_DATA) $(am__append_1) +MAINTAINERCLEANFILES = \ + org.freedesktop.ModemManager1.policy.in + +DISTCLEANFILES = org.freedesktop.ModemManager1.policy \ + $(dbusactivation_DATA) $(dbusservice_DATA) $(am__append_1) EXTRA_DIST = \ + its \ + org.freedesktop.ModemManager1.policy.in.in \ + org.freedesktop.ModemManager1.policy.in \ $(systemdsystemunit_in_files) \ $(dbusactivation_in_files) \ $(dbusservice_file_polkit) \ $(dbusservice_file_nopolkit) \ $(icon_DATA) \ - $(polkit_policy_in_in_files) \ $(logos) \ $(diagrams) @@ -517,8 +505,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -533,8 +521,6 @@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mm-glib.pc: $(top_builddir)/config.status $(srcdir)/mm-glib.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -org.freedesktop.ModemManager1.policy.in: $(top_builddir)/config.status $(srcdir)/org.freedesktop.ModemManager1.policy.in.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo @@ -767,7 +753,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -861,6 +850,7 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am @@ -963,7 +953,16 @@ @HAVE_SYSTEMD_TRUE@ $(edit) $< >$@ org.freedesktop.ModemManager1.service: org.freedesktop.ModemManager1.service.in $(edit) $< >$@ -@WITH_POLKIT_TRUE@@INTLTOOL_POLICY_RULE@ + +# Polkit + +# build file with translations, which we will include in dist +org.freedesktop.ModemManager1.policy.in: org.freedesktop.ModemManager1.policy.in.in + $(AM_V_GEN) GETTEXTDATADIR=$(top_srcdir)/data $(MSGFMT) --xml -d $(top_srcdir)/po/ -o $@ --template $< + +# build with requested user policy +@WITH_POLKIT_TRUE@org.freedesktop.ModemManager1.policy: org.freedesktop.ModemManager1.policy.in +@WITH_POLKIT_TRUE@ $(AM_V_GEN) sed -e s,@MM_DEFAULT_USER_POLICY\@,$(MM_DEFAULT_USER_POLICY), $< > $@.tmp && mv $@.tmp $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru modemmanager-1.6.8/data/ModemManager.service.in modemmanager-1.10.0/data/ModemManager.service.in --- modemmanager-1.6.8/data/ModemManager.service.in 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/data/ModemManager.service.in 2018-11-15 09:55:53.000000000 +0100 @@ -1,6 +1,5 @@ [Unit] Description=Modem Manager -After=syslog.target [Service] Type=dbus @@ -8,6 +7,13 @@ ExecStart=@sbindir@/ModemManager StandardError=null Restart=on-abort +CapabilityBoundingSet=CAP_SYS_ADMIN +ProtectSystem=true +ProtectHome=true +PrivateTmp=true +RestrictAddressFamilies=AF_NETLINK AF_UNIX +NoNewPrivileges=true +User=root [Install] WantedBy=multi-user.target diff -Nru modemmanager-1.6.8/data/org.freedesktop.ModemManager1.conf.polkit modemmanager-1.10.0/data/org.freedesktop.ModemManager1.conf.polkit --- modemmanager-1.6.8/data/org.freedesktop.ModemManager1.conf.polkit 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/data/org.freedesktop.ModemManager1.conf.polkit 2019-01-15 15:57:35.000000000 +0100 @@ -161,6 +161,14 @@ send_interface="org.freedesktop.ModemManager1.Modem.Location" send_member="Setup"/> + + + + + send_member="SendDtmf"/> diff -Nru modemmanager-1.6.8/data/org.freedesktop.ModemManager1.policy.in modemmanager-1.10.0/data/org.freedesktop.ModemManager1.policy.in --- modemmanager-1.6.8/data/org.freedesktop.ModemManager1.policy.in 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/data/org.freedesktop.ModemManager1.policy.in 2019-01-17 16:15:56.000000000 +0100 @@ -0,0 +1,276 @@ + + + + ModemManager + http://www.freedesktop.org/wiki/ModemManager + ModemManager + + Control the Modem Manager daemon + Керування фоновою службою Modem Manager + Modem Manager artalan uygulamasını denetle + Kontrollera demonen för Modem Manager + Ovládanie služby správcu modemov + Controlar o daemon do ModemManager + Sterowanie usługą ModemManager + Controlla il demone di «Modem Manager» + Kendalikan daemon Manajer Modem + Modemkezelő démon vezérlése + Controle il demoni di Modem Manager + Contrôle le service Modem Manager + Den Modem-Manager-Daemon steuern + Ovládat démona pro správu modemů + System policy prevents controlling the Modem Manager. + Правила системи перешкоджають керування Modem Manager. + Sistem ilkesi Modem Manager'ı denetlemeyi engelliyor. + En systempolicy förhindrar kontroll av Modem Manager. + Politika systému zabraňuje ovládaniu správcu modemov. + A política de sistema impede de controlar o ModemManager. + Ustawienia systemu uniemożliwiają sterowanie usługą ModemManager. + La politica di sistema impedisce il controllo di «Modem Manager» + Kebijakan sistem mencegah pengendalian Manajer Modem. + A rendszer házirendje nem teszi lehetővé a Modemkezelő vezérlését. + La politiche dal sisteme e impedìs il control di Modem Manager. + La politique système empêche le contrôle de Modem Manager. + Die Systemrichtlinien verhindern die Steuerung von ModemManager. + Systémová zásada brání v ovládání Správy modemů. + + no + auth_admin + + + + Unlock and control a mobile broadband device + Розблокувати пристрій мобільної широкосмугової мережі і керувати ним + Mobil geniş bant aygıtının kilidini aç ve denetle + Lås upp och kontrollera en mobil bredbandsenhet + Odomknutie a ovládanie mobilného širokopásmového zariadenia + Desbloquear e controlar um dispositivo de banda larga móvel + Odblokowanie i sterowanie urządzeniem komórkowym + Sblocca e controlla un dispositivo mobile a banda larga + Buka kunci dan kendalikan suatu peranti data seluler + Mobil széles sávú készülék feloldása és vezérlése + Sbloche e controle un dispositîf a bande largje mobile + Déverrouiller et contrôler un périphérique mobile à large bande + Ein mobiles Breitbandgerät entsperren und steuern + Odemykat a ovládat mobilní širokopásmové zařízení + System policy prevents unlocking or controlling the mobile broadband device. + Правила системи забороняють розблокування і керування пристроями широкосмугових мобільних мереж. + Sistem ilkesi mobil geniş bant aygıtını denetlemeyi veya kilidini açmayı engelliyor. + En systempolicy hindrar upplåsning eller kontroll över den mobila bredbandsenheten. + Politika systému zabraňuje odomknutiu alebo ovládaniu mobilného širokopásmového zariadenia. + A política de sistema impede de desbloquear ou controlar o dispositivo de banda larga móvel. + Ustawienia systemu uniemożliwiają odblokowanie lub sterowanie urządzeniem komórkowym. + La politica di sistema impedisce di sbloccare o controllare il dispositivo mobile a banda larga. + Kebijakan sistem mencegah membuka kunci atau mengendalikan peranti data seluler. + A rendszer házirendje nem teszi lehetővé a mobil széles sávú készülék feloldását vagy vezérlését. + La politiche dal sisteme e impedìs di sblocâ o controlâ il dispositîf a bande largje mobile. + La politique système empêche le verrouillage et le contrôle d’un périphérique mobile à large bande. + Die Systemrichtlinien verhindern das Entsperren oder Steuern des mobilen Breitbandgerätes. + Systémová zásada brání v odemknutí nebo v ovládání mobilního širokopásmového zařízení. + + no + @MM_DEFAULT_USER_POLICY@ + + + + Add, modify, and delete mobile broadband contacts + Додати, внести зміни і вилучити контакти пристрою мобільних широкосмугових мереж + Mobil geniş bant kişileri ekle, düzenle ve sil + Lägg till, ändra och ta bort mobila bredbandskontakter + Pridanie, úprava a odstránenie kontaktov mobilného širokopásmového zariadenia + Adicionar, modificar e excluir contatos de banda larga móvel + Dodawanie, modyfikowanie i usuwanie kontaktów urządzenia komórkowego + Aggiunge, modifica ed elimina contatti mobili a banda larga + Tambah, ubah, dan hapus kontak data seluler + Névjegyek hozzáadása, módosítása és eltávolítása + Zonte, modifiche e elimine i contats de bande largje mobile + Ajouter, modifier et supprimer des contacts de connexions mobiles + Kontakte für mobiles Breitband hinzufügen, ändern und löschen + Přidávat, měnit a mazat kontakty v mobilním zařízení + System policy prevents adding, modifying, or deleting this device's contacts. + Правила системи перешкоджають додаванню, внесенню змін та вилученню записів контактів на цьому пристрої. + Sistem ilkesi bu aygıtın kişilerini eklemeyi, düzenlemeyi veya silmeyi engelliyor. + En systempolicy förhindrar att lägga till, ändra och ta bort denna enhets kontakter. + Politika systému zabraňuje pridaniu, úprave, alebo odstráneniu kontaktov v tomto zariadení. + A política de sistema impede de adicionar, modificar ou excluir os contatos deste dispositivo. + Ustawienia systemu uniemożliwiają dodawanie, modyfikowanie lub usuwanie kontaktów tego urządzenia. + La politica di sistema impedisce di aggiungere, modificare o eliminare i contatti di questo dispositivo. + Kebijakan sistem mencegah menambah, mengubah, atau menghapus kontak-kontak peranti ini. + A rendszer házirendje nem teszi lehetővé ezen az eszközön a névjegyek hozzáadását, módosítását és eltávolítását. + La politiche dal sisteme e impedìs di zontâ, modificâ o eliminâ i contats di chest dispositîf. + La politique système empêche l’ajout, la modification ou la suppression des contacts de cet appareil. + Die Systemrichtlinien verhindern das Hinzufügen, Ändern oder Löschen der Kontakte dieses Gerätes. + Systémová zásada brání v přidání, změně nebo smazání kontaktů v tomto zařízení. + + no + @MM_DEFAULT_USER_POLICY@ + + + + Send, save, modify, and delete text messages + Надіслати, зберегти, внести зміни або вилучити текстові повідомлення + Metin ileti gönder, kaydet, düzenle ve sil + Skicka, spara, ändra och ta bort meddelanden + Odoslanie, uloženie, úprava a odstránenie textových správ + Enviar, salvar, modificar e excluir mensagens de texto + Wysyłanie, zapisywanie, modyfikowanie i usuwanie wiadomości SMS + Invia, salva, modifica ed elimina messaggi di testo + Kirim, simpan, ubah, dan hapus pesan-pesan teks + Szöveges üzenetek küldése, mentése, módosítása és törlése + Invie, salve, modifiche e elimine i messaçs di test + Envoyer, enregistrer, modifier et supprimer des messages textuels + Textnachrichten senden, speichern, bearbeiten und löschen + Odesílat, ukládat, měnit a mazat textové zprávy + System policy prevents sending or manipulating this device's text messages. + Правила системи забороняють надсилання або керування текстовими повідомленнями цього пристрою. + Sistem ilkesi bu aygıtın metin iletilerini göndermeyi veya işlemeyi engelliyor. + En systempolicy förhindrar att skicka eller ändra denna enhets textmeddelanden. + Politika systému zabraňuje odoslaniu, alebo manipulácii textových správ v tomto zariadení. + A política de sistema impede de enviar ou manipular as mensagens de texto deste dispositivo. + Ustawienia systemu uniemożliwiają wysyłanie lub manipulowanie wiadomościami SMS tego urządzenia. + La politica di sistema impedisce di inviare o manipolare i messaggi di testo di questo dispositivo. + Kebijakan sistem mencegah pengiriman atau manipulasi pesan-pesan teks peranti ini. + A rendszer házirendje nem teszi lehetővé a szöveges üzenetek küldését vagy kezelését. + La politiche dal sisteme e impedìs di inviâ o manipolâ i messaçs di test di chest dispositîf. + La politique système empêche l’envoi ou la manipulation des messages textuels ce cet appareil. + Systémová zásada brání v odesílání nebo v manipulaci s textovými zprávami na tomto zařízení. + + no + @MM_DEFAULT_USER_POLICY@ + + + + Accept incoming voice calls or start outgoing voice calls. + Приймати вхідні голосові виклики і розпочинати вихідні голосові виклики. + Gelen sesli çağrıları kabul et veya giden sesli çağrılar başlat. + Acceptera inkommande röstsamtal eller påbörja utgående röstsamtal. + Prijatie prichádzajúcich hovorov, alebo zahájenie odchádzajúcich hlasových hovorov. + Aceitar chamadas de voz recebidas ou iniciar chamadas de voz de saída. + Przyjmowanie połączeń przychodzących lub dzwonienie + Accetta chiamate vocali in arrivo o avvia chiamate vocali. + Terima panggilan suara masuk atau mulai pemanggilan suara keluar. + Bejövő hívások fogadása vagy kimenő hívások indítása. + Acete lis clamadis vocâls in jentrade o tacâ clamadis vocâls in jessude. + Accepter des appels vocaux entrants ou initier des appels vocaux sortants. + Přijímat příchozí hovory nebo začínat odchozí hovory + System policy prevents voice calls. + Правила системи перешкоджають голосовим викликам. + Sistem ilkesi sesli çağrıları engelliyor. + En systempolicy förhindrar röstsamtal. + Politika systému zabraňuje hlasovým hovorom. + A política de sistema impede chamadas de voz. + Ustawienia systemu uniemożliwiają dzwonienie. + La politica di sistema impedisce di effettuare chiamate vocali. + Kebijakan sistem mencegah panggilan suara. + A rendszer házirendje nem teszi lehetővé a hívásokat. + La politiche dal sisteme e impedìs lis clamadis vocâls. + La politique système empêche les appels vocaux. + Systémová zásada brání v hlasových hovorech. + + no + @MM_DEFAULT_USER_POLICY@ + + + + Enable and view geographic location and positioning information + Увімкнути або переглянути дані щодо географічного розташування і позиціювання + Coğrafi konum ve konumlandırma bilgisini etkinleştir ve gör + Aktivera och visa geografisk plats samt positioneringsinformation + Povolenie a zobrazenie geografickej polohy a informácií o pozícii + Habilitar e ver informações de posicionamento e localização geográfica + Włączanie i wyświetlanie informacji o położeniu geograficznym i pozycjonowaniu + Abilita e visualizza informazioni di geolocalizzazione e posizionamento + Fungsikan dan tilik lokasi geografis dan informasi posisi + Földrajzi helyzetmeghatározás bekapcsolása és az információk megtekintése + Abilite e viôt la posizion gjeografiche e lis informazions su la posizion + Activer et voir les informations de position géographique + Informationen zum geografischen Standort und Positionierung aktivieren und anzeigen + Povolovat sdělování a zobrazování geografické polohy a informací o pozici + System policy prevents enabling or viewing geographic location information. + Правила системи забороняють вмикання або перегляд даних щодо розташування. + Sistem ilkesi coğrafi konum bilgisini etkinleştirmeyi ve göstermeyi engelliyor. + En systempolicy förhindrar aktivering eller visning av geografisk platsinformation. + Politika systému zabraňuje povoleniu, alebo zobrazeniu informácií o geografickej polohe. + A política de sistema impede de habilitar ou ver informações de localização geográfica. + Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie informacji o położeniu geograficznym. + La politica di sistema impedisce di abilitare o visualizzare informazioni di geolocalizzazione. + Kebijakan sistem mencegah memfungsikan atau menilik informasi lokasi geografis. + A rendszer házirendje nem teszi lehetővé a földrajzi helyzetmeghatározás bekapcsolását vagy az információk megtekintését. + La politiche dal sisteme e impedìs di abilitâ o viodi lis informazions su la posizion gjeografiche. + La politique système empêche d’activer ou de voir les informations de position géographique. + Die Systemrichtlinien verhindern das Aktivieren oder Ändern der Informationen zum geografischen Standort. + Systémová zásada brání v povolení sdělování a v zobrazení informací o geografické poloze. + + no + @MM_DEFAULT_USER_POLICY@ + + + + Query and utilize network information and services + Надіслати запит і використати дані щодо мережі і служби + Ağ bilgisi ve hizmetleri sorgula ve yararlan + Fråga och nyttja nätverksinformation och tjänster + Požadovanie a spracovanie sieťových informácií a služieb + Consultar ou utilizar serviços e informações de rede. + Odpytywanie i używanie informacji i usług sieciowych + Interroga e utilizza informazioni e servizi della rete + Kueri dan manfaatkan layanan dan informasi jaringan + Hálózati információk és szolgáltatások lekérdezése és használata + Interoghe e dopre lis informazions di rêt e i servizis + Interroger et utiliser les informations et services du réseau + Netzwerkinformationen und -dienste abfragen und nutzen + Dotazovat se na informace o síti a na služby a využívat je + System policy prevents querying or utilizing network information and services. + Правила системи забороняють надсилання запитів і використання даних щодо мережі і служб. + Sistem ilkesi ağ bilgisini ve hizmetleri sorgulamayı veya yararlanmayı engelliyor. + En systempolicy förhindrar frågande och nyttjande av nätverksinformation och tjänster. + Politika systému zabraňuje požadovaniu, alebo spracovaniu sieťových informácií a službám. + A política de sistema impede de consultar ou utilizar serviços e informações de rede. + Ustawienia systemu uniemożliwiają odpytywanie lub używanie informacji i usług sieciowych. + La politica di sistema impedisce di interrogare o di utilizzare le informazioni e i servizi della rete. + Kebijakan sistem mencegah kueri atau pemanfaatan layanan dan informasi jaringan. + A rendszer házirendje nem teszi lehetővé a hálózati információk és szolgáltatások lekérdezését és használatát. + La politiche dal sisteme e impedìs la interogazion e la utilizazion di informazions di rêt e servizis. + La politique système empêche l’interrogation et l’utilisation des informations et des services du réseau. + Die Systemrichtlinien verhindern die Abfrage der Netzwerkinformationen und -dienste. + Systémová zásada brání v dotazování na informace o síti a na služby, nebo brání v jejich využívání. + + no + yes + + + + Query and manage firmware on a mobile broadband device + Опитування та керування мікропрограмою на пристрої мобільної широкосмугової мережі + Mobil geniş bant aygıtındaki donanım yazılımını sorgula ve yönet + Fråga och hantera fast programvara för en mobil bredbandsenhet + Požadovanie a správa firmvéru mobilného širokopásmového zariadenia + Consultar e gerenciar firmware em um dispositivo de banda larga móvel + Odpytywanie i zarządzanie oprogramowaniem sprzętowym urządzenia komórkowego + Interroga e gestisce il firmware su un dispositivo mobile a banda larga + Kueri dan kelola firmware pada suatu peranti data seluler + Firmware lekérdezése és kezelése a mobil széles sávú eszközön + Interoghe e gjestìs il firmware suntun dispositîf a bande largje mobile + Interroger et gérer le matériel d’un périphérique mobile à large bande + Firmware auf mobilen Breitbandgeräten abfragen und verwalten + Dotazovat se na firmware a spravovat jej na mobilním širokopásmovém zařízení + System policy prevents querying or managing this device's firmware. + Правила системи перешкоджають опитуванню або керування мікропрограмою цього пристрою. + Sistem ilkesi bu aygıtın donanım yazılımını sorgulamayı veya yönetmeyi engelliyor. + En systempolicy förhindrar att fråga och hantera denna enhets fasta programvara. + Politika systému zabraňuje požadovaniu, alebo správe firmvéru tohto zariadenia. + A política de sistema impede de consultar ou gerenciar o firmware do dispositivo. + Ustawienia systemu uniemożliwiają odpytywanie lub zarządzanie oprogramowaniem sprzętowym tego urządzenia. + La politica di sistema impedisce di interrogare o gestire il firmware di questo dispositivo. + Kebijakan sistem mencegah kueri atau pengelolaan firmware peranti ini. + A rendszer lekérdezése és használata lehetővé a firmware lekérdezését és kezelését az eszközön. + La politiche dal sisteme e impedìs di interogâ o gjestî il firmware di chest dispositîf. + La politique système empêche l’interrogation et la gestion du matériel de ce périphérique. + Die Systemrichtlinien verhindern die Abfrage oder Verwaltung der Firmware dieses Gerätes. + Systémová zásada brání v dotázání na firmware nebo brání v jeho správě na tomto zařízení. + + no + auth_admin + + + diff -Nru modemmanager-1.6.8/data/org.freedesktop.ModemManager1.policy.in.in modemmanager-1.10.0/data/org.freedesktop.ModemManager1.policy.in.in --- modemmanager-1.6.8/data/org.freedesktop.ModemManager1.policy.in.in 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/data/org.freedesktop.ModemManager1.policy.in.in 2018-11-15 09:55:53.000000000 +0100 @@ -10,8 +10,8 @@ ModemManager - <_description>Control the Modem Manager daemon - <_message>System policy prevents controlling the Modem Manager. + Control the Modem Manager daemon + System policy prevents controlling the Modem Manager. no auth_admin @@ -19,8 +19,8 @@ - <_description>Unlock and control a mobile broadband device - <_message>System policy prevents unlocking or controlling the mobile broadband device. + Unlock and control a mobile broadband device + System policy prevents unlocking or controlling the mobile broadband device. no @MM_DEFAULT_USER_POLICY@ @@ -28,8 +28,8 @@ - <_description>Add, modify, and delete mobile broadband contacts - <_message>System policy prevents adding, modifying, or deleting this device's contacts. + Add, modify, and delete mobile broadband contacts + System policy prevents adding, modifying, or deleting this device's contacts. no @MM_DEFAULT_USER_POLICY@ @@ -37,8 +37,8 @@ - <_description>Send, save, modify, and delete text messages - <_message>System policy prevents sending or manipulating this device's text messages. + Send, save, modify, and delete text messages + System policy prevents sending or manipulating this device's text messages. no @MM_DEFAULT_USER_POLICY@ @@ -46,8 +46,8 @@ - <_description>Accept incoming voice calls or start outgoing voice calls. - <_message>System policy prevents voice calls. + Accept incoming voice calls or start outgoing voice calls. + System policy prevents voice calls. no @MM_DEFAULT_USER_POLICY@ @@ -55,8 +55,8 @@ - <_description>Enable and view geographic location and positioning information - <_message>System policy prevents enabling or viewing geographic location information. + Enable and view geographic location and positioning information + System policy prevents enabling or viewing geographic location information. no @MM_DEFAULT_USER_POLICY@ @@ -64,8 +64,8 @@ - <_description>Query and utilize network information and services - <_message>System policy prevents querying or utilizing network information and services. + Query and utilize network information and services + System policy prevents querying or utilizing network information and services. no yes @@ -73,8 +73,8 @@ - <_description>Query and manage firmware on a mobile broadband device - <_message>System policy prevents querying or managing this device's firmware. + Query and manage firmware on a mobile broadband device + System policy prevents querying or managing this device's firmware. no auth_admin diff -Nru modemmanager-1.6.8/data/tests/Makefile.in modemmanager-1.10.0/data/tests/Makefile.in --- modemmanager-1.6.8/data/tests/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/data/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -132,7 +131,6 @@ $(srcdir)/org.freedesktop.ModemManager1.service.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -185,14 +183,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -313,8 +303,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -355,8 +343,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -382,7 +370,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/data/tests/org.freedesktop.ModemManager1.service.in modemmanager-1.10.0/data/tests/org.freedesktop.ModemManager1.service.in --- modemmanager-1.6.8/data/tests/org.freedesktop.ModemManager1.service.in 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/data/tests/org.freedesktop.ModemManager1.service.in 2018-11-15 09:55:53.000000000 +0100 @@ -2,4 +2,4 @@ [D-BUS Service] Name=org.freedesktop.ModemManager1 -Exec=@abs_top_builddir@/src/ModemManager --test-session --test-no-auto-scan --test-enable --test-plugin-dir="@abs_top_builddir@/plugins/.libs" --debug +Exec=@abs_top_builddir@/src/ModemManager --test-session --no-auto-scan --test-enable --test-plugin-dir="@abs_top_builddir@/plugins/.libs" --debug diff -Nru modemmanager-1.6.8/debian/changelog modemmanager-1.10.0/debian/changelog --- modemmanager-1.6.8/debian/changelog 2018-04-24 13:06:03.000000000 +0200 +++ modemmanager-1.10.0/debian/changelog 2019-05-06 16:09:29.000000000 +0200 @@ -1,3 +1,62 @@ +modemmanager (1.10.0-1~ubuntu18.04.2) bionic; urgency=medium + + * debian/patches/error-propagation-fix.patch: mm-broadband-modem: Fix error + propagation in CDMA service status (LP: #1819615, Upstream Issue #119). + + -- Till Kamppeter Mon, 06 May 2019 16:09:29 +0200 + +modemmanager (1.10.0-1~ubuntu18.04.1) bionic; urgency=medium + + * New upstream release (LP: #1819615) + * debian/control: Update build dependencies as now libmbim >= 1.18.0 and + libqmi >= 1.22.0 are required. + * debian/libmm-glib0.symbols: update symbols for new release. + * debian/patches/0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch: + Removed, included upstream. + + -- Till Kamppeter Tue, 12 Mar 2019 19:43:29 +0100 + +modemmanager (1.8.2-1) unstable; urgency=medium + + * New upstream version 1.8.2. (Closes: #910013) (Closes: #900907) + * debian/modemmanager.postrm: don't unmask ModemManager on postrm; we were + unmasking because we're about to remove ModemManager anyway, and prerm did + its mask with --runtime which is supposed to not be persistent. + (Closes: #902260) + * debian/control: canonicalize Vcs-* URLs. + * debian/control: bump to Standard-Version: 4.2.1; no changes required. + + -- Mathieu Trudel-Lapierre Thu, 04 Oct 2018 10:01:18 -0400 + +modemmanager (1.7.990-1ubuntu1) cosmic; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Pass --enable-more-warnings so we build without -Werror. Patch + m4/compiler_warnings.m4 to allow this. + + -- Gianfranco Costamagna Wed, 06 Jun 2018 16:34:06 +0200 + +modemmanager (1.7.990-1) unstable; urgency=medium + + * New upstream version 1.7.990. + * debian/control: Bump libqmi-glib-dev and libmbim-glib-dev Depends to new + required versions (libmbim > 1.16, libqmi > 1.20) for this release. + * Update Maintainer field for my 'real' address. (Closes: #884617) + * debian/control: Update Vcs-* fields: moved project to salsa.d.o. + * debian/control: Bump to Standards-Version 4.1.3. + * debian/copyright: + - Fix Format: URL to use https. + - Drop extra stanza for libwmc; it really is only GPL2, not GPL2+. + * debian/rules: set DPKG_GENSYMBOLS_CHECK_LEVEL=4; more verbose when there + are added/changed symbols. + * debian/libmm-glib0.symbols: update symbols for new release. + * debian/patches/default_strict_probing_policy.patch: set the filtering + policy for probing to 'strict' by default: this will avoid probing devices + that are not modems, and potentially interfering with RNGs, braille, etc. + (Closes: #683839) + + -- Mathieu Trudel-Lapierre Thu, 01 Mar 2018 09:20:02 -0500 + modemmanager (1.6.8-2ubuntu1) bionic; urgency=medium * Pass --enable-more-warnings so we build without -Werror. Patch @@ -934,3 +993,4 @@ - update debian/patches/series -- Tony Espy Thu, 06 Aug 2009 12:50:45 +0100 + diff -Nru modemmanager-1.6.8/debian/control modemmanager-1.10.0/debian/control --- modemmanager-1.6.8/debian/control 2017-10-21 00:45:12.000000000 +0200 +++ modemmanager-1.10.0/debian/control 2019-03-12 19:43:29.000000000 +0100 @@ -1,7 +1,7 @@ Source: modemmanager Section: net Priority: optional -Maintainer: Mathieu Trudel-Lapierre +Maintainer: Mathieu Trudel-Lapierre Build-Depends: debhelper (>= 10), automake, libtool, @@ -14,14 +14,14 @@ libgudev-1.0-dev (>= 147), libsystemd-dev (>= 209), libpolkit-gobject-1-dev (>= 0.97), - libqmi-glib-dev (>= 1.16.0), - libmbim-glib-dev (>= 1.14.0), + libqmi-glib-dev (>= 1.22.0), + libmbim-glib-dev (>= 1.18.0), libglib2.0-doc, valac (>= 0.22), dbus -Standards-Version: 3.9.8 -Vcs-Git: https://anonscm.debian.org/git/collab-maint/modemmanager.git -Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/modemmanager.git +Standards-Version: 4.2.1 +Vcs-Git: https://salsa.debian.org/cyphermox-guest/modemmanager.git +Vcs-Browser: https://salsa.debian.org/cyphermox-guest/modemmanager Homepage: https://www.freedesktop.org/wiki/Software/ModemManager/ Package: modemmanager diff -Nru modemmanager-1.6.8/debian/copyright modemmanager-1.10.0/debian/copyright --- modemmanager-1.6.8/debian/copyright 2017-10-21 00:45:12.000000000 +0200 +++ modemmanager-1.10.0/debian/copyright 2019-03-12 19:43:29.000000000 +0100 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ModemManager Source: https://www.freedesktop.org/software/ModemManager/ @@ -18,10 +18,6 @@ Copyright: 2010, 2011 Red Hat, Inc. License: GPL-2.0 -Files: libwmc/* -Copyright: 2010, 2011 Red Hat, Inc. -License: GPL-2.0+ - Files: libmm-glib/* include/* Copyright: 2011 - 2012 Aleksander Morgado diff -Nru modemmanager-1.6.8/debian/libmm-glib0.symbols modemmanager-1.10.0/debian/libmm-glib0.symbols --- modemmanager-1.6.8/debian/libmm-glib0.symbols 2017-10-21 00:45:12.000000000 +0200 +++ modemmanager-1.10.0/debian/libmm-glib0.symbols 2019-03-12 19:43:29.000000000 +0100 @@ -9,6 +9,7 @@ mm_bearer_disconnect_sync@Base 0.7.991 mm_bearer_dup_interface@Base 0.7.991 mm_bearer_dup_path@Base 0.7.991 + mm_bearer_get_bearer_type@Base 1.10.0-0ubuntu1 mm_bearer_get_connected@Base 0.7.991 mm_bearer_get_interface@Base 0.7.991 mm_bearer_get_ip_timeout@Base 0.7.991 @@ -79,13 +80,29 @@ mm_bearer_stats_set_duration@Base 1.5.993 mm_bearer_stats_set_rx_bytes@Base 1.5.993 mm_bearer_stats_set_tx_bytes@Base 1.5.993 + mm_bearer_type_get_string@Base 1.10.0-0ubuntu1 + mm_bearer_type_get_type@Base 1.10.0-0ubuntu1 mm_call_accept@Base 1.5.993 mm_call_accept_finish@Base 1.5.993 mm_call_accept_sync@Base 1.5.993 + mm_call_audio_format_dup@Base 1.10.0-0ubuntu1 + mm_call_audio_format_get_dictionary@Base 1.10.0-0ubuntu1 + mm_call_audio_format_get_encoding@Base 1.10.0-0ubuntu1 + mm_call_audio_format_get_rate@Base 1.10.0-0ubuntu1 + mm_call_audio_format_get_resolution@Base 1.10.0-0ubuntu1 + mm_call_audio_format_get_type@Base 1.10.0-0ubuntu1 + mm_call_audio_format_new@Base 1.10.0-0ubuntu1 + mm_call_audio_format_new_from_dictionary@Base 1.10.0-0ubuntu1 + mm_call_audio_format_set_encoding@Base 1.10.0-0ubuntu1 + mm_call_audio_format_set_rate@Base 1.10.0-0ubuntu1 + mm_call_audio_format_set_resolution@Base 1.10.0-0ubuntu1 mm_call_direction_get_string@Base 1.5.993 mm_call_direction_get_type@Base 1.5.993 + mm_call_dup_audio_port@Base 1.10.0-0ubuntu1 mm_call_dup_number@Base 1.5.993 mm_call_dup_path@Base 1.5.993 + mm_call_get_audio_format@Base 1.10.0-0ubuntu1 + mm_call_get_audio_port@Base 1.10.0-0ubuntu1 mm_call_get_direction@Base 1.5.993 mm_call_get_number@Base 1.5.993 mm_call_get_path@Base 1.5.993 @@ -95,6 +112,7 @@ mm_call_hangup@Base 1.5.993 mm_call_hangup_finish@Base 1.5.993 mm_call_hangup_sync@Base 1.5.993 + mm_call_peek_audio_format@Base 1.10.0-0ubuntu1 mm_call_properties_dup@Base 1.5.993 mm_call_properties_get_dictionary@Base 1.5.993 mm_call_properties_get_direction@Base 1.5.993 @@ -143,8 +161,13 @@ mm_cdma_manual_activation_properties_set_prl_bytearray@Base 1.2.0 mm_cdma_manual_activation_properties_set_sid@Base 1.2.0 mm_cdma_manual_activation_properties_set_spc@Base 1.2.0 + mm_common_band_is_cdma@Base 1.10.0-0ubuntu1 + mm_common_band_is_eutran@Base 1.10.0-0ubuntu1 + mm_common_band_is_gsm@Base 1.10.0-0ubuntu1 + mm_common_band_is_utran@Base 1.10.0-0ubuntu1 mm_common_bands_array_to_variant@Base 0.7.991 mm_common_bands_garray_cmp@Base 0.7.991 + mm_common_bands_garray_sort@Base 1.7.990 mm_common_bands_garray_to_variant@Base 0.7.991 mm_common_bands_variant_to_array@Base 0.7.991 mm_common_bands_variant_to_garray@Base 0.7.991 @@ -170,6 +193,7 @@ mm_common_get_call_state_from_string@Base 1.5.993 mm_common_get_call_state_reason_from_string@Base 1.5.993 mm_common_get_capabilities_from_string@Base 0.7.991 + mm_common_get_eps_ue_mode_operation_from_string@Base 1.7.990 mm_common_get_ip_type_from_string@Base 0.7.991 mm_common_get_modes_from_string@Base 0.7.991 mm_common_get_oma_features_from_string@Base 1.2.0 @@ -217,6 +241,17 @@ mm_firmware_properties_set_gobi_pri_info@Base 0.7.991 mm_firmware_properties_set_gobi_pri_unique_id@Base 0.7.991 mm_firmware_properties_set_gobi_pri_version@Base 0.7.991 + mm_firmware_update_settings_get_device_ids@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_get_fastboot_at@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_get_method@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_get_type@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_get_variant@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_get_version@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_new@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_new_from_variant@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_set_device_ids@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_set_fastboot_at@Base 1.10.0-0ubuntu1 + mm_firmware_update_settings_set_version@Base 1.10.0-0ubuntu1 mm_gdbus_bearer_call_connect@Base 0.7.991 mm_gdbus_bearer_call_connect_finish@Base 0.7.991 mm_gdbus_bearer_call_connect_sync@Base 0.7.991 @@ -230,6 +265,7 @@ mm_gdbus_bearer_dup_ip6_config@Base 0.7.991 mm_gdbus_bearer_dup_properties@Base 0.7.991 mm_gdbus_bearer_dup_stats@Base 1.5.993 + mm_gdbus_bearer_get_bearer_type@Base 1.10.0-0ubuntu1 mm_gdbus_bearer_get_connected@Base 0.7.991 mm_gdbus_bearer_get_interface@Base 0.7.991 mm_gdbus_bearer_get_ip4_config@Base 0.7.991 @@ -248,6 +284,7 @@ mm_gdbus_bearer_proxy_new_for_bus_finish@Base 0.7.991 mm_gdbus_bearer_proxy_new_for_bus_sync@Base 0.7.991 mm_gdbus_bearer_proxy_new_sync@Base 0.7.991 + mm_gdbus_bearer_set_bearer_type@Base 1.10.0-0ubuntu1 mm_gdbus_bearer_set_connected@Base 0.7.991 mm_gdbus_bearer_set_interface@Base 0.7.991 mm_gdbus_bearer_set_ip4_config@Base 0.7.991 @@ -274,9 +311,13 @@ mm_gdbus_call_complete_hangup@Base 1.5.993 mm_gdbus_call_complete_send_dtmf@Base 1.5.993 mm_gdbus_call_complete_start@Base 1.5.993 + mm_gdbus_call_dup_audio_format@Base 1.10.0-0ubuntu1 + mm_gdbus_call_dup_audio_port@Base 1.10.0-0ubuntu1 mm_gdbus_call_dup_number@Base 1.5.993 mm_gdbus_call_emit_dtmf_received@Base 1.5.993 mm_gdbus_call_emit_state_changed@Base 1.5.993 + mm_gdbus_call_get_audio_format@Base 1.10.0-0ubuntu1 + mm_gdbus_call_get_audio_port@Base 1.10.0-0ubuntu1 mm_gdbus_call_get_direction@Base 1.5.993 mm_gdbus_call_get_number@Base 1.5.993 mm_gdbus_call_get_state@Base 1.5.993 @@ -291,6 +332,8 @@ mm_gdbus_call_proxy_new_for_bus_finish@Base 1.5.993 mm_gdbus_call_proxy_new_for_bus_sync@Base 1.5.993 mm_gdbus_call_proxy_new_sync@Base 1.5.993 + mm_gdbus_call_set_audio_format@Base 1.10.0-0ubuntu1 + mm_gdbus_call_set_audio_port@Base 1.10.0-0ubuntu1 mm_gdbus_call_set_direction@Base 1.5.993 mm_gdbus_call_set_number@Base 1.5.993 mm_gdbus_call_set_state@Base 1.5.993 @@ -303,15 +346,30 @@ mm_gdbus_modem3gpp_call_scan@Base 0.7.991 mm_gdbus_modem3gpp_call_scan_finish@Base 0.7.991 mm_gdbus_modem3gpp_call_scan_sync@Base 0.7.991 + mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation@Base 1.7.990 + mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish@Base 1.7.990 + mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync@Base 1.7.990 + mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 + mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish@Base 1.10.0-0ubuntu1 + mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_complete_register@Base 0.7.991 mm_gdbus_modem3gpp_complete_scan@Base 0.7.991 + mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation@Base 1.7.990 + mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_dup_imei@Base 0.7.991 + mm_gdbus_modem3gpp_dup_initial_eps_bearer@Base 1.10.0-0ubuntu1 + mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_dup_operator_code@Base 0.7.991 mm_gdbus_modem3gpp_dup_operator_name@Base 0.7.991 + mm_gdbus_modem3gpp_dup_pco@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_get_enabled_facility_locks@Base 0.7.991 + mm_gdbus_modem3gpp_get_eps_ue_mode_operation@Base 1.7.990 mm_gdbus_modem3gpp_get_imei@Base 0.7.991 + mm_gdbus_modem3gpp_get_initial_eps_bearer@Base 1.10.0-0ubuntu1 + mm_gdbus_modem3gpp_get_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_get_operator_code@Base 0.7.991 mm_gdbus_modem3gpp_get_operator_name@Base 0.7.991 + mm_gdbus_modem3gpp_get_pco@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_get_registration_state@Base 0.7.991 mm_gdbus_modem3gpp_get_subscription_state@Base 1.2.0 mm_gdbus_modem3gpp_get_type@Base 0.7.991 @@ -325,9 +383,13 @@ mm_gdbus_modem3gpp_proxy_new_for_bus_sync@Base 0.7.991 mm_gdbus_modem3gpp_proxy_new_sync@Base 0.7.991 mm_gdbus_modem3gpp_set_enabled_facility_locks@Base 0.7.991 + mm_gdbus_modem3gpp_set_eps_ue_mode_operation@Base 1.7.990 mm_gdbus_modem3gpp_set_imei@Base 0.7.991 + mm_gdbus_modem3gpp_set_initial_eps_bearer@Base 1.10.0-0ubuntu1 + mm_gdbus_modem3gpp_set_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_set_operator_code@Base 0.7.991 mm_gdbus_modem3gpp_set_operator_name@Base 0.7.991 + mm_gdbus_modem3gpp_set_pco@Base 1.10.0-0ubuntu1 mm_gdbus_modem3gpp_set_registration_state@Base 0.7.991 mm_gdbus_modem3gpp_set_subscription_state@Base 1.2.0 mm_gdbus_modem3gpp_skeleton_get_type@Base 0.7.991 @@ -452,6 +514,7 @@ mm_gdbus_modem_dup_device_identifier@Base 0.7.991 mm_gdbus_modem_dup_drivers@Base 0.7.991 mm_gdbus_modem_dup_equipment_identifier@Base 0.7.991 + mm_gdbus_modem_dup_hardware_revision@Base 1.7.990 mm_gdbus_modem_dup_manufacturer@Base 0.7.991 mm_gdbus_modem_dup_model@Base 0.7.991 mm_gdbus_modem_dup_own_numbers@Base 0.7.991 @@ -474,7 +537,9 @@ mm_gdbus_modem_firmware_call_select_sync@Base 0.7.991 mm_gdbus_modem_firmware_complete_list@Base 0.7.991 mm_gdbus_modem_firmware_complete_select@Base 0.7.991 + mm_gdbus_modem_firmware_dup_update_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem_firmware_get_type@Base 0.7.991 + mm_gdbus_modem_firmware_get_update_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem_firmware_interface_info@Base 0.7.991 mm_gdbus_modem_firmware_override_properties@Base 0.7.991 mm_gdbus_modem_firmware_proxy_get_type@Base 0.7.991 @@ -484,6 +549,7 @@ mm_gdbus_modem_firmware_proxy_new_for_bus_finish@Base 0.7.991 mm_gdbus_modem_firmware_proxy_new_for_bus_sync@Base 0.7.991 mm_gdbus_modem_firmware_proxy_new_sync@Base 0.7.991 + mm_gdbus_modem_firmware_set_update_settings@Base 1.10.0-0ubuntu1 mm_gdbus_modem_firmware_skeleton_get_type@Base 0.7.991 mm_gdbus_modem_firmware_skeleton_new@Base 0.7.991 mm_gdbus_modem_get_access_technologies@Base 0.7.991 @@ -495,6 +561,7 @@ mm_gdbus_modem_get_device_identifier@Base 0.7.991 mm_gdbus_modem_get_drivers@Base 0.7.991 mm_gdbus_modem_get_equipment_identifier@Base 0.7.991 + mm_gdbus_modem_get_hardware_revision@Base 1.7.990 mm_gdbus_modem_get_manufacturer@Base 0.7.991 mm_gdbus_modem_get_max_active_bearers@Base 0.7.991 mm_gdbus_modem_get_max_bearers@Base 0.7.991 @@ -520,6 +587,9 @@ mm_gdbus_modem_location_call_get_location@Base 0.7.991 mm_gdbus_modem_location_call_get_location_finish@Base 0.7.991 mm_gdbus_modem_location_call_get_location_sync@Base 0.7.991 + mm_gdbus_modem_location_call_inject_assistance_data@Base 1.10.0-0ubuntu1 + mm_gdbus_modem_location_call_inject_assistance_data_finish@Base 1.10.0-0ubuntu1 + mm_gdbus_modem_location_call_inject_assistance_data_sync@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_call_set_gps_refresh_rate@Base 1.5.993 mm_gdbus_modem_location_call_set_gps_refresh_rate_finish@Base 1.5.993 mm_gdbus_modem_location_call_set_gps_refresh_rate_sync@Base 1.5.993 @@ -530,17 +600,21 @@ mm_gdbus_modem_location_call_setup_finish@Base 0.7.991 mm_gdbus_modem_location_call_setup_sync@Base 0.7.991 mm_gdbus_modem_location_complete_get_location@Base 0.7.991 + mm_gdbus_modem_location_complete_inject_assistance_data@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_complete_set_gps_refresh_rate@Base 1.5.993 mm_gdbus_modem_location_complete_set_supl_server@Base 1.5.993 mm_gdbus_modem_location_complete_setup@Base 0.7.991 + mm_gdbus_modem_location_dup_assistance_data_servers@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_dup_location@Base 0.7.991 mm_gdbus_modem_location_dup_supl_server@Base 1.5.993 + mm_gdbus_modem_location_get_assistance_data_servers@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_get_capabilities@Base 0.7.991 mm_gdbus_modem_location_get_enabled@Base 0.7.991 mm_gdbus_modem_location_get_gps_refresh_rate@Base 1.5.993 mm_gdbus_modem_location_get_location@Base 0.7.991 mm_gdbus_modem_location_get_signals_location@Base 0.7.991 mm_gdbus_modem_location_get_supl_server@Base 1.5.993 + mm_gdbus_modem_location_get_supported_assistance_data@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_get_type@Base 0.7.991 mm_gdbus_modem_location_interface_info@Base 0.7.991 mm_gdbus_modem_location_override_properties@Base 0.7.991 @@ -551,12 +625,14 @@ mm_gdbus_modem_location_proxy_new_for_bus_finish@Base 0.7.991 mm_gdbus_modem_location_proxy_new_for_bus_sync@Base 0.7.991 mm_gdbus_modem_location_proxy_new_sync@Base 0.7.991 + mm_gdbus_modem_location_set_assistance_data_servers@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_set_capabilities@Base 0.7.991 mm_gdbus_modem_location_set_enabled@Base 0.7.991 mm_gdbus_modem_location_set_gps_refresh_rate@Base 1.5.993 mm_gdbus_modem_location_set_location@Base 0.7.991 mm_gdbus_modem_location_set_signals_location@Base 0.7.991 mm_gdbus_modem_location_set_supl_server@Base 1.5.993 + mm_gdbus_modem_location_set_supported_assistance_data@Base 1.10.0-0ubuntu1 mm_gdbus_modem_location_skeleton_get_type@Base 0.7.991 mm_gdbus_modem_location_skeleton_new@Base 0.7.991 mm_gdbus_modem_messaging_call_create@Base 0.7.991 @@ -648,6 +724,7 @@ mm_gdbus_modem_set_device_identifier@Base 0.7.991 mm_gdbus_modem_set_drivers@Base 0.7.991 mm_gdbus_modem_set_equipment_identifier@Base 0.7.991 + mm_gdbus_modem_set_hardware_revision@Base 1.7.990 mm_gdbus_modem_set_manufacturer@Base 0.7.991 mm_gdbus_modem_set_max_active_bearers@Base 0.7.991 mm_gdbus_modem_set_max_bearers@Base 0.7.991 @@ -825,15 +902,25 @@ mm_gdbus_object_skeleton_set_modem_simple@Base 0.7.991 mm_gdbus_object_skeleton_set_modem_time@Base 0.7.991 mm_gdbus_object_skeleton_set_modem_voice@Base 1.5.993 + mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device@Base 1.10.0-0ubuntu1 + mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish@Base 1.10.0-0ubuntu1 + mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync@Base 1.10.0-0ubuntu1 + mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event@Base 1.7.990 + mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish@Base 1.7.990 + mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync@Base 1.7.990 mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_finish@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_sync@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_call_set_logging@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_finish@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_sync@Base 0.7.991 + mm_gdbus_org_freedesktop_modem_manager1_complete_inhibit_device@Base 1.10.0-0ubuntu1 + mm_gdbus_org_freedesktop_modem_manager1_complete_report_kernel_event@Base 1.7.990 mm_gdbus_org_freedesktop_modem_manager1_complete_scan_devices@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_complete_set_logging@Base 0.7.991 + mm_gdbus_org_freedesktop_modem_manager1_dup_version@Base 1.10.0-0ubuntu1 mm_gdbus_org_freedesktop_modem_manager1_get_type@Base 0.7.991 + mm_gdbus_org_freedesktop_modem_manager1_get_version@Base 1.10.0-0ubuntu1 mm_gdbus_org_freedesktop_modem_manager1_interface_info@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_override_properties@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_proxy_get_type@Base 0.7.991 @@ -843,6 +930,7 @@ mm_gdbus_org_freedesktop_modem_manager1_proxy_new_for_bus_finish@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_proxy_new_for_bus_sync@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_proxy_new_sync@Base 0.7.991 + mm_gdbus_org_freedesktop_modem_manager1_set_version@Base 1.10.0-0ubuntu1 mm_gdbus_org_freedesktop_modem_manager1_skeleton_get_type@Base 0.7.991 mm_gdbus_org_freedesktop_modem_manager1_skeleton_new@Base 0.7.991 mm_gdbus_sim_call_change_pin@Base 0.7.991 @@ -949,20 +1037,38 @@ mm_get_int_from_match_info@Base 0.7.991 mm_get_int_from_str@Base 0.7.991 mm_get_string_unquoted_from_match_info@Base 0.7.991 + mm_get_uint_from_hex_str@Base 1.7.990 mm_get_uint_from_match_info@Base 0.7.991 mm_get_uint_from_str@Base 0.7.991 + mm_kernel_event_properties_dup@Base 1.7.990 + mm_kernel_event_properties_get_action@Base 1.7.990 + mm_kernel_event_properties_get_dictionary@Base 1.7.990 + mm_kernel_event_properties_get_name@Base 1.7.990 + mm_kernel_event_properties_get_subsystem@Base 1.7.990 + mm_kernel_event_properties_get_type@Base 1.7.990 + mm_kernel_event_properties_get_uid@Base 1.7.990 + mm_kernel_event_properties_new@Base 1.7.990 + mm_kernel_event_properties_new_from_dictionary@Base 1.7.990 + mm_kernel_event_properties_new_from_string@Base 1.7.990 + mm_kernel_event_properties_set_action@Base 1.7.990 + mm_kernel_event_properties_set_name@Base 1.7.990 + mm_kernel_event_properties_set_subsystem@Base 1.7.990 + mm_kernel_event_properties_set_uid@Base 1.7.990 mm_location_3gpp_get_cell_id@Base 0.7.991 mm_location_3gpp_get_location_area_code@Base 0.7.991 mm_location_3gpp_get_mobile_country_code@Base 0.7.991 mm_location_3gpp_get_mobile_network_code@Base 0.7.991 mm_location_3gpp_get_string_variant@Base 0.7.991 + mm_location_3gpp_get_tracking_area_code@Base 1.10.0-0ubuntu1 mm_location_3gpp_get_type@Base 0.7.991 mm_location_3gpp_new@Base 0.7.991 mm_location_3gpp_new_from_string_variant@Base 0.7.991 + mm_location_3gpp_reset@Base 1.10.0-0ubuntu1 mm_location_3gpp_set_cell_id@Base 0.7.991 mm_location_3gpp_set_location_area_code@Base 0.7.991 mm_location_3gpp_set_mobile_country_code@Base 0.7.991 mm_location_3gpp_set_mobile_network_code@Base 0.7.991 + mm_location_3gpp_set_tracking_area_code@Base 1.10.0-0ubuntu1 mm_location_cdma_bs_get_dictionary@Base 0.7.991 mm_location_cdma_bs_get_latitude@Base 0.7.991 mm_location_cdma_bs_get_longitude@Base 0.7.991 @@ -988,31 +1094,51 @@ mm_location_gps_raw_new_from_dictionary@Base 0.7.991 mm_manager_get_proxy@Base 0.7.991 mm_manager_get_type@Base 0.7.991 + mm_manager_get_version@Base 1.10.0-0ubuntu1 + mm_manager_inhibit_device@Base 1.10.0-0ubuntu1 + mm_manager_inhibit_device_finish@Base 1.10.0-0ubuntu1 + mm_manager_inhibit_device_sync@Base 1.10.0-0ubuntu1 mm_manager_new@Base 0.7.991 mm_manager_new_finish@Base 0.7.991 mm_manager_new_sync@Base 0.7.991 mm_manager_peek_proxy@Base 0.7.991 + mm_manager_report_kernel_event@Base 1.7.990 + mm_manager_report_kernel_event_finish@Base 1.7.990 + mm_manager_report_kernel_event_sync@Base 1.7.990 mm_manager_scan_devices@Base 0.7.991 mm_manager_scan_devices_finish@Base 0.7.991 mm_manager_scan_devices_sync@Base 0.7.991 mm_manager_set_logging@Base 0.7.991 mm_manager_set_logging_finish@Base 0.7.991 mm_manager_set_logging_sync@Base 0.7.991 + mm_manager_uninhibit_device@Base 1.10.0-0ubuntu1 + mm_manager_uninhibit_device_finish@Base 1.10.0-0ubuntu1 + mm_manager_uninhibit_device_sync@Base 1.10.0-0ubuntu1 mm_message_error_get_type@Base 0.7.991 mm_message_error_quark@Base 0.7.991 mm_mobile_equipment_error_get_type@Base 0.7.991 mm_mobile_equipment_error_quark@Base 0.7.991 mm_modem_3gpp_dup_imei@Base 0.7.991 + mm_modem_3gpp_dup_initial_eps_bearer_path@Base 1.10.0-0ubuntu1 mm_modem_3gpp_dup_operator_code@Base 0.7.991 mm_modem_3gpp_dup_operator_name@Base 0.7.991 mm_modem_3gpp_dup_path@Base 0.7.991 + mm_modem_3gpp_eps_ue_mode_operation_get_string@Base 1.7.990 + mm_modem_3gpp_eps_ue_mode_operation_get_type@Base 1.7.990 mm_modem_3gpp_facility_build_string_from_mask@Base 0.7.991 mm_modem_3gpp_facility_get_type@Base 0.7.991 mm_modem_3gpp_get_enabled_facility_locks@Base 0.7.991 + mm_modem_3gpp_get_eps_ue_mode_operation@Base 1.7.990 mm_modem_3gpp_get_imei@Base 0.7.991 + mm_modem_3gpp_get_initial_eps_bearer@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_get_initial_eps_bearer_finish@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_get_initial_eps_bearer_path@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_get_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_get_initial_eps_bearer_sync@Base 1.10.0-0ubuntu1 mm_modem_3gpp_get_operator_code@Base 0.7.991 mm_modem_3gpp_get_operator_name@Base 0.7.991 mm_modem_3gpp_get_path@Base 0.7.991 + mm_modem_3gpp_get_pco@Base 1.10.0-0ubuntu1 mm_modem_3gpp_get_registration_state@Base 0.7.991 mm_modem_3gpp_get_subscription_state@Base 1.2.0 mm_modem_3gpp_get_type@Base 0.7.991 @@ -1024,6 +1150,7 @@ mm_modem_3gpp_network_get_operator_code@Base 0.7.991 mm_modem_3gpp_network_get_operator_long@Base 0.7.991 mm_modem_3gpp_network_get_operator_short@Base 0.7.991 + mm_modem_3gpp_peek_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 mm_modem_3gpp_register@Base 0.7.991 mm_modem_3gpp_register_finish@Base 0.7.991 mm_modem_3gpp_register_sync@Base 0.7.991 @@ -1032,6 +1159,12 @@ mm_modem_3gpp_scan@Base 0.7.991 mm_modem_3gpp_scan_finish@Base 0.7.991 mm_modem_3gpp_scan_sync@Base 0.7.991 + mm_modem_3gpp_set_eps_ue_mode_operation@Base 1.7.990 + mm_modem_3gpp_set_eps_ue_mode_operation_finish@Base 1.7.990 + mm_modem_3gpp_set_eps_ue_mode_operation_sync@Base 1.7.990 + mm_modem_3gpp_set_initial_eps_bearer_settings@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_set_initial_eps_bearer_settings_finish@Base 1.10.0-0ubuntu1 + mm_modem_3gpp_set_initial_eps_bearer_settings_sync@Base 1.10.0-0ubuntu1 mm_modem_3gpp_subscription_state_get_string@Base 1.2.0 mm_modem_3gpp_subscription_state_get_type@Base 1.2.0 mm_modem_3gpp_ussd_cancel@Base 0.7.991 @@ -1102,6 +1235,7 @@ mm_modem_dup_device_identifier@Base 0.7.991 mm_modem_dup_drivers@Base 0.7.991 mm_modem_dup_equipment_identifier@Base 0.7.991 + mm_modem_dup_hardware_revision@Base 1.7.990 mm_modem_dup_manufacturer@Base 0.7.991 mm_modem_dup_model@Base 0.7.991 mm_modem_dup_own_numbers@Base 0.7.991 @@ -1119,12 +1253,16 @@ mm_modem_firmware_dup_path@Base 0.7.991 mm_modem_firmware_get_path@Base 0.7.991 mm_modem_firmware_get_type@Base 0.7.991 + mm_modem_firmware_get_update_settings@Base 1.10.0-0ubuntu1 mm_modem_firmware_list@Base 0.7.991 mm_modem_firmware_list_finish@Base 0.7.991 mm_modem_firmware_list_sync@Base 0.7.991 + mm_modem_firmware_peek_update_settings@Base 1.10.0-0ubuntu1 mm_modem_firmware_select@Base 0.7.991 mm_modem_firmware_select_finish@Base 0.7.991 mm_modem_firmware_select_sync@Base 0.7.991 + mm_modem_firmware_update_method_build_string_from_mask@Base 1.10.0-0ubuntu1 + mm_modem_firmware_update_method_get_type@Base 1.10.0-0ubuntu1 mm_modem_get_access_technologies@Base 0.7.991 mm_modem_get_bearer_paths@Base 1.2.0 mm_modem_get_current_bands@Base 0.7.991 @@ -1134,6 +1272,7 @@ mm_modem_get_device_identifier@Base 0.7.991 mm_modem_get_drivers@Base 0.7.991 mm_modem_get_equipment_identifier@Base 0.7.991 + mm_modem_get_hardware_revision@Base 1.7.990 mm_modem_get_manufacturer@Base 0.7.991 mm_modem_get_max_active_bearers@Base 0.7.991 mm_modem_get_max_bearers@Base 0.7.991 @@ -1163,11 +1302,15 @@ mm_modem_list_bearers@Base 0.7.991 mm_modem_list_bearers_finish@Base 0.7.991 mm_modem_list_bearers_sync@Base 0.7.991 + mm_modem_location_assistance_data_type_build_string_from_mask@Base 1.10.0-0ubuntu1 + mm_modem_location_assistance_data_type_get_type@Base 1.10.0-0ubuntu1 + mm_modem_location_dup_assistance_data_servers@Base 1.10.0-0ubuntu1 mm_modem_location_dup_path@Base 0.7.991 mm_modem_location_dup_supl_server@Base 1.5.993 mm_modem_location_get_3gpp@Base 0.7.991 mm_modem_location_get_3gpp_finish@Base 0.7.991 mm_modem_location_get_3gpp_sync@Base 0.7.991 + mm_modem_location_get_assistance_data_servers@Base 1.10.0-0ubuntu1 mm_modem_location_get_capabilities@Base 0.7.991 mm_modem_location_get_cdma_bs@Base 0.7.991 mm_modem_location_get_cdma_bs_finish@Base 0.7.991 @@ -1185,7 +1328,11 @@ mm_modem_location_get_gps_refresh_rate@Base 1.5.993 mm_modem_location_get_path@Base 0.7.991 mm_modem_location_get_supl_server@Base 1.5.993 + mm_modem_location_get_supported_assistance_data@Base 1.10.0-0ubuntu1 mm_modem_location_get_type@Base 0.7.991 + mm_modem_location_inject_assistance_data@Base 1.10.0-0ubuntu1 + mm_modem_location_inject_assistance_data_finish@Base 1.10.0-0ubuntu1 + mm_modem_location_inject_assistance_data_sync@Base 1.10.0-0ubuntu1 mm_modem_location_set_gps_refresh_rate@Base 1.5.993 mm_modem_location_set_gps_refresh_rate_finish@Base 1.5.993 mm_modem_location_set_gps_refresh_rate_sync@Base 1.5.993 @@ -1362,6 +1509,18 @@ mm_oma_session_state_get_type@Base 1.2.0 mm_oma_session_type_get_string@Base 1.2.0 mm_oma_session_type_get_type@Base 1.2.0 + mm_pco_from_variant@Base 1.10.0-0ubuntu1 + mm_pco_get_data@Base 1.10.0-0ubuntu1 + mm_pco_get_session_id@Base 1.10.0-0ubuntu1 + mm_pco_get_type@Base 1.10.0-0ubuntu1 + mm_pco_is_complete@Base 1.10.0-0ubuntu1 + mm_pco_list_add@Base 1.10.0-0ubuntu1 + mm_pco_list_free@Base 1.10.0-0ubuntu1 + mm_pco_new@Base 1.10.0-0ubuntu1 + mm_pco_set_complete@Base 1.10.0-0ubuntu1 + mm_pco_set_data@Base 1.10.0-0ubuntu1 + mm_pco_set_session_id@Base 1.10.0-0ubuntu1 + mm_pco_to_variant@Base 1.10.0-0ubuntu1 mm_serial_error_get_type@Base 0.7.991 mm_serial_error_quark@Base 0.7.991 mm_signal_get_dictionary@Base 1.2.0 diff -Nru modemmanager-1.6.8/debian/modemmanager.postrm modemmanager-1.10.0/debian/modemmanager.postrm --- modemmanager-1.6.8/debian/modemmanager.postrm 2017-10-21 00:45:12.000000000 +0200 +++ modemmanager-1.10.0/debian/modemmanager.postrm 2019-03-12 19:43:29.000000000 +0100 @@ -1,9 +1,4 @@ #!/bin/sh set -e -# drop the temporary mask from prerm -if [ -d /run/systemd/system ] && [ "$1" = remove ]; then - systemctl unmask --runtime ModemManager -fi - #DEBHELPER# diff -Nru modemmanager-1.6.8/debian/patches/0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch modemmanager-1.10.0/debian/patches/0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch --- modemmanager-1.6.8/debian/patches/0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch 2018-04-24 13:06:03.000000000 +0200 +++ modemmanager-1.10.0/debian/patches/0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -From 1a7bcaa7bbad8b2e6a220e6780f5a7b0ec390c0d Mon Sep 17 00:00:00 2001 -From: Iain Lane -Date: Tue, 24 Apr 2018 12:31:44 +0100 -Subject: [PATCH] m4/compiler_warnings.m4: Let -Werror be disabled - -It's annoying for distributors to build with -Werror, since it means -that compiler upgrades can break the build. Let's let them disable it, -but keep it enabled by default. - -Origin: vendor, Ubuntu -Forwarded: https://bugs.freedesktop.org/show_bug.cgi?id=106208 - ---- - m4/compiler_warnings.m4 | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4 -index abc2da77..f498a282 100644 ---- a/m4/compiler_warnings.m4 -+++ b/m4/compiler_warnings.m4 -@@ -1,11 +1,11 @@ - AC_DEFUN([NM_COMPILER_WARNINGS], - [AC_ARG_ENABLE(more-warnings, -- AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), -- set_more_warnings="$enableval",set_more_warnings=yes) --AC_MSG_CHECKING(for more warnings, including -Werror) -+ AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]), -+ set_more_warnings="$enableval",set_more_warnings=error) -+AC_MSG_CHECKING(for more warnings) - if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then - AC_MSG_RESULT(yes) -- CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" -+ CFLAGS="-Wall -std=gnu89 $CFLAGS" - - for option in -Wmissing-declarations -Wmissing-prototypes \ - -Wdeclaration-after-statement -Wstrict-prototypes \ -@@ -26,6 +26,9 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then - unset SAVE_CFLAGS - done - unset option -+ if test "x$set_more_warnings" = xerror; then -+ CFLAGS="$CFLAGS -Werror" -+ fi - else - AC_MSG_RESULT(no) - fi --- -2.17.0 - diff -Nru modemmanager-1.6.8/debian/patches/default_strict_probing_policy.patch modemmanager-1.10.0/debian/patches/default_strict_probing_policy.patch --- modemmanager-1.6.8/debian/patches/default_strict_probing_policy.patch 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/debian/patches/default_strict_probing_policy.patch 2019-03-12 19:43:29.000000000 +0100 @@ -0,0 +1,19 @@ +From: Mathieu Trudel-Lapierre +Subject: Default to strict probing filter policy. +Bug-Debian: https://bugs.debian.org/683839 +Last-Update: 2018-03-01 +Forwarded: not-needed + +Index: modemmanager/data/ModemManager.service.in +=================================================================== +--- modemmanager.orig/data/ModemManager.service.in ++++ modemmanager/data/ModemManager.service.in +@@ -4,7 +4,7 @@ Description=Modem Manager + [Service] + Type=dbus + BusName=org.freedesktop.ModemManager1 +-ExecStart=@sbindir@/ModemManager ++ExecStart=@sbindir@/ModemManager --filter-policy=strict + StandardError=null + Restart=on-abort + CapabilityBoundingSet=CAP_SYS_ADMIN diff -Nru modemmanager-1.6.8/debian/patches/error-propagation-fix.patch modemmanager-1.10.0/debian/patches/error-propagation-fix.patch --- modemmanager-1.6.8/debian/patches/error-propagation-fix.patch 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/debian/patches/error-propagation-fix.patch 2019-05-06 16:07:34.000000000 +0200 @@ -0,0 +1,17 @@ +From: y paritcher +Subject: mm-broadband-modem: fix error propagation in cdma service status +Bug-Launchpad: https://bugs.launchpad.net/bugs/1819615 +Bug-Upstream: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/119 +Last-Update: 2019-05-01 + +--- a/src/mm-broadband-modem.c ++++ b/src/mm-broadband-modem.c +@@ -8231,7 +8231,7 @@ + GError *inner_error = NULL; + gboolean value; + +- value = g_task_propagate_boolean (G_TASK (res), error); ++ value = g_task_propagate_boolean (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; diff -Nru modemmanager-1.6.8/debian/patches/series modemmanager-1.10.0/debian/patches/series --- modemmanager-1.6.8/debian/patches/series 2018-04-24 13:06:03.000000000 +0200 +++ modemmanager-1.10.0/debian/patches/series 2019-05-06 16:08:03.000000000 +0200 @@ -1 +1,2 @@ -0001-m4-compiler_warnings.m4-Let-Werror-be-disabled.patch +default_strict_probing_policy.patch +error-propagation-fix.patch diff -Nru modemmanager-1.6.8/debian/rules modemmanager-1.10.0/debian/rules --- modemmanager-1.6.8/debian/rules 2018-04-24 13:06:03.000000000 +0200 +++ modemmanager-1.10.0/debian/rules 2019-03-12 19:43:29.000000000 +0100 @@ -3,6 +3,8 @@ #For debhelper debugging #export DH_VERBOSE=1 +export DPKG_GENSYMBOLS_CHECK_LEVEL=4 + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) #always exclude any data from version control systems diff -Nru modemmanager-1.6.8/depcomp modemmanager-1.10.0/depcomp --- modemmanager-1.6.8/depcomp 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/depcomp 2019-01-17 16:15:48.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,9 +783,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru modemmanager-1.6.8/docs/Makefile.in modemmanager-1.10.0/docs/Makefile.in --- modemmanager-1.6.8/docs/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/docs/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -142,7 +141,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,7 +190,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -244,14 +242,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -372,8 +362,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -414,8 +402,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,7 +520,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/docs/man/Makefile.am modemmanager-1.10.0/docs/man/Makefile.am --- modemmanager-1.6.8/docs/man/Makefile.am 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/man/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -1,3 +1,3 @@ -man_MANS = ModemManager.8 mmcli.8 +man_MANS = ModemManager.8 mmcli.1 EXTRA_DIST = $(man_MANS) diff -Nru modemmanager-1.6.8/docs/man/Makefile.in modemmanager-1.10.0/docs/man/Makefile.in --- modemmanager-1.6.8/docs/man/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/docs/man/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -154,15 +153,15 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 -am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -215,14 +214,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -343,8 +334,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -364,7 +353,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -man_MANS = ModemManager.8 mmcli.8 +man_MANS = ModemManager.8 mmcli.1 EXTRA_DIST = $(man_MANS) all: all-am @@ -386,8 +375,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -404,6 +393,49 @@ clean-libtool: -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ @@ -454,7 +486,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -488,7 +523,7 @@ check: check-am all-am: Makefile $(MANS) installdirs: - for dir in "$(DESTDIR)$(man8dir)"; do \ + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -557,7 +592,7 @@ install-info-am: -install-man: install-man8 +install-man: install-man1 install-man8 install-pdf: install-pdf-am @@ -587,7 +622,7 @@ uninstall-am: uninstall-man -uninstall-man: uninstall-man8 +uninstall-man: uninstall-man1 uninstall-man8 .MAKE: install-am install-strip @@ -597,12 +632,12 @@ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-man8 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags-am uninstall uninstall-am uninstall-man \ - uninstall-man8 + install-man1 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-man uninstall-man1 uninstall-man8 .PRECIOUS: Makefile diff -Nru modemmanager-1.6.8/docs/man/mmcli.1 modemmanager-1.10.0/docs/man/mmcli.1 --- modemmanager-1.6.8/docs/man/mmcli.1 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/man/mmcli.1 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,985 @@ +.\" mmcli(1) manual page +.\" +.\" Copyright (C) 2012 Martyn Russell +.\" +.\" Comment out '.nr' or set to 0 to eliminate WIDTH fiddlin' ! +.nr half_xtra 4 + +.TH mmcli 1 "October 2012" GNU "User Commands" + +.SH NAME +mmcli \- Control and monitor the ModemManager + +.SH SYNOPSIS +\fBmmcli\fR [\fIOPTION\fR...] + +.SH DESCRIPTION +ModemManager is a DBus-powered Linux daemon which provides a unified +high level API for communicating with (mobile broadband) modems. It +acts as a standard RIL (Radio Interface Layer) and may be used by +different connection managers, like NetworkManager. Thanks to the +built-in plugin architecture, ModemManager talks to very different +kinds of modems with very different kinds of ports. In addition to the +standard AT serial ports, Qualcomm-based QCDM and QMI ports are also +supported. + +.SH HELP OPTIONS +.TP +.B \-h, \-\-help +Show summary of options by group. +.TP +.B \-\-help\-all +Show all groups and options. +.TP +.B \-\-help\-manager +Show manager specific options. +.TP +.B \-\-help\-common +Show common options. These are used for defining the device an option +operates on. For example, modems, bearers, SIMs, SMS', etc. +.TP +.B \-\-help\-modem +Show modem specific options. +.TP +.B \-\-help\-3gpp +Show 3GPP specific options. +.TP +.B \-\-help\-cdma +Show CDMA specific options. +.TP +.B \-\-help\-simple +Show simple options. These are useful for getting connected or +disconnected and understanding the state of things as fast as possible +without worrying so much about the details. +.TP +.B \-\-help\-location +Show location or positioning specific options. +.TP +.B \-\-help\-messaging +Show messaging specific options. See also \fB\-\-help\-sms\fR which +is related. +.TP +.B \-\-help\-time +Show time specific options. +.TP +.B \-\-help\-firmware +Show firmware specific options. +.TP +.B \-\-help\-oma +Show OMA specific options. +.TP +.B \-\-help\-sim +Show SIM card specific options. +.TP +.B \-\-help\-bearer +Show bearer specific options. +.TP +.B \-\-help\-sms +Show SMS specific options. See also \fB\-\-help\-messaging\fR which +is related. + +.SH MANAGER OPTIONS +.TP +.B \-B, \-\-get\-daemon\-version +Retrieve the version of the currently running ModemManager daemon. +.TP +.B \-G, \-\-set\-logging=[ERR|WARN|INFO|DEBUG] +Set the logging level in ModemManager daemon. For debugging information you can +supply \fBDEBUG\fR. Each value above \fBDEBUG\fR provides less detail. In most +cases \fBERR\fR (for displaying errors) are the important messages. + +The default mode is \fBERR\fR. +.TP +.B \-L, \-\-list\-modems +List available modems. +.TP +.B \-M, \-\-monitor\-modems +List available modems and monitor modems added or removed. +.TP +.B \-S, \-\-scan-modems +Scan for any potential new modems. This is only useful when expecting pure +RS232 modems, as they are not notified automatically by the kernel. +.TP +.B \-I, \-\-inhibit\-device=[UID] +Inhibit the specific device from being used by ModemManager. The \fBUID\fR +that should be given is the value of the \fBDevice\fR property exposed by +a given modem (i.e. equal to the \fBID_MM_PHYSDEV_UID\fR if one set, or +otherwise equal to the full device sysfs path). + +This command will not exit right away, as that would implicitly remove the +inhibition. The user must make sure to stop the mmcli process hitting Ctrl+C +in order to un-inhibit the device. + +When a device is inhibited via this method, ModemManager will disable the modem +(therefore stopping any ongoing connection) and will no longer use it until it +is uninhibited. +.TP +.B \-\-report\-kernel\-event=['KEY1=VALUE1,KEY2=VALUE2,...'] +Manually report kernel events, instead of relying on udev (e.g. if the daemon +is running with \fB\-\-no\-auto\-scan\fR or if the system was built without udev +support). + +The supported \fBKEY\fRs are: +.RS 9 +.TP +\fB'action'\fR +Action to report, one of 'add' or 'remove'. Required. +.TP +\fB'subsystem'\fR +Subsystem of the specific port being reported, e.g. 'tty' (for serial ports), +'net' (for network interfaces), or 'usbmisc' (for cdc-wdm ports).. +.TP +\fB'name'\fR +Name of the port being reported, e.g. 'ttyACM0', 'wwan0' or 'cdc-wdm0'. +.TP +\fB'uid'\fR +The specific UID of the device, equivalent to the \fBID_MM_PHYSDEV_UID\fR udev +tag. All ports reported with the same 'UID' value will be considered part of the +same device, which may be useful for e.g. modems with multiple platform TTYs. +.RE + +.TP +.B \-\-report\-kernel\-event\-auto\-scan +When built with udev support but the daemon is running with +\fB\-\-no\-auto\-scan\fR, this method may be used to automatically report kernel +events based on udev. + +This command will not exit right away. The user must make sure to stop the mmcli +process hitting Ctrl+C in order to stopping monitoring for new events. + +.SH COMMON OPTIONS +All options below take a \fBPATH\fR or \fBINDEX\fR argument. If no action is +provided, the default information about the modem, bearer, etc. is +shown instead. + +The \fBPATH\fR and \fBINDEX\fR are created automatically when the +modem is plugged in. They can be found using \fBmmcli \-L\fR. This +produces something like (for modems only): + +.RS 7 +Found 1 modems: + /org/freedesktop/ModemManager1/Modem/\fB4\fR +.RE + +In this case, the \fBINDEX\fR is \fB4\fR and the \fBPATH\fR is the entire string above. + +However, for the bearers, SIMs and SMS cases, the \fBPATH\fR is +slightly different. The \fIModem\fR is replaced with the object name +in use, like \fIBearer\fR. For example: + +.RS 7 +/org/freedesktop/ModemManager1/\fIBearer\fR/4 +.RE + +.TP +.B \-m, \-\-modem=[PATH|INDEX] +Specify a modem. +.TP +.B \-b, \-\-bearer=[PATH|INDEX] +Specify a bearer. +.TP +.B \-i, \-\-sim=[PATH|INDEX] +Specify a SIM card. +.TP +.B \-s, \-\-sms=[PATH|INDEX] +Specify an SMS. + +.SH MODEM OPTIONS +All of the modem options below make use of the \fB\-\-modem\fR or +\fB\-m\fR switch to specify the modem to act on. + +Some operations require a \fBMODE\fR. \fBMODE\fR can be any +combination of the modes actually supported by the modem. In the +perfect case, the following are possible: + +.Bd -literal -compact + \fB'2G'\fR - 2G technologies, e.g. EDGE, CDMA1x + \fB'3G'\fR - 3G technologies, e.g. HSPA, EV-DO + \fB'4G'\fR - 4G technologies, e.g. LTE + \fB'ANY'\fR - for all supported modes. +.Ed +.TP +.B \-w, \-\-monitor\-state +Monitor the state of a given modem. +.TP +.B \-e, \-\-enable +Enable a given modem. + +This powers the antenna, starts the automatic registration process and +in general prepares the modem to be connected. +.TP +.B \-d, \-\-disable +Disable a given modem. + +This disconnects the existing connection(s) for the modem and puts it +into a low power mode. +.TP +.B \-r, \-\-reset +Resets the modem to the settings it had when it was power cycled. +.TP +.B \-\-factory\-reset=CODE +Resets the modem to its original factory default settings. + +The \fBCODE\fR provided is vendor specific. Without the correct vendor +code, it's unlikely this operation will succeed. This is not a common +user action. +.TP +.B \-\-command=COMMAND +Send an AT \fBCOMMAND\fR to the given modem. For example, +\fBCOMMAND\fR could be 'AT+GMM' to probe for phone model information. This +operation is only available when ModemManager is run in debug mode. +.TP +.B \-\-list\-bearers +List packet data bearers that are available for the given modem. +.TP +.B \-\-create\-bearer=['KEY1=VALUE1,KEY2=VALUE2,...'] +Create a new packet data bearer for a given modem. The \fBKEY\fRs and +some \fBVALUE\fRs are listed below: +.RS 9 +.TP +\fB'apn'\fR +Access Point Name. Required in 3GPP. +.TP +\fB'ip-type'\fR +Addressing type. Given as a MMBearerIpFamily value (e.g. 'ipv4', 'ipv6', 'ipv4v6'). Optional in 3GPP and CDMA. +.TP +\fB'allowed-auth'\fR +Authentication method to use. Given as a MMBearerAllowedAuth value (e.g. 'none|pap|chap|mschap|mschapv2|eap'). Optional in 3GPP. +.TP +\fB'user'\fR +User name (if any) required by the network. Optional in 3GPP. +.TP +\fB'password'\fR +Password (if any) required by the network. Optional in 3GPP. +.TP +\fB'allow-roaming'\fR +Flag to tell whether connection is allowed during roaming, given as a boolean value (i.e 'yes' or 'no'). Optional in 3GPP. +.TP +\fB'rm-protocol'\fR +Protocol of the Rm interface, given as a MMModemCdmaRmProtocol value (e.g. 'async', 'packet-relay', 'packet-network-ppp', 'packet-network-slip', 'stu-iii'). Optional in CDMA. +.TP +\fB'number'\fR +Telephone number to dial. Required in POTS. +.RE +.TP +.B \-\-delete\-bearer=[PATH|INDEX] +Delete bearer from a given modem. +.TP +.B \-\-set\-allowed\-modes=[MODE1|MODE2|...] +Set allowed modes for a given modem. For possible modes, see the +beginning of this section. +.TP +.B \-\-set\-preferred\-mode=MODE +Set the preferred \fBMODE\fR for the given modem. The \fBMODE\fR +\fIMUST\fR be one of the allowed modes as set with the +\fB\-\-set\-allowed\-modes\fR option. Possible \fBMODE\fR arguments +are detailed at the beginning of this section. +.TP +.B \-\-set\-current\-bands=[BAND1|BAND2|...] +Set bands to be used for a given modem. These are frequency ranges +the modem should use. There are quite a number of supported bands and +listing them all here would be quite extensive. For details, see the +MMModemBand documentation. + +An example would be: 'egsm|dcs|pcs|g850' to select all the GSM +frequency bands. +.TP +.B \-\-inhibit +Inhibit the specific modem from being used by ModemManager. This method +is completely equivalent to \fB\-\-inhibit\-device\fR, with the only +difference being that in this case, the modem must be managed by the daemon +at the time the inhibition is requested. + +This command will not exit right away, as that would implicitly remove the +inhibition. The user must make sure to stop the mmcli process hitting Ctrl+C +in order to un-inhibit the device. + +When a device is inhibited via this method, ModemManager will disable the modem +(therefore stopping any ongoing connection) and will no longer use it until it +is uninhibited. + +.SH 3GPP OPTIONS +The 3rd Generation Partnership Project (3GPP) is a collaboration +between groups of telecommunications associations. These options +pertain to devices which support 3GPP. + +Included are options to control USSD (Unstructured Supplementary +Service Data) sessions. + +All of the 3GPP options below make use of the \fB\-\-modem\fR or +\fB\-m\fR switch to specify the modem to act on. +.TP +.B \-\-3gpp\-scan +Scan for available 3GPP networks. +.TP +.B \-\-3gpp\-register\-home +Request a given modem to register in its home network. + +This registers with the default network(s) specified by the modem, +.TP +.B \-\-3gpp\-register\-in\-operator=MCCMNC +Request a given modem to register on the network of the given +\fBMCCMNC\fR (Mobile Country Code, Mobile Network Code) based +operator. This code is used for GSM/LTE, CDMA, iDEN, TETRA and UMTS +public land mobile networks and some satellite mobile networks. The +ITU-T Recommendation E.212 defines mobile country codes. +.TP +.B \-\-3gpp\-ussd\-status +Request the status of \fIANY\fR ongoing USSD session. +.TP +.B \-\-3gpp\-ussd\-initiate=COMMAND +Request the given modem to initiate a USSD session with \fBCOMMAND\fR. + +For example, \fBCOMMAND\fR could be '*101#' to give your current +pre-pay balance. +.TP +.B \-\-3gpp\-ussd\-respond=RESPONSE +When initiating an USSD session, a \fRRESPONSE\fR may be needed by a +network-originated request. This option allows for that. +.TP +.B \-\-3gpp\-ussd\-cancel +Cancel an ongoing USSD session for a given modem. + +.SH CDMA OPTIONS +All CDMA (Code Division Multiple Access) options require the +\fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-cdma\-activate=CARRIER +Activate the given modem using OTA (Over the Air) settings. The +\fBCARRIER\fR is a code provided by the network for the default +settings they provide. + +.SH SIMPLE OPTIONS +All simple options must be used with \fB\-\-modem\fR or \fB\-m\fR. + +.TP +.B \-\-simple\-connect=['KEY1=VALUE1,KEY2=VALUE2,...'] +Run a full connection sequence using \fBKEY\fR / \fBVALUE\fR pairs. +You can use the \fB\-\-create\-bearer\fR options, plus any of the +following ones: +.RS 9 +.TP +\fB'pin'\fR +SIM-PIN unlock code. +.TP +\fB'operator-id'\fR +ETSI MCC-MNC of a network to force registration. +.RE +.TP +.B \-\-simple\-disconnect +Disconnect \fIALL\fR connected bearers for a given modem. + +.SH LOCATION OPTIONS +These options detail how to discover your location using Global +Positioning System (GPS) or directly from your mobile network infrastructure +(either 3GPP or 3GPP2). + +All location options must be used with \fB\-\-modem\fR or \fB\-m\fR. + +.TP +.B \-\-location\-status +Show the current status for discovering our location. +.TP +.B \-\-location\-get +Show all location information available. +.TP +.B \-\-location\-enable\-3gpp +Enable location discovery using the 3GPP network. +.TP +.B \-\-location\-disable\-3gpp +Disable location discovery using the 3GPP network. +.TP +.B \-\-location\-enable\-agps +Enable A-GPS (MSA) support. This command does not implicitly start the GPS +engine, it just specifies that A-GPS should be enabled when the engine is +started. Therefore, the user should request enabling A-GPS before the raw +or NMEA outputs are enabled with \fB\-\-location\-enable\-gps\-raw\fR or +\fB\-\-location\-enable\-gps\-nmea\fR. +.TP +.B \-\-location\-disable\-agps +Disable A-GPS (MSA) support. +.TP +.B \-\-location\-enable\-gps\-nmea +Enable location discovery using GPS and reported with NMEA traces. + +This command will start the GPS engine, if it isn't started already. +.TP +.B \-\-location\-disable\-gps\-nmea +Disable location discovery using GPS and NMEA traces. + +If the raw output is not enabled at the same time, the GPS engine will be +stopped. +.TP +.B \-\-location\-enable\-gps\-raw +Enable location discovery using GPS and reported with raw (i.e. +longitude/latitude) values. + +This command will start the GPS engine, if it isn't started already. +.TP +.B \-\-location\-disable\-gps\-raw +Disable location discovery using GPS and raw values. + +If the NMEA output is not enabled at the same time, the GPS engine will be +stopped. +.TP +.B \-\-location\-enable\-cdma-bs +Enable location discovery using the 3GPP2 network. +.TP +.B \-\-location\-disable\-cdma-bs +Disable location discovery using the 3GPP2 network. +.TP +.B \-\-location\-enable\-gps\-unmanaged +Enable location discovery using GPS but without taking control of the NMEA tty +port. This allows other programs, e.g. gpsd, to use the NMEA tty once the GPS +engine has been enabled. +.TP +.B \-\-location\-disable\-gps\-unmanaged +Disable location discovery using GPS and unmanaged port. +.TP +.B \-\-location\-set\-gps\-refresh\-rate=SEC +Set the location refresh rate on the DBus interface to SEC seconds. If set to +0, the new location is published on the DBus interface as soon as ModemManager +detects it. +.TP +.B \-\-location\-set\-supl\-server=[IP:PORT] or \-\-location\-set\-supl\-server=[FQDN:PORT] +Configure the location of the A\-GPS SUPL server, either specifying the IP +address (\fBIP:PORT\fR) or specifyng a fully qualified domain name +(\fB[FQDN:PORT]\fR). +.TP +.B \-\-location\-inject\-assistance\-data=[PATH] +Inject assistance data into the GNSS module, loaded from a local file at +\fBPATH\fR. The assistance data should be in a format expected by the device, +e.g. downloaded from the URLs exposed by the 'AssistanceDataServers' property. +.TP +.B \-\-location\-set\-enable\-signal +Enable reporting location updates via DBus property signals. This is +required if applications rely on listening to 'Location' property updates, +instead of explicit queries with the policy-protected 'GetLocation' method. + +This DBus property signal updates are by default disabled. +.TP +.B \-\-location\-set\-disable\-signal +Disable reporting location updates via DBus property signals. + +.SH MESSAGING OPTIONS +All messaging options must be used with \fB\-\-modem\fR or \fB\-m\fR. + +.TP +.B \-\-messaging\-status +Show the status of the messaging support. +.TP +.B \-\-messaging\-list-sms +List SMS messages available on a given modem. +.TP +.B \-\-messaging\-create-sms=['KEY1=VALUE1,...'] +Create a new SMS on a given modem. \fBKEY\fRs can be any of the following: +.RS 9 +.TP +\fB'number'\fR + Number to which the message is addressed. +.TP +\fB'text'\fR +Message text, in UTF-8. When sending, if the text is larger than the +limit of the technology or modem, the message will be broken into +multiple parts or messages. Note that text and data are never given at +the same time. +.TP +\fB'smsc'\fR +Indicates the SMS service center number. +.TP +\fB'validity'\fR +Specifies when the SMS expires in the SMSC. +.TP +\fB'class'\fR +3GPP message class (0..3). +.TP +\fB'delivery-report-request'\fR +Specifies whether delivery report is requested when sending the SMS +('yes' or 'no') +.TP +\fB'storage'\fR +Specifies the storage where this message is kept. Storages may +be 'sm', 'me', 'mt', 'sr', 'bm', 'ta'. +.RE +.TP +.B \-\-messaging\-create\-sms\-with\-data=PATH +Use \fBPATH\fR to a filename as the data to create a new SMS. +.TP +.B \-\-messaging\-delete\-sms=[PATH|INDEX] +Delete an SMS from a given modem. + +.SH TIME OPTIONS +All time operations require the \fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-time +Display the current network time from the operator. This includes the +timezone which is usually of importance. + +.SH VOICE OPTIONS +All voice operations require the \fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-voice\-list\-calls +List calls managed (initiated, received, ongoing) on a given modem. +.TP +.B \-\-voice\-create-call=['KEY1=VALUE1,...'] +Create a new outgoing call on a given modem. \fBKEY\fRs can be any of the +following: +.RS 9 +.TP +\fB'number'\fR +Number to call. +.RE +.TP +.B \-\-voice\-delete\-call=[PATH|INDEX] +Delete a call from a given modem. + +.SH FIRMWARE OPTIONS +All firmware options require the \fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-firmware\-status +Show firmware update specific details and properties. +.TP +.B \-\-firmware\-list +List all the firmware images installed on a given modem. +.TP +.B \-\-firmware\-select=ID +Select a firmware image from those installed on a given modem. A list +of available firmware images can be seen using the +\fB\-\-firmware\-list\fR option. + +The \fBID\fR provided is a \fIUNIQUE\fR identifier for the firmware. + +.SH SIGNAL OPTIONS +All signal options require the \fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-signal\-setup=[Rate] +Setup extended signal quality information retrieval at the specified rate +(in seconds). + +By default this is disabled (rate set to 0). +.TP +.B \-\-signal\-get +Retrieve the last extended signal quality information loaded. + +.SH OMA OPTIONS +All OMA options require the \fB\-\-modem\fR or \fB\-m\fR option. + +.TP +.B \-\-oma\-status +Show the status of the OMA device management subsystem. +.TP +.B \-\-oma\-start\-client\-initiated\-session=[SESSION TYPE] +Request to start a client initiated session. + +The given session type must be one of: + 'client\-initiated\-device\-configure' + 'client\-initiated\-prl\-update' + 'client\-initiated\-hands\-free\-activation' +.TP +.B \-\-oma\-accept\-network\-initiated\-session=[SESSION ID] +Request to accept a network initiated session. +.TP +.B \-\-oma\-reject\-network\-initiated\-session=[SESSION ID] +Request to reject a network initiated session. +.TP +.B \-\-oma\-cancel\-session +Request to cancel current OMA session, if any. + +.SH SIM OPTIONS +.TP +.B \-\-pin=PIN +Send \fBPIN\fR code to a given SIM card. +.TP +.B \-\-puk=PUK +Send \fBPUK\fR code to a given SIM card. This must be used \fIWITH\fR +\fB\-\-pin\fR. +.TP +.B \-\-enable\-pin +Enable PIN request for a given SIM card. This must be used \fIWITH\fR +\fB\-\-pin\fR. +.TP +.B \-\-disable\-pin +Disable PIN request for a given SIM card. This must be used \fIWITH\fR +\fB\-\-pin\fR. +.TP +.B \-\-change\-pin=PIN +Change the PIN for a given SIM card. It will be set to \fBPIN\fR. This +must be used \fIWITH\fR \fB\-\-pin\fR to supply the old PIN number. + +.SH BEARER OPTIONS +All bearer options require the \fB\-\-bearer\fR or \fB\-b\fR option. + +.TP +.B \-c, \-\-connect +Connect to a given bearer. +.TP +.B \-x, \-\-disconnect +Disconnect from a given bearer. + +.SH SMS OPTIONS +All SMS options require the \fB\-\-sms\fR or \fB\-s\fR option. + +.TP +.B \-\-send +Send an SMS. +.TP +.B \-\-store +This option will store the SMS in the default storage defined by the +modem, which may be either modem-memory or SMS-memory. To know what +the existing default storage is, see the \fB\-\-messaging\-status\fR +option. + +.TP +.B \-\-store\-in\-storage=STORAGE +This option states which \fBSTORAGE\fR to use for SMS messages. +Possible values for \fBSTORAGE\fR include: +.RS 9 +.TP +\fB'sm'\fR +SIM card storage area. +.TP +\fB'me'\fR +Mobile equipment storage area. +.TP +\fB'mt'\fR +Sum of SIM and Mobile equipment storages +.TP +\fB'sr'\fR +Status report message storage area. +.TP +\fB'bm'\fR +Broadcast message storage area. +.TP +\fB'ta'\fR +Terminal adaptor message storage area. +.RE +.TP +.B \-\-create\-file\-with\-data\=PATH +This option takes an SMS that has \fIDATA\fR (not \fITEXT\fR) and will +create a local file described by \fBPATH\fR and store the content of +the SMS there. + +.SH CALL OPTIONS +.TP +.B \-\-start +Initiate an outgoing call. +.TP +.B \-\-accept +Accept an incoming call. +.TP +.B \-\-hangup +Reject an incoming call or hangup an ongoing one. +.TP +.B \-\-send\-dtmf=[0\-9A\-D*#] +Send a DTMF sequence through an ongoing call. + +.SH APPLICATION OPTIONS +.TP +.B \-K, \-\-output\-keyvalue +Run action with machine-friendly key-value output, to be used e.g. by +shell scripts that rely on mmcli operations. +.TP +.B \-v, \-\-verbose +Perform actions with more details reported and/or logged. +.TP +.B \-V, \-\-version +Returns the version of this program. +.TP +.B \-a, \-\-async +Use asynchronous methods. This is purely a development tool and has no +practical benefit to most user operations. +.TP +.B \-\-timeout=SECONDS +Use \fBSECONDS\fR for the timeout when performing operations with this +command. This option is useful when executing long running operations, like +\fB\-\-3gpp\-scan\fR. + +.SH EXAMPLES +.SS Send the PIN to the SIM card + +You'll need first to know which the proper path/index is for the SIM in your +modem: +.Bd -literal -compact + $ mmcli -m 0 -K | grep "modem.generic.sim" | awk -F ": " '{ print $2 }' + /org/freedesktop/ModemManager1/SIM/0 +.Ed + +And after that, you can just use the SIM index: +.Bd -literal -compact + $ sudo mmcli -i 0 --pin=1234 + successfully sent PIN code to the SIM +.Ed + +.SS Simple connect and disconnect + +You can launch the simple connection process like: +.Bd -literal -compact + $ sudo mmcli -m 0 --simple-connect="pin=1234,apn=internet" + successfully connected the modem +.Ed + +Then, you can disconnect it like: +.Bd -literal -compact + $ sudo mmcli -m 0 --simple-disconnect + successfully disconnected all bearers in the modem +.Ed + +.SS 3GPP network scan + +Scanning for 3GPP networks may really take a long time, so a specific timeout +must be given: +.Bd -literal -compact + $ sudo mmcli -m 0 --3gpp-scan --timeout=300 + --------------------- + 3GPP scan | networks: 21403 - Orange SP (gprs, unknown) + | 21407 - Movistar (gprs, unknown) + | 21404 - YOIGO (gprs, unknown) + | 21401 - vodafone ES (gprs, unknown) +.Ed + +.SS Creating a new SMS message & storing it + +Using the “sm” (SIM), you can do this using: + +.Bd -literal -compact + $ sudo mmcli -m 0 --messaging-create-sms="text='Hello world',number='+1234567890'" + Successfully created new SMS: + /org/freedesktop/ModemManager1/SMS/21 (unknown) + + $ sudo mmcli -s 21 --store-in-storage="sm" + successfully stored the SMS + + $ sudo mmcli -s 21 + ------------------------------- + General | dbus path: /org/freedesktop/ModemManager1/SMS/21 + ------------------------------- + Content | number: +1234567890 + | text: Hello world + ------------------------------- + Properties | PDU type: submit + | state: stored + | smsc: unknown + | validity: 0 + | class: 0 + | storage: sm + | delivery report: not requested + | message reference: 0 + + $ sudo mmcli -m 0 --messaging-status + ---------------------------- + Messaging | supported storages: sm, me + | default storage: me +.Ed + +.SS Sending binary SMS messages from files + +As you can see below, the important part is the +\fB\-\-messaging\-create\-sms\-with\-data\fR and the \fBPATH\fR provided. + +.Bd -literal -compact + $ sudo mmcli -m 0 \\ + --messaging-create-sms="number='+1234567890'" \\ + --messaging-create-sms-with-data=/path/to/your/file + Successfully created new SMS: + /org/freedesktop/ModemManager1/SMS/22 (unknown) + + $ sudo mmcli -s 22 --send + successfully sent the SMS +.Ed + +.SS Listing SMS messages + +When the receiver gets all the parts of the message, they can now +recover the sent file with another \fBmmcli\fR command in their +ModemManager setup: + +.Bd -literal -compact + $> sudo mmcli -m 0 --messaging-list-sms + /org/freedesktop/ModemManager1/SMS/0 (received) + + $> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file +.Ed + +.SS GPS location status + +You first need to check whether the modem has GPS-specific location +capabilities. Note that we’ll assume the modem is exposed as index 0; +if you have more than one modem, just use --list-modems to check the +proper modem index: + +.Bd -literal -compact + $ mmcli -m 0 --location-status + ---------------------------- + Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea + | enabled: none + | signals: no +.Ed + +The output says that the modem supports 3GPP Location area code/Cell +ID, GPS raw and GPS-NMEA location sources. None is enabled yet, as we +didn’t enable the modem, which we can do issuing: + +.Bd -literal -compact + $ sudo mmcli -m 0 --enable + successfully enabled the modem + + $ mmcli -m 0 --location-status + ---------------------------- + Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea + | enabled: 3gpp-lac-ci + | signals: no +.Ed + +.SS GPS location technology enabling + +We can start the GPS engine by enabling the RAW or NMEA GPS location sources: + +.Bd -literal -compact + $ sudo mmcli -m 0 \\ + --location-enable-gps-raw \\ + --location-enable-gps-nmea + successfully setup location gathering +.Ed + +If we do check again the status, we’ll see the GPS-specific locations are enabled: + +.Bd -literal -compact + $ mmcli -m 0 --location-status + -------------------------------- + Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea + | enabled: 3gpp-lac-ci, gps-raw, gps-nmea + | signals: no +.Ed + +.SS GPS location retrieval + +You can query all location information at the same time with a single command. +If any of the specific outputs is not available, the corresponding section will +be omitted from the output. + +.Bd -literal -compact + $ sudo mmcli -m 0 --location-get + ------------------------- + 3GPP location | Mobile country code: 214 + | Mobile network code: 3 + | Location area code: 21071 + | Cell ID: 7033737 + ------------------------- + GPS NMEA traces | $GPGGA,,,,,,0,,,,,,,,*66 + | $GPRMC,,V,,,,,,,,,,N*53 + | $GPGSA,A,1,,,,,,,,,,,,,,,*1E + | $GPGSV,4,1,16,24,,,,29,,,,05,,,,18,,,*7A + | $GPGSV,4,2,16,22,,,,14,,,,11,,,,17,,,*7B + | $GPGSV,4,3,16,03,,,,12,,,,30,,,,13,,,*78 + | $GPGSV,4,4,16,23,,,,15,,,,27,,,,07,,,*79 + | $GPVTG,,T,,M,,N,,K,N*2C +.Ed + +.SS A-GPS support + +If A-GPS is enabled before starting the GPS engine, and if a data connection +is available in the modem, the configured SUPL servers may be used to obtain +a faster initial position fix. + +Note that the GPS engine will not be started when just A-GPS capability is +enabled. An explicit output (RAW or NMEA) is required to be enabled in order +to start the GPS engine. + +.Bd -literal -compact + $ mmcli -m 0 --location-status + -------------------------------- + Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps + | enabled: 3gpp-lac-ci + | signals: no + ----------------------------- + GPS | refresh rate: 30 seconds + | a-gps supl server: supl.google.com:7276 + + $ sudo mmcli -m 0 --location-enable-agps + successfully setup location gathering + + $ sudo mmcli -m 0 --location-enable-gps-nmea + successfully setup location gathering + + $ sudo mmcli -m 0 --location-enable-gps-raw + successfully setup location gathering +.Ed + +.SS Injecting assistance data + +If the modem device does not have an ongoing connection (e.g. no mobile network +coverage) but the system has other means to access the Internet (e.g. WiFi), the +user may be able to download location assistance data and inject it in the +module. + +E.g. If the device supports XTRA assistance data, the user may download it from +one of the servers listed by ModemManager and manually inject it afterwards. The +XTRA assistance data is usually valid for several days. + +.Bd -literal -compact + $ mmcli -m 0 --location-status + -------------------------------- + Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps + | enabled: 3gpp-lac-ci + | signals: no + -------------------------------- + GPS | refresh rate: 30 seconds + | a-gps supl server: supl.google.com:7276 + | supported assistance: xtra + | assistance servers: https://xtrapath3.izatcloud.net/xtra3grcej.bin + | https://xtrapath1.izatcloud.net/xtra3grcej.bin + | https://xtrapath2.izatcloud.net/xtra3grcej.bin + + $ wget -q https://xtrapath3.izatcloud.net/xtra3grcej.bin + + $ sudo mmcli -m 0 --location-inject-assistance-data=./xtra3grcej.bin + successfully injected assistance data + + $ sudo mmcli -m 0 --location-enable-gps-nmea + successfully setup location gathering + + $ sudo mmcli -m 0 --location-enable-gps-raw + successfully setup location gathering +.Ed + +.SS Key-Value output + +Writing shell scripts that use mmcli to perform operations with the +modem is easy when using the \fB\-\-output\-keyvalue\fR option. For +example, you could gather all the main status information of the modem +with a single call and then parse it to read single fields: + +.Bd -literal -compact + $ STATUS=$(mmcli -m 0 --output-keyvalue) + $ echo "${STATUS}" | grep "modem.generic.state " | awk -F ": " '{ print $2 }' + failed + $ echo "${STATUS}" | grep "modem.generic.state-failed-reason " | awk -F ": " '{ print $2 }' + sim-missing +.Ed + +.SH AUTHORS +Written by Martyn Russell and Aleksander Morgado + +.SH SEE ALSO +\fBModemManager\fR(8), \fBNetworkManager\fR(8) + +AT (http://en.wikipedia.org/wiki/AT_commands). + +3GPP (http://en.wikipedia.org/wiki/3GPP). + +MCCMNC (http://en.wikipedia.org/wiki/Mobile_Network_Code). + +USSD (http://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data). + +CDMA (http://en.wikipedia.org/wiki/Code_division_multiple_access). + +OTA (http://en.wikipedia.org/wiki/Over-the-air_programming). + +GPS (http://en.wikipedia.org/wiki/Global_Positioning_System) + +NMEA (http://en.wikipedia.org/wiki/NMEA_0183) diff -Nru modemmanager-1.6.8/docs/man/mmcli.8 modemmanager-1.10.0/docs/man/mmcli.8 --- modemmanager-1.6.8/docs/man/mmcli.8 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/man/mmcli.8 1970-01-01 01:00:00.000000000 +0100 @@ -1,777 +0,0 @@ -.\" mmcli(8) manual page -.\" -.\" Copyright (C) 2012 Martyn Russell -.\" -.\" Comment out '.nr' or set to 0 to eliminate WIDTH fiddlin' ! -.nr half_xtra 4 - -.TH mmcli 8 "October 2012" GNU "User Commands" - -.SH NAME -mmcli \- Control and monitor the ModemManager - -.SH SYNOPSIS -\fBmmcli\fR [\fIOPTION\fR...] - -.SH DESCRIPTION -ModemManager is a DBus-powered Linux daemon which provides a unified -high level API for communicating with (mobile broadband) modems. It -acts as a standard RIL (Radio Interface Layer) and may be used by -different connection managers, like NetworkManager. Thanks to the -built-in plugin architecture, ModemManager talks to very different -kinds of modems with very different kinds of ports. In addition to the -standard AT serial ports, Qualcomm-based QCDM and QMI ports are also -supported. - -.SH HELP OPTIONS -.TP -.B \-h, \-\-help -Show summary of options by group. -.TP -.B \-\-help\-all -Show all groups and options. -.TP -.B \-\-help\-manager -Show manager specific options. -.TP -.B \-\-help\-common -Show common options. These are used for defining the device an option -operates on. For example, modems, bearers, SIMs, SMS', etc. -.TP -.B \-\-help\-modem -Show modem specific options. -.TP -.B \-\-help\-3gpp -Show 3GPP specific options. -.TP -.B \-\-help\-cdma -Show CDMA specific options. -.TP -.B \-\-help\-simple -Show simple options. These are useful for getting connected or -disconnected and understanding the state of things as fast as possible -without worrying so much about the details. -.TP -.B \-\-help\-location -Show location or positioning specific options. -.TP -.B \-\-help\-messaging -Show messaging specific options. See also \fB\-\-help\-sms\fR which -is related. -.TP -.B \-\-help\-time -Show time specific options. -.TP -.B \-\-help\-firmware -Show firmware specific options. -.TP -.B \-\-help\-oma -Show OMA specific options. -.TP -.B \-\-help\-sim -Show SIM card specific options. -.TP -.B \-\-help\-bearer -Show bearer specific options. -.TP -.B \-\-help\-sms -Show SMS specific options. See also \fB\-\-help\-messaging\fR which -is related. - -.SH MANAGER OPTIONS -.TP -.B \-G, \-\-set\-logging=[ERR|WARN|INFO|DEBUG] -Set the logging level in ModemManager daemon. For debugging information you can supply \fBDEBUG\fR. Each value above \fBDEBUG\fR provides less detail. In most cases \fBERR\fR (for displaying errors) are the important messages. - -The default mode is \fBERR\fR. -.TP -.B \-L, \-\-list\-modems -List available modems. -.TP -.B \-M, \-\-monitor\-modems -List available modems and monitor modems added or removed. -.TP -.B \-S, \-\-scan-modems -Scan for any potential new modems. This is only useful when expecting pure -RS232 modems, as they are not notified automatically by the kernel. - -.SH COMMON OPTIONS -All options below take a \fBPATH\fR or \fBINDEX\fR argument. If no action is -provided, the default information about the modem, bearer, etc. is -shown instead. - -The \fBPATH\fR and \fBINDEX\fR are created automatically when the -modem is plugged in. They can be found using \fBmmcli \-L\fR. This -produces something like (for modems only): - -.RS 7 -Found 1 modems: - /org/freedesktop/ModemManager1/Modem/\fB4\fR -.RE - -In this case, the \fBINDEX\fR is \fB4\fR and the \fBPATH\fR is the entire string above. - -However, for the bearers, SIMs and SMS cases, the \fBPATH\fR is -slightly different. The \fIModem\fR is replaced with the object name -in use, like \fIBearer\fR. For example: - -.RS 7 -/org/freedesktop/ModemManager1/\fIBearer\fR/4 -.RE - -.TP -.B \-m, \-\-modem=[PATH|INDEX] -Specify a modem. -.TP -.B \-b, \-\-bearer=[PATH|INDEX] -Specify a bearer. -.TP -.B \-i, \-\-sim=[PATH|INDEX] -Specify a SIM card. -.TP -.B \-s, \-\-sms=[PATH|INDEX] -Specify an SMS. - -.SH MODEM OPTIONS -All of the modem options below make use of the \fB\-\-modem\fR or -\fB\-m\fR switch to specify the modem to act on. - -Some operations require a \fBMODE\fR. \fBMODE\fR can be any -combination of the modes actually supported by the modem. In the -perfect case, the following are possible: - -.Bd -literal -compact - \fB'2G'\fR - 2G technologies, e.g. EDGE, CDMA1x - \fB'3G'\fR - 3G technologies, e.g. HSPA, EV-DO - \fB'4G'\fR - 4G technologies, e.g. LTE - \fB'ANY'\fR - for all supported modes. -.Ed -.TP -.B \-w, \-\-monitor\-state -Monitor the state of a given modem. -.TP -.B \-e, \-\-enable -Enable a given modem. - -This powers the antenna, starts the automatic registration process and -in general prepares the modem to be connected. -.TP -.B \-d, \-\-disable -Disable a given modem. - -This disconnects the existing connection(s) for the modem and puts it -into a low power mode. -.TP -.B \-r, \-\-reset -Resets the modem to the settings it had when it was power cycled. -.TP -.B \-\-factory\-reset=CODE -Resets the modem to its original factory default settings. - -The \fBCODE\fR provided is vendor specific. Without the correct vendor -code, it's unlikely this operation will succeed. This is not a common -user action. -.TP -.B \-\-command=COMMAND -Send an AT \fBCOMMAND\fR to the given modem. For example, -\fBCOMMAND\fR could be 'AT+GMM' to probe for phone model information. This -operation is only available when ModemManager is run in debug mode. -.TP -.B \-\-list\-bearers -List packet data bearers that are available for the given modem. -.TP -.B \-\-create\-bearer=['KEY1=VALUE1,KEY2=VALUE2,...'] -Create a new packet data bearer for a given modem. The \fBKEY\fRs and -some \fBVALUE\fRs are listed below: -.RS 9 -.TP -\fB'apn'\fR -Access Point Name. Required in 3GPP. -.TP -\fB'ip-type'\fR -Addressing type. Given as a MMBearerIpFamily value (e.g. 'ipv4', 'ipv6', 'ipv4v6'). Optional in 3GPP and CDMA. -.TP -\fB'allowed-auth'\fR -Authentication method to use. Given as a MMBearerAllowedAuth value (e.g. 'none|pap|chap|mschap|mschapv2|eap'). Optional in 3GPP. -.TP -\fB'user'\fR -User name (if any) required by the network. Optional in 3GPP. -.TP -\fB'password'\fR -Password (if any) required by the network. Optional in 3GPP. -.TP -\fB'allow-roaming'\fR -Flag to tell whether connection is allowed during roaming, given as a boolean value (i.e 'yes' or 'no'). Optional in 3GPP. -.TP -\fB'rm-protocol'\fR -Protocol of the Rm interface, given as a MMModemCdmaRmProtocol value (e.g. 'async', 'packet-relay', 'packet-network-ppp', 'packet-network-slip', 'stu-iii'). Optional in CDMA. -.TP -\fB'number'\fR -Telephone number to dial. Required in POTS. -.RE -.TP -.B \-\-delete\-bearer=PATH -Delete bearer from a given modem. This option explicitly uses a -\fBPATH\fR to define the bearer, you can not use an \fBINDEX\fR to be -deleted. -.TP -.B \-\-set\-allowed\-modes=[MODE1|MODE2|...] -Set allowed modes for a given modem. For possible modes, see the -beginning of this section. -.TP -.B \-\-set\-bands=[BAND1|BAND2|...] -Set bands to be used for a given modem. These are frequency ranges -the modem should use. There are quite a number of supported bands and -listing them all here would be quite extensive. For details, see the -MMModemBand documentation. - -An example would be: 'egsm|dcs|pcs|g850' to select all the GSM -frequency bands. -.TP -.B \-\-set\-preferred\-mode=MODE -Set the preferred \fBMODE\fR for the given modem. The \fBMODE\fR -\fIMUST\fR be one of the allowed modes as set with the -\fB\-\-set\-allowed\-modes\fR option. Possible \fBMODE\fR arguments -are detailed at the beginning of this section. - -.SH 3GPP OPTIONS -The 3rd Generation Partnership Project (3GPP) is a collaboration -between groups of telecommunications associations. These options -pertain to devices which support 3GPP. - -Included are options to control USSD (Unstructured Supplementary -Service Data) sessions. - -All of the 3GPP options below make use of the \fB\-\-modem\fR or -\fB\-m\fR switch to specify the modem to act on. -.TP -.B \-\-3gpp\-scan -Scan for available 3GPP networks. -.TP -.B \-\-3gpp\-register\-home -Request a given modem to register in its home network. - -This registers with the default network(s) specified by the modem, -.TP -.B \-\-3gpp\-register\-in\-operator=MCCMNC -Request a given modem to register on the network of the given -\fBMCCMNC\fR (Mobile Country Code, Mobile Network Code) based -operator. This code is used for GSM/LTE, CDMA, iDEN, TETRA and UMTS -public land mobile networks and some satellite mobile networks. The -ITU-T Recommendation E.212 defines mobile country codes. -.TP -.B \-\-3gpp\-ussd\-status -Request the status of \fIANY\fR ongoing USSD session. -.TP -.B \-\-3gpp\-ussd\-initiate=COMMAND -Request the given modem to initiate a USSD session with \fBCOMMAND\fR. - -For example, \fBCOMMAND\fR could be '*101#' to give your current -pre-pay balance. -.TP -.B \-\-3gpp\-ussd\-respond=RESPONSE -When initiating an USSD session, a \fRRESPONSE\fR may be needed by a -network-originated request. This option allows for that. -.TP -.B \-\-3gpp\-ussd\-cancel -Cancel an ongoing USSD session for a given modem. - -.SH CDMA OPTIONS -All CDMA (Code Division Multiple Access) options require the -\fB\-\-modem\fR or \fB\-m\fR option. - -.TP -.B \-\-cdma\-activate=CARRIER -Activate the given modem using OTA (Over the Air) settings. The -\fBCARRIER\fR is a code provided by the network for the default -settings they provide. - -.SH SIMPLE OPTIONS -All simple options must be used with \fB\-\-modem\fR or \fB\-m\fR. - -.TP -.B \-\-simple\-connect=['KEY1=VALUE1,KEY2=VALUE2,...'] -Run a full connection sequence using \fBKEY\fR / \fBVALUE\fR pairs. -You can use the \fB\-\-create\-bearer\fR options, plus any of the -following ones: -.RS 9 -.TP -\fB'pin'\fR -SIM-PIN unlock code. -.TP -\fB'operator-id'\fR -ETSI MCC-MNC of a network to force registration. -.RE -.TP -.B \-\-simple\-disconnect -Disconnect \fIALL\fR connected bearers for a given modem. -.TP -.B \-\-simple\-status -Display the status of the given modem. - -.SH LOCATION OPTIONS -These options detail how to discover your location using Global -Positioning System (GPS) or directly from your mobile network infrastructure -(either 3GPP or 3GPP2). - -All location options must be used with \fB\-\-modem\fR or \fB\-m\fR. - -.TP -.B \-\-location\-status -Show the current status for discovering our location. -.TP -.B \-\-location\-get -Show all location information available. -.TP -.B \-\-location\-enable\-3gpp -Enable location discovery using the 3GPP network. -.TP -.B \-\-location\-disable\-3gpp -Disable location discovery using the 3GPP network. -.TP -.B \-\-location\-get\-3gpp -Show 3GPP based location information (MCC, MNC, LAC, CI). -.TP -.B \-\-location\-enable\-gps\-nmea -Enable location discovery using GPS and reported with NMEA traces. -.TP -.B \-\-location\-disable\-gps\-nmea -Disable location discovery using GPS and NMEA traces. -.TP -.B \-\-location\-get\-gps\-nmea -Show GPS based location with NMEA trace information. -.TP -.B \-\-location\-enable\-gps\-raw -Enable location discovery using GPS and reported with raw (i.e. -longitude/latitude) values. -.TP -.B \-\-location\-disable\-gps\-raw -Disable location discovery using GPS and raw values. -.TP -.B \-\-location\-get\-gps\-raw -Show GPS based location information with raw values (e.g. latitude, longitude). -.TP -.B \-\-location\-enable\-cdma-bs -Enable location discovery using the 3GPP2 network. -.TP -.B \-\-location\-disable\-cdma-bs -Disable location discovery using the 3GPP2 network. -.TP -.B \-\-location\-get\-cdma-bs -Show 3GPP2 based location information (location of the CDMA base station). -.TP -.B \-\-location\-enable\-gps\-unmanaged -Enable location discovery using GPS but without taking control of the NMEA tty -port. -.TP -.B \-\-location\-disable\-gps\-unmanaged -Disable location discovery using GPS and unmanaged port. - -.SH MESSAGING OPTIONS -All messaging options must be used with \fB\-\-modem\fR or \fB\-m\fR. - -.TP -.B \-\-messaging\-status -Show the status of the messaging support. -.TP -.B \-\-messaging\-list-sms -List SMS messages available on a given modem. -.TP -.B \-\-messaging\-create-sms=['KEY1=VALUE1,...'] -Create a new SMS on a given modem. \fBKEY\fRs can be any of the following: -.RS 9 -.TP -\fB'number'\fR - Number to which the message is addressed. -.TP -\fB'text'\fR -Message text, in UTF-8. When sending, if the text is larger than the -limit of the technology or modem, the message will be broken into -multiple parts or messages. Note that text and data are never given at -the same time. -.TP -\fB'smsc'\fR -Indicates the SMS service center number. -.TP -\fB'validity'\fR -Specifies when the SMS expires in the SMSC. -.TP -\fB'class'\fR -3GPP message class (0..3). -.TP -\fB'delivery-report-request'\fR -Specifies whether delivery report is requested when sending the SMS -('yes' or 'no') -.TP -\fB'storage'\fR -Specifies the storage where this message is kept. Storages may -be 'sm', 'me', 'mt', 'sr', 'bm', 'ta'. -.RE -.TP -.B \-\-messaging\-create-sms-with-data=PATH -Use \fBPATH\fR to a filename as the data to create a new SMS. -.TP -.B \-\-messaging\-delete-sms=PATH -Delete an SMS from a given modem. \fBPATH\fR indicates the SMS path. - -.SH TIME OPTIONS -All time operations require the \fB\-\-modem\fR or \fB\-m\fR option. - -.TP -.B \-\-time -Display the current network time from the operator. This includes the -timezone which is usually of importance. - -.SH FIRMWARE OPTIONS -All firmware options require the \fB\-\-modem\fR or \fB\-m\fR option. - -.TP -.B \-\-firmware\-list -List all the firmware images installed on a given modem. -.TP -.B \-\-firmware\-select=ID -Select a firmware image from those installed on a given modem. A list -of available firmware images can be seen using the -\fB\-\-firmware\-list\fR option. - -The \fBID\fR provided is a \fIUNIQUE\fR identifier for the firmware. - -.SH OMA OPTIONS -All OMA options require the \fB\-\-modem\fR or \fB\-m\fR option. - -.TP -.B \-\-oma\-status -Show the status of the OMA device management subsystem. -.TP -.B \-\-oma\-start\-client\-initiated\-session=[SESSION TYPE] -Request to start a client initiated session. - -The given session type must be one of: - 'client\-initiated\-device\-configure' - 'client\-initiated\-prl\-update' - 'client\-initiated\-hands\-free\-activation' -.TP -.B \-\-oma\-accept\-network\-initiated\-session=[SESSION ID] -Request to accept a network initiated session. -.TP -.B \-\-oma\-reject\-network\-initiated\-session=[SESSION ID] -Request to reject a network initiated session. -.TP -.B \-\-oma\-cancel\-session -Request to cancel current OMA session, if any. - -.SH SIM OPTIONS -.TP -.B \-\-pin=PIN -Send \fBPIN\fR code to a given SIM card. -.TP -.B \-\-puk=PUK -Send \fBPUK\fR code to a given SIM card. This must be used \fIWITH\fR -\fB\-\-pin\fR. -.TP -.B \-\-enable\-pin -Enable PIN request for a given SIM card. This must be used \fIWITH\fR -\fB\-\-pin\fR. -.TP -.B \-\-disable\-pin -Disable PIN request for a given SIM card. This must be used \fIWITH\fR -\fB\-\-pin\fR. -.TP -.B \-\-change\-pin=PIN -Change the PIN for a given SIM card. It will be set to \fBPIN\fR. This -must be used \fIWITH\fR \fB\-\-pin\fR to supply the old PIN number. - -.SH BEARER OPTIONS -All bearer options require the \fB\-\-bearer\fR or \fB\-b\fR option. - -.TP -.B \-c, \-\-connect -Connect to a given bearer. -.TP -.B \-x, \-\-disconnect -Disconnect from a given bearer. - -.SH SMS OPTIONS -All SMS options require the \fB\-\-sms\fR or \fB\-s\fR option. - -.TP -.B \-\-send -Send an SMS. -.TP -.B \-\-store -This option will store the SMS in the default storage defined by the -modem, which may be either modem-memory or SMS-memory. To know what -the existing default storage is, see the \fB\-\-messaging\-status\fR -option. - -.TP -.B \-\-store\-in\-storage=STORAGE -This option states which \fBSTORAGE\fR to use for SMS messages. -Possible values for \fBSTORAGE\fR include: -.RS 9 -.TP -\fB'sm'\fR -SIM card storage area. -.TP -\fB'me'\fR -Mobile equipment storage area. -.TP -\fB'mt'\fR -Sum of SIM and Mobile equipment storages -.TP -\fB'sr'\fR -Status report message storage area. -.TP -\fB'bm'\fR -Broadcast message storage area. -.TP -\fB'ta'\fR -Terminal adaptor message storage area. -.RE -.TP -.B \-\-create\-file\-with\-data\=PATH -This option takes an SMS that has \fIDATA\fR (not \fITEXT\fR) and will -create a local file described by \fBPATH\fR and store the content of -the SMS there. - -.SH APPLICATION OPTIONS -.TP -.B \-v, \-\-verbose -Perform actions with more details reported and/or logged. -.TP -.B \-V, \-\-version -Returns the version of this program. -.TP -.B \-a, \-\-async -Use asynchronous methods. This is purely a development tool and has no -practical benefit to most user operations. -.TP -.B \-\-timeout=SECONDS -Use \fBSECONDS\fR for the timeout when performing operations with this -command. This option is useful when executing long running operations, like -\-\-3gpp\-scan. - -.SH EXAMPLES -.SS Send the PIN to the SIM card - -You'll need first to know which the proper path/index is for the SIM in your -modem: -.Bd -literal -compact - $ mmcli -m 0 | grep SIM - SIM | path: '/org/freedesktop/ModemManager1/SIM/0' -.Ed - -And after that, you can just use the SIM index: -.Bd -literal -compact - $ mmcli -i 0 --pin=1234 - successfully sent PIN code to the SIM -.Ed - -.SS Simple connect and disconnect - -You can launch the simple connection process like: -.Bd -literal -compact - $ mmcli -m 0 --simple-connect="pin=1234,apn=internet" - successfully connected the modem -.Ed - -Then, you can disconnect it like: -.Bd -literal -compact - $ mmcli -m 0 --simple-disconnect - successfully disconnected all bearers in the modem -.Ed - -.SS 3GPP network scan - -Scanning for 3GPP networks may really take a long time, so a specific timeout -must be given: -.Bd -literal -compact - $ mmcli -m 0 --3gpp-scan --timeout=300 - - Found 4 networks: - 21404 - Yoigo (umts, available) - 21407 - Movistar (umts, current) - 21401 - vodafone ES (umts, forbidden) - 21403 - Orange (umts, forbidden) -.Ed - -.SS Creating a new SMS message & storing it - -Using the “sm” (SIM), you can do this using: - -.Bd -literal -compact - $ mmcli -m 0 --messaging-create-sms="text='Hello world',number='+1234567890'" - Successfully created new SMS: - /org/freedesktop/ModemManager1/SMS/21 (unknown) - - $ sudo mmcli -s 21 --store-in-storage="sm" - successfully stored the SMS - - $ sudo mmcli -s 21 - SMS '/org/freedesktop/ModemManager1/SMS/21' - ----------------------------------- - Content | number: '+1234567890' - | text: 'Hello world' - ----------------------------------- - Properties | PDU type: 'submit' - | state: 'stored' - | smsc: 'unknown' - | validity: '0' - | class: '0' - | storage: 'sm' - | delivery report: 'not requested' - | message reference: '0' - - $ sudo mmcli -m 0 --messaging-status - /org/freedesktop/ModemManager1/Modem/0 - ---------------------------- - Messaging | supported storages: 'sm, me' - | default storage: 'me' -.Ed - -.SS Sending SMS messages from files - -As you can see below, the important part is the -\fB\-\-messaging\-create\-sms\-with\-data\fR and the \fBPATH\fR provided. - -.Bd -literal -compact - $ sudo mmcli -m 0 \\ - --messaging-create-sms="number='+1234567890'" \\ - --messaging-create-sms-with-data=/path/to/your/file - Successfully created new SMS: - /org/freedesktop/ModemManager1/SMS/22 (unknown) - - $ sudo mmcli -s 22 --send - successfully sent the SMS -.Ed - -.SS Listing SMS messages - -When the receiver gets all the parts of the message, they can now -recover the sent file with another \fBmmcli\fR command in their -ModemManager setup: - -.Bd -literal -compact - $> sudo mmcli -m 0 --messaging-list-sms - Found 1 SMS messages: - /org/freedesktop/ModemManager1/SMS/0 (received) - - $> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file -.Ed - -.SS GPS location status - -You first need to check whether the modem has GPS-specific location -capabilities. Note that we’ll assume the modem is exposed as index 0; -if you have more than one modem, just use --list-modems to check the -proper modem index: - -.Bd -literal -compact - $ mmcli -m 0 --location-status - /org/freedesktop/ModemManager1/Modem/0 - ---------------------------- - Location | capabilities: '3gpp-lac-ci, gps-raw, gps-nmea' - | enabled: 'none' - | signals: 'no' -.Ed - -The output says that the modem supports 3GPP Location area code/Cell -ID, GPS raw and GPS-NMEA location sources. None is enabled yet, as we -didn’t enable the modem, which we can do issuing: - -.Bd -literal -compact - $ sudo mmcli -m 0 --enable - successfully enabled the modem - - $ mmcli -m 0 --location-status - /org/freedesktop/ModemManager1/Modem/0 - ---------------------------- - Location | capabilities: '3gpp-lac-ci, gps-raw, gps-nmea' - | enabled: '3gpp-lac-ci' - | signals: 'no' -.Ed - -.SS GPS location technology enabling - -We can enable the RAW and NMEA GPS location sources using: - -.Bd -literal -compact - $ sudo mmcli -m 0 \\ - --location-enable-gps-raw \\ - --location-enable-gps-nmea - successfully setup location gathering -.Ed - -If we do check again the status, we’ll see the GPS-specific locations are enabled: - -.Bd -literal -compact - $ mmcli -m 0 --location-status - /org/freedesktop/ModemManager1/Modem/0 - ---------------------------- - Location | capabilities: '3gpp-lac-ci, gps-raw, gps-nmea' - | enabled: '3gpp-lac-ci, gps-raw, gps-nmea' - | signals: 'no' -.Ed - -.SS GPS location retrieval - -You can query location source specific information with -\fB\-\-location\-get\-3gpp\fR, \fB\-\-location\-get\-gps\-nmea\fR and -\fB\-\-location\-get\-gps\-raw\fR; but also for all at the same time: - -.Bd -literal -compact - $ sudo mmcli -m 0 --location-get - /org/freedesktop/ModemManager1/Modem/0 - ------------------------- - 3GPP location | Mobile country code: '214' - | Mobile network code: '3' - | Location area code: '21071' - | Cell ID: '7033737' - ------------------------- - GPS NMEA traces | $GPGGA,,,,,,0,,,,,,,,*66 - | $GPRMC,,V,,,,,,,,,,N*53 - | $GPGSA,A,1,,,,,,,,,,,,,,,*1E - | $GPGSV,4,1,16,24,,,,29,,,,05,,,,18,,,*7A - | $GPGSV,4,2,16,22,,,,14,,,,11,,,,17,,,*7B - | $GPGSV,4,3,16,03,,,,12,,,,30,,,,13,,,*78 - | $GPGSV,4,4,16,23,,,,15,,,,27,,,,07,,,*79 - | $GPVTG,,T,,M,,N,,K,N*2C - ------------------------- - Raw GPS | Not available - ------------------------- - CDMA BS | Not available -.Ed - -An example of RAW GPS location information: - -.Bd -literal -compact - $ sudo mmcli -m 0 --location-get-gps-raw - /org/freedesktop/ModemManager1/Modem/0 - ------------------------- - Raw GPS | UTC time: '155142.2' - | Longitude: '-3.513941' - | Latitude: '40.502603' - | Altitude: '18.000000' -.Ed - -.SH AUTHOR -Martyn Russell - -.SH SEE ALSO -\fBModemManager\fR(8), \fBNetworkManager\fR(8) - -AT (http://en.wikipedia.org/wiki/AT_commands). - -3GPP (http://en.wikipedia.org/wiki/3GPP). - -MCCMNC (http://en.wikipedia.org/wiki/Mobile_Network_Code). - -USSD (http://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data). - -CDMA (http://en.wikipedia.org/wiki/Code_division_multiple_access). - -OTA (http://en.wikipedia.org/wiki/Over-the-air_programming). - -GPS (http://en.wikipedia.org/wiki/Global_Positioning_System) - -NMEA (http://en.wikipedia.org/wiki/NMEA_0183) diff -Nru modemmanager-1.6.8/docs/man/ModemManager.8 modemmanager-1.10.0/docs/man/ModemManager.8 --- modemmanager-1.6.8/docs/man/ModemManager.8 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/docs/man/ModemManager.8 2018-11-15 09:55:53.000000000 +0100 @@ -19,26 +19,45 @@ ModemManager is a DBus-based system daemon and is not meant to be used directly from the command line. -.SH HELP OPTIONS +.SH APPLICATION OPTIONS .TP -.B \-V, \-\-version -Print the ModemManager software version and exit. +.B \-\-filter\-policy= +Specify which ports are probed and how: +.RS 9 .TP -.B \-h, \-\-help -Show application options. +\fB'WHITELIST-ONLY'\fR +Only devices or ports explicitly whitelisted with the 'ID_MM_DEVICE_PROCESS' udev tag are probed. .TP -.B \-\-help\-all -Show application and test options. +\fB'DEFAULT'\fR +All ports are allowed to be probed except for the ones explicitly greylisted as RS232 adapters or completely blacklisted. +.TP +\fB'STRICT'\fR +Only the TTY ports that are heurstically determined to be very likely to be modem ports are probed. Nay end up ignoring some devices. +.TP +\fB'PARANOID'\fR +This is equivalent to running the STRICT mode but also applying the blacklist and RS232 greylist filters explicitly. +.RE +.TP +.B \-\-no\-auto\-scan +Fully disable udev-based auto-scan looking for devices. +.TP +.B \-\-initial\-kernel\-events= +Specify location of the file where the list of initial kernel events is +available. The ModemManager daemon will process this file on startup. .TP -.B \-\-help\-test -Show test options. - -.SH APPLICATION OPTIONS .B \-\-debug Runs ModemManager with "DEBUG" log level and without daemonizing. This is useful for debugging, as it directs log output to the controlling terminal in addition to syslog. .TP +.B \-V, \-\-version +Print the ModemManager software version and exit. +.TP +.B \-h, \-\-help +Show application options. + +.SH LOGGING OPTIONS +.TP .B \-\-log\-level= Sets how much information ModemManager sends to the log destination (usually syslog's "daemon" facility). By default, only informational, warning, and error @@ -48,10 +67,13 @@ Specify location of the file where ModemManager will dump its log messages, instead of syslog. .TP -.B \-\-timestamps +.B \-\-log\-journal +Output log message to the systemd journal. +.TP +.B \-\-log\-timestamps Include absolute timestamps in the log output. .TP -.B \-\-relative-timestamps +.B \-\-log\-relative\-timestamps Include timestamps, relative to the start time of the daemon, in the log output. .SH TEST OPTIONS @@ -59,9 +81,6 @@ .B \-\-test\-session Run the ModemManager daemon in the Session bus instead of the System bus. .TP -.B \-\-test\-no\-auto\-scan -Fully disable udev-based auto-scan looking for devices. -.TP .B \-\-test\-enable Enable the Test DBus interface in the daemon. .TP @@ -72,4 +91,4 @@ Aleksander Morgado .SH SEE ALSO -\fBmmcli\fR(8), \fBNetworkManager\fR(8) +\fBmmcli\fR(1), \fBNetworkManager\fR(8) diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch02s02.html modemmanager-1.10.0/docs/reference/api/html/ch02s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch02s02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch02s02.html 2019-01-17 16:22:34.000000000 +0100 @@ -2,516 +2,40 @@ -Probing: ModemManager Reference Manual - +Builds without udev support: ModemManager Reference Manual + - - - - + + + + - - - + + +

-Probing

+Builds without udev support

- Whenever a new device is detected by ModemManager, port probing process will - get started, so that we can determine which kind of ports we have, and also - which plugin we need to use for the specific device. Devices may expose one or - more ports, and all of them will follow the same probing logic. + When the udev daemon isn't available in the system, the + ReportKernelEvent + method in the + Manager interface + may be used to notify the ModemManager daemons of device addition and removals.

- The whole probing process, including pre-probing and post-probing filters, is - implemented in the core ModemManager daemon. Plugins will just configure their - own special needs in the probing process, so that only the steps required by the - given plugin are executed. For example, plugins which do not support RS232 - devices will not need AT-based vendor or product filters. + When udev support is disabled in the build, the ID_MM_CANDIDATE + tag and manual scan requests are still applicable. ModemManager has a built-in parser + of udev rule files that is enabled when udev itself isn't available.

-
-

-Pre-probing filters

-

- Pre-probing filters are those which control whether the probing, as - requested by the specific plugin, takes place. -

-
    -
  • -

    Allowed vendor IDs

    -

    - Plugins can provide a list of udev-reported vendor IDs to be used as - pre-probing filters. If the vendor ID reported by the device via udev - is found in the list provided by the plugin, port probing will be - launched as requested by the given plugin. -

    -

    - This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_IDS - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Product IDs

    -

    - Plugins can provide a list of udev-reported pairs of vendor and product - IDs to be used as pre-probing filters. -

    -

    - If the vendor ID and product ID pair reported by the device via udev is - found in the list of 'allowed' pairs provided by the plugin, port probing - will be launched as requested by the given plugin. This additional filter - should be used when the plugin is expected to work only with a given - specific product of a given vendor. -

    -

    - If the vendor ID and product ID pair reported by the device via udev is - found in the list of 'forbidden' pairs provided by the plugin, port probing - will not be launched by this plugin. This additional filter - should be used when the plugin supports all devices of a given vendor - except for some specific ones. -

    -

    - These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_IDS - and MM_PLUGIN_FORBIDDEN_PRODUCT_IDS properties in the - MMPlugin object provided by the plugin. -

    -
  • -
  • -

    Subsystems

    -

    - Plugins can specify which subsystems they expect, so that we filter out - any port detected with a subsystem not listed by the plugin. -

    -

    - This filter is specified by the MM_PLUGIN_ALLOWED_SUBSYSTEMS - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Drivers

    -

    - Plugins can specify which drivers they expect, so that we filter out - any port detected being managed by a driver not listed by the plugin. -

    -

    - Plugins can also specify which drivers they do not expect, so that we - filter out any port detected being managed by a driver listed by the plugin. -

    -

    - These filters are specified by the MM_PLUGIN_ALLOWED_DRIVERS - and MM_PLUGIN_FORBIDDEN_DRIVERS properties in the - MMPlugin object provided by the plugin. -

    -
  • -
  • -

    udev tags

    -

    - Plugins can provide a list of udev tags, so that we filter out - any port detected which doesn't expose any of the given tags. -

    -

    - This filter is specified by the MM_PLUGIN_ALLOWED_UDEV_TAGS - property in the MMPlugin object provided - by the plugin. -

    -
  • -
-
-
-

-Probing sequence

-

- Whenever all pre-probing filters of a given plugin pass, ModemManager will run - the probing sequence as requested by the specific plugin. The main purpose of the - probing sequence step is to determine the type of port being probed, and also - prepare the information required in any expected post-probing filter. -

-
    -
  • -

    Custom initialization

    -

    - This property allows plugins to provide an asynchronous method which will get - executed as soon as the AT port gets opened. This method may be used for any - purpose, like running an early command in the ports as soon as possible, or - querying the modem for info about the port layout. -

    -

    - This configuration is specified by the MM_PLUGIN_CUSTOM_INIT - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    AT allowed

    -

    - This boolean property allows plugins to specify that they expect and support - AT serial ports. -

    -

    - This configuration is specified by the MM_PLUGIN_ALLOWED_AT - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Single AT expected

    -

    - This boolean property allows plugins to specify that they only expect and support - one AT serial port. Whenever the first AT port is grabbed, any remaining AT probing - in ports of the same device will get cancelled. -

    -

    - This configuration is specified by the MM_PLUGIN_ALLOWED_SINGLE_AT - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Custom AT probing

    -

    - This property allows plugins to specify custom commands to check whether a port - is AT or not. By default, the 'AT' command will be used if no custom one specified. -

    -

    - This configuration is specified by the MM_PLUGIN_CUSTOM_AT_PROBE - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    QCDM allowed

    -

    - This boolean property allows plugins to specify that they expect and support - QCDM serial ports. -

    -

    - This configuration is specified by the MM_PLUGIN_ALLOWED_QCDM - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Check Icera support

    -

    - This boolean property allows plugins to specify that they want to have the Icera - support checks included in the probing sequence. They can afterwards get the result - of the support check to decide whether they want to create a Icera-based modem - object or not. -

    -

    - This configuration is specified by the MM_PLUGIN_ICERA_PROBE - property in the MMPlugin object provided - by the plugin. -

    -
  • -
-
-
-

-Post-probing filters

-

- Post-probing filters are required to identify whether a plugin can handle a given - modem, in special cases where the information retrieved from udev is either not - enough or wrong. This covers, for example, RS232 modems connected through a RS232 - to USB converter, where udev-reported vendor ID is that of the converter, not the - one of the modem. -

-
    -
  • -

    Allowed vendor strings

    -

    - Plugins can provide a list of vendor strings to be used as post-probing - filters. If the vendor string reported by the device via AT commands - is found in the list provided by the plugin, the plugin will report that - it can handle this modem. -

    -

    - This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_STRINGS - property in the MMPlugin object provided - by the plugin. -

    -
  • -
  • -

    Product strings

    -

    - Plugins can provide a list of pairs of vendor and product - strings to be used as post-probing filters. -

    -

    - If the vendor and product string pair reported by the device via AT - commands is found in the 'allowed' list provided by the plugin, the - plugin will report that it can handle this modem. This additional filter - should be used when the plugin is expected to work only with a given - specific product of a given vendor. -

    -

    - If the vendor and product string pair reported by the device via AT - commands is found in the 'forbidden list provided by the plugin, the - plugin will report that it cannot handle this modem. This additional filter - should be used when the plugin supports all devices of a given vendor, except for some specific ones. -

    -

    - These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_STRINGS - and MM_PLUGIN_FORBIDDEN_PRODUCT_STRINGS properties in the - MMPlugin object provided by the plugin. -

    -
  • -
  • -

    Icera support

    -

    - Plugins can specify that they only support Icera-based modems, or that they - do not support any Icera-based modem. When either of this configurations is - enabled, the Icera support checks will be included in the - probing sequence, and the result of the check will help to determine whether - the plugin supports the modem or not. -

    -

    - This filter is specified by the MM_PLUGIN_ALLOWED_ICERA and - MM_PLUGIN_FORBIDDEN_ICERA properties in the - MMPlugin object provided by the plugin. -

    -
  • -
-

- Plugins which require post-probing filters will always be sorted last, and - therefore they will be the last ones being checked for pre-probing filters. This - is due to the fact that we need to assume that these plugins aren't able to - determine port support just with pre-probing filters, as we want to avoid - unnecessary probing sequences launched. Also note that the Generic plugin is - anyway always the last one in the list. -

-
-
-

-Probing setup examples

-
-

Example 1. Probing setup for a plugin requiring udev-based vendor/product checks

-
- - - - - - - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
G_MODULE_EXPORT MMPlugin *
-mm_plugin_create (void)
-{
-    static const gchar *subsystems[] = { "tty", NULL };
-    static const guint16 vendor_ids[] = { 0xabcd, 0 };
-    static const mm_uint16_pair product_ids[] = {
-        { 0x1234, 0xffff }
-    };
-    static const gchar *vendor_strings[] = { "vendor", NULL };
-
-    return MM_PLUGIN (
-        g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
-                      MM_PLUGIN_NAME, "Example",
-
-                      /* Next items are pre-probing filters */
-                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
-                      MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
-                      MM_PLUGIN_ALLOWED_PRODUCT_IDS, product_ids,
-
-                      /* Next items are probing sequence setup */
-                      MM_PLUGIN_ALLOWED_AT, TRUE,
-
-                      /* No post-probing filters */
-                      NULL));
-}
-
- -
-
-

Example 2. Probing setup for a plugin requiring AT-probed vendor/product checks

-
- - - - - - - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
G_MODULE_EXPORT MMPlugin *
-mm_plugin_create (void)
-{
-    static const gchar *subsystems[] = { "tty", NULL };
-    static const gchar *vendor_strings[] = { "vendor", NULL };
-    static const mm_str_pair product_strings[] = { "another-vendor", "product xyz" };
-
-    return MM_PLUGIN (
-        g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
-                      MM_PLUGIN_NAME, "Example",
-
-                      /* Next items are pre-probing filters */
-                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
-
-                      /* Next items are probing sequence setup */
-                      MM_PLUGIN_ALLOWED_AT, TRUE,
-
-                      /* Next items are post-probing filters */
-                      MM_PLUGIN_VENDOR_STRINGS, vendor_strings,
-                      MM_PLUGIN_PRODUCT_STRINGS, product_strings,
-                      NULL));
-}
-
- -
-
-

Example 3. Probing setup for a plugin with custom initialization requirements

-
- - - - - - - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
static gboolean
-parse_custom_at (const gchar *response,
-                 const GError *error,
-                 GValue *result,
-                 GError **result_error)
-{
-    if (error) {
-        *result_error = g_error_copy (error);
-        return FALSE;
-    }
-
-    /* Otherwise, done. And also report that it's an AT port. */
-    g_value_init (result, G_TYPE_BOOLEAN);
-    g_value_set_boolean (result, TRUE);
-    return TRUE;
-}
-
-static const MMPortProbeAtCommand custom_at_probe[] = {
-    { "AT+SOMETHING", parse_custom_at },
-    { NULL }
-};
-
-G_MODULE_EXPORT MMPlugin *
-mm_plugin_create (void)
-{
-    static const gchar *subsystems[] = { "tty", NULL };
-    static const guint16 vendor_ids[] = { 0xabcd, 0 };
-
-    return MM_PLUGIN (
-        g_object_new (MM_TYPE_PLUGIN_EXAMPLE,
-                      MM_PLUGIN_NAME, "Example",
-
-                      /* Next items are pre-probing filters */
-                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
-                      MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
-
-                      /* Next items are probing sequence setup */
-                      MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe,
-                      MM_PLUGIN_ALLOWED_AT,      TRUE,
-
-                      /* No post-probing filters */
-                      NULL));
-}
-
- -
-
-
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch02s03.html modemmanager-1.10.0/docs/reference/api/html/ch02s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch02s03.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch02s03.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ - - - - -Port grabbing and Modem object creation: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Port grabbing and Modem object creation

-

- Once a port passes all probing filters of a given plugin, the plugin will grab - the port. When the first port of a given device is grabbed, the plugin will create - the required Modem object. -

-

- While preparing to get the Modem object grab the specific port probed, udev-based - port type hints can be used to specify AT port flags (e.g. if a port is to be - considered primary, secondary or for PPP). -

-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch03s02.html modemmanager-1.10.0/docs/reference/api/html/ch03s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch03s02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch03s02.html 2019-01-17 16:22:34.000000000 +0100 @@ -2,81 +2,155 @@ -Enabling: ModemManager Reference Manual - +Filter policies: ModemManager Reference Manual + - - - - + + + + - - - + + +

-Enabling

+Filter policies

- Modem enabling is the user-requested sequence with the sole purpose of bringing - the modem to a state where it can get connected. -

-

- As with the initialization sequence, the global enabling sequence is itself - splitted into N per-interface enabling steps (being N the number of interfaces - exported by the modem). Those interfaces implemented by the object but not - supported by the modem will not be enabled. -

+ The predefined filter policies are: +

  • -

    Modem interface enabling

    +

    Whitelist only

    +

    + This is a policy where only the MM_FILTER_RULE_EXPLICIT_WHITELIST rule is enabled. +

    +
    # /usr/sbin/ModemManager --filter-policy=WHITELIST-ONLY
    +
  • +
  • +

    Default

    +

    + This is a policy where the following rules are enabled: +

    +
      +
    • MM_FILTER_RULE_EXPLICIT_WHITELIST
    • +
    • MM_FILTER_RULE_VIRTUAL
    • +
    • MM_FILTER_RULE_NET
    • +
    • MM_FILTER_RULE_CDC_WDM
    • +
    • MM_FILTER_RULE_TTY
    • +
    • MM_FILTER_RULE_TTY_BLACKLIST
    • +
    • MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY
    • +
    • MM_FILTER_RULE_TTY_PLATFORM_DRIVER
    • +
    • MM_FILTER_RULE_TTY_DEFAULT_ALLOWED
    • +
    +

    +

    - The sequence to enable the - Modem interface - takes care of different important steps, such as powering up the - radio interface or configuring the best charset - to use. -

    + This policy is the default one when a different one not explicitly + selected, and is equivalent to the way ModemManager has worked in previous + releases. This policy is the least restrictive one, and will end up + allowing port probing of all TTYs not explicitly blacklisted in one way + or another. +

    +
    # /usr/sbin/ModemManager --filter-policy=DEFAULT
  • -

    3GPP interface enabling

    +

    Strict

    - Modems with 3GPP capabilities will enable the - 3GPP interface - as part of the global enabling sequence. This sequence involves setting up the - automatic registration of the device in the network, as well - as configuring 3GPP specific indicators and unsolicited message - handlers. -

    + This is a policy where the following rules are enabled: +

    +
      +
    • MM_FILTER_RULE_EXPLICIT_WHITELIST
    • +
    • MM_FILTER_RULE_VIRTUAL
    • +
    • MM_FILTER_RULE_NET
    • +
    • MM_FILTER_RULE_CDC_WDM
    • +
    • MM_FILTER_RULE_TTY
    • +
    • MM_FILTER_RULE_TTY_PLATFORM_DRIVER
    • +
    • MM_FILTER_RULE_TTY_DRIVER
    • +
    • MM_FILTER_RULE_TTY_ACM_INTERFACE
    • +
    • MM_FILTER_RULE_TTY_WITH_NET
    • +
    • MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN
    • +
    +

    +

    +

    + This policy is stricter than the default one, as by default all TTYs are + forbidden except for the ones explicitly allowed by one of the TTY-specific + rules. Distributions or users should use this policy if they don't want + ModemManager to mess around with TTY ports that may not be exposed by + actual modems. +

    +
    # /usr/sbin/ModemManager --filter-policy=STRICT
  • -

    CDMA interface enabling

    +

    Paranoid

    +

    + This policy is a mix of the Default and Strict ones: +

    +
      +
    • MM_FILTER_RULE_EXPLICIT_WHITELIST
    • +
    • MM_FILTER_RULE_VIRTUAL
    • +
    • MM_FILTER_RULE_NET
    • +
    • MM_FILTER_RULE_CDC_WDM
    • +
    • MM_FILTER_RULE_TTY
    • +
    • MM_FILTER_RULE_TTY_BLACKLIST
    • +
    • MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY
    • +
    • MM_FILTER_RULE_TTY_PLATFORM_DRIVER
    • +
    • MM_FILTER_RULE_TTY_DRIVER
    • +
    • MM_FILTER_RULE_TTY_ACM_INTERFACE
    • +
    • MM_FILTER_RULE_TTY_WITH_NET
    • +
    • MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN
    • +

    - Modems with CDMA capabilities will enable the - CDMA interface - as part of the global enabling sequence. This sequence involves setting up the - periodic checks of registration in the CDMA network. -

    +

    +

    + This policy is equivalent to the Strict policy, but where the ModemManager + provided blacklist and manual scan only greylist are also used. It is not + recommended to use this option in normal setups as the blacklists may be + obsoleted in future ModemManager versions (in favor of using the Strict + policy as default). +

    +
    # /usr/sbin/ModemManager --filter-policy=PARANOID
  • -

    Additional feature-specific interface enablings

    +

    Custom

    +

    + Any of the previously defined predefined policies may be modified rule per rule + by explicitly enabling or disabling rules via environment variables. +

    +

    + E.g. this would launch ModemManager with the Default filter policy but with all + net and cdc-wdm ports forbidden completely: +

    +
    +# MM_FILTER_RULE_NET=0 \
    +  MM_FILTER_RULE_CDC_WDM=0 \
    +  /usr/sbin/ModemManager --filter-policy=DEFAULT
    +

    +

    +

    + E.g. this would launch ModemManager with the Whitelist-only filter policy but also + explicitly allowing all net and cdc-wdm ports. Note that in this case, all virtual + net ports (e.g. 'lo') are also being allowed. +

    +
    +# MM_FILTER_RULE_NET=1 \
    +  MM_FILTER_RULE_CDC_WDM=1 \
    +  /usr/sbin/ModemManager --filter-policy=WHITELIST-ONLY

    - Each feature-specific interface will have its own enabling sequence, with operations - which are directly related to the purpose of the interface. For example, enabling the - Location - interface will involve setting up the initial location information; and enabling the - Messaging - interface will involve loading the initial list of SMS available in the SIM or Modem. -

    +

+

+

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch03s03.html modemmanager-1.10.0/docs/reference/api/html/ch03s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch03s03.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch03s03.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ - - - - -Connection & disconnection: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Connection & disconnection

-

- Connecting the Modem is done through the Bearer objects. Once such an - object is created, the user can request to get the given bearer connected. -

-

- Broadband Modems will usually create Broadband Bearers. This kind of bearers can run either - the CDMA connection sequence (if the modem has CDMA capabilities) or the 3GPP connection - sequence (if the modem has 3GPP capabilities). For the special case of mixed 3GPP+CDMA - modems, it is assumed that the plugin implementation needs to decide how the connection gets - done. By default, anyway, the 3GPP sequence is used in this case. -

-

- Modems which are both LTE (3GPP) and CDMA can hand over from LTE to CDMA transparently and - automatically when no LTE network is available, even keeping the same IP address. When this - happens, the modem will get notified about the access technology change, and ModemManager - will update that information. -

-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch03s04.html modemmanager-1.10.0/docs/reference/api/html/ch03s04.html --- modemmanager-1.6.8/docs/reference/api/html/ch03s04.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch03s04.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,86 +0,0 @@ - - - - -Disabling: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Disabling

-

- Users can disable the modems, which will bring them to a state where they are in low power - mode (e.g. RF switched off) and not registered in any network. -

-

- As with the initialization or enabling sequences, the global disabling sequence is itself - splitted into N per-interface disabling steps (being N the number of interfaces - exported by the modem). Those interfaces implemented by the object but not - supported by the modem will not be disabled. -

-

- The global disabling sequence will go on disabling the interfaces one by one, but - starting with the interface which was last enabled during the enabling sequence, and - backwards. This ensures that the - Modem interface - gets disabled last. -

-
    -
  • -

    Additional feature-specific interface disablings

    -

    - Each feature-specific interface will have its own disabling sequence, with operations - which are directly related to the purpose of the interface. For example, disabling the - Location - interface will involve shutting down the location gathering; and disabling the - Messaging - interface will involve unexporting all SMS objects from DBus. -

    -
  • -
  • -

    CDMA interface disabling

    -

    - Modems with CDMA capabilities will disable the - CDMA interface - as part of the global disabling sequence. This sequence involves cancelling the - periodic checks of registration in the CDMA network. -

    -
  • -
  • -

    3GPP interface disabling

    -

    - Modems with 3GPP capabilities will disable the - 3GPP interface - as part of the global disabling sequence. This sequence involves, among other things, - cleaning up 3GPP specific indicators and unsolicited message handlers. -

    -
  • -
  • -

    Modem interface disabling

    -

    - The sequence to disable the - Modem interface - takes care of different important steps, such as powering down the - radio interface. -

    -
  • -
-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch04s02.html modemmanager-1.10.0/docs/reference/api/html/ch04s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch04s02.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch04s02.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,114 @@ + + + + +Probing sequence: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Probing sequence

+

+ Whenever all pre-probing filters of a given plugin pass, ModemManager will run + the probing sequence as requested by the specific plugin. The main purpose of the + probing sequence step is to determine the type of port being probed, and also + prepare the information required in any expected post-probing filter. +

+
    +
  • +

    Custom initialization

    +

    + This property allows plugins to provide an asynchronous method which will get + executed as soon as the AT port gets opened. This method may be used for any + purpose, like running an early command in the ports as soon as possible, or + querying the modem for info about the port layout. +

    +

    + This configuration is specified by the MM_PLUGIN_CUSTOM_INIT + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    AT allowed

    +

    + This boolean property allows plugins to specify that they expect and support + AT serial ports. +

    +

    + This configuration is specified by the MM_PLUGIN_ALLOWED_AT + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Single AT expected

    +

    + This boolean property allows plugins to specify that they only expect and support + one AT serial port. Whenever the first AT port is grabbed, any remaining AT probing + in ports of the same device will get cancelled. +

    +

    + This configuration is specified by the MM_PLUGIN_ALLOWED_SINGLE_AT + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Custom AT probing

    +

    + This property allows plugins to specify custom commands to check whether a port + is AT or not. By default, the 'AT' command will be used if no custom one specified. +

    +

    + This configuration is specified by the MM_PLUGIN_CUSTOM_AT_PROBE + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    QCDM allowed

    +

    + This boolean property allows plugins to specify that they expect and support + QCDM serial ports. +

    +

    + This configuration is specified by the MM_PLUGIN_ALLOWED_QCDM + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Check Icera support

    +

    + This boolean property allows plugins to specify that they want to have the Icera + support checks included in the probing sequence. They can afterwards get the result + of the support check to decide whether they want to create a Icera-based modem + object or not. +

    +

    + This configuration is specified by the MM_PLUGIN_ICERA_PROBE + property in the MMPlugin object provided + by the plugin. +

    +
  • +
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch04s03.html modemmanager-1.10.0/docs/reference/api/html/ch04s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch04s03.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch04s03.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,100 @@ + + + + +Post-probing filters: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Post-probing filters

+

+ Post-probing filters are required to identify whether a plugin can handle a given + modem, in special cases where the information retrieved from udev is either not + enough or wrong. This covers, for example, RS232 modems connected through a RS232 + to USB converter, where udev-reported vendor ID is that of the converter, not the + one of the modem. +

+
    +
  • +

    Allowed vendor strings

    +

    + Plugins can provide a list of vendor strings to be used as post-probing + filters. If the vendor string reported by the device via AT commands + is found in the list provided by the plugin, the plugin will report that + it can handle this modem. +

    +

    + This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_STRINGS + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Product strings

    +

    + Plugins can provide a list of pairs of vendor and product + strings to be used as post-probing filters. +

    +

    + If the vendor and product string pair reported by the device via AT + commands is found in the 'allowed' list provided by the plugin, the + plugin will report that it can handle this modem. This additional filter + should be used when the plugin is expected to work only with a given + specific product of a given vendor. +

    +

    + If the vendor and product string pair reported by the device via AT + commands is found in the 'forbidden list provided by the plugin, the + plugin will report that it cannot handle this modem. This additional filter + should be used when the plugin supports all devices of a given vendor, except for some specific ones. +

    +

    + These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_STRINGS + and MM_PLUGIN_FORBIDDEN_PRODUCT_STRINGS properties in the + MMPlugin object provided by the plugin. +

    +
  • +
  • +

    Icera support

    +

    + Plugins can specify that they only support Icera-based modems, or that they + do not support any Icera-based modem. When either of this configurations is + enabled, the Icera support checks will be included in the + probing sequence, and the result of the check will help to determine whether + the plugin supports the modem or not. +

    +

    + This filter is specified by the MM_PLUGIN_ALLOWED_ICERA and + MM_PLUGIN_FORBIDDEN_ICERA properties in the + MMPlugin object provided by the plugin. +

    +
  • +
+

+ Plugins which require post-probing filters will always be sorted last, and + therefore they will be the last ones being checked for pre-probing filters. This + is due to the fact that we need to assume that these plugins aren't able to + determine port support just with pre-probing filters, as we want to avoid + unnecessary probing sequences launched. Also note that the Generic plugin is + anyway always the last one in the list. +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch04s04.html modemmanager-1.10.0/docs/reference/api/html/ch04s04.html --- modemmanager-1.6.8/docs/reference/api/html/ch04s04.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch04s04.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,246 @@ + + + + +Probing setup examples: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Probing setup examples

+
+

Example 1. Probing setup for a plugin requiring udev-based vendor/product checks

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
G_MODULE_EXPORT MMPlugin *
+mm_plugin_create (void)
+{
+    static const gchar *subsystems[] = { "tty", NULL };
+    static const guint16 vendor_ids[] = { 0xabcd, 0 };
+    static const mm_uint16_pair product_ids[] = {
+        { 0x1234, 0xffff }
+    };
+    static const gchar *vendor_strings[] = { "vendor", NULL };
+
+    return MM_PLUGIN (
+        g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
+                      MM_PLUGIN_NAME, "Example",
+
+                      /* Next items are pre-probing filters */
+                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
+                      MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
+                      MM_PLUGIN_ALLOWED_PRODUCT_IDS, product_ids,
+
+                      /* Next items are probing sequence setup */
+                      MM_PLUGIN_ALLOWED_AT, TRUE,
+
+                      /* No post-probing filters */
+                      NULL));
+}
+
+ +
+
+

Example 2. Probing setup for a plugin requiring AT-probed vendor/product checks

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
G_MODULE_EXPORT MMPlugin *
+mm_plugin_create (void)
+{
+    static const gchar *subsystems[] = { "tty", NULL };
+    static const gchar *vendor_strings[] = { "vendor", NULL };
+    static const mm_str_pair product_strings[] = { "another-vendor", "product xyz" };
+
+    return MM_PLUGIN (
+        g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
+                      MM_PLUGIN_NAME, "Example",
+
+                      /* Next items are pre-probing filters */
+                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
+
+                      /* Next items are probing sequence setup */
+                      MM_PLUGIN_ALLOWED_AT, TRUE,
+
+                      /* Next items are post-probing filters */
+                      MM_PLUGIN_VENDOR_STRINGS, vendor_strings,
+                      MM_PLUGIN_PRODUCT_STRINGS, product_strings,
+                      NULL));
+}
+
+ +
+
+

Example 3. Probing setup for a plugin with custom initialization requirements

+
+ + + + + + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
static gboolean
+parse_custom_at (const gchar *response,
+                 const GError *error,
+                 GValue *result,
+                 GError **result_error)
+{
+    if (error) {
+        *result_error = g_error_copy (error);
+        return FALSE;
+    }
+
+    /* Otherwise, done. And also report that it's an AT port. */
+    g_value_init (result, G_TYPE_BOOLEAN);
+    g_value_set_boolean (result, TRUE);
+    return TRUE;
+}
+
+static const MMPortProbeAtCommand custom_at_probe[] = {
+    { "AT+SOMETHING", parse_custom_at },
+    { NULL }
+};
+
+G_MODULE_EXPORT MMPlugin *
+mm_plugin_create (void)
+{
+    static const gchar *subsystems[] = { "tty", NULL };
+    static const guint16 vendor_ids[] = { 0xabcd, 0 };
+
+    return MM_PLUGIN (
+        g_object_new (MM_TYPE_PLUGIN_EXAMPLE,
+                      MM_PLUGIN_NAME, "Example",
+
+                      /* Next items are pre-probing filters */
+                      MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
+                      MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
+
+                      /* Next items are probing sequence setup */
+                      MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe,
+                      MM_PLUGIN_ALLOWED_AT,      TRUE,
+
+                      /* No post-probing filters */
+                      NULL));
+}
+
+ +
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch06s02.html modemmanager-1.10.0/docs/reference/api/html/ch06s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch06s02.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch06s02.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,82 @@ + + + + +Enabling: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Enabling

+

+ Modem enabling is the user-requested sequence with the sole purpose of bringing + the modem to a state where it can get connected. +

+

+ As with the initialization sequence, the global enabling sequence is itself + splitted into N per-interface enabling steps (being N the number of interfaces + exported by the modem). Those interfaces implemented by the object but not + supported by the modem will not be enabled. +

+
    +
  • +

    Modem interface enabling

    +

    + The sequence to enable the + Modem interface + takes care of different important steps, such as powering up the + radio interface or configuring the best charset + to use. +

    +
  • +
  • +

    3GPP interface enabling

    +

    + Modems with 3GPP capabilities will enable the + 3GPP interface + as part of the global enabling sequence. This sequence involves setting up the + automatic registration of the device in the network, as well + as configuring 3GPP specific indicators and unsolicited message + handlers. +

    +
  • +
  • +

    CDMA interface enabling

    +

    + Modems with CDMA capabilities will enable the + CDMA interface + as part of the global enabling sequence. This sequence involves setting up the + periodic checks of registration in the CDMA network. +

    +
  • +
  • +

    Additional feature-specific interface enablings

    +

    + Each feature-specific interface will have its own enabling sequence, with operations + which are directly related to the purpose of the interface. For example, enabling the + Location + interface will involve setting up the initial location information; and enabling the + Messaging + interface will involve loading the initial list of SMS available in the SIM or Modem. +

    +
  • +
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch06s03.html modemmanager-1.10.0/docs/reference/api/html/ch06s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch06s03.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch06s03.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,46 @@ + + + + +Connection & disconnection: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Connection & disconnection

+

+ Connecting the Modem is done through the Bearer objects. Once such an + object is created, the user can request to get the given bearer connected. +

+

+ Broadband Modems will usually create Broadband Bearers. This kind of bearers can run either + the CDMA connection sequence (if the modem has CDMA capabilities) or the 3GPP connection + sequence (if the modem has 3GPP capabilities). For the special case of mixed 3GPP+CDMA + modems, it is assumed that the plugin implementation needs to decide how the connection gets + done. By default, anyway, the 3GPP sequence is used in this case. +

+

+ Modems which are both LTE (3GPP) and CDMA can hand over from LTE to CDMA transparently and + automatically when no LTE network is available, even keeping the same IP address. When this + happens, the modem will get notified about the access technology change, and ModemManager + will update that information. +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch06s04.html modemmanager-1.10.0/docs/reference/api/html/ch06s04.html --- modemmanager-1.6.8/docs/reference/api/html/ch06s04.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch06s04.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,86 @@ + + + + +Disabling: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Disabling

+

+ Users can disable the modems, which will bring them to a state where they are in low power + mode (e.g. RF switched off) and not registered in any network. +

+

+ As with the initialization or enabling sequences, the global disabling sequence is itself + splitted into N per-interface disabling steps (being N the number of interfaces + exported by the modem). Those interfaces implemented by the object but not + supported by the modem will not be disabled. +

+

+ The global disabling sequence will go on disabling the interfaces one by one, but + starting with the interface which was last enabled during the enabling sequence, and + backwards. This ensures that the + Modem interface + gets disabled last. +

+
    +
  • +

    Additional feature-specific interface disablings

    +

    + Each feature-specific interface will have its own disabling sequence, with operations + which are directly related to the purpose of the interface. For example, disabling the + Location + interface will involve shutting down the location gathering; and disabling the + Messaging + interface will involve unexporting all SMS objects from DBus. +

    +
  • +
  • +

    CDMA interface disabling

    +

    + Modems with CDMA capabilities will disable the + CDMA interface + as part of the global disabling sequence. This sequence involves cancelling the + periodic checks of registration in the CDMA network. +

    +
  • +
  • +

    3GPP interface disabling

    +

    + Modems with 3GPP capabilities will disable the + 3GPP interface + as part of the global disabling sequence. This sequence involves, among other things, + cleaning up 3GPP specific indicators and unsolicited message handlers. +

    +
  • +
  • +

    Modem interface disabling

    +

    + The sequence to disable the + Modem interface + takes care of different important steps, such as powering down the + radio interface. +

    +
  • +
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch13.html modemmanager-1.10.0/docs/reference/api/html/ch13.html --- modemmanager-1.6.8/docs/reference/api/html/ch13.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch13.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,64 +0,0 @@ - - - - -: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-
- -
-

-Listing available modems

-

- The D-Bus name org.freedesktop.ModemManager1 - on the system bus is the new name used by the ModemManager 1.0 daemon, and it - implements several standard DBus interfaces, including the new - - org.freedesktop.DBus.ObjectManager - - interface, which allows to list available modem objects and get notifications - where new ones are added or when existing ones are removed. There are therefore - neither a custom method to enumerate devices as in the old 0.6 interface, nor - custom signals to notify about added or removed modems. -

-

- Modems which are found but are not usable will be flagged with a - MM_MODEM_STATE_FAILED - state in the - - State - - property, and a more detailed reason about the failure will be given in the - - StateFailedReason - - property. The most common case of failure is to have the SIM missing in a modem which - requires one for operation. -

-
-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch13s02.html modemmanager-1.10.0/docs/reference/api/html/ch13s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch13s02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch13s02.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ - - - - -PIN unlocking: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-PIN unlocking

-

- The process of PIN unlocking the modem is now performed with the - - SendPin() - - method in the - - org.freedesktop.ModemManager1.Sim - - interface. -

-

- The path of the SIM object is specified in the - - Sim - - property of the - - org.freedesktop.ModemManager1.Modem - - interface. If the modem doesn't have a SIM, no object path will be given. -

-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch13s03.html modemmanager-1.10.0/docs/reference/api/html/ch13s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch13s03.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch13s03.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,69 +0,0 @@ - - - - -Connection and disconnection: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Connection and disconnection

-

- The process of requesting to connect or disconnect the modem is now split into - two operations: creating a bearer with - - CreateBearer() - - in the - - org.freedesktop.ModemManager1.Modem - - interface and getting the bearer connected with - - Connect() - - in the - - org.freedesktop.ModemManager1.Bearer - - interface. These two steps are equivalent to the old Connect() - method in the previous org.freedesktop.ModemManager.Modem - interface. -

-

- The old Disconnect() - method in the previous org.freedesktop.ModemManager.Modem - interface is therefore also applied in a per-bearer basis through the new - - Disconnect() - - in the - - org.freedesktop.ModemManager1.Bearer - - interface. -

-

- This logic of splitting the connection logic allows ModemManager to create - multiple bearers that may be connected to e.g. different access points (if - the modem allows it). -

-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch13s04.html modemmanager-1.10.0/docs/reference/api/html/ch13s04.html --- modemmanager-1.6.8/docs/reference/api/html/ch13s04.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ch13s04.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ - - - - -Simple connection: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Simple connection

-

- In order to simplify the whole sequence to get the modem connected, ModemManager - still exposes a Simple interface, renamed as: - - org.freedesktop.ModemManager1.Modem.Simple - . -

-

- The - - Connect() - - method will create a single bearer with the parameters specified in the call an get - it connected, while the - - Disconnect() - - method will disconnect all available bearers. -

-

- One of the main differences with respect to the 0.6 interface, is that - - Connect() - - doesn't support to change allowed modes or bands. Instead, these operations should - be done through the methods in the - - org.freedesktop.ModemManager1.Modem - - interface. -

-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch16.html modemmanager-1.10.0/docs/reference/api/html/ch16.html --- modemmanager-1.6.8/docs/reference/api/html/ch16.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch16.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,64 @@ + + + + +: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+
+ +
+

+Listing available modems

+

+ The D-Bus name org.freedesktop.ModemManager1 + on the system bus is the new name used by the ModemManager 1.0 daemon, and it + implements several standard DBus interfaces, including the new + + org.freedesktop.DBus.ObjectManager + + interface, which allows to list available modem objects and get notifications + where new ones are added or when existing ones are removed. There are therefore + neither a custom method to enumerate devices as in the old 0.6 interface, nor + custom signals to notify about added or removed modems. +

+

+ Modems which are found but are not usable will be flagged with a + MM_MODEM_STATE_FAILED + state in the + + State + + property, and a more detailed reason about the failure will be given in the + + StateFailedReason + + property. The most common case of failure is to have the SIM missing in a modem which + requires one for operation. +

+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch16s02.html modemmanager-1.10.0/docs/reference/api/html/ch16s02.html --- modemmanager-1.6.8/docs/reference/api/html/ch16s02.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch16s02.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,51 @@ + + + + +PIN unlocking: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+PIN unlocking

+

+ The process of PIN unlocking the modem is now performed with the + + SendPin() + + method in the + + org.freedesktop.ModemManager1.Sim + + interface. +

+

+ The path of the SIM object is specified in the + + Sim + + property of the + + org.freedesktop.ModemManager1.Modem + + interface. If the modem doesn't have a SIM, no object path will be given. +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch16s03.html modemmanager-1.10.0/docs/reference/api/html/ch16s03.html --- modemmanager-1.6.8/docs/reference/api/html/ch16s03.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch16s03.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,69 @@ + + + + +Connection and disconnection: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Connection and disconnection

+

+ The process of requesting to connect or disconnect the modem is now split into + two operations: creating a bearer with + + CreateBearer() + + in the + + org.freedesktop.ModemManager1.Modem + + interface and getting the bearer connected with + + Connect() + + in the + + org.freedesktop.ModemManager1.Bearer + + interface. These two steps are equivalent to the old Connect() + method in the previous org.freedesktop.ModemManager.Modem + interface. +

+

+ The old Disconnect() + method in the previous org.freedesktop.ModemManager.Modem + interface is therefore also applied in a per-bearer basis through the new + + Disconnect() + + in the + + org.freedesktop.ModemManager1.Bearer + + interface. +

+

+ This logic of splitting the connection logic allows ModemManager to create + multiple bearers that may be connected to e.g. different access points (if + the modem allows it). +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ch16s04.html modemmanager-1.10.0/docs/reference/api/html/ch16s04.html --- modemmanager-1.6.8/docs/reference/api/html/ch16s04.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ch16s04.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,60 @@ + + + + +Simple connection: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Simple connection

+

+ In order to simplify the whole sequence to get the modem connected, ModemManager + still exposes a Simple interface, renamed as: + + org.freedesktop.ModemManager1.Modem.Simple + . +

+

+ The + + Connect() + + method will create a single bearer with the parameters specified in the call and get + it connected, while the + + Disconnect() + + method will disconnect all available bearers. +

+

+ One of the main differences with respect to the 0.6 interface, is that + + Connect() + + doesn't support to change allowed modes or bands. Instead, these operations should + be done through the methods in the + + org.freedesktop.ModemManager1.Modem + + interface. +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Bearer.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Bearer.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Bearer.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Bearer.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Bearer: ModemManager Reference Manual - + - + @@ -40,7 +40,7 @@
-

Properties

+

Properties

 Interface   readable   s
 Connected   readable   b
@@ -49,6 +49,7 @@
 Ip6Config   readable   a{sv}
 Stats       readable   a{sv}
 IpTimeout   readable   u
+BearerType  readable   u
 Properties  readable   a{sv}
 
@@ -394,6 +395,15 @@
+

The "BearerType" property

+
+BearerType  readable   u
+
+

A MMBearerType +

+
+
+

The "Properties" property

 Properties  readable   a{sv}
@@ -404,6 +414,6 @@
 
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Call.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Call.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Call.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Call.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Call: ModemManager Reference Manual - + - - + + @@ -43,7 +43,7 @@
-

Signals

+

Signals

 DtmfReceived (s dtmf);
 StateChanged (i old,
@@ -52,12 +52,14 @@
 
-

Properties

+

Properties

 State        readable   i
 StateReason  readable   i
 Direction    readable   i
 Number       readable   s
+AudioPort    readable   s
+AudioFormat  readable   a{sv}
 
@@ -214,9 +216,63 @@

The remote phone number.

+
+
+

The "AudioPort" property

+
+AudioPort  readable   s
+
+

If call audio is routed via the host, the name of the kernel device that + provides the audio. For example, with certain Huawei USB modems, this + property might be "ttyUSB2" indicating audio is available via ttyUSB2 in + the format described by the AudioFormat property. +

+
+
+
+

The "AudioFormat" property

+
+AudioFormat  readable   a{sv}
+
+

If call audio is routed via the host, a description of the audio format + supported by the audio port. +

+

This property may include the following items: +

+
++++ + + + + + + + + + + + + + + +

"encoding"

+ The audio encoding format. For example, "pcm" for PCM audio. +

"resolution"

+ The sampling precision and its encoding format. For example, + "s16le" for signed 16-bit little-endian samples. +

"rate"

+ The sampling rate as an unsigned integer. For example, 8000 for + 8000hz. +
+

+

+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,19 +3,20 @@ org.freedesktop.ModemManager1: ModemManager Reference Manual - + - + @@ -34,8 +35,17 @@

Methods

-ScanDevices ();
-SetLogging  (IN  s level);
+ScanDevices       ();
+SetLogging        (IN  s     level);
+ReportKernelEvent (IN  a{sv} properties);
+InhibitDevice     (IN  s     uid,
+                   IN  b     inhibit);
+
+
+
+

Properties

+
+Version  readable   s
 
@@ -73,9 +83,149 @@
+
+
+

The ReportKernelEvent() method

+
+ReportKernelEvent (IN  a{sv} properties);
+
+

Reports a kernel event to ModemManager. +

+

This method is only available if udev is not being used to report kernel + events. +

+

The properties dictionary is composed of key/value string pairs. The + possible keys are: +

+

+
++++ + + + + + + + + + + + + + + + + + + +

action

+

+ The type of action, given as a string value (signature + "s"). + This parameter is MANDATORY. +

+
++++ + + + + + + + + + + +

add

+ A new kernel device has been added. +

remove

+ An existing kernel device has been removed. +
+

name

+ The device name, given as a string value (signature + "s"). + This parameter is MANDATORY. +

subsystem

+ The device subsystem, given as a string value (signature + "s"). + This parameter is MANDATORY. +

uid

+ The unique ID of the physical device, given as a string value + (signature "s"). + This parameter is OPTIONAL, if not given the sysfs path of the + physical device will be used. This parameter must be the same + for all devices exposed by the same physical device. +

+

+

+
++++ + + + + +

IN a{sv} properties:

event properties.

+
+
+
+

The InhibitDevice() method

+
+InhibitDevice (IN  s uid,
+               IN  b inhibit);
+
+

org.freedesktop.ModemManager1.Modem:Device property. + inhibit: TRUE to inhibit the modem and FALSE to uninhibit it. +

+

Inhibit or uninhibit the device. +

+

When the modem is inhibited ModemManager will close all its ports and + unexport it from the bus, so that users of the interface are no longer + able to operate with it. +

+

This operation binds the inhibition request to the existence of the + caller in the DBus bus. If the caller disappears from the bus, the + inhibition will automatically removed. +

+
++++ + + + + + + + + + + +

IN s uid:

the unique ID of the physical device, given in the

IN b inhibit:

+
+ +
+

Property Details

+
+

The "Version" property

+
+Version  readable   s
+
+

The runtime version of the ModemManager daemon. +

+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Firmware.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Firmware.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Firmware.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Firmware.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,19 +3,20 @@ org.freedesktop.ModemManager1.Modem.Firmware: ModemManager Reference Manual - + - + @@ -40,17 +41,44 @@
+

Properties

+
+UpdateSettings  readable   (ua{sv})
+
+
+

Description

-

This interface allows clients to select or install firmware images on - modems. +

This interface provides access to perform different firmware-related operations + in the modem, including listing the available firmware images in the module and + selecting which of them to use.

-

Firmware slots and firmware images are identified by arbitrary opaque - strings. +

This interface does not provide direct access to perform firmware updates in + the device. Instead, it exposes information about the expected firmware update + method as well as method-specific details required for the upgrade to happen. + The actual firmware upgrade may be performed via the Linux Vendor Firmware Service + and the fwupd daemon.

-

Firmware images are represented as dictionaries of properties. - Certain properties are pre-defined, and some are required: +

This interface will always be available as long a the modem is considered + valid.

-

+
+
+

Method Details

+
+

The List() method

+
+List (OUT s      selected,
+      OUT aa{sv} installed);
+
+

List installed firmware images. +

+

Firmware slots and firmware images are identified by arbitrary opaque + strings. +

+

Firmware images are represented as dictionaries of properties. + Certain properties are pre-defined, and some are required: +

+

@@ -60,80 +88,64 @@ + (Required) Type of the firmware image, given as a + MMFirmwareImageType value + (signature "u"). Firmware images of type + MM_FIRMWARE_IMAGE_TYPE_GENERIC + will only expose only the mandatory properties. + + (Required) A user-readable unique ID for the firmware image, given as a + string value (signature "s"). + + (Optional) The version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + (Optional) Additional information of the PRI image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + (Optional) The boot version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + (Optional) The unique ID of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + (Optional) The unique ID of the Modem firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). +

"image-type"

- (Required) Type of the firmware image, given as a - MMFirmwareImageType value - (signature "u"). Firmware images of type - MM_FIRMWARE_IMAGE_TYPE_GENERIC - will only expose only the mandatory properties. -

"unique-id"

- (Required) A user-readable unique ID for the firmware image, given as a - string value (signature "s"). -

"gobi-pri-version"

- (Optional) The version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). -

"gobi-pri-info"

- (Optional) Additional information of the PRI image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). -

"gobi-boot-version"

- (Optional) The boot version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). -

"gobi-pri-unique-id"

- (Optional) The unique ID of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). -

"gobi-modem-unique-id"

- (Optional) The unique ID of the Modem firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). -

- -
-

Method Details

-
-

The List() method

-
-List (OUT s      selected,
-      OUT aa{sv} installed);
-
-

List installed firmware images. -

-

Depending on the type of modem, installed images may be stored on the - host or the modem. -

-

Installed images can be selected non-destructively. -

@@ -165,6 +177,8 @@ List(), or if the image could not be selected for some reason.

+

Installed images can be selected non-destructively. +

@@ -177,8 +191,100 @@
+
+

Property Details

+
+

The "UpdateSettings" property

+
+UpdateSettings  readable   (ua{sv})
+
+

Detailed settings that provide information about how the module should be + updated. +

+

The settings are given as a bitmask of MMModemFirmwareUpdateMethod + values specifying the type of firmware update procedures expected followed by a + dictionary that includes other parameters applicable to the specific methods reported. +

+

+
++++ + + + + +

+

+ The following settings are mandatory as long as the reported update method is not + <term>MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE</term>. +

+
++++ + + + + + + + + + + +

"device-ids"

+ (Required) This property exposes the list of device IDs associated to a given + device, from most specific to least specific. (signature 'as'). + E.g. a list containing: "USB\VID_413C&PID_81D7&REV_0001", + "USB\VID_413C&PID_81D7" and "USB\VID_413C". +

"version"

+ (Required) This property exposes the current firmware version string of the module. + If the module uses separate version numbers for firmware version and carrier configuration, + this version string will be a combination of both, and so it may be different to the + version string showed in the "Revision" property. + (signature 's') +
+
+

+

+

+
++++ + + + + +

MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT

+

+ Devices supporting the fastboot firmware update method require exposing the + following additional settings: +

+
++++ + + + + +

"fastboot-at"

+ (Required) This property exposes the AT command that should be sent to the + module to trigger a reset into fastboot mode (signature 's') +
+
+

+

+
+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem: ModemManager Reference Manual - + - + @@ -53,7 +53,7 @@
-

Signals

+

Signals

 StateChanged (i old,
               i new,
@@ -61,7 +61,7 @@
 
-

Properties

+

Properties

 Sim                    readable   o
 Bearers                readable   ao
@@ -72,6 +72,7 @@
 Manufacturer           readable   s
 Model                  readable   s
 Revision               readable   s
+HardwareRevision       readable   s
 DeviceIdentifier       readable   s
 Device                 readable   s
 Drivers                readable   as
@@ -99,6 +100,9 @@
 

The Modem interface controls the status and actions in a given modem object.

+

This interface will always be available as long a the modem is considered + valid. +

Method Details

@@ -135,6 +139,9 @@

List configured packet data bearers (EPS Bearers, PDP Contexts, or CDMA2000 Packet Data Sessions).

+

Deprecated: 1.10.0. Use "Bearers" + property instead. +

@@ -445,7 +452,10 @@ Bearers readable ao

The list of bearer object paths (EPS Bearers, PDP Contexts, or - CDMA2000 Packet Data Sessions). + CDMA2000 Packet Data Sessions) as requested by the user. +

+

This list does not include the initial EPS bearer details (see + "InitialEpsBearer").


@@ -496,7 +506,9 @@
 MaxActiveBearers  readable   u
 
-

The maximum number of active packet data bearers the modem supports. +

The maximum number of active + MM_BEARER_TYPE_DEFAULT + bearers that may be explicitly enabled by the user.

POTS and CDMA2000-only devices support one active bearer, while GSM/UMTS and LTE-capable devices (including LTE/CDMA devices) typically support @@ -532,6 +544,15 @@


+

The "HardwareRevision" property

+
+HardwareRevision  readable   s
+
+

The revision identification of the hardware, as reported by the modem. +

+
+
+

The "DeviceIdentifier" property

 DeviceIdentifier  readable   s
@@ -560,6 +581,9 @@
 

In Linux for example, this points to a sysfs path of the usb_device object.

+

This value may also be set by the user using the MM_ID_PHYSDEV_UID udev + tag (e.g. binding the tag to a specific sysfs path). +


@@ -802,6 +826,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Location.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Location.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Location.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Location.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Location: ModemManager Reference Manual - + - + @@ -35,22 +35,25 @@

Methods

-Setup             (IN  u     sources,
-                   IN  b     signal_location);
-GetLocation       (OUT a{uv} Location);
-SetSuplServer     (IN  s     supl);
-SetGpsRefreshRate (IN  u     rate);
+Setup                (IN  u     sources,
+                      IN  b     signal_location);
+GetLocation          (OUT a{uv} Location);
+SetSuplServer        (IN  s     supl);
+InjectAssistanceData (IN  ay    data);
+SetGpsRefreshRate    (IN  u     rate);
 
-

Properties

+

Properties

-Capabilities     readable   u
-Enabled          readable   u
-SignalsLocation  readable   b
-Location         readable   a{uv}
-SuplServer       readable   s
-GpsRefreshRate   readable   u
+Capabilities             readable   u
+SupportedAssistanceData  readable   u
+Enabled                  readable   u
+SignalsLocation          readable   b
+Location                 readable   a{uv}
+SuplServer               readable   s
+AssistanceDataServers    readable   as
+GpsRefreshRate           readable   u
 
@@ -60,6 +63,11 @@ if they do, they may not be able to provide it while a data session is active.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used (including GNSS module management). +

Method Details

@@ -146,7 +154,32 @@
- + + +

IN s supl:

SUPL server configuration, given either as IP:PORT or with a full URL.

SUPL server configuration, given either as IP:PORT or as FQDN:PORT.

+
+
+
+

The InjectAssistanceData() method

+
+InjectAssistanceData (IN  ay data);
+
+

Inject assistance data to the GNSS module. + The data files should be downloaded using external means from the URLs specified in + the AssistanceDataServers property. +

+

The user does not need to specify the assistance data type being given. +

+

There is no maximum data size limit specified, default DBus system bus limits apply. +

+
++++ + + +

IN ay data:

assistance data to be injected to the GNSS module.

@@ -187,6 +220,16 @@
+

The "SupportedAssistanceData" property

+
+SupportedAssistanceData  readable   u
+
+

Bitmask of MMModemLocationAssistanceDataType + values, specifying the supported types of assistance data. +

+
+
+

The "Enabled" property

 Enabled  readable   u
@@ -241,7 +284,7 @@
 
 

Devices supporting this - capability return a string in the format "MCC,MNC,LAC,CI" (without the + capability return a string in the format "MCC,MNC,LAC,CI,TAC" (without the quotes of course) where the following applies:

@@ -269,10 +312,10 @@ @@ -284,6 +327,15 @@ e.g. "2BAF" or "D30156". + + + +

LAC

- This is the two-byte Location Area Code of the base station with - which the mobile is registered, in upper-case hexadecimal format - without leading zeros, as specified in 3GPP TS 27.007 section - 10.1.19. e.g. "84CD". + This is the two-byte Location Area Code of the GSM/UMTS base + station with which the mobile is registered, in upper-case + hexadecimal format without leading zeros, as specified in + 3GPP TS 27.007. E.g. "84CD".

TAC

+ This is the two-byte Location Area Code of the LTE base + station with which the mobile is registered, in upper-case + hexadecimal format without leading zeros, as specified in + 3GPP TS 27.007. E.g. "6FFE". +

@@ -439,7 +491,17 @@

 SuplServer  readable   s
 
-

SUPL server configuration for A-GPS, given either as IP:PORT or with a full URL. +

SUPL server configuration for A-GPS, given either as IP:PORT or FQDN:PORT. +

+
+
+
+

The "AssistanceDataServers" property

+
+AssistanceDataServers  readable   as
+
+

URLs from where the user can download assistance data files to inject with + InjectAssistanceData().


@@ -454,6 +516,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Messaging.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Messaging.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Messaging.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Messaging.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Messaging: ModemManager Reference Manual - + - + @@ -43,7 +43,7 @@
-

Signals

+

Signals

 Added   (o path,
          b received);
@@ -51,7 +51,7 @@
 
-

Properties

+

Properties

 Messages           readable   ao
 SupportedStorages  readable   au
@@ -63,6 +63,11 @@
 

The Messaging interface handles sending SMS messages and notification of new incoming messages.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used (including listing stored messages). +

Method Details

@@ -232,6 +237,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Modem3gpp: ModemManager Reference Manual - + - + @@ -35,19 +35,25 @@

Methods

-Register (IN  s      operator_id);
-Scan     (OUT aa{sv} results);
+Register                    (IN  s      operator_id);
+Scan                        (OUT aa{sv} results);
+SetEpsUeModeOperation       (IN  u      mode);
+SetInitialEpsBearerSettings (IN  a{sv}  settings);
 
-

Properties

+

Properties

-Imei                  readable   s
-RegistrationState     readable   u
-OperatorCode          readable   s
-OperatorName          readable   s
-EnabledFacilityLocks  readable   u
-SubscriptionState     readable   u
+Imei                      readable   s
+RegistrationState         readable   u
+OperatorCode              readable   s
+OperatorName              readable   s
+EnabledFacilityLocks      readable   u
+SubscriptionState         readable   u
+EpsUeModeOperation        readable   u
+Pco                       readable   a(ubay)
+InitialEpsBearer          readable   o
+InitialEpsBearerSettings  readable   a{sv}
 
@@ -55,6 +61,11 @@

This interface provides access to specific actions that may be performed in modems with 3GPP capabilities.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -153,6 +164,76 @@
+
+
+

The SetEpsUeModeOperation() method

+
+SetEpsUeModeOperation (IN  u mode);
+
+

Sets the UE mode of operation for EPS. +

+
++++ + + + + +

IN u mode:

a MMModem3gppEpsUeModeOperation.

+
+
+
+

The SetInitialEpsBearerSettings() method

+
+SetInitialEpsBearerSettings (IN  a{sv} settings);
+
+

Updates the default settings to be used in the initial default EPS bearer when registering to the LTE network. +

+

Allowed properties are: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +

"apn"

Access Point Name, given as a string value (signature "s").

"ip-type"

Addressing type, given as a MMBearerIpFamily value (signature "u").

"allowed-auth"

The authentication method to use, given as a MMBearerAllowedAuth value (signature "u").

"user"

User name (if any) required by the network, given as a string value (signature "s").

"password"

Password (if any) required by the network, given as a string value (signature "s").

+

+

+
++++ + + + + +

IN a{sv} settings:

List of properties to use when requesting the LTE attach procedure.

+

Property Details

@@ -226,10 +307,62 @@ value representing the subscription status of the account and whether there is any data remaining, given as an unsigned integer (signature "u").

+

Deprecated: 1.10.0. The value of this property can only be obtained with operator + specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense + to expose it in the ModemManager interface. +

+
+
+
+

The "EpsUeModeOperation" property

+
+EpsUeModeOperation  readable   u
+
+

A MMModem3gppEpsUeModeOperation + value representing the UE mode of operation for EPS, given as an unsigned integer + (signature "u"). +

+
+
+
+

The "Pco" property

+
+Pco  readable   a(ubay)
+
+

The raw PCOs received from the network. +

+
+
+
+

The "InitialEpsBearer" property

+
+InitialEpsBearer  readable   o
+
+

The object path for the initial default EPS bearer. +

+
+
+
+

The "InitialEpsBearerSettings" property

+
+InitialEpsBearerSettings  readable   a{sv}
+
+

List of properties requested by the device for the initial EPS bearer during + LTE network attach procedure. +

+

The network may decide to use different settings during the actual device attach + procedure, e.g. if the device is roaming or no explicit settings were requested, + so the properties shown in the org.freedesktop.ModemManager1.Modem.Modem3gpp.InitialEpsBearer:InitialEpsBearer + may be totally different. +

+

This is a read-only property, updating these settings should be done using the + SetInitialEpsBearerSettings() + method. +

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd: ModemManager Reference Manual - + - + @@ -43,7 +43,7 @@
-

Properties

+

Properties

 State                readable   u
 NetworkNotification  readable   s
@@ -54,6 +54,11 @@
 

Description

This interface provides access to actions based on the USSD protocol.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -168,6 +173,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.ModemCdma: ModemManager Reference Manual - + - + @@ -41,7 +41,7 @@
-

Signals

+

Signals

 ActivationStateChanged (u     activation_state,
                         u     activation_error,
@@ -49,7 +49,7 @@
 
-

Properties

+

Properties

 ActivationState          readable   u
 Meid                     readable   s
@@ -65,6 +65,11 @@
 

This interface provides access to specific actions that may be performed in modems with CDMA capabilities.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. Mixed 3GPP+3GPP2 devices will require + a valid unlocked SIM card before any of the features in the interface can + be used. +

Method Details

@@ -284,6 +289,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Oma.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Oma.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Oma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Oma.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Oma: ModemManager Reference Manual - + - + @@ -44,7 +44,7 @@
-

Signals

+

Signals

 SessionStateChanged (i old_session_state,
                      i new_session_state,
@@ -52,7 +52,7 @@
 
-

Properties

+

Properties

 Features                         readable   u
 PendingNetworkInitiatedSessions  readable   a(uu)
@@ -68,6 +68,11 @@
 

Device management sessions are either on-demand (client-initiated), or automatically initiated by either the device itself or the network.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -245,6 +250,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Signal.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Signal.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Signal.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Signal.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Signal: ModemManager Reference Manual - + - + @@ -39,7 +39,7 @@
-

Properties

+

Properties

 Rate  readable   u
 Cdma  readable   a{sv}
@@ -53,6 +53,11 @@
 

Description

This interface provides access to extended signal quality information.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -241,7 +246,7 @@

"ecio"

- The UMTS Ec/Io, in dBm, given as a floating point value + The UMTS Ec/Io, in dB, given as a floating point value (signature "d").

@@ -305,6 +310,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Simple: ModemManager Reference Manual - + - + @@ -44,6 +44,11 @@

Description

The Simple interface allows controlling and querying the status of Modems.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -312,6 +317,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Time.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Time.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Time.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Time.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Time: ModemManager Reference Manual - + - + @@ -40,13 +40,13 @@
-

Signals

+

Signals

 NetworkTimeChanged (s time);
 
-

Properties

+

Properties

 NetworkTimezone  readable   a{sv}
 
@@ -56,6 +56,11 @@

This interface allows clients to receive network time and timezone updates broadcast by mobile networks.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -152,6 +157,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Voice.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Voice.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Voice.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Modem.Voice.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Modem.Voice: ModemManager Reference Manual - + - + @@ -43,14 +43,14 @@
-

Signals

+

Signals

 CallAdded   (o path);
 CallDeleted (o path);
 
-

Properties

+

Properties

 Calls  readable   ao
 
@@ -59,6 +59,11 @@

Description

The Voice interface handles Calls.

+

This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. +

Method Details

@@ -188,6 +193,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sim.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sim.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sim.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sim.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Sim: ModemManager Reference Manual - + - + @@ -45,7 +45,7 @@
-

Properties

+

Properties

 SimIdentifier       readable   s
 Imsi                readable   s
@@ -200,6 +200,6 @@
 
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sms.html modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sms.html --- modemmanager-1.6.8/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sms.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/gdbus-org.freedesktop.ModemManager1.Sms.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.ModemManager1.Sms: ModemManager Reference Manual - + - + @@ -40,7 +40,7 @@
-

Properties

+

Properties

 State                  readable   u
 PduType                readable   u
@@ -178,11 +178,11 @@
 

Indicates when the SMS expires in the SMSC.

This value is composed of a - MMSmsValidityType - key, with an associated data which contains type-specific validity - information: + MMSmsValidityType + key, with an associated data which contains type-specific validity + information:

-

+

@@ -310,6 +310,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/index.html modemmanager-1.10.0/docs/reference/api/html/index.html --- modemmanager-1.6.8/docs/reference/api/html/index.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/index.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,10 +3,10 @@ ModemManager Reference Manual: ModemManager Reference Manual - + - + @@ -36,10 +36,10 @@

- For ModemManager version 1.6.8 + For ModemManager version 1.10.0

-
+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ix01.html modemmanager-1.10.0/docs/reference/api/html/ix01.html --- modemmanager-1.6.8/docs/reference/api/html/ix01.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ix01.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,11 +3,11 @@ Index: ModemManager Reference Manual - + - - + + @@ -15,496 +15,701 @@ - +
Home PrevPrev

-Index

+Index

B

-
org.freedesktop.ModemManager1.Bearer, org.freedesktop.ModemManager1.Bearer +
org.freedesktop.ModemManager1.Bearer, org.freedesktop.ModemManager1.Bearer
-
org.freedesktop.ModemManager1.Bearer.Connect(), The Connect() method +
org.freedesktop.ModemManager1.Bearer.Connect(), The Connect() method
-
org.freedesktop.ModemManager1.Bearer.Disconnect(), The Disconnect() method +
org.freedesktop.ModemManager1.Bearer.Disconnect(), The Disconnect() method
-
org.freedesktop.ModemManager1.Bearer:Connected, The "Connected" property +
org.freedesktop.ModemManager1.Bearer:BearerType, The "BearerType" property
-
org.freedesktop.ModemManager1.Bearer:Interface, The "Interface" property +
org.freedesktop.ModemManager1.Bearer:Connected, The "Connected" property
-
org.freedesktop.ModemManager1.Bearer:Ip4Config, The "Ip4Config" property +
org.freedesktop.ModemManager1.Bearer:Interface, The "Interface" property
-
org.freedesktop.ModemManager1.Bearer:Ip6Config, The "Ip6Config" property +
org.freedesktop.ModemManager1.Bearer:Ip4Config, The "Ip4Config" property
-
org.freedesktop.ModemManager1.Bearer:IpTimeout, The "IpTimeout" property +
org.freedesktop.ModemManager1.Bearer:Ip6Config, The "Ip6Config" property
-
org.freedesktop.ModemManager1.Bearer:Properties, The "Properties" property +
org.freedesktop.ModemManager1.Bearer:IpTimeout, The "IpTimeout" property
-
org.freedesktop.ModemManager1.Bearer:Stats, The "Stats" property +
org.freedesktop.ModemManager1.Bearer:Properties, The "Properties" property
-
org.freedesktop.ModemManager1.Bearer:Suspended, The "Suspended" property +
org.freedesktop.ModemManager1.Bearer:Stats, The "Stats" property
-
MMBearerAllowedAuth, enum MMBearerAllowedAuth +
org.freedesktop.ModemManager1.Bearer:Suspended, The "Suspended" property
-
MMBearerIpFamily, enum MMBearerIpFamily +
MMBearerAllowedAuth, enum MMBearerAllowedAuth
-
MMBearerIpMethod, enum MMBearerIpMethod +
MMBearerIpFamily, enum MMBearerIpFamily +
+
MMBearerIpMethod, enum MMBearerIpMethod +
+
MMBearerType, enum MMBearerType

C

-
org.freedesktop.ModemManager1.Call, org.freedesktop.ModemManager1.Call +
org.freedesktop.ModemManager1.Call, org.freedesktop.ModemManager1.Call +
+
org.freedesktop.ModemManager1.Call.Accept(), The Accept() method +
+
org.freedesktop.ModemManager1.Call.Hangup(), The Hangup() method
-
org.freedesktop.ModemManager1.Call.Accept(), The Accept() method +
org.freedesktop.ModemManager1.Call.SendDtmf(), The SendDtmf() method
-
org.freedesktop.ModemManager1.Call.Hangup(), The Hangup() method +
org.freedesktop.ModemManager1.Call.Start(), The Start() method
-
org.freedesktop.ModemManager1.Call.SendDtmf(), The SendDtmf() method +
org.freedesktop.ModemManager1.Call::DtmfReceived, The "DtmfReceived" signal
-
org.freedesktop.ModemManager1.Call.Start(), The Start() method +
org.freedesktop.ModemManager1.Call::StateChanged, The "StateChanged" signal
-
org.freedesktop.ModemManager1.Call::DtmfReceived, The "DtmfReceived" signal +
org.freedesktop.ModemManager1.Call:AudioFormat, The "AudioFormat" property
-
org.freedesktop.ModemManager1.Call::StateChanged, The "StateChanged" signal +
org.freedesktop.ModemManager1.Call:AudioPort, The "AudioPort" property
-
org.freedesktop.ModemManager1.Call:Direction, The "Direction" property +
org.freedesktop.ModemManager1.Call:Direction, The "Direction" property
-
org.freedesktop.ModemManager1.Call:Number, The "Number" property +
org.freedesktop.ModemManager1.Call:Number, The "Number" property
-
org.freedesktop.ModemManager1.Call:State, The "State" property +
org.freedesktop.ModemManager1.Call:State, The "State" property
-
org.freedesktop.ModemManager1.Call:StateReason, The "StateReason" property +
org.freedesktop.ModemManager1.Call:StateReason, The "StateReason" property
-
MMCallDirection, enum MMCallDirection +
MMCallDirection, enum MMCallDirection
-
MMCallState, enum MMCallState +
MMCallState, enum MMCallState
-
MMCallStateReason, enum MMCallStateReason +
MMCallStateReason, enum MMCallStateReason
-
MMCdmaActivationError, enum MMCdmaActivationError +
MMCdmaActivationError, enum MMCdmaActivationError
-
MM_CHECK_VERSION, MM_CHECK_VERSION() +
MM_CHECK_VERSION, MM_CHECK_VERSION()
-
MMConnectionError, enum MMConnectionError +
MMConnectionError, enum MMConnectionError
-
MMCoreError, enum MMCoreError +
MMCoreError, enum MMCoreError

F

-
MMFirmwareImageType, enum MMFirmwareImageType +
MMFirmwareImageType, enum MMFirmwareImageType
+

I

+
+
ID_MM_CANDIDATE, ID_MM_CANDIDATE +
+
ID_MM_DEVICE_IGNORE, ID_MM_DEVICE_IGNORE +
+
ID_MM_DEVICE_MANUAL_SCAN_ONLY, ID_MM_DEVICE_MANUAL_SCAN_ONLY +
+
ID_MM_DEVICE_PROCESS, ID_MM_DEVICE_PROCESS +
+
ID_MM_PHYSDEV_UID, ID_MM_PHYSDEV_UID +
+
ID_MM_PLATFORM_DRIVER_PROBE, ID_MM_PLATFORM_DRIVER_PROBE +
+
ID_MM_PORT_IGNORE, ID_MM_PORT_IGNORE +
+
ID_MM_PORT_TYPE_AT_PPP, ID_MM_PORT_TYPE_AT_PPP +
+
ID_MM_PORT_TYPE_AT_PRIMARY, ID_MM_PORT_TYPE_AT_PRIMARY +
+
ID_MM_PORT_TYPE_AT_SECONDARY, ID_MM_PORT_TYPE_AT_SECONDARY +
+
ID_MM_PORT_TYPE_GPS, ID_MM_PORT_TYPE_GPS +
+
ID_MM_PORT_TYPE_QCDM, ID_MM_PORT_TYPE_QCDM +
+
ID_MM_TTY_BAUDRATE, ID_MM_TTY_BAUDRATE +
+
ID_MM_TTY_FLOW_CONTROL, ID_MM_TTY_FLOW_CONTROL +
+
+
+

M

-
MM_MAJOR_VERSION, MM_MAJOR_VERSION +
MM_MAJOR_VERSION, MM_MAJOR_VERSION +
+
MMMessageError, enum MMMessageError +
+
MM_MICRO_VERSION, MM_MICRO_VERSION +
+
MM_MINOR_VERSION, MM_MINOR_VERSION +
+
MMMobileEquipmentError, enum MMMobileEquipmentError +
+
org.freedesktop.ModemManager1.Modem, org.freedesktop.ModemManager1.Modem +
+
org.freedesktop.ModemManager1.Modem.Command(), The Command() method +
+
org.freedesktop.ModemManager1.Modem.CreateBearer(), The CreateBearer() method +
+
org.freedesktop.ModemManager1.Modem.DeleteBearer(), The DeleteBearer() method +
+
org.freedesktop.ModemManager1.Modem.Enable(), The Enable() method +
+
org.freedesktop.ModemManager1.Modem.FactoryReset(), The FactoryReset() method +
+
org.freedesktop.ModemManager1.Modem.Firmware, org.freedesktop.ModemManager1.Modem.Firmware +
+
org.freedesktop.ModemManager1.Modem.Firmware.List(), The List() method +
+
org.freedesktop.ModemManager1.Modem.Firmware.Select(), The Select() method +
+
org.freedesktop.ModemManager1.Modem.Firmware:UpdateSettings, The "UpdateSettings" property +
+
org.freedesktop.ModemManager1.Modem.ListBearers(), The ListBearers() method +
+
org.freedesktop.ModemManager1.Modem.Location, org.freedesktop.ModemManager1.Modem.Location +
+
org.freedesktop.ModemManager1.Modem.Location.GetLocation(), The GetLocation() method +
+
org.freedesktop.ModemManager1.Modem.Location.InjectAssistanceData(), The InjectAssistanceData() method +
+
org.freedesktop.ModemManager1.Modem.Location.SetGpsRefreshRate(), The SetGpsRefreshRate() method +
+
org.freedesktop.ModemManager1.Modem.Location.SetSuplServer(), The SetSuplServer() method +
+
org.freedesktop.ModemManager1.Modem.Location.Setup(), The Setup() method +
+
org.freedesktop.ModemManager1.Modem.Location:AssistanceDataServers, The "AssistanceDataServers" property +
+
org.freedesktop.ModemManager1.Modem.Location:Capabilities, The "Capabilities" property +
+
org.freedesktop.ModemManager1.Modem.Location:Enabled, The "Enabled" property +
+
org.freedesktop.ModemManager1.Modem.Location:GpsRefreshRate, The "GpsRefreshRate" property +
+
org.freedesktop.ModemManager1.Modem.Location:Location, The "Location" property +
+
org.freedesktop.ModemManager1.Modem.Location:SignalsLocation, The "SignalsLocation" property +
+
org.freedesktop.ModemManager1.Modem.Location:SuplServer, The "SuplServer" property +
+
org.freedesktop.ModemManager1.Modem.Location:SupportedAssistanceData, The "SupportedAssistanceData" property +
+
org.freedesktop.ModemManager1.Modem.Messaging, org.freedesktop.ModemManager1.Modem.Messaging
-
MMMessageError, enum MMMessageError +
org.freedesktop.ModemManager1.Modem.Messaging.Create(), The Create() method
-
MM_MICRO_VERSION, MM_MICRO_VERSION +
org.freedesktop.ModemManager1.Modem.Messaging.Delete(), The Delete() method
-
MM_MINOR_VERSION, MM_MINOR_VERSION +
org.freedesktop.ModemManager1.Modem.Messaging.List(), The List() method
-
MMMobileEquipmentError, enum MMMobileEquipmentError +
org.freedesktop.ModemManager1.Modem.Messaging::Added, The "Added" signal
-
org.freedesktop.ModemManager1.Modem, org.freedesktop.ModemManager1.Modem +
org.freedesktop.ModemManager1.Modem.Messaging::Deleted, The "Deleted" signal
-
org.freedesktop.ModemManager1.Modem.Command(), The Command() method +
org.freedesktop.ModemManager1.Modem.Messaging:DefaultStorage, The "DefaultStorage" property
-
org.freedesktop.ModemManager1.Modem.CreateBearer(), The CreateBearer() method +
org.freedesktop.ModemManager1.Modem.Messaging:Messages, The "Messages" property
-
org.freedesktop.ModemManager1.Modem.DeleteBearer(), The DeleteBearer() method +
org.freedesktop.ModemManager1.Modem.Messaging:SupportedStorages, The "SupportedStorages" property
-
org.freedesktop.ModemManager1.Modem.Enable(), The Enable() method +
org.freedesktop.ModemManager1.Modem.Oma, org.freedesktop.ModemManager1.Modem.Oma
-
org.freedesktop.ModemManager1.Modem.FactoryReset(), The FactoryReset() method +
org.freedesktop.ModemManager1.Modem.Oma.AcceptNetworkInitiatedSession(), The AcceptNetworkInitiatedSession() method
-
org.freedesktop.ModemManager1.Modem.Firmware, org.freedesktop.ModemManager1.Modem.Firmware +
org.freedesktop.ModemManager1.Modem.Oma.CancelSession(), The CancelSession() method
-
org.freedesktop.ModemManager1.Modem.Firmware.List(), The List() method +
org.freedesktop.ModemManager1.Modem.Oma.Setup(), The Setup() method
-
org.freedesktop.ModemManager1.Modem.Firmware.Select(), The Select() method +
org.freedesktop.ModemManager1.Modem.Oma.StartClientInitiatedSession(), The StartClientInitiatedSession() method
-
org.freedesktop.ModemManager1.Modem.ListBearers(), The ListBearers() method +
org.freedesktop.ModemManager1.Modem.Oma::SessionStateChanged, The "SessionStateChanged" signal
-
org.freedesktop.ModemManager1.Modem.Location, org.freedesktop.ModemManager1.Modem.Location +
org.freedesktop.ModemManager1.Modem.Oma:Features, The "Features" property
-
org.freedesktop.ModemManager1.Modem.Location.GetLocation(), The GetLocation() method +
org.freedesktop.ModemManager1.Modem.Oma:PendingNetworkInitiatedSessions, The "PendingNetworkInitiatedSessions" property
-
org.freedesktop.ModemManager1.Modem.Location.SetGpsRefreshRate(), The SetGpsRefreshRate() method +
org.freedesktop.ModemManager1.Modem.Oma:SessionState, The "SessionState" property
-
org.freedesktop.ModemManager1.Modem.Location.SetSuplServer(), The SetSuplServer() method +
org.freedesktop.ModemManager1.Modem.Oma:SessionType, The "SessionType" property
-
org.freedesktop.ModemManager1.Modem.Location.Setup(), The Setup() method +
org.freedesktop.ModemManager1.Modem.Reset(), The Reset() method
-
org.freedesktop.ModemManager1.Modem.Location:Capabilities, The "Capabilities" property +
org.freedesktop.ModemManager1.Modem.SetCurrentBands(), The SetCurrentBands() method
-
org.freedesktop.ModemManager1.Modem.Location:Enabled, The "Enabled" property +
org.freedesktop.ModemManager1.Modem.SetCurrentCapabilities(), The SetCurrentCapabilities() method
-
org.freedesktop.ModemManager1.Modem.Location:GpsRefreshRate, The "GpsRefreshRate" property +
org.freedesktop.ModemManager1.Modem.SetCurrentModes(), The SetCurrentModes() method
-
org.freedesktop.ModemManager1.Modem.Location:Location, The "Location" property +
org.freedesktop.ModemManager1.Modem.SetPowerState(), The SetPowerState() method
-
org.freedesktop.ModemManager1.Modem.Location:SignalsLocation, The "SignalsLocation" property +
org.freedesktop.ModemManager1.Modem.Signal, org.freedesktop.ModemManager1.Modem.Signal
-
org.freedesktop.ModemManager1.Modem.Location:SuplServer, The "SuplServer" property +
org.freedesktop.ModemManager1.Modem.Signal.Setup(), The Setup() method
-
org.freedesktop.ModemManager1.Modem.Messaging, org.freedesktop.ModemManager1.Modem.Messaging +
org.freedesktop.ModemManager1.Modem.Signal:Cdma, The "Cdma" property
-
org.freedesktop.ModemManager1.Modem.Messaging.Create(), The Create() method +
org.freedesktop.ModemManager1.Modem.Signal:Evdo, The "Evdo" property
-
org.freedesktop.ModemManager1.Modem.Messaging.Delete(), The Delete() method +
org.freedesktop.ModemManager1.Modem.Signal:Gsm, The "Gsm" property
-
org.freedesktop.ModemManager1.Modem.Messaging.List(), The List() method +
org.freedesktop.ModemManager1.Modem.Signal:Lte, The "Lte" property
-
org.freedesktop.ModemManager1.Modem.Messaging::Added, The "Added" signal +
org.freedesktop.ModemManager1.Modem.Signal:Rate, The "Rate" property
-
org.freedesktop.ModemManager1.Modem.Messaging::Deleted, The "Deleted" signal +
org.freedesktop.ModemManager1.Modem.Signal:Umts, The "Umts" property
-
org.freedesktop.ModemManager1.Modem.Messaging:DefaultStorage, The "DefaultStorage" property +
org.freedesktop.ModemManager1.Modem.Simple, org.freedesktop.ModemManager1.Modem.Simple
-
org.freedesktop.ModemManager1.Modem.Messaging:Messages, The "Messages" property +
org.freedesktop.ModemManager1.Modem.Simple.Connect(), The Connect() method
-
org.freedesktop.ModemManager1.Modem.Messaging:SupportedStorages, The "SupportedStorages" property +
org.freedesktop.ModemManager1.Modem.Simple.Disconnect(), The Disconnect() method
-
org.freedesktop.ModemManager1.Modem.Oma, org.freedesktop.ModemManager1.Modem.Oma +
org.freedesktop.ModemManager1.Modem.Simple.GetStatus(), The GetStatus() method
-
org.freedesktop.ModemManager1.Modem.Oma.AcceptNetworkInitiatedSession(), The AcceptNetworkInitiatedSession() method +
org.freedesktop.ModemManager1.Modem.Time, org.freedesktop.ModemManager1.Modem.Time
-
org.freedesktop.ModemManager1.Modem.Oma.CancelSession(), The CancelSession() method +
org.freedesktop.ModemManager1.Modem.Time.GetNetworkTime(), The GetNetworkTime() method
-
org.freedesktop.ModemManager1.Modem.Oma.Setup(), The Setup() method +
org.freedesktop.ModemManager1.Modem.Time::NetworkTimeChanged, The "NetworkTimeChanged" signal
-
org.freedesktop.ModemManager1.Modem.Oma.StartClientInitiatedSession(), The StartClientInitiatedSession() method +
org.freedesktop.ModemManager1.Modem.Time:NetworkTimezone, The "NetworkTimezone" property
-
org.freedesktop.ModemManager1.Modem.Oma::SessionStateChanged, The "SessionStateChanged" signal +
org.freedesktop.ModemManager1.Modem.Voice, org.freedesktop.ModemManager1.Modem.Voice
-
org.freedesktop.ModemManager1.Modem.Oma:Features, The "Features" property +
org.freedesktop.ModemManager1.Modem.Voice.CreateCall(), The CreateCall() method
-
org.freedesktop.ModemManager1.Modem.Oma:PendingNetworkInitiatedSessions, The "PendingNetworkInitiatedSessions" property +
org.freedesktop.ModemManager1.Modem.Voice.DeleteCall(), The DeleteCall() method
-
org.freedesktop.ModemManager1.Modem.Oma:SessionState, The "SessionState" property +
org.freedesktop.ModemManager1.Modem.Voice.ListCalls(), The ListCalls() method
-
org.freedesktop.ModemManager1.Modem.Oma:SessionType, The "SessionType" property +
org.freedesktop.ModemManager1.Modem.Voice::CallAdded, The "CallAdded" signal
-
org.freedesktop.ModemManager1.Modem.Reset(), The Reset() method +
org.freedesktop.ModemManager1.Modem.Voice::CallDeleted, The "CallDeleted" signal
-
org.freedesktop.ModemManager1.Modem.SetCurrentBands(), The SetCurrentBands() method +
org.freedesktop.ModemManager1.Modem.Voice:Calls, The "Calls" property
-
org.freedesktop.ModemManager1.Modem.SetCurrentCapabilities(), The SetCurrentCapabilities() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp, org.freedesktop.ModemManager1.Modem.Modem3gpp
-
org.freedesktop.ModemManager1.Modem.SetCurrentModes(), The SetCurrentModes() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Register(), The Register() method
-
org.freedesktop.ModemManager1.Modem.SetPowerState(), The SetPowerState() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Scan(), The Scan() method
-
org.freedesktop.ModemManager1.Modem.Signal, org.freedesktop.ModemManager1.Modem.Signal +
org.freedesktop.ModemManager1.Modem.Modem3gpp.SetEpsUeModeOperation(), The SetEpsUeModeOperation() method
-
org.freedesktop.ModemManager1.Modem.Signal.Setup(), The Setup() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.SetInitialEpsBearerSettings(), The SetInitialEpsBearerSettings() method
-
org.freedesktop.ModemManager1.Modem.Signal:Cdma, The "Cdma" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:EnabledFacilityLocks, The "EnabledFacilityLocks" property
-
org.freedesktop.ModemManager1.Modem.Signal:Evdo, The "Evdo" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:EpsUeModeOperation, The "EpsUeModeOperation" property
-
org.freedesktop.ModemManager1.Modem.Signal:Gsm, The "Gsm" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:Imei, The "Imei" property
-
org.freedesktop.ModemManager1.Modem.Signal:Lte, The "Lte" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearer, The "InitialEpsBearer" property
-
org.freedesktop.ModemManager1.Modem.Signal:Rate, The "Rate" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearerSettings, The "InitialEpsBearerSettings" property
-
org.freedesktop.ModemManager1.Modem.Signal:Umts, The "Umts" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp:OperatorCode, The "OperatorCode" property
-
org.freedesktop.ModemManager1.Modem.Simple, org.freedesktop.ModemManager1.Modem.Simple +
org.freedesktop.ModemManager1.Modem.Modem3gpp:OperatorName, The "OperatorName" property
-
org.freedesktop.ModemManager1.Modem.Simple.Connect(), The Connect() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp:Pco, The "Pco" property
-
org.freedesktop.ModemManager1.Modem.Simple.Disconnect(), The Disconnect() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp:RegistrationState, The "RegistrationState" property
-
org.freedesktop.ModemManager1.Modem.Simple.GetStatus(), The GetStatus() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp:SubscriptionState, The "SubscriptionState" property
-
org.freedesktop.ModemManager1.Modem.Time, org.freedesktop.ModemManager1.Modem.Time +
MMModem3gppEpsUeModeOperation, enum MMModem3gppEpsUeModeOperation
-
org.freedesktop.ModemManager1.Modem.Time.GetNetworkTime(), The GetNetworkTime() method +
MMModem3gppFacility, enum MMModem3gppFacility
-
org.freedesktop.ModemManager1.Modem.Time::NetworkTimeChanged, The "NetworkTimeChanged" signal +
MMModem3gppNetworkAvailability, enum MMModem3gppNetworkAvailability
-
org.freedesktop.ModemManager1.Modem.Time:NetworkTimezone, The "NetworkTimezone" property +
MMModem3gppRegistrationState, enum MMModem3gppRegistrationState
-
org.freedesktop.ModemManager1.Modem.Voice, org.freedesktop.ModemManager1.Modem.Voice +
MMModem3gppSubscriptionState, enum MMModem3gppSubscriptionState
-
org.freedesktop.ModemManager1.Modem.Voice.CreateCall(), The CreateCall() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd, org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd
-
org.freedesktop.ModemManager1.Modem.Voice.DeleteCall(), The DeleteCall() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Cancel(), The Cancel() method
-
org.freedesktop.ModemManager1.Modem.Voice.ListCalls(), The ListCalls() method +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Initiate(), The Initiate() method
-
org.freedesktop.ModemManager1.Modem.Voice::CallAdded, The "CallAdded" signal +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Respond(), The Respond() method
-
org.freedesktop.ModemManager1.Modem.Voice::CallDeleted, The "CallDeleted" signal +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:NetworkNotification, The "NetworkNotification" property
-
org.freedesktop.ModemManager1.Modem.Voice:Calls, The "Calls" property +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:NetworkRequest, The "NetworkRequest" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp, org.freedesktop.ModemManager1.Modem.Modem3gpp +
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:State, The "State" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Register(), The Register() method +
MMModem3gppUssdSessionState, enum MMModem3gppUssdSessionState
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Scan(), The Scan() method +
org.freedesktop.ModemManager1.Modem::StateChanged, The "StateChanged" signal
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:EnabledFacilityLocks, The "EnabledFacilityLocks" property +
org.freedesktop.ModemManager1.Modem:AccessTechnologies, The "AccessTechnologies" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:Imei, The "Imei" property +
org.freedesktop.ModemManager1.Modem:Bearers, The "Bearers" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:OperatorCode, The "OperatorCode" property +
org.freedesktop.ModemManager1.Modem:CurrentBands, The "CurrentBands" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:OperatorName, The "OperatorName" property +
org.freedesktop.ModemManager1.Modem:CurrentCapabilities, The "CurrentCapabilities" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:RegistrationState, The "RegistrationState" property +
org.freedesktop.ModemManager1.Modem:CurrentModes, The "CurrentModes" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp:SubscriptionState, The "SubscriptionState" property +
org.freedesktop.ModemManager1.Modem:Device, The "Device" property
-
MMModem3gppFacility, enum MMModem3gppFacility +
org.freedesktop.ModemManager1.Modem:DeviceIdentifier, The "DeviceIdentifier" property
-
MMModem3gppNetworkAvailability, enum MMModem3gppNetworkAvailability +
org.freedesktop.ModemManager1.Modem:Drivers, The "Drivers" property
-
MMModem3gppRegistrationState, enum MMModem3gppRegistrationState +
org.freedesktop.ModemManager1.Modem:EquipmentIdentifier, The "EquipmentIdentifier" property
-
MMModem3gppSubscriptionState, enum MMModem3gppSubscriptionState +
org.freedesktop.ModemManager1.Modem:HardwareRevision, The "HardwareRevision" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd, org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd +
org.freedesktop.ModemManager1.Modem:Manufacturer, The "Manufacturer" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Cancel(), The Cancel() method +
org.freedesktop.ModemManager1.Modem:MaxActiveBearers, The "MaxActiveBearers" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Initiate(), The Initiate() method +
org.freedesktop.ModemManager1.Modem:MaxBearers, The "MaxBearers" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.Respond(), The Respond() method +
org.freedesktop.ModemManager1.Modem:Model, The "Model" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:NetworkNotification, The "NetworkNotification" property +
org.freedesktop.ModemManager1.Modem:OwnNumbers, The "OwnNumbers" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:NetworkRequest, The "NetworkRequest" property +
org.freedesktop.ModemManager1.Modem:Plugin, The "Plugin" property
-
org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd:State, The "State" property +
org.freedesktop.ModemManager1.Modem:Ports, The "Ports" property
-
MMModem3gppUssdSessionState, enum MMModem3gppUssdSessionState +
org.freedesktop.ModemManager1.Modem:PowerState, The "PowerState" property
-
org.freedesktop.ModemManager1.Modem::StateChanged, The "StateChanged" signal +
org.freedesktop.ModemManager1.Modem:PrimaryPort, The "PrimaryPort" property
-
org.freedesktop.ModemManager1.Modem:AccessTechnologies, The "AccessTechnologies" property +
org.freedesktop.ModemManager1.Modem:Revision, The "Revision" property
-
org.freedesktop.ModemManager1.Modem:Bearers, The "Bearers" property +
org.freedesktop.ModemManager1.Modem:SignalQuality, The "SignalQuality" property
-
org.freedesktop.ModemManager1.Modem:CurrentBands, The "CurrentBands" property +
org.freedesktop.ModemManager1.Modem:Sim, The "Sim" property
-
org.freedesktop.ModemManager1.Modem:CurrentCapabilities, The "CurrentCapabilities" property +
org.freedesktop.ModemManager1.Modem:State, The "State" property
-
org.freedesktop.ModemManager1.Modem:CurrentModes, The "CurrentModes" property +
org.freedesktop.ModemManager1.Modem:StateFailedReason, The "StateFailedReason" property
-
org.freedesktop.ModemManager1.Modem:Device, The "Device" property +
org.freedesktop.ModemManager1.Modem:SupportedBands, The "SupportedBands" property
-
org.freedesktop.ModemManager1.Modem:DeviceIdentifier, The "DeviceIdentifier" property +
org.freedesktop.ModemManager1.Modem:SupportedCapabilities, The "SupportedCapabilities" property
-
org.freedesktop.ModemManager1.Modem:Drivers, The "Drivers" property +
org.freedesktop.ModemManager1.Modem:SupportedIpFamilies, The "SupportedIpFamilies" property
-
org.freedesktop.ModemManager1.Modem:EquipmentIdentifier, The "EquipmentIdentifier" property +
org.freedesktop.ModemManager1.Modem:SupportedModes, The "SupportedModes" property
-
org.freedesktop.ModemManager1.Modem:Manufacturer, The "Manufacturer" property +
org.freedesktop.ModemManager1.Modem:UnlockRequired, The "UnlockRequired" property
-
org.freedesktop.ModemManager1.Modem:MaxActiveBearers, The "MaxActiveBearers" property +
org.freedesktop.ModemManager1.Modem:UnlockRetries, The "UnlockRetries" property
-
org.freedesktop.ModemManager1.Modem:MaxBearers, The "MaxBearers" property +
MMModemAccessTechnology, enum MMModemAccessTechnology
-
org.freedesktop.ModemManager1.Modem:Model, The "Model" property +
MMModemBand, enum MMModemBand
-
org.freedesktop.ModemManager1.Modem:OwnNumbers, The "OwnNumbers" property +
MMModemCapability, enum MMModemCapability
-
org.freedesktop.ModemManager1.Modem:Plugin, The "Plugin" property +
org.freedesktop.ModemManager1.Modem.ModemCdma, org.freedesktop.ModemManager1.Modem.ModemCdma
-
org.freedesktop.ModemManager1.Modem:Ports, The "Ports" property +
org.freedesktop.ModemManager1.Modem.ModemCdma.Activate(), The Activate() method
-
org.freedesktop.ModemManager1.Modem:PowerState, The "PowerState" property +
org.freedesktop.ModemManager1.Modem.ModemCdma.ActivateManual(), The ActivateManual() method
-
org.freedesktop.ModemManager1.Modem:PrimaryPort, The "PrimaryPort" property +
org.freedesktop.ModemManager1.Modem.ModemCdma::ActivationStateChanged, The "ActivationStateChanged" signal
-
org.freedesktop.ModemManager1.Modem:Revision, The "Revision" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:ActivationState, The "ActivationState" property
-
org.freedesktop.ModemManager1.Modem:SignalQuality, The "SignalQuality" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:Cdma1xRegistrationState, The "Cdma1xRegistrationState" property
-
org.freedesktop.ModemManager1.Modem:Sim, The "Sim" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:Esn, The "Esn" property
-
org.freedesktop.ModemManager1.Modem:State, The "State" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:EvdoRegistrationState, The "EvdoRegistrationState" property
-
org.freedesktop.ModemManager1.Modem:StateFailedReason, The "StateFailedReason" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:Meid, The "Meid" property
-
org.freedesktop.ModemManager1.Modem:SupportedBands, The "SupportedBands" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:Nid, The "Nid" property
-
org.freedesktop.ModemManager1.Modem:SupportedCapabilities, The "SupportedCapabilities" property +
org.freedesktop.ModemManager1.Modem.ModemCdma:Sid, The "Sid" property
-
org.freedesktop.ModemManager1.Modem:SupportedIpFamilies, The "SupportedIpFamilies" property +
MMModemCdmaActivationState, enum MMModemCdmaActivationState
-
org.freedesktop.ModemManager1.Modem:SupportedModes, The "SupportedModes" property +
MMModemCdmaRegistrationState, enum MMModemCdmaRegistrationState
-
org.freedesktop.ModemManager1.Modem:UnlockRequired, The "UnlockRequired" property +
MMModemCdmaRmProtocol, enum MMModemCdmaRmProtocol
-
org.freedesktop.ModemManager1.Modem:UnlockRetries, The "UnlockRetries" property +
MMModemContactsStorage, enum MMModemContactsStorage
-
MMModemAccessTechnology, enum MMModemAccessTechnology +
MMModemFirmwareUpdateMethod, enum MMModemFirmwareUpdateMethod
-
MMModemBand, enum MMModemBand +
MMModemLocationAssistanceDataType, enum MMModemLocationAssistanceDataType
-
MMModemCapability, enum MMModemCapability +
MMModemLocationSource, enum MMModemLocationSource
-
org.freedesktop.ModemManager1.Modem.ModemCdma, org.freedesktop.ModemManager1.Modem.ModemCdma +
MMModemLock, enum MMModemLock
-
org.freedesktop.ModemManager1.Modem.ModemCdma.Activate(), The Activate() method +
MMModemMode, enum MMModemMode
-
org.freedesktop.ModemManager1.Modem.ModemCdma.ActivateManual(), The ActivateManual() method +
MMModemPortType, enum MMModemPortType
-
org.freedesktop.ModemManager1.Modem.ModemCdma::ActivationStateChanged, The "ActivationStateChanged" signal +
MMModemPowerState, enum MMModemPowerState
-
org.freedesktop.ModemManager1.Modem.ModemCdma:ActivationState, The "ActivationState" property +
MMModemState, enum MMModemState
-
org.freedesktop.ModemManager1.Modem.ModemCdma:Cdma1xRegistrationState, The "Cdma1xRegistrationState" property +
MMModemStateChangeReason, enum MMModemStateChangeReason
-
org.freedesktop.ModemManager1.Modem.ModemCdma:Esn, The "Esn" property +
MMModemStateFailedReason, enum MMModemStateFailedReason
-
org.freedesktop.ModemManager1.Modem.ModemCdma:EvdoRegistrationState, The "EvdoRegistrationState" property +
MM_MODEM_BAND_CDMA_BC0_CELLULAR_800, MM_MODEM_BAND_CDMA_BC0_CELLULAR_800, MM_MODEM_BAND_CDMA_BC0_CELLULAR_800
-
org.freedesktop.ModemManager1.Modem.ModemCdma:Meid, The "Meid" property +
MM_MODEM_BAND_CDMA_BC10_SECONDARY_800, MM_MODEM_BAND_CDMA_BC10_SECONDARY_800, MM_MODEM_BAND_CDMA_BC10_SECONDARY_800
-
org.freedesktop.ModemManager1.Modem.ModemCdma:Nid, The "Nid" property +
MM_MODEM_BAND_CDMA_BC11_PAMR_400, MM_MODEM_BAND_CDMA_BC11_PAMR_400, MM_MODEM_BAND_CDMA_BC11_PAMR_400
-
org.freedesktop.ModemManager1.Modem.ModemCdma:Sid, The "Sid" property +
MM_MODEM_BAND_CDMA_BC12_PAMR_800, MM_MODEM_BAND_CDMA_BC12_PAMR_800, MM_MODEM_BAND_CDMA_BC12_PAMR_800
-
MMModemCdmaActivationState, enum MMModemCdmaActivationState +
MM_MODEM_BAND_CDMA_BC13_IMT2000_2500, MM_MODEM_BAND_CDMA_BC13_IMT2000_2500, MM_MODEM_BAND_CDMA_BC13_IMT2000_2500
-
MMModemCdmaRegistrationState, enum MMModemCdmaRegistrationState +
MM_MODEM_BAND_CDMA_BC14_PCS2_1900, MM_MODEM_BAND_CDMA_BC14_PCS2_1900, MM_MODEM_BAND_CDMA_BC14_PCS2_1900
-
MMModemCdmaRmProtocol, enum MMModemCdmaRmProtocol +
MM_MODEM_BAND_CDMA_BC15_AWS, MM_MODEM_BAND_CDMA_BC15_AWS, MM_MODEM_BAND_CDMA_BC15_AWS
-
MMModemContactsStorage, enum MMModemContactsStorage +
MM_MODEM_BAND_CDMA_BC16_US_2500, MM_MODEM_BAND_CDMA_BC16_US_2500, MM_MODEM_BAND_CDMA_BC16_US_2500
-
MMModemLocationSource, enum MMModemLocationSource +
MM_MODEM_BAND_CDMA_BC17_US_FLO_2500, MM_MODEM_BAND_CDMA_BC17_US_FLO_2500, MM_MODEM_BAND_CDMA_BC17_US_FLO_2500
-
MMModemLock, enum MMModemLock +
MM_MODEM_BAND_CDMA_BC18_US_PS_700, MM_MODEM_BAND_CDMA_BC18_US_PS_700, MM_MODEM_BAND_CDMA_BC18_US_PS_700
-
MMModemMode, enum MMModemMode +
MM_MODEM_BAND_CDMA_BC19_US_LOWER_700, MM_MODEM_BAND_CDMA_BC19_US_LOWER_700, MM_MODEM_BAND_CDMA_BC19_US_LOWER_700
-
MMModemPortType, enum MMModemPortType +
MM_MODEM_BAND_CDMA_BC1_PCS_1900, MM_MODEM_BAND_CDMA_BC1_PCS_1900, MM_MODEM_BAND_CDMA_BC1_PCS_1900
-
MMModemPowerState, enum MMModemPowerState +
MM_MODEM_BAND_CDMA_BC2_TACS, MM_MODEM_BAND_CDMA_BC2_TACS, MM_MODEM_BAND_CDMA_BC2_TACS
-
MMModemState, enum MMModemState +
MM_MODEM_BAND_CDMA_BC3_JTACS, MM_MODEM_BAND_CDMA_BC3_JTACS, MM_MODEM_BAND_CDMA_BC3_JTACS
-
MMModemStateChangeReason, enum MMModemStateChangeReason +
MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS, MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS, MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS
-
MMModemStateFailedReason, enum MMModemStateFailedReason +
MM_MODEM_BAND_CDMA_BC5_NMT450, MM_MODEM_BAND_CDMA_BC5_NMT450, MM_MODEM_BAND_CDMA_BC5_NMT450 +
+
MM_MODEM_BAND_CDMA_BC6_IMT2000, MM_MODEM_BAND_CDMA_BC6_IMT2000, MM_MODEM_BAND_CDMA_BC6_IMT2000 +
+
MM_MODEM_BAND_CDMA_BC7_CELLULAR_700, MM_MODEM_BAND_CDMA_BC7_CELLULAR_700, MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 +
+
MM_MODEM_BAND_CDMA_BC8_1800, MM_MODEM_BAND_CDMA_BC8_1800, MM_MODEM_BAND_CDMA_BC8_1800 +
+
MM_MODEM_BAND_CDMA_BC9_900, MM_MODEM_BAND_CDMA_BC9_900, MM_MODEM_BAND_CDMA_BC9_900 +
+
MM_MODEM_BAND_EUTRAN_I, MM_MODEM_BAND_EUTRAN_I, MM_MODEM_BAND_EUTRAN_I +
+
MM_MODEM_BAND_EUTRAN_II, MM_MODEM_BAND_EUTRAN_II, MM_MODEM_BAND_EUTRAN_II +
+
MM_MODEM_BAND_EUTRAN_III, MM_MODEM_BAND_EUTRAN_III, MM_MODEM_BAND_EUTRAN_III +
+
MM_MODEM_BAND_EUTRAN_IV, MM_MODEM_BAND_EUTRAN_IV, MM_MODEM_BAND_EUTRAN_IV +
+
MM_MODEM_BAND_EUTRAN_IX, MM_MODEM_BAND_EUTRAN_IX, MM_MODEM_BAND_EUTRAN_IX +
+
MM_MODEM_BAND_EUTRAN_V, MM_MODEM_BAND_EUTRAN_V, MM_MODEM_BAND_EUTRAN_V +
+
MM_MODEM_BAND_EUTRAN_VI, MM_MODEM_BAND_EUTRAN_VI, MM_MODEM_BAND_EUTRAN_VI +
+
MM_MODEM_BAND_EUTRAN_VII, MM_MODEM_BAND_EUTRAN_VII, MM_MODEM_BAND_EUTRAN_VII +
+
MM_MODEM_BAND_EUTRAN_VIII, MM_MODEM_BAND_EUTRAN_VIII, MM_MODEM_BAND_EUTRAN_VIII +
+
MM_MODEM_BAND_EUTRAN_X, MM_MODEM_BAND_EUTRAN_X, MM_MODEM_BAND_EUTRAN_X +
+
MM_MODEM_BAND_EUTRAN_XI, MM_MODEM_BAND_EUTRAN_XI, MM_MODEM_BAND_EUTRAN_XI +
+
MM_MODEM_BAND_EUTRAN_XII, MM_MODEM_BAND_EUTRAN_XII, MM_MODEM_BAND_EUTRAN_XII +
+
MM_MODEM_BAND_EUTRAN_XIII, MM_MODEM_BAND_EUTRAN_XIII, MM_MODEM_BAND_EUTRAN_XIII +
+
MM_MODEM_BAND_EUTRAN_XIV, MM_MODEM_BAND_EUTRAN_XIV, MM_MODEM_BAND_EUTRAN_XIV +
+
MM_MODEM_BAND_EUTRAN_XIX, MM_MODEM_BAND_EUTRAN_XIX, MM_MODEM_BAND_EUTRAN_XIX +
+
MM_MODEM_BAND_EUTRAN_XL, MM_MODEM_BAND_EUTRAN_XL, MM_MODEM_BAND_EUTRAN_XL +
+
MM_MODEM_BAND_EUTRAN_XLI, MM_MODEM_BAND_EUTRAN_XLI, MM_MODEM_BAND_EUTRAN_XLI +
+
MM_MODEM_BAND_EUTRAN_XLII, MM_MODEM_BAND_EUTRAN_XLII, MM_MODEM_BAND_EUTRAN_XLII +
+
MM_MODEM_BAND_EUTRAN_XLIII, MM_MODEM_BAND_EUTRAN_XLIII, MM_MODEM_BAND_EUTRAN_XLIII +
+
MM_MODEM_BAND_EUTRAN_XLIV, MM_MODEM_BAND_EUTRAN_XLIV, MM_MODEM_BAND_EUTRAN_XLIV +
+
MM_MODEM_BAND_EUTRAN_XVII, MM_MODEM_BAND_EUTRAN_XVII, MM_MODEM_BAND_EUTRAN_XVII +
+
MM_MODEM_BAND_EUTRAN_XVIII, MM_MODEM_BAND_EUTRAN_XVIII, MM_MODEM_BAND_EUTRAN_XVIII +
+
MM_MODEM_BAND_EUTRAN_XX, MM_MODEM_BAND_EUTRAN_XX, MM_MODEM_BAND_EUTRAN_XX +
+
MM_MODEM_BAND_EUTRAN_XXI, MM_MODEM_BAND_EUTRAN_XXI, MM_MODEM_BAND_EUTRAN_XXI +
+
MM_MODEM_BAND_EUTRAN_XXII, MM_MODEM_BAND_EUTRAN_XXII, MM_MODEM_BAND_EUTRAN_XXII +
+
MM_MODEM_BAND_EUTRAN_XXIII, MM_MODEM_BAND_EUTRAN_XXIII, MM_MODEM_BAND_EUTRAN_XXIII +
+
MM_MODEM_BAND_EUTRAN_XXIV, MM_MODEM_BAND_EUTRAN_XXIV, MM_MODEM_BAND_EUTRAN_XXIV +
+
MM_MODEM_BAND_EUTRAN_XXV, MM_MODEM_BAND_EUTRAN_XXV, MM_MODEM_BAND_EUTRAN_XXV +
+
MM_MODEM_BAND_EUTRAN_XXVI, MM_MODEM_BAND_EUTRAN_XXVI, MM_MODEM_BAND_EUTRAN_XXVI +
+
MM_MODEM_BAND_EUTRAN_XXXIII, MM_MODEM_BAND_EUTRAN_XXXIII, MM_MODEM_BAND_EUTRAN_XXXIII +
+
MM_MODEM_BAND_EUTRAN_XXXIV, MM_MODEM_BAND_EUTRAN_XXXIV, MM_MODEM_BAND_EUTRAN_XXXIV +
+
MM_MODEM_BAND_EUTRAN_XXXIX, MM_MODEM_BAND_EUTRAN_XXXIX, MM_MODEM_BAND_EUTRAN_XXXIX +
+
MM_MODEM_BAND_EUTRAN_XXXV, MM_MODEM_BAND_EUTRAN_XXXV, MM_MODEM_BAND_EUTRAN_XXXV +
+
MM_MODEM_BAND_EUTRAN_XXXVI, MM_MODEM_BAND_EUTRAN_XXXVI, MM_MODEM_BAND_EUTRAN_XXXVI +
+
MM_MODEM_BAND_EUTRAN_XXXVII, MM_MODEM_BAND_EUTRAN_XXXVII, MM_MODEM_BAND_EUTRAN_XXXVII +
+
MM_MODEM_BAND_EUTRAN_XXXVIII, MM_MODEM_BAND_EUTRAN_XXXVIII, MM_MODEM_BAND_EUTRAN_XXXVIII +
+
MM_MODEM_BAND_U17IV, MM_MODEM_BAND_U17IV, MM_MODEM_BAND_U17IV +
+
MM_MODEM_BAND_U17IX, MM_MODEM_BAND_U17IX, MM_MODEM_BAND_U17IX +
+
MM_MODEM_BAND_U1800, MM_MODEM_BAND_U1800, MM_MODEM_BAND_U1800 +
+
MM_MODEM_BAND_U1900, MM_MODEM_BAND_U1900, MM_MODEM_BAND_U1900 +
+
MM_MODEM_BAND_U2100, MM_MODEM_BAND_U2100, MM_MODEM_BAND_U2100 +
+
MM_MODEM_BAND_U2600, MM_MODEM_BAND_U2600, MM_MODEM_BAND_U2600 +
+
MM_MODEM_BAND_U800, MM_MODEM_BAND_U800, MM_MODEM_BAND_U800 +
+
MM_MODEM_BAND_U850, MM_MODEM_BAND_U850, MM_MODEM_BAND_U850 +
+
MM_MODEM_BAND_U900, MM_MODEM_BAND_U900, MM_MODEM_BAND_U900

O

-
MMOmaFeature, enum MMOmaFeature +
MMOmaFeature, enum MMOmaFeature +
+
MMOmaSessionState, enum MMOmaSessionState +
+
MMOmaSessionStateFailedReason, enum MMOmaSessionStateFailedReason +
+
MMOmaSessionType, enum MMOmaSessionType
-
MMOmaSessionState, enum MMOmaSessionState +
org.freedesktop.ModemManager1, org.freedesktop.ModemManager1
-
MMOmaSessionStateFailedReason, enum MMOmaSessionStateFailedReason +
org.freedesktop.ModemManager1.InhibitDevice(), The InhibitDevice() method
-
MMOmaSessionType, enum MMOmaSessionType +
org.freedesktop.ModemManager1.ReportKernelEvent(), The ReportKernelEvent() method
-
org.freedesktop.ModemManager1, org.freedesktop.ModemManager1 +
org.freedesktop.ModemManager1.ScanDevices(), The ScanDevices() method
-
org.freedesktop.ModemManager1.ScanDevices(), The ScanDevices() method +
org.freedesktop.ModemManager1.SetLogging(), The SetLogging() method
-
org.freedesktop.ModemManager1.SetLogging(), The SetLogging() method +
org.freedesktop.ModemManager1:Version, The "Version" property

S

-
MMSerialError, enum MMSerialError +
MMSerialError, enum MMSerialError
-
org.freedesktop.ModemManager1.Sim, org.freedesktop.ModemManager1.Sim +
org.freedesktop.ModemManager1.Sim, org.freedesktop.ModemManager1.Sim
-
org.freedesktop.ModemManager1.Sim.ChangePin(), The ChangePin() method +
org.freedesktop.ModemManager1.Sim.ChangePin(), The ChangePin() method
-
org.freedesktop.ModemManager1.Sim.EnablePin(), The EnablePin() method +
org.freedesktop.ModemManager1.Sim.EnablePin(), The EnablePin() method
-
org.freedesktop.ModemManager1.Sim.SendPin(), The SendPin() method +
org.freedesktop.ModemManager1.Sim.SendPin(), The SendPin() method
-
org.freedesktop.ModemManager1.Sim.SendPuk(), The SendPuk() method +
org.freedesktop.ModemManager1.Sim.SendPuk(), The SendPuk() method
-
org.freedesktop.ModemManager1.Sim:Imsi, The "Imsi" property +
org.freedesktop.ModemManager1.Sim:Imsi, The "Imsi" property
-
org.freedesktop.ModemManager1.Sim:OperatorIdentifier, The "OperatorIdentifier" property +
org.freedesktop.ModemManager1.Sim:OperatorIdentifier, The "OperatorIdentifier" property
-
org.freedesktop.ModemManager1.Sim:OperatorName, The "OperatorName" property +
org.freedesktop.ModemManager1.Sim:OperatorName, The "OperatorName" property
-
org.freedesktop.ModemManager1.Sim:SimIdentifier, The "SimIdentifier" property +
org.freedesktop.ModemManager1.Sim:SimIdentifier, The "SimIdentifier" property
-
org.freedesktop.ModemManager1.Sms, org.freedesktop.ModemManager1.Sms +
org.freedesktop.ModemManager1.Sms, org.freedesktop.ModemManager1.Sms
-
org.freedesktop.ModemManager1.Sms.Send(), The Send() method +
org.freedesktop.ModemManager1.Sms.Send(), The Send() method
-
org.freedesktop.ModemManager1.Sms.Store(), The Store() method +
org.freedesktop.ModemManager1.Sms.Store(), The Store() method
-
org.freedesktop.ModemManager1.Sms:Class, The "Class" property +
org.freedesktop.ModemManager1.Sms:Class, The "Class" property
-
org.freedesktop.ModemManager1.Sms:Data, The "Data" property +
org.freedesktop.ModemManager1.Sms:Data, The "Data" property
-
org.freedesktop.ModemManager1.Sms:DeliveryReportRequest, The "DeliveryReportRequest" property +
org.freedesktop.ModemManager1.Sms:DeliveryReportRequest, The "DeliveryReportRequest" property
-
org.freedesktop.ModemManager1.Sms:DeliveryState, The "DeliveryState" property +
org.freedesktop.ModemManager1.Sms:DeliveryState, The "DeliveryState" property
-
org.freedesktop.ModemManager1.Sms:DischargeTimestamp, The "DischargeTimestamp" property +
org.freedesktop.ModemManager1.Sms:DischargeTimestamp, The "DischargeTimestamp" property
-
org.freedesktop.ModemManager1.Sms:MessageReference, The "MessageReference" property +
org.freedesktop.ModemManager1.Sms:MessageReference, The "MessageReference" property
-
org.freedesktop.ModemManager1.Sms:Number, The "Number" property +
org.freedesktop.ModemManager1.Sms:Number, The "Number" property
-
org.freedesktop.ModemManager1.Sms:PduType, The "PduType" property +
org.freedesktop.ModemManager1.Sms:PduType, The "PduType" property
-
org.freedesktop.ModemManager1.Sms:ServiceCategory, The "ServiceCategory" property +
org.freedesktop.ModemManager1.Sms:ServiceCategory, The "ServiceCategory" property
-
org.freedesktop.ModemManager1.Sms:SMSC, The "SMSC" property +
org.freedesktop.ModemManager1.Sms:SMSC, The "SMSC" property
-
org.freedesktop.ModemManager1.Sms:State, The "State" property +
org.freedesktop.ModemManager1.Sms:State, The "State" property
-
org.freedesktop.ModemManager1.Sms:Storage, The "Storage" property +
org.freedesktop.ModemManager1.Sms:Storage, The "Storage" property
-
org.freedesktop.ModemManager1.Sms:TeleserviceId, The "TeleserviceId" property +
org.freedesktop.ModemManager1.Sms:TeleserviceId, The "TeleserviceId" property
-
org.freedesktop.ModemManager1.Sms:Text, The "Text" property +
org.freedesktop.ModemManager1.Sms:Text, The "Text" property
-
org.freedesktop.ModemManager1.Sms:Timestamp, The "Timestamp" property +
org.freedesktop.ModemManager1.Sms:Timestamp, The "Timestamp" property
-
org.freedesktop.ModemManager1.Sms:Validity, The "Validity" property +
org.freedesktop.ModemManager1.Sms:Validity, The "Validity" property
-
MMSmsCdmaServiceCategory, enum MMSmsCdmaServiceCategory +
MMSmsCdmaServiceCategory, enum MMSmsCdmaServiceCategory
-
MMSmsCdmaTeleserviceId, enum MMSmsCdmaTeleserviceId +
MMSmsCdmaTeleserviceId, enum MMSmsCdmaTeleserviceId
-
MMSmsDeliveryState, enum MMSmsDeliveryState +
MMSmsDeliveryState, enum MMSmsDeliveryState
-
MMSmsPduType, enum MMSmsPduType +
MMSmsPduType, enum MMSmsPduType
-
MMSmsState, enum MMSmsState +
MMSmsState, enum MMSmsState
-
MMSmsStorage, enum MMSmsStorage +
MMSmsStorage, enum MMSmsStorage
-
MMSmsValidityType, enum MMSmsValidityType +
MMSmsValidityType, enum MMSmsValidityType
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager-API-break-replacements.html modemmanager-1.10.0/docs/reference/api/html/ModemManager-API-break-replacements.html --- modemmanager-1.6.8/docs/reference/api/html/ModemManager-API-break-replacements.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager-API-break-replacements.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,1101 @@ + + + + +API break replacements: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

API break replacements

+

API break replacements

+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineMM_MODEM_BAND_U2100
#defineMM_MODEM_BAND_U1900
#defineMM_MODEM_BAND_U1800
#defineMM_MODEM_BAND_U17IV
#defineMM_MODEM_BAND_U850
#defineMM_MODEM_BAND_U800
#defineMM_MODEM_BAND_U2600
#defineMM_MODEM_BAND_U900
#defineMM_MODEM_BAND_U17IX
#defineMM_MODEM_BAND_EUTRAN_I
#defineMM_MODEM_BAND_EUTRAN_II
#defineMM_MODEM_BAND_EUTRAN_III
#defineMM_MODEM_BAND_EUTRAN_IV
#defineMM_MODEM_BAND_EUTRAN_V
#defineMM_MODEM_BAND_EUTRAN_VI
#defineMM_MODEM_BAND_EUTRAN_VII
#defineMM_MODEM_BAND_EUTRAN_VIII
#defineMM_MODEM_BAND_EUTRAN_IX
#defineMM_MODEM_BAND_EUTRAN_X
#defineMM_MODEM_BAND_EUTRAN_XI
#defineMM_MODEM_BAND_EUTRAN_XII
#defineMM_MODEM_BAND_EUTRAN_XIII
#defineMM_MODEM_BAND_EUTRAN_XIV
#defineMM_MODEM_BAND_EUTRAN_XVII
#defineMM_MODEM_BAND_EUTRAN_XVIII
#defineMM_MODEM_BAND_EUTRAN_XIX
#defineMM_MODEM_BAND_EUTRAN_XX
#defineMM_MODEM_BAND_EUTRAN_XXI
#defineMM_MODEM_BAND_EUTRAN_XXII
#defineMM_MODEM_BAND_EUTRAN_XXIII
#defineMM_MODEM_BAND_EUTRAN_XXIV
#defineMM_MODEM_BAND_EUTRAN_XXV
#defineMM_MODEM_BAND_EUTRAN_XXVI
#defineMM_MODEM_BAND_EUTRAN_XXXIII
#defineMM_MODEM_BAND_EUTRAN_XXXIV
#defineMM_MODEM_BAND_EUTRAN_XXXV
#defineMM_MODEM_BAND_EUTRAN_XXXVI
#defineMM_MODEM_BAND_EUTRAN_XXXVII
#defineMM_MODEM_BAND_EUTRAN_XXXVIII
#defineMM_MODEM_BAND_EUTRAN_XXXIX
#defineMM_MODEM_BAND_EUTRAN_XL
#defineMM_MODEM_BAND_EUTRAN_XLI
#defineMM_MODEM_BAND_EUTRAN_XLII
#defineMM_MODEM_BAND_EUTRAN_XLIII
#defineMM_MODEM_BAND_EUTRAN_XLIV
#defineMM_MODEM_BAND_CDMA_BC0_CELLULAR_800
#defineMM_MODEM_BAND_CDMA_BC1_PCS_1900
#defineMM_MODEM_BAND_CDMA_BC2_TACS
#defineMM_MODEM_BAND_CDMA_BC3_JTACS
#defineMM_MODEM_BAND_CDMA_BC4_KOREAN_PCS
#defineMM_MODEM_BAND_CDMA_BC5_NMT450
#defineMM_MODEM_BAND_CDMA_BC6_IMT2000
#defineMM_MODEM_BAND_CDMA_BC7_CELLULAR_700
#defineMM_MODEM_BAND_CDMA_BC8_1800
#defineMM_MODEM_BAND_CDMA_BC9_900
#defineMM_MODEM_BAND_CDMA_BC10_SECONDARY_800
#defineMM_MODEM_BAND_CDMA_BC11_PAMR_400
#defineMM_MODEM_BAND_CDMA_BC12_PAMR_800
#defineMM_MODEM_BAND_CDMA_BC13_IMT2000_2500
#defineMM_MODEM_BAND_CDMA_BC14_PCS2_1900
#defineMM_MODEM_BAND_CDMA_BC15_AWS
#defineMM_MODEM_BAND_CDMA_BC16_US_2500
#defineMM_MODEM_BAND_CDMA_BC17_US_FLO_2500
#defineMM_MODEM_BAND_CDMA_BC18_US_PS_700
#defineMM_MODEM_BAND_CDMA_BC19_US_LOWER_700
+
+
+

Description

+

These compatibility types and methods are flagged as deprecated and +therefore shouldn't be used in newly written code. They are provided to +avoid unnecessary API/ABI breaks.

+
+
+

Functions

+

+
+
+

Types and Values

+
+

MM_MODEM_BAND_U2100

+
#define MM_MODEM_BAND_U2100 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_1)
+
+
+

MM_MODEM_BAND_U2100 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_1 instead.

+
+

WCDMA 2100 MHz (UTRAN band 1).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U1900

+
#define MM_MODEM_BAND_U1900 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_2)
+
+
+

MM_MODEM_BAND_U1900 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_2 instead.

+
+

WCDMA 1900 MHz (UTRAN band 2).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U1800

+
#define MM_MODEM_BAND_U1800 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_3)
+
+
+

MM_MODEM_BAND_U1800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_3 instead.

+
+

WCDMA 1800 MHz (UTRAN band 3).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U17IV

+
#define MM_MODEM_BAND_U17IV ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_4)
+
+
+

MM_MODEM_BAND_U17IV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_4 instead.

+
+

AWS 1700/2100 MHz (UTRAN band 4).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U850

+
#define MM_MODEM_BAND_U850 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_5)
+
+
+

MM_MODEM_BAND_U850 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_5 instead.

+
+

UMTS 850 MHz (UTRAN band 5).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U800

+
#define MM_MODEM_BAND_U800 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_6)
+
+
+

MM_MODEM_BAND_U800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_6 instead.

+
+

UMTS 800 MHz (UTRAN band 6).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U2600

+
#define MM_MODEM_BAND_U2600 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_7)
+
+
+

MM_MODEM_BAND_U2600 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_7 instead.

+
+

UMTS 2600 MHz (UTRAN band 7).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U900

+
#define MM_MODEM_BAND_U900 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_8)
+
+
+

MM_MODEM_BAND_U900 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_8 instead.

+
+

UMTS 900 MHz (UTRAN band 8).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_U17IX

+
#define MM_MODEM_BAND_U17IX ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_9)
+
+
+

MM_MODEM_BAND_U17IX has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_UTRAN_9 instead.

+
+

UMTS 1700 MHz (UTRAN band 9).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_I

+
#define MM_MODEM_BAND_EUTRAN_I ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_1)
+
+
+

MM_MODEM_BAND_EUTRAN_I has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_1 instead.

+
+

E-UTRAN band 1.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_II

+
#define MM_MODEM_BAND_EUTRAN_II ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_2)
+
+
+

MM_MODEM_BAND_EUTRAN_II has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_2 instead.

+
+

E-UTRAN band 2.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_III

+
#define MM_MODEM_BAND_EUTRAN_III ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_3)
+
+
+

MM_MODEM_BAND_EUTRAN_III has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_3 instead.

+
+

E-UTRAN band 3.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_IV

+
#define MM_MODEM_BAND_EUTRAN_IV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_4)
+
+
+

MM_MODEM_BAND_EUTRAN_IV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_4 instead.

+
+

E-UTRAN band 4.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_V

+
#define MM_MODEM_BAND_EUTRAN_V ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_5)
+
+
+

MM_MODEM_BAND_EUTRAN_V has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_5 instead.

+
+

E-UTRAN band 5.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_VI

+
#define MM_MODEM_BAND_EUTRAN_VI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_6)
+
+
+

MM_MODEM_BAND_EUTRAN_VI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_6 instead.

+
+

E-UTRAN band 6.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_VII

+
#define MM_MODEM_BAND_EUTRAN_VII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_7)
+
+
+

MM_MODEM_BAND_EUTRAN_VII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_7 instead.

+
+

E-UTRAN band 7.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_VIII

+
#define MM_MODEM_BAND_EUTRAN_VIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_8)
+
+
+

MM_MODEM_BAND_EUTRAN_VIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_8 instead.

+
+

E-UTRAN band 8.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_IX

+
#define MM_MODEM_BAND_EUTRAN_IX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_9)
+
+
+

MM_MODEM_BAND_EUTRAN_IX has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_9 instead.

+
+

E-UTRAN band 9.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_X

+
#define MM_MODEM_BAND_EUTRAN_X ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_10)
+
+
+

MM_MODEM_BAND_EUTRAN_X has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_10 instead.

+
+

E-UTRAN band 10.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XI

+
#define MM_MODEM_BAND_EUTRAN_XI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_11)
+
+
+

MM_MODEM_BAND_EUTRAN_XI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_11 instead.

+
+

E-UTRAN band 11.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XII

+
#define MM_MODEM_BAND_EUTRAN_XII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_12)
+
+
+

MM_MODEM_BAND_EUTRAN_XII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_12 instead.

+
+

E-UTRAN band 12.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XIII

+
#define MM_MODEM_BAND_EUTRAN_XIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_13)
+
+
+

MM_MODEM_BAND_EUTRAN_XIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_13 instead.

+
+

E-UTRAN band 13.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XIV

+
#define MM_MODEM_BAND_EUTRAN_XIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_14)
+
+
+

MM_MODEM_BAND_EUTRAN_XIV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_14 instead.

+
+

E-UTRAN band 14.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XVII

+
#define MM_MODEM_BAND_EUTRAN_XVII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_17)
+
+
+

MM_MODEM_BAND_EUTRAN_XVII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_17 instead.

+
+

E-UTRAN band 17.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XVIII

+
#define MM_MODEM_BAND_EUTRAN_XVIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_18)
+
+
+

MM_MODEM_BAND_EUTRAN_XVIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_18 instead.

+
+

E-UTRAN band 18.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XIX

+
#define MM_MODEM_BAND_EUTRAN_XIX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_19)
+
+
+

MM_MODEM_BAND_EUTRAN_XIX has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_19 instead.

+
+

E-UTRAN band 19.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XX

+
#define MM_MODEM_BAND_EUTRAN_XX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_20)
+
+
+

MM_MODEM_BAND_EUTRAN_XX has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_20 instead.

+
+

E-UTRAN band 20.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXI

+
#define MM_MODEM_BAND_EUTRAN_XXI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_21)
+
+
+

MM_MODEM_BAND_EUTRAN_XXI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_21 instead.

+
+

E-UTRAN band 21.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXII

+
#define MM_MODEM_BAND_EUTRAN_XXII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_22)
+
+
+

MM_MODEM_BAND_EUTRAN_XXII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_22 instead.

+
+

E-UTRAN band 22.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXIII

+
#define MM_MODEM_BAND_EUTRAN_XXIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_23)
+
+
+

MM_MODEM_BAND_EUTRAN_XXIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_23 instead.

+
+

E-UTRAN band 23.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXIV

+
#define MM_MODEM_BAND_EUTRAN_XXIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_24)
+
+
+

MM_MODEM_BAND_EUTRAN_XXIV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_24 instead.

+
+

E-UTRAN band 24.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXV

+
#define MM_MODEM_BAND_EUTRAN_XXV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_25)
+
+
+

MM_MODEM_BAND_EUTRAN_XXV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_25 instead.

+
+

E-UTRAN band 25.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXVI

+
#define MM_MODEM_BAND_EUTRAN_XXVI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_26)
+
+
+

MM_MODEM_BAND_EUTRAN_XXVI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_26 instead.

+
+

E-UTRAN band 26.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIII

+
#define MM_MODEM_BAND_EUTRAN_XXXIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_33)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_33 instead.

+
+

E-UTRAN band 33.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIV

+
#define MM_MODEM_BAND_EUTRAN_XXXIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_34)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_34 instead.

+
+

E-UTRAN band 34.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXV

+
#define MM_MODEM_BAND_EUTRAN_XXXV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_35)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_35 instead.

+
+

E-UTRAN band 35.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVI

+
#define MM_MODEM_BAND_EUTRAN_XXXVI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_36)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_36 instead.

+
+

E-UTRAN band 36.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVII

+
#define MM_MODEM_BAND_EUTRAN_XXXVII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_37)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_37 instead.

+
+

E-UTRAN band 37.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVIII

+
#define MM_MODEM_BAND_EUTRAN_XXXVIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_38)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXVIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_38 instead.

+
+

E-UTRAN band 38.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIX

+
#define MM_MODEM_BAND_EUTRAN_XXXIX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_39)
+
+
+

MM_MODEM_BAND_EUTRAN_XXXIX has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_39 instead.

+
+

E-UTRAN band 39.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XL

+
#define MM_MODEM_BAND_EUTRAN_XL ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_40)
+
+
+

MM_MODEM_BAND_EUTRAN_XL has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_40 instead.

+
+

E-UTRAN band 40.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XLI

+
#define MM_MODEM_BAND_EUTRAN_XLI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_41)
+
+
+

MM_MODEM_BAND_EUTRAN_XLI has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_41 instead.

+
+

E-UTRAN band 41.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XLII

+
#define MM_MODEM_BAND_EUTRAN_XLII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_42)
+
+
+

MM_MODEM_BAND_EUTRAN_XLII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_42 instead.

+
+

E-UTRAN band 42.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XLIII

+
#define MM_MODEM_BAND_EUTRAN_XLIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_43)
+
+
+

MM_MODEM_BAND_EUTRAN_XLIII has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_43 instead.

+
+

E-UTRAN band 43.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_EUTRAN_XLIV

+
#define MM_MODEM_BAND_EUTRAN_XLIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_44)
+
+
+

MM_MODEM_BAND_EUTRAN_XLIV has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_EUTRAN_44 instead.

+
+

E-UTRAN band 44.

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC0_CELLULAR_800

+
#define MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC0)
+
+
+

MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC0 instead.

+
+

CDMA Band Class 0 (US Cellular 850MHz)

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC1_PCS_1900

+
#define MM_MODEM_BAND_CDMA_BC1_PCS_1900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC1)
+
+
+

MM_MODEM_BAND_CDMA_BC1_PCS_1900 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC1 instead.

+
+

CDMA Band Class 1 (US PCS 1900MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC2_TACS

+
#define MM_MODEM_BAND_CDMA_BC2_TACS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC2)
+
+
+

MM_MODEM_BAND_CDMA_BC2_TACS has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC2 instead.

+
+

CDMA Band Class 2 (UK TACS 900MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC3_JTACS

+
#define MM_MODEM_BAND_CDMA_BC3_JTACS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC3)
+
+
+

MM_MODEM_BAND_CDMA_BC3_JTACS has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC3 instead.

+
+

CDMA Band Class 3 (Japanese TACS).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS

+
#define MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC4)
+
+
+

MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC4 instead.

+
+

CDMA Band Class 4 (Korean PCS).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC5_NMT450

+
#define MM_MODEM_BAND_CDMA_BC5_NMT450 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC5)
+
+
+

MM_MODEM_BAND_CDMA_BC5_NMT450 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC5 instead.

+
+

CDMA Band Class 5 (NMT 450MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC6_IMT2000

+
#define MM_MODEM_BAND_CDMA_BC6_IMT2000 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC6)
+
+
+

MM_MODEM_BAND_CDMA_BC6_IMT2000 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC6 instead.

+
+

CDMA Band Class 6 (IMT2000 2100MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC7_CELLULAR_700

+
#define MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC7)
+
+
+

MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC7 instead.

+
+

CDMA Band Class 7 (Cellular 700MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC8_1800

+
#define MM_MODEM_BAND_CDMA_BC8_1800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC8)
+
+
+

MM_MODEM_BAND_CDMA_BC8_1800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC8 instead.

+
+

CDMA Band Class 8 (1800MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC9_900

+
#define MM_MODEM_BAND_CDMA_BC9_900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC9)
+
+
+

MM_MODEM_BAND_CDMA_BC9_900 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC9 instead.

+
+

CDMA Band Class 9 (900MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC10_SECONDARY_800

+
#define MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC10)
+
+
+

MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC10 instead.

+
+

CDMA Band Class 10 (US Secondary 800).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC11_PAMR_400

+
#define MM_MODEM_BAND_CDMA_BC11_PAMR_400 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC11)
+
+
+

MM_MODEM_BAND_CDMA_BC11_PAMR_400 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC11 instead.

+
+

CDMA Band Class 11 (European PAMR 400MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC12_PAMR_800

+
#define MM_MODEM_BAND_CDMA_BC12_PAMR_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC12)
+
+
+

MM_MODEM_BAND_CDMA_BC12_PAMR_800 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC12 instead.

+
+

CDMA Band Class 12 (PAMR 800MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC13_IMT2000_2500

+
#define MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC13)
+
+
+

MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC13 instead.

+
+

CDMA Band Class 13 (IMT2000 2500MHz Expansion).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC14_PCS2_1900

+
#define MM_MODEM_BAND_CDMA_BC14_PCS2_1900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC14)
+
+
+

MM_MODEM_BAND_CDMA_BC14_PCS2_1900 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC14 instead.

+
+

CDMA Band Class 14 (More US PCS 1900MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC15_AWS

+
#define MM_MODEM_BAND_CDMA_BC15_AWS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC15)
+
+
+

MM_MODEM_BAND_CDMA_BC15_AWS has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC15 instead.

+
+

CDMA Band Class 15 (AWS 1700MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC16_US_2500

+
#define MM_MODEM_BAND_CDMA_BC16_US_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC16)
+
+
+

MM_MODEM_BAND_CDMA_BC16_US_2500 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC16 instead.

+
+

CDMA Band Class 16 (US 2500MHz).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC17_US_FLO_2500

+
#define MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC17)
+
+
+

MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC17 instead.

+
+

CDMA Band Class 17 (US 2500MHz Forward Link Only).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC18_US_PS_700

+
#define MM_MODEM_BAND_CDMA_BC18_US_PS_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC18)
+
+
+

MM_MODEM_BAND_CDMA_BC18_US_PS_700 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC18 instead.

+
+

CDMA Band Class 18 (US 700MHz Public Safety).

+

Since: 1.0

+
+
+
+

MM_MODEM_BAND_CDMA_BC19_US_LOWER_700

+
#define MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC19)
+
+
+

MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 has been deprecated since version 1.8.0 and should not be used in newly-written code.

+

Use MM_MODEM_BAND_CDMA_BC19 instead.

+
+

CDMA Band Class 19 (US Lower 700MHz).

+

Since: 1.0

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager-Common-udev-tags.html modemmanager-1.10.0/docs/reference/api/html/ModemManager-Common-udev-tags.html --- modemmanager-1.6.8/docs/reference/api/html/ModemManager-Common-udev-tags.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager-Common-udev-tags.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,276 @@ + + + + +Common udev tags: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

Common udev tags

+

Common udev tags — generic udev tags supported

+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineID_MM_CANDIDATE
#defineID_MM_PHYSDEV_UID
#defineID_MM_PORT_IGNORE
#defineID_MM_DEVICE_PROCESS
#defineID_MM_DEVICE_IGNORE
#defineID_MM_DEVICE_MANUAL_SCAN_ONLY
#defineID_MM_PLATFORM_DRIVER_PROBE
#defineID_MM_PORT_TYPE_AT_PPP
#defineID_MM_PORT_TYPE_AT_PRIMARY
#defineID_MM_PORT_TYPE_AT_SECONDARY
#defineID_MM_PORT_TYPE_GPS
#defineID_MM_PORT_TYPE_QCDM
#defineID_MM_TTY_BAUDRATE
#defineID_MM_TTY_FLOW_CONTROL
+
+
+

Description

+

This section defines generic udev tags that are used by ModemManager, +associated to full devices or to specific ports in a given device.

+
+
+

Functions

+

+
+
+

Types and Values

+
+

ID_MM_CANDIDATE

+
#define ID_MM_CANDIDATE "ID_MM_CANDIDATE"
+
+

This is a port-specific tag added automatically when all other +ModemManager related tags have already been set.

+
+
+
+

ID_MM_PHYSDEV_UID

+
#define ID_MM_PHYSDEV_UID "ID_MM_PHYSDEV_UID"
+
+

This is a device-specific tag that allows users to 'name' modem +devices with a predefined 'unique ID' string.

+

When this tag is given per-port, the daemon will consider that all +ports with the same UID value are associated to the same device. +This is useful for e.g. modems that expose multiple RS232 ports +connected to the system via different platform ports (or USB to +RS232 adapters).

+

This UID is exposed in +the 'Device' +property and can then be used in mmcli calls to refer unequivocally +to a specific device, regardless of its modem index, e.g.: + $ mmcli --modem=UID ...

+
+
+
+

ID_MM_PORT_IGNORE

+
#define ID_MM_PORT_IGNORE "ID_MM_PORT_IGNORE"
+
+

This is a port-specific tag that allows explicitly ignoring a given port +in a device.

+

This tag applies to all types of ports.

+
+
+
+

ID_MM_DEVICE_PROCESS

+
#define ID_MM_DEVICE_PROCESS "ID_MM_DEVICE_PROCESS"
+
+

This is a device-specific tag that allows explicitly requesting the +processing of all ports exposed by the device. This tag is usually +used by users when the daemon runs with WHITELIST-ONLY filter policy +type, and is associated to the MM_FILTER_RULE_EXPLICIT_WHITELIST rule.

+

This tag may also be specified in specific ports, e.g. when the modem +exposes a single platform port without any parent device.

+
+
+
+

ID_MM_DEVICE_IGNORE

+
#define ID_MM_DEVICE_IGNORE "ID_MM_DEVICE_IGNORE"
+
+

This is a device-specific tag that allows explicitly blacklisting +devices that expose TTY devices so that they are never probed.

+

This tag is used when the daemon runs with DEFAULT or PARANOID +filter policy type, and is associated to the MM_FILTER_RULE_TTY_BLACKLIST +rule.

+

This tag is ignored when the STRICT filter policy is used.

+
+
+
+

ID_MM_DEVICE_MANUAL_SCAN_ONLY

+
#define ID_MM_DEVICE_MANUAL_SCAN_ONLY "ID_MM_DEVICE_MANUAL_SCAN_ONLY"
+
+

This is a device-specific tag that allows explicitly greylisting +devices that expose TTY devices so that they are never probed +automatically. Instead, an explicit manual scan request may be sent +to the daemon so that the TTY ports exposed by the device are +probed.

+

This tag is used when the daemon runs with DEFAULT or PARANOID +filter policy type, and is associated to the MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY +rule.

+

This tag is ignored when the STRICT filter policy is used.

+
+
+
+

ID_MM_PLATFORM_DRIVER_PROBE

+
#define ID_MM_PLATFORM_DRIVER_PROBE "ID_MM_PLATFORM_DRIVER_PROBE"
+
+

This is a port-specific tag applied to platform ports so that they +are probed automatically by the daemon. Platform ports that don't +have this tag will never probed. This tag is a bit redundant, as +the user could also use ID_MM_DEVICE_PROCESS for the same purpose.

+

This tag is associated to the MM_FILTER_RULE_TTY_PLATFORM_DRIVER +rule, which is only meaningful when the daemon runs with the +DEFAULT filter policy type, as that is the only one that would +allow probing all ports not explicitly forbidden before the last +MM_FILTER_RULE_TTY_DEFAULT_ALLOWED rule.

+
+
+
+

ID_MM_PORT_TYPE_AT_PPP

+
#define ID_MM_PORT_TYPE_AT_PPP "ID_MM_PORT_TYPE_AT_PPP"
+
+

This is a port-specific tag applied to TTYs that we know in advance +are AT ports to be used as data ports exclusively.

+

This tag will also prevent QCDM probing on the port.

+
+
+
+

ID_MM_PORT_TYPE_AT_PRIMARY

+
#define ID_MM_PORT_TYPE_AT_PRIMARY "ID_MM_PORT_TYPE_AT_PRIMARY"
+
+

This is a port-specific tag applied to TTYs that we know in advance +are AT ports to be used as primary control ports.

+

This tag will also prevent QCDM probing on the port.

+
+
+
+

ID_MM_PORT_TYPE_AT_SECONDARY

+
#define ID_MM_PORT_TYPE_AT_SECONDARY "ID_MM_PORT_TYPE_AT_SECONDARY"
+
+

This is a port-specific tag applied to TTYs that we know in advance +are AT ports to be used as secondary control ports.

+

This tag will also prevent QCDM probing on the port.

+
+
+
+

ID_MM_PORT_TYPE_GPS

+
#define ID_MM_PORT_TYPE_GPS "ID_MM_PORT_TYPE_GPS"
+
+

This is a port-specific tag applied to TTYs that we know in advance +are GPS data ports where we expect to receive NMEA traces.

+

This tag also prevents AT and QCDM probing in the port.

+
+
+
+

ID_MM_PORT_TYPE_QCDM

+
#define ID_MM_PORT_TYPE_QCDM "ID_MM_PORT_TYPE_QCDM"
+
+

This is a port-specific tag applied to TTYs that we know in advance +are QCDM ports.

+

The only purpose of this tag is to prevent AT probing in the port.

+
+
+
+

ID_MM_TTY_BAUDRATE

+
#define ID_MM_TTY_BAUDRATE "ID_MM_TTY_BAUDRATE"
+
+

This is a port-specific tag applied to TTYs that require a specific +baudrate to work. USB modems will usually allow auto-bauding +configuration, so this tag is really only meaningful to true RS232 +devices.

+

The value of the tag should be the number of bauds per second to +use when talking to the port, e.g. "115200". If not given, the +default of 57600bps is assumed.

+
+
+
+

ID_MM_TTY_FLOW_CONTROL

+
#define ID_MM_TTY_FLOW_CONTROL "ID_MM_TTY_FLOW_CONTROL"
+
+

This is a port-specific tag applied to TTYs that require a specific +flow control mechanism to work not only in data mode but also in +control mode.

+

The value of the tag should be either 'none', 'xon-xoff' or +'rts-cts', and must be a flow control value supported by the device +where it's configured. If not given, it is assumed that the TTYs +don't require any specific flow control setting in command mode.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager.devhelp2 modemmanager-1.10.0/docs/reference/api/html/ModemManager.devhelp2 --- modemmanager-1.6.8/docs/reference/api/html/ModemManager.devhelp2 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager.devhelp2 2019-01-17 16:22:34.000000000 +0100 @@ -3,21 +3,26 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + @@ -26,6 +31,9 @@ + + + @@ -64,13 +72,16 @@ - - - - - + + + + + + + + @@ -78,6 +89,7 @@ + @@ -90,6 +102,7 @@ + @@ -98,6 +111,7 @@ + @@ -105,6 +119,7 @@ + @@ -122,8 +137,25 @@ + + + + + + + + + + + + + + + + + @@ -145,6 +177,7 @@ + @@ -170,12 +203,18 @@ + + + + + + @@ -203,12 +242,15 @@ + + + @@ -221,6 +263,7 @@ + @@ -246,6 +289,7 @@ + @@ -283,6 +327,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -317,6 +432,7 @@ + @@ -343,10 +459,20 @@ + + + + + + + + + + @@ -369,71 +495,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -469,6 +647,8 @@ + + @@ -524,6 +704,9 @@ + + + @@ -787,27 +970,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager-Errors.html modemmanager-1.10.0/docs/reference/api/html/ModemManager-Errors.html --- modemmanager-1.6.8/docs/reference/api/html/ModemManager-Errors.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager-Errors.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Errors: ModemManager Reference Manual - + - - + + @@ -20,7 +20,7 @@ Home Up Prev -Next +Next
@@ -687,6 +687,27 @@   +

MM_MOBILE_EQUIPMENT_ERROR_HIDDEN_KEY_REQUIRED

+ +

Hidden key required. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_EAP_METHOD_NOT_SUPPORTED

+ +

EAP method not supported. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PARAMETERS

+ +

Incorrect parameters. Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN

Unknown.

@@ -729,6 +750,13 @@   +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED

+ +

GPRS and non-GPRS services not allowed. Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED

PLMN not allowed.

@@ -771,6 +799,13 @@   +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_NOT_AUTHORIZED_FOR_CSG

+ +

GPRS not authorized for CSG. Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES

Insufficient resources.

@@ -785,6 +820,13 @@   +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_ADDRESS_OR_TYPE

+ +

Unknown PDP address or type. Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED

User authentication failed.

@@ -792,6 +834,20 @@   +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_BY_GGSN_OR_GW

+ +

Activation rejected by GGSN or gateway. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_UNSPECIFIED

+ +

Activation rejected (reason unspecified). Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED

Service option not supported.

@@ -813,6 +869,55 @@   +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_FEATURE_NOT_SUPPORTED

+ +

Feature not supported. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERROR_IN_TFT_OPERATION

+ +

Semantic error in TFT operation. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_TFT_OPERATION

+ +

Syntactical error in TFT operation. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_CONTEXT

+ +

Unknown PDP context. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERRORS_IN_PACKET_FILTER

+ +

Semantic errors in packet filter. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_PACKET_FILTER

+ +

Syntactical error in packet filter. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED

+ +

PDP context witout TFT already activated. Since: 1.8.

+ +  + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN

Unspecified GPRS error.

@@ -833,6 +938,76 @@   + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_LAST_PDN_DISCONNECTION_NOT_ALLOWED

+ +

Last PDN disconnection not allowed. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTICALLY_INCORRECT_MESSAGE

+ +

Semantically incorrect message. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_MANDATORY_IE_ERROR

+ +

Mandatory IE error. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_IE_NOT_IMPLEMENTED

+ +

IE not implemented. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONDITIONAL_IE_ERROR

+ +

Conditional IE error. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNSPECIFIED_PROTOCOL_ERROR

+ +

Unspecified protocol error. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_OPERATOR_DETERMINED_BARRING

+ +

Operator determined barring. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED

+ +

Maximum number of PDP contexts reached. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUESTED_APN_NOT_SUPPORTED

+ +

Requested APN not supported. Since: 1.8.

+ +  + + +

MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUEST_REJECTED_BCM_VIOLATION

+ +

Request rejected (BCM violation). Since: 1.8.

+ +  +
@@ -1007,6 +1182,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager-Flags-and-Enumerations.html modemmanager-1.10.0/docs/reference/api/html/ModemManager-Flags-and-Enumerations.html --- modemmanager-1.6.8/docs/reference/api/html/ModemManager-Flags-and-Enumerations.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager-Flags-and-Enumerations.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Flags and Enumerations: ModemManager Reference Manual - + - + @@ -41,6 +41,10 @@ enum +MMBearerType + + +enum MMBearerIpFamily @@ -89,6 +93,10 @@ enum +MMModem3gppEpsUeModeOperation + + +enum MMModemAccessTechnology @@ -121,6 +129,10 @@ enum +MMModemLocationAssistanceDataType + + +enum MMModemLock @@ -149,6 +161,10 @@ enum +MMModemFirmwareUpdateMethod + + +enum MMOmaFeature @@ -206,6 +222,57 @@

Types and Values

+

enum MMBearerType

+

Type of context (2G/3G) or bearer (4G).

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

MM_BEARER_TYPE_UNKNOWN

+

Unknown bearer.

+
 

MM_BEARER_TYPE_DEFAULT

+

Primary context (2G/3G) or default bearer (4G), +defined by the user of the API.

+
 

MM_BEARER_TYPE_DEFAULT_ATTACH

+

The initial default bearer established +during LTE attach procedure, automatically connected as long as the device is +regitered in the LTE network.

+
 

MM_BEARER_TYPE_DEDICATED

+

Secondary context (2G/3G) or dedicated bearer +(4G), defined by the user of the API. These bearers use the same IP address +used by a primary context or default bearer and provide a dedicated flow for +specific traffic with different QoS settings.

+
 
+
+
+
+

enum MMBearerIpFamily

Type of IP family to be used in a given Bearer.

@@ -444,14 +511,14 @@

MM_CALL_STATE_RINGING_OUT

-

incoming call is waiting for an answer.

+

outgoing call attached to GSM network, waiting for an answer.

 

MM_CALL_STATE_RINGING_IN

-

outgoing call attached to GSM network, waiting for an answer.

+

incoming call is waiting for an answer.

  @@ -537,7 +604,7 @@

MM_CALL_STATE_REASON_REFUSED_OR_BUSY

-

Remote peer is busy or refused call

+

Remote peer is busy or refused call.

  @@ -548,6 +615,13 @@   + +

MM_CALL_STATE_REASON_AUDIO_SETUP_FAILED

+ +

Error setting up audio channel.

+ +  +
@@ -767,7 +841,7 @@

enum MMModem3gppRegistrationState

-

GSM registration code as defined in 3GPP TS 27.007 section 10.1.19.

+

GSM registration code as defined in 3GPP TS 27.007.

Members

@@ -819,6 +893,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
 

MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY

+

Registered for "SMS only", home network (applicable only when on LTE).

+
 

MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY

+

Registered for "SMS only", roaming network (applicable only when on LTE).

+
 

MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY

+

Emergency services only.

+
 

MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED

+

Registered for "CSFB not preferred", home network (applicable only when on LTE).

+
 

MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED

+

Registered for "CSFB not preferred", roaming network (applicable only when on LTE).

+
 
@@ -870,6 +979,58 @@

+

enum MMModem3gppEpsUeModeOperation

+

UE mode of operation for EPS, as per 3GPP TS 24.301.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN

+

Unknown or not applicable.

+
 

MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_1

+

PS mode 1 of operation: EPS only, voice-centric.

+
 

MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_2

+

PS mode 2 of operation: EPS only, data-centric.

+
 

MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_1

+

CS/PS mode 1 of operation: EPS and non-EPS, voice-centric.

+
 

MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_2

+

CS/PS mode 2 of operation: EPS and non-EPS, data-centric.

+
 
+
+
+
+

enum MMModemAccessTechnology

Describes various access technologies that a device uses when registered with or connected to a network.

@@ -1054,461 +1215,825 @@   -

MM_MODEM_BAND_U2100

+

MM_MODEM_BAND_UTRAN_1

+ +

UMTS 2100 MHz (IMT, UTRAN band 1).

+ +  + + +

MM_MODEM_BAND_UTRAN_3

+ +

UMTS 1800 MHz (DCS, UTRAN band 3).

+ +  + + +

MM_MODEM_BAND_UTRAN_4

+ +

UMTS 1700 MHz (AWS A-F, UTRAN band 4).

+ +  + + +

MM_MODEM_BAND_UTRAN_6

+ +

UMTS 800 MHz (UTRAN band 6).

+ +  + + +

MM_MODEM_BAND_UTRAN_5

+ +

UMTS 850 MHz (CLR, UTRAN band 5).

+ +  + + +

MM_MODEM_BAND_UTRAN_8

+ +

UMTS 900 MHz (E-GSM, UTRAN band 8).

+ +  + + +

MM_MODEM_BAND_UTRAN_9

+ +

UMTS 1700 MHz (UTRAN band 9).

+ +  + + +

MM_MODEM_BAND_UTRAN_2

+ +

UMTS 1900 MHz (PCS A-F, UTRAN band 2).

+ +  + + +

MM_MODEM_BAND_UTRAN_7

+ +

UMTS 2600 MHz (IMT-E, UTRAN band 7).

+ +  + + +

MM_MODEM_BAND_G450

+ +

GSM/GPRS/EDGE 450 MHz.

+ +  + + +

MM_MODEM_BAND_G480

+ +

GSM/GPRS/EDGE 480 MHz.

+ +  + + +

MM_MODEM_BAND_G750

+ +

GSM/GPRS/EDGE 750 MHz.

+ +  + + +

MM_MODEM_BAND_G380

+ +

GSM/GPRS/EDGE 380 MHz.

+ +  + + +

MM_MODEM_BAND_G410

+ +

GSM/GPRS/EDGE 410 MHz.

+ +  + + +

MM_MODEM_BAND_G710

+ +

GSM/GPRS/EDGE 710 MHz.

+ +  + + +

MM_MODEM_BAND_G810

+ +

GSM/GPRS/EDGE 810 MHz.

+ +  + + +

MM_MODEM_BAND_EUTRAN_1

+ +

E-UTRAN band 1.

+ +  + + +

MM_MODEM_BAND_EUTRAN_2

-

WCDMA 2100 MHz (Class I).

+

E-UTRAN band 2.

  -

MM_MODEM_BAND_U1800

+

MM_MODEM_BAND_EUTRAN_3

-

WCDMA 3GPP 1800 MHz (Class III).

+

E-UTRAN band 3.

  -

MM_MODEM_BAND_U17IV

+

MM_MODEM_BAND_EUTRAN_4

-

WCDMA 3GPP AWS 1700/2100 MHz (Class IV).

+

E-UTRAN band 4.

  -

MM_MODEM_BAND_U800

+

MM_MODEM_BAND_EUTRAN_5

-

WCDMA 3GPP UMTS 800 MHz (Class VI).

+

E-UTRAN band 5.

  -

MM_MODEM_BAND_U850

+

MM_MODEM_BAND_EUTRAN_6

-

WCDMA 3GPP UMTS 850 MHz (Class V).

+

E-UTRAN band 6.

  -

MM_MODEM_BAND_U900

+

MM_MODEM_BAND_EUTRAN_7

-

WCDMA 3GPP UMTS 900 MHz (Class VIII).

+

E-UTRAN band 7.

  -

MM_MODEM_BAND_U17IX

+

MM_MODEM_BAND_EUTRAN_8

-

WCDMA 3GPP UMTS 1700 MHz (Class IX).

+

E-UTRAN band 8.

  -

MM_MODEM_BAND_U1900

+

MM_MODEM_BAND_EUTRAN_9

-

WCDMA 3GPP UMTS 1900 MHz (Class II).

+

E-UTRAN band 9.

  -

MM_MODEM_BAND_U2600

+

MM_MODEM_BAND_EUTRAN_10

-

WCDMA 3GPP UMTS 2600 MHz (Class VII, internal).

+

E-UTRAN band 10.

  -

MM_MODEM_BAND_EUTRAN_I

+

MM_MODEM_BAND_EUTRAN_11

-

E-UTRAN band I.

+

E-UTRAN band 11.

  -

MM_MODEM_BAND_EUTRAN_II

+

MM_MODEM_BAND_EUTRAN_12

-

E-UTRAN band II.

+

E-UTRAN band 12.

  -

MM_MODEM_BAND_EUTRAN_III

+

MM_MODEM_BAND_EUTRAN_13

-

E-UTRAN band III.

+

E-UTRAN band 13.

  -

MM_MODEM_BAND_EUTRAN_IV

+

MM_MODEM_BAND_EUTRAN_14

-

E-UTRAN band IV.

+

E-UTRAN band 14.

  -

MM_MODEM_BAND_EUTRAN_V

+

MM_MODEM_BAND_EUTRAN_17

-

E-UTRAN band V.

+

E-UTRAN band 17.

  -

MM_MODEM_BAND_EUTRAN_VI

+

MM_MODEM_BAND_EUTRAN_18

-

E-UTRAN band VI.

+

E-UTRAN band 18.

  -

MM_MODEM_BAND_EUTRAN_VII

+

MM_MODEM_BAND_EUTRAN_19

-

E-UTRAN band VII.

+

E-UTRAN band 19.

  -

MM_MODEM_BAND_EUTRAN_VIII

+

MM_MODEM_BAND_EUTRAN_20

-

E-UTRAN band VIII.

+

E-UTRAN band 20.

  -

MM_MODEM_BAND_EUTRAN_IX

+

MM_MODEM_BAND_EUTRAN_21

-

E-UTRAN band IX.

+

E-UTRAN band 21.

  -

MM_MODEM_BAND_EUTRAN_X

+

MM_MODEM_BAND_EUTRAN_22

-

E-UTRAN band X.

+

E-UTRAN band 22.

  -

MM_MODEM_BAND_EUTRAN_XI

+

MM_MODEM_BAND_EUTRAN_23

-

E-UTRAN band XI.

+

E-UTRAN band 23.

  -

MM_MODEM_BAND_EUTRAN_XII

+

MM_MODEM_BAND_EUTRAN_24

-

E-UTRAN band XII.

+

E-UTRAN band 24.

  -

MM_MODEM_BAND_EUTRAN_XIII

+

MM_MODEM_BAND_EUTRAN_25

-

E-UTRAN band XIII.

+

E-UTRAN band 25.

  -

MM_MODEM_BAND_EUTRAN_XIV

+

MM_MODEM_BAND_EUTRAN_26

-

E-UTRAN band XIV.

+

E-UTRAN band 26.

  -

MM_MODEM_BAND_EUTRAN_XVII

+

MM_MODEM_BAND_EUTRAN_27

-

E-UTRAN band XVII.

+

E-UTRAN band 27.

  -

MM_MODEM_BAND_EUTRAN_XVIII

+

MM_MODEM_BAND_EUTRAN_28

-

E-UTRAN band XVIII.

+

E-UTRAN band 28.

  -

MM_MODEM_BAND_EUTRAN_XIX

+

MM_MODEM_BAND_EUTRAN_29

-

E-UTRAN band XIX.

+

E-UTRAN band 29.

  -

MM_MODEM_BAND_EUTRAN_XX

+

MM_MODEM_BAND_EUTRAN_30

-

E-UTRAN band XX.

+

E-UTRAN band 30.

  -

MM_MODEM_BAND_EUTRAN_XXI

+

MM_MODEM_BAND_EUTRAN_31

-

E-UTRAN band XXI.

+

E-UTRAN band 31.

  -

MM_MODEM_BAND_EUTRAN_XXII

+

MM_MODEM_BAND_EUTRAN_32

-

E-UTRAN band XXII.

+

E-UTRAN band 32.

  -

MM_MODEM_BAND_EUTRAN_XXIII

+

MM_MODEM_BAND_EUTRAN_33

-

E-UTRAN band XXIII.

+

E-UTRAN band 33.

  -

MM_MODEM_BAND_EUTRAN_XXIV

+

MM_MODEM_BAND_EUTRAN_34

-

E-UTRAN band XXIV.

+

E-UTRAN band 34.

  -

MM_MODEM_BAND_EUTRAN_XXV

+

MM_MODEM_BAND_EUTRAN_35

-

E-UTRAN band XXV.

+

E-UTRAN band 35.

  -

MM_MODEM_BAND_EUTRAN_XXVI

+

MM_MODEM_BAND_EUTRAN_36

-

E-UTRAN band XXVI.

+

E-UTRAN band 36.

  -

MM_MODEM_BAND_EUTRAN_XXXIII

+

MM_MODEM_BAND_EUTRAN_37

-

E-UTRAN band XXXIII.

+

E-UTRAN band 37.

  -

MM_MODEM_BAND_EUTRAN_XXXIV

+

MM_MODEM_BAND_EUTRAN_38

-

E-UTRAN band XXXIV.

+

E-UTRAN band 38.

  -

MM_MODEM_BAND_EUTRAN_XXXV

+

MM_MODEM_BAND_EUTRAN_39

-

E-UTRAN band XXXV.

+

E-UTRAN band 39.

  -

MM_MODEM_BAND_EUTRAN_XXXVI

+

MM_MODEM_BAND_EUTRAN_40

-

E-UTRAN band XXXVI.

+

E-UTRAN band 40.

  -

MM_MODEM_BAND_EUTRAN_XXXVII

+

MM_MODEM_BAND_EUTRAN_41

-

E-UTRAN band XXXVII.

+

E-UTRAN band 41.

  -

MM_MODEM_BAND_EUTRAN_XXXVIII

+

MM_MODEM_BAND_EUTRAN_42

-

E-UTRAN band XXXVIII.

+

E-UTRAN band 42.

  -

MM_MODEM_BAND_EUTRAN_XXXIX

+

MM_MODEM_BAND_EUTRAN_43

-

E-UTRAN band XXXIX.

+

E-UTRAN band 43.

  -

MM_MODEM_BAND_EUTRAN_XL

+

MM_MODEM_BAND_EUTRAN_44

-

E-UTRAN band XL.

+

E-UTRAN band 44.

  -

MM_MODEM_BAND_EUTRAN_XLI

+

MM_MODEM_BAND_EUTRAN_45

-

E-UTRAN band XLI.

+

E-UTRAN band 45.

  -

MM_MODEM_BAND_EUTRAN_XLII

+

MM_MODEM_BAND_EUTRAN_46

-

E-UTRAN band XLII.

+

E-UTRAN band 46.

  -

MM_MODEM_BAND_EUTRAN_XLIII

+

MM_MODEM_BAND_EUTRAN_47

-

E-UTRAN band XLIII.

+

E-UTRAN band 47.

  -

MM_MODEM_BAND_EUTRAN_XLIV

+

MM_MODEM_BAND_EUTRAN_48

-

E-UTRAN band XLIV.

+

E-UTRAN band 48.

  -

MM_MODEM_BAND_CDMA_BC0_CELLULAR_800

+

MM_MODEM_BAND_EUTRAN_49

+ +

E-UTRAN band 49.

+ +  + + +

MM_MODEM_BAND_EUTRAN_50

+ +

E-UTRAN band 50.

+ +  + + +

MM_MODEM_BAND_EUTRAN_51

+ +

E-UTRAN band 51.

+ +  + + +

MM_MODEM_BAND_EUTRAN_52

+ +

E-UTRAN band 52.

+ +  + + +

MM_MODEM_BAND_EUTRAN_53

+ +

E-UTRAN band 53.

+ +  + + +

MM_MODEM_BAND_EUTRAN_54

+ +

E-UTRAN band 54.

+ +  + + +

MM_MODEM_BAND_EUTRAN_55

+ +

E-UTRAN band 55.

+ +  + + +

MM_MODEM_BAND_EUTRAN_56

+ +

E-UTRAN band 56.

+ +  + + +

MM_MODEM_BAND_EUTRAN_57

+ +

E-UTRAN band 57.

+ +  + + +

MM_MODEM_BAND_EUTRAN_58

+ +

E-UTRAN band 58.

+ +  + + +

MM_MODEM_BAND_EUTRAN_59

+ +

E-UTRAN band 59.

+ +  + + +

MM_MODEM_BAND_EUTRAN_60

+ +

E-UTRAN band 60.

+ +  + + +

MM_MODEM_BAND_EUTRAN_61

+ +

E-UTRAN band 61.

+ +  + + +

MM_MODEM_BAND_EUTRAN_62

+ +

E-UTRAN band 62.

+ +  + + +

MM_MODEM_BAND_EUTRAN_63

+ +

E-UTRAN band 63.

+ +  + + +

MM_MODEM_BAND_EUTRAN_64

+ +

E-UTRAN band 64.

+ +  + + +

MM_MODEM_BAND_EUTRAN_65

+ +

E-UTRAN band 65.

+ +  + + +

MM_MODEM_BAND_EUTRAN_66

+ +

E-UTRAN band 66.

+ +  + + +

MM_MODEM_BAND_EUTRAN_67

+ +

E-UTRAN band 67.

+ +  + + +

MM_MODEM_BAND_EUTRAN_68

+ +

E-UTRAN band 68.

+ +  + + +

MM_MODEM_BAND_EUTRAN_69

+ +

E-UTRAN band 69.

+ +  + + +

MM_MODEM_BAND_EUTRAN_70

+ +

E-UTRAN band 70.

+ +  + + +

MM_MODEM_BAND_EUTRAN_71

+ +

E-UTRAN band 71.

+ +  + + +

MM_MODEM_BAND_CDMA_BC0

CDMA Band Class 0 (US Cellular 850MHz).

  -

MM_MODEM_BAND_CDMA_BC1_PCS_1900

+

MM_MODEM_BAND_CDMA_BC1

CDMA Band Class 1 (US PCS 1900MHz).

  -

MM_MODEM_BAND_CDMA_BC2_TACS

+

MM_MODEM_BAND_CDMA_BC2

CDMA Band Class 2 (UK TACS 900MHz).

  -

MM_MODEM_BAND_CDMA_BC3_JTACS

+

MM_MODEM_BAND_CDMA_BC3

CDMA Band Class 3 (Japanese TACS).

  -

MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS

+

MM_MODEM_BAND_CDMA_BC4

CDMA Band Class 4 (Korean PCS).

  -

MM_MODEM_BAND_CDMA_BC5_NMT450

+

MM_MODEM_BAND_CDMA_BC5

CDMA Band Class 5 (NMT 450MHz).

  -

MM_MODEM_BAND_CDMA_BC6_IMT2000

+

MM_MODEM_BAND_CDMA_BC6

CDMA Band Class 6 (IMT2000 2100MHz).

  -

MM_MODEM_BAND_CDMA_BC7_CELLULAR_700

+

MM_MODEM_BAND_CDMA_BC7

CDMA Band Class 7 (Cellular 700MHz).

  -

MM_MODEM_BAND_CDMA_BC8_1800

+

MM_MODEM_BAND_CDMA_BC8

CDMA Band Class 8 (1800MHz).

  -

MM_MODEM_BAND_CDMA_BC9_900

+

MM_MODEM_BAND_CDMA_BC9

CDMA Band Class 9 (900MHz).

  -

MM_MODEM_BAND_CDMA_BC10_SECONDARY_800

+

MM_MODEM_BAND_CDMA_BC10

CDMA Band Class 10 (US Secondary 800).

  -

MM_MODEM_BAND_CDMA_BC11_PAMR_400

+

MM_MODEM_BAND_CDMA_BC11

CDMA Band Class 11 (European PAMR 400MHz).

  -

MM_MODEM_BAND_CDMA_BC12_PAMR_800

+

MM_MODEM_BAND_CDMA_BC12

CDMA Band Class 12 (PAMR 800MHz).

  -

MM_MODEM_BAND_CDMA_BC13_IMT2000_2500

+

MM_MODEM_BAND_CDMA_BC13

CDMA Band Class 13 (IMT2000 2500MHz Expansion).

  -

MM_MODEM_BAND_CDMA_BC14_PCS2_1900

+

MM_MODEM_BAND_CDMA_BC14

CDMA Band Class 14 (More US PCS 1900MHz).

  -

MM_MODEM_BAND_CDMA_BC15_AWS

+

MM_MODEM_BAND_CDMA_BC15

CDMA Band Class 15 (AWS 1700MHz).

  -

MM_MODEM_BAND_CDMA_BC16_US_2500

+

MM_MODEM_BAND_CDMA_BC16

CDMA Band Class 16 (US 2500MHz).

  -

MM_MODEM_BAND_CDMA_BC17_US_FLO_2500

+

MM_MODEM_BAND_CDMA_BC17

CDMA Band Class 17 (US 2500MHz Forward Link Only).

  -

MM_MODEM_BAND_CDMA_BC18_US_PS_700

+

MM_MODEM_BAND_CDMA_BC18

CDMA Band Class 18 (US 700MHz Public Safety).

  -

MM_MODEM_BAND_CDMA_BC19_US_LOWER_700

+

MM_MODEM_BAND_CDMA_BC19

CDMA Band Class 19 (US Lower 700MHz).

  +

MM_MODEM_BAND_UTRAN_10

+ +

UMTS 1700 MHz (EAWS A-G, UTRAN band 10).

+ +  + + +

MM_MODEM_BAND_UTRAN_11

+ +

UMTS 1500 MHz (LPDC, UTRAN band 11).

+ +  + + +

MM_MODEM_BAND_UTRAN_12

+ +

UMTS 700 MHz (LSMH A/B/C, UTRAN band 12).

+ +  + + +

MM_MODEM_BAND_UTRAN_13

+ +

UMTS 700 MHz (USMH C, UTRAN band 13).

+ +  + + +

MM_MODEM_BAND_UTRAN_14

+ +

UMTS 700 MHz (USMH D, UTRAN band 14).

+ +  + + +

MM_MODEM_BAND_UTRAN_19

+ +

UMTS 800 MHz (UTRAN band 19).

+ +  + + +

MM_MODEM_BAND_UTRAN_20

+ +

UMTS 800 MHz (EUDD, UTRAN band 20).

+ +  + + +

MM_MODEM_BAND_UTRAN_21

+ +

UMTS 1500 MHz (UPDC, UTRAN band 21).

+ +  + + +

MM_MODEM_BAND_UTRAN_22

+ +

UMTS 3500 MHz (UTRAN band 22).

+ +  + + +

MM_MODEM_BAND_UTRAN_25

+ +

UMTS 1900 MHz (EPCS A-G, UTRAN band 25).

+ +  + + +

MM_MODEM_BAND_UTRAN_26

+ +

UMTS 850 MHz (ECLR, UTRAN band 26).

+ +  + + +

MM_MODEM_BAND_UTRAN_32

+ +

UMTS 1500 MHz (L-band, UTRAN band 32).

+ +  + +

MM_MODEM_BAND_ANY

For certain operations, allow the modem to select a band automatically.

@@ -1862,6 +2387,37 @@

+

enum MMModemLocationAssistanceDataType

+

Type of assistance data that may be injected to the GNSS module.

+
+

Members

+
+++++ + + + + + + + + + + + + +

MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE

+

None.

+
 

MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_XTRA

+

Qualcomm gpsOneXTRA.

+
 
+
+
+
+

enum MMModemLock

Enumeration of possible lock reasons.

@@ -2370,6 +2926,44 @@

+

enum MMModemFirmwareUpdateMethod

+

Type of firmware update method supported by the module.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE

+

No method specified.

+
 

MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT

+

Device supports fastboot-based update.

+
 

MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC

+

Device supports QMI PDC based update.

+
 
+
+
+
+

enum MMOmaFeature

Features that can be enabled or disabled in the OMA device management support.

@@ -3856,6 +4450,6 @@
+
Generated by GTK-Doc V1.29
\ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ModemManager-Version-checks.html modemmanager-1.10.0/docs/reference/api/html/ModemManager-Version-checks.html --- modemmanager-1.6.8/docs/reference/api/html/ModemManager-Version-checks.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ModemManager-Version-checks.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Version checks: ModemManager Reference Manual - + - + @@ -124,7 +124,7 @@

MM_MINOR_VERSION

-
#define MM_MINOR_VERSION (6)
+
#define MM_MINOR_VERSION (10)
 

Evaluates to the minor version number of ModemManager which this source is compiled against.

@@ -132,7 +132,7 @@

MM_MICRO_VERSION

-
#define MM_MICRO_VERSION (8)
+
#define MM_MICRO_VERSION (0)
 

Evaluates to the micro version number of ModemManager which this source compiled against.

@@ -140,6 +140,6 @@
+
Generated by GTK-Doc V1.29
\ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-common-types.html modemmanager-1.10.0/docs/reference/api/html/ref-common-types.html --- modemmanager-1.6.8/docs/reference/api/html/ref-common-types.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-common-types.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Part II. Common types and definitions: ModemManager Reference Manual - + - + @@ -38,6 +38,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-compat.html modemmanager-1.10.0/docs/reference/api/html/ref-compat.html --- modemmanager-1.6.8/docs/reference/api/html/ref-compat.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-compat.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,35 @@ + + + + +Part VI. Compatibility with older versions: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Part VI. Compatibility with older versions

+
+

Table of Contents

+
+API break replacements +
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-bus-name.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-bus-name.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-bus-name.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-bus-name.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The org.freedesktop.ModemManager1 bus name: ModemManager Reference Manual - + - - + + - + @@ -32,6 +32,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus.html 2019-01-17 16:22:34.000000000 +0100 @@ -2,13 +2,13 @@ -Part III. D-Bus Reference: ModemManager Reference Manual - +Part IV. D-Bus Reference: ModemManager Reference Manual + - + - + @@ -16,12 +16,12 @@ Home -Prev +Prev Next

-Part III. D-Bus Reference

+Part IV. D-Bus Reference

Table of Contents

@@ -95,6 +95,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-bearer.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-bearer.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-bearer.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-bearer.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager/Bearers objects: ModemManager Reference Manual - + - + - + @@ -33,6 +33,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-call.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-call.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-call.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-call.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager/Calls objects: ModemManager Reference Manual - + - + - + @@ -32,6 +32,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-manager.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-manager.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-manager.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-manager.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager1 object: ModemManager Reference Manual - + - + - + @@ -40,6 +40,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-modem.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-modem.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-modem.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-modem.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager/Modems objects: ModemManager Reference Manual - + - + - + @@ -94,6 +94,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-sim.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-sim.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-sim.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-sim.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager/SIMs objects: ModemManager Reference Manual - + - + - + @@ -33,6 +33,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-sms.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-sms.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-object-sms.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-object-sms.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ The /org/freedesktop/ModemManager/SMSs objects: ModemManager Reference Manual - + - + - + @@ -32,6 +32,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Standard interfaces: ModemManager Reference Manual - + - + - + @@ -53,6 +53,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces-introspectables.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces-introspectables.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces-introspectables.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces-introspectables.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.DBus.Introspectable: ModemManager Reference Manual - + - + @@ -37,6 +37,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces-objectmanager.html modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces-objectmanager.html --- modemmanager-1.6.8/docs/reference/api/html/ref-dbus-standard-interfaces-objectmanager.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-dbus-standard-interfaces-objectmanager.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ org.freedesktop.DBus.ObjectManager: ModemManager Reference Manual - + - + @@ -36,6 +36,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-migrating.html modemmanager-1.10.0/docs/reference/api/html/ref-migrating.html --- modemmanager-1.6.8/docs/reference/api/html/ref-migrating.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-migrating.html 2019-01-17 16:22:34.000000000 +0100 @@ -2,13 +2,13 @@ -Part IV. Migrating from ModemManager 0.6 to ModemManager 1.0: ModemManager Reference Manual - +Part V. Migrating from ModemManager 0.6 to ModemManager 1.0: ModemManager Reference Manual + - - + + @@ -17,11 +17,11 @@ Home Prev -Next +Next

-Part IV. Migrating from ModemManager 0.6 to ModemManager 1.0

+Part V. Migrating from ModemManager 0.6 to ModemManager 1.0
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview.html modemmanager-1.10.0/docs/reference/api/html/ref-overview.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Part I. ModemManager Overview: ModemManager Reference Manual - + - + @@ -26,30 +26,36 @@

Table of Contents

Introduction
-
Modem detection and setup
+
Modem detection
-
Detection mechanisms
-
Probing
+
Builds with udev support
+
Builds without udev support
+
+
Modem filter
-
Pre-probing filters
-
Probing sequence
-
Post-probing filters
-
Probing setup examples
+
Filter rules
+
Filter policies
-
Port grabbing and Modem object creation
+
Port probing
+
+
Pre-probing filters
+
Probing sequence
+
Post-probing filters
+
Probing setup examples
+
Modem object creation
Modem state machine
-
Initialization
-
Enabling
-
Connection & disconnection
-
Disabling
+
Initialization
+
Enabling
+
Connection & disconnection
+
Disabling
Plugin-specific Modems
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-introduction.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-introduction.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-introduction.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-introduction.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Introduction: ModemManager Reference Manual - + - - + + @@ -17,7 +17,7 @@ Home Up Prev -Next +Next

@@ -57,6 +57,6 @@

+
Generated by GTK-Doc V1.29
\ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-detection-and-setup.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-detection-and-setup.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-detection-and-setup.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-detection-and-setup.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ - - - - -Modem detection and setup: ModemManager Reference Manual - - - - - - - - - - - - - - - - -
-

-Modem detection and setup

- -
-

-Detection mechanisms

-

- ModemManager requires udev-powered Linux kernels in order - to get notified of possible available Modems. udev will report each of the ports - found in the device, and ModemManager will probe each of the ports marked with - the ID_MM_CANDIDATE tag in udev. This includes both "tty" - and "net" ports. -

-

- Aditionally, users of RS232-based devices may need to request additional manual - scans via DBus, in order to detect modems that may have been connected to - RS232 to USB adapters. In this case, udev just knows about the USB adapter being - connected, not about the RS232 modem connected to the adapter, if any. -

-
-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-detection.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-detection.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-detection.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-detection.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,49 @@ + + + + +Modem detection: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Modem detection

+ +
+

+Builds with udev support

+

+ ModemManager requires udev-powered Linux kernels in order + to get notified of possible available Modems. udev will report each of the ports + found in the device, and ModemManager will consider for probing each of the ports + marked with the ID_MM_CANDIDATE tag in udev. +

+

+ Aditionally, users of RS232-based devices may need to request additional manual + scans via DBus, in order to detect modems that may have been connected to + RS232 to USB adapters. In this case, udev just knows about the USB adapter being + connected, not about the RS232 modem connected to the adapter, if any. +

+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-filter.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-filter.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-filter.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-filter.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,164 @@ + + + + +Modem filter: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Modem filter

+ +

+ ModemManager will not probe all TTYs, NET and cdc-wdm ports found in the system, + as this may end up interfering e.g. with TTYs that have nothing to do with modem + devices. +

+

+ The daemon comes with several predefined filter policies, each + of them composed of one or more filter rules. +

+
+

+Filter rules

+

+ The device filter in ModemManager defines the following independent filter rules. The + predefined filter policies are based on one or more of these predefined filter rules. +

+
    +
  • +

    MM_FILTER_RULE_EXPLICIT_WHITELIST

    +

    + This filter allows users to manually tag devices and/or device ports with the + ID_MM_DEVICE_PROCESS udev tag. If the filter finds this tag, + the device and/or device ports will be automatically accepted and port probing + will be allowed. +

    +
    +$ sudo vim /lib/udev/rules.d/78-mm-whitelist-internal-modem.rules
    +    ACTION!="add|change|move", GOTO="mm_whitelist_internal_modem_end"
    +    ATTRS{idVendor}=="1199", ATTRS{idProduct}=="a001", ENV{ID_MM_DEVICE_PROCESS}="1"
    +    LABEL="mm_whitelist_internal_modem_end"
    +// Apply new rules without reboot
    +$ sudo udevadm control --reload
    +$ sudo udevadm trigger
    +            
    +
  • +
  • +

    MM_FILTER_RULE_VIRTUAL

    +

    + This filter will automatically flag as forbidden all ports exposed by virtual + devices, like the 'lo' network interface or the tty0, tty1... virtual terminals. + There is no reason to disable this filter, except for testing purposes. +

    +
  • +
  • +

    MM_FILTER_RULE_NET

    +

    + This filter will automatically flag as allowed all network ports exposed by + devices. Unless there is a will to explicitly forbid network ports, this filter + should always be enabled. +

    +
  • +
  • +

    MM_FILTER_RULE_CDC_WDM

    +

    + This filter will automatically flag as allowed all cdc-wdm ports exposed by + devices. Unless there is a will to explicitly forbid the cdc-wdm ports exposed + by qmi_wwan, cdc_mbim or huawei-cdc-ncm kernel drivers, this filter should always + be enabled. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY, MM_FILTER_RULE_TTY_DEFAULT_ALLOWED and MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN

    +

    + If the MM_FILTER_RULE_TTY filter is disabled, no TTY port will be allowed. If this + filter is enabled, TTY ports will only be allowed if the TTY-specific filters (defined + next) allow it. +

    +

    + The MM_FILTER_RULE_TTY_DEFAULT_ALLOWED and MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN rules allow + defining what happens when a TTY port isn't explicitly forbidden or accepted by any of + the TTY-specific filters. When MM_FILTER_RULE_TTY is enabled, one of these other two options + must be set. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY_BLACKLIST

    +

    + This filter will not allow probing any of the devices flagged as + ID_MM_DEVICE_IGNORE, like the ones in the default blacklist + shipped by ModemManager. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY

    +

    + This filter will not allow automatic probing any of the devices flagged as + ID_MM_DEVICE_MANUAL_SCAN_ONLY, like the ones in the default + USB serial adapters greylist shipped by ModemManager. Devices flagged like + this will only be probed when a manual scan is requested via the + ScanDevices + method. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY_PLATFORM_DRIVER

    +

    + If this filter is enabled, all platform TTY ports not explicitly flagged with the + ID_MM_PLATFORM_DRIVER_PROBE will be forbidden. If the flag + is found in a platform TTY port, port probing will be allowed directly. +

    +

    + Note that this filter is obsoleted by the more generic MM_FILTER_RULE_EXPLICIT_WHITELIST + filter. It is maintained for backwards compatibility with older ModemManager versions. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY_DRIVER

    +

    + If this filter is enabled, all TTY ports managed by modem-specific kernel drivers will be + allowed automatically. +

    +
  • +
  • +

    FILTER_RULE_TTY_ACM_INTERFACE

    +

    + If this filter is enabled, all TTY ports managed by the cdc-acm kernel driver with + class=2/subclass=2/protocol=1 (AT command capable ttyACM port) will be allowed + automatically. +

    +
  • +
  • +

    MM_FILTER_RULE_TTY_WITH_NET

    +

    + If this filter is enabled, all TTY ports for devices that also expose a network + interface port will be allowed automatically. +

    +
  • +
+

+

+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-object-creation.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-object-creation.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-object-creation.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-object-creation.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,39 @@ + + + + +Modem object creation: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Modem object creation

+

+ Once a port passes all probing filters of a given plugin, the plugin will grab + the port. When the first port of a given device is grabbed, the plugin will create + the required Modem object. +

+

+ While preparing to get the Modem object grab the specific port probed, udev-based + port type hints can be used to specify AT port flags (e.g. if a port is to be + considered primary, secondary or for PPP). +

+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-port-probing.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-port-probing.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-port-probing.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-port-probing.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,138 @@ + + + + +Port probing: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Port probing

+ +

+ Whenever a new device is detected by ModemManager, port probing process will + get started, so that we can determine which kind of ports we have, and also + which plugin we need to use for the specific device. Devices may expose one or + more ports, and all of them will follow the same probing logic. +

+

+ The whole probing process, including pre-probing and post-probing filters, is + implemented in the core ModemManager daemon. Plugins will just configure their + own special needs in the probing process, so that only the steps required by the + given plugin are executed. For example, plugins which do not support RS232 + devices will not need AT-based vendor or product filters. +

+
+

+Pre-probing filters

+

+ Pre-probing filters are those which control whether the probing, as + requested by the specific plugin, takes place. +

+
    +
  • +

    Allowed vendor IDs

    +

    + Plugins can provide a list of udev-reported vendor IDs to be used as + pre-probing filters. If the vendor ID reported by the device via udev + is found in the list provided by the plugin, port probing will be + launched as requested by the given plugin. +

    +

    + This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_IDS + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Product IDs

    +

    + Plugins can provide a list of udev-reported pairs of vendor and product + IDs to be used as pre-probing filters. +

    +

    + If the vendor ID and product ID pair reported by the device via udev is + found in the list of 'allowed' pairs provided by the plugin, port probing + will be launched as requested by the given plugin. This additional filter + should be used when the plugin is expected to work only with a given + specific product of a given vendor. +

    +

    + If the vendor ID and product ID pair reported by the device via udev is + found in the list of 'forbidden' pairs provided by the plugin, port probing + will not be launched by this plugin. This additional filter + should be used when the plugin supports all devices of a given vendor + except for some specific ones. +

    +

    + These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_IDS + and MM_PLUGIN_FORBIDDEN_PRODUCT_IDS properties in the + MMPlugin object provided by the plugin. +

    +
  • +
  • +

    Subsystems

    +

    + Plugins can specify which subsystems they expect, so that we filter out + any port detected with a subsystem not listed by the plugin. +

    +

    + This filter is specified by the MM_PLUGIN_ALLOWED_SUBSYSTEMS + property in the MMPlugin object provided + by the plugin. +

    +
  • +
  • +

    Drivers

    +

    + Plugins can specify which drivers they expect, so that we filter out + any port detected being managed by a driver not listed by the plugin. +

    +

    + Plugins can also specify which drivers they do not expect, so that we + filter out any port detected being managed by a driver listed by the plugin. +

    +

    + These filters are specified by the MM_PLUGIN_ALLOWED_DRIVERS + and MM_PLUGIN_FORBIDDEN_DRIVERS properties in the + MMPlugin object provided by the plugin. +

    +
  • +
  • +

    udev tags

    +

    + Plugins can provide a list of udev tags, so that we filter out + any port detected which doesn't expose any of the given tags. +

    +

    + This filter is specified by the MM_PLUGIN_ALLOWED_UDEV_TAGS + property in the MMPlugin object provided + by the plugin. +

    +
  • +
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-state-machine.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-state-machine.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-modem-state-machine.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-modem-state-machine.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Modem state machine: ModemManager Reference Manual - + - - - + + + @@ -16,17 +16,17 @@ Home Up -Prev -Next +Prev +Next

Modem state machine

Once all ports of a given modem have been probed and grabbed by a newly created @@ -43,7 +43,7 @@

-Initialization

+Initialization

The modem initialization sequence starts only when all ports have been probed and grabbed by a given plugin. This is done so that the proper @@ -117,6 +117,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-overview-plugin-specific-modems.html modemmanager-1.10.0/docs/reference/api/html/ref-overview-plugin-specific-modems.html --- modemmanager-1.6.8/docs/reference/api/html/ref-overview-plugin-specific-modems.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/ref-overview-plugin-specific-modems.html 2019-01-17 16:22:34.000000000 +0100 @@ -3,12 +3,12 @@ Plugin-specific Modems: ModemManager Reference Manual - + - + - + @@ -16,7 +16,7 @@ Home Up -Prev +Prev Next
@@ -70,6 +70,6 @@

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/ref-udev.html modemmanager-1.10.0/docs/reference/api/html/ref-udev.html --- modemmanager-1.6.8/docs/reference/api/html/ref-udev.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/api/html/ref-udev.html 2019-01-17 16:22:34.000000000 +0100 @@ -0,0 +1,35 @@ + + + + +Part III. Common udev tag definitions: ModemManager Reference Manual + + + + + + + + + + + + + + + + +
+

+Part III. Common udev tag definitions

+
+

Table of Contents

+
+Common udev tags — generic udev tags supported +
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/api/html/style.css modemmanager-1.10.0/docs/reference/api/html/style.css --- modemmanager-1.6.8/docs/reference/api/html/style.css 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/html/style.css 2019-01-17 16:22:34.000000000 +0100 @@ -30,6 +30,10 @@ vertical-align: top; } +span.nowrap { + white-space: nowrap; +} + div.gallery-float { float: left; diff -Nru modemmanager-1.6.8/docs/reference/api/Makefile.am modemmanager-1.10.0/docs/reference/api/Makefile.am --- modemmanager-1.6.8/docs/reference/api/Makefile.am 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS = +SCAN_OPTIONS = --deprecated-guards="MM_DISABLE_DEPRECATED" # The directory containing the source code. DOC_SOURCE_DIR = $(top_srcdir)/include diff -Nru modemmanager-1.6.8/docs/reference/api/Makefile.in modemmanager-1.10.0/docs/reference/api/Makefile.in --- modemmanager-1.6.8/docs/reference/api/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -99,14 +99,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -138,7 +137,6 @@ $(top_srcdir)/gtk-doc.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -191,14 +189,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -319,8 +309,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -362,7 +350,7 @@ DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS = +SCAN_OPTIONS = --deprecated-guards="MM_DISABLE_DEPRECATED" # The directory containing the source code. DOC_SOURCE_DIR = $(top_srcdir)/include @@ -553,8 +541,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtk-doc.make $(am__empty): @@ -582,7 +570,10 @@ @ENABLE_GTK_DOC_FALSE@dist-hook: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -651,11 +642,11 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@ENABLE_GTK_DOC_FALSE@distclean-local: -@ENABLE_GTK_DOC_FALSE@clean-local: -@ENABLE_GTK_DOC_FALSE@uninstall-local: @ENABLE_GTK_DOC_FALSE@maintainer-clean-local: +@ENABLE_GTK_DOC_FALSE@clean-local: +@ENABLE_GTK_DOC_FALSE@distclean-local: @ENABLE_GTK_DOC_FALSE@install-data-local: +@ENABLE_GTK_DOC_FALSE@uninstall-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am diff -Nru modemmanager-1.6.8/docs/reference/api/ModemManager-docs.xml modemmanager-1.10.0/docs/reference/api/ModemManager-docs.xml --- modemmanager-1.6.8/docs/reference/api/ModemManager-docs.xml 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/ModemManager-docs.xml 2019-01-15 15:57:35.000000000 +0100 @@ -48,6 +48,9 @@ 2014 2015 2016 + 2017 + 2018 + 2019 The ModemManager Authors @@ -83,12 +86,22 @@ + + Common udev tag definitions + + + + + Compatibility with older versions + + + Index diff -Nru modemmanager-1.6.8/docs/reference/api/ModemManager-migration-reference.xml modemmanager-1.10.0/docs/reference/api/ModemManager-migration-reference.xml --- modemmanager-1.6.8/docs/reference/api/ModemManager-migration-reference.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/ModemManager-migration-reference.xml 2018-11-15 09:55:53.000000000 +0100 @@ -132,7 +132,7 @@ Connect() - method will create a single bearer with the parameters specified in the call an get + method will create a single bearer with the parameters specified in the call and get it connected, while the Disconnect() diff -Nru modemmanager-1.6.8/docs/reference/api/ModemManager-overview.xml modemmanager-1.10.0/docs/reference/api/ModemManager-overview.xml --- modemmanager-1.6.8/docs/reference/api/ModemManager-overview.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/ModemManager-overview.xml 2018-11-17 15:15:56.000000000 +0100 @@ -51,17 +51,16 @@ - - Modem detection and setup + + Modem detection
- Detection mechanisms + Builds with udev support ModemManager requires udev-powered Linux kernels in order to get notified of possible available Modems. udev will report each of the ports - found in the device, and ModemManager will probe each of the ports marked with - the ID_MM_CANDIDATE tag in udev. This includes both "tty" - and "net" ports. + found in the device, and ModemManager will consider for probing each of the ports + marked with the ID_MM_CANDIDATE tag in udev. Aditionally, users of RS232-based devices may need to request additional manual @@ -72,283 +71,556 @@
- Probing + Builds without udev support - Whenever a new device is detected by ModemManager, port probing process will - get started, so that we can determine which kind of ports we have, and also - which plugin we need to use for the specific device. Devices may expose one or - more ports, and all of them will follow the same probing logic. + When the udev daemon isn't available in the system, the + ReportKernelEvent + method in the + Manager interface + may be used to notify the ModemManager daemons of device addition and removals. - The whole probing process, including pre-probing and post-probing filters, is - implemented in the core ModemManager daemon. Plugins will just configure their - own special needs in the probing process, so that only the steps required by the - given plugin are executed. For example, plugins which do not support RS232 - devices will not need AT-based vendor or product filters. + When udev support is disabled in the build, the ID_MM_CANDIDATE + tag and manual scan requests are still applicable. ModemManager has a built-in parser + of udev rule files that is enabled when udev itself isn't available. +
+
-
- Pre-probing filters - - Pre-probing filters are those which control whether the probing, as - requested by the specific plugin, takes place. - + + Modem filter + + + ModemManager will not probe all TTYs, NET and cdc-wdm ports found in the system, + as this may end up interfering e.g. with TTYs that have nothing to do with modem + devices. + + + The daemon comes with several predefined filter policies, each + of them composed of one or more filter rules. + + +
+ Filter rules + + The device filter in ModemManager defines the following independent filter rules. The + predefined filter policies are based on one or more of these predefined filter rules. - Allowed vendor IDs - - Plugins can provide a list of udev-reported vendor IDs to be used as - pre-probing filters. If the vendor ID reported by the device via udev - is found in the list provided by the plugin, port probing will be - launched as requested by the given plugin. - + MM_FILTER_RULE_EXPLICIT_WHITELIST - This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_IDS - property in the MMPlugin object provided - by the plugin. + This filter allows users to manually tag devices and/or device ports with the + ID_MM_DEVICE_PROCESS udev tag. If the filter finds this tag, + the device and/or device ports will be automatically accepted and port probing + will be allowed. + +$ sudo vim /lib/udev/rules.d/78-mm-whitelist-internal-modem.rules + ACTION!="add|change|move", GOTO="mm_whitelist_internal_modem_end" + ATTRS{idVendor}=="1199", ATTRS{idProduct}=="a001", ENV{ID_MM_DEVICE_PROCESS}="1" + LABEL="mm_whitelist_internal_modem_end" +// Apply new rules without reboot +$ sudo udevadm control --reload +$ sudo udevadm trigger + - Product IDs + MM_FILTER_RULE_VIRTUAL - Plugins can provide a list of udev-reported pairs of vendor and product - IDs to be used as pre-probing filters. - - - If the vendor ID and product ID pair reported by the device via udev is - found in the list of 'allowed' pairs provided by the plugin, port probing - will be launched as requested by the given plugin. This additional filter - should be used when the plugin is expected to work only with a given - specific product of a given vendor. - - - If the vendor ID and product ID pair reported by the device via udev is - found in the list of 'forbidden' pairs provided by the plugin, port probing - will not be launched by this plugin. This additional filter - should be used when the plugin supports all devices of a given vendor - except for some specific ones. - - - These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_IDS - and MM_PLUGIN_FORBIDDEN_PRODUCT_IDS properties in the - MMPlugin object provided by the plugin. + This filter will automatically flag as forbidden all ports exposed by virtual + devices, like the 'lo' network interface or the tty0, tty1... virtual terminals. + There is no reason to disable this filter, except for testing purposes. - Subsystems - - Plugins can specify which subsystems they expect, so that we filter out - any port detected with a subsystem not listed by the plugin. - + MM_FILTER_RULE_NET - This filter is specified by the MM_PLUGIN_ALLOWED_SUBSYSTEMS - property in the MMPlugin object provided - by the plugin. + This filter will automatically flag as allowed all network ports exposed by + devices. Unless there is a will to explicitly forbid network ports, this filter + should always be enabled. - Drivers - - Plugins can specify which drivers they expect, so that we filter out - any port detected being managed by a driver not listed by the plugin. - - - Plugins can also specify which drivers they do not expect, so that we - filter out any port detected being managed by a driver listed by the plugin. - + MM_FILTER_RULE_CDC_WDM - These filters are specified by the MM_PLUGIN_ALLOWED_DRIVERS - and MM_PLUGIN_FORBIDDEN_DRIVERS properties in the - MMPlugin object provided by the plugin. + This filter will automatically flag as allowed all cdc-wdm ports exposed by + devices. Unless there is a will to explicitly forbid the cdc-wdm ports exposed + by qmi_wwan, cdc_mbim or huawei-cdc-ncm kernel drivers, this filter should always + be enabled. - udev tags + MM_FILTER_RULE_TTY, MM_FILTER_RULE_TTY_DEFAULT_ALLOWED and MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN - Plugins can provide a list of udev tags, so that we filter out - any port detected which doesn't expose any of the given tags. + If the MM_FILTER_RULE_TTY filter is disabled, no TTY port will be allowed. If this + filter is enabled, TTY ports will only be allowed if the TTY-specific filters (defined + next) allow it. - This filter is specified by the MM_PLUGIN_ALLOWED_UDEV_TAGS - property in the MMPlugin object provided - by the plugin. + The MM_FILTER_RULE_TTY_DEFAULT_ALLOWED and MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN rules allow + defining what happens when a TTY port isn't explicitly forbidden or accepted by any of + the TTY-specific filters. When MM_FILTER_RULE_TTY is enabled, one of these other two options + must be set. - -
- -
- Probing sequence - - Whenever all pre-probing filters of a given plugin pass, ModemManager will run - the probing sequence as requested by the specific plugin. The main purpose of the - probing sequence step is to determine the type of port being probed, and also - prepare the information required in any expected post-probing filter. - - - Custom initialization - - This property allows plugins to provide an asynchronous method which will get - executed as soon as the AT port gets opened. This method may be used for any - purpose, like running an early command in the ports as soon as possible, or - querying the modem for info about the port layout. - + MM_FILTER_RULE_TTY_BLACKLIST - This configuration is specified by the MM_PLUGIN_CUSTOM_INIT - property in the MMPlugin object provided - by the plugin. + This filter will not allow probing any of the devices flagged as + ID_MM_DEVICE_IGNORE, like the ones in the default blacklist + shipped by ModemManager. - AT allowed + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY - This boolean property allows plugins to specify that they expect and support - AT serial ports. - - - This configuration is specified by the MM_PLUGIN_ALLOWED_AT - property in the MMPlugin object provided - by the plugin. + This filter will not allow automatic probing any of the devices flagged as + ID_MM_DEVICE_MANUAL_SCAN_ONLY, like the ones in the default + USB serial adapters greylist shipped by ModemManager. Devices flagged like + this will only be probed when a manual scan is requested via the + ScanDevices + method. - Single AT expected + MM_FILTER_RULE_TTY_PLATFORM_DRIVER - This boolean property allows plugins to specify that they only expect and support - one AT serial port. Whenever the first AT port is grabbed, any remaining AT probing - in ports of the same device will get cancelled. + If this filter is enabled, all platform TTY ports not explicitly flagged with the + ID_MM_PLATFORM_DRIVER_PROBE will be forbidden. If the flag + is found in a platform TTY port, port probing will be allowed directly. - This configuration is specified by the MM_PLUGIN_ALLOWED_SINGLE_AT - property in the MMPlugin object provided - by the plugin. + Note that this filter is obsoleted by the more generic MM_FILTER_RULE_EXPLICIT_WHITELIST + filter. It is maintained for backwards compatibility with older ModemManager versions. - Custom AT probing + MM_FILTER_RULE_TTY_DRIVER - This property allows plugins to specify custom commands to check whether a port - is AT or not. By default, the 'AT' command will be used if no custom one specified. - - - This configuration is specified by the MM_PLUGIN_CUSTOM_AT_PROBE - property in the MMPlugin object provided - by the plugin. + If this filter is enabled, all TTY ports managed by modem-specific kernel drivers will be + allowed automatically. - QCDM allowed + FILTER_RULE_TTY_ACM_INTERFACE - This boolean property allows plugins to specify that they expect and support - QCDM serial ports. - - - This configuration is specified by the MM_PLUGIN_ALLOWED_QCDM - property in the MMPlugin object provided - by the plugin. + If this filter is enabled, all TTY ports managed by the cdc-acm kernel driver with + class=2/subclass=2/protocol=1 (AT command capable ttyACM port) will be allowed + automatically. - Check Icera support - - This boolean property allows plugins to specify that they want to have the Icera - support checks included in the probing sequence. They can afterwards get the result - of the support check to decide whether they want to create a Icera-based modem - object or not. - + MM_FILTER_RULE_TTY_WITH_NET - This configuration is specified by the MM_PLUGIN_ICERA_PROBE - property in the MMPlugin object provided - by the plugin. + If this filter is enabled, all TTY ports for devices that also expose a network + interface port will be allowed automatically. -
+ +
-
- Post-probing filters - - Post-probing filters are required to identify whether a plugin can handle a given - modem, in special cases where the information retrieved from udev is either not - enough or wrong. This covers, for example, RS232 modems connected through a RS232 - to USB converter, where udev-reported vendor ID is that of the converter, not the - one of the modem. - +
+ Filter policies + + + The predefined filter policies are: - Allowed vendor strings + Whitelist only + + This is a policy where only the MM_FILTER_RULE_EXPLICIT_WHITELIST rule is enabled. + + # /usr/sbin/ModemManager --filter-policy=WHITELIST-ONLY + + + Default - Plugins can provide a list of vendor strings to be used as post-probing - filters. If the vendor string reported by the device via AT commands - is found in the list provided by the plugin, the plugin will report that - it can handle this modem. + This is a policy where the following rules are enabled: + + MM_FILTER_RULE_EXPLICIT_WHITELIST + MM_FILTER_RULE_VIRTUAL + MM_FILTER_RULE_NET + MM_FILTER_RULE_CDC_WDM + MM_FILTER_RULE_TTY + MM_FILTER_RULE_TTY_BLACKLIST + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY + MM_FILTER_RULE_TTY_PLATFORM_DRIVER + MM_FILTER_RULE_TTY_DEFAULT_ALLOWED + - This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_STRINGS - property in the MMPlugin object provided - by the plugin. + This policy is the default one when a different one not explicitly + selected, and is equivalent to the way ModemManager has worked in previous + releases. This policy is the least restrictive one, and will end up + allowing port probing of all TTYs not explicitly blacklisted in one way + or another. + # /usr/sbin/ModemManager --filter-policy=DEFAULT - Product strings + Strict - Plugins can provide a list of pairs of vendor and product - strings to be used as post-probing filters. + This is a policy where the following rules are enabled: + + MM_FILTER_RULE_EXPLICIT_WHITELIST + MM_FILTER_RULE_VIRTUAL + MM_FILTER_RULE_NET + MM_FILTER_RULE_CDC_WDM + MM_FILTER_RULE_TTY + MM_FILTER_RULE_TTY_PLATFORM_DRIVER + MM_FILTER_RULE_TTY_DRIVER + MM_FILTER_RULE_TTY_ACM_INTERFACE + MM_FILTER_RULE_TTY_WITH_NET + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN + - If the vendor and product string pair reported by the device via AT - commands is found in the 'allowed' list provided by the plugin, the - plugin will report that it can handle this modem. This additional filter - should be used when the plugin is expected to work only with a given - specific product of a given vendor. + This policy is stricter than the default one, as by default all TTYs are + forbidden except for the ones explicitly allowed by one of the TTY-specific + rules. Distributions or users should use this policy if they don't want + ModemManager to mess around with TTY ports that may not be exposed by + actual modems. + # /usr/sbin/ModemManager --filter-policy=STRICT + + + Paranoid - If the vendor and product string pair reported by the device via AT - commands is found in the 'forbidden list provided by the plugin, the - plugin will report that it cannot handle this modem. This additional filter - should be used when the plugin supports all devices of a given vendor, except for some specific ones. + This policy is a mix of the Default and Strict ones: + + MM_FILTER_RULE_EXPLICIT_WHITELIST + MM_FILTER_RULE_VIRTUAL + MM_FILTER_RULE_NET + MM_FILTER_RULE_CDC_WDM + MM_FILTER_RULE_TTY + MM_FILTER_RULE_TTY_BLACKLIST + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY + MM_FILTER_RULE_TTY_PLATFORM_DRIVER + MM_FILTER_RULE_TTY_DRIVER + MM_FILTER_RULE_TTY_ACM_INTERFACE + MM_FILTER_RULE_TTY_WITH_NET + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN + - These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_STRINGS - and MM_PLUGIN_FORBIDDEN_PRODUCT_STRINGS properties in the - MMPlugin object provided by the plugin. + This policy is equivalent to the Strict policy, but where the ModemManager + provided blacklist and manual scan only greylist are also used. It is not + recommended to use this option in normal setups as the blacklists may be + obsoleted in future ModemManager versions (in favor of using the Strict + policy as default). + # /usr/sbin/ModemManager --filter-policy=PARANOID + - Icera support + Custom + + Any of the previously defined predefined policies may be modified rule per rule + by explicitly enabling or disabling rules via environment variables. + - Plugins can specify that they only support Icera-based modems, or that they - do not support any Icera-based modem. When either of this configurations is - enabled, the Icera support checks will be included in the - probing sequence, and the result of the check will help to determine whether - the plugin supports the modem or not. + E.g. this would launch ModemManager with the Default filter policy but with all + net and cdc-wdm ports forbidden completely: + +# MM_FILTER_RULE_NET=0 \ + MM_FILTER_RULE_CDC_WDM=0 \ + /usr/sbin/ModemManager --filter-policy=DEFAULT - This filter is specified by the MM_PLUGIN_ALLOWED_ICERA and - MM_PLUGIN_FORBIDDEN_ICERA properties in the - MMPlugin object provided by the plugin. + E.g. this would launch ModemManager with the Whitelist-only filter policy but also + explicitly allowing all net and cdc-wdm ports. Note that in this case, all virtual + net ports (e.g. 'lo') are also being allowed. + +# MM_FILTER_RULE_NET=1 \ + MM_FILTER_RULE_CDC_WDM=1 \ + /usr/sbin/ModemManager --filter-policy=WHITELIST-ONLY + + +
+ + + + Port probing + + Whenever a new device is detected by ModemManager, port probing process will + get started, so that we can determine which kind of ports we have, and also + which plugin we need to use for the specific device. Devices may expose one or + more ports, and all of them will follow the same probing logic. + + + The whole probing process, including pre-probing and post-probing filters, is + implemented in the core ModemManager daemon. Plugins will just configure their + own special needs in the probing process, so that only the steps required by the + given plugin are executed. For example, plugins which do not support RS232 + devices will not need AT-based vendor or product filters. + + +
+ Pre-probing filters + + Pre-probing filters are those which control whether the probing, as + requested by the specific plugin, takes place. + + + + Allowed vendor IDs + + Plugins can provide a list of udev-reported vendor IDs to be used as + pre-probing filters. If the vendor ID reported by the device via udev + is found in the list provided by the plugin, port probing will be + launched as requested by the given plugin. + + + This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_IDS + property in the MMPlugin object provided + by the plugin. + + + + Product IDs + + Plugins can provide a list of udev-reported pairs of vendor and product + IDs to be used as pre-probing filters. + + + If the vendor ID and product ID pair reported by the device via udev is + found in the list of 'allowed' pairs provided by the plugin, port probing + will be launched as requested by the given plugin. This additional filter + should be used when the plugin is expected to work only with a given + specific product of a given vendor. + + + If the vendor ID and product ID pair reported by the device via udev is + found in the list of 'forbidden' pairs provided by the plugin, port probing + will not be launched by this plugin. This additional filter + should be used when the plugin supports all devices of a given vendor + except for some specific ones. + + + These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_IDS + and MM_PLUGIN_FORBIDDEN_PRODUCT_IDS properties in the + MMPlugin object provided by the plugin. + + + + Subsystems + + Plugins can specify which subsystems they expect, so that we filter out + any port detected with a subsystem not listed by the plugin. + + + This filter is specified by the MM_PLUGIN_ALLOWED_SUBSYSTEMS + property in the MMPlugin object provided + by the plugin. + + + + Drivers + + Plugins can specify which drivers they expect, so that we filter out + any port detected being managed by a driver not listed by the plugin. + + + Plugins can also specify which drivers they do not expect, so that we + filter out any port detected being managed by a driver listed by the plugin. + + + These filters are specified by the MM_PLUGIN_ALLOWED_DRIVERS + and MM_PLUGIN_FORBIDDEN_DRIVERS properties in the + MMPlugin object provided by the plugin. + + + + udev tags + + Plugins can provide a list of udev tags, so that we filter out + any port detected which doesn't expose any of the given tags. + + + This filter is specified by the MM_PLUGIN_ALLOWED_UDEV_TAGS + property in the MMPlugin object provided + by the plugin. + + + +
- +
+ Probing sequence + + Whenever all pre-probing filters of a given plugin pass, ModemManager will run + the probing sequence as requested by the specific plugin. The main purpose of the + probing sequence step is to determine the type of port being probed, and also + prepare the information required in any expected post-probing filter. + + + + Custom initialization + + This property allows plugins to provide an asynchronous method which will get + executed as soon as the AT port gets opened. This method may be used for any + purpose, like running an early command in the ports as soon as possible, or + querying the modem for info about the port layout. + - Plugins which require post-probing filters will always be sorted last, and - therefore they will be the last ones being checked for pre-probing filters. This - is due to the fact that we need to assume that these plugins aren't able to - determine port support just with pre-probing filters, as we want to avoid - unnecessary probing sequences launched. Also note that the Generic plugin is - anyway always the last one in the list. - - -
- -
- Probing setup examples - - Probing setup for a plugin requiring udev-based vendor/product checks - + This configuration is specified by the MM_PLUGIN_CUSTOM_INIT + property in the MMPlugin object provided + by the plugin. + + + + AT allowed + + This boolean property allows plugins to specify that they expect and support + AT serial ports. + + + This configuration is specified by the MM_PLUGIN_ALLOWED_AT + property in the MMPlugin object provided + by the plugin. + + + + Single AT expected + + This boolean property allows plugins to specify that they only expect and support + one AT serial port. Whenever the first AT port is grabbed, any remaining AT probing + in ports of the same device will get cancelled. + + + This configuration is specified by the MM_PLUGIN_ALLOWED_SINGLE_AT + property in the MMPlugin object provided + by the plugin. + + + + Custom AT probing + + This property allows plugins to specify custom commands to check whether a port + is AT or not. By default, the 'AT' command will be used if no custom one specified. + + + This configuration is specified by the MM_PLUGIN_CUSTOM_AT_PROBE + property in the MMPlugin object provided + by the plugin. + + + + QCDM allowed + + This boolean property allows plugins to specify that they expect and support + QCDM serial ports. + + + This configuration is specified by the MM_PLUGIN_ALLOWED_QCDM + property in the MMPlugin object provided + by the plugin. + + + + Check Icera support + + This boolean property allows plugins to specify that they want to have the Icera + support checks included in the probing sequence. They can afterwards get the result + of the support check to decide whether they want to create a Icera-based modem + object or not. + + + This configuration is specified by the MM_PLUGIN_ICERA_PROBE + property in the MMPlugin object provided + by the plugin. + + + +
+ +
+ Post-probing filters + + Post-probing filters are required to identify whether a plugin can handle a given + modem, in special cases where the information retrieved from udev is either not + enough or wrong. This covers, for example, RS232 modems connected through a RS232 + to USB converter, where udev-reported vendor ID is that of the converter, not the + one of the modem. + + + + Allowed vendor strings + + Plugins can provide a list of vendor strings to be used as post-probing + filters. If the vendor string reported by the device via AT commands + is found in the list provided by the plugin, the plugin will report that + it can handle this modem. + + + This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_STRINGS + property in the MMPlugin object provided + by the plugin. + + + + Product strings + + Plugins can provide a list of pairs of vendor and product + strings to be used as post-probing filters. + + + If the vendor and product string pair reported by the device via AT + commands is found in the 'allowed' list provided by the plugin, the + plugin will report that it can handle this modem. This additional filter + should be used when the plugin is expected to work only with a given + specific product of a given vendor. + + + If the vendor and product string pair reported by the device via AT + commands is found in the 'forbidden list provided by the plugin, the + plugin will report that it cannot handle this modem. This additional filter + should be used when the plugin supports all devices of a given vendor, except for some specific ones. + + + These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_STRINGS + and MM_PLUGIN_FORBIDDEN_PRODUCT_STRINGS properties in the + MMPlugin object provided by the plugin. + + + + Icera support + + Plugins can specify that they only support Icera-based modems, or that they + do not support any Icera-based modem. When either of this configurations is + enabled, the Icera support checks will be included in the + probing sequence, and the result of the check will help to determine whether + the plugin supports the modem or not. + + + This filter is specified by the MM_PLUGIN_ALLOWED_ICERA and + MM_PLUGIN_FORBIDDEN_ICERA properties in the + MMPlugin object provided by the plugin. + + + + + + + Plugins which require post-probing filters will always be sorted last, and + therefore they will be the last ones being checked for pre-probing filters. This + is due to the fact that we need to assume that these plugins aren't able to + determine port support just with pre-probing filters, as we want to avoid + unnecessary probing sequences launched. Also note that the Generic plugin is + anyway always the last one in the list. + + +
+ +
+ Probing setup examples + + Probing setup for a plugin requiring udev-based vendor/product checks + G_MODULE_EXPORT MMPlugin * mm_plugin_create (void) { @@ -374,12 +646,12 @@ /* No post-probing filters */ NULL)); } - - + + - - Probing setup for a plugin requiring AT-probed vendor/product checks - + + Probing setup for a plugin requiring AT-probed vendor/product checks + G_MODULE_EXPORT MMPlugin * mm_plugin_create (void) { @@ -402,12 +674,12 @@ MM_PLUGIN_PRODUCT_STRINGS, product_strings, NULL)); } - - + + - - Probing setup for a plugin with custom initialization requirements - + + Probing setup for a plugin with custom initialization requirements + static gboolean parse_custom_at (const gchar *response, const GError *error, @@ -451,25 +723,23 @@ /* No post-probing filters */ NULL)); } - - -
-
- -
- Port grabbing and Modem object creation - - Once a port passes all probing filters of a given plugin, the plugin will grab - the port. When the first port of a given device is grabbed, the plugin will create - the required Modem object. - - - While preparing to get the Modem object grab the specific port probed, udev-based - port type hints can be used to specify AT port flags (e.g. if a port is to be - considered primary, secondary or for PPP). - + +
+
+ + Modem object creation + + Once a port passes all probing filters of a given plugin, the plugin will grab + the port. When the first port of a given device is grabbed, the plugin will create + the required Modem object. + + + While preparing to get the Modem object grab the specific port probed, udev-based + port type hints can be used to specify AT port flags (e.g. if a port is to be + considered primary, secondary or for PPP). + diff -Nru modemmanager-1.6.8/docs/reference/api/ModemManager-sections.txt modemmanager-1.10.0/docs/reference/api/ModemManager-sections.txt --- modemmanager-1.6.8/docs/reference/api/ModemManager-sections.txt 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/api/ModemManager-sections.txt 2019-01-17 16:22:34.000000000 +0100 @@ -10,6 +10,7 @@
mm-enums Flags and Enumerations +MMBearerType MMBearerIpFamily MMBearerIpMethod MMBearerAllowedAuth @@ -22,6 +23,7 @@ MMModem3gppSubscriptionState MMModem3gppRegistrationState MMModem3gppUssdSessionState +MMModem3gppEpsUeModeOperation MMModemAccessTechnology MMModemBand MMModemCapability @@ -30,6 +32,7 @@ MMModemCdmaRmProtocol MMModemContactsStorage MMModemLocationSource +MMModemLocationAssistanceDataType MMModemLock MMModemMode MMModemState @@ -37,6 +40,7 @@ MMModemStateChangeReason MMModemPowerState MMModemPortType +MMModemFirmwareUpdateMethod MMOmaFeature MMOmaSessionState MMOmaSessionStateFailedReason @@ -67,3 +71,94 @@ MM_MOBILE_EQUIPMENT_ERROR_DBUS_PREFIX MM_SERIAL_ERROR_DBUS_PREFIX
+ +
+mm-compat +MM_MODEM_BAND_U2100 +MM_MODEM_BAND_U1900 +MM_MODEM_BAND_U1800 +MM_MODEM_BAND_U17IV +MM_MODEM_BAND_U850 +MM_MODEM_BAND_U800 +MM_MODEM_BAND_U2600 +MM_MODEM_BAND_U900 +MM_MODEM_BAND_U17IX +MM_MODEM_BAND_EUTRAN_I +MM_MODEM_BAND_EUTRAN_II +MM_MODEM_BAND_EUTRAN_III +MM_MODEM_BAND_EUTRAN_IV +MM_MODEM_BAND_EUTRAN_V +MM_MODEM_BAND_EUTRAN_VI +MM_MODEM_BAND_EUTRAN_VII +MM_MODEM_BAND_EUTRAN_VIII +MM_MODEM_BAND_EUTRAN_IX +MM_MODEM_BAND_EUTRAN_X +MM_MODEM_BAND_EUTRAN_XI +MM_MODEM_BAND_EUTRAN_XII +MM_MODEM_BAND_EUTRAN_XIII +MM_MODEM_BAND_EUTRAN_XIV +MM_MODEM_BAND_EUTRAN_XVII +MM_MODEM_BAND_EUTRAN_XVIII +MM_MODEM_BAND_EUTRAN_XIX +MM_MODEM_BAND_EUTRAN_XX +MM_MODEM_BAND_EUTRAN_XXI +MM_MODEM_BAND_EUTRAN_XXII +MM_MODEM_BAND_EUTRAN_XXIII +MM_MODEM_BAND_EUTRAN_XXIV +MM_MODEM_BAND_EUTRAN_XXV +MM_MODEM_BAND_EUTRAN_XXVI +MM_MODEM_BAND_EUTRAN_XXXIII +MM_MODEM_BAND_EUTRAN_XXXIV +MM_MODEM_BAND_EUTRAN_XXXV +MM_MODEM_BAND_EUTRAN_XXXVI +MM_MODEM_BAND_EUTRAN_XXXVII +MM_MODEM_BAND_EUTRAN_XXXVIII +MM_MODEM_BAND_EUTRAN_XXXIX +MM_MODEM_BAND_EUTRAN_XL +MM_MODEM_BAND_EUTRAN_XLI +MM_MODEM_BAND_EUTRAN_XLII +MM_MODEM_BAND_EUTRAN_XLIII +MM_MODEM_BAND_EUTRAN_XLIV +MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 +MM_MODEM_BAND_CDMA_BC1_PCS_1900 +MM_MODEM_BAND_CDMA_BC2_TACS +MM_MODEM_BAND_CDMA_BC3_JTACS +MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS +MM_MODEM_BAND_CDMA_BC5_NMT450 +MM_MODEM_BAND_CDMA_BC6_IMT2000 +MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 +MM_MODEM_BAND_CDMA_BC8_1800 +MM_MODEM_BAND_CDMA_BC9_900 +MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 +MM_MODEM_BAND_CDMA_BC11_PAMR_400 +MM_MODEM_BAND_CDMA_BC12_PAMR_800 +MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 +MM_MODEM_BAND_CDMA_BC14_PCS2_1900 +MM_MODEM_BAND_CDMA_BC15_AWS +MM_MODEM_BAND_CDMA_BC16_US_2500 +MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 +MM_MODEM_BAND_CDMA_BC18_US_PS_700 +MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 + +MMModemBandDeprecated +MM_DEPRECATED +
+ +
+mm-tags +Common udev tags +ID_MM_CANDIDATE +ID_MM_PHYSDEV_UID +ID_MM_PORT_IGNORE +ID_MM_DEVICE_PROCESS +ID_MM_DEVICE_IGNORE +ID_MM_DEVICE_MANUAL_SCAN_ONLY +ID_MM_PLATFORM_DRIVER_PROBE +ID_MM_PORT_TYPE_AT_PPP +ID_MM_PORT_TYPE_AT_PRIMARY +ID_MM_PORT_TYPE_AT_SECONDARY +ID_MM_PORT_TYPE_GPS +ID_MM_PORT_TYPE_QCDM +ID_MM_TTY_BAUDRATE +ID_MM_TTY_FLOW_CONTROL +
diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/annotation-glossary.html modemmanager-1.10.0/docs/reference/libmm-glib/html/annotation-glossary.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/annotation-glossary.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/annotation-glossary.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,11 +3,11 @@ Annotation Glossary: libmm-glib Reference Manual - + - + @@ -18,6 +18,8 @@  |  E  |  + N +  |  O  |  S @@ -42,6 +44,9 @@

E

element-type

Generics and defining elements of containers and arrays.

+

N

+
nullable
+

NULL may be passed as the value in, out, in-out; or as a return value.

O

out

Parameter for returning results. Default is transfer full.

@@ -59,6 +64,6 @@

Override the parsed C type with given type.

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch01.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch01.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch01.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch01.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Common enums and flags helpers: libmm-glib Reference Manual - + - + @@ -27,6 +27,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch02.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch02.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch02.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The Manager object: libmm-glib Reference Manual - + - + @@ -22,11 +22,16 @@

The Manager object

-
+
+
MMManager — The Manager object -
+
+
+MMKernelEventProperties — Helper object to handle kernel event properties. +
+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The Modem object: libmm-glib Reference Manual - + - + - + @@ -16,7 +16,7 @@ Home Up -Prev +Prev Next
@@ -98,6 +98,9 @@
MMFirmwareProperties — Helper object to handle firmware information.
+
+MMFirmwareUpdateSettings — Helper object to handle firmware update settings. +
Extended signal information
@@ -116,11 +119,15 @@
MMModemVoice — The Voice interface
+
PCO support
+
+MMPco — Helper object to handle 3GPP PCO. +

Generic interfaces

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s02.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s02.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s02.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Simple interface support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Simple interface support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s03.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s03.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s03.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s03.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Location support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Location support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s04.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s04.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s04.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s04.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Messaging support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Messaging support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s05.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s05.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s05.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s05.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Time support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Time support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s06.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s06.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s06.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s06.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Firmware support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Firmware support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s07.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s07.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s07.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s07.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Extended signal information: libmm-glib Reference Manual - + - + - + @@ -16,12 +16,12 @@ Home Up -Prev +Prev Next

Extended signal information

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s08.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s08.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s08.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s08.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ OMA support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

OMA support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s09.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s09.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s09.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s09.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Voice support: libmm-glib Reference Manual - + - + @@ -22,6 +22,6 @@

Voice support

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s10.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s10.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch03s10.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch03s10.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,27 @@ + + + + +PCO support: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +

+PCO support

+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch04.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch04.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch04.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch04.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The Bearer object: libmm-glib Reference Manual - + - + - + @@ -16,7 +16,7 @@ Home Up -Prev +Prev Next
@@ -33,11 +33,11 @@ MMBearerIpConfig — Helper object to handle IP configuration.
-MMBearerStats — Helper object to handle bearer stats. +MMBearerStats — Helper object to handle bearer stats.
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch05.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch05.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch05.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch05.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The SIM object: libmm-glib Reference Manual - + - + - + @@ -16,7 +16,7 @@ Home Up -Prev +Prev Next
@@ -27,6 +27,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch06.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch06.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch06.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch06.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The SMS object: libmm-glib Reference Manual - + - + @@ -32,6 +32,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ch07.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ch07.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ch07.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ch07.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ The Call object: libmm-glib Reference Manual - + - + @@ -29,9 +29,12 @@
MMCallProperties — Helper object to handle CALL properties.
+
+MMCallAudioFormat — Helper object to handle voice call audio formats. +
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/deprecated-api-index.html modemmanager-1.10.0/docs/reference/libmm-glib/html/deprecated-api-index.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/deprecated-api-index.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/deprecated-api-index.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ - - - - -Index of deprecated API: libmm-glib Reference Manual - - - - - - - - - - - - - - - - -
-

-Index of deprecated API

- -
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/index.html modemmanager-1.10.0/docs/reference/libmm-glib/html/index.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/index.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/index.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,10 +3,10 @@ libmm-glib Reference Manual: libmm-glib Reference Manual - + - + @@ -26,10 +26,10 @@       

- For libmm-glib version 1.6.8 + For libmm-glib version 1.10.0

-
+

Permission is granted to copy, distribute and/or modify this @@ -62,9 +62,14 @@ Flags and Enumerations

The Manager object
-
+
+
MMManager — The Manager object -
+ +
+MMKernelEventProperties — Helper object to handle kernel event properties. +
+
The Modem object
@@ -142,6 +147,9 @@
MMFirmwareProperties — Helper object to handle firmware information.
+
+MMFirmwareUpdateSettings — Helper object to handle firmware update settings. +
Extended signal information
@@ -160,6 +168,10 @@
MMModemVoice — The Voice interface
+
PCO support
+
+MMPco — Helper object to handle 3GPP PCO. +
The Bearer object
@@ -173,7 +185,7 @@ MMBearerIpConfig — Helper object to handle IP configuration.
-MMBearerStats — Helper object to handle bearer stats. +MMBearerStats — Helper object to handle bearer stats.
The SIM object
@@ -197,6 +209,9 @@
MMCallProperties — Helper object to handle CALL properties.
+
+MMCallAudioFormat — Helper object to handle voice call audio formats. +
II. Low level API
@@ -369,11 +384,10 @@
Object Hierarchy
API Index
-
Index of deprecated API
Annotation Glossary
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/ix01.html modemmanager-1.10.0/docs/reference/libmm-glib/html/ix01.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/ix01.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/ix01.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ API Index: libmm-glib Reference Manual - + - + @@ -21,6 +21,8 @@  |  G  |  + K +  |  L  |  M @@ -29,6 +31,8 @@  |  O  |  + P +  |  S  |  U @@ -54,7 +58,7 @@
-MMBearerStats, struct in MMBearerStats +MMBearerStats, struct in MMBearerStats
@@ -94,6 +98,10 @@
+mm_bearer_get_bearer_type, function in MMBearer +
+
+
mm_bearer_get_connected, function in MMBearer
@@ -246,15 +254,19 @@
-mm_bearer_stats_get_duration, function in MMBearerStats +mm_bearer_stats_get_duration, function in MMBearerStats +
+
+
+mm_bearer_stats_get_rx_bytes, function in MMBearerStats
-mm_bearer_stats_get_rx_bytes, function in MMBearerStats +mm_bearer_stats_get_tx_bytes, function in MMBearerStats
-mm_bearer_stats_get_tx_bytes, function in MMBearerStats +mm_bearer_type_get_string, function in Flags and Enumerations

C

@@ -263,6 +275,10 @@
+MMCallAudioFormat, struct in MMCallAudioFormat +
+
+
MMCallProperties, struct in MMCallProperties
@@ -279,10 +295,26 @@
+mm_call_audio_format_get_encoding, function in MMCallAudioFormat +
+
+
+mm_call_audio_format_get_rate, function in MMCallAudioFormat +
+
+
+mm_call_audio_format_get_resolution, function in MMCallAudioFormat +
+
+
mm_call_direction_get_string, function in Flags and Enumerations
+mm_call_dup_audio_port, function in MMCall +
+
+
mm_call_dup_number, function in MMCall
@@ -291,6 +323,14 @@
+mm_call_get_audio_format, function in MMCall +
+
+
+mm_call_get_audio_port, function in MMCall +
+
+
mm_call_get_direction, function in MMCall
@@ -323,6 +363,10 @@
+mm_call_peek_audio_format, function in MMCall +
+
+
mm_call_properties_get_direction, function in MMCallProperties
@@ -472,6 +516,10 @@
+MMFirmwareUpdateSettings, struct in MMFirmwareUpdateSettings +
+
+
mm_firmware_image_type_get_string, function in Flags and Enumerations
@@ -503,6 +551,22 @@ mm_firmware_properties_get_unique_id, function in MMFirmwareProperties
+
+mm_firmware_update_settings_get_device_ids, function in MMFirmwareUpdateSettings +
+
+
+mm_firmware_update_settings_get_fastboot_at, function in MMFirmwareUpdateSettings +
+
+
+mm_firmware_update_settings_get_method, function in MMFirmwareUpdateSettings +
+
+
+mm_firmware_update_settings_get_version, function in MMFirmwareUpdateSettings +
+

G

MmGdbusBearer, struct in MmGdbusBearer @@ -517,6 +581,10 @@
+MmGdbusBearer:bearer-type, object property in MmGdbusBearer +
+
+
MmGdbusBearer:connected, object property in MmGdbusBearer
@@ -589,6 +657,14 @@
+MmGdbusCall:audio-format, object property in MmGdbusCall +
+
+
+MmGdbusCall:audio-port, object property in MmGdbusCall +
+
+
MmGdbusCall:direction, object property in MmGdbusCall
@@ -633,14 +709,34 @@
+MmGdbusModem3gpp::handle-set-eps-ue-mode-operation, object signal in MmGdbusModem3gpp +
+
+
+MmGdbusModem3gpp::handle-set-initial-eps-bearer-settings, object signal in MmGdbusModem3gpp +
+
+
MmGdbusModem3gpp:enabled-facility-locks, object property in MmGdbusModem3gpp
+MmGdbusModem3gpp:eps-ue-mode-operation, object property in MmGdbusModem3gpp +
+
+
MmGdbusModem3gpp:imei, object property in MmGdbusModem3gpp
+MmGdbusModem3gpp:initial-eps-bearer, object property in MmGdbusModem3gpp +
+
+
+MmGdbusModem3gpp:initial-eps-bearer-settings, object property in MmGdbusModem3gpp +
+
+
MmGdbusModem3gpp:operator-code, object property in MmGdbusModem3gpp
@@ -649,6 +745,10 @@
+MmGdbusModem3gpp:pco, object property in MmGdbusModem3gpp +
+
+
MmGdbusModem3gpp:registration-state, object property in MmGdbusModem3gpp
@@ -793,6 +893,10 @@
+MmGdbusModem:hardware-revision, object property in MmGdbusModem +
+
+
MmGdbusModem:manufacturer, object property in MmGdbusModem
@@ -941,6 +1045,10 @@
+MmGdbusModemFirmware:update-settings, object property in MmGdbusModemFirmware +
+
+
MmGdbusModemFirmwareIface, struct in MmGdbusModemFirmware
@@ -965,6 +1073,10 @@
+MmGdbusModemLocation::handle-inject-assistance-data, object signal in MmGdbusModemLocation +
+
+
MmGdbusModemLocation::handle-set-gps-refresh-rate, object signal in MmGdbusModemLocation
@@ -977,6 +1089,10 @@
+MmGdbusModemLocation:assistance-data-servers, object property in MmGdbusModemLocation +
+
+
MmGdbusModemLocation:capabilities, object property in MmGdbusModemLocation
@@ -1001,6 +1117,10 @@
+MmGdbusModemLocation:supported-assistance-data, object property in MmGdbusModemLocation +
+
+
MmGdbusModemLocationIface, struct in MmGdbusModemLocation
@@ -1333,6 +1453,14 @@
+MmGdbusOrgFreedesktopModemManager1::handle-inhibit-device, object signal in MmGdbusOrgFreedesktopModemManager1 +
+
+
+MmGdbusOrgFreedesktopModemManager1::handle-report-kernel-event, object signal in MmGdbusOrgFreedesktopModemManager1 +
+
+
MmGdbusOrgFreedesktopModemManager1::handle-scan-devices, object signal in MmGdbusOrgFreedesktopModemManager1
@@ -1341,6 +1469,10 @@
+MmGdbusOrgFreedesktopModemManager1:version, object property in MmGdbusOrgFreedesktopModemManager1 +
+
+
MmGdbusOrgFreedesktopModemManager1Iface, struct in MmGdbusOrgFreedesktopModemManager1
@@ -1533,6 +1665,10 @@
+mm_gdbus_bearer_get_bearer_type, function in MmGdbusBearer +
+
+
mm_gdbus_bearer_get_connected, function in MmGdbusBearer
@@ -1641,15 +1777,23 @@
+mm_gdbus_call_dup_audio_format, function in MmGdbusCall +
+
+
+mm_gdbus_call_dup_audio_port, function in MmGdbusCall +
+
+
mm_gdbus_call_dup_number, function in MmGdbusCall
-mm_gdbus_call_emit_dtmf_received, function in MmGdbusCall +mm_gdbus_call_get_audio_format, function in MmGdbusCall
-mm_gdbus_call_emit_state_changed, function in MmGdbusCall +mm_gdbus_call_get_audio_port, function in MmGdbusCall
@@ -1721,10 +1865,42 @@
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_dup_imei, function in MmGdbusModem3gpp
+mm_gdbus_modem3gpp_dup_initial_eps_bearer, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_dup_operator_code, function in MmGdbusModem3gpp
@@ -1733,14 +1909,30 @@
+mm_gdbus_modem3gpp_dup_pco, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_get_enabled_facility_locks, function in MmGdbusModem3gpp
+mm_gdbus_modem3gpp_get_eps_ue_mode_operation, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_get_imei, function in MmGdbusModem3gpp
+mm_gdbus_modem3gpp_get_initial_eps_bearer, function in MmGdbusModem3gpp +
+
+
+mm_gdbus_modem3gpp_get_initial_eps_bearer_settings, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_get_operator_code, function in MmGdbusModem3gpp
@@ -1749,6 +1941,10 @@
+mm_gdbus_modem3gpp_get_pco, function in MmGdbusModem3gpp +
+
+
mm_gdbus_modem3gpp_get_registration_state, function in MmGdbusModem3gpp
@@ -2117,6 +2313,10 @@
+mm_gdbus_modem_dup_hardware_revision, function in MmGdbusModem +
+
+
mm_gdbus_modem_dup_manufacturer, function in MmGdbusModem
@@ -2193,6 +2393,14 @@
+mm_gdbus_modem_firmware_dup_update_settings, function in MmGdbusModemFirmware +
+
+
+mm_gdbus_modem_firmware_get_update_settings, function in MmGdbusModemFirmware +
+
+
mm_gdbus_modem_firmware_proxy_new, function in MmGdbusModemFirmwareProxy
@@ -2257,6 +2465,10 @@
+mm_gdbus_modem_get_hardware_revision, function in MmGdbusModem +
+
+
mm_gdbus_modem_get_manufacturer, function in MmGdbusModem
@@ -2349,6 +2561,18 @@
+mm_gdbus_modem_location_call_inject_assistance_data, function in MmGdbusModemLocation +
+
+
+mm_gdbus_modem_location_call_inject_assistance_data_finish, function in MmGdbusModemLocation +
+
+
+mm_gdbus_modem_location_call_inject_assistance_data_sync, function in MmGdbusModemLocation +
+
+
mm_gdbus_modem_location_call_setup, function in MmGdbusModemLocation
@@ -2385,6 +2609,10 @@
+mm_gdbus_modem_location_dup_assistance_data_servers, function in MmGdbusModemLocation +
+
+
mm_gdbus_modem_location_dup_location, function in MmGdbusModemLocation
@@ -2393,6 +2621,10 @@
+mm_gdbus_modem_location_get_assistance_data_servers, function in MmGdbusModemLocation +
+
+
mm_gdbus_modem_location_get_capabilities, function in MmGdbusModemLocation
@@ -2417,6 +2649,10 @@
+mm_gdbus_modem_location_get_supported_assistance_data, function in MmGdbusModemLocation +
+
+
mm_gdbus_modem_location_proxy_new, function in MmGdbusModemLocationProxy
@@ -3101,6 +3337,30 @@
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices, function in MmGdbusOrgFreedesktopModemManager1
@@ -3125,6 +3385,14 @@
+mm_gdbus_org_freedesktop_modem_manager1_dup_version, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
+mm_gdbus_org_freedesktop_modem_manager1_get_version, function in MmGdbusOrgFreedesktopModemManager1 +
+
+
mm_gdbus_org_freedesktop_modem_manager1_proxy_new, function in MmGdbusOrgFreedesktopModemManager1Proxy
@@ -3404,6 +3672,47 @@ mm_gdbus_sms_skeleton_new, function in MmGdbusSmsSkeleton
+

K

+
+MMKernelEventProperties, struct in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_get_action, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_get_name, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_get_subsystem, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_get_uid, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_new, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_set_action, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_set_name, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_set_subsystem, function in MMKernelEventProperties +
+
+
+mm_kernel_event_properties_set_uid, function in MMKernelEventProperties +
+

L

MMLocation3gpp, struct in MMLocation3gpp @@ -3438,6 +3747,10 @@
+mm_location_3gpp_get_tracking_area_code, function in MMLocation3gpp +
+
+
MM_LOCATION_ALTITUDE_UNKNOWN, macro in MMModemLocation
@@ -3491,6 +3804,22 @@
+mm_manager_get_version, function in MMManager +
+
+
+mm_manager_inhibit_device, function in MMManager +
+
+
+mm_manager_inhibit_device_finish, function in MMManager +
+
+
+mm_manager_inhibit_device_sync, function in MMManager +
+
+
mm_manager_new, function in MMManager
@@ -3507,6 +3836,18 @@
+mm_manager_report_kernel_event, function in MMManager +
+
+
+mm_manager_report_kernel_event_finish, function in MMManager +
+
+
+mm_manager_report_kernel_event_sync, function in MMManager +
+
+
mm_manager_scan_devices, function in MMManager
@@ -3531,6 +3872,18 @@
+mm_manager_uninhibit_device, function in MMManager +
+
+
+mm_manager_uninhibit_device_finish, function in MMManager +
+
+
+mm_manager_uninhibit_device_sync, function in MMManager +
+
+
MMModem, struct in MMModem
@@ -3595,6 +3948,10 @@
+mm_modem_3gpp_dup_initial_eps_bearer_path, function in MMModem3gpp +
+
+
mm_modem_3gpp_dup_operator_code, function in MMModem3gpp
@@ -3607,6 +3964,10 @@
+mm_modem_3gpp_eps_ue_mode_operation_get_string, function in Flags and Enumerations +
+
+
mm_modem_3gpp_facility_build_string_from_mask, function in Flags and Enumerations
@@ -3615,10 +3976,34 @@
+mm_modem_3gpp_get_eps_ue_mode_operation, function in MMModem3gpp +
+
+
mm_modem_3gpp_get_imei, function in MMModem3gpp
+mm_modem_3gpp_get_initial_eps_bearer, function in MMModem3gpp +
+
+
+mm_modem_3gpp_get_initial_eps_bearer_finish, function in MMModem3gpp +
+
+
+mm_modem_3gpp_get_initial_eps_bearer_path, function in MMModem3gpp +
+
+
+mm_modem_3gpp_get_initial_eps_bearer_settings, function in MMModem3gpp +
+
+
+mm_modem_3gpp_get_initial_eps_bearer_sync, function in MMModem3gpp +
+
+
mm_modem_3gpp_get_operator_code, function in MMModem3gpp
@@ -3631,6 +4016,10 @@
+mm_modem_3gpp_get_pco, function in MMModem3gpp +
+
+
mm_modem_3gpp_get_registration_state, function in MMModem3gpp
@@ -3667,6 +4056,10 @@
+mm_modem_3gpp_peek_initial_eps_bearer_settings, function in MMModem3gpp +
+
+
mm_modem_3gpp_register, function in MMModem3gpp
@@ -3695,6 +4088,30 @@
+mm_modem_3gpp_set_eps_ue_mode_operation, function in MMModem3gpp +
+
+
+mm_modem_3gpp_set_eps_ue_mode_operation_finish, function in MMModem3gpp +
+
+
+mm_modem_3gpp_set_eps_ue_mode_operation_sync, function in MMModem3gpp +
+
+
+mm_modem_3gpp_set_initial_eps_bearer_settings, function in MMModem3gpp +
+
+
+mm_modem_3gpp_set_initial_eps_bearer_settings_finish, function in MMModem3gpp +
+
+
+mm_modem_3gpp_set_initial_eps_bearer_settings_sync, function in MMModem3gpp +
+
+
mm_modem_3gpp_subscription_state_get_string, function in Flags and Enumerations
@@ -3939,6 +4356,10 @@
+mm_modem_dup_hardware_revision, function in MMModem +
+
+
mm_modem_dup_manufacturer, function in MMModem
@@ -4003,6 +4424,10 @@
+mm_modem_firmware_get_update_settings, function in MMModemFirmware +
+
+
mm_modem_firmware_list, function in MMModemFirmware
@@ -4015,6 +4440,10 @@
+mm_modem_firmware_peek_update_settings, function in MMModemFirmware +
+
+
mm_modem_firmware_select, function in MMModemFirmware
@@ -4027,6 +4456,10 @@
+mm_modem_firmware_update_method_build_string_from_mask, function in Flags and Enumerations +
+
+
mm_modem_get_access_technologies, function in MMModem
@@ -4063,6 +4496,10 @@
+mm_modem_get_hardware_revision, function in MMModem +
+
+
mm_modem_get_manufacturer, function in MMModem
@@ -4175,6 +4612,14 @@
+mm_modem_location_assistance_data_type_build_string_from_mask, function in Flags and Enumerations +
+
+
+mm_modem_location_dup_assistance_data_servers, function in MMModemLocation +
+
+
mm_modem_location_dup_path, function in MMModemLocation
@@ -4195,6 +4640,10 @@
+mm_modem_location_get_assistance_data_servers, function in MMModemLocation +
+
+
mm_modem_location_get_capabilities, function in MMModemLocation
@@ -4263,6 +4712,22 @@
+mm_modem_location_get_supported_assistance_data, function in MMModemLocation +
+
+
+mm_modem_location_inject_assistance_data, function in MMModemLocation +
+
+
+mm_modem_location_inject_assistance_data_finish, function in MMModemLocation +
+
+
+mm_modem_location_inject_assistance_data_sync, function in MMModemLocation +
+
+
mm_modem_location_setup, function in MMModemLocation
@@ -4884,6 +5349,31 @@ mm_oma_session_type_get_string, function in Flags and Enumerations
+

P

+
+MMPco, struct in MMPco +
+
+
+mm_pco_get_data, function in MMPco +
+
+
+mm_pco_get_session_id, function in MMPco +
+
+
+mm_pco_is_complete, function in MMPco +
+
+
+mm_pco_list_add, function in MMPco +
+
+
+mm_pco_list_free, function in MMPco +
+

S

MMSignal, struct in MMSignal @@ -5484,6 +5974,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib.devhelp2 modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib.devhelp2 --- modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib.devhelp2 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib.devhelp2 2019-01-17 16:22:34.000000000 +0100 @@ -7,6 +7,7 @@ + @@ -40,6 +41,7 @@ + @@ -51,12 +53,15 @@ + + + - + @@ -68,6 +73,7 @@ + @@ -133,6 +139,7 @@ + @@ -151,11 +158,14 @@ + + + @@ -176,13 +186,33 @@ + + + + + + + + + + + + + + + + + + + + @@ -224,6 +254,8 @@ + + @@ -318,13 +350,28 @@ - + + + + + + + + + + + + + + + + @@ -417,8 +464,8 @@ - - + + @@ -449,16 +496,22 @@ + - + + + + + + @@ -484,6 +537,7 @@ + @@ -534,6 +588,8 @@ + + @@ -543,6 +599,11 @@ + + + + + @@ -603,6 +664,12 @@ + + + + + + @@ -610,6 +677,7 @@ + @@ -638,8 +706,8 @@ - - + + @@ -650,10 +718,10 @@ - - - - + + + + @@ -743,6 +811,10 @@ + + + + @@ -766,14 +838,29 @@ + + + + + + + + + + + + + + + @@ -880,6 +967,8 @@ + + @@ -940,6 +1029,7 @@ + @@ -990,22 +1080,41 @@ + + + + + + + + + + + + + + + + + + + @@ -1090,6 +1199,9 @@ + + + @@ -1099,18 +1211,24 @@ + + + + + + @@ -1175,6 +1293,8 @@ + + @@ -1183,6 +1303,7 @@ + @@ -1325,6 +1446,7 @@ + @@ -1335,6 +1457,7 @@ + @@ -1456,8 +1579,10 @@ - - + + + + @@ -1472,6 +1597,8 @@ + + @@ -1498,8 +1625,11 @@ + + + @@ -1522,6 +1652,7 @@ + @@ -1546,10 +1677,16 @@ + + + + + + @@ -1572,15 +1709,18 @@ + + + @@ -1597,6 +1737,7 @@ + @@ -1629,6 +1770,7 @@ + @@ -1670,6 +1812,8 @@ + + diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib-Flags-and-Enumerations.html modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib-Flags-and-Enumerations.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib-Flags-and-Enumerations.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib-Flags-and-Enumerations.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Flags and Enumerations: libmm-glib Reference Manual - + - + @@ -43,6 +43,13 @@ const gchar * +mm_bearer_type_get_string () + + + +const gchar * + + mm_bearer_ip_method_get_string () @@ -174,6 +181,13 @@ const gchar * +mm_modem_3gpp_eps_ue_mode_operation_get_string () + + + +const gchar * + + mm_modem_cdma_registration_state_get_string () @@ -200,6 +214,14 @@ + +gchar * + + +mm_modem_location_assistance_data_type_build_string_from_mask () + + + const gchar * @@ -207,6 +229,14 @@ + +gchar * + + +mm_modem_firmware_update_method_build_string_from_mask () + + + const gchar * @@ -321,6 +351,34 @@

Functions

+

mm_bearer_type_get_string ()

+
const gchar *
+mm_bearer_type_get_string (MMBearerType val);
+

Gets the nickname string for the MMBearerType specified at val +.

+
+

Parameters

+
+++++ + + + + + +

val

a MMBearerType.

 
+
+
+

Returns

+

a string with the nickname, or NULL if not found. Do not free the returned value.

+

[transfer none]

+
+
+
+

mm_bearer_ip_method_get_string ()

const gchar *
 mm_bearer_ip_method_get_string (MMBearerIpMethod val);
@@ -343,7 +401,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -371,7 +429,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -401,7 +459,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -431,7 +489,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -459,7 +517,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -488,7 +546,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -517,7 +575,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -545,7 +603,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -573,7 +631,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -603,7 +661,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -632,7 +690,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -660,7 +718,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -688,7 +746,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -717,7 +775,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -746,7 +804,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -776,7 +834,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -805,7 +863,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -834,7 +892,36 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

+

[transfer none]

+
+ +
+
+

mm_modem_3gpp_eps_ue_mode_operation_get_string ()

+
const gchar *
+mm_modem_3gpp_eps_ue_mode_operation_get_string
+                               (MMModem3gppEpsUeModeOperation val);
+

Gets the nickname string for the MMModem3gppEpsUeModeOperation specified at val +.

+
+

Parameters

+
+++++ + + + + + +

val

a MMModem3gppEpsUeModeOperation.

 
+
+
+

Returns

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -863,7 +950,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -892,7 +979,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -920,7 +1007,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -950,7 +1037,37 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

[transfer full]

+
+ +
+
+

mm_modem_location_assistance_data_type_build_string_from_mask ()

+
gchar *
+mm_modem_location_assistance_data_type_build_string_from_mask
+                               (MMModemLocationAssistanceDataType mask);
+

Builds a string containing a comma-separated list of nicknames for +each MMModemLocationAssistanceDataType in mask +.

+
+

Parameters

+
+++++ + + + + + +

mask

bitmask of MMModemLocationAssistanceDataType values.

 
+
+
+

Returns

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -978,12 +1095,42 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]


+

mm_modem_firmware_update_method_build_string_from_mask ()

+
gchar *
+mm_modem_firmware_update_method_build_string_from_mask
+                               (MMModemFirmwareUpdateMethod mask);
+

Builds a string containing a comma-separated list of nicknames for +each MMModemFirmwareUpdateMethod in mask +.

+
+

Parameters

+
+++++ + + + + + +

mask

bitmask of MMModemFirmwareUpdateMethod values.

 
+
+
+

Returns

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

[transfer full]

+
+
+
+

mm_sms_pdu_type_get_string ()

const gchar *
 mm_sms_pdu_type_get_string (MMSmsPduType val);
@@ -1006,7 +1153,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1034,7 +1181,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1062,7 +1209,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1090,7 +1237,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1118,7 +1265,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1146,7 +1293,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1175,7 +1322,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1203,7 +1350,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1232,7 +1379,7 @@

Returns

-

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

+

a string with the list of nicknames, or NULL if none given. The returned value should be freed with g_free().

[transfer full]

@@ -1260,7 +1407,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1288,7 +1435,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1317,7 +1464,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1345,7 +1492,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1373,7 +1520,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1401,7 +1548,7 @@

Returns

-

a string with the nickname, or NULL if not found. Do not free the returned value.

+

a string with the nickname, or NULL if not found. Do not free the returned value.

[transfer none]

@@ -1411,6 +1558,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib-MMBearerStats.html modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib-MMBearerStats.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/libmm-glib-MMBearerStats.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/libmm-glib-MMBearerStats.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,184 +0,0 @@ - - - - -MMBearerStats: libmm-glib Reference Manual - - - - - - - - - - - - - - - - -
-
-
- - -
-

MMBearerStats

-

MMBearerStats — Helper object to handle bearer stats.

-
-
-

Functions

-
---- - - - - - - - - - - - - - - -
-guint - -mm_bearer_stats_get_duration () -
-guint64 - -mm_bearer_stats_get_rx_bytes () -
-guint64 - -mm_bearer_stats_get_tx_bytes () -
-
-
-

Types and Values

-
---- - - - - -
structMMBearerStats
-
-
-

Description

-

The MMBearerStats is an object handling the statistics reported by the -bearer object during a connection.

-

This object is retrieved with either mm_bearer_get_stats() or -mm_bearer_peek_stats().

-
-
-

Functions

-
-

mm_bearer_stats_get_duration ()

-
guint
-mm_bearer_stats_get_duration (MMBearerStats *self);
-

Gets the duration of the current connection, in seconds.

-
-

Parameters

-
----- - - - - - -

self

a MMBearerStats.

 
-
-
-

Returns

-

a guint.

-
-
-
-
-

mm_bearer_stats_get_rx_bytes ()

-
guint64
-mm_bearer_stats_get_rx_bytes (MMBearerStats *self);
-

Gets the number of bytes received without error in the connection.

-
-

Parameters

-
----- - - - - - -

self

a MMBearerStats.

 
-
-
-

Returns

-

a guint64.

-
-
-
-
-

mm_bearer_stats_get_tx_bytes ()

-
guint64
-mm_bearer_stats_get_tx_bytes (MMBearerStats *self);
-

Gets the number of bytes transmitted without error in the connection.

-
-

Parameters

-
----- - - - - - -

self

a MMBearerStats.

 
-
-
-

Returns

-

a guint64.

-
-
-
-
-

Types and Values

-
-

struct MMBearerStats

-
struct MMBearerStats {
-};
-
-

The MMBearerStats structure contains private data and should -only be accessed using the provided API.

-
-
-
- - - \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearer.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearer.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearer.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearer.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMBearer: libmm-glib Reference Manual - + - + @@ -97,6 +97,14 @@ +MMBearerType + + +mm_bearer_get_bearer_type () + + + + MMBearerIpConfig * @@ -145,7 +153,7 @@ -MMBearerStats * +MMBearerStats * mm_bearer_peek_stats () @@ -153,7 +161,7 @@ -MMBearerStats * +MMBearerStats * mm_bearer_get_stats () @@ -268,7 +276,7 @@

Returns

-

The DBus path of the MMBearer object.

+

The DBus path of the MMBearer object.

[transfer none]

@@ -295,7 +303,7 @@

Returns

-

The DBus path of the MMBearer object. The returned value should be freed with g_free().

+

The DBus path of the MMBearer object. The returned value should be freed with g_free().

[transfer full]

@@ -328,7 +336,7 @@

Returns

-

The name of the interface, or NULL if it couldn't be retrieved.

+

The name of the interface, or NULL if it couldn't be retrieved.

[transfer none]

@@ -357,7 +365,7 @@

Returns

-

The name of the interface, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The name of the interface, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -443,6 +451,32 @@
+

mm_bearer_get_bearer_type ()

+
MMBearerType
+mm_bearer_get_bearer_type (MMBearer *self);
+

Gets the type of bearer.

+
+

Parameters

+
+++++ + + + + + +

self

A MMBearer.

 
+
+
+

Returns

+

a MMBearerType.

+
+
+
+

mm_bearer_peek_ipv4_config ()

MMBearerIpConfig *
 mm_bearer_peek_ipv4_config (MMBearer *self);
@@ -469,7 +503,7 @@

Returns

-

A MMBearerIpConfig. Do not free the returned value, it belongs to self +

A MMBearerIpConfig. Do not free the returned value, it belongs to self .

[transfer none]

@@ -502,7 +536,7 @@

Returns

-

A MMBearerIpConfig that must be freed with g_object_unref() or NULL if unknown.

+

A MMBearerIpConfig that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -534,7 +568,7 @@

Returns

-

A MMBearerIpConfig. Do not free the returned value, it belongs to self +

A MMBearerIpConfig. Do not free the returned value, it belongs to self .

[transfer none]

@@ -567,7 +601,7 @@

Returns

-

A MMBearerIpConfig that must be freed with g_object_unref() or NULL if unknown.

+

A MMBearerIpConfig that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -599,7 +633,7 @@

Returns

-

A MMBearerProperties. Do not free the returned value, it belongs to self +

A MMBearerProperties. Do not free the returned value, it belongs to self .

[transfer none]

@@ -632,16 +666,16 @@

Returns

-

A MMBearerProperties that must be freed with g_object_unref() or NULL if unknown.

+

A MMBearerProperties that must be freed with g_object_unref() or NULL if unknown.

[transfer full]


mm_bearer_peek_stats ()

-
MMBearerStats *
+
MMBearerStats *
 mm_bearer_peek_stats (MMBearer *self);
-

Gets a MMBearerStats object specifying the statistics of the current bearer +

Gets a MMBearerStats object specifying the statistics of the current bearer connection.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where @@ -664,7 +698,7 @@

Returns

-

A MMBearerStats. Do not free the returned value, it belongs to self +

A MMBearerStats. Do not free the returned value, it belongs to self .

[transfer none]

@@ -672,13 +706,13 @@

mm_bearer_get_stats ()

-
MMBearerStats *
+
MMBearerStats *
 mm_bearer_get_stats (MMBearer *self);
-

Gets a MMBearerStats object specifying the statistics of the current bearer +

Gets a MMBearerStats object specifying the statistics of the current bearer connection.

The values reported by self are not updated when the values in the interface change. Instead, the client is expected to call -mm_bearer_get_stats() again to get a new MMBearerStats with the +mm_bearer_get_stats() again to get a new MMBearerStats with the new values.

Parameters

@@ -697,7 +731,7 @@

Returns

-

A MMBearerStats that must be freed with g_object_unref() or NULL if unknown.

+

A MMBearerStats that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -731,7 +765,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -786,7 +820,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -817,7 +851,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -830,7 +864,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -863,7 +897,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -918,7 +952,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -948,7 +982,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -961,7 +995,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -977,6 +1011,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerIpConfig.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerIpConfig.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerIpConfig.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerIpConfig.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMBearerIpConfig: libmm-glib Reference Manual - + - - + + @@ -21,7 +21,7 @@ Home Up Prev -Next +Next
@@ -218,7 +218,7 @@

Returns

-

a NULL-terminated array of strings. Do not free the returned value, it is owned by self +

a NULL-terminated array of strings. Do not free the returned value, it is owned by self .

[transfer none][array zero-terminated=1]

@@ -288,6 +288,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMBearerProperties: libmm-glib Reference Manual - + - + @@ -210,7 +210,7 @@

Creates a new empty MMBearerProperties.

Returns

-

a MMBearerProperties. The returned value should be freed with g_object_unref().

+

a MMBearerProperties. The returned value should be freed with g_object_unref().

[transfer full]

@@ -237,7 +237,7 @@

Returns

-

the access point, or NULL if not set. Do not free the returned value, it is owned by self +

the access point, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -351,7 +351,7 @@

Returns

-

the username, or NULL if not set. Do not free the returned value, it is owned by self +

the username, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -409,7 +409,7 @@

Returns

-

the password, or NULL if not set. Do not free the returned value, it is owned by self +

the password, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -524,7 +524,7 @@

Returns

-

TRUE if roaming is allowed, FALSE otherwise..

+

TRUE if roaming is allowed, FALSE otherwise.


@@ -564,6 +564,11 @@

mm_bearer_properties_get_number ()

const gchar *
 mm_bearer_properties_get_number (MMBearerProperties *self);
+
+

mm_bearer_properties_get_number has been deprecated since version 1.10.0. and should not be used in newly-written code.

+

The number setting is not used anywhere, and therefore +it doesn't make sense to expose it in the ModemManager interface.

+

Gets the number to use when performing the connection.

Parameters

@@ -582,7 +587,7 @@

Returns

-

the number, or NULL if not set. Do not free the returned value, it is owned by self +

the number, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -593,6 +598,11 @@
void
 mm_bearer_properties_set_number (MMBearerProperties *self,
                                  const gchar *number);
+
+

mm_bearer_properties_set_number has been deprecated since version 1.10.0. and should not be used in newly-written code.

+

The number setting is not used anywhere, and therefore +it doesn't make sense to expose it in the ModemManager interface.

+

Sets the number to use when performing the connection.

Parameters

@@ -685,6 +695,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerStats.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerStats.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMBearerStats.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMBearerStats.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,189 @@ + + + + +MMBearerStats: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

MMBearerStats

+

MMBearerStats — Helper object to handle bearer stats.

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+guint + +mm_bearer_stats_get_duration () +
+guint64 + +mm_bearer_stats_get_rx_bytes () +
+guint64 + +mm_bearer_stats_get_tx_bytes () +
+
+
+

Types and Values

+
++++ + + + + +
structMMBearerStats
+
+
+

Object Hierarchy

+
    GObject
+    ╰── MMBearerStats
+
+
+
+

Description

+

The MMBearerStats is an object handling the statistics reported by the +bearer object during a connection.

+

This object is retrieved with either mm_bearer_get_stats() or +mm_bearer_peek_stats().

+
+
+

Functions

+
+

mm_bearer_stats_get_duration ()

+
guint
+mm_bearer_stats_get_duration (MMBearerStats *self);
+

Gets the duration of the current connection, in seconds.

+
+

Parameters

+
+++++ + + + + + +

self

a MMBearerStats.

 
+
+
+

Returns

+

a guint.

+
+
+
+
+

mm_bearer_stats_get_rx_bytes ()

+
guint64
+mm_bearer_stats_get_rx_bytes (MMBearerStats *self);
+

Gets the number of bytes received without error in the connection.

+
+

Parameters

+
+++++ + + + + + +

self

a MMBearerStats.

 
+
+
+

Returns

+

a guint64.

+
+
+
+
+

mm_bearer_stats_get_tx_bytes ()

+
guint64
+mm_bearer_stats_get_tx_bytes (MMBearerStats *self);
+

Gets the number of bytes transmitted without error in the connection.

+
+

Parameters

+
+++++ + + + + + +

self

a MMBearerStats.

 
+
+
+

Returns

+

a guint64.

+
+
+
+
+

Types and Values

+
+

struct MMBearerStats

+
struct MMBearerStats;
+

The MMBearerStats structure contains private data and should +only be accessed using the provided API.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCallAudioFormat.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCallAudioFormat.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCallAudioFormat.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCallAudioFormat.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,192 @@ + + + + +MMCallAudioFormat: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

MMCallAudioFormat

+

MMCallAudioFormat — Helper object to handle voice call audio formats.

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
const gchar * + +mm_call_audio_format_get_encoding () +
const gchar * + +mm_call_audio_format_get_resolution () +
+guint + +mm_call_audio_format_get_rate () +
+
+
+

Types and Values

+
++++ + + + + +
structMMCallAudioFormat
+
+
+

Object Hierarchy

+
    GObject
+    ╰── MMCallAudioFormat
+
+
+
+

Description

+

The MMCallAudioFormat is an object handling the voice call audio format +which describes how to send/receive voice call audio from the host.

+

This object is retrieved with either mm_call_get_audio_format() or +mm_call_peek_audio_format().

+
+
+

Functions

+
+

mm_call_audio_format_get_encoding ()

+
const gchar *
+mm_call_audio_format_get_encoding (MMCallAudioFormat *self);
+

Gets the encoding of the audio format. For example, "pcm" for PCM-encoded +audio.

+
+

Parameters

+
+++++ + + + + + +

self

a MMCallAudioFormat.

 
+
+
+

Returns

+

a string with the encoding, or NULL if unknown. Do not free the returned value, it is owned by self +.

+
+
+
+
+

mm_call_audio_format_get_resolution ()

+
const gchar *
+mm_call_audio_format_get_resolution (MMCallAudioFormat *self);
+

Gets the resolution of the audio format. For example, "s16le" for signed +16-bit little-endian audio sampling resolution.

+
+

Parameters

+
+++++ + + + + + +

self

a MMCallAudioFormat.

 
+
+
+

Returns

+

a string with the resolution, or NULL if unknown. Do not free the returned value, it is owned by self +.

+
+
+
+
+

mm_call_audio_format_get_rate ()

+
guint
+mm_call_audio_format_get_rate (MMCallAudioFormat *self);
+

Gets the sampling rate of the audio format. For example, 8000 for an 8000hz +sampling rate.

+
+

Parameters

+
+++++ + + + + + +

self

a MMCallAudioFormat.

 
+
+
+

Returns

+

the sampling rate, or 0 if unknown.

+
+
+
+
+

Types and Values

+
+

struct MMCallAudioFormat

+
struct MMCallAudioFormat;
+

The MMCallAudioFormat structure contains private data and should +only be accessed using the provided API.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCall.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCall.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCall.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCall.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMCall: libmm-glib Reference Manual - + - + @@ -96,6 +96,37 @@ +const gchar * + + +mm_call_get_audio_port () + + + + +gchar * + + +mm_call_dup_audio_port () + + + + +MMCallAudioFormat * + + +mm_call_get_audio_format () + + + + +MMCallAudioFormat * + + +mm_call_peek_audio_format () + + + void @@ -252,7 +283,7 @@

Returns

-

The DBus path of the MMCall object.

+

The DBus path of the MMCall object.

[transfer none]

@@ -279,7 +310,7 @@

Returns

-

The DBus path of the MMCall object. The returned value should be freed with g_free().

+

The DBus path of the MMCall object. The returned value should be freed with g_free().

[transfer full]

@@ -311,7 +342,7 @@

Returns

-

The number, or NULL if it couldn't be retrieved.

+

The number, or NULL if it couldn't be retrieved.

[transfer none]

@@ -339,7 +370,7 @@

Returns

-

The number, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The number, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -423,6 +454,127 @@
+

mm_call_get_audio_port ()

+
const gchar *
+mm_call_get_audio_port (MMCall *self);
+

Gets the kernel device used for audio (if any).

+
+

Parameters

+
+++++ + + + + + +

self

A MMCall.

 
+
+
+

Returns

+

The audio port, or NULL if call audio is not +routed via the host or couldn't be retrieved.

+

[transfer none]

+
+
+
+
+

mm_call_dup_audio_port ()

+
gchar *
+mm_call_dup_audio_port (MMCall *self);
+

Gets the kernel device used for audio (if any).

+
+

Parameters

+
+++++ + + + + + +

self

A MMCall.

 
+
+
+

Returns

+

The audio port, or NULL if call audio is not +routed via the host or couldn't be retrieved.

+

[transfer full]

+
+
+
+
+

mm_call_get_audio_format ()

+
MMCallAudioFormat *
+mm_call_get_audio_format (MMCall *self);
+

Gets a MMCallAudioFormat object specifying the audio format used by the +audio port if call audio is routed via the host.

+
The values reported by self are not updated when the values in the +interface change. Instead, the client is expected to call +mm_call_get_audio_format() again to get a new MMCallAudioFormat with the +new values.
+
+

Parameters

+
+++++ + + + + + +

self

A MMCall.

 
+
+
+

Returns

+

A MMCallAudioFormat that must be freed with g_object_unref() or NULL if unknown.

+

[transfer full]

+
+
+
+
+

mm_call_peek_audio_format ()

+
MMCallAudioFormat *
+mm_call_peek_audio_format (MMCall *self);
+

Gets a MMCallAudioFormat object specifying the audio format used by the +audio port if call audio is routed via the host.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_call_get_audio_format() if on another +thread.
+
+

Parameters

+
+++++ + + + + + +

self

A MMCall.

 
+
+
+

Returns

+

A MMCallAudioFormat. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+
+
+

mm_call_start ()

void
 mm_call_start (MMCall *self,
@@ -451,7 +603,7 @@
 
 
 

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -506,7 +658,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -537,7 +689,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -550,7 +702,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -584,7 +736,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -639,7 +791,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -670,7 +822,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -683,7 +835,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -717,7 +869,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -772,7 +924,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -803,7 +955,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -816,7 +968,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -856,7 +1008,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -911,7 +1063,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -948,7 +1100,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -961,7 +1113,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -977,6 +1129,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCallProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCallProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCallProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCallProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMCallProperties: libmm-glib Reference Manual - + - - + + @@ -21,7 +21,7 @@ Home Up Prev -Next +Next
@@ -149,7 +149,7 @@

Creates a new empty MMCallProperties.

Returns

-

a MMCallProperties. The returned value should be freed with g_object_unref().

+

a MMCallProperties. The returned value should be freed with g_object_unref().

[transfer full]

@@ -390,6 +390,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCdmaManualActivationProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCdmaManualActivationProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMCdmaManualActivationProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMCdmaManualActivationProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMCdmaManualActivationProperties: libmm-glib Reference Manual - + - + @@ -215,7 +215,7 @@

Creates a new MMCdmaManualActivationProperties object.

Returns

-

A MMCdmaManualActivationProperties. The returned value should be freed with g_object_unref().

+

A MMCdmaManualActivationProperties. The returned value should be freed with g_object_unref().

[transfer full]

@@ -243,7 +243,7 @@

Returns

-

The SPC. Do not free the returned value, it is owned by self +

The SPC. Do not free the returned value, it is owned by self .

[transfer none]

@@ -372,7 +372,7 @@

Returns

-

The MDN. Do not free the returned value, it is owned by self +

The MDN. Do not free the returned value, it is owned by self .

[transfer none]

@@ -443,7 +443,7 @@

Returns

-

The MIN. Do not free the returned value, it is owned by self +

The MIN. Do not free the returned value, it is owned by self .

[transfer none]

@@ -514,7 +514,7 @@

Returns

-

The MN-HA key. Do not free the returned value, it is owned by self +

The MN-HA key. Do not free the returned value, it is owned by self .

[transfer none]

@@ -585,7 +585,7 @@

Returns

-

The MN-AAA key. Do not free the returned value, it is owned by self +

The MN-AAA key. Do not free the returned value, it is owned by self .

[transfer none]

@@ -656,7 +656,7 @@

prl_len

-

Size of the returned PRL.

+

Size of the returned PRL.

[out] @@ -664,7 +664,7 @@

Returns

-

The PRL. Do not free the returned value, it is owned by self +

The PRL. Do not free the returned value, it is owned by self .

[transfer none]

@@ -693,7 +693,7 @@

Returns

-

A GByteArray with the PRL, or NULL if it doesn't contain any. Do not free the returned value, it is owned by self +

A GByteArray with the PRL, or NULL if it doesn't contain any. Do not free the returned value, it is owned by self .

[transfer none]

@@ -722,7 +722,7 @@

Returns

-

A GByteArray with the PRL, or NULL if it doesn't contain any. The returned value should be freed with g_byte_array_unref().

+

A GByteArray with the PRL, or NULL if it doesn't contain any. The returned value should be freed with g_byte_array_unref().

[transfer full]

@@ -830,6 +830,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMFirmwareProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMFirmwareProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMFirmwareProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMFirmwareProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMFirmwareProperties: libmm-glib Reference Manual - + - - + + @@ -21,7 +21,7 @@ Home Up Prev -Next +Next
@@ -169,7 +169,7 @@

Returns

-

The ID of the image. Do not free the returned value, it is owned by self +

The ID of the image. Do not free the returned value, it is owned by self .

[transfer none]

@@ -326,6 +326,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMFirmwareUpdateSettings.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMFirmwareUpdateSettings.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMFirmwareUpdateSettings.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMFirmwareUpdateSettings.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,229 @@ + + + + +MMFirmwareUpdateSettings: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

MMFirmwareUpdateSettings

+

MMFirmwareUpdateSettings — Helper object to handle firmware update settings.

+
+ +
+

Types and Values

+
++++ + + + + +
structMMFirmwareUpdateSettings
+
+
+

Object Hierarchy

+
    GObject
+    ╰── MMFirmwareUpdateSettings
+
+
+
+

Description

+

The MMFirmwareUpdateSettings is an object handling the settings exposed to +aid in the firmware update operation.

+
+
+

Functions

+
+

mm_firmware_update_settings_get_fastboot_at ()

+
const gchar *
+mm_firmware_update_settings_get_fastboot_at
+                               (MMFirmwareUpdateSettings *self);
+

Gets the AT command that should be sent to the module to trigger a reset +into fastboot mode.

+

Only applicable if the update method includes MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT.

+
+

Parameters

+
+++++ + + + + + +

self

a MMFirmwareUpdateSettings.

 
+
+
+

Returns

+

The AT command string, or NULL if unknown. Do not free the returned value, it is owned by self +.

+
+
+
+
+

mm_firmware_update_settings_get_method ()

+
MMModemFirmwareUpdateMethod
+mm_firmware_update_settings_get_method
+                               (MMFirmwareUpdateSettings *self);
+

Gets the methods to use during the firmware update operation.

+
+

Parameters

+
+++++ + + + + + +

self

A MMFirmwareUpdateSettings.

 
+
+
+

Returns

+

a bitmask of MMModemFirmwareUpdateMethod values.

+
+
+
+
+

mm_firmware_update_settings_get_device_ids ()

+
const gchar **
+mm_firmware_update_settings_get_device_ids
+                               (MMFirmwareUpdateSettings *self);
+

Gets the list of device ids used to identify the device during a firmware update +operation.

+
+

Parameters

+
+++++ + + + + + +

self

a MMFirmwareUpdateSettings.

 
+
+
+

Returns

+

The list of device ids, or NULL if unknown. Do not free the returned value, it is owned by self +.

+

[transfer none]

+
+
+
+
+

mm_firmware_update_settings_get_version ()

+
const gchar *
+mm_firmware_update_settings_get_version
+                               (MMFirmwareUpdateSettings *self);
+

Gets firmware version string.

+
+

Parameters

+
+++++ + + + + + +

self

a MMFirmwareUpdateSettings.

 
+
+
+

Returns

+

The version string, or NULL if unknown. Do not free the returned value, it is owned by self +.

+
+
+
+
+

Types and Values

+
+

struct MMFirmwareUpdateSettings

+
struct MMFirmwareUpdateSettings;
+

The MMFirmwareUpdateSettings structure contains private data and should only be accessed +using the provided API.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearer.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearer.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearer.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearer.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusBearer: libmm-glib Reference Manual - + - + @@ -133,6 +133,14 @@ +guint + + +mm_gdbus_bearer_get_bearer_type () + + + + GVariant * @@ -208,6 +216,11 @@ +guint +bearer-type +Read / Write + + gboolean connected Read / Write @@ -298,7 +311,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusBearer
 
@@ -345,7 +358,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -375,7 +388,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -405,7 +418,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -435,7 +448,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -465,7 +478,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -495,7 +508,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -553,7 +566,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -583,7 +596,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -645,6 +658,34 @@
+

mm_gdbus_bearer_get_bearer_type ()

+
guint
+mm_gdbus_bearer_get_bearer_type (MmGdbusBearer *object);
+

Gets the value of the "BearerType" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusBearer.

 
+
+
+

Returns

+

The property value.

+
+
+
+

mm_gdbus_bearer_get_stats ()

GVariant *
 mm_gdbus_bearer_get_stats (MmGdbusBearer *object);
@@ -669,7 +710,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -699,7 +740,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -733,8 +774,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -788,7 +829,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -819,8 +860,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -832,7 +873,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -867,8 +908,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -923,7 +964,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -954,8 +995,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -967,7 +1008,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -995,6 +1036,8 @@ MmGdbusBearer *object, GDBusMethodInvocation *invocation); + guint (*get_bearer_type) (MmGdbusBearer *object); + gboolean (*get_connected) (MmGdbusBearer *object); const gchar * (*get_interface) (MmGdbusBearer *object); @@ -1038,6 +1081,11 @@   +

get_bearer_type ()

+

Getter for the “bearer-type” property.

+  + +

get_connected ()

Getter for the “connected” property.

  @@ -1085,6 +1133,15 @@

Property Details

+

The “bearer-type” property

+
  “bearer-type”              guint
+

Represents the D-Bus property "BearerType".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: 0

+
+
+

The “connected” property

  “connected”                gboolean

Represents the D-Bus property "Connected".

@@ -1250,6 +1307,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearerProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearerProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearerProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearerProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusBearerProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusBearerProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusBearerProxy]

@@ -372,8 +372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -385,7 +385,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusBearerProxy]

@@ -424,9 +424,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -435,8 +435,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -448,7 +448,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusBearerProxy]

@@ -464,6 +464,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearerSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearerSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusBearerSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusBearerSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusBearerSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Bearer.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusBearerSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCall.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCall.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCall.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCall.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusCall: libmm-glib Reference Manual - + - + @@ -85,18 +85,33 @@ -void +GVariant * -mm_gdbus_call_emit_dtmf_received () +mm_gdbus_call_dup_audio_format () -void +gchar * + + +mm_gdbus_call_dup_audio_port () + + + + +GVariant * + + +mm_gdbus_call_get_audio_format () + + + +const gchar * -mm_gdbus_call_emit_state_changed () +mm_gdbus_call_get_audio_port () @@ -208,6 +223,18 @@ + +GVariant * +audio-format +Read / Write + + + +gchar * +audio-port +Read / Write + + gint direction Read / Write @@ -294,7 +321,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusCall
 
@@ -369,7 +396,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -399,7 +426,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -461,75 +488,123 @@
-

mm_gdbus_call_emit_dtmf_received ()

-
void
-mm_gdbus_call_emit_dtmf_received (MmGdbusCall *object,
-                                  const gchar *arg_dtmf);
-

Emits the "DtmfReceived" D-Bus signal.

+

mm_gdbus_call_dup_audio_format ()

+
GVariant *
+mm_gdbus_call_dup_audio_format (MmGdbusCall *object);
+

Gets a copy of the "AudioFormat" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

-

Parameters

+

Parameters

- - + - - - - - - - +

object

A MmGdbusCall.

 

arg_dtmf

Argument to pass with the signal.

 
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

[transfer full]

+

-

mm_gdbus_call_emit_state_changed ()

-
void
-mm_gdbus_call_emit_state_changed (MmGdbusCall *object,
-                                  gint arg_old,
-                                  gint arg_new,
-                                  guint arg_reason);
-

Emits the "StateChanged" D-Bus signal.

+

mm_gdbus_call_dup_audio_port ()

+
gchar *
+mm_gdbus_call_dup_audio_port (MmGdbusCall *object);
+

Gets a copy of the "AudioPort" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

-

Parameters

+

Parameters

- - + - - - - - - - - - + +

object

A MmGdbusCall.

 

arg_old

Argument to pass with the signal.

 

arg_new

Argument to pass with the signal.

+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

[transfer full]

+
+
+
+
+

mm_gdbus_call_get_audio_format ()

+
GVariant *
+mm_gdbus_call_get_audio_format (MmGdbusCall *object);
+

Gets the value of the "AudioFormat" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_call_dup_audio_format() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + - - - - + +

object

A MmGdbusCall.

 

arg_reason

Argument to pass with the signal.

+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+
+

mm_gdbus_call_get_audio_port ()

+
const gchar *
+mm_gdbus_call_get_audio_port (MmGdbusCall *object);
+

Gets the value of the "AudioPort" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_call_dup_audio_port() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + - - +

object

A MmGdbusCall.

 
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+

@@ -561,8 +636,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -616,7 +691,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -647,8 +722,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -660,7 +735,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -695,8 +770,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -750,7 +825,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -781,8 +856,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -794,7 +869,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -829,8 +904,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -884,7 +959,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -915,8 +990,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -928,7 +1003,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -969,8 +1044,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -1024,7 +1099,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1061,8 +1136,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1074,7 +1149,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1112,6 +1187,10 @@ MmGdbusCall *object, GDBusMethodInvocation *invocation); + GVariant * (*get_audio_format) (MmGdbusCall *object); + + const gchar * (*get_audio_port) (MmGdbusCall *object); + gint (*get_direction) (MmGdbusCall *object); const gchar * (*get_number) (MmGdbusCall *object); @@ -1167,6 +1246,16 @@   +

get_audio_format ()

+

Getter for the “audio-format” property.

+  + + +

get_audio_port ()

+

Getter for the “audio-port” property.

+  + +

get_direction ()

Getter for the “direction” property.

  @@ -1204,6 +1293,25 @@

Property Details

+

The “audio-format” property

+
  “audio-format”             GVariant *
+

Represents the D-Bus property "AudioFormat".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Allowed values: GVariant<a{sv}>

+

Default value: NULL

+
+
+
+

The “audio-port” property

+
  “audio-port”               gchar *
+

Represents the D-Bus property "AudioPort".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: NULL

+
+
+

The “direction” property

  “direction”                gint

Represents the D-Bus property "Direction".

@@ -1509,6 +1617,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCallProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCallProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCallProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCallProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusCallProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusCallProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusCallProxy]

@@ -371,8 +371,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -384,7 +384,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusCallProxy]

@@ -423,9 +423,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -434,8 +434,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -447,7 +447,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusCallProxy]

@@ -463,6 +463,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCallSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCallSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusCallSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusCallSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusCallSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Call.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusCallSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gpp.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gpp.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gpp.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gpp.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gpp: libmm-glib Reference Manual - + - + @@ -115,6 +115,61 @@ +guint + + +mm_gdbus_modem3gpp_get_eps_ue_mode_operation () + + + + +GVariant * + + +mm_gdbus_modem3gpp_get_pco () + + + + +GVariant * + + +mm_gdbus_modem3gpp_dup_pco () + + + +const gchar * + + +mm_gdbus_modem3gpp_get_initial_eps_bearer () + + + + +gchar * + + +mm_gdbus_modem3gpp_dup_initial_eps_bearer () + + + + +GVariant * + + +mm_gdbus_modem3gpp_get_initial_eps_bearer_settings () + + + + +GVariant * + + +mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings () + + + + void @@ -161,6 +216,54 @@ mm_gdbus_modem3gpp_call_scan_sync () + + +void + + +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation () + + + + +gboolean + + +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish () + + + + +gboolean + + +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync () + + + + +void + + +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings () + + + + +gboolean + + +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish () + + + + +gboolean + + +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync () + + @@ -179,6 +282,11 @@ Read / Write +guint +eps-ue-mode-operation +Read / Write + + gchar * imei @@ -187,6 +295,18 @@ gchar * +initial-eps-bearer +Read / Write + + + +GVariant * +initial-eps-bearer-settings +Read / Write + + + +gchar * operator-code Read / Write @@ -197,6 +317,12 @@ Read / Write + +GVariant * +pco +Read / Write + + guint registration-state Read / Write @@ -228,6 +354,16 @@ handle-scan Run Last + +gboolean +handle-set-eps-ue-mode-operation +Run Last + + +gboolean +handle-set-initial-eps-bearer-settings +Run Last + @@ -252,7 +388,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModem3gpp
 
@@ -328,7 +464,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -358,7 +494,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -388,7 +524,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -418,7 +554,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -448,7 +584,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -478,7 +614,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -542,6 +678,219 @@
+

mm_gdbus_modem3gpp_get_eps_ue_mode_operation ()

+
guint
+mm_gdbus_modem3gpp_get_eps_ue_mode_operation
+                               (MmGdbusModem3gpp *object);
+

Gets the value of the "EpsUeModeOperation" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value.

+
+
+
+
+

mm_gdbus_modem3gpp_get_pco ()

+
GVariant *
+mm_gdbus_modem3gpp_get_pco (MmGdbusModem3gpp *object);
+

Gets the value of the "Pco" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem3gpp_dup_pco() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+
+

mm_gdbus_modem3gpp_dup_pco ()

+
GVariant *
+mm_gdbus_modem3gpp_dup_pco (MmGdbusModem3gpp *object);
+

Gets a copy of the "Pco" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

[transfer full]

+
+
+
+
+

mm_gdbus_modem3gpp_get_initial_eps_bearer ()

+
const gchar *
+mm_gdbus_modem3gpp_get_initial_eps_bearer
+                               (MmGdbusModem3gpp *object);
+

Gets the value of the "InitialEpsBearer" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem3gpp_dup_initial_eps_bearer() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+
+

mm_gdbus_modem3gpp_dup_initial_eps_bearer ()

+
gchar *
+mm_gdbus_modem3gpp_dup_initial_eps_bearer
+                               (MmGdbusModem3gpp *object);
+

Gets a copy of the "InitialEpsBearer" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

[transfer full]

+
+
+
+
+

mm_gdbus_modem3gpp_get_initial_eps_bearer_settings ()

+
GVariant *
+mm_gdbus_modem3gpp_get_initial_eps_bearer_settings
+                               (MmGdbusModem3gpp *object);
+

Gets the value of the "InitialEpsBearerSettings" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+
+

mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings ()

+
GVariant *
+mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings
+                               (MmGdbusModem3gpp *object);
+

Gets a copy of the "InitialEpsBearerSettings" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem3gpp.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

[transfer full]

+
+
+
+

mm_gdbus_modem3gpp_call_register ()

void
 mm_gdbus_modem3gpp_call_register (MmGdbusModem3gpp *proxy,
@@ -576,8 +925,8 @@
 
 
 

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -632,7 +981,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -669,8 +1018,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -682,7 +1031,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -717,8 +1066,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -760,7 +1109,7 @@

out_results

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -778,7 +1127,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -810,13 +1159,13 @@

out_results

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -828,7 +1177,305 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+ +
+
+

mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation ()

+
void
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation
+                               (MmGdbusModem3gpp *proxy,
+                                guint arg_mode,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously invokes the SetEpsUeModeOperation() D-Bus method on proxy +. +When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish() to get the result of the operation.

+

See mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

arg_mode

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish ()

+
gboolean
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish
+                               (MmGdbusModem3gpp *proxy,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync ()

+
gboolean
+mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync
+                               (MmGdbusModem3gpp *proxy,
+                                guint arg_mode,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously invokes the SetEpsUeModeOperation() D-Bus method on proxy +. The calling thread is blocked until a reply is received.

+

See mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

arg_mode

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings ()

+
void
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings
+                               (MmGdbusModem3gpp *proxy,
+                                GVariant *arg_settings,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously invokes the SetInitialEpsBearerSettings() D-Bus method on proxy +. +When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish() to get the result of the operation.

+

See mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

arg_settings

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish ()

+
gboolean
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish
+                               (MmGdbusModem3gpp *proxy,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync ()

+
gboolean
+mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync
+                               (MmGdbusModem3gpp *proxy,
+                                GVariant *arg_settings,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously invokes the SetInitialEpsBearerSettings() D-Bus method on proxy +. The calling thread is blocked until a reply is received.

+

See mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModem3gppProxy.

 

arg_settings

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -857,14 +1504,32 @@ MmGdbusModem3gpp *object, GDBusMethodInvocation *invocation); + gboolean (*handle_set_eps_ue_mode_operation) ( + MmGdbusModem3gpp *object, + GDBusMethodInvocation *invocation, + guint arg_mode); + + gboolean (*handle_set_initial_eps_bearer_settings) ( + MmGdbusModem3gpp *object, + GDBusMethodInvocation *invocation, + GVariant *arg_settings); + guint (*get_enabled_facility_locks) (MmGdbusModem3gpp *object); + guint (*get_eps_ue_mode_operation) (MmGdbusModem3gpp *object); + const gchar * (*get_imei) (MmGdbusModem3gpp *object); + const gchar * (*get_initial_eps_bearer) (MmGdbusModem3gpp *object); + + GVariant * (*get_initial_eps_bearer_settings) (MmGdbusModem3gpp *object); + const gchar * (*get_operator_code) (MmGdbusModem3gpp *object); const gchar * (*get_operator_name) (MmGdbusModem3gpp *object); + GVariant * (*get_pco) (MmGdbusModem3gpp *object); + guint (*get_registration_state) (MmGdbusModem3gpp *object); guint (*get_subscription_state) (MmGdbusModem3gpp *object); @@ -896,16 +1561,41 @@   +

handle_set_eps_ue_mode_operation ()

+

Handler for the “handle-set-eps-ue-mode-operation” signal.

+  + + +

handle_set_initial_eps_bearer_settings ()

+

Handler for the “handle-set-initial-eps-bearer-settings” signal.

+  + +

get_enabled_facility_locks ()

Getter for the “enabled-facility-locks” property.

  +

get_eps_ue_mode_operation ()

+

Getter for the “eps-ue-mode-operation” property.

+  + +

get_imei ()

Getter for the “imei” property.

  +

get_initial_eps_bearer ()

+

Getter for the “initial-eps-bearer” property.

+  + + +

get_initial_eps_bearer_settings ()

+

Getter for the “initial-eps-bearer-settings” property.

+  + +

get_operator_code ()

Getter for the “operator-code” property.

  @@ -916,6 +1606,11 @@   +

get_pco ()

+

Getter for the “pco” property.

+  + +

get_registration_state ()

Getter for the “registration-state” property.

  @@ -942,6 +1637,15 @@

+

The “eps-ue-mode-operation” property

+
  “eps-ue-mode-operation”    guint
+

Represents the D-Bus property "EpsUeModeOperation".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: 0

+
+
+

The “imei” property

  “imei”                     gchar *

Represents the D-Bus property "Imei".

@@ -951,6 +1655,25 @@

+

The “initial-eps-bearer” property

+
  “initial-eps-bearer”       gchar *
+

Represents the D-Bus property "InitialEpsBearer".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: NULL

+
+
+
+

The “initial-eps-bearer-settings” property

+
  “initial-eps-bearer-settings” GVariant *
+

Represents the D-Bus property "InitialEpsBearerSettings".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Allowed values: GVariant<a{sv}>

+

Default value: NULL

+
+
+

The “operator-code” property

  “operator-code”            gchar *

Represents the D-Bus property "OperatorCode".

@@ -969,6 +1692,16 @@

+

The “pco” property

+
  “pco”                      GVariant *
+

Represents the D-Bus property "Pco".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Allowed values: GVariant<a(ubay)>

+

Default value: NULL

+
+
+

The “registration-state” property

  “registration-state”       guint

Represents the D-Bus property "RegistrationState".

@@ -1079,9 +1812,107 @@

Flags: Run Last

+
+
+

The “handle-set-eps-ue-mode-operation” signal

+
gboolean
+user_function (MmGdbusModem3gpp      *object,
+               GDBusMethodInvocation *invocation,
+               guint                  arg_mode,
+               gpointer               user_data)
+

Signal emitted when a remote caller is invoking the SetEpsUeModeOperation() D-Bus method.

+

If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation + and eventually call mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

object

A MmGdbusModem3gpp.

 

invocation

A GDBusMethodInvocation.

 

arg_mode

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

TRUE if the invocation was handled, FALSE to let other signal handlers run.

+
+

Flags: Run Last

+
+
+
+

The “handle-set-initial-eps-bearer-settings” signal

+
gboolean
+user_function (MmGdbusModem3gpp      *object,
+               GDBusMethodInvocation *invocation,
+               GVariant              *arg_settings,
+               gpointer               user_data)
+

Signal emitted when a remote caller is invoking the SetInitialEpsBearerSettings() D-Bus method.

+

If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation + and eventually call mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

object

A MmGdbusModem3gpp.

 

invocation

A GDBusMethodInvocation.

 

arg_settings

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

TRUE if the invocation was handled, FALSE to let other signal handlers run.

+
+

Flags: Run Last

+
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gppProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppProxy]

@@ -372,8 +372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -385,7 +385,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppProxy]

@@ -424,9 +424,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -435,8 +435,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -448,7 +448,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppProxy]

@@ -464,6 +464,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gppSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modem3gpp.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModem3gppSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssd.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssd.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssd.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssd.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gppUssd: libmm-glib Reference Manual - + - + @@ -234,7 +234,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModem3gppUssd
 
@@ -310,7 +310,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -341,7 +341,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -372,7 +372,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -403,7 +403,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -443,8 +443,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -487,7 +487,7 @@

out_reply

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -505,7 +505,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -544,13 +544,13 @@

out_reply

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -562,7 +562,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -603,8 +603,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -647,7 +647,7 @@

out_reply

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -665,7 +665,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -704,13 +704,13 @@

out_reply

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -722,7 +722,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -757,8 +757,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -813,7 +813,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -845,8 +845,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -858,7 +858,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1123,6 +1123,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gppUssdProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppUssdProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppUssdProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppUssdProxy]

@@ -427,9 +427,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModem3gppUssdProxy]

@@ -467,6 +467,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem3gppUssdSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem3gppUssdSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModem3gppUssdSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdma.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdma.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdma.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemCdma: libmm-glib Reference Manual - + - + @@ -262,7 +262,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemCdma
 
@@ -396,7 +396,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -426,7 +426,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -456,7 +456,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -486,7 +486,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -582,8 +582,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -638,7 +638,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -676,8 +676,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -689,7 +689,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -731,8 +731,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -787,7 +787,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -825,8 +825,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -838,7 +838,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1177,6 +1177,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdmaProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdmaProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdmaProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdmaProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemCdmaProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemCdmaProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemCdmaProxy]

@@ -372,8 +372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -385,7 +385,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemCdmaProxy]

@@ -424,9 +424,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -435,8 +435,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -448,7 +448,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemCdmaProxy]

@@ -464,6 +464,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdmaSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdmaSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemCdmaSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemCdmaSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemCdmaSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.ModemCdma.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemCdmaSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmware.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmware.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmware.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmware.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemFirmware: libmm-glib Reference Manual - + - + @@ -18,7 +18,8 @@ Description  |  Object Hierarchy  |  Prerequisites  |  - Known Implementations  |  + Known Implementations  |  + Properties  |  Signals Home @@ -45,6 +46,22 @@ +GVariant * + + +mm_gdbus_modem_firmware_dup_update_settings () + + + + +GVariant * + + +mm_gdbus_modem_firmware_get_update_settings () + + + + void @@ -95,6 +112,22 @@
+

Properties

+
+++++ + + + + + +
+GVariant *update-settingsRead / Write
+
+

Signals

@@ -137,7 +170,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemFirmware
 
@@ -160,6 +193,68 @@

Functions

+

mm_gdbus_modem_firmware_dup_update_settings ()

+
GVariant *
+mm_gdbus_modem_firmware_dup_update_settings
+                               (MmGdbusModemFirmware *object);
+

Gets a copy of the "UpdateSettings" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModemFirmware.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

[transfer full]

+
+ +
+
+

mm_gdbus_modem_firmware_get_update_settings ()

+
GVariant *
+mm_gdbus_modem_firmware_get_update_settings
+                               (MmGdbusModemFirmware *object);
+

Gets the value of the "UpdateSettings" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem_firmware_dup_update_settings() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModemFirmware.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+

mm_gdbus_modem_firmware_call_list ()

void
 mm_gdbus_modem_firmware_call_list (MmGdbusModemFirmware *proxy,
@@ -188,8 +283,8 @@
 
 
 

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -233,12 +328,12 @@

out_selected

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

out_installed

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -256,7 +351,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -290,18 +385,18 @@

out_selected

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

out_installed

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -313,7 +408,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -354,8 +449,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -410,7 +505,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -448,8 +543,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -461,7 +556,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -480,6 +575,7 @@
struct MmGdbusModemFirmwareIface {
   GTypeInterface parent_iface;
 
+
   gboolean (*handle_list) (
     MmGdbusModemFirmware *object,
     GDBusMethodInvocation *invocation);
@@ -488,6 +584,8 @@
     MmGdbusModemFirmware *object,
     GDBusMethodInvocation *invocation,
     const gchar *arg_uniqueid);
+
+  GVariant * (*get_update_settings) (MmGdbusModemFirmware *object);
 };
 

Virtual table for the D-Bus interface org.freedesktop.ModemManager1.Modem.Firmware.

@@ -515,12 +613,29 @@

Handler for the “handle-select” signal.

  + +

get_update_settings ()

+

Getter for the “update-settings” property.

+  +
+

Property Details

+
+

The “update-settings” property

+
  “update-settings”          GVariant *
+

Represents the D-Bus property "UpdateSettings".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Allowed values: GVariant<(ua{sv})>

+

Default value: NULL

+
+
+

Signal Details

The “handle-list” signal

@@ -616,6 +731,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmwareProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmwareProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmwareProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmwareProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemFirmwareProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemFirmwareProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemFirmwareProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemFirmwareProxy]

@@ -427,9 +427,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemFirmwareProxy]

@@ -467,6 +467,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmwareSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmwareSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemFirmwareSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemFirmwareSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemFirmwareSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Firmware.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemFirmwareSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModem.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModem.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModem: libmm-glib Reference Manual - + - + @@ -298,6 +298,21 @@ +const gchar * + + +mm_gdbus_modem_get_hardware_revision () + + + + +gchar * + + +mm_gdbus_modem_dup_hardware_revision () + + + GVariant * @@ -753,6 +768,12 @@ gchar * +hardware-revision +Read / Write + + + +gchar * manufacturer Read / Write @@ -958,7 +979,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModem
 
@@ -1034,7 +1055,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1064,7 +1085,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1094,7 +1115,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1124,7 +1145,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -1154,7 +1175,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1184,7 +1205,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -1243,7 +1264,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1273,7 +1294,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1303,7 +1324,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1333,7 +1354,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1363,7 +1384,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1393,7 +1414,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1424,7 +1445,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1455,7 +1476,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1485,7 +1506,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1515,7 +1536,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1601,7 +1622,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1631,7 +1652,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1661,7 +1682,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1691,7 +1712,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1721,7 +1742,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1751,7 +1772,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1809,7 +1830,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1839,7 +1860,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1869,7 +1890,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1899,7 +1920,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -1929,7 +1950,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1959,7 +1980,67 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

[transfer full]

+
+ +
+
+

mm_gdbus_modem_get_hardware_revision ()

+
const gchar *
+mm_gdbus_modem_get_hardware_revision (MmGdbusModem *object);
+

Gets the value of the "HardwareRevision" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem_dup_hardware_revision() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+
+

mm_gdbus_modem_dup_hardware_revision ()

+
gchar *
+mm_gdbus_modem_dup_hardware_revision (MmGdbusModem *object);
+

Gets a copy of the "HardwareRevision" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModem.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1989,7 +2070,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2019,7 +2100,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -2049,7 +2130,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2079,7 +2160,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -2110,7 +2191,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2141,7 +2222,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -2228,7 +2309,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2258,7 +2339,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -2317,7 +2398,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2347,7 +2428,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -2405,7 +2486,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -2435,7 +2516,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -2475,8 +2556,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -2530,7 +2611,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2567,8 +2648,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -2580,7 +2661,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2621,8 +2702,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -2677,7 +2758,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2715,8 +2796,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -2728,7 +2809,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2769,8 +2850,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -2813,7 +2894,7 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -2831,7 +2912,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2870,13 +2951,13 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -2888,7 +2969,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -2929,8 +3010,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -2985,7 +3066,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3023,8 +3104,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3036,7 +3117,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3071,8 +3152,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3115,8 +3196,8 @@

out_bearers

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

res

@@ -3133,7 +3214,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3165,13 +3246,13 @@

out_bearers

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3183,7 +3264,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3218,8 +3299,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3273,7 +3354,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3304,8 +3385,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3317,7 +3398,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3358,8 +3439,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3414,7 +3495,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3452,8 +3533,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3465,7 +3546,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3506,8 +3587,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3562,7 +3643,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3600,8 +3681,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3613,7 +3694,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3654,8 +3735,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3710,7 +3791,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3748,8 +3829,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3761,7 +3842,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3803,8 +3884,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -3859,7 +3940,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3897,8 +3978,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -3910,7 +3991,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -3957,8 +4038,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -4000,7 +4081,7 @@

out_response

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -4018,7 +4099,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -4062,13 +4143,13 @@

out_response

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -4080,7 +4161,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -4173,6 +4254,8 @@ const gchar * (*get_equipment_identifier) (MmGdbusModem *object); + const gchar * (*get_hardware_revision) (MmGdbusModem *object); + const gchar * (*get_manufacturer) (MmGdbusModem *object); guint (*get_max_active_bearers) (MmGdbusModem *object); @@ -4336,6 +4419,11 @@   +

get_hardware_revision ()

+

Getter for the “hardware-revision” property.

+  + +

get_manufacturer ()

Getter for the “manufacturer” property.

  @@ -4529,6 +4617,15 @@
+

The “hardware-revision” property

+
  “hardware-revision”        gchar *
+

Represents the D-Bus property "HardwareRevision".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: NULL

+
+
+

The “manufacturer” property

  “manufacturer”             gchar *

Represents the D-Bus property "Manufacturer".

@@ -5300,6 +5397,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocation.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocation.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocation.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocation.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemLocation: libmm-glib Reference Manual - + - + @@ -109,6 +109,29 @@ +guint + + +mm_gdbus_modem_location_get_supported_assistance_data () + + + + +gchar ** + + +mm_gdbus_modem_location_dup_assistance_data_servers () + + + +const gchar *const * + + +mm_gdbus_modem_location_get_assistance_data_servers () + + + + void @@ -184,6 +207,30 @@ void +mm_gdbus_modem_location_call_inject_assistance_data () + + + + +gboolean + + +mm_gdbus_modem_location_call_inject_assistance_data_finish () + + + + +gboolean + + +mm_gdbus_modem_location_call_inject_assistance_data_sync () + + + + +void + + mm_gdbus_modem_location_call_set_gps_refresh_rate () @@ -216,6 +263,11 @@ +GStrv +assistance-data-servers +Read / Write + + guint capabilities Read / Write @@ -247,6 +299,11 @@ supl-server Read / Write + +guint +supported-assistance-data +Read / Write + @@ -266,6 +323,11 @@ gboolean +handle-inject-assistance-data +Run Last + + +gboolean handle-set-gps-refresh-rate Run Last @@ -303,7 +365,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemLocation
 
@@ -436,7 +498,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -466,7 +528,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -496,7 +558,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -527,7 +589,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -563,6 +625,97 @@
+

mm_gdbus_modem_location_get_supported_assistance_data ()

+
guint
+mm_gdbus_modem_location_get_supported_assistance_data
+                               (MmGdbusModemLocation *object);
+

Gets the value of the "SupportedAssistanceData" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModemLocation.

 
+
+
+

Returns

+

The property value.

+
+
+
+
+

mm_gdbus_modem_location_dup_assistance_data_servers ()

+
gchar **
+mm_gdbus_modem_location_dup_assistance_data_servers
+                               (MmGdbusModemLocation *object);
+

Gets a copy of the "AssistanceDataServers" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModemLocation.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

[transfer full]

+
+
+
+
+

mm_gdbus_modem_location_get_assistance_data_servers ()

+
const gchar *const *
+mm_gdbus_modem_location_get_assistance_data_servers
+                               (MmGdbusModemLocation *object);
+

Gets the value of the "AssistanceDataServers" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_modem_location_dup_assistance_data_servers() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusModemLocation.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+

mm_gdbus_modem_location_call_get_location ()

void
 mm_gdbus_modem_location_call_get_location
@@ -592,8 +745,8 @@
 
 
 

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -636,7 +789,7 @@

out_Location

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -654,7 +807,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -687,13 +840,13 @@

out_Location

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -705,7 +858,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -752,8 +905,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -808,7 +961,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -852,8 +1005,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -865,7 +1018,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -907,8 +1060,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -963,7 +1116,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1001,8 +1154,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1014,7 +1167,156 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+ +
+
+

mm_gdbus_modem_location_call_inject_assistance_data ()

+
void
+mm_gdbus_modem_location_call_inject_assistance_data
+                               (MmGdbusModemLocation *proxy,
+                                GVariant *arg_data,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously invokes the InjectAssistanceData() D-Bus method on proxy +. +When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_gdbus_modem_location_call_inject_assistance_data_finish() to get the result of the operation.

+

See mm_gdbus_modem_location_call_inject_assistance_data_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModemLocationProxy.

 

arg_data

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_gdbus_modem_location_call_inject_assistance_data_finish ()

+
gboolean
+mm_gdbus_modem_location_call_inject_assistance_data_finish
+                               (MmGdbusModemLocation *proxy,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_gdbus_modem_location_call_inject_assistance_data().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModemLocationProxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_gdbus_modem_location_call_inject_assistance_data().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_modem_location_call_inject_assistance_data_sync ()

+
gboolean
+mm_gdbus_modem_location_call_inject_assistance_data_sync
+                               (MmGdbusModemLocation *proxy,
+                                GVariant *arg_data,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously invokes the InjectAssistanceData() D-Bus method on proxy +. The calling thread is blocked until a reply is received.

+

See mm_gdbus_modem_location_call_inject_assistance_data() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusModemLocationProxy.

 

arg_data

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1056,8 +1358,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -1112,7 +1414,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1150,8 +1452,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1163,7 +1465,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1187,6 +1489,11 @@ MmGdbusModemLocation *object, GDBusMethodInvocation *invocation); + gboolean (*handle_inject_assistance_data) ( + MmGdbusModemLocation *object, + GDBusMethodInvocation *invocation, + GVariant *arg_data); + gboolean (*handle_set_gps_refresh_rate) ( MmGdbusModemLocation *object, GDBusMethodInvocation *invocation, @@ -1203,6 +1510,8 @@ guint arg_sources, gboolean arg_signal_location); + const gchar *const * (*get_assistance_data_servers) (MmGdbusModemLocation *object); + guint (*get_capabilities) (MmGdbusModemLocation *object); guint (*get_enabled) (MmGdbusModemLocation *object); @@ -1214,6 +1523,8 @@ gboolean (*get_signals_location) (MmGdbusModemLocation *object); const gchar * (*get_supl_server) (MmGdbusModemLocation *object); + + guint (*get_supported_assistance_data) (MmGdbusModemLocation *object); };

Virtual table for the D-Bus interface org.freedesktop.ModemManager1.Modem.Location.

@@ -1237,6 +1548,11 @@   +

handle_inject_assistance_data ()

+

Handler for the “handle-inject-assistance-data” signal.

+  + +

handle_set_gps_refresh_rate ()

Handler for the “handle-set-gps-refresh-rate” signal.

  @@ -1252,6 +1568,11 @@   +

get_assistance_data_servers ()

+

Getter for the “assistance-data-servers” property.

+  + +

get_capabilities ()

Getter for the “capabilities” property.

  @@ -1281,6 +1602,11 @@

Getter for the “supl-server” property.

  + +

get_supported_assistance_data ()

+

Getter for the “supported-assistance-data” property.

+  + @@ -1289,6 +1615,14 @@

Property Details

+

The “assistance-data-servers” property

+
  “assistance-data-servers”  GStrv
+

Represents the D-Bus property "AssistanceDataServers".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+
+
+

The “capabilities” property

  “capabilities”             guint

Represents the D-Bus property "Capabilities".

@@ -1342,6 +1676,15 @@

Flags: Read / Write

Default value: NULL

+
+
+

The “supported-assistance-data” property

+
  “supported-assistance-data” guint
+

Represents the D-Bus property "SupportedAssistanceData".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: 0

+

Signal Details

@@ -1389,6 +1732,55 @@

+

The “handle-inject-assistance-data” signal

+
gboolean
+user_function (MmGdbusModemLocation  *object,
+               GDBusMethodInvocation *invocation,
+               GVariant              *arg_data,
+               gpointer               user_data)
+

Signal emitted when a remote caller is invoking the InjectAssistanceData() D-Bus method.

+

If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation + and eventually call mm_gdbus_modem_location_complete_inject_assistance_data() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

object

A MmGdbusModemLocation.

 

invocation

A GDBusMethodInvocation.

 

arg_data

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

TRUE if the invocation was handled, FALSE to let other signal handlers run.

+
+

Flags: Run Last

+
+
+

The “handle-set-gps-refresh-rate” signal

gboolean
 user_function (MmGdbusModemLocation  *object,
@@ -1543,6 +1935,6 @@
 
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocationProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocationProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocationProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocationProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemLocationProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemLocationProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemLocationProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemLocationProxy]

@@ -427,9 +427,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemLocationProxy]

@@ -467,6 +467,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocationSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocationSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemLocationSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemLocationSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemLocationSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Location.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemLocationSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessaging.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessaging.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessaging.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessaging.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemMessaging: libmm-glib Reference Manual - + - + @@ -244,7 +244,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemMessaging
 
@@ -291,7 +291,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -321,7 +321,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

[transfer full]

@@ -352,7 +352,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -383,7 +383,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -452,8 +452,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -496,7 +496,7 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -514,7 +514,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -553,13 +553,13 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -571,7 +571,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -612,8 +612,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -668,7 +668,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -706,8 +706,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -719,7 +719,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -754,8 +754,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -798,8 +798,8 @@

out_result

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

res

@@ -816,7 +816,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -849,13 +849,13 @@

out_result

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -867,7 +867,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1234,6 +1234,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessagingProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessagingProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessagingProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessagingProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemMessagingProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemMessagingProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemMessagingProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemMessagingProxy]

@@ -427,9 +427,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemMessagingProxy]

@@ -467,6 +467,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessagingSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessagingSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemMessagingSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemMessagingSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemMessagingSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Messaging.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemMessagingSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOma.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOma.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOma.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemOma: libmm-glib Reference Manual - + - + @@ -274,7 +274,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemOma
 
@@ -338,8 +338,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -394,7 +394,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -487,8 +487,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -543,7 +543,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -575,8 +575,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -588,7 +588,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -629,8 +629,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -684,7 +684,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -721,8 +721,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -734,7 +734,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -776,8 +776,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -832,7 +832,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -870,8 +870,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -883,7 +883,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -999,7 +999,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1030,7 +1030,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -1439,6 +1439,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOmaProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOmaProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOmaProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOmaProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemOmaProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemOmaProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemOmaProxy]

@@ -372,8 +372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -385,7 +385,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemOmaProxy]

@@ -424,9 +424,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -435,8 +435,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -448,7 +448,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemOmaProxy]

@@ -464,6 +464,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOmaSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOmaSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemOmaSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemOmaSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemOmaSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Oma.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemOmaSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemProxy]

@@ -371,8 +371,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -384,7 +384,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemProxy]

@@ -423,9 +423,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -434,8 +434,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -447,7 +447,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemProxy]

@@ -463,6 +463,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignal.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignal.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignal.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignal.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSignal: libmm-glib Reference Manual - + - + @@ -242,7 +242,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemSignal
 
@@ -317,7 +317,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -348,7 +348,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -379,7 +379,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -410,7 +410,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -441,7 +441,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -471,7 +471,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -500,7 +500,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -529,7 +529,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -558,7 +558,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -587,7 +587,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -627,8 +627,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -683,7 +683,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -720,8 +720,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -733,7 +733,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -940,6 +940,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignalProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignalProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignalProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignalProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSignalProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSignalProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSignalProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSignalProxy]

@@ -426,9 +426,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -437,8 +437,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -450,7 +450,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSignalProxy]

@@ -466,6 +466,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignalSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignalSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSignalSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSignalSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSignalSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Signal.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemSignalSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimple.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimple.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimple.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimple.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSimple: libmm-glib Reference Manual - + - + @@ -166,7 +166,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemSimple
 
@@ -223,8 +223,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -267,7 +267,7 @@

out_bearer

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -285,7 +285,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -324,13 +324,13 @@

out_bearer

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -342,7 +342,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -383,8 +383,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -439,7 +439,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -477,8 +477,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -490,7 +490,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -525,8 +525,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -569,7 +569,7 @@

out_properties

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -587,7 +587,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -620,13 +620,13 @@

out_properties

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -638,7 +638,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -852,6 +852,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimpleProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimpleProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimpleProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimpleProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSimpleProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSimpleProxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSimpleProxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSimpleProxy]

@@ -426,9 +426,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -437,8 +437,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -450,7 +450,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemSimpleProxy]

@@ -466,6 +466,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimpleSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimpleSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSimpleSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSimpleSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSimpleSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Simple.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemSimpleSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTime.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTime.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTime.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTime.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemTime: libmm-glib Reference Manual - + - + @@ -146,7 +146,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemTime
 
@@ -194,7 +194,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -225,7 +225,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -260,8 +260,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -304,7 +304,7 @@

out_time

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -322,7 +322,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -355,13 +355,13 @@

out_time

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -373,7 +373,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -537,6 +537,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTimeProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTimeProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTimeProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTimeProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemTimeProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemTimeProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -322,7 +322,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemTimeProxy]

@@ -372,8 +372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -385,7 +385,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemTimeProxy]

@@ -424,9 +424,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -435,8 +435,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -448,7 +448,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemTimeProxy]

@@ -464,6 +464,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTimeSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTimeSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemTimeSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemTimeSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemTimeSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Time.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemTimeSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoice.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoice.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoice.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoice.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemVoice: libmm-glib Reference Manual - + - + @@ -207,7 +207,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusModemVoice
 
@@ -254,7 +254,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -284,7 +284,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

+

The property value or NULL if the property is not set. The returned value should be freed with g_strfreev().

[transfer full]

@@ -324,8 +324,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -368,7 +368,7 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out] @@ -386,7 +386,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -425,13 +425,13 @@

out_path

-

Return location for return parameter or NULL to ignore.

+

Return location for return parameter or NULL to ignore.

[out]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -443,7 +443,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -484,8 +484,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -540,7 +540,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -578,8 +578,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -591,7 +591,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -626,8 +626,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -670,8 +670,8 @@

out_result

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

res

@@ -688,7 +688,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -721,13 +721,13 @@

out_result

-

Return location for return parameter or NULL to ignore.

-[out] +

Return location for return parameter or NULL to ignore.

+[out][array zero-terminated=1]

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -739,7 +739,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1066,6 +1066,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoiceProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoiceProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoiceProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoiceProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemVoiceProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemVoiceProxy]

@@ -273,8 +273,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -323,7 +323,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemVoiceProxy]

@@ -373,8 +373,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -386,7 +386,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemVoiceProxy]

@@ -425,9 +425,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -436,8 +436,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -449,7 +449,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusModemVoiceProxy]

@@ -465,6 +465,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoiceSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoiceSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusModemVoiceSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusModemVoiceSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusModemVoiceSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Modem.Voice.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusModemVoiceSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObject.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObject.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObject.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObject.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusObject: libmm-glib Reference Manual - + - + @@ -343,7 +343,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusObject
 
@@ -389,7 +389,7 @@

Returns

-

A MmGdbusModem or NULL if object +

A MmGdbusModem or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -419,7 +419,7 @@

Returns

-

A MmGdbusModem that must be freed with g_object_unref() or NULL if object +

A MmGdbusModem that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -449,7 +449,7 @@

Returns

-

A MmGdbusModem3gpp or NULL if object +

A MmGdbusModem3gpp or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -479,7 +479,7 @@

Returns

-

A MmGdbusModem3gpp that must be freed with g_object_unref() or NULL if object +

A MmGdbusModem3gpp that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -509,7 +509,7 @@

Returns

-

A MmGdbusModem3gppUssd or NULL if object +

A MmGdbusModem3gppUssd or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -539,7 +539,7 @@

Returns

-

A MmGdbusModem3gppUssd that must be freed with g_object_unref() or NULL if object +

A MmGdbusModem3gppUssd that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -569,7 +569,7 @@

Returns

-

A MmGdbusModemCdma or NULL if object +

A MmGdbusModemCdma or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -599,7 +599,7 @@

Returns

-

A MmGdbusModemCdma that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemCdma that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -629,7 +629,7 @@

Returns

-

A MmGdbusModemLocation or NULL if object +

A MmGdbusModemLocation or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -659,7 +659,7 @@

Returns

-

A MmGdbusModemLocation that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemLocation that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -689,7 +689,7 @@

Returns

-

A MmGdbusModemMessaging or NULL if object +

A MmGdbusModemMessaging or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -719,7 +719,7 @@

Returns

-

A MmGdbusModemMessaging that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemMessaging that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -749,7 +749,7 @@

Returns

-

A MmGdbusModemTime or NULL if object +

A MmGdbusModemTime or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -779,7 +779,7 @@

Returns

-

A MmGdbusModemTime that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemTime that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -809,7 +809,7 @@

Returns

-

A MmGdbusModemFirmware or NULL if object +

A MmGdbusModemFirmware or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -839,7 +839,7 @@

Returns

-

A MmGdbusModemFirmware that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemFirmware that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -869,7 +869,7 @@

Returns

-

A MmGdbusModemOma or NULL if object +

A MmGdbusModemOma or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -899,7 +899,7 @@

Returns

-

A MmGdbusModemOma that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemOma that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -929,7 +929,7 @@

Returns

-

A MmGdbusModemSimple or NULL if object +

A MmGdbusModemSimple or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -959,7 +959,7 @@

Returns

-

A MmGdbusModemSimple that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemSimple that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -989,7 +989,7 @@

Returns

-

A MmGdbusModemSignal or NULL if object +

A MmGdbusModemSignal or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -1019,7 +1019,7 @@

Returns

-

A MmGdbusModemSignal that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemSignal that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -1049,7 +1049,7 @@

Returns

-

A MmGdbusModemVoice or NULL if object +

A MmGdbusModemVoice or NULL if object does not implement the interface. Do not free the returned object, it is owned by object .

[transfer none]

@@ -1079,7 +1079,7 @@

Returns

-

A MmGdbusModemVoice that must be freed with g_object_unref() or NULL if object +

A MmGdbusModemVoice that must be freed with g_object_unref() or NULL if object does not implement the interface.

[transfer full]

@@ -1217,6 +1217,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectManagerClient.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectManagerClient.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectManagerClient.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectManagerClient.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusObjectManagerClient: libmm-glib Reference Manual - + - + @@ -169,9 +169,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -180,8 +180,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -230,7 +230,7 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MmGdbusObjectManagerClient]

@@ -270,9 +270,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -281,8 +281,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -294,7 +294,7 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MmGdbusObjectManagerClient]

@@ -347,8 +347,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -397,7 +397,7 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MmGdbusObjectManagerClient]

@@ -447,8 +447,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -460,7 +460,7 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MmGdbusObjectManagerClient]

@@ -475,7 +475,7 @@ const gchar *interface_name, gpointer user_data);

A GDBusProxyTypeFunc that maps interface_name - to the generated GDBusObjectProxy- and GDBusProxy-derived types.

+ to the generated GDBusObjectProxy derived and GDBusProxy derived types.

Parameters

@@ -497,8 +497,8 @@ - - + + @@ -510,7 +510,7 @@

Returns

-

A GDBusProxy-derived GType if interface_name +

A GDBusProxy derived GType if interface_name is not NULL, otherwise the GType for MmGdbusObjectProxy.

@@ -525,6 +525,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusObjectProxy: libmm-glib Reference Manual - + - + @@ -112,7 +112,7 @@

Returns

-

The proxy object.

+

The proxy object.

[transfer full]

@@ -127,6 +127,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusObjectSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusObjectSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusObjectSkeleton: libmm-glib Reference Manual - + - + @@ -201,7 +201,7 @@

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full]

@@ -229,8 +229,8 @@ - - + +

interface_name

Interface name of the remote object or NULL to get the object proxy GType.

[allow-none]

Interface name of the remote object or NULL to get the object proxy GType.

[nullable]

user_data

interface_

A MmGdbusModem or NULL to clear the interface.

[allow-none]

A MmGdbusModem or NULL to clear the interface.

[nullable]
@@ -261,8 +261,8 @@

interface_

-

A MmGdbusModem3gpp or NULL to clear the interface.

-[allow-none] +

A MmGdbusModem3gpp or NULL to clear the interface.

+[nullable]
@@ -293,8 +293,8 @@

interface_

-

A MmGdbusModem3gppUssd or NULL to clear the interface.

-[allow-none] +

A MmGdbusModem3gppUssd or NULL to clear the interface.

+[nullable] @@ -325,8 +325,8 @@

interface_

-

A MmGdbusModemCdma or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemCdma or NULL to clear the interface.

+[nullable] @@ -357,8 +357,8 @@

interface_

-

A MmGdbusModemFirmware or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemFirmware or NULL to clear the interface.

+[nullable] @@ -389,8 +389,8 @@

interface_

-

A MmGdbusModemOma or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemOma or NULL to clear the interface.

+[nullable] @@ -421,8 +421,8 @@

interface_

-

A MmGdbusModemLocation or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemLocation or NULL to clear the interface.

+[nullable] @@ -453,8 +453,8 @@

interface_

-

A MmGdbusModemMessaging or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemMessaging or NULL to clear the interface.

+[nullable] @@ -485,8 +485,8 @@

interface_

-

A MmGdbusModemSimple or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemSimple or NULL to clear the interface.

+[nullable] @@ -517,8 +517,8 @@

interface_

-

A MmGdbusModemTime or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemTime or NULL to clear the interface.

+[nullable] @@ -549,8 +549,8 @@

interface_

-

A MmGdbusModemSignal or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemSignal or NULL to clear the interface.

+[nullable] @@ -581,8 +581,8 @@

interface_

-

A MmGdbusModemVoice or NULL to clear the interface.

-[allow-none] +

A MmGdbusModemVoice or NULL to clear the interface.

+[nullable] @@ -599,6 +599,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusOrgFreedesktopModemManager1: libmm-glib Reference Manual - + - + @@ -18,7 +18,8 @@ Description  |  Object Hierarchy  |  Prerequisites  |  - Known Implementations  |  + Known Implementations  |  + Properties  |  Signals Home @@ -45,6 +46,21 @@ +gchar * + + +mm_gdbus_org_freedesktop_modem_manager1_dup_version () + + + +const gchar * + + +mm_gdbus_org_freedesktop_modem_manager1_get_version () + + + + void @@ -72,6 +88,30 @@ void +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device () + + + + +gboolean + + +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish () + + + + +gboolean + + +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync () + + + + +void + + mm_gdbus_org_freedesktop_modem_manager1_call_set_logging () @@ -91,10 +131,50 @@ mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_sync () + + +void + + +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event () + + + + +gboolean + + +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish () + + + + +gboolean + + +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync () + +
+

Properties

+
+++++ + + + + + +
+gchar *versionRead / Write
+
+

Signals

@@ -105,6 +185,16 @@ + + + + + + + + + + @@ -137,7 +227,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusOrgFreedesktopModemManager1
 
@@ -160,6 +250,68 @@

Functions

+

mm_gdbus_org_freedesktop_modem_manager1_dup_version ()

+
gchar *
+mm_gdbus_org_freedesktop_modem_manager1_dup_version
+                               (MmGdbusOrgFreedesktopModemManager1 *object);
+

Gets a copy of the "Version" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+

[skip]

+
+

Parameters

+
gbooleanhandle-inhibit-deviceRun Last
gbooleanhandle-report-kernel-eventRun Last
gboolean handle-scan-devices Run Last
+++++ + + + + + +

object

A MmGdbusOrgFreedesktopModemManager1.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

[transfer full]

+
+ +
+
+

mm_gdbus_org_freedesktop_modem_manager1_get_version ()

+
const gchar *
+mm_gdbus_org_freedesktop_modem_manager1_get_version
+                               (MmGdbusOrgFreedesktopModemManager1 *object);
+

Gets the value of the "Version" D-Bus property.

+

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

+
The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use mm_gdbus_org_freedesktop_modem_manager1_dup_version() if on another thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

object

A MmGdbusOrgFreedesktopModemManager1.

 
+
+
+

Returns

+

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +.

+

[transfer none]

+
+
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices ()

void
 mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices
@@ -189,8 +341,8 @@
 
 
 

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -245,7 +397,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -277,8 +429,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -290,7 +442,168 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+ +
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device ()

+
void
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                const gchar *arg_uid,
+                                gboolean arg_inhibit,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously invokes the InhibitDevice() D-Bus method on proxy +. +When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish() to get the result of the operation.

+

See mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

arg_uid

Argument to pass with the method invocation.

 

arg_inhibit

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish ()

+
gboolean
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync ()

+
gboolean
+mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                const gchar *arg_uid,
+                                gboolean arg_inhibit,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously invokes the InhibitDevice() D-Bus method on proxy +. The calling thread is blocked until a reply is received.

+

See mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

arg_uid

Argument to pass with the method invocation.

 

arg_inhibit

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -332,8 +645,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -388,7 +701,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -426,8 +739,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -439,7 +752,156 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+ +
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event ()

+
void
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                GVariant *arg_properties,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously invokes the ReportKernelEvent() D-Bus method on proxy +. +When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish() to get the result of the operation.

+

See mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

arg_properties

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish ()

+
gboolean
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error +is set.

+

[skip]

+
+
+
+
+

mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync ()

+
gboolean
+mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync
+                               (MmGdbusOrgFreedesktopModemManager1 *proxy,
+                                GVariant *arg_properties,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously invokes the ReportKernelEvent() D-Bus method on proxy +. The calling thread is blocked until a reply is received.

+

See mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

proxy

A MmGdbusOrgFreedesktopModemManager1Proxy.

 

arg_properties

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -458,6 +920,18 @@
struct MmGdbusOrgFreedesktopModemManager1Iface {
   GTypeInterface parent_iface;
 
+
+  gboolean (*handle_inhibit_device) (
+    MmGdbusOrgFreedesktopModemManager1 *object,
+    GDBusMethodInvocation *invocation,
+    const gchar *arg_uid,
+    gboolean arg_inhibit);
+
+  gboolean (*handle_report_kernel_event) (
+    MmGdbusOrgFreedesktopModemManager1 *object,
+    GDBusMethodInvocation *invocation,
+    GVariant *arg_properties);
+
   gboolean (*handle_scan_devices) (
     MmGdbusOrgFreedesktopModemManager1 *object,
     GDBusMethodInvocation *invocation);
@@ -466,6 +940,8 @@
     MmGdbusOrgFreedesktopModemManager1 *object,
     GDBusMethodInvocation *invocation,
     const gchar *arg_level);
+
+  const gchar * (*get_version) (MmGdbusOrgFreedesktopModemManager1 *object);
 };
 

Virtual table for the D-Bus interface org.freedesktop.ModemManager1.

@@ -484,6 +960,16 @@   +

handle_inhibit_device ()

+

Handler for the “handle-inhibit-device” signal.

+  + + +

handle_report_kernel_event ()

+

Handler for the “handle-report-kernel-event” signal.

+  + +

handle_scan_devices ()

Handler for the “handle-scan-devices” signal.

  @@ -493,14 +979,134 @@

Handler for the “handle-set-logging” signal.

  + +

get_version ()

+

Getter for the “version” property.

+  +
+

Property Details

+
+

The “version” property

+
  “version”                  gchar *
+

Represents the D-Bus property "Version".

+

Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.

+

Flags: Read / Write

+

Default value: NULL

+
+
+

Signal Details

+

The “handle-inhibit-device” signal

+
gboolean
+user_function (MmGdbusOrgFreedesktopModemManager1 *object,
+               GDBusMethodInvocation              *invocation,
+               gchar                              *arg_uid,
+               gboolean                            arg_inhibit,
+               gpointer                            user_data)
+

Signal emitted when a remote caller is invoking the InhibitDevice() D-Bus method.

+

If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation + and eventually call mm_gdbus_org_freedesktop_modem_manager1_complete_inhibit_device() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

object

A MmGdbusOrgFreedesktopModemManager1.

 

invocation

A GDBusMethodInvocation.

 

arg_uid

Argument passed by remote caller.

 

arg_inhibit

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

TRUE if the invocation was handled, FALSE to let other signal handlers run.

+
+

Flags: Run Last

+
+
+
+

The “handle-report-kernel-event” signal

+
gboolean
+user_function (MmGdbusOrgFreedesktopModemManager1 *object,
+               GDBusMethodInvocation              *invocation,
+               GVariant                           *arg_properties,
+               gpointer                            user_data)
+

Signal emitted when a remote caller is invoking the ReportKernelEvent() D-Bus method.

+

If a signal handler returns TRUE, it means the signal handler will handle the invocation (e.g. take a reference to invocation + and eventually call mm_gdbus_org_freedesktop_modem_manager1_complete_report_kernel_event() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

object

A MmGdbusOrgFreedesktopModemManager1.

 

invocation

A GDBusMethodInvocation.

 

arg_properties

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 
+
+
+

Returns

+

TRUE if the invocation was handled, FALSE to let other signal handlers run.

+
+

Flags: Run Last

+
+
+

The “handle-scan-devices” signal

gboolean
 user_function (MmGdbusOrgFreedesktopModemManager1 *object,
@@ -594,6 +1200,6 @@
 
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Proxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Proxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Proxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Proxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusOrgFreedesktopModemManager1Proxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -221,7 +221,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusOrgFreedesktopModemManager1Proxy]

@@ -274,8 +274,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -324,7 +324,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusOrgFreedesktopModemManager1Proxy]

@@ -374,8 +374,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -387,7 +387,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusOrgFreedesktopModemManager1Proxy]

@@ -427,9 +427,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -438,8 +438,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -451,7 +451,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusOrgFreedesktopModemManager1Proxy]

@@ -467,6 +467,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Skeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Skeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Skeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusOrgFreedesktopModemManager1Skeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusOrgFreedesktopModemManager1Skeleton: libmm-glib Reference Manual - + - + @@ -89,7 +89,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusOrgFreedesktopModemManager1Skeleton]

@@ -104,6 +104,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSim.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSim.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSim.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSim.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSim: libmm-glib Reference Manual - + - + @@ -292,7 +292,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusSim
 
@@ -339,7 +339,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -369,7 +369,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -399,7 +399,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -429,7 +429,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -459,7 +459,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -489,7 +489,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -519,7 +519,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -549,7 +549,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -589,8 +589,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -644,7 +644,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -681,8 +681,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -694,7 +694,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -741,8 +741,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -796,7 +796,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -839,8 +839,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -852,7 +852,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -899,8 +899,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -954,7 +954,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -997,8 +997,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1010,7 +1010,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1057,8 +1057,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -1112,7 +1112,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1155,8 +1155,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1168,7 +1168,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1536,6 +1536,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSimProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSimProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSimProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSimProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSimProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSimProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -321,7 +321,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSimProxy]

@@ -370,8 +370,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -383,7 +383,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSimProxy]

@@ -422,9 +422,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -433,8 +433,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -446,7 +446,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSimProxy]

@@ -462,6 +462,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSimSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSimSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSimSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSimSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSimSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Sim.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusSimSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSms.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSms.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSms.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSms.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSms: libmm-glib Reference Manual - + - + @@ -416,7 +416,7 @@

Object Hierarchy

-
    GInterface
+
    GInterface
     ╰── MmGdbusSms
 
@@ -575,7 +575,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -605,7 +605,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -635,7 +635,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -665,7 +665,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -695,7 +695,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -725,7 +725,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -755,7 +755,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -785,7 +785,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -815,7 +815,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -845,7 +845,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

+

The property value or NULL if the property is not set. The returned value should be freed with g_variant_unref().

[transfer full]

@@ -959,7 +959,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -989,7 +989,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1019,7 +1019,7 @@

Returns

-

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object +

The property value or NULL if the property is not set. Do not free the returned value, it belongs to object .

[transfer none]

@@ -1049,7 +1049,7 @@

Returns

-

The property value or NULL if the property is not set. The returned value should be freed with g_free().

+

The property value or NULL if the property is not set. The returned value should be freed with g_free().

[transfer full]

@@ -1140,8 +1140,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -1195,7 +1195,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1226,8 +1226,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1239,7 +1239,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1280,8 +1280,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -1335,7 +1335,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1372,8 +1372,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -1385,7 +1385,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeded, FALSE if error is set.

[skip]

@@ -1801,6 +1801,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSmsProxy.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSmsProxy.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSmsProxy.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSmsProxy.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSmsProxy: libmm-glib Reference Manual - + - + @@ -160,9 +160,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -171,8 +171,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -220,7 +220,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSmsProxy]

@@ -272,8 +272,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

callback

@@ -321,7 +321,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSmsProxy]

@@ -370,8 +370,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -383,7 +383,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSmsProxy]

@@ -422,9 +422,9 @@

name

-

A bus name (well-known or unique) or NULL if connection +

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

-[allow-none] +[nullable]

object_path

@@ -433,8 +433,8 @@

cancellable

-

A GCancellable or NULL.

-[allow-none] +

A GCancellable or NULL.

+[nullable]

error

@@ -446,7 +446,7 @@

Returns

-

The constructed proxy object or NULL if error +

The constructed proxy object or NULL if error is set.

[transfer full][type MmGdbusSmsProxy]

@@ -462,6 +462,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSmsSkeleton.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSmsSkeleton.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MmGdbusSmsSkeleton.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MmGdbusSmsSkeleton.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MmGdbusSmsSkeleton: libmm-glib Reference Manual - + - + @@ -88,7 +88,7 @@

Creates a skeleton object for the D-Bus interface org.freedesktop.ModemManager1.Sms.

Returns

-

The skeleton object.

+

The skeleton object.

[transfer full][type MmGdbusSmsSkeleton]

@@ -103,6 +103,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMKernelEventProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMKernelEventProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMKernelEventProperties.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMKernelEventProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,401 @@ + + + + +MMKernelEventProperties: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

MMKernelEventProperties

+

MMKernelEventProperties — Helper object to handle kernel event properties.

+
+
+

Functions

+ +
+
+

Types and Values

+
++++ + + + + +
structMMKernelEventProperties
+
+
+

Object Hierarchy

+
    GObject
+    ╰── MMKernelEventProperties
+
+
+
+

Description

+

The MMKernelEventProperties is an object handling the properties to be set +in reported kernel events.

+

This object is created by the user and passed to ModemManager with either +mm_manager_report_kernel_event() or mm_manager_report_kernel_event_sync().

+
+
+

Functions

+
+

mm_kernel_event_properties_new ()

+
MMKernelEventProperties *
+mm_kernel_event_properties_new (void);
+

Creates a new empty MMKernelEventProperties.

+
+

Returns

+

a MMKernelEventProperties. The returned value should be freed with g_object_unref().

+

[transfer full]

+
+
+
+
+

mm_kernel_event_properties_get_action ()

+
const gchar *
+mm_kernel_event_properties_get_action (MMKernelEventProperties *self);
+

Gets the action.

+
+

Parameters

+
+++++ + + + + + +

self

A MMKernelEventProperties.

 
+
+
+

Returns

+

The action. Do not free the returned value, it is owned by self +.

+

[transfer none]

+
+
+
+
+

mm_kernel_event_properties_set_action ()

+
void
+mm_kernel_event_properties_set_action (MMKernelEventProperties *self,
+                                       const gchar *action);
+

Sets the action.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

A MMKernelEventProperties.

 

action

The action to set.

 
+
+
+
+
+

mm_kernel_event_properties_get_name ()

+
const gchar *
+mm_kernel_event_properties_get_name (MMKernelEventProperties *self);
+

Gets the name.

+
+

Parameters

+
+++++ + + + + + +

self

A MMKernelEventProperties.

 
+
+
+

Returns

+

The name. Do not free the returned value, it is owned by self +.

+

[transfer none]

+
+
+
+
+

mm_kernel_event_properties_set_name ()

+
void
+mm_kernel_event_properties_set_name (MMKernelEventProperties *self,
+                                     const gchar *name);
+

Sets the name.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

A MMKernelEventProperties.

 

name

The name to set.

 
+
+
+
+
+

mm_kernel_event_properties_get_subsystem ()

+
const gchar *
+mm_kernel_event_properties_get_subsystem
+                               (MMKernelEventProperties *self);
+

Gets the subsystem.

+
+

Parameters

+
+++++ + + + + + +

self

A MMKernelEventProperties.

 
+
+
+

Returns

+

The subsystem. Do not free the returned value, it is owned by self +.

+

[transfer none]

+
+
+
+
+

mm_kernel_event_properties_set_subsystem ()

+
void
+mm_kernel_event_properties_set_subsystem
+                               (MMKernelEventProperties *self,
+                                const gchar *subsystem);
+

Sets the subsystem.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

A MMKernelEventProperties.

 

subsystem

The subsystem to set.

 
+
+
+
+
+

mm_kernel_event_properties_get_uid ()

+
const gchar *
+mm_kernel_event_properties_get_uid (MMKernelEventProperties *self);
+

Gets the unique ID of the physical device.

+
+

Parameters

+
+++++ + + + + + +

self

A MMKernelEventProperties.

 
+
+
+

Returns

+

The uid. Do not free the returned value, it is owned by self +.

+

[transfer none]

+
+
+
+
+

mm_kernel_event_properties_set_uid ()

+
void
+mm_kernel_event_properties_set_uid (MMKernelEventProperties *self,
+                                    const gchar *uid);
+

Sets the unique ID of the physical device.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

A MMKernelEventProperties.

 

uid

The uid to set.

 
+
+
+
+
+

Types and Values

+
+

struct MMKernelEventProperties

+
struct MMKernelEventProperties;
+

The MMKernelEventProperties structure contains private data and should only be +accessed using the provided API.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocation3gpp.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocation3gpp.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocation3gpp.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocation3gpp.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMLocation3gpp: libmm-glib Reference Manual - + - + @@ -69,6 +69,14 @@ gulong +mm_location_3gpp_get_tracking_area_code () + + + + +gulong + + mm_location_3gpp_get_cell_id () @@ -137,6 +145,9 @@ mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self);

Gets the Mobile Network Code of the 3GPP network.

+

Note that 0 may actually be a valid MNC. In general, the MNC should be +considered valid just if the reported MCC is valid, as MCC should never +be 0.

Parameters

@@ -186,6 +197,33 @@
+

mm_location_3gpp_get_tracking_area_code ()

+
gulong
+mm_location_3gpp_get_tracking_area_code
+                               (MMLocation3gpp *self);
+

Gets the location area code of the 3GPP network.

+
+

Parameters

+
+++++ + + + + + +

self

a MMLocation3gpp.

 
+
+
+

Returns

+

the location area code, or 0 if unknown.

+
+ +
+

mm_location_3gpp_get_cell_id ()

gulong
 mm_location_3gpp_get_cell_id (MMLocation3gpp *self);
@@ -222,6 +260,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationCdmaBs.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationCdmaBs.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationCdmaBs.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationCdmaBs.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMLocationCdmaBs: libmm-glib Reference Manual - + - + @@ -151,6 +151,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationGpsNmea.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationGpsNmea.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationGpsNmea.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationGpsNmea.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMLocationGpsNmea: libmm-glib Reference Manual - + - + @@ -145,7 +145,7 @@

Returns

-

a string containing all traces, or NULL if none available. The returned value should be freed with g_free().

+

a string containing all traces, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -161,6 +161,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationGpsRaw.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationGpsRaw.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMLocationGpsRaw.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMLocationGpsRaw.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMLocationGpsRaw: libmm-glib Reference Manual - + - + @@ -219,6 +219,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMManager.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMManager.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMManager.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMManager.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMManager: libmm-glib Reference Manual - + - - + + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
@@ -82,6 +82,13 @@ +const gchar * + + +mm_manager_get_version () + + + void @@ -110,6 +117,54 @@ void +mm_manager_inhibit_device () + + + + +gboolean + + +mm_manager_inhibit_device_finish () + + + + +gboolean + + +mm_manager_inhibit_device_sync () + + + + +void + + +mm_manager_uninhibit_device () + + + + +gboolean + + +mm_manager_uninhibit_device_finish () + + + + +gboolean + + +mm_manager_uninhibit_device_sync () + + + + +void + + mm_manager_set_logging () @@ -129,6 +184,30 @@ mm_manager_set_logging_sync () + + +void + + +mm_manager_report_kernel_event () + + + + +gboolean + + +mm_manager_report_kernel_event_finish () + + + + +gboolean + + +mm_manager_report_kernel_event_sync () + +
@@ -191,7 +270,7 @@

Returns

-

The GDBusProxy interface of manager +

The GDBusProxy interface of manager , or NULL if none. Do not free the returned object, it is owned by manager .

[transfer none]

@@ -221,7 +300,7 @@

Returns

-

The GDBusProxy interface of manager +

The GDBusProxy interface of manager , or NULL if none. The returned object must be freed with g_object_unref().

[transfer full]

@@ -262,7 +341,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -311,7 +390,7 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MMManager]

@@ -348,7 +427,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -361,13 +440,42 @@

Returns

-

The constructed object manager client or NULL if error +

The constructed object manager client or NULL if error is set.

[transfer full][type MMManager]


+

mm_manager_get_version ()

+
const gchar *
+mm_manager_get_version (MMManager *manager);
+

Gets the ModemManager version, as reported by the daemon.

+

It is safe to assume this value never changes during runtime.

+
+

Parameters

+
+++++ + + + + + +

manager

A MMManager.

 
+
+
+

Returns

+

The version, or NULL if none available. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+
+
+

mm_manager_scan_devices ()

void
 mm_manager_scan_devices (MMManager *manager,
@@ -396,7 +504,7 @@
 
 
 

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -451,7 +559,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeeded, FALSE if error is set.

@@ -481,7 +589,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -494,7 +602,321 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeeded, FALSE if error +is set.

+
+ +
+
+

mm_manager_inhibit_device ()

+
void
+mm_manager_inhibit_device (MMManager *manager,
+                           const gchar *uid,
+                           GCancellable *cancellable,
+                           GAsyncReadyCallback callback,
+                           gpointer user_data);
+

Asynchronously requests to add an inhibition on the device identified by uid +.

+

The uid + must be the unique ID retrieved from an existing MMModem using +mm_modem_get_device(). The caller should keep track of this uid + and use it +in the mm_manager_uninhibit_device() call when the inhibition is no longer required.

+

The inhibition added with this method may also be automatically removed when +the caller program disappears from the bus (e.g. if the program ends before +having called mm_manager_uninhibit_device() explicitly).

+

When the operation is finished, callback + will be invoked in the

+thread-default main loop

of the thread you are calling this method from. You can then call +mm_manager_inhibit_device_finish() to get the result of the operation.

+

See mm_manager_inhibit_device_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

uid

the unique ID of the physical device.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_manager_inhibit_device_finish ()

+
gboolean
+mm_manager_inhibit_device_finish (MMManager *manager,
+                                  GAsyncResult *res,
+                                  GError **error);
+

Finishes an operation started with mm_manager_inhibit_device().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_manager_inhibit_device().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeeded, FALSE if error +is set.

+
+
+
+
+

mm_manager_inhibit_device_sync ()

+
gboolean
+mm_manager_inhibit_device_sync (MMManager *manager,
+                                const gchar *uid,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously requests to add an inhibition on the device identified by uid +.

+

The uid + must be the unique ID retrieved from an existing MMModem using +mm_modem_get_device(). The caller should keep track of this uid + and use it +in the mm_manager_uninhibit_device_sync() call when the inhibition is no longer required.

+

The inhibition added with this method may also be automatically removed when +the caller program disappears from the bus (e.g. if the program ends before +having called mm_manager_uninhibit_device_sync() explicitly).

+

See mm_manager_inhibit_device() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

uid

the unique ID of the physical device.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeeded, FALSE if error +is set.

+
+
+
+
+

mm_manager_uninhibit_device ()

+
void
+mm_manager_uninhibit_device (MMManager *manager,
+                             const gchar *uid,
+                             GCancellable *cancellable,
+                             GAsyncReadyCallback callback,
+                             gpointer user_data);
+

Asynchronously requests to remove an inhibition on the device identified by uid +.

+

The uid + must be the same unique ID that was sent in the inhibition request.

+

Only the same program that placed an inhibition on a given device is able to remove +the inhibition.

+

When the operation is finished, callback + will be invoked in the

+thread-default main loop

of the thread you are calling this method from. You can then call +mm_manager_uninhibit_device_finish() to get the result of the operation.

+

See mm_manager_uninhibit_device_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

uid

the unique ID of the physical device.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_manager_uninhibit_device_finish ()

+
gboolean
+mm_manager_uninhibit_device_finish (MMManager *manager,
+                                    GAsyncResult *res,
+                                    GError **error);
+

Finishes an operation started with mm_manager_uninhibit_device().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_manager_uninhibit_device().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeeded, FALSE if error +is set.

+
+
+
+
+

mm_manager_uninhibit_device_sync ()

+
gboolean
+mm_manager_uninhibit_device_sync (MMManager *manager,
+                                  const gchar *uid,
+                                  GCancellable *cancellable,
+                                  GError **error);
+

Synchronously requests to remove an inhibition on the device identified by uid +.

+

The uid + must be the same unique ID that was sent in the inhibition request.

+

Only the same program that placed an inhibition on a given device is able to remove +the inhibition.

+

See mm_manager_uninhibit_device() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

uid

the unique ID of the physical device.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the call succeeded, FALSE if error is set.

@@ -534,7 +956,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -589,7 +1011,7 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeeded, FALSE if error is set.

@@ -625,7 +1047,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -638,7 +1060,151 @@

Returns

-

TRUE if the call succeded, FALSE if error +

TRUE if the call succeeded, FALSE if error +is set.

+
+ +
+
+

mm_manager_report_kernel_event ()

+
void
+mm_manager_report_kernel_event (MMManager *manager,
+                                MMKernelEventProperties *properties,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously report kernel event.

+

When the operation is finished, callback + will be invoked in the

+thread-default main loop

of the thread you are calling this method from. You can then call +mm_manager_report_kernel_event_finish() to get the result of the operation.

+

See mm_manager_report_kernel_event_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

properties

the properties of the kernel event.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_manager_report_kernel_event_finish ()

+
gboolean
+mm_manager_report_kernel_event_finish (MMManager *manager,
+                                       GAsyncResult *res,
+                                       GError **error);
+

Finishes an operation started with mm_manager_report_kernel_event().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_manager_report_kernel_event().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation succeeded, FALSE if error +is set.

+
+
+
+
+

mm_manager_report_kernel_event_sync ()

+
gboolean
+mm_manager_report_kernel_event_sync (MMManager *manager,
+                                     MMKernelEventProperties *properties,
+                                     GCancellable *cancellable,
+                                     GError **error);
+

Synchronously report kernel event.

+

The calling thread is blocked until a reply is received.

+

See mm_manager_report_kernel_event() for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

manager

A MMManager.

 

properties

the properties of the kernel event.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation succeeded, FALSE if error is set.

@@ -654,6 +1220,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem3gpp.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem3gpp.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem3gpp.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem3gpp.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModem3gpp: libmm-glib Reference Manual - + - + @@ -172,6 +172,77 @@ +GList * + + +mm_modem_3gpp_get_pco () + + + + +MMModem3gppEpsUeModeOperation + + +mm_modem_3gpp_get_eps_ue_mode_operation () + + + +const gchar * + + +mm_modem_3gpp_get_initial_eps_bearer_path () + + + + +gchar * + + +mm_modem_3gpp_dup_initial_eps_bearer_path () + + + + +void + + +mm_modem_3gpp_get_initial_eps_bearer () + + + + +MMBearer * + + +mm_modem_3gpp_get_initial_eps_bearer_finish () + + + + +MMBearer * + + +mm_modem_3gpp_get_initial_eps_bearer_sync () + + + + +MMBearerProperties * + + +mm_modem_3gpp_get_initial_eps_bearer_settings () + + + + +MMBearerProperties * + + +mm_modem_3gpp_peek_initial_eps_bearer_settings () + + + + void @@ -218,6 +289,54 @@ mm_modem_3gpp_scan_sync () + + +void + + +mm_modem_3gpp_set_eps_ue_mode_operation () + + + + +gboolean + + +mm_modem_3gpp_set_eps_ue_mode_operation_finish () + + + + +gboolean + + +mm_modem_3gpp_set_eps_ue_mode_operation_sync () + + + + +void + + +mm_modem_3gpp_set_initial_eps_bearer_settings () + + + + +gboolean + + +mm_modem_3gpp_set_initial_eps_bearer_settings_finish () + + + + +gboolean + + +mm_modem_3gpp_set_initial_eps_bearer_settings_sync () + + @@ -286,7 +405,7 @@

Returns

-

The operator code, or NULL if none available.

+

The operator code, or NULL if none available.

[transfer none]

@@ -314,7 +433,7 @@

Returns

-

The long operator name, or NULL if none available.

+

The long operator name, or NULL if none available.

[transfer none]

@@ -342,7 +461,7 @@

Returns

-

The long operator name, or NULL if none available.

+

The long operator name, or NULL if none available.

[transfer none]

@@ -445,7 +564,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -472,7 +591,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -504,7 +623,7 @@

Returns

-

The IMEI, or NULL if none available.

+

The IMEI, or NULL if none available.

[transfer none]

@@ -532,7 +651,7 @@

Returns

-

The IMEI, or NULL if none available. The returned value should be freed with g_free().

+

The IMEI, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -571,7 +690,7 @@

Returns

-

The operator code, or NULL if none available.

+

The operator code, or NULL if none available.

[transfer none]

@@ -603,7 +722,7 @@

Returns

-

The operator code, or NULL if none available. The returned value should be freed with g_free().

+

The operator code, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -635,7 +754,7 @@

Returns

-

The operator name, or NULL if none available.

+

The operator name, or NULL if none available.

[transfer none]

@@ -663,7 +782,7 @@

Returns

-

The operator name, or NULL if none available. The returned value should be freed with g_free().

+

The operator name, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -726,8 +845,17 @@

mm_modem_3gpp_get_subscription_state ()

MMModem3gppSubscriptionState
 mm_modem_3gpp_get_subscription_state (MMModem3gpp *self);
+
+

mm_modem_3gpp_get_subscription_state has been deprecated since version 1.10.0. and should not be used in newly-written code.

+

The value of this property can only be obtained with operator +specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense +to expose it in the ModemManager interface.

+

Get the current subscription status of the account. This value is only available after the modem attempts to register with the network.

+

The value of this property can only be obtained with operator specific logic (e.g. +processing specific PCO info), and therefore it doesn't make sense to expose it in +the ModemManager interface.

Parameters

@@ -750,6 +878,326 @@
+

mm_modem_3gpp_get_pco ()

+
GList *
+mm_modem_3gpp_get_pco (MMModem3gpp *self);
+

Get the list of MMPco received from the network.

+

The caller is responsible for freeing the returned GList with +mm_pco_list_free().

+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+
+

Returns

+

A list of MMPco.

+

[element-type ModemManager.Pco][transfer full]

+
+ +
+
+

mm_modem_3gpp_get_eps_ue_mode_operation ()

+
MMModem3gppEpsUeModeOperation
+mm_modem_3gpp_get_eps_ue_mode_operation
+                               (MMModem3gpp *self);
+

Get the UE mode of operation for EPS.

+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+ +
+
+
+

mm_modem_3gpp_get_initial_eps_bearer_path ()

+
const gchar *
+mm_modem_3gpp_get_initial_eps_bearer_path
+                               (MMModem3gpp *self);
+

Gets the DBus path of the initial EPS MMBearer exposed in this MMModem3gpp.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_modem_3gpp_dup_initial_eps_bearer_path() if on another +thread.
+

[skip]

+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+
+

Returns

+

The DBus path of the MMBearer, or NULL if none available. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+
+
+
+

mm_modem_3gpp_dup_initial_eps_bearer_path ()

+
gchar *
+mm_modem_3gpp_dup_initial_eps_bearer_path
+                               (MMModem3gpp *self);
+

Gets a copy of the DBus path of the initial EPS MMBearer exposed in this MMModem3gpp.

+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+
+

Returns

+

The DBus path of the MMBearer, or NULL if none available. The returned value should be freed with g_free().

+

[transfer full]

+
+
+
+
+

mm_modem_3gpp_get_initial_eps_bearer ()

+
void
+mm_modem_3gpp_get_initial_eps_bearer (MMModem3gpp *self,
+                                      GCancellable *cancellable,
+                                      GAsyncReadyCallback callback,
+                                      gpointer user_data);
+

Asynchronously gets the initial EPS MMBearer object exposed by this MMModem3gpp.

+

When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_modem_3gpp_get_initial_eps_bearer_finish() to get the result of the operation.

+

See mm_modem_3gpp_get_initial_eps_bearer_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_modem_3gpp_get_initial_eps_bearer_finish ()

+
MMBearer *
+mm_modem_3gpp_get_initial_eps_bearer_finish
+                               (MMModem3gpp *self,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_modem_3gpp_get_initial_eps_bearer().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_modem_3gpp_get_initial_eps_bearer().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

a MMSim or NULL if error +is set. The returned value should be freed with g_object_unref().

+

[transfer full]

+
+
+
+
+

mm_modem_3gpp_get_initial_eps_bearer_sync ()

+
MMBearer *
+mm_modem_3gpp_get_initial_eps_bearer_sync
+                               (MMModem3gpp *self,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously gets the initial EPS MMBearer object exposed by this MMModem3gpp.

+

The calling thread is blocked until a reply is received. See mm_modem_3gpp_get_initial_eps_bearer() +for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

a MMBearer or NULL if error +is set. The returned value should be freed with g_object_unref().

+

[transfer full]

+
+
+
+
+

mm_modem_3gpp_get_initial_eps_bearer_settings ()

+
MMBearerProperties *
+mm_modem_3gpp_get_initial_eps_bearer_settings
+                               (MMModem3gpp *self);
+

Gets a MMBearerProperties object specifying the settings configured in +the device to use when attaching to the LTE network.

+
The values reported by self are not updated when the values in the +interface change. Instead, the client is expected to call +mm_modem_3gpp_get_initial_eps_bearer_settings() again to get a new MMBearerProperties with the +new values.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+
+

Returns

+

A MMBearerProperties that must be freed with g_object_unref() or NULL if unknown.

+

[transfer full]

+
+
+
+
+

mm_modem_3gpp_peek_initial_eps_bearer_settings ()

+
MMBearerProperties *
+mm_modem_3gpp_peek_initial_eps_bearer_settings
+                               (MMModem3gpp *self);
+

Gets a MMBearerProperties object specifying the settings configured in +the device to use when attaching to the LTE network.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_modem_3gpp_get_initial_eps_bearer_settings() if on another +thread.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModem3gpp.

 
+
+
+

Returns

+

A MMBearerProperties. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+
+
+

mm_modem_3gpp_register ()

void
 mm_modem_3gpp_register (MMModem3gpp *self,
@@ -783,7 +1231,7 @@
 
 
 

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -874,7 +1322,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -920,7 +1368,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -975,7 +1423,7 @@

Returns

-

a list of MMModem3gppNetwork structs, or NULL if error +

a list of MMModem3gppNetwork structs, or NULL if error is set. The returned value should be freed with g_list_free_full() using mm_modem_3gpp_network_free() as GDestroyNotify function.

[transfer full][element-type ModemManager.Modem3gppNetwork]

@@ -1006,7 +1454,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1019,11 +1467,307 @@

Returns

-

a list of MMModem3gppNetwork structs, or NULL if error +

a list of MMModem3gppNetwork structs, or NULL if error is set. The returned value should be freed with g_list_free_full() using mm_modem_3gpp_network_free() as GDestroyNotify function.

[transfer full][element-type ModemManager.Modem3gppNetwork]

+
+
+

mm_modem_3gpp_set_eps_ue_mode_operation ()

+
void
+mm_modem_3gpp_set_eps_ue_mode_operation
+                               (MMModem3gpp *self,
+                                MMModem3gppEpsUeModeOperation mode,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously requests to update the EPS UE mode of operation.

+

When the operation is finished, callback + will be invoked in the

+thread-default main loop

of the thread you are calling this method from. You can then call +mm_modem_3gpp_set_eps_ue_mode_operation_finish() to get the result of the operation.

+

See mm_modem_3gpp_set_eps_ue_mode_operation_sync() for the synchronous, blocking +version of this method. The calling thread is blocked until a reply is received.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

mode

A MMModem3gppEpsUeModeOperation.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_modem_3gpp_set_eps_ue_mode_operation_finish ()

+
gboolean
+mm_modem_3gpp_set_eps_ue_mode_operation_finish
+                               (MMModem3gpp *self,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_modem_3gpp_set_eps_ue_mode_operation().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_modem_3gpp_set_eps_ue_mode_operation().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation was successful, FALSE if error +is set.

+
+
+
+
+

mm_modem_3gpp_set_eps_ue_mode_operation_sync ()

+
gboolean
+mm_modem_3gpp_set_eps_ue_mode_operation_sync
+                               (MMModem3gpp *self,
+                                MMModem3gppEpsUeModeOperation mode,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously requests to update the EPS UE mode of operation.

+

The calling thread is blocked until a reply is received. +See mm_modem_3gpp_set_eps_ue_mode_operation() for the asynchronous version +of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

mode

A MMModem3gppEpsUeModeOperation.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation was successful, FALSE if error +is set.

+
+
+
+
+

mm_modem_3gpp_set_initial_eps_bearer_settings ()

+
void
+mm_modem_3gpp_set_initial_eps_bearer_settings
+                               (MMModem3gpp *self,
+                                MMBearerProperties *config,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Asynchronously configures the settings for the initial LTE default bearer.

+

When the operation is finished, callback + will be invoked in the

+thread-default main loop

of the thread you are calling this method from. You can then call +mm_modem_3gpp_set_initial_eps_bearer_settings_finish() to get the result of the operation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

config

A MMBearerProperties object with the properties to use.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_modem_3gpp_set_initial_eps_bearer_settings_finish ()

+
gboolean
+mm_modem_3gpp_set_initial_eps_bearer_settings_finish
+                               (MMModem3gpp *self,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_modem_3gpp_set_initial_eps_bearer_settings().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_modem_3gpp_set_initial_eps_bearer_settings().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation was successful, FALSE if error +is set.

+
+
+
+
+

mm_modem_3gpp_set_initial_eps_bearer_settings_sync ()

+
gboolean
+mm_modem_3gpp_set_initial_eps_bearer_settings_sync
+                               (MMModem3gpp *self,
+                                MMBearerProperties *config,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously configures the settings for the initial LTE default bearer.

+

The calling thread is blocked until a reply is received. See +mm_modem_3gpp_set_initial_eps_bearer_settings() for the asynchronous +version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModem3gpp.

 

config

A MMBearerProperties object with the properties to use.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the operation was successful, FALSE if error +is set.

+
+

Types and Values

@@ -1043,6 +1787,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem3gppUssd.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem3gppUssd.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem3gppUssd.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem3gppUssd.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModem3gppUssd: libmm-glib Reference Manual - + - + @@ -226,7 +226,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -253,7 +253,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -311,7 +311,7 @@

Returns

-

The network request, or NULL if none available.

+

The network request, or NULL if none available.

[transfer none]

@@ -339,7 +339,7 @@

Returns

-

The network request, or NULL if none available. The returned value should be freed with g_free().

+

The network request, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -371,7 +371,7 @@

Returns

-

The network notification, or NULL if none available.

+

The network notification, or NULL if none available.

[transfer none]

@@ -399,7 +399,7 @@

Returns

-

The network notification, or NULL if none available. The returned value should be freed with g_free().

+

The network notification, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -441,7 +441,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -534,7 +534,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -587,7 +587,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -679,7 +679,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -724,7 +724,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -809,7 +809,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -838,6 +838,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemCdma.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemCdma.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemCdma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemCdma.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemCdma: libmm-glib Reference Manual - + - + @@ -245,7 +245,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -272,7 +272,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -305,7 +305,7 @@

Returns

-

The ESN, or NULL if none available.

+

The ESN, or NULL if none available.

[transfer none]

@@ -334,7 +334,7 @@

Returns

-

The ESN, or NULL if none available. The returned value should be freed with g_free().

+

The ESN, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -366,7 +366,7 @@

Returns

-

The MEID, or NULL if none available.

+

The MEID, or NULL if none available.

[transfer none]

@@ -394,7 +394,7 @@

Returns

-

The MEID, or NULL if none available. The returned value should be freed with g_free().

+

The MEID, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -570,7 +570,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -662,7 +662,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -714,7 +714,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -805,7 +805,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -848,6 +848,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemFirmware.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemFirmware.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemFirmware.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemFirmware.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemFirmware: libmm-glib Reference Manual - + - + @@ -104,6 +104,22 @@ mm_modem_firmware_select_sync () + + +MMFirmwareUpdateSettings * + + +mm_modem_firmware_get_update_settings () + + + + +MMFirmwareUpdateSettings * + + +mm_modem_firmware_peek_update_settings () + + @@ -164,7 +180,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -191,7 +207,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -224,7 +240,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -268,12 +284,12 @@

selected

-

The selected firmware slot, or NULL if no slot is selected (such as if all slots are empty, or no slots exist). The returned value should be freed with g_object_unref().

+

The selected firmware slot, or NULL if no slot is selected (such as if all slots are empty, or no slots exist). The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

installed

-

A list of MMFirmwareProperties objects specifying the installed images. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify.

+

A list of MMFirmwareProperties objects specifying the installed images. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify.

[out][allow-none][transfer full][element-type ModemManager.FirmwareProperties] @@ -323,17 +339,17 @@

selected

-

The selected firmware slot, or NULL if no slot is selected (such as if all slots are empty, or no slots exist). The returned value should be freed with g_object_unref().

+

The selected firmware slot, or NULL if no slot is selected (such as if all slots are empty, or no slots exist). The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

installed

-

A list of MMFirmwareProperties objects specifying the installed images. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify.

+

A list of MMFirmwareProperties objects specifying the installed images. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify.

[out][allow-none][transfer full][element-type ModemManager.FirmwareProperties]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -387,7 +403,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -480,7 +496,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -497,6 +513,72 @@ is set.

+
+
+

mm_modem_firmware_get_update_settings ()

+
MMFirmwareUpdateSettings *
+mm_modem_firmware_get_update_settings (MMModemFirmware *self);
+

Gets a MMFirmwareUpdateSettings object specifying the expected update +settings.

+
The values reported by self are not updated when the values in the +interface change. Instead, the client is expected to call +mm_modem_firmware_get_update_settings() again to get a new MMFirmwareUpdateSettings +with the new values.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModemFirmware.

 
+
+
+

Returns

+

A MMFirmwareUpdateSettings that must be freed with g_object_unref() or NULL if unknown.

+

[transfer full]

+
+
+
+
+

mm_modem_firmware_peek_update_settings ()

+
MMFirmwareUpdateSettings *
+mm_modem_firmware_peek_update_settings
+                               (MMModemFirmware *self);
+

Gets a MMFirmwareUpdateSettings object specifying the expected update +settings.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_modem_firmware_get_update_settings() if on +another thread.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModemFirmware.

 
+
+
+

Returns

+

A MMFirmwareUpdateSettings. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+

Types and Values

@@ -509,6 +591,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModem.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModem.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModem: libmm-glib Reference Manual - + - + @@ -150,6 +150,21 @@ +const gchar * + + +mm_modem_get_hardware_revision () + + + + +gchar * + + +mm_modem_dup_hardware_revision () + + + const gchar * const * @@ -812,7 +827,7 @@

Returns

-

The DBus path of the MMObject object. Do not free the returned value, it belongs to self +

The DBus path of the MMObject object. Do not free the returned value, it belongs to self .

[transfer none]

@@ -840,7 +855,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -946,13 +961,13 @@

capabilities

-

Return location for the array of MMModemCapability values. Do not free the returned array, it is owned by self +

Return location for the array of MMModemCapability values. Do not free the returned array, it is owned by self .

[out][array length=n_capabilities]

n_capabilities

-

Return location for the number of values in capabilities +

Return location for the number of values in capabilities .

[out] @@ -990,12 +1005,12 @@

capabilities

-

Return location for the array of MMModemCapability values. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMModemCapability values. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_capabilities]

n_capabilities

-

Return location for the number of values in capabilities +

Return location for the number of values in capabilities .

[out] @@ -1063,7 +1078,7 @@

Returns

-

The equipment manufacturer, or NULL if none available. Do not free the returned value, it belongs to self +

The equipment manufacturer, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1091,7 +1106,7 @@

Returns

-

The equipment manufacturer, or NULL if none available. The returned value should be freed with g_free().

+

The equipment manufacturer, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1122,7 +1137,7 @@

Returns

-

The equipment model, or NULL if none available. Do not free the returned value, it belongs to self +

The equipment model, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1150,7 +1165,7 @@

Returns

-

The equipment model, or NULL if none available. The returned value should be freed with g_free().

+

The equipment model, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1181,7 +1196,7 @@

Returns

-

The equipment revision, or NULL if none available. Do not free the returned value, it belongs to self +

The equipment revision, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1209,7 +1224,66 @@

Returns

-

The equipment revision, or NULL if none available. The returned value should be freed with g_free().

+

The equipment revision, or NULL if none available. The returned value should be freed with g_free().

+

[transfer full]

+
+ +
+
+

mm_modem_get_hardware_revision ()

+
const gchar *
+mm_modem_get_hardware_revision (MMModem *self);
+

Gets the equipment hardware revision, as reported by this MMModem.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_modem_dup_hardware_revision() if on another +thread.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModem.

 
+
+
+

Returns

+

The equipment hardware revision, or NULL if none available. Do not free the returned value, it belongs to self +.

+

[transfer none]

+
+
+
+
+

mm_modem_dup_hardware_revision ()

+
gchar *
+mm_modem_dup_hardware_revision (MMModem *self);
+

Gets a copy of the equipment hardware revision, as reported by this MMModem.

+
+

Parameters

+
+++++ + + + + + +

self

A MMModem.

 
+
+
+

Returns

+

The equipment hardware revision, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1241,7 +1315,7 @@

Returns

-

The drivers, or NULL if none available. Do not free the returned value, it belongs to self +

The drivers, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1270,7 +1344,7 @@

Returns

-

The drivers, or NULL if none available. The returned value should be freed with g_strfreev().

+

The drivers, or NULL if none available. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1301,7 +1375,7 @@

Returns

-

The name of the plugin, or NULL if none available. Do not free the returned value, it belongs to self +

The name of the plugin, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1329,7 +1403,7 @@

Returns

-

The name of the plugin, or NULL if none available. The returned value should be freed with g_free().

+

The name of the plugin, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1360,7 +1434,7 @@

Returns

-

The name of the primary port. Do not free the returned value, it belongs to self +

The name of the primary port. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1388,7 +1462,7 @@

Returns

-

The name of the primary port. The returned value should be freed with g_free().

+

The name of the primary port. The returned value should be freed with g_free().

[transfer full]

@@ -1416,13 +1490,13 @@

ports

-

Return location for the array of MMModemPortInfo values. Do not free the returned value, it is owned by self +

Return location for the array of MMModemPortInfo values. Do not free the returned value, it is owned by self .

[out][array length=n_ports][transfer none]

n_ports

-

Return location for the number of values in ports +

Return location for the number of values in ports .

[out] @@ -1460,12 +1534,12 @@

ports

-

Return location for the array of MMModemPortInfo values. The returned array should be freed with mm_modem_port_info_array_free() when no longer needed.

+

Return location for the array of MMModemPortInfo values. The returned array should be freed with mm_modem_port_info_array_free() when no longer needed.

[out][array length=n_ports]

n_ports

-

Return location for the number of values in ports +

Return location for the number of values in ports .

[out] @@ -1507,7 +1581,7 @@

Returns

-

The device, or NULL if none available. Do not free the returned value, it belongs to self +

The device, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1536,7 +1610,7 @@

Returns

-

The device, or NULL if none available. The returned value should be freed with g_free().

+

The device, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1550,7 +1624,7 @@ for CDMA devices.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where -self was constructed. Use mm_modem_dup_plugin() if on another +self was constructed. Use mm_modem_dup_equipment_identifier() if on another thread.

Parameters

@@ -1569,7 +1643,7 @@

Returns

-

The equipment identifier, or NULL if none available. Do not free the returned value, it belongs to self +

The equipment identifier, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1599,7 +1673,7 @@

Returns

-

The equipment identifier, or NULL if none available. The returned value should be freed with g_free().

+

The equipment identifier, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1637,7 +1711,7 @@

Returns

-

The device identifier, or NULL if none available. Do not free the returned value, it belongs to self +

The device identifier, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1672,7 +1746,7 @@

Returns

-

The device identifier, or NULL if none available. The returned value should be freed with g_free().

+

The device identifier, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -1732,7 +1806,7 @@

Returns

-

A MMUnlockRetries. Do not free the returned value, it belongs to self +

A MMUnlockRetries. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1767,7 +1841,7 @@

Returns

-

A MMUnlockRetries that must be freed with g_object_unref() or NULL if unknown.

+

A MMUnlockRetries that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -1859,7 +1933,7 @@

Returns

-

The DBus paths of the MMBearer handled in this MMModem, or NULL if none available. Do not free the returned value, it belongs to self +

The DBus paths of the MMBearer handled in this MMModem, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1887,7 +1961,7 @@

Returns

-

The DBus paths of the MMBearer handled in this MMModem, or NULL if none available. The returned value should be freed with g_strfreev().

+

The DBus paths of the MMBearer handled in this MMModem, or NULL if none available. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1920,7 +1994,7 @@

Returns

-

The list of own numbers or NULL if none available. Do not free the returned value, it belongs to self +

The list of own numbers or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -1949,7 +2023,7 @@

Returns

-

The list of own numbers or NULL if none is available. The returned value should be freed with g_strfreev().

+

The list of own numbers or NULL if none is available. The returned value should be freed with g_strfreev().

[transfer full]

@@ -1977,13 +2051,13 @@

modes

-

Return location for the array of MMModemModeCombination values. Do not free the returned array, it is owned by self +

Return location for the array of MMModemModeCombination values. Do not free the returned array, it is owned by self .

[out][array length=n_modes]

n_modes

-

Return location for the number of values in modes +

Return location for the number of values in modes .

[out] @@ -2021,12 +2095,12 @@

modes

-

Return location for the array of MMModemModeCombination structs. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMModemModeCombination structs. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_modes]

n_modes

-

Return location for the number of values in modes +

Return location for the number of values in modes .

[out] @@ -2066,12 +2140,12 @@

allowed

-

Return location for a bitmask of MMModemMode values.

+

Return location for a bitmask of MMModemMode values.

[out]

preferred

-

Return location for a MMModemMode value.

+

Return location for a MMModemMode value.

[out] @@ -2110,13 +2184,13 @@

bands

-

Return location for the array of MMModemBand values. Do not free the returned array, it is owned by self +

Return location for the array of MMModemBand values. Do not free the returned array, it is owned by self .

[out][array length=n_bands]

n_bands

-

Return location for the number of values in bands +

Return location for the number of values in bands .

[out] @@ -2156,12 +2230,12 @@

bands

-

Return location for the array of MMModemBand values. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMModemBand values. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_bands]

n_bands

-

Return location for the number of values in bands +

Return location for the number of values in bands .

[out] @@ -2201,13 +2275,13 @@

bands

-

Return location for the array of MMModemBand values. Do not free the returned value, it is owned by self +

Return location for the array of MMModemBand values. Do not free the returned value, it is owned by self .

[out][array length=n_bands]

n_bands

-

Return location for the number of values in bands +

Return location for the number of values in bands .

[out] @@ -2247,12 +2321,12 @@

bands

-

Return location for the array of MMModemBand values. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMModemBand values. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_bands]

n_bands

-

Return location for the number of values in bands +

Return location for the number of values in bands .

[out] @@ -2317,7 +2391,7 @@

recent

-

Return location for the flag specifying if the signal quality value was recent or not.

+

Return location for the flag specifying if the signal quality value was recent or not.

[out] @@ -2383,7 +2457,7 @@

Returns

-

The DBus path of the MMSim handled in this MMModem, or NULL if none available. Do not free the returned value, it belongs to self +

The DBus path of the MMSim handled in this MMModem, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]

@@ -2411,7 +2485,7 @@

Returns

-

The DBus path of the MMSim handled in this MMModem, or NULL if none available. The returned value should be freed with g_free().

+

The DBus path of the MMSim handled in this MMModem, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -2423,7 +2497,7 @@ GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -

Synchronously gets the MMSim object managed by this MMModem.

+

Asynchronously gets the MMSim object managed by this MMModem.

When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from. You can then call mm_modem_get_sim_finish() to get the result of the operation.

@@ -2444,7 +2518,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2499,7 +2573,7 @@

Returns

-

a MMSim or NULL if error +

a MMSim or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -2530,7 +2604,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2543,7 +2617,7 @@

Returns

-

a MMSim or NULL if error +

a MMSim or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -2579,7 +2653,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2666,7 +2740,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2713,7 +2787,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2799,7 +2873,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2852,7 +2926,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -2944,7 +3018,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3004,7 +3078,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3103,7 +3177,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3163,7 +3237,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3262,7 +3336,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3314,7 +3388,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3407,7 +3481,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3454,7 +3528,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3540,7 +3614,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3593,7 +3667,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3685,7 +3759,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3731,7 +3805,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3786,9 +3860,9 @@

Returns

-

The list of MMBearer objects, or NULL if either none found or if error +

The list of MMBearer objects, or NULL if either none found or if error is set.

-

[transfer full][element-type ModemManager.Modem]

+

[transfer full][element-type ModemManager.Bearer]


@@ -3817,7 +3891,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3830,9 +3904,9 @@

Returns

-

The list of MMBearer objects, or NULL if either none found or if error +

The list of MMBearer objects, or NULL if either none found or if error is set.

-

[transfer full][element-type ModemManager.Modem]

+

[transfer full][element-type ModemManager.Bearer]


@@ -3874,7 +3948,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3929,7 +4003,7 @@

Returns

-

A newly created MMBearer, or NULL if error +

A newly created MMBearer, or NULL if error is set.

[transfer full]

@@ -3970,7 +4044,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -3983,7 +4057,7 @@

Returns

-

A newly created MMBearer, or NULL if error +

A newly created MMBearer, or NULL if error is set.

[transfer full]

@@ -4023,7 +4097,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -4114,7 +4188,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -4172,7 +4246,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -4227,7 +4301,7 @@

Returns

-

A newly allocated string with the reply to the command, or NULL if error +

A newly allocated string with the reply to the command, or NULL if error is set. The returned value should be freed with g_free().

[transfer full]

@@ -4270,7 +4344,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -4283,7 +4357,7 @@

Returns

-

A newly allocated string with the reply to the command, or NULL if error +

A newly allocated string with the reply to the command, or NULL if error is set. The returned value should be freed with g_free().

[transfer full]

@@ -4395,6 +4469,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemLocation.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemLocation.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemLocation.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemLocation.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemLocation: libmm-glib Reference Manual - + - + @@ -74,6 +74,14 @@ +guint + + +mm_modem_location_get_gps_refresh_rate () + + + + gboolean @@ -97,10 +105,25 @@ -guint +MMModemLocationAssistanceDataType -mm_modem_location_get_gps_refresh_rate () +mm_modem_location_get_supported_assistance_data () + + + + +gchar ** + + +mm_modem_location_dup_assistance_data_servers () + + + +const gchar ** + + +mm_modem_location_get_assistance_data_servers () @@ -156,6 +179,30 @@ void +mm_modem_location_inject_assistance_data () + + + + +gboolean + + +mm_modem_location_inject_assistance_data_finish () + + + + +gboolean + + +mm_modem_location_inject_assistance_data_sync () + + + + +void + + mm_modem_location_set_gps_refresh_rate () @@ -369,7 +416,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -396,7 +443,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -454,6 +501,33 @@
+

mm_modem_location_get_gps_refresh_rate ()

+
guint
+mm_modem_location_get_gps_refresh_rate
+                               (MMModemLocation *self);
+

Gets the GPS refresh rate, in seconds.

+
+

Parameters

+
+++++ + + + + + +

self

A MMModemLocation.

 
+
+
+

Returns

+

The GPS refresh rate, or 0 if no fixed rate is used.

+
+
+
+

mm_modem_location_signals_location ()

gboolean
 mm_modem_location_signals_location (MMModemLocation *self);
@@ -501,7 +575,7 @@

Returns

-

The SUPL server address, or NULL if none available. The returned value should be freed with g_free().

+

The SUPL server address, or NULL if none available. The returned value should be freed with g_free().

[transfer full]

@@ -532,20 +606,20 @@

Returns

-

The SUPL server address, or NULL if none available. Do not free the returned value, it belongs to self +

The SUPL server address, or NULL if none available. Do not free the returned value, it belongs to self .

[transfer none]


-

mm_modem_location_get_gps_refresh_rate ()

-
guint
-mm_modem_location_get_gps_refresh_rate
+

mm_modem_location_get_supported_assistance_data ()

+
MMModemLocationAssistanceDataType
+mm_modem_location_get_supported_assistance_data
                                (MMModemLocation *self);
-

Gets the GPS refresh rate, in seconds.

+

Gets a bitmask of the supported assistance data types.

-

Parameters

+

Parameters

@@ -560,8 +634,69 @@
-

Returns

-

The GPS refresh rate, or 0 if no fixed rate is used.

+

Returns

+

A MMModemLocationAssistanceDataType.

+
+
+
+
+

mm_modem_location_dup_assistance_data_servers ()

+
gchar **
+mm_modem_location_dup_assistance_data_servers
+                               (MMModemLocation *self);
+

Gets the list of assistance data servers.

+
+

Parameters

+
+++++ + + + + + +

self

A MMModemLocation.

 
+
+
+

Returns

+

a NULL-terminated array of server addresses, or NULL if none available. The returned value should be freed with g_strfreev().

+

[transfer full]

+
+
+
+
+

mm_modem_location_get_assistance_data_servers ()

+
const gchar **
+mm_modem_location_get_assistance_data_servers
+                               (MMModemLocation *self);
+

Gets the list of assistance data servers.

+
The returned value is only valid until the property changes so +it is only safe to use this function on the thread where +self was constructed. Use mm_modem_location_dup_assistance_data_servers() if on another +thread.
+
+

Parameters

+
+++++ + + + + + +

self

A MMModemLocation.

 
+
+
+

Returns

+

a NULL-terminated array of server addresses, or NULL if none available. Do not free the returned value, it belongs to self +.

+

[transfer none]


@@ -606,7 +741,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -704,7 +839,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -756,7 +891,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -849,7 +984,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -868,6 +1003,166 @@
+

mm_modem_location_inject_assistance_data ()

+
void
+mm_modem_location_inject_assistance_data
+                               (MMModemLocation *self,
+                                const guint8 *data,
+                                gsize data_size,
+                                GCancellable *cancellable,
+                                GAsyncReadyCallback callback,
+                                gpointer user_data);
+

Aynchronously injects assistance data to the GNSS module.

+

When the operation is finished, callback + will be invoked in the thread-default main loop of the thread you are calling this method from. +You can then call mm_modem_location_inject_assistance_data_finish() to get the result of the operation.

+

See mm_modem_location_inject_assistance_data_sync() for the synchronous, blocking version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModemLocation.

 

data

Data to inject.

[array length=data_size]

data_size

size of data +.

 

cancellable

A GCancellable or NULL.

[allow-none]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback +.

 
+
+
+
+
+

mm_modem_location_inject_assistance_data_finish ()

+
gboolean
+mm_modem_location_inject_assistance_data_finish
+                               (MMModemLocation *self,
+                                GAsyncResult *res,
+                                GError **error);
+

Finishes an operation started with mm_modem_location_inject_assistance_data().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

A MMModemLocation.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to mm_modem_location_inject_assistance_data().

 

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the injection was successful, FALSE if error +is set.

+
+
+
+
+

mm_modem_location_inject_assistance_data_sync ()

+
gboolean
+mm_modem_location_inject_assistance_data_sync
+                               (MMModemLocation *self,
+                                const guint8 *data,
+                                gsize data_size,
+                                GCancellable *cancellable,
+                                GError **error);
+

Synchronously injects assistance data to the GNSS module.

+

The calling thread is blocked until a reply is received. See mm_modem_location_inject_assistance_data() +for the asynchronous version of this method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

A MMModemLocation.

 

data

Data to inject.

[array length=data_size]

data_size

size of data +.

 

cancellable

A GCancellable or NULL.

[allow-none]

error

Return location for error or NULL.

 
+
+
+

Returns

+

TRUE if the injection was successful, FALSE if error +is set.

+
+
+
+

mm_modem_location_set_gps_refresh_rate ()

void
 mm_modem_location_set_gps_refresh_rate
@@ -903,7 +1198,7 @@
 
 
 

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -997,7 +1292,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1043,7 +1338,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1098,7 +1393,7 @@

Returns

-

A MMLocation3gpp, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocation3gpp, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1128,7 +1423,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1141,7 +1436,7 @@

Returns

-

A MMLocation3gpp, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocation3gpp, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1174,7 +1469,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1229,7 +1524,7 @@

Returns

-

A MMLocationGpsNmea, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationGpsNmea, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1259,7 +1554,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1272,7 +1567,7 @@

Returns

-

A MMLocationGpsNmea, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationGpsNmea, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1305,7 +1600,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1360,7 +1655,7 @@

Returns

-

A MMLocationGpsRaw, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationGpsRaw, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1390,7 +1685,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1403,7 +1698,7 @@

Returns

-

A MMLocationGpsRaw, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationGpsRaw, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1436,7 +1731,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1491,7 +1786,7 @@

Returns

-

A MMLocationCdmaBs, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationCdmaBs, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1521,7 +1816,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1534,7 +1829,7 @@

Returns

-

A MMLocationCdmaBs, or NULL if not available. The returned value should be freed with g_object_unref().

+

A MMLocationCdmaBs, or NULL if not available. The returned value should be freed with g_object_unref().

[transfer full]

@@ -1567,7 +1862,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1613,22 +1908,22 @@

location_3gpp

-

Return location for a MMLocation3gpp if 3GPP location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocation3gpp if 3GPP location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_gps_nmea

-

Return location for a MMLocationGpsNmea if GPS NMEA location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationGpsNmea if GPS NMEA location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_gps_raw

-

Return location for a MMLocationGpsRaw if GPS raw location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationGpsRaw if GPS raw location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_cdma_bs

-

Return location for a MMLocationCdmaBs if CDMA Base Station location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationCdmaBs if CDMA Base Station location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full] @@ -1680,27 +1975,27 @@

location_3gpp

-

Return location for a MMLocation3gpp if 3GPP location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocation3gpp if 3GPP location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_gps_nmea

-

Return location for a MMLocationGpsNmea if GPS NMEA location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationGpsNmea if GPS NMEA location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_gps_raw

-

Return location for a MMLocationGpsRaw if GPS raw location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationGpsRaw if GPS raw location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

location_cdma_bs

-

Return location for a MMLocationCdmaBs if CDMA Base Station location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

+

Return location for a MMLocationCdmaBs if CDMA Base Station location is requested, or NULL if not required. The returned value should be freed with g_object_unref().

[out][allow-none][transfer full]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1752,6 +2047,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemMessaging.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemMessaging.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemMessaging.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemMessaging.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemMessaging: libmm-glib Reference Manual - + - + @@ -212,7 +212,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -239,7 +239,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -268,13 +268,13 @@

storages

-

Return location for the array of MMSmsStorage values. Do not free the returned array, it is owned by self +

Return location for the array of MMSmsStorage values. Do not free the returned array, it is owned by self .

[out]

n_storages

-

Return location for the number of values in storages +

Return location for the number of values in storages .

[out] @@ -313,12 +313,12 @@

storages

-

Return location for the array of MMSmsStorage values. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMSmsStorage values. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_storages]

n_storages

-

Return location for the number of values in storages +

Return location for the number of values in storages .

[out] @@ -394,7 +394,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -449,7 +449,7 @@

Returns

-

A newly created MMSms, or NULL if error +

A newly created MMSms, or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -486,7 +486,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -499,7 +499,7 @@

Returns

-

A newly created MMSms, or NULL if error +

A newly created MMSms, or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -539,7 +539,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -630,7 +630,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -676,7 +676,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -731,7 +731,7 @@

Returns

-

A list of MMSms objects, or NULL if either not found or error +

A list of MMSms objects, or NULL if either not found or error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify function.

[element-type ModemManager.Sms][transfer full]

@@ -762,7 +762,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -775,9 +775,9 @@

Returns

-

A list of MMSms objects, or NULL if either not found or error +

A list of MMSms objects, or NULL if either not found or error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify function.

-

[element-type MMSms][transfer full]

+

[element-type ModemManager.Sms][transfer full]

@@ -792,6 +792,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemOma.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemOma.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemOma.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemOma.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemOma: libmm-glib Reference Manual - + - + @@ -258,7 +258,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -285,7 +285,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -324,7 +324,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -415,7 +415,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -468,7 +468,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -561,7 +561,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -620,7 +620,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -719,7 +719,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -765,7 +765,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -850,7 +850,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -970,13 +970,13 @@

sessions

-

Return location for the array of MMOmaPendingNetworkInitiatedSession values. Do not free the returned array, it is owned by self +

Return location for the array of MMOmaPendingNetworkInitiatedSession values. Do not free the returned array, it is owned by self .

[out][array length=n_sessions]

n_sessions

-

Return location for the number of values in sessions +

Return location for the number of values in sessions .

[out] @@ -1015,12 +1015,12 @@

sessions

-

Return location for the array of MMOmaPendingNetworkInitiatedSession structs. The returned array should be freed with g_free() when no longer needed.

+

Return location for the array of MMOmaPendingNetworkInitiatedSession structs. The returned array should be freed with g_free() when no longer needed.

[out][array length=n_sessions]

n_sessions

-

Return location for the number of values in sessions +

Return location for the number of values in sessions .

[out] @@ -1079,6 +1079,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemSignal.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemSignal.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemSignal.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemSignal.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemSignal: libmm-glib Reference Manual - + - + @@ -229,7 +229,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -256,7 +256,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -313,7 +313,7 @@

Returns

-

A MMSignal. Do not free the returned value, it belongs to self +

A MMSignal. Do not free the returned value, it belongs to self .

[transfer none]

@@ -345,7 +345,7 @@

Returns

-

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

+

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -376,7 +376,7 @@

Returns

-

A MMSignal. Do not free the returned value, it belongs to self +

A MMSignal. Do not free the returned value, it belongs to self .

[transfer none]

@@ -408,7 +408,7 @@

Returns

-

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

+

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -439,7 +439,7 @@

Returns

-

A MMSignal. Do not free the returned value, it belongs to self +

A MMSignal. Do not free the returned value, it belongs to self .

[transfer none]

@@ -471,7 +471,7 @@

Returns

-

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

+

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -502,7 +502,7 @@

Returns

-

A MMSignal. Do not free the returned value, it belongs to self +

A MMSignal. Do not free the returned value, it belongs to self .

[transfer none]

@@ -534,7 +534,7 @@

Returns

-

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

+

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -565,7 +565,7 @@

Returns

-

A MMSignal. Do not free the returned value, it belongs to self +

A MMSignal. Do not free the returned value, it belongs to self .

[transfer none]

@@ -597,7 +597,7 @@

Returns

-

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

+

A MMSignal that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -636,7 +636,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -727,7 +727,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -756,6 +756,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemSimple.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemSimple.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemSimple.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemSimple.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemSimple: libmm-glib Reference Manual - + - + @@ -188,7 +188,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -215,7 +215,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -250,12 +250,12 @@

properties

-

A MMSimpleConnectProperties bundle.

+

A MMSimpleConnectProperties bundle.

[transfer none]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -310,7 +310,7 @@

Returns

-

A MMBearer, or FALSE if error +

A MMBearer, or FALSE if error is set. The returned value must be freed with g_object_ref().

[transfer full]

@@ -343,12 +343,12 @@

properties

-

A MMSimpleConnectProperties bundle.

+

A MMSimpleConnectProperties bundle.

[transfer none]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -361,7 +361,7 @@

Returns

-

A MMBearer, or FALSE if error +

A MMBearer, or FALSE if error is set. The returned value must be freed with g_object_ref().

[transfer full]

@@ -396,12 +396,12 @@

bearer

-

Path of the bearer to disconnect, or NULL to disconnect all connected bearers.

+

Path of the bearer to disconnect, or NULL to disconnect all connected bearers.

[allow-none]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -487,12 +487,12 @@

bearer

-

Path of the bearer to disconnect, or NULL to disconnect all connected bearers.

+

Path of the bearer to disconnect, or NULL to disconnect all connected bearers.

[allow-none]

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -538,7 +538,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -593,7 +593,7 @@

Returns

-

A MMSimpleStatus, or FALSE if error +

A MMSimpleStatus, or FALSE if error is set. The returned value must be freed with g_object_ref().

[transfer full]

@@ -624,7 +624,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -637,7 +637,7 @@

Returns

-

A MMSimpleStatus, or FALSE if error +

A MMSimpleStatus, or FALSE if error is set. The returned value must be freed with g_object_ref().

[transfer full]

@@ -654,6 +654,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemTime.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemTime.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemTime.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemTime.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemTime: libmm-glib Reference Manual - + - + @@ -156,7 +156,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -183,7 +183,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -214,7 +214,7 @@

Returns

-

A MMNetworkTimezone. Do not free the returned value, it belongs to self +

A MMNetworkTimezone. Do not free the returned value, it belongs to self .

[transfer none]

@@ -246,7 +246,7 @@

Returns

-

A MMNetworkTimezone that must be freed with g_object_unref() or NULL if unknown.

+

A MMNetworkTimezone that must be freed with g_object_unref() or NULL if unknown.

[transfer full]

@@ -279,7 +279,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -334,7 +334,7 @@

Returns

-

A string containing the network time, or NULL if error +

A string containing the network time, or NULL if error is set. The returned value should be freed with g_free().

[transfer full]

@@ -365,7 +365,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -378,7 +378,7 @@

Returns

-

A string containing the network time, or NULL if error +

A string containing the network time, or NULL if error is set. The returned value should be freed with g_free().

[transfer full]

@@ -395,6 +395,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemVoice.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemVoice.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMModemVoice.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMModemVoice.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMModemVoice: libmm-glib Reference Manual - + - - + + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
@@ -188,7 +188,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -215,7 +215,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -254,7 +254,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -309,7 +309,7 @@

Returns

-

A newly created MMCall, or NULL if error +

A newly created MMCall, or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -346,7 +346,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -359,7 +359,7 @@

Returns

-

A newly created MMCall, or NULL if error +

A newly created MMCall, or NULL if error is set. The returned value should be freed with g_object_unref().

[transfer full]

@@ -399,7 +399,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -490,7 +490,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -536,7 +536,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -591,7 +591,7 @@

Returns

-

A list of MMCall objects, or NULL if either not found or error +

A list of MMCall objects, or NULL if either not found or error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify function.

[element-type ModemManager.Call][transfer full]

@@ -622,7 +622,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -635,9 +635,9 @@

Returns

-

A list of MMCall objects, or NULL if either not found or error +

A list of MMCall objects, or NULL if either not found or error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as GDestroyNotify function.

-

[element-type MMCall][transfer full]

+

[element-type ModemManager.Call][transfer full]

@@ -652,6 +652,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMNetworkTimezone.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMNetworkTimezone.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMNetworkTimezone.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMNetworkTimezone.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMNetworkTimezone: libmm-glib Reference Manual - + - + @@ -209,6 +209,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMObject.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMObject.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMObject.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMObject.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMObject: libmm-glib Reference Manual - + - + @@ -310,7 +310,7 @@

Returns

-

The DBus path of the MMObject object.

+

The DBus path of the MMObject object.

[transfer none]

@@ -337,7 +337,7 @@

Returns

-

The DBus path of the MMObject. The returned value should be freed with g_free().

+

The DBus path of the MMObject. The returned value should be freed with g_free().

[transfer full]

@@ -366,7 +366,7 @@

Returns

-

A MMModem or NULL if self +

A MMModem or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -396,7 +396,7 @@

Returns

-

A MMModem that must be freed with g_object_unref() or NULL if self +

A MMModem that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -426,7 +426,7 @@

Returns

-

A MMModem3gpp or NULL if self +

A MMModem3gpp or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -456,7 +456,7 @@

Returns

-

A MMModem3gpp that must be freed with g_object_unref() or NULL if self +

A MMModem3gpp that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -486,7 +486,7 @@

Returns

-

A MMModem3gppUssd or NULL if self +

A MMModem3gppUssd or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -516,7 +516,7 @@

Returns

-

A MMModem3gppUssd that must be freed with g_object_unref() or NULL if self +

A MMModem3gppUssd that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -546,7 +546,7 @@

Returns

-

A MMModemCdma or NULL if self +

A MMModemCdma or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -576,7 +576,7 @@

Returns

-

A MMModemCdma that must be freed with g_object_unref() or NULL if self +

A MMModemCdma that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -606,7 +606,7 @@

Returns

-

A MMModemLocation or NULL if self +

A MMModemLocation or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -636,7 +636,7 @@

Returns

-

A MMModemLocation that must be freed with g_object_unref() or NULL if self +

A MMModemLocation that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -666,7 +666,7 @@

Returns

-

A MMModemMessaging or NULL if self +

A MMModemMessaging or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -696,7 +696,7 @@

Returns

-

A MMModemMessaging that must be freed with g_object_unref() or NULL if self +

A MMModemMessaging that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -726,7 +726,7 @@

Returns

-

A MMModemTime or NULL if self +

A MMModemTime or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -756,7 +756,7 @@

Returns

-

A MMModemTime that must be freed with g_object_unref() or NULL if self +

A MMModemTime that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -786,7 +786,7 @@

Returns

-

A MMModemFirmware or NULL if self +

A MMModemFirmware or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -816,7 +816,7 @@

Returns

-

A MMModemFirmware that must be freed with g_object_unref() or NULL if self +

A MMModemFirmware that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -846,7 +846,7 @@

Returns

-

A MMModemOma or NULL if self +

A MMModemOma or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -876,7 +876,7 @@

Returns

-

A MMModemOma that must be freed with g_object_unref() or NULL if self +

A MMModemOma that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -906,7 +906,7 @@

Returns

-

A MMModemSimple or NULL if self +

A MMModemSimple or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -936,7 +936,7 @@

Returns

-

A MMModemSimple that must be freed with g_object_unref() or NULL if self +

A MMModemSimple that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -966,7 +966,7 @@

Returns

-

A MMModemSignal or NULL if self +

A MMModemSignal or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -996,7 +996,7 @@

Returns

-

A MMModemSignal that must be freed with g_object_unref() or NULL if self +

A MMModemSignal that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -1026,7 +1026,7 @@

Returns

-

A MMModemVoice or NULL if self +

A MMModemVoice or NULL if self does not implement the interface. Do not free the returned object, it is owned by self .

[transfer none]

@@ -1056,7 +1056,7 @@

Returns

-

A MMModemVoice that must be freed with g_object_unref() or NULL if self +

A MMModemVoice that must be freed with g_object_unref() or NULL if self does not implement the interface.

[transfer full]

@@ -1073,6 +1073,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMPco.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMPco.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMPco.html 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMPco.html 2019-01-17 16:22:35.000000000 +0100 @@ -0,0 +1,272 @@ + + + + +MMPco: libmm-glib Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

MMPco

+

MMPco — Helper object to handle 3GPP PCO.

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+guint32 + +mm_pco_get_session_id () +
+gboolean + +mm_pco_is_complete () +
const guint8 * + +mm_pco_get_data () +
+GList * + +mm_pco_list_add () +
+void + +mm_pco_list_free () +
+
+
+

Types and Values

+
++++ + + + + +
structMMPco
+
+
+

Object Hierarchy

+
    GObject
+    ╰── MMPco
+
+
+
+

Description

+

The MMPco is an object handling the raw 3GPP Protocol Configuration Options +(PCO) that the modem has received from the network.

+

This object is retrieved with mm_modem_3gpp_get_pco().

+
+
+

Functions

+
+

mm_pco_get_session_id ()

+
guint32
+mm_pco_get_session_id (MMPco *self);
+

Gets the session ID associated with the PCO.

+
+

Parameters

+
+++++ + + + + + +

self

a MMPco.

 
+
+
+

Returns

+

the session ID.

+
+
+
+
+

mm_pco_is_complete ()

+
gboolean
+mm_pco_is_complete (MMPco *self);
+

Gets the complete flag that indicates whether the PCO data contains the +complete PCO structure received from the network.

+
+

Parameters

+
+++++ + + + + + +

self

a MMPco.

 
+
+
+

Returns

+

TRUE if the PCO data contains the complete PCO structure, FALSE otherwise.

+
+
+
+
+

mm_pco_get_data ()

+
const guint8 *
+mm_pco_get_data (MMPco *self,
+                 gsize *data_size);
+

Gets the PCO data in raw bytes.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

self

a MMPco.

 

data_size

Size of the PCO data, if any given.

[out]
+
+
+

Returns

+

the PCO data, or NULL if it doesn't contain any.

+

[transfer none]

+
+
+
+
+

mm_pco_list_add ()

+
GList *
+mm_pco_list_add (GList *pco_list,
+                 MMPco *pco);
+

Adds a MMPco to a given PCO list. MMPco objects stored in the order of +their session ID. An existing PCO with the same session ID is overwritten +with the new value.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

pco_list

a GList of MMPco.

[transfer full][element-type ModemManager.Pco]

pco

a MMPco to add to the given list.

[transfer none]
+
+
+

Returns

+

the new start of an updated or newly allocated GList of MMPco.

+

[transfer full][element-type ModemManager.Pco]

+
+
+
+
+

mm_pco_list_free ()

+
void
+mm_pco_list_free (GList *pco_list);
+

Frees all of the memory used by a GList of MMPco.

+
+

Parameters

+
+++++ + + + + + +

pco_list

a GList of MMPco.

[transfer full][element-type ModemManager.Pco]
+
+
+
+
+

Types and Values

+
+

struct MMPco

+
struct MMPco;
+

The MMPco structure contains private data and should only be accessed +using the provided API.

+
+
+
+ + + \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSignal.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSignal.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSignal.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSignal.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSignal: libmm-glib Reference Manual - + - + @@ -195,7 +195,7 @@

mm_signal_get_ecio ()

gdouble
 mm_signal_get_ecio (MMSignal *self);
-

Gets the Ec/Io, in dBm.

+

Gets the Ec/Io, in dB.

Only applicable to CDMA1x, CDMA EV-DO and UMTS (WCDMA).

Parameters

@@ -364,13 +364,13 @@

MM_SIGNAL_UNKNOWN

-
#define MM_SIGNAL_UNKNOWN G_MINDOUBLE
+
#define MM_SIGNAL_UNKNOWN -G_MAXDOUBLE
 

Identifier for an unknown signal value.

+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSim.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSim.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSim.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSim.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSim: libmm-glib Reference Manual - + - + @@ -297,7 +297,7 @@

Returns

-

The DBus path of the MMSim object.

+

The DBus path of the MMSim object.

[transfer none]

@@ -324,7 +324,7 @@

Returns

-

The DBus path of the MMSim object. The returned value should be freed with g_free().

+

The DBus path of the MMSim object. The returned value should be freed with g_free().

[transfer full]

@@ -355,7 +355,7 @@

Returns

-

The unique identifier of the MMSim object, or NULL if it couldn't be retrieved.

+

The unique identifier of the MMSim object, or NULL if it couldn't be retrieved.

[transfer none]

@@ -382,7 +382,7 @@

Returns

-

The unique identifier of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The unique identifier of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -413,7 +413,7 @@

Returns

-

The IMSI of the MMSim object, or NULL if it couldn't be retrieved.

+

The IMSI of the MMSim object, or NULL if it couldn't be retrieved.

[transfer none]

@@ -440,7 +440,7 @@

Returns

-

The IMSI of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The IMSI of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -471,7 +471,7 @@

Returns

-

The Operator Identifier of the MMSim object, or NULL if it couldn't be retrieved.

+

The Operator Identifier of the MMSim object, or NULL if it couldn't be retrieved.

[transfer none]

@@ -498,7 +498,7 @@

Returns

-

The Operator Identifier of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The Operator Identifier of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -529,7 +529,7 @@

Returns

-

The Operator Name of the MMSim object, or NULL if it couldn't be retrieved.

+

The Operator Name of the MMSim object, or NULL if it couldn't be retrieved.

[transfer none]

@@ -556,7 +556,7 @@

Returns

-

The Operator Name of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The Operator Name of the MMSim object, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -595,7 +595,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -650,7 +650,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -686,7 +686,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -699,7 +699,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -744,7 +744,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -799,7 +799,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -841,7 +841,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -854,7 +854,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -893,7 +893,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -948,7 +948,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -984,7 +984,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -997,7 +997,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1036,7 +1036,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1091,7 +1091,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1127,7 +1127,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1140,7 +1140,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1185,7 +1185,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1240,7 +1240,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1282,7 +1282,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1295,7 +1295,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1311,6 +1311,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSimpleConnectProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSimpleConnectProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSimpleConnectProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSimpleConnectProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSimpleConnectProperties: libmm-glib Reference Manual - + - + @@ -224,7 +224,7 @@

Creates a new empty MMSimpleConnectProperties.

Returns

-

a MMSimpleConnectProperties. The returned value should be freed with g_object_unref().

+

a MMSimpleConnectProperties. The returned value should be freed with g_object_unref().

[transfer full]

@@ -251,7 +251,7 @@

Returns

-

the PIN, or NULL if not set. Do not free the returned value, it is owned by self +

the PIN, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -310,7 +310,7 @@

Returns

-

the operator ID, or NULL if not set. Do not free the returned value, it is owned by self +

the operator ID, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -369,7 +369,7 @@

Returns

-

the access point, or NULL if not set. Do not free the returned value, it is owned by self +

the access point, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -485,7 +485,7 @@

Returns

-

the username, or NULL if not set. Do not free the returned value, it is owned by self +

the username, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -544,7 +544,7 @@

Returns

-

the password, or NULL if not set. Do not free the returned value, it is owned by self +

the password, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -703,6 +703,11 @@
const gchar *
 mm_simple_connect_properties_get_number
                                (MMSimpleConnectProperties *self);
+
+

mm_simple_connect_properties_get_number has been deprecated since version 1.10.0. and should not be used in newly-written code.

+

The number setting is not used anywhere, and therefore +it doesn't make sense to expose it in the ModemManager interface.

+

Gets the number to use when performing the connection.

Parameters

@@ -721,7 +726,7 @@

Returns

-

the number, or NULL if not set. Do not free the returned value, it is owned by self +

the number, or NULL if not set. Do not free the returned value, it is owned by self .

[transfer none]

@@ -733,6 +738,11 @@ mm_simple_connect_properties_set_number (MMSimpleConnectProperties *self, const gchar *number); +
+

mm_simple_connect_properties_set_number has been deprecated since version 1.10.0. and should not be used in newly-written code.

+

The number setting is not used anywhere, and therefore +it doesn't make sense to expose it in the ModemManager interface.

+

Sets the number to use when performing the connection.

Parameters

@@ -769,6 +779,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSimpleStatus.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSimpleStatus.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSimpleStatus.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSimpleStatus.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSimpleStatus: libmm-glib Reference Manual - + - + @@ -290,7 +290,7 @@

recent

-

indication of whether the given signal quality is considered recent.

+

indication of whether the given signal quality is considered recent.

[out][allow-none] @@ -352,13 +352,13 @@

bands

-

location for an array of MMModemBand values. Do not free the returned value, it is owned by self +

location for an array of MMModemBand values. Do not free the returned value, it is owned by self .

[out]

n_bands

-

number of elements in bands +

number of elements in bands .

[out] @@ -695,6 +695,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSms.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSms.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSms.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSms.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSms: libmm-glib Reference Manual - + - + @@ -343,7 +343,7 @@

Returns

-

The DBus path of the MMSms object.

+

The DBus path of the MMSms object.

[transfer none]

@@ -370,7 +370,7 @@

Returns

-

The DBus path of the MMSms object. The returned value should be freed with g_free().

+

The DBus path of the MMSms object. The returned value should be freed with g_free().

[transfer full]

@@ -479,7 +479,7 @@

Returns

-

The message text, or NULL if it doesn't contain any (e.g. contains data instead).

+

The message text, or NULL if it doesn't contain any (e.g. contains data instead).

[transfer none]

@@ -506,7 +506,7 @@

Returns

-

The message text, or NULL if it doesn't contain any (e.g. contains data instead). The returned value should be freed with g_free().

+

The message text, or NULL if it doesn't contain any (e.g. contains data instead). The returned value should be freed with g_free().

[transfer full]

@@ -533,7 +533,7 @@

data_len

-

Size of the output data, if any given.

+

Size of the output data, if any given.

[out] @@ -541,8 +541,8 @@

Returns

-

The message data, or NULL if it doesn't contain any (e.g. contains text instead).

-

[transfer none]

+

The message data, or NULL if it doesn't contain any (e.g. contains text instead).

+

[transfer none][array length=data_len][element-type guint8]


@@ -568,7 +568,7 @@

data_len

-

Size of the output data, if any given.

+

Size of the output data, if any given.

[out] @@ -576,8 +576,8 @@

Returns

-

The message data, or NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_free().

-

[transfer full]

+

The message data, or NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_free().

+

[transfer full][array length=data_len][element-type guint8]


@@ -607,7 +607,7 @@

Returns

-

The number, or NULL if it couldn't be retrieved.

+

The number, or NULL if it couldn't be retrieved.

[transfer none]

@@ -634,7 +634,7 @@

Returns

-

The number, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The number, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -665,7 +665,7 @@

Returns

-

The number of the SMSC, or NULL if it couldn't be retrieved.

+

The number of the SMSC, or NULL if it couldn't be retrieved.

[transfer none]

@@ -692,7 +692,7 @@

Returns

-

The number of the SMSC, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The number of the SMSC, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -885,7 +885,7 @@

Returns

-

The timestamp, or NULL if it couldn't be retrieved.

+

The timestamp, or NULL if it couldn't be retrieved.

[transfer none]

@@ -915,7 +915,7 @@

Returns

-

The timestamp, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The timestamp, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -948,7 +948,7 @@

Returns

-

The timestamp, or NULL if it couldn't be retrieved.

+

The timestamp, or NULL if it couldn't be retrieved.

[transfer none]

@@ -977,7 +977,7 @@

Returns

-

The timestamp, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

+

The timestamp, or NULL if it couldn't be retrieved. The returned value should be freed with g_free().

[transfer full]

@@ -1064,7 +1064,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1119,7 +1119,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1150,7 +1150,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1163,7 +1163,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1203,7 +1203,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1258,7 +1258,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1295,7 +1295,7 @@

cancellable

-

A GCancellable or NULL.

+

A GCancellable or NULL.

[allow-none] @@ -1308,7 +1308,7 @@

Returns

-

TRUE if the operation succeded, FALSE if error +

TRUE if the operation succeeded, FALSE if error is set.

@@ -1324,6 +1324,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSmsProperties.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSmsProperties.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMSmsProperties.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMSmsProperties.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMSmsProperties: libmm-glib Reference Manual - + - + @@ -258,7 +258,7 @@

Creates a new empty MMSmsProperties.

Returns

-

a MMSmsProperties. The returned value should be freed with g_object_unref().

+

a MMSmsProperties. The returned value should be freed with g_object_unref().

[transfer full]

@@ -285,7 +285,7 @@

Returns

-

The message text, or NULL if it doesn't contain any (e.g. contains data instead). Do not free the returned value, it is owned by self +

The message text, or NULL if it doesn't contain any (e.g. contains data instead). Do not free the returned value, it is owned by self .

[transfer none]

@@ -343,7 +343,7 @@

data_len

-

Size of the output data, if any given.

+

Size of the output data, if any given.

[out] @@ -351,7 +351,7 @@

Returns

-

The message data, or NULL if it doesn't contain any (e.g. contains text instead).

+

The message data, or NULL if it doesn't contain any (e.g. contains text instead).

[transfer none]

@@ -415,7 +415,7 @@

Returns

-

A GByteArray with the message data, or NULL if it doesn't contain any (e.g. contains text instead). Do not free the returned value, it is owned by self +

A GByteArray with the message data, or NULL if it doesn't contain any (e.g. contains text instead). Do not free the returned value, it is owned by self .

[transfer none]

@@ -443,7 +443,7 @@

Returns

-

A GByteArray with the message data, or NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_byte_array_unref().

+

A GByteArray with the message data, or NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_byte_array_unref().

[transfer full]

@@ -501,7 +501,7 @@

Returns

-

The number, or NULL if it couldn't be retrieved. Do not free the returned value, it is owned by self +

The number, or NULL if it couldn't be retrieved. Do not free the returned value, it is owned by self .

[transfer none]

@@ -559,7 +559,7 @@

Returns

-

The number of the SMSC, or NULL if it couldn't be retrieved. Do not free the returned value, it is owned by self +

The number of the SMSC, or NULL if it couldn't be retrieved. Do not free the returned value, it is owned by self .

[transfer none]

@@ -918,6 +918,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/MMUnlockRetries.html modemmanager-1.10.0/docs/reference/libmm-glib/html/MMUnlockRetries.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/MMUnlockRetries.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/MMUnlockRetries.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ MMUnlockRetries: libmm-glib Reference Manual - + - + @@ -199,12 +199,12 @@

callback

-

callback to call for each available lock.

+

callback to call for each available lock.

[scope call]

user_data

-

data to pass to callback +

data to pass to callback .

[closure] @@ -231,6 +231,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/object-tree.html modemmanager-1.10.0/docs/reference/libmm-glib/html/object-tree.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/object-tree.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/object-tree.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Object Hierarchy: libmm-glib Reference Manual - + - + @@ -60,9 +60,12 @@ ╰── MMSms ├── MMBearerIpConfig ├── MMBearerProperties + ├── MMBearerStats + ├── MMCallAudioFormat ├── MMCallProperties ├── MMCdmaManualActivationProperties ├── MMFirmwareProperties + ├── MMFirmwareUpdateSettings ├── GDBusInterfaceSkeleton ├── MmGdbusBearerSkeleton ├── MmGdbusCallSkeleton @@ -89,17 +92,19 @@ ╰── MMObject ├── GDBusObjectSkeleton ╰── MmGdbusObjectSkeleton + ├── MMKernelEventProperties ├── MMLocation3gpp ├── MMLocationCdmaBs ├── MMLocationGpsNmea ├── MMLocationGpsRaw ├── MMNetworkTimezone + ├── MMPco ├── MMSignal ├── MMSimpleConnectProperties ├── MMSimpleStatus ├── MMSmsProperties ╰── MMUnlockRetries - GInterface + GInterface ├── MmGdbusBearer ├── MmGdbusCall ├── MmGdbusModem3gpp @@ -121,6 +126,6 @@ +
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/pt01.html modemmanager-1.10.0/docs/reference/libmm-glib/html/pt01.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/pt01.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/pt01.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Part I. High level API: libmm-glib Reference Manual - + - + @@ -30,9 +30,14 @@ Flags and Enumerations
The Manager object
-
+
+
MMManager — The Manager object -
+ +
+MMKernelEventProperties — Helper object to handle kernel event properties. +
+
The Modem object
@@ -110,6 +115,9 @@
MMFirmwareProperties — Helper object to handle firmware information.
+
+MMFirmwareUpdateSettings — Helper object to handle firmware update settings. +
Extended signal information
@@ -128,6 +136,10 @@
MMModemVoice — The Voice interface
+
PCO support
+
+MMPco — Helper object to handle 3GPP PCO. +
The Bearer object
@@ -141,7 +153,7 @@ MMBearerIpConfig — Helper object to handle IP configuration.
-MMBearerStats — Helper object to handle bearer stats. +MMBearerStats — Helper object to handle bearer stats.
The SIM object
@@ -165,11 +177,14 @@
MMCallProperties — Helper object to handle CALL properties.
+
+MMCallAudioFormat — Helper object to handle voice call audio formats. +
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/pt02.html modemmanager-1.10.0/docs/reference/libmm-glib/html/pt02.html --- modemmanager-1.6.8/docs/reference/libmm-glib/html/pt02.html 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/pt02.html 2019-01-17 16:22:35.000000000 +0100 @@ -3,12 +3,12 @@ Part II. Low level API: libmm-glib Reference Manual - + - + - + @@ -16,7 +16,7 @@ Home -Prev +Prev Next
@@ -194,6 +194,6 @@
+
Generated by GTK-Doc V1.29 \ No newline at end of file diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/html/style.css modemmanager-1.10.0/docs/reference/libmm-glib/html/style.css --- modemmanager-1.6.8/docs/reference/libmm-glib/html/style.css 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/html/style.css 2019-01-17 16:22:34.000000000 +0100 @@ -30,6 +30,10 @@ vertical-align: top; } +span.nowrap { + white-space: nowrap; +} + div.gallery-float { float: left; diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib-docs.xml modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib-docs.xml --- modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib-docs.xml 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib-docs.xml 2019-01-15 15:57:35.000000000 +0100 @@ -36,6 +36,9 @@ 2014 2015 2016 + 2017 + 2018 + 2019 The ModemManager Authors @@ -72,6 +75,7 @@ The Manager object + @@ -113,6 +117,7 @@ Firmware support +
Extended signal information @@ -127,6 +132,10 @@ Voice support
+
+ PCO support + +
@@ -152,6 +161,7 @@ The Call object + diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib-sections.txt modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib-sections.txt --- modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib-sections.txt 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib-sections.txt 2019-01-17 16:22:34.000000000 +0100 @@ -14,12 +14,22 @@ mm_manager_new_finish mm_manager_new_sync +mm_manager_get_version mm_manager_scan_devices mm_manager_scan_devices_finish mm_manager_scan_devices_sync +mm_manager_inhibit_device +mm_manager_inhibit_device_finish +mm_manager_inhibit_device_sync +mm_manager_uninhibit_device +mm_manager_uninhibit_device_finish +mm_manager_uninhibit_device_sync mm_manager_set_logging mm_manager_set_logging_finish mm_manager_set_logging_sync +mm_manager_report_kernel_event +mm_manager_report_kernel_event_finish +mm_manager_report_kernel_event_sync MMManagerClass MMManagerPrivate @@ -33,6 +43,37 @@
+mm-kernel-event-properties +MMKernelEventProperties +MMKernelEventProperties + +mm_kernel_event_properties_new +mm_kernel_event_properties_get_action +mm_kernel_event_properties_set_action +mm_kernel_event_properties_get_name +mm_kernel_event_properties_set_name +mm_kernel_event_properties_get_subsystem +mm_kernel_event_properties_set_subsystem +mm_kernel_event_properties_get_uid +mm_kernel_event_properties_set_uid + +mm_kernel_event_properties_new_from_string +mm_kernel_event_properties_new_from_dictionary +mm_kernel_event_properties_dup +mm_kernel_event_properties_get_dictionary + +MMKernelEventPropertiesClass +MMKernelEventPropertiesPrivate +MM_KERNEL_EVENT_PROPERTIES +MM_KERNEL_EVENT_PROPERTIES_CLASS +MM_KERNEL_EVENT_PROPERTIES_GET_CLASS +MM_IS_KERNEL_EVENT_PROPERTIES +MM_IS_KERNEL_EVENT_PROPERTIES_CLASS +MM_TYPE_KERNEL_EVENT_PROPERTIES +mm_kernel_event_properties_get_type +
+ +
mm-object MMObject MMObject @@ -96,6 +137,8 @@ mm_modem_dup_model mm_modem_get_revision mm_modem_dup_revision +mm_modem_get_hardware_revision +mm_modem_dup_hardware_revision mm_modem_get_drivers mm_modem_dup_drivers mm_modem_get_plugin @@ -240,6 +283,15 @@ mm_modem_3gpp_get_enabled_facility_locks mm_modem_3gpp_get_registration_state mm_modem_3gpp_get_subscription_state +mm_modem_3gpp_get_pco +mm_modem_3gpp_get_eps_ue_mode_operation +mm_modem_3gpp_get_initial_eps_bearer_path +mm_modem_3gpp_dup_initial_eps_bearer_path +mm_modem_3gpp_get_initial_eps_bearer +mm_modem_3gpp_get_initial_eps_bearer_finish +mm_modem_3gpp_get_initial_eps_bearer_sync +mm_modem_3gpp_get_initial_eps_bearer_settings +mm_modem_3gpp_peek_initial_eps_bearer_settings mm_modem_3gpp_register mm_modem_3gpp_register_finish @@ -247,8 +299,15 @@ mm_modem_3gpp_scan mm_modem_3gpp_scan_finish mm_modem_3gpp_scan_sync +mm_modem_3gpp_set_eps_ue_mode_operation +mm_modem_3gpp_set_eps_ue_mode_operation_finish +mm_modem_3gpp_set_eps_ue_mode_operation_sync +mm_modem_3gpp_set_initial_eps_bearer_settings +mm_modem_3gpp_set_initial_eps_bearer_settings_finish +mm_modem_3gpp_set_initial_eps_bearer_settings_sync MMModem3gppClass +MMModem3gppPrivate MM_IS_MODEM_3GPP MM_IS_MODEM_3GPP_CLASS MM_MODEM_3GPP @@ -379,10 +438,13 @@ mm_modem_location_dup_path mm_modem_location_get_capabilities mm_modem_location_get_enabled +mm_modem_location_get_gps_refresh_rate mm_modem_location_signals_location mm_modem_location_dup_supl_server mm_modem_location_get_supl_server -mm_modem_location_get_gps_refresh_rate +mm_modem_location_get_supported_assistance_data +mm_modem_location_dup_assistance_data_servers +mm_modem_location_get_assistance_data_servers mm_modem_location_setup mm_modem_location_setup_finish @@ -390,6 +452,9 @@ mm_modem_location_set_supl_server mm_modem_location_set_supl_server_finish mm_modem_location_set_supl_server_sync +mm_modem_location_inject_assistance_data +mm_modem_location_inject_assistance_data_finish +mm_modem_location_inject_assistance_data_sync mm_modem_location_set_gps_refresh_rate mm_modem_location_set_gps_refresh_rate_finish mm_modem_location_set_gps_refresh_rate_sync @@ -427,6 +492,7 @@ mm_location_3gpp_get_mobile_country_code mm_location_3gpp_get_mobile_network_code mm_location_3gpp_get_location_area_code +mm_location_3gpp_get_tracking_area_code mm_location_3gpp_get_cell_id mm_location_3gpp_get_string_variant @@ -434,8 +500,10 @@ mm_location_3gpp_new_from_string_variant mm_location_3gpp_set_cell_id mm_location_3gpp_set_location_area_code +mm_location_3gpp_set_tracking_area_code mm_location_3gpp_set_mobile_country_code mm_location_3gpp_set_mobile_network_code +mm_location_3gpp_reset MMLocation3gppClass MMLocation3gppPrivate @@ -622,7 +690,10 @@ mm_modem_firmware_select mm_modem_firmware_select_finish mm_modem_firmware_select_sync +mm_modem_firmware_get_update_settings +mm_modem_firmware_peek_update_settings +MMModemFirmwarePrivate MMModemFirmwareClass MM_IS_MODEM_FIRMWARE MM_IS_MODEM_FIRMWARE_CLASS @@ -667,6 +738,34 @@
+mm-firmware-update-settings +MMFirmwareUpdateSettings +MMFirmwareUpdateSettings + +mm_firmware_update_settings_get_fastboot_at +mm_firmware_update_settings_get_method +mm_firmware_update_settings_get_device_ids +mm_firmware_update_settings_get_version + +mm_firmware_update_settings_get_variant +mm_firmware_update_settings_new +mm_firmware_update_settings_new_from_variant +mm_firmware_update_settings_set_fastboot_at +mm_firmware_update_settings_set_device_ids +mm_firmware_update_settings_set_version + +MMFirmwareUpdateSettingsClass +MMFirmwareUpdateSettingsPrivate +MM_FIRMWARE_UPDATE_SETTINGS +MM_FIRMWARE_UPDATE_SETTINGS_CLASS +MM_FIRMWARE_UPDATE_SETTINGS_GET_CLASS +MM_IS_FIRMWARE_UPDATE_SETTINGS +MM_IS_FIRMWARE_UPDATE_SETTINGS_CLASS +MM_TYPE_FIRMWARE_UPDATE_SETTINGS +mm_firmware_update_settings_get_type +
+ +
mm-modem-oma MMModemOma MMModemOma @@ -933,6 +1032,7 @@ mm_bearer_get_connected mm_bearer_get_suspended mm_bearer_get_ip_timeout +mm_bearer_get_bearer_type mm_bearer_peek_ipv4_config mm_bearer_get_ipv4_config mm_bearer_peek_ipv6_config @@ -1212,6 +1312,10 @@ mm_call_get_direction mm_call_get_state mm_call_get_state_reason +mm_call_get_audio_port +mm_call_dup_audio_port +mm_call_get_audio_format +mm_call_peek_audio_format mm_call_start mm_call_start_finish @@ -1227,6 +1331,7 @@ mm_call_send_dtmf_sync MMCallClass +MMCallPrivate MM_IS_CALL MM_IS_CALL_CLASS MM_CALL @@ -1269,8 +1374,67 @@
+mm-pco +MMPco +MMPco + +mm_pco_get_session_id +mm_pco_is_complete +mm_pco_get_data + +mm_pco_list_add +mm_pco_list_free + +mm_pco_new +mm_pco_from_variant +mm_pco_to_variant +mm_pco_set_session_id +mm_pco_set_complete +mm_pco_set_data + +MMPcoClass +MMPcoPrivate +MM_IS_PCO +MM_IS_PCO_CLASS +MM_PCO +MM_PCO_CLASS +MM_PCO_GET_CLASS +MM_TYPE_PCO +mm_pco_get_type +
+ +
+mm-call-audio-format +MMCallAudioFormat +MMCallAudioFormat + +mm_call_audio_format_get_encoding +mm_call_audio_format_get_resolution +mm_call_audio_format_get_rate + +mm_call_audio_format_get_dictionary +mm_call_audio_format_new +mm_call_audio_format_new_from_dictionary +mm_call_audio_format_set_encoding +mm_call_audio_format_set_resolution +mm_call_audio_format_set_rate +mm_call_audio_format_dup + +MMCallAudioFormatClass +MMCallAudioFormatPrivate +MM_CALL_AUDIO_FORMAT +MM_CALL_AUDIO_FORMAT_CLASS +MM_CALL_AUDIO_FORMAT_GET_CLASS +MM_IS_CALL_AUDIO_FORMAT +MM_IS_CALL_AUDIO_FORMAT_CLASS +MM_TYPE_CALL_AUDIO_FORMAT +mm_call_audio_format_get_type +
+ +
mm-enums-types Flags and Enumerations +mm_bearer_type_get_string mm_bearer_ip_method_get_string mm_bearer_ip_family_get_string mm_bearer_allowed_auth_build_string_from_mask @@ -1289,11 +1453,14 @@ mm_modem_3gpp_facility_build_string_from_mask mm_modem_3gpp_network_availability_get_string mm_modem_3gpp_ussd_session_state_get_string +mm_modem_3gpp_eps_ue_mode_operation_get_string mm_modem_cdma_registration_state_get_string mm_modem_cdma_activation_state_get_string mm_modem_cdma_rm_protocol_get_string mm_modem_location_source_build_string_from_mask +mm_modem_location_assistance_data_type_build_string_from_mask mm_modem_contacts_storage_get_string +mm_modem_firmware_update_method_build_string_from_mask mm_sms_pdu_type_get_string mm_sms_state_get_string mm_sms_delivery_state_get_string @@ -1327,7 +1494,9 @@ mm_sms_cdma_teleservice_id_build_string_from_mask mm_sms_cdma_service_category_build_string_from_mask mm_modem_location_source_get_string +mm_modem_location_assistance_data_type_get_string mm_modem_contacts_storage_build_string_from_mask +mm_bearer_type_build_string_from_mask mm_bearer_ip_family_build_string_from_mask mm_bearer_ip_method_build_string_from_mask mm_bearer_allowed_auth_get_string @@ -1339,6 +1508,7 @@ mm_modem_3gpp_facility_get_string mm_modem_3gpp_network_availability_build_string_from_mask mm_modem_3gpp_ussd_session_state_build_string_from_mask +mm_modem_3gpp_eps_ue_mode_operation_build_string_from_mask mm_firmware_image_type_build_string_from_mask mm_modem_port_type_build_string_from_mask mm_oma_feature_get_string @@ -1348,7 +1518,9 @@ mm_call_direction_build_string_from_mask mm_call_state_build_string_from_mask mm_call_state_reason_build_string_from_mask +mm_modem_firmware_update_method_get_string +MM_TYPE_BEARER_TYPE MM_TYPE_BEARER_IP_FAMILY MM_TYPE_BEARER_IP_METHOD MM_TYPE_BEARER_ALLOWED_AUTH @@ -1358,6 +1530,7 @@ MM_TYPE_MODEM_3GPP_REGISTRATION_STATE MM_TYPE_MODEM_3GPP_SUBSCRIPTION_STATE MM_TYPE_MODEM_3GPP_USSD_SESSION_STATE +MM_TYPE_MODEM_3GPP_EPS_UE_MODE_OPERATION MM_TYPE_MODEM_ACCESS_TECHNOLOGY MM_TYPE_MODEM_BAND MM_TYPE_MODEM_CAPABILITY @@ -1366,6 +1539,7 @@ MM_TYPE_MODEM_CDMA_RM_PROTOCOL MM_TYPE_MODEM_CONTACTS_STORAGE MM_TYPE_MODEM_LOCATION_SOURCE +MM_TYPE_MODEM_LOCATION_ASSISTANCE_DATA_TYPE MM_TYPE_MODEM_LOCK MM_TYPE_MODEM_MODE MM_TYPE_MODEM_STATE @@ -1387,6 +1561,8 @@ MM_TYPE_CALL_DIRECTION MM_TYPE_CALL_STATE MM_TYPE_CALL_STATE_REASON +MM_TYPE_MODEM_FIRMWARE_UPDATE_METHOD +mm_bearer_type_get_type mm_bearer_ip_family_get_type mm_bearer_ip_method_get_type mm_bearer_allowed_auth_get_type @@ -1396,6 +1572,7 @@ mm_modem_3gpp_registration_state_get_type mm_modem_3gpp_subscription_state_get_type mm_modem_3gpp_ussd_session_state_get_type +mm_modem_3gpp_eps_ue_mode_operation_get_type mm_modem_access_technology_get_type mm_modem_band_get_type mm_modem_capability_get_type @@ -1404,6 +1581,7 @@ mm_modem_cdma_rm_protocol_get_type mm_modem_contacts_storage_get_type mm_modem_location_source_get_type +mm_modem_location_assistance_data_type_get_type mm_modem_lock_get_type mm_modem_mode_get_type mm_modem_state_change_reason_get_type @@ -1425,6 +1603,7 @@ mm_call_direction_get_type mm_call_state_get_type mm_call_state_reason_get_type +mm_modem_firmware_update_method_get_type
@@ -1474,6 +1653,7 @@ mm_gdbus_bearer_dup_properties mm_gdbus_bearer_get_connected mm_gdbus_bearer_get_suspended +mm_gdbus_bearer_get_bearer_type mm_gdbus_bearer_get_stats mm_gdbus_bearer_dup_stats @@ -1492,6 +1672,7 @@ mm_gdbus_bearer_set_ip_timeout mm_gdbus_bearer_set_properties mm_gdbus_bearer_set_suspended +mm_gdbus_bearer_set_bearer_type mm_gdbus_bearer_set_stats mm_gdbus_bearer_override_properties mm_gdbus_bearer_complete_connect @@ -1551,16 +1732,27 @@ MmGdbusOrgFreedesktopModemManager1 MmGdbusOrgFreedesktopModemManager1Iface +mm_gdbus_org_freedesktop_modem_manager1_dup_version +mm_gdbus_org_freedesktop_modem_manager1_get_version mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_finish mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_sync +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish +mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync mm_gdbus_org_freedesktop_modem_manager1_call_set_logging mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_finish mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_sync +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish +mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync +mm_gdbus_org_freedesktop_modem_manager1_set_version mm_gdbus_org_freedesktop_modem_manager1_override_properties +mm_gdbus_org_freedesktop_modem_manager1_complete_inhibit_device mm_gdbus_org_freedesktop_modem_manager1_complete_scan_devices mm_gdbus_org_freedesktop_modem_manager1_complete_set_logging +mm_gdbus_org_freedesktop_modem_manager1_complete_report_kernel_event mm_gdbus_org_freedesktop_modem_manager1_interface_info MM_GDBUS_IS_ORG_FREEDESKTOP_MODEM_MANAGER1 @@ -1626,6 +1818,13 @@ mm_gdbus_modem3gpp_dup_operator_name mm_gdbus_modem3gpp_get_enabled_facility_locks mm_gdbus_modem3gpp_get_subscription_state +mm_gdbus_modem3gpp_get_eps_ue_mode_operation +mm_gdbus_modem3gpp_get_pco +mm_gdbus_modem3gpp_dup_pco +mm_gdbus_modem3gpp_get_initial_eps_bearer +mm_gdbus_modem3gpp_dup_initial_eps_bearer +mm_gdbus_modem3gpp_get_initial_eps_bearer_settings +mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings mm_gdbus_modem3gpp_call_register mm_gdbus_modem3gpp_call_register_finish @@ -1633,9 +1832,17 @@ mm_gdbus_modem3gpp_call_scan mm_gdbus_modem3gpp_call_scan_finish mm_gdbus_modem3gpp_call_scan_sync +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish +mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish +mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync mm_gdbus_modem3gpp_complete_register mm_gdbus_modem3gpp_complete_scan +mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation +mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings mm_gdbus_modem3gpp_interface_info mm_gdbus_modem3gpp_override_properties mm_gdbus_modem3gpp_set_enabled_facility_locks @@ -1644,6 +1851,10 @@ mm_gdbus_modem3gpp_set_operator_name mm_gdbus_modem3gpp_set_registration_state mm_gdbus_modem3gpp_set_subscription_state +mm_gdbus_modem3gpp_set_eps_ue_mode_operation +mm_gdbus_modem3gpp_set_pco +mm_gdbus_modem3gpp_set_initial_eps_bearer +mm_gdbus_modem3gpp_set_initial_eps_bearer_settings MM_GDBUS_IS_MODEM3GPP MM_GDBUS_MODEM3GPP @@ -1811,6 +2022,8 @@ mm_gdbus_modem_dup_ports mm_gdbus_modem_get_revision mm_gdbus_modem_dup_revision +mm_gdbus_modem_get_hardware_revision +mm_gdbus_modem_dup_hardware_revision mm_gdbus_modem_get_signal_quality mm_gdbus_modem_dup_signal_quality mm_gdbus_modem_get_sim @@ -1880,6 +2093,7 @@ mm_gdbus_modem_set_primary_port mm_gdbus_modem_set_ports mm_gdbus_modem_set_revision +mm_gdbus_modem_set_hardware_revision mm_gdbus_modem_set_signal_quality mm_gdbus_modem_set_sim mm_gdbus_modem_set_supported_capabilities @@ -2053,6 +2267,9 @@ mm_gdbus_modem_location_dup_supl_server mm_gdbus_modem_location_get_supl_server mm_gdbus_modem_location_get_gps_refresh_rate +mm_gdbus_modem_location_get_supported_assistance_data +mm_gdbus_modem_location_dup_assistance_data_servers +mm_gdbus_modem_location_get_assistance_data_servers mm_gdbus_modem_location_call_get_location mm_gdbus_modem_location_call_get_location_finish @@ -2063,6 +2280,9 @@ mm_gdbus_modem_location_call_set_supl_server mm_gdbus_modem_location_call_set_supl_server_finish mm_gdbus_modem_location_call_set_supl_server_sync +mm_gdbus_modem_location_call_inject_assistance_data +mm_gdbus_modem_location_call_inject_assistance_data_finish +mm_gdbus_modem_location_call_inject_assistance_data_sync mm_gdbus_modem_location_call_set_gps_refresh_rate mm_gdbus_modem_location_call_set_gps_refresh_rate_finish mm_gdbus_modem_location_call_set_gps_refresh_rate_sync @@ -2072,10 +2292,13 @@ mm_gdbus_modem_location_set_location mm_gdbus_modem_location_set_signals_location mm_gdbus_modem_location_set_supl_server +mm_gdbus_modem_location_set_supported_assistance_data mm_gdbus_modem_location_set_gps_refresh_rate +mm_gdbus_modem_location_set_assistance_data_servers mm_gdbus_modem_location_complete_get_location mm_gdbus_modem_location_complete_setup mm_gdbus_modem_location_complete_set_supl_server +mm_gdbus_modem_location_complete_inject_assistance_data mm_gdbus_modem_location_complete_set_gps_refresh_rate mm_gdbus_modem_location_interface_info mm_gdbus_modem_location_override_properties @@ -2285,6 +2508,8 @@ MmGdbusModemFirmware MmGdbusModemFirmwareIface +mm_gdbus_modem_firmware_dup_update_settings +mm_gdbus_modem_firmware_get_update_settings mm_gdbus_modem_firmware_call_list mm_gdbus_modem_firmware_call_list_finish @@ -2293,6 +2518,7 @@ mm_gdbus_modem_firmware_call_select_finish mm_gdbus_modem_firmware_call_select_sync +mm_gdbus_modem_firmware_set_update_settings mm_gdbus_modem_firmware_complete_list mm_gdbus_modem_firmware_complete_select mm_gdbus_modem_firmware_interface_info @@ -2975,8 +3201,10 @@ mm_gdbus_call_dup_number mm_gdbus_call_get_state mm_gdbus_call_get_state_reason -mm_gdbus_call_emit_dtmf_received -mm_gdbus_call_emit_state_changed +mm_gdbus_call_dup_audio_format +mm_gdbus_call_dup_audio_port +mm_gdbus_call_get_audio_format +mm_gdbus_call_get_audio_port mm_gdbus_call_call_accept mm_gdbus_call_call_accept_finish @@ -2995,12 +3223,16 @@ mm_gdbus_call_set_number mm_gdbus_call_set_state mm_gdbus_call_set_state_reason +mm_gdbus_call_set_audio_format +mm_gdbus_call_set_audio_port mm_gdbus_call_complete_accept mm_gdbus_call_complete_hangup mm_gdbus_call_complete_send_dtmf mm_gdbus_call_complete_start mm_gdbus_call_interface_info mm_gdbus_call_override_properties +mm_gdbus_call_emit_dtmf_received +mm_gdbus_call_emit_state_changed MM_GDBUS_IS_CALL MM_GDBUS_CALL diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib.types modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib.types --- modemmanager-1.6.8/docs/reference/libmm-glib/libmm-glib.types 2017-06-17 10:27:27.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/libmm-glib.types 2019-01-17 16:22:34.000000000 +0100 @@ -4,6 +4,9 @@ mm_bearer_ip_family_get_type mm_bearer_ip_method_get_type mm_bearer_properties_get_type +mm_bearer_stats_get_type +mm_bearer_type_get_type +mm_call_audio_format_get_type mm_call_direction_get_type mm_call_get_type mm_call_properties_get_type @@ -15,6 +18,7 @@ mm_core_error_get_type mm_firmware_image_type_get_type mm_firmware_properties_get_type +mm_firmware_update_settings_get_type mm_gdbus_bearer_get_type mm_gdbus_bearer_proxy_get_type mm_gdbus_bearer_skeleton_get_type @@ -70,6 +74,7 @@ mm_gdbus_sms_get_type mm_gdbus_sms_proxy_get_type mm_gdbus_sms_skeleton_get_type +mm_kernel_event_properties_get_type mm_location_3gpp_get_type mm_location_cdma_bs_get_type mm_location_gps_nmea_get_type @@ -77,6 +82,7 @@ mm_manager_get_type mm_message_error_get_type mm_mobile_equipment_error_get_type +mm_modem_3gpp_eps_ue_mode_operation_get_type mm_modem_3gpp_facility_get_type mm_modem_3gpp_get_type mm_modem_3gpp_network_availability_get_type @@ -93,7 +99,9 @@ mm_modem_cdma_rm_protocol_get_type mm_modem_contacts_storage_get_type mm_modem_firmware_get_type +mm_modem_firmware_update_method_get_type mm_modem_get_type +mm_modem_location_assistance_data_type_get_type mm_modem_location_get_type mm_modem_location_source_get_type mm_modem_lock_get_type @@ -115,6 +123,7 @@ mm_oma_session_state_failed_reason_get_type mm_oma_session_state_get_type mm_oma_session_type_get_type +mm_pco_get_type mm_serial_error_get_type mm_signal_get_type mm_sim_get_type diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/Makefile.am modemmanager-1.10.0/docs/reference/libmm-glib/Makefile.am --- modemmanager-1.6.8/docs/reference/libmm-glib/Makefile.am 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -12,7 +12,7 @@ DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS = +SCAN_OPTIONS = --rebuild-types --deprecated-guards="MM_DISABLE_DEPRECATED" # The directory containing the source code. DOC_SOURCE_DIR = \ diff -Nru modemmanager-1.6.8/docs/reference/libmm-glib/Makefile.in modemmanager-1.10.0/docs/reference/libmm-glib/Makefile.in --- modemmanager-1.6.8/docs/reference/libmm-glib/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/libmm-glib/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -99,14 +99,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -138,7 +137,6 @@ $(top_srcdir)/gtk-doc.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -191,14 +189,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -319,8 +309,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -355,7 +343,7 @@ DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS = +SCAN_OPTIONS = --rebuild-types --deprecated-guards="MM_DISABLE_DEPRECATED" # The directory containing the source code. DOC_SOURCE_DIR = \ @@ -531,8 +519,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtk-doc.make $(am__empty): @@ -560,7 +548,10 @@ @ENABLE_GTK_DOC_FALSE@dist-hook: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -630,10 +621,10 @@ @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @ENABLE_GTK_DOC_FALSE@uninstall-local: -@ENABLE_GTK_DOC_FALSE@distclean-local: -@ENABLE_GTK_DOC_FALSE@clean-local: @ENABLE_GTK_DOC_FALSE@install-data-local: +@ENABLE_GTK_DOC_FALSE@distclean-local: @ENABLE_GTK_DOC_FALSE@maintainer-clean-local: +@ENABLE_GTK_DOC_FALSE@clean-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am diff -Nru modemmanager-1.6.8/docs/reference/Makefile.in modemmanager-1.10.0/docs/reference/Makefile.in --- modemmanager-1.6.8/docs/reference/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/docs/reference/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -142,7 +141,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,7 +190,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -244,14 +242,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -372,8 +362,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -414,8 +402,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,7 +520,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/examples/Makefile.in modemmanager-1.10.0/examples/Makefile.in --- modemmanager-1.6.8/examples/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/examples/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -142,7 +141,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,7 +190,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -244,14 +242,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -372,8 +362,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -414,8 +402,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,7 +520,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/examples/modem-watcher-javascript/Makefile.in modemmanager-1.10.0/examples/modem-watcher-javascript/Makefile.in --- modemmanager-1.6.8/examples/modem-watcher-javascript/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/examples/modem-watcher-javascript/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -131,7 +130,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -184,14 +182,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -312,8 +302,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -358,8 +346,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -383,7 +371,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/examples/modem-watcher-javascript/modemWatcher.js modemmanager-1.10.0/examples/modem-watcher-javascript/modemWatcher.js --- modemmanager-1.6.8/examples/modem-watcher-javascript/modemWatcher.js 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/examples/modem-watcher-javascript/modemWatcher.js 2019-01-15 15:57:35.000000000 +0100 @@ -49,7 +49,7 @@ _ModemManagerNameOwnerChanged: function() { if (this._manager.name_owner) - print('[ModemWatcher] ModemManager service is available in bus'); + print('[ModemWatcher] ModemManager ' + this._manager.get_version() + ' service is available in bus'); else print('[ModemWatcher] ModemManager service not available in bus'); }, diff -Nru modemmanager-1.6.8/examples/modem-watcher-python/Makefile.in modemmanager-1.10.0/examples/modem-watcher-python/Makefile.in --- modemmanager-1.6.8/examples/modem-watcher-python/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/examples/modem-watcher-python/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -131,7 +130,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -184,14 +182,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -312,8 +302,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -357,8 +345,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -382,7 +370,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/examples/modem-watcher-python/ModemWatcher.py modemmanager-1.10.0/examples/modem-watcher-python/ModemWatcher.py --- modemmanager-1.6.8/examples/modem-watcher-python/ModemWatcher.py 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/examples/modem-watcher-python/ModemWatcher.py 2019-01-15 15:57:35.000000000 +0100 @@ -54,7 +54,7 @@ """ def set_available(self): if self.available == False or self.initializing == True: - print('[ModemWatcher] ModemManager service is available in bus') + print('[ModemWatcher] ModemManager %s service is available in bus' % self.manager.get_version()) self.object_added_id = self.manager.connect('object-added', self.on_object_added) self.object_removed_id = self.manager.connect('object-removed', self.on_object_removed) self.available = True diff -Nru modemmanager-1.6.8/examples/sms-python/Makefile.in modemmanager-1.10.0/examples/sms-python/Makefile.in --- modemmanager-1.6.8/examples/sms-python/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/examples/sms-python/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -131,7 +130,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -184,14 +182,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -312,8 +302,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -357,8 +345,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -382,7 +370,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/include/Makefile.am modemmanager-1.10.0/include/Makefile.am --- modemmanager-1.6.8/include/Makefile.am 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/include/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -8,6 +8,7 @@ ModemManager-names.h \ ModemManager-enums.h \ ModemManager-errors.h \ + ModemManager-compat.h \ ModemManager-version.h \ ModemManager.h @@ -18,4 +19,5 @@ ModemManager-names.h EXTRA_DIST = \ + ModemManager-tags.h \ ModemManager-version.h.in diff -Nru modemmanager-1.6.8/include/Makefile.in modemmanager-1.10.0/include/Makefile.in --- modemmanager-1.6.8/include/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/include/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ @@ -181,7 +180,6 @@ $(srcdir)/ModemManager-version.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -234,14 +232,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -362,8 +352,6 @@ includedir = @includedir@/ModemManager infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -389,6 +377,7 @@ ModemManager-names.h \ ModemManager-enums.h \ ModemManager-errors.h \ + ModemManager-compat.h \ ModemManager-version.h \ ModemManager.h @@ -396,6 +385,7 @@ ModemManager-names.h EXTRA_DIST = \ + ModemManager-tags.h \ ModemManager-version.h.in all: all-am @@ -418,8 +408,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -512,7 +502,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/include/ModemManager-compat.h modemmanager-1.10.0/include/ModemManager-compat.h --- modemmanager-1.6.8/include/ModemManager-compat.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/include/ModemManager-compat.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,699 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Google, Inc. + */ + +#ifndef _MODEMMANAGER_COMPAT_H_ +#define _MODEMMANAGER_COMPAT_H_ + +#if !defined (__MODEM_MANAGER_H_INSIDE__) +#error "Only can be included directly." +#endif + +#include + +#ifndef MM_DISABLE_DEPRECATED + +/** + * SECTION:mm-compat + * @title: API break replacements + * + * These compatibility types and methods are flagged as deprecated and + * therefore shouldn't be used in newly written code. They are provided to + * avoid unnecessary API/ABI breaks. + */ + +/* deprecated attribute support since gcc 3.1 */ +#if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +# define MM_DEPRECATED __attribute__((__deprecated__)) +#else +# define MM_DEPRECATED +#endif + +/* The following type exists just so that we can get deprecation warnings */ +MM_DEPRECATED +typedef int MMModemBandDeprecated; + +/** + * MM_MODEM_BAND_U2100: + * + * WCDMA 2100 MHz (UTRAN band 1). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_1 instead. + */ +#define MM_MODEM_BAND_U2100 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_1) + +/** + * MM_MODEM_BAND_U1900: + * + * WCDMA 1900 MHz (UTRAN band 2). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_2 instead. + */ +#define MM_MODEM_BAND_U1900 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_2) + +/** + * MM_MODEM_BAND_U1800: + * + * WCDMA 1800 MHz (UTRAN band 3). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_3 instead. + */ +#define MM_MODEM_BAND_U1800 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_3) + +/** + * MM_MODEM_BAND_U17IV: + * + * AWS 1700/2100 MHz (UTRAN band 4). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_4 instead. + */ +#define MM_MODEM_BAND_U17IV ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_4) + +/** + * MM_MODEM_BAND_U850: + * + * UMTS 850 MHz (UTRAN band 5). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_5 instead. + */ +#define MM_MODEM_BAND_U850 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_5) + +/** + * MM_MODEM_BAND_U800: + * + * UMTS 800 MHz (UTRAN band 6). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_6 instead. + */ +#define MM_MODEM_BAND_U800 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_6) + +/** + * MM_MODEM_BAND_U2600: + * + * UMTS 2600 MHz (UTRAN band 7). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_7 instead. + */ +#define MM_MODEM_BAND_U2600 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_7) + +/** + * MM_MODEM_BAND_U900: + * + * UMTS 900 MHz (UTRAN band 8). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_8 instead. + */ +#define MM_MODEM_BAND_U900 ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_8) + +/** + * MM_MODEM_BAND_U17IX: + * + * UMTS 1700 MHz (UTRAN band 9). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_UTRAN_9 instead. + */ +#define MM_MODEM_BAND_U17IX ((MMModemBandDeprecated)MM_MODEM_BAND_UTRAN_9) + +/** + * MM_MODEM_BAND_EUTRAN_I: + * + * E-UTRAN band 1. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_1 instead. + */ +#define MM_MODEM_BAND_EUTRAN_I ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_1) + +/** + * MM_MODEM_BAND_EUTRAN_II: + * + * E-UTRAN band 2. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_2 instead. + */ +#define MM_MODEM_BAND_EUTRAN_II ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_2) + +/** + * MM_MODEM_BAND_EUTRAN_III: + * + * E-UTRAN band 3. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_3 instead. + */ +#define MM_MODEM_BAND_EUTRAN_III ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_3) + +/** + * MM_MODEM_BAND_EUTRAN_IV: + * + * E-UTRAN band 4. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_4 instead. + */ +#define MM_MODEM_BAND_EUTRAN_IV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_4) + +/** + * MM_MODEM_BAND_EUTRAN_V: + * + * E-UTRAN band 5. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_5 instead. + */ +#define MM_MODEM_BAND_EUTRAN_V ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_5) + +/** + * MM_MODEM_BAND_EUTRAN_VI: + * + * E-UTRAN band 6. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_6 instead. + */ +#define MM_MODEM_BAND_EUTRAN_VI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_6) + +/** + * MM_MODEM_BAND_EUTRAN_VII: + * + * E-UTRAN band 7. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_7 instead. + */ +#define MM_MODEM_BAND_EUTRAN_VII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_7) + +/** + * MM_MODEM_BAND_EUTRAN_VIII: + * + * E-UTRAN band 8. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_8 instead. + */ +#define MM_MODEM_BAND_EUTRAN_VIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_8) + +/** + * MM_MODEM_BAND_EUTRAN_IX: + * + * E-UTRAN band 9. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_9 instead. + */ +#define MM_MODEM_BAND_EUTRAN_IX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_9) + +/** + * MM_MODEM_BAND_EUTRAN_X: + * + * E-UTRAN band 10. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_10 instead. + */ +#define MM_MODEM_BAND_EUTRAN_X ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_10) + +/** + * MM_MODEM_BAND_EUTRAN_XI: + * + * E-UTRAN band 11. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_11 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_11) + +/** + * MM_MODEM_BAND_EUTRAN_XII: + * + * E-UTRAN band 12. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_12 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_12) + +/** + * MM_MODEM_BAND_EUTRAN_XIII: + * + * E-UTRAN band 13. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_13 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_13) + +/** + * MM_MODEM_BAND_EUTRAN_XIV: + * + * E-UTRAN band 14. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_14 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_14) + +/** + * MM_MODEM_BAND_EUTRAN_XVII: + * + * E-UTRAN band 17. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_17 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XVII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_17) + +/** + * MM_MODEM_BAND_EUTRAN_XVIII: + * + * E-UTRAN band 18. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_18 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XVIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_18) + +/** + * MM_MODEM_BAND_EUTRAN_XIX: + * + * E-UTRAN band 19. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_19 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XIX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_19) + +/** + * MM_MODEM_BAND_EUTRAN_XX: + * + * E-UTRAN band 20. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_20 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_20) + +/** + * MM_MODEM_BAND_EUTRAN_XXI: + * + * E-UTRAN band 21. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_21 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_21) + +/** + * MM_MODEM_BAND_EUTRAN_XXII: + * + * E-UTRAN band 22. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_22 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_22) + +/** + * MM_MODEM_BAND_EUTRAN_XXIII: + * + * E-UTRAN band 23. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_23 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_23) + +/** + * MM_MODEM_BAND_EUTRAN_XXIV: + * + * E-UTRAN band 24. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_24 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_24) + +/** + * MM_MODEM_BAND_EUTRAN_XXV: + * + * E-UTRAN band 25. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_25 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_25) + +/** + * MM_MODEM_BAND_EUTRAN_XXVI: + * + * E-UTRAN band 26. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_26 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXVI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_26) + +/** + * MM_MODEM_BAND_EUTRAN_XXXIII: + * + * E-UTRAN band 33. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_33 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_33) + +/** + * MM_MODEM_BAND_EUTRAN_XXXIV: + * + * E-UTRAN band 34. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_34 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_34) + +/** + * MM_MODEM_BAND_EUTRAN_XXXV: + * + * E-UTRAN band 35. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_35 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_35) + +/** + * MM_MODEM_BAND_EUTRAN_XXXVI: + * + * E-UTRAN band 36. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_36 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXVI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_36) + +/** + * MM_MODEM_BAND_EUTRAN_XXXVII: + * + * E-UTRAN band 37. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_37 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXVII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_37) + +/** + * MM_MODEM_BAND_EUTRAN_XXXVIII: + * + * E-UTRAN band 38. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_38 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXVIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_38) + +/** + * MM_MODEM_BAND_EUTRAN_XXXIX: + * + * E-UTRAN band 39. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_39 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XXXIX ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_39) + +/** + * MM_MODEM_BAND_EUTRAN_XL: + * + * E-UTRAN band 40. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_40 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XL ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_40) + +/** + * MM_MODEM_BAND_EUTRAN_XLI: + * + * E-UTRAN band 41. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_41 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XLI ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_41) + +/** + * MM_MODEM_BAND_EUTRAN_XLII: + * + * E-UTRAN band 42. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_42 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XLII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_42) + +/** + * MM_MODEM_BAND_EUTRAN_XLIII: + * + * E-UTRAN band 43. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_43 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XLIII ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_43) + +/** + * MM_MODEM_BAND_EUTRAN_XLIV: + * + * E-UTRAN band 44. + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_EUTRAN_44 instead. + */ +#define MM_MODEM_BAND_EUTRAN_XLIV ((MMModemBandDeprecated)MM_MODEM_BAND_EUTRAN_44) + +/** + * MM_MODEM_BAND_CDMA_BC0_CELLULAR_800: + * + * CDMA Band Class 0 (US Cellular 850MHz) + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC0 instead. + */ +#define MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC0) + +/** + * MM_MODEM_BAND_CDMA_BC1_PCS_1900: + * + * CDMA Band Class 1 (US PCS 1900MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC1 instead. + */ +#define MM_MODEM_BAND_CDMA_BC1_PCS_1900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC1) + +/** + * MM_MODEM_BAND_CDMA_BC2_TACS: + * + * CDMA Band Class 2 (UK TACS 900MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC2 instead. + */ +#define MM_MODEM_BAND_CDMA_BC2_TACS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC2) + +/** + * MM_MODEM_BAND_CDMA_BC3_JTACS: + * + * CDMA Band Class 3 (Japanese TACS). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC3 instead. + */ +#define MM_MODEM_BAND_CDMA_BC3_JTACS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC3) + +/** + * MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS: + * + * CDMA Band Class 4 (Korean PCS). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC4 instead. + */ +#define MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC4) + +/** + * MM_MODEM_BAND_CDMA_BC5_NMT450: + * + * CDMA Band Class 5 (NMT 450MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC5 instead. + */ +#define MM_MODEM_BAND_CDMA_BC5_NMT450 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC5) + +/** + * MM_MODEM_BAND_CDMA_BC6_IMT2000: + * + * CDMA Band Class 6 (IMT2000 2100MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC6 instead. + */ +#define MM_MODEM_BAND_CDMA_BC6_IMT2000 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC6) + +/** + * MM_MODEM_BAND_CDMA_BC7_CELLULAR_700: + * + * CDMA Band Class 7 (Cellular 700MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC7 instead. + */ +#define MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC7) + +/** + * MM_MODEM_BAND_CDMA_BC8_1800: + * + * CDMA Band Class 8 (1800MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC8 instead. + */ +#define MM_MODEM_BAND_CDMA_BC8_1800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC8) + +/** + * MM_MODEM_BAND_CDMA_BC9_900: + * + * CDMA Band Class 9 (900MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC9 instead. + */ +#define MM_MODEM_BAND_CDMA_BC9_900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC9) + +/** + * MM_MODEM_BAND_CDMA_BC10_SECONDARY_800: + * + * CDMA Band Class 10 (US Secondary 800). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC10 instead. + */ +#define MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC10) + +/** + * MM_MODEM_BAND_CDMA_BC11_PAMR_400: + * + * CDMA Band Class 11 (European PAMR 400MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC11 instead. + */ +#define MM_MODEM_BAND_CDMA_BC11_PAMR_400 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC11) + +/** + * MM_MODEM_BAND_CDMA_BC12_PAMR_800: + * + * CDMA Band Class 12 (PAMR 800MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC12 instead. + */ +#define MM_MODEM_BAND_CDMA_BC12_PAMR_800 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC12) + +/** + * MM_MODEM_BAND_CDMA_BC13_IMT2000_2500: + * + * CDMA Band Class 13 (IMT2000 2500MHz Expansion). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC13 instead. + */ +#define MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC13) + +/** + * MM_MODEM_BAND_CDMA_BC14_PCS2_1900: + * + * CDMA Band Class 14 (More US PCS 1900MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC14 instead. + */ +#define MM_MODEM_BAND_CDMA_BC14_PCS2_1900 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC14) + +/** + * MM_MODEM_BAND_CDMA_BC15_AWS: + * + * CDMA Band Class 15 (AWS 1700MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC15 instead. + */ +#define MM_MODEM_BAND_CDMA_BC15_AWS ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC15) + +/** + * MM_MODEM_BAND_CDMA_BC16_US_2500: + * + * CDMA Band Class 16 (US 2500MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC16 instead. + */ +#define MM_MODEM_BAND_CDMA_BC16_US_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC16) + +/** + * MM_MODEM_BAND_CDMA_BC17_US_FLO_2500: + * + * CDMA Band Class 17 (US 2500MHz Forward Link Only). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC17 instead. + */ +#define MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC17) + +/** + * MM_MODEM_BAND_CDMA_BC18_US_PS_700: + * + * CDMA Band Class 18 (US 700MHz Public Safety). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC18 instead. + */ +#define MM_MODEM_BAND_CDMA_BC18_US_PS_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC18) + +/** + * MM_MODEM_BAND_CDMA_BC19_US_LOWER_700: + * + * CDMA Band Class 19 (US Lower 700MHz). + * + * Since: 1.0 + * Deprecated: 1.8.0: Use #MM_MODEM_BAND_CDMA_BC19 instead. + */ +#define MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 ((MMModemBandDeprecated)MM_MODEM_BAND_CDMA_BC19) + +#endif /* MM_DISABLE_DEPRECATED */ + +#endif /* _MODEMMANAGER_COMPAT_H_ */ diff -Nru modemmanager-1.6.8/include/ModemManager-enums.h modemmanager-1.10.0/include/ModemManager-enums.h --- modemmanager-1.6.8/include/ModemManager-enums.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/include/ModemManager-enums.h 2019-01-15 15:57:35.000000000 +0100 @@ -249,71 +249,123 @@ * @MM_MODEM_BAND_DCS: GSM/GPRS/EDGE 1800 MHz. * @MM_MODEM_BAND_PCS: GSM/GPRS/EDGE 1900 MHz. * @MM_MODEM_BAND_G850: GSM/GPRS/EDGE 850 MHz. - * @MM_MODEM_BAND_U2100: WCDMA 2100 MHz (Class I). - * @MM_MODEM_BAND_U1800: WCDMA 3GPP 1800 MHz (Class III). - * @MM_MODEM_BAND_U17IV: WCDMA 3GPP AWS 1700/2100 MHz (Class IV). - * @MM_MODEM_BAND_U800: WCDMA 3GPP UMTS 800 MHz (Class VI). - * @MM_MODEM_BAND_U850: WCDMA 3GPP UMTS 850 MHz (Class V). - * @MM_MODEM_BAND_U900: WCDMA 3GPP UMTS 900 MHz (Class VIII). - * @MM_MODEM_BAND_U17IX: WCDMA 3GPP UMTS 1700 MHz (Class IX). - * @MM_MODEM_BAND_U1900: WCDMA 3GPP UMTS 1900 MHz (Class II). - * @MM_MODEM_BAND_U2600: WCDMA 3GPP UMTS 2600 MHz (Class VII, internal). - * @MM_MODEM_BAND_EUTRAN_I: E-UTRAN band I. - * @MM_MODEM_BAND_EUTRAN_II: E-UTRAN band II. - * @MM_MODEM_BAND_EUTRAN_III: E-UTRAN band III. - * @MM_MODEM_BAND_EUTRAN_IV: E-UTRAN band IV. - * @MM_MODEM_BAND_EUTRAN_V: E-UTRAN band V. - * @MM_MODEM_BAND_EUTRAN_VI: E-UTRAN band VI. - * @MM_MODEM_BAND_EUTRAN_VII: E-UTRAN band VII. - * @MM_MODEM_BAND_EUTRAN_VIII: E-UTRAN band VIII. - * @MM_MODEM_BAND_EUTRAN_IX: E-UTRAN band IX. - * @MM_MODEM_BAND_EUTRAN_X: E-UTRAN band X. - * @MM_MODEM_BAND_EUTRAN_XI: E-UTRAN band XI. - * @MM_MODEM_BAND_EUTRAN_XII: E-UTRAN band XII. - * @MM_MODEM_BAND_EUTRAN_XIII: E-UTRAN band XIII. - * @MM_MODEM_BAND_EUTRAN_XIV: E-UTRAN band XIV. - * @MM_MODEM_BAND_EUTRAN_XVII: E-UTRAN band XVII. - * @MM_MODEM_BAND_EUTRAN_XVIII: E-UTRAN band XVIII. - * @MM_MODEM_BAND_EUTRAN_XIX: E-UTRAN band XIX. - * @MM_MODEM_BAND_EUTRAN_XX: E-UTRAN band XX. - * @MM_MODEM_BAND_EUTRAN_XXI: E-UTRAN band XXI. - * @MM_MODEM_BAND_EUTRAN_XXII: E-UTRAN band XXII. - * @MM_MODEM_BAND_EUTRAN_XXIII: E-UTRAN band XXIII. - * @MM_MODEM_BAND_EUTRAN_XXIV: E-UTRAN band XXIV. - * @MM_MODEM_BAND_EUTRAN_XXV: E-UTRAN band XXV. - * @MM_MODEM_BAND_EUTRAN_XXVI: E-UTRAN band XXVI. - * @MM_MODEM_BAND_EUTRAN_XXXIII: E-UTRAN band XXXIII. - * @MM_MODEM_BAND_EUTRAN_XXXIV: E-UTRAN band XXXIV. - * @MM_MODEM_BAND_EUTRAN_XXXV: E-UTRAN band XXXV. - * @MM_MODEM_BAND_EUTRAN_XXXVI: E-UTRAN band XXXVI. - * @MM_MODEM_BAND_EUTRAN_XXXVII: E-UTRAN band XXXVII. - * @MM_MODEM_BAND_EUTRAN_XXXVIII: E-UTRAN band XXXVIII. - * @MM_MODEM_BAND_EUTRAN_XXXIX: E-UTRAN band XXXIX. - * @MM_MODEM_BAND_EUTRAN_XL: E-UTRAN band XL. - * @MM_MODEM_BAND_EUTRAN_XLI: E-UTRAN band XLI. - * @MM_MODEM_BAND_EUTRAN_XLII: E-UTRAN band XLII. - * @MM_MODEM_BAND_EUTRAN_XLIII: E-UTRAN band XLIII. - * @MM_MODEM_BAND_EUTRAN_XLIV: E-UTRAN band XLIV. - * @MM_MODEM_BAND_CDMA_BC0_CELLULAR_800: CDMA Band Class 0 (US Cellular 850MHz). - * @MM_MODEM_BAND_CDMA_BC1_PCS_1900: CDMA Band Class 1 (US PCS 1900MHz). - * @MM_MODEM_BAND_CDMA_BC2_TACS: CDMA Band Class 2 (UK TACS 900MHz). - * @MM_MODEM_BAND_CDMA_BC3_JTACS: CDMA Band Class 3 (Japanese TACS). - * @MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS: CDMA Band Class 4 (Korean PCS). - * @MM_MODEM_BAND_CDMA_BC5_NMT450: CDMA Band Class 5 (NMT 450MHz). - * @MM_MODEM_BAND_CDMA_BC6_IMT2000: CDMA Band Class 6 (IMT2000 2100MHz). - * @MM_MODEM_BAND_CDMA_BC7_CELLULAR_700: CDMA Band Class 7 (Cellular 700MHz). - * @MM_MODEM_BAND_CDMA_BC8_1800: CDMA Band Class 8 (1800MHz). - * @MM_MODEM_BAND_CDMA_BC9_900: CDMA Band Class 9 (900MHz). - * @MM_MODEM_BAND_CDMA_BC10_SECONDARY_800: CDMA Band Class 10 (US Secondary 800). - * @MM_MODEM_BAND_CDMA_BC11_PAMR_400: CDMA Band Class 11 (European PAMR 400MHz). - * @MM_MODEM_BAND_CDMA_BC12_PAMR_800: CDMA Band Class 12 (PAMR 800MHz). - * @MM_MODEM_BAND_CDMA_BC13_IMT2000_2500: CDMA Band Class 13 (IMT2000 2500MHz Expansion). - * @MM_MODEM_BAND_CDMA_BC14_PCS2_1900: CDMA Band Class 14 (More US PCS 1900MHz). - * @MM_MODEM_BAND_CDMA_BC15_AWS: CDMA Band Class 15 (AWS 1700MHz). - * @MM_MODEM_BAND_CDMA_BC16_US_2500: CDMA Band Class 16 (US 2500MHz). - * @MM_MODEM_BAND_CDMA_BC17_US_FLO_2500: CDMA Band Class 17 (US 2500MHz Forward Link Only). - * @MM_MODEM_BAND_CDMA_BC18_US_PS_700: CDMA Band Class 18 (US 700MHz Public Safety). - * @MM_MODEM_BAND_CDMA_BC19_US_LOWER_700: CDMA Band Class 19 (US Lower 700MHz). + * @MM_MODEM_BAND_G450: GSM/GPRS/EDGE 450 MHz. + * @MM_MODEM_BAND_G480: GSM/GPRS/EDGE 480 MHz. + * @MM_MODEM_BAND_G750: GSM/GPRS/EDGE 750 MHz. + * @MM_MODEM_BAND_G380: GSM/GPRS/EDGE 380 MHz. + * @MM_MODEM_BAND_G410: GSM/GPRS/EDGE 410 MHz. + * @MM_MODEM_BAND_G710: GSM/GPRS/EDGE 710 MHz. + * @MM_MODEM_BAND_G810: GSM/GPRS/EDGE 810 MHz. + * @MM_MODEM_BAND_UTRAN_1: UMTS 2100 MHz (IMT, UTRAN band 1). + * @MM_MODEM_BAND_UTRAN_2: UMTS 1900 MHz (PCS A-F, UTRAN band 2). + * @MM_MODEM_BAND_UTRAN_3: UMTS 1800 MHz (DCS, UTRAN band 3). + * @MM_MODEM_BAND_UTRAN_4: UMTS 1700 MHz (AWS A-F, UTRAN band 4). + * @MM_MODEM_BAND_UTRAN_5: UMTS 850 MHz (CLR, UTRAN band 5). + * @MM_MODEM_BAND_UTRAN_6: UMTS 800 MHz (UTRAN band 6). + * @MM_MODEM_BAND_UTRAN_7: UMTS 2600 MHz (IMT-E, UTRAN band 7). + * @MM_MODEM_BAND_UTRAN_8: UMTS 900 MHz (E-GSM, UTRAN band 8). + * @MM_MODEM_BAND_UTRAN_9: UMTS 1700 MHz (UTRAN band 9). + * @MM_MODEM_BAND_UTRAN_10: UMTS 1700 MHz (EAWS A-G, UTRAN band 10). + * @MM_MODEM_BAND_UTRAN_11: UMTS 1500 MHz (LPDC, UTRAN band 11). + * @MM_MODEM_BAND_UTRAN_12: UMTS 700 MHz (LSMH A/B/C, UTRAN band 12). + * @MM_MODEM_BAND_UTRAN_13: UMTS 700 MHz (USMH C, UTRAN band 13). + * @MM_MODEM_BAND_UTRAN_14: UMTS 700 MHz (USMH D, UTRAN band 14). + * @MM_MODEM_BAND_UTRAN_19: UMTS 800 MHz (UTRAN band 19). + * @MM_MODEM_BAND_UTRAN_20: UMTS 800 MHz (EUDD, UTRAN band 20). + * @MM_MODEM_BAND_UTRAN_21: UMTS 1500 MHz (UPDC, UTRAN band 21). + * @MM_MODEM_BAND_UTRAN_22: UMTS 3500 MHz (UTRAN band 22). + * @MM_MODEM_BAND_UTRAN_25: UMTS 1900 MHz (EPCS A-G, UTRAN band 25). + * @MM_MODEM_BAND_UTRAN_26: UMTS 850 MHz (ECLR, UTRAN band 26). + * @MM_MODEM_BAND_UTRAN_32: UMTS 1500 MHz (L-band, UTRAN band 32). + * @MM_MODEM_BAND_EUTRAN_1: E-UTRAN band 1. + * @MM_MODEM_BAND_EUTRAN_2: E-UTRAN band 2. + * @MM_MODEM_BAND_EUTRAN_3: E-UTRAN band 3. + * @MM_MODEM_BAND_EUTRAN_4: E-UTRAN band 4. + * @MM_MODEM_BAND_EUTRAN_5: E-UTRAN band 5. + * @MM_MODEM_BAND_EUTRAN_6: E-UTRAN band 6. + * @MM_MODEM_BAND_EUTRAN_7: E-UTRAN band 7. + * @MM_MODEM_BAND_EUTRAN_8: E-UTRAN band 8. + * @MM_MODEM_BAND_EUTRAN_9: E-UTRAN band 9. + * @MM_MODEM_BAND_EUTRAN_10: E-UTRAN band 10. + * @MM_MODEM_BAND_EUTRAN_11: E-UTRAN band 11. + * @MM_MODEM_BAND_EUTRAN_12: E-UTRAN band 12. + * @MM_MODEM_BAND_EUTRAN_13: E-UTRAN band 13. + * @MM_MODEM_BAND_EUTRAN_14: E-UTRAN band 14. + * @MM_MODEM_BAND_EUTRAN_17: E-UTRAN band 17. + * @MM_MODEM_BAND_EUTRAN_18: E-UTRAN band 18. + * @MM_MODEM_BAND_EUTRAN_19: E-UTRAN band 19. + * @MM_MODEM_BAND_EUTRAN_20: E-UTRAN band 20. + * @MM_MODEM_BAND_EUTRAN_21: E-UTRAN band 21. + * @MM_MODEM_BAND_EUTRAN_22: E-UTRAN band 22. + * @MM_MODEM_BAND_EUTRAN_23: E-UTRAN band 23. + * @MM_MODEM_BAND_EUTRAN_24: E-UTRAN band 24. + * @MM_MODEM_BAND_EUTRAN_25: E-UTRAN band 25. + * @MM_MODEM_BAND_EUTRAN_26: E-UTRAN band 26. + * @MM_MODEM_BAND_EUTRAN_27: E-UTRAN band 27. + * @MM_MODEM_BAND_EUTRAN_28: E-UTRAN band 28. + * @MM_MODEM_BAND_EUTRAN_29: E-UTRAN band 29. + * @MM_MODEM_BAND_EUTRAN_30: E-UTRAN band 30. + * @MM_MODEM_BAND_EUTRAN_31: E-UTRAN band 31. + * @MM_MODEM_BAND_EUTRAN_32: E-UTRAN band 32. + * @MM_MODEM_BAND_EUTRAN_33: E-UTRAN band 33. + * @MM_MODEM_BAND_EUTRAN_34: E-UTRAN band 34. + * @MM_MODEM_BAND_EUTRAN_35: E-UTRAN band 35. + * @MM_MODEM_BAND_EUTRAN_36: E-UTRAN band 36. + * @MM_MODEM_BAND_EUTRAN_37: E-UTRAN band 37. + * @MM_MODEM_BAND_EUTRAN_38: E-UTRAN band 38. + * @MM_MODEM_BAND_EUTRAN_39: E-UTRAN band 39. + * @MM_MODEM_BAND_EUTRAN_40: E-UTRAN band 40. + * @MM_MODEM_BAND_EUTRAN_41: E-UTRAN band 41. + * @MM_MODEM_BAND_EUTRAN_42: E-UTRAN band 42. + * @MM_MODEM_BAND_EUTRAN_43: E-UTRAN band 43. + * @MM_MODEM_BAND_EUTRAN_44: E-UTRAN band 44. + * @MM_MODEM_BAND_EUTRAN_45: E-UTRAN band 45. + * @MM_MODEM_BAND_EUTRAN_46: E-UTRAN band 46. + * @MM_MODEM_BAND_EUTRAN_47: E-UTRAN band 47. + * @MM_MODEM_BAND_EUTRAN_48: E-UTRAN band 48. + * @MM_MODEM_BAND_EUTRAN_49: E-UTRAN band 49. + * @MM_MODEM_BAND_EUTRAN_50: E-UTRAN band 50. + * @MM_MODEM_BAND_EUTRAN_51: E-UTRAN band 51. + * @MM_MODEM_BAND_EUTRAN_52: E-UTRAN band 52. + * @MM_MODEM_BAND_EUTRAN_53: E-UTRAN band 53. + * @MM_MODEM_BAND_EUTRAN_54: E-UTRAN band 54. + * @MM_MODEM_BAND_EUTRAN_55: E-UTRAN band 55. + * @MM_MODEM_BAND_EUTRAN_56: E-UTRAN band 56. + * @MM_MODEM_BAND_EUTRAN_57: E-UTRAN band 57. + * @MM_MODEM_BAND_EUTRAN_58: E-UTRAN band 58. + * @MM_MODEM_BAND_EUTRAN_59: E-UTRAN band 59. + * @MM_MODEM_BAND_EUTRAN_60: E-UTRAN band 60. + * @MM_MODEM_BAND_EUTRAN_61: E-UTRAN band 61. + * @MM_MODEM_BAND_EUTRAN_62: E-UTRAN band 62. + * @MM_MODEM_BAND_EUTRAN_63: E-UTRAN band 63. + * @MM_MODEM_BAND_EUTRAN_64: E-UTRAN band 64. + * @MM_MODEM_BAND_EUTRAN_65: E-UTRAN band 65. + * @MM_MODEM_BAND_EUTRAN_66: E-UTRAN band 66. + * @MM_MODEM_BAND_EUTRAN_67: E-UTRAN band 67. + * @MM_MODEM_BAND_EUTRAN_68: E-UTRAN band 68. + * @MM_MODEM_BAND_EUTRAN_69: E-UTRAN band 69. + * @MM_MODEM_BAND_EUTRAN_70: E-UTRAN band 70. + * @MM_MODEM_BAND_EUTRAN_71: E-UTRAN band 71. + * @MM_MODEM_BAND_CDMA_BC0: CDMA Band Class 0 (US Cellular 850MHz). + * @MM_MODEM_BAND_CDMA_BC1: CDMA Band Class 1 (US PCS 1900MHz). + * @MM_MODEM_BAND_CDMA_BC2: CDMA Band Class 2 (UK TACS 900MHz). + * @MM_MODEM_BAND_CDMA_BC3: CDMA Band Class 3 (Japanese TACS). + * @MM_MODEM_BAND_CDMA_BC4: CDMA Band Class 4 (Korean PCS). + * @MM_MODEM_BAND_CDMA_BC5: CDMA Band Class 5 (NMT 450MHz). + * @MM_MODEM_BAND_CDMA_BC6: CDMA Band Class 6 (IMT2000 2100MHz). + * @MM_MODEM_BAND_CDMA_BC7: CDMA Band Class 7 (Cellular 700MHz). + * @MM_MODEM_BAND_CDMA_BC8: CDMA Band Class 8 (1800MHz). + * @MM_MODEM_BAND_CDMA_BC9: CDMA Band Class 9 (900MHz). + * @MM_MODEM_BAND_CDMA_BC10: CDMA Band Class 10 (US Secondary 800). + * @MM_MODEM_BAND_CDMA_BC11: CDMA Band Class 11 (European PAMR 400MHz). + * @MM_MODEM_BAND_CDMA_BC12: CDMA Band Class 12 (PAMR 800MHz). + * @MM_MODEM_BAND_CDMA_BC13: CDMA Band Class 13 (IMT2000 2500MHz Expansion). + * @MM_MODEM_BAND_CDMA_BC14: CDMA Band Class 14 (More US PCS 1900MHz). + * @MM_MODEM_BAND_CDMA_BC15: CDMA Band Class 15 (AWS 1700MHz). + * @MM_MODEM_BAND_CDMA_BC16: CDMA Band Class 16 (US 2500MHz). + * @MM_MODEM_BAND_CDMA_BC17: CDMA Band Class 17 (US 2500MHz Forward Link Only). + * @MM_MODEM_BAND_CDMA_BC18: CDMA Band Class 18 (US 700MHz Public Safety). + * @MM_MODEM_BAND_CDMA_BC19: CDMA Band Class 19 (US Lower 700MHz). * @MM_MODEM_BAND_ANY: For certain operations, allow the modem to select a band automatically. * * Radio bands supported by the device when connecting to a mobile network. @@ -321,77 +373,134 @@ typedef enum { /*< underscore_name=mm_modem_band >*/ MM_MODEM_BAND_UNKNOWN = 0, /* GSM/UMTS bands */ - MM_MODEM_BAND_EGSM = 1, - MM_MODEM_BAND_DCS = 2, - MM_MODEM_BAND_PCS = 3, - MM_MODEM_BAND_G850 = 4, - MM_MODEM_BAND_U2100 = 5, - MM_MODEM_BAND_U1800 = 6, - MM_MODEM_BAND_U17IV = 7, - MM_MODEM_BAND_U800 = 8, - MM_MODEM_BAND_U850 = 9, - MM_MODEM_BAND_U900 = 10, - MM_MODEM_BAND_U17IX = 11, - MM_MODEM_BAND_U1900 = 12, - MM_MODEM_BAND_U2600 = 13, + MM_MODEM_BAND_EGSM = 1, + MM_MODEM_BAND_DCS = 2, + MM_MODEM_BAND_PCS = 3, + MM_MODEM_BAND_G850 = 4, + MM_MODEM_BAND_UTRAN_1 = 5, + MM_MODEM_BAND_UTRAN_3 = 6, + MM_MODEM_BAND_UTRAN_4 = 7, + MM_MODEM_BAND_UTRAN_6 = 8, + MM_MODEM_BAND_UTRAN_5 = 9, + MM_MODEM_BAND_UTRAN_8 = 10, + MM_MODEM_BAND_UTRAN_9 = 11, + MM_MODEM_BAND_UTRAN_2 = 12, + MM_MODEM_BAND_UTRAN_7 = 13, + MM_MODEM_BAND_G450 = 14, + MM_MODEM_BAND_G480 = 15, + MM_MODEM_BAND_G750 = 16, + MM_MODEM_BAND_G380 = 17, + MM_MODEM_BAND_G410 = 18, + MM_MODEM_BAND_G710 = 19, + MM_MODEM_BAND_G810 = 20, /* LTE bands */ - MM_MODEM_BAND_EUTRAN_I = 31, - MM_MODEM_BAND_EUTRAN_II = 32, - MM_MODEM_BAND_EUTRAN_III = 33, - MM_MODEM_BAND_EUTRAN_IV = 34, - MM_MODEM_BAND_EUTRAN_V = 35, - MM_MODEM_BAND_EUTRAN_VI = 36, - MM_MODEM_BAND_EUTRAN_VII = 37, - MM_MODEM_BAND_EUTRAN_VIII = 38, - MM_MODEM_BAND_EUTRAN_IX = 39, - MM_MODEM_BAND_EUTRAN_X = 40, - MM_MODEM_BAND_EUTRAN_XI = 41, - MM_MODEM_BAND_EUTRAN_XII = 42, - MM_MODEM_BAND_EUTRAN_XIII = 43, - MM_MODEM_BAND_EUTRAN_XIV = 44, - MM_MODEM_BAND_EUTRAN_XVII = 47, - MM_MODEM_BAND_EUTRAN_XVIII = 48, - MM_MODEM_BAND_EUTRAN_XIX = 49, - MM_MODEM_BAND_EUTRAN_XX = 50, - MM_MODEM_BAND_EUTRAN_XXI = 51, - MM_MODEM_BAND_EUTRAN_XXII = 52, - MM_MODEM_BAND_EUTRAN_XXIII = 53, - MM_MODEM_BAND_EUTRAN_XXIV = 54, - MM_MODEM_BAND_EUTRAN_XXV = 55, - MM_MODEM_BAND_EUTRAN_XXVI = 56, - MM_MODEM_BAND_EUTRAN_XXXIII = 63, - MM_MODEM_BAND_EUTRAN_XXXIV = 64, - MM_MODEM_BAND_EUTRAN_XXXV = 65, - MM_MODEM_BAND_EUTRAN_XXXVI = 66, - MM_MODEM_BAND_EUTRAN_XXXVII = 67, - MM_MODEM_BAND_EUTRAN_XXXVIII = 68, - MM_MODEM_BAND_EUTRAN_XXXIX = 69, - MM_MODEM_BAND_EUTRAN_XL = 70, - MM_MODEM_BAND_EUTRAN_XLI = 71, - MM_MODEM_BAND_EUTRAN_XLII = 72, - MM_MODEM_BAND_EUTRAN_XLIII = 73, - MM_MODEM_BAND_EUTRAN_XLIV = 74, + MM_MODEM_BAND_EUTRAN_1 = 31, + MM_MODEM_BAND_EUTRAN_2 = 32, + MM_MODEM_BAND_EUTRAN_3 = 33, + MM_MODEM_BAND_EUTRAN_4 = 34, + MM_MODEM_BAND_EUTRAN_5 = 35, + MM_MODEM_BAND_EUTRAN_6 = 36, + MM_MODEM_BAND_EUTRAN_7 = 37, + MM_MODEM_BAND_EUTRAN_8 = 38, + MM_MODEM_BAND_EUTRAN_9 = 39, + MM_MODEM_BAND_EUTRAN_10 = 40, + MM_MODEM_BAND_EUTRAN_11 = 41, + MM_MODEM_BAND_EUTRAN_12 = 42, + MM_MODEM_BAND_EUTRAN_13 = 43, + MM_MODEM_BAND_EUTRAN_14 = 44, + MM_MODEM_BAND_EUTRAN_17 = 47, + MM_MODEM_BAND_EUTRAN_18 = 48, + MM_MODEM_BAND_EUTRAN_19 = 49, + MM_MODEM_BAND_EUTRAN_20 = 50, + MM_MODEM_BAND_EUTRAN_21 = 51, + MM_MODEM_BAND_EUTRAN_22 = 52, + MM_MODEM_BAND_EUTRAN_23 = 53, + MM_MODEM_BAND_EUTRAN_24 = 54, + MM_MODEM_BAND_EUTRAN_25 = 55, + MM_MODEM_BAND_EUTRAN_26 = 56, + MM_MODEM_BAND_EUTRAN_27 = 57, + MM_MODEM_BAND_EUTRAN_28 = 58, + MM_MODEM_BAND_EUTRAN_29 = 59, + MM_MODEM_BAND_EUTRAN_30 = 60, + MM_MODEM_BAND_EUTRAN_31 = 61, + MM_MODEM_BAND_EUTRAN_32 = 62, + MM_MODEM_BAND_EUTRAN_33 = 63, + MM_MODEM_BAND_EUTRAN_34 = 64, + MM_MODEM_BAND_EUTRAN_35 = 65, + MM_MODEM_BAND_EUTRAN_36 = 66, + MM_MODEM_BAND_EUTRAN_37 = 67, + MM_MODEM_BAND_EUTRAN_38 = 68, + MM_MODEM_BAND_EUTRAN_39 = 69, + MM_MODEM_BAND_EUTRAN_40 = 70, + MM_MODEM_BAND_EUTRAN_41 = 71, + MM_MODEM_BAND_EUTRAN_42 = 72, + MM_MODEM_BAND_EUTRAN_43 = 73, + MM_MODEM_BAND_EUTRAN_44 = 74, + MM_MODEM_BAND_EUTRAN_45 = 75, + MM_MODEM_BAND_EUTRAN_46 = 76, + MM_MODEM_BAND_EUTRAN_47 = 77, + MM_MODEM_BAND_EUTRAN_48 = 78, + MM_MODEM_BAND_EUTRAN_49 = 79, + MM_MODEM_BAND_EUTRAN_50 = 80, + MM_MODEM_BAND_EUTRAN_51 = 81, + MM_MODEM_BAND_EUTRAN_52 = 82, + MM_MODEM_BAND_EUTRAN_53 = 83, + MM_MODEM_BAND_EUTRAN_54 = 84, + MM_MODEM_BAND_EUTRAN_55 = 85, + MM_MODEM_BAND_EUTRAN_56 = 86, + MM_MODEM_BAND_EUTRAN_57 = 87, + MM_MODEM_BAND_EUTRAN_58 = 88, + MM_MODEM_BAND_EUTRAN_59 = 89, + MM_MODEM_BAND_EUTRAN_60 = 90, + MM_MODEM_BAND_EUTRAN_61 = 91, + MM_MODEM_BAND_EUTRAN_62 = 92, + MM_MODEM_BAND_EUTRAN_63 = 93, + MM_MODEM_BAND_EUTRAN_64 = 94, + MM_MODEM_BAND_EUTRAN_65 = 95, + MM_MODEM_BAND_EUTRAN_66 = 96, + MM_MODEM_BAND_EUTRAN_67 = 97, + MM_MODEM_BAND_EUTRAN_68 = 98, + MM_MODEM_BAND_EUTRAN_69 = 99, + MM_MODEM_BAND_EUTRAN_70 = 100, + MM_MODEM_BAND_EUTRAN_71 = 101, /* CDMA Band Classes (see 3GPP2 C.S0057-C) */ - MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 = 128, - MM_MODEM_BAND_CDMA_BC1_PCS_1900 = 129, - MM_MODEM_BAND_CDMA_BC2_TACS = 130, - MM_MODEM_BAND_CDMA_BC3_JTACS = 131, - MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS = 132, - MM_MODEM_BAND_CDMA_BC5_NMT450 = 134, - MM_MODEM_BAND_CDMA_BC6_IMT2000 = 135, - MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 = 136, - MM_MODEM_BAND_CDMA_BC8_1800 = 137, - MM_MODEM_BAND_CDMA_BC9_900 = 138, - MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 = 139, - MM_MODEM_BAND_CDMA_BC11_PAMR_400 = 140, - MM_MODEM_BAND_CDMA_BC12_PAMR_800 = 141, - MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 = 142, - MM_MODEM_BAND_CDMA_BC14_PCS2_1900 = 143, - MM_MODEM_BAND_CDMA_BC15_AWS = 144, - MM_MODEM_BAND_CDMA_BC16_US_2500 = 145, - MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 = 146, - MM_MODEM_BAND_CDMA_BC18_US_PS_700 = 147, - MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 = 148, + MM_MODEM_BAND_CDMA_BC0 = 128, + MM_MODEM_BAND_CDMA_BC1 = 129, + MM_MODEM_BAND_CDMA_BC2 = 130, + MM_MODEM_BAND_CDMA_BC3 = 131, + MM_MODEM_BAND_CDMA_BC4 = 132, + MM_MODEM_BAND_CDMA_BC5 = 134, + MM_MODEM_BAND_CDMA_BC6 = 135, + MM_MODEM_BAND_CDMA_BC7 = 136, + MM_MODEM_BAND_CDMA_BC8 = 137, + MM_MODEM_BAND_CDMA_BC9 = 138, + MM_MODEM_BAND_CDMA_BC10 = 139, + MM_MODEM_BAND_CDMA_BC11 = 140, + MM_MODEM_BAND_CDMA_BC12 = 141, + MM_MODEM_BAND_CDMA_BC13 = 142, + MM_MODEM_BAND_CDMA_BC14 = 143, + MM_MODEM_BAND_CDMA_BC15 = 144, + MM_MODEM_BAND_CDMA_BC16 = 145, + MM_MODEM_BAND_CDMA_BC17 = 146, + MM_MODEM_BAND_CDMA_BC18 = 147, + MM_MODEM_BAND_CDMA_BC19 = 148, + /* Additional UMTS bands: + * 15-18 reserved + * 23-24 reserved + * 27-31 reserved + */ + MM_MODEM_BAND_UTRAN_10 = 210, + MM_MODEM_BAND_UTRAN_11 = 211, + MM_MODEM_BAND_UTRAN_12 = 212, + MM_MODEM_BAND_UTRAN_13 = 213, + MM_MODEM_BAND_UTRAN_14 = 214, + MM_MODEM_BAND_UTRAN_19 = 219, + MM_MODEM_BAND_UTRAN_20 = 220, + MM_MODEM_BAND_UTRAN_21 = 221, + MM_MODEM_BAND_UTRAN_22 = 222, + MM_MODEM_BAND_UTRAN_25 = 225, + MM_MODEM_BAND_UTRAN_26 = 226, + MM_MODEM_BAND_UTRAN_32 = 232, /* All/Any */ MM_MODEM_BAND_ANY = 256 } MMModemBand; @@ -834,6 +943,18 @@ } MMModemLocationSource; /** + * MMModemLocationAssistanceDataType: + * @MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE: None. + * @MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_XTRA: Qualcomm gpsOneXTRA. + * + * Type of assistance data that may be injected to the GNSS module. + */ +typedef enum { /*< underscore_name=mm_modem_location_assistance_data_type >*/ + MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE = 0, + MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_XTRA = 1 << 0, +} MMModemLocationAssistanceDataType; + +/** * MMModemContactsStorage: * @MM_MODEM_CONTACTS_STORAGE_UNKNOWN: Unknown location. * @MM_MODEM_CONTACTS_STORAGE_ME: Device's local memory. @@ -850,6 +971,28 @@ } MMModemContactsStorage; /** + * MMBearerType: + * @MM_BEARER_TYPE_UNKNOWN: Unknown bearer. + * @MM_BEARER_TYPE_DEFAULT: Primary context (2G/3G) or default bearer (4G), + * defined by the user of the API. + * @MM_BEARER_TYPE_DEFAULT_ATTACH: The initial default bearer established + * during LTE attach procedure, automatically connected as long as the device is + * regitered in the LTE network. + * @MM_BEARER_TYPE_DEDICATED: Secondary context (2G/3G) or dedicated bearer + * (4G), defined by the user of the API. These bearers use the same IP address + * used by a primary context or default bearer and provide a dedicated flow for + * specific traffic with different QoS settings. + * + * Type of context (2G/3G) or bearer (4G). + */ +typedef enum { /*< underscore_name=mm_bearer_type >*/ + MM_BEARER_TYPE_UNKNOWN = 0, + MM_BEARER_TYPE_DEFAULT = 1, + MM_BEARER_TYPE_DEFAULT_ATTACH = 2, + MM_BEARER_TYPE_DEDICATED = 3, +} MMBearerType; + +/** * MMBearerIpMethod: * @MM_BEARER_IP_METHOD_UNKNOWN: Unknown method. * @MM_BEARER_IP_METHOD_PPP: Use PPP to get IP addresses and DNS information. @@ -978,16 +1121,26 @@ * @MM_MODEM_3GPP_REGISTRATION_STATE_DENIED: Registration denied. * @MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN: Unknown registration status. * @MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING: Registered on a roaming network. + * @MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY: Registered for "SMS only", home network (applicable only when on LTE). + * @MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY: Registered for "SMS only", roaming network (applicable only when on LTE). + * @MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY: Emergency services only. + * @MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED: Registered for "CSFB not preferred", home network (applicable only when on LTE). + * @MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED: Registered for "CSFB not preferred", roaming network (applicable only when on LTE). * - * GSM registration code as defined in 3GPP TS 27.007 section 10.1.19. + * GSM registration code as defined in 3GPP TS 27.007. */ typedef enum { /*< underscore_name=mm_modem_3gpp_registration_state >*/ - MM_MODEM_3GPP_REGISTRATION_STATE_IDLE = 0, - MM_MODEM_3GPP_REGISTRATION_STATE_HOME = 1, - MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING = 2, - MM_MODEM_3GPP_REGISTRATION_STATE_DENIED = 3, - MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN = 4, - MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING = 5, + MM_MODEM_3GPP_REGISTRATION_STATE_IDLE = 0, + MM_MODEM_3GPP_REGISTRATION_STATE_HOME = 1, + MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING = 2, + MM_MODEM_3GPP_REGISTRATION_STATE_DENIED = 3, + MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN = 4, + MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING = 5, + MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY = 6, + MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY = 7, + MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY = 8, + MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED = 9, + MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED = 10, } MMModem3gppRegistrationState; /** @@ -1069,6 +1222,24 @@ } MMModem3gppUssdSessionState; /** + * MMModem3gppEpsUeModeOperation: + * @MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN: Unknown or not applicable. + * @MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_1: PS mode 1 of operation: EPS only, voice-centric. + * @MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_2: PS mode 2 of operation: EPS only, data-centric. + * @MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_1: CS/PS mode 1 of operation: EPS and non-EPS, voice-centric. + * @MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_2: CS/PS mode 2 of operation: EPS and non-EPS, data-centric. + * + * UE mode of operation for EPS, as per 3GPP TS 24.301. + */ +typedef enum { /*< underscore_name=mm_modem_3gpp_eps_ue_mode_operation >*/ + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN = 0, + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_1 = 1, + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_2 = 2, + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_1 = 3, + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_2 = 4, +} MMModem3gppEpsUeModeOperation; + +/** * MMFirmwareImageType: * @MM_FIRMWARE_IMAGE_TYPE_UNKNOWN: Unknown firmware type. * @MM_FIRMWARE_IMAGE_TYPE_GENERIC: Generic firmware image. @@ -1178,8 +1349,8 @@ * MMCallState: * @MM_CALL_STATE_UNKNOWN: default state for a new outgoing call. * @MM_CALL_STATE_DIALING: outgoing call started. Wait for free channel. - * @MM_CALL_STATE_RINGING_IN: outgoing call attached to GSM network, waiting for an answer. - * @MM_CALL_STATE_RINGING_OUT: incoming call is waiting for an answer. + * @MM_CALL_STATE_RINGING_IN: incoming call is waiting for an answer. + * @MM_CALL_STATE_RINGING_OUT: outgoing call attached to GSM network, waiting for an answer. * @MM_CALL_STATE_ACTIVE: call is active between two peers. * @MM_CALL_STATE_HELD: held call (by +CHLD AT command). * @MM_CALL_STATE_WAITING: waiting call (by +CCWA AT command). @@ -1205,8 +1376,9 @@ * @MM_CALL_STATE_REASON_INCOMING_NEW: Received a new incoming call. * @MM_CALL_STATE_REASON_ACCEPTED: Dialing or Ringing call is accepted. * @MM_CALL_STATE_REASON_TERMINATED: Call is correctly terminated. - * @MM_CALL_STATE_REASON_REFUSED_OR_BUSY: Remote peer is busy or refused call + * @MM_CALL_STATE_REASON_REFUSED_OR_BUSY: Remote peer is busy or refused call. * @MM_CALL_STATE_REASON_ERROR: Wrong number or generic network error. + * @MM_CALL_STATE_REASON_AUDIO_SETUP_FAILED: Error setting up audio channel. */ typedef enum { /*< underscore_name=mm_call_state_reason >*/ MM_CALL_STATE_REASON_UNKNOWN = 0, @@ -1215,7 +1387,8 @@ MM_CALL_STATE_REASON_ACCEPTED = 3, MM_CALL_STATE_REASON_TERMINATED = 4, MM_CALL_STATE_REASON_REFUSED_OR_BUSY = 5, - MM_CALL_STATE_REASON_ERROR = 6 + MM_CALL_STATE_REASON_ERROR = 6, + MM_CALL_STATE_REASON_AUDIO_SETUP_FAILED = 7 } MMCallStateReason; /** @@ -1230,4 +1403,18 @@ MM_CALL_DIRECTION_OUTGOING = 2 } MMCallDirection; +/** + * MMModemFirmwareUpdateMethod: + * @MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE: No method specified. + * @MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT: Device supports fastboot-based update. + * @MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC: Device supports QMI PDC based update. + * + * Type of firmware update method supported by the module. + */ +typedef enum { /*< underscore_name=mm_modem_firmware_update_method >*/ + MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE = 0, + MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT = 1 << 0, + MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC = 1 << 1, +} MMModemFirmwareUpdateMethod; + #endif /* _MODEMMANAGER_ENUMS_H_ */ diff -Nru modemmanager-1.6.8/include/ModemManager-errors.h modemmanager-1.10.0/include/ModemManager-errors.h --- modemmanager-1.6.8/include/ModemManager-errors.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/include/ModemManager-errors.h 2018-11-15 09:55:53.000000000 +0100 @@ -112,90 +112,140 @@ * @MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK: Service provider personalisation PUK required. * @MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN: Corporate personalisation PIN required. * @MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK: Corporate personalisation PUK required. + * @MM_MOBILE_EQUIPMENT_ERROR_HIDDEN_KEY_REQUIRED: Hidden key required. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_EAP_METHOD_NOT_SUPPORTED: EAP method not supported. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PARAMETERS: Incorrect parameters. Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN: Unknown. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_HLR: IMSI unknown in HLR. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_VLR: IMSI unknown in VLR. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS: Illegal MS. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME: Illegal ME. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED: GPRS service not allowed. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED: GPRS and non-GPRS services not allowed. Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED: PLMN not allowed. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED: Location area not allowed. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED: Roaming not allowed in this location area. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_NO_CELLS_IN_LOCATION_AREA: No cells in this location area. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_NETWORK_FAILURE: Network failure. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONGESTION: Congestion. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_NOT_AUTHORIZED_FOR_CSG: GPRS not authorized for CSG. Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES: Insufficient resources. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_MISSING_OR_UNKNOWN_APN: Missing or unknown APN. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_ADDRESS_OR_TYPE: Unknown PDP address or type. Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED: User authentication failed. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_BY_GGSN_OR_GW: Activation rejected by GGSN or gateway. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_UNSPECIFIED: Activation rejected (reason unspecified). Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED: Service option not supported. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED: Requested service option not subscribed. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER: Service option temporarily out of order. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_FEATURE_NOT_SUPPORTED: Feature not supported. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERROR_IN_TFT_OPERATION: Semantic error in TFT operation. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_TFT_OPERATION: Syntactical error in TFT operation. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_CONTEXT: Unknown PDP context. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERRORS_IN_PACKET_FILTER: Semantic errors in packet filter. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_PACKET_FILTER: Syntactical error in packet filter. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED: PDP context witout TFT already activated. Since: 1.8. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN: Unspecified GPRS error. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE: PDP authentication failure. * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS: Invalid mobile class. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_LAST_PDN_DISCONNECTION_NOT_ALLOWED: Last PDN disconnection not allowed. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTICALLY_INCORRECT_MESSAGE: Semantically incorrect message. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_MANDATORY_IE_ERROR: Mandatory IE error. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_IE_NOT_IMPLEMENTED: IE not implemented. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONDITIONAL_IE_ERROR: Conditional IE error. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNSPECIFIED_PROTOCOL_ERROR: Unspecified protocol error. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_OPERATOR_DETERMINED_BARRING: Operator determined barring. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED: Maximum number of PDP contexts reached. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUESTED_APN_NOT_SUPPORTED: Requested APN not supported. Since: 1.8. + * @MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUEST_REJECTED_BCM_VIOLATION: Request rejected (BCM violation). Since: 1.8. * * Enumeration of Mobile Equipment errors, as defined in 3GPP TS 07.07 version 7.8.0. */ typedef enum { /*< underscore_name=mm_mobile_equipment_error >*/ /* General errors */ - MM_MOBILE_EQUIPMENT_ERROR_PHONE_FAILURE = 0, /*< nick=PhoneFailure >*/ - MM_MOBILE_EQUIPMENT_ERROR_NO_CONNECTION = 1, /*< nick=NoConnection >*/ - MM_MOBILE_EQUIPMENT_ERROR_LINK_RESERVED = 2, /*< nick=LinkReserved >*/ - MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED = 3, /*< nick=NotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED = 4, /*< nick=NotSupported >*/ - MM_MOBILE_EQUIPMENT_ERROR_PH_SIM_PIN = 5, /*< nick=PhSimPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PIN = 6, /*< nick=PhFsimPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PUK = 7, /*< nick=PhFsimPuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED = 10, /*< nick=SimNotInserted >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN = 11, /*< nick=SimPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK = 12, /*< nick=SimPuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE = 13, /*< nick=SimFailure >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY = 14, /*< nick=SimBusy >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG = 15, /*< nick=SimWrong >*/ - MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD = 16, /*< nick=IncorrectPassword >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN2 = 17, /*< nick=SimPin2 >*/ - MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK2 = 18, /*< nick=SimPuk2 >*/ - MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FULL = 20, /*< nick=MemoryFull >*/ - MM_MOBILE_EQUIPMENT_ERROR_INVALID_INDEX = 21, /*< nick=InvalidIndex >*/ - MM_MOBILE_EQUIPMENT_ERROR_NOT_FOUND = 22, /*< nick=NotFound >*/ - MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FAILURE = 23, /*< nick=MemoryFailure >*/ - MM_MOBILE_EQUIPMENT_ERROR_TEXT_TOO_LONG = 24, /*< nick=TextTooLong >*/ - MM_MOBILE_EQUIPMENT_ERROR_INVALID_CHARS = 25, /*< nick=InvalidChars >*/ - MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_TOO_LONG = 26, /*< nick=DialStringTooLong >*/ - MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_INVALID = 27, /*< nick=DialStringInvalid >*/ - MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK = 30, /*< nick=NoNetwork >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT = 31, /*< nick=NetworkTimeout >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED = 32, /*< nick=NetworkNotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PIN = 40, /*< nick=NetworkPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PUK = 41, /*< nick=NetworkPuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PIN = 42, /*< nick=NetworkSubsetPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PUK = 43, /*< nick=NetworkSubsetPuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PIN = 44, /*< nick=ServicePin >*/ - MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK = 45, /*< nick=ServicePuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN = 46, /*< nick=CorpPin >*/ - MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK = 47, /*< nick=CorpPuk >*/ - MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN = 100, /*< nick=Unknown >*/ + MM_MOBILE_EQUIPMENT_ERROR_PHONE_FAILURE = 0, /*< nick=PhoneFailure >*/ + MM_MOBILE_EQUIPMENT_ERROR_NO_CONNECTION = 1, /*< nick=NoConnection >*/ + MM_MOBILE_EQUIPMENT_ERROR_LINK_RESERVED = 2, /*< nick=LinkReserved >*/ + MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED = 3, /*< nick=NotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED = 4, /*< nick=NotSupported >*/ + MM_MOBILE_EQUIPMENT_ERROR_PH_SIM_PIN = 5, /*< nick=PhSimPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PIN = 6, /*< nick=PhFsimPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PUK = 7, /*< nick=PhFsimPuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED = 10, /*< nick=SimNotInserted >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN = 11, /*< nick=SimPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK = 12, /*< nick=SimPuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE = 13, /*< nick=SimFailure >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY = 14, /*< nick=SimBusy >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG = 15, /*< nick=SimWrong >*/ + MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD = 16, /*< nick=IncorrectPassword >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN2 = 17, /*< nick=SimPin2 >*/ + MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK2 = 18, /*< nick=SimPuk2 >*/ + MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FULL = 20, /*< nick=MemoryFull >*/ + MM_MOBILE_EQUIPMENT_ERROR_INVALID_INDEX = 21, /*< nick=InvalidIndex >*/ + MM_MOBILE_EQUIPMENT_ERROR_NOT_FOUND = 22, /*< nick=NotFound >*/ + MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FAILURE = 23, /*< nick=MemoryFailure >*/ + MM_MOBILE_EQUIPMENT_ERROR_TEXT_TOO_LONG = 24, /*< nick=TextTooLong >*/ + MM_MOBILE_EQUIPMENT_ERROR_INVALID_CHARS = 25, /*< nick=InvalidChars >*/ + MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_TOO_LONG = 26, /*< nick=DialStringTooLong >*/ + MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_INVALID = 27, /*< nick=DialStringInvalid >*/ + MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK = 30, /*< nick=NoNetwork >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT = 31, /*< nick=NetworkTimeout >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED = 32, /*< nick=NetworkNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PIN = 40, /*< nick=NetworkPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PUK = 41, /*< nick=NetworkPuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PIN = 42, /*< nick=NetworkSubsetPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PUK = 43, /*< nick=NetworkSubsetPuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PIN = 44, /*< nick=ServicePin >*/ + MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK = 45, /*< nick=ServicePuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN = 46, /*< nick=CorpPin >*/ + MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK = 47, /*< nick=CorpPuk >*/ + MM_MOBILE_EQUIPMENT_ERROR_HIDDEN_KEY_REQUIRED = 48, /*< nick=HiddenKeyRequired >*/ + MM_MOBILE_EQUIPMENT_ERROR_EAP_METHOD_NOT_SUPPORTED = 49, /*< nick=EapMethodNotSupported >*/ + MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PARAMETERS = 50, /*< nick=IncorrectParameters >*/ + MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN = 100, /*< nick=Unknown >*/ /* GPRS related errors */ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_HLR = 102, /*< nick=GprsImsiUnknownInHlr >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS = 103, /*< nick=GprsIllegalMs >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_VLR = 104, /*< nick=GprsImsiUnknownInVlr >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME = 106, /*< nick=GprsIllegalMe >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED = 107, /*< nick=GprsServiceNotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED = 111, /*< nick=GprsPlmnNotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED = 112, /*< nick=GprsLocationNotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED = 113, /*< nick=GprsRomaingNotAllowed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_NO_CELLS_IN_LOCATION_AREA = 115, /*< nick=GprsNoCellsInLocationArea >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_NETWORK_FAILURE = 117, /*< nick=GprsNetworkFailure >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONGESTION = 122, /*< nick=GprsCongestion >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES = 126, /*< nick=GprsInsufficientResources >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_MISSING_OR_UNKNOWN_APN = 127, /*< nick=GprsMissingOrUnknownApn >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED = 129, /*< nick=GprsUserAuthenticationFailed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED = 132, /*< nick=GprsServiceOptionNotSupported >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED = 133, /*< nick=GprsServiceOptionNotSubscribed >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER = 134, /*< nick=GprsServiceOptionOutOfOrder >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN = 148, /*< nick=GprsUnknown >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE = 149, /*< nick=GprsPdpAuthFailure >*/ - MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS = 150, /*< nick=GprsInvalidMobileClass >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_HLR = 102, /*< nick=GprsImsiUnknownInHlr >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS = 103, /*< nick=GprsIllegalMs >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_IMSI_UNKNOWN_IN_VLR = 104, /*< nick=GprsImsiUnknownInVlr >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME = 106, /*< nick=GprsIllegalMe >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED = 107, /*< nick=GprsServiceNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 108, /*< nick=GprsAndNonGprsServicesNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED = 111, /*< nick=GprsPlmnNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED = 112, /*< nick=GprsLocationNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED = 113, /*< nick=GprsRomaingNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_NO_CELLS_IN_LOCATION_AREA = 115, /*< nick=GprsNoCellsInLocationArea >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_NETWORK_FAILURE = 117, /*< nick=GprsNetworkFailure >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONGESTION = 122, /*< nick=GprsCongestion >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_NOT_AUTHORIZED_FOR_CSG = 125, /*< nick=NotAuthorizedForCsg >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES = 126, /*< nick=GprsInsufficientResources >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_MISSING_OR_UNKNOWN_APN = 127, /*< nick=GprsMissingOrUnknownApn >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_ADDRESS_OR_TYPE = 128, /*< nick=GprsUnknownPdpAddressOrType >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED = 129, /*< nick=GprsUserAuthenticationFailed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_BY_GGSN_OR_GW = 130, /*< nick=GprsActivationRejectedByGgsnOrGw >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_UNSPECIFIED = 131, /*< nick=GprsActivationRejectedUnspecified >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED = 132, /*< nick=GprsServiceOptionNotSupported >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED = 133, /*< nick=GprsServiceOptionNotSubscribed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER = 134, /*< nick=GprsServiceOptionOutOfOrder >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_FEATURE_NOT_SUPPORTED = 140, /*< nick=GprsFeatureNotSupported >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERROR_IN_TFT_OPERATION = 141, /*< nick=GprsSemanticErrorInTftOperation >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_TFT_OPERATION = 142, /*< nick=GprsSyntacticalErrorInTftOperation >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_CONTEXT = 143, /*< nick=GprsUnknownPdpContext >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTIC_ERRORS_IN_PACKET_FILTER = 144, /*< nick=GprsSemanticErrorsInPacketFilter >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SYNTACTICAL_ERROR_IN_PACKET_FILTER = 145, /*< nick=GprsSyntacticalErrorsInPacketFilter >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED = 146, /*< nick=GprsPdpContextWithoutTftAlreadyActivated >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN = 148, /*< nick=GprsUnknown >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE = 149, /*< nick=GprsPdpAuthFailure >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS = 150, /*< nick=GprsInvalidMobileClass >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_LAST_PDN_DISCONNECTION_NOT_ALLOWED = 171, /*< nick=GprsLastPdnDisconnectionNotAllowed >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_SEMANTICALLY_INCORRECT_MESSAGE = 172, /*< nick=GprsSemanticallyIncorrectMessage >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_MANDATORY_IE_ERROR = 173, /*< nick=GprsMandatoryIeError >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_IE_NOT_IMPLEMENTED = 174, /*< nick=GprsIeNotImplemented >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_CONDITIONAL_IE_ERROR = 175, /*< nick=GprsConditionalIeError >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNSPECIFIED_PROTOCOL_ERROR = 176, /*< nick=GprsUnspecifiedProtocolError >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_OPERATOR_DETERMINED_BARRING = 177, /*< nick=GprsOperatorDeterminedBarring >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED = 178, /*< nick=GprsMaximumNumberOfPdpContextsReached >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUESTED_APN_NOT_SUPPORTED = 179, /*< nick=GprsRequestedApnNotSupported >*/ + MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUEST_REJECTED_BCM_VIOLATION = 180, /*< nick=GprsRequestRejectedBcmViolation >*/ } MMMobileEquipmentError; /** diff -Nru modemmanager-1.6.8/include/ModemManager.h modemmanager-1.10.0/include/ModemManager.h --- modemmanager-1.6.8/include/ModemManager.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/include/ModemManager.h 2018-11-15 09:55:53.000000000 +0100 @@ -37,6 +37,9 @@ /* Public header with errors */ #include +/* Public header with compatibility types and methods */ +#include + /* Public header with version info */ #include diff -Nru modemmanager-1.6.8/include/ModemManager-names.h modemmanager-1.10.0/include/ModemManager-names.h --- modemmanager-1.6.8/include/ModemManager-names.h 2017-06-17 10:25:04.000000000 +0200 +++ modemmanager-1.10.0/include/ModemManager-names.h 2019-01-17 16:15:56.000000000 +0100 @@ -74,6 +74,9 @@ #define MM_MANAGER_METHOD_SCANDEVICES "ScanDevices" #define MM_MANAGER_METHOD_SETLOGGING "SetLogging" +#define MM_MANAGER_METHOD_REPORTKERNELEVENT "ReportKernelEvent" +#define MM_MANAGER_METHOD_INHIBITDEVICE "InhibitDevice" +#define MM_MANAGER_PROPERTY_VERSION "Version" /* * Interface 'org.freedesktop.ModemManager1.Sim' */ @@ -99,6 +102,7 @@ #define MM_BEARER_PROPERTY_IP6CONFIG "Ip6Config" #define MM_BEARER_PROPERTY_STATS "Stats" #define MM_BEARER_PROPERTY_IPTIMEOUT "IpTimeout" +#define MM_BEARER_PROPERTY_BEARERTYPE "BearerType" #define MM_BEARER_PROPERTY_PROPERTIES "Properties" /* * Interface 'org.freedesktop.ModemManager1.Sms' @@ -136,6 +140,8 @@ #define MM_CALL_PROPERTY_STATEREASON "StateReason" #define MM_CALL_PROPERTY_DIRECTION "Direction" #define MM_CALL_PROPERTY_NUMBER "Number" +#define MM_CALL_PROPERTY_AUDIOPORT "AudioPort" +#define MM_CALL_PROPERTY_AUDIOFORMAT "AudioFormat" /* * Interface 'org.freedesktop.ModemManager1.Modem' */ @@ -161,6 +167,7 @@ #define MM_MODEM_PROPERTY_MANUFACTURER "Manufacturer" #define MM_MODEM_PROPERTY_MODEL "Model" #define MM_MODEM_PROPERTY_REVISION "Revision" +#define MM_MODEM_PROPERTY_HARDWAREREVISION "HardwareRevision" #define MM_MODEM_PROPERTY_DEVICEIDENTIFIER "DeviceIdentifier" #define MM_MODEM_PROPERTY_DEVICE "Device" #define MM_MODEM_PROPERTY_DRIVERS "Drivers" @@ -197,12 +204,18 @@ #define MM_MODEM_MODEM3GPP_METHOD_REGISTER "Register" #define MM_MODEM_MODEM3GPP_METHOD_SCAN "Scan" +#define MM_MODEM_MODEM3GPP_METHOD_SETEPSUEMODEOPERATION "SetEpsUeModeOperation" +#define MM_MODEM_MODEM3GPP_METHOD_SETINITIALEPSBEARERSETTINGS "SetInitialEpsBearerSettings" #define MM_MODEM_MODEM3GPP_PROPERTY_IMEI "Imei" #define MM_MODEM_MODEM3GPP_PROPERTY_REGISTRATIONSTATE "RegistrationState" #define MM_MODEM_MODEM3GPP_PROPERTY_OPERATORCODE "OperatorCode" #define MM_MODEM_MODEM3GPP_PROPERTY_OPERATORNAME "OperatorName" #define MM_MODEM_MODEM3GPP_PROPERTY_ENABLEDFACILITYLOCKS "EnabledFacilityLocks" #define MM_MODEM_MODEM3GPP_PROPERTY_SUBSCRIPTIONSTATE "SubscriptionState" +#define MM_MODEM_MODEM3GPP_PROPERTY_EPSUEMODEOPERATION "EpsUeModeOperation" +#define MM_MODEM_MODEM3GPP_PROPERTY_PCO "Pco" +#define MM_MODEM_MODEM3GPP_PROPERTY_INITIALEPSBEARER "InitialEpsBearer" +#define MM_MODEM_MODEM3GPP_PROPERTY_INITIALEPSBEARERSETTINGS "InitialEpsBearerSettings" /* * Interface 'org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd' */ @@ -246,12 +259,15 @@ #define MM_MODEM_LOCATION_METHOD_SETUP "Setup" #define MM_MODEM_LOCATION_METHOD_GETLOCATION "GetLocation" #define MM_MODEM_LOCATION_METHOD_SETSUPLSERVER "SetSuplServer" +#define MM_MODEM_LOCATION_METHOD_INJECTASSISTANCEDATA "InjectAssistanceData" #define MM_MODEM_LOCATION_METHOD_SETGPSREFRESHRATE "SetGpsRefreshRate" #define MM_MODEM_LOCATION_PROPERTY_CAPABILITIES "Capabilities" +#define MM_MODEM_LOCATION_PROPERTY_SUPPORTEDASSISTANCEDATA "SupportedAssistanceData" #define MM_MODEM_LOCATION_PROPERTY_ENABLED "Enabled" #define MM_MODEM_LOCATION_PROPERTY_SIGNALSLOCATION "SignalsLocation" #define MM_MODEM_LOCATION_PROPERTY_LOCATION "Location" #define MM_MODEM_LOCATION_PROPERTY_SUPLSERVER "SuplServer" +#define MM_MODEM_LOCATION_PROPERTY_ASSISTANCEDATASERVERS "AssistanceDataServers" #define MM_MODEM_LOCATION_PROPERTY_GPSREFRESHRATE "GpsRefreshRate" /* * Interface 'org.freedesktop.ModemManager1.Modem.Time' @@ -266,6 +282,7 @@ #define MM_MODEM_FIRMWARE_METHOD_LIST "List" #define MM_MODEM_FIRMWARE_METHOD_SELECT "Select" +#define MM_MODEM_FIRMWARE_PROPERTY_UPDATESETTINGS "UpdateSettings" /* * Interface 'org.freedesktop.ModemManager1.Modem.Signal' */ diff -Nru modemmanager-1.6.8/include/ModemManager-tags.h modemmanager-1.10.0/include/ModemManager-tags.h --- modemmanager-1.6.8/include/ModemManager-tags.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/include/ModemManager-tags.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,210 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +/* + * NOTE! this file is NOT part of the installed ModemManager API. + * + * We keep this file under include/ because we want to build and + * expose the associated documentation. + */ + +#ifndef MM_TAGS_H +#define MM_TAGS_H + +/** + * SECTION:mm-tags + * @short_description: generic udev tags supported + * + * This section defines generic udev tags that are used by ModemManager, + * associated to full devices or to specific ports in a given device. + */ + +/** + * ID_MM_CANDIDATE: + * + * This is a port-specific tag added automatically when all other + * ModemManager related tags have already been set. + */ +#define ID_MM_CANDIDATE "ID_MM_CANDIDATE" + +/** + * ID_MM_PHYSDEV_UID: + * + * This is a device-specific tag that allows users to 'name' modem + * devices with a predefined 'unique ID' string. + * + * When this tag is given per-port, the daemon will consider that all + * ports with the same UID value are associated to the same device. + * This is useful for e.g. modems that expose multiple RS232 ports + * connected to the system via different platform ports (or USB to + * RS232 adapters). + * + * This UID is exposed in + * the 'Device' + * property and can then be used in mmcli calls to refer unequivocally + * to a specific device, regardless of its modem index, e.g.: + * $ mmcli --modem=UID ... + */ +#define ID_MM_PHYSDEV_UID "ID_MM_PHYSDEV_UID" + +/** + * ID_MM_DEVICE_PROCESS: + * + * This is a device-specific tag that allows explicitly requesting the + * processing of all ports exposed by the device. This tag is usually + * used by users when the daemon runs with WHITELIST-ONLY filter policy + * type, and is associated to the MM_FILTER_RULE_EXPLICIT_WHITELIST rule. + * + * This tag may also be specified in specific ports, e.g. when the modem + * exposes a single platform port without any parent device. + */ +#define ID_MM_DEVICE_PROCESS "ID_MM_DEVICE_PROCESS" + +/** + * ID_MM_PORT_IGNORE: + * + * This is a port-specific tag that allows explicitly ignoring a given port + * in a device. + * + * This tag applies to all types of ports. + */ +#define ID_MM_PORT_IGNORE "ID_MM_PORT_IGNORE" + +/** + * ID_MM_DEVICE_IGNORE: + * + * This is a device-specific tag that allows explicitly blacklisting + * devices that expose TTY devices so that they are never probed. + * + * This tag is used when the daemon runs with DEFAULT or PARANOID + * filter policy type, and is associated to the MM_FILTER_RULE_TTY_BLACKLIST + * rule. + * + * This tag is ignored when the STRICT filter policy is used. + */ +#define ID_MM_DEVICE_IGNORE "ID_MM_DEVICE_IGNORE" + +/** + * ID_MM_DEVICE_MANUAL_SCAN_ONLY: + * + * This is a device-specific tag that allows explicitly greylisting + * devices that expose TTY devices so that they are never probed + * automatically. Instead, an explicit manual scan request may be sent + * to the daemon so that the TTY ports exposed by the device are + * probed. + * + * This tag is used when the daemon runs with DEFAULT or PARANOID + * filter policy type, and is associated to the MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY + * rule. + * + * This tag is ignored when the STRICT filter policy is used. + */ +#define ID_MM_DEVICE_MANUAL_SCAN_ONLY "ID_MM_DEVICE_MANUAL_SCAN_ONLY" + +/** + * ID_MM_PLATFORM_DRIVER_PROBE: + * + * This is a port-specific tag applied to platform ports so that they + * are probed automatically by the daemon. Platform ports that don't + * have this tag will never probed. This tag is a bit redundant, as + * the user could also use ID_MM_DEVICE_PROCESS for the same purpose. + * + * This tag is associated to the MM_FILTER_RULE_TTY_PLATFORM_DRIVER + * rule, which is only meaningful when the daemon runs with the + * DEFAULT filter policy type, as that is the only one that would + * allow probing all ports not explicitly forbidden before the last + * MM_FILTER_RULE_TTY_DEFAULT_ALLOWED rule. + */ +#define ID_MM_PLATFORM_DRIVER_PROBE "ID_MM_PLATFORM_DRIVER_PROBE" + +/** + * ID_MM_PORT_TYPE_AT_PRIMARY: + * + * This is a port-specific tag applied to TTYs that we know in advance + * are AT ports to be used as primary control ports. + * + * This tag will also prevent QCDM probing on the port. + */ +#define ID_MM_PORT_TYPE_AT_PRIMARY "ID_MM_PORT_TYPE_AT_PRIMARY" + +/** + * ID_MM_PORT_TYPE_AT_SECONDARY: + * + * This is a port-specific tag applied to TTYs that we know in advance + * are AT ports to be used as secondary control ports. + * + * This tag will also prevent QCDM probing on the port. + */ +#define ID_MM_PORT_TYPE_AT_SECONDARY "ID_MM_PORT_TYPE_AT_SECONDARY" + +/** + * ID_MM_PORT_TYPE_AT_PPP: + * + * This is a port-specific tag applied to TTYs that we know in advance + * are AT ports to be used as data ports exclusively. + * + * This tag will also prevent QCDM probing on the port. + */ +#define ID_MM_PORT_TYPE_AT_PPP "ID_MM_PORT_TYPE_AT_PPP" + +/** + * ID_MM_PORT_TYPE_QCDM: + * + * This is a port-specific tag applied to TTYs that we know in advance + * are QCDM ports. + * + * The only purpose of this tag is to prevent AT probing in the port. + */ +#define ID_MM_PORT_TYPE_QCDM "ID_MM_PORT_TYPE_QCDM" + +/** + * ID_MM_PORT_TYPE_GPS: + * + * This is a port-specific tag applied to TTYs that we know in advance + * are GPS data ports where we expect to receive NMEA traces. + * + * This tag also prevents AT and QCDM probing in the port. + */ +#define ID_MM_PORT_TYPE_GPS "ID_MM_PORT_TYPE_GPS" + +/** + * ID_MM_TTY_BAUDRATE: + * + * This is a port-specific tag applied to TTYs that require a specific + * baudrate to work. USB modems will usually allow auto-bauding + * configuration, so this tag is really only meaningful to true RS232 + * devices. + * + * The value of the tag should be the number of bauds per second to + * use when talking to the port, e.g. "115200". If not given, the + * default of 57600bps is assumed. + */ +#define ID_MM_TTY_BAUDRATE "ID_MM_TTY_BAUDRATE" + +/** + * ID_MM_TTY_FLOW_CONTROL: + * + * This is a port-specific tag applied to TTYs that require a specific + * flow control mechanism to work not only in data mode but also in + * control mode. + * + * The value of the tag should be either 'none', 'xon-xoff' or + * 'rts-cts', and must be a flow control value supported by the device + * where it's configured. If not given, it is assumed that the TTYs + * don't require any specific flow control setting in command mode. + */ +#define ID_MM_TTY_FLOW_CONTROL "ID_MM_TTY_FLOW_CONTROL" + +#endif /* MM_TAGS_H */ diff -Nru modemmanager-1.6.8/include/ModemManager-version.h modemmanager-1.10.0/include/ModemManager-version.h --- modemmanager-1.6.8/include/ModemManager-version.h 2017-06-17 10:25:02.000000000 +0200 +++ modemmanager-1.10.0/include/ModemManager-version.h 2019-01-17 16:15:53.000000000 +0100 @@ -42,7 +42,7 @@ * Evaluates to the minor version number of ModemManager which this source * is compiled against. */ -#define MM_MINOR_VERSION (6) +#define MM_MINOR_VERSION (10) /** * MM_MICRO_VERSION: @@ -50,7 +50,7 @@ * Evaluates to the micro version number of ModemManager which this source * compiled against. */ -#define MM_MICRO_VERSION (8) +#define MM_MICRO_VERSION (0) /** * MM_CHECK_VERSION: diff -Nru modemmanager-1.6.8/INSTALL modemmanager-1.10.0/INSTALL --- modemmanager-1.6.8/INSTALL 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/INSTALL 2019-01-17 16:15:48.000000000 +0100 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -12,97 +12,96 @@ Basic Installation ================== - Briefly, the shell command `./configure && make && make install' + Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for +more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented +'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. - The `configure' shell script attempts to guess correct values for + The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you +some point 'config.cache' contains results you don't want to keep, you may remove or edit it. - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. The simplest way to compile this package is: - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. - Running `configure' might take a while. While running, it prints + Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. - 2. Type `make' to compile the package. + 2. Type 'make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. - 4. Type `make install' to install the programs and any data files and + 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root + user, and only the 'make install' phase executed with root privileges. - 5. Optionally, type `make installcheck' to repeat any self-tests, but + 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required + regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. - 7. Often, you can also type `make uninstall' to remove the installed + 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. - 8. Some packages, particularly those that use Automake, provide `make + 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. + targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' +the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix @@ -113,21 +112,21 @@ You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. - With a non-GNU `make', it is safer to compile the package for one + With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before +installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ @@ -136,105 +135,104 @@ This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. +using the 'lipo' tool if you have problems. Installation Names ================== - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or +correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without +'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each -affected directory. For example, `make install +affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the package recognizes. - For packages that use the X Window System, `configure' can usually + For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure +execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure +overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. +overridden with 'make V=0'. Particular systems ================== - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try ./configure CC="cc" @@ -242,26 +240,26 @@ ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== - There may be some features `configure' cannot figure out + There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints +_same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM @@ -270,101 +268,101 @@ OS KERNEL-OS - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will +use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. +eventually be run) with '--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run +environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: +them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc -causes the specified `gcc' to be used as the C compiler (unless it is +causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -`configure' Invocation +'configure' Invocation ====================== - `configure' recognizes the following options to control how it + 'configure' recognizes the following options to control how it operates. -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. -`--help=short' -`--help=recursive' +'--help=short' +'--help=recursive' Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' script, and exit. -`--cache-file=FILE' +'--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to + traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error + suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). -`--srcdir=DIR' +'--srcdir=DIR' Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. + 'configure' can determine that directory automatically. -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. -`--no-create' -`-n' +'--no-create' +'-n' Run the configure checks, but stop before creating any output files. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff -Nru modemmanager-1.6.8/install-sh modemmanager-1.10.0/install-sh --- modemmanager-1.6.8/install-sh 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/install-sh 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,34 +332,43 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -427,8 +444,8 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -493,9 +510,9 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru modemmanager-1.6.8/introspection/Makefile.in modemmanager-1.10.0/introspection/Makefile.in --- modemmanager-1.6.8/introspection/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/introspection/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -172,7 +171,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -221,7 +220,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -274,14 +272,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -402,8 +392,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -472,8 +460,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -611,7 +599,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Bearer.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Bearer.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Bearer.xml 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Bearer.xml 2019-01-15 15:57:35.000000000 +0100 @@ -280,6 +280,13 @@ + + + + + + + + + diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml 2019-01-15 15:57:35.000000000 +0100 @@ -6,6 +6,7 @@ Copyright (C) 2011-2013 Red Hat, Inc. Copyright (C) 2011-2013 Google, Inc. Copyright (C) 2011-2013 Lanedo GmbH + Copyright (C) 2018 Aleksander Morgado --> @@ -14,67 +15,18 @@ org.freedesktop.ModemManager1.Modem.Firmware: @short_description: The ModemManager Firmware interface. - This interface allows clients to select or install firmware images on - modems. + This interface provides access to perform different firmware-related operations + in the modem, including listing the available firmware images in the module and + selecting which of them to use. + + This interface does not provide direct access to perform firmware updates in + the device. Instead, it exposes information about the expected firmware update + method as well as method-specific details required for the upgrade to happen. + The actual firmware upgrade may be performed via the Linux Vendor Firmware Service + and the fwupd daemon. - Firmware slots and firmware images are identified by arbitrary opaque - strings. - - Firmware images are represented as dictionaries of properties. - Certain properties are pre-defined, and some are required: - - - "image-type" - - (Required) Type of the firmware image, given as a - MMFirmwareImageType value - (signature "u"). Firmware images of type - MM_FIRMWARE_IMAGE_TYPE_GENERIC - will only expose only the mandatory properties. - - - "unique-id" - - (Required) A user-readable unique ID for the firmware image, given as a - string value (signature "s"). - - - "gobi-pri-version" - - (Optional) The version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-pri-info" - - (Optional) Additional information of the PRI image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-boot-version" - - (Optional) The boot version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-pri-unique-id" - - (Optional) The unique ID of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-modem-unique-id" - - (Optional) The unique ID of the Modem firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - + This interface will always be available as long a the modem is considered + valid. --> @@ -85,13 +37,67 @@ List installed firmware images. - Depending on the type of modem, installed images may be stored on the - host or the modem. + Firmware slots and firmware images are identified by arbitrary opaque + strings. - Installed images can be selected non-destructively. + Firmware images are represented as dictionaries of properties. + Certain properties are pre-defined, and some are required: + + + "image-type" + + (Required) Type of the firmware image, given as a + MMFirmwareImageType value + (signature "u"). Firmware images of type + MM_FIRMWARE_IMAGE_TYPE_GENERIC + will only expose only the mandatory properties. + + + "unique-id" + + (Required) A user-readable unique ID for the firmware image, given as a + string value (signature "s"). + + + "gobi-pri-version" + + (Optional) The version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-pri-info" + + (Optional) Additional information of the PRI image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-boot-version" + + (Optional) The boot version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-pri-unique-id" + + (Optional) The unique ID of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-modem-unique-id" + + (Optional) The unique ID of the Modem firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + --> - + @@ -106,30 +112,73 @@ returned by List(), or if the image could not be selected for some reason. + + Installed images can be selected non-destructively. --> + UpdateSettings: + + Detailed settings that provide information about how the module should be + updated. + + The settings are given as a bitmask of MMModemFirmwareUpdateMethod + values specifying the type of firmware update procedures expected followed by a + dictionary that includes other parameters applicable to the specific methods reported. + + + + + + The following settings are mandatory as long as the reported update method is not + MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE. + + + "device-ids" + + (Required) This property exposes the list of device IDs associated to a given + device, from most specific to least specific. (signature 'as'). + E.g. a list containing: "USB\VID_413C&PID_81D7&REV_0001", + "USB\VID_413C&PID_81D7" and "USB\VID_413C". + + + "version" + + (Required) This property exposes the current firmware version string of the module. + If the module uses separate version numbers for firmware version and carrier configuration, + this version string will be a combination of both, and so it may be different to the + version string showed in the #org.freedesktop.ModemManager1.Modem:Revision property. + (signature 's') + + + + + + + + + MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT + + + Devices supporting the fastboot firmware update method require exposing the + following additional settings: + + + "fastboot-at" + + (Required) This property exposes the AT command that should be sent to the + module to trigger a reset into fastboot mode (signature 's') + + + + + + + --> + diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Location.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Location.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Location.xml 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Location.xml 2019-01-15 15:57:35.000000000 +0100 @@ -19,6 +19,11 @@ client applications. Not all devices can provide this information, or even if they do, they may not be able to provide it while a data session is active. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used (including GNSS module management). --> @@ -71,7 +76,7 @@ @@ -80,6 +85,24 @@ + + + + + + + + + + + + + diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml 2019-01-15 15:57:35.000000000 +0100 @@ -16,6 +16,11 @@ @short_description: The ModemManager 3GPP USSD interface. This interface provides access to actions based on the USSD protocol. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml 2019-01-15 15:57:35.000000000 +0100 @@ -17,6 +17,11 @@ This interface provides access to specific actions that may be performed in modems with 3GPP capabilities. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> @@ -86,6 +91,40 @@ + + + + + + + + + + + + + + + + + + + + + + diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml 2019-01-15 15:57:35.000000000 +0100 @@ -17,6 +17,11 @@ This interface provides access to specific actions that may be performed in modems with CDMA capabilities. + + This interface will only be available once the modem is ready to be + registered in the cellular network. Mixed 3GPP+3GPP2 devices will require + a valid unlocked SIM card before any of the features in the interface can + be used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Oma.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Oma.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Oma.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Oma.xml 2019-01-15 15:57:35.000000000 +0100 @@ -17,6 +17,11 @@ Device management sessions are either on-demand (client-initiated), or automatically initiated by either the device itself or the network. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Signal.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Signal.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Signal.xml 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Signal.xml 2019-01-15 15:57:35.000000000 +0100 @@ -13,6 +13,11 @@ @short_description: The ModemManager Signal interface. This interface provides access to extended signal quality information. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> @@ -161,7 +166,7 @@ "ecio" - The UMTS Ec/Io, in dBm, given as a floating point value + The UMTS Ec/Io, in dB, given as a floating point value (signature "d"). diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml 2019-01-15 15:57:35.000000000 +0100 @@ -16,6 +16,11 @@ @short_description: The ModemManager Simple interface. The Simple interface allows controlling and querying the status of Modems. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Time.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Time.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Time.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Time.xml 2019-01-15 15:57:35.000000000 +0100 @@ -16,6 +16,11 @@ This interface allows clients to receive network time and timezone updates broadcast by mobile networks. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml 2019-01-15 15:57:35.000000000 +0100 @@ -14,6 +14,11 @@ @short_description: The ModemManager Voice interface. The Voice interface handles Calls. + + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. --> diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Modem.xml 2017-05-23 18:40:35.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Modem.xml 2019-01-15 15:57:35.000000000 +0100 @@ -17,6 +17,9 @@ The Modem interface controls the status and actions in a given modem object. + + This interface will always be available as long a the modem is considered + valid. --> @@ -42,6 +45,9 @@ List configured packet data bearers (EPS Bearers, PDP Contexts, or CDMA2000 Packet Data Sessions). + + Deprecated: 1.10.0. Use #org.freedesktop.ModemManager1.Modem:Bearers + property instead. --> @@ -213,7 +219,10 @@ Bearers: The list of bearer object paths (EPS Bearers, PDP Contexts, or - CDMA2000 Packet Data Sessions). + CDMA2000 Packet Data Sessions) as requested by the user. + + This list does not include the initial EPS bearer details (see + #org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearer). --> @@ -256,7 +265,9 @@ + + + diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Sms.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Sms.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.Sms.xml 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.Sms.xml 2019-01-15 15:57:35.000000000 +0100 @@ -101,12 +101,12 @@ Indicates when the SMS expires in the SMSC. This value is composed of a - MMSmsValidityType - key, with an associated data which contains type-specific validity - information: + MMSmsValidityType + key, with an associated data which contains type-specific validity + information: - - MM_SMS_VALIDITY_TYPE_RELATIVE + + MM_SMS_VALIDITY_TYPE_RELATIVE The value is the length of the validity period in minutes, given diff -Nru modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.xml modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.xml --- modemmanager-1.6.8/introspection/org.freedesktop.ModemManager1.xml 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/introspection/org.freedesktop.ModemManager1.xml 2019-01-15 15:57:35.000000000 +0100 @@ -37,5 +37,102 @@ + + + + + + + + + + + + + + diff -Nru modemmanager-1.6.8/introspection/tests/Makefile.in modemmanager-1.10.0/introspection/tests/Makefile.in --- modemmanager-1.6.8/introspection/tests/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/introspection/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -131,7 +130,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -184,14 +182,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -312,8 +302,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -356,8 +344,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -381,7 +369,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/libmm-glib/generated/Makefile.in modemmanager-1.10.0/libmm-glib/generated/Makefile.in --- modemmanager-1.6.8/libmm-glib/generated/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -95,14 +95,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -143,7 +142,17 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + ./$(DEPDIR)/libmm_generated_la-mm-enums-types.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-errors-quarks.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-errors-types.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-bearer.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-call.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-manager.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-modem.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sim.Plo \ + ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sms.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -214,7 +223,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -263,7 +272,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -316,14 +324,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -444,8 +444,6 @@ includedir = @includedir@/libmm-glib infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -643,8 +641,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -676,15 +674,21 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-enums-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-errors-quarks.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-errors-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-bearer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-call.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-manager.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-modem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-sim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-sms.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-enums-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-errors-quarks.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-errors-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-bearer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-call.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-manager.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-modem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-sim.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_generated_la-mm-gdbus-sms.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -899,7 +903,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1002,7 +1009,15 @@ mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-enums-types.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-errors-quarks.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-errors-types.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-bearer.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-call.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-manager.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-modem.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sim.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sms.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1048,7 +1063,15 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-enums-types.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-errors-quarks.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-errors-types.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-bearer.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-call.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-manager.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-modem.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sim.Plo + -rm -f ./$(DEPDIR)/libmm_generated_la-mm-gdbus-sms.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1070,8 +1093,8 @@ .MAKE: $(am__recursive_targets) all check install install-am \ install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml 2019-01-17 16:15:58.000000000 +0100 @@ -22,6 +22,7 @@ Ip6Config readable a{sv} Stats readable a{sv} IpTimeout readable u +BearerType readable u Properties readable a{sv} @@ -287,6 +288,15 @@ Maximum time to wait for a successful IP establishment, when PPP is used. + + The "BearerType" property + org.freedesktop.ModemManager1.Bearer:BearerType + +BearerType readable u + + A MMBearerType + + The "Properties" property org.freedesktop.ModemManager1.Bearer:Properties diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml 2019-01-17 16:15:58.000000000 +0100 @@ -13,66 +13,24 @@ Select (IN s uniqueid); + + Properties + +UpdateSettings readable (ua{sv}) + + Description - This interface allows clients to select or install firmware images on - modems. - Firmware slots and firmware images are identified by arbitrary opaque - strings. - Firmware images are represented as dictionaries of properties. - Certain properties are pre-defined, and some are required: - - "image-type" - - (Required) Type of the firmware image, given as a - MMFirmwareImageType value - (signature "u"). Firmware images of type - MM_FIRMWARE_IMAGE_TYPE_GENERIC - will only expose only the mandatory properties. - - - "unique-id" - - (Required) A user-readable unique ID for the firmware image, given as a - string value (signature "s"). - - - "gobi-pri-version" - - (Optional) The version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-pri-info" - - (Optional) Additional information of the PRI image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-boot-version" - - (Optional) The boot version of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-pri-unique-id" - - (Optional) The unique ID of the PRI firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - "gobi-modem-unique-id" - - (Optional) The unique ID of the Modem firmware image, in images of type - MM_FIRMWARE_IMAGE_TYPE_GOBI, - given as a string value (signature "s"). - - - + This interface provides access to perform different firmware-related operations + in the modem, including listing the available firmware images in the module and + selecting which of them to use. + This interface does not provide direct access to perform firmware updates in + the device. Instead, it exposes information about the expected firmware update + method as well as method-specific details required for the upgrade to happen. + The actual firmware upgrade may be performed via the Linux Vendor Firmware Service + and the fwupd daemon. + This interface will always be available as long a the modem is considered + valid. @@ -85,9 +43,62 @@ OUT aa{sv} installed); List installed firmware images. - Depending on the type of modem, installed images may be stored on the - host or the modem. - Installed images can be selected non-destructively. + Firmware slots and firmware images are identified by arbitrary opaque + strings. + Firmware images are represented as dictionaries of properties. + Certain properties are pre-defined, and some are required: + + "image-type" + + (Required) Type of the firmware image, given as a + MMFirmwareImageType value + (signature "u"). Firmware images of type + MM_FIRMWARE_IMAGE_TYPE_GENERIC + will only expose only the mandatory properties. + + + "unique-id" + + (Required) A user-readable unique ID for the firmware image, given as a + string value (signature "s"). + + + "gobi-pri-version" + + (Optional) The version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-pri-info" + + (Optional) Additional information of the PRI image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-boot-version" + + (Optional) The boot version of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-pri-unique-id" + + (Optional) The unique ID of the PRI firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + "gobi-modem-unique-id" + + (Optional) The unique ID of the Modem firmware image, in images of type + MM_FIRMWARE_IMAGE_TYPE_GOBI, + given as a string value (signature "s"). + + + @@ -112,6 +123,7 @@ returned by List(), or if the image could not be selected for some reason. + Installed images can be selected non-destructively. @@ -121,5 +133,68 @@ + + Property Details + + The "UpdateSettings" property + org.freedesktop.ModemManager1.Modem.Firmware:UpdateSettings + +UpdateSettings readable (ua{sv}) + + Detailed settings that provide information about how the module should be + updated. + The settings are given as a bitmask of MMModemFirmwareUpdateMethod + values specifying the type of firmware update procedures expected followed by a + dictionary that includes other parameters applicable to the specific methods reported. + + + + + The following settings are mandatory as long as the reported update method is not + MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE. + + + "device-ids" + + (Required) This property exposes the list of device IDs associated to a given + device, from most specific to least specific. (signature 'as'). + E.g. a list containing: "USB\VID_413C&PID_81D7&REV_0001", + "USB\VID_413C&PID_81D7" and "USB\VID_413C". + + + "version" + + (Required) This property exposes the current firmware version string of the module. + If the module uses separate version numbers for firmware version and carrier configuration, + this version string will be a combination of both, and so it may be different to the + version string showed in the "Revision" property. + (signature 's') + + + + + + + + MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT + + + Devices supporting the fastboot firmware update method require exposing the + following additional settings: + + + "fastboot-at" + + (Required) This property exposes the AT command that should be sent to the + module to trigger a reset into fastboot mode (signature 's') + + + + + + + + + diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml 2019-01-17 16:15:58.000000000 +0100 @@ -8,22 +8,25 @@ org.freedesktop.ModemManager1.Modem.Location The ModemManager Location interface. Methods -Setup (IN u sources, - IN b signal_location); -GetLocation (OUT a{uv} Location); -SetSuplServer (IN s supl); -SetGpsRefreshRate (IN u rate); +Setup (IN u sources, + IN b signal_location); +GetLocation (OUT a{uv} Location); +SetSuplServer (IN s supl); +InjectAssistanceData (IN ay data); +SetGpsRefreshRate (IN u rate); Properties -Capabilities readable u -Enabled readable u -SignalsLocation readable b -Location readable a{uv} -SuplServer readable s -GpsRefreshRate readable u +Capabilities readable u +SupportedAssistanceData readable u +Enabled readable u +SignalsLocation readable b +Location readable a{uv} +SuplServer readable s +AssistanceDataServers readable as +GpsRefreshRate readable u @@ -32,6 +35,10 @@ client applications. Not all devices can provide this information, or even if they do, they may not be able to provide it while a data session is active. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used (including GNSS module management). @@ -103,7 +110,26 @@ IN s supl: - SUPL server configuration, given either as IP:PORT or with a full URL. + SUPL server configuration, given either as IP:PORT or as FQDN:PORT. + + + + + The InjectAssistanceData() method + org.freedesktop.ModemManager1.Modem.Location.InjectAssistanceData() + +InjectAssistanceData (IN ay data); + + Inject assistance data to the GNSS module. + The data files should be downloaded using external means from the URLs specified in + the AssistanceDataServers property. + The user does not need to specify the assistance data type being given. + There is no maximum data size limit specified, default DBus system bus limits apply. + + + + IN ay data: + assistance data to be injected to the GNSS module. @@ -138,6 +164,16 @@ values, specifying the supported location sources. + + The "SupportedAssistanceData" property + org.freedesktop.ModemManager1.Modem.Location:SupportedAssistanceData + +SupportedAssistanceData readable u + + Bitmask of MMModemLocationAssistanceDataType + values, specifying the supported types of assistance data. + + The "Enabled" property org.freedesktop.ModemManager1.Modem.Location:Enabled @@ -183,7 +219,7 @@ Devices supporting this - capability return a string in the format "MCC,MNC,LAC,CI" (without the + capability return a string in the format "MCC,MNC,LAC,CI,TAC" (without the quotes of course) where the following applies: @@ -203,10 +239,10 @@ LAC - This is the two-byte Location Area Code of the base station with - which the mobile is registered, in upper-case hexadecimal format - without leading zeros, as specified in 3GPP TS 27.007 section - 10.1.19. e.g. "84CD". + This is the two-byte Location Area Code of the GSM/UMTS base + station with which the mobile is registered, in upper-case + hexadecimal format without leading zeros, as specified in + 3GPP TS 27.007. E.g. "84CD". CI @@ -217,6 +253,14 @@ e.g. "2BAF" or "D30156". + TAC + + This is the two-byte Location Area Code of the LTE base + station with which the mobile is registered, in upper-case + hexadecimal format without leading zeros, as specified in + 3GPP TS 27.007. E.g. "6FFE". + + The entire string may only be composed of the ASCII digits [0-9], @@ -342,7 +386,17 @@ SuplServer readable s - SUPL server configuration for A-GPS, given either as IP:PORT or with a full URL. + SUPL server configuration for A-GPS, given either as IP:PORT or FQDN:PORT. + + + + The "AssistanceDataServers" property + org.freedesktop.ModemManager1.Modem.Location:AssistanceDataServers + +AssistanceDataServers readable as + + URLs from where the user can download assistance data files to inject with + InjectAssistanceData(). diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml 2019-01-17 16:15:58.000000000 +0100 @@ -34,6 +34,10 @@ Description The Messaging interface handles sending SMS messages and notification of new incoming messages. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used (including listing stored messages). diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml 2019-01-17 16:15:58.000000000 +0100 @@ -26,6 +26,10 @@ Description This interface provides access to actions based on the USSD protocol. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml 2019-01-17 16:15:58.000000000 +0100 @@ -8,25 +8,35 @@ org.freedesktop.ModemManager1.Modem.Modem3gpp The ModemManager 3GPP interface. Methods -Register (IN s operator_id); -Scan (OUT aa{sv} results); +Register (IN s operator_id); +Scan (OUT aa{sv} results); +SetEpsUeModeOperation (IN u mode); +SetInitialEpsBearerSettings (IN a{sv} settings); Properties -Imei readable s -RegistrationState readable u -OperatorCode readable s -OperatorName readable s -EnabledFacilityLocks readable u -SubscriptionState readable u +Imei readable s +RegistrationState readable u +OperatorCode readable s +OperatorName readable s +EnabledFacilityLocks readable u +SubscriptionState readable u +EpsUeModeOperation readable u +Pco readable a(ubay) +InitialEpsBearer readable o +InitialEpsBearerSettings readable a{sv} Description This interface provides access to specific actions that may be performed in modems with 3GPP capabilities. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. @@ -105,6 +115,49 @@ + + The SetEpsUeModeOperation() method + org.freedesktop.ModemManager1.Modem.Modem3gpp.SetEpsUeModeOperation() + +SetEpsUeModeOperation (IN u mode); + + Sets the UE mode of operation for EPS. + + + + IN u mode: + a MMModem3gppEpsUeModeOperation. + + + + + The SetInitialEpsBearerSettings() method + org.freedesktop.ModemManager1.Modem.Modem3gpp.SetInitialEpsBearerSettings() + +SetInitialEpsBearerSettings (IN a{sv} settings); + + Updates the default settings to be used in the initial default EPS bearer when registering to the LTE network. + Allowed properties are: + + "apn" + Access Point Name, given as a string value (signature "s"). + "ip-type" + Addressing type, given as a MMBearerIpFamily value (signature "u"). + "allowed-auth" + The authentication method to use, given as a MMBearerAllowedAuth value (signature "u"). + "user" + User name (if any) required by the network, given as a string value (signature "s"). + "password" + Password (if any) required by the network, given as a string value (signature "s"). + + + + + IN a{sv} settings: + List of properties to use when requesting the LTE attach procedure. + + + Property Details @@ -175,6 +228,55 @@ A MMModem3gppSubscriptionState value representing the subscription status of the account and whether there is any data remaining, given as an unsigned integer (signature "u"). + Deprecated: 1.10.0. The value of this property can only be obtained with operator + specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense + to expose it in the ModemManager interface. + + + + The "EpsUeModeOperation" property + org.freedesktop.ModemManager1.Modem.Modem3gpp:EpsUeModeOperation + +EpsUeModeOperation readable u + + A MMModem3gppEpsUeModeOperation + value representing the UE mode of operation for EPS, given as an unsigned integer + (signature "u"). + + + + The "Pco" property + org.freedesktop.ModemManager1.Modem.Modem3gpp:Pco + +Pco readable a(ubay) + + The raw PCOs received from the network. + + + + The "InitialEpsBearer" property + org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearer + +InitialEpsBearer readable o + + The object path for the initial default EPS bearer. + + + + The "InitialEpsBearerSettings" property + org.freedesktop.ModemManager1.Modem.Modem3gpp:InitialEpsBearerSettings + +InitialEpsBearerSettings readable a{sv} + + List of properties requested by the device for the initial EPS bearer during + LTE network attach procedure. + The network may decide to use different settings during the actual device attach + procedure, e.g. if the device is roaming or no explicit settings were requested, + so the properties shown in the org.freedesktop.ModemManager1.Modem.Modem3gpp.InitialEpsBearer:InitialEpsBearer + may be totally different. + This is a read-only property, updating these settings should be done using the + SetInitialEpsBearerSettings() + method. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml 2019-01-17 16:15:58.000000000 +0100 @@ -36,6 +36,10 @@ Description This interface provides access to specific actions that may be performed in modems with CDMA capabilities. + This interface will only be available once the modem is ready to be + registered in the cellular network. Mixed 3GPP+3GPP2 devices will require + a valid unlocked SIM card before any of the features in the interface can + be used. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml 2019-01-17 16:15:58.000000000 +0100 @@ -38,6 +38,10 @@ specified by the Open Mobile Alliance (OMA). Device management sessions are either on-demand (client-initiated), or automatically initiated by either the device itself or the network. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml 2017-06-17 10:25:07.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml 2019-01-17 16:15:58.000000000 +0100 @@ -25,6 +25,10 @@ Description This interface provides access to extended signal quality information. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. @@ -185,7 +189,7 @@ "ecio" - The UMTS Ec/Io, in dBm, given as a floating point value + The UMTS Ec/Io, in dB, given as a floating point value (signature "d"). diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml 2019-01-17 16:15:58.000000000 +0100 @@ -17,6 +17,10 @@ Description The Simple interface allows controlling and querying the status of Modems. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml 2019-01-17 16:15:58.000000000 +0100 @@ -27,6 +27,10 @@ Description This interface allows clients to receive network time and timezone updates broadcast by mobile networks. + This interface will only be available once the modem is ready to be + registered in the cellular network. 3GPP devices will require a valid + unlocked SIM card before any of the features in the interface can be + used. diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml 2019-01-17 16:15:58.000000000 +0100 @@ -44,6 +44,7 @@ Manufacturer readable s Model readable s Revision readable s +HardwareRevision readable s DeviceIdentifier readable s Device readable s Drivers readable as @@ -70,6 +71,8 @@ Description The Modem interface controls the status and actions in a given modem object. + This interface will always be available as long a the modem is considered + valid. @@ -101,6 +104,8 @@ List configured packet data bearers (EPS Bearers, PDP Contexts, or CDMA2000 Packet Data Sessions). + Deprecated: 1.10.0. Use "Bearers" + property instead. @@ -336,7 +341,9 @@ Bearers readable ao The list of bearer object paths (EPS Bearers, PDP Contexts, or - CDMA2000 Packet Data Sessions). + CDMA2000 Packet Data Sessions) as requested by the user. + This list does not include the initial EPS bearer details (see + "InitialEpsBearer"). @@ -385,7 +392,9 @@ MaxActiveBearers readable u - The maximum number of active packet data bearers the modem supports. + The maximum number of active + MM_BEARER_TYPE_DEFAULT + bearers that may be explicitly enabled by the user. POTS and CDMA2000-only devices support one active bearer, while GSM/UMTS and LTE-capable devices (including LTE/CDMA devices) typically support at least two active bearers. @@ -418,6 +427,15 @@ The revision identification of the software, as reported by the modem. + + The "HardwareRevision" property + org.freedesktop.ModemManager1.Modem:HardwareRevision + +HardwareRevision readable s + + The revision identification of the hardware, as reported by the modem. + + The "DeviceIdentifier" property org.freedesktop.ModemManager1.Modem:DeviceIdentifier @@ -444,6 +462,8 @@ may be dependent upon the operating system. In Linux for example, this points to a sysfs path of the usb_device object. + This value may also be set by the user using the MM_ID_PHYSDEV_UID udev + tag (e.g. binding the tag to a specific sysfs path). diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml 2019-01-17 16:15:58.000000000 +0100 @@ -142,11 +142,11 @@ Indicates when the SMS expires in the SMSC. This value is composed of a - MMSmsValidityType - key, with an associated data which contains type-specific validity - information: - - MM_SMS_VALIDITY_TYPE_RELATIVE + MMSmsValidityType + key, with an associated data which contains type-specific validity + information: + + MM_SMS_VALIDITY_TYPE_RELATIVE The value is the length of the validity period in minutes, given diff -Nru modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml --- modemmanager-1.6.8/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml 2017-06-17 10:25:06.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml 2019-01-17 16:15:58.000000000 +0100 @@ -8,10 +8,19 @@ org.freedesktop.ModemManager1 The ModemManager Manager interface. Methods -ScanDevices (); -SetLogging (IN s level); +ScanDevices (); +SetLogging (IN s level); +ReportKernelEvent (IN a{sv} properties); +InhibitDevice (IN s uid, + IN b inhibit); + + Properties + +Version readable s + + Description The Manager interface allows controlling and querying the status of the @@ -44,6 +53,117 @@ + + The ReportKernelEvent() method + org.freedesktop.ModemManager1.ReportKernelEvent() + +ReportKernelEvent (IN a{sv} properties); + + Reports a kernel event to ModemManager. + This method is only available if udev is not being used to report kernel + events. + The properties dictionary is composed of key/value string pairs. The + possible keys are: + + action + + + The type of action, given as a string value (signature + "s"). + This parameter is MANDATORY. + + + add + + A new kernel device has been added. + + + remove + + An existing kernel device has been removed. + + + + + + name + + + The device name, given as a string value (signature + "s"). + This parameter is MANDATORY. + + + + subsystem + + + The device subsystem, given as a string value (signature + "s"). + This parameter is MANDATORY. + + + + uid + + + The unique ID of the physical device, given as a string value + (signature "s"). + This parameter is OPTIONAL, if not given the sysfs path of the + physical device will be used. This parameter must be the same + for all devices exposed by the same physical device. + + + + + + + + IN a{sv} properties: + event properties. + + + + + The InhibitDevice() method + org.freedesktop.ModemManager1.InhibitDevice() + +InhibitDevice (IN s uid, + IN b inhibit); + + org.freedesktop.ModemManager1.Modem:Device property. + inhibit: TRUE to inhibit the modem and FALSE to uninhibit it. + Inhibit or uninhibit the device. + When the modem is inhibited ModemManager will close all its ports and + unexport it from the bus, so that users of the interface are no longer + able to operate with it. + This operation binds the inhibition request to the existence of the + caller in the DBus bus. If the caller disappears from the bus, the + inhibition will automatically removed. + + + + IN s uid: + the unique ID of the physical device, given in the + + + IN b inhibit: + + + + + + + Property Details + + The "Version" property + org.freedesktop.ModemManager1:Version + +Version readable s + + The runtime version of the ModemManager daemon. + + diff -Nru modemmanager-1.6.8/libmm-glib/generated/tests/Makefile.in modemmanager-1.10.0/libmm-glib/generated/tests/Makefile.in --- modemmanager-1.6.8/libmm-glib/generated/tests/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/generated/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -136,7 +135,9 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + ./$(DEPDIR)/libmm_test_generated_la-mm-gdbus-test.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -185,7 +186,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -238,14 +238,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -366,8 +358,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -438,8 +428,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -471,7 +461,13 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_test_generated_la-mm-gdbus-test.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_test_generated_la-mm-gdbus-test.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -562,7 +558,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -636,7 +635,7 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_test_generated_la-mm-gdbus-test.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -682,7 +681,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_test_generated_la-mm-gdbus-test.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -703,16 +702,16 @@ .MAKE: all check install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am diff -Nru modemmanager-1.6.8/libmm-glib/libmm-glib.h modemmanager-1.10.0/libmm-glib/libmm-glib.h --- modemmanager-1.6.8/libmm-glib/libmm-glib.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/libmm-glib.h 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,10 @@ /* This headers are not exported within ModemManager */ # include # include +# include +# include +# include +# include # include # include # include @@ -62,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -70,8 +75,11 @@ #include #include #include +#include #include #include +#include +#include /* generated */ #include diff -Nru modemmanager-1.6.8/libmm-glib/Makefile.am modemmanager-1.10.0/libmm-glib/Makefile.am --- modemmanager-1.6.8/libmm-glib/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -77,10 +77,18 @@ mm-network-timezone.c \ mm-firmware-properties.h \ mm-firmware-properties.c \ + mm-firmware-update-settings.h \ + mm-firmware-update-settings.c \ mm-cdma-manual-activation-properties.h \ mm-cdma-manual-activation-properties.c \ mm-signal.h \ mm-signal.c \ + mm-kernel-event-properties.h \ + mm-kernel-event-properties.c \ + mm-pco.h \ + mm-pco.c \ + mm-call-audio-format.h \ + mm-call-audio-format.c \ $(NULL) libmm_glib_la_CPPFLAGS = \ @@ -147,8 +155,12 @@ mm-unlock-retries.h \ mm-network-timezone.h \ mm-firmware-properties.h \ + mm-firmware-update-settings.h \ mm-cdma-manual-activation-properties.h \ mm-signal.h \ + mm-kernel-event-properties.h \ + mm-pco.h \ + mm-call-audio-format.h \ $(NULL) CLEANFILES = @@ -183,6 +195,7 @@ ModemManager-version.h ModemManager-enums.h \ ModemManager-errors.h \ + ModemManager-compat.h \ ModemManager.h \ $(NULL) diff -Nru modemmanager-1.6.8/libmm-glib/Makefile.in modemmanager-1.10.0/libmm-glib/Makefile.in --- modemmanager-1.6.8/libmm-glib/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -97,14 +97,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ @@ -175,8 +174,11 @@ libmm_glib_la-mm-unlock-retries.lo \ libmm_glib_la-mm-network-timezone.lo \ libmm_glib_la-mm-firmware-properties.lo \ + libmm_glib_la-mm-firmware-update-settings.lo \ libmm_glib_la-mm-cdma-manual-activation-properties.lo \ - libmm_glib_la-mm-signal.lo + libmm_glib_la-mm-signal.lo \ + libmm_glib_la-mm-kernel-event-properties.lo \ + libmm_glib_la-mm-pco.lo libmm_glib_la-mm-call-audio-format.lo libmm_glib_la_OBJECTS = $(am_libmm_glib_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -199,7 +201,48 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + ./$(DEPDIR)/libmm_glib_la-mm-bearer-ip-config.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-bearer-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-bearer-stats.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-bearer.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-call-audio-format.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-call-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-call.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-common-helpers.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-firmware-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-helper-types.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-location-3gpp.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-location-cdma-bs.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-location-gps-nmea.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-location-gps-raw.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-manager.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp-ussd.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-cdma.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-firmware.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-location.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-messaging.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-oma.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-signal.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-simple.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-time.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem-voice.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-modem.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-network-timezone.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-object.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-pco.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-signal.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-sim.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-simple-connect-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-simple-status.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-sms-properties.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-sms.Plo \ + ./$(DEPDIR)/libmm_glib_la-mm-unlock-retries.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -243,7 +286,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -292,7 +335,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -345,14 +387,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -473,8 +507,6 @@ includedir = @includedir@/libmm-glib infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -570,10 +602,18 @@ mm-network-timezone.c \ mm-firmware-properties.h \ mm-firmware-properties.c \ + mm-firmware-update-settings.h \ + mm-firmware-update-settings.c \ mm-cdma-manual-activation-properties.h \ mm-cdma-manual-activation-properties.c \ mm-signal.h \ mm-signal.c \ + mm-kernel-event-properties.h \ + mm-kernel-event-properties.c \ + mm-pco.h \ + mm-pco.c \ + mm-call-audio-format.h \ + mm-call-audio-format.c \ $(NULL) libmm_glib_la_CPPFLAGS = \ @@ -639,8 +679,12 @@ mm-unlock-retries.h \ mm-network-timezone.h \ mm-firmware-properties.h \ + mm-firmware-update-settings.h \ mm-cdma-manual-activation-properties.h \ mm-signal.h \ + mm-kernel-event-properties.h \ + mm-pco.h \ + mm-call-audio-format.h \ $(NULL) CLEANFILES = $(am__append_1) @@ -719,8 +763,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -776,42 +820,52 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-ip-config.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-stats.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-call-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-call.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-common-helpers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-firmware-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-helper-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-3gpp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-cdma-bs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-gps-nmea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-gps-raw.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-manager.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp-ussd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-cdma.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-firmware.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-location.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-messaging.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-oma.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-signal.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-simple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-time.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-voice.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-network-timezone.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-object.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-signal.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-simple-connect-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-simple-status.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sms-properties.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sms.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-unlock-retries.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-ip-config.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer-stats.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-bearer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-call-audio-format.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-call-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-call.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-common-helpers.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-firmware-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-helper-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-3gpp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-cdma-bs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-gps-nmea.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-location-gps-raw.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-manager.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp-ussd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-cdma.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-firmware.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-location.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-messaging.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-oma.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-signal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-simple.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-time.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem-voice.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-modem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-network-timezone.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-object.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-pco.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-signal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sim.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-simple-connect-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-simple-status.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sms-properties.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-sms.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmm_glib_la-mm-unlock-retries.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -1075,6 +1129,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-firmware-properties.lo `test -f 'mm-firmware-properties.c' || echo '$(srcdir)/'`mm-firmware-properties.c +libmm_glib_la-mm-firmware-update-settings.lo: mm-firmware-update-settings.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -MT libmm_glib_la-mm-firmware-update-settings.lo -MD -MP -MF $(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Tpo -c -o libmm_glib_la-mm-firmware-update-settings.lo `test -f 'mm-firmware-update-settings.c' || echo '$(srcdir)/'`mm-firmware-update-settings.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Tpo $(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-firmware-update-settings.c' object='libmm_glib_la-mm-firmware-update-settings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-firmware-update-settings.lo `test -f 'mm-firmware-update-settings.c' || echo '$(srcdir)/'`mm-firmware-update-settings.c + libmm_glib_la-mm-cdma-manual-activation-properties.lo: mm-cdma-manual-activation-properties.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -MT libmm_glib_la-mm-cdma-manual-activation-properties.lo -MD -MP -MF $(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Tpo -c -o libmm_glib_la-mm-cdma-manual-activation-properties.lo `test -f 'mm-cdma-manual-activation-properties.c' || echo '$(srcdir)/'`mm-cdma-manual-activation-properties.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Tpo $(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo @@ -1089,6 +1150,27 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-signal.lo `test -f 'mm-signal.c' || echo '$(srcdir)/'`mm-signal.c +libmm_glib_la-mm-kernel-event-properties.lo: mm-kernel-event-properties.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -MT libmm_glib_la-mm-kernel-event-properties.lo -MD -MP -MF $(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Tpo -c -o libmm_glib_la-mm-kernel-event-properties.lo `test -f 'mm-kernel-event-properties.c' || echo '$(srcdir)/'`mm-kernel-event-properties.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Tpo $(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-kernel-event-properties.c' object='libmm_glib_la-mm-kernel-event-properties.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-kernel-event-properties.lo `test -f 'mm-kernel-event-properties.c' || echo '$(srcdir)/'`mm-kernel-event-properties.c + +libmm_glib_la-mm-pco.lo: mm-pco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -MT libmm_glib_la-mm-pco.lo -MD -MP -MF $(DEPDIR)/libmm_glib_la-mm-pco.Tpo -c -o libmm_glib_la-mm-pco.lo `test -f 'mm-pco.c' || echo '$(srcdir)/'`mm-pco.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmm_glib_la-mm-pco.Tpo $(DEPDIR)/libmm_glib_la-mm-pco.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-pco.c' object='libmm_glib_la-mm-pco.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-pco.lo `test -f 'mm-pco.c' || echo '$(srcdir)/'`mm-pco.c + +libmm_glib_la-mm-call-audio-format.lo: mm-call-audio-format.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -MT libmm_glib_la-mm-call-audio-format.lo -MD -MP -MF $(DEPDIR)/libmm_glib_la-mm-call-audio-format.Tpo -c -o libmm_glib_la-mm-call-audio-format.lo `test -f 'mm-call-audio-format.c' || echo '$(srcdir)/'`mm-call-audio-format.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmm_glib_la-mm-call-audio-format.Tpo $(DEPDIR)/libmm_glib_la-mm-call-audio-format.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-call-audio-format.c' object='libmm_glib_la-mm-call-audio-format.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_glib_la_CPPFLAGS) $(CPPFLAGS) $(libmm_glib_la_CFLAGS) $(CFLAGS) -c -o libmm_glib_la-mm-call-audio-format.lo `test -f 'mm-call-audio-format.c' || echo '$(srcdir)/'`mm-call-audio-format.c + mostlyclean-libtool: -rm -f *.lo @@ -1257,7 +1339,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1357,7 +1442,46 @@ mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-ip-config.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-stats.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call-audio-format.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-common-helpers.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-firmware-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-helper-types.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-3gpp.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-cdma-bs.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-gps-nmea.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-gps-raw.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-manager.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp-ussd.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-cdma.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-firmware.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-location.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-messaging.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-oma.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-signal.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-simple.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-time.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-voice.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-network-timezone.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-object.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-pco.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-signal.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sim.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-simple-connect-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-simple-status.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sms-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sms.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-unlock-retries.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1404,7 +1528,46 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-ip-config.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer-stats.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-bearer.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call-audio-format.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-call.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-cdma-manual-activation-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-common-helpers.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-firmware-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-firmware-update-settings.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-helper-types.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-kernel-event-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-3gpp.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-cdma-bs.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-gps-nmea.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-location-gps-raw.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-manager.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp-ussd.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-3gpp.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-cdma.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-firmware.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-location.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-messaging.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-oma.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-signal.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-simple.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-time.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem-voice.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-modem.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-network-timezone.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-object.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-pco.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-signal.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sim.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-simple-connect-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-simple-status.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sms-properties.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-sms.Plo + -rm -f ./$(DEPDIR)/libmm_glib_la-mm-unlock-retries.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1426,28 +1589,30 @@ .MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libLTLIBRARIES \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-includeHEADERS install-info \ - install-info-am install-libLTLIBRARIES install-man \ - install-nodist_girDATA install-nodist_typelibDATA install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-includeHEADERS uninstall-libLTLIBRARIES \ - uninstall-nodist_girDATA uninstall-nodist_typelibDATA +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES install-man install-nodist_girDATA \ + install-nodist_typelibDATA install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-nodist_girDATA \ + uninstall-nodist_typelibDATA .PRECIOUS: Makefile @HAVE_INTROSPECTION_TRUE@ ModemManager-enums.h \ @HAVE_INTROSPECTION_TRUE@ ModemManager-errors.h \ +@HAVE_INTROSPECTION_TRUE@ ModemManager-compat.h \ @HAVE_INTROSPECTION_TRUE@ ModemManager.h \ @HAVE_INTROSPECTION_TRUE@ $(NULL) diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer.c modemmanager-1.10.0/libmm-glib/mm-bearer.c --- modemmanager-1.6.8/libmm-glib/mm-bearer.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer.c 2019-01-15 15:57:35.000000000 +0100 @@ -204,6 +204,24 @@ /*****************************************************************************/ +/** + * mm_bearer_get_bearer_type: + * @self: A #MMBearer. + * + * Gets the type of bearer. + * + * Returns: a #MMBearerType. + */ +MMBearerType +mm_bearer_get_bearer_type (MMBearer *self) +{ + g_return_val_if_fail (MM_IS_BEARER (self), MM_BEARER_TYPE_UNKNOWN); + + return mm_gdbus_bearer_get_bearer_type (MM_GDBUS_BEARER (self)); +} + +/*****************************************************************************/ + static void ipv4_config_updated (MMBearer *self, GParamSpec *pspec) @@ -659,7 +677,7 @@ * * Finishes an operation started with mm_bearer_connect(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_bearer_connect_finish (MMBearer *self, @@ -709,7 +727,7 @@ * The calling thread is blocked until a reply is received. * See mm_bearer_connect() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_bearer_connect_sync (MMBearer *self, @@ -756,7 +774,7 @@ * * Finishes an operation started with mm_bearer_disconnect(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_bearer_disconnect_finish (MMBearer *self, @@ -779,7 +797,7 @@ * The calling thread is blocked until a reply is received. * See mm_bearer_disconnect() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_bearer_disconnect_sync (MMBearer *self, @@ -803,6 +821,7 @@ g_mutex_init (&self->priv->ipv4_config_mutex); g_mutex_init (&self->priv->ipv6_config_mutex); g_mutex_init (&self->priv->properties_mutex); + g_mutex_init (&self->priv->stats_mutex); } static void @@ -813,6 +832,7 @@ g_mutex_clear (&self->priv->ipv4_config_mutex); g_mutex_clear (&self->priv->ipv6_config_mutex); g_mutex_clear (&self->priv->properties_mutex); + g_mutex_clear (&self->priv->stats_mutex); G_OBJECT_CLASS (mm_bearer_parent_class)->finalize (object); } @@ -825,6 +845,7 @@ g_clear_object (&self->priv->ipv4_config); g_clear_object (&self->priv->ipv6_config); g_clear_object (&self->priv->properties); + g_clear_object (&self->priv->stats); G_OBJECT_CLASS (mm_bearer_parent_class)->dispose (object); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer.h modemmanager-1.10.0/libmm-glib/mm-bearer.h --- modemmanager-1.6.8/libmm-glib/mm-bearer.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer.h 2019-01-15 15:57:35.000000000 +0100 @@ -67,17 +67,23 @@ GType mm_bearer_get_type (void); -const gchar *mm_bearer_get_path (MMBearer *self); -gchar *mm_bearer_dup_path (MMBearer *self); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearer, g_object_unref) +#endif -const gchar *mm_bearer_get_interface (MMBearer *self); -gchar *mm_bearer_dup_interface (MMBearer *self); +const gchar *mm_bearer_get_path (MMBearer *self); +gchar *mm_bearer_dup_path (MMBearer *self); -gboolean mm_bearer_get_connected (MMBearer *self); +const gchar *mm_bearer_get_interface (MMBearer *self); +gchar *mm_bearer_dup_interface (MMBearer *self); -gboolean mm_bearer_get_suspended (MMBearer *self); +gboolean mm_bearer_get_connected (MMBearer *self); -guint mm_bearer_get_ip_timeout (MMBearer *self); +gboolean mm_bearer_get_suspended (MMBearer *self); + +guint mm_bearer_get_ip_timeout (MMBearer *self); + +MMBearerType mm_bearer_get_bearer_type (MMBearer *self); void mm_bearer_connect (MMBearer *self, GCancellable *cancellable, diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer-ip-config.h modemmanager-1.10.0/libmm-glib/mm-bearer-ip-config.h --- modemmanager-1.6.8/libmm-glib/mm-bearer-ip-config.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer-ip-config.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_bearer_ip_config_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerIpConfig, g_object_unref) +#endif + MMBearerIpMethod mm_bearer_ip_config_get_method (MMBearerIpConfig *self); const gchar *mm_bearer_ip_config_get_address (MMBearerIpConfig *self); guint mm_bearer_ip_config_get_prefix (MMBearerIpConfig *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer-properties.c modemmanager-1.10.0/libmm-glib/mm-bearer-properties.c --- modemmanager-1.6.8/libmm-glib/mm-bearer-properties.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer-properties.c 2019-01-15 15:57:35.000000000 +0100 @@ -38,10 +38,12 @@ #define PROPERTY_USER "user" #define PROPERTY_PASSWORD "password" #define PROPERTY_IP_TYPE "ip-type" -#define PROPERTY_NUMBER "number" #define PROPERTY_ALLOW_ROAMING "allow-roaming" #define PROPERTY_RM_PROTOCOL "rm-protocol" +/* no longer used properties */ +#define DEPRECATED_PROPERTY_NUMBER "number" + struct _MMBearerPropertiesPrivate { /* APN */ gchar *apn; @@ -49,8 +51,6 @@ MMBearerIpFamily ip_type; /* Allowed auth */ MMBearerAllowedAuth allowed_auth; - /* Number */ - gchar *number; /* User */ gchar *user; /* Password */ @@ -261,7 +261,7 @@ * * Checks whether roaming is allowed in the connection. * - * Returns: %TRUE if roaming is allowed, %FALSE otherwise.. + * Returns: %TRUE if roaming is allowed, %FALSE otherwise. */ gboolean mm_bearer_properties_get_allow_roaming (MMBearerProperties *self) @@ -273,12 +273,17 @@ /*****************************************************************************/ +#ifndef MM_DISABLE_DEPRECATED + /** * mm_bearer_properties_set_number: * @self: a #MMBearerProperties. * @number: the number. * * Sets the number to use when performing the connection. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ void mm_bearer_properties_set_number (MMBearerProperties *self, @@ -286,8 +291,7 @@ { g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - g_free (self->priv->number); - self->priv->number = g_strdup (number); + /* NO-OP */ } /** @@ -297,15 +301,21 @@ * Gets the number to use when performing the connection. * * Returns: (transfer none): the number, or #NULL if not set. Do not free the returned value, it is owned by @self. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ const gchar * mm_bearer_properties_get_number (MMBearerProperties *self) { g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - return self->priv->number; + /* NO-OP */ + return NULL; } +#endif /* MM_DISABLE_DEPRECATED */ + /*****************************************************************************/ /** @@ -385,12 +395,6 @@ PROPERTY_IP_TYPE, g_variant_new_uint32 (self->priv->ip_type)); - if (self->priv->number) - g_variant_builder_add (&builder, - "{sv}", - PROPERTY_NUMBER, - g_variant_new_string (self->priv->number)); - if (self->priv->allow_roaming_set) g_variant_builder_add (&builder, "{sv}", @@ -408,16 +412,6 @@ /*****************************************************************************/ - -/** - * mm_bearer_properties_consume_string: - * @self: a #MMBearerProperties - * @key: the key string. - * @value: the value string. - * @error: (allow-none): Return location for error or %NULL. - * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. - */ gboolean mm_bearer_properties_consume_string (MMBearerProperties *self, const gchar *key, @@ -462,9 +456,7 @@ return FALSE; } mm_bearer_properties_set_allow_roaming (self, allow_roaming); - } else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_bearer_properties_set_number (self, value); - else if (g_str_equal (key, PROPERTY_RM_PROTOCOL)) { + } else if (g_str_equal (key, PROPERTY_RM_PROTOCOL)) { GError *inner_error = NULL; MMModemCdmaRmProtocol protocol; @@ -474,6 +466,8 @@ return FALSE; } mm_bearer_properties_set_rm_protocol (self, protocol); + } else if (g_str_equal (key, DEPRECATED_PROPERTY_NUMBER)) { + /* NO-OP */ } else { g_set_error (error, MM_CORE_ERROR, @@ -527,15 +521,6 @@ /*****************************************************************************/ -/** - * mm_bearer_properties_consume_variant: - * @properties: a #MMBearerProperties - * @key: the key string. - * @value: a #GVariant - * @error: (allow-none): Return location for error or %NULL. - * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. - */ gboolean mm_bearer_properties_consume_variant (MMBearerProperties *properties, const gchar *key, @@ -564,15 +549,13 @@ mm_bearer_properties_set_ip_type ( properties, g_variant_get_uint32 (value)); - else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_bearer_properties_set_number ( - properties, - g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_ALLOW_ROAMING)) mm_bearer_properties_set_allow_roaming ( properties, g_variant_get_boolean (value)); - else { + else if (g_str_equal (key, DEPRECATED_PROPERTY_NUMBER)) { + /* NO-OP */ + } else { /* Set error */ g_set_error (error, MM_CORE_ERROR, @@ -665,7 +648,6 @@ { return ((!g_strcmp0 (a->priv->apn, b->priv->apn)) && (a->priv->ip_type == b->priv->ip_type) && - (!g_strcmp0 (a->priv->number, b->priv->number)) && (a->priv->allowed_auth == b->priv->allowed_auth) && (!g_strcmp0 (a->priv->user, b->priv->user)) && (!g_strcmp0 (a->priv->password, b->priv->password)) && @@ -712,7 +694,6 @@ g_free (self->priv->apn); g_free (self->priv->user); g_free (self->priv->password); - g_free (self->priv->number); G_OBJECT_CLASS (mm_bearer_properties_parent_class)->finalize (object); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer-properties.h modemmanager-1.10.0/libmm-glib/mm-bearer-properties.h --- modemmanager-1.6.8/libmm-glib/mm-bearer-properties.h 2017-05-23 18:40:35.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_bearer_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerProperties, g_object_unref) +#endif + MMBearerProperties *mm_bearer_properties_new (void); void mm_bearer_properties_set_apn (MMBearerProperties *self, @@ -69,8 +73,6 @@ MMBearerIpFamily ip_type); void mm_bearer_properties_set_allow_roaming (MMBearerProperties *self, gboolean allow_roaming); -void mm_bearer_properties_set_number (MMBearerProperties *self, - const gchar *number); void mm_bearer_properties_set_rm_protocol (MMBearerProperties *self, MMModemCdmaRmProtocol protocol); @@ -80,9 +82,16 @@ const gchar *mm_bearer_properties_get_password (MMBearerProperties *self); MMBearerIpFamily mm_bearer_properties_get_ip_type (MMBearerProperties *self); gboolean mm_bearer_properties_get_allow_roaming (MMBearerProperties *self); -const gchar *mm_bearer_properties_get_number (MMBearerProperties *self); MMModemCdmaRmProtocol mm_bearer_properties_get_rm_protocol (MMBearerProperties *self); +#ifndef MM_DISABLE_DEPRECATED +G_DEPRECATED +void mm_bearer_properties_set_number (MMBearerProperties *self, + const gchar *number); +G_DEPRECATED +const gchar *mm_bearer_properties_get_number (MMBearerProperties *self); +#endif + /*****************************************************************************/ /* ModemManager/libmm-glib/mmcli specific methods */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-bearer-stats.h modemmanager-1.10.0/libmm-glib/mm-bearer-stats.h --- modemmanager-1.6.8/libmm-glib/mm-bearer-stats.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-bearer-stats.h 2019-01-15 15:57:35.000000000 +0100 @@ -57,6 +57,10 @@ GType mm_bearer_stats_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerStats, g_object_unref) +#endif + guint mm_bearer_stats_get_duration (MMBearerStats *self); guint64 mm_bearer_stats_get_rx_bytes (MMBearerStats *self); guint64 mm_bearer_stats_get_tx_bytes (MMBearerStats *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-call-audio-format.c modemmanager-1.10.0/libmm-glib/mm-call-audio-format.c --- modemmanager-1.6.8/libmm-glib/mm-call-audio-format.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-call-audio-format.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,276 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Red Hat, Inc. + */ + +#include + +#include "mm-errors-types.h" +#include "mm-call-audio-format.h" + +/** + * SECTION: mm-call-audio-format + * @title: MMCallAudioFormat + * @short_description: Helper object to handle voice call audio formats. + * + * The #MMCallAudioFormat is an object handling the voice call audio format + * which describes how to send/receive voice call audio from the host. + * + * This object is retrieved with either mm_call_get_audio_format() or + * mm_call_peek_audio_format(). + */ + +G_DEFINE_TYPE (MMCallAudioFormat, mm_call_audio_format, G_TYPE_OBJECT) + +#define PROPERTY_ENCODING "encoding" +#define PROPERTY_RESOLUTION "resolution" +#define PROPERTY_RATE "rate" + +struct _MMCallAudioFormatPrivate { + gchar *encoding; + gchar *resolution; + guint rate; +}; + +/*****************************************************************************/ + +/** + * mm_call_audio_format_get_encoding: + * @self: a #MMCallAudioFormat. + * + * Gets the encoding of the audio format. For example, "pcm" for PCM-encoded + * audio. + * + * Returns: a string with the encoding, or #NULL if unknown. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_call_audio_format_get_encoding (MMCallAudioFormat *self) +{ + g_return_val_if_fail (MM_IS_CALL_AUDIO_FORMAT (self), NULL); + + return self->priv->encoding; +} + +void +mm_call_audio_format_set_encoding (MMCallAudioFormat *self, + const gchar *encoding) +{ + g_return_if_fail (MM_IS_CALL_AUDIO_FORMAT (self)); + + g_free (self->priv->encoding); + self->priv->encoding = g_strdup (encoding); +} + +/*****************************************************************************/ + +/** + * mm_call_audio_format_get_resolution: + * @self: a #MMCallAudioFormat. + * + * Gets the resolution of the audio format. For example, "s16le" for signed + * 16-bit little-endian audio sampling resolution. + * + * Returns: a string with the resolution, or #NULL if unknown. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_call_audio_format_get_resolution (MMCallAudioFormat *self) +{ + g_return_val_if_fail (MM_IS_CALL_AUDIO_FORMAT (self), NULL); + + return self->priv->resolution; +} + +void +mm_call_audio_format_set_resolution (MMCallAudioFormat *self, + const gchar *resolution) +{ + g_return_if_fail (MM_IS_CALL_AUDIO_FORMAT (self)); + + g_free (self->priv->resolution); + self->priv->resolution = g_strdup (resolution); +} + +/*****************************************************************************/ + +/** + * mm_call_audio_format_get_rate: + * @self: a #MMCallAudioFormat. + * + * Gets the sampling rate of the audio format. For example, 8000 for an 8000hz + * sampling rate. + * + * Returns: the sampling rate, or 0 if unknown. + */ +guint +mm_call_audio_format_get_rate (MMCallAudioFormat *self) +{ + g_return_val_if_fail (MM_IS_CALL_AUDIO_FORMAT (self), 0); + + return self->priv->rate; +} + +void +mm_call_audio_format_set_rate (MMCallAudioFormat *self, + guint rate) +{ + g_return_if_fail (MM_IS_CALL_AUDIO_FORMAT (self)); + + self->priv->rate = rate; +} + +/*****************************************************************************/ + +GVariant * +mm_call_audio_format_get_dictionary (MMCallAudioFormat *self) +{ + GVariantBuilder builder; + + /* We do allow NULL */ + if (!self) + return NULL; + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (self) { + if (self->priv->encoding) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_ENCODING, + g_variant_new_string (self->priv->encoding)); + + if (self->priv->resolution) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_RESOLUTION, + g_variant_new_string (self->priv->resolution)); + + if (self->priv->rate) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_RATE, + g_variant_new_uint32 (self->priv->rate)); + } + + return g_variant_builder_end (&builder); +} + +/*****************************************************************************/ + +MMCallAudioFormat * +mm_call_audio_format_new_from_dictionary (GVariant *dictionary, + GError **error) +{ + GVariantIter iter; + gchar *key; + GVariant *value; + MMCallAudioFormat *self; + + self = mm_call_audio_format_new (); + if (!dictionary) + return self; + + if (!g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{sv}"))) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot create call audio format from dictionary: " + "invalid variant type received"); + g_object_unref (self); + return NULL; + } + + g_variant_iter_init (&iter, dictionary); + while (g_variant_iter_next (&iter, "{sv}", &key, &value)) { + if (g_str_equal (key, PROPERTY_ENCODING)) + mm_call_audio_format_set_encoding ( + self, + g_variant_get_string (value, NULL)); + else if (g_str_equal (key, PROPERTY_RESOLUTION)) + mm_call_audio_format_set_resolution ( + self, + g_variant_get_string (value, NULL)); + else if (g_str_equal (key, PROPERTY_RATE)) + mm_call_audio_format_set_rate ( + self, + g_variant_get_uint32 (value)); + + g_free (key); + g_variant_unref (value); + } + + return self; +} + +/*****************************************************************************/ + +/** + * mm_call_audio_format_dup: + * @orig: a #MMCallAudioFormat + * + * Creates a copy of @orig. + * + * Returns: (transfer full): a newly created #MMCallAudioFormat + */ +MMCallAudioFormat * +mm_call_audio_format_dup (MMCallAudioFormat *orig) +{ + GVariant *dict; + MMCallAudioFormat *copy; + GError *error = NULL; + + g_return_val_if_fail (MM_IS_CALL_AUDIO_FORMAT (orig), NULL); + + dict = mm_call_audio_format_get_dictionary (orig); + copy = mm_call_audio_format_new_from_dictionary (dict, &error); + g_assert_no_error (error); + g_variant_unref (dict); + + return copy; +} + +/*****************************************************************************/ + +MMCallAudioFormat * +mm_call_audio_format_new (void) +{ + return (MM_CALL_AUDIO_FORMAT ( + g_object_new (MM_TYPE_CALL_AUDIO_FORMAT, NULL))); +} + +static void +mm_call_audio_format_init (MMCallAudioFormat *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), + MM_TYPE_CALL_AUDIO_FORMAT, + MMCallAudioFormatPrivate); +} + +static void +finalize (GObject *object) +{ + MMCallAudioFormat *self = MM_CALL_AUDIO_FORMAT (object); + + g_free (self->priv->encoding); + g_free (self->priv->resolution); + + G_OBJECT_CLASS (mm_call_audio_format_parent_class)->finalize (object); +} + +static void +mm_call_audio_format_class_init (MMCallAudioFormatClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMCallAudioFormatPrivate)); + + object_class->finalize = finalize; +} diff -Nru modemmanager-1.6.8/libmm-glib/mm-call-audio-format.h modemmanager-1.10.0/libmm-glib/mm-call-audio-format.h --- modemmanager-1.6.8/libmm-glib/mm-call-audio-format.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-call-audio-format.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,92 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Red Hat, Inc. + */ + +#ifndef MM_CALL_AUDIO_FORMAT_H +#define MM_CALL_AUDIO_FORMAT_H + +#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include + +G_BEGIN_DECLS + +#define MM_TYPE_CALL_AUDIO_FORMAT (mm_call_audio_format_get_type ()) +#define MM_CALL_AUDIO_FORMAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_CALL_AUDIO_FORMAT, MMCallAudioFormat)) +#define MM_CALL_AUDIO_FORMAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_CALL_AUDIO_FORMAT, MMCallAudioFormatClass)) +#define MM_IS_CALL_AUDIO_FORMAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_CALL_AUDIO_FORMAT)) +#define MM_IS_CALL_AUDIO_FORMAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_CALL_AUDIO_FORMAT)) +#define MM_CALL_AUDIO_FORMAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_CALL_AUDIO_FORMAT, MMCallAudioFormatClass)) + +typedef struct _MMCallAudioFormat MMCallAudioFormat; +typedef struct _MMCallAudioFormatClass MMCallAudioFormatClass; +typedef struct _MMCallAudioFormatPrivate MMCallAudioFormatPrivate; + +/** + * MMCallAudioFormat: + * + * The #MMCallAudioFormat structure contains private data and should + * only be accessed using the provided API. + */ +struct _MMCallAudioFormat { + /*< private >*/ + GObject parent; + MMCallAudioFormatPrivate *priv; +}; + +struct _MMCallAudioFormatClass { + /*< private >*/ + GObjectClass parent; +}; + +GType mm_call_audio_format_get_type (void); + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallAudioFormat, g_object_unref) +#endif + +const gchar *mm_call_audio_format_get_encoding (MMCallAudioFormat *self); +const gchar *mm_call_audio_format_get_resolution (MMCallAudioFormat *self); +guint mm_call_audio_format_get_rate (MMCallAudioFormat *self); + +/*****************************************************************************/ +/* ModemManager/libmm-glib/mmcli specific methods */ + +#if defined (_LIBMM_INSIDE_MM) || \ + defined (_LIBMM_INSIDE_MMCLI) || \ + defined (LIBMM_GLIB_COMPILATION) + +MMCallAudioFormat *mm_call_audio_format_new (void); +MMCallAudioFormat *mm_call_audio_format_new_from_dictionary (GVariant *dictionary, + GError **error); + +MMCallAudioFormat *mm_call_audio_format_dup (MMCallAudioFormat *orig); + +void mm_call_audio_format_set_encoding (MMCallAudioFormat *self, + const gchar *encoding); +void mm_call_audio_format_set_resolution (MMCallAudioFormat *self, + const gchar *resolution); +void mm_call_audio_format_set_rate (MMCallAudioFormat *self, + guint rate); + +GVariant *mm_call_audio_format_get_dictionary (MMCallAudioFormat *self); + +#endif + +G_END_DECLS + +#endif /* MM_CALL_AUDIO_FORMAT_H */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-call.c modemmanager-1.10.0/libmm-glib/mm-call.c --- modemmanager-1.6.8/libmm-glib/mm-call.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-call.c 2019-01-15 15:57:35.000000000 +0100 @@ -36,6 +36,13 @@ G_DEFINE_TYPE (MMCall, mm_call, MM_GDBUS_TYPE_CALL_PROXY) +struct _MMCallPrivate { + /* Audio Format */ + GMutex audio_format_mutex; + guint audio_format_id; + MMCallAudioFormat *audio_format; +}; + /*****************************************************************************/ /** @@ -177,6 +184,156 @@ /*****************************************************************************/ /** + * mm_call_get_audio_port: + * @self: A #MMCall. + * + * Gets the kernel device used for audio (if any). + * + * Returns: (transfer none): The audio port, or %NULL if call audio is not + * routed via the host or couldn't be retrieved. + */ +const gchar * +mm_call_get_audio_port (MMCall *self) +{ + g_return_val_if_fail (MM_IS_CALL (self), NULL); + + RETURN_NON_EMPTY_CONSTANT_STRING ( + mm_gdbus_call_get_audio_port (MM_GDBUS_CALL (self))); +} + +/** + * mm_call_dup_audio_port: + * @self: A #MMCall. + * + * Gets the kernel device used for audio (if any). + * + * Returns: (transfer full): The audio port, or %NULL if call audio is not + * routed via the host or couldn't be retrieved. + */ +gchar * +mm_call_dup_audio_port (MMCall *self) +{ + g_return_val_if_fail (MM_IS_CALL (self), NULL); + + RETURN_NON_EMPTY_STRING ( + mm_gdbus_call_dup_audio_port (MM_GDBUS_CALL (self))); +} + +/*****************************************************************************/ + +static void +audio_format_updated (MMCall *self, + GParamSpec *pspec) +{ + g_mutex_lock (&self->priv->audio_format_mutex); + { + GVariant *dictionary; + + g_clear_object (&self->priv->audio_format); + + /* TODO: update existing object instead of re-creating? */ + dictionary = mm_gdbus_call_get_audio_format (MM_GDBUS_CALL (self)); + if (dictionary) { + GError *error = NULL; + + self->priv->audio_format = mm_call_audio_format_new_from_dictionary (dictionary, &error); + if (error) { + g_warning ("Invalid audio format update received: %s", error->message); + g_error_free (error); + } + } + } + g_mutex_unlock (&self->priv->audio_format_mutex); +} + +static void +ensure_internal_audio_format (MMCall *self, + MMCallAudioFormat **dup) +{ + g_mutex_lock (&self->priv->audio_format_mutex); + { + /* If this is the first time ever asking for the object, setup the + * update listener and the initial object, if any. */ + if (!self->priv->audio_format_id) { + GVariant *dictionary; + + dictionary = mm_gdbus_call_dup_audio_format (MM_GDBUS_CALL (self)); + if (dictionary) { + GError *error = NULL; + + self->priv->audio_format = mm_call_audio_format_new_from_dictionary (dictionary, &error); + if (error) { + g_warning ("Invalid initial audio format: %s", error->message); + g_error_free (error); + } + g_variant_unref (dictionary); + } + + /* No need to clear this signal connection when freeing self */ + self->priv->audio_format_id = + g_signal_connect (self, + "notify::audio-format", + G_CALLBACK (audio_format_updated), + NULL); + } + + if (dup && self->priv->audio_format) + *dup = g_object_ref (self->priv->audio_format); + } + g_mutex_unlock (&self->priv->audio_format_mutex); +} + +/** + * mm_call_get_audio_format: + * @self: A #MMCall. + * + * Gets a #MMCallAudioFormat object specifying the audio format used by the + * audio port if call audio is routed via the host. + * + * The values reported by @self are not updated when the values in the + * interface change. Instead, the client is expected to call + * mm_call_get_audio_format() again to get a new #MMCallAudioFormat with the + * new values. + * + * Returns: (transfer full): A #MMCallAudioFormat that must be freed with g_object_unref() or %NULL if unknown. + */ +MMCallAudioFormat * +mm_call_get_audio_format (MMCall *self) +{ + MMCallAudioFormat *format = NULL; + + g_return_val_if_fail (MM_IS_CALL (self), NULL); + + ensure_internal_audio_format (self, &format); + return format; +} + +/** + * mm_call_peek_audio_format: + * @self: A #MMCall. + * + * Gets a #MMCallAudioFormat object specifying the audio format used by the + * audio port if call audio is routed via the host. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_call_get_audio_format() if on another + * thread. + * + * Returns: (transfer none): A #MMCallAudioFormat. Do not free the returned value, it belongs to @self. + */ +MMCallAudioFormat * +mm_call_peek_audio_format (MMCall *self) +{ + g_return_val_if_fail (MM_IS_CALL (self), NULL); + + ensure_internal_audio_format (self, NULL); + return self->priv->audio_format; +} + +/*****************************************************************************/ + +/** * mm_call_start_finish: * @self: A #MMCall. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_call_start(). @@ -184,7 +341,7 @@ * * Finishes an operation started with mm_call_start(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_start_finish (MMCall *self, @@ -239,7 +396,7 @@ * The calling thread is blocked until a reply is received. * See mm_call_start() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_start_sync (MMCall *self, @@ -263,7 +420,7 @@ * * Finishes an operation started with mm_call_accept(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_accept_finish (MMCall *self, @@ -318,7 +475,7 @@ * The calling thread is blocked until an incoming call is ready. * See mm_call_accept() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_accept_sync (MMCall *self, @@ -342,7 +499,7 @@ * * Finishes an operation started with mm_call_hangup(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_hangup_finish (MMCall *self, @@ -397,7 +554,7 @@ * The calling thread is blocked until an incoming call is ready. * See mm_call_hangup() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_hangup_sync (MMCall *self, @@ -421,7 +578,7 @@ * * Finishes an operation started with mm_call_send_dtmf(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_send_dtmf_finish (MMCall *self, @@ -480,7 +637,7 @@ * The calling thread is blocked until an incoming call is ready. * See mm_call_send_dtmf() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_call_send_dtmf_sync (MMCall *self, @@ -500,9 +657,40 @@ static void mm_call_init (MMCall *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + MM_TYPE_CALL, + MMCallPrivate); + g_mutex_init (&self->priv->audio_format_mutex); +} + +static void +finalize (GObject *object) +{ + MMCall *self = MM_CALL (object); + + g_mutex_clear (&self->priv->audio_format_mutex); + + G_OBJECT_CLASS (mm_call_parent_class)->finalize (object); +} + +static void +dispose (GObject *object) +{ + MMCall *self = MM_CALL (object); + + g_clear_object (&self->priv->audio_format); + + G_OBJECT_CLASS (mm_call_parent_class)->dispose (object); } static void mm_call_class_init (MMCallClass *call_class) { + GObjectClass *object_class = G_OBJECT_CLASS (call_class); + + g_type_class_add_private (object_class, sizeof (MMCallPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + object_class->finalize = finalize; } diff -Nru modemmanager-1.6.8/libmm-glib/mm-call.h modemmanager-1.10.0/libmm-glib/mm-call.h --- modemmanager-1.6.8/libmm-glib/mm-call.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-call.h 2019-01-15 15:57:35.000000000 +0100 @@ -26,7 +26,7 @@ #include #include "mm-gdbus-call.h" -#include "mm-call-properties.h" +#include "mm-call-audio-format.h" G_BEGIN_DECLS @@ -39,6 +39,7 @@ typedef struct _MMCall MMCall; typedef struct _MMCallClass MMCallClass; +typedef struct _MMCallPrivate MMCallPrivate; /** * MMCall: @@ -49,7 +50,7 @@ struct _MMCall { /*< private >*/ MmGdbusCallProxy parent; - gpointer unused; + MMCallPrivate *priv; }; struct _MMCallClass { @@ -59,6 +60,10 @@ GType mm_call_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCall, g_object_unref) +#endif + const gchar *mm_call_get_path (MMCall *self); gchar *mm_call_dup_path (MMCall *self); @@ -71,6 +76,11 @@ MMCallDirection mm_call_get_direction (MMCall *self); +const gchar *mm_call_get_audio_port (MMCall *self); +gchar *mm_call_dup_audio_port (MMCall *self); + +MMCallAudioFormat *mm_call_get_audio_format (MMCall *self); +MMCallAudioFormat *mm_call_peek_audio_format(MMCall *self); void mm_call_start (MMCall *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-call-properties.h modemmanager-1.10.0/libmm-glib/mm-call-properties.h --- modemmanager-1.6.8/libmm-glib/mm-call-properties.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-call-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_call_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallProperties, g_object_unref) +#endif + MMCallProperties *mm_call_properties_new (void); void mm_call_properties_set_number (MMCallProperties *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-cdma-manual-activation-properties.c modemmanager-1.10.0/libmm-glib/mm-cdma-manual-activation-properties.c --- modemmanager-1.6.8/libmm-glib/mm-cdma-manual-activation-properties.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-cdma-manual-activation-properties.c 2018-11-15 09:55:53.000000000 +0100 @@ -407,10 +407,11 @@ gsize *prl_len) { g_return_val_if_fail (MM_IS_CDMA_MANUAL_ACTIVATION_PROPERTIES (self), NULL); - if (self->priv->prl && prl_len) - *prl_len = self->priv->prl->len; - return self->priv->prl->data; + if (prl_len) + *prl_len = (self->priv->prl ? self->priv->prl->len : 0); + + return (self->priv->prl ? self->priv->prl->data : NULL); } /** diff -Nru modemmanager-1.6.8/libmm-glib/mm-cdma-manual-activation-properties.h modemmanager-1.10.0/libmm-glib/mm-cdma-manual-activation-properties.h --- modemmanager-1.6.8/libmm-glib/mm-cdma-manual-activation-properties.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-cdma-manual-activation-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_cdma_manual_activation_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCdmaManualActivationProperties, g_object_unref) +#endif + MMCdmaManualActivationProperties *mm_cdma_manual_activation_properties_new (void); gboolean mm_cdma_manual_activation_properties_set_spc (MMCdmaManualActivationProperties *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-common-helpers.c modemmanager-1.10.0/libmm-glib/mm-common-helpers.c --- modemmanager-1.6.8/libmm-glib/mm-common-helpers.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-common-helpers.c 2019-01-15 15:57:35.000000000 +0100 @@ -25,6 +25,66 @@ #include "mm-errors-types.h" #include "mm-common-helpers.h" +static gint +_enum_from_string (GType type, + const gchar *str, + gint error_value, + GError **error) +{ + GEnumClass *enum_class; + gint value; + guint i; + + enum_class = G_ENUM_CLASS (g_type_class_ref (type)); + + for (i = 0; enum_class->values[i].value_nick; i++) { + if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) { + value = enum_class->values[i].value; + g_type_class_unref (enum_class); + return value; + } + } + + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Couldn't match '%s' with a valid %s value", + str, + g_type_name (type)); + g_type_class_unref (enum_class); + return error_value; +} + +static guint +_flags_from_string (GType type, + const gchar *str, + guint error_value, + GError **error) +{ + GFlagsClass *flags_class; + guint value; + guint i; + + flags_class = G_FLAGS_CLASS (g_type_class_ref (type)); + + for (i = 0; flags_class->values[i].value_nick; i++) { + if (!g_ascii_strcasecmp (str, flags_class->values[i].value_nick)) { + value = flags_class->values[i].value; + g_type_class_unref (flags_class); + return value; + } + } + + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Couldn't match '%s' with a valid %s value", + str, + g_type_name (type)); + g_type_class_unref (flags_class); + return error_value; +} + gchar * mm_common_build_capabilities_string (const MMModemCapability *capabilities, guint n_capabilities) @@ -662,6 +722,38 @@ return !different; } +void +mm_common_bands_garray_sort (GArray *array) +{ + g_array_sort (array, (GCompareFunc) cmp_band); +} + +gboolean +mm_common_band_is_gsm (MMModemBand band) +{ + return ((band >= MM_MODEM_BAND_EGSM && band <= MM_MODEM_BAND_G850) || + (band >= MM_MODEM_BAND_G450 && band <= MM_MODEM_BAND_G810)); +} + +gboolean +mm_common_band_is_utran (MMModemBand band) +{ + return ((band >= MM_MODEM_BAND_UTRAN_1 && band <= MM_MODEM_BAND_UTRAN_7) || + (band >= MM_MODEM_BAND_UTRAN_10 && band <= MM_MODEM_BAND_UTRAN_32)); +} + +gboolean +mm_common_band_is_eutran (MMModemBand band) +{ + return (band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_71); +} + +gboolean +mm_common_band_is_cdma (MMModemBand band) +{ + return (band >= MM_MODEM_BAND_CDMA_BC0 && band <= MM_MODEM_BAND_CDMA_BC19); +} + GArray * mm_common_mode_combinations_variant_to_garray (GVariant *variant) { @@ -752,6 +844,16 @@ return g_variant_builder_end (&builder); } +MMModem3gppEpsUeModeOperation +mm_common_get_eps_ue_mode_operation_from_string (const gchar *str, + GError **error) +{ + return _enum_from_string (MM_TYPE_MODEM_3GPP_EPS_UE_MODE_OPERATION, + str, + MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN, + error); +} + GArray * mm_common_oma_pending_network_initiated_sessions_variant_to_garray (GVariant *variant) { @@ -853,44 +955,20 @@ mm_common_get_rm_protocol_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_MODEM_CDMA_RM_PROTOCOL)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMModemCdmaRmProtocol value", - str); - return MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN; + return _enum_from_string (MM_TYPE_MODEM_CDMA_RM_PROTOCOL, + str, + MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN, + error); } MMBearerIpFamily mm_common_get_ip_type_from_string (const gchar *str, GError **error) { - GFlagsClass *flags_class; - guint i; - - flags_class = G_FLAGS_CLASS (g_type_class_ref (MM_TYPE_BEARER_IP_FAMILY)); - - for (i = 0; flags_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, flags_class->values[i].value_nick)) - return flags_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMBearerIpFamily value", - str); - return MM_BEARER_IP_FAMILY_NONE; + return _flags_from_string (MM_TYPE_BEARER_IP_FAMILY, + str, + MM_BEARER_IP_FAMILY_NONE, + error); } MMBearerAllowedAuth @@ -947,132 +1025,60 @@ mm_common_get_sms_storage_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_SMS_STORAGE)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMSmsStorage value", - str); - return MM_SMS_STORAGE_UNKNOWN; + return _enum_from_string (MM_TYPE_SMS_STORAGE, + str, + MM_SMS_STORAGE_UNKNOWN, + error); } MMSmsCdmaTeleserviceId mm_common_get_sms_cdma_teleservice_id_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_SMS_CDMA_TELESERVICE_ID)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMSmsCdmaTeleserviceId value", - str); - return MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN; + return _enum_from_string (MM_TYPE_SMS_CDMA_TELESERVICE_ID, + str, + MM_SMS_CDMA_TELESERVICE_ID_UNKNOWN, + error); } MMSmsCdmaServiceCategory mm_common_get_sms_cdma_service_category_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_SMS_CDMA_SERVICE_CATEGORY)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMSmsCdmaServiceCategory value", - str); - return MM_SMS_CDMA_SERVICE_CATEGORY_UNKNOWN; + return _enum_from_string (MM_TYPE_SMS_CDMA_SERVICE_CATEGORY, + str, + MM_SMS_CDMA_SERVICE_CATEGORY_UNKNOWN, + error); } MMCallDirection mm_common_get_call_direction_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_CALL_DIRECTION)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMCallDirection value", - str); - return MM_CALL_DIRECTION_UNKNOWN; + return _enum_from_string (MM_TYPE_CALL_DIRECTION, + str, + MM_CALL_DIRECTION_UNKNOWN, + error); } MMCallState mm_common_get_call_state_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_CALL_STATE)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMCallState value", - str); - return MM_CALL_STATE_UNKNOWN; + return _enum_from_string (MM_TYPE_CALL_STATE, + str, + MM_CALL_STATE_UNKNOWN, + error); } MMCallStateReason mm_common_get_call_state_reason_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_CALL_STATE_REASON)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMCallStateReason value", - str); - return MM_CALL_STATE_REASON_UNKNOWN; + return _enum_from_string (MM_TYPE_CALL_STATE_REASON, + str, + MM_CALL_STATE_REASON_UNKNOWN, + error); } MMOmaFeature @@ -1129,22 +1135,10 @@ mm_common_get_oma_session_type_from_string (const gchar *str, GError **error) { - GEnumClass *enum_class; - guint i; - - enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_OMA_SESSION_TYPE)); - - for (i = 0; enum_class->values[i].value_nick; i++) { - if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) - return enum_class->values[i].value; - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't match '%s' with a valid MMOmaSessionType value", - str); - return MM_OMA_SESSION_TYPE_UNKNOWN; + return _enum_from_string (MM_TYPE_OMA_SESSION_TYPE, + str, + MM_OMA_SESSION_TYPE_UNKNOWN, + error); } GVariant * @@ -1389,6 +1383,49 @@ if (!errno && num <= G_MAXUINT) { *out = (guint)num; return TRUE; + } + return FALSE; +} + +/** + * mm_get_uint_from_hex_str: + * @str: the hex string to convert to an unsigned int + * @out: on success, the number + * + * Converts a string to an unsigned number. All characters in the string + * MUST be valid hexadecimal digits (0-9, A-F, a-f), otherwise FALSE is + * returned. + * + * An optional "0x" prefix may be given in @str. + * + * Returns: %TRUE if the string was converted, %FALSE if it was not or if it + * did not contain only digits. + */ +gboolean +mm_get_uint_from_hex_str (const gchar *str, + guint *out) +{ + gulong num; + + if (!str) + return FALSE; + + if (g_str_has_prefix (str, "0x")) + str = &str[2]; + + if (!str[0]) + return FALSE; + + for (num = 0; str[num]; num++) { + if (!g_ascii_isxdigit (str[num])) + return FALSE; + } + + errno = 0; + num = strtoul (str, NULL, 16); + if (!errno && num <= G_MAXUINT) { + *out = (guint)num; + return TRUE; } return FALSE; } diff -Nru modemmanager-1.6.8/libmm-glib/mm-common-helpers.h modemmanager-1.10.0/libmm-glib/mm-common-helpers.h --- modemmanager-1.6.8/libmm-glib/mm-common-helpers.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-common-helpers.h 2019-01-15 15:57:35.000000000 +0100 @@ -76,6 +76,9 @@ MMOmaSessionType mm_common_get_oma_session_type_from_string (const gchar *str, GError **error); +MMModem3gppEpsUeModeOperation mm_common_get_eps_ue_mode_operation_from_string (const gchar *str, + GError **error); + GArray *mm_common_ports_variant_to_garray (GVariant *variant); MMModemPortInfo *mm_common_ports_variant_to_array (GVariant *variant, guint *n_ports); @@ -100,7 +103,13 @@ GVariant *mm_common_build_bands_any (void); GVariant *mm_common_build_bands_unknown (void); -gboolean mm_common_bands_garray_cmp (GArray *a, GArray *b); +gboolean mm_common_bands_garray_cmp (GArray *a, GArray *b); +void mm_common_bands_garray_sort (GArray *array); + +gboolean mm_common_band_is_gsm (MMModemBand band); +gboolean mm_common_band_is_utran (MMModemBand band); +gboolean mm_common_band_is_eutran (MMModemBand band); +gboolean mm_common_band_is_cdma (MMModemBand band); GArray *mm_common_mode_combinations_variant_to_garray (GVariant *variant); MMModemModeCombination *mm_common_mode_combinations_variant_to_array (GVariant *variant, @@ -143,6 +152,8 @@ gint *out); gboolean mm_get_uint_from_str (const gchar *str, guint *out); +gboolean mm_get_uint_from_hex_str (const gchar *str, + guint *out); gboolean mm_get_uint_from_match_info (GMatchInfo *match_info, guint32 match_index, guint *out); @@ -163,4 +174,27 @@ gboolean mm_utils_check_for_single_value (guint32 value); +#if GLIB_CHECK_VERSION(2, 44, 0) +#define mm_autoptr g_autoptr +#else + +/* Re-implement for those glib that don't have it */ +#define _MM_AUTOPTR_FUNC_NAME(TypeName) mm_autoptr_cleanup_##TypeName +#define _MM_AUTOPTR_TYPENAME(TypeName) TypeName##_autoptr +#define _MM_CLEANUP(func) __attribute__((cleanup(func))) + +#define _MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, cleanup) \ + typedef TypeName *_MM_AUTOPTR_TYPENAME(TypeName); \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + static G_GNUC_UNUSED inline void _MM_AUTOPTR_FUNC_NAME(TypeName) (TypeName **_ptr) \ + { if (_ptr && *_ptr) (cleanup) (*_ptr); } \ + G_GNUC_END_IGNORE_DEPRECATIONS + +#define mm_autoptr(TypeName) _MM_CLEANUP(_MM_AUTOPTR_FUNC_NAME(TypeName)) _MM_AUTOPTR_TYPENAME(TypeName) + +_MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(GRegex, g_regex_unref) +_MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(GMatchInfo, g_match_info_unref) + +#endif + #endif /* MM_COMMON_HELPERS_H */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-firmware-properties.h modemmanager-1.10.0/libmm-glib/mm-firmware-properties.h --- modemmanager-1.6.8/libmm-glib/mm-firmware-properties.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-firmware-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_firmware_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMFirmwareProperties, g_object_unref) +#endif + const gchar *mm_firmware_properties_get_unique_id (MMFirmwareProperties *self); MMFirmwareImageType mm_firmware_properties_get_image_type (MMFirmwareProperties *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-firmware-update-settings.c modemmanager-1.10.0/libmm-glib/mm-firmware-update-settings.c --- modemmanager-1.6.8/libmm-glib/mm-firmware-update-settings.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-firmware-update-settings.c 2019-01-16 15:56:42.000000000 +0100 @@ -0,0 +1,335 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include "mm-errors-types.h" +#include "mm-common-helpers.h" +#include "mm-firmware-update-settings.h" + +/** + * SECTION: mm-firmware-update-settings + * @title: MMFirmwareUpdateSettings + * @short_description: Helper object to handle firmware update settings. + * + * The #MMFirmwareUpdateSettings is an object handling the settings exposed to + * aid in the firmware update operation. + */ + +G_DEFINE_TYPE (MMFirmwareUpdateSettings, mm_firmware_update_settings, G_TYPE_OBJECT) + +#define PROPERTY_DEVICE_IDS "device-ids" +#define PROPERTY_VERSION "version" +#define PROPERTY_FASTBOOT_AT "fastboot-at" + +struct _MMFirmwareUpdateSettingsPrivate { + /* Generic */ + MMModemFirmwareUpdateMethod method; + gchar **device_ids; + gchar *version; + /* Fasboot specific */ + gchar *fastboot_at; +}; + +/*****************************************************************************/ + +/** + * mm_firmware_update_settings_get_method: + * @self: A #MMFirmwareUpdateSettings. + * + * Gets the methods to use during the firmware update operation. + * + * Returns: a bitmask of #MMModemFirmwareUpdateMethod values. + */ +MMModemFirmwareUpdateMethod +mm_firmware_update_settings_get_method (MMFirmwareUpdateSettings *self) +{ + g_return_val_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self), MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE); + + return self->priv->method; +} + +/*****************************************************************************/ + +/** + * mm_firmware_update_settings_get_device_ids: + * @self: a #MMFirmwareUpdateSettings. + * + * Gets the list of device ids used to identify the device during a firmware update + * operation. + * + * Returns: (transfer none): The list of device ids, or %NULL if unknown. Do not free the returned value, it is owned by @self. + */ +const gchar ** +mm_firmware_update_settings_get_device_ids (MMFirmwareUpdateSettings *self) +{ + g_return_val_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self), NULL); + + return (const gchar **) self->priv->device_ids; +} + +void +mm_firmware_update_settings_set_device_ids (MMFirmwareUpdateSettings *self, + const gchar **device_ids) +{ + g_return_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self)); + + g_strfreev (self->priv->device_ids); + self->priv->device_ids = g_strdupv ((gchar **)device_ids); +} + +/*****************************************************************************/ + +/** + * mm_firmware_update_settings_get_version: + * @self: a #MMFirmwareUpdateSettings. + * + * Gets firmware version string. + * + * + * Returns: The version string, or %NULL if unknown. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_firmware_update_settings_get_version (MMFirmwareUpdateSettings *self) +{ + g_return_val_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self), NULL); + + return self->priv->version; +} + +void +mm_firmware_update_settings_set_version (MMFirmwareUpdateSettings *self, + const gchar *version) +{ + g_return_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self)); + + g_free (self->priv->version); + self->priv->version = g_strdup (version); +} + +/*****************************************************************************/ + +/** + * mm_firmware_update_settings_get_fastboot_at: + * @self: a #MMFirmwareUpdateSettings. + * + * Gets the AT command that should be sent to the module to trigger a reset + * into fastboot mode. + * + * Only applicable if the update method includes %MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT. + * + * Returns: The AT command string, or %NULL if unknown. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_firmware_update_settings_get_fastboot_at (MMFirmwareUpdateSettings *self) +{ + g_return_val_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self), NULL); + g_return_val_if_fail (self->priv->method & MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT, NULL); + + return self->priv->fastboot_at; +} + +void +mm_firmware_update_settings_set_fastboot_at (MMFirmwareUpdateSettings *self, + const gchar *fastboot_at) +{ + g_return_if_fail (MM_IS_FIRMWARE_UPDATE_SETTINGS (self)); + g_return_if_fail (self->priv->method & MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT); + + g_free (self->priv->fastboot_at); + self->priv->fastboot_at = g_strdup (fastboot_at); +} + +/*****************************************************************************/ + +/** + * mm_firmware_update_settings_get_variant: + * @self: A #MMFirmwareUpdateSettings. + * + * Gets a variant with the contents of @self. + * + * Returns: (transfer full): A variant with the update settings. The returned value should be freed with g_variant_unref(). + */ +GVariant * +mm_firmware_update_settings_get_variant (MMFirmwareUpdateSettings *self) +{ + MMModemFirmwareUpdateMethod method; + GVariantBuilder builder; + + method = (self ? self->priv->method : MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE); + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(ua{sv})")); + g_variant_builder_add (&builder, "u", method); + + g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); + { + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_DEVICE_IDS, + g_variant_new_strv ((const gchar * const *)self->priv->device_ids, -1)); + + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_VERSION, + g_variant_new_string (self->priv->version)); + + if (method & MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT) { + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_FASTBOOT_AT, + g_variant_new_string (self->priv->fastboot_at)); + } + } + g_variant_builder_close (&builder); + + return g_variant_ref_sink (g_variant_builder_end (&builder)); +} + +/*****************************************************************************/ + +static gboolean +consume_variant (MMFirmwareUpdateSettings *self, + const gchar *key, + GVariant *value, + GError **error) +{ + if (g_str_equal (key, PROPERTY_FASTBOOT_AT)) { + g_free (self->priv->fastboot_at); + self->priv->fastboot_at = g_variant_dup_string (value, NULL); + } else if (g_str_equal (key, PROPERTY_VERSION)) { + g_free (self->priv->version); + self->priv->version = g_variant_dup_string (value, NULL); + } else if (g_str_equal (key, PROPERTY_DEVICE_IDS)) { + g_strfreev (self->priv->device_ids); + self->priv->device_ids = g_variant_dup_strv (value, NULL); + } else { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid settings dictionary, unexpected key '%s'", key); + return FALSE; + } + return TRUE; +} + +/** + * mm_firmware_update_settings_new_from_variant: + * @variant: A variant with the update settings. + * @error: Return location for error or %NULL. + * + * Creates a new #MMFirmwareUpdateSettings from the input @variant. + * + * Returns: (transfer full): A #MMFirmwareUpdateSettings or %NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMFirmwareUpdateSettings * +mm_firmware_update_settings_new_from_variant (GVariant *variant, + GError **error) +{ + MMFirmwareUpdateSettings *self; + guint method = MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE; + GVariant *dictionary = NULL; + GError *inner_error = NULL; + + if (!variant) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "No input given"); + return NULL; + } + + if (!g_variant_is_of_type (variant, G_VARIANT_TYPE ("(ua{sv})"))) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid input type"); + return NULL; + } + + g_variant_get (variant, "(u@a{sv})", &method, &dictionary); + self = mm_firmware_update_settings_new (method); + + if ((method != MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE) && dictionary) { + GVariantIter iter; + gchar *key; + GVariant *value; + + g_variant_iter_init (&iter, dictionary); + while (!inner_error && g_variant_iter_next (&iter, "{sv}", &key, &value)) { + consume_variant (self, key, value, &inner_error); + g_free (key); + g_variant_unref (value); + } + + if (!inner_error) { + if (!self->priv->device_ids) + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Missing required '" PROPERTY_DEVICE_IDS "' setting"); + else if (!self->priv->version) + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Missing required '" PROPERTY_VERSION "' setting"); + } + + if (!inner_error) { + if ((method & MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT) && (!self->priv->fastboot_at)) + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Fastboot method requires the '" PROPERTY_FASTBOOT_AT "' setting"); + } + g_variant_unref (dictionary); + } + + if (inner_error) { + g_propagate_error (error, inner_error); + g_object_unref (self); + return NULL; + } + + return self; +} + +/*****************************************************************************/ + +MMFirmwareUpdateSettings * +mm_firmware_update_settings_new (MMModemFirmwareUpdateMethod method) +{ + MMFirmwareUpdateSettings *self; + + self = g_object_new (MM_TYPE_FIRMWARE_UPDATE_SETTINGS, NULL); + self->priv->method = method; + return self; +} + +static void +mm_firmware_update_settings_init (MMFirmwareUpdateSettings *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_FIRMWARE_UPDATE_SETTINGS, MMFirmwareUpdateSettingsPrivate); + self->priv->method = MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE; +} + +static void +finalize (GObject *object) +{ + MMFirmwareUpdateSettings *self = MM_FIRMWARE_UPDATE_SETTINGS (object); + + g_strfreev (self->priv->device_ids); + g_free (self->priv->version); + g_free (self->priv->fastboot_at); + + G_OBJECT_CLASS (mm_firmware_update_settings_parent_class)->finalize (object); +} + +static void +mm_firmware_update_settings_class_init (MMFirmwareUpdateSettingsClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMFirmwareUpdateSettingsPrivate)); + + object_class->finalize = finalize; +} diff -Nru modemmanager-1.6.8/libmm-glib/mm-firmware-update-settings.h modemmanager-1.10.0/libmm-glib/mm-firmware-update-settings.h --- modemmanager-1.6.8/libmm-glib/mm-firmware-update-settings.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-firmware-update-settings.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,99 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_FIRMWARE_UPDATE_SETTINGS_H +#define MM_FIRMWARE_UPDATE_SETTINGS_H + +#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include + +G_BEGIN_DECLS + +#define MM_TYPE_FIRMWARE_UPDATE_SETTINGS (mm_firmware_update_settings_get_type ()) +#define MM_FIRMWARE_UPDATE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_FIRMWARE_UPDATE_SETTINGS, MMFirmwareUpdateSettings)) +#define MM_FIRMWARE_UPDATE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_FIRMWARE_UPDATE_SETTINGS, MMFirmwareUpdateSettingsClass)) +#define MM_IS_FIRMWARE_UPDATE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_FIRMWARE_UPDATE_SETTINGS)) +#define MM_IS_FIRMWARE_UPDATE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_FIRMWARE_UPDATE_SETTINGS)) +#define MM_FIRMWARE_UPDATE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_FIRMWARE_UPDATE_SETTINGS, MMFirmwareUpdateSettingsClass)) + +typedef struct _MMFirmwareUpdateSettings MMFirmwareUpdateSettings; +typedef struct _MMFirmwareUpdateSettingsClass MMFirmwareUpdateSettingsClass; +typedef struct _MMFirmwareUpdateSettingsPrivate MMFirmwareUpdateSettingsPrivate; + +/** + * MMFirmwareUpdateSettings: + * + * The #MMFirmwareUpdateSettings structure contains private data and should only be accessed + * using the provided API. + */ +struct _MMFirmwareUpdateSettings { + /*< private >*/ + GObject parent; + MMFirmwareUpdateSettingsPrivate *priv; +}; + +struct _MMFirmwareUpdateSettingsClass { + /*< private >*/ + GObjectClass parent; +}; + +GType mm_firmware_update_settings_get_type (void); + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMFirmwareUpdateSettings, g_object_unref) +#endif + +MMModemFirmwareUpdateMethod mm_firmware_update_settings_get_method (MMFirmwareUpdateSettings *self); + +/* Generic */ +const gchar **mm_firmware_update_settings_get_device_ids (MMFirmwareUpdateSettings *self); +const gchar *mm_firmware_update_settings_get_version (MMFirmwareUpdateSettings *self); + +/* Fastboot specific */ +const gchar *mm_firmware_update_settings_get_fastboot_at (MMFirmwareUpdateSettings *self); + +/*****************************************************************************/ +/* ModemManager/libmm-glib/mmcli specific methods */ + +#if defined (_LIBMM_INSIDE_MM) || \ + defined (_LIBMM_INSIDE_MMCLI) || \ + defined (LIBMM_GLIB_COMPILATION) + +MMFirmwareUpdateSettings *mm_firmware_update_settings_new (MMModemFirmwareUpdateMethod method); + +MMFirmwareUpdateSettings *mm_firmware_update_settings_new_from_variant (GVariant *variant, + GError **error); + +GVariant *mm_firmware_update_settings_get_variant (MMFirmwareUpdateSettings *self); + +/* Generic */ +void mm_firmware_update_settings_set_device_ids (MMFirmwareUpdateSettings *self, + const gchar **device_ids); +void mm_firmware_update_settings_set_version (MMFirmwareUpdateSettings *self, + const gchar *version); + +/* Fastboot specific */ +void mm_firmware_update_settings_set_fastboot_at (MMFirmwareUpdateSettings *self, + const gchar *fastboot_at); + +#endif + +G_END_DECLS + +#endif /* MM_FIRMWARE_UPDATE_SETTINGS_H */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-kernel-event-properties.c modemmanager-1.10.0/libmm-glib/mm-kernel-event-properties.c --- modemmanager-1.6.8/libmm-glib/mm-kernel-event-properties.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-kernel-event-properties.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,454 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#include +#include +#include + +#include "mm-errors-types.h" +#include "mm-enums-types.h" +#include "mm-common-helpers.h" +#include "mm-kernel-event-properties.h" + +/** + * SECTION: mm-kernel-event-properties + * @title: MMKernelEventProperties + * @short_description: Helper object to handle kernel event properties. + * + * The #MMKernelEventProperties is an object handling the properties to be set + * in reported kernel events. + * + * This object is created by the user and passed to ModemManager with either + * mm_manager_report_kernel_event() or mm_manager_report_kernel_event_sync(). + */ + +G_DEFINE_TYPE (MMKernelEventProperties, mm_kernel_event_properties, G_TYPE_OBJECT) + +#define PROPERTY_ACTION "action" +#define PROPERTY_SUBSYSTEM "subsystem" +#define PROPERTY_NAME "name" +#define PROPERTY_UID "uid" + +struct _MMKernelEventPropertiesPrivate { + gchar *action; + gchar *subsystem; + gchar *name; + gchar *uid; +}; + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_set_action: + * @self: A #MMKernelEventProperties. + * @action: The action to set. + * + * Sets the action. + */ +void +mm_kernel_event_properties_set_action (MMKernelEventProperties *self, + const gchar *action) +{ + g_return_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self)); + + g_free (self->priv->action); + self->priv->action = g_strdup (action); +} + +/** + * mm_kernel_event_properties_get_action: + * @self: A #MMKernelEventProperties. + * + * Gets the action. + * + * Returns: (transfer none): The action. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_kernel_event_properties_get_action (MMKernelEventProperties *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self), NULL); + + return self->priv->action; +} + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_set_subsystem: + * @self: A #MMKernelEventProperties. + * @subsystem: The subsystem to set. + * + * Sets the subsystem. + */ +void +mm_kernel_event_properties_set_subsystem (MMKernelEventProperties *self, + const gchar *subsystem) +{ + g_return_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self)); + + g_free (self->priv->subsystem); + self->priv->subsystem = g_strdup (subsystem); +} + +/** + * mm_kernel_event_properties_get_subsystem: + * @self: A #MMKernelEventProperties. + * + * Gets the subsystem. + * + * Returns: (transfer none): The subsystem. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_kernel_event_properties_get_subsystem (MMKernelEventProperties *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self), NULL); + + return self->priv->subsystem; +} + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_set_name: + * @self: A #MMKernelEventProperties. + * @name: The name to set. + * + * Sets the name. + */ +void +mm_kernel_event_properties_set_name (MMKernelEventProperties *self, + const gchar *name) +{ + g_return_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self)); + + g_free (self->priv->name); + self->priv->name = g_strdup (name); +} + +/** + * mm_kernel_event_properties_get_name: + * @self: A #MMKernelEventProperties. + * + * Gets the name. + * + * Returns: (transfer none): The name. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_kernel_event_properties_get_name (MMKernelEventProperties *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self), NULL); + + return self->priv->name; +} + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_set_uid: + * @self: A #MMKernelEventProperties. + * @uid: The uid to set. + * + * Sets the unique ID of the physical device. + */ +void +mm_kernel_event_properties_set_uid (MMKernelEventProperties *self, + const gchar *uid) +{ + g_return_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self)); + + g_free (self->priv->uid); + self->priv->uid = g_strdup (uid); +} + +/** + * mm_kernel_event_properties_get_uid: + * @self: A #MMKernelEventProperties. + * + * Gets the unique ID of the physical device. + * + * Returns: (transfer none): The uid. Do not free the returned value, it is owned by @self. + */ +const gchar * +mm_kernel_event_properties_get_uid (MMKernelEventProperties *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self), NULL); + + return self->priv->uid; +} + +/*****************************************************************************/ + +GVariant * +mm_kernel_event_properties_get_dictionary (MMKernelEventProperties *self) +{ + GVariantBuilder builder; + + /* We do allow NULL */ + if (!self) + return NULL; + + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (self), NULL); + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + + if (self->priv->action) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_ACTION, + g_variant_new_string (self->priv->action)); + + if (self->priv->subsystem) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_SUBSYSTEM, + g_variant_new_string (self->priv->subsystem)); + + if (self->priv->name) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_NAME, + g_variant_new_string (self->priv->name)); + + if (self->priv->uid) + g_variant_builder_add (&builder, + "{sv}", + PROPERTY_UID, + g_variant_new_string (self->priv->uid)); + + return g_variant_ref_sink (g_variant_builder_end (&builder)); +} + +/*****************************************************************************/ + +static gboolean +consume_string (MMKernelEventProperties *self, + const gchar *key, + const gchar *value, + GError **error) +{ + if (g_str_equal (key, PROPERTY_ACTION)) + mm_kernel_event_properties_set_action (self, value); + else if (g_str_equal (key, PROPERTY_SUBSYSTEM)) + mm_kernel_event_properties_set_subsystem (self, value); + else if (g_str_equal (key, PROPERTY_NAME)) + mm_kernel_event_properties_set_name (self, value); + else if (g_str_equal (key, PROPERTY_UID)) + mm_kernel_event_properties_set_uid (self, value); + else { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Invalid properties string, unexpected key '%s'", + key); + return FALSE; + } + + return TRUE; +} + +typedef struct { + MMKernelEventProperties *properties; + GError *error; +} ParseKeyValueContext; + +static gboolean +key_value_foreach (const gchar *key, + const gchar *value, + ParseKeyValueContext *ctx) +{ + return consume_string (ctx->properties, + key, + value, + &ctx->error); +} + +MMKernelEventProperties * +mm_kernel_event_properties_new_from_string (const gchar *str, + GError **error) +{ + ParseKeyValueContext ctx; + + ctx.properties = mm_kernel_event_properties_new (); + ctx.error = NULL; + + mm_common_parse_key_value_string (str, + &ctx.error, + (MMParseKeyValueForeachFn) key_value_foreach, + &ctx); + + /* If error, destroy the object */ + if (ctx.error) { + g_propagate_error (error, ctx.error); + g_object_unref (ctx.properties); + ctx.properties = NULL; + } + + return ctx.properties; +} + +/*****************************************************************************/ + +static gboolean +consume_variant (MMKernelEventProperties *properties, + const gchar *key, + GVariant *value, + GError **error) +{ + if (g_str_equal (key, PROPERTY_ACTION)) + mm_kernel_event_properties_set_action ( + properties, + g_variant_get_string (value, NULL)); + else if (g_str_equal (key, PROPERTY_SUBSYSTEM)) + mm_kernel_event_properties_set_subsystem ( + properties, + g_variant_get_string (value, NULL)); + else if (g_str_equal (key, PROPERTY_NAME)) + mm_kernel_event_properties_set_name ( + properties, + g_variant_get_string (value, NULL)); + else if (g_str_equal (key, PROPERTY_UID)) + mm_kernel_event_properties_set_uid ( + properties, + g_variant_get_string (value, NULL)); + else { + /* Set error */ + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Invalid properties dictionary, unexpected key '%s'", + key); + return FALSE; + } + + return TRUE; +} + +MMKernelEventProperties * +mm_kernel_event_properties_new_from_dictionary (GVariant *dictionary, + GError **error) +{ + GError *inner_error = NULL; + GVariantIter iter; + gchar *key; + GVariant *value; + MMKernelEventProperties *properties; + + properties = mm_kernel_event_properties_new (); + if (!dictionary) + return properties; + + if (!g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{sv}"))) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot create kernel event properties from dictionary: " + "invalid variant type received"); + g_object_unref (properties); + return NULL; + } + + g_variant_iter_init (&iter, dictionary); + while (!inner_error && + g_variant_iter_next (&iter, "{sv}", &key, &value)) { + consume_variant (properties, + key, + value, + &inner_error); + g_free (key); + g_variant_unref (value); + } + + /* If error, destroy the object */ + if (inner_error) { + g_propagate_error (error, inner_error); + g_object_unref (properties); + properties = NULL; + } + + return properties; +} + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_dup: + * @orig: a #MMKernelEventProperties + * + * Returns a copy of @orig. + * + * Returns: (transfer full): a #MMKernelEventProperties + */ +MMKernelEventProperties * +mm_kernel_event_properties_dup (MMKernelEventProperties *orig) +{ + GVariant *dict; + MMKernelEventProperties *copy; + GError *error = NULL; + + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (orig), NULL); + + dict = mm_kernel_event_properties_get_dictionary (orig); + copy = mm_kernel_event_properties_new_from_dictionary (dict, &error); + g_assert_no_error (error); + g_variant_unref (dict); + + return copy; +} + +/*****************************************************************************/ + +/** + * mm_kernel_event_properties_new: + * + * Creates a new empty #MMKernelEventProperties. + * + * Returns: (transfer full): a #MMKernelEventProperties. The returned value should be freed with g_object_unref(). + */ +MMKernelEventProperties * +mm_kernel_event_properties_new (void) +{ + return (MM_KERNEL_EVENT_PROPERTIES (g_object_new (MM_TYPE_KERNEL_EVENT_PROPERTIES, NULL))); +} + +static void +mm_kernel_event_properties_init (MMKernelEventProperties *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + MM_TYPE_KERNEL_EVENT_PROPERTIES, + MMKernelEventPropertiesPrivate); +} + +static void +finalize (GObject *object) +{ + MMKernelEventProperties *self = MM_KERNEL_EVENT_PROPERTIES (object); + + g_free (self->priv->action); + g_free (self->priv->subsystem); + g_free (self->priv->name); + g_free (self->priv->uid); + + G_OBJECT_CLASS (mm_kernel_event_properties_parent_class)->finalize (object); +} + +static void +mm_kernel_event_properties_class_init (MMKernelEventPropertiesClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMKernelEventPropertiesPrivate)); + + object_class->finalize = finalize; +} diff -Nru modemmanager-1.6.8/libmm-glib/mm-kernel-event-properties.h modemmanager-1.10.0/libmm-glib/mm-kernel-event-properties.h --- modemmanager-1.6.8/libmm-glib/mm-kernel-event-properties.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-kernel-event-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,101 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#ifndef MM_KERNEL_EVENT_PROPERTIES_H +#define MM_KERNEL_EVENT_PROPERTIES_H + +#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include + +G_BEGIN_DECLS + +#define MM_TYPE_KERNEL_EVENT_PROPERTIES (mm_kernel_event_properties_get_type ()) +#define MM_KERNEL_EVENT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_KERNEL_EVENT_PROPERTIES, MMKernelEventProperties)) +#define MM_KERNEL_EVENT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_KERNEL_EVENT_PROPERTIES, MMKernelEventPropertiesClass)) +#define MM_IS_KERNEL_EVENT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_KERNEL_EVENT_PROPERTIES)) +#define MM_IS_KERNEL_EVENT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_KERNEL_EVENT_PROPERTIES)) +#define MM_KERNEL_EVENT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_KERNEL_EVENT_PROPERTIES, MMKernelEventPropertiesClass)) + +typedef struct _MMKernelEventProperties MMKernelEventProperties; +typedef struct _MMKernelEventPropertiesClass MMKernelEventPropertiesClass; +typedef struct _MMKernelEventPropertiesPrivate MMKernelEventPropertiesPrivate; + +/** + * MMKernelEventProperties: + * + * The #MMKernelEventProperties structure contains private data and should only be + * accessed using the provided API. + */ +struct _MMKernelEventProperties { + /*< private >*/ + GObject parent; + MMKernelEventPropertiesPrivate *priv; +}; + +struct _MMKernelEventPropertiesClass { + /*< private >*/ + GObjectClass parent; +}; + +GType mm_kernel_event_properties_get_type (void); + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMKernelEventProperties, g_object_unref) +#endif + +MMKernelEventProperties *mm_kernel_event_properties_new (void); + +void mm_kernel_event_properties_set_action (MMKernelEventProperties *self, + const gchar *action); +const gchar *mm_kernel_event_properties_get_action (MMKernelEventProperties *self); + +void mm_kernel_event_properties_set_subsystem (MMKernelEventProperties *self, + const gchar *subsystem); +const gchar *mm_kernel_event_properties_get_subsystem (MMKernelEventProperties *self); + +void mm_kernel_event_properties_set_name (MMKernelEventProperties *self, + const gchar *name); +const gchar *mm_kernel_event_properties_get_name (MMKernelEventProperties *self); + +void mm_kernel_event_properties_set_uid (MMKernelEventProperties *self, + const gchar *uid); +const gchar *mm_kernel_event_properties_get_uid (MMKernelEventProperties *self); + +/*****************************************************************************/ +/* ModemManager/libmm-glib/mmcli specific methods */ + +#if defined (_LIBMM_INSIDE_MM) || \ + defined (_LIBMM_INSIDE_MMCLI) || \ + defined (LIBMM_GLIB_COMPILATION) + +MMKernelEventProperties *mm_kernel_event_properties_new_from_string (const gchar *str, + GError **error); + +MMKernelEventProperties *mm_kernel_event_properties_new_from_dictionary (GVariant *dictionary, + GError **error); + +MMKernelEventProperties *mm_kernel_event_properties_dup (MMKernelEventProperties *orig); + +GVariant *mm_kernel_event_properties_get_dictionary (MMKernelEventProperties *self); + +#endif + +G_END_DECLS + +#endif /* MM_KERNEL_EVENT_PROPERTIES_H */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-3gpp.c modemmanager-1.10.0/libmm-glib/mm-location-3gpp.c --- modemmanager-1.6.8/libmm-glib/mm-location-3gpp.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-3gpp.c 2019-01-15 15:57:35.000000000 +0100 @@ -41,6 +41,12 @@ guint mobile_network_code; gulong location_area_code; gulong cell_id; + gulong tracking_area_code; + + /* We use 0 as default MNC when unknown, and that is a bit problematic if + * the network operator has actually a 0 MNC (e.g. China Mobile, 46000). + * We need to explicitly track whether MNC is set or not. */ + gboolean mobile_network_code_set; }; /*****************************************************************************/ @@ -83,6 +89,10 @@ * * Gets the Mobile Network Code of the 3GPP network. * + * Note that 0 may actually be a valid MNC. In general, the MNC should be + * considered valid just if the reported MCC is valid, as MCC should never + * be 0. + * * Returns: the MNC, or 0 if unknown. */ guint @@ -100,9 +110,10 @@ g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), FALSE); /* If no change in the location info, don't do anything */ - if (self->priv->mobile_network_code == mobile_network_code) + if (self->priv->mobile_network_code_set && (self->priv->mobile_network_code == mobile_network_code)) return FALSE; + self->priv->mobile_network_code_set = TRUE; self->priv->mobile_network_code = mobile_network_code; return TRUE; } @@ -173,6 +184,62 @@ /*****************************************************************************/ +/** + * mm_location_3gpp_get_tracking_area_code: + * @self: a #MMLocation3gpp. + * + * Gets the location area code of the 3GPP network. + * + * Returns: the location area code, or 0 if unknown. + */ +gulong +mm_location_3gpp_get_tracking_area_code (MMLocation3gpp *self) +{ + g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), 0); + + return self->priv->tracking_area_code; +} + +gboolean +mm_location_3gpp_set_tracking_area_code (MMLocation3gpp *self, + gulong tracking_area_code) +{ + g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), FALSE); + + /* If no change in the location info, don't do anything */ + if (self->priv->tracking_area_code == tracking_area_code) + return FALSE; + + self->priv->tracking_area_code = tracking_area_code; + return TRUE; +} + +/*****************************************************************************/ + +gboolean +mm_location_3gpp_reset (MMLocation3gpp *self) +{ + g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), FALSE); + + if (self->priv->mobile_country_code == 0 && + !self->priv->mobile_network_code_set && + self->priv->mobile_network_code == 0 && + self->priv->location_area_code == 0 && + self->priv->tracking_area_code == 0 && + self->priv->cell_id == 0) + return FALSE; + + self->priv->mobile_country_code = 0; + self->priv->mobile_network_code_set = FALSE; + self->priv->mobile_network_code = 0; + self->priv->location_area_code = 0; + self->priv->tracking_area_code = 0; + self->priv->cell_id = 0; + return TRUE; +} + +/*****************************************************************************/ + GVariant * mm_location_3gpp_get_string_variant (MMLocation3gpp *self) { @@ -181,16 +248,17 @@ g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), NULL); if (self->priv->mobile_country_code && - self->priv->mobile_network_code && - self->priv->location_area_code && + self->priv->mobile_network_code_set && /* MNC 0 is actually valid! */ + (self->priv->location_area_code || self->priv->tracking_area_code) && self->priv->cell_id) { gchar *str; - str = g_strdup_printf ("%u,%u,%lX,%lX", + str = g_strdup_printf ("%u,%u,%lX,%lX,%lX", self->priv->mobile_country_code, self->priv->mobile_network_code, self->priv->location_area_code, - self->priv->cell_id); + self->priv->cell_id, + self->priv->tracking_area_code); variant = g_variant_new_string (str); g_free (str); @@ -291,13 +359,16 @@ validate_string_length ("Location area code", split[2], 4, error) && validate_numeric_string_content ("Location area code", split[2], TRUE, error) && validate_string_length ("Cell ID", split[3], 8, error) && - validate_numeric_string_content ("Cell ID", split[3], TRUE, error)) { + validate_numeric_string_content ("Cell ID", split[3], TRUE, error) && + validate_string_length ("Tracking area code", split[4], 8, error) && + validate_numeric_string_content ("Tracking area code", split[4], TRUE, error)) { /* Create new location object */ self = mm_location_3gpp_new (); self->priv->mobile_country_code = strtol (split[0], NULL, 10); self->priv->mobile_network_code = strtol (split[1], NULL, 10); self->priv->location_area_code = strtol (split[2], NULL, 16); self->priv->cell_id = strtol (split[3], NULL, 16); + self->priv->tracking_area_code = strtol (split[4], NULL, 16); } g_strfreev (split); diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-3gpp.h modemmanager-1.10.0/libmm-glib/mm-location-3gpp.h --- modemmanager-1.6.8/libmm-glib/mm-location-3gpp.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-3gpp.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,10 +55,15 @@ GType mm_location_3gpp_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocation3gpp, g_object_unref) +#endif + guint mm_location_3gpp_get_mobile_country_code (MMLocation3gpp *self); guint mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self); gulong mm_location_3gpp_get_location_area_code (MMLocation3gpp *self); gulong mm_location_3gpp_get_cell_id (MMLocation3gpp *self); +gulong mm_location_3gpp_get_tracking_area_code (MMLocation3gpp *self); /*****************************************************************************/ /* ModemManager/libmm-glib/mmcli specific methods */ @@ -81,6 +86,9 @@ gulong location_area_code); gboolean mm_location_3gpp_set_cell_id (MMLocation3gpp *self, gulong cell_id); +gboolean mm_location_3gpp_set_tracking_area_code (MMLocation3gpp *self, + gulong tracking_area_code); +gboolean mm_location_3gpp_reset (MMLocation3gpp *self); #endif diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-cdma-bs.h modemmanager-1.10.0/libmm-glib/mm-location-cdma-bs.h --- modemmanager-1.6.8/libmm-glib/mm-location-cdma-bs.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-cdma-bs.h 2019-01-15 15:57:35.000000000 +0100 @@ -57,6 +57,10 @@ GType mm_location_cdma_bs_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationCdmaBs, g_object_unref) +#endif + gdouble mm_location_cdma_bs_get_longitude (MMLocationCdmaBs *self); gdouble mm_location_cdma_bs_get_latitude (MMLocationCdmaBs *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-gps-nmea.c modemmanager-1.10.0/libmm-glib/mm-location-gps-nmea.c --- modemmanager-1.6.8/libmm-glib/mm-location-gps-nmea.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-gps-nmea.c 2018-11-15 09:55:53.000000000 +0100 @@ -77,8 +77,10 @@ gchar *trace_type; i = strchr (trace, ','); - if (!i || i == trace) + if (!i || i == trace) { + g_free (trace); return FALSE; + } trace_type = g_malloc (i - trace + 1); memcpy (trace_type, trace, i - trace); @@ -96,8 +98,11 @@ gchar *sequence; /* Skip the trace if we already have it there */ - if (strstr (previous, trace)) + if (strstr (previous, trace)) { + g_free (trace_type); + g_free (trace); return TRUE; + } sequence = g_strdup_printf ("%s%s%s", previous, @@ -222,8 +227,7 @@ self = mm_location_gps_nmea_new (); for (i = 0; split[i]; i++) { - if (!location_gps_nmea_take_trace (self, split[i])) - g_free (split[i]); + location_gps_nmea_take_trace (self, split[i]); } /* Note that the strings in the array of strings were already taken diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-gps-nmea.h modemmanager-1.10.0/libmm-glib/mm-location-gps-nmea.h --- modemmanager-1.6.8/libmm-glib/mm-location-gps-nmea.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-gps-nmea.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_location_gps_nmea_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationGpsNmea, g_object_unref) +#endif + const gchar *mm_location_gps_nmea_get_trace (MMLocationGpsNmea *self, const gchar *trace_type); gchar *mm_location_gps_nmea_build_full (MMLocationGpsNmea *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-gps-raw.c modemmanager-1.10.0/libmm-glib/mm-location-gps-raw.c --- modemmanager-1.6.8/libmm-glib/mm-location-gps-raw.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-gps-raw.c 2019-01-15 15:57:35.000000000 +0100 @@ -42,7 +42,8 @@ #define PROPERTY_ALTITUDE "altitude" struct _MMLocationGpsRawPrivate { - GRegex *gpgga_regex; + GRegex *gga_regex; + gboolean prefer_gngga; gchar *utc_time; gdouble latitude; @@ -172,9 +173,22 @@ { GMatchInfo *match_info = NULL; - /* Current implementation works only with $GPGGA traces */ - if (!g_str_has_prefix (trace, "$GPGGA")) + /* Current implementation works only with $GPGGA and $GNGGA traces */ + do { + if (g_str_has_prefix (trace, "$GPGGA")) { + if (self->priv->prefer_gngga) + /* Ignore GPGGA, prefer GNGGA */ + return FALSE; + break; + } + if (g_str_has_prefix (trace, "$GNGGA")) { + if (!self->priv->prefer_gngga) + self->priv->prefer_gngga = TRUE; + break; + } + /* Otherwise, ignore trace */ return FALSE; + } while (0); /* * $GPGGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh @@ -195,16 +209,15 @@ * 14 = Diff. reference station ID# * 15 = Checksum */ - if (G_UNLIKELY (!self->priv->gpgga_regex)) - self->priv->gpgga_regex = g_regex_new ("\\$GPGGA,(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)\\*(.*).*", - G_REGEX_RAW | G_REGEX_OPTIMIZE, - 0, - NULL); + if (G_UNLIKELY (!self->priv->gga_regex)) + self->priv->gga_regex = g_regex_new ("\\$G(?:P|N)GGA,(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)\\*(.*).*", + G_REGEX_RAW | G_REGEX_OPTIMIZE, + 0, + NULL); - if (g_regex_match (self->priv->gpgga_regex, trace, 0, &match_info)) { + if (g_regex_match (self->priv->gga_regex, trace, 0, &match_info)) { /* UTC time */ - if (self->priv->utc_time) - g_free (self->priv->utc_time); + g_free (self->priv->utc_time); self->priv->utc_time = g_match_info_fetch (match_info, 1); /* Latitude */ @@ -371,8 +384,10 @@ { MMLocationGpsRaw *self = MM_LOCATION_GPS_RAW (object); - if (self->priv->gpgga_regex) - g_regex_unref (self->priv->gpgga_regex); + if (self->priv->gga_regex) + g_regex_unref (self->priv->gga_regex); + + g_free (self->priv->utc_time); G_OBJECT_CLASS (mm_location_gps_raw_parent_class)->finalize (object); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-location-gps-raw.h modemmanager-1.10.0/libmm-glib/mm-location-gps-raw.h --- modemmanager-1.6.8/libmm-glib/mm-location-gps-raw.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-location-gps-raw.h 2019-01-15 15:57:35.000000000 +0100 @@ -57,6 +57,10 @@ GType mm_location_gps_raw_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationGpsRaw, g_object_unref) +#endif + const gchar *mm_location_gps_raw_get_utc_time (MMLocationGpsRaw *self); gdouble mm_location_gps_raw_get_longitude (MMLocationGpsRaw *self); gdouble mm_location_gps_raw_get_latitude (MMLocationGpsRaw *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-manager.c modemmanager-1.10.0/libmm-glib/mm-manager.c --- modemmanager-1.6.8/libmm-glib/mm-manager.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-manager.c 2019-01-15 15:57:35.000000000 +0100 @@ -17,14 +17,13 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011 - 2012 Aleksander Morgado * Copyright (C) 2011 - 2012 Google, Inc. - * - * Author: Aleksander Morgado + * Copyright (C) 2011 - 2018 Aleksander Morgado */ #include +#include "mm-helpers.h" #include "mm-errors-types.h" #include "mm-gdbus-manager.h" #include "mm-manager.h" @@ -90,13 +89,23 @@ /*****************************************************************************/ +static void +cleanup_modem_manager1_proxy (MMManager *self) +{ + if (self->priv->manager_iface_proxy) { + g_signal_handlers_disconnect_by_func (self, cleanup_modem_manager1_proxy, NULL); + g_clear_object (&self->priv->manager_iface_proxy); + } +} + static gboolean ensure_modem_manager1_proxy (MMManager *self, GError **error) { gchar *name = NULL; gchar *object_path = NULL; - GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_NONE; + GDBusObjectManagerClientFlags obj_manager_flags = G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE; + GDBusProxyFlags proxy_flags = G_DBUS_PROXY_FLAGS_NONE; GDBusConnection *connection = NULL; if (self->priv->manager_iface_proxy) @@ -106,13 +115,16 @@ g_object_get (self, "name", &name, "object-path", &object_path, - "flags", &flags, + "flags", &obj_manager_flags, "connection", &connection, NULL); + if (obj_manager_flags & G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START) + proxy_flags |= G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START; + self->priv->manager_iface_proxy = mm_gdbus_org_freedesktop_modem_manager1_proxy_new_sync (connection, - flags, + proxy_flags, name, object_path, NULL, @@ -121,6 +133,12 @@ g_free (object_path); g_free (name); + if (self->priv->manager_iface_proxy) + g_signal_connect (self, + "notify::name-owner", + G_CALLBACK (cleanup_modem_manager1_proxy), + NULL); + return !!self->priv->manager_iface_proxy; } @@ -139,10 +157,13 @@ mm_manager_new_finish (GAsyncResult *res, GError **error) { - GDBusObjectManager *ret; + GObject *ret; + GObject *source_object; - ret = mm_gdbus_object_manager_client_new_finish (res, error); - return (ret ? MM_MANAGER (ret) : NULL); + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + return MM_MANAGER (ret); } /** @@ -204,19 +225,15 @@ GCancellable *cancellable, GError **error) { - GInitable *ret; - - ret = g_initable_new (MM_TYPE_MANAGER, - cancellable, - error, - "name", MM_DBUS_SERVICE, - "object-path", MM_DBUS_PATH, - "flags", flags, - "connection", connection, - "get-proxy-type-func", get_proxy_type, - NULL); - - return (ret ? MM_MANAGER (ret) : NULL); + return MM_MANAGER (g_initable_new (MM_TYPE_MANAGER, + cancellable, + error, + "name", MM_DBUS_SERVICE, + "object-path", MM_DBUS_PATH, + "flags", flags, + "connection", connection, + "get-proxy-type-func", get_proxy_type, + NULL)); } /*****************************************************************************/ @@ -262,6 +279,30 @@ /*****************************************************************************/ /** + * mm_manager_get_version: + * @manager: A #MMManager. + * + * Gets the ModemManager version, as reported by the daemon. + * + * It is safe to assume this value never changes during runtime. + * + * Returns: (transfer none): The version, or %NULL if none available. Do not free the returned value, it belongs to @self. + */ +const gchar * +mm_manager_get_version (MMManager *manager) +{ + g_return_val_if_fail (MM_IS_MANAGER (manager), NULL); + + if (!ensure_modem_manager1_proxy (manager, NULL)) + return NULL; + + RETURN_NON_EMPTY_CONSTANT_STRING ( + mm_gdbus_org_freedesktop_modem_manager1_get_version (manager->priv->manager_iface_proxy)); +} + +/*****************************************************************************/ + +/** * mm_manager_set_logging_finish: * @manager: A #MMManager. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_manager_set_logging(). @@ -269,33 +310,32 @@ * * Finishes an operation started with mm_manager_set_logging(). * - * Returns: %TRUE if the call succeded, %FALSE if @error is set. + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. */ gboolean mm_manager_set_logging_finish (MMManager *manager, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void set_logging_ready (MmGdbusOrgFreedesktopModemManager1 *manager_iface_proxy, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - if (mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_finish ( + if (!mm_gdbus_org_freedesktop_modem_manager1_call_set_logging_finish ( manager_iface_proxy, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } /** @@ -322,20 +362,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GError *inner_error = NULL; g_return_if_fail (MM_IS_MANAGER (manager)); - result = g_simple_async_result_new (G_OBJECT (manager), - callback, - user_data, - mm_manager_set_logging); + task = g_task_new (manager, cancellable, callback, user_data); if (!ensure_modem_manager1_proxy (manager, &inner_error)) { - g_simple_async_result_take_error (result, inner_error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, inner_error); + g_object_unref (task); return; } @@ -344,7 +380,7 @@ level, cancellable, (GAsyncReadyCallback)set_logging_ready, - result); + task); } /** @@ -360,7 +396,7 @@ * * See mm_manager_set_logging() for the asynchronous version of this method. * - * Returns: %TRUE if the call succeded, %FALSE if @error is set. + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. */ gboolean mm_manager_set_logging_sync (MMManager *manager, @@ -390,33 +426,32 @@ * * Finishes an operation started with mm_manager_scan_devices(). * - * Returns: %TRUE if the call succeded, %FALSE if @error is set. + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. */ gboolean mm_manager_scan_devices_finish (MMManager *manager, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void scan_devices_ready (MmGdbusOrgFreedesktopModemManager1 *manager_iface_proxy, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - if (mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_finish ( + if (!mm_gdbus_org_freedesktop_modem_manager1_call_scan_devices_finish ( manager_iface_proxy, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } /** @@ -441,20 +476,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GError *inner_error = NULL; g_return_if_fail (MM_IS_MANAGER (manager)); - result = g_simple_async_result_new (G_OBJECT (manager), - callback, - user_data, - mm_manager_scan_devices); + task = g_task_new (manager, cancellable, callback, user_data); if (!ensure_modem_manager1_proxy (manager, &inner_error)) { - g_simple_async_result_take_error (result, inner_error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, inner_error); + g_object_unref (task); return; } @@ -462,7 +493,7 @@ manager->priv->manager_iface_proxy, cancellable, (GAsyncReadyCallback)scan_devices_ready, - result); + task); } /** @@ -477,7 +508,7 @@ * * See mm_manager_scan_devices() for the asynchronous version of this method. * - * Returns: %TRUE if the call succeded, %FALSE if @error is set. + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. */ gboolean mm_manager_scan_devices_sync (MMManager *manager, @@ -496,6 +527,366 @@ } /*****************************************************************************/ + +/** + * mm_manager_report_kernel_event_finish: + * @manager: A #MMManager. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_manager_report_kernel_event(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_manager_report_kernel_event(). + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_report_kernel_event_finish (MMManager *manager, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +report_kernel_event_ready (MmGdbusOrgFreedesktopModemManager1 *manager_iface_proxy, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_finish ( + manager_iface_proxy, + res, + &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +/** + * mm_manager_report_kernel_event: + * @manager: A #MMManager. + * @properties: the properties of the kernel event. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously report kernel event. + * + * When the operation is finished, @callback will be invoked in the + * thread-default main loop + * of the thread you are calling this method from. You can then call + * mm_manager_report_kernel_event_finish() to get the result of the operation. + * + * See mm_manager_report_kernel_event_sync() for the synchronous, blocking version of this method. + */ +void +mm_manager_report_kernel_event (MMManager *manager, + MMKernelEventProperties *properties, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + GError *inner_error = NULL; + GVariant *dictionary; + + g_return_if_fail (MM_IS_MANAGER (manager)); + + task = g_task_new (manager, cancellable, callback, user_data); + + if (!ensure_modem_manager1_proxy (manager, &inner_error)) { + g_task_return_error (task, inner_error); + g_object_unref (task); + return; + } + + dictionary = mm_kernel_event_properties_get_dictionary (properties); + mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event ( + manager->priv->manager_iface_proxy, + dictionary, + cancellable, + (GAsyncReadyCallback)report_kernel_event_ready, + task); + g_variant_unref (dictionary); +} + +/** + * mm_manager_report_kernel_event_sync: + * @manager: A #MMManager. + * @properties: the properties of the kernel event. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously report kernel event. + * + * The calling thread is blocked until a reply is received. + * + * See mm_manager_report_kernel_event() for the asynchronous version of this method. + * + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_report_kernel_event_sync (MMManager *manager, + MMKernelEventProperties *properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *dictionary; + gboolean result; + + g_return_val_if_fail (MM_IS_MANAGER (manager), FALSE); + + if (!ensure_modem_manager1_proxy (manager, error)) + return FALSE; + + dictionary = mm_kernel_event_properties_get_dictionary (properties); + result = (mm_gdbus_org_freedesktop_modem_manager1_call_report_kernel_event_sync ( + manager->priv->manager_iface_proxy, + dictionary, + cancellable, + error)); + g_variant_unref (dictionary); + return result; +} + +/*****************************************************************************/ + +static gboolean +common_inhibit_device_finish (MMManager *manager, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +inhibit_ready (MmGdbusOrgFreedesktopModemManager1 *manager_iface_proxy, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_finish (manager_iface_proxy, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +common_inhibit_device (MMManager *manager, + const gchar *uid, + gboolean inhibit, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + GError *inner_error = NULL; + + task = g_task_new (manager, cancellable, callback, user_data); + + if (!ensure_modem_manager1_proxy (manager, &inner_error)) { + g_task_return_error (task, inner_error); + g_object_unref (task); + return; + } + + mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device ( + manager->priv->manager_iface_proxy, + uid, + inhibit, + cancellable, + (GAsyncReadyCallback)inhibit_ready, + task); +} + +static gboolean +common_inhibit_device_sync (MMManager *manager, + const gchar *uid, + gboolean inhibit, + GCancellable *cancellable, + GError **error) +{ + if (!ensure_modem_manager1_proxy (manager, error)) + return FALSE; + + return (mm_gdbus_org_freedesktop_modem_manager1_call_inhibit_device_sync ( + manager->priv->manager_iface_proxy, + uid, + inhibit, + cancellable, + error)); +} + +/** + * mm_manager_inhibit_device_finish: + * @manager: A #MMManager. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_manager_inhibit_device(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_manager_inhibit_device(). + * + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_inhibit_device_finish (MMManager *manager, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MANAGER (manager), FALSE); + return common_inhibit_device_finish (manager, res, error); +} + +/** + * mm_manager_inhibit_device: + * @manager: A #MMManager. + * @uid: the unique ID of the physical device. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously requests to add an inhibition on the device identified by @uid. + * + * The @uid must be the unique ID retrieved from an existing #MMModem using + * mm_modem_get_device(). The caller should keep track of this @uid and use it + * in the mm_manager_uninhibit_device() call when the inhibition is no longer required. + * + * The inhibition added with this method may also be automatically removed when + * the caller program disappears from the bus (e.g. if the program ends before + * having called mm_manager_uninhibit_device() explicitly). + * + * When the operation is finished, @callback will be invoked in the + * thread-default main loop + * of the thread you are calling this method from. You can then call + * mm_manager_inhibit_device_finish() to get the result of the operation. + * + * See mm_manager_inhibit_device_sync() for the synchronous, blocking version of this method. + */ +void +mm_manager_inhibit_device (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_MANAGER (manager)); + common_inhibit_device (manager, uid, TRUE, cancellable, callback, user_data); +} + +/** + * mm_manager_inhibit_device_sync: + * @manager: A #MMManager. + * @uid: the unique ID of the physical device. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously requests to add an inhibition on the device identified by @uid. + * + * The @uid must be the unique ID retrieved from an existing #MMModem using + * mm_modem_get_device(). The caller should keep track of this @uid and use it + * in the mm_manager_uninhibit_device_sync() call when the inhibition is no longer required. + * + * The inhibition added with this method may also be automatically removed when + * the caller program disappears from the bus (e.g. if the program ends before + * having called mm_manager_uninhibit_device_sync() explicitly). + * + * See mm_manager_inhibit_device() for the asynchronous version of this method. + * + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_inhibit_device_sync (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_MANAGER (manager), FALSE); + return common_inhibit_device_sync (manager, uid, TRUE, cancellable, error); +} + +/** + * mm_manager_uninhibit_device_finish: + * @manager: A #MMManager. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_manager_uninhibit_device(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_manager_uninhibit_device(). + * + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_uninhibit_device_finish (MMManager *manager, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MANAGER (manager), FALSE); + return common_inhibit_device_finish (manager, res, error); +} + +/** + * mm_manager_uninhibit_device: + * @manager: A #MMManager. + * @uid: the unique ID of the physical device. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously requests to remove an inhibition on the device identified by @uid. + * + * The @uid must be the same unique ID that was sent in the inhibition request. + * + * Only the same program that placed an inhibition on a given device is able to remove + * the inhibition. + * + * When the operation is finished, @callback will be invoked in the + * thread-default main loop + * of the thread you are calling this method from. You can then call + * mm_manager_uninhibit_device_finish() to get the result of the operation. + * + * See mm_manager_uninhibit_device_sync() for the synchronous, blocking version of this method. + */ +void +mm_manager_uninhibit_device (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_MANAGER (manager)); + common_inhibit_device (manager, uid, FALSE, cancellable, callback, user_data); +} + +/** + * mm_manager_uninhibit_device_sync: + * @manager: A #MMManager. + * @uid: the unique ID of the physical device. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously requests to remove an inhibition on the device identified by @uid. + * + * The @uid must be the same unique ID that was sent in the inhibition request. + * + * Only the same program that placed an inhibition on a given device is able to remove + * the inhibition. + * + * See mm_manager_uninhibit_device() for the asynchronous version of this method. + * + * Returns: %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +mm_manager_uninhibit_device_sync (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_MANAGER (manager), FALSE); + return common_inhibit_device_sync (manager, uid, FALSE, cancellable, error); +} + +/*****************************************************************************/ static void register_dbus_errors (void) diff -Nru modemmanager-1.6.8/libmm-glib/mm-manager.h modemmanager-1.10.0/libmm-glib/mm-manager.h --- modemmanager-1.6.8/libmm-glib/mm-manager.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-manager.h 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,7 @@ #include #include "mm-gdbus-modem.h" +#include "mm-kernel-event-properties.h" G_BEGIN_DECLS @@ -66,6 +67,10 @@ GType mm_manager_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMManager, g_object_unref) +#endif + void mm_manager_new ( GDBusConnection *connection, GDBusObjectManagerClientFlags flags, @@ -84,6 +89,8 @@ GDBusProxy *mm_manager_peek_proxy (MMManager *manager); GDBusProxy *mm_manager_get_proxy (MMManager *manager); +const gchar *mm_manager_get_version (MMManager *manager); + void mm_manager_set_logging (MMManager *manager, const gchar *level, GCancellable *cancellable, @@ -108,6 +115,45 @@ GCancellable *cancellable, GError **error); +void mm_manager_report_kernel_event (MMManager *manager, + MMKernelEventProperties *properties, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_manager_report_kernel_event_finish (MMManager *manager, + GAsyncResult *res, + GError **error); +gboolean mm_manager_report_kernel_event_sync (MMManager *manager, + MMKernelEventProperties *properties, + GCancellable *cancellable, + GError **error); + +void mm_manager_inhibit_device (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_manager_inhibit_device_finish (MMManager *manager, + GAsyncResult *res, + GError **error); +gboolean mm_manager_inhibit_device_sync (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GError **error); + +void mm_manager_uninhibit_device (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_manager_uninhibit_device_finish (MMManager *manager, + GAsyncResult *res, + GError **error); +gboolean mm_manager_uninhibit_device_sync (MMManager *manager, + const gchar *uid, + GCancellable *cancellable, + GError **error); + G_END_DECLS #endif /* _MM_MANAGER_H_ */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-3gpp.c modemmanager-1.10.0/libmm-glib/mm-modem-3gpp.c --- modemmanager-1.6.8/libmm-glib/mm-modem-3gpp.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-3gpp.c 2019-01-15 15:57:35.000000000 +0100 @@ -26,6 +26,8 @@ #include "mm-helpers.h" #include "mm-errors-types.h" #include "mm-modem-3gpp.h" +#include "mm-bearer.h" +#include "mm-pco.h" /** * SECTION: mm-modem-3gpp @@ -41,6 +43,13 @@ G_DEFINE_TYPE (MMModem3gpp, mm_modem_3gpp, MM_GDBUS_TYPE_MODEM3GPP_PROXY) +struct _MMModem3gppPrivate { + /* Properties */ + GMutex initial_eps_bearer_settings_mutex; + guint initial_eps_bearer_settings_id; + MMBearerProperties *initial_eps_bearer_settings; +}; + /*****************************************************************************/ /** @@ -245,6 +254,8 @@ /*****************************************************************************/ +#ifndef MM_DISABLE_DEPRECATED + /** * mm_modem_3gpp_get_subscription_state: * @self: A #MMModem. @@ -252,16 +263,24 @@ * Get the current subscription status of the account. This value is only * available after the modem attempts to register with the network. * + * The value of this property can only be obtained with operator specific logic (e.g. + * processing specific PCO info), and therefore it doesn't make sense to expose it in + * the ModemManager interface. + * * Returns: A #MMModem3gppSubscriptionState value, specifying the current subscription state. + * + * Deprecated: 1.10.0. The value of this property can only be obtained with operator + * specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense + * to expose it in the ModemManager interface. */ MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self) { - g_return_val_if_fail (MM_IS_MODEM_3GPP (self), MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN); - - return mm_gdbus_modem3gpp_get_subscription_state (MM_GDBUS_MODEM3GPP (self)); + return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN; } +#endif /* MM_DISABLE_DEPRECATED */ + /*****************************************************************************/ /** @@ -280,6 +299,101 @@ return mm_gdbus_modem3gpp_get_enabled_facility_locks (MM_GDBUS_MODEM3GPP (self)); } +/** + * mm_modem_3gpp_get_eps_ue_mode_operation: + * @self: A #MMModem3gpp. + * + * Get the UE mode of operation for EPS. + * + * Returns: A #MMModem3gppEpsUeModeOperation. + */ +MMModem3gppEpsUeModeOperation +mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN); + + return mm_gdbus_modem3gpp_get_eps_ue_mode_operation (MM_GDBUS_MODEM3GPP (self)); +} + +/*****************************************************************************/ + +/** + * mm_modem_3gpp_get_pco: + * @self: A #MMModem3gpp. + * + * Get the list of #MMPco received from the network. + * + * The caller is responsible for freeing the returned #GList with + * mm_pco_list_free(). + * + * Returns: (element-type ModemManager.Pco) (transfer full): A list of #MMPco. + */ +GList * +mm_modem_3gpp_get_pco (MMModem3gpp *self) +{ + GList *pco_list = NULL; + GVariant *container, *child; + GVariantIter iter; + + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + container = mm_gdbus_modem3gpp_get_pco (MM_GDBUS_MODEM3GPP (self)); + + g_return_val_if_fail (g_variant_is_of_type (container, G_VARIANT_TYPE ("a(ubay)")), + NULL); + g_variant_iter_init (&iter, container); + while ((child = g_variant_iter_next_value (&iter))) { + MMPco *pco; + + pco = mm_pco_from_variant (child, NULL); + pco_list = mm_pco_list_add (pco_list, pco); + g_object_unref (pco); + g_variant_unref (child); + } + + return pco_list; +} + +/*****************************************************************************/ + +/** + * mm_modem_3gpp_get_initial_eps_bearer_path: (skip) + * @self: A #MMModem3gpp. + * + * Gets the DBus path of the initial EPS #MMBearer exposed in this #MMModem3gpp. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_3gpp_dup_initial_eps_bearer_path() if on another + * thread. + * + * Returns: (transfer none): The DBus path of the #MMBearer, or %NULL if none available. Do not free the returned value, it belongs to @self. + */ +const gchar * +mm_modem_3gpp_get_initial_eps_bearer_path (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + RETURN_NON_EMPTY_CONSTANT_STRING (mm_gdbus_modem3gpp_get_initial_eps_bearer (MM_GDBUS_MODEM3GPP (self))); +} + +/** + * mm_modem_3gpp_dup_initial_eps_bearer_path: + * @self: A #MMModem3gpp. + * + * Gets a copy of the DBus path of the initial EPS #MMBearer exposed in this #MMModem3gpp. + * + * Returns: (transfer full): The DBus path of the #MMBearer, or %NULL if none available. The returned value should be freed with g_free(). + */ +gchar * +mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + RETURN_NON_EMPTY_STRING ( + mm_gdbus_modem3gpp_dup_initial_eps_bearer (MM_GDBUS_MODEM3GPP (self))); +} + /*****************************************************************************/ /** @@ -464,6 +578,117 @@ /*****************************************************************************/ +static void +initial_eps_bearer_settings_updated (MMModem3gpp *self, + GParamSpec *pspec) +{ + g_mutex_lock (&self->priv->initial_eps_bearer_settings_mutex); + { + GVariant *dictionary; + + g_clear_object (&self->priv->initial_eps_bearer_settings); + + dictionary = mm_gdbus_modem3gpp_get_initial_eps_bearer_settings (MM_GDBUS_MODEM3GPP (self)); + if (dictionary) { + GError *error = NULL; + + self->priv->initial_eps_bearer_settings = mm_bearer_properties_new_from_dictionary (dictionary, &error); + if (error) { + g_warning ("Invalid bearer properties received: %s", error->message); + g_error_free (error); + } + } + } + g_mutex_unlock (&self->priv->initial_eps_bearer_settings_mutex); +} + +static void +ensure_internal_initial_eps_bearer_settings (MMModem3gpp *self, + MMBearerProperties **dup) +{ + g_mutex_lock (&self->priv->initial_eps_bearer_settings_mutex); + { + /* If this is the first time ever asking for the object, setup the + * update listener and the initial object, if any. */ + if (!self->priv->initial_eps_bearer_settings_id) { + GVariant *dictionary; + + dictionary = mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings (MM_GDBUS_MODEM3GPP (self)); + if (dictionary) { + GError *error = NULL; + + self->priv->initial_eps_bearer_settings = mm_bearer_properties_new_from_dictionary (dictionary, &error); + if (error) { + g_warning ("Invalid initial bearer properties: %s", error->message); + g_error_free (error); + } + g_variant_unref (dictionary); + } + + /* No need to clear this signal connection when freeing self */ + self->priv->initial_eps_bearer_settings_id = + g_signal_connect (self, + "notify::initial-eps-bearer-properties", + G_CALLBACK (initial_eps_bearer_settings_updated), + NULL); + } + + if (dup && self->priv->initial_eps_bearer_settings) + *dup = g_object_ref (self->priv->initial_eps_bearer_settings); + } + g_mutex_unlock (&self->priv->initial_eps_bearer_settings_mutex); +} + +/** + * mm_modem_3gpp_get_initial_eps_bearer_settings: + * @self: A #MMModem3gpp. + * + * Gets a #MMBearerProperties object specifying the settings configured in + * the device to use when attaching to the LTE network. + * + * The values reported by @self are not updated when the values in the + * interface change. Instead, the client is expected to call + * mm_modem_3gpp_get_initial_eps_bearer_settings() again to get a new #MMBearerProperties with the + * new values. + * + * Returns: (transfer full): A #MMBearerProperties that must be freed with g_object_unref() or %NULL if unknown. + */ +MMBearerProperties * +mm_modem_3gpp_get_initial_eps_bearer_settings (MMModem3gpp *self) +{ + MMBearerProperties *props = NULL; + + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + ensure_internal_initial_eps_bearer_settings (self, &props); + return props; +} + +/** + * mm_modem_3gpp_peek_initial_eps_bearer_settings: + * @self: A #MMModem3gpp. + * + * Gets a #MMBearerProperties object specifying the settings configured in + * the device to use when attaching to the LTE network. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_3gpp_get_initial_eps_bearer_settings() if on another + * thread. + * + * Returns: (transfer none): A #MMBearerProperties. Do not free the returned value, it belongs to @self. + */ +MMBearerProperties * +mm_modem_3gpp_peek_initial_eps_bearer_settings (MMModem3gpp *self) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + ensure_internal_initial_eps_bearer_settings (self, NULL); + return self->priv->initial_eps_bearer_settings; +} + +/*****************************************************************************/ + static GList * create_networks_list (GVariant *variant) { @@ -590,12 +815,345 @@ /*****************************************************************************/ +/** + * mm_modem_3gpp_set_eps_ue_mode_operation_finish: + * @self: A #MMModem3gpp. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_3gpp_set_eps_ue_mode_operation(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_modem_3gpp_set_eps_ue_mode_operation(). + * + * Returns: %TRUE if the operation was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_3gpp_set_eps_ue_mode_operation_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), FALSE); + + return mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_finish (MM_GDBUS_MODEM3GPP (self), res, error); +} + +/** + * mm_modem_3gpp_set_eps_ue_mode_operation: + * @self: A #MMModem3gpp. + * @mode: A #MMModem3gppEpsUeModeOperation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously requests to update the EPS UE mode of operation. + * + * When the operation is finished, @callback will be invoked in the + * thread-default main loop + * of the thread you are calling this method from. You can then call + * mm_modem_3gpp_set_eps_ue_mode_operation_finish() to get the result of the operation. + * + * See mm_modem_3gpp_set_eps_ue_mode_operation_sync() for the synchronous, blocking + * version of this method. The calling thread is blocked until a reply is received. + */ +void +mm_modem_3gpp_set_eps_ue_mode_operation (MMModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_MODEM_3GPP (self)); + g_return_if_fail (mode != MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN); + + mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation (MM_GDBUS_MODEM3GPP (self), (guint) mode, cancellable, callback, user_data); +} + +/** + * mm_modem_3gpp_set_eps_ue_mode_operation_sync: + * @self: A #MMModem3gpp. + * @mode: A #MMModem3gppEpsUeModeOperation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously requests to update the EPS UE mode of operation. + * + * The calling thread is blocked until a reply is received. + * See mm_modem_3gpp_set_eps_ue_mode_operation() for the asynchronous version + * of this method. + * + * Returns: %TRUE if the operation was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_3gpp_set_eps_ue_mode_operation_sync (MMModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), FALSE); + g_return_val_if_fail (mode != MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN, FALSE); + + return mm_gdbus_modem3gpp_call_set_eps_ue_mode_operation_sync (MM_GDBUS_MODEM3GPP (self), (guint) mode, cancellable, error); +} + +/*****************************************************************************/ + +/** + * mm_modem_3gpp_get_initial_eps_bearer_finish: + * @self: A #MMModem3gpp. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_3gpp_get_initial_eps_bearer(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_modem_3gpp_get_initial_eps_bearer(). + * + * Returns: (transfer full): a #MMSim or #NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMBearer * +mm_modem_3gpp_get_initial_eps_bearer_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +modem_3gpp_get_initial_eps_bearer_ready (GDBusConnection *connection, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + GObject *sim; + GObject *source_object; + + source_object = g_async_result_get_source_object (res); + sim = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, &error); + g_object_unref (source_object); + + if (error) + g_task_return_error (task, error); + else + g_task_return_pointer (task, sim, g_object_unref); + + g_object_unref (task); +} + +/** + * mm_modem_3gpp_get_initial_eps_bearer: + * @self: A #MMModem3gpp. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously gets the initial EPS #MMBearer object exposed by this #MMModem3gpp. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call mm_modem_3gpp_get_initial_eps_bearer_finish() to get the result of the operation. + * + * See mm_modem_3gpp_get_initial_eps_bearer_sync() for the synchronous, blocking version of this method. + */ +void +mm_modem_3gpp_get_initial_eps_bearer (MMModem3gpp *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + const gchar *bearer_path; + + g_return_if_fail (MM_IS_MODEM_3GPP (self)); + + task = g_task_new (self, cancellable, callback, user_data); + + bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (self); + if (!bearer_path || g_str_equal (bearer_path, "/")) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No initial EPS bearer object available"); + g_object_unref (task); + return; + } + + g_async_initable_new_async (MM_TYPE_BEARER, + G_PRIORITY_DEFAULT, + cancellable, + (GAsyncReadyCallback)modem_3gpp_get_initial_eps_bearer_ready, + task, + "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + "g-name", MM_DBUS_SERVICE, + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), + "g-object-path", bearer_path, + "g-interface-name", "org.freedesktop.ModemManager1.Bearer", + NULL); +} + +/** + * mm_modem_3gpp_get_initial_eps_bearer_sync: + * @self: A #MMModem3gpp. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously gets the initial EPS #MMBearer object exposed by this #MMModem3gpp. + * + * The calling thread is blocked until a reply is received. See mm_modem_3gpp_get_initial_eps_bearer() + * for the asynchronous version of this method. + * + * Returns: (transfer full): a #MMBearer or #NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMBearer * +mm_modem_3gpp_get_initial_eps_bearer_sync (MMModem3gpp *self, + GCancellable *cancellable, + GError **error) +{ + GObject *bearer; + const gchar *bearer_path; + + g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL); + + bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (self); + if (!bearer_path || g_str_equal (bearer_path, "/")) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No initial EPS bearer object available"); + return NULL; + } + + bearer = g_initable_new (MM_TYPE_BEARER, + cancellable, + error, + "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + "g-name", MM_DBUS_SERVICE, + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), + "g-object-path", bearer_path, + "g-interface-name", "org.freedesktop.ModemManager1.Bearer", + NULL); + + return (bearer ? MM_BEARER (bearer) : NULL); +} + +/*****************************************************************************/ + +/** + * mm_modem_3gpp_set_initial_eps_bearer_settings_finish: + * @self: A #MMModem3gpp. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_3gpp_set_initial_eps_bearer_settings(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_modem_3gpp_set_initial_eps_bearer_settings(). + * + * Returns: %TRUE if the operation was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_3gpp_set_initial_eps_bearer_settings_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_finish (MM_GDBUS_MODEM3GPP (self), res, error); +} + +/** + * mm_modem_3gpp_set_initial_eps_bearer_settings: + * @self: A #MMModem3gpp. + * @config: A #MMBearerProperties object with the properties to use. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously configures the settings for the initial LTE default bearer. + * + * When the operation is finished, @callback will be invoked in the + * thread-default main loop + * of the thread you are calling this method from. You can then call + * mm_modem_3gpp_set_initial_eps_bearer_settings_finish() to get the result of the operation. + */ +void +mm_modem_3gpp_set_initial_eps_bearer_settings (MMModem3gpp *self, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GVariant *dictionary; + + dictionary = mm_bearer_properties_get_dictionary (config); + mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings (MM_GDBUS_MODEM3GPP (self), + dictionary, + cancellable, + callback, + user_data); + g_variant_unref (dictionary); +} + +/** + * mm_modem_3gpp_set_initial_eps_bearer_settings_sync: + * @self: A #MMModem3gpp. + * @config: A #MMBearerProperties object with the properties to use. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously configures the settings for the initial LTE default bearer. + * + * The calling thread is blocked until a reply is received. See + * mm_modem_3gpp_set_initial_eps_bearer_settings() for the asynchronous + * version of this method. + * + * Returns: %TRUE if the operation was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_3gpp_set_initial_eps_bearer_settings_sync (MMModem3gpp *self, + MMBearerProperties *config, + GCancellable *cancellable, + GError **error) +{ + gboolean result; + GVariant *dictionary; + + dictionary = mm_bearer_properties_get_dictionary (config); + result = mm_gdbus_modem3gpp_call_set_initial_eps_bearer_settings_sync (MM_GDBUS_MODEM3GPP (self), + dictionary, + cancellable, + error); + g_variant_unref (dictionary); + return result; +} + +/*****************************************************************************/ + static void mm_modem_3gpp_init (MMModem3gpp *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_3GPP, MMModem3gppPrivate); + g_mutex_init (&self->priv->initial_eps_bearer_settings_mutex); +} + +static void +finalize (GObject *object) +{ + MMModem3gpp *self = MM_MODEM_3GPP (object); + + g_mutex_clear (&self->priv->initial_eps_bearer_settings_mutex); + + G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->finalize (object); +} + +static void +dispose (GObject *object) +{ + MMModem3gpp *self = MM_MODEM_3GPP (object); + + g_clear_object (&self->priv->initial_eps_bearer_settings); + + G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->dispose (object); } static void mm_modem_3gpp_class_init (MMModem3gppClass *modem_class) { + GObjectClass *object_class = G_OBJECT_CLASS (modem_class); + + g_type_class_add_private (object_class, sizeof (MMModem3gppPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + object_class->finalize = finalize; } diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-3gpp.h modemmanager-1.10.0/libmm-glib/mm-modem-3gpp.h --- modemmanager-1.6.8/libmm-glib/mm-modem-3gpp.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-3gpp.h 2019-01-15 15:57:35.000000000 +0100 @@ -30,6 +30,7 @@ #include +#include "mm-bearer.h" #include "mm-gdbus-modem.h" G_BEGIN_DECLS @@ -43,6 +44,7 @@ typedef struct _MMModem3gpp MMModem3gpp; typedef struct _MMModem3gppClass MMModem3gppClass; +typedef struct _MMModem3gppPrivate MMModem3gppPrivate; /** * MMModem3gpp: @@ -52,8 +54,8 @@ */ struct _MMModem3gpp { /*< private >*/ - MmGdbusModem3gppProxy parent; - gpointer unused; + MmGdbusModem3gppProxy parent; + MMModem3gppPrivate *priv; }; struct _MMModem3gppClass { @@ -63,6 +65,10 @@ GType mm_modem_3gpp_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gpp, g_object_unref) +#endif + const gchar *mm_modem_3gpp_get_path (MMModem3gpp *self); gchar *mm_modem_3gpp_dup_path (MMModem3gpp *self); @@ -76,10 +82,18 @@ gchar *mm_modem_3gpp_dup_operator_name (MMModem3gpp *self); MMModem3gppRegistrationState mm_modem_3gpp_get_registration_state (MMModem3gpp *self); -MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self); MMModem3gppFacility mm_modem_3gpp_get_enabled_facility_locks (MMModem3gpp *self); +MMModem3gppEpsUeModeOperation mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self); + +GList *mm_modem_3gpp_get_pco (MMModem3gpp *self); + +const gchar *mm_modem_3gpp_get_initial_eps_bearer_path (MMModem3gpp *self); +gchar *mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self); + +MMBearerProperties *mm_modem_3gpp_get_initial_eps_bearer_settings (MMModem3gpp *self); +MMBearerProperties *mm_modem_3gpp_peek_initial_eps_bearer_settings (MMModem3gpp *self); void mm_modem_3gpp_register (MMModem3gpp *self, const gchar *network_id, @@ -120,6 +134,50 @@ GCancellable *cancellable, GError **error); +void mm_modem_3gpp_set_eps_ue_mode_operation (MMModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_modem_3gpp_set_eps_ue_mode_operation_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error); +gboolean mm_modem_3gpp_set_eps_ue_mode_operation_sync (MMModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GCancellable *cancellable, + GError **error); + +void mm_modem_3gpp_get_initial_eps_bearer (MMModem3gpp *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBearer *mm_modem_3gpp_get_initial_eps_bearer_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error); +MMBearer *mm_modem_3gpp_get_initial_eps_bearer_sync (MMModem3gpp *self, + GCancellable *cancellable, + GError **error); + +void mm_modem_3gpp_set_initial_eps_bearer_settings (MMModem3gpp *self, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_modem_3gpp_set_initial_eps_bearer_settings_finish (MMModem3gpp *self, + GAsyncResult *res, + GError **error); +gboolean mm_modem_3gpp_set_initial_eps_bearer_settings_sync (MMModem3gpp *self, + MMBearerProperties *config, + GCancellable *cancellable, + GError **error); + +#ifndef MM_DISABLE_DEPRECATED + +G_DEPRECATED +MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self); + +#endif + G_END_DECLS #endif /* _MM_MODEM_3GPP_H_ */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-3gpp-ussd.h modemmanager-1.10.0/libmm-glib/mm-modem-3gpp-ussd.h --- modemmanager-1.6.8/libmm-glib/mm-modem-3gpp-ussd.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-3gpp-ussd.h 2019-01-15 15:57:35.000000000 +0100 @@ -63,6 +63,10 @@ GType mm_modem_3gpp_ussd_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gppUssd, g_object_unref) +#endif + const gchar *mm_modem_3gpp_ussd_get_path (MMModem3gppUssd *self); gchar *mm_modem_3gpp_ussd_dup_path (MMModem3gppUssd *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem.c modemmanager-1.10.0/libmm-glib/mm-modem.c --- modemmanager-1.6.8/libmm-glib/mm-modem.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem.c 2019-01-13 14:41:52.000000000 +0100 @@ -503,6 +503,47 @@ /*****************************************************************************/ /** + * mm_modem_get_hardware_revision: + * @self: A #MMModem. + * + * Gets the equipment hardware revision, as reported by this #MMModem. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_dup_hardware_revision() if on another + * thread. + * + * Returns: (transfer none): The equipment hardware revision, or %NULL if none available. Do not free the returned value, it belongs to @self. + */ +const gchar * +mm_modem_get_hardware_revision (MMModem *self) +{ + g_return_val_if_fail (MM_IS_MODEM (self), NULL); + + RETURN_NON_EMPTY_CONSTANT_STRING ( + mm_gdbus_modem_get_hardware_revision (MM_GDBUS_MODEM (self))); +} + +/** + * mm_modem_dup_hardware_revision: + * @self: A #MMModem. + * + * Gets a copy of the equipment hardware revision, as reported by this #MMModem. + * + * Returns: (transfer full): The equipment hardware revision, or %NULL if none available. The returned value should be freed with g_free(). + */ +gchar * +mm_modem_dup_hardware_revision (MMModem *self) +{ + g_return_val_if_fail (MM_IS_MODEM (self), NULL); + + RETURN_NON_EMPTY_STRING ( + mm_gdbus_modem_dup_hardware_revision (MM_GDBUS_MODEM (self))); +} + +/*****************************************************************************/ + +/** * mm_modem_get_device_identifier: * @self: A #MMModem. * @@ -865,7 +906,7 @@ * * The returned value is only valid until the property changes so * it is only safe to use this function on the thread where - * @self was constructed. Use mm_modem_dup_plugin() if on another + * @self was constructed. Use mm_modem_dup_equipment_identifier() if on another * thread. * * Returns: (transfer none): The equipment identifier, or %NULL if none available. Do not free the returned value, it belongs to @self. @@ -1752,9 +1793,6 @@ /*****************************************************************************/ typedef struct { - MMModem *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; gchar **bearer_paths; GList *bearer_objects; guint i; @@ -1763,20 +1801,14 @@ static void bearer_object_list_free (GList *list) { - g_list_free_full (list, (GDestroyNotify) g_object_unref); + g_list_free_full (list, g_object_unref); } static void -list_bearers_context_complete_and_free (ListBearersContext *ctx) +list_bearers_context_free (ListBearersContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_strfreev (ctx->bearer_paths); bearer_object_list_free (ctx->bearer_objects); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_ref (ctx->self); g_slice_free (ListBearersContext, ctx); } @@ -1788,77 +1820,80 @@ * * Finishes an operation started with mm_modem_list_bearers(). * - * Returns: (transfer full) (element-type ModemManager.Modem): The list of #MMBearer objects, or %NULL if either none found or if @error is set. + * Returns: (transfer full) (element-type ModemManager.Bearer): The list of #MMBearer objects, or %NULL if either none found or if @error is set. */ GList * mm_modem_list_bearers_finish (MMModem *self, GAsyncResult *res, GError **error) { - GList *list; - g_return_val_if_fail (MM_IS_MODEM (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - list = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - /* The list we got, including the objects within, is owned by the async result; - * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_task_propagate_pointer (G_TASK (res), error); } -static void create_next_bearer (ListBearersContext *ctx); +static void create_next_bearer (GTask *task); static void modem_list_bearers_build_object_ready (GDBusConnection *connection, GAsyncResult *res, - ListBearersContext *ctx) + GTask *task) { GObject *bearer; GError *error = NULL; GObject *source_object; + ListBearersContext *ctx; source_object = g_async_result_get_source_object (res); bearer = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, &error); g_object_unref (source_object); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_bearers_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Keep the object */ ctx->bearer_objects = g_list_prepend (ctx->bearer_objects, bearer); /* If no more bearers, just end here. */ if (!ctx->bearer_paths[++ctx->i]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - ctx->bearer_objects, - (GDestroyNotify)bearer_object_list_free); - ctx->bearer_objects = NULL; - list_bearers_context_complete_and_free (ctx); + GList *bearer_objects; + + bearer_objects = g_list_copy_deep (ctx->bearer_objects, + (GCopyFunc)g_object_ref, + NULL); + g_task_return_pointer (task, + bearer_objects, + (GDestroyNotify)bearer_object_list_free); + g_object_unref (task); return; } /* Keep on creating next object */ - create_next_bearer (ctx); + create_next_bearer (task); } static void -create_next_bearer (ListBearersContext *ctx) +create_next_bearer (GTask *task) { + MMModem *self; + ListBearersContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + g_async_initable_new_async (MM_TYPE_BEARER, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)modem_list_bearers_build_object_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, - "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (ctx->self)), + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), "g-object-path", ctx->bearer_paths[ctx->i], "g-interface-name", "org.freedesktop.ModemManager1.Bearer", NULL); @@ -1885,31 +1920,28 @@ gpointer user_data) { ListBearersContext *ctx; + GTask *task; g_return_if_fail (MM_IS_MODEM (self)); ctx = g_slice_new0 (ListBearersContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_list_bearers); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); /* Read from the property, skip List() */ ctx->bearer_paths = mm_gdbus_modem_dup_bearers (MM_GDBUS_MODEM (self)); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)list_bearers_context_free); + /* If no bearers, just end here. */ if (!ctx->bearer_paths || !ctx->bearer_paths[0]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, NULL, NULL); - list_bearers_context_complete_and_free (ctx); + g_task_return_pointer (task, NULL, NULL); + g_object_unref (task); return; } /* Got list of paths. If at least one found, start creating objects for each */ ctx->i = 0; - create_next_bearer (ctx); + create_next_bearer (task); } /** @@ -1923,7 +1955,7 @@ * The calling thread is blocked until a reply is received. See mm_modem_list_bearers() * for the asynchronous version of this method. * - * Returns: (transfer full) (element-type ModemManager.Modem): The list of #MMBearer objects, or %NULL if either none found or if @error is set. + * Returns: (transfer full) (element-type ModemManager.Bearer): The list of #MMBearer objects, or %NULL if either none found or if @error is set. */ GList * mm_modem_list_bearers_sync (MMModem *self, @@ -1971,21 +2003,6 @@ /*****************************************************************************/ -typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; -} CreateBearerContext; - -static void -create_bearer_context_complete_and_free (CreateBearerContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_slice_free (CreateBearerContext, ctx); -} - /** * mm_modem_create_bearer_finish: * @self: A #MMModem. @@ -2003,16 +2020,13 @@ { g_return_val_if_fail (MM_IS_MODEM (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void modem_new_bearer_ready (GDBusConnection *connection, GAsyncResult *res, - CreateBearerContext *ctx) + GTask *task) { GError *error = NULL; GObject *bearer; @@ -2023,19 +2037,17 @@ g_object_unref (source_object); if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, - bearer, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, bearer, g_object_unref); - create_bearer_context_complete_and_free (ctx); + g_object_unref (task); } static void modem_create_bearer_ready (MMModem *self, GAsyncResult *res, - CreateBearerContext *ctx) + GTask *task) { GError *error = NULL; gchar *bearer_path = NULL; @@ -2044,17 +2056,17 @@ &bearer_path, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - create_bearer_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_free (bearer_path); return; } g_async_initable_new_async (MM_TYPE_BEARER, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)modem_new_bearer_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), @@ -2091,18 +2103,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - CreateBearerContext *ctx; + GTask *task; GVariant *dictionary; g_return_if_fail (MM_IS_MODEM (self)); - ctx = g_slice_new0 (CreateBearerContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_create_bearer); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); + task = g_task_new (self, cancellable, callback, user_data); dictionary = mm_bearer_properties_get_dictionary (properties); @@ -2111,7 +2117,7 @@ dictionary, cancellable, (GAsyncReadyCallback)modem_create_bearer_ready, - ctx); + task); g_variant_unref (dictionary); } @@ -2837,23 +2843,15 @@ GAsyncResult *res, GError **error) { - MMSim *sim; - g_return_val_if_fail (MM_IS_MODEM (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - sim = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_return_val_if_fail (sim != NULL, NULL); - - return MM_SIM (g_object_ref (sim)); + return g_task_propagate_pointer (G_TASK (res), error); } static void modem_get_sim_ready (GDBusConnection *connection, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GObject *sim; @@ -2864,14 +2862,11 @@ g_object_unref (source_object); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - sim, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, sim, g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } /** @@ -2881,7 +2876,7 @@ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * - * Synchronously gets the #MMSim object managed by this #MMModem. + * Asynchronously gets the #MMSim object managed by this #MMModem. * * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. * You can then call mm_modem_get_sim_finish() to get the result of the operation. @@ -2894,24 +2889,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; const gchar *sim_path; g_return_if_fail (MM_IS_MODEM (self)); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_get_sim); + task = g_task_new (self, cancellable, callback, user_data); sim_path = mm_modem_get_sim_path (self); if (!sim_path || g_str_equal (sim_path, "/")) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No SIM object available"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No SIM object available"); + g_object_unref (task); return; } @@ -2919,7 +2910,7 @@ G_PRIORITY_DEFAULT, cancellable, (GAsyncReadyCallback)modem_get_sim_ready, - result, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-cdma.h modemmanager-1.10.0/libmm-glib/mm-modem-cdma.h --- modemmanager-1.6.8/libmm-glib/mm-modem-cdma.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-cdma.h 2019-01-15 15:57:35.000000000 +0100 @@ -64,6 +64,10 @@ GType mm_modem_cdma_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemCdma, g_object_unref) +#endif + const gchar *mm_modem_cdma_get_path (MMModemCdma *self); gchar *mm_modem_cdma_dup_path (MMModemCdma *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-firmware.c modemmanager-1.10.0/libmm-glib/mm-modem-firmware.c --- modemmanager-1.6.8/libmm-glib/mm-modem-firmware.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-firmware.c 2019-01-16 15:54:41.000000000 +0100 @@ -40,6 +40,12 @@ G_DEFINE_TYPE (MMModemFirmware, mm_modem_firmware, MM_GDBUS_TYPE_MODEM_FIRMWARE_PROXY) +struct _MMModemFirmwarePrivate { + GMutex update_settings_mutex; + guint update_settings_id; + MMFirmwareUpdateSettings *update_settings; +}; + /*****************************************************************************/ /** @@ -82,6 +88,116 @@ /*****************************************************************************/ +static void +update_settings_updated (MMModemFirmware *self, + GParamSpec *pspec) +{ + g_mutex_lock (&self->priv->update_settings_mutex); + { + GVariant *variant; + + g_clear_object (&self->priv->update_settings); + variant = mm_gdbus_modem_firmware_get_update_settings (MM_GDBUS_MODEM_FIRMWARE (self)); + if (variant) { + GError *error = NULL; + + self->priv->update_settings = mm_firmware_update_settings_new_from_variant (variant, &error); + if (error) { + g_warning ("Invalid update settings received: %s", error->message); + g_error_free (error); + } + } + } + g_mutex_unlock (&self->priv->update_settings_mutex); +} + +static void +ensure_internal_update_settings (MMModemFirmware *self, + MMFirmwareUpdateSettings **dupl) +{ + g_mutex_lock (&self->priv->update_settings_mutex); + { + /* If this is the first time ever asking for the object, setup the + * update listener and the initial object, if any. */ + if (!self->priv->update_settings_id) { + GVariant *variant; + + variant = mm_gdbus_modem_firmware_dup_update_settings (MM_GDBUS_MODEM_FIRMWARE (self)); + if (variant) { + GError *error = NULL; + + self->priv->update_settings = mm_firmware_update_settings_new_from_variant (variant, &error); + if (error) { + g_warning ("Invalid initial update settings: %s", error->message); + g_error_free (error); + } + g_variant_unref (variant); + } + + /* No need to clear this signal connection when freeing self */ + self->priv->update_settings_id = + g_signal_connect (self, + "notify::update-settings", + G_CALLBACK (update_settings_updated), + NULL); + } + + if (dupl && self->priv->update_settings) + *dupl = g_object_ref (self->priv->update_settings); + } + g_mutex_unlock (&self->priv->update_settings_mutex); +} + +/** + * mm_modem_firmware_get_update_settings: + * @self: A #MMModemFirmware. + * + * Gets a #MMFirmwareUpdateSettings object specifying the expected update + * settings. + * + * The values reported by @self are not updated when the values in the + * interface change. Instead, the client is expected to call + * mm_modem_firmware_get_update_settings() again to get a new #MMFirmwareUpdateSettings + * with the new values. + * + * Returns: (transfer full): A #MMFirmwareUpdateSettings that must be freed with g_object_unref() or %NULL if unknown. + */ +MMFirmwareUpdateSettings * +mm_modem_firmware_get_update_settings (MMModemFirmware *self) +{ + MMFirmwareUpdateSettings *update_settings = NULL; + + g_return_val_if_fail (MM_IS_MODEM_FIRMWARE (self), NULL); + + ensure_internal_update_settings (self, &update_settings); + return update_settings; +} + +/** + * mm_modem_firmware_peek_update_settings: + * @self: A #MMModemFirmware. + * + * Gets a #MMFirmwareUpdateSettings object specifying the expected update + * settings. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_firmware_get_update_settings() if on + * another thread. + * + * Returns: (transfer none): A #MMFirmwareUpdateSettings. Do not free the returned value, it belongs to @self. + */ +MMFirmwareUpdateSettings * +mm_modem_firmware_peek_update_settings (MMModemFirmware *self) +{ + g_return_val_if_fail (MM_IS_MODEM_FIRMWARE (self), NULL); + + ensure_internal_update_settings (self, NULL); + return self->priv->update_settings; +} + +/*****************************************************************************/ + /** * mm_modem_firmware_select_finish: * @self: A #MMModemFirmware. @@ -128,7 +244,7 @@ gpointer user_data) { g_return_if_fail (MM_IS_MODEM_FIRMWARE (self)); - g_return_if_fail (unique_id != NULL || unique_id[0] == '\0'); + g_return_if_fail (unique_id != NULL && unique_id[0] != '\0'); mm_gdbus_modem_firmware_call_select (MM_GDBUS_MODEM_FIRMWARE (self), unique_id, cancellable, callback, user_data); } @@ -157,7 +273,7 @@ GError **error) { g_return_val_if_fail (MM_IS_MODEM_FIRMWARE (self), FALSE); - g_return_val_if_fail (unique_id != NULL || unique_id[0] == '\0', FALSE); + g_return_val_if_fail (unique_id != NULL && unique_id[0] != '\0', FALSE); return mm_gdbus_modem_firmware_call_select_sync (MM_GDBUS_MODEM_FIRMWARE (self), unique_id, cancellable, error); } @@ -372,9 +488,38 @@ static void mm_modem_firmware_init (MMModemFirmware *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_FIRMWARE, MMModemFirmwarePrivate); + g_mutex_init (&self->priv->update_settings_mutex); +} + +static void +finalize (GObject *object) +{ + MMModemFirmware *self = MM_MODEM_FIRMWARE (object); + + g_mutex_clear (&self->priv->update_settings_mutex); + + G_OBJECT_CLASS (mm_modem_firmware_parent_class)->finalize (object); +} + +static void +dispose (GObject *object) +{ + MMModemFirmware *self = MM_MODEM_FIRMWARE (object); + + g_clear_object (&self->priv->update_settings); + + G_OBJECT_CLASS (mm_modem_firmware_parent_class)->dispose (object); } static void mm_modem_firmware_class_init (MMModemFirmwareClass *modem_class) { + GObjectClass *object_class = G_OBJECT_CLASS (modem_class); + + g_type_class_add_private (object_class, sizeof (MMModemFirmwarePrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + object_class->finalize = finalize; } diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-firmware.h modemmanager-1.10.0/libmm-glib/mm-modem-firmware.h --- modemmanager-1.6.8/libmm-glib/mm-modem-firmware.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-firmware.h 2019-01-15 15:57:35.000000000 +0100 @@ -18,6 +18,7 @@ * Boston, MA 02110-1301 USA. * * Copyright (C) 2012 Google, Inc. + * Copyright (C) 2018 Aleksander Morgado */ #ifndef _MM_MODEM_FIRMWARE_H_ @@ -31,6 +32,7 @@ #include "mm-gdbus-modem.h" #include "mm-firmware-properties.h" +#include "mm-firmware-update-settings.h" G_BEGIN_DECLS @@ -43,6 +45,7 @@ typedef struct _MMModemFirmware MMModemFirmware; typedef struct _MMModemFirmwareClass MMModemFirmwareClass; +typedef struct _MMModemFirmwarePrivate MMModemFirmwarePrivate; /** * MMModemFirmware: @@ -53,7 +56,7 @@ struct _MMModemFirmware { /*< private >*/ MmGdbusModemFirmwareProxy parent; - gpointer unused; + MMModemFirmwarePrivate *priv; }; struct _MMModemFirmwareClass { @@ -63,9 +66,16 @@ GType mm_modem_firmware_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemFirmware, g_object_unref) +#endif + const gchar *mm_modem_firmware_get_path (MMModemFirmware *self); gchar *mm_modem_firmware_dup_path (MMModemFirmware *self); +MMFirmwareUpdateSettings *mm_modem_firmware_get_update_settings (MMModemFirmware *self); +MMFirmwareUpdateSettings *mm_modem_firmware_peek_update_settings (MMModemFirmware *self); + void mm_modem_firmware_list (MMModemFirmware *self, GCancellable *cancellable, GAsyncReadyCallback callback, diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem.h modemmanager-1.10.0/libmm-glib/mm-modem.h --- modemmanager-1.6.8/libmm-glib/mm-modem.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem.h 2019-01-15 15:57:35.000000000 +0100 @@ -68,6 +68,10 @@ GType mm_modem_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem, g_object_unref) +#endif + const gchar *mm_modem_get_path (MMModem *self); gchar *mm_modem_dup_path (MMModem *self); @@ -99,6 +103,9 @@ const gchar *mm_modem_get_revision (MMModem *self); gchar *mm_modem_dup_revision (MMModem *self); +const gchar *mm_modem_get_hardware_revision (MMModem *self); +gchar *mm_modem_dup_hardware_revision (MMModem *self); + const gchar *mm_modem_get_device_identifier (MMModem *self); gchar *mm_modem_dup_device_identifier (MMModem *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-location.c modemmanager-1.10.0/libmm-glib/mm-modem-location.c --- modemmanager-1.6.8/libmm-glib/mm-modem-location.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-location.c 2019-01-15 15:57:35.000000000 +0100 @@ -101,6 +101,24 @@ /*****************************************************************************/ /** + * mm_modem_location_get_supported_assistance_data: + * @self: A #MMModemLocation. + * + * Gets a bitmask of the supported assistance data types. + * + * Returns: A #MMModemLocationAssistanceDataType. + */ +MMModemLocationAssistanceDataType +mm_modem_location_get_supported_assistance_data (MMModemLocation *self) +{ + g_return_val_if_fail (MM_IS_MODEM_LOCATION (self), MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE); + + return (MMModemLocationAssistanceDataType) mm_gdbus_modem_location_get_supported_assistance_data (MM_GDBUS_MODEM_LOCATION (self)); +} + +/*****************************************************************************/ + +/** * mm_modem_location_get_enabled: * @self: A #MMModemLocation. * @@ -307,6 +325,91 @@ /*****************************************************************************/ /** + * mm_modem_location_inject_assistance_data_finish: + * @self: A #MMModemLocation. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_location_inject_assistance_data(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with mm_modem_location_inject_assistance_data(). + * + * Returns: %TRUE if the injection was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_location_inject_assistance_data_finish (MMModemLocation *self, + GAsyncResult *res, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_LOCATION (self), FALSE); + + return mm_gdbus_modem_location_call_inject_assistance_data_finish (MM_GDBUS_MODEM_LOCATION (self), res, error); +} + +/** + * mm_modem_location_inject_assistance_data: + * @self: A #MMModemLocation. + * @data: (array length=data_size): Data to inject. + * @data_size: size of @data. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Aynchronously injects assistance data to the GNSS module. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call mm_modem_location_inject_assistance_data_finish() to get the result of the operation. + * + * See mm_modem_location_inject_assistance_data_sync() for the synchronous, blocking version of this method. + */ +void +mm_modem_location_inject_assistance_data (MMModemLocation *self, + const guint8 *data, + gsize data_size, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_return_if_fail (MM_IS_MODEM_LOCATION (self)); + + mm_gdbus_modem_location_call_inject_assistance_data (MM_GDBUS_MODEM_LOCATION (self), + g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, data, data_size, sizeof (guint8)), + cancellable, + callback, + user_data); +} + +/** + * mm_modem_location_inject_assistance_data_sync: + * @self: A #MMModemLocation. + * @data: (array length=data_size): Data to inject. + * @data_size: size of @data. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously injects assistance data to the GNSS module. + * + * The calling thread is blocked until a reply is received. See mm_modem_location_inject_assistance_data() + * for the asynchronous version of this method. + * + * Returns: %TRUE if the injection was successful, %FALSE if @error is set. + */ +gboolean +mm_modem_location_inject_assistance_data_sync (MMModemLocation *self, + const guint8 *data, + gsize data_size, + GCancellable *cancellable, + GError **error) +{ + g_return_val_if_fail (MM_IS_MODEM_LOCATION (self), FALSE); + + return mm_gdbus_modem_location_call_inject_assistance_data_sync (MM_GDBUS_MODEM_LOCATION (self), + g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, data, data_size, sizeof (guint8)), + cancellable, + error); +} + +/*****************************************************************************/ + +/** * mm_modem_location_set_gps_refresh_rate_finish: * @self: A #MMModemLocation. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_location_set_gps_refresh_rate(). @@ -875,6 +978,56 @@ } /*****************************************************************************/ + +/** + * mm_modem_location_get_assistance_data_servers: + * @self: A #MMModemLocation. + * + * Gets the list of assistance data servers. + * + * The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_location_dup_assistance_data_servers() if on another + * thread. + * + * Returns: (transfer none): a %NULL-terminated array of server addresses, or %NULL if none available. Do not free the returned value, it belongs to @self. + */ +const gchar ** +mm_modem_location_get_assistance_data_servers (MMModemLocation *self) +{ + const gchar **tmp; + + g_return_val_if_fail (MM_IS_MODEM_LOCATION (self), NULL); + + tmp = (const gchar **) mm_gdbus_modem_location_get_assistance_data_servers (MM_GDBUS_MODEM_LOCATION (self)); + + return ((tmp && tmp[0]) ? tmp : NULL); +} + +/** + * mm_modem_location_dup_assistance_data_servers: + * @self: A #MMModemLocation. + * + * Gets the list of assistance data servers. + * + * Returns: (transfer full): a %NULL-terminated array of server addresses, or %NULL if none available. The returned value should be freed with g_strfreev(). + */ +gchar ** +mm_modem_location_dup_assistance_data_servers (MMModemLocation *self) +{ + gchar **tmp; + + g_return_val_if_fail (MM_IS_MODEM_LOCATION (self), NULL); + + tmp = mm_gdbus_modem_location_dup_assistance_data_servers (MM_GDBUS_MODEM_LOCATION (self)); + if (tmp && tmp[0]) + return tmp; + + g_strfreev (tmp); + return NULL; +} + +/*****************************************************************************/ /** * mm_modem_location_get_gps_refresh_rate: diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-location.h modemmanager-1.10.0/libmm-glib/mm-modem-location.h --- modemmanager-1.6.8/libmm-glib/mm-modem-location.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-location.h 2019-01-15 15:57:35.000000000 +0100 @@ -67,6 +67,10 @@ GType mm_modem_location_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemLocation, g_object_unref) +#endif + const gchar *mm_modem_location_get_path (MMModemLocation *self); gchar *mm_modem_location_dup_path (MMModemLocation *self); @@ -76,9 +80,14 @@ gboolean mm_modem_location_signals_location (MMModemLocation *self); +MMModemLocationAssistanceDataType mm_modem_location_get_supported_assistance_data (MMModemLocation *self); + const gchar *mm_modem_location_get_supl_server (MMModemLocation *self); gchar *mm_modem_location_dup_supl_server (MMModemLocation *self); +const gchar **mm_modem_location_get_assistance_data_servers (MMModemLocation *self); +gchar **mm_modem_location_dup_assistance_data_servers (MMModemLocation *self); + guint mm_modem_location_get_gps_refresh_rate (MMModemLocation *self); void mm_modem_location_setup (MMModemLocation *self, @@ -109,6 +118,21 @@ GCancellable *cancellable, GError **error); +void mm_modem_location_inject_assistance_data (MMModemLocation *self, + const guint8 *data, + gsize data_size, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_modem_location_inject_assistance_data_finish (MMModemLocation *self, + GAsyncResult *res, + GError **error); +gboolean mm_modem_location_inject_assistance_data_sync (MMModemLocation *self, + const guint8 *data, + gsize data_size, + GCancellable *cancellable, + GError **error); + void mm_modem_location_set_gps_refresh_rate (MMModemLocation *self, guint rate, GCancellable *cancellable, diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-messaging.c modemmanager-1.10.0/libmm-glib/mm-modem-messaging.c --- modemmanager-1.6.8/libmm-glib/mm-modem-messaging.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-messaging.c 2018-11-15 09:55:53.000000000 +0100 @@ -219,9 +219,6 @@ /*****************************************************************************/ typedef struct { - MMModemMessaging *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; gchar **sms_paths; GList *sms_objects; guint i; @@ -230,20 +227,14 @@ static void sms_object_list_free (GList *list) { - g_list_free_full (list, (GDestroyNotify) g_object_unref); + g_list_free_full (list, g_object_unref); } static void -list_sms_context_complete_and_free (ListSmsContext *ctx) +list_sms_context_free (ListSmsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_strfreev (ctx->sms_paths); sms_object_list_free (ctx->sms_objects); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_ref (ctx->self); g_slice_free (ListSmsContext, ctx); } @@ -262,70 +253,69 @@ GAsyncResult *res, GError **error) { - GList *list; - g_return_val_if_fail (MM_IS_MODEM_MESSAGING (self), FALSE); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - list = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - /* The list we got, including the objects within, is owned by the async result; - * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_task_propagate_pointer (G_TASK (res), error); } -static void create_next_sms (ListSmsContext *ctx); +static void create_next_sms (GTask *task); static void list_build_object_ready (GDBusConnection *connection, GAsyncResult *res, - ListSmsContext *ctx) + GTask *task) { GError *error = NULL; GObject *sms; GObject *source_object; + ListSmsContext *ctx; source_object = g_async_result_get_source_object (res); sms = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, &error); g_object_unref (source_object); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_sms_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Keep the object */ ctx->sms_objects = g_list_prepend (ctx->sms_objects, sms); /* If no more smss, just end here. */ if (!ctx->sms_paths[++ctx->i]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - ctx->sms_objects, - (GDestroyNotify)sms_object_list_free); - ctx->sms_objects = NULL; - list_sms_context_complete_and_free (ctx); + GList *sms_objects; + + sms_objects = g_list_copy_deep (ctx->sms_objects, (GCopyFunc)g_object_ref, NULL); + g_task_return_pointer (task, sms_objects, (GDestroyNotify)sms_object_list_free); + g_object_unref (task); return; } /* Keep on creating next object */ - create_next_sms (ctx); + create_next_sms (task); } static void -create_next_sms (ListSmsContext *ctx) +create_next_sms (GTask *task) { + MMModemMessaging *self; + ListSmsContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + g_async_initable_new_async (MM_TYPE_SMS, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)list_build_object_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, - "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (ctx->self)), + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), "g-object-path", ctx->sms_paths[ctx->i], "g-interface-name", "org.freedesktop.ModemManager1.Sms", NULL); @@ -352,30 +342,26 @@ gpointer user_data) { ListSmsContext *ctx; + GTask *task; g_return_if_fail (MM_IS_MODEM_MESSAGING (self)); ctx = g_slice_new0 (ListSmsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_messaging_list); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->sms_paths = mm_gdbus_modem_messaging_dup_messages (MM_GDBUS_MODEM_MESSAGING (self)); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)list_sms_context_free); + /* If no SMS, just end here. */ if (!ctx->sms_paths || !ctx->sms_paths[0]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, NULL, NULL); - list_sms_context_complete_and_free (ctx); + g_task_return_pointer (task, NULL, NULL); + g_object_unref (task); return; } /* Got list of paths. If at least one found, start creating objects for each */ ctx->i = 0; - create_next_sms (ctx); + create_next_sms (task); } /** @@ -389,7 +375,7 @@ * The calling thread is blocked until a reply is received. See mm_modem_messaging_list() * for the asynchronous version of this method. * - * Returns: (element-type MMSms) (transfer full): A list of #MMSms objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. + * Returns: (element-type ModemManager.Sms) (transfer full): A list of #MMSms objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. */ GList * mm_modem_messaging_list_sync (MMModemMessaging *self, @@ -436,21 +422,6 @@ /*****************************************************************************/ -typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; -} CreateSmsContext; - -static void -create_sms_context_complete_and_free (CreateSmsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_slice_free (CreateSmsContext, ctx); -} - /** * mm_modem_messaging_create_finish: * @self: A #MMModemMessaging. @@ -468,16 +439,13 @@ { g_return_val_if_fail (MM_IS_MODEM_MESSAGING (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void new_sms_object_ready (GDBusConnection *connection, GAsyncResult *res, - CreateSmsContext *ctx) + GTask *task) { GError *error = NULL; GObject *sms; @@ -488,19 +456,17 @@ g_object_unref (source_object); if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, - sms, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, sms, g_object_unref); - create_sms_context_complete_and_free (ctx); + g_object_unref (task); } static void create_sms_ready (MMModemMessaging *self, GAsyncResult *res, - CreateSmsContext *ctx) + GTask *task) { GError *error = NULL; gchar *sms_path = NULL; @@ -509,17 +475,17 @@ &sms_path, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - create_sms_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_free (sms_path); return; } g_async_initable_new_async (MM_TYPE_SMS, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)new_sms_object_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), @@ -551,26 +517,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - CreateSmsContext *ctx; + GTask *task; GVariant *dictionary; g_return_if_fail (MM_IS_MODEM_MESSAGING (self)); - ctx = g_slice_new0 (CreateSmsContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_messaging_create); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - + task = g_task_new (self, cancellable, callback, user_data); dictionary = (mm_sms_properties_get_dictionary (properties)); mm_gdbus_modem_messaging_call_create ( MM_GDBUS_MODEM_MESSAGING (self), dictionary, cancellable, (GAsyncReadyCallback)create_sms_ready, - ctx); + task); g_variant_unref (dictionary); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-messaging.h modemmanager-1.10.0/libmm-glib/mm-modem-messaging.h --- modemmanager-1.6.8/libmm-glib/mm-modem-messaging.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-messaging.h 2019-01-15 15:57:35.000000000 +0100 @@ -66,6 +66,10 @@ GType mm_modem_messaging_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemMessaging, g_object_unref) +#endif + const gchar *mm_modem_messaging_get_path (MMModemMessaging *self); gchar *mm_modem_messaging_dup_path (MMModemMessaging *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-oma.h modemmanager-1.10.0/libmm-glib/mm-modem-oma.h --- modemmanager-1.6.8/libmm-glib/mm-modem-oma.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-oma.h 2019-01-15 15:57:35.000000000 +0100 @@ -64,6 +64,10 @@ GType mm_modem_oma_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemOma, g_object_unref) +#endif + const gchar *mm_modem_oma_get_path (MMModemOma *self); gchar *mm_modem_oma_dup_path (MMModemOma *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-signal.h modemmanager-1.10.0/libmm-glib/mm-modem-signal.h --- modemmanager-1.6.8/libmm-glib/mm-modem-signal.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-signal.h 2019-01-15 15:57:35.000000000 +0100 @@ -64,6 +64,10 @@ GType mm_modem_signal_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemSignal, g_object_unref) +#endif + const gchar *mm_modem_signal_get_path (MMModemSignal *self); gchar *mm_modem_signal_dup_path (MMModemSignal *self); guint mm_modem_signal_get_rate (MMModemSignal *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-simple.c modemmanager-1.10.0/libmm-glib/mm-modem-simple.c --- modemmanager-1.6.8/libmm-glib/mm-modem-simple.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-simple.c 2018-11-15 09:55:53.000000000 +0100 @@ -82,21 +82,6 @@ /*****************************************************************************/ -typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; -} ConnectContext; - -static void -connect_context_complete_and_free (ConnectContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_slice_free (ConnectContext, ctx); -} - /** * mm_modem_simple_connect_finish: * @self: A #MMModemSimple. @@ -114,16 +99,13 @@ { g_return_val_if_fail (MM_IS_MODEM_SIMPLE (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void new_bearer_ready (GDBusConnection *connection, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { GError *error = NULL; GObject *bearer; @@ -134,19 +116,17 @@ g_object_unref (source_object); if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, - bearer, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, bearer, g_object_unref); - connect_context_complete_and_free (ctx); + g_object_unref (task); } static void simple_connect_ready (MMModemSimple *self, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { GError *error = NULL; gchar *bearer_path = NULL; @@ -155,16 +135,16 @@ &bearer_path, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } g_async_initable_new_async (MM_TYPE_BEARER, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)new_bearer_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), @@ -196,18 +176,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - ConnectContext *ctx; + GTask *task; GVariant *variant; g_return_if_fail (MM_IS_MODEM_SIMPLE (self)); - ctx = g_slice_new0 (ConnectContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_simple_connect); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); + task = g_task_new (self, cancellable, callback, user_data); variant = mm_simple_connect_properties_get_dictionary (properties); mm_gdbus_modem_simple_call_connect ( @@ -215,7 +189,7 @@ variant, cancellable, (GAsyncReadyCallback)simple_connect_ready, - ctx); + task); g_variant_unref (variant); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-simple.h modemmanager-1.10.0/libmm-glib/mm-modem-simple.h --- modemmanager-1.6.8/libmm-glib/mm-modem-simple.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-simple.h 2019-01-15 15:57:35.000000000 +0100 @@ -66,6 +66,10 @@ GType mm_modem_simple_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemSimple, g_object_unref) +#endif + const gchar *mm_modem_simple_get_path (MMModemSimple *self); gchar *mm_modem_simple_dup_path (MMModemSimple *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-time.h modemmanager-1.10.0/libmm-glib/mm-modem-time.h --- modemmanager-1.6.8/libmm-glib/mm-modem-time.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-time.h 2019-01-15 15:57:35.000000000 +0100 @@ -65,6 +65,10 @@ GType mm_modem_time_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemTime, g_object_unref) +#endif + const gchar *mm_modem_time_get_path (MMModemTime *self); gchar *mm_modem_time_dup_path (MMModemTime *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-voice.c modemmanager-1.10.0/libmm-glib/mm-modem-voice.c --- modemmanager-1.6.8/libmm-glib/mm-modem-voice.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-voice.c 2018-11-15 09:55:53.000000000 +0100 @@ -84,9 +84,6 @@ /*****************************************************************************/ typedef struct { - MMModemVoice *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; gchar **call_paths; GList *call_objects; guint i; @@ -95,20 +92,14 @@ static void call_object_list_free (GList *list) { - g_list_free_full (list, (GDestroyNotify) g_object_unref); + g_list_free_full (list, g_object_unref); } static void -list_call_context_complete_and_free (ListCallsContext *ctx) +list_call_context_free (ListCallsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_strfreev (ctx->call_paths); call_object_list_free (ctx->call_objects); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_ref (ctx->self); g_slice_free (ListCallsContext, ctx); } @@ -127,70 +118,69 @@ GAsyncResult *res, GError **error) { - GList *list; - g_return_val_if_fail (MM_IS_MODEM_VOICE (self), FALSE); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - list = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - /* The list we got, including the objects within, is owned by the async result; - * so we'll make sure we return a new list */ - g_list_foreach (list, (GFunc)g_object_ref, NULL); - return g_list_copy (list); + return g_task_propagate_pointer (G_TASK (res), error); } -static void create_next_call (ListCallsContext *ctx); +static void create_next_call (GTask *task); static void list_build_object_ready (GDBusConnection *connection, GAsyncResult *res, - ListCallsContext *ctx) + GTask *task) { GError *error = NULL; GObject *call; GObject *source_object; + ListCallsContext *ctx; source_object = g_async_result_get_source_object (res); call = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, &error); g_object_unref (source_object); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_call_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Keep the object */ ctx->call_objects = g_list_prepend (ctx->call_objects, call); /* If no more calls, just end here. */ if (!ctx->call_paths[++ctx->i]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - ctx->call_objects, - (GDestroyNotify)call_object_list_free); - ctx->call_objects = NULL; - list_call_context_complete_and_free (ctx); + GList *call_objects; + + call_objects = g_list_copy_deep (ctx->call_objects, (GCopyFunc)g_object_ref, NULL); + g_task_return_pointer (task, call_objects, (GDestroyNotify)call_object_list_free); + g_object_unref (task); return; } /* Keep on creating next object */ - create_next_call (ctx); + create_next_call (task); } static void -create_next_call (ListCallsContext *ctx) +create_next_call (GTask *task) { + MMModemVoice *self; + ListCallsContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + g_async_initable_new_async (MM_TYPE_CALL, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)list_build_object_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, - "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (ctx->self)), + "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), "g-object-path", ctx->call_paths[ctx->i], "g-interface-name", "org.freedesktop.ModemManager1.Call", NULL); @@ -217,30 +207,26 @@ gpointer user_data) { ListCallsContext *ctx; + GTask *task; g_return_if_fail (MM_IS_MODEM_VOICE (self)); ctx = g_slice_new0 (ListCallsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_voice_list_calls); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - ctx->call_paths = mm_gdbus_modem_voice_dup_calls (MM_GDBUS_MODEM_VOICE (self)); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)list_call_context_free); + /* If no CALL, just end here. */ if (!ctx->call_paths || !ctx->call_paths[0]) { - g_simple_async_result_set_op_res_gpointer (ctx->result, NULL, NULL); - list_call_context_complete_and_free (ctx); + g_task_return_pointer (task, NULL, NULL); + g_object_unref (task); return; } /* Got list of paths. If at least one found, start creating objects for each */ ctx->i = 0; - create_next_call (ctx); + create_next_call (task); } /** @@ -254,7 +240,7 @@ * The calling thread is blocked until a reply is received. See mm_modem_voice_list_calls() * for the asynchronous version of this method. * - * Returns: (element-type MMCall) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. + * Returns: (element-type ModemManager.Call) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. */ GList * mm_modem_voice_list_calls_sync (MMModemVoice *self, @@ -301,21 +287,6 @@ /*****************************************************************************/ -typedef struct { - GSimpleAsyncResult *result; - GCancellable *cancellable; -} CreateCallContext; - -static void -create_call_context_complete_and_free (CreateCallContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_slice_free (CreateCallContext, ctx); -} - /** * mm_modem_voice_create_call_finish: * @self: A #MMModemVoice. @@ -328,21 +299,18 @@ */ MMCall * mm_modem_voice_create_call_finish (MMModemVoice *self, - GAsyncResult *res, - GError **error) + GAsyncResult *res, + GError **error) { g_return_val_if_fail (MM_IS_MODEM_VOICE (self), NULL); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void new_call_object_ready (GDBusConnection *connection, - GAsyncResult *res, - CreateCallContext *ctx) + GAsyncResult *res, + GTask *task) { GError *error = NULL; GObject *call; @@ -353,19 +321,17 @@ g_object_unref (source_object); if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, - call, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, call, g_object_unref); - create_call_context_complete_and_free (ctx); + g_object_unref (task); } static void create_call_ready (MMModemVoice *self, - GAsyncResult *res, - CreateCallContext *ctx) + GAsyncResult *res, + GTask *task) { GError *error = NULL; gchar *call_path = NULL; @@ -374,17 +340,17 @@ &call_path, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - create_call_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_free (call_path); return; } g_async_initable_new_async (MM_TYPE_CALL, G_PRIORITY_DEFAULT, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)new_call_object_ready, - ctx, + task, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", MM_DBUS_SERVICE, "g-connection", g_dbus_proxy_get_connection (G_DBUS_PROXY (self)), @@ -416,26 +382,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - CreateCallContext *ctx; + GTask *task; GVariant *dictionary; g_return_if_fail (MM_IS_MODEM_VOICE (self)); - ctx = g_slice_new0 (CreateCallContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_modem_voice_create_call); - if (cancellable) - ctx->cancellable = g_object_ref (cancellable); - + task = g_task_new (self, cancellable, callback, user_data); dictionary = mm_call_properties_get_dictionary (properties); mm_gdbus_modem_voice_call_create_call ( MM_GDBUS_MODEM_VOICE (self), dictionary, cancellable, (GAsyncReadyCallback)create_call_ready, - ctx); + task); g_variant_unref (dictionary); } diff -Nru modemmanager-1.6.8/libmm-glib/mm-modem-voice.h modemmanager-1.10.0/libmm-glib/mm-modem-voice.h --- modemmanager-1.6.8/libmm-glib/mm-modem-voice.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-modem-voice.h 2019-01-15 15:57:35.000000000 +0100 @@ -66,6 +66,10 @@ GType mm_modem_voice_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemVoice, g_object_unref) +#endif + const gchar *mm_modem_voice_get_path (MMModemVoice *self); gchar *mm_modem_voice_dup_path (MMModemVoice *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-network-timezone.h modemmanager-1.10.0/libmm-glib/mm-network-timezone.h --- modemmanager-1.6.8/libmm-glib/mm-network-timezone.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-network-timezone.h 2019-01-15 15:57:35.000000000 +0100 @@ -69,6 +69,10 @@ GType mm_network_timezone_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMNetworkTimezone, g_object_unref) +#endif + gint32 mm_network_timezone_get_offset (MMNetworkTimezone *self); gint32 mm_network_timezone_get_dst_offset (MMNetworkTimezone *self); gint32 mm_network_timezone_get_leap_seconds (MMNetworkTimezone *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-object.h modemmanager-1.10.0/libmm-glib/mm-object.h --- modemmanager-1.6.8/libmm-glib/mm-object.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-object.h 2019-01-15 15:57:35.000000000 +0100 @@ -75,6 +75,10 @@ GType mm_object_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMObject, g_object_unref) +#endif + const gchar *mm_object_get_path (MMObject *self); gchar *mm_object_dup_path (MMObject *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-pco.c modemmanager-1.10.0/libmm-glib/mm-pco.c --- modemmanager-1.6.8/libmm-glib/mm-pco.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-pco.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,330 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright 2018 Google LLC. + */ + +#include +#include + +#include "mm-enums-types.h" +#include "mm-errors-types.h" +#include "mm-common-helpers.h" +#include "mm-pco.h" + +/** + * SECTION: mm-pco + * @title: MMPco + * @short_description: Helper object to handle 3GPP PCO. + * + * The #MMPco is an object handling the raw 3GPP Protocol Configuration Options + * (PCO) that the modem has received from the network. + * + * This object is retrieved with mm_modem_3gpp_get_pco(). + */ + +G_DEFINE_TYPE (MMPco, mm_pco, G_TYPE_OBJECT); + +struct _MMPcoPrivate { + /* Session ID, signature 'u' */ + guint32 session_id; + /* Flag indicating if the PCO data is complete or partial, signature 'b' */ + gboolean is_complete; + /* Raw PCO data, signature 'ay' */ + GBytes *data; +}; + +/*****************************************************************************/ + +static GBytes * +_g_variant_get_bytes (GVariant *variant) +{ + GByteArray *byte_array; + guint num_bytes; + GVariantIter iter; + guint8 byte; + + g_assert (g_variant_is_of_type (variant, G_VARIANT_TYPE ("ay"))); + + num_bytes = g_variant_n_children (variant); + if (num_bytes == 0) + return NULL; + + byte_array = g_byte_array_sized_new (num_bytes); + + g_variant_iter_init (&iter, variant); + while (g_variant_iter_loop (&iter, "y", &byte)) + g_byte_array_append (byte_array, &byte, sizeof (byte)); + + return g_byte_array_free_to_bytes (byte_array); +} + +/*****************************************************************************/ + +/** + * mm_pco_get_session_id: + * @self: a #MMPco. + * + * Gets the session ID associated with the PCO. + * + * Returns: the session ID. + */ +guint32 +mm_pco_get_session_id (MMPco *self) +{ + g_return_val_if_fail (MM_IS_PCO (self), G_MAXUINT32); + + return self->priv->session_id; +} + +void +mm_pco_set_session_id (MMPco *self, + guint32 session_id) +{ + g_return_if_fail (MM_IS_PCO (self)); + + self->priv->session_id = session_id; +} + +/*****************************************************************************/ + +/** + * mm_pco_is_complete: + * @self: a #MMPco. + * + * Gets the complete flag that indicates whether the PCO data contains the + * complete PCO structure received from the network. + * + * Returns: %TRUE if the PCO data contains the complete PCO structure, %FALSE otherwise. + */ +gboolean +mm_pco_is_complete (MMPco *self) +{ + g_return_val_if_fail (MM_IS_PCO (self), FALSE); + + return self->priv->is_complete; +} + +void +mm_pco_set_complete (MMPco *self, + gboolean is_complete) +{ + g_return_if_fail (MM_IS_PCO (self)); + + self->priv->is_complete = is_complete; +} + +/*****************************************************************************/ + +/** + * mm_pco_get_data: + * @self: a #MMPco. + * @data_size: (out): Size of the PCO data, if any given. + * + * Gets the PCO data in raw bytes. + * + * Returns: (transfer none): the PCO data, or %NULL if it doesn't contain any. + */ +const guint8 * +mm_pco_get_data (MMPco *self, + gsize *data_size) +{ + g_return_val_if_fail (MM_IS_PCO (self), NULL); + + return g_bytes_get_data (self->priv->data, data_size); +} + +void +mm_pco_set_data (MMPco *self, + const guint8 *data, + gsize data_size) +{ + g_return_if_fail (MM_IS_PCO (self)); + + g_bytes_unref (self->priv->data); + + self->priv->data = (data && data_size) ? g_bytes_new (data, data_size) + : NULL; +} + +/*****************************************************************************/ + +/** + * mm_pco_from_variant: + * @variant: A variant with the PCO information. + * @error: Return location for error or %NULL. + * + * Creates a new #MMPco object with the values exposed in + * the variant. + * + * Returns: (transfer full): A #MMPco or %NULL if @error is set. The returned value should be freed with g_object_unref(). + */ +MMPco * +mm_pco_from_variant (GVariant *variant, + GError **error) +{ + MMPco *pco; + GVariant *pco_data = NULL; + + pco = mm_pco_new (); + if (!variant) + return pco; + + if (!g_variant_is_of_type (variant, G_VARIANT_TYPE ("(ubay)"))) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot create PCO from variant: " + "invalid variant type received"); + g_object_unref (pco); + return NULL; + } + + g_variant_get (variant, "(ub@ay)", + &pco->priv->session_id, + &pco->priv->is_complete, + &pco_data); + + g_bytes_unref (pco->priv->data); + pco->priv->data = _g_variant_get_bytes (pco_data); + g_variant_unref (pco_data); + + return pco; +} + +/*****************************************************************************/ + +/** + * mm_pco_to_variant: + * @self: a #MMPco. + * + * Gets a GVariant representation with signature "(ubay)" of @self. + * + * Returns: (transfer full): A #GVariant representation of the #MMPco object. The returned value should be freed with g_variant_unref(). + */ +GVariant * +mm_pco_to_variant (MMPco *self) +{ + GVariantBuilder builder; + gsize i, pco_data_size; + const guint8 *pco_data; + + /* Allow NULL */ + if (!self) + return NULL; + + g_return_val_if_fail (MM_IS_PCO (self), NULL); + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(ubay)")); + + g_variant_builder_add (&builder, "u", self->priv->session_id); + g_variant_builder_add (&builder, "b", self->priv->is_complete); + + g_variant_builder_open (&builder, G_VARIANT_TYPE ("ay")); + if (self->priv->data) { + pco_data = g_bytes_get_data (self->priv->data, &pco_data_size); + for (i = 0; i < pco_data_size; ++i) + g_variant_builder_add (&builder, "y", pco_data[i]); + } + g_variant_builder_close (&builder); + + return g_variant_ref_sink (g_variant_builder_end (&builder)); +} + +/*****************************************************************************/ + +/** + * mm_pco_list_free: + * @pco_list: (transfer full)(element-type ModemManager.Pco): a #GList of #MMPco. + * + * Frees all of the memory used by a #GList of #MMPco. + */ +void +mm_pco_list_free (GList *pco_list) +{ + g_list_free_full (pco_list, g_object_unref); +} + +/** + * mm_pco_list_add: + * @pco_list: (transfer full)(element-type ModemManager.Pco): a #GList of #MMPco. + * @pco: (transfer none): a #MMPco to add to the given list. + * + * Adds a #MMPco to a given PCO list. #MMPco objects stored in the order of + * their session ID. An existing PCO with the same session ID is overwritten + * with the new value. + * + * Returns: (transfer full)(element-type ModemManager.Pco): the new start of an updated or newly allocated #GList of #MMPco. + */ +GList * +mm_pco_list_add (GList *pco_list, + MMPco *pco) +{ + GList *iter; + guint32 session_id; + + g_return_val_if_fail (pco != NULL, pco_list); + + session_id = mm_pco_get_session_id (pco); + + for (iter = g_list_first (pco_list); iter; iter = g_list_next (iter)) { + MMPco *iter_pco = iter->data; + guint32 iter_session_id = mm_pco_get_session_id (iter_pco); + + if (iter_session_id < session_id) + continue; + else if (iter_session_id == session_id) { + iter->data = g_object_ref (pco); + g_object_unref (iter_pco); + return pco_list; + } else + break; + } + + return g_list_insert_before (pco_list, iter, g_object_ref (pco)); +} + +/*****************************************************************************/ + +MMPco * +mm_pco_new (void) +{ + return (MM_PCO (g_object_new (MM_TYPE_PCO, NULL))); +} + +static void +mm_pco_init (MMPco *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_PCO, MMPcoPrivate); + + self->priv->session_id = G_MAXUINT32; +} + +static void +finalize (GObject *object) +{ + MMPco *self = MM_PCO (object); + + g_bytes_unref (self->priv->data); + + G_OBJECT_CLASS (mm_pco_parent_class)->finalize (object); +} + +static void +mm_pco_class_init (MMPcoClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMPcoPrivate)); + + object_class->finalize = finalize; +} diff -Nru modemmanager-1.6.8/libmm-glib/mm-pco.h modemmanager-1.10.0/libmm-glib/mm-pco.h --- modemmanager-1.6.8/libmm-glib/mm-pco.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/mm-pco.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright 2018 Google LLC. + */ + +#ifndef MM_PCO_H +#define MM_PCO_H + +#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include + +G_BEGIN_DECLS + +#define MM_TYPE_PCO (mm_pco_get_type ()) +#define MM_PCO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PCO, MMPco)) +#define MM_PCO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PCO, MMPcoClass)) +#define MM_IS_PCO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PCO)) +#define MM_IS_PCO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PCO)) +#define MM_PCO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PCO, MMPcoClass)) + +typedef struct _MMPco MMPco; +typedef struct _MMPcoClass MMPcoClass; +typedef struct _MMPcoPrivate MMPcoPrivate; + +/** + * MMPco: + * + * The #MMPco structure contains private data and should only be accessed + * using the provided API. + */ +struct _MMPco { + /*< private >*/ + GObject parent; + MMPcoPrivate *priv; +}; + +struct _MMPcoClass { + /*< private >*/ + GObjectClass parent; +}; + +GType mm_pco_get_type (void); + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPco, g_object_unref) +#endif + +guint32 mm_pco_get_session_id (MMPco *self); +gboolean mm_pco_is_complete (MMPco *self); +const guint8 *mm_pco_get_data (MMPco *self, + gsize *data_size); + +void mm_pco_list_free (GList *pco_list); +GList *mm_pco_list_add (GList *pco_list, + MMPco *pco); + +/*****************************************************************************/ +/* ModemManager/libmm-glib/mmcli specific methods */ + +#if defined (_LIBMM_INSIDE_MM) || \ + defined (_LIBMM_INSIDE_MMCLI) || \ + defined (LIBMM_GLIB_COMPILATION) + +MMPco *mm_pco_new (void); +MMPco *mm_pco_from_variant (GVariant *variant, + GError **error); +GVariant *mm_pco_to_variant (MMPco *self); +void mm_pco_set_session_id (MMPco *self, + guint32 session_id); +void mm_pco_set_complete (MMPco *self, + gboolean is_complete); +void mm_pco_set_data (MMPco *self, + const guint8 *data, + gsize data_size); + +#endif + +G_END_DECLS + +#endif /* MM_PCO_H */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-signal.c modemmanager-1.10.0/libmm-glib/mm-signal.c --- modemmanager-1.6.8/libmm-glib/mm-signal.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-signal.c 2018-11-15 09:55:53.000000000 +0100 @@ -111,7 +111,7 @@ * mm_signal_get_ecio: * @self: a #MMSignal. * - * Gets the Ec/Io, in dBm. + * Gets the Ec/Io, in dB. * * Only applicable to CDMA1x, CDMA EV-DO and UMTS (WCDMA). * diff -Nru modemmanager-1.6.8/libmm-glib/mm-signal.h modemmanager-1.10.0/libmm-glib/mm-signal.h --- modemmanager-1.6.8/libmm-glib/mm-signal.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-signal.h 2019-01-15 15:57:35.000000000 +0100 @@ -30,7 +30,7 @@ * * Identifier for an unknown signal value. */ -#define MM_SIGNAL_UNKNOWN G_MINDOUBLE +#define MM_SIGNAL_UNKNOWN -G_MAXDOUBLE #define MM_TYPE_SIGNAL (mm_signal_get_type ()) #define MM_SIGNAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIGNAL, MMSignal)) @@ -62,6 +62,10 @@ GType mm_signal_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSignal, g_object_unref) +#endif + gdouble mm_signal_get_rssi (MMSignal *self); gdouble mm_signal_get_rscp (MMSignal *self); gdouble mm_signal_get_ecio (MMSignal *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-sim.c modemmanager-1.10.0/libmm-glib/mm-sim.c --- modemmanager-1.6.8/libmm-glib/mm-sim.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sim.c 2018-11-15 09:55:53.000000000 +0100 @@ -253,7 +253,7 @@ * * Finishes an operation started with mm_sim_send_pin(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_send_pin_finish (MMSim *self, @@ -308,7 +308,7 @@ * The calling thread is blocked until a reply is received. * See mm_sim_send_pin() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_send_pin_sync (MMSim *self, @@ -334,7 +334,7 @@ * * Finishes an operation started with mm_sim_send_puk(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_send_puk_finish (MMSim *self, @@ -393,7 +393,7 @@ * The calling thread is blocked until a reply is received. * See mm_sim_send_puk() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_send_puk_sync (MMSim *self, @@ -421,7 +421,7 @@ * * Finishes an operation started with mm_sim_enable_pin(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_enable_pin_finish (MMSim *self, @@ -477,7 +477,7 @@ * The calling thread is blocked until a reply is received. * See mm_sim_enable_pin() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_enable_pin_sync (MMSim *self, @@ -504,7 +504,7 @@ * * Finishes an operation started with mm_sim_disable_pin(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_disable_pin_finish (MMSim *self, @@ -560,7 +560,7 @@ * The calling thread is blocked until a reply is received. * See mm_sim_disable_pin() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_disable_pin_sync (MMSim *self, @@ -587,7 +587,7 @@ * * Finishes an operation started with mm_sim_change_pin(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_change_pin_finish (MMSim *self, @@ -646,7 +646,7 @@ * The calling thread is blocked until a reply is received. * See mm_sim_change_pin() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sim_change_pin_sync (MMSim *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-sim.h modemmanager-1.10.0/libmm-glib/mm-sim.h --- modemmanager-1.6.8/libmm-glib/mm-sim.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sim.h 2019-01-15 15:57:35.000000000 +0100 @@ -63,6 +63,10 @@ GType mm_sim_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSim, g_object_unref) +#endif + const gchar *mm_sim_get_path (MMSim *self); gchar *mm_sim_dup_path (MMSim *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-simple-connect-properties.c modemmanager-1.10.0/libmm-glib/mm-simple-connect-properties.c --- modemmanager-1.6.8/libmm-glib/mm-simple-connect-properties.c 2017-05-23 18:40:35.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-simple-connect-properties.c 2019-01-15 15:57:35.000000000 +0100 @@ -328,12 +328,17 @@ /*****************************************************************************/ +#ifndef MM_DISABLE_DEPRECATED + /** * mm_simple_connect_properties_set_number: * @self: a #MMSimpleConnectProperties. * @number: the number. * * Sets the number to use when performing the connection. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ void mm_simple_connect_properties_set_number (MMSimpleConnectProperties *self, @@ -341,8 +346,7 @@ { g_return_if_fail (MM_IS_SIMPLE_CONNECT_PROPERTIES (self)); - mm_bearer_properties_set_number (self->priv->bearer_properties, - number); + /* NO-OP */ } /** @@ -352,15 +356,21 @@ * Gets the number to use when performing the connection. * * Returns: (transfer none): the number, or #NULL if not set. Do not free the returned value, it is owned by @self. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ const gchar * mm_simple_connect_properties_get_number (MMSimpleConnectProperties *self) { g_return_val_if_fail (MM_IS_SIMPLE_CONNECT_PROPERTIES (self), NULL); - return mm_bearer_properties_get_number (self->priv->bearer_properties); + /* NO-OP */ + return NULL; } +#endif /* MM_DISABLE_DEPRECATED */ + /*****************************************************************************/ /** diff -Nru modemmanager-1.6.8/libmm-glib/mm-simple-connect-properties.h modemmanager-1.10.0/libmm-glib/mm-simple-connect-properties.h --- modemmanager-1.6.8/libmm-glib/mm-simple-connect-properties.h 2017-05-23 18:40:35.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-simple-connect-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -57,6 +57,10 @@ GType mm_simple_connect_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimpleConnectProperties, g_object_unref) +#endif + MMSimpleConnectProperties *mm_simple_connect_properties_new (void); void mm_simple_connect_properties_set_pin (MMSimpleConnectProperties *self, @@ -75,8 +79,6 @@ MMBearerIpFamily ip_type); void mm_simple_connect_properties_set_allow_roaming (MMSimpleConnectProperties *self, gboolean allow_roaming); -void mm_simple_connect_properties_set_number (MMSimpleConnectProperties *self, - const gchar *number); const gchar *mm_simple_connect_properties_get_pin (MMSimpleConnectProperties *self); const gchar *mm_simple_connect_properties_get_operator_id (MMSimpleConnectProperties *self); @@ -86,7 +88,14 @@ const gchar *mm_simple_connect_properties_get_password (MMSimpleConnectProperties *self); MMBearerIpFamily mm_simple_connect_properties_get_ip_type (MMSimpleConnectProperties *self); gboolean mm_simple_connect_properties_get_allow_roaming (MMSimpleConnectProperties *self); -const gchar *mm_simple_connect_properties_get_number (MMSimpleConnectProperties *self); + +#ifndef MM_DISABLE_DEPRECATED +G_DEPRECATED +void mm_simple_connect_properties_set_number (MMSimpleConnectProperties *self, + const gchar *number); +G_DEPRECATED +const gchar *mm_simple_connect_properties_get_number (MMSimpleConnectProperties *self); +#endif /*****************************************************************************/ /* ModemManager/libmm-glib/mmcli specific methods */ diff -Nru modemmanager-1.6.8/libmm-glib/mm-simple-status.h modemmanager-1.10.0/libmm-glib/mm-simple-status.h --- modemmanager-1.6.8/libmm-glib/mm-simple-status.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-simple-status.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,9 @@ GType mm_simple_status_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimpleStatus, g_object_unref) +#endif MMModemState mm_simple_status_get_state (MMSimpleStatus *self); guint32 mm_simple_status_get_signal_quality (MMSimpleStatus *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-sms.c modemmanager-1.10.0/libmm-glib/mm-sms.c --- modemmanager-1.6.8/libmm-glib/mm-sms.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sms.c 2018-11-15 09:55:53.000000000 +0100 @@ -131,7 +131,7 @@ * * Gets the message data. * - * Returns: (transfer none): The message data, or %NULL if it doesn't contain any (e.g. contains text instead). + * Returns: (transfer none) (array length=data_len) (element-type guint8): The message data, or %NULL if it doesn't contain any (e.g. contains text instead). */ const guint8 * mm_sms_get_data (MMSms *self, @@ -158,7 +158,7 @@ * * Gets the message data. * - * Returns: (transfer full): The message data, or %NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_free(). + * Returns: (transfer full) (array length=data_len) (element-type guint8): The message data, or %NULL if it doesn't contain any (e.g. contains text instead). The returned value should be freed with g_free(). */ guint8 * mm_sms_dup_data (MMSms *self, @@ -614,7 +614,7 @@ * * Finishes an operation started with mm_sms_send(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sms_send_finish (MMSms *self, @@ -669,7 +669,7 @@ * The calling thread is blocked until a reply is received. * See mm_sms_send() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sms_send_sync (MMSms *self, @@ -693,7 +693,7 @@ * * Finishes an operation started with mm_sms_store(). * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sms_store_finish (MMSms *self, @@ -752,7 +752,7 @@ * The calling thread is blocked until a reply is received. * See mm_sms_store() for the asynchronous version of this method. * - * Returns: %TRUE if the operation succeded, %FALSE if @error is set. + * Returns: %TRUE if the operation succeeded, %FALSE if @error is set. */ gboolean mm_sms_store_sync (MMSms *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-sms.h modemmanager-1.10.0/libmm-glib/mm-sms.h --- modemmanager-1.6.8/libmm-glib/mm-sms.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sms.h 2019-01-15 15:57:35.000000000 +0100 @@ -63,6 +63,10 @@ GType mm_sms_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSms, g_object_unref) +#endif + const gchar *mm_sms_get_path (MMSms *self); gchar *mm_sms_dup_path (MMSms *self); diff -Nru modemmanager-1.6.8/libmm-glib/mm-sms-properties.c modemmanager-1.10.0/libmm-glib/mm-sms-properties.c --- modemmanager-1.6.8/libmm-glib/mm-sms-properties.c 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sms-properties.c 2018-11-15 09:55:53.000000000 +0100 @@ -157,10 +157,10 @@ { g_return_val_if_fail (MM_IS_SMS_PROPERTIES (self), NULL); - if (self->priv->data && data_len) - *data_len = self->priv->data->len; + if (data_len) + *data_len = (self->priv->data ? self->priv->data->len : 0); - return self->priv->data->data; + return (self->priv->data ? self->priv->data->data : NULL); } /** diff -Nru modemmanager-1.6.8/libmm-glib/mm-sms-properties.h modemmanager-1.10.0/libmm-glib/mm-sms-properties.h --- modemmanager-1.6.8/libmm-glib/mm-sms-properties.h 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-sms-properties.h 2019-01-15 15:57:35.000000000 +0100 @@ -55,6 +55,10 @@ GType mm_sms_properties_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsProperties, g_object_unref) +#endif + MMSmsProperties *mm_sms_properties_new (void); void mm_sms_properties_set_text (MMSmsProperties *self, diff -Nru modemmanager-1.6.8/libmm-glib/mm-unlock-retries.h modemmanager-1.10.0/libmm-glib/mm-unlock-retries.h --- modemmanager-1.6.8/libmm-glib/mm-unlock-retries.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/mm-unlock-retries.h 2019-01-15 15:57:35.000000000 +0100 @@ -62,6 +62,10 @@ GType mm_unlock_retries_get_type (void); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMUnlockRetries, g_object_unref) +#endif + guint mm_unlock_retries_get (MMUnlockRetries *self, MMModemLock lock); diff -Nru modemmanager-1.6.8/libmm-glib/tests/Makefile.am modemmanager-1.10.0/libmm-glib/tests/Makefile.am --- modemmanager-1.6.8/libmm-glib/tests/Makefile.am 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/tests/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -3,13 +3,7 @@ AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) -noinst_PROGRAMS = test-common-helpers -TEST_PROGS += $(noinst_PROGRAMS) - -test_common_helpers_SOURCES = \ - test-common-helpers.c - -test_common_helpers_CPPFLAGS = \ +LIBMM_GLIB_TESTS_COMMON_CPPFLAGS = \ $(MM_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/include \ @@ -20,6 +14,19 @@ -I${top_builddir}/libmm-glib/generated \ -DLIBMM_GLIB_COMPILATION -test_common_helpers_LDADD = \ +LIBMM_GLIB_TESTS_COMMON_LDADD = \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(MM_LIBS) + +noinst_PROGRAMS = \ + test-common-helpers \ + test-pco +TEST_PROGS += $(noinst_PROGRAMS) + +test_common_helpers_SOURCES = test-common-helpers.c +test_common_helpers_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) +test_common_helpers_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) + +test_pco_SOURCES = test-pco.c +test_pco_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) +test_pco_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) diff -Nru modemmanager-1.6.8/libmm-glib/tests/Makefile.in modemmanager-1.10.0/libmm-glib/tests/Makefile.in --- modemmanager-1.6.8/libmm-glib/tests/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -88,21 +88,20 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = test-common-helpers$(EXEEXT) +noinst_PROGRAMS = test-common-helpers$(EXEEXT) test-pco$(EXEEXT) subdir = libmm-glib/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -115,12 +114,16 @@ test_common_helpers-test-common-helpers.$(OBJEXT) test_common_helpers_OBJECTS = $(am_test_common_helpers_OBJECTS) am__DEPENDENCIES_1 = -test_common_helpers_DEPENDENCIES = \ - $(top_builddir)/libmm-glib/libmm-glib.la $(am__DEPENDENCIES_1) +am__DEPENDENCIES_2 = $(top_builddir)/libmm-glib/libmm-glib.la \ + $(am__DEPENDENCIES_1) +test_common_helpers_DEPENDENCIES = $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +am_test_pco_OBJECTS = test_pco-test-pco.$(OBJEXT) +test_pco_OBJECTS = $(am_test_pco_OBJECTS) +test_pco_DEPENDENCIES = $(am__DEPENDENCIES_2) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -135,7 +138,10 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + ./$(DEPDIR)/test_common_helpers-test-common-helpers.Po \ + ./$(DEPDIR)/test_pco-test-pco.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -155,8 +161,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(test_common_helpers_SOURCES) -DIST_SOURCES = $(test_common_helpers_SOURCES) +SOURCES = $(test_common_helpers_SOURCES) $(test_pco_SOURCES) +DIST_SOURCES = $(test_common_helpers_SOURCES) $(test_pco_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -185,7 +191,6 @@ $(top_srcdir)/gtester.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -238,14 +243,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -366,8 +363,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -395,10 +390,7 @@ TEST_PROGS = $(noinst_PROGRAMS) AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) -test_common_helpers_SOURCES = \ - test-common-helpers.c - -test_common_helpers_CPPFLAGS = \ +LIBMM_GLIB_TESTS_COMMON_CPPFLAGS = \ $(MM_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/include \ @@ -409,10 +401,16 @@ -I${top_builddir}/libmm-glib/generated \ -DLIBMM_GLIB_COMPILATION -test_common_helpers_LDADD = \ +LIBMM_GLIB_TESTS_COMMON_LDADD = \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(MM_LIBS) +test_common_helpers_SOURCES = test-common-helpers.c +test_common_helpers_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) +test_common_helpers_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) +test_pco_SOURCES = test-pco.c +test_pco_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) +test_pco_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) all: all-am .SUFFIXES: @@ -434,8 +432,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtester.make $(am__empty): @@ -461,13 +459,24 @@ @rm -f test-common-helpers$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_common_helpers_OBJECTS) $(test_common_helpers_LDADD) $(LIBS) +test-pco$(EXEEXT): $(test_pco_OBJECTS) $(test_pco_DEPENDENCIES) $(EXTRA_test_pco_DEPENDENCIES) + @rm -f test-pco$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_pco_OBJECTS) $(test_pco_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common_helpers-test-common-helpers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common_helpers-test-common-helpers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pco-test-pco.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -507,6 +516,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_common_helpers_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_common_helpers-test-common-helpers.obj `if test -f 'test-common-helpers.c'; then $(CYGPATH_W) 'test-common-helpers.c'; else $(CYGPATH_W) '$(srcdir)/test-common-helpers.c'; fi` +test_pco-test-pco.o: test-pco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_pco_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_pco-test-pco.o -MD -MP -MF $(DEPDIR)/test_pco-test-pco.Tpo -c -o test_pco-test-pco.o `test -f 'test-pco.c' || echo '$(srcdir)/'`test-pco.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_pco-test-pco.Tpo $(DEPDIR)/test_pco-test-pco.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-pco.c' object='test_pco-test-pco.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_pco_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_pco-test-pco.o `test -f 'test-pco.c' || echo '$(srcdir)/'`test-pco.c + +test_pco-test-pco.obj: test-pco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_pco_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_pco-test-pco.obj -MD -MP -MF $(DEPDIR)/test_pco-test-pco.Tpo -c -o test_pco-test-pco.obj `if test -f 'test-pco.c'; then $(CYGPATH_W) 'test-pco.c'; else $(CYGPATH_W) '$(srcdir)/test-pco.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_pco-test-pco.Tpo $(DEPDIR)/test_pco-test-pco.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-pco.c' object='test_pco-test-pco.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_pco_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_pco-test-pco.obj `if test -f 'test-pco.c'; then $(CYGPATH_W) 'test-pco.c'; else $(CYGPATH_W) '$(srcdir)/test-pco.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -565,7 +588,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -636,7 +662,8 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test_common_helpers-test-common-helpers.Po + -rm -f ./$(DEPDIR)/test_pco-test-pco.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -682,7 +709,8 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test_common_helpers-test-common-helpers.Po + -rm -f ./$(DEPDIR)/test_pco-test-pco.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -703,19 +731,19 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru modemmanager-1.6.8/libmm-glib/tests/test-common-helpers.c modemmanager-1.10.0/libmm-glib/tests/test-common-helpers.c --- modemmanager-1.6.8/libmm-glib/tests/test-common-helpers.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libmm-glib/tests/test-common-helpers.c 2018-11-15 09:55:53.000000000 +0100 @@ -490,7 +490,6 @@ int main (int argc, char **argv) { - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/Common/KeyValue/standard", key_value_test_standard); diff -Nru modemmanager-1.6.8/libmm-glib/tests/test-pco.c modemmanager-1.10.0/libmm-glib/tests/test-pco.c --- modemmanager-1.6.8/libmm-glib/tests/test-pco.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libmm-glib/tests/test-pco.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright 2018 Google LLC. + */ + +#include +#include +#include + +typedef struct { + guint32 session_id; + gboolean is_complete; + gsize pco_data_size; + guint8 pco_data[50]; +} TestPco; + +static const TestPco test_pco_list[] = { + { 3, TRUE, 8, { 0x27, 0x06, 0x80, 0x00, 0x10, 0x02, 0x05, 0x94 } }, + { 1, FALSE, 3, { 0x27, 0x01, 0x80 } }, + { 5, FALSE, 10, { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, + { 4, TRUE, 14, { 0x27, 0x0C, 0x80, 0x10, 0x02, 0x05, 0x94, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, + { 3, FALSE, 10, { 0x27, 0x08, 0x80, 0x00, 0x0D, 0x04, 0xC6, 0xE0, 0xAD, 0x87 } }, +}; + +static const TestPco expected_pco_list[] = { + { 1, FALSE, 3, { 0x27, 0x01, 0x80 } }, + { 3, FALSE, 10, { 0x27, 0x08, 0x80, 0x00, 0x0D, 0x04, 0xC6, 0xE0, 0xAD, 0x87 } }, + { 4, TRUE, 14, { 0x27, 0x0C, 0x80, 0x10, 0x02, 0x05, 0x94, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, + { 5, FALSE, 10, { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, +}; + +static void +test_pco_list_add (void) +{ + GList *list = NULL; + guint i; + + for (i = 0; i < G_N_ELEMENTS (test_pco_list); ++i) { + const TestPco *test_pco = &test_pco_list[i]; + MMPco *pco; + + pco = mm_pco_new (); + mm_pco_set_session_id (pco, test_pco->session_id); + mm_pco_set_complete (pco, test_pco->is_complete); + mm_pco_set_data (pco, test_pco->pco_data, test_pco->pco_data_size); + list = mm_pco_list_add (list, pco); + } + + g_assert (list != NULL); + g_assert_cmpuint (g_list_length (list), ==, G_N_ELEMENTS (expected_pco_list)); + + for (i = 0; i < G_N_ELEMENTS (expected_pco_list); ++i) { + GList *current; + MMPco *pco; + const TestPco *expected_pco; + gsize pco_data_size; + const guint8 *pco_data; + + current = g_list_nth (list, i); + pco = current->data; + expected_pco = &expected_pco_list[i]; + + g_assert (pco != NULL); + g_assert_cmpuint (mm_pco_get_session_id (pco), ==, expected_pco->session_id); + g_assert (mm_pco_is_complete (pco) == expected_pco->is_complete); + pco_data = mm_pco_get_data (pco, &pco_data_size); + g_assert (pco_data != NULL); + g_assert_cmpuint (pco_data_size, ==, expected_pco->pco_data_size); + g_assert_cmpint (memcmp (pco_data, expected_pco->pco_data, pco_data_size), ==, 0); + } + + mm_pco_list_free (list); +} + +/**************************************************************/ + +int main (int argc, char **argv) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/Pco/pco-list-add", test_pco_list_add); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/libqcdm/Makefile.in modemmanager-1.10.0/libqcdm/Makefile.in --- modemmanager-1.6.8/libqcdm/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -142,7 +141,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,7 +190,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -244,14 +242,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -372,8 +362,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -414,8 +402,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,7 +520,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/libqcdm/src/commands.c modemmanager-1.10.0/libqcdm/src/commands.c --- modemmanager-1.6.8/libqcdm/src/commands.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/commands.c 2018-11-15 09:55:53.000000000 +0100 @@ -29,8 +29,8 @@ /**********************************************************************/ -static u_int8_t -cdma_prev_to_qcdm (u_int8_t cdma) +static uint8_t +cdma_prev_to_qcdm (uint8_t cdma) { switch (cdma) { case CDMA_PREV_IS_95: @@ -53,8 +53,8 @@ return QCDM_CDMA_PREV_UNKNOWN; } -static u_int8_t -cdma_band_class_to_qcdm (u_int8_t cdma) +static uint8_t +cdma_band_class_to_qcdm (uint8_t cdma) { switch (cdma) { case CDMA_BAND_CLASS_0_CELLULAR_800: @@ -103,8 +103,8 @@ return QCDM_CDMA_BAND_CLASS_UNKNOWN; } -static u_int8_t -nv_mode_pref_from_qcdm (u_int8_t qcdm) +static uint8_t +nv_mode_pref_from_qcdm (uint8_t qcdm) { switch (qcdm) { case QCDM_CMD_NV_MODE_PREF_ITEM_MODE_PREF_DIGITAL: @@ -152,7 +152,7 @@ * */ static char * -bin2hexstr (const u_int8_t *bytes, int len) +bin2hexstr (const uint8_t *bytes, int len) { static char hex_digits[] = "0123456789abcdef"; char *result; @@ -178,7 +178,7 @@ /**********************************************************************/ static qcdmbool -check_command (const char *buf, size_t len, u_int8_t cmd, size_t min_len, int *out_error) +check_command (const char *buf, size_t len, uint8_t cmd, size_t min_len, int *out_error) { if (len < 1) { qcdm_err (0, "DM command response malformed (must be at least 1 byte in length)"); @@ -241,7 +241,7 @@ } static int -nv_status_to_qcdm_error (u_int16_t status) +nv_status_to_qcdm_error (uint16_t status) { switch (status) { case DIAG_NV_STATUS_OK: @@ -266,9 +266,9 @@ } static qcdmbool -check_nv_cmd (DMCmdNVReadWrite *cmd, u_int16_t nv_item, int *out_error) +check_nv_cmd (DMCmdNVReadWrite *cmd, uint16_t nv_item, int *out_error) { - u_int16_t cmd_item; + uint16_t cmd_item; qcdm_return_val_if_fail (cmd != NULL, FALSE); qcdm_return_val_if_fail ((cmd->code == DIAG_CMD_NV_READ) || (cmd->code == DIAG_CMD_NV_WRITE), FALSE); @@ -375,7 +375,7 @@ QcdmResult *result = NULL; DMCmdEsnRsp *rsp = (DMCmdEsnRsp *) buf; char *tmp; - u_int8_t swapped[4]; + uint8_t swapped[4]; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -403,7 +403,7 @@ /**********************************************************************/ size_t -qcdm_cmd_control_new (char *buf, size_t len, u_int8_t mode) +qcdm_cmd_control_new (char *buf, size_t len, uint8_t mode) { char cmdbuf[5]; DMCmdControl *cmd = (DMCmdControl *) &cmdbuf[0]; @@ -413,7 +413,7 @@ memset (cmd, 0, sizeof (*cmd)); cmd->code = DIAG_CMD_CONTROL; - cmd->mode = htole16 ((u_int16_t) mode); + cmd->mode = htole16 ((uint16_t) mode); return dm_encapsulate_buffer (cmdbuf, sizeof (*cmd), sizeof (cmdbuf), buf, len); } @@ -452,8 +452,8 @@ QcdmResult *result = NULL; DMCmdStatusRsp *rsp = (DMCmdStatusRsp *) buf; char *tmp; - u_int8_t swapped[4]; - u_int32_t tmp_num; + uint8_t swapped[4]; + uint32_t tmp_num; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -474,27 +474,27 @@ qcdm_result_add_string (result, QCDM_CMD_CDMA_STATUS_ITEM_ESN, tmp); free (tmp); - tmp_num = (u_int32_t) le16toh (rsp->rf_mode); + tmp_num = (uint32_t) le16toh (rsp->rf_mode); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_RF_MODE, tmp_num); - tmp_num = (u_int32_t) le16toh (rsp->cdma_rx_state); + tmp_num = (uint32_t) le16toh (rsp->cdma_rx_state); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_RX_STATE, tmp_num); - tmp_num = (u_int32_t) le16toh (rsp->entry_reason); + tmp_num = (uint32_t) le16toh (rsp->entry_reason); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_ENTRY_REASON, tmp_num); - tmp_num = (u_int32_t) le16toh (rsp->curr_chan); + tmp_num = (uint32_t) le16toh (rsp->curr_chan); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_CURRENT_CHANNEL, tmp_num); qcdm_result_add_u8 (result, QCDM_CMD_CDMA_STATUS_ITEM_CODE_CHANNEL, rsp->cdma_code_chan); - tmp_num = (u_int32_t) le16toh (rsp->pilot_base); + tmp_num = (uint32_t) le16toh (rsp->pilot_base); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_PILOT_BASE, tmp_num); - tmp_num = (u_int32_t) le16toh (rsp->sid); + tmp_num = (uint32_t) le16toh (rsp->sid); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_SID, tmp_num); - tmp_num = (u_int32_t) le16toh (rsp->nid); + tmp_num = (uint32_t) le16toh (rsp->nid); qcdm_result_add_u32 (result, QCDM_CMD_CDMA_STATUS_ITEM_NID, tmp_num); return result; @@ -566,15 +566,15 @@ return dm_encapsulate_buffer (cmdbuf, sizeof (*cmd), sizeof (cmdbuf), buf, len); } -static u_int8_t -snapshot_state_to_qcdm (u_int8_t cdma_state) +static uint8_t +snapshot_state_to_qcdm (uint8_t cdma_state) { /* CDMA_STATUS_SNAPSHOT_STATE_* -> QCDM_STATUS_SNAPSHOT_STATE_* */ return cdma_state + 1; } -static inline u_int8_t -digit_fixup (u_int8_t d) +static inline uint8_t +digit_fixup (uint8_t d) { /* CDMA MCC/IMSI conversion adds 1 to each digit, and digits equal to * 10 are really zero. @@ -590,9 +590,9 @@ QcdmResult *result = NULL; DMCmdStatusSnapshotRsp *rsp = (DMCmdStatusSnapshotRsp *) buf; char *tmp; - u_int8_t swapped[4]; - u_int8_t tmcc[3]; - u_int16_t mcc, hmcc; + uint8_t swapped[4]; + uint8_t tmcc[3]; + uint16_t mcc, hmcc; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -653,7 +653,7 @@ #define PILOT_SETS_CMD_NEIGHBOR_SET "neighbor-set" static const char * -set_num_to_str (u_int32_t num) +set_num_to_str (uint32_t num) { if (num == QCDM_CMD_PILOT_SETS_TYPE_ACTIVE) return PILOT_SETS_CMD_ACTIVE_SET; @@ -682,7 +682,7 @@ if (sets_len > 0) { qcdm_result_add_u8_array (result, PILOT_SETS_CMD_ACTIVE_SET, - (const u_int8_t *) &rsp->sets[0], + (const uint8_t *) &rsp->sets[0], sets_len); } @@ -690,7 +690,7 @@ if (sets_len > 0) { qcdm_result_add_u8_array (result, PILOT_SETS_CMD_CANDIDATE_SET, - (const u_int8_t *) &rsp->sets[rsp->active_count], + (const uint8_t *) &rsp->sets[rsp->active_count], sets_len); } @@ -698,7 +698,7 @@ if (sets_len > 0) { qcdm_result_add_u8_array (result, PILOT_SETS_CMD_NEIGHBOR_SET, - (const u_int8_t *) &rsp->sets[rsp->active_count + rsp->candidate_count], + (const uint8_t *) &rsp->sets[rsp->active_count + rsp->candidate_count], sets_len); } @@ -707,11 +707,11 @@ qcdmbool qcdm_cmd_pilot_sets_result_get_num (QcdmResult *result, - u_int32_t set_type, - u_int32_t *out_num) + uint32_t set_type, + uint32_t *out_num) { const char *set_name; - const u_int8_t *array = NULL; + const uint8_t *array = NULL; size_t array_len = 0; qcdm_return_val_if_fail (result != NULL, FALSE); @@ -728,15 +728,15 @@ qcdmbool qcdm_cmd_pilot_sets_result_get_pilot (QcdmResult *result, - u_int32_t set_type, - u_int32_t num, - u_int32_t *out_pn_offset, - u_int32_t *out_ecio, + uint32_t set_type, + uint32_t num, + uint32_t *out_pn_offset, + uint32_t *out_ecio, float *out_db) { const char *set_name; DMCmdPilotSetsSet *set; - const u_int8_t *array = NULL; + const uint8_t *array = NULL; size_t array_len = 0; qcdm_return_val_if_fail (result != NULL, FALSE); @@ -760,7 +760,7 @@ /**********************************************************************/ size_t -qcdm_cmd_nv_get_mdn_new (char *buf, size_t len, u_int8_t profile) +qcdm_cmd_nv_get_mdn_new (char *buf, size_t len, uint8_t profile) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -812,7 +812,7 @@ /**********************************************************************/ static qcdmbool -roam_pref_validate (u_int8_t dm) +roam_pref_validate (uint8_t dm) { if ( dm == DIAG_NV_ROAM_PREF_HOME_ONLY || dm == DIAG_NV_ROAM_PREF_ROAM_ONLY @@ -822,7 +822,7 @@ } size_t -qcdm_cmd_nv_get_roam_pref_new (char *buf, size_t len, u_int8_t profile) +qcdm_cmd_nv_get_roam_pref_new (char *buf, size_t len, uint8_t profile) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -873,8 +873,8 @@ size_t qcdm_cmd_nv_set_roam_pref_new (char *buf, size_t len, - u_int8_t profile, - u_int8_t roam_pref) + uint8_t profile, + uint8_t roam_pref) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -916,7 +916,7 @@ /**********************************************************************/ size_t -qcdm_cmd_nv_get_mode_pref_new (char *buf, size_t len, u_int8_t profile) +qcdm_cmd_nv_get_mode_pref_new (char *buf, size_t len, uint8_t profile) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -962,8 +962,8 @@ size_t qcdm_cmd_nv_set_mode_pref_new (char *buf, size_t len, - u_int8_t profile, - u_int8_t mode_pref) + uint8_t profile, + uint8_t mode_pref) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -1044,7 +1044,7 @@ size_t qcdm_cmd_nv_set_hybrid_pref_new (char *buf, size_t len, - u_int8_t hybrid_pref) + uint8_t hybrid_pref) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -1132,7 +1132,7 @@ size_t qcdm_cmd_nv_set_ipv6_enabled_new (char *buf, size_t len, - u_int8_t enabled) + uint8_t enabled) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -1176,7 +1176,7 @@ /**********************************************************************/ static qcdmbool -hdr_rev_pref_validate (u_int8_t dm) +hdr_rev_pref_validate (uint8_t dm) { if ( dm == DIAG_NV_HDR_REV_PREF_0 || dm == DIAG_NV_HDR_REV_PREF_A @@ -1232,7 +1232,7 @@ size_t qcdm_cmd_nv_set_hdr_rev_pref_new (char *buf, size_t len, - u_int8_t rev_pref) + uint8_t rev_pref) { char cmdbuf[sizeof (DMCmdNVReadWrite) + 2]; DMCmdNVReadWrite *cmd = (DMCmdNVReadWrite *) &cmdbuf[0]; @@ -1294,15 +1294,15 @@ { QcdmResult *result = NULL; DMCmdSubsysCMStateInfoRsp *rsp = (DMCmdSubsysCMStateInfoRsp *) buf; - u_int32_t tmp_num; - u_int32_t roam_pref; + uint32_t tmp_num; + uint32_t roam_pref; qcdm_return_val_if_fail (buf != NULL, NULL); if (!check_command (buf, len, DIAG_CMD_SUBSYS, sizeof (DMCmdSubsysCMStateInfoRsp), out_error)) return NULL; - roam_pref = (u_int32_t) le32toh (rsp->roam_pref); + roam_pref = (uint32_t) le32toh (rsp->roam_pref); if (!roam_pref_validate (roam_pref)) { qcdm_err (0, "Unknown roam preference 0x%X", roam_pref); return NULL; @@ -1310,33 +1310,33 @@ result = qcdm_result_new (); - tmp_num = (u_int32_t) le32toh (rsp->call_state); + tmp_num = (uint32_t) le32toh (rsp->call_state); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_CALL_STATE, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->oper_mode); + tmp_num = (uint32_t) le32toh (rsp->oper_mode); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_OPERATING_MODE, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->system_mode); + tmp_num = (uint32_t) le32toh (rsp->system_mode); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SYSTEM_MODE, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->mode_pref); + tmp_num = (uint32_t) le32toh (rsp->mode_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_MODE_PREF, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->band_pref); + tmp_num = (uint32_t) le32toh (rsp->band_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_BAND_PREF, tmp_num); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_ROAM_PREF, roam_pref); - tmp_num = (u_int32_t) le32toh (rsp->srv_domain_pref); + tmp_num = (uint32_t) le32toh (rsp->srv_domain_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SERVICE_DOMAIN_PREF, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->acq_order_pref); + tmp_num = (uint32_t) le32toh (rsp->acq_order_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_ACQ_ORDER_PREF, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->hybrid_pref); + tmp_num = (uint32_t) le32toh (rsp->hybrid_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_HYBRID_PREF, tmp_num); - tmp_num = (u_int32_t) le32toh (rsp->network_sel_mode_pref); + tmp_num = (uint32_t) le32toh (rsp->network_sel_mode_pref); qcdm_result_add_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_NETWORK_SELECTION_PREF, tmp_num); return result; @@ -1392,14 +1392,14 @@ size_t qcdm_cmd_ext_logmask_new (char *buf, size_t len, - u_int32_t items[], - u_int16_t maxlog) + uint32_t items[], + uint16_t maxlog) { char cmdbuf[sizeof (DMCmdExtLogMask) + 2]; DMCmdExtLogMask *cmd = (DMCmdExtLogMask *) &cmdbuf[0]; - u_int16_t highest = 0; + uint16_t highest = 0; size_t total = 3; - u_int32_t i; + uint32_t i; qcdm_return_val_if_fail (buf != NULL, 0); qcdm_return_val_if_fail (len >= sizeof (*cmd) + DIAG_TRAILER_LEN, 0); @@ -1432,7 +1432,7 @@ { QcdmResult *result = NULL; DMCmdExtLogMask *rsp = (DMCmdExtLogMask *) buf; - u_int32_t masklen = 0, maxlog = 0; + uint32_t masklen = 0, maxlog = 0; size_t minlen = 0; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -1479,7 +1479,7 @@ qcdmbool qcmd_cmd_ext_logmask_result_get_item (QcdmResult *result, - u_int16_t item) + uint16_t item) { return FALSE; } @@ -1555,7 +1555,7 @@ size_t qcdm_cmd_nw_subsys_modem_snapshot_cdma_new (char *buf, size_t len, - u_int8_t chipset) + uint8_t chipset) { char cmdbuf[sizeof (DMCmdSubsysNwSnapshotReq) + 2]; DMCmdSubsysNwSnapshotReq *cmd = (DMCmdSubsysNwSnapshotReq *) &cmdbuf[0]; @@ -1594,8 +1594,8 @@ QcdmResult *result = NULL; DMCmdSubsysNwSnapshotRsp *rsp = (DMCmdSubsysNwSnapshotRsp *) buf; DMCmdSubsysNwSnapshotCdma *cdma = (DMCmdSubsysNwSnapshotCdma *) &rsp->data; - u_int32_t num; - u_int8_t num8; + uint32_t num; + uint8_t num8; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -1638,7 +1638,7 @@ size_t qcdm_cmd_nw_subsys_eri_new (char *buf, size_t len, - u_int8_t chipset) + uint8_t chipset) { char cmdbuf[sizeof (DMCmdSubsysHeader) + 2]; DMCmdSubsysHeader *cmd = (DMCmdSubsysHeader *) &cmdbuf[0]; @@ -1708,16 +1708,16 @@ static size_t qcdm_cmd_log_config_new (char *buf, size_t len, - u_int32_t op, - u_int32_t equip_id, - u_int16_t items[]) + uint32_t op, + uint32_t equip_id, + uint16_t items[]) { DMCmdLogConfig *cmd; - u_int16_t highest = 0; - u_int32_t items_len = 0; + uint16_t highest = 0; + uint32_t items_len = 0; size_t cmdsize = 0, cmdbufsize; - u_int32_t i; - u_int16_t log_code; + uint32_t i; + uint16_t log_code; qcdm_return_val_if_fail (buf != NULL, 0); qcdm_return_val_if_fail ((equip_id & 0xFFF0) == 0, 0); @@ -1757,7 +1757,7 @@ size_t qcdm_cmd_log_config_get_mask_new (char *buf, size_t len, - u_int32_t equip_id) + uint32_t equip_id) { return qcdm_cmd_log_config_new (buf, len, @@ -1767,7 +1767,7 @@ } static int -check_log_config_respose (const char *buf, size_t len, u_int32_t op) +check_log_config_respose (const char *buf, size_t len, uint32_t op) { DMCmdLogConfigRsp *rsp = (DMCmdLogConfigRsp *) buf; size_t minlen = 16; /* minimum valid resposne */ @@ -1781,7 +1781,7 @@ } if (rsp->code == DIAG_CMD_LOG_CONFIG) { - u_int32_t rspop; + uint32_t rspop; if (len < 16) { /* At least enough for code + op + result + equipid */ @@ -1833,13 +1833,13 @@ #define LOG_CODE_SET(mask, code) (mask[code / 8] & (1 << (code % 8))) static QcdmResult * -log_config_get_set_result (const char *buf, size_t len, u_int32_t op, int *out_error) +log_config_get_set_result (const char *buf, size_t len, uint32_t op, int *out_error) { QcdmResult *result = NULL; DMCmdLogConfigRsp *rsp = (DMCmdLogConfigRsp *) buf; int err; - u_int32_t num_items; - u_int32_t equipid; + uint32_t num_items; + uint32_t equipid; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -1859,8 +1859,8 @@ qcdm_result_add_u32 (result, QCDM_CMD_LOG_CONFIG_MASK_ITEM_NUM_ITEMS, num_items); if (num_items > 0) { - u_int32_t i, num_result_items = 0, count = 0; - u_int16_t *items; + uint32_t i, num_result_items = 0, count = 0; + uint16_t *items; /* First pass to find out how many are actually enabled */ for (i = 0; i < num_items; i++) { @@ -1893,8 +1893,8 @@ size_t qcdm_cmd_log_config_set_mask_new (char *buf, size_t len, - u_int32_t equip_id, - u_int16_t items[]) + uint32_t equip_id, + uint16_t items[]) { return qcdm_cmd_log_config_new (buf, len, @@ -1911,12 +1911,12 @@ qcdmbool qcmd_cmd_log_config_mask_result_code_set (QcdmResult *result, - u_int32_t equipid, - u_int16_t log_code) + uint32_t equipid, + uint16_t log_code) { - const u_int16_t *items = NULL; + const uint16_t *items = NULL; size_t len = 0; - u_int32_t i, tmp; + uint32_t i, tmp; qcdm_return_val_if_fail (result != NULL, FALSE); @@ -1941,10 +1941,10 @@ static char bcd_chars[] = "0123456789\0\0\0\0\0\0"; static qcdmbool -imxi_bcd_to_string (u_int8_t bytes[8], size_t len, char *buf, size_t buflen) +imxi_bcd_to_string (uint8_t bytes[8], size_t len, char *buf, size_t buflen) { char *p; - u_int32_t i; + uint32_t i; if (bytes[0] == 0) return TRUE; @@ -2042,8 +2042,8 @@ QcdmResult *result = NULL; DMCmdSubsysGsmStateInfoRsp *rsp = (DMCmdSubsysGsmStateInfoRsp *) buf; char imxi[18]; - u_int32_t mcc = 0, mnc = 0; - u_int8_t mnc3; + uint32_t mcc = 0, mnc = 0; + uint8_t mnc3; qcdm_return_val_if_fail (buf != NULL, NULL); @@ -2090,4 +2090,3 @@ } /**********************************************************************/ - diff -Nru modemmanager-1.6.8/libqcdm/src/commands.h modemmanager-1.10.0/libqcdm/src/commands.h --- modemmanager-1.6.8/libqcdm/src/commands.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/commands.h 2018-11-15 09:55:53.000000000 +0100 @@ -110,7 +110,7 @@ QCDM_CMD_CONTROL_MODE_RESET = 2, }; -size_t qcdm_cmd_control_new (char *buf, size_t len, u_int8_t mode); +size_t qcdm_cmd_control_new (char *buf, size_t len, uint8_t mode); QcdmResult *qcdm_cmd_control_result (const char *buf, size_t len, @@ -236,14 +236,14 @@ int *out_error); qcdmbool qcdm_cmd_pilot_sets_result_get_num (QcdmResult *result, - u_int32_t set_type, - u_int32_t *out_num); + uint32_t set_type, + uint32_t *out_num); qcdmbool qcdm_cmd_pilot_sets_result_get_pilot (QcdmResult *result, - u_int32_t set_type, - u_int32_t num, - u_int32_t *out_pn_offset, - u_int32_t *out_ecio, + uint32_t set_type, + uint32_t num, + uint32_t *out_pn_offset, + uint32_t *out_ecio, float *out_db); /**********************************************************************/ @@ -251,7 +251,7 @@ #define QCDM_CMD_NV_GET_MDN_ITEM_PROFILE "profile" #define QCDM_CMD_NV_GET_MDN_ITEM_MDN "mdn" -size_t qcdm_cmd_nv_get_mdn_new (char *buf, size_t len, u_int8_t profile); +size_t qcdm_cmd_nv_get_mdn_new (char *buf, size_t len, uint8_t profile); QcdmResult *qcdm_cmd_nv_get_mdn_result (const char *buf, size_t len, @@ -271,7 +271,7 @@ size_t qcdm_cmd_nv_get_roam_pref_new (char *buf, size_t len, - u_int8_t profile); + uint8_t profile); QcdmResult *qcdm_cmd_nv_get_roam_pref_result (const char *buf, size_t len, @@ -279,8 +279,8 @@ size_t qcdm_cmd_nv_set_roam_pref_new (char *buf, size_t len, - u_int8_t profile, - u_int8_t roam_pref); + uint8_t profile, + uint8_t roam_pref); QcdmResult *qcdm_cmd_nv_set_roam_pref_result (const char *buf, size_t len, @@ -311,7 +311,7 @@ size_t qcdm_cmd_nv_get_mode_pref_new (char *buf, size_t len, - u_int8_t profile); + uint8_t profile); QcdmResult *qcdm_cmd_nv_get_mode_pref_result (const char *buf, size_t len, @@ -319,8 +319,8 @@ size_t qcdm_cmd_nv_set_mode_pref_new (char *buf, size_t len, - u_int8_t profile, - u_int8_t mode_pref); + uint8_t profile, + uint8_t mode_pref); QcdmResult *qcdm_cmd_nv_set_mode_pref_result (const char *buf, size_t len, @@ -343,7 +343,7 @@ size_t qcdm_cmd_nv_set_hybrid_pref_new (char *buf, size_t len, - u_int8_t hybrid_pref); + uint8_t hybrid_pref); QcdmResult *qcdm_cmd_nv_set_hybrid_pref_result (const char *buf, size_t len, @@ -366,7 +366,7 @@ size_t qcdm_cmd_nv_set_ipv6_enabled_new (char *buf, size_t len, - u_int8_t enabled); + uint8_t enabled); QcdmResult *qcdm_cmd_nv_set_ipv6_enabled_result (const char *buf, size_t len, @@ -391,7 +391,7 @@ size_t qcdm_cmd_nv_set_hdr_rev_pref_new (char *buf, size_t len, - u_int8_t rev_pref); + uint8_t rev_pref); QcdmResult *qcdm_cmd_nv_set_hdr_rev_pref_result (const char *buf, size_t len, @@ -568,8 +568,8 @@ size_t qcdm_cmd_ext_logmask_new (char *buf, size_t len, - u_int32_t items[], /* terminated by 0 */ - u_int16_t maxlog); + uint32_t items[], /* terminated by 0 */ + uint16_t maxlog); QcdmResult *qcdm_cmd_ext_logmask_result (const char *buf, size_t len, @@ -577,7 +577,7 @@ /* Returns TRUE if 'item' is set in the log mask */ qcdmbool qcmd_cmd_ext_logmask_result_get_item (QcdmResult *result, - u_int16_t item); + uint16_t item); /**********************************************************************/ @@ -593,12 +593,12 @@ size_t qcdm_cmd_log_config_get_mask_new (char *buf, size_t len, - u_int32_t equip_id); + uint32_t equip_id); size_t qcdm_cmd_log_config_set_mask_new (char *buf, size_t len, - u_int32_t equip_id, - u_int16_t items[]); + uint32_t equip_id, + uint16_t items[]); #define QCDM_CMD_LOG_CONFIG_MASK_ITEM_EQUIP_ID "equip-id" @@ -615,8 +615,8 @@ int *out_error); qcdmbool qcmd_cmd_log_config_mask_result_code_set (QcdmResult *result, - u_int32_t equipid, - u_int16_t log_code); + uint32_t equipid, + uint16_t log_code); /**********************************************************************/ @@ -651,7 +651,7 @@ size_t qcdm_cmd_nw_subsys_modem_snapshot_cdma_new (char *buf, size_t len, - u_int8_t chipset); + uint8_t chipset); QcdmResult *qcdm_cmd_nw_subsys_modem_snapshot_cdma_result (const char *buf, size_t len, @@ -677,7 +677,7 @@ size_t qcdm_cmd_nw_subsys_eri_new (char *buf, size_t len, - u_int8_t chipset); + uint8_t chipset); QcdmResult *qcdm_cmd_nw_subsys_eri_result (const char *buf, size_t len, diff -Nru modemmanager-1.6.8/libqcdm/src/dm-commands.h modemmanager-1.10.0/libqcdm/src/dm-commands.h --- modemmanager-1.6.8/libqcdm/src/dm-commands.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/dm-commands.h 2018-11-15 09:55:53.000000000 +0100 @@ -55,12 +55,12 @@ DIAG_CMD_NV_READ = 38, /* Read NV item */ DIAG_CMD_NV_WRITE = 39, /* Write NV item */ DIAG_CMD_CONTROL = 41, /* Mode change request */ - DIAG_CMD_ERR_READ = 42, /* Error record retreival */ + DIAG_CMD_ERR_READ = 42, /* Error record retrieval */ DIAG_CMD_ERR_CLEAR = 43, /* Error record clear */ DIAG_CMD_SER_RESET = 44, /* Symbol error rate counter reset */ DIAG_CMD_SER_REPORT = 45, /* Symbol error rate counter report */ DIAG_CMD_TEST = 46, /* Run a specified test */ - DIAG_CMD_GET_DIPSW = 47, /* Retreive the current DIP switch setting */ + DIAG_CMD_GET_DIPSW = 47, /* Retrieve the current DIP switch setting */ DIAG_CMD_SET_DIPSW = 48, /* Write new DIP switch setting */ DIAG_CMD_VOC_PCM_LB = 49, /* Start/Stop Vocoder PCM loopback */ DIAG_CMD_VOC_PKT_LB = 50, /* Start/Stop Vocoder PKT loopback */ @@ -236,15 +236,15 @@ /* Generic DM command header */ struct DMCmdHeader { - u_int8_t code; + uint8_t code; } __attribute__ ((packed)); typedef struct DMCmdHeader DMCmdHeader; /* DIAG_CMD_SUBSYS */ struct DMCmdSubsysHeader { - u_int8_t code; - u_int8_t subsys_id; - u_int16_t subsys_cmd; + uint8_t code; + uint8_t subsys_id; + uint16_t subsys_cmd; } __attribute__ ((packed)); typedef struct DMCmdSubsysHeader DMCmdSubsysHeader; @@ -255,82 +255,82 @@ /* DIAG_CMD_CONTROL */ struct DMCmdControl { - u_int8_t code; + uint8_t code; /* DMControlMode */ - u_int16_t mode; + uint16_t mode; } __attribute__ ((packed)); typedef struct DMCmdControl DMCmdControl; /* DIAG_CMD_NV_READ / DIAG_CMD_NV_WRITE */ struct DMCmdNVReadWrite { - u_int8_t code; - u_int16_t nv_item; - u_int8_t data[128]; - u_int16_t status; + uint8_t code; + uint16_t nv_item; + uint8_t data[128]; + uint16_t status; } __attribute__ ((packed)); typedef struct DMCmdNVReadWrite DMCmdNVReadWrite; /* DIAG_CMD_VERSION_INFO */ struct DMCmdVersionInfoRsp { - u_int8_t code; + uint8_t code; char comp_date[11]; char comp_time[8]; char rel_date[11]; char rel_time[8]; char model[8]; - u_int8_t scm; - u_int8_t mob_cai_rev; - u_int8_t mob_model; - u_int16_t mob_firmware_rev; - u_int8_t slot_cycle_index; - u_int8_t msm_ver; - u_int8_t _unknown; + uint8_t scm; + uint8_t mob_cai_rev; + uint8_t mob_model; + uint16_t mob_firmware_rev; + uint8_t slot_cycle_index; + uint8_t msm_ver; + uint8_t _unknown; } __attribute__ ((packed)); typedef struct DMCmdVersionInfoRsp DMCmdVersionInfoRsp; /* DIAG_CMD_ESN */ struct DMCmdEsnRsp { - u_int8_t code; - u_int8_t esn[4]; + uint8_t code; + uint8_t esn[4]; } __attribute__ ((packed)); typedef struct DMCmdEsnRsp DMCmdEsnRsp; /* DIAG_CMD_STATUS */ struct DMCmdStatusRsp { - u_int8_t code; - u_int8_t _unknown[3]; - u_int8_t esn[4]; - u_int16_t rf_mode; - u_int8_t min1_analog[4]; - u_int8_t min1_cdma[4]; - u_int8_t min2_analog[2]; - u_int8_t min2_cdma[2]; - u_int8_t _unknown1; - u_int16_t cdma_rx_state; - u_int8_t good_frames; - u_int16_t analog_corrected_frames; - u_int16_t analog_bad_frames; - u_int16_t analog_word_syncs; - u_int16_t entry_reason; - u_int16_t curr_chan; - u_int8_t cdma_code_chan; - u_int16_t pilot_base; - u_int16_t sid; - u_int16_t nid; - u_int16_t analog_locaid; - u_int16_t analog_rssi; - u_int8_t analog_power; + uint8_t code; + uint8_t _unknown[3]; + uint8_t esn[4]; + uint16_t rf_mode; + uint8_t min1_analog[4]; + uint8_t min1_cdma[4]; + uint8_t min2_analog[2]; + uint8_t min2_cdma[2]; + uint8_t _unknown1; + uint16_t cdma_rx_state; + uint8_t good_frames; + uint16_t analog_corrected_frames; + uint16_t analog_bad_frames; + uint16_t analog_word_syncs; + uint16_t entry_reason; + uint16_t curr_chan; + uint8_t cdma_code_chan; + uint16_t pilot_base; + uint16_t sid; + uint16_t nid; + uint16_t analog_locaid; + uint16_t analog_rssi; + uint8_t analog_power; } __attribute__ ((packed)); typedef struct DMCmdStatusRsp DMCmdStatusRsp; /* DIAG_CMD_SW_VERSION */ struct DMCmdSwVersionRsp { - u_int8_t code; + uint8_t code; char version[31]; char comp_date[11]; - u_int8_t _unknown1[2]; + uint8_t _unknown1[2]; char comp_time[8]; - u_int8_t _unknown2[2]; + uint8_t _unknown2[2]; } __attribute__ ((packed)); typedef struct DMCmdSwVersionRsp DMCmdSwVersionRsp; @@ -347,55 +347,55 @@ /* DIAG_CMD_STATUS_SNAPSHOT */ struct DMCmdStatusSnapshotRsp { - u_int8_t code; - u_int8_t esn[4]; - u_int8_t imsi_s1[4]; - u_int8_t imsi_s2[2]; - u_int8_t imsi_s[8]; - u_int8_t imsi_11_12; - u_int16_t mcc; - u_int8_t imsi_addr_num; - u_int16_t sid; - u_int16_t nid; - u_int8_t prev; - u_int8_t prev_in_use; - u_int8_t mob_prev; - u_int8_t band_class; - u_int16_t frequency; - u_int8_t oper_mode; - u_int8_t state; - u_int8_t sub_state; + uint8_t code; + uint8_t esn[4]; + uint8_t imsi_s1[4]; + uint8_t imsi_s2[2]; + uint8_t imsi_s[8]; + uint8_t imsi_11_12; + uint16_t mcc; + uint8_t imsi_addr_num; + uint16_t sid; + uint16_t nid; + uint8_t prev; + uint8_t prev_in_use; + uint8_t mob_prev; + uint8_t band_class; + uint16_t frequency; + uint8_t oper_mode; + uint8_t state; + uint8_t sub_state; } __attribute__ ((packed)); typedef struct DMCmdStatusSnapshotRsp DMCmdStatusSnapshotRsp; /* DIAG_SUBSYS_CM_STATE_INFO subsys command */ struct DMCmdSubsysCMStateInfoRsp { DMCmdSubsysHeader header; - u_int32_t call_state; - u_int32_t oper_mode; - u_int32_t system_mode; - u_int32_t mode_pref; - u_int32_t band_pref; - u_int32_t roam_pref; - u_int32_t srv_domain_pref; - u_int32_t acq_order_pref; - u_int32_t hybrid_pref; - u_int32_t network_sel_mode_pref; + uint32_t call_state; + uint32_t oper_mode; + uint32_t system_mode; + uint32_t mode_pref; + uint32_t band_pref; + uint32_t roam_pref; + uint32_t srv_domain_pref; + uint32_t acq_order_pref; + uint32_t hybrid_pref; + uint32_t network_sel_mode_pref; } __attribute__ ((packed)); typedef struct DMCmdSubsysCMStateInfoRsp DMCmdSubsysCMStateInfoRsp; /* DIAG_SUBSYS_HDR_STATE_INFO subsys command */ struct DMCmdSubsysHDRStateInfoRsp { DMCmdSubsysHeader header; - u_int8_t at_state; - u_int8_t session_state; - u_int8_t almp_state; - u_int8_t init_state; - u_int8_t idle_state; - u_int8_t connected_state; - u_int8_t route_update_state; - u_int8_t overhead_msg_state; - u_int8_t hdr_hybrid_mode; + uint8_t at_state; + uint8_t session_state; + uint8_t almp_state; + uint8_t init_state; + uint8_t idle_state; + uint8_t connected_state; + uint8_t route_update_state; + uint8_t overhead_msg_state; + uint8_t hdr_hybrid_mode; } __attribute__ ((packed)); typedef struct DMCmdSubsysHDRStateInfoRsp DMCmdSubsysHDRStateInfoRsp; @@ -403,124 +403,124 @@ /* DIAG_SUBSYS_ZTE_STATUS subsys command */ struct DMCmdSubsysZteStatusRsp { DMCmdSubsysHeader header; - u_int8_t _unknown1[8]; - u_int8_t signal_ind; - u_int8_t _unknown2; + uint8_t _unknown1[8]; + uint8_t signal_ind; + uint8_t _unknown2; } __attribute__ ((packed)); typedef struct DMCmdSubsysZteStatusRsp DMCmdSubsysZteStatusRsp; /* DIAG_CMD_PILOT_SETS command */ struct DMCmdPilotSetsSet { - u_int16_t pn_offset; - u_int16_t ecio; + uint16_t pn_offset; + uint16_t ecio; } __attribute__ ((packed)); typedef struct DMCmdPilotSetsSet DMCmdPilotSetsSet; struct DMCmdPilotSetsRsp { - u_int8_t code; - u_int16_t pilot_inc; - u_int8_t active_count; - u_int8_t candidate_count; - u_int8_t neighbor_count; + uint8_t code; + uint16_t pilot_inc; + uint8_t active_count; + uint8_t candidate_count; + uint8_t neighbor_count; DMCmdPilotSetsSet sets[52]; } __attribute__ ((packed)); typedef struct DMCmdPilotSetsRsp DMCmdPilotSetsRsp; struct DMCmdLog { - u_int8_t code; - u_int8_t more; - u_int16_t len; /* size of packet after this member */ - u_int16_t _unknown2; /* contains same value as len */ - u_int16_t log_code; - u_int64_t timestamp; - u_int8_t data[0]; + uint8_t code; + uint8_t more; + uint16_t len; /* size of packet after this member */ + uint16_t _unknown2; /* contains same value as len */ + uint16_t log_code; + uint64_t timestamp; + uint8_t data[0]; } __attribute__ ((packed)); typedef struct DMCmdLog DMCmdLog; struct DMCmdExtLogMask { - u_int8_t code; + uint8_t code; /* Bit number of highest '1' in 'mask'; set to 0 to get current mask. */ - u_int16_t len; + uint16_t len; /* Bitfield of log messages to receive */ - u_int8_t mask[512]; + uint8_t mask[512]; } __attribute__ ((packed)); typedef struct DMCmdExtLogMask DMCmdExtLogMask; struct DMCmdEventReport { - u_int8_t code; - u_int8_t on; + uint8_t code; + uint8_t on; } __attribute__ ((packed)); typedef struct DMCmdEventReport DMCmdEventReport; struct DMCmdEventReportRsp { - u_int8_t code; - u_int16_t len; - u_int16_t event_id; - u_int8_t data[0]; + uint8_t code; + uint16_t len; + uint16_t event_id; + uint8_t data[0]; } __attribute__ ((packed)); typedef struct DMCmdEventReportRsp DMCmdEventReportRsp; /* DIAG_SUBSYS_NOVATEL_* subsys command */ struct DMCmdSubsysNwSnapshotReq { DMCmdSubsysHeader hdr; - u_int8_t technology; /* DIAG_SUBSYS_NOVATEL_MODEM_SNAPSHOT_TECH_* */ - u_int32_t snapshot_mask; + uint8_t technology; /* DIAG_SUBSYS_NOVATEL_MODEM_SNAPSHOT_TECH_* */ + uint32_t snapshot_mask; } __attribute__ ((packed)); typedef struct DMCmdSubsysNwSnapshotReq DMCmdSubsysNwSnapshotReq; /* DIAG_SUBSYS_NOVATEL_MODEM_SNAPSHOT response */ struct DMCmdSubsysNwSnapshotRsp { DMCmdSubsysHeader hdr; - u_int8_t response_code; - u_int32_t bitfield1; - u_int32_t bitfield2; - u_int8_t data[100]; /* DMCmdSubsysNwSnapshotCdma */ + uint8_t response_code; + uint32_t bitfield1; + uint32_t bitfield2; + uint8_t data[100]; /* DMCmdSubsysNwSnapshotCdma */ } __attribute__ ((packed)); typedef struct DMCmdSubsysNwSnapshotRsp DMCmdSubsysNwSnapshotRsp; struct DMCmdSubsysNwSnapshotCdma { - u_int32_t rssi; - u_int32_t battery_level; - u_int8_t call_info; - u_int8_t new_sms_ind; - u_int8_t missed_calls; - u_int32_t voicemail_ind; - u_int8_t pkt_call_ctrl_state; - u_int8_t mip_rrp_err_code; - u_int8_t cur_packet_zone_id; - u_int8_t prev; - u_int8_t band_class; - u_int8_t eri; - u_int8_t eri_alert_id; - u_int32_t cur_call_total_time; - u_int32_t cur_call_active_time; - u_int32_t cur_call_tx_ip_bytes; - u_int32_t cur_call_rx_ip_bytes; - u_int8_t connection_status; - u_int16_t dominant_pn; - u_int8_t wdisable_mask; - u_int8_t hdr_rev; + uint32_t rssi; + uint32_t battery_level; + uint8_t call_info; + uint8_t new_sms_ind; + uint8_t missed_calls; + uint32_t voicemail_ind; + uint8_t pkt_call_ctrl_state; + uint8_t mip_rrp_err_code; + uint8_t cur_packet_zone_id; + uint8_t prev; + uint8_t band_class; + uint8_t eri; + uint8_t eri_alert_id; + uint32_t cur_call_total_time; + uint32_t cur_call_active_time; + uint32_t cur_call_tx_ip_bytes; + uint32_t cur_call_rx_ip_bytes; + uint8_t connection_status; + uint16_t dominant_pn; + uint8_t wdisable_mask; + uint8_t hdr_rev; } __attribute__ ((packed)); typedef struct DMCmdSubsysNwSnapshotCdma DMCmdSubsysNwSnapshotCdma; /* DIAG_SUBSYS_NOVATEL_MODEM_SNAPSHOT response */ struct DMCmdSubsysNwEriRsp { DMCmdSubsysHeader hdr; - u_int8_t status; - u_int16_t error; - u_int8_t roam; - u_int8_t eri_header[6]; - u_int8_t eri_call_prompt[38]; + uint8_t status; + uint16_t error; + uint8_t roam; + uint8_t eri_header[6]; + uint8_t eri_call_prompt[38]; /* Roaming Indicator */ - u_int8_t indicator_id; - u_int8_t icon_id; - u_int8_t icon_mode; - u_int8_t call_prompt_id; /* Call Guard? */ - u_int8_t alert_id; /* Ringer? */ - u_int8_t encoding_type; - u_int8_t text_len; - u_int8_t text[32]; + uint8_t indicator_id; + uint8_t icon_id; + uint8_t icon_mode; + uint8_t call_prompt_id; /* Call Guard? */ + uint8_t alert_id; /* Ringer? */ + uint8_t encoding_type; + uint8_t text_len; + uint8_t text[32]; } __attribute__ ((packed)); typedef struct DMCmdSubsysNwEriRsp DMCmdSubsysNwEriRsp; @@ -531,26 +531,26 @@ }; struct DMCmdLogConfig { - u_int8_t code; - u_int8_t pad[3]; - u_int32_t op; - u_int32_t equipid; - u_int32_t num_items; - u_int8_t mask[0]; + uint8_t code; + uint8_t pad[3]; + uint32_t op; + uint32_t equipid; + uint32_t num_items; + uint8_t mask[0]; } __attribute__ ((packed)); typedef struct DMCmdLogConfig DMCmdLogConfig; struct DMCmdLogConfigRsp { - u_int8_t code; - u_int8_t pad[3]; - u_int32_t op; - u_int32_t result; /* 0 = success */ - u_int32_t equipid; + uint8_t code; + uint8_t pad[3]; + uint32_t op; + uint32_t result; /* 0 = success */ + uint32_t equipid; union { - u_int32_t get_range_items[16]; + uint32_t get_range_items[16]; struct { - u_int32_t num_items; - u_int8_t mask[0]; + uint32_t num_items; + uint8_t mask[0]; } get_set_items; } u; } __attribute__ ((packed)); @@ -559,51 +559,50 @@ /* DIAG_SUBSYS_WCDMA_CALL_START command */ struct DMCmdSubsysWcdmaCallStart { DMCmdSubsysHeader hdr; - u_int8_t number_len; - u_int8_t number_digits[32]; - u_int8_t amr_rate; /* default to 7 */ + uint8_t number_len; + uint8_t number_digits[32]; + uint8_t amr_rate; /* default to 7 */ } __attribute__ ((packed)); typedef struct DMCmdSubsysWcdmaCallStart DMCmdSubsysWcdmaCallStart; /* DIAG_SUBSYS_WCDMA_STATE_INFO response */ struct DMCmdSubsysWcdmaStateInfoRsp { DMCmdSubsysHeader hdr; - u_int8_t imei_len; - u_int8_t imei[8]; - u_int8_t imsi_len; - u_int8_t imsi[8]; - u_int8_t l1_state; + uint8_t imei_len; + uint8_t imei[8]; + uint8_t imsi_len; + uint8_t imsi[8]; + uint8_t l1_state; } __attribute__ ((packed)); typedef struct DMCmdSubsysWcdmaStateInfoRsp DMCmdSubsysWcdmaStateInfoRsp; /* DIAG_SUBSYS_GSM_STATE_INFO response */ struct DMCmdSubsysGsmStateInfoRsp { DMCmdSubsysHeader hdr; - u_int8_t imei_len; - u_int8_t imei[8]; - u_int8_t imsi_len; - u_int8_t imsi[8]; - u_int8_t lai[5]; - u_int16_t cellid; - u_int8_t cm_call_state; - u_int8_t cm_opmode; - u_int8_t cm_sysmode; + uint8_t imei_len; + uint8_t imei[8]; + uint8_t imsi_len; + uint8_t imsi[8]; + uint8_t lai[5]; + uint16_t cellid; + uint8_t cm_call_state; + uint8_t cm_opmode; + uint8_t cm_sysmode; } __attribute__ ((packed)); typedef struct DMCmdSubsysGsmStateInfoRsp DMCmdSubsysGsmStateInfoRsp; /* DIAG_CMD_SAMSUNG_IND response */ struct DMCmdSamsungIndRsp { DMCmdHeader hdr; - u_int8_t _unknown1; /* always zero */ - u_int8_t _unknown2; /* 0x0c */ - u_int8_t _unknown3[4]; /* always zero */ - u_int8_t _unknown4; /* 0x05 */ - u_int8_t _unknown5; /* always zero */ - u_int8_t _unknown6; /* 0x01 */ - u_int8_t _unknown7; /* always zero */ - u_int8_t signal; /* 0 - 5 */ + uint8_t _unknown1; /* always zero */ + uint8_t _unknown2; /* 0x0c */ + uint8_t _unknown3[4]; /* always zero */ + uint8_t _unknown4; /* 0x05 */ + uint8_t _unknown5; /* always zero */ + uint8_t _unknown6; /* 0x01 */ + uint8_t _unknown7; /* always zero */ + uint8_t signal; /* 0 - 5 */ } __attribute__ ((packed)); typedef struct DMCmdSamsungIndRsp DMCmdSamsungIndRsp; #endif /* LIBQCDM_DM_COMMANDS_H */ - diff -Nru modemmanager-1.6.8/libqcdm/src/log-items.h modemmanager-1.10.0/libqcdm/src/log-items.h --- modemmanager-1.6.8/libqcdm/src/log-items.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/log-items.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,6 +18,8 @@ #ifndef LIBQCDM_LOG_ITEMS_H #define LIBQCDM_LOG_ITEMS_H +#include + enum { /* CDMA and EVDO items */ DM_LOG_ITEM_CDMA_ACCESS_CHANNEL_MSG = 0x1004, @@ -37,7 +39,7 @@ DM_LOG_ITEM_EVDO_REV_POWER_CONTROL = 0x1063, DM_LOG_ITEM_EVDO_ARQ_EFFECTIVE_RECEIVE_RATE = 0x1066, DM_LOG_ITEM_EVDO_AIR_LINK_SUMMARY = 0x1068, - DM_LOG_ITEM_EVDO_POWER = 0x1069 + DM_LOG_ITEM_EVDO_POWER = 0x1069, DM_LOG_ITEM_EVDO_FWD_LINK_PACKET_SNAPSHOT = 0x106A, DM_LOG_ITEM_EVDO_ACCESS_ATTEMPT = 0x106C, DM_LOG_ITEM_EVDO_REV_ACTIVITY_BITS_BUFFER = 0x106D, @@ -60,84 +62,84 @@ /* DM_LOG_ITEM_CDMA_PAGING_CHANNEL_MSG */ struct DMLogItemPagingChannelMsg { - u_int8_t msg_len; /* size of entire struct including this field */ - u_int8_t msg_type; /* MSG_TYPE as in 3GPP2 C.S0004 Table 3.1.2.3.1.1.2 */ - u_int8_t data[0]; /* Packed message as in 3GPP2 C.S0005 3.7.2.3.2.x */ + uint8_t msg_len; /* size of entire struct including this field */ + uint8_t msg_type; /* MSG_TYPE as in 3GPP2 C.S0004 Table 3.1.2.3.1.1.2 */ + uint8_t data[0]; /* Packed message as in 3GPP2 C.S0005 3.7.2.3.2.x */ } __attribute ((packed)); typedef struct DMLogItemPagingChannelMsg DMLogItemPagingChannelMsg; /* DM_LOG_ITEM_CDMA_REVERSE_POWER_CONTROL */ struct DMLogItemRPCItem { - u_int8_t channel_set_mask; - u_int16_t frame_count; - u_int8_t len_per_frame; - u_int16_t dec_history; - u_int8_t rx_agc_vals; - u_int8_t tx_power_vals; - u_int8_t tx_gain_adjust; + uint8_t channel_set_mask; + uint16_t frame_count; + uint8_t len_per_frame; + uint16_t dec_history; + uint8_t rx_agc_vals; + uint8_t tx_power_vals; + uint8_t tx_gain_adjust; } __attribute__ ((packed)); typedef struct DMLogItemRPCItem DMLogItemRPCItem; struct DMLogItemCdmaReversePowerControl { - u_int8_t frame_offset; - u_int8_t band_class; - u_int16_t rev_chan_rc; - u_int8_t pilot_gating_rate; - u_int8_t step_size; - u_int8_t num_records; + uint8_t frame_offset; + uint8_t band_class; + uint16_t rev_chan_rc; + uint8_t pilot_gating_rate; + uint8_t step_size; + uint8_t num_records; DMLogItemRPCItem records[]; } __attribute__ ((packed)); typedef struct DMLogItemCdmaReversePowerControl DMLogItemCdmaReversePowerControl; /* DM_LOG_ITEM_EVDO_PILOT_SETS_V2 */ -struct EvdoPilotSetsV2PilotRecord { - u_int16_t pilot_pn; +struct DMLogItemEvdoPilotSetsV2Pilot { + uint16_t pilot_pn; /* HDR pilot energy doesn't appear to be in the same units as 1x pilot - * energy (eg, -0.5 dBm increments). Instead, you can approximate EC/IO - * by using this formula empirically derived from simultaneous AT!ECIO - * and HDR Pilot Sets V2 results from a Sierra modem: + * energy (eg, -0.5 dBm increments). Instead it appears roughly correlated + * to RSSI dBm by using this formula empirically derived from simultaneous + * AT!RSSI and HDR Pilot Sets V2 results from a Sierra modem: * - * EC/IO = (pilot_energy / -50) + 1 + * RSSI dBm = -110 + (MAX(pilot_energy - 50, 0) / 14) */ - u_int16_t pilot_energy; + uint16_t pilot_energy; union { struct { - u_int16_t mac_index; - u_int8_t unknown1; - u_int8_t unknown2; - u_int16_t window_center; + uint16_t mac_index; + uint8_t unknown1; + uint8_t unknown2; + uint16_t window_center; } Active; struct { - u_int16_t channel_number; - u_int8_t unknown1; - u_int8_t unknown2; - u_int16_t window_center; + uint16_t channel_number; + uint8_t unknown1; + uint8_t unknown2; + uint16_t window_center; } Candidate; struct { - u_int16_t channel_number; - u_int16_t window_center; - u_int8_t unknown1; // Offset? - u_int8_t unknown2; // Age? + uint16_t channel_number; + uint16_t window_center; + uint8_t unknown1; // Offset? + uint8_t unknown2; // Age? } Remaining; }; } __attribute__ ((packed)); -typedef struct EvdoPilotSetsV2PilotRecord EvdoPilotSetsV2PilotRecord; +typedef struct DMLogItemEvdoPilotSetsV2Pilot DMLogItemEvdoPilotSetsV2Pilot; /* DM_LOG_ITEM_EVDO_PILOT_SETS_V2 */ struct DMLogItemEvdoPilotSetsV2 { - u_int8_t pn_offset; - u_int8_t active_set_count; - u_int8_t active_set_window; - u_int16_t active_set_channel; - u_int8_t unknown1; - u_int8_t candidate_set_count; - u_int8_t candidate_set_window; - u_int8_t remaining_set_count; - u_int8_t remaining_set_window; - u_int8_t unknown2; + uint8_t pn_offset; + uint8_t active_count; + uint8_t active_window; + uint16_t active_channel; + uint8_t unknown1; + uint8_t candidate_count; + uint8_t candidate_window; + uint8_t remaining_count; + uint8_t remaining_window; + uint8_t unknown2; - EvdoPilotSetsV2PilotRecord records[]; + DMLogItemEvdoPilotSetsV2Pilot sets[]; } __attribute__ ((packed)); typedef struct DMLogItemEvdoPilotSetsV2 DMLogItemEvdoPilotSetsV2; @@ -145,29 +147,29 @@ struct DMLogItemWcdmaTaFingerInfo { int32_t tx_pos; int16_t coherent_interval_len; - u_int8_t non_coherent_interval_len; - u_int8_t num_paths; - u_int32_t path_enr; - int32_t pn_pos_path + uint8_t non_coherent_interval_len; + uint8_t num_paths; + uint32_t path_enr; + int32_t pn_pos_path; int16_t pri_cpich_psc; - u_int8_t unknown1; - u_int8_t sec_cpich_ssc; - u_int8_t finger_channel_code_index; - u_int8_t finger_index; + uint8_t unknown1; + uint8_t sec_cpich_ssc; + uint8_t finger_channel_code_index; + uint8_t finger_index; } __attribute__ ((packed)); typedef struct DMLogItemWcdmaTaFingerInfo DMLogItemWcdmaTaFingerInfo; /* DM_LOG_ITEM_WCDMA_AGC_INFO */ struct DMLogItemWcdmaAgcInfo { - u_int8_t num_samples; - u_int16_t rx_agc; - u_int16_t tx_agc; - u_int16_t rx_agc_adj_pdm; - u_int16_t tx_agc_adj_pdm; - u_int16_t max_tx; + uint8_t num_samples; + uint16_t rx_agc; + uint16_t tx_agc; + uint16_t rx_agc_adj_pdm; + uint16_t tx_agc_adj_pdm; + uint16_t max_tx; /* Bit 4 means tx_agc is valid */ - u_int8_t agc_info; + uint8_t agc_info; } __attribute__ ((packed)); typedef struct DMLogItemWcdmaAgcInfo DMLogItemWcdmaAgcInfo; @@ -183,38 +185,38 @@ }; struct DMLogItemWcdmaRrcState { - u_int8_t rrc_state; + uint8_t rrc_state; } __attribute__ ((packed)); typedef struct DMLogItemWcdmaRrcState DMLogItemWcdmaRrcState; /* DM_LOG_ITEM_WCDMA_CELL_ID */ struct DMLogItemWcdmaCellId { - u_int8_t unknown1[8]; - u_int32_t cellid; - u_int8_t unknown2[4]; + uint8_t unknown1[8]; + uint32_t cellid; + uint8_t unknown2[4]; } __attribute__ ((packed)); typedef struct DMLogItemWcdmaCellId DMLogItemWcdmaCellId; /* DM_LOG_ITEM_GSM_BURST_METRICS */ struct DMLogItemGsmBurstMetric { - u_int32_t fn; - u_int16_t arfcn; - u_int32_t rssi; - u_int16_t power; - u_int16_t dc_offset_i; - u_int16_t dc_offset_q; - u_int16_t freq_offset; - u_int16_t timing_offset; - u_int16_t snr; - u_int8_t gain_state; + uint32_t fn; + uint16_t arfcn; + uint32_t rssi; + uint16_t power; + uint16_t dc_offset_i; + uint16_t dc_offset_q; + uint16_t freq_offset; + uint16_t timing_offset; + uint16_t snr; + uint8_t gain_state; } __attribute__ ((packed)); typedef struct DMLogItemGsmBurstMetric DMLogItemGsmBurstMetric; struct DMLogItemGsmBurstMetrics { - u_int8_t channel; - DMLogItemBurstMetric metrics[4]; + uint8_t channel; + DMLogItemGsmBurstMetric metrics[4]; } __attribute__ ((packed)); typedef struct DMLogItemGsmBurstMetrics DMLogItemGsmBurstMetrics; @@ -231,12 +233,12 @@ struct DMLogItemGsmBcchMessage { /* Band is top 4 bits; lower 12 is ARFCN */ - u_int16_t bcch_arfcn; - u_int16_t bsic; - u_int16_t cell_id; - u_int8_t lai[5]; - u_int8_t cell_selection_prio; - u_int8_t ncc_permitted; + uint16_t bcch_arfcn; + uint16_t bsic; + uint16_t cell_id; + uint8_t lai[5]; + uint8_t cell_selection_prio; + uint8_t ncc_permitted; } __attribute__ ((packed)); typedef struct DMLogItemGsmBcchMessage DMLogItemGsmBcchMessage; diff -Nru modemmanager-1.6.8/libqcdm/src/logs.c modemmanager-1.10.0/libqcdm/src/logs.c --- modemmanager-1.6.8/libqcdm/src/logs.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libqcdm/src/logs.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,183 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2010 Red Hat, Inc. + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include "log-items.h" +#include "logs.h" +#include "errors.h" +#include "dm-commands.h" +#include "result-private.h" +#include "utils.h" + + +/**********************************************************************/ + +static qcdmbool +check_log_item (const char *buf, size_t len, uint16_t log_code, size_t min_len, int *out_error) +{ + DMCmdLog *log_cmd = (DMCmdLog *) buf; + + if (len < sizeof (DMCmdLog)) { + qcdm_err (0, "DM log item malformed (must be at least %zu bytes in length)", sizeof (DMCmdLog)); + if (out_error) + *out_error = -QCDM_ERROR_RESPONSE_MALFORMED; + return FALSE; + } + + if (buf[0] != DIAG_CMD_LOG) { + if (out_error) + *out_error = -QCDM_ERROR_RESPONSE_UNEXPECTED; + return FALSE; + } + + if (le16toh (log_cmd->log_code) != log_code) { + if (out_error) + *out_error = -QCDM_ERROR_RESPONSE_UNEXPECTED; + return FALSE; + } + + if (len < sizeof (DMCmdLog) + min_len) { + qcdm_err (0, "DM log item response not long enough (got %zu, expected " + "at least %zu).", len, sizeof (DMCmdLog) + min_len); + if (out_error) + *out_error = -QCDM_ERROR_RESPONSE_BAD_LENGTH; + return FALSE; + } + + return TRUE; +} + +/**********************************************************************/ + +#define PILOT_SETS_LOG_ACTIVE_SET "active-set" +#define PILOT_SETS_LOG_CANDIDATE_SET "candidate-set" +#define PILOT_SETS_LOG_REMAINING_SET "remaining-set" + +static const char * +set_num_to_str (uint32_t num) +{ + if (num == QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_ACTIVE) + return PILOT_SETS_LOG_ACTIVE_SET; + if (num == QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_CANDIDATE) + return PILOT_SETS_LOG_CANDIDATE_SET; + if (num == QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_REMAINING) + return PILOT_SETS_LOG_REMAINING_SET; + return NULL; +} + +QcdmResult * +qcdm_log_item_evdo_pilot_sets_v2_new (const char *buf, size_t len, int *out_error) +{ + QcdmResult *result = NULL; + DMLogItemEvdoPilotSetsV2 *pilot_sets; + DMCmdLog *log_cmd = (DMCmdLog *) buf; + size_t sets_len; + + qcdm_return_val_if_fail (buf != NULL, NULL); + + if (!check_log_item (buf, len, DM_LOG_ITEM_EVDO_PILOT_SETS_V2, sizeof (DMLogItemEvdoPilotSetsV2), out_error)) + return NULL; + + pilot_sets = (DMLogItemEvdoPilotSetsV2 *) log_cmd->data; + + result = qcdm_result_new (); + + sets_len = pilot_sets->active_count * sizeof (DMLogItemEvdoPilotSetsV2Pilot); + if (sets_len > 0) { + qcdm_result_add_u8_array (result, + PILOT_SETS_LOG_ACTIVE_SET, + (const uint8_t *) &pilot_sets->sets[0], + sets_len); + } + + sets_len = pilot_sets->candidate_count * sizeof (DMLogItemEvdoPilotSetsV2Pilot); + if (sets_len > 0) { + qcdm_result_add_u8_array (result, + PILOT_SETS_LOG_CANDIDATE_SET, + (const uint8_t *) &pilot_sets->sets[pilot_sets->active_count], + sets_len); + } + + sets_len = pilot_sets->remaining_count * sizeof (DMLogItemEvdoPilotSetsV2Pilot); + if (sets_len > 0) { + qcdm_result_add_u8_array (result, + PILOT_SETS_LOG_REMAINING_SET, + (const uint8_t *) &pilot_sets->sets[pilot_sets->active_count + pilot_sets->candidate_count], + sets_len); + } + + return result; + +} + +qcdmbool +qcdm_log_item_evdo_pilot_sets_v2_get_num (QcdmResult *result, + uint32_t set_type, + uint32_t *out_num) +{ + const char *set_name; + const uint8_t *array = NULL; + size_t array_len = 0; + + qcdm_return_val_if_fail (result != NULL, FALSE); + + set_name = set_num_to_str (set_type); + qcdm_return_val_if_fail (set_name != NULL, FALSE); + + if (qcdm_result_get_u8_array (result, set_name, &array, &array_len)) + return FALSE; + + *out_num = array_len / sizeof (DMLogItemEvdoPilotSetsV2Pilot); + return TRUE; +} + +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + +qcdmbool +qcdm_log_item_evdo_pilot_sets_v2_get_pilot (QcdmResult *result, + uint32_t set_type, + uint32_t num, + uint32_t *out_pilot_pn, + uint32_t *out_pilot_energy, + int32_t *out_rssi_dbm) +{ + const char *set_name; + DMLogItemEvdoPilotSetsV2Pilot *pilot; + const uint8_t *array = NULL; + size_t array_len = 0; + + qcdm_return_val_if_fail (result != NULL, FALSE); + + set_name = set_num_to_str (set_type); + qcdm_return_val_if_fail (set_name != NULL, FALSE); + + if (qcdm_result_get_u8_array (result, set_name, &array, &array_len)) + return FALSE; + + qcdm_return_val_if_fail (num < array_len / sizeof (DMLogItemEvdoPilotSetsV2Pilot), FALSE); + + pilot = (DMLogItemEvdoPilotSetsV2Pilot *) &array[num * sizeof (DMLogItemEvdoPilotSetsV2Pilot)]; + *out_pilot_pn = le16toh (pilot->pilot_pn); + *out_pilot_energy = le16toh (pilot->pilot_energy); + *out_rssi_dbm = (int32_t) (-110.0 + ((float) MAX (le16toh (pilot->pilot_energy) - 50, 0) / 14.0)); + return TRUE; +} + +/**********************************************************************/ diff -Nru modemmanager-1.6.8/libqcdm/src/logs.h modemmanager-1.10.0/libqcdm/src/logs.h --- modemmanager-1.6.8/libqcdm/src/logs.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/libqcdm/src/logs.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,50 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2010 Red Hat, Inc. + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LIBQCDM_LOGS_H +#define LIBQCDM_LOGS_H + +#include "utils.h" +#include "result.h" + +/**********************************************************************/ + +enum { + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_UNKNOWN = 0, + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_ACTIVE = 1, + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_CANDIDATE = 2, + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_REMAINING = 3, +}; + +QcdmResult *qcdm_log_item_evdo_pilot_sets_v2_new (const char *buf, + size_t len, + int *out_error); + +qcdmbool qcdm_log_item_evdo_pilot_sets_v2_get_num (QcdmResult *result, + uint32_t set_type, + uint32_t *out_num); + +qcdmbool qcdm_log_item_evdo_pilot_sets_v2_get_pilot (QcdmResult *result, + uint32_t set_type, + uint32_t num, + uint32_t *out_pilot_pn, + uint32_t *out_pilot_energy, + int32_t *out_rssi_dbm); + +/**********************************************************************/ + +#endif /* LIBQCDM_LOGS_H */ diff -Nru modemmanager-1.6.8/libqcdm/src/Makefile.am modemmanager-1.10.0/libqcdm/src/Makefile.am --- modemmanager-1.6.8/libqcdm/src/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -16,6 +16,8 @@ commands.h \ errors.c \ errors.h \ + logs.c \ + logs.h \ result.c \ result.h \ result-private.h \ diff -Nru modemmanager-1.6.8/libqcdm/src/Makefile.in modemmanager-1.10.0/libqcdm/src/Makefile.in --- modemmanager-1.6.8/libqcdm/src/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -120,7 +119,8 @@ am__v_lt_1 = libqcdm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libqcdm_la_OBJECTS = libqcdm_la-com.lo libqcdm_la-commands.lo \ - libqcdm_la-errors.lo libqcdm_la-result.lo libqcdm_la-utils.lo + libqcdm_la-errors.lo libqcdm_la-logs.lo libqcdm_la-result.lo \ + libqcdm_la-utils.lo libqcdm_la_OBJECTS = $(am_libqcdm_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -136,7 +136,14 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libqcdm_la-com.Plo \ + ./$(DEPDIR)/libqcdm_la-commands.Plo \ + ./$(DEPDIR)/libqcdm_la-errors.Plo \ + ./$(DEPDIR)/libqcdm_la-logs.Plo \ + ./$(DEPDIR)/libqcdm_la-result.Plo \ + ./$(DEPDIR)/libqcdm_la-utils.Plo \ + ./$(DEPDIR)/libqcdm_test_la-utils.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -185,7 +192,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -238,14 +244,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -366,8 +364,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -403,6 +399,8 @@ commands.h \ errors.c \ errors.h \ + logs.c \ + logs.h \ result.c \ result.h \ result-private.h \ @@ -447,8 +445,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -483,12 +481,19 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-com.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-commands.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-errors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-result.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-utils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_test_la-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-com.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-commands.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-errors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-logs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-result.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_la-utils.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqcdm_test_la-utils.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -542,6 +547,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcdm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqcdm_la-errors.lo `test -f 'errors.c' || echo '$(srcdir)/'`errors.c +libqcdm_la-logs.lo: logs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcdm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqcdm_la-logs.lo -MD -MP -MF $(DEPDIR)/libqcdm_la-logs.Tpo -c -o libqcdm_la-logs.lo `test -f 'logs.c' || echo '$(srcdir)/'`logs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libqcdm_la-logs.Tpo $(DEPDIR)/libqcdm_la-logs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logs.c' object='libqcdm_la-logs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcdm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqcdm_la-logs.lo `test -f 'logs.c' || echo '$(srcdir)/'`logs.c + libqcdm_la-result.lo: result.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqcdm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqcdm_la-result.lo -MD -MP -MF $(DEPDIR)/libqcdm_la-result.Tpo -c -o libqcdm_la-result.lo `test -f 'result.c' || echo '$(srcdir)/'`result.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libqcdm_la-result.Tpo $(DEPDIR)/libqcdm_la-result.Plo @@ -614,7 +626,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -684,7 +699,13 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libqcdm_la-com.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-commands.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-errors.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-logs.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-result.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-utils.Plo + -rm -f ./$(DEPDIR)/libqcdm_test_la-utils.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -730,7 +751,13 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libqcdm_la-com.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-commands.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-errors.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-logs.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-result.Plo + -rm -f ./$(DEPDIR)/libqcdm_la-utils.Plo + -rm -f ./$(DEPDIR)/libqcdm_test_la-utils.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -751,16 +778,16 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am diff -Nru modemmanager-1.6.8/libqcdm/src/nv-items.h modemmanager-1.10.0/libqcdm/src/nv-items.h --- modemmanager-1.6.8/libqcdm/src/nv-items.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/nv-items.h 2018-11-15 09:55:53.000000000 +0100 @@ -64,15 +64,15 @@ /* DIAG_NV_MODE_PREF */ struct DMNVItemModePref { - u_int8_t profile; - u_int8_t mode_pref; + uint8_t profile; + uint8_t mode_pref; } __attribute__ ((packed)); typedef struct DMNVItemModePref DMNVItemModePref; /* DIAG_NV_DIR_NUMBER */ struct DMNVItemMdn { - u_int8_t profile; - u_int8_t mdn[10]; + uint8_t profile; + uint8_t mdn[10]; } __attribute__ ((packed)); typedef struct DMNVItemMdn DMNVItemMdn; @@ -85,8 +85,8 @@ /* DIAG_NV_ROAM_PREF */ struct DMNVItemRoamPref { - u_int8_t profile; - u_int8_t roam_pref; + uint8_t profile; + uint8_t roam_pref; } __attribute__ ((packed)); typedef struct DMNVItemRoamPref DMNVItemRoamPref; @@ -99,7 +99,7 @@ /* DIAG_NV_HDR_REV_PREF */ struct DMNVItemHdrRevPref { - u_int8_t rev_pref; + uint8_t rev_pref; } __attribute__ ((packed)); typedef struct DMNVItemHdrRevPref DMNVItemHdrRevPref; @@ -111,7 +111,7 @@ /* DIAG_NV_HYBRID_PREF */ struct DMNVItemHybridPref { - u_int8_t hybrid_pref; + uint8_t hybrid_pref; } __attribute__ ((packed)); typedef struct DMNVItemHybridPref DMNVItemHybridPref; @@ -123,9 +123,8 @@ /* DIAG_NV_IPV6_ENABLED */ struct DMNVItemIPv6Enabled { - u_int8_t enabled; + uint8_t enabled; } __attribute__ ((packed)); typedef struct DMNVItemIPv6Enabled DMNVItemIPv6Enabled; #endif /* LIBQCDM_NV_ITEMS_H */ - diff -Nru modemmanager-1.6.8/libqcdm/src/result.c modemmanager-1.10.0/libqcdm/src/result.c --- modemmanager-1.6.8/libqcdm/src/result.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/result.c 2019-01-15 15:57:35.000000000 +0100 @@ -37,15 +37,15 @@ struct Val { char *key; - u_int8_t type; + uint8_t type; union { char *s; - u_int8_t u8; - u_int32_t u32; - u_int8_t *u8_array; - u_int16_t *u16_array; + uint8_t u8; + uint32_t u32; + uint8_t *u8_array; + uint16_t *u16_array; } u; - u_int32_t array_len; + uint32_t array_len; Val *next; }; @@ -84,7 +84,7 @@ } static Val * -val_new_u8 (const char *key, u_int8_t u) +val_new_u8 (const char *key, uint8_t u) { Val *v; @@ -102,7 +102,7 @@ } static Val * -val_new_u8_array (const char *key, const u_int8_t *array, size_t array_len) +val_new_u8_array (const char *key, const uint8_t *array, size_t array_len) { Val *v; @@ -129,7 +129,7 @@ } static Val * -val_new_u32 (const char *key, u_int32_t u) +val_new_u32 (const char *key, uint32_t u) { Val *v; @@ -147,7 +147,7 @@ } static Val * -val_new_u16_array (const char *key, const u_int16_t *array, size_t array_len) +val_new_u16_array (const char *key, const uint16_t *array, size_t array_len) { Val *v; size_t sz; @@ -163,7 +163,7 @@ v->key = strdup (key); v->type = VAL_TYPE_U16_ARRAY; - sz = sizeof (u_int16_t) * array_len; + sz = sizeof (uint16_t) * array_len; v->u.u16_array = malloc (sz); if (v->u.u16_array == NULL) { val_free (v); @@ -178,7 +178,7 @@ /*********************************************************/ struct QcdmResult { - u_int32_t refcount; + uint32_t refcount; Val *first; }; @@ -289,7 +289,7 @@ void qcdm_result_add_u8 (QcdmResult *r, const char *key, - u_int8_t num) + uint8_t num) { Val *v; @@ -306,7 +306,7 @@ int qcdm_result_get_u8 (QcdmResult *r, const char *key, - u_int8_t *out_val) + uint8_t *out_val) { Val *v; @@ -326,7 +326,7 @@ void qcdm_result_add_u8_array (QcdmResult *r, const char *key, - const u_int8_t *array, + const uint8_t *array, size_t array_len) { Val *v; @@ -335,7 +335,6 @@ qcdm_return_if_fail (r->refcount > 0); qcdm_return_if_fail (key != NULL); qcdm_return_if_fail (array != NULL); - qcdm_return_if_fail (array_len >= 0); v = val_new_u8_array (key, array, array_len); qcdm_return_if_fail (v != NULL); @@ -346,7 +345,7 @@ int qcdm_result_get_u8_array (QcdmResult *r, const char *key, - const u_int8_t **out_val, + const uint8_t **out_val, size_t *out_len) { Val *v; @@ -369,7 +368,7 @@ void qcdm_result_add_u32 (QcdmResult *r, const char *key, - u_int32_t num) + uint32_t num) { Val *v; @@ -386,7 +385,7 @@ int qcdm_result_get_u32 (QcdmResult *r, const char *key, - u_int32_t *out_val) + uint32_t *out_val) { Val *v; @@ -406,7 +405,7 @@ void qcdm_result_add_u16_array (QcdmResult *r, const char *key, - const u_int16_t *array, + const uint16_t *array, size_t array_len) { Val *v; @@ -415,7 +414,6 @@ qcdm_return_if_fail (r->refcount > 0); qcdm_return_if_fail (key != NULL); qcdm_return_if_fail (array != NULL); - qcdm_return_if_fail (array_len >= 0); v = val_new_u16_array (key, array, array_len); qcdm_return_if_fail (v != NULL); @@ -426,7 +424,7 @@ int qcdm_result_get_u16_array (QcdmResult *r, const char *key, - const u_int16_t **out_val, + const uint16_t **out_val, size_t *out_len) { Val *v; @@ -445,4 +443,3 @@ *out_len = v->array_len; return 0; } - diff -Nru modemmanager-1.6.8/libqcdm/src/result.h modemmanager-1.10.0/libqcdm/src/result.h --- modemmanager-1.6.8/libqcdm/src/result.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/result.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ #ifndef LIBQCDM_RESULT_H #define LIBQCDM_RESULT_H -#include +#include typedef struct QcdmResult QcdmResult; @@ -28,15 +28,15 @@ int qcdm_result_get_u8 (QcdmResult *r, const char *key, - u_int8_t *out_val); + uint8_t *out_val); int qcdm_result_get_u32 (QcdmResult *r, const char *key, - u_int32_t *out_val); + uint32_t *out_val); int qcdm_result_get_u16_array (QcdmResult *result, const char *key, - const u_int16_t **out_val, + const uint16_t **out_val, size_t *out_len); QcdmResult *qcdm_result_ref (QcdmResult *r); @@ -44,4 +44,3 @@ void qcdm_result_unref (QcdmResult *r); #endif /* LIBQCDM_RESULT_H */ - diff -Nru modemmanager-1.6.8/libqcdm/src/result-private.h modemmanager-1.10.0/libqcdm/src/result-private.h --- modemmanager-1.6.8/libqcdm/src/result-private.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/result-private.h 2018-11-15 09:55:53.000000000 +0100 @@ -28,26 +28,25 @@ void qcdm_result_add_u8 (QcdmResult *result, const char *key, - u_int8_t num); + uint8_t num); void qcdm_result_add_u8_array (QcdmResult *result, const char *key, - const u_int8_t *array, + const uint8_t *array, size_t array_len); int qcdm_result_get_u8_array (QcdmResult *result, const char *key, - const u_int8_t **out_val, + const uint8_t **out_val, size_t *out_len); void qcdm_result_add_u16_array (QcdmResult *result, const char *key, - const u_int16_t *array, + const uint16_t *array, size_t array_len); void qcdm_result_add_u32 (QcdmResult *result, const char *key, - u_int32_t num); + uint32_t num); #endif /* LIBQCDM_RESULT_PRIVATE_H */ - diff -Nru modemmanager-1.6.8/libqcdm/src/utils.c modemmanager-1.10.0/libqcdm/src/utils.c --- modemmanager-1.6.8/libqcdm/src/utils.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/utils.c 2018-11-15 09:55:53.000000000 +0100 @@ -33,7 +33,7 @@ */ /* Table of CRCs for each possible byte, with a generator polynomial of 0x8408 */ -static const u_int16_t crc_table[256] = { +static const uint16_t crc_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, @@ -69,10 +69,10 @@ }; /* Calculate the CRC for a buffer using a seed of 0xffff */ -u_int16_t +uint16_t dm_crc16 (const char *buffer, size_t len) { - u_int16_t crc = 0xffff; + uint16_t crc = 0xffff; while (len--) crc = crc_table[(crc ^ *buffer++) & 0xff] ^ (crc >> 8); @@ -102,7 +102,7 @@ /* Since escaping potentially doubles the # of bytes, short-circuit the * length check if destination buffer is clearly large enough. Note the - * + * */ if (outbuf_len <= inbuf_len << 1) { size_t outbuf_required = inbuf_len + 1; /* +1 for the trailing control char */ @@ -187,7 +187,7 @@ char *outbuf, size_t outbuf_len) { - u_int16_t crc; + uint16_t crc; size_t escaped_len; qcdm_return_val_if_fail (inbuf != NULL, 0); @@ -242,7 +242,7 @@ { qcdmbool escaping = FALSE; size_t i, pkt_len = 0, unesc_len; - u_int16_t crc, pkt_crc; + uint16_t crc, pkt_crc; qcdm_return_val_if_fail (inbuf != NULL, FALSE); qcdm_return_val_if_fail (outbuf != NULL, FALSE); @@ -309,4 +309,3 @@ *out_decap_len = unesc_len - 2; /* decap_len should not include the CRC */ return TRUE; } - diff -Nru modemmanager-1.6.8/libqcdm/src/utils.h modemmanager-1.10.0/libqcdm/src/utils.h --- modemmanager-1.6.8/libqcdm/src/utils.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/src/utils.h 2018-11-15 09:55:53.000000000 +0100 @@ -19,20 +19,20 @@ #define LIBQCDM_UTILS_H #include -#include +#include -typedef u_int8_t qcdmbool; +typedef uint8_t qcdmbool; #ifndef TRUE -#define TRUE ((u_int8_t) 1) +#define TRUE ((uint8_t) 1) #endif #ifndef FALSE -#define FALSE ((u_int8_t) 0) +#define FALSE ((uint8_t) 0) #endif #define DIAG_CONTROL_CHAR 0x7E #define DIAG_TRAILER_LEN 3 -u_int16_t dm_crc16 (const char *buffer, size_t len); +uint16_t dm_crc16 (const char *buffer, size_t len); size_t dm_escape (const char *inbuf, size_t inbuf_len, @@ -60,4 +60,3 @@ qcdmbool *out_need_more); #endif /* LIBQCDM_UTILS_H */ - diff -Nru modemmanager-1.6.8/libqcdm/tests/ipv6pref.c modemmanager-1.10.0/libqcdm/tests/ipv6pref.c --- modemmanager-1.6.8/libqcdm/tests/ipv6pref.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/ipv6pref.c 2018-11-15 09:55:53.000000000 +0100 @@ -39,7 +39,7 @@ int i = 0, z; qcdmbool newline = FALSE; char tmp[500]; - u_int32_t flen; + uint32_t flen; flen = snprintf (tmp, sizeof (tmp) - 1, "%s (%zu) ", detail, len); fprintf (stdout, "%s", tmp); @@ -173,7 +173,7 @@ } static int -qcdm_set_ipv6_enabled (int fd, u_int8_t ipv6pref) +qcdm_set_ipv6_enabled (int fd, uint8_t ipv6pref) { int err; char buf[512]; @@ -216,7 +216,7 @@ size_t len; QcdmResult *result; size_t reply_len; - u_int8_t mode; + uint8_t mode; len = qcdm_cmd_nv_get_ipv6_enabled_new (buf, sizeof (buf)); assert (len); @@ -313,4 +313,3 @@ return 0; } - diff -Nru modemmanager-1.6.8/libqcdm/tests/Makefile.in modemmanager-1.10.0/libqcdm/tests/Makefile.in --- modemmanager-1.6.8/libqcdm/tests/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -104,14 +104,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -160,7 +159,15 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/ipv6pref-ipv6pref.Po \ + ./$(DEPDIR)/modepref-modepref.Po ./$(DEPDIR)/reset-reset.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm-com.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm-crc.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm-escaping.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm-result.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm-utils.Po \ + ./$(DEPDIR)/test_qcdm-test-qcdm.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -212,7 +219,6 @@ $(top_srcdir)/gtester.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -265,14 +271,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -393,8 +391,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -483,8 +479,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtester.make $(am__empty): @@ -528,15 +524,21 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipv6pref-ipv6pref.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modepref-modepref.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reset-reset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-com.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-crc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-escaping.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-result.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-utils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipv6pref-ipv6pref.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modepref-modepref.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reset-reset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-com.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-crc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-escaping.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-result.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm-utils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_qcdm-test-qcdm.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -746,7 +748,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -817,7 +822,15 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/ipv6pref-ipv6pref.Po + -rm -f ./$(DEPDIR)/modepref-modepref.Po + -rm -f ./$(DEPDIR)/reset-reset.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-com.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-crc.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-escaping.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-result.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-utils.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -863,7 +876,15 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/ipv6pref-ipv6pref.Po + -rm -f ./$(DEPDIR)/modepref-modepref.Po + -rm -f ./$(DEPDIR)/reset-reset.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-com.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-crc.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-escaping.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-result.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm-utils.Po + -rm -f ./$(DEPDIR)/test_qcdm-test-qcdm.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -884,19 +905,19 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru modemmanager-1.6.8/libqcdm/tests/modepref.c modemmanager-1.10.0/libqcdm/tests/modepref.c --- modemmanager-1.6.8/libqcdm/tests/modepref.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/modepref.c 2018-11-15 09:55:53.000000000 +0100 @@ -39,7 +39,7 @@ int i = 0, z; qcdmbool newline = FALSE; char tmp[500]; - u_int32_t flen; + uint32_t flen; flen = snprintf (tmp, sizeof (tmp) - 1, "%s (%zu) ", detail, len); fprintf (stdout, "%s", tmp); @@ -173,7 +173,7 @@ } static int -qcdm_set_mode_pref (int fd, u_int8_t modepref) +qcdm_set_mode_pref (int fd, uint8_t modepref) { int err; char buf[512]; @@ -217,7 +217,7 @@ QcdmResult *result; size_t reply_len; const char *smode = NULL; - u_int8_t mode = 0; + uint8_t mode = 0; len = qcdm_cmd_nv_get_mode_pref_new (buf, sizeof (buf), 0); assert (len); @@ -291,7 +291,7 @@ } static int -qcdm_set_hdr_pref (int fd, u_int8_t hdrpref) +qcdm_set_hdr_pref (int fd, uint8_t hdrpref) { int err; char buf[512]; @@ -334,7 +334,7 @@ size_t len; QcdmResult *result = NULL; size_t reply_len; - u_int8_t pref; + uint8_t pref; const char *spref = NULL; len = qcdm_cmd_nv_get_hdr_rev_pref_new (buf, sizeof (buf)); @@ -385,7 +385,7 @@ } static int -qcdm_set_mode (int fd, u_int8_t mode) +qcdm_set_mode (int fd, uint8_t mode) { int err; char buf[512]; @@ -435,8 +435,8 @@ static qcdmbool parse_mode (const char *s, - u_int8_t *out_mode, - u_int8_t *out_hdrpref, + uint8_t *out_mode, + uint8_t *out_hdrpref, qcdmbool *out_set_evdo) { if (strcasecmp (s, "lte") == 0) { @@ -506,8 +506,8 @@ int main (int argc, char *argv[]) { - u_int8_t mode = QCDM_CMD_NV_MODE_PREF_ITEM_MODE_PREF_AUTO; - u_int8_t hdrpref = QCDM_CMD_NV_HDR_REV_PREF_ITEM_REV_PREF_EHRPD; + uint8_t mode = QCDM_CMD_NV_MODE_PREF_ITEM_MODE_PREF_AUTO; + uint8_t hdrpref = QCDM_CMD_NV_HDR_REV_PREF_ITEM_REV_PREF_EHRPD; const char *dmport = argv[1]; const char *smode = argv[2]; const char *msg; @@ -570,4 +570,3 @@ return 0; } - diff -Nru modemmanager-1.6.8/libqcdm/tests/reset.c modemmanager-1.10.0/libqcdm/tests/reset.c --- modemmanager-1.6.8/libqcdm/tests/reset.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/reset.c 2018-11-15 09:55:53.000000000 +0100 @@ -40,7 +40,7 @@ int i = 0, z; qcdmbool newline = FALSE; char tmp[500]; - u_int32_t flen; + uint32_t flen; flen = snprintf (tmp, sizeof (tmp) - 1, "%s (%zu) ", detail, len); fprintf (stdout, "%s", tmp); @@ -174,7 +174,7 @@ } static int -qcdm_set_mode (int fd, u_int8_t mode) +qcdm_set_mode (int fd, uint8_t mode) { int err; char buf[512]; diff -Nru modemmanager-1.6.8/libqcdm/tests/test-qcdm-com.c modemmanager-1.10.0/libqcdm/tests/test-qcdm-com.c --- modemmanager-1.6.8/libqcdm/tests/test-qcdm-com.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/test-qcdm-com.c 2018-11-15 09:55:53.000000000 +0100 @@ -156,7 +156,7 @@ } static const char * -cm_call_state_to_string (u_int32_t state) +cm_call_state_to_string (uint32_t state) { switch (state) { case QCDM_CMD_CM_SUBSYS_STATE_INFO_CALL_STATE_IDLE: @@ -176,7 +176,7 @@ } static const char * -cm_system_mode_to_string (u_int32_t mode) +cm_system_mode_to_string (uint32_t mode) { switch (mode) { case QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_NO_SERVICE: @@ -1480,7 +1480,7 @@ gint len; QcdmResult *result; gsize reply_len; - u_int32_t items[] = { 0x002C, 0x002E, 0 }; + uint32_t items[] = { 0x002C, 0x002E, 0 }; guint32 maxlog = 0; /* First get # of items the device supports */ @@ -1505,7 +1505,7 @@ qcdm_result_unref (result); /* Now enable some log items */ - len = qcdm_cmd_ext_logmask_new (buf, sizeof (buf), items, (u_int16_t) maxlog); + len = qcdm_cmd_ext_logmask_new (buf, sizeof (buf), items, (uint16_t) maxlog); /* Send the command */ success = send_command (d, buf, len); @@ -1581,11 +1581,11 @@ gint len; QcdmResult *result; gsize reply_len; - u_int32_t num_items = 0; - const u_int16_t *items = NULL, *reread_items; + uint32_t num_items = 0; + const uint16_t *items = NULL, *reread_items; size_t items_len = 0, reread_len; - u_int32_t i; - u_int16_t test_items[] = { 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x102C, 0x102E, 0 }; + uint32_t i; + uint16_t test_items[] = { 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x102C, 0x102E, 0 }; /* Get existing mask for CDMA/EVDO equip ID */ len = qcdm_cmd_log_config_get_mask_new (buf, sizeof (buf), 0x01); @@ -1922,8 +1922,8 @@ QcdmResult *result; gsize reply_len; const char *str; - u_int32_t num; - u_int8_t u8; + uint32_t num; + uint8_t u8; len = qcdm_cmd_gsm_subsys_state_info_new (buf, sizeof (buf)); g_assert (len == 7); @@ -1984,4 +1984,3 @@ qcdm_result_unref (result); } - diff -Nru modemmanager-1.6.8/libqcdm/tests/test-qcdm-result.c modemmanager-1.10.0/libqcdm/tests/test-qcdm-result.c --- modemmanager-1.6.8/libqcdm/tests/test-qcdm-result.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libqcdm/tests/test-qcdm-result.c 2018-11-15 09:55:53.000000000 +0100 @@ -76,8 +76,8 @@ void test_result_uint8_array (void *f, void *data) { - u_int8_t array[] = { 0, 1, 255, 32, 128, 127 }; - const u_int8_t *tmp = NULL; + uint8_t array[] = { 0, 1, 255, 32, 128, 127 }; + const uint8_t *tmp = NULL; size_t tmp_len = 0; QcdmResult *result; @@ -90,4 +90,3 @@ qcdm_result_unref (result); } - diff -Nru modemmanager-1.6.8/libwmc/Makefile.in modemmanager-1.10.0/libwmc/Makefile.in --- modemmanager-1.6.8/libwmc/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libwmc/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -142,7 +141,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -191,7 +190,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -244,14 +242,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -372,8 +362,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -414,8 +402,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -532,7 +520,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff -Nru modemmanager-1.6.8/libwmc/src/commands.c modemmanager-1.10.0/libwmc/src/commands.c --- modemmanager-1.6.8/libwmc/src/commands.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/commands.c 2018-11-15 09:55:53.000000000 +0100 @@ -28,22 +28,22 @@ /**********************************************************************/ static int -check_command (const char *buf, size_t len, u_int8_t cmd, size_t min_len) +check_command (const char *buf, size_t len, uint8_t cmd, size_t min_len) { if (len < 1) { wmc_err (0, "Zero-length response"); return -WMC_ERROR_RESPONSE_BAD_LENGTH; } - if ((u_int8_t) buf[0] != WMC_CMD_MARKER) { + if ((uint8_t) buf[0] != WMC_CMD_MARKER) { wmc_err (0, "Missing WMC command marker (expected 0x%02X, got 0x%02X)", - WMC_CMD_MARKER, (u_int8_t) buf[0]); + WMC_CMD_MARKER, (uint8_t) buf[0]); return -WMC_ERROR_RESPONSE_UNEXPECTED; } - if ((u_int8_t) buf[1] != cmd) { + if ((uint8_t) buf[1] != cmd) { wmc_err (0, "Unexpected WMC command response (expected 0x%02X, got 0x%02X)", - (u_int8_t) cmd, (u_int8_t) buf[1]); + (uint8_t) cmd, (uint8_t) buf[1]); return -WMC_ERROR_RESPONSE_UNEXPECTED; } @@ -245,40 +245,40 @@ } static wmcbool -is_gsm_service (u_int8_t service) +is_gsm_service (uint8_t service) { return (service == WMC_SERVICE_GSM || service == WMC_SERVICE_GPRS || service == WMC_SERVICE_EDGE); } static wmcbool -is_umts_service (u_int8_t service) +is_umts_service (uint8_t service) { return (service == WMC_SERVICE_UMTS || service == WMC_SERVICE_HSDPA || service == WMC_SERVICE_HSUPA || service == WMC_SERVICE_HSPA); } static wmcbool -is_cdma_service (u_int8_t service) +is_cdma_service (uint8_t service) { return (service == WMC_SERVICE_IS95A || service == WMC_SERVICE_IS95B || service == WMC_SERVICE_1XRTT); } static wmcbool -is_evdo_service (u_int8_t service) +is_evdo_service (uint8_t service) { return (service == WMC_SERVICE_EVDO_0 || service == WMC_SERVICE_EVDO_A || service == WMC_SERVICE_EVDO_A_EHRPD); } static wmcbool -is_lte_service (u_int8_t service) +is_lte_service (uint8_t service) { return (service == WMC_SERVICE_LTE); } -static u_int8_t -sanitize_dbm (u_int8_t in_dbm, u_int8_t service) +static uint8_t +sanitize_dbm (uint8_t in_dbm, uint8_t service) { - u_int8_t cutoff; + uint8_t cutoff; /* 0x6A (-106 dBm) = no signal for GSM/GPRS/EDGE */ /* 0x7D (-125 dBm) = no signal for everything else */ @@ -297,7 +297,7 @@ WmcCmdNetworkInfo3Rsp *rsp3 = (WmcCmdNetworkInfo3Rsp *) buf; char tmp[65]; int err; - u_int32_t mccmnc = 0, mcc, mnc; + uint32_t mccmnc = 0, mcc, mnc; wmc_return_val_if_fail (buf != NULL, NULL); @@ -415,7 +415,7 @@ /**********************************************************************/ static wmcbool -validate_mode (u_int8_t mode) +validate_mode (uint8_t mode) { switch (mode) { case WMC_NETWORK_MODE_AUTO_CDMA: @@ -434,7 +434,7 @@ } size_t -wmc_cmd_set_global_mode_new (char *buf, size_t buflen, u_int8_t mode) +wmc_cmd_set_global_mode_new (char *buf, size_t buflen, uint8_t mode) { WmcCmdSetGlobalMode *cmd = (WmcCmdSetGlobalMode *) buf; @@ -464,4 +464,3 @@ } /**********************************************************************/ - diff -Nru modemmanager-1.6.8/libwmc/src/commands.h modemmanager-1.10.0/libwmc/src/commands.h --- modemmanager-1.6.8/libwmc/src/commands.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/commands.h 2018-11-15 09:55:53.000000000 +0100 @@ -107,7 +107,7 @@ /**********************************************************************/ -size_t wmc_cmd_set_global_mode_new (char *buf, size_t buflen, u_int8_t mode); +size_t wmc_cmd_set_global_mode_new (char *buf, size_t buflen, uint8_t mode); WmcResult * wmc_cmd_set_global_mode_result (const char *buf, size_t len); diff -Nru modemmanager-1.6.8/libwmc/src/Makefile.in modemmanager-1.10.0/libwmc/src/Makefile.in --- modemmanager-1.6.8/libwmc/src/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -133,7 +132,12 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libwmc_la-com.Plo \ + ./$(DEPDIR)/libwmc_la-commands.Plo \ + ./$(DEPDIR)/libwmc_la-errors.Plo \ + ./$(DEPDIR)/libwmc_la-result.Plo \ + ./$(DEPDIR)/libwmc_la-utils.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -182,7 +186,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -235,14 +238,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -363,8 +358,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -428,8 +421,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -461,11 +454,17 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-com.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-commands.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-errors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-result.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-com.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-commands.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-errors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-result.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwmc_la-utils.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -584,7 +583,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -654,7 +656,11 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libwmc_la-com.Plo + -rm -f ./$(DEPDIR)/libwmc_la-commands.Plo + -rm -f ./$(DEPDIR)/libwmc_la-errors.Plo + -rm -f ./$(DEPDIR)/libwmc_la-result.Plo + -rm -f ./$(DEPDIR)/libwmc_la-utils.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -700,7 +706,11 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libwmc_la-com.Plo + -rm -f ./$(DEPDIR)/libwmc_la-commands.Plo + -rm -f ./$(DEPDIR)/libwmc_la-errors.Plo + -rm -f ./$(DEPDIR)/libwmc_la-result.Plo + -rm -f ./$(DEPDIR)/libwmc_la-utils.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -721,16 +731,16 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am diff -Nru modemmanager-1.6.8/libwmc/src/protocol.h modemmanager-1.10.0/libwmc/src/protocol.h --- modemmanager-1.6.8/libwmc/src/protocol.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/protocol.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ #ifndef LIBWMC_PROTOCOL_H #define LIBWMC_PROTOCOL_H -#define WMC_CMD_MARKER ((u_int8_t) 0xC8) +#define WMC_CMD_MARKER ((uint8_t) 0xC8) enum { WMC_CMD_GET_GLOBAL_MODE = 0x03, @@ -51,108 +51,108 @@ /* Generic WMC command header */ struct WmcCmdHeader { - u_int8_t marker; /* Always 0xC8 */ - u_int8_t cmd; + uint8_t marker; /* Always 0xC8 */ + uint8_t cmd; } __attribute__ ((packed)); typedef struct WmcCmdHeader WmcCmdHeader; /* Used on newer devices like the UML190 and later */ struct WmcCmdInit2 { WmcCmdHeader hdr; - u_int16_t year; - u_int8_t month; - u_int16_t day; /* big endian */ - u_int16_t hours; /* big endian */ - u_int16_t minutes; /* big endian */ - u_int16_t seconds; /* big endian */ - u_int8_t _unknown1[3]; + uint16_t year; + uint8_t month; + uint16_t day; /* big endian */ + uint16_t hours; /* big endian */ + uint16_t minutes; /* big endian */ + uint16_t seconds; /* big endian */ + uint8_t _unknown1[3]; } __attribute__ ((packed)); typedef struct WmcCmdInit2 WmcCmdInit2; struct WmcCmdInit2Rsp { WmcCmdHeader hdr; - u_int8_t _unknown1[4]; + uint8_t _unknown1[4]; } __attribute__ ((packed)); typedef struct WmcCmdInit2Rsp WmcCmdInit2Rsp; struct WmcCmdDeviceInfoRsp { WmcCmdHeader hdr; - u_int8_t _unknown1[27]; + uint8_t _unknown1[27]; char manf[64]; char model[64]; char fwrev[64]; char hwrev[64]; - u_int8_t _unknown2[64]; - u_int8_t _unknown3[64]; + uint8_t _unknown2[64]; + uint8_t _unknown3[64]; char min[10]; /* CDMA2000/IS-95 MIN */ - u_int8_t _unknown4[12]; - u_int16_t home_sid; - u_int8_t _unknown5[2]; - u_int16_t prlver; - u_int8_t _unknown6[2]; - u_int16_t eriver; - u_int8_t _unknown7[4]; + uint8_t _unknown4[12]; + uint16_t home_sid; + uint8_t _unknown5[2]; + uint16_t prlver; + uint8_t _unknown6[2]; + uint16_t eriver; + uint8_t _unknown7[4]; } __attribute__ ((packed)); typedef struct WmcCmdDeviceInfoRsp WmcCmdDeviceInfoRsp; struct WmcCmdDeviceInfo2Rsp { WmcCmdHeader hdr; - u_int8_t _unknown1[27]; + uint8_t _unknown1[27]; char manf[64]; char model[64]; char fwrev[64]; char hwrev[64]; - u_int8_t _unknown2[64]; - u_int8_t _unknown3[64]; - u_int8_t min[10]; /* CDMA2000/IS-95 MIN */ - u_int8_t _unknown4[12]; - u_int16_t home_sid; - u_int8_t _unknown5[2]; - u_int16_t prlver; - u_int8_t _unknown6[2]; - u_int16_t eriver; - u_int8_t _unknown7[4]; - u_int8_t _unknown8[64]; - u_int8_t meid[14]; - u_int8_t _unknown10[6]; /* always zero */ - u_int8_t imei[16]; - u_int8_t _unknown11[6]; /* always zero */ - u_int8_t _unknown12[16]; - u_int8_t iccid[20]; - u_int8_t _unknown13[6]; + uint8_t _unknown2[64]; + uint8_t _unknown3[64]; + uint8_t min[10]; /* CDMA2000/IS-95 MIN */ + uint8_t _unknown4[12]; + uint16_t home_sid; + uint8_t _unknown5[2]; + uint16_t prlver; + uint8_t _unknown6[2]; + uint16_t eriver; + uint8_t _unknown7[4]; + uint8_t _unknown8[64]; + uint8_t meid[14]; + uint8_t _unknown10[6]; /* always zero */ + uint8_t imei[16]; + uint8_t _unknown11[6]; /* always zero */ + uint8_t _unknown12[16]; + uint8_t iccid[20]; + uint8_t _unknown13[6]; } __attribute__ ((packed)); typedef struct WmcCmdDeviceInfo2Rsp WmcCmdDeviceInfo2Rsp; struct WmcCmdDeviceInfo3Rsp { WmcCmdHeader hdr; - u_int8_t _unknown1[27]; + uint8_t _unknown1[27]; char manf[64]; char model[64]; char fwrev[64]; char hwrev[64]; - u_int8_t _unknown2[64]; - u_int8_t _unknown3[64]; - u_int8_t min[10]; /* CDMA2000/IS-95 MIN */ - u_int8_t _unknown4[12]; - u_int16_t home_sid; - u_int8_t _unknown5[2]; - u_int16_t prlver; - u_int8_t _unknown6[2]; - u_int16_t eri_ver; - u_int8_t _unknown7[4]; - u_int8_t _unknown8[64]; - u_int8_t meid[14]; - u_int8_t _unknown10[6]; /* always zero */ - u_int8_t imei[16]; - u_int8_t _unknown11[6]; /* always zero */ - u_int8_t _unknown12[16]; - u_int8_t iccid[20]; - u_int8_t _unknown13[6]; - u_int8_t mcc[16]; - u_int8_t mnc[16]; - u_int8_t _unknown14[4]; - u_int8_t _unknown15[4]; - u_int8_t _unknown16[4]; + uint8_t _unknown2[64]; + uint8_t _unknown3[64]; + uint8_t min[10]; /* CDMA2000/IS-95 MIN */ + uint8_t _unknown4[12]; + uint16_t home_sid; + uint8_t _unknown5[2]; + uint16_t prlver; + uint8_t _unknown6[2]; + uint16_t eri_ver; + uint8_t _unknown7[4]; + uint8_t _unknown8[64]; + uint8_t meid[14]; + uint8_t _unknown10[6]; /* always zero */ + uint8_t imei[16]; + uint8_t _unknown11[6]; /* always zero */ + uint8_t _unknown12[16]; + uint8_t iccid[20]; + uint8_t _unknown13[6]; + uint8_t mcc[16]; + uint8_t mnc[16]; + uint8_t _unknown14[4]; + uint8_t _unknown15[4]; + uint8_t _unknown16[4]; } __attribute__ ((packed)); typedef struct WmcCmdDeviceInfo3Rsp WmcCmdDeviceInfo3Rsp; @@ -180,94 +180,94 @@ /* PC5740 response */ struct WmcCmdNetworkInfoRsp { WmcCmdHeader hdr; - u_int8_t _unknown1; - u_int8_t _unknown2[3]; /* Always zero */ - u_int8_t service; /* One of WMC_SERVICE_* */ - u_int8_t _unknown3; /* Either 0x00 or 0x01 */ - u_int16_t ts_year; - u_int8_t ts_month; - u_int16_t ts_day; /* BE */ - u_int16_t ts_hours; /* BE */ - u_int16_t ts_minutes; /* BE */ - u_int16_t ts_seconds; /* BE */ - u_int16_t counter1; /* A timestamp/counter? */ - u_int16_t _unknown4; - u_int8_t _unknown5[3]; /* Always 0xFE 0xFF 0xFF */ - u_int8_t two_g_dbm; /* 0x7D = no signal */ - u_int8_t _unknown6[37]; /* Always zero */ + uint8_t _unknown1; + uint8_t _unknown2[3]; /* Always zero */ + uint8_t service; /* One of WMC_SERVICE_* */ + uint8_t _unknown3; /* Either 0x00 or 0x01 */ + uint16_t ts_year; + uint8_t ts_month; + uint16_t ts_day; /* BE */ + uint16_t ts_hours; /* BE */ + uint16_t ts_minutes; /* BE */ + uint16_t ts_seconds; /* BE */ + uint16_t counter1; /* A timestamp/counter? */ + uint16_t _unknown4; + uint8_t _unknown5[3]; /* Always 0xFE 0xFF 0xFF */ + uint8_t two_g_dbm; /* 0x7D = no signal */ + uint8_t _unknown6[37]; /* Always zero */ } __attribute__ ((packed)); typedef struct WmcCmdNetworkInfoRsp WmcCmdNetworkInfoRsp; /* UML190 response */ struct WmcCmdNetworkInfo2Rsp { WmcCmdHeader hdr; - u_int8_t _unknown1; /* 0x00 on LTE, 0x07 or 0x1F on CDMA */ - u_int8_t _unknown2[3]; /* Always zero */ - u_int8_t service; /* One of WMC_SERVICE_* */ - u_int8_t _unknown3; - u_int16_t ts_year; - u_int8_t ts_month; - u_int16_t ts_day; /* BE */ - u_int16_t ts_hours; /* BE */ - u_int16_t ts_minutes; /* BE */ - u_int16_t ts_seconds; /* BE */ - u_int8_t _unknown4; /* always zero */ - u_int16_t uptime_secs; - u_int8_t _unknown5; - u_int8_t _unknown6[3]; /* always zero on LTE, 0xFE 0xFF 0xFF on CDMA */ - u_int8_t two_g_dbm; /* 0x7D = no CDMA signal, 0x6a = no GSM signal */ - u_int8_t _unknown7[3]; /* Always zero */ - u_int8_t cdma_opname[16]; /* Zero terminated? */ - u_int8_t _unknown8[18]; /* Always zero */ - u_int8_t three_g_dbm; /* 0x7D = no signal */ - u_int8_t _unknown9[3]; /* Always zero */ - u_int8_t _unknown10; /* 0x01 on LTE, 0x40 on CDMA */ - u_int8_t _unknown11[3]; /* Always zero */ - u_int8_t _unknown12; /* Always 0x01 */ - u_int8_t tgpp_opname[8]; /* 3GPP operator name (Zero terminated? Sometimes "MCC MNC" too */ - u_int8_t _unknown13[4]; /* Always zero */ - u_int32_t _unknown14; /* 43 75 3a 00 on GSM/WCDMA mode, zero on others */ - u_int32_t _unknown15; /* 49 7d 3a 00 on GSM/WCDMA mode, zero on others */ - u_int8_t _unknown16[44]; /* Always zero */ - u_int32_t mcc_mnc; /* GSM/WCDMA only, see MCC/MNC format note */ + uint8_t _unknown1; /* 0x00 on LTE, 0x07 or 0x1F on CDMA */ + uint8_t _unknown2[3]; /* Always zero */ + uint8_t service; /* One of WMC_SERVICE_* */ + uint8_t _unknown3; + uint16_t ts_year; + uint8_t ts_month; + uint16_t ts_day; /* BE */ + uint16_t ts_hours; /* BE */ + uint16_t ts_minutes; /* BE */ + uint16_t ts_seconds; /* BE */ + uint8_t _unknown4; /* always zero */ + uint16_t uptime_secs; + uint8_t _unknown5; + uint8_t _unknown6[3]; /* always zero on LTE, 0xFE 0xFF 0xFF on CDMA */ + uint8_t two_g_dbm; /* 0x7D = no CDMA signal, 0x6a = no GSM signal */ + uint8_t _unknown7[3]; /* Always zero */ + uint8_t cdma_opname[16]; /* Zero terminated? */ + uint8_t _unknown8[18]; /* Always zero */ + uint8_t three_g_dbm; /* 0x7D = no signal */ + uint8_t _unknown9[3]; /* Always zero */ + uint8_t _unknown10; /* 0x01 on LTE, 0x40 on CDMA */ + uint8_t _unknown11[3]; /* Always zero */ + uint8_t _unknown12; /* Always 0x01 */ + uint8_t tgpp_opname[8]; /* 3GPP operator name (Zero terminated? Sometimes "MCC MNC" too */ + uint8_t _unknown13[4]; /* Always zero */ + uint32_t _unknown14; /* 43 75 3a 00 on GSM/WCDMA mode, zero on others */ + uint32_t _unknown15; /* 49 7d 3a 00 on GSM/WCDMA mode, zero on others */ + uint8_t _unknown16[44]; /* Always zero */ + uint32_t mcc_mnc; /* GSM/WCDMA only, see MCC/MNC format note */ } __attribute__ ((packed)); typedef struct WmcCmdNetworkInfo2Rsp WmcCmdNetworkInfo2Rsp; /* UML290 response */ struct WmcCmdNetworkInfo3Rsp { WmcCmdHeader hdr; - u_int8_t _unknown1; /* 0x00 on LTE, 0x07 or 0x1F on CDMA */ - u_int8_t _unknown2[3]; /* Always zero */ - u_int8_t service; /* One of WMC_SERVICE_* */ - u_int8_t _unknown3; - u_int16_t ts_year; - u_int8_t ts_month; - u_int16_t ts_day; /* BE */ - u_int16_t ts_hours; /* BE */ - u_int16_t ts_minutes; /* BE */ - u_int16_t ts_seconds; /* BE */ - u_int8_t _unknown4; /* always zero */ - u_int16_t uptime_secs; - u_int8_t _unknown5; - u_int8_t _unknown6[3]; /* always zero on LTE, 0xFE 0xFF 0xFF on CDMA */ - u_int8_t two_g_dbm; /* 0x7D = no CDMA signal, 0x6a = no GSM signal */ - u_int8_t _unknown7[3]; /* Always zero */ - u_int8_t cdma_opname[16]; /* Zero terminated? */ - u_int8_t _unknown8[18]; /* Always zero */ - u_int8_t three_g_dbm; /* 0x7D = no signal */ - u_int8_t _unknown9[3]; /* Always zero */ - u_int8_t _unknown10; /* 0x01 on LTE, 0x40 on CDMA */ - u_int8_t _unknown11[3]; /* Always zero */ - u_int8_t _unknown12; /* Always 0x01 */ - u_int8_t tgpp_opname[8]; /* Zero terminated? Sometimes "MCC MNC" too */ - u_int8_t _unknown13[4]; /* Always zero */ - u_int32_t _unknown14; /* 43 75 3a 00 on GSM/WCDMA mode, zero on others */ - u_int32_t _unknown15; /* 49 7d 3a 00 on GSM/WCDMA mode, zero on others */ - u_int8_t _unknown16[44]; /* Always zero */ - u_int32_t mcc_mnc; /* GSM/WCDMA only, see MCC/MNC format note */ - u_int8_t lte_dbm; /* 0x00 if not in LTE mode */ - u_int8_t _unknown17[3]; /* Always zero */ - u_int8_t _unknown18[4]; + uint8_t _unknown1; /* 0x00 on LTE, 0x07 or 0x1F on CDMA */ + uint8_t _unknown2[3]; /* Always zero */ + uint8_t service; /* One of WMC_SERVICE_* */ + uint8_t _unknown3; + uint16_t ts_year; + uint8_t ts_month; + uint16_t ts_day; /* BE */ + uint16_t ts_hours; /* BE */ + uint16_t ts_minutes; /* BE */ + uint16_t ts_seconds; /* BE */ + uint8_t _unknown4; /* always zero */ + uint16_t uptime_secs; + uint8_t _unknown5; + uint8_t _unknown6[3]; /* always zero on LTE, 0xFE 0xFF 0xFF on CDMA */ + uint8_t two_g_dbm; /* 0x7D = no CDMA signal, 0x6a = no GSM signal */ + uint8_t _unknown7[3]; /* Always zero */ + uint8_t cdma_opname[16]; /* Zero terminated? */ + uint8_t _unknown8[18]; /* Always zero */ + uint8_t three_g_dbm; /* 0x7D = no signal */ + uint8_t _unknown9[3]; /* Always zero */ + uint8_t _unknown10; /* 0x01 on LTE, 0x40 on CDMA */ + uint8_t _unknown11[3]; /* Always zero */ + uint8_t _unknown12; /* Always 0x01 */ + uint8_t tgpp_opname[8]; /* Zero terminated? Sometimes "MCC MNC" too */ + uint8_t _unknown13[4]; /* Always zero */ + uint32_t _unknown14; /* 43 75 3a 00 on GSM/WCDMA mode, zero on others */ + uint32_t _unknown15; /* 49 7d 3a 00 on GSM/WCDMA mode, zero on others */ + uint8_t _unknown16[44]; /* Always zero */ + uint32_t mcc_mnc; /* GSM/WCDMA only, see MCC/MNC format note */ + uint8_t lte_dbm; /* 0x00 if not in LTE mode */ + uint8_t _unknown17[3]; /* Always zero */ + uint8_t _unknown18[4]; } __attribute__ ((packed)); typedef struct WmcCmdNetworkInfo3Rsp WmcCmdNetworkInfo3Rsp; @@ -291,26 +291,26 @@ /* Used on UML190 */ struct WmcCmdConnectionInfoRsp { WmcCmdHeader hdr; - u_int32_t rx_bytes; - u_int32_t tx_bytes; - u_int8_t _unknown1[8]; - u_int8_t state; /* One of WMC_CONNECTION_STATE_* */ - u_int8_t _unknown2[3]; /* Always 0xc0 0x0b 0x00 */ + uint32_t rx_bytes; + uint32_t tx_bytes; + uint8_t _unknown1[8]; + uint8_t state; /* One of WMC_CONNECTION_STATE_* */ + uint8_t _unknown2[3]; /* Always 0xc0 0x0b 0x00 */ } __attribute__ ((packed)); typedef struct WmcCmdConnectionInfoRsp WmcCmdConnectionInfoRsp; /* Used on UML290 */ struct WmcCmdConnectionInfo2Rsp { WmcCmdHeader hdr; - u_int32_t rx_bytes; - u_int32_t tx_bytes; - u_int8_t _unknown1[8]; - u_int8_t state; /* One of WMC_CONNECTION_STATE_* */ - u_int8_t _unknown2[3]; /* Always 0xc0 0x0b 0x00 */ - u_int8_t _unknown3[4]; /* Always 0x01 0x00 0x00 0x00 */ - u_int8_t ip4_address[16]; /* String format, ie "10.156.45.3" */ - u_int8_t _unknown4[8]; /* Netmask? */ - u_int8_t ip6_address[40]; /* String format */ + uint32_t rx_bytes; + uint32_t tx_bytes; + uint8_t _unknown1[8]; + uint8_t state; /* One of WMC_CONNECTION_STATE_* */ + uint8_t _unknown2[3]; /* Always 0xc0 0x0b 0x00 */ + uint8_t _unknown3[4]; /* Always 0x01 0x00 0x00 0x00 */ + uint8_t ip4_address[16]; /* String format, ie "10.156.45.3" */ + uint8_t _unknown4[8]; /* Netmask? */ + uint8_t ip6_address[40]; /* String format */ } __attribute__ ((packed)); typedef struct WmcCmdConnection2InfoRsp WmcCmdConnection2InfoRsp; @@ -329,16 +329,16 @@ struct WmcCmdGetGlobalMode { WmcCmdHeader hdr; - u_int8_t _unknown1; /* always 0 */ + uint8_t _unknown1; /* always 0 */ } __attribute__ ((packed)); typedef struct WmcCmdGetGlobalMode WmcCmdGetGlobalMode; struct WmcCmdGetGlobalModeRsp { WmcCmdHeader hdr; - u_int8_t _unknown1; /* always 0x01 */ - u_int8_t mode; /* one of WMC_GLOBAL_MODE_* */ - u_int8_t _unknown2; /* always 0x05 */ - u_int8_t _unknown3; /* always 0x00 */ + uint8_t _unknown1; /* always 0x01 */ + uint8_t mode; /* one of WMC_GLOBAL_MODE_* */ + uint8_t _unknown2; /* always 0x05 */ + uint8_t _unknown3; /* always 0x00 */ } __attribute__ ((packed)); typedef struct WmcCmdGetGlobalModeRsp WmcCmdGetGlobalModeRsp; @@ -346,17 +346,17 @@ struct WmcCmdSetGlobalMode { WmcCmdHeader hdr; - u_int8_t _unknown1; /* always 0x01 */ - u_int8_t mode; /* one of WMC_GLOBAL_MODE_* */ - u_int8_t _unknown2; /* always 0x05 */ - u_int8_t _unknown3; /* always 0x00 */ + uint8_t _unknown1; /* always 0x01 */ + uint8_t mode; /* one of WMC_GLOBAL_MODE_* */ + uint8_t _unknown2; /* always 0x05 */ + uint8_t _unknown3; /* always 0x00 */ } __attribute__ ((packed)); typedef struct WmcCmdSetGlobalMode WmcCmdSetGlobalMode; struct WmcCmdSetGlobalModeRsp { WmcCmdHeader hdr; - u_int8_t _unknown1; /* always 0x01 */ - u_int32_t _unknown2; /* always zero */ + uint8_t _unknown1; /* always 0x01 */ + uint32_t _unknown2; /* always zero */ } __attribute__ ((packed)); typedef struct WmcCmdSetGlobalModeRsp WmcCmdSetGlobalModeRsp; @@ -364,11 +364,11 @@ struct WmcCmdSetOperator { WmcCmdHeader hdr; - u_int8_t automatic; /* 0x00 = manual, 0x01 = auto */ - u_int8_t _unknown1; /* always 0x50 */ - u_int8_t _unknown2[3]; /* always zero */ - u_int32_t mcc_mnc; /* MCC/MNC for manual reg (see format note), zero for auto */ - u_int8_t _unknown3[56]; /* always zero */ + uint8_t automatic; /* 0x00 = manual, 0x01 = auto */ + uint8_t _unknown1; /* always 0x50 */ + uint8_t _unknown2[3]; /* always zero */ + uint32_t mcc_mnc; /* MCC/MNC for manual reg (see format note), zero for auto */ + uint8_t _unknown3[56]; /* always zero */ } __attribute__ ((packed)); typedef struct WmcCmdSetOperator WmcCmdSetOperator; @@ -380,8 +380,8 @@ struct WmcCmdSetOperatorRsp { WmcCmdHeader hdr; - u_int8_t status; /* one of WMC_SET_OPERATOR_STATUS_* */ - u_int8_t _unknown1[3]; /* always zero */ + uint8_t status; /* one of WMC_SET_OPERATOR_STATUS_* */ + uint8_t _unknown1[3]; /* always zero */ } __attribute__ ((packed)); typedef struct WmcCmdSetOperatorRsp WmcCmdSetOperatorRsp; @@ -396,18 +396,18 @@ /* Response for both GET_FIRST_OPERATOR and GET_NEXT_OPERATOR */ struct WmcCmdGetOperatorRsp { WmcCmdHeader hdr; - u_int8_t _unknown1; /* Usually 0x50, sometimes 0x00 */ - u_int8_t _unknown2[3]; /* always zero */ - u_int32_t mcc_mnc; /* see format note */ - u_int8_t opname[8]; - u_int8_t _unknown3[56]; /* always zero */ - u_int8_t stat; /* follows 3GPP TS27.007 +COPS ? */ - u_int8_t _unknown4[3]; /* always zero */ - u_int8_t service; /* one of WMC_OPERATOR_SERVICE_* */ - u_int8_t _unknown5[3]; /* always zero */ - u_int8_t _unknown6; /* 0x63 (GET_FIRST_OP) might mean "wait" */ - u_int8_t _unknown7; /* 0x00 or 0x01 */ - u_int8_t _unknown8[2]; /* always zero */ + uint8_t _unknown1; /* Usually 0x50, sometimes 0x00 */ + uint8_t _unknown2[3]; /* always zero */ + uint32_t mcc_mnc; /* see format note */ + uint8_t opname[8]; + uint8_t _unknown3[56]; /* always zero */ + uint8_t stat; /* follows 3GPP TS27.007 +COPS ? */ + uint8_t _unknown4[3]; /* always zero */ + uint8_t service; /* one of WMC_OPERATOR_SERVICE_* */ + uint8_t _unknown5[3]; /* always zero */ + uint8_t _unknown6; /* 0x63 (GET_FIRST_OP) might mean "wait" */ + uint8_t _unknown7; /* 0x00 or 0x01 */ + uint8_t _unknown8[2]; /* always zero */ } __attribute__ ((packed)); typedef struct WmcCmdGetOperatorRsp WmcCmdGetOperatorRsp; @@ -422,38 +422,38 @@ /* Later devices return all zeros for this command */ struct WmcCmdFieldTestRsp { WmcCmdHeader hdr; - u_int8_t prl_requirements; - u_int8_t eri_support; + uint8_t prl_requirements; + uint8_t eri_support; char nam_name[7]; - u_int8_t _unknown1; /* always zero */ - u_int8_t _unknown2[3]; /* always 0x0A 0x0A 0x0A */ - u_int8_t _unknown3[5]; /* always zero */ - u_int8_t _unknown4[10]; /* all 0x0F */ - u_int16_t home_sid; - u_int16_t home_nid; + uint8_t _unknown1; /* always zero */ + uint8_t _unknown2[3]; /* always 0x0A 0x0A 0x0A */ + uint8_t _unknown3[5]; /* always zero */ + uint8_t _unknown4[10]; /* all 0x0F */ + uint16_t home_sid; + uint16_t home_nid; char min1[7]; char min2[3]; char mcc[3]; char imsi_s[10]; char mnc[2]; - u_int16_t primary_cdma_chan_a; - u_int16_t secondary_cdma_chan_a; - u_int16_t primary_cdma_chan_b; - u_int16_t secondary_cdma_chan_b; - u_int8_t accolc; + uint16_t primary_cdma_chan_a; + uint16_t secondary_cdma_chan_a; + uint16_t primary_cdma_chan_b; + uint16_t secondary_cdma_chan_b; + uint8_t accolc; char sw_version[64]; char hw_version[64]; - u_int16_t prlver; - u_int16_t eriver; - u_int16_t nid; - u_int8_t last_call_end_reason; /* ? */ - u_int8_t rssi; - u_int16_t channel; - u_int8_t prev; - u_int16_t pn_offset; - u_int8_t sys_select_pref; - u_int8_t mip_pref; - u_int8_t hybrid_pref; + uint16_t prlver; + uint16_t eriver; + uint16_t nid; + uint8_t last_call_end_reason; /* ? */ + uint8_t rssi; + uint16_t channel; + uint8_t prev; + uint16_t pn_offset; + uint8_t sys_select_pref; + uint8_t mip_pref; + uint8_t hybrid_pref; } __attribute__ ((packed)); typedef struct WmcCmdFieldTestRsp WmcCmdFieldTestRsp; diff -Nru modemmanager-1.6.8/libwmc/src/result.c modemmanager-1.10.0/libwmc/src/result.c --- modemmanager-1.6.8/libwmc/src/result.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/result.c 2018-11-15 09:55:53.000000000 +0100 @@ -38,8 +38,8 @@ ValType type; union { char *s; - u_int8_t u8; - u_int32_t u32; + uint8_t u8; + uint32_t u32; } u; Val *next; }; @@ -76,7 +76,7 @@ } static Val * -val_new_u8 (const char *key, u_int8_t u) +val_new_u8 (const char *key, uint8_t u) { Val *v; @@ -94,7 +94,7 @@ } static Val * -val_new_u32 (const char *key, u_int32_t u) +val_new_u32 (const char *key, uint32_t u) { Val *v; @@ -114,7 +114,7 @@ /*********************************************************/ struct WmcResult { - u_int32_t refcount; + uint32_t refcount; Val *first; }; @@ -225,7 +225,7 @@ void wmc_result_add_u8 (WmcResult *r, const char *key, - u_int8_t num) + uint8_t num) { Val *v; @@ -242,7 +242,7 @@ int wmc_result_get_u8 (WmcResult *r, const char *key, - u_int8_t *out_val) + uint8_t *out_val) { Val *v; @@ -262,7 +262,7 @@ void wmc_result_add_u32 (WmcResult *r, const char *key, - u_int32_t num) + uint32_t num) { Val *v; @@ -279,7 +279,7 @@ int wmc_result_get_u32 (WmcResult *r, const char *key, - u_int32_t *out_val) + uint32_t *out_val) { Val *v; @@ -295,4 +295,3 @@ *out_val = v->u.u32; return 0; } - diff -Nru modemmanager-1.6.8/libwmc/src/result.h modemmanager-1.10.0/libwmc/src/result.h --- modemmanager-1.6.8/libwmc/src/result.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/result.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ #ifndef LIBWMC_RESULT_H #define LIBWMC_RESULT_H -#include +#include typedef struct WmcResult WmcResult; @@ -28,15 +28,14 @@ int wmc_result_get_u8 (WmcResult *r, const char *key, - u_int8_t *out_val); + uint8_t *out_val); int wmc_result_get_u32 (WmcResult *r, const char *key, - u_int32_t *out_val); + uint32_t *out_val); WmcResult *wmc_result_ref (WmcResult *r); void wmc_result_unref (WmcResult *r); #endif /* LIBWMC_RESULT_H */ - diff -Nru modemmanager-1.6.8/libwmc/src/result-private.h modemmanager-1.10.0/libwmc/src/result-private.h --- modemmanager-1.6.8/libwmc/src/result-private.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/result-private.h 2018-11-15 09:55:53.000000000 +0100 @@ -28,11 +28,10 @@ void wmc_result_add_u8 (WmcResult *result, const char *key, - u_int8_t num); + uint8_t num); void wmc_result_add_u32 (WmcResult *result, const char *key, - u_int32_t num); + uint32_t num); #endif /* LIBWMC_RESULT_PRIVATE_H */ - diff -Nru modemmanager-1.6.8/libwmc/src/utils.c modemmanager-1.10.0/libwmc/src/utils.c --- modemmanager-1.6.8/libwmc/src/utils.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/utils.c 2018-11-15 09:55:53.000000000 +0100 @@ -33,7 +33,7 @@ */ /* Table of CRCs for each possible byte, with a generator polynomial of 0x8408 */ -static const u_int16_t crc_table[256] = { +static const uint16_t crc_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, @@ -69,10 +69,10 @@ }; /* Calculate the CRC for a buffer using a seed of 0xffff */ -u_int16_t -wmc_crc16 (const char *buffer, size_t len, u_int16_t seed) +uint16_t +wmc_crc16 (const char *buffer, size_t len, uint16_t seed) { - u_int16_t crc = seed ? seed : 0xFFFF; + uint16_t crc = seed ? seed : 0xFFFF; while (len--) crc = crc_table[(crc ^ *buffer++) & 0xff] ^ (crc >> 8); @@ -103,7 +103,7 @@ /* Since escaping potentially doubles the # of bytes, short-circuit the * length check if destination buffer is clearly large enough. Note the - * + * */ if (outbuf_len <= inbuf_len << 1) { size_t outbuf_required = inbuf_len + 1; /* +1 for the trailing control char */ @@ -129,7 +129,7 @@ src = inbuf; i = inbuf_len; while (i--) { - u_int8_t byte = (u_int8_t) *src++; + uint8_t byte = (uint8_t) *src++; if ( byte == DIAG_CONTROL_CHAR || byte == DIAG_ESC_CHAR @@ -194,13 +194,13 @@ hdlc_encapsulate_buffer (char *inbuf, size_t cmd_len, size_t inbuf_len, - u_int16_t crc_seed, + uint16_t crc_seed, wmcbool add_trailer, wmcbool escape_all_ctrl, char *outbuf, size_t outbuf_len) { - u_int16_t crc; + uint16_t crc; size_t escaped_len; wmc_return_val_if_fail (inbuf != NULL, 0); @@ -338,7 +338,7 @@ hdlc_decapsulate_buffer (const char *inbuf, size_t inbuf_len, wmcbool check_known_crc, - u_int16_t known_crc, + uint16_t known_crc, char *outbuf, size_t outbuf_len, size_t *out_decap_len, @@ -347,7 +347,7 @@ { wmcbool escaping = FALSE; size_t i, pkt_len = 0, unesc_len; - u_int16_t crc, pkt_crc; + uint16_t crc, pkt_crc; wmc_return_val_if_fail (inbuf != NULL, FALSE); wmc_return_val_if_fail (outbuf != NULL, FALSE); @@ -457,4 +457,3 @@ outbuf, outbuf_len, out_decap_len, out_used, out_need_more); } - diff -Nru modemmanager-1.6.8/libwmc/src/utils.h modemmanager-1.10.0/libwmc/src/utils.h --- modemmanager-1.6.8/libwmc/src/utils.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/src/utils.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,14 +18,14 @@ #ifndef LIBWMC_UTILS_H #define LIBWMC_UTILS_H -#include +#include -typedef u_int8_t wmcbool; +typedef uint8_t wmcbool; #ifndef TRUE -#define TRUE ((u_int8_t) 1) +#define TRUE ((uint8_t) 1) #endif #ifndef FALSE -#define FALSE ((u_int8_t) 0) +#define FALSE ((uint8_t) 0) #endif #define DIAG_CONTROL_CHAR 0x7E @@ -33,7 +33,7 @@ /* Utility and testcase functions */ -u_int16_t wmc_crc16 (const char *buffer, size_t len, u_int16_t seed); +uint16_t wmc_crc16 (const char *buffer, size_t len, uint16_t seed); size_t hdlc_escape (const char *inbuf, size_t inbuf_len, @@ -50,7 +50,7 @@ size_t hdlc_encapsulate_buffer (char *inbuf, size_t cmd_len, size_t inbuf_len, - u_int16_t crc_seed, + uint16_t crc_seed, wmcbool add_trailer, wmcbool escape_all_ctrl, char *outbuf, @@ -59,7 +59,7 @@ wmcbool hdlc_decapsulate_buffer (const char *inbuf, size_t inbuf_len, wmcbool check_known_crc, - u_int16_t known_crc, + uint16_t known_crc, char *outbuf, size_t outbuf_len, size_t *out_decap_len, @@ -85,4 +85,3 @@ wmcbool uml290); #endif /* LIBWMC_UTILS_H */ - diff -Nru modemmanager-1.6.8/libwmc/tests/Makefile.in modemmanager-1.10.0/libwmc/tests/Makefile.in --- modemmanager-1.6.8/libwmc/tests/Makefile.in 2017-06-17 10:24:57.000000000 +0200 +++ modemmanager-1.10.0/libwmc/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -97,14 +97,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -139,7 +138,12 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/test_wmc-test-wmc-com.Po \ + ./$(DEPDIR)/test_wmc-test-wmc-crc.Po \ + ./$(DEPDIR)/test_wmc-test-wmc-escaping.Po \ + ./$(DEPDIR)/test_wmc-test-wmc-utils.Po \ + ./$(DEPDIR)/test_wmc-test-wmc.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -189,7 +193,6 @@ $(top_srcdir)/gtester.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -242,14 +245,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -370,8 +365,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -437,8 +430,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtester.make $(am__empty): @@ -470,11 +463,17 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-com.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-crc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-escaping.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-utils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-com.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-crc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-escaping.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc-utils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wmc-test-wmc.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -628,7 +627,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -699,7 +701,11 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-com.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-crc.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-escaping.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-utils.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -745,7 +751,11 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-com.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-crc.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-escaping.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc-utils.Po + -rm -f ./$(DEPDIR)/test_wmc-test-wmc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -766,19 +776,19 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru modemmanager-1.6.8/libwmc/tests/test-wmc-com.c modemmanager-1.10.0/libwmc/tests/test-wmc-com.c --- modemmanager-1.6.8/libwmc/tests/test-wmc-com.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/libwmc/tests/test-wmc-com.c 2018-11-15 09:55:53.000000000 +0100 @@ -347,7 +347,7 @@ } static const char * -service_to_string (u_int8_t service) +service_to_string (uint8_t service) { switch (service) { case WMC_NETWORK_SERVICE_NONE: @@ -392,7 +392,7 @@ wmcbool success; char buf[1024]; const char *str; - u_int8_t dbm, service; + uint8_t dbm, service; gint len; WmcResult *result; size_t reply_len; @@ -445,7 +445,7 @@ } static const char * -mode_to_string (u_int8_t service) +mode_to_string (uint8_t service) { switch (service) { case WMC_NETWORK_MODE_AUTO_CDMA: @@ -475,7 +475,7 @@ TestComData *d = data; wmcbool success; char buf[1024]; - u_int8_t mode; + uint8_t mode; gint len; WmcResult *result; size_t reply_len; @@ -502,4 +502,3 @@ wmc_result_unref (result); } - diff -Nru modemmanager-1.6.8/ltmain.sh modemmanager-1.10.0/ltmain.sh --- modemmanager-1.6.8/ltmain.sh 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/ltmain.sh 2019-01-17 16:15:41.000000000 +0100 @@ -1,12 +1,12 @@ #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2018-07-24.06 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.6.42-b88ce # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.6.42-b88ce +package_revision=2.4.6.42 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2018-07-24.06; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2018 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 3 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -140,9 +131,6 @@ fi" done -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - # Make sure IFS has a sensible default sp=' ' nl=' @@ -159,6 +147,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +267,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +303,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -580,16 +588,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1099,199 @@ } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + case $func_quote_portable_result in + *[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1337,8 @@ _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1363,8 @@ _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1491,26 @@ # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2018 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 3 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2018-07-24.06; # UTC ## ------ ## @@ -1415,7 +1533,7 @@ # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1545,7 @@ # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1594,8 @@ ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1628,8 @@ # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1638,28 @@ } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1669,19 @@ case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1691,18 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1712,8 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1722,36 @@ # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1762,26 @@ # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1791,27 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1820,8 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1832,7 @@ opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1844,32 @@ { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1879,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1935,24 @@ shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +1969,10 @@ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2028,8 @@ # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2044,9 @@ func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1938,31 +2124,44 @@ # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2171,12 @@ # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.6.42-b88ce' # func_echo ARG... @@ -2068,12 +2267,12 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.6.42-b88ce automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . +GNU libtool home page: . General help using GNU software: ." exit 0 } @@ -2124,7 +2323,7 @@ # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2270,6 +2469,8 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2494,16 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2515,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2595,20 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2451,8 +2665,8 @@ } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3632,8 @@ esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3706,8 @@ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -4096,8 +4310,8 @@ case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4321,8 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4165,12 +4379,12 @@ esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4395,8 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4692,8 @@ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5472,8 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5483,7 @@ \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6826,9 @@ while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -7211,9 +7426,9 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,10 +7442,10 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7254,8 +7469,8 @@ # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7272,12 +7487,16 @@ # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7298,15 +7517,15 @@ continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7426,8 +7645,8 @@ *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -9933,8 +10152,8 @@ for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10027,8 +10246,8 @@ eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10502,12 +10721,13 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10747,13 +10967,15 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff -Nru modemmanager-1.6.8/m4/compiler_warnings.m4 modemmanager-1.10.0/m4/compiler_warnings.m4 --- modemmanager-1.6.8/m4/compiler_warnings.m4 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/m4/compiler_warnings.m4 2018-11-15 09:55:53.000000000 +0100 @@ -1,11 +1,11 @@ AC_DEFUN([NM_COMPILER_WARNINGS], [AC_ARG_ENABLE(more-warnings, - AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), - set_more_warnings="$enableval",set_more_warnings=yes) -AC_MSG_CHECKING(for more warnings, including -Werror) + AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]), + set_more_warnings="$enableval",set_more_warnings=error) +AC_MSG_CHECKING(for more warnings) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) - CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" + CFLAGS="-Wall -std=gnu89 $CFLAGS" for option in -Wmissing-declarations -Wmissing-prototypes \ -Wdeclaration-after-statement -Wstrict-prototypes \ @@ -26,6 +26,9 @@ unset SAVE_CFLAGS done unset option + if test "x$set_more_warnings" = xerror; then + CFLAGS="$CFLAGS -Werror" + fi else AC_MSG_RESULT(no) fi diff -Nru modemmanager-1.6.8/m4/gettext.m4 modemmanager-1.10.0/m4/gettext.m4 --- modemmanager-1.6.8/m4/gettext.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/gettext.m4 2019-01-17 16:15:34.000000000 +0100 @@ -1,16 +1,16 @@ -# gettext.m4 serial 66 (gettext-0.18.2) -dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +# gettext.m4 serial 68 (gettext-0.19.8) +dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: @@ -161,13 +161,18 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -193,17 +198,22 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) @@ -214,17 +224,22 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" @@ -399,3 +414,7 @@ dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + + +dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) diff -Nru modemmanager-1.6.8/m4/iconv.m4 modemmanager-1.10.0/m4/iconv.m4 --- modemmanager-1.6.8/m4/iconv.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/iconv.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,5 +1,5 @@ -# iconv.m4 serial 18 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc. +# iconv.m4 serial 19 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -72,27 +72,33 @@ if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include -int main () -{ - int result = 0; + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; @@ -105,14 +111,14 @@ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; @@ -124,14 +130,14 @@ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304"; + static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; @@ -144,14 +150,14 @@ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; @@ -171,17 +177,14 @@ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; -}]])], - [am_cv_func_iconv_works=yes], - [am_cv_func_iconv_works=no], - [ -changequote(,)dnl - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac -changequote([,])dnl - ]) +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in diff -Nru modemmanager-1.6.8/m4/intlmacosx.m4 modemmanager-1.10.0/m4/intlmacosx.m4 --- modemmanager-1.6.8/m4/intlmacosx.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/intlmacosx.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,16 +1,16 @@ # intlmacosx.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2004-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. diff -Nru modemmanager-1.6.8/m4/intltool.m4 modemmanager-1.10.0/m4/intltool.m4 --- modemmanager-1.6.8/m4/intltool.m4 2017-06-17 10:24:38.000000000 +0200 +++ modemmanager-1.10.0/m4/intltool.m4 1970-01-01 01:00:00.000000000 +0100 @@ -1,212 +0,0 @@ -## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- -## Copyright (C) 2001 Eazel, Inc. -## Author: Maciej Stachowiak -## Kenneth Christiansen -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) -# serial 42 IT_PROG_INTLTOOL -AC_DEFUN([IT_PROG_INTLTOOL], [ -AC_PREREQ([2.50])dnl -AC_REQUIRE([AM_NLS])dnl - -case "$am__api_version" in - 1.[01234]) - AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) - ;; - *) - ;; -esac - -INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` -INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` -INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` -if test -n "$1"; then - AC_MSG_CHECKING([for intltool >= $1]) - AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) - test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || - AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) -fi - -AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) -AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) -AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) -if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then - AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) -fi - -if test -z "$AM_DEFAULT_VERBOSITY"; then - AM_DEFAULT_VERBOSITY=1 -fi -AC_SUBST([AM_DEFAULT_VERBOSITY]) - -INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' -INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' -INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' -AC_SUBST(INTLTOOL_V_MERGE) -AC_SUBST(INTLTOOL__v_MERGE_) -AC_SUBST(INTLTOOL__v_MERGE_0) - -INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' -intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' -intltool__v_merge_options_0='-q' -AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) -AC_SUBST(intltool__v_merge_options_) -AC_SUBST(intltool__v_merge_options_0) - - INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' -INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' - INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' -INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' -if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then - INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' -else - INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' -fi - INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' - -_IT_SUBST(INTLTOOL_DESKTOP_RULE) -_IT_SUBST(INTLTOOL_DIRECTORY_RULE) -_IT_SUBST(INTLTOOL_KEYS_RULE) -_IT_SUBST(INTLTOOL_PROP_RULE) -_IT_SUBST(INTLTOOL_OAF_RULE) -_IT_SUBST(INTLTOOL_PONG_RULE) -_IT_SUBST(INTLTOOL_SERVER_RULE) -_IT_SUBST(INTLTOOL_SHEET_RULE) -_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) -_IT_SUBST(INTLTOOL_UI_RULE) -_IT_SUBST(INTLTOOL_XAM_RULE) -_IT_SUBST(INTLTOOL_KBD_RULE) -_IT_SUBST(INTLTOOL_XML_RULE) -_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) -_IT_SUBST(INTLTOOL_CAVES_RULE) -_IT_SUBST(INTLTOOL_SCHEMAS_RULE) -_IT_SUBST(INTLTOOL_THEME_RULE) -_IT_SUBST(INTLTOOL_SERVICE_RULE) -_IT_SUBST(INTLTOOL_POLICY_RULE) - -# Check the gettext tools to make sure they are GNU -AC_PATH_PROG(XGETTEXT, xgettext) -AC_PATH_PROG(MSGMERGE, msgmerge) -AC_PATH_PROG(MSGFMT, msgfmt) -AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) -if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then - AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) -fi -xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" -mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" -mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" -if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then - AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) -fi - -AC_PATH_PROG(INTLTOOL_PERL, perl) -if test -z "$INTLTOOL_PERL"; then - AC_MSG_ERROR([perl not found]) -fi -AC_MSG_CHECKING([for perl >= 5.8.1]) -$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 -if test $? -ne 0; then - AC_MSG_ERROR([perl 5.8.1 is required for intltool]) -else - IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` - AC_MSG_RESULT([$IT_PERL_VERSION]) -fi -if test "x$2" != "xno-xml"; then - AC_MSG_CHECKING([for XML::Parser]) - if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then - AC_MSG_RESULT([ok]) - else - AC_MSG_ERROR([XML::Parser perl module is required for intltool]) - fi -fi - -# Substitute ALL_LINGUAS so we can use it in po/Makefile -AC_SUBST(ALL_LINGUAS) - -IT_PO_SUBDIR([po]) - -]) - - -# IT_PO_SUBDIR(DIRNAME) -# --------------------- -# All po subdirs have to be declared with this macro; the subdir "po" is -# declared by IT_PROG_INTLTOOL. -# -AC_DEFUN([IT_PO_SUBDIR], -[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. -dnl -dnl The following CONFIG_COMMANDS should be executed at the very end -dnl of config.status. -AC_CONFIG_COMMANDS_PRE([ - AC_CONFIG_COMMANDS([$1/stamp-it], [ - if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then - AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) - fi - rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" - >"$1/stamp-it.tmp" - [sed '/^#/d - s/^[[].*] *// - /^[ ]*$/d - '"s|^| $ac_top_srcdir/|" \ - "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" - ] - [sed '/^POTFILES =/,/[^\\]$/ { - /^POTFILES =/!d - r $1/POTFILES - } - ' "$1/Makefile.in" >"$1/Makefile"] - rm -f "$1/Makefile.tmp" - mv "$1/stamp-it.tmp" "$1/stamp-it" - ]) -])dnl -]) - -# _IT_SUBST(VARIABLE) -# ------------------- -# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST -# -AC_DEFUN([_IT_SUBST], -[ -AC_SUBST([$1]) -m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) -] -) - -# deprecated macros -AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) -# A hint is needed for aclocal from Automake <= 1.9.4: -# AC_DEFUN([AC_PROG_INTLTOOL], ...) - diff -Nru modemmanager-1.6.8/m4/lib-ld.m4 modemmanager-1.10.0/m4/lib-ld.m4 --- modemmanager-1.6.8/m4/lib-ld.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/lib-ld.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,5 +1,5 @@ # lib-ld.m4 serial 6 -dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru modemmanager-1.6.8/m4/lib-link.m4 modemmanager-1.10.0/m4/lib-link.m4 --- modemmanager-1.6.8/m4/lib-link.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/lib-link.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,5 +1,5 @@ # lib-link.m4 serial 26 (gettext-0.18.2) -dnl Copyright (C) 2001-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru modemmanager-1.6.8/m4/lib-prefix.m4 modemmanager-1.10.0/m4/lib-prefix.m4 --- modemmanager-1.6.8/m4/lib-prefix.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/lib-prefix.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru modemmanager-1.6.8/m4/libtool.m4 modemmanager-1.10.0/m4/libtool.m4 --- modemmanager-1.6.8/m4/libtool.m4 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/m4/libtool.m4 2019-01-17 16:15:41.000000000 +0100 @@ -1,6 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -219,8 +219,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -1042,8 +1042,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1493,9 +1493,22 @@ m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -2207,26 +2220,35 @@ striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2565,8 +2587,8 @@ dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2622,7 +2644,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -4010,7 +4032,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4919,7 +4941,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4927,7 +4949,7 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4984,15 +5006,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5156,6 +5178,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5373,7 +5396,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5556,12 +5579,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5602,7 +5625,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5861,6 +5884,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6631,8 +6655,8 @@ cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6730,6 +6754,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) diff -Nru modemmanager-1.6.8/m4/lt~obsolete.m4 modemmanager-1.10.0/m4/lt~obsolete.m4 --- modemmanager-1.6.8/m4/lt~obsolete.m4 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/m4/lt~obsolete.m4 2019-01-17 16:15:42.000000000 +0100 @@ -1,6 +1,6 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # diff -Nru modemmanager-1.6.8/m4/ltoptions.m4 modemmanager-1.10.0/m4/ltoptions.m4 --- modemmanager-1.6.8/m4/ltoptions.m4 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/m4/ltoptions.m4 2019-01-17 16:15:42.000000000 +0100 @@ -1,6 +1,6 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff -Nru modemmanager-1.6.8/m4/ltsugar.m4 modemmanager-1.10.0/m4/ltsugar.m4 --- modemmanager-1.6.8/m4/ltsugar.m4 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/m4/ltsugar.m4 2019-01-17 16:15:42.000000000 +0100 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff -Nru modemmanager-1.6.8/m4/ltversion.m4 modemmanager-1.10.0/m4/ltversion.m4 --- modemmanager-1.6.8/m4/ltversion.m4 2017-06-17 10:24:46.000000000 +0200 +++ modemmanager-1.10.0/m4/ltversion.m4 2019-01-17 16:15:42.000000000 +0100 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4221 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce]) +m4_define([LT_PACKAGE_REVISION], [2.4.6.42]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.6.42-b88ce' +macro_revision='2.4.6.42' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru modemmanager-1.6.8/m4/nls.m4 modemmanager-1.10.0/m4/nls.m4 --- modemmanager-1.6.8/m4/nls.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/nls.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,17 +1,17 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software +dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru modemmanager-1.6.8/m4/po.m4 modemmanager-1.10.0/m4/po.m4 --- modemmanager-1.6.8/m4/po.m4 2017-06-17 10:24:36.000000000 +0200 +++ modemmanager-1.10.0/m4/po.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,16 +1,16 @@ -# po.m4 serial 22 (gettext-0.19) -dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +# po.m4 serial 24 (gettext-0.19) +dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru modemmanager-1.6.8/m4/progtest.m4 modemmanager-1.10.0/m4/progtest.m4 --- modemmanager-1.6.8/m4/progtest.m4 2017-06-17 10:24:37.000000000 +0200 +++ modemmanager-1.10.0/m4/progtest.m4 2019-01-17 16:15:35.000000000 +0100 @@ -1,16 +1,16 @@ # progtest.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1996-2003, 2005, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru modemmanager-1.6.8/Makefile.am modemmanager-1.10.0/Makefile.am --- modemmanager-1.6.8/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -2,6 +2,7 @@ SUBDIRS = \ . \ build-aux \ + po \ data \ include \ libqcdm \ @@ -13,33 +14,31 @@ vapi \ introspection \ uml290 \ - po \ test \ examples \ docs \ $(NULL) -DISTCHECK_CONFIGURE_FLAGS = \ +ChangeLog: + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ + (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log --stat) | fmt --split-only > $@.tmp \ + && mv -f $@.tmp $@ \ + || ($(RM) $@.tmp; \ + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ + (test -f $@ || echo git-log is required to generate this file >> $@)); \ + else \ + test -f $@ || \ + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ + echo A git checkout and git-log is required to generate this file >> $@); \ + fi + +AM_DISTCHECK_CONFIGURE_FLAGS = \ --with-udev-base-dir="$$dc_install_base" \ --with-systemdsystemunitdir="$$dc_install_base/$(SYSTEMD_UNIT_DIR)" \ --enable-gtk-doc=yes \ $(NULL) -INTLTOOL_FILES = \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - $(NULL) - -DISTCLEANFILES = \ - intltool-extract \ - intltool-merge \ - intltool-update \ - po/.intltool-merge-cache \ - $(NULL) - EXTRA_DIST = \ - $(INTLTOOL_FILES) \ autogen.sh \ gtester.make \ COPYING.LIB \ diff -Nru modemmanager-1.6.8/Makefile.in modemmanager-1.10.0/Makefile.in --- modemmanager-1.6.8/Makefile.in 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,14 +93,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -145,7 +144,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -215,7 +214,6 @@ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -268,14 +266,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -396,8 +386,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -420,6 +408,7 @@ SUBDIRS = \ . \ build-aux \ + po \ data \ include \ libqcdm \ @@ -431,33 +420,18 @@ vapi \ introspection \ uml290 \ - po \ test \ examples \ docs \ $(NULL) -DISTCHECK_CONFIGURE_FLAGS = \ +AM_DISTCHECK_CONFIGURE_FLAGS = \ --with-udev-base-dir="$$dc_install_base" \ --with-systemdsystemunitdir="$$dc_install_base/$(SYSTEMD_UNIT_DIR)" \ --enable-gtk-doc=yes \ $(NULL) -INTLTOOL_FILES = \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - $(NULL) - -DISTCLEANFILES = \ - intltool-extract \ - intltool-merge \ - intltool-update \ - po/.intltool-merge-cache \ - $(NULL) - EXTRA_DIST = \ - $(INTLTOOL_FILES) \ autogen.sh \ gtester.make \ COPYING.LIB \ @@ -489,8 +463,8 @@ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -632,7 +606,10 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -850,7 +827,6 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -948,6 +924,19 @@ .PRECIOUS: Makefile +ChangeLog: + $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ + (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log --stat) | fmt --split-only > $@.tmp \ + && mv -f $@.tmp $@ \ + || ($(RM) $@.tmp; \ + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ + (test -f $@ || echo git-log is required to generate this file >> $@)); \ + else \ + test -f $@ || \ + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ + echo A git checkout and git-log is required to generate this file >> $@); \ + fi + @CODE_COVERAGE_RULES@ @CODE_COVERAGE_ENABLED_TRUE@clean-local: diff -Nru modemmanager-1.6.8/missing modemmanager-1.10.0/missing --- modemmanager-1.6.8/missing 2017-06-17 10:24:56.000000000 +0200 +++ modemmanager-1.10.0/missing 2019-01-17 16:15:48.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru modemmanager-1.6.8/NEWS modemmanager-1.10.0/NEWS --- modemmanager-1.6.8/NEWS 2017-06-17 10:09:58.000000000 +0200 +++ modemmanager-1.10.0/NEWS 2019-01-16 10:14:53.000000000 +0100 @@ -1,95 +1,310 @@ -ModemManager 1.6.8 +ModemManager 1.10.0 ------------------------------------------- -This is a new bugfix release of ModemManager. +This is a new stable release of ModemManager. -Among other things fixed: +The following notes are directed to package maintainers: - * Blacklist: - ** Ignored default Linux USB Serial Gadget. + * This version requires: + ** libmbim >= 1.18.0 (for the optional MBIM support) + ** libqmi >= 1.22.0 (for the optional QMI support) + +The most important features and changes in this release are the following: + + * udev: + ** Consolidated common tag names among all the supported plugins. E.g. + ID_MM_PORT_TYPE_GPS, ID_MM_PORT_TYPE_AT_*, ID_MM_PORT_TYPE_QCDM... + All these generic tags are included as symbols in the API, and + compatibility will be maintained for these. Custom setups of + ModemManager relying on previously available per-plugin udev tags may + need to manually port them to this new generic subset. + ** New tag to allow specifying flow control settings to use in serial ports. + + * Core: + ** Avoid probing other protocols on TTYs tagged in udev with specific port + type tags (e.g. avoid probing QCDM if a port is tagged as AT). This allows + faster port probing and modem detection for known modem layouts. + ** Implemented support to enable and handle +CGEV URCs for asynchronous + connection state updates in AT-controlled devices. + + * Manager interface: + ** New runtime daemon version reporting. + ** New support for requesting device inhibition, e.g. so that ModemManager + stops completely using a modem device until the inhibition is released. + This feature is implemented to allow fwupd taking over of a device + completely for as long as it needs during a firmware update. + + * Modem interface: + ** All methods are always connected, even in Failed state. + ** Allow parallel Enable()/Disable() calls. + ** Deprecated redundant ListBearers() method, the read-only Bearers property + is already showing the same information. + + * Bearer interface: + ** New 'BearerType' property, e.g. to specify whether a bearer is the initial + LTE default bearer or not. + ** Deprecated 'number' field in bearer settings. Applications do not need to + send the 'number' field in Bearer.Connect() or in Modem.Simple.Connect(), + as the setting is totally ignored. + + * mmcli: + ** New 'key-value' output, easier to parse by scripts than the default. + ** Removed redundant '--location-get-XXX' actions, as the '--location-get' + already reports the location information for all sources. + ** Removed redundant '--simple-status' action, as the same information can be + obtained through different mmcli operations. + ** New manager '--inhibit-device' action and modem-specific '--inhibit', to + allow requesting device inhibition. + + * 3GPP interface: + ** New support for exposing the network reported Protocol Configuration + Options (PCO), to be used instead of the new deprecated Subscription + State property. + ** New support for exposing the initial LTE default bearer status. + ** New support for configuring the initial LTE default bearer settings. + + * Location interface: + ** New LTE Tracking Area Code (TAC) in 3GPP location information. + ** New support for injecting assistance data (e.g. Qualcomm XTRA) into the + GNSS engine, useful when there is no mobile connection to use MSA A-GPS. + + * Firmware interface: + ** Support for reporting firmware update support properties, e.g. specifying + which update methods are supported. This information will be consumed by + fwupd in order to allow upgrading firmware in devices managed by + ModemManager. + + * Voice interface: + ** Multiple improvements and fixes in the voice call management logic + implemented with generic AT commands. + ** Added AudioPort and AudioFormat properties to the Call object. + ** Added new generic audio channel setup/cleanup handlers in the Call object. * QMI: - ** Fixed build with libqmi 1.16. - ** Allow prefix match for modem images ending with '?'. + ** New LOC service based GNSS support, including A-GPS setup via SUPL server. + ** New support for the "extended" LTE band list. + ** New support for reading IMSI and ICCID with the UIM service. + + * MBIM: + ** Implemented support for processing Protocol Configuration Options using + Microsoft-defined Basic Connect Extensions. + ** Implemented support for LTE attach status and configuration using + Microsoft-defined Basic Connect Extensions. + ** Implemented support for the extended signal interface and for 3GPP location + details using the AT&T specific service. + ** Implemented support for 3GPP USSD operations using the standard USSD + service. + ** For Qualcomm-based MBIM devices, those with QMI-over-MBIM support, a whole + new set of features is now available, including: QMI LOC/PDS location + support, allowed/preferred mode management, frequency band selection, + power management operations... * Plugins: - ** Telit: fix #PSNT values interpretation for HSDPA and LTE modems. - ** Telit: add LTE access technology reporting. - ** Huawei: let the E3372 run NDISDUP via TTY. - ** MBM: fix async method completion enabling unsolicited events. + ** xmm: new XMM plugin, with shared logic (allowed/preferred mode management, + frequency band selection, power management operations, extended signal + quality reporting, GPS/A-GPS...) for Intel XMM based devices. + ** fibocom: new plugin, with support for generic MBIM and XMM-based devices. + ** dell: added support for XMM-based devices, like the DW5820e. + ** dell: added custom support for the DW5821e, including 'unmanaged' GPS and + firmware update integration details. + ** cinterion: new shared interface to include all logic shared between Option + and Option/HSO devices. + ** sierra-legacy: implemented connection monitoring support. + ** u-blox: added support for extended call state transitions. + ** u-blox: added CDC-ECM support for SARA/LISA-U2xx modems. + ** altair-lte: migrated from SubscriptionState to PCO. - * Core: - ** AT+WS46=? response parser extended to support ranges. - ** Fix setting up signal quality retrieval logic. +All the features and fixes which were backported to 1.8.x releases are also present +in ModemManager 1.10.0. -ModemManager 1.6.6 +ModemManager 1.8.0 ------------------------------------------- -This is a new bugfix release of ModemManager. - -Among other things fixed: +This is a new stable release of ModemManager. - * Blacklist: - ** Ignored keyboard.io devices. - ** Ignored Analog Devices EVAL-ADXL362Z-DB. - ** Ignored promotion boards from Renesas. - ** Ignored Analog PlutoSDR. - ** Ignored Telit LE866 flashing device. +The following notes are directed to package maintainers: - * Plugins: - ** Telit: fix AT+SERVICE 3GPP2 access technology reporting. - ** Telit: lock/unlock CSIM operations by default. - ** Telit: don't ignore AT ports without an explicit port type hint tag. - ** Cinterion: improve ^SMONG and ^SCFG=? response parsers. - ** Huawei: implement Signal interface based on ^HCSQ. - ** QMI: require FCC auth if InvalidTransition error is detected. - ** QMI: fix incorrect use of mm_base_bearer_get_status(). - ** QMI: add WDS event reporting support. - ** MBIM: remove parent access tech loading. + * This version requires: + ** GLib 2.36.0 + ** gettext 0.19.8 (for the optional rebuild of documentation) + ** libmbim >= 1.16.0 (for the optional MBIM support) + ** libqmi >= 1.20.0 (for the optional QMI support) + ** libsystemd >= 209 or libsystemd-login >= 183 (for the optional suspend + and resume support) + ** libsystemd >= 209 (for the optional systemd journal support) + ** polkit >= 0.97 (for the optional PolicyKit support) + + * This version no longer requires: + ** intltool (replaced by new features in gettext) + + * Distributions using systemd should explicitly use the following configure + options: + ** '--with-systemd-suspend-resume': the only supported source for suspend and + resume events is now systemd, so the previous '--with-suspend-resume=[]' + option was renamed. + ** '--with-systemd-journal' to use the new journal support. + + * Distributions wanting to avoid ModemManager poking TTY ports that isn't + supposed to touch may start using the new 'STRICT' filter policy, given + as an option to the ModemManager daemon (e.g. patching the default systemd + service file provided). See below for more info about the filter policy and + the side effects of using the STRICT approach: + ** E.g. ModemManager --filter-policy=STRICT + +The most important features and changes in this release are the following: + + * New 'filter policy' setting in the ModemManager daemon to decide which ports + are probed and how. Currently these levels are defined: + ** WHITELIST-ONLY: Only devices or ports explicitly whitelisted with the new + 'ID_MM_DEVICE_PROCESS' udev tag are probed. + ** DEFAULT: All ports are allowed to be probed except for the ones explicitly + greylisted as RS232 adapters or completely blacklisted. This is the + default approach that was used until now, and the default as well in this + release if a different one isn't requested. + ** STRICT: The daemon defines a set of heuristics to try to detect modems and + ports to probe. Only the TTY ports that are very very likely to be modem + ports are probed, therefore completely avoiding the need of having a + separate blacklist or RS232 adapter greylist. But note that this policy + may end up ignoring some devices, like TTY controlled modems without an + associated network port. + ** PARANOID: This is equivalent to running the STRICT mode but also applying + the blacklist and RS232 greylist filters explicitly. + + * Device 'naming'. This release includes logic to allow 'naming' devices with + the ID_MM_PHYSDEV_UID udev tag, so that the names can then be used in e.g. + mmcli and also exposed in the 'Device' property in the Modem interface. This + new setup makes it possible to give the devices unique names that are kept + across reboots. + + * Allow skipping the automatic scan for devices in the daemon with the new + '--no-auto-scan' daemon option. Instead, the daemon may be called with the + '--initial-kernel-events=[PATH]' option including a predefined list of ports + or otherwise get the port additions reported during runtime with the + mmcli --report-kernel-event=[] command. + + * Allow building and running without 'udev'. In this setup, the previously + explained '--no-auto-scan' is enabled by default, so ports are not + automatically detected .Note that this setup is not suggested for standard + distributions: if udev is available in the system, it is the preferred method + to manage the port addition and removal. + + * SIM hot swap. The core includes the needed logic to support SIM hot swap in + the different devices, although for now it's only tested for Telit and MBIM + modems. If a SIM hot swap is detected, the modem is flagged as failed and + reprobed from scratch. + + * Connection status monitoring logic. In order to try to detect network + initiated disconnections, a generic setup is provided to plugins so that they + can implement explicit connection status checks that would be executed + periodically. + + * New support for 3GPP CSFB states and operation modes. We now support + registration states reported as "SMS only" or "CSFB not preferred", and + provide APIs to set and get the "UE mode of operation for EPS". + +This version comes with the following new features: + + * Build and system: + ** Updated the systemd service file with additional security related rules. + ** Added support for systemd journal logging. + ** Updated most of the code to use GTask instead of the deprecated + GSimpleAsyncResult based operations. + ** ChangeLog is built from git during the dist tarball generation. + + * New translations: Polish, Brazilian Portuguese, Slovak, Hungarian, Czech, + Ukrainian, Swedish and Indonesian. + + * API: + ** Defined additional GSM, UMTS and LTE frequency bands. + ** The MMModemBand enumeration values (EUTRAN, UTRAN and CDMA) have been + renamed to consolidate how they are defined. A compatibility layer has + been provided to avoid breaking the API. + ** New 'HardwareRevision' property in the Modem interface. + ** New 'EpsUeModeOperation' property and 'SetEpsUeModeOperation' method in + the Modem 3GPP interface. * Core: - ** Added RSCP item in the Signal interface. - ** Implement Signal interface in the generic AT based modem based on ^CESQ. - ** Improve network registration checks for LTE devices. - ** Handle SDIO devices. - ** Fix QCDM access tech reporting for WCDMA system modes. - ** Fix capabilities in 4G-only devices. - ** Set TTY as connected as soon as ATD replies. - - * and some other fixes... - - -ModemManager 1.6.4 -------------------------------------------- -This is a new bugfix release of ModemManager. + ** Updated libqcdm to load signal strength from QCDM EVDO Pilot Sets. + ** Updated udev rules with new per-vendor rules for quicker processing. + ** Explicitly ignored ports are never probed now, but they will be reported + as owned by the device and exposed in the Ports property. + ** New 'ID_MM_TTY_BAUDRATE' udev tag to specify the baudrate to use in RS232 + TTY ports. + ** If using UCS2, still assume that the operator name may be given in ASCII. + ** Explicitly open QCDM ports anytime it's needed, instead of assuming they + are open when enabled. + ** Query supported ME event reporting options and automatically set the best + choice based on the supported ones. + ** Query supported flow control modems and automatically set the best choice + based on the supported ones. + ** Explicitly configure flow control settings on the TTY as soon as it is + connected, only applicable for RS232 devices. + ** Implemented generic unlock retries loading. + + * MBIM: + ** Explicitly reprobe the modem when the mbim-proxy is detected dead. + ** Workaround implemented to keep track of the PIN1 unlock retries as the + protocol isn't very good allowing this. + ** Load and expose HW revision. -Among other things fixed: + * QMI: + ** Explicitly reprobe the modem when the qmi-proxy is detected dead. + ** Load and expose HW revision. + ** Detect port closed and forbid client allocation operations. + ** New optional connection status monitoring support, enabled by default for + the Netgear AC341U. - * Blacklist: - ** Ignored new Infineon flashloader devices. - ** Ignored Sigma Sport docking stations. + * Location interface: + ** Disabled by default for MBIM modems. - * Core: - ** USSD: don't rely on lock status to allow actions. - ** 3GPP: always use 300s by default in the network scan operation. - ** Build: limit the available glib functionality to the version supported. + * Messaging interface: + ** Try decoding with UTF-16BE when UCS-2 reported. * Plugins: - ** telit: add support for the Telit GE910. - ** zte: fix SUBSYSTEMS and ATTRS{idVendor} checks. - - * and some other minor fixes... + ** u-blox: new plugin, currently supporting the TOBY-L2, TOBY-L4, TOBY-R2, + LARA-R2 and LISA-R2. + ** quectel: new plugin, supporting generic AT/QMI based modems. + ** cinterion: implemented support for devices exposing a WWAN network + interface. + ** cinterion: support changing modes in LTE capable devices. + ** cinterion: added GPS support for devices controlled only with AT^SGPSC. + ** cinterion: use ^SIND unsolicited messages for access tech reporting. + ** huawei: implemented Signal interface. + ** telit: added support for RS232, QMI and MBIM modems. + ** novatel: cleaned up registration state and access tech reporting. + ** novatel-lte: implemented unlock retries loading. + ** dell: speed probing time up and reduce udev dependency. + ** mbm: added GPS support for the Dell DW5560. + +The following features which were backported to 1.6.x releases are also present +in ModemManager 1.8.0: + + * Build and System: + ** Explicitly use -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 and + -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36 so that we don't get warnings + for GLib features that are flagged as deprecated in newer versions. + ** Dropped After=syslog.target rule in systemd service file. + ** Added all ModemManager udev tags also in "bind" events. -ModemManager 1.6.2 -------------------------------------------- -This is a new bugfix release of ModemManager. + * Core: + ** Improved detection of 4G-only modems. + ** TTY is set as connected as soon as ATD replies. + ** Removed the default ID_MM_PLATFORM_DRIVER_PROBE whitelist. + + * Signal interface: + ** Report RSCP if available. + ** New generic implementation of the Signal interface in AT-based devices + using AT+CESQ. -Among other things fixed: - * Huawei: fix setting up unsolicited voice messages - * Blacklist: ignored u-blox GPS/GLOSNASS USB dongle and some new Arduinos. - * ZTE: avoid making udev rules tty-only. - * and some other minor fixes... + * QMI: + ** Run FCC auth sequence if "InvalidTransition" is reported when going + online. + ** Added WDS reporting event support. + * Plugins: + ** huawei: let the E3372 run NDISDUP via TTY (when the exposed cdc-wdm is + non-functional). + ** telit: added support for the GE910. ModemManager 1.6.0 ------------------------------------------- diff -Nru modemmanager-1.6.8/plugins/altair/mm-broadband-bearer-altair-lte.c modemmanager-1.10.0/plugins/altair/mm-broadband-bearer-altair-lte.c --- modemmanager-1.6.8/plugins/altair/mm-broadband-bearer-altair-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/mm-broadband-bearer-altair-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -42,51 +42,17 @@ /* 3GPP Connect sequence */ typedef struct { - MMBroadbandBearerAltairLte *self; MMBaseModem *modem; MMPortSerialAt *primary; MMPort *data; - GCancellable *cancellable; - GSimpleAsyncResult *result; } DetailedConnectContext; -static DetailedConnectContext * -detailed_connect_context_new (MMBroadbandBearer *self, - MMBroadbandModem *modem, - MMPortSerialAt *primary, - MMPort *data, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - DetailedConnectContext *ctx; - - ctx = g_new0 (DetailedConnectContext, 1); - ctx->self = g_object_ref (self); - ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); - ctx->primary = g_object_ref (primary); - ctx->data = g_object_ref (data); - /* NOTE: - * We don't currently support cancelling AT commands, so we'll just check - * whether the operation is to be cancelled at each step. */ - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - detailed_connect_context_new); - return ctx; -} - static void -detailed_connect_context_complete_and_free (DetailedConnectContext *ctx) +detailed_connect_context_free (DetailedConnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->data); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } @@ -95,17 +61,15 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void connect_3gpp_connect_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { + DetailedConnectContext *ctx; const gchar *result; GError *error = NULL; MMBearerIpConfig *config; @@ -113,46 +77,48 @@ result = mm_base_modem_at_command_full_finish (modem, res, &error); if (!result) { mm_warn ("connect failed: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } mm_dbg ("Connected"); + ctx = g_task_get_task_data (task); + config = mm_bearer_ip_config_new (); mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_DHCP); /* Set operation result */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - mm_bearer_connect_result_new (ctx->data, - config, - config), + g_task_return_pointer ( + task, + mm_bearer_connect_result_new (ctx->data, config, config), (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); g_object_unref (config); - - detailed_connect_context_complete_and_free (ctx); } static void connect_3gpp_apnsettings_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { + DetailedConnectContext *ctx; const gchar *result; GError *error = NULL; result = mm_base_modem_at_command_full_finish (modem, res, &error); if (!result) { mm_warn ("setting APN failed: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + mm_dbg ("APN set - connecting bearer"); mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -160,9 +126,9 @@ 20, /* timeout */ FALSE, /* allow_cached */ FALSE, /* is_raw */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)connect_3gpp_connect_ready, - ctx); /* user_data */ + task); /* user_data */ } static void @@ -179,6 +145,7 @@ MMBearerProperties *config; MMModem3gppRegistrationState registration_state; MMPort *data; + GTask *task; /* There is a known firmware bug that can leave the modem unusable if a * connect attempt is made when out of coverage. So, fail without trying. @@ -187,12 +154,13 @@ MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, ®istration_state, NULL); if (registration_state == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK, - "Out of coverage, can't connect."); + g_task_report_new_error (self, + callback, + user_data, + connect_3gpp, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK, + "Out of coverage, can't connect."); return; } @@ -201,37 +169,39 @@ * */ if (mm_broadband_modem_altair_lte_is_sim_refresh_detach_in_progress (modem)) { mm_dbg ("Detached from network to process SIM refresh, failing connect request"); - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY, - "Detached from network to process SIM refresh, can't connect."); + g_task_report_new_error (self, + callback, + user_data, + connect_3gpp, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY, + "Detached from network to process SIM refresh, can't connect."); return; } data = mm_base_modem_peek_best_data_port (MM_BASE_MODEM (modem), MM_PORT_TYPE_NET); if (!data) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_CONNECTED, - "Couldn't connect: no available net port available"); + g_task_report_new_error (self, + callback, + user_data, + connect_3gpp, + MM_CORE_ERROR, + MM_CORE_ERROR_CONNECTED, + "Couldn't connect: no available net port available"); return; } - ctx = detailed_connect_context_new (self, - modem, - primary, - data, - cancellable, - callback, - user_data); + ctx = g_new0 (DetailedConnectContext, 1); + ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); + ctx->primary = g_object_ref (primary); + ctx->data = g_object_ref (data); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_connect_context_free); config = mm_base_bearer_peek_config (MM_BASE_BEARER (self)); apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (config)); - command = g_strdup_printf ("%%APNN=%s",apn); + command = g_strdup_printf ("%%APNN=%s", apn); g_free (apn); mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -239,9 +209,9 @@ 10, /* timeout */ FALSE, /* allow_cached */ FALSE, /* is_raw */ - ctx->cancellable, + cancellable, (GAsyncReadyCallback)connect_3gpp_apnsettings_ready, - ctx); /* user_data */ + task); /* user_data */ g_free (command); } @@ -256,52 +226,27 @@ GSimpleAsyncResult *result; } DetailedDisconnectContext; -static DetailedDisconnectContext * -detailed_disconnect_context_new (MMBroadbandBearer *self, - MMBroadbandModem *modem, - MMPortSerialAt *primary, - MMPort *data, - GAsyncReadyCallback callback, - gpointer user_data) -{ - DetailedDisconnectContext *ctx; - - ctx = g_new0 (DetailedDisconnectContext, 1); - ctx->self = g_object_ref (self); - ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); - ctx->primary = g_object_ref (primary); - ctx->data = g_object_ref (data); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - detailed_disconnect_context_new); - return ctx; -} - static gboolean disconnect_3gpp_finish (MMBroadbandBearer *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -detailed_disconnect_context_complete_and_free (DetailedDisconnectContext *ctx) +detailed_disconnect_context_free (DetailedDisconnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->data); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } static void disconnect_3gpp_check_status (MMBaseModem *modem, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { const gchar *result; @@ -310,12 +255,12 @@ result = mm_base_modem_at_command_full_finish (modem, res, &error); if (!result) { mm_warn ("Disconnect failed: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + g_object_unref (task); } static void @@ -330,6 +275,7 @@ { DetailedDisconnectContext *ctx; MMModem3gppRegistrationState registration_state; + GTask *task; /* There is a known firmware bug that can leave the modem unusable if a * disconnect attempt is made when out of coverage. So, fail without trying. @@ -338,16 +284,23 @@ MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, ®istration_state, NULL); if (registration_state == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK, - "Out of coverage, can't disconnect."); + g_task_report_new_error (self, + callback, + user_data, + disconnect_3gpp, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK, + "Out of coverage, can't disconnect."); return; } - ctx = detailed_disconnect_context_new (self, modem, primary, data, callback, user_data); + ctx = g_new0 (DetailedDisconnectContext, 1); + ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); + ctx->primary = g_object_ref (primary); + ctx->data = g_object_ref (data); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_disconnect_context_free); mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -357,7 +310,7 @@ FALSE, /* is_raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_3gpp_check_status, - ctx); /* user_data */ + task); /* user_data */ } /*****************************************************************************/ @@ -409,8 +362,12 @@ static void mm_broadband_bearer_altair_lte_class_init (MMBroadbandBearerAltairLteClass *klass) { + MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass); MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass); + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; + broadband_bearer_class->connect_3gpp = connect_3gpp; broadband_bearer_class->connect_3gpp_finish = connect_3gpp_finish; broadband_bearer_class->disconnect_3gpp = disconnect_3gpp; diff -Nru modemmanager-1.6.8/plugins/altair/mm-broadband-modem-altair-lte.c modemmanager-1.10.0/plugins/altair/mm-broadband-modem-altair-lte.c --- modemmanager-1.6.8/plugins/altair/mm-broadband-modem-altair-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/mm-broadband-modem-altair-lte.c 2019-01-15 15:57:35.000000000 +0100 @@ -67,6 +67,8 @@ GRegex *statcm_regex; /* Regex for PCO notifications */ GRegex *pcoinfo_regex; + + GList *pco_list; }; static MMIfaceModem3gpp *iface_modem_3gpp_parent; @@ -104,33 +106,23 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_altair_lte_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } static void @@ -139,20 +131,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - /* Set a new ref to the bearer object as result */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); /* We just create a MMBroadbandBearer */ mm_broadband_bearer_altair_lte_new (MM_BROADBAND_MODEM_ALTAIR_LTE (self), properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - result); + task); } /*****************************************************************************/ @@ -163,16 +151,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -181,9 +166,8 @@ response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -196,18 +180,15 @@ mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN2, pin2); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK2, puk2); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } else { - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid unlock retries response: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -215,16 +196,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - "%CPININFO", - 3, - FALSE, - (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries)); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + mm_base_modem_at_command (MM_BASE_MODEM (self), + "%CPININFO", + 3, + FALSE, + (GAsyncReadyCallback)load_unlock_retries_ready, + task); } /*****************************************************************************/ @@ -235,15 +216,15 @@ GAsyncResult *res, GError **error) { - MMModemCapability caps; - gchar *caps_str; + GError *inner_error = NULL; + gssize value; - /* This modem is LTE only.*/ - caps = MM_MODEM_CAPABILITY_LTE; - caps_str = mm_modem_capability_build_string_from_mask (caps); - mm_dbg ("Loaded current capabilities: %s", caps_str); - g_free (caps_str); - return caps; + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_CAPABILITY_NONE; + } + return (MMModemCapability)value; } static void @@ -251,16 +232,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; mm_dbg ("Loading (Altair LTE) current capabilities..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_capabilities); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + /* This modem is LTE only.*/ + g_task_return_int (task, MM_MODEM_CAPABILITY_LTE); + g_object_unref (task); } /*****************************************************************************/ @@ -271,11 +250,7 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } #define BANDCAP_TAG "%BANDCAP: " @@ -283,7 +258,7 @@ static void load_supported_bands_done (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GArray *bands; const gchar *response; @@ -292,9 +267,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query supported bands: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -306,21 +280,17 @@ bands = mm_altair_parse_bands_response (response); if (!bands) { mm_dbg ("Failed to parse supported bands response"); - g_simple_async_result_set_error ( - operation_result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to parse supported bands response"); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gpointer (operation_result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); + g_object_unref (task); } static void @@ -328,12 +298,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_bands); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command ( MM_BASE_MODEM (self), @@ -341,7 +308,7 @@ 3, FALSE, (GAsyncReadyCallback)load_supported_bands_done, - result); + task); } /*****************************************************************************/ @@ -352,11 +319,7 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } #define CFGBANDS_TAG "Bands: " @@ -364,7 +327,7 @@ static void load_current_bands_done (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GArray *bands; const gchar *response; @@ -373,9 +336,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query current bands: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -387,21 +349,17 @@ bands = mm_altair_parse_bands_response (response); if (!bands) { mm_dbg ("Failed to parse current bands response"); - g_simple_async_result_set_error ( - operation_result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to parse current bands response"); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gpointer (operation_result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); + g_object_unref (task); } static void @@ -409,12 +367,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_bands); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command ( MM_BASE_MODEM (self), @@ -422,7 +377,7 @@ 3, FALSE, (GAsyncReadyCallback)load_current_bands_done, - result); + task); } /*****************************************************************************/ @@ -457,14 +412,36 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), - error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +simulate_unprovisioned_subscription_pco_update (MMBroadbandModemAltairLte *self) +{ + MMPco *pco; + + /* Simulate a %PCOINFO notification issued to the IMS PDN that indicates an + * unprovisioned Verizon SIM. See mm_altair_parse_vendor_pco_info() for the + * detailed format of a %PCOINFO response. + * + * 1,FF00,13018405 is constructed as follows: + * + * 1: CID for IMS PDN + * FF 00: Container ID for the Verizon-specific PCO content + * 13 01 84: Binary coded decimal representation of Verizon MCC/MNC 311/084 + * 05: Value indicating an unprovisioned SIM + */ + pco = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,FF00,13018405", NULL); + g_assert (pco != NULL); + self->priv->pco_list = mm_pco_list_add (self->priv->pco_list, pco); + mm_iface_modem_3gpp_update_pco_list (MM_IFACE_MODEM_3GPP (self), self->priv->pco_list); + g_object_unref (pco); } static void run_registration_checks_subscription_state_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; const gchar *at_response; @@ -474,15 +451,14 @@ * ignore the error. This allows the registration attempt to continue. * So, the async response from this function is *always* True. */ - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); at_response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!at_response) { g_assert (error); mm_warn ("AT+CEER failed: %s", error->message); g_error_free (error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -491,27 +467,27 @@ g_assert (error); mm_warn ("Failed to parse AT+CEER response: %s", error->message); g_error_free (error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } if (g_strcmp0 ("EPS_AND_NON_EPS_SERVICES_NOT_ALLOWED", ceer_response) == 0) { mm_dbg ("Registration failed due to unprovisioned SIM."); - mm_iface_modem_3gpp_update_subscription_state (self, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNPROVISIONED); + simulate_unprovisioned_subscription_pco_update (MM_BROADBAND_MODEM_ALTAIR_LTE (self)); } else { mm_dbg ("Failed to find a better reason for registration failure."); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); g_free (ceer_response); } static void run_registration_checks_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; gboolean success; @@ -520,9 +496,8 @@ success = iface_modem_3gpp_parent->run_registration_checks_finish (self, res, &error); if (!success) { g_assert (error); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -532,7 +507,7 @@ 6, FALSE, (GAsyncReadyCallback) run_registration_checks_subscription_state_ready, - operation_result); + task); } static void @@ -543,12 +518,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *operation_result; + GTask *task; - operation_result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_run_registration_checks); + task = g_task_new (self, NULL, callback, user_data); g_assert (iface_modem_3gpp_parent->run_registration_checks); iface_modem_3gpp_parent->run_registration_checks (self, @@ -556,47 +528,61 @@ ps_supported, eps_supported, (GAsyncReadyCallback) run_registration_checks_ready, - operation_result); + task); } /*****************************************************************************/ /* Register in network (3GPP interface) */ +static gboolean +modem_3gpp_register_in_network_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +cmatt_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + static void -modem_3gpp_register_in_network (MMIfaceModem3gpp *self, - const gchar *operator_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_register_in_network (MMIfaceModem3gpp *self, + const gchar *operator_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; + + task = g_task_new (self, cancellable, callback, user_data); + if (operator_id) { /* Currently only VZW is supported */ - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Setting a specific operator Id is not supported"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Setting a specific operator ID is not supported"); + g_object_unref (task); return; } - mm_base_modem_at_command_full (MM_BASE_MODEM (self), - mm_base_modem_peek_best_at_port (MM_BASE_MODEM (self), NULL), - "%CMATT=1", - 3, - FALSE, - FALSE, /* raw */ - cancellable, - callback, - user_data); -} - -static gboolean -modem_3gpp_register_in_network_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - return !!mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, error); + mm_base_modem_at_command (MM_BASE_MODEM (self), + "%CMATT=1", + 3, + FALSE, /* allow cached */ + (GAsyncReadyCallback)cmatt_ready, + task); } /*****************************************************************************/ @@ -770,7 +756,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable/disable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -805,26 +791,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_3gpp_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_3gpp_unsolicited_events_handlers (MM_BROADBAND_MODEM_ALTAIR_LTE (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -832,33 +816,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_3gpp_setup_unsolicited_events_ready, - result); + task); } static void parent_3gpp_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -866,12 +846,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own cleanup first */ set_3gpp_unsolicited_events_handlers (MM_BROADBAND_MODEM_ALTAIR_LTE (self), FALSE); @@ -880,7 +857,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_3gpp_cleanup_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -917,36 +894,34 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -957,7 +932,7 @@ NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void @@ -965,18 +940,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -994,36 +966,34 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_finish (self, res, NULL, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1031,7 +1001,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static void @@ -1039,12 +1009,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own disable first */ mm_base_modem_at_sequence ( @@ -1053,7 +1020,7 @@ NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -1065,16 +1032,21 @@ GError **error) { const gchar *result; - gchar *operator_code; + gchar *operator_code = NULL; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); if (!result) return NULL; - operator_code = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_UNKNOWN); - if (operator_code) - mm_dbg ("loaded Operator Code: %s", operator_code); + if (!mm_3gpp_parse_cops_read_response (result, + NULL, /* mode */ + NULL, /* format */ + &operator_code, + NULL, /* act */ + error)) + return NULL; + mm_dbg ("loaded Operator Code: %s", operator_code); return operator_code; } @@ -1109,16 +1081,23 @@ GError **error) { const gchar *result; - gchar *operator_name; + gchar *operator_name = NULL; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); if (!result) return NULL; - operator_name = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_UNKNOWN); + if (!mm_3gpp_parse_cops_read_response (result, + NULL, /* mode */ + NULL, /* format */ + &operator_name, + NULL, /* act */ + error)) + return NULL; + + mm_3gpp_normalize_operator (&operator_name, MM_MODEM_CHARSET_UNKNOWN); if (operator_name) mm_dbg ("loaded Operator Name: %s", operator_name); - return operator_name; } @@ -1145,154 +1124,30 @@ } /*****************************************************************************/ -/* Subscription State loading (3GPP interface) */ - -typedef struct { - MMIfaceModem3gpp *self; - GSimpleAsyncResult *result; - gchar *pco_info; -} LoadSubscriptionStateContext; - -static void -load_subscription_state_context_complete_and_free (LoadSubscriptionStateContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_free (ctx->pco_info); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadSubscriptionStateContext, ctx); -} - -static MMModem3gppSubscriptionState -altair_vzw_pco_value_to_mm_modem_3gpp_subscription_state (guint pco_value) -{ - switch (pco_value) { - case 0: - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_PROVISIONED; - case 3: - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_OUT_OF_DATA; - case 5: - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNPROVISIONED; - default: - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN; - } -} - -static MMModem3gppSubscriptionState -modem_3gpp_load_subscription_state_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN; - - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); -} +/* PCOINFO unsolicited event handler */ static void -altair_get_subscription_state (MMIfaceModem3gpp *self, - LoadSubscriptionStateContext *ctx) +altair_pco_info_changed (MMPortSerialAt *port, + GMatchInfo *match_info, + MMBroadbandModemAltairLte *self) { - guint pco_value = -1; + const gchar *pco_info; + MMPco *pco; GError *error = NULL; - MMModem3gppSubscriptionState subscription_state; - mm_dbg ("Parsing vendor PCO info: %s", ctx->pco_info); - pco_value = mm_altair_parse_vendor_pco_info (ctx->pco_info, &error); - if (error) { - g_simple_async_result_take_error (ctx->result, error); - load_subscription_state_context_complete_and_free (ctx); - return; - } - mm_dbg ("PCO value = %d", pco_value); - - subscription_state = altair_vzw_pco_value_to_mm_modem_3gpp_subscription_state (pco_value); - g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (subscription_state), NULL); - load_subscription_state_context_complete_and_free (ctx); -} - -static void -altair_load_vendor_pco_info_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - LoadSubscriptionStateContext *ctx) -{ - const gchar *response; - GError *error = NULL; + pco_info = g_match_info_fetch (match_info, 0); - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + mm_dbg ("Parsing vendor PCO info: %s", pco_info); + pco = mm_altair_parse_vendor_pco_info (pco_info, &error); if (error) { - mm_dbg ("Failed to load vendor PCO info."); - g_simple_async_result_take_error (ctx->result, error); - load_subscription_state_context_complete_and_free (ctx); - return; - } - g_assert (response); - ctx->pco_info = g_strdup (response); - altair_get_subscription_state (self, ctx); -} - -static void -modem_3gpp_load_subscription_state (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LoadSubscriptionStateContext *ctx; - - ctx = g_slice_new0 (LoadSubscriptionStateContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_subscription_state); - - mm_dbg ("Loading vendor PCO info..."); - mm_base_modem_at_command (MM_BASE_MODEM (self), - "%PCOINFO?", - 6, - FALSE, - (GAsyncReadyCallback)altair_load_vendor_pco_info_ready, - ctx); -} - -/*****************************************************************************/ -/* PCOINFO unsolicited event handler */ - -static void -altair_get_subscription_state_ready (MMBroadbandModemAltairLte *self, - GAsyncResult *res, - gpointer *user_data) -{ - GError *error = NULL; - MMModem3gppSubscriptionState subscription_state; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), &error)) { - mm_warn ("Couldn't load Subscription State: '%s'", error->message); + mm_warn ("Error parsing vendor PCO info: %s", error->message); g_error_free (error); return; } - subscription_state = GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - if (subscription_state != MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN) - mm_iface_modem_3gpp_update_subscription_state (MM_IFACE_MODEM_3GPP (self), subscription_state); -} - -static void -altair_pco_info_changed (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemAltairLte *self) -{ - LoadSubscriptionStateContext *ctx; - const gchar *response; - - ctx = g_slice_new0 (LoadSubscriptionStateContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - (GAsyncReadyCallback)altair_get_subscription_state_ready, - NULL, - altair_pco_info_changed); - response = g_match_info_fetch (match_info, 0); - ctx->pco_info = g_strdup (response); - altair_get_subscription_state (MM_IFACE_MODEM_3GPP (self), ctx); + self->priv->pco_list = mm_pco_list_add (self->priv->pco_list, pco); + mm_iface_modem_3gpp_update_pco_list (MM_IFACE_MODEM_3GPP (self), self->priv->pco_list); + g_object_unref (pco); } /*****************************************************************************/ @@ -1452,8 +1307,6 @@ iface->load_operator_code_finish = modem_3gpp_load_operator_code_finish; iface->load_operator_name = modem_3gpp_load_operator_name; iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish; - iface->load_subscription_state = modem_3gpp_load_subscription_state; - iface->load_subscription_state_finish = modem_3gpp_load_subscription_state_finish; } static void diff -Nru modemmanager-1.6.8/plugins/altair/mm-modem-helpers-altair-lte.c modemmanager-1.10.0/plugins/altair/mm-modem-helpers-altair-lte.c --- modemmanager-1.6.8/plugins/altair/mm-modem-helpers-altair-lte.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/mm-modem-helpers-altair-lte.c 2019-01-15 15:57:35.000000000 +0100 @@ -50,12 +50,12 @@ MMModemBand band; band_value = (guint32)strtoul (split[i], NULL, 10); - band = MM_MODEM_BAND_EUTRAN_I - 1 + band_value; + band = MM_MODEM_BAND_EUTRAN_1 - 1 + band_value; /* Due to a firmware issue, the modem may incorrectly includes 0 in the * bands response. We thus ignore any band value outside the range of * E-UTRAN operating bands. */ - if (band >= MM_MODEM_BAND_EUTRAN_I && band <= MM_MODEM_BAND_EUTRAN_XLIV) + if (band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_44) g_array_append_val (bands, band); } @@ -71,13 +71,13 @@ mm_altair_parse_ceer_response (const gchar *response, GError **error) { - GRegex *r; - GMatchInfo *match_info = NULL; + mm_autoptr(GRegex) r = NULL; + mm_autoptr(GMatchInfo) match_info = NULL; gchar *ceer_response = NULL; /* First accept an empty response as the no error case. Sometimes, the only - * respone to the AT+CEER query is an OK. + * response to the AT+CEER query is an OK. */ if (g_strcmp0 ("", response) == 0) { return g_strdup (""); @@ -93,8 +93,6 @@ if (!g_regex_match (r, response, 0, &match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Could not parse +CEER response"); - g_match_info_free (match_info); - g_regex_unref (r); return NULL; } @@ -104,8 +102,6 @@ ceer_response = g_strdup (""); } - g_match_info_free (match_info); - g_regex_unref (r); return ceer_response; } @@ -115,15 +111,13 @@ guint mm_altair_parse_cid (const gchar *response, GError **error) { - GRegex *regex; - GMatchInfo *match_info; + mm_autoptr(GRegex) regex = NULL; + mm_autoptr(GMatchInfo) match_info = NULL; guint cid = -1; regex = g_regex_new ("\\%CGINFO:\\s*(\\d+)", G_REGEX_RAW, 0, NULL); g_assert (regex); if (!g_regex_match_full (regex, response, strlen (response), 0, 0, &match_info, error)) { - g_match_info_free (match_info); - g_regex_unref (regex); return -1; } @@ -133,70 +127,23 @@ MM_CORE_ERROR_FAILED, "Failed to parse %%CGINFO=\"cid\",1 response"); - g_match_info_free (match_info); - g_regex_unref (regex); return cid; } /*****************************************************************************/ /* %PCOINFO response parser */ -typedef enum { - MM_VZW_PCO_PROVISIONED = 0, - MM_VZW_PCO_LIMIT_REACHED = 1, - MM_VZW_PCO_OUT_OF_DATA = 3, - MM_VZW_PCO_UNPROVISIONED = 5 -} MMVzwPco; - -static guint -altair_extract_vzw_pco_value (const gchar *pco_payload, GError **error) -{ - GRegex *regex; - GMatchInfo *match_info; - guint pco_value = -1; - - /* Extract PCO value from PCO payload. - * The PCO value in the VZW network is after the VZW PLMN (MCC+MNC 311-480). - */ - regex = g_regex_new ("130184(\\d+)", G_REGEX_RAW, 0, NULL); - g_assert (regex); - if (!g_regex_match_full (regex, - pco_payload, - strlen (pco_payload), - 0, - 0, - &match_info, - error)) { - g_match_info_free (match_info); - g_regex_unref (regex); - return -1; - } - - if (!g_match_info_matches (match_info) || - !mm_get_uint_from_match_info (match_info, 1, &pco_value)) - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse PCO value from PCO payload: '%s'", - pco_payload); - - g_match_info_free (match_info); - g_regex_unref (regex); - - return pco_value; -} - -guint +MMPco * mm_altair_parse_vendor_pco_info (const gchar *pco_info, GError **error) { - GRegex *regex; - GMatchInfo *match_info; - guint pco_value = -1; + mm_autoptr(GRegex) regex = NULL; + mm_autoptr(GMatchInfo) match_info = NULL; + MMPco *pco = NULL; gint num_matches; if (!pco_info[0]) /* No APNs configured, all done */ - return -1; + return NULL; /* Expected %PCOINFO response: * @@ -208,9 +155,7 @@ 0, NULL); g_assert (regex); if (!g_regex_match_full (regex, pco_info, strlen (pco_info), 0, 0, &match_info, error)) { - g_match_info_free (match_info); - g_regex_unref (regex); - return -1; + return NULL; } num_matches = g_match_info_get_match_count (match_info); @@ -220,15 +165,19 @@ MM_CORE_ERROR_FAILED, "Failed to parse substrings, number of matches: %d", num_matches); - g_match_info_free (match_info); - g_regex_unref (regex); - return -1; + return NULL; } while (g_match_info_matches (match_info)) { guint pco_cid; gchar *pco_id; gchar *pco_payload; + gsize pco_payload_len; + gchar *pco_payload_bytes = NULL; + gsize pco_payload_bytes_len; + guint8 pco_prefix[6]; + GByteArray *pco_raw; + gsize pco_raw_len; if (!mm_get_uint_from_match_info (match_info, 1, &pco_cid)) { g_set_error (error, @@ -239,6 +188,12 @@ break; } + /* We are only interested in IMS and Internet PDN PCO. */ + if (pco_cid != MM_ALTAIR_IMS_PDN_CID && pco_cid != MM_ALTAIR_INTERNET_PDN_CID) { + g_match_info_next (match_info, error); + continue; + } + pco_id = mm_get_string_unquoted_from_match_info (match_info, 3); if (!pco_id) { g_set_error (error, @@ -265,20 +220,61 @@ break; } - pco_value = altair_extract_vzw_pco_value (pco_payload, error); + pco_payload_len = strlen (pco_payload); + if (pco_payload_len % 2 == 0) + pco_payload_bytes = mm_utils_hexstr2bin (pco_payload, &pco_payload_bytes_len); + g_free (pco_payload); - /* We are only interested in IMS and Internet PDN PCO. */ - if (pco_cid == MM_ALTAIR_IMS_PDN_CID || pco_cid == MM_ALTAIR_INTERNET_PDN_CID) { + if (!pco_payload_bytes) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid PCO payload from PCO info: '%s'", + pco_info); break; } - pco_value = -1; - g_match_info_next (match_info, error); + /* Protocol Configuration Options (PCO) is an information element with an + * identifier (IEI) 0x27 and contains between 3 and 253 octets. See 3GPP TS + * 24.008 for more details on PCO. + * + * NOTE: The standard uses one-based indexing, but to better correlate to the + * code, zero-based indexing is used in the description hereinafter. + * + * Octet | Value + * --------+-------------------------------------------- + * 0 | PCO IEI (= 0x27) + * 1 | Length of PCO contents (= total length - 2) + * 2 | bit 7 : ext + * | bit 6 to 3 : spare (= 0b0000) + * | bit 2 to 0 : Configuration protocol + * 3 to 4 | Element 1 ID + * 5 | Length of element 1 contents + * 6 to m | Element 1 contents + * ... | + */ + pco_raw_len = sizeof (pco_prefix) + pco_payload_bytes_len; + pco_prefix[0] = 0x27; + pco_prefix[1] = pco_raw_len - 2; + pco_prefix[2] = 0x80; + /* Verizon uses element ID 0xFF00 for carrier-specific PCO content. */ + pco_prefix[3] = 0xFF; + pco_prefix[4] = 0x00; + pco_prefix[5] = pco_payload_bytes_len; + + pco_raw = g_byte_array_sized_new (pco_raw_len); + g_byte_array_append (pco_raw, pco_prefix, sizeof (pco_prefix)); + g_byte_array_append (pco_raw, (guint8 *)pco_payload_bytes, pco_payload_bytes_len); + g_free (pco_payload_bytes); + + pco = mm_pco_new (); + mm_pco_set_session_id (pco, pco_cid); + mm_pco_set_complete (pco, TRUE); + mm_pco_set_data (pco, pco_raw->data, pco_raw->len); + g_byte_array_unref (pco_raw); + break; } - g_match_info_free (match_info); - g_regex_unref (regex); - - return pco_value; + return pco; } diff -Nru modemmanager-1.6.8/plugins/altair/mm-modem-helpers-altair-lte.h modemmanager-1.10.0/plugins/altair/mm-modem-helpers-altair-lte.h --- modemmanager-1.6.8/plugins/altair/mm-modem-helpers-altair-lte.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/mm-modem-helpers-altair-lte.h 2019-01-15 15:57:35.000000000 +0100 @@ -19,6 +19,9 @@ #include +#define _LIBMM_INSIDE_MM +#include + /* Bands response parser */ GArray *mm_altair_parse_bands_response (const gchar *response); @@ -30,6 +33,6 @@ guint mm_altair_parse_cid (const gchar *response, GError **error); /* %PCOINFO response parser */ -guint mm_altair_parse_vendor_pco_info (const gchar *pco_info, GError **error); +MMPco *mm_altair_parse_vendor_pco_info (const gchar *pco_info, GError **error); #endif /* MM_MODEM_HELPERS_ALTAIR_H */ diff -Nru modemmanager-1.6.8/plugins/altair/mm-plugin-altair-lte.c modemmanager-1.10.0/plugins/altair/mm-plugin-altair-lte.c --- modemmanager-1.6.8/plugins/altair/mm-plugin-altair-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/mm-plugin-altair-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -51,14 +51,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_altair_lte_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_altair_lte_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/altair/tests/test-modem-helpers-altair-lte.c modemmanager-1.10.0/plugins/altair/tests/test-modem-helpers-altair-lte.c --- modemmanager-1.6.8/plugins/altair/tests/test-modem-helpers-altair-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/altair/tests/test-modem-helpers-altair-lte.c 2019-01-15 15:57:35.000000000 +0100 @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -43,10 +44,10 @@ bands = mm_altair_parse_bands_response ("0, 0, 1, 4,13,44,45"); g_assert (bands != NULL); g_assert_cmpuint (bands->len, ==, 4); - g_assert_cmpuint (g_array_index (bands, MMModemBand, 0), ==, MM_MODEM_BAND_EUTRAN_I); - g_assert_cmpuint (g_array_index (bands, MMModemBand, 1), ==, MM_MODEM_BAND_EUTRAN_IV); - g_assert_cmpuint (g_array_index (bands, MMModemBand, 2), ==, MM_MODEM_BAND_EUTRAN_XIII); - g_assert_cmpuint (g_array_index (bands, MMModemBand, 3), ==, MM_MODEM_BAND_EUTRAN_XLIV); + g_assert_cmpuint (g_array_index (bands, MMModemBand, 0), ==, MM_MODEM_BAND_EUTRAN_1); + g_assert_cmpuint (g_array_index (bands, MMModemBand, 1), ==, MM_MODEM_BAND_EUTRAN_4); + g_assert_cmpuint (g_array_index (bands, MMModemBand, 2), ==, MM_MODEM_BAND_EUTRAN_13); + g_assert_cmpuint (g_array_index (bands, MMModemBand, 3), ==, MM_MODEM_BAND_EUTRAN_44); g_array_free (bands, TRUE); } @@ -59,7 +60,7 @@ } CeerTest; static const CeerTest ceer_tests[] = { - { "", "" }, /* Special case, sometimes the response is empty, treat it as a valid response. */ + { "", "" }, /* Special case, sometimes the response is empty, treat it as a good response. */ { "+CEER:", "" }, { "+CEER: EPS_AND_NON_EPS_SERVICES_NOT_ALLOWED", "EPS_AND_NON_EPS_SERVICES_NOT_ALLOWED" }, { "+CEER: NO_SUITABLE_CELLS_IN_TRACKING_AREA", "NO_SUITABLE_CELLS_IN_TRACKING_AREA" }, @@ -97,52 +98,86 @@ g_assert (mm_altair_parse_cid ("%CGINFO:blah", NULL) == -1); } -static void -test_parse_vendor_pco_info (void) -{ - guint pco_value; +/*****************************************************************************/ +/* Test %PCOINFO responses */ + +typedef struct { + const gchar *pco_info; + guint32 session_id; + gsize pco_data_size; + guint8 pco_data[50]; +} TestValidPcoInfo; +static const TestValidPcoInfo good_pco_infos[] = { /* Valid PCO values */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,1,FF00,13018400", NULL); - g_assert (pco_value == 0); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,1,FF00,13018403", NULL); - g_assert (pco_value == 3); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,1,FF00,13018405", NULL); - g_assert (pco_value == 5); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,3,FF00,13018400", NULL); - g_assert (pco_value == 0); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,3,FF00,13018403", NULL); - g_assert (pco_value == 3); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,3,FF00,13018405", NULL); - g_assert (pco_value == 5); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO:1,FF00,13018400", NULL); - g_assert (pco_value == 0); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO:1,FF00,13018403", NULL); - g_assert (pco_value == 3); - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO:1,FF00,13018405", NULL); - g_assert (pco_value == 5); - /* Different container */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,3,F000,13018401", NULL); - g_assert (pco_value == -1); - /* Invalid CID */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,2,FF00,13018401", NULL); - g_assert (pco_value == -1); + { "%PCOINFO: 1,1,FF00,13018400", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x00 } }, + { "%PCOINFO: 1,1,FF00,13018403", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x03 } }, + { "%PCOINFO: 1,1,FF00,13018405", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, + { "%PCOINFO: 1,3,FF00,13018400", 3, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x00 } }, + { "%PCOINFO: 1,3,FF00,13018403", 3, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x03 } }, + { "%PCOINFO: 1,3,FF00,13018405", 3, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, + { "%PCOINFO:1,FF00,13018400", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x00 } }, + { "%PCOINFO:1,FF00,13018403", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x03 } }, + { "%PCOINFO:1,FF00,13018405", 1, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x05 } }, /* Different payload */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,3,FF00,13018501", NULL); - g_assert (pco_value == -1); - /* Bad PCO info */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: blah,blah,FF00,13018401", NULL); - g_assert (pco_value == -1); + { "%PCOINFO: 1,3,FF00,130185", 3, 9, + { 0x27, 0x07, 0x80, 0xFF, 0x00, 0x03, 0x13, 0x01, 0x85 } }, /* Multiline PCO info */ - pco_value = mm_altair_parse_vendor_pco_info ("%PCOINFO: 1,2,FF00,13018400\r\n%PCOINFO: 1,3,FF00,13018403", NULL); - g_assert (pco_value == 3); + { "%PCOINFO: 1,2,FF00,13018400\r\n%PCOINFO: 1,3,FF00,13018403", 3, 10, + { 0x27, 0x08, 0x80, 0xFF, 0x00, 0x04, 0x13, 0x01, 0x84, 0x03 } }, +}; + +static const gchar *bad_pco_infos[] = { + /* Different container */ + "%PCOINFO: 1,3,F000,13018401", + /* Ingood CID */ + "%PCOINFO: 1,2,FF00,13018401", + /* Bad PCO info */ + "%PCOINFO: blah,blah,FF00,13018401", + /* Bad PCO payload */ + "%PCOINFO: 1,1,FF00,130184011", +}; + +static void +test_parse_vendor_pco_info (void) +{ + MMPco *pco; + guint i; + + for (i = 0; i < G_N_ELEMENTS (good_pco_infos); ++i) { + const guint8 *pco_data; + gsize pco_data_size; + + pco = mm_altair_parse_vendor_pco_info (good_pco_infos[i].pco_info, NULL); + g_assert (pco != NULL); + g_assert_cmpuint (mm_pco_get_session_id (pco), ==, good_pco_infos[i].session_id); + g_assert (mm_pco_is_complete (pco)); + pco_data = mm_pco_get_data (pco, &pco_data_size); + g_assert (pco_data != NULL); + g_assert_cmpuint (pco_data_size, ==, good_pco_infos[i].pco_data_size); + g_assert_cmpint (memcmp (pco_data, good_pco_infos[i].pco_data, pco_data_size), ==, 0); + g_object_unref (pco); + } + + for (i = 0; i < G_N_ELEMENTS (bad_pco_infos); ++i) { + pco = mm_altair_parse_vendor_pco_info (bad_pco_infos[i], NULL); + g_assert (pco == NULL); + } } int main (int argc, char **argv) { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/altair/parse_bands", test_parse_bands); diff -Nru modemmanager-1.6.8/plugins/anydata/mm-broadband-modem-anydata.c modemmanager-1.10.0/plugins/anydata/mm-broadband-modem-anydata.c --- modemmanager-1.6.8/plugins/anydata/mm-broadband-modem-anydata.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/anydata/mm-broadband-modem-anydata.c 2018-11-15 09:55:53.000000000 +0100 @@ -47,36 +47,6 @@ MMModemCdmaRegistrationState detailed_evdo_state; } DetailedRegistrationStateResults; -typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - MMPortSerialAt *port; - MMModemCdmaRegistrationState cdma1x_state; - MMModemCdmaRegistrationState evdo_state; - GError *error; -} DetailedRegistrationStateContext; - -static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) -{ - if (ctx->error) - g_simple_async_result_take_error (ctx->result, ctx->error); - else { - DetailedRegistrationStateResults *results; - - results = g_new (DetailedRegistrationStateResults, 1); - results->detailed_cdma1x_state = ctx->cdma1x_state; - results->detailed_evdo_state = ctx->evdo_state; - g_simple_async_result_set_op_res_gpointer (ctx->result, results, g_free); - } - - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->port); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean get_detailed_registration_state_finish (MMIfaceModemCdma *self, GAsyncResult *res, @@ -86,31 +56,36 @@ { DetailedRegistrationStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *detailed_cdma1x_state = results->detailed_cdma1x_state; *detailed_evdo_state = results->detailed_evdo_state; + g_free (results); return TRUE; } static void hstate_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateResults *results; GError *error = NULL; const gchar *response; GRegex *r; GMatchInfo *match_info; + results = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { /* Leave superclass' reg state alone if AT*HSTATE isn't supported */ g_error_free (error); - /* Result is set here when completing */ - detailed_registration_state_context_complete_and_free (ctx); + + g_task_return_pointer (task, g_memdup (results, sizeof (*results)), g_free); + g_object_unref (task); return; } @@ -137,11 +112,11 @@ * It may be that IDLE actually means NO SERVICE too; not sure. */ if (dbm > -105) - ctx->evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; + results->detailed_evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; break; case 4: /* ACCESS */ case 5: /* CONNECT */ - ctx->evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; + results->detailed_evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; break; default: mm_warn ("ANYDATA: unknown *STATE (%d); assuming no service.", val); @@ -157,25 +132,29 @@ g_match_info_free (match_info); g_regex_unref (r); - /* Result is set here when completing */ - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, g_memdup (results, sizeof (*results)), g_free); + g_object_unref (task); } static void state_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateResults *results; + GError *error = NULL; const gchar *response; GRegex *r; GMatchInfo *match_info; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &ctx->error); - if (ctx->error) { - detailed_registration_state_context_complete_and_free (ctx); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); return; } + results = g_task_get_task_data (task); response = mm_strip_tag (response, "*STATE:"); /* Format is ",,,,,,..." */ @@ -199,12 +178,12 @@ * It may be that IDLE actually means NO SERVICE too; not sure. */ if (dbm > -105) - ctx->cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; + results->detailed_cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; break; case 2: /* ACCESS */ case 3: /* PAGING */ case 4: /* TRAFFIC */ - ctx->cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; + results->detailed_cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; break; default: mm_warn ("ANYDATA: unknown *STATE (%d); assuming no service.", val); @@ -224,7 +203,7 @@ 3, FALSE, (GAsyncReadyCallback)hstate_ready, - ctx); + task); } static void @@ -234,24 +213,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - DetailedRegistrationStateContext *ctx; + DetailedRegistrationStateResults *results; + GTask *task; + + results = g_new (DetailedRegistrationStateResults, 1); + results->detailed_cdma1x_state = cdma1x_state; + results->detailed_evdo_state = evdo_state; - /* Setup context */ - ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_detailed_registration_state); - ctx->cdma1x_state = cdma1x_state; - ctx->evdo_state = evdo_state; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, results, g_free); mm_base_modem_at_command (MM_BASE_MODEM (self), "*STATE?", 3, FALSE, (GAsyncReadyCallback)state_ready, - ctx); + task); } /*****************************************************************************/ @@ -295,7 +272,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Now reset the unsolicited messages */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/anydata/mm-plugin-anydata.c modemmanager-1.10.0/plugins/anydata/mm-plugin-anydata.c --- modemmanager-1.6.8/plugins/anydata/mm-plugin-anydata.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/anydata/mm-plugin-anydata.c 2018-11-15 09:55:53.000000000 +0100 @@ -38,7 +38,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -48,7 +48,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered AnyDATA modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -56,7 +56,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_anydata_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_anydata_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/cinterion/77-mm-cinterion-port-types.rules modemmanager-1.10.0/plugins/cinterion/77-mm-cinterion-port-types.rules --- modemmanager-1.6.8/plugins/cinterion/77-mm-cinterion-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/77-mm-cinterion-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,11 +1,16 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_cinterion_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_cinterion_port_types_end" -ENV{ID_VENDOR_ID}!="1e2d", GOTO="mm_cinterion_port_types_end" +ACTION!="add|change|move|bind", GOTO="mm_cinterion_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e2d", GOTO="mm_cinterion_port_types" +GOTO="mm_cinterion_port_types_end" +LABEL="mm_cinterion_port_types" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_CINTERION_PORT_TYPE_GPS}="1" +# PHS8 +ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_GPS}="1" + +# PLS8 +ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" LABEL="mm_cinterion_port_types_end" diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-broadband-bearer-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-broadband-bearer-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-broadband-bearer-cinterion.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/cinterion/mm-broadband-bearer-cinterion.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,750 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Trimble Navigation Limited + * Author: Matthew Stanger + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mm-base-modem-at.h" +#include "mm-broadband-bearer-cinterion.h" +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-cinterion.h" +#include "mm-daemon-enums-types.h" + +G_DEFINE_TYPE (MMBroadbandBearerCinterion, mm_broadband_bearer_cinterion, MM_TYPE_BROADBAND_BEARER) + +/*****************************************************************************/ +/* WWAN interface mapping */ + +typedef struct { + guint swwan_index; + guint usb_iface_num; +} UsbInterfaceConfig; + +/* Map SWWAN index, USB interface number and preferred PDP context. + * + * The expected USB interface mapping is: + * INTERFACE=usb0 -> ID_USB_INTERFACE_NUM=0a + * INTERFACE=usb1 -> ID_USB_INTERFACE_NUM=0c + */ +static const UsbInterfaceConfig usb_interface_configs[] = { + { + .swwan_index = 1, + .usb_iface_num = 0x0a, + }, + { + .swwan_index = 2, + .usb_iface_num = 0x0c, + }, +}; + +static gint +get_usb_interface_config_index (MMPort *data, + GError **error) +{ + guint usb_iface_num; + guint i; + + usb_iface_num = mm_kernel_device_get_property_as_int_hex (mm_port_peek_kernel_device (data), "ID_USB_INTERFACE_NUM"); + + for (i = 0; i < G_N_ELEMENTS (usb_interface_configs); i++) { + if (usb_interface_configs[i].usb_iface_num == usb_iface_num) + return (gint) i; + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unsupported WWAN interface: unexpected interface number: 0x%02x", usb_iface_num); + return -1; +} + +/*****************************************************************************/ +/* Connection status loading + * NOTE: only CONNECTED or DISCONNECTED should be reported here. + */ + +static MMBearerConnectionStatus +load_connection_status_finish (MMBaseBearer *bearer, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize aux; + + aux = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + } + return (MMBearerConnectionStatus) aux; +} + +static void +swwan_check_status_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + MMBearerConnectionStatus status; + guint cid; + + cid = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) { + g_task_return_error (task, error); + goto out; + } + + status = mm_cinterion_parse_swwan_response (response, cid, &error); + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) { + g_task_return_error (task, error); + goto out; + } + + g_assert (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED || + status == MM_BEARER_CONNECTION_STATUS_CONNECTED); + g_task_return_int (task, (gssize) status); + +out: + g_object_unref (task); +} + +static void +load_connection_status_by_cid (MMBroadbandBearerCinterion *bearer, + guint cid, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MMBaseModem *modem; + + task = g_task_new (bearer, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (cid), NULL); + + g_object_get (bearer, + MM_BASE_BEARER_MODEM, &modem, + NULL); + + mm_base_modem_at_command (modem, + "^SWWAN?", + 5, + FALSE, + (GAsyncReadyCallback) swwan_check_status_ready, + task); + g_object_unref (modem); +} + +static void +load_connection_status (MMBaseBearer *bearer, + GAsyncReadyCallback callback, + gpointer user_data) +{ + load_connection_status_by_cid (MM_BROADBAND_BEARER_CINTERION (bearer), + mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (bearer)), + callback, + user_data); +} + +/*****************************************************************************/ +/* Auth helpers */ + +typedef enum { + BEARER_CINTERION_AUTH_UNKNOWN = -1, + BEARER_CINTERION_AUTH_NONE = 0, + BEARER_CINTERION_AUTH_PAP = 1, + BEARER_CINTERION_AUTH_CHAP = 2, + BEARER_CINTERION_AUTH_MSCHAPV2 = 3, +} BearerCinterionAuthType; + +static BearerCinterionAuthType +parse_auth_type (MMBearerAllowedAuth mm_auth) +{ + switch (mm_auth) { + case MM_BEARER_ALLOWED_AUTH_NONE: + return BEARER_CINTERION_AUTH_NONE; + case MM_BEARER_ALLOWED_AUTH_PAP: + return BEARER_CINTERION_AUTH_PAP; + case MM_BEARER_ALLOWED_AUTH_CHAP: + return BEARER_CINTERION_AUTH_CHAP; + case MM_BEARER_ALLOWED_AUTH_MSCHAPV2: + return BEARER_CINTERION_AUTH_MSCHAPV2; + default: + return BEARER_CINTERION_AUTH_UNKNOWN; + } +} + +/* AT^SGAUTH=[, [, , ]] */ +static gchar * +build_auth_string (MMBearerProperties *config, + guint cid) +{ + const gchar *user; + const gchar *passwd; + gboolean has_user; + gboolean has_passwd; + MMBearerAllowedAuth auth; + BearerCinterionAuthType encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN; + + user = mm_bearer_properties_get_user (config); + passwd = mm_bearer_properties_get_password (config); + auth = mm_bearer_properties_get_allowed_auth (config); + + has_user = (user && user[0]); + has_passwd = (passwd && passwd[0]); + encoded_auth = parse_auth_type (auth); + + /* When 'none' requested, we won't require user/password */ + if (encoded_auth == BEARER_CINTERION_AUTH_NONE) { + if (has_user || has_passwd) + mm_warn ("APN user/password given but 'none' authentication requested"); + return g_strdup_printf ("^SGAUTH=%u,%d", cid, encoded_auth); + } + + /* No explicit auth type requested? */ + if (encoded_auth == BEARER_CINTERION_AUTH_UNKNOWN) { + /* If no user/passwd given, do nothing */ + if (!has_user && !has_passwd) + return NULL; + + /* If user/passwd given, default to PAP */ + mm_dbg ("APN user/password given but no authentication type explicitly requested: defaulting to 'PAP'"); + encoded_auth = BEARER_CINTERION_AUTH_PAP; + } + + return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s", cid, encoded_auth, passwd, user); +} + +/******************************************************************************/ +/* Dial 3GPP */ + +typedef enum { + DIAL_3GPP_CONTEXT_STEP_FIRST = 0, + DIAL_3GPP_CONTEXT_STEP_AUTH, + DIAL_3GPP_CONTEXT_STEP_START_SWWAN, + DIAL_3GPP_CONTEXT_STEP_VALIDATE_CONNECTION, + DIAL_3GPP_CONTEXT_STEP_LAST, +} Dial3gppContextStep; + +typedef struct { + MMBroadbandBearerCinterion *self; + MMBaseModem *modem; + MMPortSerialAt *primary; + guint cid; + MMPort *data; + gint usb_interface_config_index; + Dial3gppContextStep step; +} Dial3gppContext; + +static void +dial_3gpp_context_free (Dial3gppContext *ctx) +{ + g_object_unref (ctx->modem); + g_object_unref (ctx->self); + g_object_unref (ctx->primary); + g_clear_object (&ctx->data); + g_slice_free (Dial3gppContext, ctx); +} + +static MMPort * +dial_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) +{ + return MM_PORT (g_task_propagate_pointer (G_TASK (res), error)); +} + +static void dial_3gpp_context_step (GTask *task); + +static void +dial_connection_status_ready (MMBroadbandBearerCinterion *self, + GAsyncResult *res, + GTask *task) +{ + MMBearerConnectionStatus status; + Dial3gppContext *ctx; + GError *error = NULL; + + ctx = (Dial3gppContext *) g_task_get_task_data (task); + + status = load_connection_status_finish (MM_BASE_BEARER (self), res, &error); + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "CID %u is reported disconnected", ctx->cid); + g_object_unref (task); + return; + } + + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED); + + /* Go to next step */ + ctx->step++; + dial_3gpp_context_step (task); +} + +static void +common_dial_operation_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + Dial3gppContext *ctx; + GError *error = NULL; + + ctx = (Dial3gppContext *) g_task_get_task_data (task); + + if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Go to next step */ + ctx->step++; + dial_3gpp_context_step (task); +} + +static void +handle_cancel_dial (GTask *task) +{ + Dial3gppContext *ctx; + gchar *command; + + ctx = (Dial3gppContext *) g_task_get_task_data (task); + + /* Disconnect, may not succeed. Will not check response on cancel */ + command = g_strdup_printf ("^SWWAN=0,%u,%u", + ctx->cid, usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + mm_base_modem_at_command_full (ctx->modem, + ctx->primary, + command, + 3, + FALSE, + FALSE, + NULL, + NULL, + NULL); + g_free (command); +} + +static void +dial_3gpp_context_step (GTask *task) +{ + Dial3gppContext *ctx; + + ctx = (Dial3gppContext *) g_task_get_task_data (task); + + /* Check for cancellation */ + if (g_task_return_error_if_cancelled (task)) { + handle_cancel_dial (task); + g_object_unref (task); + return; + } + + switch (ctx->step) { + case DIAL_3GPP_CONTEXT_STEP_FIRST: { + MMBearerIpFamily ip_family; + + /* Only IPv4 supported by this bearer implementation for now */ + ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + if (ip_family == MM_BEARER_IP_FAMILY_NONE || ip_family == MM_BEARER_IP_FAMILY_ANY) { + gchar *ip_family_str; + + ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (ctx->self)); + ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family); + mm_dbg ("No specific IP family requested, defaulting to %s", ip_family_str); + g_free (ip_family_str); + } + + if (ip_family != MM_BEARER_IP_FAMILY_IPV4) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Only IPv4 is supported by this modem"); + g_object_unref (task); + return; + } + + /* Fall down to next step */ + ctx->step++; + } + + case DIAL_3GPP_CONTEXT_STEP_AUTH: { + gchar *command; + + command = build_auth_string (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)), ctx->cid); + if (command) { + mm_dbg ("cinterion dial step %u/%u: authenticating...", ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST); + /* Send SGAUTH write, if User & Pass are provided. + * advance to next state by callback */ + mm_base_modem_at_command_full (ctx->modem, + ctx->primary, + command, + 10, + FALSE, + FALSE, + NULL, + (GAsyncReadyCallback) common_dial_operation_ready, + task); + g_free (command); + return; + } + + /* Fall down to next step */ + mm_dbg ("cinterion dial step %u/%u: authentication not required", ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST); + ctx->step++; + } + + case DIAL_3GPP_CONTEXT_STEP_START_SWWAN: { + gchar *command; + + mm_dbg ("cinterion dial step %u/%u: starting SWWAN interface %u connection...", + ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST, usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + command = g_strdup_printf ("^SWWAN=1,%u,%u", + ctx->cid, + usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + mm_base_modem_at_command_full (ctx->modem, + ctx->primary, + command, + 90, + FALSE, + FALSE, + NULL, + (GAsyncReadyCallback) common_dial_operation_ready, + task); + g_free (command); + return; + } + + case DIAL_3GPP_CONTEXT_STEP_VALIDATE_CONNECTION: + mm_dbg ("cinterion dial step %u/%u: checking SWWAN interface %u status...", + ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST, usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + load_connection_status_by_cid (ctx->self, + ctx->cid, + (GAsyncReadyCallback) dial_connection_status_ready, + task); + return; + + case DIAL_3GPP_CONTEXT_STEP_LAST: + mm_dbg ("cinterion dial step %u/%u: finished", ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST); + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); + return; + } +} + +static void +dial_3gpp (MMBroadbandBearer *self, + MMBaseModem *modem, + MMPortSerialAt *primary, + guint cid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Dial3gppContext *ctx; + GError *error = NULL; + + g_assert (primary != NULL); + + /* Setup task and create connection context */ + task = g_task_new (self, cancellable, callback, user_data); + ctx = g_slice_new0 (Dial3gppContext); + g_task_set_task_data (task, ctx, (GDestroyNotify) dial_3gpp_context_free); + + /* Setup context */ + ctx->self = g_object_ref (self); + ctx->modem = g_object_ref (modem); + ctx->primary = g_object_ref (primary); + ctx->cid = cid; + ctx->step = DIAL_3GPP_CONTEXT_STEP_FIRST; + + /* Get a net port to setup the connection on */ + ctx->data = mm_base_modem_peek_best_data_port (MM_BASE_MODEM (modem), MM_PORT_TYPE_NET); + if (!ctx->data) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); + g_object_unref (task); + return; + } + g_object_ref (ctx->data); + + /* Validate configuration */ + ctx->usb_interface_config_index = get_usb_interface_config_index (ctx->data, &error); + if (ctx->usb_interface_config_index < 0) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Run! */ + dial_3gpp_context_step (task); +} + +/*****************************************************************************/ +/* Disconnect 3GPP */ + +typedef enum { + DISCONNECT_3GPP_CONTEXT_STEP_FIRST, + DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN, + DISCONNECT_3GPP_CONTEXT_STEP_CONNECTION_STATUS, + DISCONNECT_3GPP_CONTEXT_STEP_LAST, +} Disconnect3gppContextStep; + +typedef struct { + MMBroadbandBearerCinterion *self; + MMBaseModem *modem; + MMPortSerialAt *primary; + MMPort *data; + guint cid; + gint usb_interface_config_index; + Disconnect3gppContextStep step; +} Disconnect3gppContext; + +static void +disconnect_3gpp_context_free (Disconnect3gppContext *ctx) +{ + g_object_unref (ctx->data); + g_object_unref (ctx->primary); + g_object_unref (ctx->self); + g_object_unref (ctx->modem); + g_slice_free (Disconnect3gppContext, ctx); +} + +static gboolean +disconnect_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void disconnect_3gpp_context_step (GTask *task); + +static void +disconnect_connection_status_ready (MMBroadbandBearerCinterion *self, + GAsyncResult *res, + GTask *task) +{ + MMBearerConnectionStatus status; + Disconnect3gppContext *ctx; + GError *error = NULL; + + ctx = (Disconnect3gppContext *) g_task_get_task_data (task); + + status = load_connection_status_finish (MM_BASE_BEARER (self), res, &error); + switch (status) { + case MM_BEARER_CONNECTION_STATUS_UNKNOWN: + /* Assume disconnected */ + mm_dbg ("couldn't get CID %u status, assume disconnected: %s", ctx->cid, error->message); + g_clear_error (&error); + break; + case MM_BEARER_CONNECTION_STATUS_DISCONNECTED: + break; + case MM_BEARER_CONNECTION_STATUS_CONNECTED: + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "CID %u is reported connected", ctx->cid); + g_object_unref (task); + return; + default: + g_assert_not_reached (); + } + + /* Go on to next step */ + ctx->step++; + disconnect_3gpp_context_step (task); +} + +static void +swwan_disconnect_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + Disconnect3gppContext *ctx; + + ctx = (Disconnect3gppContext *) g_task_get_task_data (task); + + /* We don't bother to check error or response here since, ctx flow's + * next step checks it */ + mm_base_modem_at_command_full_finish (modem, res, NULL); + + /* Go on to next step */ + ctx->step++; + disconnect_3gpp_context_step (task); +} + +static void +disconnect_3gpp_context_step (GTask *task) +{ + Disconnect3gppContext *ctx; + + ctx = (Disconnect3gppContext *) g_task_get_task_data (task); + + switch (ctx->step) { + case DISCONNECT_3GPP_CONTEXT_STEP_FIRST: + /* Fall down to next step */ + ctx->step++; + + case DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN: { + gchar *command; + + command = g_strdup_printf ("^SWWAN=0,%u,%u", + ctx->cid, usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + mm_dbg ("cinterion disconnect step %u/%u: disconnecting PDP CID %u...", + ctx->step, DISCONNECT_3GPP_CONTEXT_STEP_LAST, ctx->cid); + mm_base_modem_at_command_full (ctx->modem, + ctx->primary, + command, + 10, + FALSE, + FALSE, + NULL, + (GAsyncReadyCallback) swwan_disconnect_ready, + task); + g_free (command); + return; + } + + case DISCONNECT_3GPP_CONTEXT_STEP_CONNECTION_STATUS: + mm_dbg ("cinterion disconnect step %u/%u: checking SWWAN interface %u status...", + ctx->step, DISCONNECT_3GPP_CONTEXT_STEP_LAST, + usb_interface_configs[ctx->usb_interface_config_index].swwan_index); + load_connection_status_by_cid (MM_BROADBAND_BEARER_CINTERION (ctx->self), + ctx->cid, + (GAsyncReadyCallback) disconnect_connection_status_ready, + task); + return; + + case DISCONNECT_3GPP_CONTEXT_STEP_LAST: + mm_dbg ("cinterion disconnect step %u/%u: finished", + ctx->step, DISCONNECT_3GPP_CONTEXT_STEP_LAST); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } +} + +static void +disconnect_3gpp (MMBroadbandBearer *self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + MMPortSerialAt *secondary, + MMPort *data, + guint cid, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Disconnect3gppContext *ctx; + GError *error = NULL; + + g_assert (primary != NULL); + g_assert (data != NULL); + + /* Setup task and create connection context */ + task = g_task_new (self, NULL, callback, user_data); + ctx = g_slice_new0 (Disconnect3gppContext); + g_task_set_task_data (task, ctx, (GDestroyNotify) disconnect_3gpp_context_free); + + /* Setup context */ + ctx->self = g_object_ref (self); + ctx->modem = g_object_ref (modem); + ctx->primary = g_object_ref (primary); + ctx->data = g_object_ref (data); + ctx->cid = cid; + ctx->step = DISCONNECT_3GPP_CONTEXT_STEP_FIRST; + + /* Validate configuration */ + ctx->usb_interface_config_index = get_usb_interface_config_index (data, &error); + if (ctx->usb_interface_config_index < 0) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Start */ + disconnect_3gpp_context_step (task); +} + +/*****************************************************************************/ +/* Setup and Init Bearers */ + +MMBaseBearer * +mm_broadband_bearer_cinterion_new_finish (GAsyncResult *res, + GError **error) +{ + GObject *bearer; + GObject *source; + + source = g_async_result_get_source_object (res); + bearer = g_async_initable_new_finish (G_ASYNC_INITABLE (source), res, error); + g_object_unref (source); + + if (!bearer) + return NULL; + + /* Only export valid bearers */ + mm_base_bearer_export (MM_BASE_BEARER (bearer)); + + return MM_BASE_BEARER (bearer); +} + +void +mm_broadband_bearer_cinterion_new (MMBroadbandModemCinterion *modem, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async ( + MM_TYPE_BROADBAND_BEARER_CINTERION, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + MM_BASE_BEARER_MODEM, modem, + MM_BASE_BEARER_CONFIG, config, + NULL); +} + +static void +mm_broadband_bearer_cinterion_init (MMBroadbandBearerCinterion *self) +{ +} + +static void +mm_broadband_bearer_cinterion_class_init (MMBroadbandBearerCinterionClass *klass) +{ + MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass); + MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass); + + base_bearer_class->load_connection_status = load_connection_status; + base_bearer_class->load_connection_status_finish = load_connection_status_finish; + + broadband_bearer_class->dial_3gpp = dial_3gpp; + broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; + broadband_bearer_class->disconnect_3gpp = disconnect_3gpp; + broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish; +} diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-broadband-bearer-cinterion.h modemmanager-1.10.0/plugins/cinterion/mm-broadband-bearer-cinterion.h --- modemmanager-1.6.8/plugins/cinterion/mm-broadband-bearer-cinterion.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/cinterion/mm-broadband-bearer-cinterion.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Trimble Navigation Limited + * Author: Matthew Stanger + */ + +#ifndef MM_BROADBAND_BEARER_CINTERION_H +#define MM_BROADBAND_BEARER_CINTERION_H + +#include +#include + +#include "mm-broadband-bearer.h" +#include "mm-broadband-modem-cinterion.h" + +#define MM_TYPE_BROADBAND_BEARER_CINTERION (mm_broadband_bearer_cinterion_get_type ()) +#define MM_BROADBAND_BEARER_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_BEARER_CINTERION, MMBroadbandBearerCinterion)) +#define MM_BROADBAND_BEARER_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_BEARER_CINTERION, MMBroadbandBearerCinterionClass)) +#define MM_IS_BROADBAND_BEARER_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_BEARER_CINTERION)) +#define MM_IS_BROADBAND_BEARER_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_BEARER_CINTERION)) +#define MM_BROADBAND_BEARER_CINTERION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_BEARER_CINTERION, MMBroadbandBearerCinterionClass)) + +typedef struct _MMBroadbandBearerCinterion MMBroadbandBearerCinterion; +typedef struct _MMBroadbandBearerCinterionClass MMBroadbandBearerCinterionClass; + +struct _MMBroadbandBearerCinterion { + MMBroadbandBearer parent; +}; + +struct _MMBroadbandBearerCinterionClass { + MMBroadbandBearerClass parent; +}; + +GType mm_broadband_bearer_cinterion_get_type (void); + +void mm_broadband_bearer_cinterion_new (MMBroadbandModemCinterion *modem, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBaseBearer *mm_broadband_bearer_cinterion_new_finish (GAsyncResult *res, + GError **error); + +#endif /* MM_BROADBAND_BEARER_CINTERION_H */ diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-broadband-modem-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-broadband-modem-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-broadband-modem-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-broadband-modem-cinterion.c 2019-01-15 15:57:35.000000000 +0100 @@ -12,7 +12,9 @@ * * Copyright (C) 2011 Ammonit Measurement GmbH * Copyright (C) 2011 Google Inc. + * Copyright (C) 2016 Trimble Navigation Limited * Author: Aleksander Morgado + * Contributor: Matthew Stanger */ #include @@ -35,25 +37,33 @@ #include "mm-base-modem-at.h" #include "mm-broadband-modem-cinterion.h" #include "mm-modem-helpers-cinterion.h" -#include "mm-common-cinterion.h" +#include "mm-shared-cinterion.h" +#include "mm-broadband-bearer-cinterion.h" -static void iface_modem_init (MMIfaceModem *iface); -static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface); +static void iface_modem_init (MMIfaceModem *iface); +static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface); static void iface_modem_messaging_init (MMIfaceModemMessaging *iface); -static void iface_modem_location_init (MMIfaceModemLocation *iface); +static void iface_modem_location_init (MMIfaceModemLocation *iface); +static void shared_cinterion_init (MMSharedCinterion *iface); -static MMIfaceModem *iface_modem_parent; +static MMIfaceModem *iface_modem_parent; +static MMIfaceModem3gpp *iface_modem_3gpp_parent; +static MMIfaceModemLocation *iface_modem_location_parent; G_DEFINE_TYPE_EXTENDED (MMBroadbandModemCinterion, mm_broadband_modem_cinterion, MM_TYPE_BROADBAND_MODEM, 0, G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_MESSAGING, iface_modem_messaging_init) - G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_CINTERION, shared_cinterion_init)) -struct _MMBroadbandModemCinterionPrivate { - /* Flag to know if we should try AT^SIND or not to get psinfo */ - gboolean sind_psinfo; +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_NOT_SUPPORTED, + FEATURE_SUPPORTED, +} FeatureSupport; +struct _MMBroadbandModemCinterionPrivate { /* Command to go into sleep mode */ gchar *sleep_mode_cmd; @@ -69,61 +79,38 @@ GArray *cnmi_supported_bm; GArray *cnmi_supported_ds; GArray *cnmi_supported_bfr; -}; - -/*****************************************************************************/ -/* Unsolicited events enabling */ -static gboolean -enable_unsolicited_events_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); -} + /* +CIEV 'psinfo' indications */ + GRegex *ciev_psinfo_regex; -static void -enable_unsolicited_events (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - /* AT=CMER=[[,[,[,[,]]]]] - * but should be either not set, or equal to 0 or 2. - * Enabled with 2. - */ - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+CMER=3,0,0,2", - 3, - FALSE, - callback, - user_data); -} + /* Flags for feature support checks */ + FeatureSupport swwan_support; + FeatureSupport sind_psinfo_support; +}; /*****************************************************************************/ /* Enable unsolicited events (SMS indications) (Messaging interface) */ static gboolean -messaging_enable_unsolicited_events_finish (MMIfaceModemMessaging *self, - GAsyncResult *res, - GError **error) +messaging_enable_unsolicited_events_finish (MMIfaceModemMessaging *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -cnmi_test_ready (MMBaseModem *self, +cnmi_test_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (error) - g_simple_async_result_take_error (simple, error); + if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static gboolean @@ -144,84 +131,79 @@ static void messaging_enable_unsolicited_events (MMIfaceModemMessaging *_self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); - GString *cmd; - GError *error = NULL; - GSimpleAsyncResult *simple; + GString *cmd; + GError *error = NULL; + GTask *task; - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_enable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* AT+CNMI=,[[,[,[,]]]] */ cmd = g_string_new ("+CNMI="); /* Mode 2 or 1 */ - if (!error) { - if (value_supported (self->priv->cnmi_supported_mode, 2)) - g_string_append_printf (cmd, "%u,", 2); - else if (value_supported (self->priv->cnmi_supported_mode, 1)) - g_string_append_printf (cmd, "%u,", 1); - else - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "SMS settings don't accept [2,1] "); + if (value_supported (self->priv->cnmi_supported_mode, 2)) + g_string_append_printf (cmd, "%u,", 2); + else if (value_supported (self->priv->cnmi_supported_mode, 1)) + g_string_append_printf (cmd, "%u,", 1); + else { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "SMS settings don't accept [2,1] "); + goto out; } /* mt 2 or 1 */ - if (!error) { - if (value_supported (self->priv->cnmi_supported_mt, 2)) - g_string_append_printf (cmd, "%u,", 2); - else if (value_supported (self->priv->cnmi_supported_mt, 1)) - g_string_append_printf (cmd, "%u,", 1); - else - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "SMS settings don't accept [2,1] "); + if (value_supported (self->priv->cnmi_supported_mt, 2)) + g_string_append_printf (cmd, "%u,", 2); + else if (value_supported (self->priv->cnmi_supported_mt, 1)) + g_string_append_printf (cmd, "%u,", 1); + else { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "SMS settings don't accept [2,1] "); + goto out; } /* bm 2 or 0 */ - if (!error) { - if (value_supported (self->priv->cnmi_supported_bm, 2)) - g_string_append_printf (cmd, "%u,", 2); - else if (value_supported (self->priv->cnmi_supported_bm, 0)) - g_string_append_printf (cmd, "%u,", 0); - else - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "SMS settings don't accept [2,0] "); + if (value_supported (self->priv->cnmi_supported_bm, 2)) + g_string_append_printf (cmd, "%u,", 2); + else if (value_supported (self->priv->cnmi_supported_bm, 0)) + g_string_append_printf (cmd, "%u,", 0); + else { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "SMS settings don't accept [2,0] "); + goto out; } /* ds 2, 1 or 0 */ - if (!error) { - if (value_supported (self->priv->cnmi_supported_ds, 2)) - g_string_append_printf (cmd, "%u,", 2); - else if (value_supported (self->priv->cnmi_supported_ds, 1)) - g_string_append_printf (cmd, "%u,", 1); - else if (value_supported (self->priv->cnmi_supported_ds, 0)) - g_string_append_printf (cmd, "%u,", 0); - else - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "SMS settings don't accept [2,1,0] "); + if (value_supported (self->priv->cnmi_supported_ds, 2)) + g_string_append_printf (cmd, "%u,", 2); + else if (value_supported (self->priv->cnmi_supported_ds, 1)) + g_string_append_printf (cmd, "%u,", 1); + else if (value_supported (self->priv->cnmi_supported_ds, 0)) + g_string_append_printf (cmd, "%u,", 0); + else { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "SMS settings don't accept [2,1,0] "); + goto out; } /* bfr 1 */ - if (!error) { - if (value_supported (self->priv->cnmi_supported_bfr, 1)) - g_string_append_printf (cmd, "%u", 1); - /* otherwise, skip setting it */ - } + if (value_supported (self->priv->cnmi_supported_bfr, 1)) + g_string_append_printf (cmd, "%u", 1); + /* otherwise, skip setting it */ +out: /* Early error report */ if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); g_string_free (cmd, TRUE); return; } @@ -231,7 +213,7 @@ 3, FALSE, (GAsyncReadyCallback)cnmi_test_ready, - simple); + task); g_string_free (cmd, TRUE); } @@ -239,26 +221,26 @@ /* Check if Messaging supported (Messaging interface) */ static gboolean -messaging_check_support_finish (MMIfaceModemMessaging *self, - GAsyncResult *res, - GError **error) +messaging_check_support_finish (MMIfaceModemMessaging *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -cnmi_format_check_ready (MMBroadbandModemCinterion *self, +cnmi_format_check_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - GError *error = NULL; - const gchar *response; + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + GError *error = NULL; + const gchar *response; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (_self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -275,32 +257,26 @@ } /* CNMI command is supported; assume we have full messaging capabilities */ - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void messaging_check_support (MMIfaceModemMessaging *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_check_support); + task = g_task_new (self, NULL, callback, user_data); /* We assume that CDMA-only modems don't have messaging capabilities */ if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "CDMA-only modems don't have messaging capabilities"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "CDMA-only modems don't have messaging capabilities"); + g_object_unref (task); return; } @@ -310,75 +286,73 @@ 3, TRUE, (GAsyncReadyCallback)cnmi_format_check_ready, - result); + task); } /*****************************************************************************/ -/* MODEM POWER DOWN */ +/* Power down */ static gboolean -modem_power_down_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +modem_power_down_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -sleep_ready (MMBaseModem *self, +sleep_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - - /* Ignore errors */ - if (error) { + if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) { + /* Ignore errors */ mm_dbg ("Couldn't send power down command: '%s'", error->message); g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -send_sleep_mode_command (MMBroadbandModemCinterion *self, - GSimpleAsyncResult *operation_result) +send_sleep_mode_command (GTask *task) { - if (self->priv->sleep_mode_cmd && - self->priv->sleep_mode_cmd[0]) { + MMBroadbandModemCinterion *self; + + self = g_task_get_source_object (task); + + if (self->priv->sleep_mode_cmd && self->priv->sleep_mode_cmd[0]) { mm_base_modem_at_command (MM_BASE_MODEM (self), self->priv->sleep_mode_cmd, 5, FALSE, (GAsyncReadyCallback)sleep_ready, - operation_result); + task); return; } /* No default command; just finish without sending anything */ - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -supported_functionality_status_query_ready (MMBroadbandModemCinterion *self, +supported_functionality_status_query_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { - const gchar *response; - GError *error = NULL; + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + const gchar *response; + GError *error = NULL; g_assert (self->priv->sleep_mode_cmd == NULL); - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (_self, res, &error); if (!response) { - mm_warn ("Couldn't query supported functionality status: '%s'", - error->message); + mm_warn ("Couldn't query supported functionality status: '%s'", error->message); g_error_free (error); self->priv->sleep_mode_cmd = g_strdup (""); } else { @@ -404,26 +378,22 @@ } } - send_sleep_mode_command (self, operation_result); + send_sleep_mode_command (task); } static void -modem_power_down (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_power_down (MMIfaceModem *_self, + GAsyncReadyCallback callback, + gpointer user_data) { - MMBroadbandModemCinterion *cinterion = MM_BROADBAND_MODEM_CINTERION (self); - GSimpleAsyncResult *result; + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_down); + task = g_task_new (self, NULL, callback, user_data); /* If sleep command already decided, use it. */ - if (cinterion->priv->sleep_mode_cmd) - send_sleep_mode_command (MM_BROADBAND_MODEM_CINTERION (self), - result); + if (self->priv->sleep_mode_cmd) + send_sleep_mode_command (task); else mm_base_modem_at_command ( MM_BASE_MODEM (self), @@ -431,7 +401,7 @@ 3, FALSE, (GAsyncReadyCallback)supported_functionality_status_query_ready, - result); + task); } /*****************************************************************************/ @@ -440,18 +410,16 @@ #define MAX_POWER_OFF_WAIT_TIME_SECS 20 typedef struct { - MMBroadbandModemCinterion *self; MMPortSerialAt *port; - GSimpleAsyncResult *result; - GRegex *shutdown_regex; - gboolean shutdown_received; - gboolean smso_replied; - gboolean serial_open; - guint timeout_id; + GRegex *shutdown_regex; + gboolean shutdown_received; + gboolean smso_replied; + gboolean serial_open; + guint timeout_id; } PowerOffContext; static void -power_off_context_complete_and_free (PowerOffContext *ctx) +power_off_context_free (PowerOffContext *ctx) { if (ctx->serial_open) mm_port_serial_close (MM_PORT_SERIAL (ctx->port)); @@ -459,99 +427,118 @@ g_source_remove (ctx->timeout_id); mm_port_serial_at_add_unsolicited_msg_handler (ctx->port, ctx->shutdown_regex, NULL, NULL, NULL); g_object_unref (ctx->port); - g_object_unref (ctx->self); g_regex_unref (ctx->shutdown_regex); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_slice_free (PowerOffContext, ctx); } static gboolean -modem_power_off_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +modem_power_off_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -complete_power_off (PowerOffContext *ctx) +complete_power_off (GTask *task) { + PowerOffContext *ctx; + + ctx = g_task_get_task_data (task); + if (!ctx->shutdown_received || !ctx->smso_replied) return; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - power_off_context_complete_and_free (ctx); + /* remove timeout right away */ + g_assert (ctx->timeout_id); + g_source_remove (ctx->timeout_id); + ctx->timeout_id = 0; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -smso_ready (MMBaseModem *self, +smso_ready (MMBaseModem *self, GAsyncResult *res, - PowerOffContext *ctx) + GTask *task) { - GError *error = NULL; + PowerOffContext *ctx; + GError *error = NULL; - mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error); - if (error) { - g_simple_async_result_take_error (ctx->result, error); - power_off_context_complete_and_free (ctx); + ctx = g_task_get_task_data (task); + + if (!mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } - /* Set as replied */ + /* Set as replied and see if we can complete */ ctx->smso_replied = TRUE; - complete_power_off (ctx); + complete_power_off (task); } static void shutdown_received (MMPortSerialAt *port, - GMatchInfo *match_info, - PowerOffContext *ctx) + GMatchInfo *match_info, + GTask *task) { - /* Cleanup handler */ + PowerOffContext *ctx; + + ctx = g_task_get_task_data (task); + + /* Cleanup handler right away, we don't want it called any more */ mm_port_serial_at_add_unsolicited_msg_handler (port, ctx->shutdown_regex, NULL, NULL, NULL); - /* Set as received */ + + /* Set as received and see if we can complete */ ctx->shutdown_received = TRUE; - complete_power_off (ctx); + complete_power_off (task); } static gboolean -power_off_timeout_cb (PowerOffContext *ctx) +power_off_timeout_cb (GTask *task) { + PowerOffContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; /* The SMSO reply should have come earlier */ g_warn_if_fail (ctx->smso_replied == TRUE); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Power off operation timed out"); - power_off_context_complete_and_free (ctx); + /* Cleanup handler right away, we no longer want to receive it */ + mm_port_serial_at_add_unsolicited_msg_handler (ctx->port, ctx->shutdown_regex, NULL, NULL, NULL); + + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Power off operation timed out"); + g_object_unref (task); return G_SOURCE_REMOVE; } static void -modem_power_off (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_power_off (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; PowerOffContext *ctx; - GError *error = NULL; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); ctx = g_slice_new0 (PowerOffContext); - ctx->self = g_object_ref (self); ctx->port = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_off); ctx->shutdown_regex = g_regex_new ("\\r\\n\\^SHUTDOWN\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); ctx->timeout_id = g_timeout_add_seconds (MAX_POWER_OFF_WAIT_TIME_SECS, (GSourceFunc)power_off_timeout_cb, - ctx); + task); + g_task_set_task_data (task, ctx, (GDestroyNotify) power_off_context_free); /* We'll need to wait for a ^SHUTDOWN before returning the action, which is * when the modem tells us that it is ready to be shutdown */ @@ -559,15 +546,15 @@ ctx->port, ctx->shutdown_regex, (MMPortSerialAtUnsolicitedMsgFn)shutdown_received, - ctx, + task, NULL); /* In order to get the ^SHUTDOWN notification, we must keep the port open * during the wait time */ ctx->serial_open = mm_port_serial_open (MM_PORT_SERIAL (ctx->port), &error); if (G_UNLIKELY (error)) { - g_simple_async_result_take_error (ctx->result, error); - power_off_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -583,202 +570,379 @@ FALSE, /* is_raw */ NULL, /* cancellable */ (GAsyncReadyCallback)smso_ready, - ctx); + task); } /*****************************************************************************/ -/* ACCESS TECHNOLOGIES */ +/* Access technologies polling */ static gboolean -load_access_technologies_finish (MMIfaceModem *self, - GAsyncResult *res, - MMModemAccessTechnology *access_technologies, - guint *mask, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) +load_access_technologies_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemAccessTechnology *access_technologies, + guint *mask, + GError **error) +{ + GError *inner_error = NULL; + gssize val; + + val = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - *access_technologies = (MMModemAccessTechnology) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + *access_technologies = (MMModemAccessTechnology) val; *mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; return TRUE; } static void -smong_query_ready (MMBroadbandModemCinterion *self, +smong_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; MMModemAccessTechnology access_tech; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - } else if (!mm_cinterion_parse_smong_response (response, &access_tech, &error)) { - /* We'll reset here the flag to try to use SIND/psinfo the next time */ - self->priv->sind_psinfo = TRUE; - g_simple_async_result_take_error (operation_result, error); - } else { - /* We'll default to use SMONG then */ - self->priv->sind_psinfo = FALSE; - g_simple_async_result_set_op_res_gpointer (operation_result, GUINT_TO_POINTER (access_tech), NULL); - } - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); -} - -static MMModemAccessTechnology -get_access_technology_from_psinfo (const gchar *psinfo, - GError **error) -{ - guint psinfoval; - - if (mm_get_uint_from_str (psinfo, &psinfoval)) { - switch (psinfoval) { - case 0: - return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; - case 1: - case 2: - return MM_MODEM_ACCESS_TECHNOLOGY_GPRS; - case 3: - case 4: - return MM_MODEM_ACCESS_TECHNOLOGY_EDGE; - case 5: - case 6: - return MM_MODEM_ACCESS_TECHNOLOGY_UMTS; - case 7: - case 8: - return MM_MODEM_ACCESS_TECHNOLOGY_HSDPA; - case 9: - case 10: - return (MM_MODEM_ACCESS_TECHNOLOGY_HSDPA | MM_MODEM_ACCESS_TECHNOLOGY_HSUPA); - default: - break; - } + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || !mm_cinterion_parse_smong_response (response, &access_tech, &error)) + g_task_return_error (task, error); + else + g_task_return_int (task, (gssize) access_tech); + g_object_unref (task); +} + +static void +load_access_technologies (MMIfaceModem *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Abort access technology polling if ^SIND psinfo URCs are enabled */ + if (self->priv->sind_psinfo_support == FEATURE_SUPPORTED) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "No need to poll access technologies"); + g_object_unref (task); + return; + } + + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "^SMONG", + 3, + FALSE, + (GAsyncReadyCallback)smong_query_ready, + task); +} + +/*****************************************************************************/ +/* Disable unsolicited events (3GPP interface) */ + +static gboolean +modem_3gpp_disable_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) { + mm_warn ("Couldn't disable parent 3GPP unsolicited events: %s", error->message); + g_error_free (error); } - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't get network capabilities, " - "invalid psinfo value: '%s'", - psinfo); - return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -sind_query_ready (MMBroadbandModemCinterion *self, - GAsyncResult *res, - GSimpleAsyncResult *operation_result) +parent_disable_unsolicited_messages (GTask *task) +{ + /* Chain up parent's disable */ + iface_modem_3gpp_parent->disable_unsolicited_events ( + MM_IFACE_MODEM_3GPP (g_task_get_source_object (task)), + (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, + task); +} + +static void +sind_psinfo_disable_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) { - const gchar *response; GError *error = NULL; - GMatchInfo *match_info = NULL; - GRegex *regex; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + if (!mm_base_modem_at_command_finish (self, res, &error)) { + mm_warn ("Couldn't disable ^SIND psinfo notifications: %s", error->message); + g_error_free (error); + } + + parent_disable_unsolicited_messages (task); +} + +static void +modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemCinterion *self; + GTask *task; + + self = MM_BROADBAND_MODEM_CINTERION (_self); + + task = g_task_new (self, NULL, callback, user_data); + + if (self->priv->sind_psinfo_support == FEATURE_SUPPORTED) { + /* Disable access technology update reporting */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SIND=\"psinfo\",0", + 3, + FALSE, + (GAsyncReadyCallback)sind_psinfo_disable_ready, + task); return; } - /* The AT^SIND? command replies a list of several different indicators. - * We will only look for 'psinfo' which is the one which may tell us - * the available network access technology. Note that only 3G-enabled - * devices seem to have this indicator. - * - * AT+SIND? - * ^SIND: battchg,1,1 - * ^SIND: signal,1,99 - * ... - */ - regex = g_regex_new ("\\r\\n\\^SIND:\\s*psinfo,\\s*(\\d*),\\s*(\\d*)", 0, 0, NULL); - if (g_regex_match_full (regex, response, strlen (response), 0, 0, &match_info, NULL)) { - MMModemAccessTechnology act; - gchar *ind_value; - - ind_value = g_match_info_fetch (match_info, 2); - act = get_access_technology_from_psinfo (ind_value, &error); - g_free (ind_value); - g_simple_async_result_set_op_res_gpointer (operation_result, GUINT_TO_POINTER (act), NULL); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + parent_disable_unsolicited_messages (task); +} + +/*****************************************************************************/ +/* Enable unsolicited events (3GPP interface) */ + +static gboolean +modem_3gpp_enable_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +sind_psinfo_enable_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemCinterion *self; + GError *error = NULL; + const gchar *response; + guint mode; + guint val; + + self = MM_BROADBAND_MODEM_CINTERION (_self); + if (!(response = mm_base_modem_at_command_finish (_self, res, &error))) { + self->priv->sind_psinfo_support = FEATURE_NOT_SUPPORTED; + mm_warn ("Couldn't enable ^SIND psinfo notifications: %s", error->message); + g_error_free (error); + } else if (!mm_cinterion_parse_sind_response (response, NULL, &mode, &val, &error)) { + self->priv->sind_psinfo_support = FEATURE_NOT_SUPPORTED; + mm_warn ("Couldn't parse ^SIND psinfo response: %s", error->message); + g_error_free (error); } else { - /* If there was no 'psinfo' indicator, we'll try AT^SMONG and read the cell - * info table. */ - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - "^SMONG", - 3, - FALSE, - (GAsyncReadyCallback)smong_query_ready, - operation_result); + /* Flag ^SIND psinfo supported so that we don't poll */ + self->priv->sind_psinfo_support = FEATURE_SUPPORTED; + + /* Report initial access technology gathered right away */ + mm_dbg ("Reporting initial access technologies..."); + mm_iface_modem_update_access_technologies (MM_IFACE_MODEM (self), + mm_cinterion_get_access_technology_from_sind_psinfo (val), + MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); } - g_match_info_free (match_info); - g_regex_unref (regex); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -load_access_technologies (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *_self, + GAsyncResult *res, + GTask *task) { - MMBroadbandModemCinterion *broadband = MM_BROADBAND_MODEM_CINTERION (self); - GSimpleAsyncResult *result; + MMBroadbandModemCinterion *self; + GError *error = NULL; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_access_technologies); + self = MM_BROADBAND_MODEM_CINTERION (_self); - if (broadband->priv->sind_psinfo) { - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - "^SIND?", - 3, - FALSE, - (GAsyncReadyCallback)sind_query_ready, - result); + if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (_self, res, &error)) { + mm_warn ("Couldn't enable parent 3GPP unsolicited events: %s", error->message); + g_error_free (error); + } + + if (self->priv->sind_psinfo_support != FEATURE_NOT_SUPPORTED) { + /* Enable access technology update reporting */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SIND=\"psinfo\",1", + 3, + FALSE, + (GAsyncReadyCallback)sind_psinfo_enable_ready, + task); return; } - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - "^SMONG", - 3, - FALSE, - (GAsyncReadyCallback)smong_query_ready, - result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Chain up parent's enable */ + iface_modem_3gpp_parent->enable_unsolicited_events ( + self, + (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, + task); +} + +/*****************************************************************************/ +/* Setup/Cleanup unsolicited events (3GPP interface) */ + +static void +sind_psinfo_received (MMPortSerialAt *port, + GMatchInfo *match_info, + MMBroadbandModemCinterion *self) +{ + guint val; + + if (!mm_get_uint_from_match_info (match_info, 1, &val)) { + mm_dbg ("Failed to convert psinfo value"); + return; + } + + mm_iface_modem_update_access_technologies (MM_IFACE_MODEM (self), + mm_cinterion_get_access_technology_from_sind_psinfo (val), + MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); +} + +static void +set_unsolicited_events_handlers (MMBroadbandModemCinterion *self, + gboolean enable) +{ + MMPortSerialAt *ports[2]; + guint i; + + ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); + ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); + + /* Enable unsolicited events in given port */ + for (i = 0; i < G_N_ELEMENTS (ports); i++) { + if (!ports[i]) + continue; + + mm_port_serial_at_add_unsolicited_msg_handler ( + ports[i], + self->priv->ciev_psinfo_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)sind_psinfo_received : NULL, + enable ? self : NULL, + NULL); + } +} + +static gboolean +modem_3gpp_setup_cleanup_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) + g_task_return_error (task, error); + else { + /* Our own setup now */ + set_unsolicited_events_handlers (MM_BROADBAND_MODEM_CINTERION (self), TRUE); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); +} + +static void +modem_3gpp_setup_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Chain up parent's setup */ + iface_modem_3gpp_parent->setup_unsolicited_events ( + self, + (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, + task); +} + +static void +parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Our own cleanup first */ + set_unsolicited_events_handlers (MM_BROADBAND_MODEM_CINTERION (self), FALSE); + + /* And now chain up parent's cleanup */ + iface_modem_3gpp_parent->cleanup_unsolicited_events ( + self, + (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, + task); } /*****************************************************************************/ /* Load supported modes (Modem interface) */ static GArray * -load_supported_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -788,9 +952,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -805,19 +968,30 @@ mode.allowed = MM_MODEM_MODE_3G; mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); - /* 2G and 3G */ - mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); + + if (mm_iface_modem_is_4g (self)) { + /* 4G only */ + mode.allowed = MM_MODEM_MODE_4G; + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + /* 2G, 3G and 4G */ + mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } else { + /* 2G and 3G */ + mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } /* Filter out those unsupported modes */ filtered = mm_filter_supported_modes (all, combinations); g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -829,170 +1003,130 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Set current modes (Modem interface) */ static gboolean -set_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_access_technology_update_ready (MMBroadbandModemCinterion *self, - GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GAsyncResult *res, + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - else { - /* Request immediate access tech update */ - mm_iface_modem_refresh_access_technologies (MM_IFACE_MODEM (self)); - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -set_current_modes (MMIfaceModem *_self, - MMModemMode allowed, - MMModemMode preferred, - GAsyncReadyCallback callback, - gpointer user_data) +set_current_modes (MMIfaceModem *_self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + gchar *command; + GTask *task; g_assert (preferred == MM_MODEM_MODE_NONE); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); - - /* For dual 2G/3G devices... */ - if (mm_iface_modem_is_2g (_self) && - mm_iface_modem_is_3g (_self)) { - gchar *command; - - /* We will try to simulate the possible allowed modes here. The - * Cinterion devices do not seem to allow setting preferred access - * technology in 3G devices, but they allow restricting to a given - * one: - * - 2G-only is forced by forcing GERAN RAT (AcT=0) - * - 3G-only is forced by forcing UTRAN RAT (AcT=2) - * - for the remaining ones, we default to automatic selection of RAT, - * which is based on the quality of the connection. - */ + task = g_task_new (self, NULL, callback, user_data); - if (allowed == MM_MODEM_MODE_3G) - command = g_strdup ("+COPS=,,,2"); - else if (allowed == MM_MODEM_MODE_2G) - command = g_strdup ("+COPS=,,,0"); - else if (allowed == (MM_MODEM_MODE_3G | MM_MODEM_MODE_2G)) { - /* no AcT given, defaults to Auto. For this case, we cannot provide - * AT+COPS=,,, (i.e. just without a last value). Instead, we need to - * re-run the last manual/automatic selection command which succeeded, - * (or auto by default if none was launched) */ - if (self->priv->manual_operator_id) - command = g_strdup_printf ("+COPS=1,2,\"%s\"", self->priv->manual_operator_id); - else - command = g_strdup ("+COPS=0"); - } else - g_assert_not_reached (); + /* We will try to simulate the possible allowed modes here. The + * Cinterion devices do not seem to allow setting preferred access + * technology in devices, but they allow restricting to a given + * one: + * - 2G-only is forced by forcing GERAN RAT (AcT=0) + * - 3G-only is forced by forcing UTRAN RAT (AcT=2) + * - 4G-only is forced by forcing E-UTRAN RAT (AcT=7) + * - for the remaining ones, we default to automatic selection of RAT, + * which is based on the quality of the connection. + */ - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - command, - 20, - FALSE, - (GAsyncReadyCallback)allowed_access_technology_update_ready, - result); - g_free (command); - return; + if (mm_iface_modem_is_4g (_self) && allowed == MM_MODEM_MODE_4G) + command = g_strdup ("+COPS=,,,7"); + else if (mm_iface_modem_is_3g (_self) && allowed == MM_MODEM_MODE_3G) + command = g_strdup ("+COPS=,,,2"); + else if (mm_iface_modem_is_2g (_self) && allowed == MM_MODEM_MODE_2G) + command = g_strdup ("+COPS=,,,0"); + else { + /* For any other combination (e.g. ANY or no AcT given, defaults to Auto. For this case, we cannot provide + * AT+COPS=,,, (i.e. just without a last value). Instead, we need to + * re-run the last manual/automatic selection command which succeeded, + * (or auto by default if none was launched) */ + if (self->priv->manual_operator_id) + command = g_strdup_printf ("+COPS=1,2,\"%s\"", self->priv->manual_operator_id); + else + command = g_strdup ("+COPS=0"); } - /* For 2G-only and 3G-only devices, we already stated that we don't - * support mode switching. */ - g_assert_not_reached (); + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + command, + 20, + FALSE, + (GAsyncReadyCallback)allowed_access_technology_update_ready, + task); + + g_free (command); } /*****************************************************************************/ /* Register in network (3GPP interface) */ -typedef struct { - MMBroadbandModemCinterion *self; - GSimpleAsyncResult *result; - gchar *operator_id; -} RegisterInNetworkContext; - -static void -register_in_network_context_complete_and_free (RegisterInNetworkContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx->operator_id); - g_slice_free (RegisterInNetworkContext, ctx); -} - static gboolean -register_in_network_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +register_in_network_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -cops_write_ready (MMBaseModem *self, +cops_write_ready (MMBaseModem *_self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { - GError *error = NULL; + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + GError *error = NULL; - if (!mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error)) - g_simple_async_result_take_error (ctx->result, error); + if (!mm_base_modem_at_command_full_finish (_self, res, &error)) + g_task_return_error (task, error); else { - /* Update cached */ - g_free (ctx->self->priv->manual_operator_id); - ctx->self->priv->manual_operator_id = g_strdup (ctx->operator_id); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_free (self->priv->manual_operator_id); + self->priv->manual_operator_id = g_strdup (g_task_get_task_data (task)); + g_task_return_boolean (task, TRUE); } - - register_in_network_context_complete_and_free (ctx); + g_object_unref (task); } static void -register_in_network (MMIfaceModem3gpp *self, - const gchar *operator_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +register_in_network (MMIfaceModem3gpp *self, + const gchar *operator_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { - RegisterInNetworkContext *ctx; + GTask *task; gchar *command; - ctx = g_slice_new (RegisterInNetworkContext); - ctx->self = g_object_ref (self); - ctx->operator_id = g_strdup (operator_id); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - register_in_network); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, g_strdup (operator_id), g_free); /* If the user sent a specific network to use, lock it in. */ if (operator_id) @@ -1008,7 +1142,7 @@ FALSE, /* raw */ cancellable, (GAsyncReadyCallback)cops_write_ready, - ctx); + task); g_free (command); } @@ -1016,173 +1150,146 @@ /* Supported bands (Modem interface) */ static GArray * -load_supported_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -scfg_test_ready (MMBaseModem *_self, +scfg_test_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); - const gchar *response; - GError *error = NULL; - GArray *bands; + const gchar *response; + GError *error = NULL; + GArray *bands; response = mm_base_modem_at_command_finish (_self, res, &error); - if (!response) - g_simple_async_result_take_error (simple, error); - else if (!mm_cinterion_parse_scfg_test (response, - mm_broadband_modem_get_current_charset (MM_BROADBAND_MODEM (self)), - &bands, - &error)) - g_simple_async_result_take_error (simple, error); + if (!response || + !mm_cinterion_parse_scfg_test (response, + mm_broadband_modem_get_current_charset (MM_BROADBAND_MODEM (self)), + &bands, + &error)) + g_task_return_error (task, error); else { mm_cinterion_build_band (bands, 0, FALSE, &self->priv->supported_bands, NULL); g_assert (self->priv->supported_bands != 0); - g_simple_async_result_set_op_res_gpointer (simple, bands, (GDestroyNotify)g_array_unref); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void -load_supported_bands (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *simple; - - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_bands); + GTask *task; + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SCFG=?", 3, FALSE, (GAsyncReadyCallback)scfg_test_ready, - simple); + task); } /*****************************************************************************/ /* Load current bands (Modem interface) */ static GArray * -load_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -get_band_ready (MMBroadbandModemCinterion *self, +get_band_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; - GError *error = NULL; - GArray *bands = NULL; + GError *error = NULL; + GArray *bands = NULL; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!response) - g_simple_async_result_take_error (simple, error); - else if (!mm_cinterion_parse_scfg_response (response, - mm_broadband_modem_get_current_charset (MM_BROADBAND_MODEM (self)), - &bands, - &error)) - g_simple_async_result_take_error (simple, error); + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || + !mm_cinterion_parse_scfg_response (response, + mm_broadband_modem_get_current_charset (MM_BROADBAND_MODEM (self)), + &bands, + &error)) + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, bands, (GDestroyNotify)g_array_unref); - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bands, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void -load_current_bands (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_current_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_bands); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SCFG=\"Radio/Band\"", 3, FALSE, (GAsyncReadyCallback)get_band_ready, - result); + task); } /*****************************************************************************/ /* Set current bands (Modem interface) */ static gboolean -set_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -scfg_set_ready (MMBaseModem *self, +scfg_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) - /* Let the error be critical */ - g_simple_async_result_take_error (operation_result, error); - else { - /* Request immediate access tech update */ - mm_iface_modem_refresh_access_technologies (MM_IFACE_MODEM (self)); - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - } - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -set_bands_3g (MMIfaceModem *_self, - GArray *bands_array, - GSimpleAsyncResult *simple) +set_bands_3g (GTask *task, + GArray *bands_array) { - MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); - GError *error = NULL; - guint band = 0; - gchar *cmd; + MMBroadbandModemCinterion *self; + GError *error = NULL; + guint band = 0; + gchar *cmd; + + self = g_task_get_source_object (task); if (!mm_cinterion_build_band (bands_array, self->priv->supported_bands, FALSE, /* 2G and 3G */ &band, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1201,29 +1308,29 @@ 15, FALSE, (GAsyncReadyCallback)scfg_set_ready, - simple); + task); g_free (cmd); } static void -set_bands_2g (MMIfaceModem *_self, - GArray *bands_array, - GSimpleAsyncResult *simple) +set_bands_2g (GTask *task, + GArray *bands_array) { - MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); - GError *error = NULL; - guint band = 0; - gchar *cmd; - gchar *bandstr; + MMBroadbandModemCinterion *self; + GError *error = NULL; + guint band = 0; + gchar *cmd; + gchar *bandstr; + + self = g_task_get_source_object (task); if (!mm_cinterion_build_band (bands_array, self->priv->supported_bands, TRUE, /* 2G only */ &band, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1231,12 +1338,11 @@ bandstr = g_strdup_printf ("%u", band); bandstr = mm_broadband_modem_take_and_convert_to_current_charset (MM_BROADBAND_MODEM (self), bandstr); if (!bandstr) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Couldn't convert band set to current charset"); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Couldn't convert band set to current charset"); + g_object_unref (task); return; } @@ -1253,19 +1359,19 @@ 15, FALSE, (GAsyncReadyCallback)scfg_set_ready, - simple); + task); g_free (cmd); g_free (bandstr); } static void -set_current_bands (MMIfaceModem *self, - GArray *bands_array, - GAsyncReadyCallback callback, - gpointer user_data) +set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* The bands that we get here are previously validated by the interface, and * that means that ALL the bands given here were also given in the list of @@ -1273,79 +1379,69 @@ * will end up being valid, as not all combinations are possible. E.g, * Cinterion modems supporting only 2G have specific combinations allowed. */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_bands); - + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_3g (self)) - set_bands_3g (self, bands_array, result); + set_bands_3g (task, bands_array); else - set_bands_2g (self, bands_array, result); + set_bands_2g (task, bands_array); } /*****************************************************************************/ -/* FLOW CONTROL */ +/* Flow control */ static gboolean -setup_flow_control_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +setup_flow_control_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -setup_flow_control_ready (MMBroadbandModemCinterion *self, +setup_flow_control_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; - if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) + if (!mm_base_modem_at_command_finish (self, res, &error)) /* Let the error be critical. We DO need RTS/CTS in order to have * proper modem disabling. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -setup_flow_control (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +setup_flow_control (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_flow_control); + task = g_task_new (self, NULL, callback, user_data); /* We need to enable RTS/CTS so that CYCLIC SLEEP mode works */ + g_object_set (self, MM_BROADBAND_MODEM_FLOW_CONTROL, MM_FLOW_CONTROL_RTS_CTS, NULL); mm_base_modem_at_command (MM_BASE_MODEM (self), "\\Q3", 3, FALSE, (GAsyncReadyCallback)setup_flow_control_ready, - result); + task); } /*****************************************************************************/ /* Load unlock retries (Modem interface) */ typedef struct { - MMBroadbandModemCinterion *self; - GSimpleAsyncResult *result; MMUnlockRetries *retries; - guint i; + guint i; } LoadUnlockRetriesContext; typedef struct { - MMModemLock lock; + MMModemLock lock; const gchar *command; } UnlockRetriesMap; @@ -1361,35 +1457,32 @@ }; static void -load_unlock_retries_context_complete_and_free (LoadUnlockRetriesContext *ctx) +load_unlock_retries_context_free (LoadUnlockRetriesContext *ctx) { - g_simple_async_result_complete (ctx->result); g_object_unref (ctx->retries); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (LoadUnlockRetriesContext, ctx); } static MMUnlockRetries * -load_unlock_retries_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_unlock_retries_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } -static void load_unlock_retries_context_step (LoadUnlockRetriesContext *ctx); +static void load_unlock_retries_context_step (GTask *task); static void -spic_ready (MMBaseModem *self, +spic_ready (MMBaseModem *self, GAsyncResult *res, - LoadUnlockRetriesContext *ctx) + GTask *task) { - const gchar *response; - GError *error = NULL; + LoadUnlockRetriesContext *ctx; + const gchar *response; + GError *error = NULL; + + ctx = g_task_get_task_data (task); response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { @@ -1410,46 +1503,49 @@ /* Go to next lock value */ ctx->i++; - load_unlock_retries_context_step (ctx); + load_unlock_retries_context_step (task); } static void -load_unlock_retries_context_step (LoadUnlockRetriesContext *ctx) +load_unlock_retries_context_step (GTask *task) { + MMBroadbandModemCinterion *self; + LoadUnlockRetriesContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->i == G_N_ELEMENTS (unlock_retries_map)) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->retries), - (GDestroyNotify)g_object_unref); - load_unlock_retries_context_complete_and_free (ctx); + g_task_return_pointer (task, g_object_ref (ctx->retries), g_object_unref); + g_object_unref (task); return; } mm_base_modem_at_command ( - MM_BASE_MODEM (ctx->self), + MM_BASE_MODEM (self), unlock_retries_map[ctx->i].command, 3, FALSE, (GAsyncReadyCallback)spic_ready, - ctx); + task); } static void -load_unlock_retries (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_unlock_retries (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; LoadUnlockRetriesContext *ctx; + task = g_task_new (self, NULL, callback, user_data); + ctx = g_slice_new0 (LoadUnlockRetriesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries); ctx->retries = mm_unlock_retries_new (); ctx->i = 0; + g_task_set_task_data (task, ctx, (GDestroyNotify)load_unlock_retries_context_free); - load_unlock_retries_context_step (ctx); + load_unlock_retries_context_step (task); } /*****************************************************************************/ @@ -1464,48 +1560,40 @@ } CinterionSimStatus; typedef struct { - MMBroadbandModemCinterion *self; - GSimpleAsyncResult *result; guint retries; guint timeout_id; } AfterSimUnlockContext; -static void -after_sim_unlock_context_complete_and_free (AfterSimUnlockContext *ctx) -{ - g_assert (ctx->timeout_id == 0); - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (AfterSimUnlockContext, ctx); -} - static gboolean -after_sim_unlock_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +after_sim_unlock_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void after_sim_unlock_context_step (AfterSimUnlockContext *ctx); +static void after_sim_unlock_context_step (GTask *task); static gboolean -simstatus_timeout_cb (AfterSimUnlockContext *ctx) +simstatus_timeout_cb (GTask *task) { + AfterSimUnlockContext *ctx; + + ctx = g_task_get_task_data (task); ctx->timeout_id = 0; - after_sim_unlock_context_step (ctx); + after_sim_unlock_context_step (task); return G_SOURCE_REMOVE; } static void -simstatus_check_ready (MMBaseModem *self, +simstatus_check_ready (MMBaseModem *self, GAsyncResult *res, - AfterSimUnlockContext *ctx) + GTask *task) { - const gchar *response; + AfterSimUnlockContext *ctx; + const gchar *response; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL); + response = mm_base_modem_at_command_finish (self, res, NULL); if (response) { gchar *descr = NULL; guint val = 0; @@ -1515,8 +1603,8 @@ val == CINTERION_SIM_STATUS_INIT_COMPLETED) { /* SIM ready! */ g_free (descr); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - after_sim_unlock_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1524,58 +1612,181 @@ } /* Need to retry after 1 sec */ + ctx = g_task_get_task_data (task); g_assert (ctx->timeout_id == 0); - ctx->timeout_id = g_timeout_add_seconds (1, (GSourceFunc)simstatus_timeout_cb, ctx); + ctx->timeout_id = g_timeout_add_seconds (1, (GSourceFunc)simstatus_timeout_cb, task); } static void -after_sim_unlock_context_step (AfterSimUnlockContext *ctx) +after_sim_unlock_context_step (GTask *task) { + MMBroadbandModemCinterion *self; + AfterSimUnlockContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->retries == 0) { /* Too much wait, go on anyway */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - after_sim_unlock_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Recheck */ ctx->retries--; - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - "^SIND=\"simstatus\",1", + mm_base_modem_at_command (MM_BASE_MODEM (self), + "^SIND=\"simstatus\",2", 3, FALSE, (GAsyncReadyCallback)simstatus_check_ready, - ctx); + task); } static void -after_sim_unlock (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +after_sim_unlock (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; AfterSimUnlockContext *ctx; - ctx = g_slice_new0 (AfterSimUnlockContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); + ctx = g_new0 (AfterSimUnlockContext, 1); ctx->retries = MAX_AFTER_SIM_UNLOCK_RETRIES; + g_task_set_task_data (task, ctx, g_free); - after_sim_unlock_context_step (ctx); + after_sim_unlock_context_step (task); } /*****************************************************************************/ -/* Setup ports (Broadband modem class) */ +/* Create Bearer (Modem interface) */ + +static MMBaseBearer * +cinterion_modem_create_bearer_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} static void -setup_ports (MMBroadbandModem *self) +broadband_bearer_cinterion_new_ready (GObject *unused, + GAsyncResult *res, + GTask *task) { - /* Call parent's setup ports first always */ - MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_cinterion_parent_class)->setup_ports (self); + MMBaseBearer *bearer; + GError *error = NULL; + + bearer = mm_broadband_bearer_cinterion_new_finish (res, &error); + if (!bearer) + g_task_return_error (task, error); + else + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); +} - mm_common_cinterion_setup_gps_port (self); +static void +broadband_bearer_new_ready (GObject *unused, + GAsyncResult *res, + GTask *task) +{ + MMBaseBearer *bearer; + GError *error = NULL; + + bearer = mm_broadband_bearer_new_finish (res, &error); + if (!bearer) + g_task_return_error (task, error); + else + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); +} + +static void +common_create_bearer (GTask *task) +{ + MMBroadbandModemCinterion *self; + + self = g_task_get_source_object (task); + + switch (self->priv->swwan_support) { + case FEATURE_NOT_SUPPORTED: + mm_dbg ("^SWWAN not supported, creating default bearer..."); + mm_broadband_bearer_new (MM_BROADBAND_MODEM (self), + g_task_get_task_data (task), + NULL, /* cancellable */ + (GAsyncReadyCallback)broadband_bearer_new_ready, + task); + return; + case FEATURE_SUPPORTED: + mm_dbg ("^SWWAN supported, creating cinterion bearer..."); + mm_broadband_bearer_cinterion_new (MM_BROADBAND_MODEM_CINTERION (self), + g_task_get_task_data (task), + NULL, /* cancellable */ + (GAsyncReadyCallback)broadband_bearer_cinterion_new_ready, + task); + return; + default: + g_assert_not_reached (); + } +} + +static void +swwan_test_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + + /* Fetch the result to the SWWAN test. If no response given (error triggered), + * assume unsupported */ + if (!mm_base_modem_at_command_finish (_self, res, NULL)) { + mm_dbg ("SWWAN unsupported"); + self->priv->swwan_support = FEATURE_NOT_SUPPORTED; + } else { + mm_dbg ("SWWAN supported"); + self->priv->swwan_support = FEATURE_SUPPORTED; + } + + /* Go on and create the bearer */ + common_create_bearer (task); +} + +static void +cinterion_modem_create_bearer (MMIfaceModem *_self, + MMBearerProperties *properties, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemCinterion *self = MM_BROADBAND_MODEM_CINTERION (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, g_object_ref (properties), g_object_unref); + + /* Newer Cinterion modems may support SWWAN, which is the same as WWAN. + * Check to see if current modem supports it.*/ + if (self->priv->swwan_support != FEATURE_SUPPORT_UNKNOWN) { + common_create_bearer (task); + return; + } + + /* If we don't have a data port, don't even bother checking for ^SWWAN + * support. */ + if (!mm_base_modem_peek_best_data_port (MM_BASE_MODEM (self), MM_PORT_TYPE_NET)) { + mm_dbg ("skipping ^SWWAN check as no data port is available"); + self->priv->swwan_support = FEATURE_NOT_SUPPORTED; + common_create_bearer (task); + return; + } + + mm_dbg ("checking ^SWWAN support..."); + mm_base_modem_at_command (MM_BASE_MODEM (self), + "^SWWAN=?", + 6, + TRUE, /* may be cached */ + (GAsyncReadyCallback) swwan_test_ready, + task); } /*****************************************************************************/ @@ -1604,8 +1815,12 @@ MM_TYPE_BROADBAND_MODEM_CINTERION, MMBroadbandModemCinterionPrivate); - /* Set defaults */ - self->priv->sind_psinfo = TRUE; /* Initially, always try to get psinfo */ + /* Initialize private variables */ + self->priv->sind_psinfo_support = FEATURE_SUPPORT_UNKNOWN; + self->priv->swwan_support = FEATURE_SUPPORT_UNKNOWN; + + self->priv->ciev_psinfo_regex = g_regex_new ("\\r\\n\\+CIEV: psinfo,(\\d+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); } static void @@ -1627,6 +1842,8 @@ if (self->priv->cnmi_supported_bfr) g_array_unref (self->priv->cnmi_supported_bfr); + g_regex_unref (self->priv->ciev_psinfo_regex); + G_OBJECT_CLASS (mm_broadband_modem_cinterion_parent_class)->finalize (object); } @@ -1635,6 +1852,8 @@ { iface_modem_parent = g_type_interface_peek_parent (iface); + iface->create_bearer = cinterion_modem_create_bearer; + iface->create_bearer_finish = cinterion_modem_create_bearer_finish; iface->load_supported_modes = load_supported_modes; iface->load_supported_modes_finish = load_supported_modes_finish; iface->set_current_modes = set_current_modes; @@ -1662,8 +1881,18 @@ static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface) { - iface->enable_unsolicited_events = enable_unsolicited_events; - iface->enable_unsolicited_events_finish = enable_unsolicited_events_finish; + iface_modem_3gpp_parent = g_type_interface_peek_parent (iface); + + iface->enable_unsolicited_events = modem_3gpp_enable_unsolicited_events; + iface->enable_unsolicited_events_finish = modem_3gpp_enable_unsolicited_events_finish; + iface->disable_unsolicited_events = modem_3gpp_disable_unsolicited_events; + iface->disable_unsolicited_events_finish = modem_3gpp_disable_unsolicited_events_finish; + + iface->setup_unsolicited_events = modem_3gpp_setup_unsolicited_events; + iface->setup_unsolicited_events_finish = modem_3gpp_setup_cleanup_unsolicited_events_finish; + iface->cleanup_unsolicited_events = modem_3gpp_cleanup_unsolicited_events; + iface->cleanup_unsolicited_events_finish = modem_3gpp_setup_cleanup_unsolicited_events_finish; + iface->register_in_network = register_in_network; iface->register_in_network_finish = register_in_network_finish; } @@ -1680,25 +1909,35 @@ static void iface_modem_location_init (MMIfaceModemLocation *iface) { - mm_common_cinterion_peek_parent_location_interface (iface); + iface_modem_location_parent = g_type_interface_peek_parent (iface); + + iface->load_capabilities = mm_shared_cinterion_location_load_capabilities; + iface->load_capabilities_finish = mm_shared_cinterion_location_load_capabilities_finish; + iface->enable_location_gathering = mm_shared_cinterion_enable_location_gathering; + iface->enable_location_gathering_finish = mm_shared_cinterion_enable_location_gathering_finish; + iface->disable_location_gathering = mm_shared_cinterion_disable_location_gathering; + iface->disable_location_gathering_finish = mm_shared_cinterion_disable_location_gathering_finish; +} - iface->load_capabilities = mm_common_cinterion_location_load_capabilities; - iface->load_capabilities_finish = mm_common_cinterion_location_load_capabilities_finish; - iface->enable_location_gathering = mm_common_cinterion_enable_location_gathering; - iface->enable_location_gathering_finish = mm_common_cinterion_enable_location_gathering_finish; - iface->disable_location_gathering = mm_common_cinterion_disable_location_gathering; - iface->disable_location_gathering_finish = mm_common_cinterion_disable_location_gathering_finish; +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedCinterion *self) +{ + return iface_modem_location_parent; +} + +static void +shared_cinterion_init (MMSharedCinterion *iface) +{ + iface->peek_parent_location_interface = peek_parent_location_interface; } static void mm_broadband_modem_cinterion_class_init (MMBroadbandModemCinterionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass); g_type_class_add_private (object_class, sizeof (MMBroadbandModemCinterionPrivate)); /* Virtual methods */ object_class->finalize = finalize; - broadband_modem_class->setup_ports = setup_ports; } diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-broadband-modem-qmi-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-broadband-modem-qmi-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-broadband-modem-qmi-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-broadband-modem-qmi-cinterion.c 2018-11-15 09:55:53.000000000 +0100 @@ -27,24 +27,16 @@ #include "mm-errors-types.h" #include "mm-iface-modem-location.h" #include "mm-broadband-modem-qmi-cinterion.h" -#include "mm-common-cinterion.h" +#include "mm-shared-cinterion.h" static void iface_modem_location_init (MMIfaceModemLocation *iface); +static void shared_cinterion_init (MMSharedCinterion *iface); -G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQmiCinterion, mm_broadband_modem_qmi_cinterion, MM_TYPE_BROADBAND_MODEM_QMI, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init)) - -/*****************************************************************************/ -/* Setup ports (Broadband modem class) */ - -static void -setup_ports (MMBroadbandModem *self) -{ - /* Call parent's setup ports first always */ - MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_qmi_cinterion_parent_class)->setup_ports (self); +static MMIfaceModemLocation *iface_modem_location_parent; - mm_common_cinterion_setup_gps_port (self); -} +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQmiCinterion, mm_broadband_modem_qmi_cinterion, MM_TYPE_BROADBAND_MODEM_QMI, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_CINTERION, shared_cinterion_init)) /*****************************************************************************/ @@ -72,21 +64,29 @@ static void iface_modem_location_init (MMIfaceModemLocation *iface) { - mm_common_cinterion_peek_parent_location_interface (iface); + iface_modem_location_parent = g_type_interface_peek_parent (iface); - iface->load_capabilities = mm_common_cinterion_location_load_capabilities; - iface->load_capabilities_finish = mm_common_cinterion_location_load_capabilities_finish; - iface->enable_location_gathering = mm_common_cinterion_enable_location_gathering; - iface->enable_location_gathering_finish = mm_common_cinterion_enable_location_gathering_finish; - iface->disable_location_gathering = mm_common_cinterion_disable_location_gathering; - iface->disable_location_gathering_finish = mm_common_cinterion_disable_location_gathering_finish; + iface->load_capabilities = mm_shared_cinterion_location_load_capabilities; + iface->load_capabilities_finish = mm_shared_cinterion_location_load_capabilities_finish; + iface->enable_location_gathering = mm_shared_cinterion_enable_location_gathering; + iface->enable_location_gathering_finish = mm_shared_cinterion_enable_location_gathering_finish; + iface->disable_location_gathering = mm_shared_cinterion_disable_location_gathering; + iface->disable_location_gathering_finish = mm_shared_cinterion_disable_location_gathering_finish; +} + +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedCinterion *self) +{ + return iface_modem_location_parent; } static void -mm_broadband_modem_qmi_cinterion_class_init (MMBroadbandModemQmiCinterionClass *klass) +shared_cinterion_init (MMSharedCinterion *iface) { - MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass); + iface->peek_parent_location_interface = peek_parent_location_interface; +} - /* Virtual methods */ - broadband_modem_class->setup_ports = setup_ports; +static void +mm_broadband_modem_qmi_cinterion_class_init (MMBroadbandModemQmiCinterionClass *klass) +{ } diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-common-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-common-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-common-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-common-cinterion.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,466 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2014 Ammonit Measurement GmbH - * Author: Aleksander Morgado - */ - -#include "mm-common-cinterion.h" -#include "mm-base-modem-at.h" - -static MMIfaceModemLocation *iface_modem_location_parent; - -/*****************************************************************************/ - -#define CINTERION_LOCATION_CONTEXT_TAG "cinterion-location-tag" -static GQuark cinterion_location_context_quark; - -/*****************************************************************************/ - -typedef struct { - MMModemLocationSource enabled_sources; -} LocationContext; - -static void -location_context_free (LocationContext *ctx) -{ - g_slice_free (LocationContext, ctx); -} - -static LocationContext * -get_location_context (MMBaseModem *self) -{ - LocationContext *ctx; - - if (G_UNLIKELY (!cinterion_location_context_quark)) - cinterion_location_context_quark = (g_quark_from_static_string ( - CINTERION_LOCATION_CONTEXT_TAG)); - - ctx = g_object_get_qdata (G_OBJECT (self), cinterion_location_context_quark); - if (!ctx) { - /* Create context and keep it as object data */ - ctx = g_slice_new (LocationContext); - ctx->enabled_sources = MM_MODEM_LOCATION_SOURCE_NONE; - - g_object_set_qdata_full ( - G_OBJECT (self), - cinterion_location_context_quark, - ctx, - (GDestroyNotify)location_context_free); - } - - return ctx; -} - - -/*****************************************************************************/ -/* Location capabilities loading (Location interface) */ - -MMModemLocationSource -mm_common_cinterion_location_load_capabilities_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCATION_SOURCE_NONE; - - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); -} - -static void -parent_load_capabilities_ready (MMIfaceModemLocation *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - MMModemLocationSource sources; - GError *error = NULL; - - sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); - if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - /* Now our own check. */ - if (mm_base_modem_peek_port_gps (MM_BASE_MODEM (self))) - sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED); - - /* So we're done, complete */ - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (sources), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -void -mm_common_cinterion_location_load_capabilities (MMIfaceModemLocation *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_common_cinterion_location_load_capabilities); - - /* Chain up parent's setup */ - iface_modem_location_parent->load_capabilities ( - self, - (GAsyncReadyCallback)parent_load_capabilities_ready, - result); -} - -/*****************************************************************************/ -/* Enable/Disable location gathering (Location interface) */ - -typedef struct { - MMBaseModem *self; - GSimpleAsyncResult *result; - MMModemLocationSource source; -} LocationGatheringContext; - -static void -location_gathering_context_complete_and_free (LocationGatheringContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LocationGatheringContext, ctx); -} - -/******************************/ -/* Disable location gathering */ - -gboolean -mm_common_cinterion_disable_location_gathering_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -gps_disabled_ready (MMBaseModem *self, - GAsyncResult *res, - LocationGatheringContext *ctx) -{ - GError *error = NULL; - - if (!mm_base_modem_at_command_full_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - - /* Only use the GPS port in NMEA/RAW setups */ - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { - MMPortSerialGps *gps_port; - - /* Even if we get an error here, we try to close the GPS port */ - gps_port = mm_base_modem_peek_port_gps (self); - if (gps_port) - mm_port_serial_close (MM_PORT_SERIAL (gps_port)); - } - - location_gathering_context_complete_and_free (ctx); -} - -static void -internal_disable_location_gathering (LocationGatheringContext *ctx) -{ - LocationContext *location_ctx; - gboolean stop_gps = FALSE; - - location_ctx = get_location_context (MM_BASE_MODEM (ctx->self)); - - /* Only stop GPS engine if no GPS-related sources enabled */ - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { - location_ctx->enabled_sources &= ~ctx->source; - - if (!(location_ctx->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) - stop_gps = TRUE; - } - - if (stop_gps) { - /* We disable continuous GPS fixes */ - mm_base_modem_at_command_full (MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_best_at_port (MM_BASE_MODEM (ctx->self), NULL), - "AT^SGPSS=0", - 3, - FALSE, - FALSE, /* raw */ - NULL, /* cancellable */ - (GAsyncReadyCallback)gps_disabled_ready, - ctx); - return; - } - - /* For any other location (e.g. 3GPP), or if still some GPS needed, just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); -} - -static void -parent_disable_location_gathering_ready (MMIfaceModemLocation *self, - GAsyncResult *res, - LocationGatheringContext *ctx) -{ - GError *error = NULL; - - if (!iface_modem_location_parent->disable_location_gathering_finish (self, res, &error)) { - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { - /* Ignore errors when disabling GPS, we can try with AT commands */ - g_error_free (error); - } else { - /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); - return; - } - } - - internal_disable_location_gathering (ctx); -} - -void -mm_common_cinterion_disable_location_gathering (MMIfaceModemLocation *self, - MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LocationGatheringContext *ctx; - - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_common_cinterion_disable_location_gathering); - ctx->source = source; - - /* Chain up parent's gathering enable */ - if (iface_modem_location_parent->disable_location_gathering) { - iface_modem_location_parent->disable_location_gathering ( - self, - source, - (GAsyncReadyCallback)parent_disable_location_gathering_ready, - ctx); - return; - } - - internal_disable_location_gathering (ctx); -} - -/*****************************************************************************/ -/* Enable location gathering (Location interface) */ - -gboolean -mm_common_cinterion_enable_location_gathering_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -gps_enabled_ready (MMBaseModem *self, - GAsyncResult *res, - LocationGatheringContext *ctx) -{ - GError *error = NULL; - - if (!mm_base_modem_at_command_full_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); - return; - } - - /* Only use the GPS port in NMEA/RAW setups */ - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { - MMPortSerialGps *gps_port; - - gps_port = mm_base_modem_peek_port_gps (self); - if (!gps_port || - !mm_port_serial_open (MM_PORT_SERIAL (gps_port), &error)) { - if (error) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't open raw GPS serial port"); - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - - location_gathering_context_complete_and_free (ctx); -} - -static void -parent_enable_location_gathering_ready (MMIfaceModemLocation *self, - GAsyncResult *res, - LocationGatheringContext *ctx) -{ - gboolean start_gps = FALSE; - GError *error = NULL; - LocationContext *location_ctx; - - if (!iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) { - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { - /* Ignore errors when enabling GPS, we can try with AT commands */ - g_error_free (error); - } else { - /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); - return; - } - } - - /* Now our own enabling */ - - location_ctx = get_location_context (MM_BASE_MODEM (self)); - - /* NMEA and RAW are both enabled in the same way */ - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { - /* Only start GPS engine if not done already */ - if (!(location_ctx->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) - start_gps = TRUE; - location_ctx->enabled_sources |= ctx->source; - } - - if (start_gps) { - /* We enable continuous GPS fixes */ - mm_base_modem_at_command_full (MM_BASE_MODEM (self), - mm_base_modem_peek_best_at_port (MM_BASE_MODEM (self), NULL), - "AT^SGPSS=4", - 3, - FALSE, - FALSE, /* raw */ - NULL, /* cancellable */ - (GAsyncReadyCallback)gps_enabled_ready, - ctx); - return; - } - - /* For any other location (e.g. 3GPP), or if GPS already running just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); -} - -void -mm_common_cinterion_enable_location_gathering (MMIfaceModemLocation *self, - MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LocationGatheringContext *ctx; - - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_common_cinterion_enable_location_gathering); - ctx->source = source; - - /* Chain up parent's gathering enable */ - iface_modem_location_parent->enable_location_gathering ( - self, - source, - (GAsyncReadyCallback)parent_enable_location_gathering_ready, - ctx); -} - -/*****************************************************************************/ -/* Setup ports (Broadband modem class) */ - -static void -trace_received (MMPortSerialGps *port, - const gchar *trace, - MMIfaceModemLocation *self) -{ - /* Helper to debug GPS location related issues. Don't depend on a real GPS - * fix for debugging, just use some random values to update */ -#if 0 - if (g_str_has_prefix (trace, "$GPGGA")) { - GString *str; - GDateTime *now; - - now = g_date_time_new_now_utc (); - str = g_string_new (""); - g_string_append_printf (str, - "$GPGGA,%02u%02u%02u,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47", - g_date_time_get_hour (now), - g_date_time_get_minute (now), - g_date_time_get_second (now)); - mm_iface_modem_location_gps_update (self, str->str); - g_string_free (str, TRUE); - g_date_time_unref (now); - return; - } -#endif - - mm_iface_modem_location_gps_update (self, trace); -} - -void -mm_common_cinterion_setup_gps_port (MMBroadbandModem *self) -{ - MMPortSerialGps *gps_data_port; - - gps_data_port = mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)); - if (gps_data_port) { - /* It may happen that the modem was started with GPS already enabled, or - * maybe ModemManager got rebooted and it was left enabled before. We'll make - * sure that it is disabled when we initialize the modem */ - mm_base_modem_at_command_full (MM_BASE_MODEM (self), - mm_base_modem_peek_best_at_port (MM_BASE_MODEM (self), NULL), - "AT^SGPSS=0", - 3, FALSE, FALSE, NULL, NULL, NULL); - - /* Add handler for the NMEA traces */ - mm_port_serial_gps_add_trace_handler (gps_data_port, - (MMPortSerialGpsTraceFn)trace_received, - self, - NULL); - } -} - -/*****************************************************************************/ - -void -mm_common_cinterion_peek_parent_location_interface (MMIfaceModemLocation *iface) -{ - iface_modem_location_parent = g_type_interface_peek_parent (iface); -} diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-common-cinterion.h modemmanager-1.10.0/plugins/cinterion/mm-common-cinterion.h --- modemmanager-1.6.8/plugins/cinterion/mm-common-cinterion.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-common-cinterion.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2014 Ammonit Measurement GmbH - * Author: Aleksander Morgado - */ - -#ifndef MM_COMMON_CINTERION_H -#define MM_COMMON_CINTERION_H - -#include "glib.h" -#include "mm-broadband-modem.h" -#include "mm-iface-modem-location.h" - -void mm_common_cinterion_location_load_capabilities (MMIfaceModemLocation *self, - GAsyncReadyCallback callback, - gpointer user_data); -MMModemLocationSource mm_common_cinterion_location_load_capabilities_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error); - -void mm_common_cinterion_enable_location_gathering (MMIfaceModemLocation *self, - MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_common_cinterion_enable_location_gathering_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error); - -void mm_common_cinterion_disable_location_gathering (MMIfaceModemLocation *self, - MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_common_cinterion_disable_location_gathering_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error); - -void mm_common_cinterion_setup_gps_port (MMBroadbandModem *self); - -void mm_common_cinterion_peek_parent_location_interface (MMIfaceModemLocation *iface); - -#endif /* MM_COMMON_CINTERION_H */ diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-modem-helpers-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-modem-helpers-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-modem-helpers-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-modem-helpers-cinterion.c 2019-01-15 15:57:35.000000000 +0100 @@ -10,12 +10,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * + * Copyright (C) 2016 Trimble Navigation Limited * Copyright (C) 2014 Aleksander Morgado + * Contributor: Matthew Stanger */ #include #include #include +#include #include "ModemManager.h" #define _LIBMM_INSIDE_MM @@ -24,6 +27,7 @@ #include "mm-charsets.h" #include "mm-errors-types.h" #include "mm-modem-helpers-cinterion.h" +#include "mm-modem-helpers.h" /* Setup relationship between the 3G band bitmask in the modem and the bitmask * in ModemManager. */ @@ -32,21 +36,35 @@ MMModemBand mm_band; } CinterionBand; -/* Table checked in HC25 and PHS8 references. This table includes both 2G and 3G +/* Table checked in PLS8-X/E/J/V/US, HC25 & PHS8 references. The table includes 2/3/4G * frequencies. Depending on which one is configured, one access technology or * the other will be used. This may conflict with the allowed mode configuration * set, so you shouldn't for example set 3G frequency bands, and then use a * 2G-only allowed mode. */ static const CinterionBand cinterion_bands[] = { - { (1 << 0), MM_MODEM_BAND_EGSM }, - { (1 << 1), MM_MODEM_BAND_DCS }, - { (1 << 2), MM_MODEM_BAND_PCS }, - { (1 << 3), MM_MODEM_BAND_G850 }, - { (1 << 4), MM_MODEM_BAND_U2100 }, - { (1 << 5), MM_MODEM_BAND_U1900 }, - { (1 << 6), MM_MODEM_BAND_U850 }, - { (1 << 7), MM_MODEM_BAND_U900 }, - { (1 << 8), MM_MODEM_BAND_U800 } + { (1 << 0), MM_MODEM_BAND_EGSM }, + { (1 << 1), MM_MODEM_BAND_DCS }, + { (1 << 2), MM_MODEM_BAND_G850 }, + { (1 << 3), MM_MODEM_BAND_PCS }, + { (1 << 4), MM_MODEM_BAND_UTRAN_1 }, + { (1 << 5), MM_MODEM_BAND_UTRAN_2 }, + { (1 << 6), MM_MODEM_BAND_UTRAN_5 }, + { (1 << 7), MM_MODEM_BAND_UTRAN_8 }, + { (1 << 8), MM_MODEM_BAND_UTRAN_6 }, + { (1 << 9), MM_MODEM_BAND_UTRAN_4 }, + { (1 << 10), MM_MODEM_BAND_UTRAN_19 }, + { (1 << 12), MM_MODEM_BAND_UTRAN_3 }, + { (1 << 13), MM_MODEM_BAND_EUTRAN_1 }, + { (1 << 14), MM_MODEM_BAND_EUTRAN_2 }, + { (1 << 15), MM_MODEM_BAND_EUTRAN_3 }, + { (1 << 16), MM_MODEM_BAND_EUTRAN_4 }, + { (1 << 17), MM_MODEM_BAND_EUTRAN_5 }, + { (1 << 18), MM_MODEM_BAND_EUTRAN_7 }, + { (1 << 19), MM_MODEM_BAND_EUTRAN_8 }, + { (1 << 20), MM_MODEM_BAND_EUTRAN_17 }, + { (1 << 21), MM_MODEM_BAND_EUTRAN_20 }, + { (1 << 22), MM_MODEM_BAND_EUTRAN_13 }, + { (1 << 24), MM_MODEM_BAND_EUTRAN_19 } }; /* Check valid combinations in 2G-only devices */ @@ -129,8 +147,7 @@ g_free (maxbandstr); } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (!bands) @@ -216,8 +233,7 @@ g_free (currentstr); } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (!bands) @@ -244,43 +260,6 @@ * +CNMI: (0,1,2),(0,1),(0,2),(0),(1) */ -static GArray * -read_number_list (const gchar *str) -{ - GError *inner_error = NULL; - GArray *out = NULL; - GRegex *r; - GMatchInfo *match_info; - - if (!str) - return NULL; - - r = g_regex_new ("(\\d),?", G_REGEX_UNGREEDY, 0, NULL); - g_assert (r != NULL); - - g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); - while (!inner_error && g_match_info_matches (match_info)) { - guint aux; - - if (mm_get_uint_from_match_info (match_info, 1, &aux)) { - if (!out) - out = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3); - g_array_append_val (out, aux); - } - g_match_info_next (match_info, &inner_error); - } - - if (inner_error) { - mm_warn ("Unexpected error matching +CNMI response: '%s'", inner_error->message); - g_error_free (inner_error); - } - - g_match_info_free (match_info); - g_regex_unref (r); - - return out; -} - gboolean mm_cinterion_parse_cnmi_test (const gchar *response, GArray **supported_mode, @@ -293,6 +272,11 @@ GRegex *r; GMatchInfo *match_info; GError *inner_error = NULL; + GArray *tmp_supported_mode = NULL; + GArray *tmp_supported_mt = NULL; + GArray *tmp_supported_bm = NULL; + GArray *tmp_supported_ds = NULL; + GArray *tmp_supported_bfr = NULL; if (!response) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing response"); @@ -310,77 +294,75 @@ gchar *str; str = mm_get_string_unquoted_from_match_info (match_info, 1); - *supported_mode = read_number_list (str); + tmp_supported_mode = mm_parse_uint_list (str, &inner_error); g_free (str); + if (inner_error) + goto out; } if (supported_mt) { gchar *str; str = mm_get_string_unquoted_from_match_info (match_info, 2); - *supported_mt = read_number_list (str); + tmp_supported_mt = mm_parse_uint_list (str, &inner_error); g_free (str); + if (inner_error) + goto out; } if (supported_bm) { gchar *str; str = mm_get_string_unquoted_from_match_info (match_info, 3); - *supported_bm = read_number_list (str); + tmp_supported_bm = mm_parse_uint_list (str, &inner_error); g_free (str); + if (inner_error) + goto out; } if (supported_ds) { gchar *str; str = mm_get_string_unquoted_from_match_info (match_info, 4); - *supported_ds = read_number_list (str); + tmp_supported_ds = mm_parse_uint_list (str, &inner_error); g_free (str); + if (inner_error) + goto out; } if (supported_bfr) { gchar *str; str = mm_get_string_unquoted_from_match_info (match_info, 5); - *supported_bfr = read_number_list (str); + tmp_supported_bfr = mm_parse_uint_list (str, &inner_error); g_free (str); + if (inner_error) + goto out; } } - if (match_info) - g_match_info_free (match_info); - g_regex_unref (r); +out: - if ((supported_mode && *supported_mode == NULL) || - (supported_mt && *supported_mt == NULL) || - (supported_bm && *supported_bm == NULL) || - (supported_ds && *supported_ds == NULL) || - (supported_bfr && *supported_bfr == NULL)) - inner_error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Error parsing +CNMI=? response"); + g_match_info_free (match_info); + g_regex_unref (r); if (inner_error) { - if (supported_mode && *supported_mode) { - g_array_unref (*supported_mode); - *supported_mode = NULL; - } - if (supported_mt && *supported_mt) { - g_array_unref (*supported_mt); - *supported_mt = NULL; - } - if (supported_bm && *supported_bm) { - g_array_unref (*supported_bm); - *supported_bm = NULL; - } - if (supported_ds && *supported_ds) { - g_array_unref (*supported_ds); - *supported_ds = NULL; - } - if (supported_bfr && *supported_bfr) { - g_array_unref (*supported_bfr); - *supported_bfr = NULL; - } + g_clear_pointer (&tmp_supported_mode, g_array_unref); + g_clear_pointer (&tmp_supported_mt, g_array_unref); + g_clear_pointer (&tmp_supported_bm, g_array_unref); + g_clear_pointer (&tmp_supported_ds, g_array_unref); + g_clear_pointer (&tmp_supported_bfr, g_array_unref); g_propagate_error (error, inner_error); return FALSE; } + if (supported_mode) + *supported_mode = tmp_supported_mode; + if (supported_mt) + *supported_mt = tmp_supported_mt; + if (supported_bm) + *supported_bm = tmp_supported_bm; + if (supported_ds) + *supported_ds = tmp_supported_ds; + if (supported_bfr) + *supported_bfr = tmp_supported_bfr; + return TRUE; } @@ -472,8 +454,7 @@ } else errors++; - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (errors > 0) { @@ -485,6 +466,99 @@ } /*****************************************************************************/ +/* ^SWWAN read parser + * + * Description: Parses , [, ] or CME ERROR from SWWAN. + * + * The method returns a MMSwwanState with the connection status of a single + * PDP context, the one being queried via the cid given as input. + * + * Note that we use CID for matching because the WWAN adapter field is optional + * it seems. + * + * Read Command + * AT^SWWAN? + * Response(s) + * [^SWWAN: , [, ]] + * [^SWWAN: ...] + * OK + * ERROR + * +CME ERROR: + * + * Examples: + * OK - If no WWAN connection is active, then read command just returns OK + * ^SWWAN: 3,1,1 - 3rd PDP Context, Activated, First WWAN Adaptor + * +CME ERROR: ? - + */ + +enum { + MM_SWWAN_STATE_DISCONNECTED = 0, + MM_SWWAN_STATE_CONNECTED = 1, +}; + +MMBearerConnectionStatus +mm_cinterion_parse_swwan_response (const gchar *response, + guint cid, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + MMBearerConnectionStatus status; + + g_assert (response); + + /* If no WWAN connection is active, then ^SWWAN read command just returns OK + * (which we receive as an empty string) */ + if (!response[0]) + return MM_BEARER_CONNECTION_STATUS_DISCONNECTED; + + if (!g_str_has_prefix (response, "^SWWAN:")) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse ^SWWAN response: '%s'", response); + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + } + + r = g_regex_new ("\\^SWWAN:\\s*(\\d+),\\s*(\\d+)(?:,\\s*(\\d+))?(?:\\r\\n)?", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + status = MM_BEARER_CONNECTION_STATUS_UNKNOWN; + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + while (!inner_error && g_match_info_matches (match_info)) { + guint read_state; + guint read_cid; + + if (!mm_get_uint_from_match_info (match_info, 1, &read_cid)) + mm_warn ("Couldn't read cid in ^SWWAN response: '%s'", response); + else if (!mm_get_uint_from_match_info (match_info, 2, &read_state)) + mm_warn ("Couldn't read state in ^SWWAN response: '%s'", response); + else if (read_cid == cid) { + if (read_state == MM_SWWAN_STATE_CONNECTED) { + status = MM_BEARER_CONNECTION_STATUS_CONNECTED; + break; + } + if (read_state == MM_SWWAN_STATE_DISCONNECTED) { + status = MM_BEARER_CONNECTION_STATUS_DISCONNECTED; + break; + } + mm_warn ("Invalid state read in ^SWWAN response: %u", read_state); + break; + } + g_match_info_next (match_info, &inner_error); + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No state returned for CID %u", cid); + + return status; +} + +/*****************************************************************************/ /* ^SMONG response parser */ static MMModemAccessTechnology @@ -560,3 +634,36 @@ g_assert (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); return TRUE; } + +/*****************************************************************************/ +/* ^SIND psinfo helper */ + +MMModemAccessTechnology +mm_cinterion_get_access_technology_from_sind_psinfo (guint val) +{ + switch (val) { + case 0: + return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + case 1: + case 2: + return MM_MODEM_ACCESS_TECHNOLOGY_GPRS; + case 3: + case 4: + return MM_MODEM_ACCESS_TECHNOLOGY_EDGE; + case 5: + case 6: + return MM_MODEM_ACCESS_TECHNOLOGY_UMTS; + case 7: + case 8: + return MM_MODEM_ACCESS_TECHNOLOGY_HSDPA; + case 9: + case 10: + return (MM_MODEM_ACCESS_TECHNOLOGY_HSDPA | MM_MODEM_ACCESS_TECHNOLOGY_HSUPA); + case 16: + case 17: + return MM_MODEM_ACCESS_TECHNOLOGY_LTE; + default: + mm_dbg ("Unable to identify access technology from psinfo reported value: %u", val); + return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + } +} diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-modem-helpers-cinterion.h modemmanager-1.10.0/plugins/cinterion/mm-modem-helpers-cinterion.h --- modemmanager-1.6.8/plugins/cinterion/mm-modem-helpers-cinterion.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-modem-helpers-cinterion.h 2018-11-15 09:55:53.000000000 +0100 @@ -10,7 +10,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * + * Copyright (C) 2016 Trimble Navigation Limited * Copyright (C) 2014 Aleksander Morgado + * Contributor: Matthew Stanger */ #ifndef MM_MODEM_HELPERS_CINTERION_H @@ -19,6 +21,7 @@ #include #include +#include /*****************************************************************************/ /* ^SCFG test parser */ @@ -66,10 +69,22 @@ GError **error); /*****************************************************************************/ +/* ^SWWAN response parser */ + +MMBearerConnectionStatus mm_cinterion_parse_swwan_response (const gchar *response, + guint swwan_index, + GError **error); + +/*****************************************************************************/ /* ^SMONG response parser */ gboolean mm_cinterion_parse_smong_response (const gchar *response, MMModemAccessTechnology *access_tech, GError **error); +/*****************************************************************************/ +/* ^SIND psinfo helper */ + +MMModemAccessTechnology mm_cinterion_get_access_technology_from_sind_psinfo (guint val); + #endif /* MM_MODEM_HELPERS_CINTERION_H */ diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-plugin-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-plugin-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-plugin-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/mm-plugin-cinterion.c 2019-01-15 15:57:35.000000000 +0100 @@ -46,91 +46,67 @@ #define TAG_CINTERION_APP_PORT "cinterion-app-port" #define TAG_CINTERION_MODEM_PORT "cinterion-modem-port" -typedef struct { - MMPortProbe *probe; - MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; -} CinterionCustomInitContext; - -static void -cinterion_custom_init_context_complete_and_free (CinterionCustomInitContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); - g_slice_free (CinterionCustomInitContext, ctx); -} - static gboolean -cinterion_custom_init_finish (MMPortProbe *probe, - GAsyncResult *result, - GError **error) +cinterion_custom_init_finish (MMPortProbe *probe, + GAsyncResult *result, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } static void sqport_ready (MMPortSerialAt *port, - GAsyncResult *res, - CinterionCustomInitContext *ctx) + GAsyncResult *res, + GTask *task) { + MMPortProbe *probe; const gchar *response; + probe = g_task_get_source_object (task); + /* Ignore errors, just avoid tagging */ response = mm_port_serial_at_command_finish (port, res, NULL); if (response) { /* A valid reply to AT^SQPORT tells us this is an AT port already */ - mm_port_probe_set_result_at (ctx->probe, TRUE); + mm_port_probe_set_result_at (probe, TRUE); if (strstr (response, "Application")) - g_object_set_data (G_OBJECT (ctx->probe), TAG_CINTERION_APP_PORT, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_CINTERION_APP_PORT, GUINT_TO_POINTER (TRUE)); else if (strstr (response, "Modem")) - g_object_set_data (G_OBJECT (ctx->probe), TAG_CINTERION_MODEM_PORT, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_CINTERION_MODEM_PORT, GUINT_TO_POINTER (TRUE)); } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - cinterion_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -cinterion_custom_init (MMPortProbe *probe, - MMPortSerialAt *port, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +cinterion_custom_init (MMPortProbe *probe, + MMPortSerialAt *port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { - CinterionCustomInitContext *ctx; + GTask *task; - ctx = g_slice_new (CinterionCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - cinterion_custom_init); - ctx->probe = g_object_ref (probe); - ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; + task = g_task_new (probe, cancellable, callback, user_data); mm_port_serial_at_command ( - ctx->port, + port, "AT^SQPORT?", 3, FALSE, /* raw */ FALSE, /* allow cached */ - ctx->cancellable, - (GAsyncReadyCallback)sqport_ready, - ctx); + cancellable, + (GAsyncReadyCallback) sqport_ready, + task); } /*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -140,7 +116,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Cinterion modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_cinterion_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_cinterion_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -148,7 +124,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -176,20 +152,10 @@ mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe)); pflags = MM_PORT_SERIAL_AT_FLAG_PPP; - } else if (g_udev_device_get_property_as_boolean (mm_port_probe_peek_port (probe), - "ID_MM_CINTERION_PORT_TYPE_GPS")) { - mm_dbg ("(%s/%s)' Port flagged as GPS", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - /* Not an AT port, but the port to grab GPS traces */ - g_warn_if_fail (ptype == MM_PORT_TYPE_UNKNOWN); - ptype = MM_PORT_TYPE_GPS; } return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), ptype, pflags, error); diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-shared-cinterion.c modemmanager-1.10.0/plugins/cinterion/mm-shared-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/mm-shared-cinterion.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/cinterion/mm-shared-cinterion.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,812 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2014 Ammonit Measurement GmbH + * Copyright (C) 2014 - 2018 Aleksander Morgado + */ + +#include + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-location.h" +#include "mm-base-modem.h" +#include "mm-base-modem-at.h" +#include "mm-shared-cinterion.h" + +/*****************************************************************************/ +/* Private data context */ + +#define PRIVATE_TAG "shared-cinterion-private-tag" +static GQuark private_quark; + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_NOT_SUPPORTED, + FEATURE_SUPPORTED, +} FeatureSupport; + +typedef struct { + MMIfaceModemLocation *iface_modem_location_parent; + MMModemLocationSource supported_sources; + MMModemLocationSource enabled_sources; + FeatureSupport sgpss_support; + FeatureSupport sgpsc_support; +} Private; + +static void +private_free (Private *ctx) +{ + g_slice_free (Private, ctx); +} + +static Private * +get_private (MMSharedCinterion *self) +{ + Private *priv; + + if (G_UNLIKELY (!private_quark)) + private_quark = (g_quark_from_static_string (PRIVATE_TAG)); + + priv = g_object_get_qdata (G_OBJECT (self), private_quark); + if (!priv) { + priv = g_slice_new (Private); + + priv->supported_sources = MM_MODEM_LOCATION_SOURCE_NONE; + priv->enabled_sources = MM_MODEM_LOCATION_SOURCE_NONE; + priv->sgpss_support = FEATURE_SUPPORT_UNKNOWN; + priv->sgpsc_support = FEATURE_SUPPORT_UNKNOWN; + + /* Setup parent class' MMIfaceModemLocation */ + g_assert (MM_SHARED_CINTERION_GET_INTERFACE (self)->peek_parent_location_interface); + priv->iface_modem_location_parent = MM_SHARED_CINTERION_GET_INTERFACE (self)->peek_parent_location_interface (self); + + g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free); + } + + return priv; +} + +/*****************************************************************************/ +/* GPS trace received */ + +static void +trace_received (MMPortSerialGps *port, + const gchar *trace, + MMIfaceModemLocation *self) +{ + /* Helper to debug GPS location related issues. Don't depend on a real GPS + * fix for debugging, just use some random values to update */ +#if 0 + if (g_str_has_prefix (trace, "$GPGGA")) { + GString *str; + GDateTime *now; + + now = g_date_time_new_now_utc (); + str = g_string_new (""); + g_string_append_printf (str, + "$GPGGA,%02u%02u%02u,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47", + g_date_time_get_hour (now), + g_date_time_get_minute (now), + g_date_time_get_second (now)); + mm_iface_modem_location_gps_update (self, str->str); + g_string_free (str, TRUE); + g_date_time_unref (now); + return; + } +#endif + + mm_iface_modem_location_gps_update (self, trace); +} + +/*****************************************************************************/ +/* Location capabilities loading (Location interface) */ + +MMModemLocationSource +mm_shared_cinterion_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize aux; + + aux = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource) aux; +} + +static void probe_gps_features (GTask *task); + +static void +sgpsc_test_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + Private *priv; + + priv = get_private (MM_SHARED_CINTERION (self)); + + if (!mm_base_modem_at_command_finish (self, res, NULL)) + priv->sgpsc_support = FEATURE_NOT_SUPPORTED; + else { + /* ^SGPSC supported! */ + priv->sgpsc_support = FEATURE_SUPPORTED; + /* It may happen that the modem was started with GPS already enabled, or + * maybe ModemManager got rebooted and it was left enabled before. We'll + * make sure that it is disabled when we initialize the modem. */ + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSC=\"Engine\",\"0\"", 3, FALSE, NULL, NULL); + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSC=\"Power/Antenna\",\"off\"", 3, FALSE, NULL, NULL); + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSC=\"NMEA/Output\",\"off\"", 3, FALSE, NULL, NULL); + } + + probe_gps_features (task); +} + +static void +sgpss_test_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + Private *priv; + + priv = get_private (MM_SHARED_CINTERION (self)); + + if (!mm_base_modem_at_command_finish (self, res, NULL)) + priv->sgpss_support = FEATURE_NOT_SUPPORTED; + else { + /* ^SGPSS supported! */ + priv->sgpss_support = FEATURE_SUPPORTED; + + /* Flag ^SGPSC as unsupported, even if it may be supported, so that we + * only use one set of commands to enable/disable GPS. */ + priv->sgpsc_support = FEATURE_NOT_SUPPORTED; + + /* It may happen that the modem was started with GPS already enabled, or + * maybe ModemManager got rebooted and it was left enabled before. We'll + * make sure that it is disabled when we initialize the modem. */ + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSS=0", 3, FALSE, NULL, NULL); + } + + probe_gps_features (task); +} + +static void +probe_gps_features (GTask *task) +{ + MMSharedCinterion *self; + MMModemLocationSource sources; + Private *priv; + + self = MM_SHARED_CINTERION (g_task_get_source_object (task)); + priv = get_private (self); + + /* Need to check if SGPSS supported... */ + if (priv->sgpss_support == FEATURE_SUPPORT_UNKNOWN) { + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSS=?", 3, TRUE, (GAsyncReadyCallback) sgpss_test_ready, task); + return; + } + + /* Need to check if SGPSC supported... */ + if (priv->sgpsc_support == FEATURE_SUPPORT_UNKNOWN) { + mm_base_modem_at_command (MM_BASE_MODEM (self), "AT^SGPSC=?", 3, TRUE, (GAsyncReadyCallback) sgpsc_test_ready, task); + return; + } + + /* All GPS features probed */ + + /* Recover parent sources */ + sources = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + if (priv->sgpss_support == FEATURE_SUPPORTED || priv->sgpsc_support == FEATURE_SUPPORTED) { + mm_dbg ("GPS commands supported: GPS capabilities enabled"); + + /* We only flag as supported by this implementation those sources not already + * supported by the parent implementation */ + if (!(sources & MM_MODEM_LOCATION_SOURCE_GPS_NMEA)) + priv->supported_sources |= MM_MODEM_LOCATION_SOURCE_GPS_NMEA; + if (!(sources & MM_MODEM_LOCATION_SOURCE_GPS_RAW)) + priv->supported_sources |= MM_MODEM_LOCATION_SOURCE_GPS_RAW; + if (!(sources & MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) + priv->supported_sources |= MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED; + + sources |= priv->supported_sources; + + /* Add handler for the NMEA traces in the GPS data port */ + mm_port_serial_gps_add_trace_handler (mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)), + (MMPortSerialGpsTraceFn)trace_received, + self, + NULL); + } else + mm_dbg ("No GPS command supported: no GPS capabilities"); + + g_task_return_int (task, (gssize) sources); + g_object_unref (task); +} + +static void +parent_load_capabilities_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource sources; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_CINTERION (self)); + + sources = priv->iface_modem_location_parent->load_capabilities_finish (self, res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Now our own check. If we don't have any GPS port, we're done */ + if (!mm_base_modem_peek_port_gps (MM_BASE_MODEM (self))) { + mm_dbg ("No GPS data port found: no GPS capabilities"); + g_task_return_int (task, sources); + g_object_unref (task); + return; + } + + /* Cache sources supported by the parent */ + g_task_set_task_data (task, GUINT_TO_POINTER (sources), NULL); + + /* Probe all GPS features */ + probe_gps_features (task); +} + +void +mm_shared_cinterion_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + GTask *task; + + priv = get_private (MM_SHARED_CINTERION (self)); + task = g_task_new (self, NULL, callback, user_data); + + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->load_capabilities); + g_assert (priv->iface_modem_location_parent->load_capabilities_finish); + + priv->iface_modem_location_parent->load_capabilities (self, + (GAsyncReadyCallback)parent_load_capabilities_ready, + task); +} + +/*****************************************************************************/ +/* Disable location gathering (Location interface) */ + +typedef enum { + DISABLE_LOCATION_GATHERING_GPS_STEP_FIRST, + DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSS, + DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE, + DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ANTENNA, + DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_OUTPUT, + DISABLE_LOCATION_GATHERING_GPS_STEP_LAST, +} DisableLocationGatheringGpsStep; + +typedef struct { + MMModemLocationSource source; + DisableLocationGatheringGpsStep gps_step; + GError *sgpss_error; + GError *sgpsc_error; +} DisableLocationGatheringContext; + +static void +disable_location_gathering_context_free (DisableLocationGatheringContext *ctx) +{ + if (ctx->sgpss_error) + g_error_free (ctx->sgpss_error); + if (ctx->sgpsc_error) + g_error_free (ctx->sgpsc_error); + g_slice_free (DisableLocationGatheringContext, ctx); +} + +gboolean +mm_shared_cinterion_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void disable_location_gathering_context_gps_step (GTask *task); + +static void +disable_sgpsc_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + DisableLocationGatheringContext *ctx; + GError *error = NULL; + + ctx = (DisableLocationGatheringContext *) g_task_get_task_data (task); + + /* Store error, if not one available already, and continue */ + if (!mm_base_modem_at_command_finish (self, res, &error)) { + if (!ctx->sgpsc_error) + ctx->sgpsc_error = error; + else + g_error_free (error); + } + + ctx->gps_step++; + disable_location_gathering_context_gps_step (task); +} + +static void +disable_sgpss_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + DisableLocationGatheringContext *ctx; + + ctx = (DisableLocationGatheringContext *) g_task_get_task_data (task); + + /* Store error, if any, and continue */ + g_assert (!ctx->sgpss_error); + mm_base_modem_at_command_finish (self, res, &ctx->sgpss_error); + + ctx->gps_step++; + disable_location_gathering_context_gps_step (task); +} + +static void +disable_location_gathering_context_gps_step (GTask *task) +{ + DisableLocationGatheringContext *ctx; + MMSharedCinterion *self; + Private *priv; + + self = MM_SHARED_CINTERION (g_task_get_source_object (task)); + priv = get_private (self); + ctx = (DisableLocationGatheringContext *) g_task_get_task_data (task); + + /* Only one of both supported */ + g_assert ((priv->sgpss_support == FEATURE_SUPPORTED) || (priv->sgpsc_support == FEATURE_SUPPORTED)); + g_assert (!((priv->sgpss_support == FEATURE_SUPPORTED) && (priv->sgpsc_support == FEATURE_SUPPORTED))); + + switch (ctx->gps_step) { + case DISABLE_LOCATION_GATHERING_GPS_STEP_FIRST: + ctx->gps_step++; + /* Fall down to next step */ + + case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSS: + if (priv->sgpss_support == FEATURE_SUPPORTED) { + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSS=0", + 3, FALSE, (GAsyncReadyCallback) disable_sgpss_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* Engine off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"Engine\",\"0\"", + 3, FALSE, (GAsyncReadyCallback) disable_sgpsc_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ANTENNA: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* Antenna off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"Power/Antenna\",\"off\"", + 3, FALSE, (GAsyncReadyCallback) disable_sgpsc_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_OUTPUT: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* NMEA output off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"NMEA/Output\",\"off\"", + 3, FALSE, (GAsyncReadyCallback) disable_sgpsc_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case DISABLE_LOCATION_GATHERING_GPS_STEP_LAST: + /* Only use the GPS port in NMEA/RAW setups */ + if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { + MMPortSerialGps *gps_port; + + /* Even if we get an error here, we try to close the GPS port */ + gps_port = mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)); + if (gps_port) + mm_port_serial_close (MM_PORT_SERIAL (gps_port)); + } + + if (ctx->sgpss_error) { + g_task_return_error (task, ctx->sgpss_error); + g_clear_error (&ctx->sgpss_error); + } else if (ctx->sgpsc_error) { + g_task_return_error (task, ctx->sgpsc_error); + g_clear_error (&ctx->sgpsc_error); + } else { + priv->enabled_sources &= ~ctx->source; + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); + return; + } +} + +static void +parent_disable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error; + Private *priv; + + priv = get_private (MM_SHARED_CINTERION (self)); + + g_assert (priv->iface_modem_location_parent); + if (!priv->iface_modem_location_parent->disable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_cinterion_disable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + DisableLocationGatheringContext *ctx; + MMModemLocationSource enabled_sources; + Private *priv; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + priv = get_private (MM_SHARED_CINTERION (self)); + g_assert (priv->iface_modem_location_parent); + + /* Only consider request if it applies to one of the sources we are + * supporting, otherwise run parent disable */ + if (!(priv->supported_sources & source)) { + /* If disabling implemented by the parent, run it. */ + if (priv->iface_modem_location_parent->disable_location_gathering && + priv->iface_modem_location_parent->disable_location_gathering_finish) { + priv->iface_modem_location_parent->disable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_disable_location_gathering_ready, + task); + return; + } + /* Otherwise, we're done */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* We only expect GPS sources here */ + g_assert (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)); + + /* Flag as disabled to see how many others we would have left enabled */ + enabled_sources = priv->enabled_sources; + enabled_sources &= ~source; + + /* If there are still GPS-related sources enabled, do nothing else */ + if (enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { + priv->enabled_sources &= ~source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Stop GPS engine if all GPS-related sources are disabled */ + ctx = g_slice_new0 (DisableLocationGatheringContext); + ctx->source = source; + ctx->gps_step = DISABLE_LOCATION_GATHERING_GPS_STEP_FIRST; + g_task_set_task_data (task, ctx, (GDestroyNotify) disable_location_gathering_context_free); + disable_location_gathering_context_gps_step (task); +} + +/*****************************************************************************/ +/* Enable location gathering (Location interface) */ + +/* We will retry the SGPSC command that enables the Engine */ +#define MAX_SGPSC_ENGINE_RETRIES 3 + +/* Cinterion asks for 100ms some time between GPS commands, but we'll give up + * to 2000ms before setting the Engine configuration as 100ms didn't seem always + * enough (we would get +CME ERROR: 767 errors reported). */ +#define GPS_COMMAND_TIMEOUT_DEFAULT_MS 100 +#define GPS_COMMAND_TIMEOUT_ENGINE_MS 2000 + +typedef enum { + ENABLE_LOCATION_GATHERING_GPS_STEP_FIRST, + ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSS, + ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_OUTPUT, + ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ANTENNA, + ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE, + ENABLE_LOCATION_GATHERING_GPS_STEP_LAST, +} EnableLocationGatheringGpsStep; + +typedef struct { + MMModemLocationSource source; + EnableLocationGatheringGpsStep gps_step; + guint sgpsc_engine_retries; +} EnableLocationGatheringContext; + +static void +enable_location_gathering_context_free (EnableLocationGatheringContext *ctx) +{ + g_slice_free (EnableLocationGatheringContext, ctx); +} + +gboolean +mm_shared_cinterion_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void enable_location_gathering_context_gps_step (GTask *task); + +static gboolean +enable_location_gathering_context_gps_step_schedule_cb (GTask *task) +{ + /* Run the scheduled step */ + enable_location_gathering_context_gps_step (task); + return G_SOURCE_REMOVE; +} + +static void +enable_sgpsc_or_sgpss_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + EnableLocationGatheringContext *ctx; + GError *error = NULL; + + ctx = (EnableLocationGatheringContext *) g_task_get_task_data (task); + + if (!mm_base_modem_at_command_finish (self, res, &error)) { + /* The GPS setup may sometimes report "+CME ERROR 767" when enabling the + * Engine; so we'll run some retries of the same command ourselves. */ + if (ctx->gps_step == ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE) { + ctx->sgpsc_engine_retries++; + mm_dbg ("GPS Engine setup failed (%u/%u)", ctx->sgpsc_engine_retries, MAX_SGPSC_ENGINE_RETRIES); + if (ctx->sgpsc_engine_retries < MAX_SGPSC_ENGINE_RETRIES) { + g_clear_error (&error); + goto schedule; + } + } + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Go on to next step */ + ctx->gps_step++; + +schedule: + g_timeout_add (ctx->gps_step == ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE ? GPS_COMMAND_TIMEOUT_ENGINE_MS : GPS_COMMAND_TIMEOUT_DEFAULT_MS, + (GSourceFunc) enable_location_gathering_context_gps_step_schedule_cb, task); +} + +static void +enable_location_gathering_context_gps_step (GTask *task) +{ + EnableLocationGatheringContext *ctx; + MMSharedCinterion *self; + Private *priv; + + self = MM_SHARED_CINTERION (g_task_get_source_object (task)); + priv = get_private (self); + ctx = (EnableLocationGatheringContext *) g_task_get_task_data (task); + + /* Only one of both supported */ + g_assert ((priv->sgpss_support == FEATURE_SUPPORTED) || (priv->sgpsc_support == FEATURE_SUPPORTED)); + g_assert (!((priv->sgpss_support == FEATURE_SUPPORTED) && (priv->sgpsc_support == FEATURE_SUPPORTED))); + + switch (ctx->gps_step) { + case ENABLE_LOCATION_GATHERING_GPS_STEP_FIRST: + ctx->gps_step++; + /* Fall down to next step */ + + case ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSS: + if (priv->sgpss_support == FEATURE_SUPPORTED) { + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSS=4", + 3, FALSE, (GAsyncReadyCallback) enable_sgpsc_or_sgpss_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_OUTPUT: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* NMEA output off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"NMEA/Output\",\"on\"", + 3, FALSE, (GAsyncReadyCallback) enable_sgpsc_or_sgpss_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + + case ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ANTENNA: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* Antenna off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"Power/Antenna\",\"on\"", + 3, FALSE, (GAsyncReadyCallback) enable_sgpsc_or_sgpss_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case ENABLE_LOCATION_GATHERING_GPS_STEP_SGPSC_ENGINE: + if (priv->sgpsc_support == FEATURE_SUPPORTED) { + /* Engine off */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT^SGPSC=\"Engine\",\"1\"", + 3, FALSE, (GAsyncReadyCallback) enable_sgpsc_or_sgpss_ready, task); + return; + } + ctx->gps_step++; + /* Fall down to next step */ + + case ENABLE_LOCATION_GATHERING_GPS_STEP_LAST: + /* Only use the GPS port in NMEA/RAW setups */ + if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { + MMPortSerialGps *gps_port; + GError *error = NULL; + + gps_port = mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)); + if (!gps_port || !mm_port_serial_open (MM_PORT_SERIAL (gps_port), &error)) { + if (error) + g_task_return_error (task, error); + else + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't open raw GPS serial port"); + g_object_unref (task); + return; + } + } + + /* Success */ + priv->enabled_sources |= ctx->source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } +} + +static void +parent_enable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error; + Private *priv; + + priv = get_private (MM_SHARED_CINTERION (self)); + + g_assert (priv->iface_modem_location_parent); + if (!priv->iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_cinterion_enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + GTask *task; + EnableLocationGatheringContext *ctx; + + + task = g_task_new (self, NULL, callback, user_data); + + priv = get_private (MM_SHARED_CINTERION (self)); + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->enable_location_gathering); + g_assert (priv->iface_modem_location_parent->enable_location_gathering_finish); + + /* Only consider request if it applies to one of the sources we are + * supporting, otherwise run parent enable */ + if (!(priv->supported_sources & source)) { + priv->iface_modem_location_parent->enable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_enable_location_gathering_ready, + task); + return; + } + + /* We only expect GPS sources here */ + g_assert (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)); + + /* If GPS already started, store new flag and we're done */ + if (priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { + priv->enabled_sources |= source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx = g_slice_new0 (EnableLocationGatheringContext); + ctx->source = source; + ctx->gps_step = ENABLE_LOCATION_GATHERING_GPS_STEP_FIRST; + g_task_set_task_data (task, ctx, (GDestroyNotify) enable_location_gathering_context_free); + + enable_location_gathering_context_gps_step (task); +} + +/*****************************************************************************/ + +static void +shared_cinterion_init (gpointer g_iface) +{ +} + +GType +mm_shared_cinterion_get_type (void) +{ + static GType shared_cinterion_type = 0; + + if (!G_UNLIKELY (shared_cinterion_type)) { + static const GTypeInfo info = { + sizeof (MMSharedCinterion), /* class_size */ + shared_cinterion_init, /* base_init */ + NULL, /* base_finalize */ + }; + + shared_cinterion_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedCinterion", &info, 0); + g_type_interface_add_prerequisite (shared_cinterion_type, MM_TYPE_IFACE_MODEM_LOCATION); + } + + return shared_cinterion_type; +} diff -Nru modemmanager-1.6.8/plugins/cinterion/mm-shared-cinterion.h modemmanager-1.10.0/plugins/cinterion/mm-shared-cinterion.h --- modemmanager-1.6.8/plugins/cinterion/mm-shared-cinterion.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/cinterion/mm-shared-cinterion.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2014 Ammonit Measurement GmbH + * Copyright (C) 2014 - 2018 Aleksander Morgado + */ + +#ifndef MM_SHARED_CINTERION_H +#define MM_SHARED_CINTERION_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-broadband-modem.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-location.h" + +#define MM_TYPE_SHARED_CINTERION (mm_shared_cinterion_get_type ()) +#define MM_SHARED_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_CINTERION, MMSharedCinterion)) +#define MM_IS_SHARED_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_CINTERION)) +#define MM_SHARED_CINTERION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_CINTERION, MMSharedCinterion)) + +typedef struct _MMSharedCinterion MMSharedCinterion; + +struct _MMSharedCinterion { + GTypeInterface g_iface; + + /* Peek location interface of the parent class of the object */ + MMIfaceModemLocation * (* peek_parent_location_interface) (MMSharedCinterion *self); +}; + +GType mm_shared_cinterion_get_type (void); + +void mm_shared_cinterion_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemLocationSource mm_shared_cinterion_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + +void mm_shared_cinterion_enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_cinterion_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + +void mm_shared_cinterion_disable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_cinterion_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + +#endif /* MM_SHARED_CINTERION_H */ diff -Nru modemmanager-1.6.8/plugins/cinterion/tests/test-modem-helpers-cinterion.c modemmanager-1.10.0/plugins/cinterion/tests/test-modem-helpers-cinterion.c --- modemmanager-1.6.8/plugins/cinterion/tests/test-modem-helpers-cinterion.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/cinterion/tests/test-modem-helpers-cinterion.c 2018-11-15 09:55:53.000000000 +0100 @@ -25,12 +25,6 @@ #include "mm-modem-helpers.h" #include "mm-modem-helpers-cinterion.h" -static gint -sort_band (MMModemBand a, MMModemBand b) -{ - return a - b; -} - /*****************************************************************************/ /* Test ^SCFG test responses */ @@ -52,8 +46,8 @@ g_assert (res == TRUE); g_assert (bands != NULL); - g_array_sort (bands, (GCompareFunc)sort_band); - g_array_sort (expected_bands, (GCompareFunc)sort_band); + mm_common_bands_garray_sort (bands); + mm_common_bands_garray_sort (expected_bands); expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, expected_bands->len); @@ -103,15 +97,15 @@ "^SCFG: \"URC/Ringline/ActiveTime\",(\"0\",\"1\",\"2\",\"keep\")\r\n"; expected_bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 9); - single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_PCS, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_G850, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U2100, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U1900, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U850, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U900, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U800, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_PCS, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_G850, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_1, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_2, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_5, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_8, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_6, g_array_append_val (expected_bands, single); common_test_scfg (response, expected_bands); @@ -176,10 +170,10 @@ "^SCFG: \"Userware/Watchdog\",(\"0\",\"1\",\"2\")\r\n"; expected_bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 4); - single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U2100, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U900, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_1, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_8, g_array_append_val (expected_bands, single); common_test_scfg (response, expected_bands); @@ -205,8 +199,8 @@ g_assert (res == TRUE); g_assert (bands != NULL); - g_array_sort (bands, (GCompareFunc)sort_band); - g_array_sort (expected_bands, (GCompareFunc)sort_band); + mm_common_bands_garray_sort (bands); + mm_common_bands_garray_sort (expected_bands); expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, expected_bands->len); @@ -267,13 +261,13 @@ "\r\n"; expected_bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 9); - single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_PCS, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_G850, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U2100, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U1900, g_array_append_val (expected_bands, single); - single = MM_MODEM_BAND_U850, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_EGSM, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_DCS, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_PCS, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_G850, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_1, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_2, g_array_append_val (expected_bands, single); + single = MM_MODEM_BAND_UTRAN_5, g_array_append_val (expected_bands, single); common_test_scfg_response (response, MM_MODEM_CHARSET_UNKNOWN, expected_bands); @@ -395,7 +389,206 @@ g_array_unref (expected_mt); g_array_unref (expected_bm); g_array_unref (expected_ds); - g_array_unref (expected_bfr);} + g_array_unref (expected_bfr); +} + +static void +test_cnmi_other (void) +{ + GArray *expected_mode; + GArray *expected_mt; + GArray *expected_bm; + GArray *expected_ds; + GArray *expected_bfr; + guint val; + const gchar *response = + "+CNMI: (0-3),(0,1),(0,2,3),(0,2),(1)\r\n" + "\r\n"; + + expected_mode = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3); + val = 0, g_array_append_val (expected_mode, val); + val = 1, g_array_append_val (expected_mode, val); + val = 2, g_array_append_val (expected_mode, val); + val = 3, g_array_append_val (expected_mode, val); + + expected_mt = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); + val = 0, g_array_append_val (expected_mt, val); + val = 1, g_array_append_val (expected_mt, val); + + expected_bm = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); + val = 0, g_array_append_val (expected_bm, val); + val = 2, g_array_append_val (expected_bm, val); + val = 3, g_array_append_val (expected_bm, val); + + expected_ds = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); + val = 0, g_array_append_val (expected_ds, val); + val = 2, g_array_append_val (expected_ds, val); + + expected_bfr = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); + val = 1, g_array_append_val (expected_bfr, val); + + common_test_cnmi (response, + expected_mode, + expected_mt, + expected_bm, + expected_ds, + expected_bfr); + + g_array_unref (expected_mode); + g_array_unref (expected_mt); + g_array_unref (expected_bm); + g_array_unref (expected_ds); + g_array_unref (expected_bfr); +} + +/*****************************************************************************/ +/* Test ^SWWAN read */ + +#define SWWAN_TEST_MAX_CIDS 2 + +typedef struct { + guint cid; + MMBearerConnectionStatus state; +} PdpContextState; + +typedef struct { + const gchar *response; + PdpContextState expected_items[SWWAN_TEST_MAX_CIDS]; + gboolean skip_test_other_cids; +} SwwanTest; + +/* Note: all tests are based on checking CIDs 2 and 3 */ +static const SwwanTest swwan_tests[] = { + /* No active PDP context reported (all disconnected) */ + { + .response = "", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED } + }, + /* Don't test other CIDs because for those we would also return + * DISCONNECTED, not UNKNOWN. */ + .skip_test_other_cids = TRUE + }, + /* Single PDP context active (short version without interface index) */ + { + .response = "^SWWAN: 3,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_UNKNOWN }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + }, + /* Single PDP context active (long version with interface index) */ + { + .response = "^SWWAN: 3,1,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_UNKNOWN }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + }, + /* Single PDP context inactive (short version without interface index) */ + { + .response = "^SWWAN: 3,0\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_UNKNOWN }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED } + } + }, + /* Single PDP context inactive (long version with interface index) */ + { + .response = "^SWWAN: 3,0,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_UNKNOWN }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED } + } + }, + /* Multiple PDP contexts active (short version without interface index) */ + { + .response = "^SWWAN: 2,1\r\n^SWWAN: 3,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + }, + /* Multiple PDP contexts active (long version with interface index) */ + { + .response = "^SWWAN: 2,1,3\r\n^SWWAN: 3,1,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + }, + /* Multiple PDP contexts inactive (short version without interface index) */ + { + .response = "^SWWAN: 2,0\r\n^SWWAN: 3,0\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED } + } + }, + /* Multiple PDP contexts inactive (long version with interface index) */ + { + .response = "^SWWAN: 2,0,3\r\n^SWWAN: 3,0,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED } + } + }, + /* Multiple PDP contexts active/inactive (short version without interface index) */ + { + .response = "^SWWAN: 2,0\r\n^SWWAN: 3,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + }, + /* Multiple PDP contexts active/inactive (long version with interface index) */ + { + .response = "^SWWAN: 2,0,3\r\n^SWWAN: 3,1,1\r\n", + .expected_items = { + { .cid = 2, .state = MM_BEARER_CONNECTION_STATUS_DISCONNECTED }, + { .cid = 3, .state = MM_BEARER_CONNECTION_STATUS_CONNECTED } + } + } +}; + +static void +test_swwan_pls8 (void) +{ + MMBearerConnectionStatus read_state; + GError *error = NULL; + guint i; + + /* Base tests for successful responses */ + for (i = 0; i < G_N_ELEMENTS (swwan_tests); i++) { + guint j; + + /* Query for the expected items (CIDs 2 and 3) */ + for (j = 0; j < SWWAN_TEST_MAX_CIDS; j++) { + read_state = mm_cinterion_parse_swwan_response (swwan_tests[i].response, swwan_tests[i].expected_items[j].cid, &error); + if (swwan_tests[i].expected_items[j].state == MM_BEARER_CONNECTION_STATUS_UNKNOWN) { + g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); + g_clear_error (&error); + } else + g_assert_no_error (error); + g_assert_cmpint (read_state, ==, swwan_tests[i].expected_items[j].state); + } + + /* Query for a CID which isn't replied (e.g. 12) */ + if (!swwan_tests[i].skip_test_other_cids) { + read_state = mm_cinterion_parse_swwan_response (swwan_tests[i].response, 12, &error); + g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); + g_assert_cmpint (read_state, ==, MM_BEARER_CONNECTION_STATUS_UNKNOWN); + g_clear_error (&error); + } + } + + /* Additional tests for errors */ + read_state = mm_cinterion_parse_swwan_response ("^GARBAGE", 2, &error); + g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); + g_assert_cmpint (read_state, ==, MM_BEARER_CONNECTION_STATUS_UNKNOWN); + g_clear_error (&error); +} /*****************************************************************************/ /* Test ^SIND responses */ @@ -500,7 +693,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/cinterion/scfg", test_scfg); @@ -509,6 +701,8 @@ g_test_add_func ("/MM/cinterion/scfg/response/2g", test_scfg_response_2g); g_test_add_func ("/MM/cinterion/scfg/response/2g/ucs2", test_scfg_response_2g_ucs2); g_test_add_func ("/MM/cinterion/cnmi/phs8", test_cnmi_phs8); + g_test_add_func ("/MM/cinterion/cnmi/other", test_cnmi_other); + g_test_add_func ("/MM/cinterion/swwan/pls8", test_swwan_pls8); g_test_add_func ("/MM/cinterion/sind/response/simstatus", test_sind_response_simstatus); g_test_add_func ("/MM/cinterion/smong/response/tc63i", test_smong_response_tc63i); g_test_add_func ("/MM/cinterion/smong/response/other", test_smong_response_other); diff -Nru modemmanager-1.6.8/plugins/dell/77-mm-dell-port-types.rules modemmanager-1.10.0/plugins/dell/77-mm-dell-port-types.rules --- modemmanager-1.6.8/plugins/dell/77-mm-dell-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/dell/77-mm-dell-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,6 +1,6 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_dell_port_types_end" +ACTION!="add|change|move|bind", GOTO="mm_dell_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", GOTO="mm_dell_vendorcheck" GOTO="mm_dell_port_types_end" @@ -8,9 +8,15 @@ LABEL="mm_dell_vendorcheck" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -# DW5580 is a Dell-branded Telit modem -# tag is needed here both for dynamic port recognition and minimizing port probing time -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81ba", ENV{ID_MM_TELIT_TAGGED}="1", ENV{ID_MM_TELIT_PORTS_TAGGED}="1" +# Dell DW5821e +# if 02: primary port +# if 03: secondary port +# if 04: raw NMEA port +# if 05: diag/qcdm port +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_QCDM}="1" GOTO="mm_dell_port_types_end" LABEL="mm_dell_port_types_end" diff -Nru modemmanager-1.6.8/plugins/dell/mm-broadband-modem-dell-dw5821e.c modemmanager-1.10.0/plugins/dell/mm-broadband-modem-dell-dw5821e.c --- modemmanager-1.6.8/plugins/dell/mm-broadband-modem-dell-dw5821e.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/dell/mm-broadband-modem-dell-dw5821e.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,360 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-errors-types.h" +#include "mm-modem-helpers.h" +#include "mm-base-modem-at.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-location.h" +#include "mm-iface-modem-firmware.h" +#include "mm-broadband-modem-dell-dw5821e.h" + +static void iface_modem_location_init (MMIfaceModemLocation *iface); +static void iface_modem_firmware_init (MMIfaceModemFirmware *iface); + +static MMIfaceModemLocation *iface_modem_location_parent; + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemDellDw5821e, mm_broadband_modem_dell_dw5821e, MM_TYPE_BROADBAND_MODEM_MBIM, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init)) + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_NOT_SUPPORTED, + FEATURE_SUPPORTED +} FeatureSupport; + +struct _MMBroadbandModemDellDw5821ePrivate { + FeatureSupport unmanaged_gps_support; +}; + +/*****************************************************************************/ +/* Firmware update settings */ + +static MMFirmwareUpdateSettings * +firmware_load_update_settings_finish (MMIfaceModemFirmware *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +firmware_load_update_settings (MMIfaceModemFirmware *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMFirmwareUpdateSettings *update_settings; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT | + MM_MODEM_FIRMWARE_UPDATE_METHOD_QMI_PDC); + mm_firmware_update_settings_set_fastboot_at (update_settings, "AT^FASTBOOT"); + + g_task_return_pointer (task, update_settings, g_object_unref); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location capabilities loading (Location interface) */ + +static MMModemLocationSource +location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; +} + +static void +parent_load_capabilities_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource sources; + GError *error = NULL; + + sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* If we have a GPS port and an AT port, enable unmanaged GPS support */ + if (mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)) && + mm_base_modem_peek_port_gps (MM_BASE_MODEM (self))) { + MM_BROADBAND_MODEM_DELL_DW5821E (self)->priv->unmanaged_gps_support = FEATURE_SUPPORTED; + sources |= MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED; + } + + /* So we're done, complete */ + g_task_return_int (task, sources); + g_object_unref (task); +} + +static void +location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Chain up parent's setup */ + iface_modem_location_parent->load_capabilities (self, + (GAsyncReadyCallback)parent_load_capabilities_ready, + task); +} + +/*****************************************************************************/ +/* Disable location gathering (Location interface) */ + +static gboolean +disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +parent_disable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!iface_modem_location_parent->disable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_disable_location_gathering (GTask *task) +{ + MMIfaceModemLocation *self; + MMModemLocationSource source; + + self = MM_IFACE_MODEM_LOCATION (g_task_get_source_object (task)); + source = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + iface_modem_location_parent->disable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_disable_location_gathering_ready, + task); +} + +static void +unmanaged_gps_disabled_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + parent_disable_location_gathering (task); +} + +static void +disable_location_gathering (MMIfaceModemLocation *_self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemDellDw5821e *self = MM_BROADBAND_MODEM_DELL_DW5821E (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + /* We only support Unmanaged GPS at this level */ + if ((self->priv->unmanaged_gps_support != FEATURE_SUPPORTED) || + (source != MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { + parent_disable_location_gathering (task); + return; + } + + mm_base_modem_at_command (MM_BASE_MODEM (_self), + "^NV=30007,01,\"00\"", + 3, + FALSE, + (GAsyncReadyCallback)unmanaged_gps_disabled_ready, + task); +} + +/*****************************************************************************/ +/* Enable location gathering (Location interface) */ + +static gboolean +enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +unmanaged_gps_enabled_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_enable_location_gathering_ready (MMIfaceModemLocation *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemDellDw5821e *self = MM_BROADBAND_MODEM_DELL_DW5821E (_self); + GError *error = NULL; + MMModemLocationSource source; + + if (!iface_modem_location_parent->enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* We only support Unmanaged GPS at this level */ + source = GPOINTER_TO_UINT (g_task_get_task_data (task)); + if ((self->priv->unmanaged_gps_support != FEATURE_SUPPORTED) || + (source != MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + mm_base_modem_at_command (MM_BASE_MODEM (_self), + "^NV=30007,01,\"01\"", + 3, + FALSE, + (GAsyncReadyCallback)unmanaged_gps_enabled_ready, + task); +} + +static void +enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + /* Chain up parent's gathering enable */ + iface_modem_location_parent->enable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_enable_location_gathering_ready, + task); +} + +/*****************************************************************************/ + +MMBroadbandModemDellDw5821e * +mm_broadband_modem_dell_dw5821e_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_DELL_DW5821E, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, TRUE, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, FALSE, + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, TRUE, + NULL); +} + +static void +mm_broadband_modem_dell_dw5821e_init (MMBroadbandModemDellDw5821e *self) +{ + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_BROADBAND_MODEM_DELL_DW5821E, MMBroadbandModemDellDw5821ePrivate); + self->priv->unmanaged_gps_support = FEATURE_SUPPORT_UNKNOWN; +} + +static void +iface_modem_location_init (MMIfaceModemLocation *iface) +{ + iface_modem_location_parent = g_type_interface_peek_parent (iface); + + iface->load_capabilities = location_load_capabilities; + iface->load_capabilities_finish = location_load_capabilities_finish; + iface->enable_location_gathering = enable_location_gathering; + iface->enable_location_gathering_finish = enable_location_gathering_finish; + iface->disable_location_gathering = disable_location_gathering; + iface->disable_location_gathering_finish = disable_location_gathering_finish; +} + +static void +iface_modem_firmware_init (MMIfaceModemFirmware *iface) +{ + iface->load_update_settings = firmware_load_update_settings; + iface->load_update_settings_finish = firmware_load_update_settings_finish; +} + +static void +mm_broadband_modem_dell_dw5821e_class_init (MMBroadbandModemDellDw5821eClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMBroadbandModemDellDw5821ePrivate)); +} diff -Nru modemmanager-1.6.8/plugins/dell/mm-broadband-modem-dell-dw5821e.h modemmanager-1.10.0/plugins/dell/mm-broadband-modem-dell-dw5821e.h --- modemmanager-1.6.8/plugins/dell/mm-broadband-modem-dell-dw5821e.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/dell/mm-broadband-modem-dell-dw5821e.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_DELL_DW5821E_H +#define MM_BROADBAND_MODEM_DELL_DW5821E_H + +#include "mm-broadband-modem-mbim.h" + +#define MM_TYPE_BROADBAND_MODEM_DELL_DW5821E (mm_broadband_modem_dell_dw5821e_get_type ()) +#define MM_BROADBAND_MODEM_DELL_DW5821E(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_DELL_DW5821E, MMBroadbandModemDellDw5821e)) +#define MM_BROADBAND_MODEM_DELL_DW5821E_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_DELL_DW5821E, MMBroadbandModemDellDw5821eClass)) +#define MM_IS_BROADBAND_MODEM_DELL_DW5821E(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_DELL_DW5821E)) +#define MM_IS_BROADBAND_MODEM_DELL_DW5821E_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_DELL_DW5821E)) +#define MM_BROADBAND_MODEM_DELL_DW5821E_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_DELL_DW5821E, MMBroadbandModemDellDw5821eClass)) + +typedef struct _MMBroadbandModemDellDw5821e MMBroadbandModemDellDw5821e; +typedef struct _MMBroadbandModemDellDw5821eClass MMBroadbandModemDellDw5821eClass; +typedef struct _MMBroadbandModemDellDw5821ePrivate MMBroadbandModemDellDw5821ePrivate; + +struct _MMBroadbandModemDellDw5821e { + MMBroadbandModemMbim parent; + MMBroadbandModemDellDw5821ePrivate *priv; +}; + +struct _MMBroadbandModemDellDw5821eClass{ + MMBroadbandModemMbimClass parent; +}; + +GType mm_broadband_modem_dell_dw5821e_get_type (void); + +MMBroadbandModemDellDw5821e *mm_broadband_modem_dell_dw5821e_new (const gchar *device, + const gchar **driver, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_DELL_DW5821E_H */ diff -Nru modemmanager-1.6.8/plugins/dell/mm-plugin-dell.c modemmanager-1.10.0/plugins/dell/mm-plugin-dell.c --- modemmanager-1.6.8/plugins/dell/mm-plugin-dell.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/dell/mm-plugin-dell.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,6 +34,7 @@ #include "mm-broadband-modem-sierra.h" #include "mm-common-sierra.h" #include "mm-broadband-modem-telit.h" +#include "mm-broadband-modem-xmm.h" #include "mm-common-telit.h" #include "mm-log.h" @@ -43,8 +44,12 @@ #if defined WITH_MBIM #include "mm-broadband-modem-mbim.h" +#include "mm-broadband-modem-mbim-xmm.h" +#include "mm-broadband-modem-dell-dw5821e.h" #endif +#define MAX_PORT_PROBE_TIMEOUTS 3 + G_DEFINE_TYPE (MMPluginDell, mm_plugin_dell, MM_TYPE_PLUGIN) MM_PLUGIN_DEFINE_MAJOR_VERSION @@ -63,101 +68,103 @@ /* Custom init */ typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; - guint gmi_retries; - guint cgmi_retries; - guint ati_retries; + guint gmi_retries; + guint cgmi_retries; + guint ati_retries; + guint timeouts; } CustomInitContext; static void -custom_init_context_complete_and_free (CustomInitContext *ctx) +custom_init_context_free (CustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (CustomInitContext, ctx); } static gboolean -dell_custom_init_finish (MMPortProbe *probe, - GAsyncResult *result, - GError **error) +dell_custom_init_finish (MMPortProbe *probe, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -novatel_custom_init_ready (MMPortProbe *probe, - GAsyncResult *res, - CustomInitContext *ctx) +novatel_custom_init_ready (MMPortProbe *probe, + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!mm_common_novatel_custom_init_finish (probe, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -sierra_custom_init_ready (MMPortProbe *probe, - GAsyncResult *res, - CustomInitContext *ctx) +sierra_custom_init_ready (MMPortProbe *probe, + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!mm_common_sierra_custom_init_finish (probe, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -telit_custom_init_ready (MMPortProbe *probe, - GAsyncResult *res, - CustomInitContext *ctx) +telit_custom_init_ready (MMPortProbe *probe, + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!telit_custom_init_finish (probe, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } -static void custom_init_step (CustomInitContext *ctx); +static void custom_init_step (GTask *task); static void -custom_init_step_next_command (CustomInitContext *ctx) +custom_init_step_next_command (GTask *task) { + CustomInitContext *ctx; + + ctx = g_task_get_task_data (task); + + ctx->timeouts = 0; if (ctx->gmi_retries > 0) ctx->gmi_retries = 0; else if (ctx->cgmi_retries > 0) ctx->cgmi_retries = 0; else if (ctx->ati_retries > 0) ctx->ati_retries = 0; - custom_init_step (ctx); + custom_init_step (task); } static void response_ready (MMPortSerialAt *port, - GAsyncResult *res, - CustomInitContext *ctx) + GAsyncResult *res, + GTask *task) { - const gchar *response; - GError *error = NULL; - gchar *lower; - DellManufacturer manufacturer; + CustomInitContext *ctx; + MMPortProbe *probe; + const gchar *response; + GError *error = NULL; + gchar *lower; + DellManufacturer manufacturer; + + probe = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); response = mm_port_serial_at_command_finish (port, res, &error); if (error) { @@ -165,11 +172,12 @@ if (!g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { mm_dbg ("(Dell) Error probing AT port: %s", error->message); g_error_free (error); - custom_init_step_next_command (ctx); + custom_init_step_next_command (task); return; } /* Directly retry same command on timeout */ - custom_init_step (ctx); + ctx->timeouts++; + custom_init_step (task); g_error_free (error); return; } @@ -190,85 +198,94 @@ /* Tag based on manufacturer */ if (manufacturer != DELL_MANUFACTURER_UNKNOWN) { - g_object_set_data (G_OBJECT (ctx->probe), TAG_DELL_MANUFACTURER, GUINT_TO_POINTER (manufacturer)); + g_object_set_data (G_OBJECT (probe), TAG_DELL_MANUFACTURER, GUINT_TO_POINTER (manufacturer)); /* Run additional custom init, if needed */ if (manufacturer == DELL_MANUFACTURER_NOVATEL) { - mm_common_novatel_custom_init (ctx->probe, + mm_common_novatel_custom_init (probe, ctx->port, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) novatel_custom_init_ready, - ctx); + task); return; } if (manufacturer == DELL_MANUFACTURER_SIERRA) { - mm_common_sierra_custom_init (ctx->probe, + mm_common_sierra_custom_init (probe, ctx->port, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) sierra_custom_init_ready, - ctx); + task); return; } if (manufacturer == DELL_MANUFACTURER_TELIT) { - telit_custom_init (ctx->probe, + telit_custom_init (probe, ctx->port, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) telit_custom_init_ready, - ctx); + task); return; } /* Finish custom_init */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* If we got a response, but we didn't get an expected string, try with next command */ - custom_init_step_next_command (ctx); + custom_init_step_next_command (task); } static void -custom_init_step (CustomInitContext *ctx) +custom_init_step (GTask *task) { - /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + CustomInitContext *ctx; + MMPortProbe *probe; + + probe = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + /* If cancelled, end without error right away */ + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { mm_dbg ("(Dell) no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } #if defined WITH_QMI /* If device has a QMI port, don't run anything else, as we don't care */ - if (mm_port_probe_list_has_qmi_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (ctx->probe)))) { + if (mm_port_probe_list_has_qmi_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (probe)))) { mm_dbg ("(Dell) no need to run custom init in (%s): device has QMI port", mm_port_get_device (MM_PORT (ctx->port))); - mm_port_probe_set_result_at (ctx->probe, FALSE); - mm_port_probe_set_result_qcdm (ctx->probe, FALSE); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } #endif #if defined WITH_MBIM /* If device has a MBIM port, don't run anything else, as we don't care */ - if (mm_port_probe_list_has_mbim_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (ctx->probe)))) { + if (mm_port_probe_list_has_mbim_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (probe)))) { mm_dbg ("(Dell) no need to run custom init in (%s): device has MBIM port", mm_port_get_device (MM_PORT (ctx->port))); - mm_port_probe_set_result_at (ctx->probe, FALSE); - mm_port_probe_set_result_qcdm (ctx->probe, FALSE); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } #endif + if (ctx->timeouts >= MAX_PORT_PROBE_TIMEOUTS) { + mm_dbg ("(Dell) couldn't detect real manufacturer in (%s): too many timeouts", + mm_port_get_device (MM_PORT (ctx->port))); + mm_port_probe_set_result_at (probe, FALSE); + goto out; + } + if (ctx->gmi_retries > 0) { ctx->gmi_retries--; mm_port_serial_at_command (ctx->port, @@ -276,9 +293,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)response_ready, - ctx); + task); return; } @@ -289,9 +306,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)response_ready, - ctx); + task); return; } @@ -303,51 +320,41 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)response_ready, - ctx); + task); return; } - /* Finish custom_init */ - mm_dbg ("(Dell) couldn't flip secondary port to AT in (%s): all retries consumed", + mm_dbg ("(Dell) couldn't detect real manufacturer in (%s): all retries consumed", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); +out: + /* Finish custom_init */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -dell_custom_init (MMPortProbe *probe, - MMPortSerialAt *port, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +dell_custom_init (MMPortProbe *probe, + MMPortSerialAt *port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; CustomInitContext *ctx; - GUdevDevice *udevDevice; - - udevDevice = mm_port_probe_peek_port (probe); ctx = g_slice_new0 (CustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - dell_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->gmi_retries = 3; - ctx->cgmi_retries = 3; - ctx->ati_retries = 3; + ctx->cgmi_retries = 1; + ctx->ati_retries = 1; - /* Dell-branded Telit modems always answer to +GMI - * Avoid +CGMI and ATI sending for minimizing port probing time */ - if (g_udev_device_get_property_as_boolean (udevDevice, "ID_MM_TELIT_PORTS_TAGGED")) { - ctx->cgmi_retries = 0; - ctx->ati_retries = 0; - } + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_check_cancellable (task, FALSE); + g_task_set_task_data (task, ctx, (GDestroyNotify) custom_init_context_free); - custom_init_step (ctx); + custom_init_step (task); } /*****************************************************************************/ @@ -367,7 +374,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -381,7 +388,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Dell-branded modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -391,8 +398,27 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { + /* Specific implementation for the DW5821e */ + if (vendor == 0x413c && product == 0x81d7) { + mm_dbg ("MBIM-powered DW5821e modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_dell_dw5821e_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } + + if (mm_port_probe_list_is_xmm (probes)) { + mm_dbg ("MBIM-powered XMM-based modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_mbim_xmm_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } + mm_dbg ("MBIM-powered Dell-branded modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -402,7 +428,7 @@ if (port_probe_list_has_manufacturer_port (probes, DELL_MANUFACTURER_NOVATEL)) { mm_dbg ("Novatel-powered Dell-branded modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_novatel_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -411,7 +437,7 @@ if (port_probe_list_has_manufacturer_port (probes, DELL_MANUFACTURER_SIERRA)) { mm_dbg ("Sierra-powered Dell-branded modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_sierra_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_sierra_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -420,15 +446,24 @@ if (port_probe_list_has_manufacturer_port (probes, DELL_MANUFACTURER_TELIT)) { mm_dbg ("Telit-powered Dell-branded modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_telit_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_telit_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } + if (mm_port_probe_list_is_xmm (probes)) { + mm_dbg ("XMM-based modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_xmm_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } + mm_dbg ("Dell-branded generic modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -438,10 +473,10 @@ /*****************************************************************************/ static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) +grab_port (MMPlugin *self, + MMBaseModem *modem, + MMPortProbe *probe, + GError **error) { if (MM_IS_BROADBAND_MODEM_SIERRA (modem)) return mm_common_sierra_grab_port (self, modem, probe, error); @@ -450,9 +485,7 @@ return telit_grab_port (self, modem, probe, error); return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), mm_port_probe_get_port_type (probe), MM_PORT_SERIAL_AT_FLAG_NONE, error); @@ -472,14 +505,15 @@ return MM_PLUGIN ( g_object_new (MM_TYPE_PLUGIN_DELL, - MM_PLUGIN_NAME, "Dell", - MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, - MM_PLUGIN_ALLOWED_VENDOR_IDS, vendors, - MM_PLUGIN_ALLOWED_AT, TRUE, - MM_PLUGIN_CUSTOM_INIT, &custom_init, - MM_PLUGIN_ALLOWED_QCDM, TRUE, - MM_PLUGIN_ALLOWED_QMI, TRUE, - MM_PLUGIN_ALLOWED_MBIM, TRUE, + MM_PLUGIN_NAME, "Dell", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendors, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_CUSTOM_INIT, &custom_init, + MM_PLUGIN_ALLOWED_QCDM, TRUE, + MM_PLUGIN_ALLOWED_QMI, TRUE, + MM_PLUGIN_ALLOWED_MBIM, TRUE, + MM_PLUGIN_XMM_PROBE, TRUE, NULL)); } diff -Nru modemmanager-1.6.8/plugins/fibocom/77-mm-fibocom-port-types.rules modemmanager-1.10.0/plugins/fibocom/77-mm-fibocom-port-types.rules --- modemmanager-1.6.8/plugins/fibocom/77-mm-fibocom-port-types.rules 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/fibocom/77-mm-fibocom-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,16 @@ +# do not edit this file, it will be overwritten on update +ACTION!="add|change|move|bind", GOTO="mm_fibocom_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2cb7", GOTO="mm_fibocom_port_types" +GOTO="mm_fibocom_port_types_end" + +LABEL="mm_fibocom_port_types" + +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" + +# Fibocom L850-GL +# ttyACM0 (if #2): AT port +# ttyACM1 (if #4): debug port (ignore) +# ttyACM2 (if #6): AT port +ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1" + +LABEL="mm_fibocom_port_types_end" diff -Nru modemmanager-1.6.8/plugins/fibocom/mm-plugin-fibocom.c modemmanager-1.10.0/plugins/fibocom/mm-plugin-fibocom.c --- modemmanager-1.6.8/plugins/fibocom/mm-plugin-fibocom.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/fibocom/mm-plugin-fibocom.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,116 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-plugin-fibocom.h" +#include "mm-broadband-modem.h" +#include "mm-broadband-modem-xmm.h" + +#if defined WITH_MBIM +#include "mm-broadband-modem-mbim.h" +#include "mm-broadband-modem-mbim-xmm.h" +#endif + +G_DEFINE_TYPE (MMPluginFibocom, mm_plugin_fibocom, MM_TYPE_PLUGIN) + +MM_PLUGIN_DEFINE_MAJOR_VERSION +MM_PLUGIN_DEFINE_MINOR_VERSION + +/*****************************************************************************/ + +static MMBaseModem * +create_modem (MMPlugin *self, + const gchar *uid, + const gchar **drivers, + guint16 vendor, + guint16 product, + GList *probes, + GError **error) +{ +#if defined WITH_MBIM + if (mm_port_probe_list_has_mbim_port (probes)) { + if (mm_port_probe_list_is_xmm (probes)) { + mm_dbg ("MBIM-powered XMM-based Fibocom modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_mbim_xmm_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } + mm_dbg ("MBIM-powered Fibocom modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } +#endif + + if (mm_port_probe_list_is_xmm (probes)) { + mm_dbg ("XMM-based Fibocom modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_xmm_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } + + mm_dbg ("Fibocom modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); +} + +/*****************************************************************************/ + +G_MODULE_EXPORT MMPlugin * +mm_plugin_create (void) +{ + static const gchar *subsystems[] = { "tty", "net", "usb", NULL }; + static const guint16 vendor_ids[] = { 0x2cb7, 0 }; + static const gchar *drivers[] = { "cdc_mbim", NULL }; + + return MM_PLUGIN ( + g_object_new (MM_TYPE_PLUGIN_FIBOCOM, + MM_PLUGIN_NAME, "Fibocom", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, + MM_PLUGIN_ALLOWED_DRIVERS, drivers, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_ALLOWED_MBIM, TRUE, + MM_PLUGIN_XMM_PROBE, TRUE, + NULL)); +} + +static void +mm_plugin_fibocom_init (MMPluginFibocom *self) +{ +} + +static void +mm_plugin_fibocom_class_init (MMPluginFibocomClass *klass) +{ + MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); + + plugin_class->create_modem = create_modem; +} diff -Nru modemmanager-1.6.8/plugins/fibocom/mm-plugin-fibocom.h modemmanager-1.10.0/plugins/fibocom/mm-plugin-fibocom.h --- modemmanager-1.6.8/plugins/fibocom/mm-plugin-fibocom.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/fibocom/mm-plugin-fibocom.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_PLUGIN_FIBOCOM_H +#define MM_PLUGIN_FIBOCOM_H + +#include "mm-plugin.h" + +#define MM_TYPE_PLUGIN_FIBOCOM (mm_plugin_fibocom_get_type ()) +#define MM_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocom)) +#define MM_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) +#define MM_IS_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_FIBOCOM)) +#define MM_IS_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_FIBOCOM)) +#define MM_PLUGIN_FIBOCOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) + +typedef struct { + MMPlugin parent; +} MMPluginFibocom; + +typedef struct { + MMPluginClass parent; +} MMPluginFibocomClass; + +GType mm_plugin_fibocom_get_type (void); + +G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); + +#endif /* MM_PLUGIN_FIBOCOM_H */ diff -Nru modemmanager-1.6.8/plugins/generic/mm-plugin-generic.c modemmanager-1.10.0/plugins/generic/mm-plugin-generic.c --- modemmanager-1.6.8/plugins/generic/mm-plugin-generic.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/generic/mm-plugin-generic.c 2018-11-15 09:55:53.000000000 +0100 @@ -50,7 +50,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -60,7 +60,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered generic modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -71,7 +71,7 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { mm_dbg ("MBIM-powered generic modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -79,7 +79,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/generic/tests/test-service-generic.c modemmanager-1.10.0/plugins/generic/tests/test-service-generic.c --- modemmanager-1.6.8/plugins/generic/tests/test-service-generic.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/generic/tests/test-service-generic.c 2018-11-15 09:55:53.000000000 +0100 @@ -82,7 +82,6 @@ int main (int argc, char *argv[]) { - g_type_init (); g_test_init (&argc, &argv, NULL); TEST_ADD ("/MM/Service/Generic/enable-disable", test_enable_disable); diff -Nru modemmanager-1.6.8/plugins/haier/77-mm-haier-port-types.rules modemmanager-1.10.0/plugins/haier/77-mm-haier-port-types.rules --- modemmanager-1.6.8/plugins/haier/77-mm-haier-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/haier/77-mm-haier-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,15 +1,13 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_haier_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_haier_port_types_end" - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="201e", GOTO="mm_haier_port_types_vendorcheck" +ACTION!="add|change|move|bind", GOTO="mm_haier_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="201e", GOTO="mm_haier_port_types" GOTO="mm_haier_port_types_end" -LABEL="mm_haier_port_types_vendorcheck" +LABEL="mm_haier_port_types" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # Haier CE81B -ATTRS{idVendor}=="201e", ATTRS{idProduct}=="10f8", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_HAIER_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="201e", ATTRS{idProduct}=="10f8", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" LABEL="mm_haier_port_types_end" diff -Nru modemmanager-1.6.8/plugins/haier/mm-plugin-haier.c modemmanager-1.10.0/plugins/haier/mm-plugin-haier.c --- modemmanager-1.6.8/plugins/haier/mm-plugin-haier.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/haier/mm-plugin-haier.c 2019-01-15 15:57:35.000000000 +0100 @@ -32,48 +32,20 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - - /* Look for port type hints */ - if (mm_port_probe_is_at (probe) && g_udev_device_get_property_as_boolean (port, "ID_MM_HAIER_PORT_TYPE_MODEM")) { - mm_dbg ("HAIER: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = (MM_PORT_SERIAL_AT_FLAG_PRIMARY | MM_PORT_SERIAL_AT_FLAG_PPP); - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - mm_port_probe_get_port_type (probe), - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -101,5 +73,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/huawei/77-mm-huawei-net-port-types.rules modemmanager-1.10.0/plugins/huawei/77-mm-huawei-net-port-types.rules --- modemmanager-1.6.8/plugins/huawei/77-mm-huawei-net-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/77-mm-huawei-net-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,21 +1,23 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_huawei_port_types_end" +ACTION!="add|change|move|bind", GOTO="mm_huawei_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", GOTO="mm_huawei_port_types" +GOTO="mm_huawei_port_types_end" -ENV{ID_VENDOR_ID}!="12d1", GOTO="mm_huawei_port_types_end" +LABEL="mm_huawei_port_types" # MU609 does not support getportmode (crashes modem with default firmware) -ATTRS{idProduct}=="1573", ENV{ID_MM_HUAWEI_DISABLE_GETPORTMODE}="1" +ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1573", ENV{ID_MM_HUAWEI_DISABLE_GETPORTMODE}="1" # Mark the modem and at port flags for ModemManager -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1" -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_PORT_TYPE_AT_PPP}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_PORT_TYPE_AT_PPP}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" # GPS NMEA port on MU609 -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_HUAWEI_GPS_PORT}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_PORT_TYPE_GPS}="1" # GPS NMEA port on MU909 -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="14", ENV{ID_MM_HUAWEI_GPS_PORT}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="14", ENV{ID_MM_PORT_TYPE_GPS}="1" # Only the standard ECM or NCM port can support dial-up with AT NDISDUP through AT port SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02", ATTRS{bInterfaceSubClass}=="06",ATTRS{bInterfaceProtocol}=="00", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1" diff -Nru modemmanager-1.6.8/plugins/huawei/mm-broadband-bearer-huawei.c modemmanager-1.10.0/plugins/huawei/mm-broadband-bearer-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-broadband-bearer-huawei.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-broadband-bearer-huawei.c 2018-11-15 09:55:53.000000000 +0100 @@ -72,12 +72,9 @@ } Connect3gppContextStep; typedef struct { - MMBroadbandBearerHuawei *self; MMBaseModem *modem; MMPortSerialAt *primary; MMPort *data; - GCancellable *cancellable; - GSimpleAsyncResult *result; Connect3gppContextStep step; guint check_count; guint failed_ndisstatqry_count; @@ -85,14 +82,9 @@ } Connect3gppContext; static void -connect_3gpp_context_complete_and_free (Connect3gppContext *ctx) +connect_3gpp_context_free (Connect3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_clear_object (&ctx->ipv4_config); g_clear_object (&ctx->data); @@ -106,33 +98,29 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } -static void connect_3gpp_context_step (Connect3gppContext *ctx); +static void connect_3gpp_context_step (GTask *task); static void connect_dhcp_check_ready (MMBaseModem *modem, GAsyncResult *res, MMBroadbandBearerHuawei *self) { + GTask *task; Connect3gppContext *ctx; const gchar *response; GError *error = NULL; - ctx = self->priv->connect_pending; - g_assert (ctx != NULL); + task = self->priv->connect_pending; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); /* Balance refcount */ g_object_unref (self); - /* Default to automatic/DHCP addressing */ - ctx->ipv4_config = mm_bearer_ip_config_new (); - mm_bearer_ip_config_set_method (ctx->ipv4_config, MM_BEARER_IP_METHOD_DHCP); - /* Cache IPv4 details if available, otherwise clients will have to use DHCP */ response = mm_base_modem_at_command_full_finish (modem, res, &error); if (response) { @@ -193,23 +181,23 @@ g_clear_error (&error); ctx->step++; - connect_3gpp_context_step (ctx); + connect_3gpp_context_step (task); } static gboolean connect_retry_ndisstatqry_check_cb (MMBroadbandBearerHuawei *self) { - Connect3gppContext *ctx; + GTask *task; /* Recover context */ - ctx = self->priv->connect_pending; - g_assert (ctx != NULL); + task = self->priv->connect_pending; + g_assert (task != NULL); /* Balance refcount */ g_object_unref (self); /* Retry same step */ - connect_3gpp_context_step (ctx); + connect_3gpp_context_step (task); return G_SOURCE_REMOVE; } @@ -219,6 +207,7 @@ GAsyncResult *res, MMBroadbandBearerHuawei *self) { + GTask *task; Connect3gppContext *ctx; const gchar *response; GError *error = NULL; @@ -227,8 +216,10 @@ gboolean ipv6_available = FALSE; gboolean ipv6_connected = FALSE; - ctx = self->priv->connect_pending; - g_assert (ctx != NULL); + task = self->priv->connect_pending; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); /* Balance refcount */ g_object_unref (self); @@ -251,7 +242,7 @@ if (ipv4_available && ipv4_connected) { /* Success! */ ctx->step++; - connect_3gpp_context_step (ctx); + connect_3gpp_context_step (task); return; } @@ -266,26 +257,29 @@ GAsyncResult *res, MMBroadbandBearerHuawei *self) { + GTask *task; Connect3gppContext *ctx; GError *error = NULL; - ctx = self->priv->connect_pending; - g_assert (ctx != NULL); + task = self->priv->connect_pending; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); /* Balance refcount */ g_object_unref (self); if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - /* Clear context */ + /* Clear task */ self->priv->connect_pending = NULL; - g_simple_async_result_take_error (ctx->result, error); - connect_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go to next step */ ctx->step++; - connect_3gpp_context_step (ctx); + connect_3gpp_context_step (task); } typedef enum { @@ -314,12 +308,18 @@ } static void -connect_3gpp_context_step (Connect3gppContext *ctx) +connect_3gpp_context_step (GTask *task) { + MMBroadbandBearerHuawei *self; + Connect3gppContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Check for cancellation */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - /* Clear context */ - ctx->self->priv->connect_pending = NULL; + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { + /* Clear task */ + self->priv->connect_pending = NULL; /* If we already sent the connetion command, send the disconnection one */ if (ctx->step > CONNECT_3GPP_CONTEXT_STEP_NDISDUP) @@ -333,29 +333,29 @@ NULL, /* Do not care the AT response */ NULL); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Huawei connection operation has been cancelled"); - connect_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_CANCELLED, + "Huawei connection operation has been cancelled"); + g_object_unref (task); return; } /* Network-initiated disconnect should not be outstanding at this point, * because it interferes with the connect attempt. */ - g_assert (ctx->self->priv->network_disconnect_pending_id == 0); + g_assert (self->priv->network_disconnect_pending_id == 0); switch (ctx->step) { case CONNECT_3GPP_CONTEXT_STEP_FIRST: { MMBearerIpFamily ip_family; - ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); if (ip_family == MM_BEARER_IP_FAMILY_NONE || ip_family == MM_BEARER_IP_FAMILY_ANY) { gchar *ip_family_str; - ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (ctx->self)); + ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (self)); ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family); mm_dbg ("No specific IP family requested, defaulting to %s", ip_family_str); @@ -363,16 +363,16 @@ } if (ip_family != MM_BEARER_IP_FAMILY_IPV4) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Only IPv4 is supported by this modem"); - connect_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Only IPv4 is supported by this modem"); + g_object_unref (task); return; } - /* Store the context */ - ctx->self->priv->connect_pending = ctx; + /* Store the task */ + self->priv->connect_pending = task; ctx->step++; /* Fall down to the next step */ @@ -386,14 +386,14 @@ gint encoded_auth = MM_BEARER_HUAWEI_AUTH_UNKNOWN; gchar *command; - apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - passwd = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + passwd = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); encoded_auth = huawei_parse_auth_type (auth); /* Default to no authentication if not specified */ - if ((encoded_auth = huawei_parse_auth_type (auth)) == MM_BEARER_HUAWEI_AUTH_UNKNOWN) + if (encoded_auth == MM_BEARER_HUAWEI_AUTH_UNKNOWN) encoded_auth = MM_BEARER_HUAWEI_AUTH_NONE; if (!user && !passwd) @@ -419,7 +419,7 @@ FALSE, NULL, (GAsyncReadyCallback)connect_ndisdup_ready, - g_object_ref (ctx->self)); + g_object_ref (self)); g_free (command); return; } @@ -431,24 +431,24 @@ */ if (ctx->check_count > 60) { /* Clear context */ - ctx->self->priv->connect_pending = NULL; - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Connection attempt timed out"); - connect_3gpp_context_complete_and_free (ctx); + self->priv->connect_pending = NULL; + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Connection attempt timed out"); + g_object_unref (task); return; } /* Give up if too many unexpected responses to NIDSSTATQRY are encountered. */ if (ctx->failed_ndisstatqry_count > 10) { /* Clear context */ - ctx->self->priv->connect_pending = NULL; - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, - "Connection attempt not supported."); - connect_3gpp_context_complete_and_free (ctx); + self->priv->connect_pending = NULL; + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, + "Connection attempt not supported."); + g_object_unref (task); return; } @@ -462,7 +462,7 @@ FALSE, NULL, (GAsyncReadyCallback)connect_ndisstatqry_check_ready, - g_object_ref (ctx->self)); + g_object_ref (self)); return; case CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG: @@ -474,30 +474,26 @@ FALSE, NULL, (GAsyncReadyCallback)connect_dhcp_check_ready, - g_object_ref (ctx->self)); + g_object_ref (self)); return; case CONNECT_3GPP_CONTEXT_STEP_LAST: /* Clear context */ - ctx->self->priv->connect_pending = NULL; + self->priv->connect_pending = NULL; /* Setup result */ - { - if (ctx->ipv4_config) { - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - mm_bearer_connect_result_new (ctx->data, ctx->ipv4_config, NULL), - (GDestroyNotify)mm_bearer_connect_result_unref); - } - } + g_task_return_pointer ( + task, + mm_bearer_connect_result_new (ctx->data, ctx->ipv4_config, NULL), + (GDestroyNotify)mm_bearer_connect_result_unref); - connect_3gpp_context_complete_and_free (ctx); + g_object_unref (task); return; } } static void -connect_3gpp (MMBroadbandBearer *self, +connect_3gpp (MMBroadbandBearer *_self, MMBroadbandModem *modem, MMPortSerialAt *primary, MMPortSerialAt *secondary, @@ -505,7 +501,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - Connect3gppContext *ctx; + MMBroadbandBearerHuawei *self = MM_BROADBAND_BEARER_HUAWEI (_self); + Connect3gppContext *ctx; + GTask *task; MMPort *data; g_assert (primary != NULL); @@ -513,35 +511,39 @@ /* We need a net data port */ data = mm_base_modem_peek_best_data_port (MM_BASE_MODEM (modem), MM_PORT_TYPE_NET); if (!data) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No valid data port found to launch connection"); + g_task_report_new_error (self, + callback, + user_data, + connect_3gpp, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); return; } /* Setup connection context */ ctx = g_slice_new0 (Connect3gppContext); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (modem); ctx->data = g_object_ref (data); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - connect_3gpp); - ctx->cancellable = g_object_ref (cancellable); ctx->step = CONNECT_3GPP_CONTEXT_STEP_FIRST; - g_assert (ctx->self->priv->connect_pending == NULL); - g_assert (ctx->self->priv->disconnect_pending == NULL); + g_assert (self->priv->connect_pending == NULL); + g_assert (self->priv->disconnect_pending == NULL); /* Get correct dial port to use */ ctx->primary = get_dial_port (MM_BROADBAND_MODEM_HUAWEI (ctx->modem), ctx->data, primary); + + /* Default to automatic/DHCP addressing */ + ctx->ipv4_config = mm_bearer_ip_config_new (); + mm_bearer_ip_config_set_method (ctx->ipv4_config, MM_BEARER_IP_METHOD_DHCP); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)connect_3gpp_context_free); + g_task_set_check_cancellable (task, FALSE); + /* Run! */ - connect_3gpp_context_step (ctx); + connect_3gpp_context_step (task); } /*****************************************************************************/ @@ -555,22 +557,17 @@ } Disconnect3gppContextStep; typedef struct { - MMBroadbandBearerHuawei *self; MMBaseModem *modem; MMPortSerialAt *primary; - GSimpleAsyncResult *result; Disconnect3gppContextStep step; guint check_count; guint failed_ndisstatqry_count; } Disconnect3gppContext; static void -disconnect_3gpp_context_complete_and_free (Disconnect3gppContext *ctx) +disconnect_3gpp_context_free (Disconnect3gppContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); - g_object_unref (ctx->self); g_object_unref (ctx->modem); g_slice_free (Disconnect3gppContext, ctx); } @@ -580,25 +577,25 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void disconnect_3gpp_context_step (Disconnect3gppContext *ctx); +static void disconnect_3gpp_context_step (GTask *task); static gboolean disconnect_retry_ndisstatqry_check_cb (MMBroadbandBearerHuawei *self) { - Disconnect3gppContext *ctx; + GTask *task; /* Recover context */ - ctx = self->priv->disconnect_pending; - g_assert (ctx != NULL); + task = self->priv->disconnect_pending; + g_assert (task != NULL); /* Balance refcount */ g_object_unref (self); /* Retry same step */ - disconnect_3gpp_context_step (ctx); + disconnect_3gpp_context_step (task); return G_SOURCE_REMOVE; } @@ -607,6 +604,7 @@ GAsyncResult *res, MMBroadbandBearerHuawei *self) { + GTask *task; Disconnect3gppContext *ctx; const gchar *response; GError *error = NULL; @@ -615,8 +613,10 @@ gboolean ipv6_available = FALSE; gboolean ipv6_connected = FALSE; - ctx = self->priv->disconnect_pending; - g_assert (ctx != NULL); + task = self->priv->disconnect_pending; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); /* Balance refcount */ g_object_unref (self); @@ -639,7 +639,7 @@ if (ipv4_available && !ipv4_connected) { /* Success! */ ctx->step++; - disconnect_3gpp_context_step (ctx); + disconnect_3gpp_context_step (task); return; } @@ -654,42 +654,51 @@ GAsyncResult *res, MMBroadbandBearerHuawei *self) { + GTask *task; Disconnect3gppContext *ctx; GError *error = NULL; - ctx = self->priv->disconnect_pending; - g_assert (ctx != NULL); + task = self->priv->disconnect_pending; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); /* Balance refcount */ g_object_unref (self); if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - /* Clear context */ + /* Clear task */ self->priv->disconnect_pending = NULL; - g_simple_async_result_take_error (ctx->result, error); - disconnect_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go to next step */ ctx->step++; - disconnect_3gpp_context_step (ctx); + disconnect_3gpp_context_step (task); } static void -disconnect_3gpp_context_step (Disconnect3gppContext *ctx) +disconnect_3gpp_context_step (GTask *task) { + MMBroadbandBearerHuawei *self; + Disconnect3gppContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISCONNECT_3GPP_CONTEXT_STEP_FIRST: - /* Store the context */ - ctx->self->priv->disconnect_pending = ctx; + /* Store the task */ + self->priv->disconnect_pending = task; /* We ignore any pending network-initiated disconnection in order to prevent it * from interfering with the client-initiated disconnection, as we would like to * proceed with the latter anyway. */ - if (ctx->self->priv->network_disconnect_pending_id != 0) { - g_source_remove (ctx->self->priv->network_disconnect_pending_id); - ctx->self->priv->network_disconnect_pending_id = 0; + if (self->priv->network_disconnect_pending_id != 0) { + g_source_remove (self->priv->network_disconnect_pending_id); + self->priv->network_disconnect_pending_id = 0; } ctx->step++; @@ -704,31 +713,31 @@ FALSE, NULL, (GAsyncReadyCallback)disconnect_ndisdup_ready, - g_object_ref (ctx->self)); + g_object_ref (self)); return; case DISCONNECT_3GPP_CONTEXT_STEP_NDISSTATQRY: /* If too many retries (1s of wait between the retries), failed */ if (ctx->check_count > 60) { - /* Clear context */ - ctx->self->priv->disconnect_pending = NULL; - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Disconnection attempt timed out"); - disconnect_3gpp_context_complete_and_free (ctx); + /* Clear task */ + self->priv->disconnect_pending = NULL; + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Disconnection attempt timed out"); + g_object_unref (task); return; } /* Give up if too many unexpected responses to NIDSSTATQRY are encountered. */ if (ctx->failed_ndisstatqry_count > 10) { - /* Clear context */ - ctx->self->priv->disconnect_pending = NULL; - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, - "Disconnection attempt not supported."); - disconnect_3gpp_context_complete_and_free (ctx); + /* Clear task */ + self->priv->disconnect_pending = NULL; + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, + "Disconnection attempt not supported."); + g_object_unref (task); return; } @@ -742,21 +751,21 @@ FALSE, NULL, (GAsyncReadyCallback)disconnect_ndisstatqry_check_ready, - g_object_ref (ctx->self)); + g_object_ref (self)); return; case DISCONNECT_3GPP_CONTEXT_STEP_LAST: - /* Clear context */ - ctx->self->priv->disconnect_pending = NULL; + /* Clear task */ + self->priv->disconnect_pending = NULL; /* Set data port as result */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_3gpp_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } } static void -disconnect_3gpp (MMBroadbandBearer *self, +disconnect_3gpp (MMBroadbandBearer *_self, MMBroadbandModem *modem, MMPortSerialAt *primary, MMPortSerialAt *secondary, @@ -765,27 +774,27 @@ GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandBearerHuawei *self = MM_BROADBAND_BEARER_HUAWEI (_self); Disconnect3gppContext *ctx; + GTask *task; g_assert (primary != NULL); ctx = g_slice_new0 (Disconnect3gppContext); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect_3gpp); ctx->step = DISCONNECT_3GPP_CONTEXT_STEP_FIRST; - g_assert (ctx->self->priv->connect_pending == NULL); - g_assert (ctx->self->priv->disconnect_pending == NULL); + g_assert (self->priv->connect_pending == NULL); + g_assert (self->priv->disconnect_pending == NULL); /* Get correct dial port to use */ ctx->primary = get_dial_port (MM_BROADBAND_MODEM_HUAWEI (ctx->modem), data, primary); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disconnect_3gpp_context_free); + /* Start! */ - disconnect_3gpp_context_step (ctx); + disconnect_3gpp_context_step (task); } /*****************************************************************************/ @@ -921,7 +930,11 @@ g_type_class_add_private (object_class, sizeof (MMBroadbandBearerHuaweiPrivate)); object_class->dispose = dispose; + base_bearer_class->report_connection_status = report_connection_status; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; + broadband_bearer_class->connect_3gpp = connect_3gpp; broadband_bearer_class->connect_3gpp_finish = connect_3gpp_finish; broadband_bearer_class->disconnect_3gpp = disconnect_3gpp; diff -Nru modemmanager-1.6.8/plugins/huawei/mm-broadband-modem-huawei.c modemmanager-1.10.0/plugins/huawei/mm-broadband-modem-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-broadband-modem-huawei.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-broadband-modem-huawei.c 2019-01-15 15:57:35.000000000 +0100 @@ -26,7 +26,6 @@ #include #include #include -#include #include #define _LIBMM_INSIDE_MM @@ -104,14 +103,6 @@ GRegex *dsflowrpt_regex; GRegex *ndisstat_regex; - /* Regex for voice call related notifications */ - GRegex *orig_regex; - GRegex *conf_regex; - GRegex *conn_regex; - GRegex *cend_regex; - GRegex *ddtmf_regex; - GRegex *cschannelinfo_regex; - /* Regex to ignore */ GRegex *boot_regex; GRegex *connect_regex; @@ -130,6 +121,9 @@ GRegex *posend_regex; GRegex *ecclist_regex; GRegex *ltersrp_regex; + GRegex *cschannelinfo_regex; + GRegex *eons_regex; + GRegex *orig_regex; FeatureSupport ndisdup_support; FeatureSupport rfswitch_support; @@ -139,6 +133,7 @@ FeatureSupport prefmode_support; FeatureSupport time_support; FeatureSupport nwtime_support; + FeatureSupport cvoice_support; MMModemLocationSource enabled_sources; @@ -147,12 +142,16 @@ GArray *prefmode_supported_modes; DetailedSignal detailed_signal; + + /* Voice call audio related properties */ + guint audio_hz; + guint audio_bits; }; /*****************************************************************************/ -static GList * -get_at_port_list (MMBroadbandModemHuawei *self) +GList * +mm_broadband_modem_huawei_get_at_port_list (MMBroadbandModemHuawei *self) { GList *out = NULL; MMPortSerialAt *port; @@ -205,11 +204,10 @@ { SysinfoResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = (SysinfoResult *) g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - if (extended) *extended = result->extended; if (srv_status) @@ -227,13 +225,14 @@ if (sys_submode) *sys_submode = result->sys_submode; + g_free (result); return TRUE; } static void run_sysinfo_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response; @@ -242,9 +241,8 @@ response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { mm_dbg ("^SYSINFO failed: %s", error->message); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -260,34 +258,32 @@ &result->sys_submode, &error)) { mm_dbg ("^SYSINFO parsing failed: %s", error->message); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); g_free (result); return; } - g_simple_async_result_set_op_res_gpointer (simple, result, g_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, result, g_free); + g_object_unref (task); } static void run_sysinfo (MMBroadbandModemHuawei *self, - GSimpleAsyncResult *result) + GTask *task) { mm_base_modem_at_command (MM_BASE_MODEM (self), "^SYSINFO", 3, FALSE, (GAsyncReadyCallback)run_sysinfo_ready, - result); + task); } static void run_sysinfoex_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); GError *error = NULL; @@ -301,15 +297,14 @@ self->priv->sysinfoex_support = FEATURE_NOT_SUPPORTED; mm_dbg ("^SYSINFOEX failed: %s, assuming unsupported", error->message); g_error_free (error); - run_sysinfo (self, simple); + run_sysinfo (self, task); return; } /* Otherwise, propagate error */ mm_dbg ("^SYSINFOEX failed: %s", error->message); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -327,30 +322,28 @@ &result->sys_submode, &error)) { mm_dbg ("^SYSINFOEX parsing failed: %s", error->message); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); g_free (result); return; } /* Submode from SYSINFOEX always valid */ result->sys_submode_valid = TRUE; - g_simple_async_result_set_op_res_gpointer (simple, result, g_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, result, g_free); + g_object_unref (task); } static void run_sysinfoex (MMBroadbandModemHuawei *self, - GSimpleAsyncResult *result) + GTask *task) { mm_base_modem_at_command (MM_BASE_MODEM (self), "^SYSINFOEX", 3, FALSE, (GAsyncReadyCallback)run_sysinfoex_ready, - result); + task); } static void @@ -358,17 +351,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sysinfo); if (self->priv->sysinfoex_support == FEATURE_SUPPORT_UNKNOWN || self->priv->sysinfoex_support == FEATURE_SUPPORTED) - run_sysinfoex (self, result); + run_sysinfoex (self, task); else - run_sysinfo (self, result); + run_sysinfo (self, task); } /*****************************************************************************/ @@ -719,14 +710,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -735,16 +726,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* A 3-second wait is necessary for SIM to become ready, or the firmware may * fail miserably and reboot itself */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -757,12 +745,12 @@ static BandTable bands[] = { /* Sort 3G first since it's preferred */ - { MM_MODEM_BAND_U2100, 0x00400000 }, - { MM_MODEM_BAND_U1900, 0x00800000 }, - { MM_MODEM_BAND_U850, 0x04000000 }, - { MM_MODEM_BAND_U900, 0x00020000 }, - { MM_MODEM_BAND_G850, 0x00080000 }, + { MM_MODEM_BAND_UTRAN_1, 0x00400000 }, + { MM_MODEM_BAND_UTRAN_2, 0x00800000 }, + { MM_MODEM_BAND_UTRAN_5, 0x04000000 }, + { MM_MODEM_BAND_UTRAN_8, 0x00020000 }, /* 2G second */ + { MM_MODEM_BAND_G850, 0x00080000 }, { MM_MODEM_BAND_DCS, 0x00000080 }, { MM_MODEM_BAND_EGSM, 0x00000100 }, { MM_MODEM_BAND_PCS, 0x00200000 } @@ -896,24 +884,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void syscfg_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) /* Let the error be critical */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -922,27 +909,23 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *cmd; guint32 huawei_band = 0x3FFFFFFF; gchar *bands_string; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_bands); + task = g_task_new (self, NULL, callback, user_data); bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array->data, bands_array->len); if (!bands_array_to_huawei (bands_array, &huawei_band)) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid bands requested: '%s'", - bands_string); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid bands requested: '%s'", + bands_string); + g_object_unref (task); g_free (bands_string); return; } @@ -953,7 +936,7 @@ 3, FALSE, (GAsyncReadyCallback)syscfg_set_ready, - result); + task); g_free (cmd); g_free (bands_string); } @@ -966,16 +949,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void syscfg_test_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1017,9 +997,9 @@ } self->priv->syscfg_support = FEATURE_SUPPORTED; - g_simple_async_result_set_op_res_gpointer (simple, - combinations, - (GDestroyNotify)g_array_unref); + g_task_return_pointer (task, + combinations, + (GDestroyNotify)g_array_unref); } else { mm_dbg ("Error while checking ^SYSCFG format: %s", error->message); /* If SIM-PIN error, don't mark as feature unsupported; we'll retry later */ @@ -1027,17 +1007,16 @@ MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN)) self->priv->syscfg_support = FEATURE_NOT_SUPPORTED; - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void syscfgex_test_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1069,11 +1048,10 @@ self->priv->syscfgex_support = FEATURE_SUPPORTED; - g_simple_async_result_set_op_res_gpointer (simple, - combinations, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, + combinations, + (GDestroyNotify)g_array_unref); + g_object_unref (task); return; } @@ -1083,9 +1061,8 @@ if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } g_error_free (error); @@ -1099,13 +1076,13 @@ 3, TRUE, (GAsyncReadyCallback)syscfg_test_ready, - simple); + task); } static void prefmode_test_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1136,9 +1113,9 @@ } self->priv->prefmode_support = FEATURE_SUPPORTED; - g_simple_async_result_set_op_res_gpointer (simple, - combinations, - (GDestroyNotify)g_array_unref); + g_task_return_pointer (task, + combinations, + (GDestroyNotify)g_array_unref); } else { mm_dbg ("Error while checking ^PREFMODE format: %s", error->message); /* If SIM-PIN error, don't mark as feature unsupported; we'll retry later */ @@ -1146,11 +1123,10 @@ MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN)) self->priv->prefmode_support = FEATURE_NOT_SUPPORTED; - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1159,12 +1135,9 @@ gpointer user_data) { MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes); + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_cdma_only (_self)) { /* ^PREFMODE only in CDMA-only modems */ @@ -1175,7 +1148,7 @@ 3, TRUE, (GAsyncReadyCallback)prefmode_test_ready, - result); + task); return; } @@ -1186,7 +1159,7 @@ 3, TRUE, (GAsyncReadyCallback)syscfgex_test_ready, - result); + task); } /*****************************************************************************/ @@ -1201,19 +1174,21 @@ { MMModemModeCombination *out; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + out = g_task_propagate_pointer (G_TASK (res), error); + if (!out) return FALSE; - out = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *allowed = out->allowed; *preferred = out->preferred; + + g_free (out); return TRUE; } static void prefmode_load_current_modes_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1226,22 +1201,22 @@ &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { - MMModemModeCombination out; + MMModemModeCombination *out; - out.allowed = current->allowed; - out.preferred = current->preferred; - g_simple_async_result_set_op_res_gpointer (simple, &out, NULL); + out = g_new (MMModemModeCombination, 1); + out->allowed = current->allowed; + out->preferred = current->preferred; + g_task_return_pointer (task, out, g_free); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void syscfg_load_current_modes_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1254,23 +1229,22 @@ &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { - MMModemModeCombination out; + MMModemModeCombination *out; - out.allowed = current->allowed; - out.preferred = current->preferred; - g_simple_async_result_set_op_res_gpointer (simple, &out, NULL); + out = g_new (MMModemModeCombination, 1); + out->allowed = current->allowed; + out->preferred = current->preferred; + g_task_return_pointer (task, out, g_free); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void syscfgex_load_current_modes_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1282,17 +1256,16 @@ self->priv->syscfgex_supported_modes, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { - MMModemModeCombination out; + MMModemModeCombination *out; - out.allowed = current->allowed; - out.preferred = current->preferred; - g_simple_async_result_set_op_res_gpointer (simple, &out, NULL); + out = g_new (MMModemModeCombination, 1); + out->allowed = current->allowed; + out->preferred = current->preferred; + g_task_return_pointer (task, out, g_free); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1301,14 +1274,11 @@ gpointer user_data) { MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); - GSimpleAsyncResult *result; + GTask *task; mm_dbg ("loading current modes (huawei)..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->syscfgex_support == FEATURE_SUPPORTED) { g_assert (self->priv->syscfgex_supported_modes != NULL); @@ -1318,7 +1288,7 @@ 3, FALSE, (GAsyncReadyCallback)syscfgex_load_current_modes_ready, - result); + task); return; } @@ -1330,7 +1300,7 @@ 3, FALSE, (GAsyncReadyCallback)syscfg_load_current_modes_ready, - result); + task); return; } @@ -1342,16 +1312,15 @@ 3, FALSE, (GAsyncReadyCallback)prefmode_load_current_modes_ready, - result); + task); return; } - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unable to load current modes"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unable to load current modes"); + g_object_unref (task); } /*****************************************************************************/ @@ -1362,31 +1331,30 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void set_current_modes_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static gboolean prefmode_set_current_modes (MMBroadbandModemHuawei *self, MMModemMode allowed, MMModemMode preferred, - GSimpleAsyncResult *simple, + GTask *task, GError **error) { guint i; @@ -1420,7 +1388,7 @@ 3, FALSE, (GAsyncReadyCallback)set_current_modes_ready, - simple); + task); g_free (command); return TRUE; } @@ -1429,7 +1397,7 @@ syscfg_set_current_modes (MMBroadbandModemHuawei *self, MMModemMode allowed, MMModemMode preferred, - GSimpleAsyncResult *simple, + GTask *task, GError **error) { guint i; @@ -1465,7 +1433,7 @@ 3, FALSE, (GAsyncReadyCallback)set_current_modes_ready, - simple); + task); g_free (command); return TRUE; } @@ -1474,7 +1442,7 @@ syscfgex_set_current_modes (MMBroadbandModemHuawei *self, MMModemMode allowed, MMModemMode preferred, - GSimpleAsyncResult *simple, + GTask *task, GError **error) { guint i; @@ -1509,7 +1477,7 @@ 3, FALSE, (GAsyncReadyCallback)set_current_modes_ready, - simple); + task); g_free (command); return TRUE; } @@ -1522,31 +1490,27 @@ gpointer user_data) { MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; mm_dbg ("setting current modes (huawei)..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->syscfgex_support == FEATURE_SUPPORTED) - syscfgex_set_current_modes (self, allowed, preferred, result, &error); + syscfgex_set_current_modes (self, allowed, preferred, task, &error); else if (self->priv->syscfg_support == FEATURE_SUPPORTED) - syscfg_set_current_modes (self, allowed, preferred, result, &error); + syscfg_set_current_modes (self, allowed, preferred, task, &error); else if (self->priv->prefmode_support == FEATURE_SUPPORTED) - prefmode_set_current_modes (self, allowed, preferred, result, &error); + prefmode_set_current_modes (self, allowed, preferred, task, &error); else error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Setting current modes is not supported"); if (error) { - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, error); + g_object_unref (task); } } @@ -1888,7 +1852,7 @@ { GList *ports, *l; - ports = get_at_port_list (self); + ports = mm_broadband_modem_huawei_get_at_port_list (self); /* Enable/disable unsolicited events in given port */ for (l = ports; l; l = g_list_next (l)) { @@ -1933,7 +1897,7 @@ NULL); } - g_list_free_full (ports, (GDestroyNotify)g_object_unref); + g_list_free_full (ports, g_object_unref); } static gboolean @@ -1941,26 +1905,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_3gpp_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_3gpp_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1968,33 +1930,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_3gpp_setup_unsolicited_events_ready, - result); + task); } static void parent_3gpp_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -2002,12 +1960,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own cleanup first */ set_3gpp_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE); @@ -2016,7 +1971,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_3gpp_cleanup_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -2027,23 +1982,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { @@ -2057,14 +2011,13 @@ static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); } /* Our own enable now */ @@ -2076,7 +2029,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void @@ -2084,18 +2037,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -2106,36 +2056,34 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_full_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -2143,7 +2091,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static void @@ -2151,12 +2099,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own disable first */ mm_base_modem_at_command_full ( @@ -2168,137 +2113,79 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); -} - -/*****************************************************************************/ -/* Operator Name loading (3GPP interface) */ - -static gchar * -modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - const gchar *result; - gchar *operator_name; - - result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); - if (!result) - return NULL; - - /* Despite +CSCS? may claim supporting UCS2, Huawei modems always report the - * operator name in ASCII in a +COPS response. Thus, we ignore the current - * charset claimed by the modem and assume the charset is IRA when parsing - * the operator name. - */ - operator_name = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_IRA); - if (operator_name) - mm_dbg ("loaded Operator Name: %s", operator_name); - - return operator_name; -} - -static void -modem_3gpp_load_operator_name (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - mm_dbg ("loading Operator Name (huawei)..."); - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+COPS=3,0;+COPS?", - 3, - FALSE, - callback, - user_data); + task); } /*****************************************************************************/ /* Create Bearer (Modem interface) */ -typedef struct { - MMBroadbandModemHuawei *self; - GSimpleAsyncResult *result; - MMBearerProperties *properties; -} CreateBearerContext; - -static void -create_bearer_context_complete_and_free (CreateBearerContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->properties); - g_slice_free (CreateBearerContext, ctx); -} - static MMBaseBearer * huawei_modem_create_bearer_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New huawei bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_huawei_new_ready (GObject *source, GAsyncResult *res, - CreateBearerContext *ctx) + GTask *task) { MMBaseBearer *bearer; GError *error = NULL; bearer = mm_broadband_bearer_huawei_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, bearer, (GDestroyNotify)g_object_unref); - create_bearer_context_complete_and_free (ctx); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - CreateBearerContext *ctx) + GTask *task) { MMBaseBearer *bearer; GError *error = NULL; bearer = mm_broadband_bearer_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, bearer, (GDestroyNotify)g_object_unref); - create_bearer_context_complete_and_free (ctx); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } static void -create_bearer_for_net_port (CreateBearerContext *ctx) +create_bearer_for_net_port (GTask *task) { - switch (ctx->self->priv->ndisdup_support) { + MMBroadbandModemHuawei *self; + MMBearerProperties *properties; + + self = g_task_get_source_object (task); + properties = g_task_get_task_data (task); + + switch (self->priv->ndisdup_support) { case FEATURE_SUPPORT_UNKNOWN: g_assert_not_reached (); case FEATURE_NOT_SUPPORTED: mm_dbg ("^NDISDUP not supported, creating default bearer..."); - mm_broadband_bearer_new (MM_BROADBAND_MODEM (ctx->self), - ctx->properties, + mm_broadband_bearer_new (MM_BROADBAND_MODEM (self), + properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - ctx); + task); return; case FEATURE_SUPPORTED: mm_dbg ("^NDISDUP supported, creating huawei bearer..."); - mm_broadband_bearer_huawei_new (MM_BROADBAND_MODEM_HUAWEI (ctx->self), - ctx->properties, + mm_broadband_bearer_huawei_new (MM_BROADBAND_MODEM_HUAWEI (self), + properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_huawei_new_ready, - ctx); + task); return; } } @@ -2309,9 +2196,10 @@ { GList *cdc_wdm_at_ports, *l; const gchar *net_port_parent_path; + MMPortSerialAt *found = NULL; g_warn_if_fail (mm_port_get_subsys (port) == MM_PORT_SUBSYS_NET); - net_port_parent_path = mm_port_get_parent_path (port); + net_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (port)); if (!net_port_parent_path) { mm_warn ("(%s) no parent path for net port", mm_port_get_device (port)); return NULL; @@ -2322,16 +2210,17 @@ MM_PORT_SUBSYS_USB, MM_PORT_TYPE_AT, NULL); - for (l = cdc_wdm_at_ports; l; l = g_list_next (l)) { + for (l = cdc_wdm_at_ports; l && !found; l = g_list_next (l)) { const gchar *wdm_port_parent_path; g_assert (MM_IS_PORT_SERIAL_AT (l->data)); - wdm_port_parent_path = mm_port_get_parent_path (MM_PORT (l->data)); + wdm_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (MM_PORT (l->data))); if (wdm_port_parent_path && g_str_equal (wdm_port_parent_path, net_port_parent_path)) - return MM_PORT_SERIAL_AT (l->data); + found = MM_PORT_SERIAL_AT (l->data); } - return NULL; + g_list_free_full (cdc_wdm_at_ports, g_object_unref); + return found; } @@ -2354,44 +2243,30 @@ ensure_ndisdup_support_checked (MMBroadbandModemHuawei *self, MMPort *port) { - GUdevClient *client; - GUdevDevice *data_device; - /* Check NDISDUP support the first time we need it */ if (self->priv->ndisdup_support != FEATURE_SUPPORT_UNKNOWN) return; /* First, check for devices which support NDISDUP on any AT port. These * devices are tagged by udev */ - client = g_udev_client_new (NULL); - data_device = (g_udev_client_query_by_subsystem_and_name ( - client, - "net", - mm_port_get_device (port))); - if (data_device && g_udev_device_get_property_as_boolean (data_device, "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { + if (mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (port), "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { mm_dbg ("This device (%s) can support ndisdup feature", mm_port_get_device (port)); self->priv->ndisdup_support = FEATURE_SUPPORTED; - goto out; } - /* Then, look for devices which have both a net port and a cdc-wdm * AT-capable port. We assume that these devices allow NDISDUP only * when issued in the cdc-wdm port. */ - if (peek_port_at_for_data (self, port)) { + else if (peek_port_at_for_data (self, port)) { mm_dbg ("This device (%s) can support ndisdup feature on non-serial AT port", mm_port_get_device (port)); self->priv->ndisdup_support = FEATURE_SUPPORTED; - goto out; } + if (self->priv->ndisdup_support != FEATURE_SUPPORT_UNKNOWN) + return; + mm_dbg ("This device (%s) can not support ndisdup feature", mm_port_get_device (port)); self->priv->ndisdup_support = FEATURE_NOT_SUPPORTED; - -out: - if (data_device) - g_object_unref (data_device); - if (client) - g_object_unref (client); } static void @@ -2400,21 +2275,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - CreateBearerContext *ctx; + GTask *task; MMPort *port; - ctx = g_slice_new0 (CreateBearerContext); - ctx->self = g_object_ref (self); - ctx->properties = g_object_ref (properties); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - huawei_modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, g_object_ref (properties), g_object_unref); port = mm_base_modem_peek_best_data_port (MM_BASE_MODEM (self), MM_PORT_TYPE_NET); if (port) { - ensure_ndisdup_support_checked (ctx->self, port); - create_bearer_for_net_port (ctx); + ensure_ndisdup_support_checked (MM_BROADBAND_MODEM_HUAWEI (self), port); + create_bearer_for_net_port (task); return; } @@ -2423,11 +2293,16 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - ctx); + task); } /*****************************************************************************/ -/* USSD encode/decode (3GPP-USSD interface) */ +/* USSD encode/decode (3GPP-USSD interface) + * + * Huawei devices don't use the current charset (as per AT+CSCS) in the CUSD + * command, they instead expect data encoded in GSM-7 already, given as a + * hex string. + */ static gchar * encode (MMIfaceModem3gppUssd *self, @@ -2451,7 +2326,7 @@ len++; } - packed = gsm_pack (gsm, len, 0, &packed_len); + packed = mm_charset_gsm_pack (gsm, len, 0, &packed_len); hex = mm_utils_bin2hexstr (packed, packed_len); g_free (packed); g_free (gsm); @@ -2470,7 +2345,7 @@ guint32 unpacked_len; bin = mm_utils_hexstr2bin (reply, &bin_len); - unpacked = gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len); /* if the last character in a 7-byte block is padding, then drop it */ if ((bin_len % 7 == 0) && (unpacked[unpacked_len - 1] == 0x0d)) unpacked_len--; @@ -2520,36 +2395,37 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return 0; + GError *inner_error = NULL; + gssize value; - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return 0; + } + return (guint)value; } static void parent_load_signal_quality_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; guint signal_quality; signal_quality = iface_modem_parent->load_signal_quality_finish (self, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (signal_quality), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, signal_quality); + g_object_unref (task); } static void signal_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response, *command; gchar buf[5]; @@ -2561,11 +2437,11 @@ iface_modem_parent->load_signal_quality ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_signal_quality_ready, - simple); + task); return; } - command = g_object_get_data (G_OBJECT (simple), "command"); + command = g_task_get_task_data (task); g_assert (command); response = mm_strip_tag (response, command); /* 'command' won't include the trailing ':' in the response, so strip that */ @@ -2579,19 +2455,16 @@ if (mm_get_uint_from_str (buf, &quality)) { quality = CLAMP (quality, 0, 100); - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (quality), - NULL); + g_task_return_int (task, quality); } else { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse %s response: '%s'", - command, response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse %s response: '%s'", + command, response); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -2599,22 +2472,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; MMModemCdmaRegistrationState evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; const char *command = "^CSQLVL"; mm_dbg ("loading signal quality..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_signal_quality); + task = g_task_new (self, NULL, callback, user_data); /* 3GPP modems can just run parent's signal quality loading */ if (mm_iface_modem_is_3gpp (self)) { iface_modem_parent->load_signal_quality ( self, (GAsyncReadyCallback)parent_load_signal_quality_ready, - result); + task); return; } @@ -2625,7 +2495,8 @@ NULL); if (evdo_state > MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) command = "^HDRCSQLVL"; - g_object_set_data (G_OBJECT (result), "command", (gpointer) command); + + g_task_set_task_data (task, g_strdup (command), g_free); mm_base_modem_at_command ( MM_BASE_MODEM (self), @@ -2633,7 +2504,7 @@ 3, FALSE, (GAsyncReadyCallback)signal_ready, - result); + task); } /*****************************************************************************/ @@ -2645,7 +2516,7 @@ { GList *ports, *l; - ports = get_at_port_list (self); + ports = mm_broadband_modem_huawei_get_at_port_list (self); /* Enable/disable unsolicited events in given port */ for (l = ports; l; l = g_list_next (l)) { @@ -2673,7 +2544,7 @@ NULL); } - g_list_free_full (ports, (GDestroyNotify)g_object_unref); + g_list_free_full (ports, g_object_unref); } static gboolean @@ -2681,26 +2552,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_cdma_setup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_cdma_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_cdma_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -2708,12 +2577,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_setup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup if needed */ if (iface_modem_cdma_parent->setup_unsolicited_events && @@ -2721,30 +2587,28 @@ iface_modem_cdma_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cdma_setup_unsolicited_events_ready, - result); + task); return; } /* Otherwise just run our setup and complete */ set_cdma_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (result), TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void parent_cdma_cleanup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_cdma_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -2752,12 +2616,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own cleanup first */ set_cdma_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE); @@ -2768,14 +2629,13 @@ iface_modem_cdma_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cdma_cleanup_unsolicited_events_ready, - result); + task); return; } /* Otherwise we're done */ - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (result), TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -2801,35 +2661,39 @@ { SetupRegistrationChecksResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step; *skip_qcdm_hdr_step = results->skip_qcdm_hdr_step; *skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step; *skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step; *skip_detailed_registration_state = results->skip_detailed_registration_state; + g_free (results); return TRUE; } static void parent_setup_registration_checks_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + SetupRegistrationChecksResults *results; GError *error = NULL; - SetupRegistrationChecksResults results = { 0 }; + + results = g_new0 (SetupRegistrationChecksResults, 1); if (!iface_modem_cdma_parent->setup_registration_checks_finish (self, res, - &results.skip_qcdm_call_manager_step, - &results.skip_qcdm_hdr_step, - &results.skip_at_cdma_service_status_step, - &results.skip_at_cdma1x_serving_system_step, - &results.skip_detailed_registration_state, + &results->skip_qcdm_call_manager_step, + &results->skip_qcdm_hdr_step, + &results->skip_at_cdma_service_status_step, + &results->skip_at_cdma1x_serving_system_step, + &results->skip_detailed_registration_state, &error)) { - g_simple_async_result_take_error (simple, error); + g_free (results); + g_task_return_error (task, error); } else { gboolean evdo_supported = FALSE; @@ -2842,18 +2706,16 @@ * AT+CSS won't necessarily report EVDO registration status, only 1X. */ if (evdo_supported) - results.skip_at_cdma1x_serving_system_step = TRUE; + results->skip_at_cdma1x_serving_system_step = TRUE; /* Force to always use the detailed registration checks, as we have * ^SYSINFO for that */ - results.skip_detailed_registration_state = FALSE; + results->skip_detailed_registration_state = FALSE; - g_simple_async_result_set_op_res_gpointer (simple, &results, NULL); + g_task_return_pointer (task, results, g_free); } - /* All done. NOTE: complete NOT in idle! */ - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -2861,17 +2723,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_registration_checks); + task = g_task_new (self, NULL, callback, user_data); /* Run parent's checks first */ iface_modem_cdma_parent->setup_registration_checks (self, (GAsyncReadyCallback)parent_setup_registration_checks_ready, - result); + task); } /*****************************************************************************/ @@ -2883,21 +2742,9 @@ } DetailedRegistrationStateResults; typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; DetailedRegistrationStateResults state; } DetailedRegistrationStateContext; -static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) -{ - /* Always not in idle! we're passing a struct in stack as result */ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean get_detailed_registration_state_finish (MMIfaceModemCdma *self, GAsyncResult *res, @@ -2907,25 +2754,29 @@ { DetailedRegistrationStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *detailed_cdma1x_state = results->detailed_cdma1x_state; *detailed_evdo_state = results->detailed_evdo_state; + g_free (results); return TRUE; } static void registration_state_sysinfo_ready (MMBroadbandModemHuawei *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateContext *ctx; gboolean extended = FALSE; guint srv_status = 0; guint sys_mode = 0; guint roam_status = 0; + ctx = g_task_get_task_data (task); + if (!sysinfo_finish (self, res, &extended, @@ -2937,10 +2788,11 @@ NULL, /* sys_submode_valid */ NULL, /* sys_submode */ NULL)) { - /* If error, leave superclass' reg state alone if ^SYSINFO isn't supported. - * NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); + /* If error, leave superclass' reg state alone if ^SYSINFO isn't supported. */ + g_task_return_pointer (task, + g_memdup (&ctx->state, sizeof (ctx->state)), + g_free); + g_object_unref (task); return; } @@ -2980,9 +2832,10 @@ } } - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, + g_memdup (&ctx->state, sizeof (ctx->state)), + g_free); + g_object_unref (task); } static void @@ -2993,255 +2846,91 @@ gpointer user_data) { DetailedRegistrationStateContext *ctx; + GTask *task; /* Setup context */ - ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_detailed_registration_state); + ctx = g_new (DetailedRegistrationStateContext, 1); ctx->state.detailed_cdma1x_state = cdma1x_state; ctx->state.detailed_evdo_state = evdo_state; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + sysinfo (MM_BROADBAND_MODEM_HUAWEI (self), (GAsyncReadyCallback)registration_state_sysinfo_ready, - ctx); + task); } /*****************************************************************************/ -/* Setup/Cleanup unsolicited events (Voice interface) */ - -static void -huawei_voice_origination (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemHuawei *self) -{ - guint call_x = 0; - guint call_type = 0; - - if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) - return; +/* Check if Voice supported (Voice interface) */ - if (!mm_get_uint_from_match_info (match_info, 2, &call_type)) - return; - - mm_dbg ("[^ORIG] Origination call id '%u' of type '%u'", call_x, call_type); - - /* TODO: Handle multiple calls - * mm_iface_modem_voice_set_call_id (MM_IFACE_MODEM_VOICE (self)); */ -} - -static void -huawei_voice_ringback_tone (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemHuawei *self) +static gboolean +modem_voice_check_support_finish (MMIfaceModemVoice *self, + GAsyncResult *res, + GError **error) { - guint call_x = 0; - - if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) - return; - - mm_dbg ("[^CONF] Ringback tone from call id '%u'", call_x); - - mm_iface_modem_voice_call_dialing_to_ringing (MM_IFACE_MODEM_VOICE (self)); + return g_task_propagate_boolean (G_TASK (res), error); } static void -huawei_voice_call_connection (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemHuawei *self) +voice_parent_check_support_ready (MMIfaceModemVoice *self, + GAsyncResult *res, + GTask *task) { - guint call_x = 0; - guint call_type = 0; - - if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) - return; - - if (!mm_get_uint_from_match_info (match_info, 2, &call_type)) - return; - - mm_dbg ("[^CONN] Call id '%u' of type '%u' connected", call_x, call_type); + gboolean parent_support; - mm_iface_modem_voice_call_ringing_to_active (MM_IFACE_MODEM_VOICE (self)); + parent_support = iface_modem_voice_parent->check_support_finish (self, res, NULL); + g_task_return_boolean (task, parent_support); + g_object_unref (task); } static void -huawei_voice_call_end (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemHuawei *self) +cvoice_check_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) { - guint call_x = 0; - guint duration = 0; - guint cc_cause = 0; - guint end_status = 0; - - if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) - return; - - if (!mm_get_uint_from_match_info (match_info, 2, &duration)) - return; + MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); + GError *error = NULL; + const gchar *response; - if (!mm_get_uint_from_match_info (match_info, 3, &end_status)) + response = mm_base_modem_at_command_finish (_self, res, &error); + if (!response || + !mm_huawei_parse_cvoice_response (response, + &self->priv->audio_hz, + &self->priv->audio_bits, + &error)) { + self->priv->cvoice_support = FEATURE_NOT_SUPPORTED; + mm_dbg ("Huawei-specific CVOICE is unsupported: %s", error->message); + g_clear_error (&error); + + /* Now check generic support */ + iface_modem_voice_parent->check_support (MM_IFACE_MODEM_VOICE (self), + (GAsyncReadyCallback)voice_parent_check_support_ready, + task); return; - - //This is optional - mm_get_uint_from_match_info (match_info, 4, &cc_cause); - - mm_dbg ("[^CEND] Call '%u' terminated with status '%u' and cause '%u'. Duration of call '%d'", call_x, end_status, cc_cause, duration); - - mm_iface_modem_voice_network_hangup (MM_IFACE_MODEM_VOICE (self)); -} - -static void -huawei_voice_received_dtmf (MMPortSerialAt *port, - GMatchInfo *match_info, - MMBroadbandModemHuawei *self) -{ - gchar *key; - - key = g_match_info_fetch (match_info, 1); - - if (key) { - mm_dbg ("[^DDTMF] Received DTMF '%s'", key); - mm_iface_modem_voice_received_dtmf (MM_IFACE_MODEM_VOICE (self), key); } -} - -static void -set_voice_unsolicited_events_handlers (MMBroadbandModemHuawei *self, - gboolean enable) -{ - GList *ports, *l; - - ports = get_at_port_list (self); - - /* Enable/disable unsolicited events in given port */ - for (l = ports; l; l = g_list_next (l)) { - MMPortSerialAt *port = MM_PORT_SERIAL_AT (l->data); - - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->orig_regex, - enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_origination : NULL, - enable ? self : NULL, - NULL); - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->conf_regex, - enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_ringback_tone : NULL, - enable ? self : NULL, - NULL); - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->conn_regex, - enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_call_connection : NULL, - enable ? self : NULL, - NULL); - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->cend_regex, - enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_call_end : NULL, - enable ? self : NULL, - NULL); - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->ddtmf_regex, - enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_received_dtmf: NULL, - enable ? self : NULL, - NULL); - /* Ignore this message (Huawei ME909s-120 firmware. 23.613.61.00.00) */ - mm_port_serial_at_add_unsolicited_msg_handler ( - port, - self->priv->cschannelinfo_regex, - NULL, NULL, NULL); - } - - g_list_free_full (ports, (GDestroyNotify)g_object_unref); -} - -static gboolean -modem_voice_setup_cleanup_unsolicited_events_finish (MMIfaceModemVoice *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -parent_voice_setup_unsolicited_events_ready (MMIfaceModemVoice *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - GError *error = NULL; - - if (!iface_modem_voice_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); - else { - /* Our own setup now */ - set_voice_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - } - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -modem_voice_setup_unsolicited_events (MMIfaceModemVoice *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_voice_setup_unsolicited_events); - - /* Chain up parent's setup */ - iface_modem_voice_parent->setup_unsolicited_events ( - self, - (GAsyncReadyCallback)parent_voice_setup_unsolicited_events_ready, - result); -} - -static void -parent_voice_cleanup_unsolicited_events_ready (MMIfaceModemVoice *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - GError *error = NULL; - - if (!iface_modem_voice_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); - else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + mm_dbg ("Huawei-specific CVOICE is supported"); + self->priv->cvoice_support = FEATURE_SUPPORTED; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -modem_voice_cleanup_unsolicited_events (MMIfaceModemVoice *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_voice_check_support (MMIfaceModemVoice *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_voice_cleanup_unsolicited_events); - - /* Our own cleanup first */ - set_voice_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE); + GTask *task; - /* And now chain up parent's cleanup */ - iface_modem_voice_parent->cleanup_unsolicited_events ( - self, - (GAsyncReadyCallback)parent_voice_cleanup_unsolicited_events_ready, - result); + /* Check for Huawei-specific ^CVOICE support */ + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command (MM_BASE_MODEM (self), + "^CVOICE?", + 3, + TRUE, + (GAsyncReadyCallback)cvoice_check_ready, + task); } /*****************************************************************************/ @@ -3252,23 +2941,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_voice_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_voice_enable_sequence[] = { @@ -3280,14 +2968,13 @@ static void parent_voice_enable_unsolicited_events_ready (MMIfaceModemVoice *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_voice_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -3300,7 +2987,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_voice_enable_unsolicited_events_ready, - simple); + task); } static void @@ -3308,18 +2995,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_voice_enable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's enable */ iface_modem_voice_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_voice_enable_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ @@ -3330,23 +3014,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_voice_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_voice_disable_sequence[] = { @@ -3360,12 +3043,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *simple; + GTask *task; - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_voice_disable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* No unsolicited events disabling in parent */ @@ -3377,17 +3057,28 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_voice_disable_unsolicited_events_ready, - simple); + task); } /*****************************************************************************/ /* Create call (Voice interface) */ static MMBaseCall * -create_call (MMIfaceModemVoice *self) +create_call (MMIfaceModemVoice *_self, + MMCallDirection direction, + const gchar *number) { - /* New Huawei Call */ - return mm_call_huawei_new (MM_BASE_MODEM (self)); + MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); + + /* If CVOICE is supported we must have audio settings */ + g_assert (self->priv->cvoice_support == FEATURE_NOT_SUPPORTED || + (self->priv->cvoice_support == FEATURE_SUPPORTED && self->priv->audio_hz && self->priv->audio_bits)); + + return mm_call_huawei_new (MM_BASE_MODEM (self), + direction, + number, + self->priv->audio_hz, + self->priv->audio_bits); } /*****************************************************************************/ @@ -3472,7 +3163,7 @@ { GList *ports, *l; - ports = get_at_port_list (self); + ports = mm_broadband_modem_huawei_get_at_port_list (self); mm_dbg ("%s ^RFSWITCH unsolicited event handler", enable ? "Enable" : "Disable"); @@ -3486,20 +3177,20 @@ enable); } - g_list_free_full (ports, (GDestroyNotify)g_object_unref); + g_list_free_full (ports, g_object_unref); } static void parent_load_power_state_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *result) + GTask *task) { GError *error = NULL; MMModemPowerState power_state; power_state = iface_modem_parent->load_power_state_finish (self, res, &error); if (error) - g_simple_async_result_take_error (result, error); + g_task_return_error (task, error); else { /* As modem_power_down uses +CFUN=0 to put the modem in low state, we treat * CFUN 0 as 'LOW' power state instead of 'OFF'. Otherwise, MMIfaceModem @@ -3507,17 +3198,16 @@ if (power_state == MM_MODEM_POWER_STATE_OFF) power_state = MM_MODEM_POWER_STATE_LOW; - g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (power_state), NULL); + g_task_return_int (task, power_state); } - g_simple_async_result_complete (result); - g_object_unref (result); + g_object_unref (task); } static void huawei_rfswitch_check_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *result) + GTask *task) { MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); GError *error = NULL; @@ -3549,7 +3239,7 @@ /* Fall back to parent's load_power_state */ iface_modem_parent->load_power_state (MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_power_state_ready, - result); + task); return; } @@ -3564,16 +3254,12 @@ } if (error) - g_simple_async_result_take_error (result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (result, - sw_state ? - GUINT_TO_POINTER (MM_MODEM_POWER_STATE_ON) : - GUINT_TO_POINTER (MM_MODEM_POWER_STATE_LOW), - NULL); + g_task_return_int (task, + sw_state ? MM_MODEM_POWER_STATE_ON : MM_MODEM_POWER_STATE_LOW); - g_simple_async_result_complete (result); - g_object_unref (result); + g_object_unref (task); } static MMModemPowerState @@ -3581,10 +3267,15 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_POWER_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemPowerState)GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_POWER_STATE_UNKNOWN; + } + return (MMModemPowerState)value; } static void @@ -3592,12 +3283,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_power_state); + task = g_task_new (self, NULL, callback, user_data); switch (MM_BROADBAND_MODEM_HUAWEI (self)->priv->rfswitch_support) { case FEATURE_SUPPORT_UNKNOWN: @@ -3613,14 +3301,14 @@ 3, FALSE, (GAsyncReadyCallback)huawei_rfswitch_check_ready, - result); + task); break; } case FEATURE_NOT_SUPPORTED: /* Run parent's load_power_state */ iface_modem_parent->load_power_state (self, (GAsyncReadyCallback)parent_load_power_state_ready, - result); + task); break; default: g_assert_not_reached (); @@ -3740,25 +3428,29 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCATION_SOURCE_NONE; + GError *inner_error = NULL; + gssize value; - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; } static void parent_load_capabilities_ready (MMIfaceModemLocation *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemLocationSource sources; GError *error = NULL; sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -3769,11 +3461,8 @@ MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED); /* So we're done, complete */ - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (sources), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, sources); + g_object_unref (task); } static void @@ -3781,38 +3470,24 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_load_capabilities); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup */ iface_modem_location_parent->load_capabilities (self, (GAsyncReadyCallback)parent_load_capabilities_ready, - result); + task); } /*****************************************************************************/ /* Enable/Disable location gathering (Location interface) */ typedef struct { - MMBroadbandModemHuawei *self; - GSimpleAsyncResult *result; MMModemLocationSource source; int idx; } LocationGatheringContext; -static void -location_gathering_context_complete_and_free (LocationGatheringContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LocationGatheringContext, ctx); -} - /******************************/ /* Disable location gathering */ @@ -3821,21 +3496,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void gps_disabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; MMPortSerialGps *gps_port; GError *error = NULL; - if (!mm_base_modem_at_command_full_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + ctx = g_task_get_task_data (task); + + mm_base_modem_at_command_full_finish (self, res, &error); /* Only use the GPS port in NMEA/RAW setups */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | @@ -3846,7 +3521,11 @@ mm_port_serial_close (MM_PORT_SERIAL (gps_port)); } - location_gathering_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -3858,15 +3537,14 @@ MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); gboolean stop_gps = FALSE; LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Only stop GPS engine if no GPS-related sources enabled */ if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | @@ -3888,13 +3566,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_disabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if still some GPS needed, just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -3905,7 +3583,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static char *gps_startup[] = { @@ -3919,15 +3597,18 @@ static void gps_enabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; GError *error = NULL; MMPortSerialGps *gps_port; + ctx = g_task_get_task_data (task); + if (!mm_base_modem_at_command_full_finish (self, res, &error)) { ctx->idx = 0; - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -3941,7 +3622,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_enabled_ready, - ctx); + task); return; } @@ -3952,46 +3633,50 @@ if (!gps_port || !mm_port_serial_open (MM_PORT_SERIAL (gps_port), &error)) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't open raw GPS serial port"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't open raw GPS serial port"); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - location_gathering_context_complete_and_free (ctx); + g_object_unref (task); } static void -parent_enable_location_gathering_ready (MMIfaceModemLocation *self, +parent_enable_location_gathering_ready (MMIfaceModemLocation *_self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); + LocationGatheringContext *ctx; gboolean start_gps = FALSE; GError *error = NULL; - if (!iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + if (!iface_modem_location_parent->enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* Now our own enabling */ + ctx = g_task_get_task_data (task); + /* NMEA and RAW are both enabled in the same way */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { /* Only start GPS engine if not done already */ - if (!(ctx->self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) + if (!(self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) start_gps = TRUE; - ctx->self->priv->enabled_sources |= ctx->source; + self->priv->enabled_sources |= ctx->source; } if (start_gps) { @@ -4003,13 +3688,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_enabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if GPS already running just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -4019,21 +3704,20 @@ gpointer user_data) { LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; ctx->idx = 0; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Chain up parent's gathering enable */ iface_modem_location_parent->enable_location_gathering (self, source, (GAsyncReadyCallback)parent_enable_location_gathering_ready, - ctx); + task); } /*****************************************************************************/ @@ -4044,24 +3728,23 @@ GAsyncResult *res, GError **error) { - MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); - - if (self->priv->nwtime_support == FEATURE_SUPPORTED) - return TRUE; - if (self->priv->time_support == FEATURE_SUPPORTED) - return TRUE; - return FALSE; + return g_task_propagate_boolean (G_TASK (res), error); } static void -modem_time_check_ready (MMBaseModem *self, +modem_time_check_ready (MMBaseModem *_self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + MMBroadbandModemHuawei *self = MM_BROADBAND_MODEM_HUAWEI (_self); + /* Responses are checked in the sequence parser, ignore overall result */ - mm_base_modem_at_sequence_finish (self, res, NULL, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + mm_base_modem_at_sequence_finish (_self, res, NULL, NULL); + + g_task_return_boolean (task, + (self->priv->nwtime_support == FEATURE_SUPPORTED || + self->priv->time_support == FEATURE_SUPPORTED)); + g_object_unref (task); } static gboolean @@ -4102,19 +3785,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_time_check_support); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_sequence (MM_BASE_MODEM (self), time_cmd_sequence, NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)modem_time_check_ready, - result); + task); } /*****************************************************************************/ @@ -4261,7 +3941,7 @@ { GList *ports, *l; - ports = get_at_port_list (self); + ports = mm_broadband_modem_huawei_get_at_port_list (self); /* Enable/disable unsolicited events in given port */ for (l = ports; l; l = g_list_next (l)) { @@ -4331,9 +4011,21 @@ port, self->priv->ltersrp_regex, NULL, NULL, NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->cschannelinfo_regex, + NULL, NULL, NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->eons_regex, + NULL, NULL, NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->orig_regex, + NULL, NULL, NULL); } - g_list_free_full (ports, (GDestroyNotify)g_object_unref); + g_list_free_full (ports, g_object_unref); } static void @@ -4358,7 +4050,6 @@ /* Now reset the unsolicited messages we'll handle when enabled */ set_3gpp_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE); set_cdma_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE); - set_voice_unsolicited_events_handlers(MM_BROADBAND_MODEM_HUAWEI (self), FALSE); /* NMEA GPS monitoring */ gps_data_port = mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)); @@ -4451,36 +4142,12 @@ G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); self->priv->ltersrp_regex = g_regex_new ("\\r\\n\\^LTERSRP:.+\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - - /* Voice related regex - * ^ORIG: , - * ^CONF: - * ^CONN: , - * ^CEND: ,,[,] - */ - self->priv->orig_regex = g_regex_new ("\\r\\n\\^ORIG:\\s*(\\d+),(\\d+)\\r\\n", - G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - self->priv->conf_regex = g_regex_new ("\\r\\n\\^CONF:\\s*(\\d+)\\r\\n", - G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - self->priv->conn_regex = g_regex_new ("\\r\\n\\^CONN:\\s*(\\d+),(\\d+)\\r\\n", - G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - self->priv->cend_regex = g_regex_new ("\\r\\n\\^CEND:\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),?\\s*(\\d*)\\r\\n", - G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - - /* Voice: receive DTMF regex - * ^DDTMF: - * Key should be 0-9, A-D, *, # - */ - self->priv->ddtmf_regex = g_regex_new ("\\r\\n\\^DDTMF:\\s*([0-9A-D\\*\\#])\\r\\n", - G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - - /* Voice: Unknown message that's broke ATA command - * ^CSCHANNELINFO: , - * Key should be 0-9, A-D, *, # - */ - self->priv->cschannelinfo_regex = g_regex_new ("\\r\\n\\^CSCHANNELINFO:\\s*(\\d+),(\\d+)\\r\\n", + self->priv->cschannelinfo_regex = g_regex_new ("\\r\\n\\^CSCHANNELINFO:.+\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - + self->priv->eons_regex = g_regex_new ("\\r\\n\\^EONS:.+\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + self->priv->orig_regex = g_regex_new ("\\r\\n\\^ORIG:.+\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); self->priv->ndisdup_support = FEATURE_SUPPORT_UNKNOWN; self->priv->rfswitch_support = FEATURE_SUPPORT_UNKNOWN; @@ -4490,6 +4157,7 @@ self->priv->prefmode_support = FEATURE_SUPPORT_UNKNOWN; self->priv->nwtime_support = FEATURE_SUPPORT_UNKNOWN; self->priv->time_support = FEATURE_SUPPORT_UNKNOWN; + self->priv->cvoice_support = FEATURE_SUPPORT_UNKNOWN; } static void @@ -4530,12 +4198,9 @@ g_regex_unref (self->priv->posend_regex); g_regex_unref (self->priv->ecclist_regex); g_regex_unref (self->priv->ltersrp_regex); - g_regex_unref (self->priv->orig_regex); - g_regex_unref (self->priv->conf_regex); - g_regex_unref (self->priv->conn_regex); - g_regex_unref (self->priv->cend_regex); - g_regex_unref (self->priv->ddtmf_regex); g_regex_unref (self->priv->cschannelinfo_regex); + g_regex_unref (self->priv->eons_regex); + g_regex_unref (self->priv->orig_regex); if (self->priv->syscfg_supported_modes) g_array_unref (self->priv->syscfg_supported_modes); @@ -4597,8 +4262,6 @@ iface->enable_unsolicited_events_finish = modem_3gpp_enable_unsolicited_events_finish; iface->disable_unsolicited_events = modem_3gpp_disable_unsolicited_events; iface->disable_unsolicited_events_finish = modem_3gpp_disable_unsolicited_events_finish; - iface->load_operator_name = modem_3gpp_load_operator_name; - iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish; } static void @@ -4652,10 +4315,8 @@ { iface_modem_voice_parent = g_type_interface_peek_parent (iface); - iface->setup_unsolicited_events = modem_voice_setup_unsolicited_events; - iface->setup_unsolicited_events_finish = modem_voice_setup_cleanup_unsolicited_events_finish; - iface->cleanup_unsolicited_events = modem_voice_cleanup_unsolicited_events; - iface->cleanup_unsolicited_events_finish = modem_voice_setup_cleanup_unsolicited_events_finish; + iface->check_support = modem_voice_check_support; + iface->check_support_finish = modem_voice_check_support_finish; iface->enable_unsolicited_events = modem_voice_enable_unsolicited_events; iface->enable_unsolicited_events_finish = modem_voice_enable_unsolicited_events_finish; iface->disable_unsolicited_events = modem_voice_disable_unsolicited_events; diff -Nru modemmanager-1.6.8/plugins/huawei/mm-broadband-modem-huawei.h modemmanager-1.10.0/plugins/huawei/mm-broadband-modem-huawei.h --- modemmanager-1.6.8/plugins/huawei/mm-broadband-modem-huawei.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-broadband-modem-huawei.h 2019-01-15 15:57:35.000000000 +0100 @@ -50,5 +50,6 @@ MMPortSerialAt *mm_broadband_modem_huawei_peek_port_at_for_data (MMBroadbandModemHuawei *self, MMPort *port); +GList *mm_broadband_modem_huawei_get_at_port_list (MMBroadbandModemHuawei *self); #endif /* MM_BROADBAND_MODEM_HUAWEI_H */ diff -Nru modemmanager-1.6.8/plugins/huawei/mm-call-huawei.c modemmanager-1.10.0/plugins/huawei/mm-call-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-call-huawei.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-call-huawei.c 2019-01-15 15:57:35.000000000 +0100 @@ -26,132 +26,420 @@ #include "mm-log.h" #include "mm-base-modem-at.h" +#include "mm-broadband-modem-huawei.h" #include "mm-call-huawei.h" G_DEFINE_TYPE (MMCallHuawei, mm_call_huawei, MM_TYPE_BASE_CALL) +enum { + PROP_0, + PROP_AUDIO_HZ, + PROP_AUDIO_BITS, + PROP_LAST +}; + +static GParamSpec *properties[PROP_LAST]; + +struct _MMCallHuaweiPrivate { + GRegex *conf_regex; + GRegex *conn_regex; + GRegex *cend_regex; + GRegex *ddtmf_regex; + guint audio_hz; + guint audio_bits; +}; + /*****************************************************************************/ -/* Start the CALL */ +/* Audio channel setup */ typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallStartContext; + MMBaseModem *modem; + MMPort *audio_port; + MMCallAudioFormat *audio_format; +} SetupAudioChannelContext; static void -call_start_context_complete_and_free (CallStartContext *ctx) +setup_audio_channel_context_free (SetupAudioChannelContext *ctx) +{ + g_clear_object (&ctx->audio_port); + g_clear_object (&ctx->audio_format); + g_clear_object (&ctx->modem); + g_slice_free (SetupAudioChannelContext, ctx); +} + +static gboolean +setup_audio_channel_finish (MMBaseCall *self, + GAsyncResult *res, + MMPort **audio_port, + MMCallAudioFormat **audio_format, + GError **error) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); + SetupAudioChannelContext *ctx; + + if (!g_task_propagate_boolean (G_TASK (res), error)) + return FALSE; + + ctx = g_task_get_task_data (G_TASK (res)); + + if (audio_port && ctx->audio_port) + *audio_port = g_object_ref (ctx->audio_port); + if (audio_format && ctx->audio_format) + *audio_format = g_object_ref (ctx->audio_format); + + return TRUE; } static void -call_start_ready (MMBaseModem *modem, - GAsyncResult *res, - CallStartContext *ctx) +ddsetex_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) { - GError *error = NULL; - const gchar *response = NULL; + MMCallHuawei *self; + SetupAudioChannelContext *ctx; + GError *error = NULL; + const gchar *response = NULL; + gchar *resolution_str; response = mm_base_modem_at_command_finish (modem, res, &error); - if (error) { - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - /* something is wrong, serial timeout could never occurs */ - } - - if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_DIALTONE)) { - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); - } - - if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_BUSY) || - g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_ANSWER) || - g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_CARRIER)) { - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); - } - - mm_dbg ("Couldn't start call : '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - call_start_context_complete_and_free (ctx); + if (!response) { + mm_dbg ("Error enabling audio streaming: '%s'", error->message); + g_task_return_error (task, error); + g_object_unref (task); return; } - /* check response for error */ - if (response && strlen (response) > 0 ) { - error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Couldn't start the call: " - "Modem response '%s'", response); - - /* Update state */ - mm_base_call_change_state (ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); - } else { - /* Update state */ - mm_base_call_change_state (ctx->self, MM_CALL_STATE_DIALING, MM_CALL_STATE_REASON_OUTGOING_STARTED); - } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); - if (error) { - g_simple_async_result_take_error (ctx->result, error); - call_start_context_complete_and_free (ctx); - return; - } + /* Setup audio format */ + g_assert (self->priv->audio_hz && self->priv->audio_bits); + resolution_str = g_strdup_printf ("s%ule", self->priv->audio_bits); + ctx->audio_format = mm_call_audio_format_new (); + mm_call_audio_format_set_encoding (ctx->audio_format, "pcm"); + mm_call_audio_format_set_resolution (ctx->audio_format, resolution_str); + mm_call_audio_format_set_rate (ctx->audio_format, self->priv->audio_hz); + + /* The QCDM port, if present, switches from QCDM to voice while + * a voice call is active. */ + ctx->audio_port = MM_PORT (mm_base_modem_get_port_qcdm (modem)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - call_start_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -call_start (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - CallStartContext *ctx; - gchar *cmd; - - /* Setup the context */ - ctx = g_new0 (CallStartContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_start); - ctx->self = g_object_ref (self); - g_object_get (ctx->self, +setup_audio_channel (MMBaseCall *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + SetupAudioChannelContext *ctx; + MMCallHuawei *self; + GTask *task; + MMBaseModem *modem = NULL; + + self = MM_CALL_HUAWEI (_self); + + task = g_task_new (self, NULL, callback, user_data); + + /* If there is no CVOICE support, no custom audio setup required + * (i.e. audio path is externally managed) */ + if (!self->priv->audio_hz && !self->priv->audio_bits) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx = g_slice_new0 (SetupAudioChannelContext); + g_object_get (self, MM_BASE_CALL_MODEM, &ctx->modem, NULL); + g_task_set_task_data (task, ctx, (GDestroyNotify) setup_audio_channel_context_free); - cmd = g_strdup_printf ("ATD%s;", mm_gdbus_call_get_number (MM_GDBUS_CALL (self))); - mm_base_modem_at_command (ctx->modem, - cmd, - 3, + /* Enable audio streaming on the audio port */ + mm_base_modem_at_command (modem, + "AT^DDSETEX=2", + 5, FALSE, - (GAsyncReadyCallback)call_start_ready, - ctx); - g_free (cmd); + (GAsyncReadyCallback)ddsetex_ready, + task); +} + +/*****************************************************************************/ +/* In-call unsolicited events */ + +static void +huawei_voice_ringback_tone (MMPortSerialAt *port, + GMatchInfo *match_info, + MMCallHuawei *self) +{ + guint call_x = 0; + + if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) + return; + + mm_dbg ("Ringback tone from call id '%u'", call_x); + + if (mm_gdbus_call_get_state (MM_GDBUS_CALL (self)) == MM_CALL_STATE_DIALING) + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED); +} + +static void +huawei_voice_call_connection (MMPortSerialAt *port, + GMatchInfo *match_info, + MMCallHuawei *self) +{ + guint call_x = 0; + guint call_type = 0; + + if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) + return; + + if (!mm_get_uint_from_match_info (match_info, 2, &call_type)) + return; + + mm_dbg ("Call id '%u' of type '%u' connected", call_x, call_type); + + if (mm_gdbus_call_get_state (MM_GDBUS_CALL (self)) == MM_CALL_STATE_RINGING_OUT) + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); +} + +static void +huawei_voice_call_end (MMPortSerialAt *port, + GMatchInfo *match_info, + MMCallHuawei *self) +{ + guint call_x = 0; + guint duration = 0; + guint cc_cause = 0; + guint end_status = 0; + + if (!mm_get_uint_from_match_info (match_info, 1, &call_x)) + return; + + if (!mm_get_uint_from_match_info (match_info, 2, &duration)) + return; + + if (!mm_get_uint_from_match_info (match_info, 3, &end_status)) + return; + + /* This is optional */ + mm_get_uint_from_match_info (match_info, 4, &cc_cause); + + mm_dbg ("Call id '%u' terminated with status '%u' and cause '%u'. Duration of call '%d'", + call_x, end_status, cc_cause, duration); + + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); +} + +static void +huawei_voice_received_dtmf (MMPortSerialAt *port, + GMatchInfo *match_info, + MMCallHuawei *self) +{ + gchar *key; + + key = g_match_info_fetch (match_info, 1); + + if (!key) + return; + + mm_dbg ("Received DTMF '%s'", key); + mm_base_call_received_dtmf (MM_BASE_CALL (self), key); + g_free (key); +} + +static gboolean +common_setup_cleanup_unsolicited_events (MMCallHuawei *self, + gboolean enable, + GError **error) +{ + MMBaseModem *modem = NULL; + GList *ports, *l; + + if (G_UNLIKELY (!self->priv->conf_regex)) + self->priv->conf_regex = g_regex_new ("\\r\\n\\^CONF:\\s*(\\d+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + if (G_UNLIKELY (!self->priv->conn_regex)) + self->priv->conn_regex = g_regex_new ("\\r\\n\\^CONN:\\s*(\\d+),(\\d+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + if (G_UNLIKELY (!self->priv->cend_regex)) + self->priv->cend_regex = g_regex_new ("\\r\\n\\^CEND:\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),?\\s*(\\d*)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + if (G_UNLIKELY (!self->priv->ddtmf_regex)) + self->priv->ddtmf_regex = g_regex_new ("\\r\\n\\^DDTMF:\\s*([0-9A-D\\*\\#])\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + + g_object_get (self, + MM_BASE_CALL_MODEM, &modem, + NULL); + + ports = mm_broadband_modem_huawei_get_at_port_list (MM_BROADBAND_MODEM_HUAWEI (modem)); + + for (l = ports; l; l = g_list_next (l)) { + MMPortSerialAt *port; + + port = MM_PORT_SERIAL_AT (l->data); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->conf_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_ringback_tone : NULL, + enable ? self : NULL, + NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->conn_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_call_connection : NULL, + enable ? self : NULL, + NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->cend_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_call_end : NULL, + enable ? self : NULL, + NULL); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->ddtmf_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)huawei_voice_received_dtmf: NULL, + enable ? self : NULL, + NULL); + } + + g_list_free_full (ports, g_object_unref); + g_object_unref (modem); + return TRUE; +} + +static gboolean +setup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (MM_CALL_HUAWEI (self), TRUE, error); +} + +static gboolean +cleanup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (MM_CALL_HUAWEI (self), FALSE, error); } /*****************************************************************************/ MMBaseCall * -mm_call_huawei_new (MMBaseModem *modem) +mm_call_huawei_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number, + guint audio_hz, + guint audio_bits) { return MM_BASE_CALL (g_object_new (MM_TYPE_CALL_HUAWEI, - MM_BASE_CALL_MODEM, modem, + MM_BASE_CALL_MODEM, modem, + "direction", direction, + "number", number, + MM_CALL_HUAWEI_AUDIO_HZ, audio_hz, + MM_CALL_HUAWEI_AUDIO_BITS, audio_bits, + MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE, + MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE, NULL)); } static void mm_call_huawei_init (MMCallHuawei *self) { + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CALL_HUAWEI, MMCallHuaweiPrivate); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMCallHuawei *self = MM_CALL_HUAWEI (object); + + switch (prop_id) { + case PROP_AUDIO_HZ: + self->priv->audio_hz = g_value_get_uint (value); + break; + case PROP_AUDIO_BITS: + self->priv->audio_bits = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMCallHuawei *self = MM_CALL_HUAWEI (object); + + switch (prop_id) { + case PROP_AUDIO_HZ: + g_value_set_uint (value, self->priv->audio_hz); + break; + case PROP_AUDIO_BITS: + g_value_set_uint (value, self->priv->audio_bits); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + MMCallHuawei *self = MM_CALL_HUAWEI (object); + + if (self->priv->conf_regex) + g_regex_unref (self->priv->conf_regex); + if (self->priv->conn_regex) + g_regex_unref (self->priv->conn_regex); + if (self->priv->cend_regex) + g_regex_unref (self->priv->cend_regex); + if (self->priv->ddtmf_regex) + g_regex_unref (self->priv->ddtmf_regex); + + G_OBJECT_CLASS (mm_call_huawei_parent_class)->finalize (object); } static void mm_call_huawei_class_init (MMCallHuaweiClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); MMBaseCallClass *base_call_class = MM_BASE_CALL_CLASS (klass); - base_call_class->start = call_start; + g_type_class_add_private (object_class, sizeof (MMCallHuaweiPrivate)); + + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->finalize = finalize; + + base_call_class->setup_unsolicited_events = setup_unsolicited_events; + base_call_class->cleanup_unsolicited_events = cleanup_unsolicited_events; + base_call_class->setup_audio_channel = setup_audio_channel; + base_call_class->setup_audio_channel_finish = setup_audio_channel_finish; + + properties[PROP_AUDIO_HZ] = + g_param_spec_uint (MM_CALL_HUAWEI_AUDIO_HZ, + "Audio Hz", + "Voice call audio hz if call audio is routed via the host", + 0, 24000, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_AUDIO_HZ, properties[PROP_AUDIO_HZ]); + + properties[PROP_AUDIO_BITS] = + g_param_spec_uint (MM_CALL_HUAWEI_AUDIO_BITS, + "Audio Bits", + "Voice call audio bits if call audio is routed via the host", + 0, 24, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_AUDIO_BITS, properties[PROP_AUDIO_BITS]); } diff -Nru modemmanager-1.6.8/plugins/huawei/mm-call-huawei.h modemmanager-1.10.0/plugins/huawei/mm-call-huawei.h --- modemmanager-1.6.8/plugins/huawei/mm-call-huawei.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-call-huawei.h 2019-01-15 15:57:35.000000000 +0100 @@ -28,11 +28,16 @@ #define MM_IS_CALL_HUAWEI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_CALL_HUAWEI)) #define MM_CALL_HUAWEI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_CALL_HUAWEI, MMCallHuaweiClass)) +#define MM_CALL_HUAWEI_AUDIO_HZ "call-huawei-audio-hz" +#define MM_CALL_HUAWEI_AUDIO_BITS "call-huawei-audio-bits" + typedef struct _MMCallHuawei MMCallHuawei; typedef struct _MMCallHuaweiClass MMCallHuaweiClass; +typedef struct _MMCallHuaweiPrivate MMCallHuaweiPrivate; struct _MMCallHuawei { MMBaseCall parent; + MMCallHuaweiPrivate *priv; }; struct _MMCallHuaweiClass { @@ -41,6 +46,10 @@ GType mm_call_huawei_get_type (void); -MMBaseCall *mm_call_huawei_new (MMBaseModem *modem); +MMBaseCall *mm_call_huawei_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number, + guint audio_hz, + guint audio_bits); #endif /* MM_CALL_HUAWEI_H */ diff -Nru modemmanager-1.6.8/plugins/huawei/mm-modem-helpers-huawei.c modemmanager-1.10.0/plugins/huawei/mm-modem-helpers-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-modem-helpers-huawei.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-modem-helpers-huawei.c 2019-01-15 15:57:35.000000000 +0100 @@ -230,7 +230,7 @@ * actually 10.10.1.1. */ - r = g_regex_new ("\\^DHCP:\\s*([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),.*$", 0, 0, NULL); + r = g_regex_new ("\\^DHCP:\\s*(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),.*$", 0, 0, NULL); g_assert (r != NULL); matched = g_regex_match_full (r, reply, -1, 0, 0, &match_info, &match_error); @@ -257,8 +257,7 @@ } } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return matched; } @@ -324,8 +323,7 @@ } } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return matched; } @@ -389,8 +387,7 @@ mm_get_uint_from_match_info (match_info, 8, out_sys_submode); } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return matched; } @@ -1257,8 +1254,7 @@ } } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return ret; @@ -1329,8 +1325,7 @@ } } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return ret; @@ -1400,8 +1395,69 @@ ret = TRUE; done: - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); + g_regex_unref (r); + + return ret; +} + +/*****************************************************************************/ +/* ^CVOICE response parser */ + +gboolean +mm_huawei_parse_cvoice_response (const gchar *response, + guint *out_hz, + guint *out_bits, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info = NULL; + GError *match_error = NULL; + guint supported = 0, hz = 0, bits = 0; + gboolean ret = FALSE; + + /* ^CVOICE: <0=supported,1=unsupported>,,, */ + r = g_regex_new ("\\^CVOICE:\\s*(\\d)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)$", 0, 0, NULL); + g_assert (r != NULL); + + if (!g_regex_match_full (r, response, -1, 0, 0, &match_info, &match_error)) { + if (match_error) { + g_propagate_error (error, match_error); + g_prefix_error (error, "Could not parse ^CVOICE results: "); + } else { + g_set_error_literal (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't match ^CVOICE reply"); + } + } else { + /* Remember that g_match_info_get_match_count() includes match #0 */ + g_assert (g_match_info_get_match_count (match_info) >= 5); + + if (mm_get_uint_from_match_info (match_info, 1, &supported) && + mm_get_uint_from_match_info (match_info, 2, &hz) && + mm_get_uint_from_match_info (match_info, 3, &bits)) { + if (supported == 0) { + if (out_hz) + *out_hz = hz; + if (out_bits) + *out_bits = bits; + ret = TRUE; + } else { + g_set_error_literal (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "^CVOICE not supported by this device"); + } + } else { + g_set_error_literal (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse ^CVOICE reply"); + } + } + + g_match_info_free (match_info); g_regex_unref (r); return ret; diff -Nru modemmanager-1.6.8/plugins/huawei/mm-modem-helpers-huawei.h modemmanager-1.10.0/plugins/huawei/mm-modem-helpers-huawei.h --- modemmanager-1.6.8/plugins/huawei/mm-modem-helpers-huawei.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-modem-helpers-huawei.h 2019-01-15 15:57:35.000000000 +0100 @@ -151,4 +151,12 @@ guint *out_value5, GError **error); +/*****************************************************************************/ +/* ^CVOICE response parser */ + +gboolean mm_huawei_parse_cvoice_response (const gchar *response, + guint *hz, + guint *bits, + GError **error); + #endif /* MM_MODEM_HELPERS_HUAWEI_H */ diff -Nru modemmanager-1.6.8/plugins/huawei/mm-plugin-huawei.c modemmanager-1.10.0/plugins/huawei/mm-plugin-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-plugin-huawei.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-plugin-huawei.c 2019-01-15 15:57:35.000000000 +0100 @@ -75,8 +75,6 @@ typedef struct { MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; gboolean curc_done; guint curc_retries; gboolean getportmode_done; @@ -84,15 +82,10 @@ } HuaweiCustomInitContext; static void -huawei_custom_init_context_complete_and_free (HuaweiCustomInitContext *ctx) +huawei_custom_init_context_free (HuaweiCustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (HuaweiCustomInitContext, ctx); } @@ -101,10 +94,10 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void huawei_custom_init_step (HuaweiCustomInitContext *ctx); +static void huawei_custom_init_step (GTask *task); static void cache_port_mode (MMDevice *device, @@ -129,11 +122,14 @@ static void getportmode_ready (MMPortSerialAt *port, GAsyncResult *res, - HuaweiCustomInitContext *ctx) + GTask *task) { + HuaweiCustomInitContext *ctx; const gchar *response; GError *error = NULL; + ctx = g_task_get_task_data (task); + response = mm_port_serial_at_command_finish (port, res, &error); if (error) { mm_dbg ("(Huawei) couldn't get port mode: '%s'", @@ -175,18 +171,20 @@ if (error) g_error_free (error); - huawei_custom_init_step (ctx); + huawei_custom_init_step (task); } static void curc_ready (MMPortSerialAt *port, GAsyncResult *res, - HuaweiCustomInitContext *ctx) + GTask *task) { - const gchar *response; + HuaweiCustomInitContext *ctx; GError *error = NULL; - response = mm_port_serial_at_command_finish (port, res, &error); + ctx = g_task_get_task_data (task); + + mm_port_serial_at_command_finish (port, res, &error); if (error) { /* Retry if we get a timeout error */ if (g_error_matches (error, @@ -206,7 +204,7 @@ if (error) g_error_free (error); - huawei_custom_init_step (ctx); + huawei_custom_init_step (task); } static void @@ -227,9 +225,9 @@ /* Only expect ttys for next probing attempt */ if (g_str_equal (mm_port_probe_get_port_subsys (probe), "tty")) { - gint usbif; + guint usbif; - usbif = g_udev_device_get_property_as_int (mm_port_probe_peek_port (probe), "ID_USB_INTERFACE_NUM"); + usbif = mm_kernel_device_get_property_as_int_hex (mm_port_probe_peek_port (probe), "ID_USB_INTERFACE_NUM"); if (usbif == fi_ctx->first_usbif) { /* This is the one we just probed, which wasn't yet removed, so just skip it */ } else if (usbif > fi_ctx->first_usbif && @@ -251,17 +249,20 @@ } static void -huawei_custom_init_step (HuaweiCustomInitContext *ctx) +huawei_custom_init_step (GTask *task) { + HuaweiCustomInitContext *ctx; FirstInterfaceContext *fi_ctx; - GUdevDevice *port; + MMKernelDevice *port; + + ctx = g_task_get_task_data (task); /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_task_return_error_if_cancelled (task)) { mm_dbg ("(Huawei) no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - huawei_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -269,10 +270,10 @@ if (ctx->curc_retries == 0) { /* All retries consumed, probably not an AT port */ mm_port_probe_set_result_at (ctx->probe, FALSE); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); /* Try with next */ try_next_usbif (mm_port_probe_peek_device (ctx->probe)); - huawei_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -284,18 +285,18 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)curc_ready, - ctx); + task); return; } /* Try to get a port map from the modem */ port = mm_port_probe_peek_port (ctx->probe); - if (!ctx->getportmode_done && !g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) { + if (!ctx->getportmode_done && !mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_HUAWEI_DISABLE_GETPORTMODE")) { if (ctx->getportmode_retries == 0) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - huawei_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -306,9 +307,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)getportmode_ready, - ctx); + task); return; } @@ -317,8 +318,8 @@ g_assert (fi_ctx != NULL); fi_ctx->custom_init_run = TRUE; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - huawei_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static gboolean @@ -341,6 +342,7 @@ MMDevice *device; FirstInterfaceContext *fi_ctx; HuaweiCustomInitContext *ctx; + GTask *task; device = mm_port_probe_peek_device (probe); @@ -377,33 +379,31 @@ } ctx = g_slice_new (HuaweiCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - huawei_custom_init); ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->curc_done = FALSE; ctx->curc_retries = 3; ctx->getportmode_done = FALSE; ctx->getportmode_retries = 3; + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)huawei_custom_init_context_free); + /* Custom init only to be run in the first interface */ - if (g_udev_device_get_property_as_int (mm_port_probe_peek_port (probe), - "ID_USB_INTERFACE_NUM") != fi_ctx->first_usbif) { + if (mm_kernel_device_get_property_as_int_hex (mm_port_probe_peek_port (probe), + "ID_USB_INTERFACE_NUM") != fi_ctx->first_usbif) { if (fi_ctx->custom_init_run) /* If custom init was run already, we can consider this as successfully run */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); else /* Otherwise, we'll need to defer the probing a bit more */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY, - "Defer needed"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY, + "Defer needed"); - huawei_custom_init_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -413,7 +413,7 @@ fi_ctx->timeout_id = 0; } - huawei_custom_init_step (ctx); + huawei_custom_init_step (task); } /*****************************************************************************/ @@ -431,9 +431,9 @@ /* Now we propagate the tags to the specific port probes */ for (l = probes; l; l = g_list_next (l)) { MMPortSerialAtFlag at_port_flags = MM_PORT_SERIAL_AT_FLAG_NONE; - gint usbif; + guint usbif; - usbif = g_udev_device_get_property_as_int (mm_port_probe_peek_port (MM_PORT_PROBE (l->data)), "ID_USB_INTERFACE_NUM"); + usbif = mm_kernel_device_get_property_as_int_hex (mm_port_probe_peek_port (MM_PORT_PROBE (l->data)), "ID_USB_INTERFACE_NUM"); if (GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (device), TAG_GETPORTMODE_SUPPORTED))) { if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_PCUI_PORT))) { @@ -481,7 +481,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -493,7 +493,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Huawei modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -504,7 +504,7 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { mm_dbg ("MBIM-powered Huawei modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -512,7 +512,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_huawei_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_huawei_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -525,34 +525,19 @@ MMPortProbe *probe, GError **error) { - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - GUdevDevice *port; + MMPortSerialAtFlag pflags; + MMKernelDevice *port; MMPortType port_type; port_type = mm_port_probe_get_port_type (probe); port = mm_port_probe_peek_port (probe); - if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_AT_PORT")) { - mm_dbg ("(%s/%s)' Port flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_MODEM_PORT")) { - mm_dbg ("(%s/%s) Port flagged as PPP", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PPP; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_GPS_PORT")) { - mm_dbg ("(%s/%s) Port flagged as GPS", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - port_type = MM_PORT_TYPE_GPS; - } else { + pflags = (MMPortSerialAtFlag) GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS)); + if (pflags != MM_PORT_SERIAL_AT_FLAG_NONE) { gchar *str; - pflags = (MMPortSerialAtFlag) GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS)); str = mm_port_serial_at_flag_build_string_from_mask (pflags); - mm_dbg ("(%s/%s) Port will have AT flags '%s'", + mm_dbg ("(%s/%s) huawei port will have AT flags '%s'", mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe), str); @@ -560,9 +545,7 @@ } return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + port, port_type, pflags, error); diff -Nru modemmanager-1.6.8/plugins/huawei/mm-sim-huawei.c modemmanager-1.10.0/plugins/huawei/mm-sim-huawei.c --- modemmanager-1.6.8/plugins/huawei/mm-sim-huawei.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/mm-sim-huawei.c 2018-11-15 09:55:53.000000000 +0100 @@ -41,38 +41,30 @@ GAsyncResult *res, GError **error) { - gchar *iccid; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - iccid = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("loaded SIM identifier: %s", iccid); - return g_strdup (iccid); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_sim_identifier_ready (MMSimHuawei *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; gchar *simid; simid = MM_BASE_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier_finish (MM_BASE_SIM (self), res, &error); if (simid) - g_simple_async_result_set_op_res_gpointer (simple, simid, g_free); + g_task_return_pointer (task, simid, g_free); else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void iccid_read_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseSim *self; const gchar *response; @@ -89,19 +81,17 @@ parsed = mm_3gpp_parse_iccid (p, NULL); if (parsed) { - g_simple_async_result_set_op_res_gpointer (simple, parsed, g_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, parsed, g_free); + g_object_unref (task); return; } error: /* Chain up to parent method; older devices don't support ^ICCID */ - self = MM_BASE_SIM (g_async_result_get_source_object (G_ASYNC_RESULT (simple))); + self = g_task_get_source_object (task); MM_BASE_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier (self, (GAsyncReadyCallback) parent_load_sim_identifier_ready, - simple); - g_object_unref (self); + task); } static void @@ -122,10 +112,7 @@ 5, FALSE, (GAsyncReadyCallback)iccid_read_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_sim_identifier)); + g_task_new (self, NULL, callback, user_data)); g_object_unref (modem); } diff -Nru modemmanager-1.6.8/plugins/huawei/tests/test-modem-helpers-huawei.c modemmanager-1.10.0/plugins/huawei/tests/test-modem-helpers-huawei.c --- modemmanager-1.6.8/plugins/huawei/tests/test-modem-helpers-huawei.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/huawei/tests/test-modem-helpers-huawei.c 2018-11-15 09:55:53.000000000 +0100 @@ -154,10 +154,16 @@ static const DhcpTest dhcp_tests[] = { { "^DHCP:a3ec5c64,f8ffffff,a1ec5c64,a1ec5c64,2200b10a,74bba80a,236800,236800\r\n", "100.92.236.163", 29, "100.92.236.161", "10.177.0.34", "10.168.187.116" }, + { "^DHCP:0xa3ec5c64,0xf8ffffff,0xa1ec5c64,0xa1ec5c64,0x2200b10a,0x74bba80a,236800,236800\r\n", + "100.92.236.163", 29, "100.92.236.161", "10.177.0.34", "10.168.187.116" }, { "^DHCP: 1010A0A,FCFFFFFF,2010A0A,2010A0A,0,0,150000000,150000000\r\n", "10.10.1.1", 30, "10.10.1.2", "0.0.0.0", "0.0.0.0" }, { "^DHCP: CCDB080A,F8FFFFFF,C9DB080A,C9DB080A,E67B59C0,E77B59C0,85600,85600\r\n", "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, + { "^DHCP: 0xCCDB080A,0xF8FFFFFF,0xC9DB080A,0xC9DB080A,0xE67B59C0,0xE77B59C0,85600,85600\r\n", + "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, + { "^DHCP: 0XCCDB080A,0XF8FFFFFF,0XC9DB080A,0XC9DB080A,0XE67B59C0,0XE77B59C0,85600,85600\r\n", + "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, { NULL } }; @@ -1291,7 +1297,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/huawei/ndisstatqry", test_ndisstatqry); diff -Nru modemmanager-1.6.8/plugins/icera/mm-broadband-bearer-icera.c modemmanager-1.10.0/plugins/icera/mm-broadband-bearer-icera.c --- modemmanager-1.6.8/plugins/icera/mm-broadband-bearer-icera.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/icera/mm-broadband-bearer-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -63,43 +63,16 @@ /* 3GPP IP config retrieval (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerIcera *self; MMBaseModem *modem; MMPortSerialAt *primary; guint cid; - GSimpleAsyncResult *result; } GetIpConfig3gppContext; -static GetIpConfig3gppContext * -get_ip_config_3gpp_context_new (MMBroadbandBearerIcera *self, - MMBaseModem *modem, - MMPortSerialAt *primary, - guint cid, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GetIpConfig3gppContext *ctx; - - ctx = g_new0 (GetIpConfig3gppContext, 1); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (modem); - ctx->primary = g_object_ref (primary); - ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_ip_config_3gpp_context_new); - return ctx; -} - static void -get_ip_config_context_complete_and_free (GetIpConfig3gppContext *ctx) +get_ip_config_context_free (GetIpConfig3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } @@ -113,12 +86,10 @@ MMBearerConnectResult *configs; MMBearerIpConfig *ipv4, *ipv6; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + configs = g_task_propagate_pointer (G_TASK (res), error); + if (!configs) return FALSE; - configs = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_assert (configs); - ipv4 = mm_bearer_connect_result_peek_ipv4_config (configs); ipv6 = mm_bearer_connect_result_peek_ipv6_config (configs); g_assert (ipv4 || ipv6); @@ -127,23 +98,27 @@ if (ipv6_config && ipv6) *ipv6_config = g_object_ref (ipv6); + mm_bearer_connect_result_unref (configs); return TRUE; } static void ip_config_ready (MMBaseModem *modem, GAsyncResult *res, - GetIpConfig3gppContext *ctx) + GTask *task) { + GetIpConfig3gppContext *ctx; MMBearerIpConfig *ipv4_config = NULL; MMBearerIpConfig *ipv6_config = NULL; const gchar *response; GError *error = NULL; MMBearerConnectResult *connect_result; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); goto out; } @@ -152,34 +127,34 @@ &ipv4_config, &ipv6_config, &error)) { - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); goto out; } if (!ipv4_config && !ipv6_config) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get IP config: couldn't parse response '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get IP config: couldn't parse response '%s'", + response); goto out; } connect_result = mm_bearer_connect_result_new (MM_PORT (ctx->primary), ipv4_config, ipv6_config); - g_simple_async_result_set_op_res_gpointer (ctx->result, - connect_result, - (GDestroyNotify)mm_bearer_connect_result_unref); + g_task_return_pointer (task, + connect_result, + (GDestroyNotify)mm_bearer_connect_result_unref); out: + g_object_unref (task); g_clear_object (&ipv4_config); g_clear_object (&ipv6_config); - get_ip_config_context_complete_and_free (ctx); } static void -get_ip_config_3gpp (MMBroadbandBearer *self, +get_ip_config_3gpp (MMBroadbandBearer *_self, MMBroadbandModem *modem, MMPortSerialAt *primary, MMPortSerialAt *secondary, @@ -189,16 +164,19 @@ GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (_self); GetIpConfig3gppContext *ctx; + GTask *task; + + ctx = g_new0 (GetIpConfig3gppContext, 1); + ctx->modem = g_object_ref (MM_BASE_MODEM (modem)); + ctx->primary = g_object_ref (primary); + ctx->cid = cid; - ctx = get_ip_config_3gpp_context_new (MM_BROADBAND_BEARER_ICERA (self), - MM_BASE_MODEM (modem), - primary, - cid, - callback, - user_data); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)get_ip_config_context_free); - if (ctx->self->priv->default_ip_method == MM_BEARER_IP_METHOD_STATIC) { + if (self->priv->default_ip_method == MM_BEARER_IP_METHOD_STATIC) { gchar *command; command = g_strdup_printf ("%%IPDPADDR=%u", cid); @@ -210,13 +188,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)ip_config_ready, - ctx); + task); g_free (command); return; } /* Otherwise, DHCP */ - if (ctx->self->priv->default_ip_method == MM_BEARER_IP_METHOD_DHCP) { + if (self->priv->default_ip_method == MM_BEARER_IP_METHOD_DHCP) { MMBearerConnectResult *connect_result; MMBearerIpConfig *ipv4_config = NULL, *ipv6_config = NULL; @@ -236,10 +214,10 @@ g_clear_object (&ipv4_config); g_clear_object (&ipv6_config); - g_simple_async_result_set_op_res_gpointer (ctx->result, - connect_result, - (GDestroyNotify)mm_bearer_connect_result_unref); - get_ip_config_context_complete_and_free (ctx); + g_task_return_pointer (task, + connect_result, + (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); return; } @@ -249,58 +227,44 @@ /*****************************************************************************/ /* 3GPP disconnection */ -typedef struct { - MMBroadbandBearerIcera *self; - GSimpleAsyncResult *result; -} Disconnect3gppContext; - -static void -disconnect_3gpp_context_complete_and_free (Disconnect3gppContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean disconnect_3gpp_finish (MMBroadbandBearer *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean disconnect_3gpp_timed_out_cb (MMBroadbandBearerIcera *self) { - Disconnect3gppContext *ctx; + GTask *task; - /* Recover context */ - ctx = self->priv->disconnect_pending; + /* Recover disconnection task */ + task = self->priv->disconnect_pending; self->priv->disconnect_pending = NULL; self->priv->disconnect_pending_id = 0; - g_simple_async_result_set_error (ctx->result, - MM_SERIAL_ERROR, - MM_SERIAL_ERROR_RESPONSE_TIMEOUT, - "Disconnection attempt timed out"); + g_task_return_new_error (task, + MM_SERIAL_ERROR, + MM_SERIAL_ERROR_RESPONSE_TIMEOUT, + "Disconnection attempt timed out"); + g_object_unref (task); - disconnect_3gpp_context_complete_and_free (ctx); return G_SOURCE_REMOVE; } static void -report_disconnect_status (MMBroadbandBearerIcera *self, - MMBearerConnectionStatus status) +process_pending_disconnect_attempt (MMBroadbandBearerIcera *self, + MMBearerConnectionStatus status) { - Disconnect3gppContext *ctx; + GTask *task; - /* Recover context */ - ctx = self->priv->disconnect_pending; + /* Recover disconnection task */ + task = self->priv->disconnect_pending; self->priv->disconnect_pending = NULL; - g_assert (ctx != NULL); + g_assert (task != NULL); /* Cleanup timeout, if any */ if (self->priv->disconnect_pending_id) { @@ -310,19 +274,19 @@ /* Received 'CONNECTED' during a disconnection attempt? */ if (status == MM_BEARER_CONNECTION_STATUS_CONNECTED) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Disconnection failed"); - disconnect_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Disconnection failed"); + g_object_unref (task); return; } /* Received 'DISCONNECTED' during a disconnection attempt? */ if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED || status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_3gpp_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -335,17 +299,17 @@ GAsyncResult *res, MMBroadbandBearerIcera *self) { - Disconnect3gppContext *ctx; + GTask *task; GError *error = NULL; - /* Try to recover the disconnection context. If none found, it means the - * context was already completed and we have nothing else to do. */ - ctx = self->priv->disconnect_pending; + /* Try to recover the disconnection task. If none found, it means the + * task was already completed and we have nothing else to do. */ + task = self->priv->disconnect_pending; /* Balance refcount with the extra ref we passed to command_full() */ g_object_unref (self); - if (!ctx) { + if (!task) { mm_dbg ("Disconnection context was finished already by an unsolicited message"); /* Run _finish() to finalize the async call, even if we don't care @@ -357,8 +321,8 @@ mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { self->priv->disconnect_pending = NULL; - g_simple_async_result_take_error (ctx->result, error); - disconnect_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -380,23 +344,18 @@ { MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (bearer); gchar *command; - Disconnect3gppContext *ctx; + GTask *task; - ctx = g_new0 (Disconnect3gppContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect_3gpp); + task = g_task_new (self, NULL, callback, user_data); /* The unsolicited response to %IPDPACT may come before the OK does. - * We will keep the disconnection context in the bearer private data so + * We will keep the disconnection task in the bearer private data so * that it is accessible from the unsolicited message handler. Note - * also that we do NOT pass the ctx to the GAsyncReadyCallback, as it + * also that we do NOT pass the task to the GAsyncReadyCallback, as it * may not be valid any more when the callback is called (it may be * already completed in the unsolicited handling) */ - g_assert (ctx->self->priv->disconnect_pending == NULL); - ctx->self->priv->disconnect_pending = ctx; + g_assert (self->priv->disconnect_pending == NULL); + self->priv->disconnect_pending = task; command = g_strdup_printf ("%%IPDPACT=%d,0", cid); mm_base_modem_at_command_full ( @@ -408,7 +367,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_ipdpact_ready, - g_object_ref (ctx->self)); /* we pass the bearer object! */ + g_object_ref (self)); /* we pass the bearer object! */ g_free (command); } @@ -416,84 +375,60 @@ /* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerIcera *self; - MMBaseModem *modem; + MMBaseModem *modem; MMPortSerialAt *primary; - guint cid; - GCancellable *cancellable; - GSimpleAsyncResult *result; - MMPort *data; - guint authentication_retries; - GError *saved_error; + guint cid; + MMPort *data; + guint authentication_retries; + GError *saved_error; } Dial3gppContext; static void -dial_3gpp_context_complete_and_free (Dial3gppContext *ctx) +dial_3gpp_context_free (Dial3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->data) - g_object_unref (ctx->data); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->primary); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); + g_assert (!ctx->saved_error); + g_clear_object (&ctx->data); + g_clear_object (&ctx->primary); + g_clear_object (&ctx->modem); g_slice_free (Dial3gppContext, ctx); } -static gboolean -dial_3gpp_context_set_error_if_cancelled (Dial3gppContext *ctx, - GError **error) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Dial operation has been cancelled"); - return TRUE; -} - -static gboolean -dial_3gpp_context_complete_and_free_if_cancelled (Dial3gppContext *ctx) -{ - GError *error = NULL; - - if (!dial_3gpp_context_set_error_if_cancelled (ctx, &error)) - return FALSE; - - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); - return TRUE; -} - static MMPort * -dial_3gpp_finish (MMBroadbandBearer *self, - GAsyncResult *res, - GError **error) +dial_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_PORT (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return MM_PORT (g_task_propagate_pointer (G_TASK (res), error)); } static void -connect_reset_ready (MMBaseModem *modem, +connect_reset_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; + + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_full_finish (modem, res, NULL); - /* error should have already been set in the simple async result */ - dial_3gpp_context_complete_and_free (ctx); + /* When reset is requested, it was either cancelled or an error was stored */ + if (!g_task_return_error_if_cancelled (task)) { + g_assert (ctx->saved_error); + g_task_return_error (task, ctx->saved_error); + ctx->saved_error = NULL; + } + + g_object_unref (task); } static void -connect_reset (Dial3gppContext *ctx) +connect_reset (GTask *task) { - gchar *command; + Dial3gppContext *ctx; + gchar *command; + + ctx = g_task_get_task_data (task); /* Need to reset the connection attempt */ command = g_strdup_printf ("%%IPDPACT=%d,0", ctx->cid); @@ -512,81 +447,44 @@ static gboolean connect_timed_out_cb (MMBroadbandBearerIcera *self) { + GTask *task; Dial3gppContext *ctx; - /* Recover context and remove it from the private info */ - ctx = self->priv->connect_pending; + /* Cleanup timeout ID */ + self->priv->connect_pending_id = 0; + + /* Recover task and own it */ + task = self->priv->connect_pending; self->priv->connect_pending = NULL; + g_assert (task); - /* Remove cancellation, if found */ - if (self->priv->connect_cancellable_id) { - g_cancellable_disconnect (ctx->cancellable, - self->priv->connect_cancellable_id); - self->priv->connect_cancellable_id = 0; - } + ctx = g_task_get_task_data (task); /* Remove closed port watch, if found */ - if (ctx && self->priv->connect_port_closed_id) { + if (self->priv->connect_port_closed_id) { g_signal_handler_disconnect (ctx->primary, self->priv->connect_port_closed_id); self->priv->connect_port_closed_id = 0; } - /* Cleanup timeout ID */ - self->priv->connect_pending_id = 0; - - /* If we were cancelled, prefer that error */ - if (ctx->saved_error) { - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - } else - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Connection attempt timed out"); + /* Setup error to return after the reset */ + g_assert (!ctx->saved_error); + ctx->saved_error = g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Connection attempt timed out"); /* It's probably pointless to try to reset this here, but anyway... */ - connect_reset (ctx); + connect_reset (task); return G_SOURCE_REMOVE; } static void -connect_cancelled_cb (GCancellable *cancellable, - MMBroadbandBearerIcera *self) -{ - Dial3gppContext *ctx; - - /* Recover context but DON'T remove it from the private info */ - ctx = self->priv->connect_pending; - - /* Remove the cancellable - * NOTE: we shouldn't remove the timeout yet. We still need to wait - * to get connected before running the explicit connection reset */ - self->priv->connect_cancellable_id = 0; - - /* Store cancelled error */ - g_assert (dial_3gpp_context_set_error_if_cancelled (ctx, &ctx->saved_error)); - - /* We cannot reset right here, we need to wait for the connection - * attempt to finish */ -} - -static void -forced_close_cb (MMPortSerial *port, - MMBroadbandBearerIcera *self) -{ - /* Just treat the forced close event as any other unsolicited message */ - mm_base_bearer_report_connection_status (MM_BASE_BEARER (self), - MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED); -} - -static void -ier_query_ready (MMBaseModem *modem, +ier_query_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { const gchar *response; - GError *activation_error = NULL; + GError *activation_error = NULL; response = mm_base_modem_at_command_full_finish (modem, res, NULL); if (response) { @@ -605,42 +503,34 @@ } if (activation_error) - g_simple_async_result_take_error (ctx->result, activation_error); + g_task_return_error (task, activation_error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Call setup failed"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Call setup failed"); + g_object_unref (task); } static void -report_connect_status (MMBroadbandBearerIcera *self, - MMBearerConnectionStatus status) +process_pending_connect_attempt (MMBroadbandBearerIcera *self, + MMBearerConnectionStatus status) { + GTask *task; Dial3gppContext *ctx; - g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || - status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED || - status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); - - /* Recover context and remove it from the private info */ - ctx = self->priv->connect_pending; + /* Recover task and remove both cancellation and timeout (if any)*/ + g_assert (self->priv->connect_pending); + task = self->priv->connect_pending; self->priv->connect_pending = NULL; - g_assert (ctx != NULL); - /* Cleanup cancellable, timeout and port closed watch, if any */ + ctx = g_task_get_task_data (task); + if (self->priv->connect_pending_id) { g_source_remove (self->priv->connect_pending_id); self->priv->connect_pending_id = 0; } - if (self->priv->connect_cancellable_id) { - g_cancellable_disconnect (ctx->cancellable, - self->priv->connect_cancellable_id); - self->priv->connect_cancellable_id = 0; - } - if (self->priv->connect_port_closed_id) { g_signal_handler_disconnect (ctx->primary, self->priv->connect_port_closed_id); self->priv->connect_port_closed_id = 0; @@ -648,29 +538,21 @@ /* Received 'CONNECTED' during a connection attempt? */ if (status == MM_BEARER_CONNECTION_STATUS_CONNECTED) { - /* If we wanted to get cancelled before, do it now */ - if (ctx->saved_error) { - /* Keep error */ - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - /* Cancel connection */ - connect_reset (ctx); + /* If we wanted to get cancelled before, do it now. */ + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { + connect_reset (task); return; } - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->data), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); return; } /* If we wanted to get cancelled before and now we couldn't connect, * use the cancelled error and return */ - if (ctx->saved_error) { - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - dial_3gpp_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } @@ -685,51 +567,56 @@ FALSE, FALSE, /* raw */ NULL, /* cancellable */ - (GAsyncReadyCallback)ier_query_ready, - ctx); + (GAsyncReadyCallback) ier_query_ready, + task); return; } /* Otherwise, received 'DISCONNECTED' during a connection attempt? */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Call setup failed"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Call setup failed"); + g_object_unref (task); } static void -activate_ready (MMBaseModem *modem, - GAsyncResult *res, +forced_close_cb (MMBroadbandBearerIcera *self) +{ + /* Just treat the forced close event as any other unsolicited message */ + mm_base_bearer_report_connection_status (MM_BASE_BEARER (self), + MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED); +} + +static void +activate_ready (MMBaseModem *modem, + GAsyncResult *res, MMBroadbandBearerIcera *self) { + GTask *task; Dial3gppContext *ctx; - GError *error = NULL; + GError *error = NULL; + + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; /* Try to recover the connection context. If none found, it means the * context was already completed and we have nothing else to do. */ - ctx = self->priv->connect_pending; - - /* Balance refcount with the extra ref we passed to command_full() */ - g_object_unref (self); - - if (!ctx) { + if (!task) { mm_dbg ("Connection context was finished already by an unsolicited message"); - /* Run _finish() to finalize the async call, even if we don't care * the result */ mm_base_modem_at_command_full_finish (modem, res, NULL); - return; + goto out; } /* Errors on the dial command are fatal */ if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - self->priv->connect_pending = NULL; - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); - return; + g_task_return_error (task, error); + g_object_unref (task); + goto out; } + /* Track again */ + self->priv->connect_pending = task; + /* We will now setup a timeout and keep the context in the bearer's private. * Reports of modem being connected will arrive via unsolicited messages. * This timeout should be long enough. Actually... ideally should never get @@ -738,40 +625,45 @@ (GSourceFunc)connect_timed_out_cb, self); - /* From now on, if we get cancelled, we'll still need to wait for the connection - * attempt to finish before resetting it */ - self->priv->connect_cancellable_id = g_cancellable_connect (ctx->cancellable, - G_CALLBACK (connect_cancelled_cb), - self, - NULL); - /* If we get the port closed, we treat as a connect error */ - self->priv->connect_port_closed_id = g_signal_connect (ctx->primary, - "forced-close", - G_CALLBACK (forced_close_cb), - self); + ctx = g_task_get_task_data (task); + self->priv->connect_port_closed_id = g_signal_connect_swapped (ctx->primary, + "forced-close", + G_CALLBACK (forced_close_cb), + self); + + out: + /* Balance refcount with the extra ref we passed to command_full() */ + g_object_unref (self); } -static void authenticate (Dial3gppContext *ctx); +static void authenticate (GTask *task); static gboolean -retry_authentication_cb (Dial3gppContext *ctx) +retry_authentication_cb (GTask *task) { - authenticate (ctx); + authenticate (task); return G_SOURCE_REMOVE; } static void -authenticate_ready (MMBaseModem *modem, +authenticate_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { - GError *error = NULL; - gchar *command; + MMBroadbandBearerIcera *self; + Dial3gppContext *ctx; + GError *error = NULL; + gchar *command; /* If cancelled, complete */ - if (dial_3gpp_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { /* Retry configuring the context. It sometimes fails with a 583 @@ -780,13 +672,13 @@ if (++ctx->authentication_retries < 3) { mm_dbg ("Authentication failed: '%s'; retrying...", error->message); g_error_free (error); - g_timeout_add_seconds (1, (GSourceFunc)retry_authentication_cb, ctx); + g_timeout_add_seconds (1, (GSourceFunc)retry_authentication_cb, task); return; } /* Return an error */ - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -796,34 +688,38 @@ * also that we do NOT pass the ctx to the GAsyncReadyCallback, as it * may not be valid any more when the callback is called (it may be * already completed in the unsolicited handling) */ - g_assert (ctx->self->priv->connect_pending == NULL); - ctx->self->priv->connect_pending = ctx; + g_assert (self->priv->connect_pending == NULL); + self->priv->connect_pending = task; command = g_strdup_printf ("%%IPDPACT=%d,1", ctx->cid); - mm_base_modem_at_command_full ( - ctx->modem, - ctx->primary, - command, - 60, - FALSE, - FALSE, /* raw */ - NULL, /* cancellable */ - (GAsyncReadyCallback)activate_ready, - g_object_ref (ctx->self)); /* we pass the bearer object! */ + mm_base_modem_at_command_full (ctx->modem, + ctx->primary, + command, + 60, + FALSE, + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback) activate_ready, + g_object_ref (self)); /* we pass the bearer object! */ g_free (command); } static void -authenticate (Dial3gppContext *ctx) +authenticate (GTask *task) { - gchar *command; - const gchar *user; - const gchar *password; - MMBearerAllowedAuth allowed_auth; - - user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + MMBroadbandBearerIcera *self; + Dial3gppContext *ctx; + gchar *command; + const gchar *user; + const gchar *password; + MMBearerAllowedAuth allowed_auth; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); /* Both user and password are required; otherwise firmware returns an error */ if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) { @@ -832,7 +728,7 @@ } else { gchar *quoted_user; gchar *quoted_password; - guint icera_auth; + guint icera_auth; if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) { mm_dbg ("Using default (PAP) authentication method"); @@ -847,21 +743,23 @@ gchar *str; str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth); - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot use any of the specified authentication methods (%s)", - str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot use any of the specified authentication methods (%s)", + str); + g_object_unref (task); g_free (str); - dial_3gpp_context_complete_and_free (ctx); return; } - quoted_user = mm_port_serial_at_quote_string (user); + quoted_user = mm_port_serial_at_quote_string (user); quoted_password = mm_port_serial_at_quote_string (password); command = g_strdup_printf ("%%IPDPCFG=%d,0,%u,%s,%s", - ctx->cid, icera_auth, quoted_user, quoted_password); + ctx->cid, + icera_auth, + quoted_user, + quoted_password); g_free (quoted_user); g_free (quoted_password); } @@ -874,14 +772,14 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)authenticate_ready, - ctx); + task); g_free (command); } static void -deactivate_ready (MMBaseModem *modem, +deactivate_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { /* * Ignore any error here; %IPDPACT=ctx,0 will produce an error 767 @@ -890,13 +788,16 @@ */ mm_base_modem_at_command_full_finish (modem, res, NULL); - authenticate (ctx); + authenticate (task); } static void -connect_deactivate (Dial3gppContext *ctx) +connect_deactivate (GTask *task) { - gchar *command; + Dial3gppContext *ctx; + gchar *command; + + ctx = g_task_get_task_data (task); /* Deactivate the context we want to use before we try to activate * it. This handles the case where ModemManager crashed while @@ -913,66 +814,68 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)deactivate_ready, - ctx); + task); g_free (command); } static void -dial_3gpp (MMBroadbandBearer *self, - MMBaseModem *modem, - MMPortSerialAt *primary, - guint cid, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - Dial3gppContext *ctx; +dial_3gpp (MMBroadbandBearer *_self, + MMBaseModem *modem, + MMPortSerialAt *primary, + guint cid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (_self); + GTask *task; + Dial3gppContext *ctx; g_assert (primary != NULL); + task = g_task_new (self, cancellable, callback, user_data); + ctx = g_slice_new0 (Dial3gppContext); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (modem); + ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); - ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - dial_3gpp); - ctx->cancellable = g_object_ref (cancellable); + ctx->cid = cid; + g_task_set_task_data (task, ctx, (GDestroyNotify)dial_3gpp_context_free); /* We need a net data port */ ctx->data = mm_base_modem_get_best_data_port (modem, MM_PORT_TYPE_NET); if (!ctx->data) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No valid data port found to launch connection"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); + g_object_unref (task); return; } - connect_deactivate (ctx); + connect_deactivate (task); } /*****************************************************************************/ static void -report_connection_status (MMBaseBearer *bearer, - MMBearerConnectionStatus status) +report_connection_status (MMBaseBearer *_self, + MMBearerConnectionStatus status) { - MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (bearer); + MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (_self); + + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || + status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED || + status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); /* Process pending connection attempt */ if (self->priv->connect_pending) { - report_connect_status (self, status); + process_pending_connect_attempt (self, status); return; } /* Process pending disconnection attempt */ if (self->priv->disconnect_pending) { - report_disconnect_status (self, status); + process_pending_disconnect_attempt (self, status); return; } @@ -985,7 +888,7 @@ /* If no connection/disconnection attempt on-going, make sure we mark ourselves as * disconnected. Make sure we only pass 'DISCONNECTED' to the parent */ MM_BASE_BEARER_CLASS (mm_broadband_bearer_icera_parent_class)->report_connection_status ( - bearer, + _self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED); } } @@ -1091,7 +994,11 @@ object_class->get_property = get_property; object_class->set_property = set_property; + base_bearer_class->report_connection_status = report_connection_status; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; + broadband_bearer_class->dial_3gpp = dial_3gpp; broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp; diff -Nru modemmanager-1.6.8/plugins/icera/mm-broadband-modem-icera.c modemmanager-1.10.0/plugins/icera/mm-broadband-modem-icera.c --- modemmanager-1.6.8/plugins/icera/mm-broadband-modem-icera.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/icera/mm-broadband-modem-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -305,24 +305,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -332,14 +332,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint icera_mode = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_set_current_modes); + task = g_task_new (self, NULL, callback, user_data); /* * The core has checked the following: @@ -366,18 +363,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -388,7 +383,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } @@ -555,7 +550,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -597,12 +592,16 @@ guint *mask, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - *access_technologies = ((MMModemAccessTechnology) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res)))); + *access_technologies = (MMModemAccessTechnology) value; *mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; return TRUE; } @@ -610,26 +609,23 @@ static void nwstate_query_ready (MMBroadbandModemIcera *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { mm_dbg ("Couldn't query access technology: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); } else { /* * The unsolicited message handler will already have run and * removed the NWSTATE response, so we use the result from there. */ - g_simple_async_result_set_op_res_gpointer (operation_result, - GUINT_TO_POINTER (self->priv->last_act), - NULL); + g_task_return_int (task, self->priv->last_act); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -637,12 +633,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_access_technologies); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command ( MM_BASE_MODEM (self), @@ -650,7 +643,7 @@ 3, FALSE, (GAsyncReadyCallback)nwstate_query_ready, - result); + task); } /*****************************************************************************/ @@ -661,26 +654,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_ICERA (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -692,25 +683,21 @@ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events)); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -718,13 +705,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_ICERA (self), FALSE); @@ -732,7 +712,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -743,35 +723,33 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -782,7 +760,7 @@ 3, FALSE, (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void @@ -794,38 +772,33 @@ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events)); + g_task_new (self, NULL, callback, user_data)); } static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -833,7 +806,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static void @@ -847,10 +820,7 @@ 3, FALSE, (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -861,50 +831,41 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_BASE_BEARER (g_object_ref ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res)))); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_icera_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_icera_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void @@ -913,12 +874,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); /* If we get a NET port, create Icera bearer */ if (mm_base_modem_peek_best_data_port (MM_BASE_MODEM (self), MM_PORT_TYPE_NET)) { @@ -928,7 +886,7 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_icera_new_ready, - result); + task); return; } @@ -938,7 +896,7 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - result); + task); } /*****************************************************************************/ @@ -949,13 +907,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cfun_enable_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -964,13 +922,14 @@ if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED)) - g_simple_async_result_take_error (simple, error); - else + g_task_return_error (task, error); + else { g_error_free (error); + g_task_return_boolean (task, TRUE); + } } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -978,19 +937,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_up); - mm_base_modem_at_command (MM_BASE_MODEM (self), "+CFUN=1", 10, FALSE, (GAsyncReadyCallback)cfun_enable_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1056,16 +1008,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1074,9 +1023,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1088,18 +1036,15 @@ mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN2, pin2); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK2, puk2); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } else { - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid unlock retries response: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -1113,10 +1058,7 @@ 3, FALSE, (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_retries)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1137,20 +1079,20 @@ static const Band modem_bands[] = { /* Sort 3G first since it's preferred */ - { MM_MODEM_BAND_U2100, "FDD_BAND_I", FALSE }, - { MM_MODEM_BAND_U1900, "FDD_BAND_II", FALSE }, - { MM_MODEM_BAND_U1800, "FDD_BAND_III", FALSE }, - { MM_MODEM_BAND_U17IV, "FDD_BAND_IV", FALSE }, - { MM_MODEM_BAND_U800, "FDD_BAND_VI", FALSE }, - { MM_MODEM_BAND_U850, "FDD_BAND_V", FALSE }, - { MM_MODEM_BAND_U900, "FDD_BAND_VIII", FALSE }, + { MM_MODEM_BAND_UTRAN_1, "FDD_BAND_I", FALSE }, + { MM_MODEM_BAND_UTRAN_2, "FDD_BAND_II", FALSE }, + { MM_MODEM_BAND_UTRAN_3, "FDD_BAND_III", FALSE }, + { MM_MODEM_BAND_UTRAN_4, "FDD_BAND_IV", FALSE }, + { MM_MODEM_BAND_UTRAN_5, "FDD_BAND_V", FALSE }, + { MM_MODEM_BAND_UTRAN_6, "FDD_BAND_VI", FALSE }, + { MM_MODEM_BAND_UTRAN_8, "FDD_BAND_VIII", FALSE }, /* 2G second */ - { MM_MODEM_BAND_G850, "G850", FALSE }, - { MM_MODEM_BAND_DCS, "DCS", FALSE }, - { MM_MODEM_BAND_EGSM, "EGSM", FALSE }, - { MM_MODEM_BAND_PCS, "PCS", FALSE }, + { MM_MODEM_BAND_G850, "G850", FALSE }, + { MM_MODEM_BAND_DCS, "DCS", FALSE }, + { MM_MODEM_BAND_EGSM, "EGSM", FALSE }, + { MM_MODEM_BAND_PCS, "PCS", FALSE }, /* And ANY last since it's most inclusive */ - { MM_MODEM_BAND_ANY, "ANY", FALSE }, + { MM_MODEM_BAND_ANY, "ANY", FALSE }, }; static const guint modem_band_any_bit = 1 << (G_N_ELEMENTS (modem_bands) - 1); @@ -1243,17 +1185,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_supported_bands_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; SupportedBandsContext *ctx = NULL; @@ -1262,7 +1200,7 @@ mm_base_modem_at_sequence_finish (self, res, (gpointer) &ctx, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), ctx->idx); @@ -1282,12 +1220,9 @@ g_array_prepend_val (bands, b->band); } - g_simple_async_result_set_op_res_gpointer (simple, - bands, - (GDestroyNotify) g_array_unref); + g_task_return_pointer (task, bands, (GDestroyNotify) g_array_unref); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static gboolean @@ -1315,7 +1250,7 @@ static void load_supported_bands_get_current_bands_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { SupportedBandsContext *ctx; const gchar *response; @@ -1326,9 +1261,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query current bands: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1366,7 +1300,7 @@ ctx, (GDestroyNotify) supported_bands_context_free, (GAsyncReadyCallback) load_supported_bands_ready, - operation_result); + task); } static void @@ -1385,10 +1319,7 @@ 3, FALSE, (GAsyncReadyCallback)load_supported_bands_get_current_bands_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_bands)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1399,17 +1330,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_current_bands_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GArray *bands; const gchar *response; @@ -1420,9 +1347,7 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query current bands: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); } else { /* Parse bands from Icera response into MM band numbers */ parsed = parse_bands (response, &len); @@ -1435,12 +1360,9 @@ } g_slist_free_full (parsed, (GDestroyNotify) band_free); - g_simple_async_result_set_op_res_gpointer (operation_result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); } + g_object_unref (task); } static void @@ -1454,17 +1376,13 @@ 3, FALSE, (GAsyncReadyCallback)load_current_bands_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_bands)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Set current bands (Modem interface) */ typedef struct { - GSimpleAsyncResult *result; guint bandbits; guint enablebits; guint disablebits; @@ -1482,43 +1400,38 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void set_one_band (MMIfaceModem *self, SetCurrentBandsContext *ctx); - -static void -set_current_bands_context_complete_and_free (SetCurrentBandsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_slice_free (SetCurrentBandsContext, ctx); -} +static void set_one_band (MMIfaceModem *self, GTask *task); static void set_current_bands_next (MMIfaceModem *self, GAsyncResult *res, - SetCurrentBandsContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) { mm_dbg ("Couldn't set current bands: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - set_current_bands_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - set_one_band (self, ctx); + set_one_band (self, task); } static void set_one_band (MMIfaceModem *self, - SetCurrentBandsContext *ctx) + GTask *task) { + SetCurrentBandsContext *ctx; guint enable, band; gchar *command; + ctx = g_task_get_task_data (task); + /* Find the next band to enable or disable, always doing enables first */ enable = 1; band = ffs (ctx->enablebits); @@ -1528,8 +1441,8 @@ } if (band == 0) { /* Both enabling and disabling are done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_bands_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1554,7 +1467,7 @@ 10, FALSE, (GAsyncReadyCallback)set_current_bands_next, - ctx); + task); g_free (command); } @@ -1582,24 +1495,26 @@ static void set_current_bands_got_current_bands (MMIfaceModem *self, GAsyncResult *res, - SetCurrentBandsContext *ctx) + GTask *task) { + SetCurrentBandsContext *ctx; GArray *bands; GError *error = NULL; guint currentbits; bands = modem_load_current_bands_finish (self, res, &error); if (!bands) { - g_simple_async_result_take_error (ctx->result, error); - set_current_bands_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); currentbits = band_array_to_bandbits (bands); ctx->enablebits = ctx->bandbits & ~currentbits; ctx->disablebits = currentbits & ~ctx->bandbits; - set_one_band (self, ctx); + set_one_band (self, task); } static void @@ -1609,27 +1524,27 @@ gpointer user_data) { SetCurrentBandsContext *ctx; + GTask *task; - ctx = g_slice_new0 (SetCurrentBandsContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_set_current_bands); + ctx = g_new0 (SetCurrentBandsContext, 1); ctx->bandbits = band_array_to_bandbits (bands_array); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* * If ANY is requested, simply enable ANY to activate all bands except for * those forbidden. */ if (ctx->bandbits & modem_band_any_bit) { ctx->enablebits = modem_band_any_bit; ctx->disablebits = 0; - set_one_band (self, ctx); + set_one_band (self, task); return; } modem_load_current_bands (self, (GAsyncReadyCallback)set_current_bands_got_current_bands, - ctx); + task); } /*****************************************************************************/ @@ -1801,11 +1716,7 @@ GAsyncResult *res, GError **error) { - /* We assume Icera devices always support *TLTS, since they appear - * to return ERROR if the modem is not powered up, and thus we cannot - * check for *TLTS support during modem initialization. - */ - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -1813,15 +1724,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_time_check_support); + task = g_task_new (self, NULL, callback, user_data); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + /* We assume Icera devices always support *TLTS, since they appear + * to return ERROR if the modem is not powered up, and thus we cannot + * check for *TLTS support during modem initialization. + */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/icera/mm-modem-helpers-icera.c modemmanager-1.10.0/plugins/icera/mm-modem-helpers-icera.c --- modemmanager-1.6.8/plugins/icera/mm-modem-helpers-icera.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/icera/mm-modem-helpers-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -215,7 +215,7 @@ GError *local = NULL; gboolean success = FALSE; char **items; - guint num_items, i, first_free; + guint num_items, i; gint num; g_return_val_if_fail (out_ip4_config, FALSE); @@ -240,7 +240,7 @@ /* Strip any spaces on elements; inet_pton() doesn't like them */ num_items = g_strv_length (items); - for (i = 0, first_free = 0; i < num_items; i++) + for (i = 0; i < num_items; i++) items[i] = g_strstrip (items[i]); if (num_items < 7) { diff -Nru modemmanager-1.6.8/plugins/icera/tests/test-modem-helpers-icera.c modemmanager-1.10.0/plugins/icera/tests/test-modem-helpers-icera.c --- modemmanager-1.6.8/plugins/icera/tests/test-modem-helpers-icera.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/icera/tests/test-modem-helpers-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -199,7 +199,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/icera/ipdpaddr", test_ipdpaddr); diff -Nru modemmanager-1.6.8/plugins/iridium/mm-bearer-iridium.c modemmanager-1.10.0/plugins/iridium/mm-bearer-iridium.c --- modemmanager-1.6.8/plugins/iridium/mm-bearer-iridium.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/iridium/mm-bearer-iridium.c 2018-11-15 09:55:53.000000000 +0100 @@ -37,24 +37,17 @@ /* Connect */ typedef struct { - MMBearerIridium *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; MMPortSerialAt *primary; GError *saved_error; } ConnectContext; static void -connect_context_complete_and_free (ConnectContext *ctx) +connect_context_free (ConnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->saved_error) g_error_free (ctx->saved_error); if (ctx->primary) g_object_unref (ctx->primary); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -63,58 +56,50 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void connect_report_ready (MMBaseModem *modem, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; const gchar *result; /* If cancelled, complete */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - connect_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* If we got a proper extended reply, build the new error to be set */ result = mm_base_modem_at_command_full_finish (modem, res, NULL); - if (result && - g_str_has_prefix (result, "+CEER: ") && - strlen (result) > 7) { - g_simple_async_result_set_error (ctx->result, - ctx->saved_error->domain, - ctx->saved_error->code, - "%s", &result[7]); - g_error_free (ctx->saved_error); + if (result && g_str_has_prefix (result, "+CEER: ") && strlen (result) > 7) { + g_task_return_new_error (task, + ctx->saved_error->domain, + ctx->saved_error->code, + "%s", &result[7]); + } else { + /* Otherwise, take the original error as it was */ + g_task_return_error (task, ctx->saved_error); ctx->saved_error = NULL; - connect_context_complete_and_free (ctx); - return; } - - /* Take the original error as it was */ - g_simple_async_result_take_error (ctx->result, - ctx->saved_error); - ctx->saved_error = NULL; - connect_context_complete_and_free (ctx); + g_object_unref (task); } static void dial_ready (MMBaseModem *modem, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; MMBearerIpConfig *config; + ctx = g_task_get_task_data (task); + /* DO NOT check for cancellable here. If we got here without errors, the * bearer is really connected and therefore we need to reflect that in * the state machine. */ @@ -130,7 +115,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)connect_report_ready, - ctx); + task); return; } @@ -141,38 +126,36 @@ config = mm_bearer_ip_config_new (); mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_PPP); - /* Set operation result */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, + /* Return operation result */ + g_task_return_pointer ( + task, mm_bearer_connect_result_new (MM_PORT (ctx->primary), config, NULL), (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); g_object_unref (config); - - connect_context_complete_and_free (ctx); } static void service_type_ready (MMBaseModem *modem, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; /* If cancelled, complete */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - connect_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Errors setting the service type will be critical */ mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -188,7 +171,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)dial_ready, - ctx); + task); } static void @@ -198,6 +181,7 @@ gpointer user_data) { ConnectContext *ctx; + GTask *task; MMBaseModem *modem = NULL; g_object_get (self, @@ -210,13 +194,10 @@ /* In this context, we only keep the stuff we'll need later */ ctx = g_new0 (ConnectContext, 1); - ctx->self = g_object_ref (self); ctx->primary = mm_base_modem_get_port_primary (modem); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - connect); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify) connect_context_free); /* Bearer service type set to 9600bps (V.110), which behaves better than the * default 9600bps (V.32). */ @@ -229,7 +210,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)service_type_ready, - ctx); + task); g_object_unref (modem); } @@ -270,4 +251,6 @@ /* Virtual methods */ base_bearer_class->connect = connect; base_bearer_class->connect_finish = connect_finish; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; } diff -Nru modemmanager-1.6.8/plugins/iridium/mm-broadband-modem-iridium.c modemmanager-1.10.0/plugins/iridium/mm-broadband-modem-iridium.c --- modemmanager-1.6.8/plugins/iridium/mm-broadband-modem-iridium.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/iridium/mm-broadband-modem-iridium.c 2019-01-15 15:57:35.000000000 +0100 @@ -44,40 +44,51 @@ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_MESSAGING, iface_modem_messaging_init)); /*****************************************************************************/ -/* Operator Code and Name loading (3GPP interface) */ +/* Operator Code loading (3GPP interface) */ static gchar * load_operator_code_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_operator_code (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); /* Only "90103" operator code is assumed */ - return g_strdup ("90103"); + g_task_return_pointer (task, g_strdup ("90103"), g_free); + g_object_unref (task); } +/*****************************************************************************/ +/* Operator Name loading (3GPP interface) */ + static gchar * load_operator_name_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - /* Only "IRIDIUM" operator name is assumed */ - return g_strdup ("IRIDIUM"); + return g_task_propagate_pointer (G_TASK (res), error); } static void -load_operator_name_or_code (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_operator_name (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_operator_name_or_code); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + /* Only "IRIDIUM" operator name is assumed */ + g_task_return_pointer (task, g_strdup ("IRIDIUM"), g_free); + g_object_unref (task); } /*****************************************************************************/ @@ -168,25 +179,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_flow_control_ready (MMBroadbandModemIridium *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) /* Let the error be critical. We DO need RTS/CTS in order to have * proper modem disabling. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -194,13 +204,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_flow_control); - /* Enable RTS/CTS flow control. * Other available values: * AT&K0: Disable flow control @@ -208,12 +211,13 @@ * AT&K4: XOFF/XON * AT&K6: Both RTS/CTS and XOFF/XON */ + g_object_set (self, MM_BROADBAND_MODEM_FLOW_CONTROL, MM_FLOW_CONTROL_RTS_CTS, NULL); mm_base_modem_at_command (MM_BASE_MODEM (self), "&K3", 3, FALSE, (GAsyncReadyCallback)setup_flow_control_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -224,7 +228,7 @@ GAsyncResult *res, GError **error) { - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -232,14 +236,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; GArray *combinations; MMModemModeCombination mode; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes); + GTask *task; /* Build list of combinations */ combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); @@ -249,9 +248,9 @@ mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); - g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -285,12 +284,7 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New Iridium bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -300,20 +294,14 @@ gpointer user_data) { MMBaseBearer *bearer; - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - create_bearer); mm_dbg ("Creating Iridium bearer..."); bearer = mm_bearer_iridium_new (MM_BROADBAND_MODEM_IRIDIUM (self), properties); - g_simple_async_result_set_op_res_gpointer (result, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -409,9 +397,9 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface) { /* Fixed operator code and name to be reported */ - iface->load_operator_name = load_operator_name_or_code; + iface->load_operator_name = load_operator_name; iface->load_operator_name_finish = load_operator_name_finish; - iface->load_operator_code = load_operator_name_or_code; + iface->load_operator_code = load_operator_code; iface->load_operator_code_finish = load_operator_code_finish; /* Don't try to scan networks with AT+COPS=?. diff -Nru modemmanager-1.6.8/plugins/iridium/mm-plugin-iridium.c modemmanager-1.10.0/plugins/iridium/mm-plugin-iridium.c --- modemmanager-1.6.8/plugins/iridium/mm-plugin-iridium.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/iridium/mm-plugin-iridium.c 2018-11-15 09:55:53.000000000 +0100 @@ -38,14 +38,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_iridium_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_iridium_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/linktop/mm-broadband-modem-linktop.c modemmanager-1.10.0/plugins/linktop/mm-broadband-modem-linktop.c --- modemmanager-1.6.8/plugins/linktop/mm-broadband-modem-linktop.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/linktop/mm-broadband-modem-linktop.c 2018-11-15 09:55:53.000000000 +0100 @@ -33,10 +33,7 @@ #include "mm-iface-modem.h" #include "mm-base-modem-at.h" #include "mm-broadband-modem-linktop.h" - -#define LINKTOP_MODE_ANY 1 -#define LINKTOP_MODE_2G 5 -#define LINKTOP_MODE_3G 6 +#include "mm-modem-helpers-linktop.h" static void iface_modem_init (MMIfaceModem *iface); @@ -53,16 +50,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -72,9 +66,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -99,9 +92,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -113,10 +105,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -130,44 +119,13 @@ GError **error) { const gchar *response; - const gchar *str; - guint aux; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); - if (!response) - return FALSE; - - str = mm_strip_tag (response, "CFUN:"); - if (!mm_get_uint_from_str (str, &aux)) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse CFUN? response: '%s'", - response); + if (!response || !mm_linktop_parse_cfun_query_current_modes (response, allowed, error)) return FALSE; - } - switch (aux) { - case LINKTOP_MODE_2G: - *allowed = MM_MODEM_MODE_2G; - *preferred = MM_MODEM_MODE_NONE; - break; - - case LINKTOP_MODE_3G: - *allowed = MM_MODEM_MODE_3G; - *preferred = MM_MODEM_MODE_NONE; - break; - - case LINKTOP_MODE_ANY: - *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - *preferred = MM_MODEM_MODE_NONE; - break; - - default: - *allowed = MM_MODEM_MODE_ANY; - *preferred = MM_MODEM_MODE_NONE; - break; - } + /* None preferred always */ + *preferred = MM_MODEM_MODE_NONE; return TRUE; } @@ -193,24 +151,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemLinktop *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -220,14 +178,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint linktop_mode = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) linktop_mode = LINKTOP_MODE_2G; @@ -246,18 +201,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -268,7 +221,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } diff -Nru modemmanager-1.6.8/plugins/linktop/mm-modem-helpers-linktop.c modemmanager-1.10.0/plugins/linktop/mm-modem-helpers-linktop.c --- modemmanager-1.6.8/plugins/linktop/mm-modem-helpers-linktop.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/linktop/mm-modem-helpers-linktop.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,55 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2008 - 2009 Novell, Inc. + * Copyright (C) 2009 - 2016 Red Hat, Inc. + * Copyright (C) 2016 Aleksander Morgado + */ + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-linktop.h" + +/*****************************************************************************/ + +gboolean +mm_linktop_parse_cfun_query_current_modes (const gchar *response, + MMModemMode *allowed, + GError **error) +{ + guint state; + + g_assert (allowed); + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return FALSE; + + switch (state) { + case LINKTOP_MODE_OFFLINE: + case LINKTOP_MODE_LOW_POWER: + *allowed = MM_MODEM_MODE_NONE; + return TRUE; + case LINKTOP_MODE_2G: + *allowed = MM_MODEM_MODE_2G; + return TRUE; + case LINKTOP_MODE_3G: + *allowed = MM_MODEM_MODE_3G; + return TRUE; + case LINKTOP_MODE_ANY: + *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + return TRUE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown linktop +CFUN current mode: %u", state); + return FALSE; + } +} diff -Nru modemmanager-1.6.8/plugins/linktop/mm-modem-helpers-linktop.h modemmanager-1.10.0/plugins/linktop/mm-modem-helpers-linktop.h --- modemmanager-1.6.8/plugins/linktop/mm-modem-helpers-linktop.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/linktop/mm-modem-helpers-linktop.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2008 - 2009 Novell, Inc. + * Copyright (C) 2009 - 2016 Red Hat, Inc. + * Copyright (C) 2016 Aleksander Morgado + */ + +#ifndef MM_MODEM_HELPERS_LINKTOP_H +#define MM_MODEM_HELPERS_LINKTOP_H + +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +typedef enum { + LINKTOP_MODE_OFFLINE = 0, + LINKTOP_MODE_ANY = 1, + LINKTOP_MODE_LOW_POWER = 4, + LINKTOP_MODE_2G = 5, + LINKTOP_MODE_3G = 6, +} MMLinktopMode; + +/* AT+CFUN? response parsers */ +gboolean mm_linktop_parse_cfun_query_current_modes (const gchar *response, + MMModemMode *allowed, + GError **error); + +#endif /* MM_MODEM_HELPERS_LINKTOP_H */ diff -Nru modemmanager-1.6.8/plugins/linktop/mm-plugin-linktop.c modemmanager-1.10.0/plugins/linktop/mm-plugin-linktop.c --- modemmanager-1.6.8/plugins/linktop/mm-plugin-linktop.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/linktop/mm-plugin-linktop.c 2018-11-15 09:55:53.000000000 +0100 @@ -33,14 +33,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_linktop_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_linktop_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/linktop/tests/test-modem-helpers-linktop.c modemmanager-1.10.0/plugins/linktop/tests/test-modem-helpers-linktop.c --- modemmanager-1.6.8/plugins/linktop/tests/test-modem-helpers-linktop.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/linktop/tests/test-modem-helpers-linktop.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,93 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-linktop.h" + +/* #define ENABLE_TEST_MESSAGE_TRACES */ + +/*****************************************************************************/ + +typedef struct { + const gchar *str; + MMModemMode allowed; +} CfunQueryCurrentModeTest; + +static const CfunQueryCurrentModeTest cfun_query_current_mode_tests[] = { + { "+CFUN: 0", MM_MODEM_MODE_NONE }, + { "+CFUN: 1", MM_MODEM_MODE_2G | MM_MODEM_MODE_3G }, + { "+CFUN: 4", MM_MODEM_MODE_NONE }, + { "+CFUN: 5", MM_MODEM_MODE_2G }, + { "+CFUN: 6", MM_MODEM_MODE_3G }, +}; + +static void +test_cfun_query_current_modes (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_current_mode_tests); i++) { + GError *error = NULL; + gboolean success; + MMModemMode allowed = MM_MODEM_MODE_NONE; + + success = mm_linktop_parse_cfun_query_current_modes (cfun_query_current_mode_tests[i].str, &allowed, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_current_mode_tests[i].allowed, ==, allowed); + } +} + +/*****************************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/linktop/cfun/query/current-modes", test_cfun_query_current_modes); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/plugins/longcheer/77-mm-longcheer-port-types.rules modemmanager-1.10.0/plugins/longcheer/77-mm-longcheer-port-types.rules --- modemmanager-1.6.8/plugins/longcheer/77-mm-longcheer-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/longcheer/77-mm-longcheer-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -12,10 +12,7 @@ # cmser.inf lists the aux ports that may be either AT-capable or not but # cannot be used for PPP. - -ACTION!="add|change|move", GOTO="mm_longcheer_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_longcheer_port_types_end" - +ACTION!="add|change|move|bind", GOTO="mm_longcheer_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c9e", GOTO="mm_longcheer_vendorcheck" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1bbb", GOTO="mm_tamobile_vendorcheck" GOTO="mm_longcheer_port_types_end" @@ -23,156 +20,154 @@ LABEL="mm_longcheer_vendorcheck" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="3197", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="3197", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="3197", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="3197", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="3197", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6000", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6060", ENV{ID_MM_LONGCHEER_TAGGED}="1" # Alcatel One Touch X020 -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="6061", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7001", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7002", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7101", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="7102", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8000", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8001", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="8002", ENV{ID_MM_LONGCHEER_TAGGED}="1" # ChinaBird PL68 -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9000", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9001", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9002", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9003", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9004", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9004", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9004", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9005", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9010", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9012", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9020", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9022", ENV{ID_MM_LONGCHEER_TAGGED}="1" # Zoom products -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9602", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9603", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9604", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9605", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9606", ENV{ID_MM_LONGCHEER_TAGGED}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9607", ENV{ID_MM_LONGCHEER_TAGGED}="1" GOTO="mm_longcheer_port_types_end" - LABEL="mm_tamobile_vendorcheck" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # Alcatel One Touch X060s -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{ID_MM_LONGCHEER_TAGGED}="1" GOTO="mm_longcheer_port_types_end" - LABEL="mm_longcheer_port_types_end" diff -Nru modemmanager-1.6.8/plugins/longcheer/mm-broadband-modem-longcheer.c modemmanager-1.10.0/plugins/longcheer/mm-broadband-modem-longcheer.c --- modemmanager-1.6.8/plugins/longcheer/mm-broadband-modem-longcheer.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/longcheer/mm-broadband-modem-longcheer.c 2018-11-15 09:55:53.000000000 +0100 @@ -46,16 +46,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -65,9 +62,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -96,9 +92,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -110,10 +105,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -199,24 +191,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemLongcheer *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -226,14 +217,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint mododr = 0; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) mododr = 3; @@ -254,18 +242,17 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); + g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -276,7 +263,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } @@ -324,16 +311,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -342,9 +326,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -361,18 +344,15 @@ mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN2, pin2); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK2, puk2); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } else { - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid unlock retries response: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -386,10 +366,7 @@ 3, FALSE, (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/longcheer/mm-plugin-longcheer.c modemmanager-1.10.0/plugins/longcheer/mm-plugin-longcheer.c --- modemmanager-1.6.8/plugins/longcheer/mm-plugin-longcheer.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/longcheer/mm-plugin-longcheer.c 2019-01-15 15:57:35.000000000 +0100 @@ -35,23 +35,14 @@ /* Custom init */ typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; guint retries; } LongcheerCustomInitContext; static void -longcheer_custom_init_context_complete_and_free (LongcheerCustomInitContext *ctx) +longcheer_custom_init_context_free (LongcheerCustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (LongcheerCustomInitContext, ctx); } @@ -60,15 +51,15 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void longcheer_custom_init_step (LongcheerCustomInitContext *ctx); +static void longcheer_custom_init_step (GTask *task); static void gmr_ready (MMPortSerialAt *port, GAsyncResult *res, - LongcheerCustomInitContext *ctx) + GTask *task) { const gchar *p; const gchar *response; @@ -76,9 +67,11 @@ response = mm_port_serial_at_command_finish (port, res, &error); if (error) { + g_error_free (error); + /* Just retry... */ - longcheer_custom_init_step (ctx); - goto out; + longcheer_custom_init_step (task); + return; } /* Note the lack of a ':' on the GMR; the X200 doesn't send one */ @@ -90,42 +83,43 @@ * does not support since it uses a different chipset even though the * X060s and the X200 have the exact same USB VID and PID. */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "X200 cannot be supported with the Longcheer plugin"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "X200 cannot be supported with the Longcheer plugin"); } else { mm_dbg ("(Longcheer) device is not a X200"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } - - longcheer_custom_init_context_complete_and_free (ctx); - -out: - if (error) - g_error_free (error); + g_object_unref (task); } static void -longcheer_custom_init_step (LongcheerCustomInitContext *ctx) +longcheer_custom_init_step (GTask *task) { + LongcheerCustomInitContext *ctx; + GCancellable *cancellable; + + ctx = g_task_get_task_data (task); + cancellable = g_task_get_cancellable (task); + /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_cancellable_is_cancelled (cancellable)) { mm_dbg ("(Longcheer) no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - longcheer_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } if (ctx->retries == 0) { /* In this case, we need the AT command result to decide whether we can * support this modem or not, so really fail if we didn't get it. */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get device revision information"); - longcheer_custom_init_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get device revision information"); + g_object_unref (task); return; } @@ -136,9 +130,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + cancellable, (GAsyncReadyCallback)gmr_ready, - ctx); + task); } static void @@ -150,17 +144,19 @@ { MMDevice *device; LongcheerCustomInitContext *ctx; + GTask *task; ctx = g_slice_new (LongcheerCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - longcheer_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->retries = 3; + task = g_task_new (probe, cancellable, callback, user_data); + /* Clears the check-cancellable flag of the task as we expect the task to + * return TRUE upon cancellation. + */ + g_task_set_check_cancellable (task, FALSE); + g_task_set_task_data (task, ctx, (GDestroyNotify)longcheer_custom_init_context_free); + /* TCT/Alcatel in their infinite wisdom assigned the same USB VID/PID to * the x060s (Longcheer firmware) and the x200 (something else) and thus * we can't tell them apart via udev rules. Worse, they both report the @@ -174,76 +170,32 @@ if (mm_device_get_vendor (device) != 0x1bbb || mm_device_get_product (device) != 0x0000) { /* If not exactly this vendor/product, just skip */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - longcheer_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - longcheer_custom_init_step (ctx); + longcheer_custom_init_step (task); } /*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_longcheer_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_longcheer_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortType ptype; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - ptype = mm_port_probe_get_port_type (probe); - - /* Look for port type hints; just probing can't distinguish which port should - * be the data/primary port on these devices. We have to tag them based on - * what the Windows .INF files say the port layout should be. - */ - if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_MODEM")) { - mm_dbg ("longcheer: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_AUX")) { - mm_dbg ("longcheer: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } else { - /* If the port was tagged by the udev rules but isn't a primary or secondary, - * then ignore it to guard against race conditions if a device just happens - * to show up with more than two AT-capable ports. - */ - ptype = MM_PORT_TYPE_IGNORED; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - ptype, - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -286,5 +238,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/Makefile.am modemmanager-1.10.0/plugins/Makefile.am --- modemmanager-1.6.8/plugins/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -12,6 +12,7 @@ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ + -I$(top_srcdir)/src/kerneldevice \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/libmm-glib \ @@ -57,6 +58,12 @@ # Plugins pkglib_LTLIBRARIES = +# Built sources +BUILT_SOURCES = + +# Clean files +CLEANFILES = + ################################################################################ # common service test support ################################################################################ @@ -173,6 +180,25 @@ # common sierra support ################################################################################ +noinst_LTLIBRARIES += libhelpers-sierra.la +libhelpers_sierra_la_SOURCES = \ + sierra/mm-modem-helpers-sierra.c \ + sierra/mm-modem-helpers-sierra.h \ + $(NULL) + +noinst_PROGRAMS += test-modem-helpers-sierra +test_modem_helpers_sierra_SOURCES = \ + sierra/tests/test-modem-helpers-sierra.c \ + $(NULL) +test_modem_helpers_sierra_CPPFLAGS = \ + -I$(top_srcdir)/plugins/sierra \ + $(NULL) +test_modem_helpers_sierra_LDADD = \ + $(builddir)/libhelpers-sierra.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + noinst_LTLIBRARIES += libmm-utils-sierra.la libmm_utils_sierra_la_SOURCES = \ sierra/mm-common-sierra.c \ @@ -184,6 +210,9 @@ sierra/mm-broadband-modem-sierra.c \ sierra/mm-broadband-modem-sierra.h \ $(NULL) +libmm_utils_sierra_la_LIBADD = \ + $(builddir)/libhelpers-sierra.la \ + $(NULL) SIERRA_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/sierra SIERRA_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-sierra.la @@ -218,44 +247,50 @@ NOVATEL_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-novatel.la ################################################################################ -# common telit support +# common xmm support ################################################################################ -# Common telit helpers library -noinst_LTLIBRARIES += libhelpers-telit.la -libhelpers_telit_la_SOURCES = \ - telit/mm-modem-helpers-telit.c \ - telit/mm-modem-helpers-telit.h \ +noinst_LTLIBRARIES += libhelpers-xmm.la +libhelpers_xmm_la_SOURCES = \ + xmm/mm-modem-helpers-xmm.c \ + xmm/mm-modem-helpers-xmm.h \ $(NULL) -noinst_PROGRAMS += test-modem-helpers-telit -test_modem_helpers_telit_SOURCES = \ - telit/tests/test-mm-modem-helpers-telit.c \ +noinst_PROGRAMS += test-modem-helpers-xmm +test_modem_helpers_xmm_SOURCES = \ + xmm/tests/test-modem-helpers-xmm.c \ $(NULL) -test_modem_helpers_telit_CPPFLAGS = \ - -I$(top_srcdir)/plugins/telit \ +test_modem_helpers_xmm_CPPFLAGS = \ + -I$(top_srcdir)/plugins/xmm \ $(NULL) -test_modem_helpers_telit_LDADD = \ - $(builddir)/libhelpers-telit.la \ +test_modem_helpers_xmm_LDADD = \ + $(builddir)/libhelpers-xmm.la \ $(top_builddir)/src/libhelpers.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(NULL) -# Common telit modem support library -noinst_LTLIBRARIES += libmm-utils-telit.la -libmm_utils_telit_la_SOURCES = \ - telit/mm-common-telit.c \ - telit/mm-common-telit.h \ - telit/mm-broadband-modem-telit.c \ - telit/mm-broadband-modem-telit.h \ +noinst_LTLIBRARIES += libmm-utils-xmm.la +libmm_utils_xmm_la_SOURCES = \ + xmm/mm-shared-xmm.h \ + xmm/mm-shared-xmm.c \ + xmm/mm-broadband-modem-xmm.h \ + xmm/mm-broadband-modem-xmm.c \ $(NULL) -TELIT_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/telit -TELIT_COMMON_LIBADD_FLAGS = \ - $(builddir)/libhelpers-telit.la \ - $(builddir)/libmm-utils-telit.la \ +if WITH_MBIM +libmm_utils_xmm_la_SOURCES += \ + xmm/mm-broadband-modem-mbim-xmm.h \ + xmm/mm-broadband-modem-mbim-xmm.c \ + $(NULL) +endif + +libmm_utils_xmm_la_LIBADD = \ + $(builddir)/libhelpers-xmm.la \ $(NULL) +XMM_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/xmm +XMM_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-xmm.la + ################################################################################ # plugin: generic ################################################################################ @@ -329,6 +364,8 @@ dist_udevrules_DATA += huawei/77-mm-huawei-net-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_HUAWEI=\"${srcdir}/huawei\" + ################################################################################ # plugin: ericsson mbm ################################################################################ @@ -344,6 +381,8 @@ dist_udevrules_DATA += mbm/77-mm-ericsson-mbm.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_MBM=\"${srcdir}/mbm\" + ################################################################################ # plugin: option ################################################################################ @@ -378,6 +417,8 @@ # plugin: sierra (new QMI or MBIM modems) ################################################################################ +dist_udevrules_DATA += sierra/77-mm-sierra.rules + pkglib_LTLIBRARIES += libmm-plugin-sierra.la libmm_plugin_sierra_la_SOURCES = \ sierra/mm-plugin-sierra.c \ @@ -446,6 +487,8 @@ dist_udevrules_DATA += nokia/77-mm-nokia-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_NOKIA=\"${srcdir}/nokia\" + ################################################################################ # plugin: zte ################################################################################ @@ -467,6 +510,8 @@ dist_udevrules_DATA += zte/77-mm-zte-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_ZTE=\"${srcdir}/zte\" + ################################################################################ # plugin: longcheer (and rebranded dongles) ################################################################################ @@ -483,6 +528,8 @@ dist_udevrules_DATA += longcheer/77-mm-longcheer-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_LONGCHEER=\"${srcdir}/longcheer\" + ################################################################################ # plugin: anydata cdma ################################################################################ @@ -501,6 +548,25 @@ # plugin: linktop cdma ################################################################################ +noinst_LTLIBRARIES += libhelpers-linktop.la +libhelpers_linktop_la_SOURCES = \ + linktop/mm-modem-helpers-linktop.c \ + linktop/mm-modem-helpers-linktop.h \ + $(NULL) + +noinst_PROGRAMS += test-modem-helpers-linktop +test_modem_helpers_linktop_SOURCES = \ + linktop/tests/test-modem-helpers-linktop.c \ + $(NULL) +test_modem_helpers_linktop_CPPFLAGS = \ + -I$(top_srcdir)/plugins/linktop \ + $(NULL) +test_modem_helpers_linktop_LDADD = \ + $(builddir)/libhelpers-linktop.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + pkglib_LTLIBRARIES += libmm-plugin-linktop.la libmm_plugin_linktop_la_SOURCES = \ linktop/mm-plugin-linktop.c \ @@ -510,6 +576,7 @@ $(NULL) libmm_plugin_linktop_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_linktop_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_linktop_la_LIBADD = $(builddir)/libhelpers-linktop.la ################################################################################ # plugin: simtech @@ -527,6 +594,8 @@ dist_udevrules_DATA += simtech/77-mm-simtech-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_SIMTECH=\"${srcdir}/simtech\" + ################################################################################ # plugin: alcatel/TCT/JRD x220D and possibly others ################################################################################ @@ -543,6 +612,8 @@ dist_udevrules_DATA += x22x/77-mm-x22x-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_X22X=\"${srcdir}/x22x\" + ################################################################################ # plugin: pantech ################################################################################ @@ -601,10 +672,12 @@ libmm_plugin_cinterion_la_SOURCES = \ cinterion/mm-plugin-cinterion.c \ cinterion/mm-plugin-cinterion.h \ - cinterion/mm-common-cinterion.c \ - cinterion/mm-common-cinterion.h \ + cinterion/mm-shared-cinterion.c \ + cinterion/mm-shared-cinterion.h \ cinterion/mm-broadband-modem-cinterion.c \ cinterion/mm-broadband-modem-cinterion.h \ + cinterion/mm-broadband-bearer-cinterion.c \ + cinterion/mm-broadband-bearer-cinterion.h \ $(NULL) if WITH_QMI libmm_plugin_cinterion_la_SOURCES += \ @@ -618,6 +691,8 @@ dist_udevrules_DATA += cinterion/77-mm-cinterion-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_CINTERION=\"${srcdir}/cinterion\" + ################################################################################ # plugin: iridium ################################################################################ @@ -675,7 +750,7 @@ # plugin: novatel lte ################################################################################ -pkglib_LTLIBRARIES += libmm-plugin-novatel_lte.la +pkglib_LTLIBRARIES += libmm-plugin-novatel-lte.la libmm_plugin_novatel_lte_la_SOURCES = \ novatel/mm-plugin-novatel-lte.c \ novatel/mm-plugin-novatel-lte.h \ @@ -703,21 +778,6 @@ libmm_plugin_novatel_la_LIBADD = $(NOVATEL_COMMON_LIBADD_FLAGS) ################################################################################ -# plugin: dell (novatel, sierra or telit) -################################################################################ - -pkglib_LTLIBRARIES += libmm-plugin-dell.la -libmm_plugin_dell_la_SOURCES = \ - dell/mm-plugin-dell.c \ - dell/mm-plugin-dell.h \ - $(NULL) -libmm_plugin_dell_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(NOVATEL_COMMON_COMPILER_FLAGS) $(SIERRA_COMMON_COMPILER_FLAGS) $(TELIT_COMMON_COMPILER_FLAGS) $(MBM_COMMON_COMPILER_FLAGS) -libmm_plugin_dell_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) -libmm_plugin_dell_la_LIBADD = $(NOVATEL_COMMON_LIBADD_FLAGS) $(SIERRA_COMMON_LIBADD_FLAGS) $(TELIT_COMMON_LIBADD_FLAGS) $(MBM_COMMON_LIBADD_FLAGS) - -dist_udevrules_DATA += dell/77-mm-dell-port-types.rules - -################################################################################ # plugin: altair lte ################################################################################ @@ -771,17 +831,91 @@ # plugin: telit ################################################################################ +PLUGIN_TELIT_COMPILER_FLAGS = \ + -I$(top_srcdir)/plugins/telit \ + -I$(top_builddir)/plugins/telit \ + $(NULL) + +noinst_LTLIBRARIES += libhelpers-telit.la + +TELIT_ENUMS_INPUTS = \ + $(top_srcdir)/plugins/telit/mm-modem-helpers-telit.h \ + $(NULL) + +TELIT_ENUMS_GENERATED = \ + telit/mm-telit-enums-types.h \ + telit/mm-telit-enums-types.c \ + $(NULL) + +telit/mm-telit-enums-types.h: Makefile.am $(TELIT_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) \ + $(MKDIR_P) telit; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-modem-helpers-telit.h\"\n#ifndef __MM_TELIT_ENUMS_TYPES_H__\n#define __MM_TELIT_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_TELIT_ENUMS_TYPES_H__ */\n" \ + $(TELIT_ENUMS_INPUTS) > $@ + +telit/mm-telit-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c telit/mm-telit-enums-types.h + $(AM_V_GEN) \ + $(MKDIR_P) telit; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-telit-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(TELIT_ENUMS_INPUTS) > $@ + +libhelpers_telit_la_SOURCES = \ + telit/mm-modem-helpers-telit.c \ + telit/mm-modem-helpers-telit.h \ + $(NULL) + +nodist_libhelpers_telit_la_SOURCES = $(TELIT_ENUMS_GENERATED) + +libhelpers_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) + +BUILT_SOURCES += $(TELIT_ENUMS_GENERATED) +CLEANFILES += $(TELIT_ENUMS_GENERATED) + pkglib_LTLIBRARIES += libmm-plugin-telit.la libmm_plugin_telit_la_SOURCES = \ telit/mm-plugin-telit.c \ telit/mm-plugin-telit.h \ $(NULL) -libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) +libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(PLUGIN_TELIT_COMPILER_FLAGS) libmm_plugin_telit_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) libmm_plugin_telit_la_LIBADD = $(TELIT_COMMON_LIBADD_FLAGS) dist_udevrules_DATA += telit/77-mm-telit-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_TELIT=\"${srcdir}/telit\" + +noinst_PROGRAMS += test-modem-helpers-telit +test_modem_helpers_telit_SOURCES = \ + telit/tests/test-mm-modem-helpers-telit.c \ + $(NULL) +test_modem_helpers_telit_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) +test_modem_helpers_telit_LDADD = \ + $(builddir)/libhelpers-telit.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + +# Common telit modem support library +noinst_LTLIBRARIES += libmm-utils-telit.la +libmm_utils_telit_la_SOURCES = \ + telit/mm-common-telit.c \ + telit/mm-common-telit.h \ + telit/mm-broadband-modem-telit.c \ + telit/mm-broadband-modem-telit.h \ + $(NULL) +libmm_utils_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) + +TELIT_COMMON_COMPILER_FLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) +TELIT_COMMON_LIBADD_FLAGS = \ + $(builddir)/libhelpers-telit.la \ + $(builddir)/libmm-utils-telit.la \ + $(NULL) + ################################################################################ # plugin: mtk ################################################################################ @@ -798,6 +932,8 @@ dist_udevrules_DATA += mtk/77-mm-mtk-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_MTK=\"${srcdir}/mtk\" + ################################################################################ # plugin: haier ################################################################################ @@ -812,6 +948,177 @@ dist_udevrules_DATA += haier/77-mm-haier-port-types.rules +AM_CFLAGS += -DTESTUDEVRULESDIR_HAIER=\"${srcdir}/haier\" + +################################################################################ +# plugin: u-blox +################################################################################ + +dist_udevrules_DATA += ublox/77-mm-ublox-port-types.rules + +PLUGIN_UBLOX_COMPILER_FLAGS = \ + -I$(top_srcdir)/plugins/ublox \ + -I$(top_builddir)/plugins/ublox \ + $(NULL) + +noinst_LTLIBRARIES += libhelpers-ublox.la + +UBLOX_ENUMS_INPUTS = \ + $(top_srcdir)/plugins/ublox/mm-modem-helpers-ublox.h \ + $(NULL) + +UBLOX_ENUMS_GENERATED = \ + ublox/mm-ublox-enums-types.h \ + ublox/mm-ublox-enums-types.c \ + $(NULL) + +ublox/mm-ublox-enums-types.h: Makefile.am $(UBLOX_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) \ + $(MKDIR_P) ublox; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-modem-helpers-ublox.h\"\n#ifndef __MM_UBLOX_ENUMS_TYPES_H__\n#define __MM_UBLOX_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_UBLOX_ENUMS_TYPES_H__ */\n" \ + $(UBLOX_ENUMS_INPUTS) > $@ + +ublox/mm-ublox-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c ublox/mm-ublox-enums-types.h + $(AM_V_GEN) \ + $(MKDIR_P) ublox; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-ublox-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(UBLOX_ENUMS_INPUTS) > $@ + +libhelpers_ublox_la_SOURCES = \ + ublox/mm-modem-helpers-ublox.c \ + ublox/mm-modem-helpers-ublox.h \ + $(NULL) + +nodist_libhelpers_ublox_la_SOURCES = $(UBLOX_ENUMS_GENERATED) + +libhelpers_ublox_la_CPPFLAGS = $(PLUGIN_UBLOX_COMPILER_FLAGS) + +BUILT_SOURCES += $(UBLOX_ENUMS_GENERATED) +CLEANFILES += $(UBLOX_ENUMS_GENERATED) + +noinst_PROGRAMS += test-modem-helpers-ublox +test_modem_helpers_ublox_SOURCES = \ + ublox/tests/test-modem-helpers-ublox.c \ + $(NULL) +test_modem_helpers_ublox_CPPFLAGS = $(PLUGIN_UBLOX_COMPILER_FLAGS) +test_modem_helpers_ublox_LDADD = \ + $(builddir)/libhelpers-ublox.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + +pkglib_LTLIBRARIES += libmm-plugin-ublox.la +libmm_plugin_ublox_la_SOURCES = \ + ublox/mm-plugin-ublox.c \ + ublox/mm-plugin-ublox.h \ + ublox/mm-call-ublox.c \ + ublox/mm-call-ublox.h \ + ublox/mm-broadband-bearer-ublox.h \ + ublox/mm-broadband-bearer-ublox.c \ + ublox/mm-broadband-modem-ublox.h \ + ublox/mm-broadband-modem-ublox.c \ + ublox/mm-sim-ublox.c \ + ublox/mm-sim-ublox.h \ + $(NULL) +libmm_plugin_ublox_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(PLUGIN_UBLOX_COMPILER_FLAGS) +libmm_plugin_ublox_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_ublox_la_LIBADD = $(builddir)/libhelpers-ublox.la + +################################################################################ +# plugin: dell (novatel, sierra or telit) +################################################################################ + +pkglib_LTLIBRARIES += libmm-plugin-dell.la +libmm_plugin_dell_la_SOURCES = \ + dell/mm-plugin-dell.c \ + dell/mm-plugin-dell.h \ + $(NULL) + +if WITH_MBIM +libmm_plugin_dell_la_SOURCES += \ + dell/mm-broadband-modem-dell-dw5821e.h \ + dell/mm-broadband-modem-dell-dw5821e.c \ + $(NULL) +endif + +libmm_plugin_dell_la_CPPFLAGS = \ + $(PLUGIN_COMMON_COMPILER_FLAGS) \ + $(NOVATEL_COMMON_COMPILER_FLAGS) \ + $(SIERRA_COMMON_COMPILER_FLAGS) \ + $(TELIT_COMMON_COMPILER_FLAGS) \ + $(XMM_COMMON_COMPILER_FLAGS) \ + $(MBM_COMMON_COMPILER_FLAGS) \ + $(NULL) +libmm_plugin_dell_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_dell_la_LIBADD = \ + $(NOVATEL_COMMON_LIBADD_FLAGS) \ + $(SIERRA_COMMON_LIBADD_FLAGS) \ + $(TELIT_COMMON_LIBADD_FLAGS) \ + $(XMM_COMMON_LIBADD_FLAGS) \ + $(MBM_COMMON_LIBADD_FLAGS) \ + $(NULL) + +dist_udevrules_DATA += dell/77-mm-dell-port-types.rules + +AM_CFLAGS += -DTESTUDEVRULESDIR_DELL=\"${srcdir}/dell\" + +################################################################################ +# plugin: quectel +################################################################################ + +pkglib_LTLIBRARIES += libmm-plugin-quectel.la +libmm_plugin_quectel_la_SOURCES = \ + quectel/mm-plugin-quectel.c \ + quectel/mm-plugin-quectel.h \ + quectel/mm-shared-quectel.c \ + quectel/mm-shared-quectel.h \ + quectel/mm-broadband-modem-quectel.c \ + quectel/mm-broadband-modem-quectel.h \ + $(NULL) +if WITH_QMI +libmm_plugin_quectel_la_SOURCES += \ + quectel/mm-broadband-modem-qmi-quectel.c \ + quectel/mm-broadband-modem-qmi-quectel.h \ + $(NULL) +endif +libmm_plugin_quectel_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) +libmm_plugin_quectel_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) + +################################################################################ +# plugin: fibocom +################################################################################ + +pkglib_LTLIBRARIES += libmm-plugin-fibocom.la +libmm_plugin_fibocom_la_SOURCES = \ + fibocom/mm-plugin-fibocom.c \ + fibocom/mm-plugin-fibocom.h \ + $(NULL) +libmm_plugin_fibocom_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(XMM_COMMON_COMPILER_FLAGS) +libmm_plugin_fibocom_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_fibocom_la_LIBADD = $(XMM_COMMON_LIBADD_FLAGS) + +dist_udevrules_DATA += fibocom/77-mm-fibocom-port-types.rules + +AM_CFLAGS += -DTESTUDEVRULESDIR_FIBOCOM=\"${srcdir}/fibocom\" + +################################################################################ +# udev rules tester +################################################################################ + +noinst_PROGRAMS += test-udev-rules +test_udev_rules_SOURCES = \ + tests/test-udev-rules.c \ + $(NULL) +test_udev_rules_LDADD = \ + $(top_builddir)/src/libkerneldevice.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + ################################################################################ TEST_PROGS += $(noinst_PROGRAMS) diff -Nru modemmanager-1.6.8/plugins/Makefile.in modemmanager-1.10.0/plugins/Makefile.in --- modemmanager-1.6.8/plugins/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/plugins/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -96,31 +96,48 @@ @WITH_MBIM_TRUE@am__append_4 = $(MBIM_LIBS) noinst_PROGRAMS = test-modem-helpers-icera$(EXEEXT) \ test-modem-helpers-mbm$(EXEEXT) \ - test-modem-helpers-telit$(EXEEXT) \ - test-service-generic$(EXEEXT) \ + test-modem-helpers-sierra$(EXEEXT) \ + test-modem-helpers-xmm$(EXEEXT) test-service-generic$(EXEEXT) \ test-modem-helpers-huawei$(EXEEXT) \ + test-modem-helpers-linktop$(EXEEXT) \ test-modem-helpers-cinterion$(EXEEXT) \ test-modem-helpers-thuraya$(EXEEXT) \ - test-modem-helpers-altair-lte$(EXEEXT) -@WITH_QMI_TRUE@am__append_5 = \ + test-modem-helpers-altair-lte$(EXEEXT) \ + test-modem-helpers-telit$(EXEEXT) \ + test-modem-helpers-ublox$(EXEEXT) test-udev-rules$(EXEEXT) +@WITH_MBIM_TRUE@am__append_5 = \ +@WITH_MBIM_TRUE@ xmm/mm-broadband-modem-mbim-xmm.h \ +@WITH_MBIM_TRUE@ xmm/mm-broadband-modem-mbim-xmm.c \ +@WITH_MBIM_TRUE@ $(NULL) + +@WITH_QMI_TRUE@am__append_6 = \ @WITH_QMI_TRUE@ cinterion/mm-broadband-modem-qmi-cinterion.c \ @WITH_QMI_TRUE@ cinterion/mm-broadband-modem-qmi-cinterion.h \ @WITH_QMI_TRUE@ $(NULL) +@WITH_MBIM_TRUE@am__append_7 = \ +@WITH_MBIM_TRUE@ dell/mm-broadband-modem-dell-dw5821e.h \ +@WITH_MBIM_TRUE@ dell/mm-broadband-modem-dell-dw5821e.c \ +@WITH_MBIM_TRUE@ $(NULL) + +@WITH_QMI_TRUE@am__append_8 = \ +@WITH_QMI_TRUE@ quectel/mm-broadband-modem-qmi-quectel.c \ +@WITH_QMI_TRUE@ quectel/mm-broadband-modem-qmi-quectel.h \ +@WITH_QMI_TRUE@ $(NULL) + subdir = plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_udevrules_DATA) \ @@ -129,6 +146,7 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -179,16 +197,37 @@ libhelpers_icera_la_LIBADD = am_libhelpers_icera_la_OBJECTS = icera/mm-modem-helpers-icera.lo libhelpers_icera_la_OBJECTS = $(am_libhelpers_icera_la_OBJECTS) +libhelpers_linktop_la_LIBADD = +am_libhelpers_linktop_la_OBJECTS = \ + linktop/mm-modem-helpers-linktop.lo +libhelpers_linktop_la_OBJECTS = $(am_libhelpers_linktop_la_OBJECTS) libhelpers_mbm_la_LIBADD = am_libhelpers_mbm_la_OBJECTS = mbm/mm-modem-helpers-mbm.lo libhelpers_mbm_la_OBJECTS = $(am_libhelpers_mbm_la_OBJECTS) +libhelpers_sierra_la_LIBADD = +am_libhelpers_sierra_la_OBJECTS = sierra/mm-modem-helpers-sierra.lo +libhelpers_sierra_la_OBJECTS = $(am_libhelpers_sierra_la_OBJECTS) libhelpers_telit_la_LIBADD = -am_libhelpers_telit_la_OBJECTS = telit/mm-modem-helpers-telit.lo -libhelpers_telit_la_OBJECTS = $(am_libhelpers_telit_la_OBJECTS) +am_libhelpers_telit_la_OBJECTS = \ + telit/libhelpers_telit_la-mm-modem-helpers-telit.lo +am__objects_1 = telit/libhelpers_telit_la-mm-telit-enums-types.lo +nodist_libhelpers_telit_la_OBJECTS = $(am__objects_1) +libhelpers_telit_la_OBJECTS = $(am_libhelpers_telit_la_OBJECTS) \ + $(nodist_libhelpers_telit_la_OBJECTS) libhelpers_thuraya_la_LIBADD = am_libhelpers_thuraya_la_OBJECTS = \ thuraya/mm-modem-helpers-thuraya.lo libhelpers_thuraya_la_OBJECTS = $(am_libhelpers_thuraya_la_OBJECTS) +libhelpers_ublox_la_LIBADD = +am_libhelpers_ublox_la_OBJECTS = \ + ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo +am__objects_2 = ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo +nodist_libhelpers_ublox_la_OBJECTS = $(am__objects_2) +libhelpers_ublox_la_OBJECTS = $(am_libhelpers_ublox_la_OBJECTS) \ + $(nodist_libhelpers_ublox_la_OBJECTS) +libhelpers_xmm_la_LIBADD = +am_libhelpers_xmm_la_OBJECTS = xmm/mm-modem-helpers-xmm.lo +libhelpers_xmm_la_OBJECTS = $(am_libhelpers_xmm_la_OBJECTS) libmm_plugin_altair_lte_la_DEPENDENCIES = \ $(builddir)/libhelpers-altair-lte.la am_libmm_plugin_altair_lte_la_OBJECTS = \ @@ -216,18 +255,21 @@ am__libmm_plugin_cinterion_la_SOURCES_DIST = \ cinterion/mm-plugin-cinterion.c \ cinterion/mm-plugin-cinterion.h \ - cinterion/mm-common-cinterion.c \ - cinterion/mm-common-cinterion.h \ + cinterion/mm-shared-cinterion.c \ + cinterion/mm-shared-cinterion.h \ cinterion/mm-broadband-modem-cinterion.c \ cinterion/mm-broadband-modem-cinterion.h \ + cinterion/mm-broadband-bearer-cinterion.c \ + cinterion/mm-broadband-bearer-cinterion.h \ cinterion/mm-broadband-modem-qmi-cinterion.c \ cinterion/mm-broadband-modem-qmi-cinterion.h -@WITH_QMI_TRUE@am__objects_1 = cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo +@WITH_QMI_TRUE@am__objects_3 = cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo am_libmm_plugin_cinterion_la_OBJECTS = \ cinterion/libmm_plugin_cinterion_la-mm-plugin-cinterion.lo \ - cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo \ + cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo \ cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo \ - $(am__objects_1) + cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo \ + $(am__objects_3) libmm_plugin_cinterion_la_OBJECTS = \ $(am_libmm_plugin_cinterion_la_OBJECTS) libmm_plugin_cinterion_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @@ -238,9 +280,13 @@ $(builddir)/libmm-utils-telit.la libmm_plugin_dell_la_DEPENDENCIES = $(NOVATEL_COMMON_LIBADD_FLAGS) \ $(SIERRA_COMMON_LIBADD_FLAGS) $(am__DEPENDENCIES_1) \ - $(MBM_COMMON_LIBADD_FLAGS) + $(XMM_COMMON_LIBADD_FLAGS) $(MBM_COMMON_LIBADD_FLAGS) +am__libmm_plugin_dell_la_SOURCES_DIST = dell/mm-plugin-dell.c \ + dell/mm-plugin-dell.h dell/mm-broadband-modem-dell-dw5821e.h \ + dell/mm-broadband-modem-dell-dw5821e.c +@WITH_MBIM_TRUE@am__objects_4 = dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo am_libmm_plugin_dell_la_OBJECTS = \ - dell/libmm_plugin_dell_la-mm-plugin-dell.lo + dell/libmm_plugin_dell_la-mm-plugin-dell.lo $(am__objects_4) libmm_plugin_dell_la_OBJECTS = $(am_libmm_plugin_dell_la_OBJECTS) libmm_plugin_dell_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -256,6 +302,15 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_ericsson_mbm_la_LDFLAGS) \ $(LDFLAGS) -o $@ +libmm_plugin_fibocom_la_DEPENDENCIES = $(XMM_COMMON_LIBADD_FLAGS) +am_libmm_plugin_fibocom_la_OBJECTS = \ + fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo +libmm_plugin_fibocom_la_OBJECTS = \ + $(am_libmm_plugin_fibocom_la_OBJECTS) +libmm_plugin_fibocom_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_fibocom_la_LDFLAGS) \ + $(LDFLAGS) -o $@ libmm_plugin_generic_la_LIBADD = am_libmm_plugin_generic_la_OBJECTS = \ generic/libmm_plugin_generic_la-mm-plugin-generic.lo @@ -298,7 +353,8 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_iridium_la_LDFLAGS) \ $(LDFLAGS) -o $@ -libmm_plugin_linktop_la_LIBADD = +libmm_plugin_linktop_la_DEPENDENCIES = \ + $(builddir)/libhelpers-linktop.la am_libmm_plugin_linktop_la_OBJECTS = \ linktop/libmm_plugin_linktop_la-mm-plugin-linktop.lo \ linktop/libmm_plugin_linktop_la-mm-broadband-modem-linktop.lo @@ -357,15 +413,6 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_nokia_la_LDFLAGS) \ $(LDFLAGS) -o $@ -libmm_plugin_novatel_la_DEPENDENCIES = $(NOVATEL_COMMON_LIBADD_FLAGS) -am_libmm_plugin_novatel_la_OBJECTS = \ - novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo -libmm_plugin_novatel_la_OBJECTS = \ - $(am_libmm_plugin_novatel_la_OBJECTS) -libmm_plugin_novatel_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_novatel_la_LDFLAGS) \ - $(LDFLAGS) -o $@ libmm_plugin_novatel_lte_la_LIBADD = am_libmm_plugin_novatel_lte_la_OBJECTS = \ novatel/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.lo \ @@ -378,6 +425,15 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_novatel_lte_la_LDFLAGS) \ $(LDFLAGS) -o $@ +libmm_plugin_novatel_la_DEPENDENCIES = $(NOVATEL_COMMON_LIBADD_FLAGS) +am_libmm_plugin_novatel_la_OBJECTS = \ + novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo +libmm_plugin_novatel_la_OBJECTS = \ + $(am_libmm_plugin_novatel_la_OBJECTS) +libmm_plugin_novatel_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_novatel_la_LDFLAGS) \ + $(LDFLAGS) -o $@ libmm_plugin_option_hso_la_DEPENDENCIES = \ $(OPTION_COMMON_LIBADD_FLAGS) am_libmm_plugin_option_hso_la_OBJECTS = \ @@ -409,6 +465,26 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_pantech_la_LDFLAGS) \ $(LDFLAGS) -o $@ +libmm_plugin_quectel_la_LIBADD = +am__libmm_plugin_quectel_la_SOURCES_DIST = \ + quectel/mm-plugin-quectel.c quectel/mm-plugin-quectel.h \ + quectel/mm-shared-quectel.c quectel/mm-shared-quectel.h \ + quectel/mm-broadband-modem-quectel.c \ + quectel/mm-broadband-modem-quectel.h \ + quectel/mm-broadband-modem-qmi-quectel.c \ + quectel/mm-broadband-modem-qmi-quectel.h +@WITH_QMI_TRUE@am__objects_5 = quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo +am_libmm_plugin_quectel_la_OBJECTS = \ + quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo \ + quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo \ + quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo \ + $(am__objects_5) +libmm_plugin_quectel_la_OBJECTS = \ + $(am_libmm_plugin_quectel_la_OBJECTS) +libmm_plugin_quectel_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_quectel_la_LDFLAGS) \ + $(LDFLAGS) -o $@ libmm_plugin_samsung_la_DEPENDENCIES = $(ICERA_COMMON_LIBADD_FLAGS) am_libmm_plugin_samsung_la_OBJECTS = \ samsung/libmm_plugin_samsung_la-mm-plugin-samsung.lo \ @@ -466,6 +542,18 @@ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_thuraya_la_LDFLAGS) \ $(LDFLAGS) -o $@ +libmm_plugin_ublox_la_DEPENDENCIES = $(builddir)/libhelpers-ublox.la +am_libmm_plugin_ublox_la_OBJECTS = \ + ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo \ + ublox/libmm_plugin_ublox_la-mm-call-ublox.lo \ + ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo \ + ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo \ + ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo +libmm_plugin_ublox_la_OBJECTS = $(am_libmm_plugin_ublox_la_OBJECTS) +libmm_plugin_ublox_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libmm_plugin_ublox_la_LDFLAGS) \ + $(LDFLAGS) -o $@ libmm_plugin_via_la_LIBADD = am_libmm_plugin_via_la_OBJECTS = \ via/libmm_plugin_via_la-mm-plugin-via.lo \ @@ -527,16 +615,25 @@ am_libmm_utils_option_la_OBJECTS = \ option/mm-broadband-modem-option.lo libmm_utils_option_la_OBJECTS = $(am_libmm_utils_option_la_OBJECTS) -libmm_utils_sierra_la_LIBADD = +libmm_utils_sierra_la_DEPENDENCIES = $(builddir)/libhelpers-sierra.la am_libmm_utils_sierra_la_OBJECTS = sierra/mm-common-sierra.lo \ sierra/mm-sim-sierra.lo sierra/mm-broadband-bearer-sierra.lo \ sierra/mm-broadband-modem-sierra.lo libmm_utils_sierra_la_OBJECTS = $(am_libmm_utils_sierra_la_OBJECTS) libmm_utils_telit_la_LIBADD = -am_libmm_utils_telit_la_OBJECTS = telit/mm-common-telit.lo \ - telit/mm-broadband-modem-telit.lo +am_libmm_utils_telit_la_OBJECTS = \ + telit/libmm_utils_telit_la-mm-common-telit.lo \ + telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo libmm_utils_telit_la_OBJECTS = $(am_libmm_utils_telit_la_OBJECTS) -PROGRAMS = $(noinst_PROGRAMS) +libmm_utils_xmm_la_DEPENDENCIES = $(builddir)/libhelpers-xmm.la +am__libmm_utils_xmm_la_SOURCES_DIST = xmm/mm-shared-xmm.h \ + xmm/mm-shared-xmm.c xmm/mm-broadband-modem-xmm.h \ + xmm/mm-broadband-modem-xmm.c xmm/mm-broadband-modem-mbim-xmm.h \ + xmm/mm-broadband-modem-mbim-xmm.c +@WITH_MBIM_TRUE@am__objects_6 = xmm/mm-broadband-modem-mbim-xmm.lo +am_libmm_utils_xmm_la_OBJECTS = xmm/mm-shared-xmm.lo \ + xmm/mm-broadband-modem-xmm.lo $(am__objects_6) +libmm_utils_xmm_la_OBJECTS = $(am_libmm_utils_xmm_la_OBJECTS) am_test_modem_helpers_altair_lte_OBJECTS = altair/tests/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.$(OBJEXT) test_modem_helpers_altair_lte_OBJECTS = \ $(am_test_modem_helpers_altair_lte_OBJECTS) @@ -565,11 +662,25 @@ $(builddir)/libhelpers-icera.la \ $(top_builddir)/src/libhelpers.la \ $(top_builddir)/libmm-glib/libmm-glib.la +am_test_modem_helpers_linktop_OBJECTS = linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.$(OBJEXT) +test_modem_helpers_linktop_OBJECTS = \ + $(am_test_modem_helpers_linktop_OBJECTS) +test_modem_helpers_linktop_DEPENDENCIES = \ + $(builddir)/libhelpers-linktop.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la am_test_modem_helpers_mbm_OBJECTS = mbm/tests/test_modem_helpers_mbm-test-modem-helpers-mbm.$(OBJEXT) test_modem_helpers_mbm_OBJECTS = $(am_test_modem_helpers_mbm_OBJECTS) test_modem_helpers_mbm_DEPENDENCIES = $(builddir)/libhelpers-mbm.la \ $(top_builddir)/src/libhelpers.la \ $(top_builddir)/libmm-glib/libmm-glib.la +am_test_modem_helpers_sierra_OBJECTS = sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.$(OBJEXT) +test_modem_helpers_sierra_OBJECTS = \ + $(am_test_modem_helpers_sierra_OBJECTS) +test_modem_helpers_sierra_DEPENDENCIES = \ + $(builddir)/libhelpers-sierra.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la am_test_modem_helpers_telit_OBJECTS = telit/tests/test_modem_helpers_telit-test-mm-modem-helpers-telit.$(OBJEXT) test_modem_helpers_telit_OBJECTS = \ $(am_test_modem_helpers_telit_OBJECTS) @@ -584,9 +695,25 @@ $(builddir)/libhelpers-thuraya.la \ $(top_builddir)/src/libhelpers.la \ $(top_builddir)/libmm-glib/libmm-glib.la +am_test_modem_helpers_ublox_OBJECTS = ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.$(OBJEXT) +test_modem_helpers_ublox_OBJECTS = \ + $(am_test_modem_helpers_ublox_OBJECTS) +test_modem_helpers_ublox_DEPENDENCIES = \ + $(builddir)/libhelpers-ublox.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la +am_test_modem_helpers_xmm_OBJECTS = xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.$(OBJEXT) +test_modem_helpers_xmm_OBJECTS = $(am_test_modem_helpers_xmm_OBJECTS) +test_modem_helpers_xmm_DEPENDENCIES = $(builddir)/libhelpers-xmm.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la am_test_service_generic_OBJECTS = generic/tests/test_service_generic-test-service-generic.$(OBJEXT) test_service_generic_OBJECTS = $(am_test_service_generic_OBJECTS) test_service_generic_DEPENDENCIES = $(TEST_COMMON_LIBADD_FLAGS) +am_test_udev_rules_OBJECTS = tests/test-udev-rules.$(OBJEXT) +test_udev_rules_OBJECTS = $(am_test_udev_rules_OBJECTS) +test_udev_rules_DEPENDENCIES = $(top_builddir)/src/libkerneldevice.la \ + $(top_builddir)/libmm-glib/libmm-glib.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -601,7 +728,130 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-bearer-altair-lte.Plo \ + altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.Plo \ + altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo \ + altair/$(DEPDIR)/mm-modem-helpers-altair-lte.Plo \ + altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po \ + anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-broadband-modem-anydata.Plo \ + anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-plugin-anydata.Plo \ + cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Plo \ + cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Plo \ + cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo \ + cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-plugin-cinterion.Plo \ + cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Plo \ + cinterion/$(DEPDIR)/mm-modem-helpers-cinterion.Plo \ + cinterion/tests/$(DEPDIR)/test_modem_helpers_cinterion-test-modem-helpers-cinterion.Po \ + dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Plo \ + dell/$(DEPDIR)/libmm_plugin_dell_la-mm-plugin-dell.Plo \ + fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Plo \ + generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo \ + generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po \ + haier/$(DEPDIR)/libmm_plugin_haier_la-mm-plugin-haier.Plo \ + huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-bearer-huawei.Plo \ + huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-modem-huawei.Plo \ + huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-call-huawei.Plo \ + huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-plugin-huawei.Plo \ + huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-sim-huawei.Plo \ + huawei/$(DEPDIR)/mm-modem-helpers-huawei.Plo \ + huawei/tests/$(DEPDIR)/test_modem_helpers_huawei-test-modem-helpers-huawei.Po \ + icera/$(DEPDIR)/mm-broadband-bearer-icera.Plo \ + icera/$(DEPDIR)/mm-broadband-modem-icera.Plo \ + icera/$(DEPDIR)/mm-modem-helpers-icera.Plo \ + icera/tests/$(DEPDIR)/test_modem_helpers_icera-test-modem-helpers-icera.Po \ + iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-bearer-iridium.Plo \ + iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-broadband-modem-iridium.Plo \ + iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-plugin-iridium.Plo \ + iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-sim-iridium.Plo \ + linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-broadband-modem-linktop.Plo \ + linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-plugin-linktop.Plo \ + linktop/$(DEPDIR)/mm-modem-helpers-linktop.Plo \ + linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po \ + longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-broadband-modem-longcheer.Plo \ + longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-plugin-longcheer.Plo \ + mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo \ + mbm/$(DEPDIR)/mm-broadband-bearer-mbm.Plo \ + mbm/$(DEPDIR)/mm-broadband-modem-mbm.Plo \ + mbm/$(DEPDIR)/mm-modem-helpers-mbm.Plo \ + mbm/$(DEPDIR)/mm-sim-mbm.Plo \ + mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po \ + motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-broadband-modem-motorola.Plo \ + motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-plugin-motorola.Plo \ + mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-broadband-modem-mtk.Plo \ + mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-plugin-mtk.Plo \ + nokia/$(DEPDIR)/libmm_plugin_nokia_icera_la-mm-plugin-nokia-icera.Plo \ + nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-broadband-modem-nokia.Plo \ + nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-plugin-nokia.Plo \ + nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-sim-nokia.Plo \ + novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo \ + novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-bearer-novatel-lte.Plo \ + novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.Plo \ + novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo \ + novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.Plo \ + novatel/$(DEPDIR)/mm-broadband-modem-novatel.Plo \ + novatel/$(DEPDIR)/mm-common-novatel.Plo \ + option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-bearer-hso.Plo \ + option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-modem-hso.Plo \ + option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo \ + option/$(DEPDIR)/libmm_plugin_option_la-mm-plugin-option.Plo \ + option/$(DEPDIR)/mm-broadband-modem-option.Plo \ + pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-broadband-modem-pantech.Plo \ + pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-plugin-pantech.Plo \ + pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-sim-pantech.Plo \ + quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Plo \ + quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Plo \ + quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Plo \ + quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Plo \ + samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-broadband-modem-samsung.Plo \ + samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo \ + sierra/$(DEPDIR)/libmm_plugin_sierra_la-mm-plugin-sierra.Plo \ + sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.Plo \ + sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.Plo \ + sierra/$(DEPDIR)/mm-broadband-bearer-sierra.Plo \ + sierra/$(DEPDIR)/mm-broadband-modem-sierra.Plo \ + sierra/$(DEPDIR)/mm-common-sierra.Plo \ + sierra/$(DEPDIR)/mm-modem-helpers-sierra.Plo \ + sierra/$(DEPDIR)/mm-sim-sierra.Plo \ + sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po \ + simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-broadband-modem-simtech.Plo \ + simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-plugin-simtech.Plo \ + telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Plo \ + telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Plo \ + telit/$(DEPDIR)/libmm_plugin_telit_la-mm-plugin-telit.Plo \ + telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Plo \ + telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Plo \ + telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po \ + tests/$(DEPDIR)/libmm_test_common_la-test-fixture.Plo \ + tests/$(DEPDIR)/libmm_test_common_la-test-port-context.Plo \ + tests/$(DEPDIR)/test-udev-rules.Po \ + thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.Plo \ + thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-plugin-thuraya.Plo \ + thuraya/$(DEPDIR)/mm-modem-helpers-thuraya.Plo \ + thuraya/tests/$(DEPDIR)/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.Po \ + ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Plo \ + ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Plo \ + ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Plo \ + ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Plo \ + ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Plo \ + ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Plo \ + ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Plo \ + ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po \ + via/$(DEPDIR)/libmm_plugin_via_la-mm-broadband-modem-via.Plo \ + via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo \ + wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-broadband-modem-wavecom.Plo \ + wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-plugin-wavecom.Plo \ + x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-broadband-modem-x22x.Plo \ + x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-plugin-x22x.Plo \ + xmm/$(DEPDIR)/mm-broadband-modem-mbim-xmm.Plo \ + xmm/$(DEPDIR)/mm-broadband-modem-xmm.Plo \ + xmm/$(DEPDIR)/mm-modem-helpers-xmm.Plo \ + xmm/$(DEPDIR)/mm-shared-xmm.Plo \ + xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po \ + zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte-icera.Plo \ + zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte.Plo \ + zte/$(DEPDIR)/libmm_plugin_zte_la-mm-common-zte.Plo \ + zte/$(DEPDIR)/libmm_plugin_zte_la-mm-plugin-zte.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -624,13 +874,19 @@ SOURCES = $(libhelpers_altair_lte_la_SOURCES) \ $(libhelpers_cinterion_la_SOURCES) \ $(libhelpers_huawei_la_SOURCES) $(libhelpers_icera_la_SOURCES) \ - $(libhelpers_mbm_la_SOURCES) $(libhelpers_telit_la_SOURCES) \ + $(libhelpers_linktop_la_SOURCES) $(libhelpers_mbm_la_SOURCES) \ + $(libhelpers_sierra_la_SOURCES) $(libhelpers_telit_la_SOURCES) \ + $(nodist_libhelpers_telit_la_SOURCES) \ $(libhelpers_thuraya_la_SOURCES) \ + $(libhelpers_ublox_la_SOURCES) \ + $(nodist_libhelpers_ublox_la_SOURCES) \ + $(libhelpers_xmm_la_SOURCES) \ $(libmm_plugin_altair_lte_la_SOURCES) \ $(libmm_plugin_anydata_la_SOURCES) \ $(libmm_plugin_cinterion_la_SOURCES) \ $(libmm_plugin_dell_la_SOURCES) \ $(libmm_plugin_ericsson_mbm_la_SOURCES) \ + $(libmm_plugin_fibocom_la_SOURCES) \ $(libmm_plugin_generic_la_SOURCES) \ $(libmm_plugin_haier_la_SOURCES) \ $(libmm_plugin_huawei_la_SOURCES) \ @@ -641,17 +897,19 @@ $(libmm_plugin_mtk_la_SOURCES) \ $(libmm_plugin_nokia_icera_la_SOURCES) \ $(libmm_plugin_nokia_la_SOURCES) \ - $(libmm_plugin_novatel_la_SOURCES) \ $(libmm_plugin_novatel_lte_la_SOURCES) \ + $(libmm_plugin_novatel_la_SOURCES) \ $(libmm_plugin_option_hso_la_SOURCES) \ $(libmm_plugin_option_la_SOURCES) \ $(libmm_plugin_pantech_la_SOURCES) \ + $(libmm_plugin_quectel_la_SOURCES) \ $(libmm_plugin_samsung_la_SOURCES) \ $(libmm_plugin_sierra_legacy_la_SOURCES) \ $(libmm_plugin_sierra_la_SOURCES) \ $(libmm_plugin_simtech_la_SOURCES) \ $(libmm_plugin_telit_la_SOURCES) \ $(libmm_plugin_thuraya_la_SOURCES) \ + $(libmm_plugin_ublox_la_SOURCES) \ $(libmm_plugin_via_la_SOURCES) \ $(libmm_plugin_wavecom_la_SOURCES) \ $(libmm_plugin_x22x_la_SOURCES) $(libmm_plugin_zte_la_SOURCES) \ @@ -660,25 +918,32 @@ $(libmm_utils_novatel_la_SOURCES) \ $(libmm_utils_option_la_SOURCES) \ $(libmm_utils_sierra_la_SOURCES) \ - $(libmm_utils_telit_la_SOURCES) \ + $(libmm_utils_telit_la_SOURCES) $(libmm_utils_xmm_la_SOURCES) \ $(test_modem_helpers_altair_lte_SOURCES) \ $(test_modem_helpers_cinterion_SOURCES) \ $(test_modem_helpers_huawei_SOURCES) \ $(test_modem_helpers_icera_SOURCES) \ + $(test_modem_helpers_linktop_SOURCES) \ $(test_modem_helpers_mbm_SOURCES) \ + $(test_modem_helpers_sierra_SOURCES) \ $(test_modem_helpers_telit_SOURCES) \ $(test_modem_helpers_thuraya_SOURCES) \ - $(test_service_generic_SOURCES) + $(test_modem_helpers_ublox_SOURCES) \ + $(test_modem_helpers_xmm_SOURCES) \ + $(test_service_generic_SOURCES) $(test_udev_rules_SOURCES) DIST_SOURCES = $(libhelpers_altair_lte_la_SOURCES) \ $(libhelpers_cinterion_la_SOURCES) \ $(libhelpers_huawei_la_SOURCES) $(libhelpers_icera_la_SOURCES) \ - $(libhelpers_mbm_la_SOURCES) $(libhelpers_telit_la_SOURCES) \ + $(libhelpers_linktop_la_SOURCES) $(libhelpers_mbm_la_SOURCES) \ + $(libhelpers_sierra_la_SOURCES) $(libhelpers_telit_la_SOURCES) \ $(libhelpers_thuraya_la_SOURCES) \ + $(libhelpers_ublox_la_SOURCES) $(libhelpers_xmm_la_SOURCES) \ $(libmm_plugin_altair_lte_la_SOURCES) \ $(libmm_plugin_anydata_la_SOURCES) \ $(am__libmm_plugin_cinterion_la_SOURCES_DIST) \ - $(libmm_plugin_dell_la_SOURCES) \ + $(am__libmm_plugin_dell_la_SOURCES_DIST) \ $(libmm_plugin_ericsson_mbm_la_SOURCES) \ + $(libmm_plugin_fibocom_la_SOURCES) \ $(libmm_plugin_generic_la_SOURCES) \ $(libmm_plugin_haier_la_SOURCES) \ $(libmm_plugin_huawei_la_SOURCES) \ @@ -689,17 +954,19 @@ $(libmm_plugin_mtk_la_SOURCES) \ $(libmm_plugin_nokia_icera_la_SOURCES) \ $(libmm_plugin_nokia_la_SOURCES) \ - $(libmm_plugin_novatel_la_SOURCES) \ $(libmm_plugin_novatel_lte_la_SOURCES) \ + $(libmm_plugin_novatel_la_SOURCES) \ $(libmm_plugin_option_hso_la_SOURCES) \ $(libmm_plugin_option_la_SOURCES) \ $(libmm_plugin_pantech_la_SOURCES) \ + $(am__libmm_plugin_quectel_la_SOURCES_DIST) \ $(libmm_plugin_samsung_la_SOURCES) \ $(libmm_plugin_sierra_legacy_la_SOURCES) \ $(libmm_plugin_sierra_la_SOURCES) \ $(libmm_plugin_simtech_la_SOURCES) \ $(libmm_plugin_telit_la_SOURCES) \ $(libmm_plugin_thuraya_la_SOURCES) \ + $(libmm_plugin_ublox_la_SOURCES) \ $(libmm_plugin_via_la_SOURCES) \ $(libmm_plugin_wavecom_la_SOURCES) \ $(libmm_plugin_x22x_la_SOURCES) $(libmm_plugin_zte_la_SOURCES) \ @@ -709,14 +976,19 @@ $(libmm_utils_option_la_SOURCES) \ $(libmm_utils_sierra_la_SOURCES) \ $(libmm_utils_telit_la_SOURCES) \ + $(am__libmm_utils_xmm_la_SOURCES_DIST) \ $(test_modem_helpers_altair_lte_SOURCES) \ $(test_modem_helpers_cinterion_SOURCES) \ $(test_modem_helpers_huawei_SOURCES) \ $(test_modem_helpers_icera_SOURCES) \ + $(test_modem_helpers_linktop_SOURCES) \ $(test_modem_helpers_mbm_SOURCES) \ + $(test_modem_helpers_sierra_SOURCES) \ $(test_modem_helpers_telit_SOURCES) \ $(test_modem_helpers_thuraya_SOURCES) \ - $(test_service_generic_SOURCES) + $(test_modem_helpers_ublox_SOURCES) \ + $(test_modem_helpers_xmm_SOURCES) \ + $(test_service_generic_SOURCES) $(test_udev_rules_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -746,7 +1018,6 @@ $(top_srcdir)/gtester.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -799,14 +1070,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -927,8 +1190,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -962,11 +1223,23 @@ ################################################################################ AM_CFLAGS = $(MM_CFLAGS) $(CODE_COVERAGE_CFLAGS) $(GUDEV_CFLAGS) \ -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_builddir)/src \ - -I$(top_srcdir)/include -I$(top_builddir)/include \ - -I$(top_srcdir)/libmm-glib \ + -I$(top_srcdir)/src/kerneldevice -I$(top_srcdir)/include \ + -I$(top_builddir)/include -I$(top_srcdir)/libmm-glib \ -I$(top_srcdir)/libmm-glib/generated \ -I$(top_builddir)/libmm-glib/generated $(NULL) $(am__append_1) \ - $(am__append_3) + $(am__append_3) -DTESTUDEVRULESDIR_HUAWEI=\"${srcdir}/huawei\" \ + -DTESTUDEVRULESDIR_MBM=\"${srcdir}/mbm\" \ + -DTESTUDEVRULESDIR_NOKIA=\"${srcdir}/nokia\" \ + -DTESTUDEVRULESDIR_ZTE=\"${srcdir}/zte\" \ + -DTESTUDEVRULESDIR_LONGCHEER=\"${srcdir}/longcheer\" \ + -DTESTUDEVRULESDIR_SIMTECH=\"${srcdir}/simtech\" \ + -DTESTUDEVRULESDIR_X22X=\"${srcdir}/x22x\" \ + -DTESTUDEVRULESDIR_CINTERION=\"${srcdir}/cinterion\" \ + -DTESTUDEVRULESDIR_TELIT=\"${srcdir}/telit\" \ + -DTESTUDEVRULESDIR_MTK=\"${srcdir}/mtk\" \ + -DTESTUDEVRULESDIR_HAIER=\"${srcdir}/haier\" \ + -DTESTUDEVRULESDIR_DELL=\"${srcdir}/dell\" \ + -DTESTUDEVRULESDIR_FIBOCOM=\"${srcdir}/fibocom\" AM_LDFLAGS = $(MM_LIBS) $(CODE_COVERAGE_LDFLAGS) $(GUDEV_LIBS) $(NULL) \ $(am__append_2) $(am__append_4) @@ -983,18 +1256,28 @@ # UDev rules udevrulesdir = $(UDEV_BASE_DIR)/rules.d + +################################################################################ +# plugin: sierra (new QMI or MBIM modems) +################################################################################ + +################################################################################ +# plugin: u-blox +################################################################################ dist_udevrules_DATA = huawei/77-mm-huawei-net-port-types.rules \ - mbm/77-mm-ericsson-mbm.rules \ + mbm/77-mm-ericsson-mbm.rules sierra/77-mm-sierra.rules \ nokia/77-mm-nokia-port-types.rules \ zte/77-mm-zte-port-types.rules \ longcheer/77-mm-longcheer-port-types.rules \ simtech/77-mm-simtech-port-types.rules \ x22x/77-mm-x22x-port-types.rules \ cinterion/77-mm-cinterion-port-types.rules \ - dell/77-mm-dell-port-types.rules \ telit/77-mm-telit-port-types.rules \ mtk/77-mm-mtk-port-types.rules \ - haier/77-mm-haier-port-types.rules + haier/77-mm-haier-port-types.rules \ + ublox/77-mm-ublox-port-types.rules \ + dell/77-mm-dell-port-types.rules \ + fibocom/77-mm-fibocom-port-types.rules # Helper libs @@ -1025,18 +1308,18 @@ # Common Novatel modem support library ################################################################################ -# common telit support +# common xmm support ################################################################################ -# Common telit helpers library - -# Common telit modem support library - ################################################################################ # plugin: huawei ################################################################################ ################################################################################ +# plugin: linktop cdma +################################################################################ + +################################################################################ # plugin: cinterion (previously siemens) ################################################################################ @@ -1047,13 +1330,16 @@ ################################################################################ # plugin: altair lte ################################################################################ + +# Common telit modem support library noinst_LTLIBRARIES = libmm-test-common.la libhelpers-icera.la \ libmm-utils-icera.la libhelpers-mbm.la libmm-utils-mbm.la \ - libmm-utils-sierra.la libmm-utils-option.la \ - libmm-utils-novatel.la libhelpers-telit.la \ - libmm-utils-telit.la libhelpers-huawei.la \ + libhelpers-sierra.la libmm-utils-sierra.la \ + libmm-utils-option.la libmm-utils-novatel.la libhelpers-xmm.la \ + libmm-utils-xmm.la libhelpers-huawei.la libhelpers-linktop.la \ libhelpers-cinterion.la libhelpers-thuraya.la \ - libhelpers-altair-lte.la + libhelpers-altair-lte.la libhelpers-telit.la \ + libmm-utils-telit.la libhelpers-ublox.la # Plugins @@ -1078,10 +1364,6 @@ ################################################################################ ################################################################################ -# plugin: sierra (new QMI or MBIM modems) -################################################################################ - -################################################################################ # plugin: sierra (legacy) ################################################################################ @@ -1110,10 +1392,6 @@ ################################################################################ ################################################################################ -# plugin: linktop cdma -################################################################################ - -################################################################################ # plugin: simtech ################################################################################ @@ -1142,23 +1420,27 @@ ################################################################################ ################################################################################ -# plugin: dell (novatel, sierra or telit) +# plugin: via ################################################################################ ################################################################################ -# plugin: via +# plugin: mtk ################################################################################ ################################################################################ -# plugin: telit +# plugin: haier ################################################################################ ################################################################################ -# plugin: mtk +# plugin: dell (novatel, sierra or telit) ################################################################################ ################################################################################ -# plugin: haier +# plugin: quectel +################################################################################ + +################################################################################ +# plugin: fibocom ################################################################################ pkglib_LTLIBRARIES = libmm-plugin-generic.la libmm-plugin-motorola.la \ libmm-plugin-huawei.la libmm-plugin-ericsson-mbm.la \ @@ -1171,10 +1453,18 @@ libmm-plugin-x22x.la libmm-plugin-pantech.la \ libmm-plugin-samsung.la libmm-plugin-cinterion.la \ libmm-plugin-iridium.la libmm-plugin-thuraya.la \ - libmm-plugin-novatel_lte.la libmm-plugin-novatel.la \ - libmm-plugin-dell.la libmm-plugin-altair-lte.la \ - libmm-plugin-via.la libmm-plugin-telit.la libmm-plugin-mtk.la \ - libmm-plugin-haier.la + libmm-plugin-novatel-lte.la libmm-plugin-novatel.la \ + libmm-plugin-altair-lte.la libmm-plugin-via.la \ + libmm-plugin-telit.la libmm-plugin-mtk.la \ + libmm-plugin-haier.la libmm-plugin-ublox.la \ + libmm-plugin-dell.la libmm-plugin-quectel.la \ + libmm-plugin-fibocom.la + +# Built sources +BUILT_SOURCES = $(TELIT_ENUMS_GENERATED) $(UBLOX_ENUMS_GENERATED) + +# Clean files +CLEANFILES = $(TELIT_ENUMS_GENERATED) $(UBLOX_ENUMS_GENERATED) libmm_test_common_la_SOURCES = \ tests/test-fixture.h \ tests/test-fixture.c \ @@ -1272,6 +1562,25 @@ MBM_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/mbm MBM_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-mbm.la +libhelpers_sierra_la_SOURCES = \ + sierra/mm-modem-helpers-sierra.c \ + sierra/mm-modem-helpers-sierra.h \ + $(NULL) + +test_modem_helpers_sierra_SOURCES = \ + sierra/tests/test-modem-helpers-sierra.c \ + $(NULL) + +test_modem_helpers_sierra_CPPFLAGS = \ + -I$(top_srcdir)/plugins/sierra \ + $(NULL) + +test_modem_helpers_sierra_LDADD = \ + $(builddir)/libhelpers-sierra.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + libmm_utils_sierra_la_SOURCES = \ sierra/mm-common-sierra.c \ sierra/mm-common-sierra.h \ @@ -1283,6 +1592,10 @@ sierra/mm-broadband-modem-sierra.h \ $(NULL) +libmm_utils_sierra_la_LIBADD = \ + $(builddir)/libhelpers-sierra.la \ + $(NULL) + SIERRA_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/sierra SIERRA_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-sierra.la libmm_utils_option_la_SOURCES = \ @@ -1301,38 +1614,34 @@ NOVATEL_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/novatel NOVATEL_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-novatel.la -libhelpers_telit_la_SOURCES = \ - telit/mm-modem-helpers-telit.c \ - telit/mm-modem-helpers-telit.h \ +libhelpers_xmm_la_SOURCES = \ + xmm/mm-modem-helpers-xmm.c \ + xmm/mm-modem-helpers-xmm.h \ $(NULL) -test_modem_helpers_telit_SOURCES = \ - telit/tests/test-mm-modem-helpers-telit.c \ +test_modem_helpers_xmm_SOURCES = \ + xmm/tests/test-modem-helpers-xmm.c \ $(NULL) -test_modem_helpers_telit_CPPFLAGS = \ - -I$(top_srcdir)/plugins/telit \ +test_modem_helpers_xmm_CPPFLAGS = \ + -I$(top_srcdir)/plugins/xmm \ $(NULL) -test_modem_helpers_telit_LDADD = \ - $(builddir)/libhelpers-telit.la \ +test_modem_helpers_xmm_LDADD = \ + $(builddir)/libhelpers-xmm.la \ $(top_builddir)/src/libhelpers.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(NULL) -libmm_utils_telit_la_SOURCES = \ - telit/mm-common-telit.c \ - telit/mm-common-telit.h \ - telit/mm-broadband-modem-telit.c \ - telit/mm-broadband-modem-telit.h \ - $(NULL) - -TELIT_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/telit -TELIT_COMMON_LIBADD_FLAGS = \ - $(builddir)/libhelpers-telit.la \ - $(builddir)/libmm-utils-telit.la \ +libmm_utils_xmm_la_SOURCES = xmm/mm-shared-xmm.h xmm/mm-shared-xmm.c \ + xmm/mm-broadband-modem-xmm.h xmm/mm-broadband-modem-xmm.c \ + $(NULL) $(am__append_5) +libmm_utils_xmm_la_LIBADD = \ + $(builddir)/libhelpers-xmm.la \ $(NULL) +XMM_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/xmm +XMM_COMMON_LIBADD_FLAGS = $(builddir)/libmm-utils-xmm.la libmm_plugin_generic_la_SOURCES = \ generic/mm-plugin-generic.c \ generic/mm-plugin-generic.h \ @@ -1492,6 +1801,25 @@ libmm_plugin_anydata_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_anydata_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libhelpers_linktop_la_SOURCES = \ + linktop/mm-modem-helpers-linktop.c \ + linktop/mm-modem-helpers-linktop.h \ + $(NULL) + +test_modem_helpers_linktop_SOURCES = \ + linktop/tests/test-modem-helpers-linktop.c \ + $(NULL) + +test_modem_helpers_linktop_CPPFLAGS = \ + -I$(top_srcdir)/plugins/linktop \ + $(NULL) + +test_modem_helpers_linktop_LDADD = \ + $(builddir)/libhelpers-linktop.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + libmm_plugin_linktop_la_SOURCES = \ linktop/mm-plugin-linktop.c \ linktop/mm-plugin-linktop.h \ @@ -1501,6 +1829,7 @@ libmm_plugin_linktop_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_linktop_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_linktop_la_LIBADD = $(builddir)/libhelpers-linktop.la libmm_plugin_simtech_la_SOURCES = \ simtech/mm-plugin-simtech.c \ simtech/mm-plugin-simtech.h \ @@ -1561,11 +1890,13 @@ libmm_plugin_cinterion_la_SOURCES = cinterion/mm-plugin-cinterion.c \ cinterion/mm-plugin-cinterion.h \ - cinterion/mm-common-cinterion.c \ - cinterion/mm-common-cinterion.h \ + cinterion/mm-shared-cinterion.c \ + cinterion/mm-shared-cinterion.h \ cinterion/mm-broadband-modem-cinterion.c \ - cinterion/mm-broadband-modem-cinterion.h $(NULL) \ - $(am__append_5) + cinterion/mm-broadband-modem-cinterion.h \ + cinterion/mm-broadband-bearer-cinterion.c \ + cinterion/mm-broadband-bearer-cinterion.h $(NULL) \ + $(am__append_6) libmm_plugin_cinterion_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_cinterion_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) libmm_plugin_cinterion_la_LIBADD = $(builddir)/libhelpers-cinterion.la @@ -1633,14 +1964,6 @@ libmm_plugin_novatel_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(NOVATEL_COMMON_COMPILER_FLAGS) libmm_plugin_novatel_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) libmm_plugin_novatel_la_LIBADD = $(NOVATEL_COMMON_LIBADD_FLAGS) -libmm_plugin_dell_la_SOURCES = \ - dell/mm-plugin-dell.c \ - dell/mm-plugin-dell.h \ - $(NULL) - -libmm_plugin_dell_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(NOVATEL_COMMON_COMPILER_FLAGS) $(SIERRA_COMMON_COMPILER_FLAGS) $(TELIT_COMMON_COMPILER_FLAGS) $(MBM_COMMON_COMPILER_FLAGS) -libmm_plugin_dell_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) -libmm_plugin_dell_la_LIBADD = $(NOVATEL_COMMON_LIBADD_FLAGS) $(SIERRA_COMMON_LIBADD_FLAGS) $(TELIT_COMMON_LIBADD_FLAGS) $(MBM_COMMON_LIBADD_FLAGS) libhelpers_altair_lte_la_SOURCES = \ altair/mm-modem-helpers-altair-lte.c \ altair/mm-modem-helpers-altair-lte.h \ @@ -1681,14 +2004,64 @@ libmm_plugin_via_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_via_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) + +################################################################################ +# plugin: telit +################################################################################ +PLUGIN_TELIT_COMPILER_FLAGS = \ + -I$(top_srcdir)/plugins/telit \ + -I$(top_builddir)/plugins/telit \ + $(NULL) + +TELIT_ENUMS_INPUTS = \ + $(top_srcdir)/plugins/telit/mm-modem-helpers-telit.h \ + $(NULL) + +TELIT_ENUMS_GENERATED = \ + telit/mm-telit-enums-types.h \ + telit/mm-telit-enums-types.c \ + $(NULL) + +libhelpers_telit_la_SOURCES = \ + telit/mm-modem-helpers-telit.c \ + telit/mm-modem-helpers-telit.h \ + $(NULL) + +nodist_libhelpers_telit_la_SOURCES = $(TELIT_ENUMS_GENERATED) +libhelpers_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) libmm_plugin_telit_la_SOURCES = \ telit/mm-plugin-telit.c \ telit/mm-plugin-telit.h \ $(NULL) -libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) +libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(PLUGIN_TELIT_COMPILER_FLAGS) libmm_plugin_telit_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) libmm_plugin_telit_la_LIBADD = $(TELIT_COMMON_LIBADD_FLAGS) +test_modem_helpers_telit_SOURCES = \ + telit/tests/test-mm-modem-helpers-telit.c \ + $(NULL) + +test_modem_helpers_telit_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) +test_modem_helpers_telit_LDADD = \ + $(builddir)/libhelpers-telit.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + +libmm_utils_telit_la_SOURCES = \ + telit/mm-common-telit.c \ + telit/mm-common-telit.h \ + telit/mm-broadband-modem-telit.c \ + telit/mm-broadband-modem-telit.h \ + $(NULL) + +libmm_utils_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) +TELIT_COMMON_COMPILER_FLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS) +TELIT_COMMON_LIBADD_FLAGS = \ + $(builddir)/libhelpers-telit.la \ + $(builddir)/libmm-utils-telit.la \ + $(NULL) + libmm_plugin_mtk_la_SOURCES = \ mtk/mm-plugin-mtk.c \ mtk/mm-plugin-mtk.h \ @@ -1705,7 +2078,100 @@ libmm_plugin_haier_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_haier_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) -all: all-am +PLUGIN_UBLOX_COMPILER_FLAGS = \ + -I$(top_srcdir)/plugins/ublox \ + -I$(top_builddir)/plugins/ublox \ + $(NULL) + +UBLOX_ENUMS_INPUTS = \ + $(top_srcdir)/plugins/ublox/mm-modem-helpers-ublox.h \ + $(NULL) + +UBLOX_ENUMS_GENERATED = \ + ublox/mm-ublox-enums-types.h \ + ublox/mm-ublox-enums-types.c \ + $(NULL) + +libhelpers_ublox_la_SOURCES = \ + ublox/mm-modem-helpers-ublox.c \ + ublox/mm-modem-helpers-ublox.h \ + $(NULL) + +nodist_libhelpers_ublox_la_SOURCES = $(UBLOX_ENUMS_GENERATED) +libhelpers_ublox_la_CPPFLAGS = $(PLUGIN_UBLOX_COMPILER_FLAGS) +test_modem_helpers_ublox_SOURCES = \ + ublox/tests/test-modem-helpers-ublox.c \ + $(NULL) + +test_modem_helpers_ublox_CPPFLAGS = $(PLUGIN_UBLOX_COMPILER_FLAGS) +test_modem_helpers_ublox_LDADD = \ + $(builddir)/libhelpers-ublox.la \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + +libmm_plugin_ublox_la_SOURCES = \ + ublox/mm-plugin-ublox.c \ + ublox/mm-plugin-ublox.h \ + ublox/mm-call-ublox.c \ + ublox/mm-call-ublox.h \ + ublox/mm-broadband-bearer-ublox.h \ + ublox/mm-broadband-bearer-ublox.c \ + ublox/mm-broadband-modem-ublox.h \ + ublox/mm-broadband-modem-ublox.c \ + ublox/mm-sim-ublox.c \ + ublox/mm-sim-ublox.h \ + $(NULL) + +libmm_plugin_ublox_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(PLUGIN_UBLOX_COMPILER_FLAGS) +libmm_plugin_ublox_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_ublox_la_LIBADD = $(builddir)/libhelpers-ublox.la +libmm_plugin_dell_la_SOURCES = dell/mm-plugin-dell.c \ + dell/mm-plugin-dell.h $(NULL) $(am__append_7) +libmm_plugin_dell_la_CPPFLAGS = \ + $(PLUGIN_COMMON_COMPILER_FLAGS) \ + $(NOVATEL_COMMON_COMPILER_FLAGS) \ + $(SIERRA_COMMON_COMPILER_FLAGS) \ + $(TELIT_COMMON_COMPILER_FLAGS) \ + $(XMM_COMMON_COMPILER_FLAGS) \ + $(MBM_COMMON_COMPILER_FLAGS) \ + $(NULL) + +libmm_plugin_dell_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_dell_la_LIBADD = \ + $(NOVATEL_COMMON_LIBADD_FLAGS) \ + $(SIERRA_COMMON_LIBADD_FLAGS) \ + $(TELIT_COMMON_LIBADD_FLAGS) \ + $(XMM_COMMON_LIBADD_FLAGS) \ + $(MBM_COMMON_LIBADD_FLAGS) \ + $(NULL) + +libmm_plugin_quectel_la_SOURCES = quectel/mm-plugin-quectel.c \ + quectel/mm-plugin-quectel.h quectel/mm-shared-quectel.c \ + quectel/mm-shared-quectel.h \ + quectel/mm-broadband-modem-quectel.c \ + quectel/mm-broadband-modem-quectel.h $(NULL) $(am__append_8) +libmm_plugin_quectel_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) +libmm_plugin_quectel_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_fibocom_la_SOURCES = \ + fibocom/mm-plugin-fibocom.c \ + fibocom/mm-plugin-fibocom.h \ + $(NULL) + +libmm_plugin_fibocom_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(XMM_COMMON_COMPILER_FLAGS) +libmm_plugin_fibocom_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) +libmm_plugin_fibocom_la_LIBADD = $(XMM_COMMON_LIBADD_FLAGS) +test_udev_rules_SOURCES = \ + tests/test-udev-rules.c \ + $(NULL) + +test_udev_rules_LDADD = \ + $(top_builddir)/src/libkerneldevice.la \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -1726,8 +2192,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtester.make $(am__empty): @@ -1740,6 +2206,15 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ @@ -1829,6 +2304,17 @@ libhelpers-icera.la: $(libhelpers_icera_la_OBJECTS) $(libhelpers_icera_la_DEPENDENCIES) $(EXTRA_libhelpers_icera_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libhelpers_icera_la_OBJECTS) $(libhelpers_icera_la_LIBADD) $(LIBS) +linktop/$(am__dirstamp): + @$(MKDIR_P) linktop + @: > linktop/$(am__dirstamp) +linktop/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) linktop/$(DEPDIR) + @: > linktop/$(DEPDIR)/$(am__dirstamp) +linktop/mm-modem-helpers-linktop.lo: linktop/$(am__dirstamp) \ + linktop/$(DEPDIR)/$(am__dirstamp) + +libhelpers-linktop.la: $(libhelpers_linktop_la_OBJECTS) $(libhelpers_linktop_la_DEPENDENCIES) $(EXTRA_libhelpers_linktop_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libhelpers_linktop_la_OBJECTS) $(libhelpers_linktop_la_LIBADD) $(LIBS) mbm/$(am__dirstamp): @$(MKDIR_P) mbm @: > mbm/$(am__dirstamp) @@ -1840,14 +2326,27 @@ libhelpers-mbm.la: $(libhelpers_mbm_la_OBJECTS) $(libhelpers_mbm_la_DEPENDENCIES) $(EXTRA_libhelpers_mbm_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libhelpers_mbm_la_OBJECTS) $(libhelpers_mbm_la_LIBADD) $(LIBS) +sierra/$(am__dirstamp): + @$(MKDIR_P) sierra + @: > sierra/$(am__dirstamp) +sierra/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sierra/$(DEPDIR) + @: > sierra/$(DEPDIR)/$(am__dirstamp) +sierra/mm-modem-helpers-sierra.lo: sierra/$(am__dirstamp) \ + sierra/$(DEPDIR)/$(am__dirstamp) + +libhelpers-sierra.la: $(libhelpers_sierra_la_OBJECTS) $(libhelpers_sierra_la_DEPENDENCIES) $(EXTRA_libhelpers_sierra_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libhelpers_sierra_la_OBJECTS) $(libhelpers_sierra_la_LIBADD) $(LIBS) telit/$(am__dirstamp): @$(MKDIR_P) telit @: > telit/$(am__dirstamp) telit/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) telit/$(DEPDIR) @: > telit/$(DEPDIR)/$(am__dirstamp) -telit/mm-modem-helpers-telit.lo: telit/$(am__dirstamp) \ - telit/$(DEPDIR)/$(am__dirstamp) +telit/libhelpers_telit_la-mm-modem-helpers-telit.lo: \ + telit/$(am__dirstamp) telit/$(DEPDIR)/$(am__dirstamp) +telit/libhelpers_telit_la-mm-telit-enums-types.lo: \ + telit/$(am__dirstamp) telit/$(DEPDIR)/$(am__dirstamp) libhelpers-telit.la: $(libhelpers_telit_la_OBJECTS) $(libhelpers_telit_la_DEPENDENCIES) $(EXTRA_libhelpers_telit_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libhelpers_telit_la_OBJECTS) $(libhelpers_telit_la_LIBADD) $(LIBS) @@ -1862,6 +2361,30 @@ libhelpers-thuraya.la: $(libhelpers_thuraya_la_OBJECTS) $(libhelpers_thuraya_la_DEPENDENCIES) $(EXTRA_libhelpers_thuraya_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libhelpers_thuraya_la_OBJECTS) $(libhelpers_thuraya_la_LIBADD) $(LIBS) +ublox/$(am__dirstamp): + @$(MKDIR_P) ublox + @: > ublox/$(am__dirstamp) +ublox/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ublox/$(DEPDIR) + @: > ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo: \ + ublox/$(am__dirstamp) ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo: \ + ublox/$(am__dirstamp) ublox/$(DEPDIR)/$(am__dirstamp) + +libhelpers-ublox.la: $(libhelpers_ublox_la_OBJECTS) $(libhelpers_ublox_la_DEPENDENCIES) $(EXTRA_libhelpers_ublox_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libhelpers_ublox_la_OBJECTS) $(libhelpers_ublox_la_LIBADD) $(LIBS) +xmm/$(am__dirstamp): + @$(MKDIR_P) xmm + @: > xmm/$(am__dirstamp) +xmm/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) xmm/$(DEPDIR) + @: > xmm/$(DEPDIR)/$(am__dirstamp) +xmm/mm-modem-helpers-xmm.lo: xmm/$(am__dirstamp) \ + xmm/$(DEPDIR)/$(am__dirstamp) + +libhelpers-xmm.la: $(libhelpers_xmm_la_OBJECTS) $(libhelpers_xmm_la_DEPENDENCIES) $(EXTRA_libhelpers_xmm_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libhelpers_xmm_la_OBJECTS) $(libhelpers_xmm_la_LIBADD) $(LIBS) altair/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.lo: \ altair/$(am__dirstamp) altair/$(DEPDIR)/$(am__dirstamp) altair/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.lo: \ @@ -1886,10 +2409,12 @@ $(AM_V_CCLD)$(libmm_plugin_anydata_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_anydata_la_OBJECTS) $(libmm_plugin_anydata_la_LIBADD) $(LIBS) cinterion/libmm_plugin_cinterion_la-mm-plugin-cinterion.lo: \ cinterion/$(am__dirstamp) cinterion/$(DEPDIR)/$(am__dirstamp) -cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo: \ +cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo: \ cinterion/$(am__dirstamp) cinterion/$(DEPDIR)/$(am__dirstamp) cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo: \ cinterion/$(am__dirstamp) cinterion/$(DEPDIR)/$(am__dirstamp) +cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo: \ + cinterion/$(am__dirstamp) cinterion/$(DEPDIR)/$(am__dirstamp) cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo: \ cinterion/$(am__dirstamp) cinterion/$(DEPDIR)/$(am__dirstamp) @@ -1903,6 +2428,8 @@ @: > dell/$(DEPDIR)/$(am__dirstamp) dell/libmm_plugin_dell_la-mm-plugin-dell.lo: dell/$(am__dirstamp) \ dell/$(DEPDIR)/$(am__dirstamp) +dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo: \ + dell/$(am__dirstamp) dell/$(DEPDIR)/$(am__dirstamp) libmm-plugin-dell.la: $(libmm_plugin_dell_la_OBJECTS) $(libmm_plugin_dell_la_DEPENDENCIES) $(EXTRA_libmm_plugin_dell_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_dell_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_dell_la_OBJECTS) $(libmm_plugin_dell_la_LIBADD) $(LIBS) @@ -1911,6 +2438,17 @@ libmm-plugin-ericsson-mbm.la: $(libmm_plugin_ericsson_mbm_la_OBJECTS) $(libmm_plugin_ericsson_mbm_la_DEPENDENCIES) $(EXTRA_libmm_plugin_ericsson_mbm_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_ericsson_mbm_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_ericsson_mbm_la_OBJECTS) $(libmm_plugin_ericsson_mbm_la_LIBADD) $(LIBS) +fibocom/$(am__dirstamp): + @$(MKDIR_P) fibocom + @: > fibocom/$(am__dirstamp) +fibocom/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) fibocom/$(DEPDIR) + @: > fibocom/$(DEPDIR)/$(am__dirstamp) +fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo: \ + fibocom/$(am__dirstamp) fibocom/$(DEPDIR)/$(am__dirstamp) + +libmm-plugin-fibocom.la: $(libmm_plugin_fibocom_la_OBJECTS) $(libmm_plugin_fibocom_la_DEPENDENCIES) $(EXTRA_libmm_plugin_fibocom_la_DEPENDENCIES) + $(AM_V_CCLD)$(libmm_plugin_fibocom_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_fibocom_la_OBJECTS) $(libmm_plugin_fibocom_la_LIBADD) $(LIBS) generic/$(am__dirstamp): @$(MKDIR_P) generic @: > generic/$(am__dirstamp) @@ -1963,12 +2501,6 @@ libmm-plugin-iridium.la: $(libmm_plugin_iridium_la_OBJECTS) $(libmm_plugin_iridium_la_DEPENDENCIES) $(EXTRA_libmm_plugin_iridium_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_iridium_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_iridium_la_OBJECTS) $(libmm_plugin_iridium_la_LIBADD) $(LIBS) -linktop/$(am__dirstamp): - @$(MKDIR_P) linktop - @: > linktop/$(am__dirstamp) -linktop/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) linktop/$(DEPDIR) - @: > linktop/$(DEPDIR)/$(am__dirstamp) linktop/libmm_plugin_linktop_la-mm-plugin-linktop.lo: \ linktop/$(am__dirstamp) linktop/$(DEPDIR)/$(am__dirstamp) linktop/libmm_plugin_linktop_la-mm-broadband-modem-linktop.lo: \ @@ -2041,11 +2573,6 @@ novatel/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) novatel/$(DEPDIR) @: > novatel/$(DEPDIR)/$(am__dirstamp) -novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo: \ - novatel/$(am__dirstamp) novatel/$(DEPDIR)/$(am__dirstamp) - -libmm-plugin-novatel.la: $(libmm_plugin_novatel_la_OBJECTS) $(libmm_plugin_novatel_la_DEPENDENCIES) $(EXTRA_libmm_plugin_novatel_la_DEPENDENCIES) - $(AM_V_CCLD)$(libmm_plugin_novatel_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_novatel_la_OBJECTS) $(libmm_plugin_novatel_la_LIBADD) $(LIBS) novatel/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.lo: \ novatel/$(am__dirstamp) novatel/$(DEPDIR)/$(am__dirstamp) novatel/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.lo: \ @@ -2055,8 +2582,13 @@ novatel/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.lo: \ novatel/$(am__dirstamp) novatel/$(DEPDIR)/$(am__dirstamp) -libmm-plugin-novatel_lte.la: $(libmm_plugin_novatel_lte_la_OBJECTS) $(libmm_plugin_novatel_lte_la_DEPENDENCIES) $(EXTRA_libmm_plugin_novatel_lte_la_DEPENDENCIES) +libmm-plugin-novatel-lte.la: $(libmm_plugin_novatel_lte_la_OBJECTS) $(libmm_plugin_novatel_lte_la_DEPENDENCIES) $(EXTRA_libmm_plugin_novatel_lte_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_novatel_lte_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_novatel_lte_la_OBJECTS) $(libmm_plugin_novatel_lte_la_LIBADD) $(LIBS) +novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo: \ + novatel/$(am__dirstamp) novatel/$(DEPDIR)/$(am__dirstamp) + +libmm-plugin-novatel.la: $(libmm_plugin_novatel_la_OBJECTS) $(libmm_plugin_novatel_la_DEPENDENCIES) $(EXTRA_libmm_plugin_novatel_la_DEPENDENCIES) + $(AM_V_CCLD)$(libmm_plugin_novatel_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_novatel_la_OBJECTS) $(libmm_plugin_novatel_la_LIBADD) $(LIBS) option/$(am__dirstamp): @$(MKDIR_P) option @: > option/$(am__dirstamp) @@ -2092,6 +2624,23 @@ libmm-plugin-pantech.la: $(libmm_plugin_pantech_la_OBJECTS) $(libmm_plugin_pantech_la_DEPENDENCIES) $(EXTRA_libmm_plugin_pantech_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_pantech_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_pantech_la_OBJECTS) $(libmm_plugin_pantech_la_LIBADD) $(LIBS) +quectel/$(am__dirstamp): + @$(MKDIR_P) quectel + @: > quectel/$(am__dirstamp) +quectel/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) quectel/$(DEPDIR) + @: > quectel/$(DEPDIR)/$(am__dirstamp) +quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo: \ + quectel/$(am__dirstamp) quectel/$(DEPDIR)/$(am__dirstamp) +quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo: \ + quectel/$(am__dirstamp) quectel/$(DEPDIR)/$(am__dirstamp) +quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo: \ + quectel/$(am__dirstamp) quectel/$(DEPDIR)/$(am__dirstamp) +quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo: \ + quectel/$(am__dirstamp) quectel/$(DEPDIR)/$(am__dirstamp) + +libmm-plugin-quectel.la: $(libmm_plugin_quectel_la_OBJECTS) $(libmm_plugin_quectel_la_DEPENDENCIES) $(EXTRA_libmm_plugin_quectel_la_DEPENDENCIES) + $(AM_V_CCLD)$(libmm_plugin_quectel_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_quectel_la_OBJECTS) $(libmm_plugin_quectel_la_LIBADD) $(LIBS) samsung/$(am__dirstamp): @$(MKDIR_P) samsung @: > samsung/$(am__dirstamp) @@ -2105,12 +2654,6 @@ libmm-plugin-samsung.la: $(libmm_plugin_samsung_la_OBJECTS) $(libmm_plugin_samsung_la_DEPENDENCIES) $(EXTRA_libmm_plugin_samsung_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_samsung_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_samsung_la_OBJECTS) $(libmm_plugin_samsung_la_LIBADD) $(LIBS) -sierra/$(am__dirstamp): - @$(MKDIR_P) sierra - @: > sierra/$(am__dirstamp) -sierra/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) sierra/$(DEPDIR) - @: > sierra/$(DEPDIR)/$(am__dirstamp) sierra/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.lo: \ sierra/$(am__dirstamp) sierra/$(DEPDIR)/$(am__dirstamp) sierra/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.lo: \ @@ -2148,6 +2691,19 @@ libmm-plugin-thuraya.la: $(libmm_plugin_thuraya_la_OBJECTS) $(libmm_plugin_thuraya_la_DEPENDENCIES) $(EXTRA_libmm_plugin_thuraya_la_DEPENDENCIES) $(AM_V_CCLD)$(libmm_plugin_thuraya_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_thuraya_la_OBJECTS) $(libmm_plugin_thuraya_la_LIBADD) $(LIBS) +ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo: ublox/$(am__dirstamp) \ + ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libmm_plugin_ublox_la-mm-call-ublox.lo: ublox/$(am__dirstamp) \ + ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo: \ + ublox/$(am__dirstamp) ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo: \ + ublox/$(am__dirstamp) ublox/$(DEPDIR)/$(am__dirstamp) +ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo: ublox/$(am__dirstamp) \ + ublox/$(DEPDIR)/$(am__dirstamp) + +libmm-plugin-ublox.la: $(libmm_plugin_ublox_la_OBJECTS) $(libmm_plugin_ublox_la_DEPENDENCIES) $(EXTRA_libmm_plugin_ublox_la_DEPENDENCIES) + $(AM_V_CCLD)$(libmm_plugin_ublox_la_LINK) -rpath $(pkglibdir) $(libmm_plugin_ublox_la_OBJECTS) $(libmm_plugin_ublox_la_LIBADD) $(LIBS) via/$(am__dirstamp): @$(MKDIR_P) via @: > via/$(am__dirstamp) @@ -2255,22 +2811,22 @@ libmm-utils-sierra.la: $(libmm_utils_sierra_la_OBJECTS) $(libmm_utils_sierra_la_DEPENDENCIES) $(EXTRA_libmm_utils_sierra_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmm_utils_sierra_la_OBJECTS) $(libmm_utils_sierra_la_LIBADD) $(LIBS) -telit/mm-common-telit.lo: telit/$(am__dirstamp) \ - telit/$(DEPDIR)/$(am__dirstamp) -telit/mm-broadband-modem-telit.lo: telit/$(am__dirstamp) \ +telit/libmm_utils_telit_la-mm-common-telit.lo: telit/$(am__dirstamp) \ telit/$(DEPDIR)/$(am__dirstamp) +telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo: \ + telit/$(am__dirstamp) telit/$(DEPDIR)/$(am__dirstamp) libmm-utils-telit.la: $(libmm_utils_telit_la_OBJECTS) $(libmm_utils_telit_la_DEPENDENCIES) $(EXTRA_libmm_utils_telit_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmm_utils_telit_la_OBJECTS) $(libmm_utils_telit_la_LIBADD) $(LIBS) +xmm/mm-shared-xmm.lo: xmm/$(am__dirstamp) \ + xmm/$(DEPDIR)/$(am__dirstamp) +xmm/mm-broadband-modem-xmm.lo: xmm/$(am__dirstamp) \ + xmm/$(DEPDIR)/$(am__dirstamp) +xmm/mm-broadband-modem-mbim-xmm.lo: xmm/$(am__dirstamp) \ + xmm/$(DEPDIR)/$(am__dirstamp) -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list +libmm-utils-xmm.la: $(libmm_utils_xmm_la_OBJECTS) $(libmm_utils_xmm_la_DEPENDENCIES) $(EXTRA_libmm_utils_xmm_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libmm_utils_xmm_la_OBJECTS) $(libmm_utils_xmm_la_LIBADD) $(LIBS) altair/tests/$(am__dirstamp): @$(MKDIR_P) altair/tests @: > altair/tests/$(am__dirstamp) @@ -2323,6 +2879,19 @@ test-modem-helpers-icera$(EXEEXT): $(test_modem_helpers_icera_OBJECTS) $(test_modem_helpers_icera_DEPENDENCIES) $(EXTRA_test_modem_helpers_icera_DEPENDENCIES) @rm -f test-modem-helpers-icera$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_modem_helpers_icera_OBJECTS) $(test_modem_helpers_icera_LDADD) $(LIBS) +linktop/tests/$(am__dirstamp): + @$(MKDIR_P) linktop/tests + @: > linktop/tests/$(am__dirstamp) +linktop/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) linktop/tests/$(DEPDIR) + @: > linktop/tests/$(DEPDIR)/$(am__dirstamp) +linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.$(OBJEXT): \ + linktop/tests/$(am__dirstamp) \ + linktop/tests/$(DEPDIR)/$(am__dirstamp) + +test-modem-helpers-linktop$(EXEEXT): $(test_modem_helpers_linktop_OBJECTS) $(test_modem_helpers_linktop_DEPENDENCIES) $(EXTRA_test_modem_helpers_linktop_DEPENDENCIES) + @rm -f test-modem-helpers-linktop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_modem_helpers_linktop_OBJECTS) $(test_modem_helpers_linktop_LDADD) $(LIBS) mbm/tests/$(am__dirstamp): @$(MKDIR_P) mbm/tests @: > mbm/tests/$(am__dirstamp) @@ -2335,6 +2904,19 @@ test-modem-helpers-mbm$(EXEEXT): $(test_modem_helpers_mbm_OBJECTS) $(test_modem_helpers_mbm_DEPENDENCIES) $(EXTRA_test_modem_helpers_mbm_DEPENDENCIES) @rm -f test-modem-helpers-mbm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_modem_helpers_mbm_OBJECTS) $(test_modem_helpers_mbm_LDADD) $(LIBS) +sierra/tests/$(am__dirstamp): + @$(MKDIR_P) sierra/tests + @: > sierra/tests/$(am__dirstamp) +sierra/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sierra/tests/$(DEPDIR) + @: > sierra/tests/$(DEPDIR)/$(am__dirstamp) +sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.$(OBJEXT): \ + sierra/tests/$(am__dirstamp) \ + sierra/tests/$(DEPDIR)/$(am__dirstamp) + +test-modem-helpers-sierra$(EXEEXT): $(test_modem_helpers_sierra_OBJECTS) $(test_modem_helpers_sierra_DEPENDENCIES) $(EXTRA_test_modem_helpers_sierra_DEPENDENCIES) + @rm -f test-modem-helpers-sierra$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_modem_helpers_sierra_OBJECTS) $(test_modem_helpers_sierra_LDADD) $(LIBS) telit/tests/$(am__dirstamp): @$(MKDIR_P) telit/tests @: > telit/tests/$(am__dirstamp) @@ -2361,6 +2943,31 @@ test-modem-helpers-thuraya$(EXEEXT): $(test_modem_helpers_thuraya_OBJECTS) $(test_modem_helpers_thuraya_DEPENDENCIES) $(EXTRA_test_modem_helpers_thuraya_DEPENDENCIES) @rm -f test-modem-helpers-thuraya$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_modem_helpers_thuraya_OBJECTS) $(test_modem_helpers_thuraya_LDADD) $(LIBS) +ublox/tests/$(am__dirstamp): + @$(MKDIR_P) ublox/tests + @: > ublox/tests/$(am__dirstamp) +ublox/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ublox/tests/$(DEPDIR) + @: > ublox/tests/$(DEPDIR)/$(am__dirstamp) +ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.$(OBJEXT): \ + ublox/tests/$(am__dirstamp) \ + ublox/tests/$(DEPDIR)/$(am__dirstamp) + +test-modem-helpers-ublox$(EXEEXT): $(test_modem_helpers_ublox_OBJECTS) $(test_modem_helpers_ublox_DEPENDENCIES) $(EXTRA_test_modem_helpers_ublox_DEPENDENCIES) + @rm -f test-modem-helpers-ublox$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_modem_helpers_ublox_OBJECTS) $(test_modem_helpers_ublox_LDADD) $(LIBS) +xmm/tests/$(am__dirstamp): + @$(MKDIR_P) xmm/tests + @: > xmm/tests/$(am__dirstamp) +xmm/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) xmm/tests/$(DEPDIR) + @: > xmm/tests/$(DEPDIR)/$(am__dirstamp) +xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.$(OBJEXT): \ + xmm/tests/$(am__dirstamp) xmm/tests/$(DEPDIR)/$(am__dirstamp) + +test-modem-helpers-xmm$(EXEEXT): $(test_modem_helpers_xmm_OBJECTS) $(test_modem_helpers_xmm_DEPENDENCIES) $(EXTRA_test_modem_helpers_xmm_DEPENDENCIES) + @rm -f test-modem-helpers-xmm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_modem_helpers_xmm_OBJECTS) $(test_modem_helpers_xmm_LDADD) $(LIBS) generic/tests/$(am__dirstamp): @$(MKDIR_P) generic/tests @: > generic/tests/$(am__dirstamp) @@ -2374,6 +2981,12 @@ test-service-generic$(EXEEXT): $(test_service_generic_OBJECTS) $(test_service_generic_DEPENDENCIES) $(EXTRA_test_service_generic_DEPENDENCIES) @rm -f test-service-generic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_service_generic_OBJECTS) $(test_service_generic_LDADD) $(LIBS) +tests/test-udev-rules.$(OBJEXT): tests/$(am__dirstamp) \ + tests/$(DEPDIR)/$(am__dirstamp) + +test-udev-rules$(EXEEXT): $(test_udev_rules_OBJECTS) $(test_udev_rules_DEPENDENCIES) $(EXTRA_test_udev_rules_DEPENDENCIES) + @rm -f test-udev-rules$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_udev_rules_OBJECTS) $(test_udev_rules_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -2387,6 +3000,8 @@ -rm -f cinterion/tests/*.$(OBJEXT) -rm -f dell/*.$(OBJEXT) -rm -f dell/*.lo + -rm -f fibocom/*.$(OBJEXT) + -rm -f fibocom/*.lo -rm -f generic/*.$(OBJEXT) -rm -f generic/*.lo -rm -f generic/tests/*.$(OBJEXT) @@ -2402,6 +3017,7 @@ -rm -f iridium/*.lo -rm -f linktop/*.$(OBJEXT) -rm -f linktop/*.lo + -rm -f linktop/tests/*.$(OBJEXT) -rm -f longcheer/*.$(OBJEXT) -rm -f longcheer/*.lo -rm -f mbm/*.$(OBJEXT) @@ -2419,10 +3035,13 @@ -rm -f option/*.lo -rm -f pantech/*.$(OBJEXT) -rm -f pantech/*.lo + -rm -f quectel/*.$(OBJEXT) + -rm -f quectel/*.lo -rm -f samsung/*.$(OBJEXT) -rm -f samsung/*.lo -rm -f sierra/*.$(OBJEXT) -rm -f sierra/*.lo + -rm -f sierra/tests/*.$(OBJEXT) -rm -f simtech/*.$(OBJEXT) -rm -f simtech/*.lo -rm -f telit/*.$(OBJEXT) @@ -2433,115 +3052,153 @@ -rm -f thuraya/*.$(OBJEXT) -rm -f thuraya/*.lo -rm -f thuraya/tests/*.$(OBJEXT) + -rm -f ublox/*.$(OBJEXT) + -rm -f ublox/*.lo + -rm -f ublox/tests/*.$(OBJEXT) -rm -f via/*.$(OBJEXT) -rm -f via/*.lo -rm -f wavecom/*.$(OBJEXT) -rm -f wavecom/*.lo -rm -f x22x/*.$(OBJEXT) -rm -f x22x/*.lo + -rm -f xmm/*.$(OBJEXT) + -rm -f xmm/*.lo + -rm -f xmm/tests/*.$(OBJEXT) -rm -f zte/*.$(OBJEXT) -rm -f zte/*.lo distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-bearer-altair-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/mm-modem-helpers-altair-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-broadband-modem-anydata.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-plugin-anydata.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-common-cinterion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-plugin-cinterion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/mm-modem-helpers-cinterion.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@cinterion/tests/$(DEPDIR)/test_modem_helpers_cinterion-test-modem-helpers-cinterion.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@dell/$(DEPDIR)/libmm_plugin_dell_la-mm-plugin-dell.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@haier/$(DEPDIR)/libmm_plugin_haier_la-mm-plugin-haier.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-bearer-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-modem-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-call-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-plugin-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-sim-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/mm-modem-helpers-huawei.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@huawei/tests/$(DEPDIR)/test_modem_helpers_huawei-test-modem-helpers-huawei.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-broadband-bearer-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-broadband-modem-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-modem-helpers-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@icera/tests/$(DEPDIR)/test_modem_helpers_icera-test-modem-helpers-icera.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-bearer-iridium.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-broadband-modem-iridium.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-plugin-iridium.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-sim-iridium.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-broadband-modem-linktop.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-plugin-linktop.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-broadband-modem-longcheer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-plugin-longcheer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-broadband-bearer-mbm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-broadband-modem-mbm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-modem-helpers-mbm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-sim-mbm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-broadband-modem-motorola.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-plugin-motorola.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-broadband-modem-mtk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-plugin-mtk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_icera_la-mm-plugin-nokia-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-broadband-modem-nokia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-plugin-nokia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-sim-nokia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-bearer-novatel-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/mm-broadband-modem-novatel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/mm-common-novatel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-bearer-hso.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-modem-hso.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_la-mm-plugin-option.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/mm-broadband-modem-option.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-broadband-modem-pantech.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-plugin-pantech.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-sim-pantech.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-broadband-modem-samsung.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_la-mm-plugin-sierra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-broadband-bearer-sierra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-broadband-modem-sierra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-common-sierra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-sim-sierra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-broadband-modem-simtech.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-plugin-simtech.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libmm_plugin_telit_la-mm-plugin-telit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/mm-broadband-modem-telit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/mm-common-telit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/mm-modem-helpers-telit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libmm_test_common_la-test-fixture.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libmm_test_common_la-test-port-context.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-plugin-thuraya.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/mm-modem-helpers-thuraya.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@thuraya/tests/$(DEPDIR)/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@via/$(DEPDIR)/libmm_plugin_via_la-mm-broadband-modem-via.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-broadband-modem-wavecom.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-plugin-wavecom.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-broadband-modem-x22x.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-plugin-x22x.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte-icera.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-common-zte.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-plugin-zte.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-bearer-altair-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@altair/$(DEPDIR)/mm-modem-helpers-altair-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-broadband-modem-anydata.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-plugin-anydata.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-plugin-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/$(DEPDIR)/mm-modem-helpers-cinterion.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cinterion/tests/$(DEPDIR)/test_modem_helpers_cinterion-test-modem-helpers-cinterion.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dell/$(DEPDIR)/libmm_plugin_dell_la-mm-plugin-dell.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@haier/$(DEPDIR)/libmm_plugin_haier_la-mm-plugin-haier.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-bearer-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-modem-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-call-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-plugin-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-sim-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/$(DEPDIR)/mm-modem-helpers-huawei.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@huawei/tests/$(DEPDIR)/test_modem_helpers_huawei-test-modem-helpers-huawei.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-broadband-bearer-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-broadband-modem-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@icera/$(DEPDIR)/mm-modem-helpers-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@icera/tests/$(DEPDIR)/test_modem_helpers_icera-test-modem-helpers-icera.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-bearer-iridium.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-broadband-modem-iridium.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-plugin-iridium.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-sim-iridium.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-broadband-modem-linktop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-plugin-linktop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@linktop/$(DEPDIR)/mm-modem-helpers-linktop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-broadband-modem-longcheer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-plugin-longcheer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-broadband-bearer-mbm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-broadband-modem-mbm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-modem-helpers-mbm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/$(DEPDIR)/mm-sim-mbm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-broadband-modem-motorola.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-plugin-motorola.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-broadband-modem-mtk.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-plugin-mtk.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_icera_la-mm-plugin-nokia-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-broadband-modem-nokia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-plugin-nokia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-sim-nokia.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-bearer-novatel-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/mm-broadband-modem-novatel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@novatel/$(DEPDIR)/mm-common-novatel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-bearer-hso.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-modem-hso.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/libmm_plugin_option_la-mm-plugin-option.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@option/$(DEPDIR)/mm-broadband-modem-option.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-broadband-modem-pantech.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-plugin-pantech.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-sim-pantech.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-broadband-modem-samsung.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_la-mm-plugin-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-broadband-bearer-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-broadband-modem-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-common-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-modem-helpers-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/$(DEPDIR)/mm-sim-sierra.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-broadband-modem-simtech.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-plugin-simtech.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libmm_plugin_telit_la-mm-plugin-telit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libmm_test_common_la-test-fixture.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libmm_test_common_la-test-port-context.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-udev-rules.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-plugin-thuraya.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@thuraya/$(DEPDIR)/mm-modem-helpers-thuraya.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@thuraya/tests/$(DEPDIR)/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@via/$(DEPDIR)/libmm_plugin_via_la-mm-broadband-modem-via.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-broadband-modem-wavecom.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-plugin-wavecom.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-broadband-modem-x22x.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-plugin-x22x.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@xmm/$(DEPDIR)/mm-broadband-modem-mbim-xmm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@xmm/$(DEPDIR)/mm-broadband-modem-xmm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@xmm/$(DEPDIR)/mm-modem-helpers-xmm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@xmm/$(DEPDIR)/mm-shared-xmm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte-icera.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-common-zte.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@zte/$(DEPDIR)/libmm_plugin_zte_la-mm-plugin-zte.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -2567,6 +3224,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +telit/libhelpers_telit_la-mm-modem-helpers-telit.lo: telit/mm-modem-helpers-telit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT telit/libhelpers_telit_la-mm-modem-helpers-telit.lo -MD -MP -MF telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Tpo -c -o telit/libhelpers_telit_la-mm-modem-helpers-telit.lo `test -f 'telit/mm-modem-helpers-telit.c' || echo '$(srcdir)/'`telit/mm-modem-helpers-telit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Tpo telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telit/mm-modem-helpers-telit.c' object='telit/libhelpers_telit_la-mm-modem-helpers-telit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o telit/libhelpers_telit_la-mm-modem-helpers-telit.lo `test -f 'telit/mm-modem-helpers-telit.c' || echo '$(srcdir)/'`telit/mm-modem-helpers-telit.c + +telit/libhelpers_telit_la-mm-telit-enums-types.lo: telit/mm-telit-enums-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT telit/libhelpers_telit_la-mm-telit-enums-types.lo -MD -MP -MF telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Tpo -c -o telit/libhelpers_telit_la-mm-telit-enums-types.lo `test -f 'telit/mm-telit-enums-types.c' || echo '$(srcdir)/'`telit/mm-telit-enums-types.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Tpo telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telit/mm-telit-enums-types.c' object='telit/libhelpers_telit_la-mm-telit-enums-types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o telit/libhelpers_telit_la-mm-telit-enums-types.lo `test -f 'telit/mm-telit-enums-types.c' || echo '$(srcdir)/'`telit/mm-telit-enums-types.c + +ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo: ublox/mm-modem-helpers-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Tpo -c -o ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo `test -f 'ublox/mm-modem-helpers-ublox.c' || echo '$(srcdir)/'`ublox/mm-modem-helpers-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Tpo ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-modem-helpers-ublox.c' object='ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libhelpers_ublox_la-mm-modem-helpers-ublox.lo `test -f 'ublox/mm-modem-helpers-ublox.c' || echo '$(srcdir)/'`ublox/mm-modem-helpers-ublox.c + +ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo: ublox/mm-ublox-enums-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo -MD -MP -MF ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Tpo -c -o ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo `test -f 'ublox/mm-ublox-enums-types.c' || echo '$(srcdir)/'`ublox/mm-ublox-enums-types.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Tpo ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-ublox-enums-types.c' object='ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhelpers_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libhelpers_ublox_la-mm-ublox-enums-types.lo `test -f 'ublox/mm-ublox-enums-types.c' || echo '$(srcdir)/'`ublox/mm-ublox-enums-types.c + altair/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.lo: altair/mm-plugin-altair-lte.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_altair_lte_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT altair/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.lo -MD -MP -MF altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Tpo -c -o altair/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.lo `test -f 'altair/mm-plugin-altair-lte.c' || echo '$(srcdir)/'`altair/mm-plugin-altair-lte.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Tpo altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo @@ -2609,12 +3294,12 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cinterion/libmm_plugin_cinterion_la-mm-plugin-cinterion.lo `test -f 'cinterion/mm-plugin-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-plugin-cinterion.c -cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo: cinterion/mm-common-cinterion.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo -MD -MP -MF cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-common-cinterion.Tpo -c -o cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo `test -f 'cinterion/mm-common-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-common-cinterion.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-common-cinterion.Tpo cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-common-cinterion.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cinterion/mm-common-cinterion.c' object='cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo' libtool=yes @AMDEPBACKSLASH@ +cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo: cinterion/mm-shared-cinterion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo -MD -MP -MF cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Tpo -c -o cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo `test -f 'cinterion/mm-shared-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-shared-cinterion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Tpo cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cinterion/mm-shared-cinterion.c' object='cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cinterion/libmm_plugin_cinterion_la-mm-common-cinterion.lo `test -f 'cinterion/mm-common-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-common-cinterion.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cinterion/libmm_plugin_cinterion_la-mm-shared-cinterion.lo `test -f 'cinterion/mm-shared-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-shared-cinterion.c cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo: cinterion/mm-broadband-modem-cinterion.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo -MD -MP -MF cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Tpo -c -o cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo `test -f 'cinterion/mm-broadband-modem-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-broadband-modem-cinterion.c @@ -2623,6 +3308,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.lo `test -f 'cinterion/mm-broadband-modem-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-broadband-modem-cinterion.c +cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo: cinterion/mm-broadband-bearer-cinterion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo -MD -MP -MF cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Tpo -c -o cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo `test -f 'cinterion/mm-broadband-bearer-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-broadband-bearer-cinterion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Tpo cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cinterion/mm-broadband-bearer-cinterion.c' object='cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cinterion/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.lo `test -f 'cinterion/mm-broadband-bearer-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-broadband-bearer-cinterion.c + cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo: cinterion/mm-broadband-modem-qmi-cinterion.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_cinterion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo -MD -MP -MF cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Tpo -c -o cinterion/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.lo `test -f 'cinterion/mm-broadband-modem-qmi-cinterion.c' || echo '$(srcdir)/'`cinterion/mm-broadband-modem-qmi-cinterion.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Tpo cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo @@ -2637,6 +3329,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_dell_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dell/libmm_plugin_dell_la-mm-plugin-dell.lo `test -f 'dell/mm-plugin-dell.c' || echo '$(srcdir)/'`dell/mm-plugin-dell.c +dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo: dell/mm-broadband-modem-dell-dw5821e.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_dell_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo -MD -MP -MF dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Tpo -c -o dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo `test -f 'dell/mm-broadband-modem-dell-dw5821e.c' || echo '$(srcdir)/'`dell/mm-broadband-modem-dell-dw5821e.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Tpo dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dell/mm-broadband-modem-dell-dw5821e.c' object='dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_dell_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dell/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.lo `test -f 'dell/mm-broadband-modem-dell-dw5821e.c' || echo '$(srcdir)/'`dell/mm-broadband-modem-dell-dw5821e.c + mbm/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.lo: mbm/mm-plugin-mbm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ericsson_mbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mbm/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.lo -MD -MP -MF mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Tpo -c -o mbm/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.lo `test -f 'mbm/mm-plugin-mbm.c' || echo '$(srcdir)/'`mbm/mm-plugin-mbm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Tpo mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo @@ -2644,6 +3343,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ericsson_mbm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbm/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.lo `test -f 'mbm/mm-plugin-mbm.c' || echo '$(srcdir)/'`mbm/mm-plugin-mbm.c +fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo: fibocom/mm-plugin-fibocom.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_fibocom_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo -MD -MP -MF fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Tpo -c -o fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo `test -f 'fibocom/mm-plugin-fibocom.c' || echo '$(srcdir)/'`fibocom/mm-plugin-fibocom.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Tpo fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fibocom/mm-plugin-fibocom.c' object='fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_fibocom_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fibocom/libmm_plugin_fibocom_la-mm-plugin-fibocom.lo `test -f 'fibocom/mm-plugin-fibocom.c' || echo '$(srcdir)/'`fibocom/mm-plugin-fibocom.c + generic/libmm_plugin_generic_la-mm-plugin-generic.lo: generic/mm-plugin-generic.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_generic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT generic/libmm_plugin_generic_la-mm-plugin-generic.lo -MD -MP -MF generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Tpo -c -o generic/libmm_plugin_generic_la-mm-plugin-generic.lo `test -f 'generic/mm-plugin-generic.c' || echo '$(srcdir)/'`generic/mm-plugin-generic.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Tpo generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo @@ -2805,13 +3511,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_nokia_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nokia/libmm_plugin_nokia_la-mm-broadband-modem-nokia.lo `test -f 'nokia/mm-broadband-modem-nokia.c' || echo '$(srcdir)/'`nokia/mm-broadband-modem-nokia.c -novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo: novatel/mm-plugin-novatel.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo -MD -MP -MF novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Tpo -c -o novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo `test -f 'novatel/mm-plugin-novatel.c' || echo '$(srcdir)/'`novatel/mm-plugin-novatel.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Tpo novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='novatel/mm-plugin-novatel.c' object='novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo `test -f 'novatel/mm-plugin-novatel.c' || echo '$(srcdir)/'`novatel/mm-plugin-novatel.c - novatel/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.lo: novatel/mm-plugin-novatel-lte.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_lte_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT novatel/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.lo -MD -MP -MF novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Tpo -c -o novatel/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.lo `test -f 'novatel/mm-plugin-novatel-lte.c' || echo '$(srcdir)/'`novatel/mm-plugin-novatel-lte.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Tpo novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo @@ -2840,6 +3539,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_lte_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o novatel/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.lo `test -f 'novatel/mm-sim-novatel-lte.c' || echo '$(srcdir)/'`novatel/mm-sim-novatel-lte.c +novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo: novatel/mm-plugin-novatel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo -MD -MP -MF novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Tpo -c -o novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo `test -f 'novatel/mm-plugin-novatel.c' || echo '$(srcdir)/'`novatel/mm-plugin-novatel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Tpo novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='novatel/mm-plugin-novatel.c' object='novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_novatel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o novatel/libmm_plugin_novatel_la-mm-plugin-novatel.lo `test -f 'novatel/mm-plugin-novatel.c' || echo '$(srcdir)/'`novatel/mm-plugin-novatel.c + option/libmm_plugin_option_hso_la-mm-plugin-hso.lo: option/mm-plugin-hso.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_option_hso_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT option/libmm_plugin_option_hso_la-mm-plugin-hso.lo -MD -MP -MF option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Tpo -c -o option/libmm_plugin_option_hso_la-mm-plugin-hso.lo `test -f 'option/mm-plugin-hso.c' || echo '$(srcdir)/'`option/mm-plugin-hso.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Tpo option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo @@ -2889,6 +3595,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_pantech_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pantech/libmm_plugin_pantech_la-mm-broadband-modem-pantech.lo `test -f 'pantech/mm-broadband-modem-pantech.c' || echo '$(srcdir)/'`pantech/mm-broadband-modem-pantech.c +quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo: quectel/mm-plugin-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo -MD -MP -MF quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Tpo -c -o quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo `test -f 'quectel/mm-plugin-quectel.c' || echo '$(srcdir)/'`quectel/mm-plugin-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Tpo quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quectel/mm-plugin-quectel.c' object='quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quectel/libmm_plugin_quectel_la-mm-plugin-quectel.lo `test -f 'quectel/mm-plugin-quectel.c' || echo '$(srcdir)/'`quectel/mm-plugin-quectel.c + +quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo: quectel/mm-shared-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo -MD -MP -MF quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Tpo -c -o quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo `test -f 'quectel/mm-shared-quectel.c' || echo '$(srcdir)/'`quectel/mm-shared-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Tpo quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quectel/mm-shared-quectel.c' object='quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quectel/libmm_plugin_quectel_la-mm-shared-quectel.lo `test -f 'quectel/mm-shared-quectel.c' || echo '$(srcdir)/'`quectel/mm-shared-quectel.c + +quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo: quectel/mm-broadband-modem-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo -MD -MP -MF quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Tpo -c -o quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo `test -f 'quectel/mm-broadband-modem-quectel.c' || echo '$(srcdir)/'`quectel/mm-broadband-modem-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Tpo quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quectel/mm-broadband-modem-quectel.c' object='quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quectel/libmm_plugin_quectel_la-mm-broadband-modem-quectel.lo `test -f 'quectel/mm-broadband-modem-quectel.c' || echo '$(srcdir)/'`quectel/mm-broadband-modem-quectel.c + +quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo: quectel/mm-broadband-modem-qmi-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo -MD -MP -MF quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Tpo -c -o quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo `test -f 'quectel/mm-broadband-modem-qmi-quectel.c' || echo '$(srcdir)/'`quectel/mm-broadband-modem-qmi-quectel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Tpo quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='quectel/mm-broadband-modem-qmi-quectel.c' object='quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_quectel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quectel/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.lo `test -f 'quectel/mm-broadband-modem-qmi-quectel.c' || echo '$(srcdir)/'`quectel/mm-broadband-modem-qmi-quectel.c + samsung/libmm_plugin_samsung_la-mm-plugin-samsung.lo: samsung/mm-plugin-samsung.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_samsung_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT samsung/libmm_plugin_samsung_la-mm-plugin-samsung.lo -MD -MP -MF samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Tpo -c -o samsung/libmm_plugin_samsung_la-mm-plugin-samsung.lo `test -f 'samsung/mm-plugin-samsung.c' || echo '$(srcdir)/'`samsung/mm-plugin-samsung.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Tpo samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo @@ -2959,6 +3693,41 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_thuraya_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thuraya/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.lo `test -f 'thuraya/mm-broadband-modem-thuraya.c' || echo '$(srcdir)/'`thuraya/mm-broadband-modem-thuraya.c +ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo: ublox/mm-plugin-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Tpo -c -o ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo `test -f 'ublox/mm-plugin-ublox.c' || echo '$(srcdir)/'`ublox/mm-plugin-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Tpo ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-plugin-ublox.c' object='ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libmm_plugin_ublox_la-mm-plugin-ublox.lo `test -f 'ublox/mm-plugin-ublox.c' || echo '$(srcdir)/'`ublox/mm-plugin-ublox.c + +ublox/libmm_plugin_ublox_la-mm-call-ublox.lo: ublox/mm-call-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libmm_plugin_ublox_la-mm-call-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Tpo -c -o ublox/libmm_plugin_ublox_la-mm-call-ublox.lo `test -f 'ublox/mm-call-ublox.c' || echo '$(srcdir)/'`ublox/mm-call-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Tpo ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-call-ublox.c' object='ublox/libmm_plugin_ublox_la-mm-call-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libmm_plugin_ublox_la-mm-call-ublox.lo `test -f 'ublox/mm-call-ublox.c' || echo '$(srcdir)/'`ublox/mm-call-ublox.c + +ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo: ublox/mm-broadband-bearer-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Tpo -c -o ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo `test -f 'ublox/mm-broadband-bearer-ublox.c' || echo '$(srcdir)/'`ublox/mm-broadband-bearer-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Tpo ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-broadband-bearer-ublox.c' object='ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.lo `test -f 'ublox/mm-broadband-bearer-ublox.c' || echo '$(srcdir)/'`ublox/mm-broadband-bearer-ublox.c + +ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo: ublox/mm-broadband-modem-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Tpo -c -o ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo `test -f 'ublox/mm-broadband-modem-ublox.c' || echo '$(srcdir)/'`ublox/mm-broadband-modem-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Tpo ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-broadband-modem-ublox.c' object='ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libmm_plugin_ublox_la-mm-broadband-modem-ublox.lo `test -f 'ublox/mm-broadband-modem-ublox.c' || echo '$(srcdir)/'`ublox/mm-broadband-modem-ublox.c + +ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo: ublox/mm-sim-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo -MD -MP -MF ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Tpo -c -o ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo `test -f 'ublox/mm-sim-ublox.c' || echo '$(srcdir)/'`ublox/mm-sim-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Tpo ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/mm-sim-ublox.c' object='ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_ublox_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/libmm_plugin_ublox_la-mm-sim-ublox.lo `test -f 'ublox/mm-sim-ublox.c' || echo '$(srcdir)/'`ublox/mm-sim-ublox.c + via/libmm_plugin_via_la-mm-plugin-via.lo: via/mm-plugin-via.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_plugin_via_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT via/libmm_plugin_via_la-mm-plugin-via.lo -MD -MP -MF via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Tpo -c -o via/libmm_plugin_via_la-mm-plugin-via.lo `test -f 'via/mm-plugin-via.c' || echo '$(srcdir)/'`via/mm-plugin-via.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Tpo via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo @@ -3043,6 +3812,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_test_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/libmm_test_common_la-test-port-context.lo `test -f 'tests/test-port-context.c' || echo '$(srcdir)/'`tests/test-port-context.c +telit/libmm_utils_telit_la-mm-common-telit.lo: telit/mm-common-telit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_utils_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT telit/libmm_utils_telit_la-mm-common-telit.lo -MD -MP -MF telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Tpo -c -o telit/libmm_utils_telit_la-mm-common-telit.lo `test -f 'telit/mm-common-telit.c' || echo '$(srcdir)/'`telit/mm-common-telit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Tpo telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telit/mm-common-telit.c' object='telit/libmm_utils_telit_la-mm-common-telit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_utils_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o telit/libmm_utils_telit_la-mm-common-telit.lo `test -f 'telit/mm-common-telit.c' || echo '$(srcdir)/'`telit/mm-common-telit.c + +telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo: telit/mm-broadband-modem-telit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_utils_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo -MD -MP -MF telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Tpo -c -o telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo `test -f 'telit/mm-broadband-modem-telit.c' || echo '$(srcdir)/'`telit/mm-broadband-modem-telit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Tpo telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telit/mm-broadband-modem-telit.c' object='telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmm_utils_telit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o telit/libmm_utils_telit_la-mm-broadband-modem-telit.lo `test -f 'telit/mm-broadband-modem-telit.c' || echo '$(srcdir)/'`telit/mm-broadband-modem-telit.c + altair/tests/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.o: altair/tests/test-modem-helpers-altair-lte.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_altair_lte_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT altair/tests/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.o -MD -MP -MF altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Tpo -c -o altair/tests/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.o `test -f 'altair/tests/test-modem-helpers-altair-lte.c' || echo '$(srcdir)/'`altair/tests/test-modem-helpers-altair-lte.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Tpo altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po @@ -3099,6 +3882,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_icera_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o icera/tests/test_modem_helpers_icera-test-modem-helpers-icera.obj `if test -f 'icera/tests/test-modem-helpers-icera.c'; then $(CYGPATH_W) 'icera/tests/test-modem-helpers-icera.c'; else $(CYGPATH_W) '$(srcdir)/icera/tests/test-modem-helpers-icera.c'; fi` +linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.o: linktop/tests/test-modem-helpers-linktop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_linktop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.o -MD -MP -MF linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Tpo -c -o linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.o `test -f 'linktop/tests/test-modem-helpers-linktop.c' || echo '$(srcdir)/'`linktop/tests/test-modem-helpers-linktop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Tpo linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linktop/tests/test-modem-helpers-linktop.c' object='linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_linktop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.o `test -f 'linktop/tests/test-modem-helpers-linktop.c' || echo '$(srcdir)/'`linktop/tests/test-modem-helpers-linktop.c + +linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.obj: linktop/tests/test-modem-helpers-linktop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_linktop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.obj -MD -MP -MF linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Tpo -c -o linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.obj `if test -f 'linktop/tests/test-modem-helpers-linktop.c'; then $(CYGPATH_W) 'linktop/tests/test-modem-helpers-linktop.c'; else $(CYGPATH_W) '$(srcdir)/linktop/tests/test-modem-helpers-linktop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Tpo linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linktop/tests/test-modem-helpers-linktop.c' object='linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_linktop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linktop/tests/test_modem_helpers_linktop-test-modem-helpers-linktop.obj `if test -f 'linktop/tests/test-modem-helpers-linktop.c'; then $(CYGPATH_W) 'linktop/tests/test-modem-helpers-linktop.c'; else $(CYGPATH_W) '$(srcdir)/linktop/tests/test-modem-helpers-linktop.c'; fi` + mbm/tests/test_modem_helpers_mbm-test-modem-helpers-mbm.o: mbm/tests/test-modem-helpers-mbm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_mbm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mbm/tests/test_modem_helpers_mbm-test-modem-helpers-mbm.o -MD -MP -MF mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Tpo -c -o mbm/tests/test_modem_helpers_mbm-test-modem-helpers-mbm.o `test -f 'mbm/tests/test-modem-helpers-mbm.c' || echo '$(srcdir)/'`mbm/tests/test-modem-helpers-mbm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Tpo mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po @@ -3113,6 +3910,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_mbm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbm/tests/test_modem_helpers_mbm-test-modem-helpers-mbm.obj `if test -f 'mbm/tests/test-modem-helpers-mbm.c'; then $(CYGPATH_W) 'mbm/tests/test-modem-helpers-mbm.c'; else $(CYGPATH_W) '$(srcdir)/mbm/tests/test-modem-helpers-mbm.c'; fi` +sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.o: sierra/tests/test-modem-helpers-sierra.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_sierra_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.o -MD -MP -MF sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Tpo -c -o sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.o `test -f 'sierra/tests/test-modem-helpers-sierra.c' || echo '$(srcdir)/'`sierra/tests/test-modem-helpers-sierra.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Tpo sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sierra/tests/test-modem-helpers-sierra.c' object='sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_sierra_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.o `test -f 'sierra/tests/test-modem-helpers-sierra.c' || echo '$(srcdir)/'`sierra/tests/test-modem-helpers-sierra.c + +sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.obj: sierra/tests/test-modem-helpers-sierra.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_sierra_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.obj -MD -MP -MF sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Tpo -c -o sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.obj `if test -f 'sierra/tests/test-modem-helpers-sierra.c'; then $(CYGPATH_W) 'sierra/tests/test-modem-helpers-sierra.c'; else $(CYGPATH_W) '$(srcdir)/sierra/tests/test-modem-helpers-sierra.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Tpo sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sierra/tests/test-modem-helpers-sierra.c' object='sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_sierra_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sierra/tests/test_modem_helpers_sierra-test-modem-helpers-sierra.obj `if test -f 'sierra/tests/test-modem-helpers-sierra.c'; then $(CYGPATH_W) 'sierra/tests/test-modem-helpers-sierra.c'; else $(CYGPATH_W) '$(srcdir)/sierra/tests/test-modem-helpers-sierra.c'; fi` + telit/tests/test_modem_helpers_telit-test-mm-modem-helpers-telit.o: telit/tests/test-mm-modem-helpers-telit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_telit_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT telit/tests/test_modem_helpers_telit-test-mm-modem-helpers-telit.o -MD -MP -MF telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Tpo -c -o telit/tests/test_modem_helpers_telit-test-mm-modem-helpers-telit.o `test -f 'telit/tests/test-mm-modem-helpers-telit.c' || echo '$(srcdir)/'`telit/tests/test-mm-modem-helpers-telit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Tpo telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po @@ -3141,6 +3952,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_thuraya_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thuraya/tests/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.obj `if test -f 'thuraya/tests/test-mm-modem-helpers-thuraya.c'; then $(CYGPATH_W) 'thuraya/tests/test-mm-modem-helpers-thuraya.c'; else $(CYGPATH_W) '$(srcdir)/thuraya/tests/test-mm-modem-helpers-thuraya.c'; fi` +ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.o: ublox/tests/test-modem-helpers-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_ublox_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.o -MD -MP -MF ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Tpo -c -o ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.o `test -f 'ublox/tests/test-modem-helpers-ublox.c' || echo '$(srcdir)/'`ublox/tests/test-modem-helpers-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Tpo ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/tests/test-modem-helpers-ublox.c' object='ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_ublox_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.o `test -f 'ublox/tests/test-modem-helpers-ublox.c' || echo '$(srcdir)/'`ublox/tests/test-modem-helpers-ublox.c + +ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.obj: ublox/tests/test-modem-helpers-ublox.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_ublox_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.obj -MD -MP -MF ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Tpo -c -o ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.obj `if test -f 'ublox/tests/test-modem-helpers-ublox.c'; then $(CYGPATH_W) 'ublox/tests/test-modem-helpers-ublox.c'; else $(CYGPATH_W) '$(srcdir)/ublox/tests/test-modem-helpers-ublox.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Tpo ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ublox/tests/test-modem-helpers-ublox.c' object='ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_ublox_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ublox/tests/test_modem_helpers_ublox-test-modem-helpers-ublox.obj `if test -f 'ublox/tests/test-modem-helpers-ublox.c'; then $(CYGPATH_W) 'ublox/tests/test-modem-helpers-ublox.c'; else $(CYGPATH_W) '$(srcdir)/ublox/tests/test-modem-helpers-ublox.c'; fi` + +xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.o: xmm/tests/test-modem-helpers-xmm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_xmm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.o -MD -MP -MF xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Tpo -c -o xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.o `test -f 'xmm/tests/test-modem-helpers-xmm.c' || echo '$(srcdir)/'`xmm/tests/test-modem-helpers-xmm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Tpo xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmm/tests/test-modem-helpers-xmm.c' object='xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_xmm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.o `test -f 'xmm/tests/test-modem-helpers-xmm.c' || echo '$(srcdir)/'`xmm/tests/test-modem-helpers-xmm.c + +xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.obj: xmm/tests/test-modem-helpers-xmm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_xmm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.obj -MD -MP -MF xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Tpo -c -o xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.obj `if test -f 'xmm/tests/test-modem-helpers-xmm.c'; then $(CYGPATH_W) 'xmm/tests/test-modem-helpers-xmm.c'; else $(CYGPATH_W) '$(srcdir)/xmm/tests/test-modem-helpers-xmm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Tpo xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmm/tests/test-modem-helpers-xmm.c' object='xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_modem_helpers_xmm_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmm/tests/test_modem_helpers_xmm-test-modem-helpers-xmm.obj `if test -f 'xmm/tests/test-modem-helpers-xmm.c'; then $(CYGPATH_W) 'xmm/tests/test-modem-helpers-xmm.c'; else $(CYGPATH_W) '$(srcdir)/xmm/tests/test-modem-helpers-xmm.c'; fi` + generic/tests/test_service_generic-test-service-generic.o: generic/tests/test-service-generic.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_generic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT generic/tests/test_service_generic-test-service-generic.o -MD -MP -MF generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Tpo -c -o generic/tests/test_service_generic-test-service-generic.o `test -f 'generic/tests/test-service-generic.c' || echo '$(srcdir)/'`generic/tests/test-service-generic.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Tpo generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po @@ -3164,6 +4003,7 @@ -rm -rf anydata/.libs anydata/_libs -rm -rf cinterion/.libs cinterion/_libs -rm -rf dell/.libs dell/_libs + -rm -rf fibocom/.libs fibocom/_libs -rm -rf generic/.libs generic/_libs -rm -rf haier/.libs haier/_libs -rm -rf huawei/.libs huawei/_libs @@ -3178,15 +4018,18 @@ -rm -rf novatel/.libs novatel/_libs -rm -rf option/.libs option/_libs -rm -rf pantech/.libs pantech/_libs + -rm -rf quectel/.libs quectel/_libs -rm -rf samsung/.libs samsung/_libs -rm -rf sierra/.libs sierra/_libs -rm -rf simtech/.libs simtech/_libs -rm -rf telit/.libs telit/_libs -rm -rf tests/.libs tests/_libs -rm -rf thuraya/.libs thuraya/_libs + -rm -rf ublox/.libs ublox/_libs -rm -rf via/.libs via/_libs -rm -rf wavecom/.libs wavecom/_libs -rm -rf x22x/.libs x22x/_libs + -rm -rf xmm/.libs xmm/_libs -rm -rf zte/.libs zte/_libs install-dist_udevrulesDATA: $(dist_udevrules_DATA) @$(NORMAL_INSTALL) @@ -3262,7 +4105,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -3294,13 +4140,15 @@ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local -check: check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(udevrulesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -3322,6 +4170,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -3338,6 +4187,8 @@ -rm -f cinterion/tests/$(am__dirstamp) -rm -f dell/$(DEPDIR)/$(am__dirstamp) -rm -f dell/$(am__dirstamp) + -rm -f fibocom/$(DEPDIR)/$(am__dirstamp) + -rm -f fibocom/$(am__dirstamp) -rm -f generic/$(DEPDIR)/$(am__dirstamp) -rm -f generic/$(am__dirstamp) -rm -f generic/tests/$(DEPDIR)/$(am__dirstamp) @@ -3356,6 +4207,8 @@ -rm -f iridium/$(am__dirstamp) -rm -f linktop/$(DEPDIR)/$(am__dirstamp) -rm -f linktop/$(am__dirstamp) + -rm -f linktop/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f linktop/tests/$(am__dirstamp) -rm -f longcheer/$(DEPDIR)/$(am__dirstamp) -rm -f longcheer/$(am__dirstamp) -rm -f mbm/$(DEPDIR)/$(am__dirstamp) @@ -3374,10 +4227,14 @@ -rm -f option/$(am__dirstamp) -rm -f pantech/$(DEPDIR)/$(am__dirstamp) -rm -f pantech/$(am__dirstamp) + -rm -f quectel/$(DEPDIR)/$(am__dirstamp) + -rm -f quectel/$(am__dirstamp) -rm -f samsung/$(DEPDIR)/$(am__dirstamp) -rm -f samsung/$(am__dirstamp) -rm -f sierra/$(DEPDIR)/$(am__dirstamp) -rm -f sierra/$(am__dirstamp) + -rm -f sierra/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f sierra/tests/$(am__dirstamp) -rm -f simtech/$(DEPDIR)/$(am__dirstamp) -rm -f simtech/$(am__dirstamp) -rm -f telit/$(DEPDIR)/$(am__dirstamp) @@ -3390,25 +4247,156 @@ -rm -f thuraya/$(am__dirstamp) -rm -f thuraya/tests/$(DEPDIR)/$(am__dirstamp) -rm -f thuraya/tests/$(am__dirstamp) + -rm -f ublox/$(DEPDIR)/$(am__dirstamp) + -rm -f ublox/$(am__dirstamp) + -rm -f ublox/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f ublox/tests/$(am__dirstamp) -rm -f via/$(DEPDIR)/$(am__dirstamp) -rm -f via/$(am__dirstamp) -rm -f wavecom/$(DEPDIR)/$(am__dirstamp) -rm -f wavecom/$(am__dirstamp) -rm -f x22x/$(DEPDIR)/$(am__dirstamp) -rm -f x22x/$(am__dirstamp) + -rm -f xmm/$(DEPDIR)/$(am__dirstamp) + -rm -f xmm/$(am__dirstamp) + -rm -f xmm/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f xmm/tests/$(am__dirstamp) -rm -f zte/$(DEPDIR)/$(am__dirstamp) -rm -f zte/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am - -rm -rf altair/$(DEPDIR) altair/tests/$(DEPDIR) anydata/$(DEPDIR) cinterion/$(DEPDIR) cinterion/tests/$(DEPDIR) dell/$(DEPDIR) generic/$(DEPDIR) generic/tests/$(DEPDIR) haier/$(DEPDIR) huawei/$(DEPDIR) huawei/tests/$(DEPDIR) icera/$(DEPDIR) icera/tests/$(DEPDIR) iridium/$(DEPDIR) linktop/$(DEPDIR) longcheer/$(DEPDIR) mbm/$(DEPDIR) mbm/tests/$(DEPDIR) motorola/$(DEPDIR) mtk/$(DEPDIR) nokia/$(DEPDIR) novatel/$(DEPDIR) option/$(DEPDIR) pantech/$(DEPDIR) samsung/$(DEPDIR) sierra/$(DEPDIR) simtech/$(DEPDIR) telit/$(DEPDIR) telit/tests/$(DEPDIR) tests/$(DEPDIR) thuraya/$(DEPDIR) thuraya/tests/$(DEPDIR) via/$(DEPDIR) wavecom/$(DEPDIR) x22x/$(DEPDIR) zte/$(DEPDIR) + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-bearer-altair-lte.Plo + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.Plo + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo + -rm -f altair/$(DEPDIR)/mm-modem-helpers-altair-lte.Plo + -rm -f altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po + -rm -f anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-broadband-modem-anydata.Plo + -rm -f anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-plugin-anydata.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-plugin-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/mm-modem-helpers-cinterion.Plo + -rm -f cinterion/tests/$(DEPDIR)/test_modem_helpers_cinterion-test-modem-helpers-cinterion.Po + -rm -f dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Plo + -rm -f dell/$(DEPDIR)/libmm_plugin_dell_la-mm-plugin-dell.Plo + -rm -f fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Plo + -rm -f generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo + -rm -f generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po + -rm -f haier/$(DEPDIR)/libmm_plugin_haier_la-mm-plugin-haier.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-bearer-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-modem-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-call-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-plugin-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-sim-huawei.Plo + -rm -f huawei/$(DEPDIR)/mm-modem-helpers-huawei.Plo + -rm -f huawei/tests/$(DEPDIR)/test_modem_helpers_huawei-test-modem-helpers-huawei.Po + -rm -f icera/$(DEPDIR)/mm-broadband-bearer-icera.Plo + -rm -f icera/$(DEPDIR)/mm-broadband-modem-icera.Plo + -rm -f icera/$(DEPDIR)/mm-modem-helpers-icera.Plo + -rm -f icera/tests/$(DEPDIR)/test_modem_helpers_icera-test-modem-helpers-icera.Po + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-bearer-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-broadband-modem-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-plugin-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-sim-iridium.Plo + -rm -f linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-broadband-modem-linktop.Plo + -rm -f linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-plugin-linktop.Plo + -rm -f linktop/$(DEPDIR)/mm-modem-helpers-linktop.Plo + -rm -f linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po + -rm -f longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-broadband-modem-longcheer.Plo + -rm -f longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-plugin-longcheer.Plo + -rm -f mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-broadband-bearer-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-broadband-modem-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-modem-helpers-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-sim-mbm.Plo + -rm -f mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po + -rm -f motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-broadband-modem-motorola.Plo + -rm -f motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-plugin-motorola.Plo + -rm -f mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-broadband-modem-mtk.Plo + -rm -f mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-plugin-mtk.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_icera_la-mm-plugin-nokia-icera.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-broadband-modem-nokia.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-plugin-nokia.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-sim-nokia.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-bearer-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/mm-broadband-modem-novatel.Plo + -rm -f novatel/$(DEPDIR)/mm-common-novatel.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-bearer-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-modem-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_la-mm-plugin-option.Plo + -rm -f option/$(DEPDIR)/mm-broadband-modem-option.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-broadband-modem-pantech.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-plugin-pantech.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-sim-pantech.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Plo + -rm -f samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-broadband-modem-samsung.Plo + -rm -f samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_la-mm-plugin-sierra.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.Plo + -rm -f sierra/$(DEPDIR)/mm-broadband-bearer-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-broadband-modem-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-common-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-modem-helpers-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-sim-sierra.Plo + -rm -f sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po + -rm -f simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-broadband-modem-simtech.Plo + -rm -f simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-plugin-simtech.Plo + -rm -f telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Plo + -rm -f telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Plo + -rm -f telit/$(DEPDIR)/libmm_plugin_telit_la-mm-plugin-telit.Plo + -rm -f telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Plo + -rm -f telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Plo + -rm -f telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po + -rm -f tests/$(DEPDIR)/libmm_test_common_la-test-fixture.Plo + -rm -f tests/$(DEPDIR)/libmm_test_common_la-test-port-context.Plo + -rm -f tests/$(DEPDIR)/test-udev-rules.Po + -rm -f thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.Plo + -rm -f thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-plugin-thuraya.Plo + -rm -f thuraya/$(DEPDIR)/mm-modem-helpers-thuraya.Plo + -rm -f thuraya/tests/$(DEPDIR)/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.Po + -rm -f ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Plo + -rm -f ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Plo + -rm -f ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po + -rm -f via/$(DEPDIR)/libmm_plugin_via_la-mm-broadband-modem-via.Plo + -rm -f via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo + -rm -f wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-broadband-modem-wavecom.Plo + -rm -f wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-plugin-wavecom.Plo + -rm -f x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-broadband-modem-x22x.Plo + -rm -f x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-plugin-x22x.Plo + -rm -f xmm/$(DEPDIR)/mm-broadband-modem-mbim-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-broadband-modem-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-modem-helpers-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-shared-xmm.Plo + -rm -f xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte-icera.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-common-zte.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-plugin-zte.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -3454,7 +4442,129 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf altair/$(DEPDIR) altair/tests/$(DEPDIR) anydata/$(DEPDIR) cinterion/$(DEPDIR) cinterion/tests/$(DEPDIR) dell/$(DEPDIR) generic/$(DEPDIR) generic/tests/$(DEPDIR) haier/$(DEPDIR) huawei/$(DEPDIR) huawei/tests/$(DEPDIR) icera/$(DEPDIR) icera/tests/$(DEPDIR) iridium/$(DEPDIR) linktop/$(DEPDIR) longcheer/$(DEPDIR) mbm/$(DEPDIR) mbm/tests/$(DEPDIR) motorola/$(DEPDIR) mtk/$(DEPDIR) nokia/$(DEPDIR) novatel/$(DEPDIR) option/$(DEPDIR) pantech/$(DEPDIR) samsung/$(DEPDIR) sierra/$(DEPDIR) simtech/$(DEPDIR) telit/$(DEPDIR) telit/tests/$(DEPDIR) tests/$(DEPDIR) thuraya/$(DEPDIR) thuraya/tests/$(DEPDIR) via/$(DEPDIR) wavecom/$(DEPDIR) x22x/$(DEPDIR) zte/$(DEPDIR) + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-bearer-altair-lte.Plo + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-broadband-modem-altair-lte.Plo + -rm -f altair/$(DEPDIR)/libmm_plugin_altair_lte_la-mm-plugin-altair-lte.Plo + -rm -f altair/$(DEPDIR)/mm-modem-helpers-altair-lte.Plo + -rm -f altair/tests/$(DEPDIR)/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.Po + -rm -f anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-broadband-modem-anydata.Plo + -rm -f anydata/$(DEPDIR)/libmm_plugin_anydata_la-mm-plugin-anydata.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-bearer-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-broadband-modem-qmi-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-plugin-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/libmm_plugin_cinterion_la-mm-shared-cinterion.Plo + -rm -f cinterion/$(DEPDIR)/mm-modem-helpers-cinterion.Plo + -rm -f cinterion/tests/$(DEPDIR)/test_modem_helpers_cinterion-test-modem-helpers-cinterion.Po + -rm -f dell/$(DEPDIR)/libmm_plugin_dell_la-mm-broadband-modem-dell-dw5821e.Plo + -rm -f dell/$(DEPDIR)/libmm_plugin_dell_la-mm-plugin-dell.Plo + -rm -f fibocom/$(DEPDIR)/libmm_plugin_fibocom_la-mm-plugin-fibocom.Plo + -rm -f generic/$(DEPDIR)/libmm_plugin_generic_la-mm-plugin-generic.Plo + -rm -f generic/tests/$(DEPDIR)/test_service_generic-test-service-generic.Po + -rm -f haier/$(DEPDIR)/libmm_plugin_haier_la-mm-plugin-haier.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-bearer-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-broadband-modem-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-call-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-plugin-huawei.Plo + -rm -f huawei/$(DEPDIR)/libmm_plugin_huawei_la-mm-sim-huawei.Plo + -rm -f huawei/$(DEPDIR)/mm-modem-helpers-huawei.Plo + -rm -f huawei/tests/$(DEPDIR)/test_modem_helpers_huawei-test-modem-helpers-huawei.Po + -rm -f icera/$(DEPDIR)/mm-broadband-bearer-icera.Plo + -rm -f icera/$(DEPDIR)/mm-broadband-modem-icera.Plo + -rm -f icera/$(DEPDIR)/mm-modem-helpers-icera.Plo + -rm -f icera/tests/$(DEPDIR)/test_modem_helpers_icera-test-modem-helpers-icera.Po + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-bearer-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-broadband-modem-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-plugin-iridium.Plo + -rm -f iridium/$(DEPDIR)/libmm_plugin_iridium_la-mm-sim-iridium.Plo + -rm -f linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-broadband-modem-linktop.Plo + -rm -f linktop/$(DEPDIR)/libmm_plugin_linktop_la-mm-plugin-linktop.Plo + -rm -f linktop/$(DEPDIR)/mm-modem-helpers-linktop.Plo + -rm -f linktop/tests/$(DEPDIR)/test_modem_helpers_linktop-test-modem-helpers-linktop.Po + -rm -f longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-broadband-modem-longcheer.Plo + -rm -f longcheer/$(DEPDIR)/libmm_plugin_longcheer_la-mm-plugin-longcheer.Plo + -rm -f mbm/$(DEPDIR)/libmm_plugin_ericsson_mbm_la-mm-plugin-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-broadband-bearer-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-broadband-modem-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-modem-helpers-mbm.Plo + -rm -f mbm/$(DEPDIR)/mm-sim-mbm.Plo + -rm -f mbm/tests/$(DEPDIR)/test_modem_helpers_mbm-test-modem-helpers-mbm.Po + -rm -f motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-broadband-modem-motorola.Plo + -rm -f motorola/$(DEPDIR)/libmm_plugin_motorola_la-mm-plugin-motorola.Plo + -rm -f mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-broadband-modem-mtk.Plo + -rm -f mtk/$(DEPDIR)/libmm_plugin_mtk_la-mm-plugin-mtk.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_icera_la-mm-plugin-nokia-icera.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-broadband-modem-nokia.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-plugin-nokia.Plo + -rm -f nokia/$(DEPDIR)/libmm_plugin_nokia_la-mm-sim-nokia.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_la-mm-plugin-novatel.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-bearer-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-broadband-modem-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-plugin-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/libmm_plugin_novatel_lte_la-mm-sim-novatel-lte.Plo + -rm -f novatel/$(DEPDIR)/mm-broadband-modem-novatel.Plo + -rm -f novatel/$(DEPDIR)/mm-common-novatel.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-bearer-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-broadband-modem-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_hso_la-mm-plugin-hso.Plo + -rm -f option/$(DEPDIR)/libmm_plugin_option_la-mm-plugin-option.Plo + -rm -f option/$(DEPDIR)/mm-broadband-modem-option.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-broadband-modem-pantech.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-plugin-pantech.Plo + -rm -f pantech/$(DEPDIR)/libmm_plugin_pantech_la-mm-sim-pantech.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-qmi-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-broadband-modem-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-plugin-quectel.Plo + -rm -f quectel/$(DEPDIR)/libmm_plugin_quectel_la-mm-shared-quectel.Plo + -rm -f samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-broadband-modem-samsung.Plo + -rm -f samsung/$(DEPDIR)/libmm_plugin_samsung_la-mm-plugin-samsung.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_la-mm-plugin-sierra.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-broadband-modem-sierra-icera.Plo + -rm -f sierra/$(DEPDIR)/libmm_plugin_sierra_legacy_la-mm-plugin-sierra-legacy.Plo + -rm -f sierra/$(DEPDIR)/mm-broadband-bearer-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-broadband-modem-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-common-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-modem-helpers-sierra.Plo + -rm -f sierra/$(DEPDIR)/mm-sim-sierra.Plo + -rm -f sierra/tests/$(DEPDIR)/test_modem_helpers_sierra-test-modem-helpers-sierra.Po + -rm -f simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-broadband-modem-simtech.Plo + -rm -f simtech/$(DEPDIR)/libmm_plugin_simtech_la-mm-plugin-simtech.Plo + -rm -f telit/$(DEPDIR)/libhelpers_telit_la-mm-modem-helpers-telit.Plo + -rm -f telit/$(DEPDIR)/libhelpers_telit_la-mm-telit-enums-types.Plo + -rm -f telit/$(DEPDIR)/libmm_plugin_telit_la-mm-plugin-telit.Plo + -rm -f telit/$(DEPDIR)/libmm_utils_telit_la-mm-broadband-modem-telit.Plo + -rm -f telit/$(DEPDIR)/libmm_utils_telit_la-mm-common-telit.Plo + -rm -f telit/tests/$(DEPDIR)/test_modem_helpers_telit-test-mm-modem-helpers-telit.Po + -rm -f tests/$(DEPDIR)/libmm_test_common_la-test-fixture.Plo + -rm -f tests/$(DEPDIR)/libmm_test_common_la-test-port-context.Plo + -rm -f tests/$(DEPDIR)/test-udev-rules.Po + -rm -f thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-broadband-modem-thuraya.Plo + -rm -f thuraya/$(DEPDIR)/libmm_plugin_thuraya_la-mm-plugin-thuraya.Plo + -rm -f thuraya/$(DEPDIR)/mm-modem-helpers-thuraya.Plo + -rm -f thuraya/tests/$(DEPDIR)/test_modem_helpers_thuraya-test-mm-modem-helpers-thuraya.Po + -rm -f ublox/$(DEPDIR)/libhelpers_ublox_la-mm-modem-helpers-ublox.Plo + -rm -f ublox/$(DEPDIR)/libhelpers_ublox_la-mm-ublox-enums-types.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-bearer-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-broadband-modem-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-call-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-plugin-ublox.Plo + -rm -f ublox/$(DEPDIR)/libmm_plugin_ublox_la-mm-sim-ublox.Plo + -rm -f ublox/tests/$(DEPDIR)/test_modem_helpers_ublox-test-modem-helpers-ublox.Po + -rm -f via/$(DEPDIR)/libmm_plugin_via_la-mm-broadband-modem-via.Plo + -rm -f via/$(DEPDIR)/libmm_plugin_via_la-mm-plugin-via.Plo + -rm -f wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-broadband-modem-wavecom.Plo + -rm -f wavecom/$(DEPDIR)/libmm_plugin_wavecom_la-mm-plugin-wavecom.Plo + -rm -f x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-broadband-modem-x22x.Plo + -rm -f x22x/$(DEPDIR)/libmm_plugin_x22x_la-mm-plugin-x22x.Plo + -rm -f xmm/$(DEPDIR)/mm-broadband-modem-mbim-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-broadband-modem-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-modem-helpers-xmm.Plo + -rm -f xmm/$(DEPDIR)/mm-shared-xmm.Plo + -rm -f xmm/tests/$(DEPDIR)/test_modem_helpers_xmm-test-modem-helpers-xmm.Po + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte-icera.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-broadband-modem-zte.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-common-zte.Plo + -rm -f zte/$(DEPDIR)/libmm_plugin_zte_la-mm-plugin-zte.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -3473,24 +4583,25 @@ uninstall-am: uninstall-dist_udevrulesDATA uninstall-pkglibLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: all check check-am install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS clean-pkglibLTLIBRARIES cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_udevrulesDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ - uninstall-dist_udevrulesDATA uninstall-pkglibLTLIBRARIES +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_udevrulesDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkglibLTLIBRARIES install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-dist_udevrulesDATA \ + uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile @@ -3559,6 +4670,40 @@ # run tests in cwd as part of make check check-local: test-nonrecursive +telit/mm-telit-enums-types.h: Makefile.am $(TELIT_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) \ + $(MKDIR_P) telit; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-modem-helpers-telit.h\"\n#ifndef __MM_TELIT_ENUMS_TYPES_H__\n#define __MM_TELIT_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_TELIT_ENUMS_TYPES_H__ */\n" \ + $(TELIT_ENUMS_INPUTS) > $@ + +telit/mm-telit-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c telit/mm-telit-enums-types.h + $(AM_V_GEN) \ + $(MKDIR_P) telit; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-telit-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(TELIT_ENUMS_INPUTS) > $@ + +ublox/mm-ublox-enums-types.h: Makefile.am $(UBLOX_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) \ + $(MKDIR_P) ublox; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-modem-helpers-ublox.h\"\n#ifndef __MM_UBLOX_ENUMS_TYPES_H__\n#define __MM_UBLOX_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_UBLOX_ENUMS_TYPES_H__ */\n" \ + $(UBLOX_ENUMS_INPUTS) > $@ + +ublox/mm-ublox-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c ublox/mm-ublox-enums-types.h + $(AM_V_GEN) \ + $(MKDIR_P) ublox; \ + $(GLIB_MKENUMS) \ + --fhead "#include \"mm-ublox-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(UBLOX_ENUMS_INPUTS) > $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru modemmanager-1.6.8/plugins/mbm/77-mm-ericsson-mbm.rules modemmanager-1.10.0/plugins/mbm/77-mm-ericsson-mbm.rules --- modemmanager-1.6.8/plugins/mbm/77-mm-ericsson-mbm.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/77-mm-ericsson-mbm.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,24 +1,28 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_mbm_end" -SUBSYSTEMS=="usb", GOTO="mm_mbm_check" +ACTION!="add|change|move|bind", GOTO="mm_mbm_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bdb", GOTO="mm_mbm_ericsson_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fce", GOTO="mm_mbm_sony_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", GOTO="mm_mbm_dell_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", GOTO="mm_mbm_hp_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0930", GOTO="mm_mbm_toshiba_vendorcheck" GOTO="mm_mbm_end" -LABEL="mm_mbm_check" +LABEL="mm_mbm_ericsson_vendorcheck" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # Ericsson F3507g -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1900", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1900", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1900", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1902", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1902", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1902", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson F3607gw -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1904", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1904", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1904", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1905", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1905", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1905", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1906", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1906", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1906", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson F3307 @@ -35,9 +39,9 @@ ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="190b", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson F5521gw -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="190d", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="190d", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="190d", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1911", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1911", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1911", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson H5321gw @@ -59,9 +63,9 @@ ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1921", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson H5321gw -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1926", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1926", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1926", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1927", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1927", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1927", ENV{ID_MM_ERICSSON_MBM}="1" # Ericsson C3304w @@ -70,6 +74,13 @@ # Ericsson C5621 TFF ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1936", ENV{ID_MM_ERICSSON_MBM}="1" +# Lenovo N5321gw +ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="193e", ENV{ID_MM_ERICSSON_MBM}="1" + +GOTO="mm_mbm_end" + +LABEL="mm_mbm_sony_vendorcheck" + # Sony-Ericsson MD300 ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="d0cf", ENV{ID_MM_ERICSSON_MBM}="1" @@ -79,28 +90,39 @@ # Sony-Ericsson MD400G ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="d103", ENV{ID_MM_ERICSSON_MBM}="1" +GOTO="mm_mbm_end" + +LABEL="mm_mbm_dell_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" + # Dell 5560 ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818e", ENV{ID_MM_ERICSSON_MBM}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818e", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" # Dell 5550 ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818d", ENV{ID_MM_ERICSSON_MBM}="1" # Dell 5530 HSDPA -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8147", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8147", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8147", ENV{ID_MM_ERICSSON_MBM}="1" # Dell F3607gw -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8183", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8183", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8183", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8184", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8184", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8184", ENV{ID_MM_ERICSSON_MBM}="1" # Dell F3307 -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818b", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818b", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818b", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818c", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818c", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="413c", ATTRS{idProduct}=="818c", ENV{ID_MM_ERICSSON_MBM}="1" +GOTO="mm_mbm_end" + +LABEL="mm_mbm_hp_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" + # HP hs2330 Mobile Broadband Module ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="271d", ENV{ID_MM_ERICSSON_MBM}="1" @@ -111,7 +133,7 @@ ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3a1d", ENV{ID_MM_ERICSSON_MBM}="1" # HP hs2350 Mobile Broadband Module -ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3d1d", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3d1d", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3d1d", ENV{ID_MM_ERICSSON_MBM}="1" # HP lc2000 Mobile Broadband Module @@ -120,14 +142,19 @@ # HP lc2010 Mobile Broadband Module ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2f1d", ENV{ID_MM_ERICSSON_MBM}="1" +GOTO="mm_mbm_end" + +LABEL="mm_mbm_toshiba_vendorcheck" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" + # Toshiba -ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130b", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130b", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130b", ENV{ID_MM_ERICSSON_MBM}="1" # Toshiba F3607gw -ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130c", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130c", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0930", ATTRS{idProduct}=="130c", ENV{ID_MM_ERICSSON_MBM}="1" -ATTRS{idVendor}=="0930", ATTRS{idProduct}=="1311", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_ERICSSON_MBM_GPS_PORT}="1" +ATTRS{idVendor}=="0930", ATTRS{idProduct}=="1311", ENV{.MM_USBIFNUM}=="09", ENV{ID_MM_PORT_TYPE_GPS}="1" ATTRS{idVendor}=="0930", ATTRS{idProduct}=="1311", ENV{ID_MM_ERICSSON_MBM}="1" # Toshiba F3307 @@ -142,7 +169,6 @@ # Toshiba H5321gw ATTRS{idVendor}=="0930", ATTRS{idProduct}=="1319", ENV{ID_MM_ERICSSON_MBM}="1" -# Lenovo N5321gw -ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="193e", ENV{ID_MM_ERICSSON_MBM}="1" +GOTO="mm_mbm_end" LABEL="mm_mbm_end" diff -Nru modemmanager-1.6.8/plugins/mbm/mm-broadband-bearer-mbm.c modemmanager-1.10.0/plugins/mbm/mm-broadband-bearer-mbm.c --- modemmanager-1.6.8/plugins/mbm/mm-broadband-bearer-mbm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-broadband-bearer-mbm.c 2018-11-15 09:55:53.000000000 +0100 @@ -13,13 +13,14 @@ * Copyright (C) 2008 - 2010 Ericsson AB * Copyright (C) 2009 - 2012 Red Hat, Inc. * Copyright (C) 2012 Lanedo GmbH + * Copyright (C) 2017 Aleksander Morgado * * Author: Per Hallsmark * Bjorn Runaker * Torgny Johansson * Jonas Sjöquist * Dan Williams - * Aleksander Morgado + * Aleksander Morgado */ #include @@ -42,229 +43,208 @@ #include "mm-modem-helpers-mbm.h" #include "mm-daemon-enums-types.h" -G_DEFINE_TYPE (MMBroadbandBearerMbm, mm_broadband_bearer_mbm, MM_TYPE_BROADBAND_BEARER); +G_DEFINE_TYPE (MMBroadbandBearerMbm, mm_broadband_bearer_mbm, MM_TYPE_BROADBAND_BEARER) struct _MMBroadbandBearerMbmPrivate { - gpointer connect_pending; - gpointer disconnect_pending; + GTask *connect_pending; + GTask *disconnect_pending; }; /*****************************************************************************/ - -static void dial_3gpp_report_connection_status (gpointer data, - MMBearerConnectionStatus status); -static void disconnect_report_connection_status (gpointer data, - MMBearerConnectionStatus status); - -static void -report_connection_status (MMBaseBearer *bearer, - MMBearerConnectionStatus status) -{ - MMBroadbandBearerMbm *self = MM_BROADBAND_BEARER_MBM (bearer); - - g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || - status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); - - mm_dbg ("Received unsolicited *E2NAP (%s)", - mm_bearer_connection_status_get_string (status)); - - if (self->priv->connect_pending) { - /* Save unsolicited status for the pending connection attempt */ - dial_3gpp_report_connection_status (self->priv->connect_pending, status); - } else if (self->priv->disconnect_pending) { - /* Save unsolicited status for the pending disconnection attempt */ - disconnect_report_connection_status (self->priv->disconnect_pending, status); - } else { - if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { - MM_BASE_BEARER_CLASS (mm_broadband_bearer_mbm_parent_class)->report_connection_status ( - bearer, - status); - } - } -} - -/*****************************************************************************/ /* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerMbm *self; - MMBaseModem *modem; + MMBaseModem *modem; MMPortSerialAt *primary; - guint cid; - GCancellable *cancellable; - MMPort *data; - GSimpleAsyncResult *result; - guint poll_count; - guint poll_id; - MMBearerConnectionStatus e2nap_status; + guint cid; + MMPort *data; + guint poll_count; + guint poll_id; + GError *saved_error; } Dial3gppContext; static void -dial_3gpp_context_complete_and_free (Dial3gppContext *ctx) +dial_3gpp_context_free (Dial3gppContext *ctx) { - /* Clear bearer object pointer to this connect context */ - if (ctx->self->priv->connect_pending == ctx) - ctx->self->priv->connect_pending = NULL; - - g_simple_async_result_complete_in_idle (ctx->result); + g_assert (!ctx->poll_id); + g_assert (!ctx->saved_error); g_clear_object (&ctx->data); - if (ctx->poll_id) - g_source_remove (ctx->poll_id); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->primary); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); + g_clear_object (&ctx->primary); + g_clear_object (&ctx->modem); g_slice_free (Dial3gppContext, ctx); } static MMPort * -dial_3gpp_finish (MMBroadbandBearer *self, - GAsyncResult *res, - GError **error) +dial_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_PORT (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return MM_PORT (g_task_propagate_pointer (G_TASK (res), error)); } static void -dial_3gpp_report_connection_status (gpointer data, - MMBearerConnectionStatus status) +connect_reset_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) { - Dial3gppContext *ctx = data; + Dial3gppContext *ctx; - g_assert (ctx); - ctx->e2nap_status = status; -} + ctx = g_task_get_task_data (task); -static void -connect_error_disconnect_ready (MMBroadbandBearer *self, - GAsyncResult *res, - Dial3gppContext *ctx) -{ - MM_BROADBAND_BEARER_GET_CLASS (self)->disconnect_3gpp_finish ( - self, - res, - NULL); - dial_3gpp_context_complete_and_free (ctx); + MM_BROADBAND_BEARER_GET_CLASS (self)->disconnect_3gpp_finish (self, res, NULL); + + /* When reset is requested, it was either cancelled or an error was stored */ + if (!g_task_return_error_if_cancelled (task)) { + g_assert (ctx->saved_error); + g_task_return_error (task, ctx->saved_error); + ctx->saved_error = NULL; + } + + g_object_unref (task); } static void -connect_error_disconnect_start (Dial3gppContext *ctx) +connect_reset (GTask *task) { - /* We don't care about connect status anymore */ - if (ctx->self->priv->connect_pending == ctx) - ctx->self->priv->connect_pending = NULL; + MMBroadbandBearerMbm *self; + Dial3gppContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); - MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->disconnect_3gpp ( - MM_BROADBAND_BEARER (ctx->self), + MM_BROADBAND_BEARER_GET_CLASS (self)->disconnect_3gpp ( + MM_BROADBAND_BEARER (self), MM_BROADBAND_MODEM (ctx->modem), ctx->primary, NULL, ctx->data, ctx->cid, - (GAsyncReadyCallback) connect_error_disconnect_ready, - ctx); + (GAsyncReadyCallback) connect_reset_ready, + task); } -static gboolean -handle_e2nap_connect_status (Dial3gppContext *ctx) +static void +process_pending_connect_attempt (MMBroadbandBearerMbm *self, + MMBearerConnectionStatus status) { - switch (ctx->e2nap_status) { - case MM_BEARER_CONNECTION_STATUS_CONNECTED: - /* Reporting connected */ - mm_dbg ("Connected status indicated already by an unsolicited message"); - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->data), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); - return TRUE; - case MM_BEARER_CONNECTION_STATUS_DISCONNECTED: - /* Reporting disconnected */ - mm_dbg ("Connection failure status indicated already by an unsolicited message"); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Call setup failed"); - dial_3gpp_context_complete_and_free (ctx); - return TRUE; - default: - break; + GTask *task; + Dial3gppContext *ctx; + + /* Recover connection task */ + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; + g_assert (task != NULL); + + ctx = g_task_get_task_data (task); + + if (ctx->poll_id) { + g_source_remove (ctx->poll_id); + ctx->poll_id = 0; + } + + /* Received 'CONNECTED' during a connection attempt? */ + if (status == MM_BEARER_CONNECTION_STATUS_CONNECTED) { + /* If we wanted to get cancelled before, do it now. */ + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { + connect_reset (task); + return; + } + + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); + return; + } + + /* If we wanted to get cancelled before and now we couldn't connect, + * use the cancelled error and return */ + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); + return; } - return FALSE; + /* Otherwise, received 'DISCONNECTED' during a connection attempt? */ + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Call setup failed"); + g_object_unref (task); } -static gboolean connect_poll_cb (Dial3gppContext *ctx); +static gboolean connect_poll_cb (MMBroadbandBearerMbm *self); static void -connect_poll_ready (MMBaseModem *modem, - GAsyncResult *res, - Dial3gppContext *ctx) +connect_poll_ready (MMBaseModem *modem, + GAsyncResult *res, + MMBroadbandBearerMbm *self) { - GError *error = NULL; - const gchar *response; - guint state; + GTask *task; + Dial3gppContext *ctx; + GError *error = NULL; + const gchar *response; + guint state; + + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; + + if (!task) { + mm_dbg ("Connection context was finished already by an unsolicited message"); + /* Run _finish() to finalize the async call, even if we don't care + * the result */ + mm_base_modem_at_command_full_finish (modem, res, NULL); + return; + } + + ctx = g_task_get_task_data (task); response = mm_base_modem_at_command_full_finish (modem, res, &error); if (!response) { - g_simple_async_result_take_error (ctx->result, error); - connect_error_disconnect_start (ctx); + ctx->saved_error = error; + connect_reset (task); return; } - if (sscanf (response, "*ENAP: %d", &state) == 1 - && state == 1) { + if (sscanf (response, "*ENAP: %d", &state) == 1 && state == 1) { /* Success! Connected... */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->data), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); return; } - /* Process any unsolicited E2NAP disconnect notification */ - if (handle_e2nap_connect_status (ctx)) - return; - - /* Check again in one second */ + /* Restore pending task and check again in one second */ + self->priv->connect_pending = task; g_assert (ctx->poll_id == 0); - ctx->poll_id = g_timeout_add_seconds (1, - (GSourceFunc)connect_poll_cb, - ctx); + ctx->poll_id = g_timeout_add_seconds (1, (GSourceFunc) connect_poll_cb, self); } static gboolean -connect_poll_cb (Dial3gppContext *ctx) +connect_poll_cb (MMBroadbandBearerMbm *self) { + GTask *task; + Dial3gppContext *ctx; + + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; + + g_assert (task); + ctx = g_task_get_task_data (task); + ctx->poll_id = 0; /* Complete if we were cancelled */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Dial operation has been cancelled"); - connect_error_disconnect_start (ctx); + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { + connect_reset (task); return G_SOURCE_REMOVE; } - /* Process any unsolicited E2NAP status */ - if (handle_e2nap_connect_status (ctx)) - return G_SOURCE_REMOVE; - /* Too many retries... */ if (ctx->poll_count > 50) { - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Connection attempt timed out"); - connect_error_disconnect_start (ctx); + g_assert (!ctx->saved_error); + ctx->saved_error = g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Connection attempt timed out"); + connect_reset (task); return G_SOURCE_REMOVE; } + /* Restore pending task and poll */ + self->priv->connect_pending = task; ctx->poll_count++; mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -272,49 +252,69 @@ 3, FALSE, FALSE, /* raw */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)connect_poll_ready, - ctx); + self); return G_SOURCE_REMOVE; } static void -activate_ready (MMBaseModem *modem, - GAsyncResult *res, - Dial3gppContext *ctx) +activate_ready (MMBaseModem *modem, + GAsyncResult *res, + MMBroadbandBearerMbm *self) { - GError *error = NULL; + GTask *task; + Dial3gppContext *ctx; + GError *error = NULL; + + /* Try to recover the connection context. If none found, it means the + * context was already completed and we have nothing else to do. */ + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; + + if (!task) { + mm_dbg ("Connection context was finished already by an unsolicited message"); + /* Run _finish() to finalize the async call, even if we don't care + * the result */ + mm_base_modem_at_command_full_finish (modem, res, NULL); + goto out; + } /* From now on, if we get cancelled, we'll need to run the connection * reset ourselves just in case */ - if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - connect_error_disconnect_start (ctx); - return; + g_task_return_error (task, error); + g_object_unref (task); + goto out; } - /* Process any unsolicited E2NAP status received before the ENAP OK */ - if (handle_e2nap_connect_status (ctx)) - return; + ctx = g_task_get_task_data (task); /* No unsolicited E2NAP status yet; wait for it and periodically poll * to handle very old F3507g/MD300 firmware that may not send E2NAP. */ - ctx->poll_id = g_timeout_add_seconds (1, - (GSourceFunc)connect_poll_cb, - ctx); + self->priv->connect_pending = task; + ctx->poll_id = g_timeout_add_seconds (1, (GSourceFunc)connect_poll_cb, self); + + out: + /* Balance refcount with the extra ref we passed to command_full() */ + g_object_unref (self); } static void -activate (Dial3gppContext *ctx) +activate (GTask *task) { - gchar *command; + MMBroadbandBearerMbm *self; + Dial3gppContext *ctx; + gchar *command; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); /* The unsolicited response to ENAP may come before the OK does. * We will keep the connection context in the bearer private data so * that it is accessible from the unsolicited message handler. */ - g_assert (ctx->self->priv->connect_pending == NULL); - ctx->self->priv->connect_pending = ctx; + g_assert (self->priv->connect_pending == NULL); + self->priv->connect_pending = task; /* Activate the PDP context and start the data session */ command = g_strdup_printf ("AT*ENAP=1,%d", ctx->cid); @@ -324,36 +324,41 @@ 3, FALSE, FALSE, /* raw */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)activate_ready, - ctx); + g_object_ref (self)); /* we pass the bearer object! */ g_free (command); } static void -authenticate_ready (MMBaseModem *modem, +authenticate_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - activate (ctx); + activate (task); } static void -authenticate (Dial3gppContext *ctx) +authenticate (GTask *task) { - const gchar *user; - const gchar *password; + MMBroadbandBearerMbm *self; + Dial3gppContext *ctx; + const gchar *user; + const gchar *password; - user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); /* Both user and password are required; otherwise firmware returns an error */ if (user || password) { @@ -379,98 +384,68 @@ 3, FALSE, FALSE, /* raw */ - ctx->cancellable, - (GAsyncReadyCallback)authenticate_ready, - ctx); + g_task_get_cancellable (task), + (GAsyncReadyCallback) authenticate_ready, + task); g_free (command); return; } mm_dbg ("Authentication not needed"); - activate (ctx); + activate (task); } static void -dial_3gpp (MMBroadbandBearer *self, - MMBaseModem *modem, - MMPortSerialAt *primary, - guint cid, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +dial_3gpp (MMBroadbandBearer *_self, + MMBaseModem *modem, + MMPortSerialAt *primary, + guint cid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { - Dial3gppContext *ctx; + MMBroadbandBearerMbm *self = MM_BROADBAND_BEARER_MBM (_self); + GTask *task; + Dial3gppContext *ctx; g_assert (primary != NULL); + task = g_task_new (self, cancellable, callback, user_data); + ctx = g_slice_new0 (Dial3gppContext); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (modem); + ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); - ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - dial_3gpp); - ctx->cancellable = g_object_ref (cancellable); - ctx->poll_count = 0; + ctx->cid = cid; + g_task_set_task_data (task, ctx, (GDestroyNotify)dial_3gpp_context_free); /* We need a net data port */ ctx->data = mm_base_modem_get_best_data_port (modem, MM_PORT_TYPE_NET); if (!ctx->data) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No valid data port found to launch connection"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); + g_object_unref (task); return; } - authenticate (ctx); + authenticate (task); } /*****************************************************************************/ /* 3GPP IP config retrieval (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerMbm *self; MMBaseModem *modem; MMPortSerialAt *primary; MMBearerIpFamily family; - GSimpleAsyncResult *result; } GetIpConfig3gppContext; -static GetIpConfig3gppContext * -get_ip_config_3gpp_context_new (MMBroadbandBearerMbm *self, - MMBaseModem *modem, - MMPortSerialAt *primary, - MMBearerIpFamily family, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GetIpConfig3gppContext *ctx; - - ctx = g_new0 (GetIpConfig3gppContext, 1); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (modem); - ctx->primary = g_object_ref (primary); - ctx->family = family; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_ip_config_3gpp_context_new); - return ctx; -} - static void -get_ip_config_context_complete_and_free (GetIpConfig3gppContext *ctx) +get_ip_config_context_free (GetIpConfig3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } @@ -484,12 +459,10 @@ MMBearerConnectResult *configs; MMBearerIpConfig *ipv4, *ipv6; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + configs = g_task_propagate_pointer (G_TASK (res), error); + if (!configs) return FALSE; - configs = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_assert (configs); - ipv4 = mm_bearer_connect_result_peek_ipv4_config (configs); ipv6 = mm_bearer_connect_result_peek_ipv6_config (configs); g_assert (ipv4 || ipv6); @@ -498,20 +471,24 @@ if (ipv6_config && ipv6) *ipv6_config = g_object_ref (ipv6); + mm_bearer_connect_result_unref (configs); return TRUE; } static void ip_config_ready (MMBaseModem *modem, GAsyncResult *res, - GetIpConfig3gppContext *ctx) + GTask *task) { + GetIpConfig3gppContext *ctx; MMBearerIpConfig *ipv4_config = NULL; MMBearerIpConfig *ipv6_config = NULL; const gchar *response; GError *error = NULL; MMBearerConnectResult *connect_result; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { g_error_free (error); @@ -530,16 +507,16 @@ &ipv4_config, &ipv6_config, &error)) { - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); goto out; } if (!ipv4_config && !ipv6_config) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get IP config: couldn't parse response '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get IP config: couldn't parse response '%s'", + response); goto out; } } @@ -547,14 +524,14 @@ connect_result = mm_bearer_connect_result_new (MM_PORT (ctx->primary), ipv4_config, ipv6_config); - g_simple_async_result_set_op_res_gpointer (ctx->result, - connect_result, - (GDestroyNotify)mm_bearer_connect_result_unref); + g_task_return_pointer (task, + connect_result, + (GDestroyNotify)mm_bearer_connect_result_unref); out: + g_object_unref (task); g_clear_object (&ipv4_config); g_clear_object (&ipv6_config); - get_ip_config_context_complete_and_free (ctx); } static void @@ -569,13 +546,15 @@ gpointer user_data) { GetIpConfig3gppContext *ctx; + GTask *task; + + ctx = g_new0 (GetIpConfig3gppContext, 1); + ctx->modem = g_object_ref (modem); + ctx->primary = g_object_ref (primary); + ctx->family = ip_family; - ctx = get_ip_config_3gpp_context_new (MM_BROADBAND_BEARER_MBM (self), - MM_BASE_MODEM (modem), - primary, - ip_family, - callback, - user_data); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)get_ip_config_context_free); mm_base_modem_at_command_full (MM_BASE_MODEM (modem), primary, @@ -585,123 +564,142 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)ip_config_ready, - ctx); + task); } /*****************************************************************************/ /* 3GPP disconnect */ typedef struct { - MMBroadbandBearerMbm *self; - MMBaseModem *modem; + MMBaseModem *modem; MMPortSerialAt *primary; - GSimpleAsyncResult *result; - guint poll_count; - guint poll_id; - MMBearerConnectionStatus e2nap_status; + guint poll_count; + guint poll_id; } DisconnectContext; static void -disconnect_context_complete_and_free (DisconnectContext *ctx) +disconnect_context_free (DisconnectContext *ctx) { - /* Clear bearer object pointer to this disconnect context */ - if (ctx->self->priv->disconnect_pending == ctx) - ctx->self->priv->disconnect_pending = NULL; - - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->poll_id) - g_source_remove (ctx->poll_id); - g_object_unref (ctx->result); - g_object_unref (ctx->primary); - g_object_unref (ctx->self); - g_object_unref (ctx->modem); + g_assert (!ctx->poll_id); + g_clear_object (&ctx->primary); + g_clear_object (&ctx->modem); g_free (ctx); } static gboolean -disconnect_3gpp_finish (MMBroadbandBearer *self, - GAsyncResult *res, - GError **error) +disconnect_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -disconnect_report_connection_status (gpointer data, - MMBearerConnectionStatus status) +process_pending_disconnect_attempt (MMBroadbandBearerMbm *self, + MMBearerConnectionStatus status) { - DisconnectContext *ctx = data; + GTask *task; + DisconnectContext *ctx; - g_assert (ctx); - ctx->e2nap_status = status; -} + /* Recover disconnection task */ + task = self->priv->disconnect_pending; + self->priv->disconnect_pending = NULL; + g_assert (task != NULL); -static gboolean -handle_e2nap_disconnect_status (DisconnectContext *ctx) -{ - if (ctx->e2nap_status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { - /* Reporting disconnected */ - mm_dbg ("Connection disconnect indicated already by an unsolicited message"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_context_complete_and_free (ctx); - return TRUE; + ctx = g_task_get_task_data (task); + + if (ctx->poll_id) { + g_source_remove (ctx->poll_id); + ctx->poll_id = 0; } - return FALSE; + /* Received 'DISCONNECTED' during a disconnection attempt? */ + if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { + mm_dbg ("Connection disconnect indicated by an unsolicited message"); + g_task_return_boolean (task, TRUE); + } else { + /* Otherwise, report error */ + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Disconnection failed"); + } + g_object_unref (task); } -static gboolean disconnect_poll_cb (DisconnectContext *ctx); +static gboolean disconnect_poll_cb (MMBroadbandBearerMbm *self); static void -disconnect_poll_ready (MMBaseModem *modem, - GAsyncResult *res, - DisconnectContext *ctx) +disconnect_poll_ready (MMBaseModem *modem, + GAsyncResult *res, + MMBroadbandBearerMbm *self) + { - GError *error = NULL; - const gchar *response; - guint state; + GTask *task; + DisconnectContext *ctx; + GError *error = NULL; + const gchar *response; + guint state; + + task = self->priv->disconnect_pending; + self->priv->disconnect_pending = NULL; + + if (!task) { + mm_dbg ("Disconnection context was finished already by an unsolicited message"); + /* Run _finish() to finalize the async call, even if we don't care + * the result */ + mm_base_modem_at_command_full_finish (modem, res, NULL); + goto out; + } response = mm_base_modem_at_command_full_finish (modem, res, &error); if (!response) { - g_simple_async_result_take_error (ctx->result, error); - disconnect_context_complete_and_free (ctx); - return; + g_task_return_error (task, error); + g_object_unref (task); + goto out; } - if (sscanf (response, "*ENAP: %d", &state) == 1 - && state == 0) { + if (sscanf (response, "*ENAP: %d", &state) == 1 && state == 0) { /* Disconnected */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_context_complete_and_free (ctx); - return; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + goto out; } - /* Check again in one second */ + /* Restore pending task and check in 1s */ + self->priv->disconnect_pending = task; + ctx = g_task_get_task_data (task); g_assert (ctx->poll_id == 0); - ctx->poll_id = g_timeout_add_seconds (1, - (GSourceFunc)disconnect_poll_cb, - ctx); + ctx->poll_id = g_timeout_add_seconds (1, (GSourceFunc) disconnect_poll_cb, self); + + out: + /* Balance refcount with the extra ref we passed to command_full() */ + g_object_unref (self); } static gboolean -disconnect_poll_cb (DisconnectContext *ctx) +disconnect_poll_cb (MMBroadbandBearerMbm *self) { - ctx->poll_id = 0; + GTask *task; + DisconnectContext *ctx; - /* Process any unsolicited E2NAP status */ - if (handle_e2nap_disconnect_status (ctx)) - return G_SOURCE_REMOVE; + task = self->priv->disconnect_pending; + self->priv->disconnect_pending = NULL; + + g_assert (task); + ctx = g_task_get_task_data (task); + + ctx->poll_id = 0; /* Too many retries... */ if (ctx->poll_count > 20) { - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Disconnection attempt timed out"); - disconnect_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Disconnection attempt timed out"); + g_object_unref (task); return G_SOURCE_REMOVE; } + /* Restore pending task and poll */ + self->priv->disconnect_pending = task; ctx->poll_count++; mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -710,17 +708,31 @@ FALSE, FALSE, /* raw */ NULL, /* cancellable */ - (GAsyncReadyCallback)disconnect_poll_ready, - ctx); + (GAsyncReadyCallback) disconnect_poll_ready, + g_object_ref (self)); /* we pass the bearer object! */ return G_SOURCE_REMOVE; } static void -disconnect_enap_ready (MMBaseModem *modem, - GAsyncResult *res, - DisconnectContext *ctx) +disconnect_enap_ready (MMBaseModem *modem, + GAsyncResult *res, + MMBroadbandBearerMbm *self) { - GError *error = NULL; + DisconnectContext *ctx; + GTask *task; + GError *error = NULL; + + task = self->priv->disconnect_pending; + self->priv->disconnect_pending = NULL; + + /* Try to recover the disconnection context. If none found, it means the + * context was already completed and we have nothing else to do. */ + if (!task) { + mm_base_modem_at_command_full_finish (modem, res, NULL); + goto out; + } + + ctx = g_task_get_task_data (task); /* Ignore errors for now */ mm_base_modem_at_command_full_finish (modem, res, &error); @@ -729,45 +741,44 @@ g_error_free (error); } - /* Process any unsolicited E2NAP status received before the ENAP OK */ - if (handle_e2nap_disconnect_status (ctx)) - return; - /* No unsolicited E2NAP status yet; wait for it and periodically poll * to handle very old F3507g/MD300 firmware that may not send E2NAP. */ - ctx->poll_id = g_timeout_add_seconds (1, - (GSourceFunc)disconnect_poll_cb, - ctx); + self->priv->disconnect_pending = task; + ctx->poll_id = g_timeout_add_seconds (1, (GSourceFunc)disconnect_poll_cb, self); + + out: + /* Balance refcount with the extra ref we passed to command_full() */ + g_object_unref (self); } static void -disconnect_3gpp (MMBroadbandBearer *self, - MMBroadbandModem *modem, - MMPortSerialAt *primary, - MMPortSerialAt *secondary, - MMPort *data, - guint cid, - GAsyncReadyCallback callback, - gpointer user_data) -{ - DisconnectContext *ctx; +disconnect_3gpp (MMBroadbandBearer *_self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + MMPortSerialAt *secondary, + MMPort *data, + guint cid, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandBearerMbm *self = MM_BROADBAND_BEARER_MBM (_self); + GTask *task; + DisconnectContext *ctx; g_assert (primary != NULL); + task = g_task_new (self, NULL, callback, user_data); + ctx = g_new0 (DisconnectContext, 1); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); ctx->primary = g_object_ref (primary); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect_3gpp); + g_task_set_task_data (task, ctx, (GDestroyNotify) disconnect_context_free); /* The unsolicited response to ENAP may come before the OK does. * We will keep the disconnection context in the bearer private data so * that it is accessible from the unsolicited message handler. */ - g_assert (ctx->self->priv->disconnect_pending == NULL); - ctx->self->priv->disconnect_pending = ctx; + g_assert (self->priv->disconnect_pending == NULL); + self->priv->disconnect_pending = task; mm_base_modem_at_command_full (MM_BASE_MODEM (modem), primary, @@ -777,7 +788,45 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_enap_ready, - ctx); + g_object_ref (self)); /* we pass the bearer object! */ +} + +/*****************************************************************************/ + +static void +report_connection_status (MMBaseBearer *_self, + MMBearerConnectionStatus status) +{ + MMBroadbandBearerMbm *self = MM_BROADBAND_BEARER_MBM (_self); + + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || + status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED || + status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + + /* Process pending connection attempt */ + if (self->priv->connect_pending) { + process_pending_connect_attempt (self, status); + return; + } + + /* Process pending disconnection attempt */ + if (self->priv->disconnect_pending) { + process_pending_disconnect_attempt (self, status); + return; + } + + mm_dbg ("Received spontaneous E2NAP (%s)", + mm_bearer_connection_status_get_string (status)); + + /* Received a random 'DISCONNECTED'...*/ + if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED || + status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED) { + /* If no connection/disconnection attempt on-going, make sure we mark ourselves as + * disconnected. Make sure we only pass 'DISCONNECTED' to the parent */ + MM_BASE_BEARER_CLASS (mm_broadband_bearer_mbm_parent_class)->report_connection_status ( + _self, + MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + } } /*****************************************************************************/ @@ -840,6 +889,9 @@ g_type_class_add_private (object_class, sizeof (MMBroadbandBearerMbmPrivate)); base_bearer_class->report_connection_status = report_connection_status; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; + broadband_bearer_class->dial_3gpp = dial_3gpp; broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp; diff -Nru modemmanager-1.6.8/plugins/mbm/mm-broadband-modem-mbm.c modemmanager-1.10.0/plugins/mbm/mm-broadband-modem-mbm.c --- modemmanager-1.6.8/plugins/mbm/mm-broadband-modem-mbm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-broadband-modem-mbm.c 2018-11-15 09:55:53.000000000 +0100 @@ -89,31 +89,24 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New MBM bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_mbm_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_mbm_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void @@ -122,19 +115,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); - mm_dbg ("Creating MBM bearer..."); mm_broadband_bearer_mbm_new (MM_BROADBAND_MODEM_MBM (self), properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_mbm_new_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -168,14 +154,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -184,15 +170,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* wait so sim pin is done */ - g_timeout_add (500, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add (500, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -275,45 +258,22 @@ { MMBroadbandModemMbm *self = MM_BROADBAND_MODEM_MBM (_self); const gchar *response; - guint a; + gint mbm_mode = -1; + + g_assert (allowed); + g_assert (preferred); response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); - if (!response) + if (!response || !mm_mbm_parse_cfun_query_current_modes (response, allowed, &mbm_mode, error)) return FALSE; - if (mm_get_uint_from_str (mm_strip_tag (response, "+CFUN:"), &a)) { - /* No settings to set preferred */ - *preferred = MM_MODEM_MODE_NONE; - - switch (a) { - case MBM_NETWORK_MODE_OFFLINE: - case MBM_NETWORK_MODE_LOW_POWER: - /* Do not update internal mbm_mode */ - *allowed = MM_MODEM_MODE_NONE; - break; - case MBM_NETWORK_MODE_2G: - self->priv->mbm_mode = MBM_NETWORK_MODE_2G; - *allowed = MM_MODEM_MODE_2G; - break; - case MBM_NETWORK_MODE_3G: - self->priv->mbm_mode = MBM_NETWORK_MODE_3G; - *allowed = MM_MODEM_MODE_3G; - break; - default: - /* Do not update internal mbm_mode */ - *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - break; - } + /* No settings to set preferred */ + *preferred = MM_MODEM_MODE_NONE; - return TRUE; - } + if (mbm_mode != -1) + self->priv->mbm_mode = mbm_mode; - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse +CFUN response: '%s'", - response); - return FALSE; + return TRUE; } static void @@ -333,45 +293,37 @@ /* Set allowed modes (Modem interface) */ typedef struct { - MMBroadbandModemMbm *self; - GSimpleAsyncResult *result; gint mbm_mode; } SetCurrentModesContext; -static void -set_current_modes_context_complete_and_free (SetCurrentModesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (SetCurrentModesContext, ctx); -} - static gboolean set_current_modes_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBaseModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { + SetCurrentModesContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_finish (self, res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else { /* Cache current allowed mode */ - ctx->self->priv->mbm_mode = ctx->mbm_mode; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + MM_BROADBAND_MODEM_MBM (self)->priv->mbm_mode = ctx->mbm_mode; + g_task_return_boolean (task, TRUE); } - set_current_modes_context_complete_and_free (ctx); + g_object_unref (task); } static void @@ -382,16 +334,15 @@ gpointer user_data) { SetCurrentModesContext *ctx; + GTask *task; gchar *command; - ctx = g_slice_new (SetCurrentModesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + ctx = g_new (SetCurrentModesContext, 1); ctx->mbm_mode = -1; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + if (allowed == MM_MODEM_MODE_2G) ctx->mbm_mode = MBM_NETWORK_MODE_2G; else if (allowed == MM_MODEM_MODE_3G) @@ -407,17 +358,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - set_current_modes_context_complete_and_free (ctx); return; } @@ -428,44 +378,30 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - ctx); + task); g_free (command); } /*****************************************************************************/ /* Initializing the modem (during first enabling) */ -typedef struct { - GSimpleAsyncResult *result; - MMBroadbandModemMbm *self; -} EnablingModemInitContext; - -static void -enabling_modem_init_context_complete_and_free (EnablingModemInitContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (EnablingModemInitContext, ctx); -} - static gboolean enabling_modem_init_finish (MMBroadbandModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void enabling_init_sequence_ready (MMBaseModem *self, GAsyncResult *res, - EnablingModemInitContext *ctx) + GTask *task) { /* Ignore errors */ mm_base_modem_at_sequence_full_finish (self, res, NULL, NULL); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_modem_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static const MMBaseModemAtCommand enabling_modem_init_sequence[] = { @@ -477,22 +413,25 @@ }; static void -run_enabling_init_sequence (EnablingModemInitContext *ctx) +run_enabling_init_sequence (GTask *task) { - mm_base_modem_at_sequence_full (MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)), + MMBaseModem *self; + + self = g_task_get_source_object (task); + mm_base_modem_at_sequence_full (self, + mm_base_modem_peek_port_primary (self), enabling_modem_init_sequence, NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)enabling_init_sequence_ready, - ctx); + task); } static void emrdy_ready (MMBaseModem *self, GAsyncResult *res, - EnablingModemInitContext *ctx) + GTask *task) { GError *error = NULL; @@ -511,30 +450,26 @@ MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) mm_warn ("timed out waiting for EMRDY response."); else - ctx->self->priv->have_emrdy = TRUE; + MM_BROADBAND_MODEM_MBM (self)->priv->have_emrdy = TRUE; g_error_free (error); } - run_enabling_init_sequence (ctx); + run_enabling_init_sequence (task); } static void -enabling_modem_init (MMBroadbandModem *self, +enabling_modem_init (MMBroadbandModem *_self, GAsyncReadyCallback callback, gpointer user_data) { - EnablingModemInitContext *ctx; + MMBroadbandModemMbm *self = MM_BROADBAND_MODEM_MBM (_self); + GTask *task; - ctx = g_slice_new0 (EnablingModemInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enabling_modem_init); - ctx->self = g_object_ref (self); + task = g_task_new (self, NULL, callback, user_data); /* Modem is ready?, no need to check EMRDY */ - if (ctx->self->priv->have_emrdy) { - run_enabling_init_sequence (ctx); + if (self->priv->have_emrdy) { + run_enabling_init_sequence (task); return; } @@ -543,7 +478,7 @@ 3, FALSE, (GAsyncReadyCallback)emrdy_ready, - ctx); + task); } /*****************************************************************************/ @@ -615,36 +550,14 @@ GAsyncResult *res, GError **error) { - const gchar *response; - guint a; + const gchar *response; + MMModemPowerState state; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); - if (!response) - return FALSE; + if (!response || !mm_mbm_parse_cfun_query_power_state (response, &state, error)) + return MM_MODEM_POWER_STATE_UNKNOWN; - if (mm_get_uint_from_str (mm_strip_tag (response, "+CFUN:"), &a)) { - switch (a) { - case MBM_NETWORK_MODE_OFFLINE: - return MM_MODEM_POWER_STATE_OFF; - - case MBM_NETWORK_MODE_LOW_POWER: - return MM_MODEM_POWER_STATE_LOW; - - case MBM_NETWORK_MODE_ANY: - case MBM_NETWORK_MODE_2G: - case MBM_NETWORK_MODE_3G: - return MM_MODEM_POWER_STATE_ON; - default: - break; - } - } - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse +CFUN response: '%s'", - response); - return MM_MODEM_POWER_STATE_UNKNOWN; + return state; } static void @@ -907,7 +820,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -940,26 +853,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_MBM (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -967,33 +878,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -1001,13 +905,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_MBM (self), FALSE); @@ -1015,7 +912,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1026,23 +923,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { @@ -1054,14 +951,13 @@ static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1074,7 +970,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void @@ -1082,18 +978,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); - /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1104,36 +993,35 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1141,7 +1029,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { @@ -1155,13 +1043,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); - /* Our own disable first */ mm_base_modem_at_sequence_full ( MM_BASE_MODEM (self), @@ -1171,7 +1052,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1182,25 +1063,29 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCATION_SOURCE_NONE; + GError *inner_error = NULL; + gssize value; - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; } static void parent_load_capabilities_ready (MMIfaceModemLocation *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemLocationSource sources; GError *error = NULL; sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1211,11 +1096,8 @@ MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED); /* So we're done, complete */ - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (sources), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, sources); + g_object_unref (task); } static void @@ -1223,37 +1105,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_load_capabilities); - /* Chain up parent's setup */ - iface_modem_location_parent->load_capabilities (self, - (GAsyncReadyCallback)parent_load_capabilities_ready, - result); + iface_modem_location_parent->load_capabilities ( + self, + (GAsyncReadyCallback)parent_load_capabilities_ready, + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Enable/Disable location gathering (Location interface) */ typedef struct { - MMBroadbandModemMbm *self; - GSimpleAsyncResult *result; MMModemLocationSource source; } LocationGatheringContext; -static void -location_gathering_context_complete_and_free (LocationGatheringContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LocationGatheringContext, ctx); -} - /******************************/ /* Disable location gathering */ @@ -1262,21 +1127,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void gps_disabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; MMPortSerialGps *gps_port; GError *error = NULL; - if (!mm_base_modem_at_command_full_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + ctx = g_task_get_task_data (task); + + mm_base_modem_at_command_full_finish (self, res, &error); /* Only use the GPS port in NMEA/RAW setups */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | @@ -1287,7 +1152,12 @@ mm_port_serial_close (MM_PORT_SERIAL (gps_port)); } - location_gathering_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -1299,15 +1169,14 @@ MMBroadbandModemMbm *self = MM_BROADBAND_MODEM_MBM (_self); gboolean stop_gps = FALSE; LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Only stop GPS engine if no GPS-related sources enabled */ if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | @@ -1329,13 +1198,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_disabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if still some GPS needed, just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -1346,23 +1215,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void gps_enabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; GError *error = NULL; MMPortSerialGps *gps_port; if (!mm_base_modem_at_command_full_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Only use the GPS port in NMEA/RAW setups */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { @@ -1370,12 +1242,12 @@ if (!gps_port || !mm_port_serial_open (MM_PORT_SERIAL (gps_port), &error)) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't open raw GPS serial port"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't open raw GPS serial port"); } else { GByteArray *buf; const gchar *command = "ATE0*E2GPSNPD\r\n"; @@ -1395,41 +1267,44 @@ NULL, NULL); g_byte_array_unref (buf); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - location_gathering_context_complete_and_free (ctx); + g_object_unref (task); } static void -parent_enable_location_gathering_ready (MMIfaceModemLocation *self, +parent_enable_location_gathering_ready (MMIfaceModemLocation *_self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + MMBroadbandModemMbm *self = MM_BROADBAND_MODEM_MBM (_self); + LocationGatheringContext *ctx; gboolean start_gps = FALSE; GError *error = NULL; - if (!iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + if (!iface_modem_location_parent->enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* Now our own enabling */ /* NMEA and RAW are both enabled in the same way */ + ctx = g_task_get_task_data (task); if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { /* Only start GPS engine if not done already */ - if (!(ctx->self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) + if (!(self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) start_gps = TRUE; - ctx->self->priv->enabled_sources |= ctx->source; + self->priv->enabled_sources |= ctx->source; } if (start_gps) { @@ -1441,13 +1316,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_enabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if GPS already running just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -1457,20 +1332,19 @@ gpointer user_data) { LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Chain up parent's gathering enable */ iface_modem_location_parent->enable_location_gathering (self, source, (GAsyncReadyCallback)parent_enable_location_gathering_ready, - ctx); + task); } /*****************************************************************************/ @@ -1507,7 +1381,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Setup unsolicited handlers which should be always on */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/mbm/mm-modem-helpers-mbm.c modemmanager-1.10.0/plugins/mbm/mm-modem-helpers-mbm.c --- modemmanager-1.6.8/plugins/mbm/mm-modem-helpers-mbm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-modem-helpers-mbm.c 2019-01-15 15:57:35.000000000 +0100 @@ -159,8 +159,7 @@ } done: - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return !!*ip_config; } @@ -263,3 +262,74 @@ *supported_mask = mask; return !!mask; } + +/*****************************************************************************/ +/* AT+CFUN? response parsers */ + +gboolean +mm_mbm_parse_cfun_query_power_state (const gchar *response, + MMModemPowerState *out_state, + GError **error) +{ + guint state; + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return FALSE; + + switch (state) { + case MBM_NETWORK_MODE_OFFLINE: + *out_state = MM_MODEM_POWER_STATE_OFF; + return TRUE; + case MBM_NETWORK_MODE_LOW_POWER: + *out_state = MM_MODEM_POWER_STATE_LOW; + return TRUE; + case MBM_NETWORK_MODE_ANY: + case MBM_NETWORK_MODE_2G: + case MBM_NETWORK_MODE_3G: + *out_state = MM_MODEM_POWER_STATE_ON; + return TRUE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown +CFUN pòwer state: '%u'", state); + return FALSE; + } +} + +gboolean +mm_mbm_parse_cfun_query_current_modes (const gchar *response, + MMModemMode *allowed, + gint *mbm_mode, + GError **error) +{ + guint state; + + g_assert (mbm_mode); + g_assert (allowed); + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return FALSE; + + switch (state) { + case MBM_NETWORK_MODE_OFFLINE: + case MBM_NETWORK_MODE_LOW_POWER: + /* Do not update mbm_mode */ + *allowed = MM_MODEM_MODE_NONE; + return TRUE; + case MBM_NETWORK_MODE_2G: + *mbm_mode = MBM_NETWORK_MODE_2G; + *allowed = MM_MODEM_MODE_2G; + return TRUE; + case MBM_NETWORK_MODE_3G: + *mbm_mode = MBM_NETWORK_MODE_3G; + *allowed = MM_MODEM_MODE_3G; + return TRUE; + case MBM_NETWORK_MODE_ANY: + /* Do not update mbm_mode */ + *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + return TRUE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown +CFUN current mode: '%u'", state); + return FALSE; + } +} diff -Nru modemmanager-1.6.8/plugins/mbm/mm-modem-helpers-mbm.h modemmanager-1.10.0/plugins/mbm/mm-modem-helpers-mbm.h --- modemmanager-1.6.8/plugins/mbm/mm-modem-helpers-mbm.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-modem-helpers-mbm.h 2018-11-15 09:55:53.000000000 +0100 @@ -38,4 +38,13 @@ guint32 *supported_mask, GError **error); +/* AT+CFUN? response parsers */ +gboolean mm_mbm_parse_cfun_query_power_state (const gchar *response, + MMModemPowerState *out_state, + GError **error); +gboolean mm_mbm_parse_cfun_query_current_modes (const gchar *response, + MMModemMode *allowed, + gint *mbm_mode, + GError **error); + #endif /* MM_MODEM_HELPERS_MBM_H */ diff -Nru modemmanager-1.6.8/plugins/mbm/mm-plugin-mbm.c modemmanager-1.10.0/plugins/mbm/mm-plugin-mbm.c --- modemmanager-1.6.8/plugins/mbm/mm-plugin-mbm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-plugin-mbm.c 2019-01-15 15:57:35.000000000 +0100 @@ -40,7 +40,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -50,7 +50,7 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { mm_dbg ("MBIM-powered Ericsson modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -58,42 +58,13 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_mbm_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbm_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - GUdevDevice *port; - MMPortType port_type; - - port_type = mm_port_probe_get_port_type (probe); - port = mm_port_probe_peek_port (probe); - - if (g_udev_device_get_property_as_boolean (port, "ID_MM_ERICSSON_MBM_GPS_PORT")) { - mm_dbg ("(%s/%s) Port flagged as GPS", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - port_type = MM_PORT_TYPE_GPS; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - port_type, - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -126,6 +97,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; - } diff -Nru modemmanager-1.6.8/plugins/mbm/mm-sim-mbm.c modemmanager-1.10.0/plugins/mbm/mm-sim-mbm.c --- modemmanager-1.6.8/plugins/mbm/mm-sim-mbm.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/mm-sim-mbm.c 2018-11-15 09:55:53.000000000 +0100 @@ -34,20 +34,14 @@ /* SEND PIN/PUK (Generic implementation) */ typedef struct { - MMSimMbm *self; MMBaseModem *modem; - GSimpleAsyncResult *result; - MMModemLock expected; guint retries; } SendPinPukContext; static void -send_pin_puk_context_complete_and_free (SendPinPukContext *ctx) +send_pin_puk_context_free (SendPinPukContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SendPinPukContext, ctx); } @@ -56,15 +50,15 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void wait_for_unlocked_status (SendPinPukContext *ctx); +static void wait_for_unlocked_status (GTask *task); static void cpin_query_ready (MMBaseModem *modem, GAsyncResult *res, - SendPinPukContext *ctx) + GTask *task) { const gchar *result; @@ -72,64 +66,73 @@ result = mm_base_modem_at_command_finish (modem, res, NULL); if (result && strstr (result, "READY")) { /* All done! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - send_pin_puk_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Need to recheck */ - wait_for_unlocked_status (ctx); + wait_for_unlocked_status (task); } static gboolean -cpin_query_cb (SendPinPukContext *ctx) +cpin_query_cb (GTask *task) { + SendPinPukContext *ctx; + + ctx = g_task_get_task_data (task); mm_base_modem_at_command (ctx->modem, "+CPIN?", 20, FALSE, (GAsyncReadyCallback)cpin_query_ready, - ctx); + task); return G_SOURCE_REMOVE; } static void -wait_for_unlocked_status (SendPinPukContext *ctx) +wait_for_unlocked_status (GTask *task) { + SendPinPukContext *ctx; + + ctx = g_task_get_task_data (task); + /* Oops... :/ */ if (ctx->retries == 0) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "PIN was sent but modem didn't report unlocked"); - send_pin_puk_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "PIN was sent but modem didn't report unlocked"); + g_object_unref (task); return; } /* Check status */ ctx->retries--; mm_dbg ("Scheduling lock state check..."); - g_timeout_add_seconds (1, (GSourceFunc)cpin_query_cb, ctx); + g_timeout_add_seconds (1, (GSourceFunc)cpin_query_cb, task); } static void send_pin_puk_ready (MMBaseModem *modem, GAsyncResult *res, - SendPinPukContext *ctx) + GTask *task) { + SendPinPukContext *ctx; GError *error = NULL; mm_base_modem_at_command_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - send_pin_puk_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* No explicit error sending the PIN/PUK, now check status until we have the * expected lock status */ + ctx = g_task_get_task_data (task); ctx->retries = 3; - wait_for_unlocked_status (ctx); + wait_for_unlocked_status (task); } static void @@ -140,18 +143,17 @@ gpointer user_data) { SendPinPukContext *ctx; + GTask *task; gchar *command; ctx = g_slice_new (SendPinPukContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_send_pin_puk); - g_object_get (ctx->self, + g_object_get (self, MM_BASE_SIM_MODEM, &ctx->modem, NULL); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)send_pin_puk_context_free); + command = (puk ? g_strdup_printf ("+CPIN=\"%s\",\"%s\"", puk, pin) : g_strdup_printf ("+CPIN=\"%s\"", pin)); @@ -160,7 +162,7 @@ 3, FALSE, (GAsyncReadyCallback)send_pin_puk_ready, - ctx); + task); g_free (command); } diff -Nru modemmanager-1.6.8/plugins/mbm/tests/test-modem-helpers-mbm.c modemmanager-1.10.0/plugins/mbm/tests/test-modem-helpers-mbm.c --- modemmanager-1.6.8/plugins/mbm/tests/test-modem-helpers-mbm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mbm/tests/test-modem-helpers-mbm.c 2018-11-15 09:55:53.000000000 +0100 @@ -172,7 +172,7 @@ }; static void -test_cfun (void) +test_cfun_test (void) { guint i; @@ -190,6 +190,71 @@ /*****************************************************************************/ +typedef struct { + const gchar *str; + MMModemPowerState state; +} CfunQueryPowerStateTest; + +static const CfunQueryPowerStateTest cfun_query_power_state_tests[] = { + { "+CFUN: 0", MM_MODEM_POWER_STATE_OFF }, + { "+CFUN: 1", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 4", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 5", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 6", MM_MODEM_POWER_STATE_ON }, +}; + +static void +test_cfun_query_power_state (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_power_state_tests); i++) { + GError *error = NULL; + gboolean success; + MMModemPowerState state; + + success = mm_mbm_parse_cfun_query_power_state (cfun_query_power_state_tests[i].str, &state, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_power_state_tests[i].state, ==, state); + } +} + +typedef struct { + const gchar *str; + MMModemMode allowed; + gint mbm_mode; +} CfunQueryCurrentModeTest; + +static const CfunQueryCurrentModeTest cfun_query_current_mode_tests[] = { + { "+CFUN: 0", MM_MODEM_MODE_NONE, -1 }, + { "+CFUN: 1", MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, -1 }, + { "+CFUN: 4", MM_MODEM_MODE_NONE, -1 }, + { "+CFUN: 5", MM_MODEM_MODE_2G, MBM_NETWORK_MODE_2G }, + { "+CFUN: 6", MM_MODEM_MODE_3G, MBM_NETWORK_MODE_3G }, +}; + +static void +test_cfun_query_current_modes (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_current_mode_tests); i++) { + GError *error = NULL; + gboolean success; + MMModemMode allowed = MM_MODEM_MODE_NONE; + gint mbm_mode = -1; + + success = mm_mbm_parse_cfun_query_current_modes (cfun_query_current_mode_tests[i].str, &allowed, &mbm_mode, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_current_mode_tests[i].allowed, ==, allowed); + g_assert_cmpint (cfun_query_current_mode_tests[i].mbm_mode, ==, mbm_mode); + } +} + +/*****************************************************************************/ + void _mm_log (const char *loc, const char *func, @@ -214,11 +279,12 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); - g_test_add_func ("/MM/mbm/e2ipcfg", test_e2ipcfg); - g_test_add_func ("/MM/mbm/cfun", test_cfun); + g_test_add_func ("/MM/mbm/e2ipcfg", test_e2ipcfg); + g_test_add_func ("/MM/mbm/cfun/test", test_cfun_test); + g_test_add_func ("/MM/mbm/cfun/query/power-state", test_cfun_query_power_state); + g_test_add_func ("/MM/mbm/cfun/query/current-modes", test_cfun_query_current_modes); return g_test_run (); } diff -Nru modemmanager-1.6.8/plugins/motorola/mm-plugin-motorola.c modemmanager-1.10.0/plugins/motorola/mm-plugin-motorola.c --- modemmanager-1.6.8/plugins/motorola/mm-plugin-motorola.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/motorola/mm-plugin-motorola.c 2018-11-15 09:55:53.000000000 +0100 @@ -34,14 +34,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_motorola_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_motorola_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/mtk/77-mm-mtk-port-types.rules modemmanager-1.10.0/plugins/mtk/77-mm-mtk-port-types.rules --- modemmanager-1.6.8/plugins/mtk/77-mm-mtk-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mtk/77-mm-mtk-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,7 +1,6 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_mtk_port_types_end" - +ACTION!="add|change|move|bind", GOTO="mm_mtk_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="0e8d", GOTO="mm_mtk_port_types_vendorcheck" SUBSYSTEMS=="usb", ATTRS{idVendor}=="2001", GOTO="mm_dlink_port_types_vendorcheck" SUBSYSTEMS=="usb", ATTRS{idVendor}=="07d1", GOTO="mm_dlink_port_types_vendorcheck" @@ -10,26 +9,26 @@ # MediaTek devices --------------------------- LABEL="mm_mtk_port_types_vendorcheck" -ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a1", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a1", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a1", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a1", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a1", ENV{ID_MM_MTK_TAGGED}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a2", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a2", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a2", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a2", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a2", ENV{ID_MM_MTK_TAGGED}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a4", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a4", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a4", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a4", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a4", ENV{ID_MM_MTK_TAGGED}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a5", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a5", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a5", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a5", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a5", ENV{ID_MM_MTK_TAGGED}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a7", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a7", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="00a7", ENV{ID_MM_MTK_TAGGED}="1" GOTO="mm_mtk_port_types_end" @@ -37,16 +36,16 @@ # D-Link devices --------------------------- LABEL="mm_dlink_port_types_vendorcheck" -ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # D-Link DWM-156 A3 -ATTRS{idVendor}=="07d1", ATTRS{idProduct}=="7e11", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="07d1", ATTRS{idProduct}=="7e11", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="07d1", ATTRS{idProduct}=="7e11", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="07d1", ATTRS{idProduct}=="7e11", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="07d1", ATTRS{idProduct}=="7e11", ENV{ID_MM_MTK_TAGGED}="1" # D-Link DWM-156 A5 (and later?) -ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d00", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_MTK_MODEM_PORT}="1" -ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d00", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_MTK_AT_PORT}="1" +ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d00", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d00", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d00", ENV{ID_MM_MTK_TAGGED}="1" GOTO="mm_mtk_port_types_end" diff -Nru modemmanager-1.6.8/plugins/mtk/mm-broadband-modem-mtk.c modemmanager-1.10.0/plugins/mtk/mm-broadband-modem-mtk.c --- modemmanager-1.6.8/plugins/mtk/mm-broadband-modem-mtk.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mtk/mm-broadband-modem-mtk.c 2019-01-15 15:57:35.000000000 +0100 @@ -59,15 +59,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -80,9 +78,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -103,18 +100,16 @@ MM_CORE_ERROR_FAILED, "Failed to match EPINC response: %s", response); } - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); } else if (!mm_get_int_from_match_info (match_info, 1, &pin1) || !mm_get_int_from_match_info (match_info, 2, &pin2) || !mm_get_int_from_match_info (match_info, 3, &puk1) || !mm_get_int_from_match_info (match_info, 4, &puk2)) { - g_set_error (&error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse the EPINC response: '%s'", - response); - - g_simple_async_result_take_error (operation_result, error); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse the EPINC response: '%s'", + response); } else { retries = mm_unlock_retries_new (); @@ -123,18 +118,12 @@ mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK2, puk2); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } + g_object_unref (task); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); - return; } static void @@ -148,10 +137,7 @@ 3, FALSE, (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -160,14 +146,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -176,15 +162,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* For device, 3 second is OK for SIM get ready */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -193,7 +176,7 @@ static void get_supported_modes_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; @@ -207,10 +190,9 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - mm_dbg ("Fail to get response %s", response); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + mm_dbg ("Fail to get response"); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -241,8 +223,7 @@ response); g_regex_unref (r); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); return; } @@ -293,17 +274,11 @@ * +GCAP, +WS64 not support completely, generic filter will filter * out 4G modes. */ - g_simple_async_result_set_op_res_gpointer (simple, - combinations, - (GDestroyNotify)g_array_unref); - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, combinations, (GDestroyNotify)g_array_unref); + g_object_unref (task); g_regex_unref (r); - if (match_info) - g_match_info_free (match_info); - return; + g_match_info_free (match_info); } static void @@ -311,17 +286,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - mm_base_modem_at_command ( - MM_BASE_MODEM (self), - "+EGMR=0,0", - 3, - FALSE, - (GAsyncReadyCallback)get_supported_modes_ready, - g_simple_async_result_new ( - G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+EGMR=0,0", + 3, + FALSE, + (GAsyncReadyCallback)get_supported_modes_ready, + g_task_new (self, NULL, callback, user_data)); } static GArray * @@ -329,10 +299,7 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } /*****************************************************************************/ @@ -441,8 +408,7 @@ done: if (r) g_regex_unref (r); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); return result; } @@ -468,13 +434,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemMtk *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; @@ -482,11 +448,11 @@ if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -496,15 +462,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint erat_mode = -1; gint erat_pref = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) { erat_mode = 0; @@ -542,18 +505,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error ( + task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -564,7 +525,7 @@ 30, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } @@ -652,7 +613,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable/disable unsolicited events in given port */ - for (i = 0; i < 2; i++){ + for (i = 0; i < G_N_ELEMENTS (ports); i++){ if(!ports[i]) continue; @@ -698,27 +659,25 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_MTK (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -726,33 +685,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -760,13 +712,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_MTK (self), FALSE); @@ -774,7 +719,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { @@ -792,41 +737,39 @@ static void own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); } /* Our own enable now */ mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), - unsolicited_enable_sequence, - NULL,NULL,NULL, - (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), + unsolicited_enable_sequence, + NULL,NULL,NULL, + (GAsyncReadyCallback)own_enable_unsolicited_events_ready, + task); } static void @@ -834,18 +777,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); - /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( - self, - (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + self, + (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, + g_task_new (self, NULL, callback, user_data)); } static gboolean @@ -853,44 +789,43 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Next, chain up parent's disable */ iface_modem_3gpp_parent->disable_unsolicited_events ( - MM_IFACE_MODEM_3GPP (self), - (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + MM_IFACE_MODEM_3GPP (self), + (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, + task); } static void @@ -898,21 +833,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); - /* Our own disable first */ mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), - unsolicited_disable_sequence, - NULL, NULL, NULL, - (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), + unsolicited_disable_sequence, + NULL, NULL, NULL, + (GAsyncReadyCallback)own_disable_unsolicited_events_ready, + g_task_new (self, NULL, callback, user_data)); } static gboolean @@ -920,7 +848,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/mtk/mm-plugin-mtk.c modemmanager-1.10.0/plugins/mtk/mm-plugin-mtk.c --- modemmanager-1.6.8/plugins/mtk/mm-plugin-mtk.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/mtk/mm-plugin-mtk.c 2019-01-15 15:57:35.000000000 +0100 @@ -35,56 +35,20 @@ /* MTK done */ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_mtk_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mtk_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -/* MTK done */ -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - - if (mm_port_probe_is_at (probe)) { - /* Get port type from udev */ - if (g_udev_device_get_property_as_boolean (port, "ID_MM_MTK_AT_PORT")) { - mm_dbg ("MTK: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_MTK_MODEM_PORT")) { - mm_dbg ("MTK: Modem port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - mm_port_probe_get_port_type (probe), - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -115,5 +79,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/nokia/77-mm-nokia-port-types.rules modemmanager-1.10.0/plugins/nokia/77-mm-nokia-port-types.rules --- modemmanager-1.6.8/plugins/nokia/77-mm-nokia-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/nokia/77-mm-nokia-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,40 +1,38 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_nokia_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_nokia_port_types_end" - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="0421", GOTO="mm_nokia_port_types_vendorcheck" +ACTION!="add|change|move|bind", GOTO="mm_nokia_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0421", GOTO="mm_nokia_port_types" GOTO="mm_nokia_port_types_end" -LABEL="mm_nokia_port_types_vendorcheck" +LABEL="mm_nokia_port_types" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # For Nokia Internet Sticks (CS-xx) the modem/PPP port appears to always be USB interface 1 -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="060D", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="060D", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0611", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0611", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061B", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061B", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0619", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0619", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0620", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0620", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0623", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0623", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0624", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0624", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0625", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0625", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062E", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062E", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1" +ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" LABEL="mm_nokia_port_types_end" diff -Nru modemmanager-1.6.8/plugins/nokia/mm-broadband-modem-nokia.c modemmanager-1.10.0/plugins/nokia/mm-broadband-modem-nokia.c --- modemmanager-1.6.8/plugins/nokia/mm-broadband-modem-nokia.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/nokia/mm-broadband-modem-nokia.c 2018-11-15 09:55:53.000000000 +0100 @@ -75,20 +75,6 @@ guint mask; } AccessTechInfo; -static void -access_tech_set_result (GSimpleAsyncResult *simple, - MMModemAccessTechnology act, - guint mask) -{ - AccessTechInfo *info; - - info = g_new (AccessTechInfo, 1); - info->act = act; - info->mask = mask; - - g_simple_async_result_set_op_res_gpointer (simple, info, g_free); -} - static gboolean load_access_technologies_finish (MMIfaceModem *self, GAsyncResult *res, @@ -96,40 +82,41 @@ guint *mask, GError **error) { - AccessTechInfo *info; + GError *inner_error = NULL; + gssize value; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - info = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_assert (info); - *access_technologies = info->act; - *mask = info->mask; + *access_technologies = (MMModemAccessTechnology)value; + *mask = MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK; return TRUE; } static void parent_load_access_technologies_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; guint mask = 0; GError *error = NULL; if (!iface_modem_parent->load_access_technologies_finish (self, res, &act, &mask, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - access_tech_set_result (simple, act, MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); + g_task_return_int (task, act); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void access_tech_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; const gchar *response, *p; @@ -140,7 +127,7 @@ iface_modem_parent->load_access_technologies ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_access_technologies_ready, - simple); + task); return; } @@ -150,17 +137,16 @@ act = mm_string_to_access_tech (p + 1); if (act == MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN) - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't parse access technologies result: '%s'", response); else - access_tech_set_result (simple, act, MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); + g_task_return_int (task, act); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -168,19 +154,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_access_technologies); - mm_base_modem_at_command (MM_BASE_MODEM (self), "*CNTI=0", 3, FALSE, (GAsyncReadyCallback)access_tech_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -224,72 +203,68 @@ /* Initializing the modem (during first enabling) */ typedef struct { - GSimpleAsyncResult *result; - MMBroadbandModemNokia *self; guint retries; } EnablingModemInitContext; -static void -enabling_modem_init_context_complete_and_free (EnablingModemInitContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (EnablingModemInitContext, ctx); -} - static gboolean enabling_modem_init_finish (MMBroadbandModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void retry_atz (EnablingModemInitContext *ctx); +static void retry_atz (GTask *task); static void atz_ready (MMBaseModem *self, GAsyncResult *res, - EnablingModemInitContext *ctx) + GTask *task) { + EnablingModemInitContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + /* One retry less */ ctx->retries--; if (!mm_base_modem_at_command_full_finish (self, res, &error)) { /* Consumed all retries... */ if (ctx->retries == 0) { - g_simple_async_result_take_error (ctx->result, error); - enabling_modem_init_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Retry... */ g_error_free (error); - retry_atz (ctx); + retry_atz (task); return; } /* Good! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_modem_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -retry_atz (EnablingModemInitContext *ctx) +retry_atz (GTask *task) { - mm_base_modem_at_command_full (MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)), + MMBaseModem *self; + + self = g_task_get_source_object (task); + + mm_base_modem_at_command_full (self, + mm_base_modem_peek_port_primary (self), "Z", 6, FALSE, FALSE, NULL, /* cancellable */ (GAsyncReadyCallback)atz_ready, - ctx); + task); } static void @@ -298,20 +273,20 @@ gpointer user_data) { EnablingModemInitContext *ctx; + GTask *task; - ctx = g_slice_new0 (EnablingModemInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enabling_modem_init); - ctx->self = g_object_ref (self); + ctx = g_new (EnablingModemInitContext, 1); /* Send the init command twice; some devices (Nokia N900) appear to take a * few commands before responding correctly. Instead of penalizing them for * being stupid the first time by failing to enable the device, just * try again. */ ctx->retries = 2; - retry_atz (ctx); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + retry_atz (task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/nokia/mm-plugin-nokia.c modemmanager-1.10.0/plugins/nokia/mm-plugin-nokia.c --- modemmanager-1.6.8/plugins/nokia/mm-plugin-nokia.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/nokia/mm-plugin-nokia.c 2018-11-15 09:55:53.000000000 +0100 @@ -44,14 +44,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_nokia_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_nokia_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/nokia/mm-plugin-nokia-icera.c modemmanager-1.10.0/plugins/nokia/mm-plugin-nokia-icera.c --- modemmanager-1.6.8/plugins/nokia/mm-plugin-nokia-icera.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/nokia/mm-plugin-nokia-icera.c 2019-01-15 15:57:35.000000000 +0100 @@ -43,55 +43,20 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_icera_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_icera_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - - /* Look for port type hints */ - if (mm_port_probe_is_at (probe)) { - if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM")) { - mm_dbg ("Nokia: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX")) { - mm_dbg ("Nokia: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - mm_port_probe_get_port_type (probe), - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -122,5 +87,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/novatel/mm-broadband-bearer-novatel-lte.c modemmanager-1.10.0/plugins/novatel/mm-broadband-bearer-novatel-lte.c --- modemmanager-1.6.8/plugins/novatel/mm-broadband-bearer-novatel-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-broadband-bearer-novatel-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -13,6 +13,7 @@ * Copyright (C) 2008 - 2009 Novell, Inc. * Copyright (C) 2009 - 2012 Red Hat, Inc. * Copyright (C) 2011 - 2012 Google, Inc. + * Copyright (C) 2016 Aleksander Morgado */ #include @@ -32,15 +33,11 @@ #include "mm-log.h" #include "mm-modem-helpers.h" -#define CONNECTION_CHECK_TIMEOUT_SEC 5 #define QMISTATUS_TAG "$NWQMISTATUS:" -G_DEFINE_TYPE (MMBroadbandBearerNovatelLte, mm_broadband_bearer_novatel_lte, MM_TYPE_BROADBAND_BEARER); +G_DEFINE_TYPE (MMBroadbandBearerNovatelLte, mm_broadband_bearer_novatel_lte, MM_TYPE_BROADBAND_BEARER) -struct _MMBroadbandBearerNovatelLtePrivate { - /* timeout id for checking whether we're still connected */ - guint connection_poller; -}; +/*****************************************************************************/ static gchar * normalize_qmistatus (const gchar *status) @@ -58,46 +55,6 @@ return normalized_status; } -/*****************************************************************************/ -/* 3GPP Connection sequence */ - -typedef struct { - MMBroadbandBearerNovatelLte *self; - MMBaseModem *modem; - MMPortSerialAt *primary; - MMPort *data; - GCancellable *cancellable; - GSimpleAsyncResult *result; - gint retries; -} DetailedConnectContext; - -static void -detailed_connect_context_complete_and_free (DetailedConnectContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); - if (ctx->data) - g_object_unref (ctx->data); - g_object_unref (ctx->primary); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_slice_free (DetailedConnectContext, ctx); -} - -static MMBearerConnectResult * -connect_3gpp_finish (MMBroadbandBearer *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); -} - -static gboolean connect_3gpp_qmistatus (DetailedConnectContext *ctx); - static gboolean is_qmistatus_connected (const gchar *str) { @@ -122,63 +79,121 @@ return (g_strrstr (str, "QMI_RESULT_FAILURE:QMI_ERR_CALL_FAILED") != NULL); } +/*****************************************************************************/ +/* Connection status monitoring */ + +static MMBearerConnectionStatus +load_connection_status_finish (MMBaseBearer *bearer, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + } + return (MMBearerConnectionStatus)value; +} + static void -poll_connection_ready (MMBaseModem *modem, +poll_connection_ready (MMBaseModem *modem, GAsyncResult *res, - MMBroadbandBearerNovatelLte *bearer) + GTask *task) { const gchar *result; GError *error = NULL; result = mm_base_modem_at_command_finish (modem, res, &error); - if (!result) { - mm_warn ("QMI connection status failed: %s", error->message); - g_error_free (error); - return; - } - - if (is_qmistatus_disconnected (result)) { - mm_base_bearer_report_connection_status (MM_BASE_BEARER (bearer), MM_BEARER_CONNECTION_STATUS_DISCONNECTED); - g_source_remove (bearer->priv->connection_poller); - bearer->priv->connection_poller = 0; - } + if (!result) + g_task_return_error (task, error); + else if (is_qmistatus_disconnected (result)) + g_task_return_int (task, MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + else + g_task_return_int (task, MM_BEARER_CONNECTION_STATUS_CONNECTED); + g_object_unref (task); } -static gboolean -poll_connection (MMBroadbandBearerNovatelLte *bearer) +static void +load_connection_status (MMBaseBearer *bearer, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; MMBaseModem *modem = NULL; + task = g_task_new (bearer, NULL, callback, user_data); + g_object_get (MM_BASE_BEARER (bearer), MM_BASE_BEARER_MODEM, &modem, NULL); + mm_base_modem_at_command ( modem, "$NWQMISTATUS", 3, FALSE, - (GAsyncReadyCallback)poll_connection_ready, - bearer); + (GAsyncReadyCallback) poll_connection_ready, + task); + g_object_unref (modem); +} + +/*****************************************************************************/ +/* 3GPP Connection sequence */ + +typedef struct { + MMBaseModem *modem; + MMPortSerialAt *primary; + MMPort *data; + gint retries; +} DetailedConnectContext; - return G_SOURCE_CONTINUE; +static void +detailed_connect_context_free (DetailedConnectContext *ctx) +{ + if (ctx->data) + g_object_unref (ctx->data); + g_object_unref (ctx->primary); + g_object_unref (ctx->modem); + g_slice_free (DetailedConnectContext, ctx); +} + +static MMBearerConnectResult * +connect_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); } +static gboolean connect_3gpp_qmistatus (GTask *task); + static void connect_3gpp_qmistatus_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { + DetailedConnectContext *ctx; const gchar *result; gchar *normalized_result; GError *error = NULL; + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); + return; + } + + ctx = g_task_get_task_data (task); + result = mm_base_modem_at_command_full_finish (modem, res, &error); if (!result) { mm_warn ("QMI connection status failed: %s", error->message); if (!g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN)) { - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } g_error_free (error); @@ -187,17 +202,14 @@ MMBearerIpConfig *config; mm_dbg("Connected"); - ctx->self->priv->connection_poller = g_timeout_add_seconds (CONNECTION_CHECK_TIMEOUT_SEC, - (GSourceFunc)poll_connection, - ctx->self); config = mm_bearer_ip_config_new (); mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_DHCP); - g_simple_async_result_set_op_res_gpointer ( - ctx->result, + g_task_return_pointer ( + task, mm_bearer_connect_result_new (ctx->data, config, NULL), (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); g_object_unref (config); - detailed_connect_context_complete_and_free (ctx); return; } else if (is_qmistatus_call_failed (result)) { /* Don't retry if the call failed */ @@ -206,37 +218,32 @@ mm_dbg ("Error: '%s'", result); - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - detailed_connect_context_complete_and_free (ctx); - return; - } - if (ctx->retries > 0) { ctx->retries--; mm_dbg ("Retrying status check in a second. %d retries left.", ctx->retries); - g_timeout_add_seconds (1, (GSourceFunc)connect_3gpp_qmistatus, ctx); + g_timeout_add_seconds (1, (GSourceFunc)connect_3gpp_qmistatus, task); return; } /* Already exhausted all retries */ normalized_result = normalize_qmistatus (result); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "QMI connect failed: %s", - normalized_result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "QMI connect failed: %s", + normalized_result); + g_object_unref (task); g_free (normalized_result); - detailed_connect_context_complete_and_free (ctx); } static gboolean -connect_3gpp_qmistatus (DetailedConnectContext *ctx) +connect_3gpp_qmistatus (GTask *task) { + DetailedConnectContext *ctx; + + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_full ( ctx->modem, ctx->primary, @@ -244,9 +251,9 @@ 3, /* timeout */ FALSE, /* allow_cached */ FALSE, /* is_raw */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)connect_3gpp_qmistatus_ready, /* callback */ - ctx); /* user_data */ + task); /* user_data */ return G_SOURCE_REMOVE; } @@ -254,7 +261,7 @@ static void connect_3gpp_qmiconnect_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { const gchar *result; GError *error = NULL; @@ -262,8 +269,8 @@ result = mm_base_modem_at_command_full_finish (modem, res, &error); if (!result) { mm_warn ("QMI connection failed: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -273,16 +280,21 @@ * happened. Instead, we need to poll the modem to see if it's * ready. */ - g_timeout_add_seconds (1, (GSourceFunc)connect_3gpp_qmistatus, ctx); + g_timeout_add_seconds (1, (GSourceFunc)connect_3gpp_qmistatus, task); } static void -connect_3gpp_authenticate (DetailedConnectContext *ctx) +connect_3gpp_authenticate (GTask *task) { + MMBroadbandBearerNovatelLte *self; + DetailedConnectContext *ctx; MMBearerProperties *config; gchar *command, *apn, *user, *password; - config = mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + config = mm_base_bearer_peek_config (MM_BASE_BEARER (self)); apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (config)); user = mm_port_serial_at_quote_string (mm_bearer_properties_get_user (config)); password = mm_port_serial_at_quote_string (mm_bearer_properties_get_password (config)); @@ -298,9 +310,9 @@ 10, /* timeout */ FALSE, /* allow_cached */ FALSE, /* is_raw */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)connect_3gpp_qmiconnect_ready, - ctx); /* user_data */ + task); /* user_data */ g_free (command); } @@ -314,77 +326,47 @@ gpointer user_data) { DetailedConnectContext *ctx; + GTask *task; ctx = g_slice_new0 (DetailedConnectContext); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); ctx->primary = g_object_ref (primary); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - connect_3gpp); ctx->retries = 60; + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_connect_context_free); + /* Get a 'net' data port */ ctx->data = mm_base_modem_get_best_data_port (ctx->modem, MM_PORT_TYPE_NET); if (!ctx->data) { - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_CONNECTED, "Couldn't connect: no available net port available"); - detailed_connect_context_complete_and_free (ctx); + g_object_unref (task); return; } - connect_3gpp_authenticate (ctx); + connect_3gpp_authenticate (task); } /*****************************************************************************/ /* 3GPP Disonnection sequence */ typedef struct { - MMBroadbandBearer *self; MMBaseModem *modem; MMPortSerialAt *primary; MMPort *data; - GSimpleAsyncResult *result; gint retries; } DetailedDisconnectContext; -static DetailedDisconnectContext * -detailed_disconnect_context_new (MMBroadbandBearer *self, - MMBroadbandModem *modem, - MMPortSerialAt *primary, - MMPort *data, - GAsyncReadyCallback callback, - gpointer user_data) -{ - DetailedDisconnectContext *ctx; - - ctx = g_new0 (DetailedDisconnectContext, 1); - ctx->self = g_object_ref (self); - ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); - ctx->primary = g_object_ref (primary); - ctx->data = g_object_ref (data); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - detailed_disconnect_context_new); - ctx->retries = 60; - return ctx; -} - static void -detailed_disconnect_context_complete_and_free (DetailedDisconnectContext *ctx) +detailed_disconnect_context_free (DetailedDisconnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->data); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } @@ -393,16 +375,17 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static gboolean disconnect_3gpp_qmistatus (DetailedDisconnectContext *ctx); +static gboolean disconnect_3gpp_qmistatus (GTask *task); static void disconnect_3gpp_status_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { + DetailedDisconnectContext *ctx; const gchar *result; GError *error = NULL; gboolean is_connected = FALSE; @@ -411,8 +394,8 @@ if (result) { mm_dbg ("QMI connection status: %s", result); if (is_qmistatus_disconnected (result)) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } else if (is_qmistatus_connected (result)) { is_connected = TRUE; @@ -423,11 +406,13 @@ result = "Unknown error"; } + ctx = g_task_get_task_data (task); + if (ctx->retries > 0) { ctx->retries--; mm_dbg ("Retrying status check in a second. %d retries left.", ctx->retries); - g_timeout_add_seconds (1, (GSourceFunc)disconnect_3gpp_qmistatus, ctx); + g_timeout_add_seconds (1, (GSourceFunc)disconnect_3gpp_qmistatus, task); return; } @@ -438,21 +423,25 @@ gchar *normalized_result; normalized_result = normalize_qmistatus (result); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "QMI disconnect failed: %s", - normalized_result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "QMI disconnect failed: %s", + normalized_result); g_free (normalized_result); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + g_object_unref (task); } static gboolean -disconnect_3gpp_qmistatus (DetailedDisconnectContext *ctx) +disconnect_3gpp_qmistatus (GTask *task) { + DetailedDisconnectContext *ctx; + + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_full ( ctx->modem, ctx->primary, @@ -462,7 +451,7 @@ FALSE, /* is_raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_3gpp_status_ready, - ctx); /* user_data */ + task); /* user_data */ return G_SOURCE_REMOVE; } @@ -470,7 +459,7 @@ static void disconnect_3gpp_check_status (MMBaseModem *modem, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { GError *error = NULL; @@ -480,7 +469,7 @@ g_error_free (error); } - disconnect_3gpp_qmistatus (ctx); + disconnect_3gpp_qmistatus (task); } static void @@ -494,14 +483,16 @@ gpointer user_data) { DetailedDisconnectContext *ctx; - MMBroadbandBearerNovatelLte *bearer = MM_BROADBAND_BEARER_NOVATEL_LTE (self); + GTask *task; - if (bearer->priv->connection_poller) { - g_source_remove (bearer->priv->connection_poller); - bearer->priv->connection_poller = 0; - } + ctx = g_new0 (DetailedDisconnectContext, 1); + ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); + ctx->primary = g_object_ref (primary); + ctx->data = g_object_ref (data); + ctx->retries = 60; - ctx = detailed_disconnect_context_new (self, modem, primary, data, callback, user_data); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_disconnect_context_free); mm_base_modem_at_command_full ( ctx->modem, @@ -512,7 +503,7 @@ FALSE, /* is_raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_3gpp_check_status, - ctx); /* user_data */ + task); /* user_data */ } /*****************************************************************************/ @@ -558,33 +549,16 @@ static void mm_broadband_bearer_novatel_lte_init (MMBroadbandBearerNovatelLte *self) { - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - MM_TYPE_BROADBAND_BEARER_NOVATEL_LTE, - MMBroadbandBearerNovatelLtePrivate); - - self->priv->connection_poller = 0; -} - -static void -finalize (GObject *object) -{ - MMBroadbandBearerNovatelLte *self = MM_BROADBAND_BEARER_NOVATEL_LTE (object); - - if (self->priv->connection_poller) - g_source_remove (self->priv->connection_poller); - - G_OBJECT_CLASS (mm_broadband_bearer_novatel_lte_parent_class)->finalize (object); } static void mm_broadband_bearer_novatel_lte_class_init (MMBroadbandBearerNovatelLteClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass); MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass); - g_type_class_add_private (object_class, sizeof (MMBroadbandBearerNovatelLtePrivate)); - - object_class->finalize = finalize; + base_bearer_class->load_connection_status = load_connection_status; + base_bearer_class->load_connection_status_finish = load_connection_status_finish; broadband_bearer_class->connect_3gpp = connect_3gpp; broadband_bearer_class->connect_3gpp_finish = connect_3gpp_finish; diff -Nru modemmanager-1.6.8/plugins/novatel/mm-broadband-bearer-novatel-lte.h modemmanager-1.10.0/plugins/novatel/mm-broadband-bearer-novatel-lte.h --- modemmanager-1.6.8/plugins/novatel/mm-broadband-bearer-novatel-lte.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-broadband-bearer-novatel-lte.h 2018-11-15 09:55:53.000000000 +0100 @@ -36,11 +36,9 @@ typedef struct _MMBroadbandBearerNovatelLte MMBroadbandBearerNovatelLte; typedef struct _MMBroadbandBearerNovatelLteClass MMBroadbandBearerNovatelLteClass; -typedef struct _MMBroadbandBearerNovatelLtePrivate MMBroadbandBearerNovatelLtePrivate; struct _MMBroadbandBearerNovatelLte { MMBroadbandBearer parent; - MMBroadbandBearerNovatelLtePrivate *priv; }; struct _MMBroadbandBearerNovatelLteClass { diff -Nru modemmanager-1.6.8/plugins/novatel/mm-broadband-modem-novatel.c modemmanager-1.10.0/plugins/novatel/mm-broadband-modem-novatel.c --- modemmanager-1.6.8/plugins/novatel/mm-broadband-modem-novatel.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-broadband-modem-novatel.c 2019-01-15 15:57:35.000000000 +0100 @@ -58,16 +58,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -77,9 +74,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -112,9 +108,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -126,10 +121,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -149,22 +141,23 @@ { LoadCurrentModesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - /* When a valid result is given, we never complete in idle */ - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *allowed = result->allowed; *preferred = result->preferred; + g_free (result); + return TRUE; } static void nwrat_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - LoadCurrentModesResult result; + LoadCurrentModesResult *result; GError *error = NULL; const gchar *response; GRegex *r; @@ -174,9 +167,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -186,15 +178,14 @@ if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &error)) { if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't match NWRAT reply: %s", - response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't match NWRAT reply: %s", + response); + g_object_unref (task); g_match_info_free (match_info); g_regex_unref (r); return; @@ -204,40 +195,41 @@ !mm_get_int_from_match_info (match_info, 2, &b) || a < 0 || a > 2 || b < 1 || b > 2) { - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to parse mode/tech response '%s': invalid modes reported", response); + g_object_unref (task); g_match_info_free (match_info); g_regex_unref (r); - g_simple_async_result_complete (simple); - g_object_unref (simple); return; } + result = g_new0 (LoadCurrentModesResult, 1); + switch (a) { case 0: - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_NONE; break; case 1: if (b == 1) { - result.allowed = MM_MODEM_MODE_2G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_2G; + result->preferred = MM_MODEM_MODE_NONE; } else /* b == 2 */ { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_2G; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_2G; } break; case 2: if (b == 1) { - result.allowed = MM_MODEM_MODE_3G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_3G; + result->preferred = MM_MODEM_MODE_NONE; } else /* b == 2 */ { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_3G; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_3G; } break; default: @@ -249,10 +241,8 @@ g_match_info_free (match_info); g_regex_unref (r); - /* When a valid result is given, we never complete in idle */ - g_simple_async_result_set_op_res_gpointer (simple, &result, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, result, g_free); + g_object_unref (task); } static void @@ -260,22 +250,18 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); + task = g_task_new (self, NULL, callback, user_data); /* Load allowed modes only in 3GPP modems */ if (!mm_iface_modem_is_3gpp (self)) { - g_simple_async_result_set_error ( - result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Loading allowed modes not supported in CDMA-only modems"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); return; } @@ -284,7 +270,7 @@ 3, FALSE, (GAsyncReadyCallback)nwrat_query_ready, - result); + task); } /*****************************************************************************/ @@ -295,24 +281,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemNovatel *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -322,25 +307,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint a = -1; gint b = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); /* Setting allowed modes only in 3GPP modems */ if (!mm_iface_modem_is_3gpp (self)) { - g_simple_async_result_set_error ( - result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Setting allowed modes not supported in CDMA-only modems"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); return; } @@ -370,18 +351,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -392,112 +371,88 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } /*****************************************************************************/ -/* Load access technologies (Modem interface) */ - -typedef struct { - guint hdr_revision; /* QCDM_HDR_REV_x */ - MMModemAccessTechnology generic_act; - guint mask; -} SnapshotResult; - -typedef struct { - MMBaseModem *self; - MMPortSerialQcdm *port; - GSimpleAsyncResult *simple; - MMModemAccessTechnology generic_act; - guint mask; -} SnapshotContext; static void -snapshot_result_complete (GSimpleAsyncResult *simple, - guint hdr_revision, - MMModemAccessTechnology generic_act, - guint mask) +close_and_unref_port (MMPortSerialQcdm *port) { - SnapshotResult *r; - - r = g_new0 (SnapshotResult, 1); - r->hdr_revision = hdr_revision; - r->generic_act = generic_act; - r->mask = mask; - - g_simple_async_result_set_op_res_gpointer (simple, r, g_free); - g_simple_async_result_complete (simple); + mm_port_serial_close (MM_PORT_SERIAL (port)); + g_object_unref (port); } -static void -snapshot_result_complete_simple (GSimpleAsyncResult *simple, - MMModemAccessTechnology generic_act, - guint mask) +static gboolean +get_evdo_version_finish (MMBaseModem *self, + GAsyncResult *res, + guint *hdr_revision, /* QCDM_HDR_REV_* */ + GError **error) { - snapshot_result_complete (simple, QCDM_HDR_REV_UNKNOWN, generic_act, mask); -} + gssize result; -static void -snapshot_context_complete_and_free (SnapshotContext *ctx, guint hdr_revision) -{ - snapshot_result_complete (ctx->simple, - hdr_revision, - ctx->generic_act, - ctx->mask); - g_object_unref (ctx->simple); - g_object_unref (ctx->self); - g_object_unref (ctx->port); - g_free (ctx); + result = g_task_propagate_int (G_TASK (res), error); + if (result < 0) + return FALSE; + + *hdr_revision = (guint8) result; + return TRUE; } static void -nw_snapshot_old_cb (MMPortSerialQcdm *port, - GAsyncResult *res, - SnapshotContext *ctx) +nw_snapshot_old_ready (MMPortSerialQcdm *port, + GAsyncResult *res, + GTask *task) { QcdmResult *result; - guint8 hdr_revision = QCDM_HDR_REV_UNKNOWN; GError *error = NULL; GByteArray *response; + guint8 hdr_revision = QCDM_HDR_REV_UNKNOWN; response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { /* Just ignore the error and complete with the input info */ mm_dbg ("Couldn't run QCDM Novatel Modem MSM6500 snapshot: '%s'", error->message); - g_error_free (error); - snapshot_context_complete_and_free (ctx, QCDM_HDR_REV_UNKNOWN); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Parse the response */ result = qcdm_cmd_nw_subsys_modem_snapshot_cdma_result ((const gchar *) response->data, response->len, NULL); g_byte_array_unref (response); - if (result) { - qcdm_result_get_u8 (result, QCDM_CMD_NW_SUBSYS_MODEM_SNAPSHOT_CDMA_ITEM_HDR_REV, &hdr_revision); - qcdm_result_unref (result); - } else - mm_dbg ("Failed to get QCDM Novatel Modem MSM6500 snapshot."); + if (!result) { + mm_dbg ("Failed to get QCDM Novatel Modem MSM6500 snapshot: %s", error->message); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Success */ + qcdm_result_get_u8 (result, QCDM_CMD_NW_SUBSYS_MODEM_SNAPSHOT_CDMA_ITEM_HDR_REV, &hdr_revision); + qcdm_result_unref (result); - snapshot_context_complete_and_free (ctx, hdr_revision); + g_task_return_int (task, (gint) hdr_revision); + g_object_unref (task); } static void -nw_snapshot_new_cb (MMPortSerialQcdm *port, - GAsyncResult *res, - SnapshotContext *ctx) +nw_snapshot_new_ready (MMPortSerialQcdm *port, + GAsyncResult *res, + GTask *task) { QcdmResult *result; GByteArray *nwsnap; - guint8 hdr_revision = QCDM_HDR_REV_UNKNOWN; GError *error = NULL; GByteArray *response; + guint8 hdr_revision = QCDM_HDR_REV_UNKNOWN; response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { mm_dbg ("Couldn't run QCDM Novatel Modem MSM6800 snapshot: '%s'", error->message); - g_error_free (error); - snapshot_context_complete_and_free (ctx, QCDM_HDR_REV_UNKNOWN); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -505,9 +460,12 @@ result = qcdm_cmd_nw_subsys_modem_snapshot_cdma_result ((const gchar *) response->data, response->len, NULL); g_byte_array_unref (response); if (result) { + /* Success */ qcdm_result_get_u8 (result, QCDM_CMD_NW_SUBSYS_MODEM_SNAPSHOT_CDMA_ITEM_HDR_REV, &hdr_revision); qcdm_result_unref (result); - snapshot_context_complete_and_free (ctx, hdr_revision); + + g_task_return_int (task, (gint) hdr_revision); + g_object_unref (task); return; } @@ -521,32 +479,40 @@ nwsnap, 3, NULL, - (GAsyncReadyCallback)nw_snapshot_old_cb, - ctx); + (GAsyncReadyCallback)nw_snapshot_old_ready, + task); g_byte_array_unref (nwsnap); } -static gboolean -get_nw_modem_snapshot (MMBaseModem *self, - GSimpleAsyncResult *simple, - MMModemAccessTechnology generic_act, - guint mask) +static void +get_evdo_version (MMBaseModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - SnapshotContext *ctx; + GError *error = NULL; GByteArray *nwsnap; + GTask *task; MMPortSerialQcdm *port; - port = mm_base_modem_peek_port_qcdm (self); - if (!port) - return FALSE; + task = g_task_new (self, NULL, callback, user_data); - /* Setup context */ - ctx = g_new0 (SnapshotContext, 1); - ctx->self = g_object_ref (self); - ctx->port = g_object_ref (port); - ctx->simple = simple; - ctx->generic_act = generic_act; - ctx->mask = mask; + port = mm_base_modem_get_port_qcdm (self); + if (!port) { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "No available QCDM port."); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + g_task_set_task_data (task, port, (GDestroyNotify) close_and_unref_port); + + if (!mm_port_serial_open (MM_PORT_SERIAL (port), &error)) { + g_prefix_error (&error, "Couldn't open QCDM port: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } /* Try MSM6800 first since newer cards use that */ nwsnap = g_byte_array_sized_new (25); @@ -556,12 +522,20 @@ nwsnap, 3, NULL, - (GAsyncReadyCallback)nw_snapshot_new_cb, - ctx); + (GAsyncReadyCallback)nw_snapshot_new_ready, + task); g_byte_array_unref (nwsnap); - return TRUE; } +/*****************************************************************************/ +/* Load access technologies (Modem interface) */ + +typedef struct { + MMModemAccessTechnology act; + guint mask; + guint hdr_revision; /* QCDM_HDR_REV_* */ +} AccessTechContext; + static gboolean modem_load_access_technologies_finish (MMIfaceModem *self, GAsyncResult *res, @@ -569,48 +543,45 @@ guint *mask, GError **error) { - SnapshotResult *r; - MMModemAccessTechnology act; + GTask *task = G_TASK (res); + AccessTechContext *ctx = g_task_get_task_data (task); - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + if (!g_task_propagate_boolean (task, error)) return FALSE; - r = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - act = r->generic_act; - if (act & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK) { - /* Update access technology with specific EVDO revision from QCDM */ - if (r->hdr_revision == QCDM_HDR_REV_0) { + /* Update access technology with specific EVDO revision from QCDM if we have them */ + if (ctx->act & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK) { + if (ctx->hdr_revision == QCDM_HDR_REV_0) { mm_dbg ("Novatel Modem Snapshot EVDO revision: 0"); - act &= ~MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK; - act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDO0; - } else if (r->hdr_revision == QCDM_HDR_REV_A) { + ctx->act &= ~MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK; + ctx->act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDO0; + } else if (ctx->hdr_revision == QCDM_HDR_REV_A) { mm_dbg ("Novatel Modem Snapshot EVDO revision: A"); - act &= ~MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK; - act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDOA; + ctx->act &= ~MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK; + ctx->act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDOA; } else - mm_dbg ("Novatel Modem Snapshot EVDO revision: %d (unknown)", r->hdr_revision); + mm_dbg ("Novatel Modem Snapshot EVDO revision: %d (unknown)", ctx->hdr_revision); } - *access_technologies = act; - *mask = r->mask; + *access_technologies = ctx->act; + *mask = ctx->mask; return TRUE; } static void cnti_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + AccessTechContext *ctx = g_task_get_task_data (task); GError *error = NULL; const gchar *response; const gchar *p; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -621,55 +592,64 @@ MM_CORE_ERROR_FAILED, "Couldn't parse $CNTI result '%s'", response); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - snapshot_result_complete_simple (simple, - mm_string_to_access_tech (p), - MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); - g_object_unref (simple); + ctx->act = mm_string_to_access_tech (p); + ctx->mask = MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK; + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +evdo_version_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + AccessTechContext *ctx = g_task_get_task_data (task); + + if (!get_evdo_version_finish (self, res, &ctx->hdr_revision, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void parent_load_access_technologies_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; - guint mask = 0; GError *error = NULL; + AccessTechContext *ctx = g_task_get_task_data (task); if (!iface_modem_parent->load_access_technologies_finish (self, res, - &act, - &mask, + &ctx->act, + &ctx->mask, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - /* No point in checking EVDO revision if EVDO isn't being used or if for - * some reason we don't have a QCDM port. - */ - if (!(act & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK)) { - snapshot_result_complete (simple, QCDM_HDR_REV_UNKNOWN, act, mask); - g_object_unref (simple); + /* No point in checking EVDO revision if EVDO isn't being used */ + if (!(ctx->act & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK)) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - /* Pass along the access tech & mask that the parent determined so we - * can specialize it based on the EVDO revision from QCDM. - */ - if (!get_nw_modem_snapshot (MM_BASE_MODEM (self), simple, act, mask)) { - /* If there's any error, use the access tech that the parent interface determined */ - snapshot_result_complete (simple, QCDM_HDR_REV_UNKNOWN, act, mask); - g_object_unref (simple); - } + /* Get the EVDO revision from QCDM */ + get_evdo_version (MM_BASE_MODEM (self), + (GAsyncReadyCallback) evdo_version_ready, + task); } static void @@ -677,12 +657,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + AccessTechContext *ctx; + GTask *task; + + /* Setup context */ + task = g_task_new (self, NULL, callback, user_data); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_access_technologies); + ctx = g_new0 (AccessTechContext, 1); + g_task_set_task_data (task, ctx, g_free); /* CDMA-only modems defer to parent for generic access technology * checking, but can determine EVDOr0 vs. EVDOrA through proprietary @@ -692,7 +674,7 @@ iface_modem_parent->load_access_technologies ( self, (GAsyncReadyCallback)parent_load_access_technologies_ready, - result); + task); return; } @@ -702,7 +684,7 @@ 3, FALSE, (GAsyncReadyCallback)cnti_set_ready, - result); + task); } /*****************************************************************************/ @@ -713,30 +695,31 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return 0; + GError *inner_error = NULL; + gssize value; - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return 0; + } + return (guint)value; } static void parent_load_signal_quality_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; guint signal_quality; signal_quality = iface_modem_parent->load_signal_quality_finish (self, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (signal_quality), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, signal_quality); + g_object_unref (task); } static gint @@ -776,7 +759,7 @@ /* Some cards appear to use RX0/RX1 and output RSSI in negative dBm */ if (dbm < 0) success = TRUE; - } else if (isdigit (*temp) && (dbm > 0) && (dbm < 115)) { + } else if (isdigit (*temp) && (dbm > 0) && (dbm <= 125)) { /* S720 appears to use "1x RSSI" and print RSSI in dBm without '-' */ dbm *= -1; success = TRUE; @@ -795,7 +778,7 @@ static void nwrssi_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; gint quality; @@ -806,7 +789,7 @@ iface_modem_parent->load_signal_quality ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_signal_quality_ready, - simple); + task); return; } @@ -820,17 +803,14 @@ quality = get_one_quality (response, "HDR RSSI="); if (quality >= 0) - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER ((guint)quality), - NULL); + g_task_return_int (task, quality); else - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse $NWRSSI response: '%s'", - response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse $NWRSSI response: '%s'", + response); + g_object_unref (task); } static void @@ -838,20 +818,17 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; mm_dbg ("loading signal quality..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_signal_quality); + task = g_task_new (self, NULL, callback, user_data); /* 3GPP modems can just run parent's signal quality loading */ if (mm_iface_modem_is_3gpp (self)) { iface_modem_parent->load_signal_quality ( self, (GAsyncReadyCallback)parent_load_signal_quality_ready, - result); + task); return; } @@ -862,7 +839,7 @@ 3, FALSE, (GAsyncReadyCallback)nwrssi_ready, - result); + task); } /*****************************************************************************/ @@ -894,23 +871,25 @@ /* Detailed registration state (CDMA interface) */ typedef struct { - MMModemCdmaRegistrationState detailed_cdma1x_state; - MMModemCdmaRegistrationState detailed_evdo_state; -} DetailedRegistrationStateResults; + MMModemCdmaRegistrationState cdma1x_state; + MMModemCdmaRegistrationState evdo_state; +} DetailedRegistrationStateResult; typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - DetailedRegistrationStateResults state; + MMPortSerialQcdm *port; + gboolean close_port; + MMModemCdmaRegistrationState cdma1x_state; + MMModemCdmaRegistrationState evdo_state; } DetailedRegistrationStateContext; static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) +detailed_registration_state_context_free (DetailedRegistrationStateContext *ctx) { - /* Always not in idle! we're passing a struct in stack as result */ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); + if (ctx->port) { + if (ctx->close_port) + mm_port_serial_close (MM_PORT_SERIAL (ctx->port)); + g_object_unref (ctx->port); + } g_free (ctx); } @@ -921,14 +900,14 @@ MMModemCdmaRegistrationState *detailed_evdo_state, GError **error) { - DetailedRegistrationStateResults *results; + GTask *task = G_TASK (res); + DetailedRegistrationStateContext *ctx = g_task_get_task_data (task);; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + if (!g_task_propagate_boolean (task, error)) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *detailed_cdma1x_state = results->detailed_cdma1x_state; - *detailed_evdo_state = results->detailed_evdo_state; + *detailed_cdma1x_state = ctx->cdma1x_state; + *detailed_evdo_state = ctx->evdo_state; return TRUE; } @@ -980,84 +959,86 @@ else new_state = MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING; - if (ctx->state.detailed_cdma1x_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) - ctx->state.detailed_cdma1x_state = new_state; - if (ctx->state.detailed_evdo_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) - ctx->state.detailed_evdo_state = new_state; + if (ctx->cdma1x_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) + ctx->cdma1x_state = new_state; + if (ctx->evdo_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) + ctx->evdo_state = new_state; } static void reg_eri_6500_cb (MMPortSerialQcdm *port, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateContext *ctx = g_task_get_task_data (task); GError *error = NULL; GByteArray *response; + QcdmResult *result; response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { /* Just ignore the error and complete with the input info */ mm_dbg ("Couldn't run QCDM MSM6500 ERI: '%s'", error->message); g_error_free (error); - } else { - QcdmResult *result; + goto done; + } - result = qcdm_cmd_nw_subsys_eri_result ((const gchar *) response->data, response->len, NULL); - g_byte_array_unref (response); - if (result) { - parse_modem_eri (ctx, result); - qcdm_result_unref (result); - } + result = qcdm_cmd_nw_subsys_eri_result ((const gchar *) response->data, response->len, NULL); + g_byte_array_unref (response); + if (result) { + parse_modem_eri (ctx, result); + qcdm_result_unref (result); } - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); +done: + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void reg_eri_6800_cb (MMPortSerialQcdm *port, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateContext *ctx = g_task_get_task_data (task); GError *error = NULL; GByteArray *response; + GByteArray *nweri; + QcdmResult *result; response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { /* Just ignore the error and complete with the input info */ mm_dbg ("Couldn't run QCDM MSM6800 ERI: '%s'", error->message); g_error_free (error); - } else { - QcdmResult *result; - - /* Parse the response */ - result = qcdm_cmd_nw_subsys_eri_result ((const gchar *) response->data, response->len, NULL); - g_byte_array_unref (response); - if (result) { - parse_modem_eri (ctx, result); - qcdm_result_unref (result); - } else { - GByteArray *nweri; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } - /* Try for MSM6500 */ - nweri = g_byte_array_sized_new (25); - nweri->len = qcdm_cmd_nw_subsys_eri_new ((char *) nweri->data, 25, QCDM_NW_CHIPSET_6500); - g_assert (nweri->len); - mm_port_serial_qcdm_command (port, - nweri, - 3, - NULL, - (GAsyncReadyCallback)reg_eri_6500_cb, - ctx); - g_byte_array_unref (nweri); - return; - } + /* Parse the response */ + result = qcdm_cmd_nw_subsys_eri_result ((const gchar *) response->data, response->len, NULL); + g_byte_array_unref (response); + if (result) { + /* Success */ + parse_modem_eri (ctx, result); + qcdm_result_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; } - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); + /* Try for MSM6500 */ + nweri = g_byte_array_sized_new (25); + nweri->len = qcdm_cmd_nw_subsys_eri_new ((char *) nweri->data, 25, QCDM_NW_CHIPSET_6500); + g_assert (nweri->len); + mm_port_serial_qcdm_command (port, + nweri, + 3, + NULL, + (GAsyncReadyCallback)reg_eri_6500_cb, + task); + g_byte_array_unref (nweri); } static void @@ -1068,31 +1049,48 @@ gpointer user_data) { DetailedRegistrationStateContext *ctx; + GTask *task; GByteArray *nweri; - MMPortSerialQcdm *port; + GError *error = NULL; /* Setup context */ + task = g_task_new (self, NULL, callback, user_data); ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_detailed_registration_state); - ctx->state.detailed_cdma1x_state = cdma1x_state; - ctx->state.detailed_evdo_state = evdo_state; + g_task_set_task_data (task, ctx, (GDestroyNotify) detailed_registration_state_context_free); - port = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); + ctx->cdma1x_state = cdma1x_state; + ctx->evdo_state = evdo_state; + + ctx->port = mm_base_modem_get_port_qcdm (MM_BASE_MODEM (self)); + if (!ctx->port) { + /* Ignore errors and use non-detailed registration state */ + mm_dbg ("No available QCDM port."); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + if (!mm_port_serial_open (MM_PORT_SERIAL (ctx->port), &error)) { + /* Ignore errors and use non-detailed registration state */ + mm_dbg ("Couldn't open QCDM port: %s", error->message); + g_error_free (error); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx->close_port = TRUE; /* Try MSM6800 first since newer cards use that */ nweri = g_byte_array_sized_new (25); nweri->len = qcdm_cmd_nw_subsys_eri_new ((char *) nweri->data, 25, QCDM_NW_CHIPSET_6800); g_assert (nweri->len); - mm_port_serial_qcdm_command (port, + mm_port_serial_qcdm_command (ctx->port, nweri, 3, NULL, (GAsyncReadyCallback)reg_eri_6800_cb, - ctx); + task); g_byte_array_unref (nweri); } @@ -1160,8 +1158,7 @@ else g_free (result); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return success; } diff -Nru modemmanager-1.6.8/plugins/novatel/mm-broadband-modem-novatel-lte.c modemmanager-1.10.0/plugins/novatel/mm-broadband-modem-novatel-lte.c --- modemmanager-1.6.8/plugins/novatel/mm-broadband-modem-novatel-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-broadband-modem-novatel-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -74,33 +74,23 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_novatel_lte_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } static void @@ -109,20 +99,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - /* Set a new ref to the bearer object as result */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); - /* We just create a MMBroadbandBearer */ mm_broadband_bearer_novatel_lte_new (MM_BROADBAND_MODEM_NOVATEL_LTE (self), properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -156,14 +138,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -172,16 +154,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* A 3-second wait is necessary for SIM to become ready. * Otherwise, a subsequent AT+CRSM command will likely fail. */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -223,7 +202,7 @@ return FALSE; } - own_numbers = mm_3gpp_parse_cnum_exec_response (response, result_error); + own_numbers = mm_3gpp_parse_cnum_exec_response (response); if (!own_numbers) return FALSE; @@ -293,38 +272,38 @@ * The bit positions and band names on the right come from the response to $NWBAND=? */ static MMModemBand bandbits[] = { - MM_MODEM_BAND_CDMA_BC0_CELLULAR_800, /* "00 CDMA2000 Band Class 0, A-System" */ - MM_MODEM_BAND_CDMA_BC0_CELLULAR_800, /* "01 CDMA2000 Band Class 0, B-System" */ - MM_MODEM_BAND_CDMA_BC1_PCS_1900, /* "02 CDMA2000 Band Class 1, all blocks" */ - MM_MODEM_BAND_CDMA_BC2_TACS, /* "03 CDMA2000 Band Class 2, place holder" */ - MM_MODEM_BAND_CDMA_BC3_JTACS, /* "04 CDMA2000 Band Class 3, A-System" */ - MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS, /* "05 CDMA2000 Band Class 4, all blocks" */ - MM_MODEM_BAND_CDMA_BC5_NMT450, /* "06 CDMA2000 Band Class 5, all blocks" */ - MM_MODEM_BAND_DCS, /* "07 GSM DCS band" */ - MM_MODEM_BAND_EGSM, /* "08 GSM Extended GSM (E-GSM) band" */ - MM_MODEM_BAND_UNKNOWN, /* "09 GSM Primary GSM (P-GSM) band" */ - MM_MODEM_BAND_CDMA_BC6_IMT2000, /* "10 CDMA2000 Band Class 6" */ - MM_MODEM_BAND_CDMA_BC7_CELLULAR_700, /* "11 CDMA2000 Band Class 7" */ - MM_MODEM_BAND_CDMA_BC8_1800, /* "12 CDMA2000 Band Class 8" */ - MM_MODEM_BAND_CDMA_BC9_900, /* "13 CDMA2000 Band Class 9" */ - MM_MODEM_BAND_CDMA_BC10_SECONDARY_800, /* "14 CDMA2000 Band Class 10 */ - MM_MODEM_BAND_CDMA_BC11_PAMR_400, /* "15 CDMA2000 Band Class 11 */ - MM_MODEM_BAND_UNKNOWN, /* "16 GSM 450 band" */ - MM_MODEM_BAND_UNKNOWN, /* "17 GSM 480 band" */ - MM_MODEM_BAND_UNKNOWN, /* "18 GSM 750 band" */ - MM_MODEM_BAND_G850, /* "19 GSM 850 band" */ - MM_MODEM_BAND_UNKNOWN, /* "20 GSM band" */ - MM_MODEM_BAND_PCS, /* "21 GSM PCS band" */ - MM_MODEM_BAND_U2100, /* "22 WCDMA I IMT 2000 band" */ - MM_MODEM_BAND_U1900, /* "23 WCDMA II PCS band" */ - MM_MODEM_BAND_U1800, /* "24 WCDMA III 1700 band" */ - MM_MODEM_BAND_U17IV, /* "25 WCDMA IV 1700 band" */ - MM_MODEM_BAND_U850, /* "26 WCDMA V US850 band" */ - MM_MODEM_BAND_U800, /* "27 WCDMA VI JAPAN 800 band" */ - MM_MODEM_BAND_UNKNOWN, /* "28 Reserved for BC12/BC14 */ - MM_MODEM_BAND_UNKNOWN, /* "29 Reserved for BC12/BC14 */ - MM_MODEM_BAND_UNKNOWN, /* "30 Reserved" */ - MM_MODEM_BAND_UNKNOWN, /* "31 Reserved" */ + MM_MODEM_BAND_CDMA_BC0, /* "00 CDMA2000 Band Class 0, A-System" */ + MM_MODEM_BAND_CDMA_BC0, /* "01 CDMA2000 Band Class 0, B-System" */ + MM_MODEM_BAND_CDMA_BC1, /* "02 CDMA2000 Band Class 1, all blocks" */ + MM_MODEM_BAND_CDMA_BC2, /* "03 CDMA2000 Band Class 2, place holder" */ + MM_MODEM_BAND_CDMA_BC3, /* "04 CDMA2000 Band Class 3, A-System" */ + MM_MODEM_BAND_CDMA_BC4, /* "05 CDMA2000 Band Class 4, all blocks" */ + MM_MODEM_BAND_CDMA_BC5, /* "06 CDMA2000 Band Class 5, all blocks" */ + MM_MODEM_BAND_DCS, /* "07 GSM DCS band" */ + MM_MODEM_BAND_EGSM, /* "08 GSM Extended GSM (E-GSM) band" */ + MM_MODEM_BAND_UNKNOWN, /* "09 GSM Primary GSM (P-GSM) band" */ + MM_MODEM_BAND_CDMA_BC6, /* "10 CDMA2000 Band Class 6" */ + MM_MODEM_BAND_CDMA_BC7, /* "11 CDMA2000 Band Class 7" */ + MM_MODEM_BAND_CDMA_BC8, /* "12 CDMA2000 Band Class 8" */ + MM_MODEM_BAND_CDMA_BC9, /* "13 CDMA2000 Band Class 9" */ + MM_MODEM_BAND_CDMA_BC10, /* "14 CDMA2000 Band Class 10 */ + MM_MODEM_BAND_CDMA_BC11, /* "15 CDMA2000 Band Class 11 */ + MM_MODEM_BAND_G450, /* "16 GSM 450 band" */ + MM_MODEM_BAND_G480, /* "17 GSM 480 band" */ + MM_MODEM_BAND_G750, /* "18 GSM 750 band" */ + MM_MODEM_BAND_G850, /* "19 GSM 850 band" */ + MM_MODEM_BAND_UNKNOWN, /* "20 GSM 900 Railways band" */ + MM_MODEM_BAND_PCS, /* "21 GSM PCS band" */ + MM_MODEM_BAND_UTRAN_1, /* "22 WCDMA I IMT 2000 band" */ + MM_MODEM_BAND_UTRAN_2, /* "23 WCDMA II PCS band" */ + MM_MODEM_BAND_UTRAN_3, /* "24 WCDMA III 1700 band" */ + MM_MODEM_BAND_UTRAN_4, /* "25 WCDMA IV 1700 band" */ + MM_MODEM_BAND_UTRAN_5, /* "26 WCDMA V US850 band" */ + MM_MODEM_BAND_UTRAN_6, /* "27 WCDMA VI JAPAN 800 band" */ + MM_MODEM_BAND_UNKNOWN, /* "28 Reserved for BC12/BC14 */ + MM_MODEM_BAND_UNKNOWN, /* "29 Reserved for BC12/BC14 */ + MM_MODEM_BAND_UNKNOWN, /* "30 Reserved" */ + MM_MODEM_BAND_UNKNOWN, /* "31 Reserved" */ }; static GArray * @@ -332,9 +311,7 @@ GAsyncResult *res, GError **error) { - /* Never fails */ - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -342,14 +319,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GArray *bands; guint i; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_bands); + task = g_task_new (self, NULL, callback, user_data); /* * The modem doesn't support telling us what bands are supported; @@ -361,11 +335,8 @@ g_array_append_val(bands, bandbits[i]); } - g_simple_async_result_set_op_res_gpointer (result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -376,17 +347,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_current_bands_done (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GArray *bands; const gchar *response; @@ -397,9 +364,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query supported bands: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -415,11 +381,8 @@ g_array_append_val(bands, bandbits[i]); } - g_simple_async_result_set_op_res_gpointer (operation_result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); + g_object_unref (task); } static void @@ -427,20 +390,76 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_bands); - mm_base_modem_at_command ( MM_BASE_MODEM (self), "$NWBAND?", 3, FALSE, (GAsyncReadyCallback)load_current_bands_done, - result); + g_task_new (self, NULL, callback, user_data)); +} + +/*****************************************************************************/ +/* Load unlock retries (Modem interface) */ + +static MMUnlockRetries * +load_unlock_retries_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_unlock_retries_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + gint pin_num, pin_value; + int scan_count; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + if (!response) { + mm_dbg ("Couldn't query unlock retries: '%s'", error->message); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + response = mm_strip_tag (response, "$NWPINR:"); + + scan_count = sscanf (response, "PIN%d, %d", &pin_num, &pin_value); + if (scan_count != 2 || (pin_num != 1 && pin_num != 2)) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); + } else { + MMUnlockRetries *retries; + + retries = mm_unlock_retries_new (); + mm_unlock_retries_set (retries, + pin_num == 1 ? MM_MODEM_LOCK_SIM_PIN : MM_MODEM_LOCK_SIM_PIN2, + pin_value); + g_task_return_pointer (task, retries, g_object_unref); + } + g_object_unref (task); +} + +static void +load_unlock_retries (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "$NWPINR?", + 20, + FALSE, + (GAsyncReadyCallback)load_unlock_retries_ready, + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -453,12 +472,16 @@ guint *mask, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - *access_technologies = (MMModemAccessTechnology) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + *access_technologies = (MMModemAccessTechnology) value; *mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; return TRUE; } @@ -466,7 +489,7 @@ static void load_access_technologies_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; MMModemAccessTechnology act; @@ -475,9 +498,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query access technology: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -495,11 +517,8 @@ if (strstr (response, "GSM")) act |= MM_MODEM_ACCESS_TECHNOLOGY_GSM; - g_simple_async_result_set_op_res_gpointer (operation_result, - GUINT_TO_POINTER (act), - NULL); - g_simple_async_result_complete_in_idle (operation_result); - g_object_unref (operation_result); + g_task_return_int (task, act); + g_object_unref (task); } static void @@ -507,20 +526,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_access_technologies); - mm_base_modem_at_command ( MM_BASE_MODEM (self), "$NWSYSMODE", 3, FALSE, (GAsyncReadyCallback)load_access_technologies_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -555,16 +567,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void cops_query_ready (MMBroadbandModemNovatelLte *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -572,25 +581,22 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } scan_result = mm_3gpp_parse_cops_test_response (response, &error); if (error) { - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gpointer (operation_result, - scan_result, - NULL); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, + scan_result, + (GDestroyNotify)mm_3gpp_network_info_list_free); + g_object_unref (task); } static void @@ -598,15 +604,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; MMModemAccessTechnology access_tech; mm_dbg ("scanning for networks (Novatel LTE)..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - scan_networks); + task = g_task_new (self, NULL, callback, user_data); access_tech = mm_iface_modem_get_access_technologies (MM_IFACE_MODEM (self)); /* The Novatel LTE modem does not properly support AT+COPS=? in LTE mode. @@ -618,13 +621,12 @@ access_tech_string = mm_modem_access_technology_build_string_from_mask (access_tech); mm_warn ("Couldn't scan for networks with access technologies: %s", access_tech_string); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Couldn't scan for networks with access technologies: %s", - access_tech_string); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Couldn't scan for networks with access technologies: %s", + access_tech_string); + g_object_unref (task); g_free (access_tech_string); return; } @@ -634,7 +636,7 @@ 300, FALSE, (GAsyncReadyCallback)cops_query_ready, - result); + task); } /*****************************************************************************/ @@ -677,6 +679,8 @@ iface->load_supported_bands_finish = load_supported_bands_finish; iface->load_current_bands = load_current_bands; iface->load_current_bands_finish = load_current_bands_finish; + iface->load_unlock_retries = load_unlock_retries; + iface->load_unlock_retries_finish = load_unlock_retries_finish; /* No support for setting bands, as it destabilizes the modem. */ iface->load_access_technologies = load_access_technologies; iface->load_access_technologies_finish = load_access_technologies_finish; diff -Nru modemmanager-1.6.8/plugins/novatel/mm-common-novatel.c modemmanager-1.10.0/plugins/novatel/mm-common-novatel.c --- modemmanager-1.6.8/plugins/novatel/mm-common-novatel.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-common-novatel.c 2018-11-15 09:55:53.000000000 +0100 @@ -20,24 +20,15 @@ /* Custom init */ typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; guint nwdmat_retries; guint wait_time; } CustomInitContext; static void -custom_init_context_complete_and_free (CustomInitContext *ctx) +custom_init_context_free (CustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (CustomInitContext, ctx); } @@ -46,25 +37,24 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void custom_init_step (CustomInitContext *ctx); +static void custom_init_step (GTask *task); static void nwdmat_ready (MMPortSerialAt *port, GAsyncResult *res, - CustomInitContext *ctx) + GTask* task) { - const gchar *response; GError *error = NULL; - response = mm_port_serial_at_command_finish (port, res, &error); + mm_port_serial_at_command_finish (port, res, &error); if (error) { if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - custom_init_step (ctx); + custom_init_step (task); goto out; } @@ -72,8 +62,8 @@ } /* Finish custom_init */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); out: if (error) @@ -81,36 +71,42 @@ } static gboolean -custom_init_wait_cb (CustomInitContext *ctx) +custom_init_wait_cb (GTask *task) { - custom_init_step (ctx); + custom_init_step (task); return G_SOURCE_REMOVE; } static void -custom_init_step (CustomInitContext *ctx) +custom_init_step (GTask *task) { + CustomInitContext *ctx; + MMPortProbe *probe; + + ctx = g_task_get_task_data (task); + /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_task_return_error_if_cancelled (task)) { mm_dbg ("(Novatel) no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_object_unref (task); return; } + probe = g_task_get_source_object (task); + /* If device has a QMI port, don't run $NWDMAT */ - if (mm_port_probe_list_has_qmi_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (ctx->probe)))) { + if (mm_port_probe_list_has_qmi_port (mm_device_peek_port_probe_list (mm_port_probe_peek_device (probe)))) { mm_dbg ("(Novatel) no need to run custom init in (%s): device has QMI port", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } if (ctx->wait_time > 0) { ctx->wait_time--; - g_timeout_add_seconds (1, (GSourceFunc)custom_init_wait_cb, ctx); + g_timeout_add_seconds (1, (GSourceFunc)custom_init_wait_cb, task); return; } @@ -121,17 +117,17 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)nwdmat_ready, - ctx); + task); return; } /* Finish custom_init */ mm_dbg ("(Novatel) couldn't flip secondary port to AT in (%s): all retries consumed", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -142,17 +138,15 @@ gpointer user_data) { CustomInitContext *ctx; + GTask *task; ctx = g_slice_new (CustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - mm_common_novatel_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->nwdmat_retries = 3; ctx->wait_time = 2; - custom_init_step (ctx); + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)custom_init_context_free); + + custom_init_step (task); } diff -Nru modemmanager-1.6.8/plugins/novatel/mm-plugin-novatel.c modemmanager-1.10.0/plugins/novatel/mm-plugin-novatel.c --- modemmanager-1.6.8/plugins/novatel/mm-plugin-novatel.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-plugin-novatel.c 2018-11-15 09:55:53.000000000 +0100 @@ -46,7 +46,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -56,7 +56,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Novatel modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -64,7 +64,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_novatel_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/novatel/mm-plugin-novatel-lte.c modemmanager-1.10.0/plugins/novatel/mm-plugin-novatel-lte.c --- modemmanager-1.6.8/plugins/novatel/mm-plugin-novatel-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-plugin-novatel-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -35,14 +35,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_novatel_lte_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_novatel_lte_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/novatel/mm-sim-novatel-lte.c modemmanager-1.10.0/plugins/novatel/mm-sim-novatel-lte.c --- modemmanager-1.6.8/plugins/novatel/mm-sim-novatel-lte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/novatel/mm-sim-novatel-lte.c 2018-11-15 09:55:53.000000000 +0100 @@ -39,20 +39,13 @@ GAsyncResult *res, GError **error) { - gchar *imsi; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - imsi = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("loaded IMSI: %s", imsi); - return g_strdup (imsi); + return g_task_propagate_pointer (G_TASK (res), error); } static void imsi_read_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response, *str; @@ -64,9 +57,8 @@ response = mm_base_modem_at_command_finish (modem, res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -76,13 +68,12 @@ /* With or without quotes... */ if (sscanf (str, "%d,%d,\"%18c\"", &sw1, &sw2, (char *) &buf) != 3 && sscanf (str, "%d,%d,%18c", &sw1, &sw2, (char *) &buf) != 3) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse the CRSM response: '%s'", - response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse the CRSM response: '%s'", + response); + g_object_unref (task); return; } @@ -90,13 +81,12 @@ (sw1 != 0x91) && (sw1 != 0x92) && (sw1 != 0x9f)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "SIM failed to handle CRSM request (sw1 %d sw2 %d)", - sw1, sw2); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "SIM failed to handle CRSM request (sw1 %d sw2 %d)", + sw1, sw2); + g_object_unref (task); return; } @@ -114,25 +104,23 @@ } /* Invalid character */ - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "CRSM IMSI response contained invalid character '%c'", - buf[len]); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "CRSM IMSI response contained invalid character '%c'", + buf[len]); + g_object_unref (task); return; } /* BCD encoded IMSIs plus the length byte and parity are 18 digits long */ if (len != 18) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid +CRSM IMSI response size (was %zd, expected 18)", - len); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid +CRSM IMSI response size (was %zd, expected 18)", + len); + g_object_unref (task); return; } @@ -160,19 +148,17 @@ /* Ensure all 'F's, if any, are at the end */ for (; i < 15; i++) { if (imsi[i] != 'F') { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid +CRSM IMSI length (unexpected F)"); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid +CRSM IMSI length (unexpected F)"); + g_object_unref (task); return; } } - g_simple_async_result_set_op_res_gpointer (simple, imsi, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, g_strdup (imsi), g_free); + g_object_unref (task); } static void @@ -193,10 +179,7 @@ 3, FALSE, (GAsyncReadyCallback)imsi_read_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_imsi)); + g_task_new (self, NULL, callback, user_data)); g_object_unref (modem); } diff -Nru modemmanager-1.6.8/plugins/option/mm-broadband-bearer-hso.c modemmanager-1.10.0/plugins/option/mm-broadband-bearer-hso.c --- modemmanager-1.6.8/plugins/option/mm-broadband-bearer-hso.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/option/mm-broadband-bearer-hso.c 2018-11-15 09:55:53.000000000 +0100 @@ -37,10 +37,10 @@ G_DEFINE_TYPE (MMBroadbandBearerHso, mm_broadband_bearer_hso, MM_TYPE_BROADBAND_BEARER); struct _MMBroadbandBearerHsoPrivate { - guint auth_idx; - gpointer connect_pending; - guint connect_pending_id; - gulong connect_cancellable_id; + guint auth_idx; + + GTask *connect_pending; + guint connect_pending_id; gulong connect_port_closed_id; }; @@ -48,21 +48,16 @@ /* 3GPP IP config retrieval (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerHso *self; MMBaseModem *modem; MMPortSerialAt *primary; guint cid; - GSimpleAsyncResult *result; } GetIpConfig3gppContext; static void -get_ip_config_context_complete_and_free (GetIpConfig3gppContext *ctx) +get_ip_config_context_free (GetIpConfig3gppContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (GetIpConfig3gppContext, ctx); } @@ -75,12 +70,12 @@ { MMBearerIpConfig *ip_config; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + ip_config = g_task_propagate_pointer (G_TASK (res), error); + if (!ip_config) return FALSE; /* No IPv6 for now */ - ip_config = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *ipv4_config = g_object_ref (ip_config); + *ipv4_config = ip_config; /* Transfer ownership */ *ipv6_config = NULL; return TRUE; } @@ -90,8 +85,9 @@ static void ip_config_ready (MMBaseModem *modem, GAsyncResult *res, - GetIpConfig3gppContext *ctx) + GTask *task) { + GetIpConfig3gppContext *ctx; MMBearerIpConfig *ip_config = NULL; const gchar *response; GError *error = NULL; @@ -102,8 +98,8 @@ response = mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - get_ip_config_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -111,15 +107,16 @@ /* Check result */ if (!g_str_has_prefix (response, OWANDATA_TAG)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get IP config: invalid response '%s'", - response); - get_ip_config_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get IP config: invalid response '%s'", + response); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); response = mm_strip_tag (response, OWANDATA_TAG); items = g_strsplit (response, ", ", 0); @@ -159,24 +156,22 @@ if (!ip_config) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get IP config: couldn't parse response '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get IP config: couldn't parse response '%s'", + response); } else { /* If we got DNS entries, set them in the IP config */ if (dns[0]) mm_bearer_ip_config_set_dns (ip_config, (const gchar **)dns); - g_simple_async_result_set_op_res_gpointer (ctx->result, - ip_config, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, ip_config, g_object_unref); } - get_ip_config_context_complete_and_free (ctx); + g_object_unref (task); g_strfreev (items); } @@ -192,17 +187,16 @@ gpointer user_data) { GetIpConfig3gppContext *ctx; + GTask *task; gchar *command; ctx = g_slice_new0 (GetIpConfig3gppContext); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_ip_config_3gpp); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)get_ip_config_context_free); command = g_strdup_printf ("AT_OWANDATA=%d", cid); mm_base_modem_at_command_full ( @@ -214,7 +208,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)ip_config_ready, - ctx); + task); g_free (command); } @@ -222,88 +216,63 @@ /* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearerHso *self; - MMBaseModem *modem; + MMBaseModem *modem; MMPortSerialAt *primary; - guint cid; - GCancellable *cancellable; - GSimpleAsyncResult *result; - MMPort *data; - guint auth_idx; - GError *saved_error; + guint cid; + MMPort *data; + guint auth_idx; + GError *saved_error; } Dial3gppContext; static void -dial_3gpp_context_complete_and_free (Dial3gppContext *ctx) +dial_3gpp_context_free (Dial3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->data) - g_object_unref (ctx->data); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->primary); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); + g_assert (!ctx->saved_error); + g_clear_object (&ctx->data); + g_clear_object (&ctx->primary); + g_clear_object (&ctx->modem); g_slice_free (Dial3gppContext, ctx); } -static gboolean -dial_3gpp_context_set_error_if_cancelled (Dial3gppContext *ctx, - GError **error) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Dial operation has been cancelled"); - return TRUE; -} - -static gboolean -dial_3gpp_context_complete_and_free_if_cancelled (Dial3gppContext *ctx) -{ - GError *error = NULL; - - if (!dial_3gpp_context_set_error_if_cancelled (ctx, &error)) - return FALSE; - - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); - return TRUE; -} - static MMPort * -dial_3gpp_finish (MMBroadbandBearer *self, - GAsyncResult *res, - GError **error) +dial_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_PORT (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return MM_PORT (g_task_propagate_pointer (G_TASK (res), error)); } static void -connect_reset_ready (MMBaseModem *modem, +connect_reset_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; + + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_full_finish (modem, res, NULL); - /* error should have already been set in the simple async result */ - dial_3gpp_context_complete_and_free (ctx); + /* When reset is requested, it was either cancelled or an error was stored */ + if (!g_task_return_error_if_cancelled (task)) { + g_assert (ctx->saved_error); + g_task_return_error (task, ctx->saved_error); + ctx->saved_error = NULL; + } + + g_object_unref (task); } static void -connect_reset (Dial3gppContext *ctx) +connect_reset (GTask *task) { - gchar *command; + Dial3gppContext *ctx; + gchar *command; + + ctx = g_task_get_task_data (task); /* Need to reset the connection attempt */ - command = g_strdup_printf ("AT_OWANCALL=%d,0,1", - ctx->cid); + command = g_strdup_printf ("AT_OWANCALL=%d,0,1", ctx->cid); mm_base_modem_at_command_full (ctx->modem, ctx->primary, command, @@ -312,53 +281,29 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)connect_reset_ready, - ctx); + task); g_free (command); } static void -report_connection_status (MMBaseBearer *bearer, - MMBearerConnectionStatus status) +process_pending_connect_attempt (MMBroadbandBearerHso *self, + MMBearerConnectionStatus status) { - MMBroadbandBearerHso *self = MM_BROADBAND_BEARER_HSO (bearer); + GTask *task; Dial3gppContext *ctx; - g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || - status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED || - status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); - - /* Recover context (if any) and remove both cancellation and timeout (if any)*/ - ctx = self->priv->connect_pending; + /* Recover task and remove both cancellation and timeout (if any)*/ + g_assert (self->priv->connect_pending); + task = self->priv->connect_pending; self->priv->connect_pending = NULL; - /* Connection status reported but no connection attempt? */ - if (!ctx) { - g_assert (self->priv->connect_pending_id == 0); - - mm_dbg ("Received spontaneous _OWANCALL (%s)", - mm_bearer_connection_status_get_string (status)); - - if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { - /* If no connection attempt on-going, make sure we mark ourselves as - * disconnected */ - MM_BASE_BEARER_CLASS (mm_broadband_bearer_hso_parent_class)->report_connection_status ( - bearer, - status); - } - return; - } + ctx = g_task_get_task_data (task); if (self->priv->connect_pending_id) { g_source_remove (self->priv->connect_pending_id); self->priv->connect_pending_id = 0; } - if (self->priv->connect_cancellable_id) { - g_cancellable_disconnect (ctx->cancellable, - self->priv->connect_cancellable_id); - self->priv->connect_cancellable_id = 0; - } - if (self->priv->connect_port_closed_id) { g_signal_handler_disconnect (ctx->primary, self->priv->connect_port_closed_id); self->priv->connect_port_closed_id = 0; @@ -366,105 +311,60 @@ /* Reporting connected */ if (status == MM_BEARER_CONNECTION_STATUS_CONNECTED) { - /* If we wanted to get cancelled before, do it now */ - if (ctx->saved_error) { - /* Keep error */ - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - /* Cancel connection */ - connect_reset (ctx); + /* If we wanted to get cancelled before, do it now. */ + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { + connect_reset (task); return; } - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->data), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); - return; - } - - /* If we wanted to get cancelled before and now we couldn't connect, - * use the cancelled error and return */ - if (ctx->saved_error) { - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - dial_3gpp_context_complete_and_free (ctx); + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); return; } - /* Received CONNECTION_FAILED or DISCONNECTED during a connection attempt? */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Call setup failed"); - dial_3gpp_context_complete_and_free (ctx); + /* Received CONNECTION_FAILED or DISCONNECTED during a connection attempt, + * so return a failed error. Note that if the cancellable has been cancelled + * already, a cancelled error would be returned instead. */ + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Call setup failed"); + g_object_unref (task); } static gboolean connect_timed_out_cb (MMBroadbandBearerHso *self) { + GTask *task; Dial3gppContext *ctx; - /* Recover context and remove it from the private info */ - ctx = self->priv->connect_pending; + /* Cleanup timeout ID */ + self->priv->connect_pending_id = 0; + + /* Recover task and own it */ + task = self->priv->connect_pending; self->priv->connect_pending = NULL; + g_assert (task); - /* Remove cancellation, if found */ - if (self->priv->connect_cancellable_id) { - g_cancellable_disconnect (ctx->cancellable, - self->priv->connect_cancellable_id); - self->priv->connect_cancellable_id = 0; - } + ctx = g_task_get_task_data (task); /* Remove closed port watch, if found */ - if (ctx && self->priv->connect_port_closed_id) { + if (self->priv->connect_port_closed_id) { g_signal_handler_disconnect (ctx->primary, self->priv->connect_port_closed_id); self->priv->connect_port_closed_id = 0; } - /* Cleanup timeout ID */ - self->priv->connect_pending_id = 0; - - /* If we were cancelled, prefer that error */ - if (ctx->saved_error) { - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - } else - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, - "Connection attempt timed out"); + /* Setup error to return after the reset */ + g_assert (!ctx->saved_error); + ctx->saved_error = g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, + "Connection attempt timed out"); /* It's probably pointless to try to reset this here, but anyway... */ - connect_reset (ctx); + connect_reset (task); return G_SOURCE_REMOVE; } static void -connect_cancelled_cb (GCancellable *cancellable, - MMBroadbandBearerHso *self) -{ - Dial3gppContext *ctx; - - /* Recover context but DON'T remove it from the private info */ - ctx = self->priv->connect_pending; - - /* Remove the cancellable - * NOTE: we shouldn't remove the timeout yet. We still need to wait - * to get connected before running the explicit connection reset */ - self->priv->connect_cancellable_id = 0; - - /* Store cancelled error */ - g_assert (dial_3gpp_context_set_error_if_cancelled (ctx, &ctx->saved_error)); - - /* We cannot reset right here, we need to wait for the connection - * attempt to finish */ -} - -static void -forced_close_cb (MMPortSerial *port, - MMBroadbandBearerHso *self) +forced_close_cb (MMBroadbandBearerHso *self) { /* Just treat the forced close event as any other unsolicited message */ mm_base_bearer_report_connection_status (MM_BASE_BEARER (self), @@ -472,77 +372,90 @@ } static void -activate_ready (MMBaseModem *modem, - GAsyncResult *res, +activate_ready (MMBaseModem *modem, + GAsyncResult *res, MMBroadbandBearerHso *self) { + GTask *task; Dial3gppContext *ctx; - GError *error = NULL; + GError *error = NULL; - /* Try to recover the connection context. If none found, it means the - * context was already completed and we have nothing else to do. */ - ctx = self->priv->connect_pending; - - /* Balance refcount with the extra ref we passed to command_full() */ - g_object_unref (self); + task = self->priv->connect_pending; + self->priv->connect_pending = NULL; - if (!ctx) { + /* Try to recover the connection task. If none found, it means the + * task was already completed and we have nothing else to do. + * But note that we won't take owneship of the task yet! */ + if (!task) { mm_dbg ("Connection context was finished already by an unsolicited message"); - /* Run _finish() to finalize the async call, even if we don't care - * the result */ + * about the result */ mm_base_modem_at_command_full_finish (modem, res, NULL); - return; + goto out; } /* From now on, if we get cancelled, we'll need to run the connection * reset ourselves just in case */ + /* Errors on the dial command are fatal */ if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); - return; + g_task_return_error (task, error); + g_object_unref (task); + goto out; } - /* We will now setup a timeout so that we don't wait forever to get the - * connection on */ - self->priv->connect_pending_id = g_timeout_add_seconds (30, + /* Track the task again */ + self->priv->connect_pending = task; + + /* We will now setup a timeout and keep the context in the bearer's private. + * Reports of modem being connected will arrive via unsolicited messages. + * This timeout should be long enough. Actually... ideally should never get + * reached. */ + self->priv->connect_pending_id = g_timeout_add_seconds (60, (GSourceFunc)connect_timed_out_cb, self); - self->priv->connect_cancellable_id = g_cancellable_connect (ctx->cancellable, - G_CALLBACK (connect_cancelled_cb), - self, - NULL); /* If we get the port closed, we treat as a connect error */ - self->priv->connect_port_closed_id = g_signal_connect (ctx->primary, - "forced-close", - G_CALLBACK (forced_close_cb), - self); + ctx = g_task_get_task_data (task); + self->priv->connect_port_closed_id = g_signal_connect_swapped (ctx->primary, + "forced-close", + G_CALLBACK (forced_close_cb), + self); + + out: + /* Balance refcount with the extra ref we passed to command_full() */ + g_object_unref (self); } -static void authenticate (Dial3gppContext *ctx); +static void authenticate (GTask *task); static void -authenticate_ready (MMBaseModem *modem, +authenticate_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { - gchar *command; + MMBroadbandBearerHso *self; + Dial3gppContext *ctx; + gchar *command; /* If cancelled, complete */ - if (dial_3gpp_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); if (!mm_base_modem_at_command_full_finish (modem, res, NULL)) { /* Try the next auth command */ ctx->auth_idx++; - authenticate (ctx); + authenticate (task); return; } /* Store which auth command worked, for next attempts */ - ctx->self->priv->auth_idx = ctx->auth_idx; + self->priv->auth_idx = ctx->auth_idx; /* The unsolicited response to AT_OWANCALL may come before the OK does. * We will keep the connection context in the bearer private data so @@ -550,12 +463,11 @@ * also that we do NOT pass the ctx to the GAsyncReadyCallback, as it * may not be valid any more when the callback is called (it may be * already completed in the unsolicited handling) */ - g_assert (ctx->self->priv->connect_pending == NULL); - ctx->self->priv->connect_pending = ctx; + g_assert (self->priv->connect_pending == NULL); + self->priv->connect_pending = task; /* Success, activate the PDP context and start the data session */ - command = g_strdup_printf ("AT_OWANCALL=%d,1,1", - ctx->cid); + command = g_strdup_printf ("AT_OWANCALL=%d,1,1", ctx->cid); mm_base_modem_at_command_full (ctx->modem, ctx->primary, command, @@ -563,8 +475,8 @@ FALSE, FALSE, /* raw */ NULL, /* cancellable */ - (GAsyncReadyCallback)activate_ready, - g_object_ref (ctx->self)); /* we pass the bearer object! */ + (GAsyncReadyCallback) activate_ready, + g_object_ref (self)); /* we pass the bearer object! */ g_free (command); } @@ -578,25 +490,30 @@ }; static void -authenticate (Dial3gppContext *ctx) +authenticate (GTask *task) { - gchar *command; - const gchar *user; - const gchar *password; - MMBearerAllowedAuth allowed_auth; + MMBroadbandBearerHso *self; + Dial3gppContext *ctx; + gchar *command; + const gchar *user; + const gchar *password; + MMBearerAllowedAuth allowed_auth; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); if (!auth_commands[ctx->auth_idx]) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't run HSO authentication"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't run HSO authentication"); + g_object_unref (task); return; } - user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); /* Both user and password are required; otherwise firmware returns an error */ if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) { @@ -607,7 +524,7 @@ } else { gchar *quoted_user; gchar *quoted_password; - guint hso_auth; + guint hso_auth; if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) { mm_dbg ("Using default (PAP) authentication method"); @@ -622,18 +539,17 @@ gchar *str; str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth); - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot use any of the specified authentication methods (%s)", - str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot use any of the specified authentication methods (%s)", + str); + g_object_unref (task); g_free (str); - dial_3gpp_context_complete_and_free (ctx); return; } - quoted_user = mm_port_serial_at_quote_string (user); + quoted_user = mm_port_serial_at_quote_string (user); quoted_password = mm_port_serial_at_quote_string (password); command = g_strdup_printf ("%s=%d,%u,%s,%s", auth_commands[ctx->auth_idx], @@ -653,70 +569,63 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)authenticate_ready, - ctx); + task); g_free (command); } static void -dial_3gpp (MMBroadbandBearer *self, - MMBaseModem *modem, - MMPortSerialAt *primary, - guint cid, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - Dial3gppContext *ctx; +dial_3gpp (MMBroadbandBearer *_self, + MMBaseModem *modem, + MMPortSerialAt *primary, + guint cid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandBearerHso *self = MM_BROADBAND_BEARER_HSO (_self); + GTask *task; + Dial3gppContext *ctx; g_assert (primary != NULL); + task = g_task_new (self, cancellable, callback, user_data); + ctx = g_slice_new0 (Dial3gppContext); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (modem); + ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); - ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - dial_3gpp); - ctx->cancellable = g_object_ref (cancellable); + ctx->cid = cid; + g_task_set_task_data (task, ctx, (GDestroyNotify)dial_3gpp_context_free); /* Always start with the index that worked last time * (will be 0 the first time)*/ - ctx->auth_idx = ctx->self->priv->auth_idx; + ctx->auth_idx = self->priv->auth_idx; /* We need a net data port */ ctx->data = mm_base_modem_get_best_data_port (modem, MM_PORT_TYPE_NET); if (!ctx->data) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No valid data port found to launch connection"); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); + g_object_unref (task); return; } - authenticate (ctx); + authenticate (task); } /*****************************************************************************/ /* 3GPP disconnect */ typedef struct { - MMBroadbandBearerHso *self; MMBaseModem *modem; MMPortSerialAt *primary; - GSimpleAsyncResult *result; } DisconnectContext; static void -disconnect_context_complete_and_free (DisconnectContext *ctx) +disconnect_context_free (DisconnectContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); - g_object_unref (ctx->self); g_object_unref (ctx->modem); g_free (ctx); } @@ -726,13 +635,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disconnect_owancall_ready (MMBaseModem *modem, GAsyncResult *res, - DisconnectContext *ctx) + GTask *task) { GError *error = NULL; @@ -743,8 +652,8 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -759,17 +668,16 @@ { gchar *command; DisconnectContext *ctx; + GTask *task; g_assert (primary != NULL); ctx = g_new0 (DisconnectContext, 1); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); ctx->primary = g_object_ref (primary); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect_3gpp); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disconnect_context_free); /* Use specific CID */ command = g_strdup_printf ("AT_OWANCALL=%d,0,0", cid); @@ -781,12 +689,42 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_owancall_ready, - ctx); + task); g_free (command); } /*****************************************************************************/ +static void +report_connection_status (MMBaseBearer *_self, + MMBearerConnectionStatus status) +{ + MMBroadbandBearerHso *self = MM_BROADBAND_BEARER_HSO (_self); + + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || + status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED || + status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + + /* Process pending connection attempt */ + if (self->priv->connect_pending) { + process_pending_connect_attempt (self, status); + return; + } + + mm_dbg ("Received spontaneous _OWANCALL (%s)", + mm_bearer_connection_status_get_string (status)); + + if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) { + /* If no connection attempt on-going, make sure we mark ourselves as + * disconnected */ + MM_BASE_BEARER_CLASS (mm_broadband_bearer_hso_parent_class)->report_connection_status ( + _self, + status); + } +} + +/*****************************************************************************/ + MMBaseBearer * mm_broadband_bearer_hso_new_finish (GAsyncResult *res, GError **error) @@ -844,6 +782,9 @@ g_type_class_add_private (object_class, sizeof (MMBroadbandBearerHsoPrivate)); base_bearer_class->report_connection_status = report_connection_status; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; + broadband_bearer_class->dial_3gpp = dial_3gpp; broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp; diff -Nru modemmanager-1.6.8/plugins/option/mm-broadband-modem-hso.c modemmanager-1.10.0/plugins/option/mm-broadband-modem-hso.c --- modemmanager-1.6.8/plugins/option/mm-broadband-modem-hso.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/option/mm-broadband-modem-hso.c 2018-11-15 09:55:53.000000000 +0100 @@ -62,52 +62,41 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New %s bearer created at DBus path '%s'", - MM_IS_BROADBAND_BEARER_HSO (bearer) ? "HSO" : "Generic", - mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void broadband_bearer_hso_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_hso_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void @@ -116,12 +105,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); if (mm_bearer_properties_get_ip_type (properties) & (MM_BEARER_IP_FAMILY_IPV6 | MM_BEARER_IP_FAMILY_IPV4V6)) { @@ -130,7 +116,7 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - result); + task); return; } @@ -139,7 +125,7 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_hso_new_ready, - result); + task); } /*****************************************************************************/ @@ -150,16 +136,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -168,9 +151,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -180,18 +162,15 @@ retries = mm_unlock_retries_new (); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN, pin1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } else { - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid unlock retries response: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -205,10 +184,7 @@ 3, FALSE, (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -285,18 +261,18 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ mm_port_serial_at_add_unsolicited_msg_handler ( @@ -306,11 +282,9 @@ self, NULL); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -318,33 +292,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -352,13 +319,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ mm_port_serial_at_add_unsolicited_msg_handler ( mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), @@ -369,7 +329,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -380,26 +340,29 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCATION_SOURCE_NONE; + GError *inner_error = NULL; + gssize value; - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; } static void parent_load_capabilities_ready (MMIfaceModemLocation *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemLocationSource sources; GError *error = NULL; sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -423,11 +386,8 @@ MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED); /* So we're done, complete */ - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (sources), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, sources); + g_object_unref (task); } static void @@ -435,38 +395,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_load_capabilities); - /* Chain up parent's setup */ iface_modem_location_parent->load_capabilities ( self, (GAsyncReadyCallback)parent_load_capabilities_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Enable/Disable location gathering (Location interface) */ typedef struct { - MMBroadbandModemHso *self; - GSimpleAsyncResult *result; MMModemLocationSource source; } LocationGatheringContext; -static void -location_gathering_context_complete_and_free (LocationGatheringContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LocationGatheringContext, ctx); -} - /******************************/ /* Disable location gathering */ @@ -475,21 +417,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void gps_disabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; MMPortSerialGps *gps_port; GError *error = NULL; - if (!mm_base_modem_at_command_full_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + mm_base_modem_at_command_full_finish (self, res, &error); + + ctx = g_task_get_task_data (task); /* Only use the GPS port in NMEA/RAW setups */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | @@ -500,7 +442,12 @@ mm_port_serial_close (MM_PORT_SERIAL (gps_port)); } - location_gathering_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -512,15 +459,14 @@ MMBroadbandModemHso *hso = MM_BROADBAND_MODEM_HSO (self); gboolean stop_gps = FALSE; LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Only stop GPS engine if no GPS-related sources enabled */ if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | @@ -543,13 +489,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_disabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if still some GPS needed, just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************/ @@ -560,22 +506,25 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void gps_enabled_ready (MMBaseModem *self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + LocationGatheringContext *ctx; GError *error = NULL; if (!mm_base_modem_at_command_full_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Only use the GPS port in NMEA/RAW setups */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { @@ -585,37 +534,41 @@ if (!gps_port || !mm_port_serial_open (MM_PORT_SERIAL (gps_port), &error)) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't open raw GPS serial port"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't open raw GPS serial port"); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - location_gathering_context_complete_and_free (ctx); + g_object_unref (task); } static void -parent_enable_location_gathering_ready (MMIfaceModemLocation *self, +parent_enable_location_gathering_ready (MMIfaceModemLocation *_self, GAsyncResult *res, - LocationGatheringContext *ctx) + GTask *task) { + MMBroadbandModemHso *self = MM_BROADBAND_MODEM_HSO (_self); + LocationGatheringContext *ctx; gboolean start_gps = FALSE; GError *error = NULL; - if (!iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - location_gathering_context_complete_and_free (ctx); + if (!iface_modem_location_parent->enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* Now our own enabling */ + ctx = g_task_get_task_data (task); + /* NMEA, RAW and UNMANAGED are all enabled in the same way */ if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW | @@ -623,11 +576,11 @@ /* Only start GPS engine if not done already. * NOTE: interface already takes care of making sure that raw/nmea and * unmanaged are not enabled at the same time */ - if (!(ctx->self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) + if (!(self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))) start_gps = TRUE; - ctx->self->priv->enabled_sources |= ctx->source; + self->priv->enabled_sources |= ctx->source; } if (start_gps) { @@ -640,13 +593,13 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)gps_enabled_ready, - ctx); + task); return; } /* For any other location (e.g. 3GPP), or if GPS already running just return */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - location_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -656,21 +609,20 @@ gpointer user_data) { LocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new (LocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_location_gathering); + ctx = g_new (LocationGatheringContext, 1); ctx->source = source; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Chain up parent's gathering enable */ iface_modem_location_parent->enable_location_gathering ( self, source, (GAsyncReadyCallback)parent_enable_location_gathering_ready, - ctx); + task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/option/mm-broadband-modem-option.c modemmanager-1.10.0/plugins/option/mm-broadband-modem-option.c --- modemmanager-1.6.8/plugins/option/mm-broadband-modem-option.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/option/mm-broadband-modem-option.c 2018-11-15 09:55:53.000000000 +0100 @@ -65,16 +65,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -84,9 +81,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -119,9 +115,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -133,10 +128,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -222,24 +214,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -allowed_mode_update_ready (MMBroadbandModemOption *self, +allowed_mode_update_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + mm_base_modem_at_command_finish (self, res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -249,14 +241,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint option_mode = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) option_mode = 0; @@ -278,18 +267,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -300,7 +287,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } @@ -316,24 +303,13 @@ } AccessTechnologiesStep; typedef struct { - MMBroadbandModemOption *self; - GSimpleAsyncResult *result; MMModemAccessTechnology access_technology; gboolean check_2g; gboolean check_3g; AccessTechnologiesStep step; } AccessTechnologiesContext; -static void load_access_technologies_step (AccessTechnologiesContext *ctx); - -static void -access_technologies_context_complete_and_free (AccessTechnologiesContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} +static void load_access_technologies_step (GTask *task); static gboolean load_access_technologies_finish (MMIfaceModem *self, @@ -342,12 +318,17 @@ guint *mask, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } /* We are reporting ALL 3GPP access technologies here */ - *access_technologies = (MMModemAccessTechnology) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + *access_technologies = (MMModemAccessTechnology) value; *mask = MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK; return TRUE; } @@ -407,10 +388,13 @@ static void ossys_query_ready (MMBaseModem *self, GAsyncResult *res, - AccessTechnologiesContext *ctx) + GTask *task) { + AccessTechnologiesContext *ctx; const gchar *response; + ctx = g_task_get_task_data (task); + /* If for some reason the OSSYS request failed, still try to check * explicit 2G/3G mode with OCTI and OWCTI; maybe we'll get something. */ @@ -429,7 +413,7 @@ /* Go on to next step */ ctx->step++; - load_access_technologies_step (ctx); + load_access_technologies_step (task); } static gboolean @@ -487,11 +471,14 @@ static void octi_query_ready (MMBaseModem *self, GAsyncResult *res, - AccessTechnologiesContext *ctx) + GTask *task) { + AccessTechnologiesContext *ctx; MMModemAccessTechnology octi = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; const gchar *response; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (self, res, NULL); if (response && parse_octi_response (response, &octi)) { @@ -504,7 +491,7 @@ /* Go on to next step */ ctx->step++; - load_access_technologies_step (ctx); + load_access_technologies_step (task); } static gboolean @@ -544,11 +531,14 @@ static void owcti_query_ready (MMBaseModem *self, GAsyncResult *res, - AccessTechnologiesContext *ctx) + GTask *task) { + AccessTechnologiesContext *ctx; MMModemAccessTechnology owcti = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; const gchar *response; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (self, res, NULL); if (response && parse_owcti_response (response, &owcti)) { @@ -557,34 +547,40 @@ /* Go on to next step */ ctx->step++; - load_access_technologies_step (ctx); + load_access_technologies_step (task); } static void -load_access_technologies_step (AccessTechnologiesContext *ctx) +load_access_technologies_step (GTask *task) { + MMBroadbandModemOption *self; + AccessTechnologiesContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case ACCESS_TECHNOLOGIES_STEP_FIRST: /* Go on to next step */ ctx->step++; case ACCESS_TECHNOLOGIES_STEP_OSSYS: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "_OSSYS?", 3, FALSE, (GAsyncReadyCallback)ossys_query_ready, - ctx); + task); break; case ACCESS_TECHNOLOGIES_STEP_OCTI: if (ctx->check_2g) { - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "_OCTI?", 3, FALSE, (GAsyncReadyCallback)octi_query_ready, - ctx); + task); return; } /* Go on to next step */ @@ -592,12 +588,12 @@ case ACCESS_TECHNOLOGIES_STEP_OWCTI: if (ctx->check_3g) { - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "_OWCTI?", 3, FALSE, (GAsyncReadyCallback)owcti_query_ready, - ctx); + task); return; } /* Go on to next step */ @@ -605,10 +601,8 @@ case ACCESS_TECHNOLOGIES_STEP_LAST: /* All done, set result and complete */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (ctx->access_technology), - NULL); - access_technologies_context_complete_and_free (ctx); + g_task_return_int (task, ctx->access_technology); + g_object_unref (task); break; } } @@ -622,19 +616,18 @@ gpointer user_data) { AccessTechnologiesContext *ctx; + GTask *task; ctx = g_new (AccessTechnologiesContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - run_access_technology_loading_sequence); ctx->step = first; ctx->check_2g = check_2g; ctx->check_3g = check_3g; ctx->access_technology = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; - load_access_technologies_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + load_access_technologies_step (task); } static void @@ -658,46 +651,38 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_power_up_wait_cb (GSimpleAsyncResult *result) +after_power_up_wait_cb (GTask *task) { - MMBroadbandModemOption *option; - - option = MM_BROADBAND_MODEM_OPTION (g_async_result_get_source_object (G_ASYNC_RESULT (result))); + MMBroadbandModemOption *self; - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete (result); - g_object_unref (result); + self = g_task_get_source_object (task); + self->priv->after_power_up_wait_id = 0; - option->priv->after_power_up_wait_id = 0; - g_object_unref (option); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } static void -modem_after_power_up (MMIfaceModem *self, +modem_after_power_up (MMIfaceModem *_self, GAsyncReadyCallback callback, gpointer user_data) { - MMBroadbandModemOption *option = MM_BROADBAND_MODEM_OPTION (self); - GSimpleAsyncResult *result; + MMBroadbandModemOption *self = MM_BROADBAND_MODEM_OPTION (_self); /* Some Option devices return OK on +CFUN=1 right away but need some time * to finish initialization. */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_power_up); - g_warn_if_fail (option->priv->after_power_up_wait_id == 0); - option->priv->after_power_up_wait_id = + g_warn_if_fail (self->priv->after_power_up_wait_id == 0); + self->priv->after_power_up_wait_id = g_timeout_add_seconds (10, (GSourceFunc)after_power_up_wait_cb, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -850,7 +835,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -896,26 +881,25 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_OPTION (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -923,33 +907,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -957,13 +934,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_OPTION (self), FALSE); @@ -971,7 +941,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -982,23 +952,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { @@ -1012,14 +982,13 @@ static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); } /* Our own enable now */ @@ -1031,7 +1000,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void @@ -1039,18 +1008,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); - /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1061,7 +1023,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { @@ -1075,30 +1037,29 @@ static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1106,7 +1067,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static void @@ -1114,13 +1075,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); - /* Our own disable first */ mm_base_modem_at_sequence_full ( MM_BASE_MODEM (self), @@ -1130,7 +1084,7 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/option/mm-plugin-hso.c modemmanager-1.10.0/plugins/option/mm-plugin-hso.c --- modemmanager-1.6.8/plugins/option/mm-plugin-hso.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/option/mm-plugin-hso.c 2018-11-15 09:55:53.000000000 +0100 @@ -46,7 +46,7 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } static void @@ -56,13 +56,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GUdevDevice *udev_port; - GSimpleAsyncResult *result; + MMKernelDevice *kernel_port; + GTask *task; const gchar *subsys, *sysfs_path; subsys = mm_port_probe_get_port_subsys (probe); - udev_port = mm_port_probe_peek_port (probe); - sysfs_path = g_udev_device_get_sysfs_path (udev_port); + kernel_port = mm_port_probe_peek_port (probe); + sysfs_path = mm_kernel_device_get_sysfs_path (kernel_port); if (g_str_equal (subsys, "tty")) { gchar *hsotype_path; @@ -102,27 +102,23 @@ g_free (hsotype_path); } - result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - hso_custom_init); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (probe, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_hso_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_hso_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -160,9 +156,7 @@ } return mm_base_modem_grab_port (modem, - subsys, - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), port_type, pflags, error); @@ -188,6 +182,7 @@ MM_PLUGIN_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE, MM_PLUGIN_CUSTOM_INIT, &custom_init, + MM_PLUGIN_SEND_DELAY, (guint64) 0, NULL)); } diff -Nru modemmanager-1.6.8/plugins/option/mm-plugin-option.c modemmanager-1.10.0/plugins/option/mm-plugin-option.c --- modemmanager-1.6.8/plugins/option/mm-plugin-option.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/option/mm-plugin-option.c 2018-11-15 09:55:53.000000000 +0100 @@ -34,14 +34,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_option_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_option_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -55,8 +55,8 @@ GError **error) { MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - GUdevDevice *port; - gint usbif; + MMKernelDevice *port; + guint usbif; /* The Option plugin cannot do anything with non-AT ports */ if (!mm_port_probe_is_at (probe)) { @@ -73,14 +73,12 @@ * the modem/data port, per mail with Option engineers. Only this port * will emit responses to dialing commands. */ - usbif = g_udev_device_get_property_as_int (port, "ID_USB_INTERFACE_NUM"); + usbif = mm_kernel_device_get_property_as_int_hex (port, "ID_USB_INTERFACE_NUM"); if (usbif == 0) pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY | MM_PORT_SERIAL_AT_FLAG_PPP; return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + port, MM_PORT_TYPE_AT, /* we only allow AT ports here */ pflags, error); diff -Nru modemmanager-1.6.8/plugins/pantech/mm-broadband-modem-pantech.c modemmanager-1.10.0/plugins/pantech/mm-broadband-modem-pantech.c --- modemmanager-1.6.8/plugins/pantech/mm-broadband-modem-pantech.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/pantech/mm-broadband-modem-pantech.c 2018-11-15 09:55:53.000000000 +0100 @@ -114,14 +114,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -130,15 +130,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); - /* wait so sim pin is done */ - g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (5, + (GSourceFunc)after_sim_unlock_wait_cb, + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/pantech/mm-plugin-pantech.c modemmanager-1.10.0/plugins/pantech/mm-plugin-pantech.c --- modemmanager-1.6.8/plugins/pantech/mm-plugin-pantech.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/pantech/mm-plugin-pantech.c 2018-11-15 09:55:53.000000000 +0100 @@ -76,7 +76,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -86,7 +86,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Pantech modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -94,7 +94,7 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_pantech_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_pantech_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -119,9 +119,7 @@ } return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), ptype, pflags, error); diff -Nru modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-qmi-quectel.c modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-qmi-quectel.c --- modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-qmi-quectel.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-qmi-quectel.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,67 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include "mm-broadband-modem-qmi-quectel.h" +#include "mm-shared-quectel.h" +#include "mm-iface-modem-firmware.h" + +static void shared_quectel_init (MMSharedQuectel *iface); +static void iface_modem_firmware_init (MMIfaceModemFirmware *iface); + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQmiQuectel, mm_broadband_modem_qmi_quectel, MM_TYPE_BROADBAND_MODEM_QMI, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_QUECTEL, shared_quectel_init)) + +/*****************************************************************************/ + +MMBroadbandModemQmiQuectel * +mm_broadband_modem_qmi_quectel_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + NULL); +} + +static void +mm_broadband_modem_qmi_quectel_init (MMBroadbandModemQmiQuectel *self) +{ +} + +static void +iface_modem_firmware_init (MMIfaceModemFirmware *iface) +{ + iface->load_update_settings = mm_shared_quectel_firmware_load_update_settings; + iface->load_update_settings_finish = mm_shared_quectel_firmware_load_update_settings_finish; +} + +static void +shared_quectel_init (MMSharedQuectel *iface) +{ +} + +static void +mm_broadband_modem_qmi_quectel_class_init (MMBroadbandModemQmiQuectelClass *klass) +{ +} diff -Nru modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-qmi-quectel.h modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-qmi-quectel.h --- modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-qmi-quectel.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-qmi-quectel.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_QMI_QUECTEL_H +#define MM_BROADBAND_MODEM_QMI_QUECTEL_H + +#include "mm-broadband-modem-qmi.h" + +#define MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL (mm_broadband_modem_qmi_quectel_get_type ()) +#define MM_BROADBAND_MODEM_QMI_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL, MMBroadbandModemQmiQuectel)) +#define MM_BROADBAND_MODEM_QMI_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL, MMBroadbandModemQmiQuectelClass)) +#define MM_IS_BROADBAND_MODEM_QMI_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL)) +#define MM_IS_BROADBAND_MODEM_QMI_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL)) +#define MM_BROADBAND_MODEM_QMI_QUECTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_QMI_QUECTEL, MMBroadbandModemQmiQuectelClass)) + +typedef struct _MMBroadbandModemQmiQuectel MMBroadbandModemQmiQuectel; +typedef struct _MMBroadbandModemQmiQuectelClass MMBroadbandModemQmiQuectelClass; + +struct _MMBroadbandModemQmiQuectel { + MMBroadbandModemQmi parent; +}; + +struct _MMBroadbandModemQmiQuectelClass{ + MMBroadbandModemQmiClass parent; +}; + +GType mm_broadband_modem_qmi_quectel_get_type (void); + +MMBroadbandModemQmiQuectel *mm_broadband_modem_qmi_quectel_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_QMI_QUECTEL_H */ diff -Nru modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-quectel.c modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-quectel.c --- modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-quectel.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-quectel.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,67 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include "mm-broadband-modem-quectel.h" +#include "mm-shared-quectel.h" +#include "mm-iface-modem-firmware.h" + +static void shared_quectel_init (MMSharedQuectel *iface); +static void iface_modem_firmware_init (MMIfaceModemFirmware *iface); + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQuectel, mm_broadband_modem_quectel, MM_TYPE_BROADBAND_MODEM, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_QUECTEL, shared_quectel_init)) + +/*****************************************************************************/ + +MMBroadbandModemQuectel * +mm_broadband_modem_quectel_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_QUECTEL, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + NULL); +} + +static void +iface_modem_firmware_init (MMIfaceModemFirmware *iface) +{ + iface->load_update_settings = mm_shared_quectel_firmware_load_update_settings; + iface->load_update_settings_finish = mm_shared_quectel_firmware_load_update_settings_finish; +} + +static void +mm_broadband_modem_quectel_init (MMBroadbandModemQuectel *self) +{ +} + +static void +shared_quectel_init (MMSharedQuectel *iface) +{ +} + +static void +mm_broadband_modem_quectel_class_init (MMBroadbandModemQuectelClass *klass) +{ +} diff -Nru modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-quectel.h modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-quectel.h --- modemmanager-1.6.8/plugins/quectel/mm-broadband-modem-quectel.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-broadband-modem-quectel.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_QUECTEL_H +#define MM_BROADBAND_MODEM_QUECTEL_H + +#include "mm-broadband-modem.h" + +#define MM_TYPE_BROADBAND_MODEM_QUECTEL (mm_broadband_modem_quectel_get_type ()) +#define MM_BROADBAND_MODEM_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_QUECTEL, MMBroadbandModemQuectel)) +#define MM_BROADBAND_MODEM_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_QUECTEL, MMBroadbandModemQuectelClass)) +#define MM_IS_BROADBAND_MODEM_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_QUECTEL)) +#define MM_IS_BROADBAND_MODEM_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_QUECTEL)) +#define MM_BROADBAND_MODEM_QUECTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_QUECTEL, MMBroadbandModemQuectelClass)) + +typedef struct _MMBroadbandModemQuectel MMBroadbandModemQuectel; +typedef struct _MMBroadbandModemQuectelClass MMBroadbandModemQuectelClass; + +struct _MMBroadbandModemQuectel { + MMBroadbandModem parent; +}; + +struct _MMBroadbandModemQuectelClass{ + MMBroadbandModemClass parent; +}; + +GType mm_broadband_modem_quectel_get_type (void); + +MMBroadbandModemQuectel *mm_broadband_modem_quectel_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_QUECTEL_H */ diff -Nru modemmanager-1.6.8/plugins/quectel/mm-plugin-quectel.c modemmanager-1.10.0/plugins/quectel/mm-plugin-quectel.c --- modemmanager-1.6.8/plugins/quectel/mm-plugin-quectel.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-plugin-quectel.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,96 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017-2018 Aleksander Morgado + */ + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-plugin-quectel.h" +#include "mm-broadband-modem-quectel.h" + +#if defined WITH_QMI +#include "mm-broadband-modem-qmi-quectel.h" +#endif + +G_DEFINE_TYPE (MMPluginQuectel, mm_plugin_quectel, MM_TYPE_PLUGIN) + +MM_PLUGIN_DEFINE_MAJOR_VERSION +MM_PLUGIN_DEFINE_MINOR_VERSION + +/*****************************************************************************/ + +static MMBaseModem * +create_modem (MMPlugin *self, + const gchar *uid, + const gchar **drivers, + guint16 vendor, + guint16 product, + GList *probes, + GError **error) +{ +#if defined WITH_QMI + if (mm_port_probe_list_has_qmi_port (probes)) { + mm_dbg ("QMI-powered Quectel modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_qmi_quectel_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } +#endif + + return MM_BASE_MODEM (mm_broadband_modem_quectel_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); +} + +/*****************************************************************************/ + +G_MODULE_EXPORT MMPlugin * +mm_plugin_create (void) +{ + static const gchar *subsystems[] = { "tty", "net", "usb", NULL }; + static const guint16 vendor_ids[] = { 0x2c7c, 0 }; + static const gchar *drivers[] = { "qmi_wwan", NULL }; + + return MM_PLUGIN ( + g_object_new (MM_TYPE_PLUGIN_QUECTEL, + MM_PLUGIN_NAME, "Quectel", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, + MM_PLUGIN_ALLOWED_DRIVERS, drivers, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_ALLOWED_QCDM, TRUE, + MM_PLUGIN_ALLOWED_QMI, TRUE, + NULL)); +} + +static void +mm_plugin_quectel_init (MMPluginQuectel *self) +{ +} + +static void +mm_plugin_quectel_class_init (MMPluginQuectelClass *klass) +{ + MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); + + plugin_class->create_modem = create_modem; +} diff -Nru modemmanager-1.6.8/plugins/quectel/mm-plugin-quectel.h modemmanager-1.10.0/plugins/quectel/mm-plugin-quectel.h --- modemmanager-1.6.8/plugins/quectel/mm-plugin-quectel.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-plugin-quectel.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Aleksander Morgado + */ + +#ifndef MM_PLUGIN_QUECTEL_H +#define MM_PLUGIN_QUECTEL_H + +#include "mm-plugin.h" + +#define MM_TYPE_PLUGIN_QUECTEL (mm_plugin_quectel_get_type ()) +#define MM_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectel)) +#define MM_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) +#define MM_IS_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_QUECTEL)) +#define MM_IS_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_QUECTEL)) +#define MM_PLUGIN_QUECTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) + +typedef struct { + MMPlugin parent; +} MMPluginQuectel; + +typedef struct { + MMPluginClass parent; +} MMPluginQuectelClass; + +GType mm_plugin_quectel_get_type (void); + +G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); + +#endif /* MM_PLUGIN_QUECTEL_H */ diff -Nru modemmanager-1.6.8/plugins/quectel/mm-shared-quectel.c modemmanager-1.10.0/plugins/quectel/mm-shared-quectel.c --- modemmanager-1.6.8/plugins/quectel/mm-shared-quectel.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-shared-quectel.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,98 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-iface-modem-firmware.h" +#include "mm-base-modem.h" +#include "mm-base-modem-at.h" +#include "mm-shared-quectel.h" + +/*****************************************************************************/ +/* Firmware update settings loading (Firmware interface) */ + +MMFirmwareUpdateSettings * +mm_shared_quectel_firmware_load_update_settings_finish (MMIfaceModemFirmware *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +qfastboot_test_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + MMFirmwareUpdateSettings *update_settings; + + if (!mm_base_modem_at_command_finish (self, res, NULL)) + update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE); + else { + update_settings = mm_firmware_update_settings_new (MM_MODEM_FIRMWARE_UPDATE_METHOD_FASTBOOT); + mm_firmware_update_settings_set_fastboot_at (update_settings, "AT+QFASTBOOT"); + } + + g_task_return_pointer (task, update_settings, g_object_unref); + g_object_unref (task); +} + +void +mm_shared_quectel_firmware_load_update_settings (MMIfaceModemFirmware *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command (MM_BASE_MODEM (self), + "AT+QFASTBOOT=?", + 3, + TRUE, + (GAsyncReadyCallback)qfastboot_test_ready, + task); +} + +/*****************************************************************************/ + +static void +shared_quectel_init (gpointer g_iface) +{ +} + +GType +mm_shared_quectel_get_type (void) +{ + static GType shared_quectel_type = 0; + + if (!G_UNLIKELY (shared_quectel_type)) { + static const GTypeInfo info = { + sizeof (MMSharedQuectel), /* class_size */ + shared_quectel_init, /* base_init */ + NULL, /* base_finalize */ + }; + + shared_quectel_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedQuectel", &info, 0); + g_type_interface_add_prerequisite (shared_quectel_type, MM_TYPE_IFACE_MODEM_FIRMWARE); + } + + return shared_quectel_type; +} diff -Nru modemmanager-1.6.8/plugins/quectel/mm-shared-quectel.h modemmanager-1.10.0/plugins/quectel/mm-shared-quectel.h --- modemmanager-1.6.8/plugins/quectel/mm-shared-quectel.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/quectel/mm-shared-quectel.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_SHARED_QUECTEL_H +#define MM_SHARED_QUECTEL_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-broadband-modem.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-firmware.h" + +#define MM_TYPE_SHARED_QUECTEL (mm_shared_quectel_get_type ()) +#define MM_SHARED_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_QUECTEL, MMSharedQuectel)) +#define MM_IS_SHARED_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_QUECTEL)) +#define MM_SHARED_QUECTEL_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_QUECTEL, MMSharedQuectel)) + +typedef struct _MMSharedQuectel MMSharedQuectel; + +struct _MMSharedQuectel { + GTypeInterface g_iface; +}; + +GType mm_shared_quectel_get_type (void); + +void mm_shared_quectel_firmware_load_update_settings (MMIfaceModemFirmware *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMFirmwareUpdateSettings *mm_shared_quectel_firmware_load_update_settings_finish (MMIfaceModemFirmware *self, + GAsyncResult *res, + GError **error); + +#endif /* MM_SHARED_QUECTEL_H */ diff -Nru modemmanager-1.6.8/plugins/samsung/mm-broadband-modem-samsung.c modemmanager-1.10.0/plugins/samsung/mm-broadband-modem-samsung.c --- modemmanager-1.6.8/plugins/samsung/mm-broadband-modem-samsung.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/samsung/mm-broadband-modem-samsung.c 2018-11-15 09:55:53.000000000 +0100 @@ -48,7 +48,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Configure AT ports */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/samsung/mm-plugin-samsung.c modemmanager-1.10.0/plugins/samsung/mm-plugin-samsung.c --- modemmanager-1.6.8/plugins/samsung/mm-plugin-samsung.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/samsung/mm-plugin-samsung.c 2018-11-15 09:55:53.000000000 +0100 @@ -36,14 +36,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_samsung_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_samsung_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -65,6 +65,7 @@ MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_PRODUCT_IDS, products, MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_SEND_DELAY, (guint64) 0, NULL)); } diff -Nru modemmanager-1.6.8/plugins/sierra/77-mm-sierra.rules modemmanager-1.10.0/plugins/sierra/77-mm-sierra.rules --- modemmanager-1.6.8/plugins/sierra/77-mm-sierra.rules 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/sierra/77-mm-sierra.rules 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,12 @@ + +# do not edit this file, it will be overwritten on update +ACTION!="add|change|move|bind", GOTO="mm_sierra_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1199", GOTO="mm_sierra" +GOTO="mm_sierra_end" + +LABEL="mm_sierra" + +# Netgear AC341U: enable connection status polling explicitly +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9057", ENV{ID_MM_QMI_CONNECTION_STATUS_POLLING_ENABLE}="1" + +LABEL="mm_sierra_end" \ No newline at end of file diff -Nru modemmanager-1.6.8/plugins/sierra/mm-broadband-bearer-sierra.c modemmanager-1.10.0/plugins/sierra/mm-broadband-bearer-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-broadband-bearer-sierra.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-broadband-bearer-sierra.c 2019-01-15 15:57:35.000000000 +0100 @@ -31,6 +31,7 @@ #include "mm-broadband-bearer-sierra.h" #include "mm-log.h" #include "mm-modem-helpers.h" +#include "mm-modem-helpers-sierra.h" G_DEFINE_TYPE (MMBroadbandBearerSierra, mm_broadband_bearer_sierra, MM_TYPE_BROADBAND_BEARER); @@ -45,6 +46,121 @@ }; /*****************************************************************************/ +/* Connection status monitoring */ + +static MMBearerConnectionStatus +load_connection_status_finish (MMBaseBearer *bearer, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + } + return (MMBearerConnectionStatus)value; +} + +static void +scact_periodic_query_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + GList *pdp_active_list = NULL; + GList *l; + MMBearerConnectionStatus status = MM_BEARER_CONNECTION_STATUS_UNKNOWN; + guint cid; + + cid = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (response) + pdp_active_list = mm_sierra_parse_scact_read_response (response, &error); + + if (error) { + g_assert (!pdp_active_list); + g_prefix_error (&error, "Couldn't check current list of active PDP contexts: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + for (l = pdp_active_list; l; l = g_list_next (l)) { + MM3gppPdpContextActive *pdp_active; + + /* We look for the specific CID */ + pdp_active = (MM3gppPdpContextActive *)(l->data); + if (pdp_active->cid == cid) { + status = (pdp_active->active ? MM_BEARER_CONNECTION_STATUS_CONNECTED : MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + break; + } + } + mm_3gpp_pdp_context_active_list_free (pdp_active_list); + + /* PDP context not found? This shouldn't happen, error out */ + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "PDP context not found in the known contexts list"); + else + g_task_return_int (task, (gssize) status); + g_object_unref (task); +} + +static void +load_connection_status (MMBaseBearer *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MMBaseModem *modem = NULL; + MMPortSerialAt *port; + guint cid; + + task = g_task_new (self, NULL, callback, user_data); + + g_object_get (MM_BASE_BEARER (self), + MM_BASE_BEARER_MODEM, &modem, + NULL); + + /* If CID not defined, error out */ + cid = mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (self)); + if (!cid) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't load connection status: cid not defined"); + g_object_unref (task); + goto out; + } + g_task_set_task_data (task, GUINT_TO_POINTER (cid), NULL); + + /* If no control port available, error out */ + port = mm_base_modem_peek_best_at_port (modem, NULL); + if (!port) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't load connection status: no control port available"); + g_object_unref (task); + goto out; + } + + mm_base_modem_at_command_full (MM_BASE_MODEM (modem), + port, + "!SCACT?", + 3, + FALSE, /* allow cached */ + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback) scact_periodic_query_ready, + task); + +out: + g_clear_object (&modem); +} + +/*****************************************************************************/ /* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ typedef enum { @@ -56,27 +172,20 @@ } Dial3gppStep; typedef struct { - MMBroadbandBearerSierra *self; MMBaseModem *modem; MMPortSerialAt *primary; guint cid; - GCancellable *cancellable; - GSimpleAsyncResult *result; MMPort *data; Dial3gppStep step; } Dial3gppContext; static void -dial_3gpp_context_complete_and_free (Dial3gppContext *ctx) +dial_3gpp_context_free (Dial3gppContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); if (ctx->data) g_object_unref (ctx->data); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (Dial3gppContext, ctx); } @@ -85,97 +194,108 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_PORT (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return g_task_propagate_pointer (G_TASK (res), error); } -static void dial_3gpp_context_step (Dial3gppContext *ctx); +static void dial_3gpp_context_step (GTask *task); static void parent_dial_3gpp_ready (MMBroadbandBearer *self, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->data = MM_BROADBAND_BEARER_CLASS (mm_broadband_bearer_sierra_parent_class)->dial_3gpp_finish (self, res, &error); if (!ctx->data) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on */ ctx->step++; - dial_3gpp_context_step (ctx); + dial_3gpp_context_step (task); } static void scact_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on */ ctx->step++; - dial_3gpp_context_step (ctx); + dial_3gpp_context_step (task); } static void authenticate_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on */ ctx->step++; - dial_3gpp_context_step (ctx); + dial_3gpp_context_step (task); } static void cgatt_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_base_modem_at_command_full_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on */ ctx->step++; - dial_3gpp_context_step (ctx); + dial_3gpp_context_step (task); } static void -dial_3gpp_context_step (Dial3gppContext *ctx) +dial_3gpp_context_step (GTask *task) { - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Dial operation has been cancelled"); - dial_3gpp_context_complete_and_free (ctx); - return; + MMBroadbandBearerSierra *self; + Dial3gppContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); + return; } switch (ctx->step) { @@ -192,7 +312,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)cgatt_ready, - ctx); + task); return; case DIAL_3GPP_STEP_AUTHENTICATE: @@ -202,13 +322,13 @@ const gchar *password; MMBearerAllowedAuth allowed_auth; - user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) { mm_dbg ("Not using authentication"); - if (ctx->self->priv->is_icera) + if (self->priv->is_icera) command = g_strdup_printf ("%%IPDPCFG=%d,0,0,\"\",\"\"", ctx->cid); else command = g_strdup_printf ("$QCPDPP=%d,0", ctx->cid); @@ -230,20 +350,20 @@ gchar *str; str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth); - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Cannot use any of the specified authentication methods (%s)", str); g_free (str); - dial_3gpp_context_complete_and_free (ctx); + g_object_unref (task); return; } quoted_user = mm_port_serial_at_quote_string (user); quoted_password = mm_port_serial_at_quote_string (password); - if (ctx->self->priv->is_icera) { + if (self->priv->is_icera) { command = g_strdup_printf ("%%IPDPCFG=%d,0,%u,%s,%s", ctx->cid, sierra_auth, @@ -269,7 +389,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)authenticate_ready, - ctx); + task); g_free (command); return; } @@ -292,27 +412,27 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)scact_ready, - ctx); + task); g_free (command); return; } /* Chain up parent's dialling if we don't have a net port */ MM_BROADBAND_BEARER_CLASS (mm_broadband_bearer_sierra_parent_class)->dial_3gpp ( - MM_BROADBAND_BEARER (ctx->self), + MM_BROADBAND_BEARER (self), ctx->modem, ctx->primary, ctx->cid, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)parent_dial_3gpp_ready, - ctx); + task); return; case DIAL_3GPP_STEP_LAST: - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->data), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_pointer (task, + g_object_ref (ctx->data), + g_object_unref); + g_object_unref (task); return; } } @@ -327,22 +447,20 @@ gpointer user_data) { Dial3gppContext *ctx; + GTask *task; g_assert (primary != NULL); ctx = g_slice_new0 (Dial3gppContext); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); ctx->cid = cid; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - dial_3gpp); - ctx->cancellable = g_object_ref (cancellable); ctx->step = DIAL_3GPP_STEP_FIRST; - dial_3gpp_context_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)dial_3gpp_context_free); + + dial_3gpp_context_step (task); } /*****************************************************************************/ @@ -353,13 +471,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_disconnect_3gpp_ready (MMBroadbandBearer *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -368,15 +486,14 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void disconnect_scact_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -387,9 +504,8 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -402,14 +518,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; g_assert (primary != NULL); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect_3gpp); + task = g_task_new (self, NULL, callback, user_data); if (!MM_IS_PORT_SERIAL_AT (data)) { gchar *command; @@ -424,7 +537,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)disconnect_scact_ready, - result); + task); g_free (command); return; } @@ -438,7 +551,7 @@ data, cid, (GAsyncReadyCallback)parent_disconnect_3gpp_ready, - result); + task); } /*****************************************************************************/ @@ -533,13 +646,18 @@ static void mm_broadband_bearer_sierra_class_init (MMBroadbandBearerSierraClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass); MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass); g_type_class_add_private (object_class, sizeof (MMBroadbandBearerSierraPrivate)); object_class->set_property = set_property; object_class->get_property = get_property; + + base_bearer_class->load_connection_status = load_connection_status; + base_bearer_class->load_connection_status_finish = load_connection_status_finish; + broadband_bearer_class->dial_3gpp = dial_3gpp; broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; broadband_bearer_class->disconnect_3gpp = disconnect_3gpp; diff -Nru modemmanager-1.6.8/plugins/sierra/mm-broadband-modem-sierra.c modemmanager-1.10.0/plugins/sierra/mm-broadband-modem-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-broadband-modem-sierra.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-broadband-modem-sierra.c 2019-01-15 15:57:35.000000000 +0100 @@ -381,10 +381,9 @@ guint mask; } AccessTechInfo; -static void -access_tech_set_result (GSimpleAsyncResult *simple, - MMModemAccessTechnology act, - guint mask) +static AccessTechInfo * +access_tech_info_new (MMModemAccessTechnology act, + guint mask) { AccessTechInfo *info; @@ -392,7 +391,7 @@ info->act = act; info->mask = mask; - g_simple_async_result_set_op_res_gpointer (simple, info, g_free); + return info; } static gboolean @@ -404,27 +403,27 @@ { AccessTechInfo *info; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + info = g_task_propagate_pointer (G_TASK (res), error); + if (!info) return FALSE; - info = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_assert (info); *access_technologies = info->act; *mask = info->mask; + g_free (info); return TRUE; } static void access_tech_3gpp_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; const gchar *p; @@ -435,49 +434,53 @@ act = mm_string_to_access_tech (p + 1); if (act == MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN) - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't parse access technologies result: '%s'", response); else - access_tech_set_result (simple, act, MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK); + g_task_return_pointer ( + task, + access_tech_info_new (act, MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK), + g_free); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void -access_tech_cdma_ready (MMIfaceModemCdma *self, +access_tech_cdma_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; MMModemCdmaRegistrationState cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; MMModemCdmaRegistrationState evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; if (!parse_status (response, &cdma1x_state, &evdo_state, &act)) - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't parse access technologies result: '%s'", response); else - access_tech_set_result (simple, act, MM_IFACE_MODEM_CDMA_ALL_ACCESS_TECHNOLOGIES_MASK); + g_task_return_pointer ( + task, + access_tech_info_new (act, MM_IFACE_MODEM_CDMA_ALL_ACCESS_TECHNOLOGIES_MASK), + g_free); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -485,12 +488,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_access_technologies); + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_3gpp (self)) { mm_base_modem_at_command (MM_BASE_MODEM (self), @@ -498,7 +498,7 @@ 3, FALSE, (GAsyncReadyCallback)access_tech_3gpp_ready, - result); + task); return; } @@ -508,7 +508,7 @@ 3, FALSE, (GAsyncReadyCallback)access_tech_cdma_ready, - result); + task); return; } @@ -523,16 +523,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -542,17 +539,15 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* CDMA-only modems don't support changing modes, default to parent's */ if (!mm_iface_modem_is_3gpp (self)) { - g_simple_async_result_set_op_res_gpointer (simple, all, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_pointer (task, all, (GDestroyNotify) g_array_unref); + g_object_unref (task); return; } @@ -598,9 +593,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -612,10 +606,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -635,35 +626,36 @@ { LoadCurrentModesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *allowed = result->allowed; *preferred = result->preferred; + g_free (result); return TRUE; } static void selrat_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - LoadCurrentModesResult result; + LoadCurrentModesResult *result; const gchar *response; GError *error = NULL; GRegex *r = NULL; GMatchInfo *match_info = NULL; - response = mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_full_finish (self, res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } + result = g_new0 (LoadCurrentModesResult, 1); + /* Example response: !SELRAT: 03, UMTS 3G Preferred */ r = g_regex_new ("!SELRAT:\\s*(\\d+).*$", 0, 0, NULL); g_assert (r != NULL); @@ -674,51 +666,51 @@ if (mm_get_uint_from_match_info (match_info, 1, &mode) && mode <= 7) { switch (mode) { case 0: - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_NONE; if (mm_iface_modem_is_3gpp_lte (MM_IFACE_MODEM (self))) - result.allowed |= MM_MODEM_MODE_4G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed |= MM_MODEM_MODE_4G; + result->preferred = MM_MODEM_MODE_NONE; break; case 1: - result.allowed = MM_MODEM_MODE_3G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_3G; + result->preferred = MM_MODEM_MODE_NONE; break; case 2: - result.allowed = MM_MODEM_MODE_2G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_2G; + result->preferred = MM_MODEM_MODE_NONE; break; case 3: /* in Sierra LTE devices, mode 3 is automatic, including LTE, no preference */ if (mm_iface_modem_is_3gpp_lte (MM_IFACE_MODEM (self))) { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + result->preferred = MM_MODEM_MODE_NONE; } else { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_3G; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_3G; } break; case 4: /* in Sierra LTE devices, mode 4 is automatic, including LTE, no preference */ if (mm_iface_modem_is_3gpp_lte (MM_IFACE_MODEM (self))) { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + result->preferred = MM_MODEM_MODE_NONE; } else { - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_2G; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_2G; } break; case 5: - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->preferred = MM_MODEM_MODE_NONE; break; case 6: - result.allowed = MM_MODEM_MODE_4G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_4G; + result->preferred = MM_MODEM_MODE_NONE; break; case 7: - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + result->preferred = MM_MODEM_MODE_NONE; break; default: g_assert_not_reached (); @@ -735,16 +727,16 @@ "Could not parse allowed mode response: Response didn't match: '%s'", response); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); - if (error) - g_simple_async_result_take_error (simple, error); - else - g_simple_async_result_set_op_res_gpointer (simple, &result, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + if (error) { + g_free (result); + g_task_return_error (task, error); + } else + g_task_return_pointer (task, result, g_free); + + g_object_unref (task); } static void @@ -752,35 +744,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; MMPortSerialAt *primary; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (!mm_iface_modem_is_3gpp (self)) { /* Cannot do this in CDMA modems */ - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot load allowed modes in CDMA modems"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot load allowed modes in CDMA modems"); + g_object_unref (task); return; } /* Sierra secondary ports don't have full AT command interpreters */ primary = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); if (!primary || mm_port_get_connected (MM_PORT (primary))) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_CONNECTED, - "Cannot load allowed modes while connected"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_CONNECTED, + "Cannot load allowed modes while connected"); + g_object_unref (task); return; } @@ -792,7 +778,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)selrat_query_ready, - result); + task); } /*****************************************************************************/ @@ -803,23 +789,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void selrat_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - if (!mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error)) + if (!mm_base_modem_at_command_full_finish (self, res, &error)) /* Let the error be critical. */ - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -829,37 +815,31 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; MMPortSerialAt *primary; gint idx = -1; gchar *command; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (!mm_iface_modem_is_3gpp (self)) { /* Cannot do this in CDMA modems */ - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot set allowed modes in CDMA modems"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot set allowed modes in CDMA modems"); + g_object_unref (task); return; } /* Sierra secondary ports don't have full AT command interpreters */ primary = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); if (!primary || mm_port_get_connected (MM_PORT (primary))) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_CONNECTED, - "Cannot set allowed modes while connected"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_CONNECTED, + "Cannot set allowed modes while connected"); + g_object_unref (task); return; } @@ -893,18 +873,17 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); + g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -917,7 +896,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)selrat_set_ready, - result); + task); g_free (command); } @@ -929,14 +908,14 @@ GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -945,7 +924,7 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; guint timeout = 8; const gchar **drivers; guint i; @@ -961,12 +940,9 @@ timeout = 3; } - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); - g_timeout_add_seconds (timeout, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (timeout, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -977,28 +953,24 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_own_numbers_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GStrv numbers; numbers = iface_modem_parent->load_own_numbers_finish (self, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, numbers, NULL); + g_task_return_pointer (task, numbers, (GDestroyNotify)g_strfreev); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } #define MDN_TAG "MDN: " @@ -1006,7 +978,7 @@ static void own_numbers_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response, *p; const gchar *numbers[2] = { NULL, NULL }; @@ -1036,11 +1008,10 @@ goto fallback; } - g_simple_async_result_set_op_res_gpointer (simple, - g_strdupv ((gchar **) numbers), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, + g_strdupv ((gchar **) numbers), + (GDestroyNotify)g_strfreev); + g_object_unref (task); return; fallback: @@ -1048,7 +1019,7 @@ iface_modem_parent->load_own_numbers ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_own_numbers_ready, - simple); + task); } static void @@ -1056,20 +1027,17 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; mm_dbg ("loading own numbers (Sierra)..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_own_numbers); + task = g_task_new (self, NULL, callback, user_data); /* 3GPP modems can just run parent's own number loading */ if (mm_iface_modem_is_3gpp (self)) { iface_modem_parent->load_own_numbers ( self, (GAsyncReadyCallback)parent_load_own_numbers_ready, - result); + task); return; } @@ -1082,7 +1050,7 @@ 3, FALSE, (GAsyncReadyCallback)own_numbers_ready, - result); + task); } /*****************************************************************************/ @@ -1093,31 +1061,24 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_sierra_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_sierra_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void @@ -1126,12 +1087,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("Creating Sierra bearer..."); mm_broadband_bearer_sierra_new (MM_BROADBAND_MODEM (self), @@ -1139,7 +1097,7 @@ FALSE, /* is_icera */ NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_sierra_new_ready, - result); + task); } /*****************************************************************************/ @@ -1174,22 +1132,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void modem_power_down_ready (MMBaseModem *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { /* Ignore errors for now; we're not sure if all Sierra CDMA devices support * at!pcstate or 3GPP devices support +CFUN=4. */ - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL); + mm_base_modem_at_command_finish (self, res, NULL); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -1197,12 +1154,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_down); + task = g_task_new (self, NULL, callback, user_data); /* For CDMA modems, run !pcstate */ if (mm_iface_modem_is_cdma_only (self)) { @@ -1211,7 +1165,7 @@ 5, FALSE, (GAsyncReadyCallback)modem_power_down_ready, - result); + task); return; } @@ -1221,7 +1175,7 @@ 3, FALSE, (GAsyncReadyCallback)modem_power_down_ready, - result); + task); } /*****************************************************************************/ @@ -1247,51 +1201,51 @@ { SetupRegistrationChecksResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step; *skip_qcdm_hdr_step = results->skip_qcdm_hdr_step; *skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step; *skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step; *skip_detailed_registration_state = results->skip_detailed_registration_state; + g_free (results); return TRUE; } static void parent_setup_registration_checks_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - SetupRegistrationChecksResults results = { 0 }; + SetupRegistrationChecksResults *results; + results = g_new0 (SetupRegistrationChecksResults, 1); if (!iface_modem_cdma_parent->setup_registration_checks_finish (self, res, - &results.skip_qcdm_call_manager_step, - &results.skip_qcdm_hdr_step, - &results.skip_at_cdma_service_status_step, - &results.skip_at_cdma1x_serving_system_step, - &results.skip_detailed_registration_state, + &results->skip_qcdm_call_manager_step, + &results->skip_qcdm_hdr_step, + &results->skip_at_cdma_service_status_step, + &results->skip_at_cdma1x_serving_system_step, + &results->skip_detailed_registration_state, &error)) { - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + g_free (results); } else { /* Skip +CSS */ - results.skip_at_cdma1x_serving_system_step = TRUE; + results->skip_at_cdma1x_serving_system_step = TRUE; /* Skip +CAD */ - results.skip_at_cdma_service_status_step = TRUE; + results->skip_at_cdma_service_status_step = TRUE; /* Force to always use the detailed registration checks, as we have * !STATUS for that */ - results.skip_detailed_registration_state = FALSE; + results->skip_detailed_registration_state = FALSE; - g_simple_async_result_set_op_res_gpointer (simple, &results, NULL); + g_task_return_pointer (task, results, g_free); } - - /* All done. NOTE: complete NOT in idle! */ - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1299,17 +1253,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_registration_checks); + task = g_task_new (self, NULL, callback, user_data); /* Run parent's checks first */ iface_modem_cdma_parent->setup_registration_checks (self, (GAsyncReadyCallback)parent_setup_registration_checks_ready, - result); + task); } /*****************************************************************************/ @@ -1320,22 +1271,6 @@ MMModemCdmaRegistrationState detailed_evdo_state; } DetailedRegistrationStateResults; -typedef struct { - MMBroadbandModemSierra *self; - GSimpleAsyncResult *result; - DetailedRegistrationStateResults state; -} DetailedRegistrationStateContext; - -static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) -{ - /* Always not in idle! we're passing a struct in stack as result */ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean get_detailed_registration_state_finish (MMIfaceModemCdma *self, GAsyncResult *res, @@ -1345,42 +1280,36 @@ { DetailedRegistrationStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *detailed_cdma1x_state = results->detailed_cdma1x_state; *detailed_evdo_state = results->detailed_evdo_state; + g_free (results); return TRUE; } static void -status_ready (MMIfaceModemCdma *self, +status_ready (MMBaseModem *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { - GError *error = NULL; + DetailedRegistrationStateResults *results; const gchar *response; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - /* If error, leave superclass' reg state alone if AT!STATUS isn't supported. */ - if (error) { - g_error_free (error); + results = g_task_get_task_data (task); - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); - return; - } + /* If error, leave superclass' reg state alone if AT!STATUS isn't supported. */ + response = mm_base_modem_at_command_finish (self, res, NULL); + if (response) + parse_status (response, + &(results->detailed_cdma1x_state), + &(results->detailed_evdo_state), + NULL); - parse_status (response, - &(ctx->state.detailed_cdma1x_state), - &(ctx->state.detailed_evdo_state), - NULL); - - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, g_memdup (results, sizeof (*results)), g_free); + g_object_unref (task); } static void @@ -1390,24 +1319,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - DetailedRegistrationStateContext *ctx; + DetailedRegistrationStateResults *results; + GTask *task; - /* Setup context */ - ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_detailed_registration_state); - ctx->state.detailed_cdma1x_state = cdma1x_state; - ctx->state.detailed_evdo_state = evdo_state; + results = g_new0 (DetailedRegistrationStateResults, 1); + results->detailed_cdma1x_state = cdma1x_state; + results->detailed_evdo_state = evdo_state; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, results, g_free); mm_base_modem_at_command (MM_BASE_MODEM (self), "!STATUS", 3, FALSE, (GAsyncReadyCallback)status_ready, - ctx); + task); } /*****************************************************************************/ @@ -1454,8 +1381,7 @@ } } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return result; } @@ -1544,18 +1470,17 @@ GAsyncResult *res, GError **error) { - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } static void modem_time_check_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GVariant *result; - - g_simple_async_result_set_op_res_gboolean (simple, FALSE); + gboolean supported = FALSE; result = mm_base_modem_at_sequence_finish (self, res, NULL, &error); if (!error && result) { @@ -1563,12 +1488,12 @@ sierra->priv->time_method = g_variant_get_uint32 (result); if (sierra->priv->time_method != TIME_METHOD_UNKNOWN) - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + supported = TRUE; } g_clear_error (&error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, supported); + g_object_unref (task); } static gboolean @@ -1604,20 +1529,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_time_check_support); - mm_base_modem_at_sequence ( MM_BASE_MODEM (self), time_check_sequence, NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)modem_time_check_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/sierra/mm-broadband-modem-sierra-icera.c modemmanager-1.10.0/plugins/sierra/mm-broadband-modem-sierra-icera.c --- modemmanager-1.6.8/plugins/sierra/mm-broadband-modem-sierra-icera.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-broadband-modem-sierra-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -44,31 +44,24 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_sierra_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_sierra_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + + g_object_unref (task); } static void @@ -77,12 +70,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("Creating Sierra bearer..."); mm_broadband_bearer_sierra_new (MM_BROADBAND_MODEM (self), @@ -90,7 +80,7 @@ TRUE, /* is_icera */ NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_sierra_new_ready, - result); + task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/sierra/mm-common-sierra.c modemmanager-1.10.0/plugins/sierra/mm-common-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-common-sierra.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-common-sierra.c 2018-11-15 09:55:53.000000000 +0100 @@ -53,9 +53,7 @@ pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), ptype, pflags, error); @@ -79,23 +77,14 @@ } typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; guint retries; } SierraCustomInitContext; static void -sierra_custom_init_context_complete_and_free (SierraCustomInitContext *ctx) +sierra_custom_init_context_free (SierraCustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (SierraCustomInitContext, ctx); } @@ -104,31 +93,36 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void sierra_custom_init_step (SierraCustomInitContext *ctx); +static void sierra_custom_init_step (GTask *task); static void gcap_ready (MMPortSerialAt *port, GAsyncResult *res, - SierraCustomInitContext *ctx) + GTask *task) { + MMPortProbe *probe; + SierraCustomInitContext *ctx; const gchar *response; GError *error = NULL; + probe = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + response = mm_port_serial_at_command_finish (port, res, &error); if (error) { /* If consumed all tries and the last error was a timeout, assume the * port is not AT */ if (ctx->retries == 0 && g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - mm_port_probe_set_result_at (ctx->probe, FALSE); + mm_port_probe_set_result_at (probe, FALSE); } /* If reported a hard parse error, this port is definitely not an AT * port, skip trying. */ else if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_PARSE_FAILED)) { - mm_port_probe_set_result_at (ctx->probe, FALSE); + mm_port_probe_set_result_at (probe, FALSE); ctx->retries = 0; } /* Some Icera-based devices (eg, USB305) have an AT-style port that @@ -136,16 +130,16 @@ * the real AT ports do this too, so let a retry tag the port as * supported if it responds correctly later. */ else if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN)) { - mm_port_probe_set_result_at (ctx->probe, FALSE); + mm_port_probe_set_result_at (probe, FALSE); } /* Just retry... */ - sierra_custom_init_step (ctx); + sierra_custom_init_step (task); goto out; } /* A valid reply to ATI tells us this is an AT port already */ - mm_port_probe_set_result_at (ctx->probe, TRUE); + mm_port_probe_set_result_at (probe, TRUE); /* Sierra APPx ports have limited AT command parsers that just reply with * "OK" to most commands. These can sometimes be used for PPP while the @@ -154,20 +148,20 @@ * secondary APP ports. */ if (strstr (response, "APP1")) { - g_object_set_data (G_OBJECT (ctx->probe), TAG_SIERRA_APP_PORT, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_SIERRA_APP_PORT, GUINT_TO_POINTER (TRUE)); /* PPP-on-APP1-port whitelist */ if (strstr (response, "C885") || strstr (response, "USB 306") || strstr (response, "MC8790")) - g_object_set_data (G_OBJECT (ctx->probe), TAG_SIERRA_APP1_PPP_OK, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_SIERRA_APP1_PPP_OK, GUINT_TO_POINTER (TRUE)); /* For debugging: let users figure out if their device supports PPP * on the APP1 port or not. */ if (getenv ("MM_SIERRA_APP1_PPP_OK")) { mm_dbg ("Sierra: APP1 PPP OK '%s'", response); - g_object_set_data (G_OBJECT (ctx->probe), TAG_SIERRA_APP1_PPP_OK, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_SIERRA_APP1_PPP_OK, GUINT_TO_POINTER (TRUE)); } } else if (strstr (response, "APP2") || strstr (response, "APP3") || @@ -175,11 +169,11 @@ /* Additional APP ports don't support most AT commands, so they cannot * be used as the primary port. */ - g_object_set_data (G_OBJECT (ctx->probe), TAG_SIERRA_APP_PORT, GUINT_TO_POINTER (TRUE)); + g_object_set_data (G_OBJECT (probe), TAG_SIERRA_APP_PORT, GUINT_TO_POINTER (TRUE)); } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sierra_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); out: if (error) @@ -187,22 +181,28 @@ } static void -sierra_custom_init_step (SierraCustomInitContext *ctx) +sierra_custom_init_step (GTask *task) { + SierraCustomInitContext *ctx; + GCancellable *cancellable; + + ctx = g_task_get_task_data (task); + cancellable = g_task_get_cancellable (task); + /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_cancellable_is_cancelled (cancellable)) { mm_dbg ("(Sierra) no need to keep on running custom init in '%s'", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sierra_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } if (ctx->retries == 0) { mm_dbg ("(Sierra) Couldn't get port type hints from '%s'", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sierra_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -213,9 +213,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + cancellable, (GAsyncReadyCallback)gcap_ready, - ctx); + task); } void @@ -226,18 +226,17 @@ gpointer user_data) { SierraCustomInitContext *ctx; + GTask *task; ctx = g_slice_new (SierraCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - mm_common_sierra_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->retries = 3; - sierra_custom_init_step (ctx); + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_check_cancellable (task, FALSE); + g_task_set_task_data (task, ctx, (GDestroyNotify)sierra_custom_init_context_free); + + sierra_custom_init_step (task); } /*****************************************************************************/ @@ -248,22 +247,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -sierra_power_up_wait_cb (GSimpleAsyncResult *result) +sierra_power_up_wait_cb (GTask *task) { - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } static void cfun_enable_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; guint i; @@ -271,9 +269,8 @@ gboolean is_new_sierra = FALSE; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -292,24 +289,23 @@ } } - /* The modem object will be valid in the callback as 'result' keeps a + /* The modem object will be valid in the callback as 'task' keeps a * reference to it. */ - g_timeout_add_seconds (is_new_sierra ? 5 : 10, (GSourceFunc)sierra_power_up_wait_cb, simple); + g_timeout_add_seconds (is_new_sierra ? 5 : 10, (GSourceFunc)sierra_power_up_wait_cb, task); } static void pcstate_enable_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { /* Ignore errors for now; we're not sure if all Sierra CDMA devices support * at!pcstate. */ mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -317,12 +313,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_common_sierra_modem_power_up); + task = g_task_new (self, NULL, callback, user_data); /* For CDMA modems, run !pcstate */ if (mm_iface_modem_is_cdma_only (self)) { @@ -331,7 +324,7 @@ 5, FALSE, (GAsyncReadyCallback)pcstate_enable_ready, - result); + task); return; } @@ -346,7 +339,7 @@ 10, FALSE, (GAsyncReadyCallback)cfun_enable_ready, - result); + task); } /*****************************************************************************/ @@ -357,33 +350,38 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_POWER_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemPowerState)GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_POWER_STATE_UNKNOWN; + } + return (MMModemPowerState)value; } static void parent_load_power_state_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; MMModemPowerState state; state = iface_modem_parent->load_power_state_finish (self, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (state), NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, state); + + g_object_unref (task); } static void pcstate_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *result; guint state; @@ -391,40 +389,38 @@ result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!result) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Parse power state reply */ result = mm_strip_tag (result, "!PCSTATE:"); if (!mm_get_uint_from_str (result, &state)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse !PCSTATE response '%s'", - result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse !PCSTATE response '%s'", + result); } else { switch (state) { case 0: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_LOW), NULL); + g_task_return_int (task, MM_MODEM_POWER_STATE_LOW); break; case 1: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_ON), NULL); + g_task_return_int (task, MM_MODEM_POWER_STATE_ON); break; default: - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled power state: '%u'", - state); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled power state: '%u'", + state); break; } } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } void @@ -432,12 +428,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_common_sierra_load_power_state); + task = g_task_new (self, NULL, callback, user_data); /* Check power state with AT!PCSTATE? */ if (mm_iface_modem_is_cdma_only (self)) { @@ -446,14 +439,14 @@ 3, FALSE, (GAsyncReadyCallback)pcstate_query_ready, - result); + task); return; } /* Otherwise run parent's */ iface_modem_parent->load_power_state (self, (GAsyncReadyCallback)parent_load_power_state_ready, - result); + task); } /*****************************************************************************/ @@ -494,7 +487,7 @@ ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/sierra/mm-modem-helpers-sierra.c modemmanager-1.10.0/plugins/sierra/mm-modem-helpers-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-modem-helpers-sierra.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/sierra/mm-modem-helpers-sierra.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-sierra.h" + +GList * +mm_sierra_parse_scact_read_response (const gchar *reply, + GError **error) +{ + GError *inner_error = NULL; + GRegex *r; + GMatchInfo *match_info; + GList *list; + + if (!reply || !reply[0]) + /* Nothing configured, all done */ + return NULL; + + list = NULL; + r = g_regex_new ("!SCACT:\\s*(\\d+),(\\d+)", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, &inner_error); + g_assert (r); + + g_regex_match_full (r, reply, strlen (reply), 0, 0, &match_info, &inner_error); + while (!inner_error && g_match_info_matches (match_info)) { + MM3gppPdpContextActive *pdp_active; + guint cid = 0; + guint aux = 0; + + if (!mm_get_uint_from_match_info (match_info, 1, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse CID from reply: '%s'", + reply); + break; + } + if (!mm_get_uint_from_match_info (match_info, 2, &aux) || (aux != 0 && aux != 1)) { + inner_error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse context status from reply: '%s'", + reply); + break; + } + + pdp_active = g_slice_new0 (MM3gppPdpContextActive); + pdp_active->cid = cid; + pdp_active->active = (gboolean) aux; + list = g_list_prepend (list, pdp_active); + + g_match_info_next (match_info, &inner_error); + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + mm_3gpp_pdp_context_active_list_free (list); + g_propagate_error (error, inner_error); + g_prefix_error (error, "Couldn't properly parse list of active/inactive PDP contexts. "); + return NULL; + } + + list = g_list_sort (list, (GCompareFunc) mm_3gpp_pdp_context_active_cmp); + + return list; +} diff -Nru modemmanager-1.6.8/plugins/sierra/mm-modem-helpers-sierra.h modemmanager-1.10.0/plugins/sierra/mm-modem-helpers-sierra.h --- modemmanager-1.6.8/plugins/sierra/mm-modem-helpers-sierra.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/sierra/mm-modem-helpers-sierra.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,26 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_MODEM_HELPERS_SIERRA_H +#define MM_MODEM_HELPERS_SIERRA_H + +#include +#include + +/* MM3gppPdpContextActive list */ +GList *mm_sierra_parse_scact_read_response (const gchar *reply, + GError **error); + +#endif /* MM_MODEM_HELPERS_SIERRA_H */ diff -Nru modemmanager-1.6.8/plugins/sierra/mm-plugin-sierra.c modemmanager-1.10.0/plugins/sierra/mm-plugin-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-plugin-sierra.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-plugin-sierra.c 2018-11-15 09:55:53.000000000 +0100 @@ -43,7 +43,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -53,7 +53,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered Sierra modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -64,7 +64,7 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { mm_dbg ("MBIM-powered Sierra modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -73,7 +73,7 @@ #endif /* Fallback to default modem in the worst case */ - return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/sierra/mm-plugin-sierra-legacy.c modemmanager-1.10.0/plugins/sierra/mm-plugin-sierra-legacy.c --- modemmanager-1.6.8/plugins/sierra/mm-plugin-sierra-legacy.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-plugin-sierra-legacy.c 2018-11-15 09:55:53.000000000 +0100 @@ -37,7 +37,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -45,13 +45,13 @@ GError **error) { if (mm_common_sierra_port_probe_list_is_icera (probes)) - return MM_BASE_MODEM (mm_broadband_modem_sierra_icera_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_sierra_icera_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); - return MM_BASE_MODEM (mm_broadband_modem_sierra_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_sierra_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/sierra/mm-sim-sierra.c modemmanager-1.10.0/plugins/sierra/mm-sim-sierra.c --- modemmanager-1.6.8/plugins/sierra/mm-sim-sierra.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/sierra/mm-sim-sierra.c 2018-11-15 09:55:53.000000000 +0100 @@ -41,20 +41,13 @@ GAsyncResult *res, GError **error) { - gchar *iccid; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - iccid = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("loaded SIM identifier: %s", iccid); - return g_strdup (iccid); + return g_task_propagate_pointer (G_TASK (res), error); } static void iccid_read_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response; @@ -64,32 +57,29 @@ response = mm_base_modem_at_command_finish (modem, res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } p = mm_strip_tag (response, "!ICCID:"); if (!p) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse !ICCID response: '%s'", - response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse !ICCID response: '%s'", + response); + g_object_unref (task); return; } parsed = mm_3gpp_parse_iccid (p, &local); if (parsed) - g_simple_async_result_set_op_res_gpointer (simple, parsed, g_free); + g_task_return_pointer (task, parsed, g_free); else - g_simple_async_result_take_error (simple, local); + g_task_return_error (task, local); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -98,11 +88,14 @@ gpointer user_data) { MMBaseModem *modem = NULL; + GTask *task; g_object_get (self, MM_BASE_SIM_MODEM, &modem, NULL); + task = g_task_new (self, NULL, callback, user_data); + mm_dbg ("loading (Sierra) SIM identifier..."); mm_base_modem_at_command ( modem, @@ -110,10 +103,7 @@ 3, FALSE, (GAsyncReadyCallback)iccid_read_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_sim_identifier)); + task); g_object_unref (modem); } diff -Nru modemmanager-1.6.8/plugins/sierra/tests/test-modem-helpers-sierra.c modemmanager-1.10.0/plugins/sierra/tests/test-modem-helpers-sierra.c --- modemmanager-1.6.8/plugins/sierra/tests/test-modem-helpers-sierra.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/sierra/tests/test-modem-helpers-sierra.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,150 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-sierra.h" + +/*****************************************************************************/ +/* Test !SCACT? responses */ + +static void +test_scact_read_results (const gchar *desc, + const gchar *reply, + MM3gppPdpContextActive *expected_results, + guint32 expected_results_len) +{ + GList *l; + GError *error = NULL; + GList *results; + + g_debug ("\nTesting %s !SCACT response...\n", desc); + + results = mm_sierra_parse_scact_read_response (reply, &error); + g_assert_no_error (error); + if (expected_results_len) { + g_assert (results); + g_assert_cmpuint (g_list_length (results), ==, expected_results_len); + } + + for (l = results; l; l = g_list_next (l)) { + MM3gppPdpContextActive *pdp = l->data; + gboolean found = FALSE; + guint i; + + for (i = 0; !found && i < expected_results_len; i++) { + MM3gppPdpContextActive *expected; + + expected = &expected_results[i]; + if (pdp->cid == expected->cid) { + found = TRUE; + g_assert_cmpuint (pdp->active, ==, expected->active); + } + } + + g_assert (found == TRUE); + } + + mm_3gpp_pdp_context_active_list_free (results); +} + +static void +test_scact_read_response_none (void) +{ + test_scact_read_results ("none", "", NULL, 0); +} + +static void +test_scact_read_response_single_inactive (void) +{ + const gchar *reply = "!SCACT: 1,0\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, FALSE }, + }; + + test_scact_read_results ("single inactive", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +static void +test_scact_read_response_single_active (void) +{ + const gchar *reply = "!SCACT: 1,1\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, TRUE }, + }; + + test_scact_read_results ("single active", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +static void +test_scact_read_response_multiple (void) +{ + const gchar *reply = + "!SCACT: 1,0\r\n" + "!SCACT: 4,1\r\n" + "!SCACT: 5,0\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, FALSE }, + { 4, TRUE }, + { 5, FALSE }, + }; + + test_scact_read_results ("multiple", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +/*****************************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/sierra/scact/read/none", test_scact_read_response_none); + g_test_add_func ("/MM/sierra/scact/read/single-inactive", test_scact_read_response_single_inactive); + g_test_add_func ("/MM/sierra/scact/read/single-active", test_scact_read_response_single_active); + g_test_add_func ("/MM/sierra/scact/read/multiple", test_scact_read_response_multiple); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/plugins/simtech/77-mm-simtech-port-types.rules modemmanager-1.10.0/plugins/simtech/77-mm-simtech-port-types.rules --- modemmanager-1.6.8/plugins/simtech/77-mm-simtech-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/simtech/77-mm-simtech-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -10,31 +10,27 @@ # *ser.inf lists the aux ports that may be used for PPP. -ACTION!="add|change|move", GOTO="mm_simtech_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_simtech_port_types_end" - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e0e", GOTO="mm_alink_vendorcheck" +ACTION!="add|change|move|bind", GOTO="mm_simtech_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e0e", GOTO="mm_simtech_port_types" GOTO="mm_simtech_port_types_end" -LABEL="mm_alink_vendorcheck" +LABEL="mm_simtech_port_types" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # A-LINK 3GU -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_SIMTECH_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_SIMTECH_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_SIMTECH_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ENV{ID_MM_SIMTECH_TAGGED}="1" # Prolink PH-300 -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9100", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_SIMTECH_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9100", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_SIMTECH_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9100", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9100", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9100", ENV{ID_MM_SIMTECH_TAGGED}="1" # SCT UM300 -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9200", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_SIMTECH_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9200", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_SIMTECH_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9200", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9200", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9200", ENV{ID_MM_SIMTECH_TAGGED}="1" -GOTO="mm_simtech_port_types_end" - LABEL="mm_simtech_port_types_end" diff -Nru modemmanager-1.6.8/plugins/simtech/mm-broadband-modem-simtech.c modemmanager-1.10.0/plugins/simtech/mm-broadband-modem-simtech.c --- modemmanager-1.6.8/plugins/simtech/mm-broadband-modem-simtech.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/simtech/mm-broadband-modem-simtech.c 2018-11-15 09:55:53.000000000 +0100 @@ -99,7 +99,7 @@ G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -116,30 +116,28 @@ } static gboolean -modem_3gpp_setup_cleanup_unsolicited_events_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +modem_3gpp_setup_cleanup_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_SIMTECH (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -147,47 +145,32 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_SIMTECH (self), FALSE); @@ -195,34 +178,33 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Enabling unsolicited events (3GPP interface) */ static gboolean -modem_3gpp_enable_unsolicited_events_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +modem_3gpp_enable_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -own_enable_unsolicited_events_ready (MMBaseModem *self, +own_enable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { @@ -235,15 +217,15 @@ static void parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); + return; } /* Our own enable now */ @@ -255,26 +237,19 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_enable_unsolicited_events_ready, - simple); + task); } static void -modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); - /* Chain up parent's enable */ iface_modem_3gpp_parent->enable_unsolicited_events ( self, (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -282,10 +257,10 @@ static gboolean modem_3gpp_disable_unsolicited_events_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { @@ -296,31 +271,29 @@ static void parent_disable_unsolicited_events_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->disable_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -own_disable_unsolicited_events_ready (MMBaseModem *self, +own_disable_unsolicited_events_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_full_finish (self, res, NULL, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -328,7 +301,7 @@ iface_modem_3gpp_parent->disable_unsolicited_events ( MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)parent_disable_unsolicited_events_ready, - simple); + task); } static void @@ -336,13 +309,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); - /* Our own disable first */ mm_base_modem_at_sequence_full ( MM_BASE_MODEM (self), @@ -352,43 +318,45 @@ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)own_disable_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Load access technologies (Modem interface) */ static gboolean -load_access_technologies_finish (MMIfaceModem *self, - GAsyncResult *res, - MMModemAccessTechnology *access_technologies, - guint *mask, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) +load_access_technologies_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemAccessTechnology *access_technologies, + guint *mask, + GError **error) +{ + GError *inner_error = NULL; + gssize act; + + act = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - *access_technologies = (MMModemAccessTechnology) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + *access_technologies = (MMModemAccessTechnology) act; *mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; return TRUE; } static void -cnsmod_query_ready (MMBroadbandModemSimtech *self, +cnsmod_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response, *p; - GError *error = NULL; + GError *error = NULL; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -397,42 +365,30 @@ p = strchr (p, ','); if (!p || !isdigit (*(p + 1))) - g_simple_async_result_set_error ( - operation_result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to parse the +CNSMOD response: '%s'", response); else - g_simple_async_result_set_op_res_gpointer ( - operation_result, - GUINT_TO_POINTER (simtech_act_to_mm_act (atoi (p + 1))), - NULL); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_int (task, simtech_act_to_mm_act (atoi (p + 1))); + g_object_unref (task); } static void -load_access_technologies (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_access_technologies (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_access_technologies); + task = g_task_new (self, NULL, callback, user_data); /* Launch query only for 3GPP modems */ if (!mm_iface_modem_is_3gpp (self)) { - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN), - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); + g_object_unref (task); return; } @@ -442,39 +398,35 @@ 3, FALSE, (GAsyncReadyCallback)cnsmod_query_ready, - result); + task); } /*****************************************************************************/ /* Load supported modes (Modem interface) */ static GArray * -load_supported_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - GError *error = NULL; - GArray *all; - GArray *combinations; - GArray *filtered; - MMModemModeCombination mode; + GError *error = NULL; + GArray *all; + GArray *combinations; + GArray *filtered; + MMModemModeCombination mode; all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -506,24 +458,20 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void -load_supported_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { /* Run parent's loading */ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -535,70 +483,61 @@ } LoadCurrentModesResult; typedef struct { - MMBroadbandModemSimtech *self; - GSimpleAsyncResult *result; gint acqord; gint modepref; } LoadCurrentModesContext; -static void -load_current_modes_context_complete_and_free (LoadCurrentModesContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean -load_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - MMModemMode *allowed, - MMModemMode *preferred, - GError **error) +load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) { LoadCurrentModesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *allowed = result->allowed; + *allowed = result->allowed; *preferred = result->preferred; + g_free (result); return TRUE; } static void cnmp_query_ready (MMBroadbandModemSimtech *self, - GAsyncResult *res, - LoadCurrentModesContext *ctx) + GAsyncResult *res, + GTask *task) { - LoadCurrentModesResult *result; - const gchar *response, *p; - GError *error = NULL; + LoadCurrentModesContext *ctx; + LoadCurrentModesResult *result; + const gchar *response, *p; + GError *error = NULL; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); - load_current_modes_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + p = mm_strip_tag (response, "+CNMP:"); if (!p) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse the mode preference response: '%s'", - response); - load_current_modes_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse the mode preference response: '%s'", + response); + g_object_unref (task); return; } result = g_new (LoadCurrentModesResult, 1); - result->allowed = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_NONE; result->preferred = MM_MODEM_MODE_NONE; ctx->modepref = atoi (p); @@ -619,13 +558,14 @@ result->preferred = MM_MODEM_MODE_3G; break; default: - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Unknown acquisition order preference: '%d'", ctx->acqord); - load_current_modes_context_complete_and_free (ctx); + g_object_unref (task); + g_free (result); return; } break; @@ -643,51 +583,51 @@ break; default: - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Unknown mode preference: '%d'", ctx->modepref); - load_current_modes_context_complete_and_free (ctx); + g_object_unref (task); + g_free (result); return; } - /* Set final result and complete */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - result, - g_free); - load_current_modes_context_complete_and_free (ctx); + g_task_return_pointer (task, result, g_free); + g_object_unref (task); } static void -cnaop_query_ready (MMBroadbandModemSimtech *self, +cnaop_query_ready (MMBaseModem *self, GAsyncResult *res, - LoadCurrentModesContext *ctx) + GTask *task) { - const gchar *response, *p; - GError *error = NULL; + LoadCurrentModesContext *ctx; + const gchar *response, *p; + GError *error = NULL; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); - load_current_modes_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + p = mm_strip_tag (response, "+CNAOP:"); if (p) ctx->acqord = atoi (p); if (ctx->acqord < 0 || ctx->acqord > 2) { - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Failed to parse the acquisition order response: '%s'", response); - load_current_modes_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -697,91 +637,80 @@ 3, FALSE, (GAsyncReadyCallback)cnmp_query_ready, - ctx); + task); } static void -load_current_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; LoadCurrentModesContext *ctx; ctx = g_new (LoadCurrentModesContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); - ctx->acqord = -1; + ctx->acqord = -1; ctx->modepref = -1; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + mm_base_modem_at_command ( MM_BASE_MODEM (self), "+CNAOP?", 3, FALSE, (GAsyncReadyCallback)cnaop_query_ready, - ctx); + task); } /*****************************************************************************/ /* Set allowed modes (Modem interface) */ typedef struct { - MMBroadbandModemSimtech *self; - GSimpleAsyncResult *result; guint nmp; /* mode preference */ guint naop; /* acquisition order */ } SetCurrentModesContext; -static void -set_current_modes_context_complete_and_free (SetCurrentModesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean -set_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -cnaop_set_ready (MMBaseModem *self, +cnaop_set_ready (MMBaseModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -cnmp_set_ready (MMBaseModem *self, +cnmp_set_ready (MMBaseModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { - GError *error = NULL; - gchar *command; + SetCurrentModesContext *ctx; + GError *error = NULL; + gchar *command; + + ctx = g_task_get_task_data (task); mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); - set_current_modes_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -792,33 +721,30 @@ 3, FALSE, (GAsyncReadyCallback)cnaop_set_ready, - ctx); + task); g_free (command); } static void -set_current_modes (MMIfaceModem *self, - MMModemMode allowed, - MMModemMode preferred, - GAsyncReadyCallback callback, - gpointer user_data) +set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; SetCurrentModesContext *ctx; - gchar *command; - - ctx = g_new (SetCurrentModesContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + gchar *command; /* Defaults: automatic search */ - ctx->nmp = 2; + ctx = g_new (SetCurrentModesContext, 1); + ctx->nmp = 2; ctx->naop = 0; - if (allowed == MM_MODEM_MODE_ANY && - preferred == MM_MODEM_MODE_NONE) { + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + if (allowed == MM_MODEM_MODE_ANY && preferred == MM_MODEM_MODE_NONE) { /* defaults nmp and naop */ } else if (allowed == MM_MODEM_MODE_2G) { ctx->nmp = 13; @@ -841,17 +767,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - set_current_modes_context_complete_and_free (ctx); return; } @@ -862,7 +787,7 @@ 3, FALSE, (GAsyncReadyCallback)cnmp_set_ready, - ctx); + task); g_free (command); } diff -Nru modemmanager-1.6.8/plugins/simtech/mm-plugin-simtech.c modemmanager-1.10.0/plugins/simtech/mm-plugin-simtech.c --- modemmanager-1.6.8/plugins/simtech/mm-plugin-simtech.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/simtech/mm-plugin-simtech.c 2019-01-15 15:57:35.000000000 +0100 @@ -38,7 +38,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -48,7 +48,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered SimTech modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -56,61 +56,13 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_simtech_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_simtech_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortType ptype; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - ptype = mm_port_probe_get_port_type (probe); - - if (mm_port_probe_is_at (probe)) { - /* Look for port type hints; just probing can't distinguish which port should - * be the data/primary port on these devices. We have to tag them based on - * what the Windows .INF files say the port layout should be. - */ - if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_MODEM")) { - mm_dbg ("Simtech: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_AUX")) { - mm_dbg ("Simtech: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } - - /* If the port was tagged by the udev rules but isn't a primary or secondary, - * then ignore it to guard against race conditions if a device just happens - * to show up with more than two AT-capable ports. - */ - if (pflags == MM_PORT_SERIAL_AT_FLAG_NONE && - g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED")) - ptype = MM_PORT_TYPE_IGNORED; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - ptype, - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -142,5 +94,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/telit/77-mm-telit-port-types.rules modemmanager-1.10.0/plugins/telit/77-mm-telit-port-types.rules --- modemmanager-1.6.8/plugins/telit/77-mm-telit-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/77-mm-telit-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,58 +1,36 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_telit_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_telit_port_types_end" - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="1bc7", GOTO="mm_telit_vendorcheck" +ACTION!="add|change|move|bind", GOTO="mm_telit_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1bc7", GOTO="mm_telit_port_types" GOTO="mm_telit_port_types_end" -LABEL="mm_telit_vendorcheck" +LABEL="mm_telit_port_types" SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # UC864-E, UC864-E-AUTO, UC864-K, UC864-WD, UC864-WDU -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003", ENV{ID_MM_TELIT_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" # UC864-G -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{ID_MM_TELIT_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_GPS}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" # CC864-DUAL -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{ID_MM_TELIT_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_GPS}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" # CC864-SINGLE, CC864-KPS -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006", ENV{ID_MM_TELIT_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" # DE910-DUAL -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_MM_TELIT_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_GPS}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" # CE910-DUAL -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_MM_TELIT_TAGGED}="1" - -# HE910, UE910, UL865 (dynamic port identification supported) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_MM_TELIT_TAGGED}="1", ENV{ID_MM_TELIT_PORTS_TAGGED}="1" - -# GE910 (dynamic port identification supported) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_MM_TELIT_TAGGED}="1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_MM_TELIT_PORTS_TAGGED}="1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" -# LE910 V2 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_MM_TELIT_TAGGED}="1", ENV{ID_MM_TELIT_PORTS_TAGGED}="1" - -# NOTE: Qualcomm Gobi-based devices like the LE920 should not be handled -# by this plugin, but by the Gobi plugin. - -GOTO="mm_telit_port_types_end" LABEL="mm_telit_port_types_end" diff -Nru modemmanager-1.6.8/plugins/telit/mm-broadband-modem-telit.c modemmanager-1.10.0/plugins/telit/mm-broadband-modem-telit.c --- modemmanager-1.6.8/plugins/telit/mm-broadband-modem-telit.c 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-broadband-modem-telit.c 2018-11-15 09:55:53.000000000 +0100 @@ -32,16 +32,320 @@ #include "mm-iface-modem-3gpp.h" #include "mm-broadband-modem-telit.h" #include "mm-modem-helpers-telit.h" +#include "mm-telit-enums-types.h" static void iface_modem_init (MMIfaceModem *iface); static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface); static MMIfaceModem *iface_modem_parent; +static MMIfaceModem3gpp *iface_modem_3gpp_parent; G_DEFINE_TYPE_EXTENDED (MMBroadbandModemTelit, mm_broadband_modem_telit, MM_TYPE_BROADBAND_MODEM, 0, G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init)); +#define CSIM_UNLOCK_MAX_TIMEOUT 3 + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_NOT_SUPPORTED, + FEATURE_SUPPORTED +} FeatureSupport; + +struct _MMBroadbandModemTelitPrivate { + FeatureSupport csim_lock_support; + MMTelitQssStatus qss_status; + MMTelitCsimLockState csim_lock_state; + GTask *csim_lock_task; + guint csim_lock_timeout_id; + gboolean parse_qss; +}; + +/*****************************************************************************/ +/* After Sim Unlock (Modem interface) */ + +static gboolean +modem_after_sim_unlock_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static gboolean +after_sim_unlock_ready (GTask *task) +{ + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void +modem_after_sim_unlock (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* A short delay is necessary with some SIMs when + they have just been unlocked. Using 1 second as secure margin. */ + g_timeout_add_seconds (1, (GSourceFunc) after_sim_unlock_ready, task); +} + +/*****************************************************************************/ +/* Setup SIM hot swap (Modem interface) */ + +typedef enum { + QSS_SETUP_STEP_FIRST, + QSS_SETUP_STEP_QUERY, + QSS_SETUP_STEP_ENABLE_PRIMARY_PORT, + QSS_SETUP_STEP_ENABLE_SECONDARY_PORT, + QSS_SETUP_STEP_LAST +} QssSetupStep; + +typedef struct { + QssSetupStep step; + MMPortSerialAt *primary; + MMPortSerialAt *secondary; + GError *primary_error; + GError *secondary_error; +} QssSetupContext; + +static void qss_setup_step (GTask *task); +static void pending_csim_unlock_complete (MMBroadbandModemTelit *self); + +static void +telit_qss_unsolicited_handler (MMPortSerialAt *port, + GMatchInfo *match_info, + MMBroadbandModemTelit *self) +{ + MMTelitQssStatus cur_qss_status; + MMTelitQssStatus prev_qss_status; + + if (!mm_get_int_from_match_info (match_info, 1, (gint*)&cur_qss_status)) + return; + + prev_qss_status = self->priv->qss_status; + self->priv->qss_status = cur_qss_status; + + if (self->priv->csim_lock_state >= CSIM_LOCK_STATE_LOCK_REQUESTED) { + + if (prev_qss_status > QSS_STATUS_SIM_REMOVED && cur_qss_status == QSS_STATUS_SIM_REMOVED) { + mm_dbg ("QSS handler: #QSS=0 after +CSIM=1 -> CSIM locked!"); + self->priv->csim_lock_state = CSIM_LOCK_STATE_LOCKED; + } + + if (prev_qss_status == QSS_STATUS_SIM_REMOVED && cur_qss_status != QSS_STATUS_SIM_REMOVED) { + mm_dbg ("QSS handler: #QSS>=1 after +CSIM=0 -> CSIM unlocked!"); + self->priv->csim_lock_state = CSIM_LOCK_STATE_UNLOCKED; + + if (self->priv->csim_lock_timeout_id) { + g_source_remove (self->priv->csim_lock_timeout_id); + self->priv->csim_lock_timeout_id = 0; + } + + pending_csim_unlock_complete (self); + } + + return; + } + + if (cur_qss_status != prev_qss_status) + mm_dbg ("QSS handler: status changed '%s -> %s'", + mm_telit_qss_status_get_string (prev_qss_status), + mm_telit_qss_status_get_string (cur_qss_status)); + + if (self->priv->parse_qss == FALSE) { + mm_dbg ("QSS: message ignored"); + return; + } + + if ((prev_qss_status == QSS_STATUS_SIM_REMOVED && cur_qss_status != QSS_STATUS_SIM_REMOVED) || + (prev_qss_status > QSS_STATUS_SIM_REMOVED && cur_qss_status == QSS_STATUS_SIM_REMOVED)) { + mm_info ("QSS handler: SIM swap detected"); + mm_broadband_modem_update_sim_hot_swap_detected (MM_BROADBAND_MODEM (self)); + } +} + +static void +qss_setup_context_free (QssSetupContext *ctx) +{ + g_clear_object (&(ctx->primary)); + g_clear_object (&(ctx->secondary)); + g_clear_error (&(ctx->primary_error)); + g_clear_error (&(ctx->secondary_error)); + g_slice_free (QssSetupContext, ctx); +} + +static gboolean +modem_setup_sim_hot_swap_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +telit_qss_enable_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + QssSetupContext *ctx; + MMPortSerialAt *port; + GError **error; + GRegex *pattern; + + ctx = g_task_get_task_data (task); + + if (ctx->step == QSS_SETUP_STEP_ENABLE_PRIMARY_PORT) { + port = ctx->primary; + error = &ctx->primary_error; + } else if (ctx->step == QSS_SETUP_STEP_ENABLE_SECONDARY_PORT) { + port = ctx->secondary; + error = &ctx->secondary_error; + } else + g_assert_not_reached (); + + if (!mm_base_modem_at_command_full_finish (self, res, error)) { + mm_warn ("QSS: error enabling unsolicited on port %s: %s", mm_port_get_device (MM_PORT (port)), (*error)->message); + goto next_step; + } + + pattern = g_regex_new ("#QSS:\\s*([0-3])\\r\\n", G_REGEX_RAW, 0, NULL); + g_assert (pattern); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + pattern, + (MMPortSerialAtUnsolicitedMsgFn)telit_qss_unsolicited_handler, + self, + NULL); + g_regex_unref (pattern); + +next_step: + ctx->step++; + qss_setup_step (task); +} + +static void +telit_qss_query_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemTelit *self; + GError *error = NULL; + const gchar *response; + MMTelitQssStatus qss_status; + QssSetupContext *ctx; + + self = MM_BROADBAND_MODEM_TELIT (_self); + ctx = g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (_self, res, &error); + if (error) { + mm_warn ("Could not get \"#QSS?\" reply: %s", error->message); + g_error_free (error); + goto next_step; + } + + qss_status = mm_telit_parse_qss_query (response, &error); + if (error) { + mm_warn ("QSS query parse error: %s", error->message); + g_error_free (error); + goto next_step; + } + + mm_info ("QSS: current status is '%s'", mm_telit_qss_status_get_string (qss_status)); + self->priv->qss_status = qss_status; + +next_step: + ctx->step++; + qss_setup_step (task); +} + +static void +qss_setup_step (GTask *task) +{ + QssSetupContext *ctx; + MMBroadbandModemTelit *self; + + self = MM_BROADBAND_MODEM_TELIT (g_task_get_source_object (task)); + ctx = g_task_get_task_data (task); + + switch (ctx->step) { + case QSS_SETUP_STEP_FIRST: + /* Fall back on next step */ + ctx->step++; + case QSS_SETUP_STEP_QUERY: + mm_base_modem_at_command (MM_BASE_MODEM (self), + "#QSS?", + 3, + FALSE, + (GAsyncReadyCallback) telit_qss_query_ready, + task); + return; + case QSS_SETUP_STEP_ENABLE_PRIMARY_PORT: + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + ctx->primary, + "#QSS=1", + 3, + FALSE, + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback) telit_qss_enable_ready, + task); + return; + case QSS_SETUP_STEP_ENABLE_SECONDARY_PORT: + if (ctx->secondary) { + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + ctx->secondary, + "#QSS=1", + 3, + FALSE, + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback) telit_qss_enable_ready, + task); + return; + } + /* Fall back to next step */ + ctx->step++; + case QSS_SETUP_STEP_LAST: + /* If all enabling actions failed (either both, or only primary if + * there is no secondary), then we return an error */ + if (ctx->primary_error && + (ctx->secondary_error || !ctx->secondary)) + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "QSS: couldn't enable unsolicited"); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + break; + } +} + +static void +modem_setup_sim_hot_swap (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QssSetupContext *ctx; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_slice_new0 (QssSetupContext); + ctx->step = QSS_SETUP_STEP_FIRST; + ctx->primary = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + ctx->secondary = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); + + g_task_set_task_data (task, ctx, (GDestroyNotify) qss_setup_context_free); + qss_setup_step (task); +} + /*****************************************************************************/ /* Set current bands (Modem interface) */ @@ -50,25 +354,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -modem_set_current_bands_ready (MMIfaceModem *self, +modem_set_current_bands_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (error) { - g_simple_async_result_take_error (simple, error); - } else { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } + mm_base_modem_at_command_finish (self, res, &error); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -84,7 +386,7 @@ gboolean is_2g; gboolean is_3g; gboolean is_4g; - GSimpleAsyncResult *res; + GTask *task; mm_telit_get_band_flag (bands_array, &flag2g, &flag3g, &flag4g); @@ -93,32 +395,35 @@ is_4g = mm_iface_modem_is_4g (self); if (is_2g && flag2g == -1) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "None or invalid 2G bands combination in the provided list"); + g_task_report_new_error (self, + callback, + user_data, + modem_set_current_bands, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "None or invalid 2G bands combination in the provided list"); return; } if (is_3g && flag3g == -1) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "None or invalid 3G bands combination in the provided list"); + g_task_report_new_error (self, + callback, + user_data, + modem_set_current_bands, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "None or invalid 3G bands combination in the provided list"); return; } if (is_4g && flag4g == -1) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "None or invalid 4G bands combination in the provided list"); + g_task_report_new_error (self, + callback, + user_data, + modem_set_current_bands, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "None or invalid 4G bands combination in the provided list"); return; } @@ -136,24 +441,22 @@ else if (is_2g && !is_3g && is_4g) cmd = g_strdup_printf ("AT#BND=%d,0,%d", flag2g, flag4g); else { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unexpectd error: could not compose AT#BND command"); + g_task_report_new_error (self, + callback, + user_data, + modem_set_current_bands, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unexpected error: could not compose AT#BND command"); return; } - res = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_set_current_bands); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), cmd, 20, FALSE, (GAsyncReadyCallback)modem_set_current_bands_ready, - res); + task); g_free (cmd); } @@ -161,8 +464,6 @@ /* Load current bands (Modem interface) */ typedef struct { - MMIfaceModem *self; - GSimpleAsyncResult *result; gboolean mm_modem_is_2g; gboolean mm_modem_is_3g; gboolean mm_modem_is_4g; @@ -170,11 +471,8 @@ } LoadBandsContext; static void -load_bands_context_complete_and_free (LoadBandsContext *ctx) +load_bands_context_free (LoadBandsContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (LoadBandsContext, ctx); } @@ -183,26 +481,24 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); } static void load_bands_ready (MMBaseModem *self, GAsyncResult *res, - LoadBandsContext *ctx) + GTask *task) { const gchar *response; GError *error = NULL; GArray *bands = NULL; + LoadBandsContext *ctx; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else if (!mm_telit_parse_bnd_response (response, ctx->mm_modem_is_2g, ctx->mm_modem_is_3g, @@ -210,11 +506,11 @@ ctx->band_type, &bands, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (ctx->result, bands, (GDestroyNotify)g_array_unref); + g_task_return_pointer (task, bands, (GDestroyNotify)g_array_unref); - load_bands_context_complete_and_free(ctx); + g_object_unref (task); } static void @@ -222,30 +518,27 @@ GAsyncReadyCallback callback, gpointer user_data) { + GTask *task; LoadBandsContext *ctx; ctx = g_slice_new0 (LoadBandsContext); - ctx->self = g_object_ref (self); - ctx->mm_modem_is_2g = mm_iface_modem_is_2g (ctx->self); - ctx->mm_modem_is_3g = mm_iface_modem_is_3g (ctx->self); - ctx->mm_modem_is_4g = mm_iface_modem_is_4g (ctx->self); + ctx->mm_modem_is_2g = mm_iface_modem_is_2g (self); + ctx->mm_modem_is_3g = mm_iface_modem_is_3g (self); + ctx->mm_modem_is_4g = mm_iface_modem_is_4g (self); ctx->band_type = LOAD_CURRENT_BANDS; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_bands); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_bands_context_free); mm_base_modem_at_command (MM_BASE_MODEM (self), "#BND?", 3, FALSE, (GAsyncReadyCallback) load_bands_ready, - ctx); + task); } - /*****************************************************************************/ /* Load supported bands (Modem interface) */ @@ -254,27 +547,25 @@ GAsyncReadyCallback callback, gpointer user_data) { + GTask *task; LoadBandsContext *ctx; ctx = g_slice_new0 (LoadBandsContext); - ctx->self = g_object_ref (self); - ctx->mm_modem_is_2g = mm_iface_modem_is_2g (ctx->self); - ctx->mm_modem_is_3g = mm_iface_modem_is_3g (ctx->self); - ctx->mm_modem_is_4g = mm_iface_modem_is_4g (ctx->self); + ctx->mm_modem_is_2g = mm_iface_modem_is_2g (self); + ctx->mm_modem_is_3g = mm_iface_modem_is_3g (self); + ctx->mm_modem_is_4g = mm_iface_modem_is_4g (self); ctx->band_type = LOAD_SUPPORTED_BANDS; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_bands); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_bands_context_free); mm_base_modem_at_command (MM_BASE_MODEM (self), "#BND=?", 3, FALSE, (GAsyncReadyCallback) load_bands_ready, - ctx); + task); } /*****************************************************************************/ @@ -287,42 +578,29 @@ * always run. */ -#define CSIM_LOCK_STR "+CSIM=1" -#define CSIM_UNLOCK_STR "+CSIM=0" -#define CSIM_QUERY_PIN_RETRIES_STR "+CSIM=10,0020000100" -#define CSIM_QUERY_PUK_RETRIES_STR "+CSIM=10,002C000100" -#define CSIM_QUERY_PIN2_RETRIES_STR "+CSIM=10,0020008100" -#define CSIM_QUERY_PUK2_RETRIES_STR "+CSIM=10,002C008100" +#define CSIM_LOCK_STR "+CSIM=1" +#define CSIM_UNLOCK_STR "+CSIM=0" #define CSIM_QUERY_TIMEOUT 3 typedef enum { LOAD_UNLOCK_RETRIES_STEP_FIRST, LOAD_UNLOCK_RETRIES_STEP_LOCK, - LOAD_UNLOCK_RETRIES_STEP_PIN, - LOAD_UNLOCK_RETRIES_STEP_PUK, - LOAD_UNLOCK_RETRIES_STEP_PIN2, - LOAD_UNLOCK_RETRIES_STEP_PUK2, + LOAD_UNLOCK_RETRIES_STEP_PARENT, LOAD_UNLOCK_RETRIES_STEP_UNLOCK, LOAD_UNLOCK_RETRIES_STEP_LAST } LoadUnlockRetriesStep; typedef struct { - MMBroadbandModemTelit *self; - GSimpleAsyncResult *result; MMUnlockRetries *retries; LoadUnlockRetriesStep step; - guint succeded_requests; } LoadUnlockRetriesContext; -static void load_unlock_retries_step (LoadUnlockRetriesContext *ctx); +static void load_unlock_retries_step (GTask *task); static void -load_unlock_retries_context_complete_and_free (LoadUnlockRetriesContext *ctx) +load_unlock_retries_context_free (LoadUnlockRetriesContext *ctx) { - g_simple_async_result_complete (ctx->result); g_object_unref (ctx->retries); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (LoadUnlockRetriesContext, ctx); } @@ -331,172 +609,206 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (MMUnlockRetries*) g_object_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return (MMUnlockRetries *) g_task_propagate_pointer (G_TASK (res), error); } static void -csim_unlock_ready (MMBaseModem *self, - GAsyncResult *res, - LoadUnlockRetriesContext *ctx) +csim_unlock_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) { const gchar *response; GError *error = NULL; + MMBroadbandModemTelit *self; + LoadUnlockRetriesContext *ctx; + + self = MM_BROADBAND_MODEM_TELIT (_self); + ctx = g_task_get_task_data (task); /* Ignore errors */ - response = mm_base_modem_at_command_finish (self, res, &error); + response = mm_base_modem_at_command_finish (_self, res, &error); if (!response) { + if (g_error_matches (error, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED)) { + self->priv->csim_lock_support = FEATURE_NOT_SUPPORTED; + } mm_warn ("Couldn't unlock SIM card: %s", error->message); g_error_free (error); } + if (self->priv->csim_lock_support != FEATURE_NOT_SUPPORTED) + self->priv->csim_lock_support = FEATURE_SUPPORTED; + ctx->step++; - load_unlock_retries_step (ctx); + load_unlock_retries_step (task); } static void -csim_query_ready (MMBaseModem *self, - GAsyncResult *res, - LoadUnlockRetriesContext *ctx) +parent_load_unlock_retries_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + LoadUnlockRetriesContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + if (!(ctx->retries = iface_modem_parent->load_unlock_retries_finish (self, res, &error))) { + mm_warn ("couldn't load unlock retries with generic logic: %s", error->message); + g_error_free (error); + } + + ctx->step++; + load_unlock_retries_step (task); +} + +static void +csim_lock_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) { const gchar *response; - gint unlock_retries; - GError *error = NULL; + GError *error = NULL; + MMBroadbandModemTelit *self; + LoadUnlockRetriesContext *ctx; - response = mm_base_modem_at_command_finish (self, res, &error); + self = MM_BROADBAND_MODEM_TELIT (_self); + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (_self, res, &error); if (!response) { - mm_warn ("No respose for step %d: %s", ctx->step, error->message); - g_error_free (error); - goto next_step; + if (g_error_matches (error, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED)) { + self->priv->csim_lock_support = FEATURE_NOT_SUPPORTED; + mm_warn ("Couldn't lock SIM card: %s. Continuing without CSIM lock.", error->message); + g_error_free (error); + } else { + g_prefix_error (&error, "Couldn't lock SIM card: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + } else { + self->priv->csim_lock_state = CSIM_LOCK_STATE_LOCK_REQUESTED; } - if ( (unlock_retries = mm_telit_parse_csim_response (ctx->step, response, &error)) < 0) { - mm_warn ("Parse error in step %d: %s.", ctx->step, error->message); - g_error_free (error); - goto next_step; + if (self->priv->csim_lock_support != FEATURE_NOT_SUPPORTED) { + self->priv->csim_lock_support = FEATURE_SUPPORTED; } - ctx->succeded_requests++; + ctx->step++; + load_unlock_retries_step (task); +} - switch (ctx->step) { - case LOAD_UNLOCK_RETRIES_STEP_PIN: - mm_dbg ("PIN unlock retries left: %d", unlock_retries); - mm_unlock_retries_set (ctx->retries, MM_MODEM_LOCK_SIM_PIN, unlock_retries); - break; - case LOAD_UNLOCK_RETRIES_STEP_PUK: - mm_dbg ("PUK unlock retries left: %d", unlock_retries); - mm_unlock_retries_set (ctx->retries, MM_MODEM_LOCK_SIM_PUK, unlock_retries); - break; - case LOAD_UNLOCK_RETRIES_STEP_PIN2: - mm_dbg ("PIN2 unlock retries left: %d", unlock_retries); - mm_unlock_retries_set (ctx->retries, MM_MODEM_LOCK_SIM_PIN2, unlock_retries); +static void +handle_csim_locking (GTask *task, + gboolean is_lock) +{ + MMBroadbandModemTelit *self; + LoadUnlockRetriesContext *ctx; + + self = MM_BROADBAND_MODEM_TELIT (g_task_get_source_object (task)); + ctx = g_task_get_task_data (task); + + switch (self->priv->csim_lock_support) { + case FEATURE_SUPPORT_UNKNOWN: + case FEATURE_SUPPORTED: + if (is_lock) { + mm_base_modem_at_command (MM_BASE_MODEM (self), + CSIM_LOCK_STR, + CSIM_QUERY_TIMEOUT, + FALSE, + (GAsyncReadyCallback) csim_lock_ready, + task); + } else { + mm_base_modem_at_command (MM_BASE_MODEM (self), + CSIM_UNLOCK_STR, + CSIM_QUERY_TIMEOUT, + FALSE, + (GAsyncReadyCallback) csim_unlock_ready, + task); + } break; - case LOAD_UNLOCK_RETRIES_STEP_PUK2: - mm_dbg ("PUK2 unlock retries left: %d", unlock_retries); - mm_unlock_retries_set (ctx->retries, MM_MODEM_LOCK_SIM_PUK2, unlock_retries); + case FEATURE_NOT_SUPPORTED: + mm_dbg ("CSIM lock not supported by this modem. Skipping %s command", + is_lock ? "lock" : "unlock"); + ctx->step++; + load_unlock_retries_step (task); break; default: g_assert_not_reached (); break; } - -next_step: - ctx->step++; - load_unlock_retries_step (ctx); } static void -csim_lock_ready (MMBaseModem *self, - GAsyncResult *res, - LoadUnlockRetriesContext *ctx) +pending_csim_unlock_complete (MMBroadbandModemTelit *self) { - const gchar *response; - GError *error = NULL; + LoadUnlockRetriesContext *ctx; - response = mm_base_modem_at_command_finish (self, res, &error); - if (!response) { - g_prefix_error (&error, "Couldn't lock SIM card: "); - g_simple_async_result_take_error (ctx->result, error); - load_unlock_retries_context_complete_and_free (ctx); - return; + ctx = g_task_get_task_data (self->priv->csim_lock_task); + + if (!ctx->retries) { + g_task_return_new_error (self->priv->csim_lock_task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Could not get any of the SIM unlock retries values"); + } else { + g_task_return_pointer (self->priv->csim_lock_task, g_object_ref (ctx->retries), g_object_unref); } - ctx->step++; - load_unlock_retries_step (ctx); + g_clear_object (&self->priv->csim_lock_task); +} + +static gboolean +csim_unlock_periodic_check (MMBroadbandModemTelit *self) +{ + if (self->priv->csim_lock_state != CSIM_LOCK_STATE_UNLOCKED) { + mm_warn ("CSIM is still locked after %d seconds. Trying to continue anyway", CSIM_UNLOCK_MAX_TIMEOUT); + } + + self->priv->csim_lock_timeout_id = 0; + pending_csim_unlock_complete (self); + g_object_unref (self); + + return G_SOURCE_REMOVE; } static void -load_unlock_retries_step (LoadUnlockRetriesContext *ctx) +load_unlock_retries_step (GTask *task) { + MMBroadbandModemTelit *self; + LoadUnlockRetriesContext *ctx; + + self = MM_BROADBAND_MODEM_TELIT (g_task_get_source_object (task)); + ctx = g_task_get_task_data (task); switch (ctx->step) { case LOAD_UNLOCK_RETRIES_STEP_FIRST: /* Fall back on next step */ ctx->step++; case LOAD_UNLOCK_RETRIES_STEP_LOCK: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_LOCK_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_lock_ready, - ctx); + handle_csim_locking (task, TRUE); break; - case LOAD_UNLOCK_RETRIES_STEP_PIN: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_QUERY_PIN_RETRIES_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_query_ready, - ctx); - break; - case LOAD_UNLOCK_RETRIES_STEP_PUK: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_QUERY_PUK_RETRIES_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_query_ready, - ctx); - break; - case LOAD_UNLOCK_RETRIES_STEP_PIN2: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_QUERY_PIN2_RETRIES_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_query_ready, - ctx); - break; - case LOAD_UNLOCK_RETRIES_STEP_PUK2: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_QUERY_PUK2_RETRIES_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_query_ready, - ctx); + case LOAD_UNLOCK_RETRIES_STEP_PARENT: + iface_modem_parent->load_unlock_retries ( + MM_IFACE_MODEM (self), + (GAsyncReadyCallback)parent_load_unlock_retries_ready, + task); break; case LOAD_UNLOCK_RETRIES_STEP_UNLOCK: - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - CSIM_UNLOCK_STR, - CSIM_QUERY_TIMEOUT, - FALSE, - (GAsyncReadyCallback) csim_unlock_ready, - ctx); + handle_csim_locking (task, FALSE); break; case LOAD_UNLOCK_RETRIES_STEP_LAST: - if (ctx->succeded_requests == 0) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Could not get any of the SIM unlock retries values"); + self->priv->csim_lock_task = task; + if (self->priv->csim_lock_state == CSIM_LOCK_STATE_LOCKED) { + mm_dbg ("CSIM is locked. Waiting for #QSS=1"); + self->priv->csim_lock_timeout_id = g_timeout_add_seconds (CSIM_UNLOCK_MAX_TIMEOUT, + (GSourceFunc) csim_unlock_periodic_check, + g_object_ref(self)); } else { - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->retries), - (GDestroyNotify)g_object_unref); + self->priv->csim_lock_state = CSIM_LOCK_STATE_UNLOCKED; + pending_csim_unlock_complete (self); } - - load_unlock_retries_context_complete_and_free (ctx); break; default: break; @@ -508,20 +820,47 @@ GAsyncReadyCallback callback, gpointer user_data) { + GTask *task; LoadUnlockRetriesContext *ctx; - ctx = g_slice_new0 (LoadUnlockRetriesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_retries); + g_assert (iface_modem_parent->load_unlock_retries); + g_assert (iface_modem_parent->load_unlock_retries_finish); - ctx->retries = mm_unlock_retries_new (); + ctx = g_slice_new0 (LoadUnlockRetriesContext); ctx->step = LOAD_UNLOCK_RETRIES_STEP_FIRST; - ctx->succeded_requests = 0; - load_unlock_retries_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_unlock_retries_context_free); + + load_unlock_retries_step (task); +} + +/*****************************************************************************/ +/* Modem after power up (Modem interface) */ + +static gboolean +modem_after_power_up_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_after_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MMBroadbandModemTelit *modem = MM_BROADBAND_MODEM_TELIT (self); + + task = g_task_new (self, NULL, callback, user_data); + + mm_dbg ("Stop ignoring #QSS"); + modem->priv->parse_qss = TRUE; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -532,7 +871,28 @@ GAsyncResult *res, GError **error) { - return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +telit_modem_power_down_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (mm_base_modem_at_command_finish (self, res, &error)) { + mm_dbg ("Ignore #QSS unsolicited during power down/low"); + MM_BROADBAND_MODEM_TELIT (self)->priv->parse_qss = FALSE; + } + + if (error) { + mm_err ("modem power down: %s", error->message); + g_clear_error (&error); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -540,12 +900,15 @@ GAsyncReadyCallback callback, gpointer user_data) { + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CFUN=4", 20, FALSE, - callback, - user_data); + (GAsyncReadyCallback) telit_modem_power_down_ready, + task); } /*****************************************************************************/ @@ -721,52 +1084,6 @@ } /*****************************************************************************/ -/* Flow control (Modem interface) */ - -static gboolean -setup_flow_control_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - /* Completely ignore errors */ - return TRUE; -} - -static void -setup_flow_control (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - gchar *cmd; - guint flow_control = 1; /* Default flow control: XON/XOFF */ - - switch (mm_base_modem_get_product_id (MM_BASE_MODEM (self)) & 0xFFFF) { - case 0x0021: - flow_control = 2; /* Telit IMC modems support only RTS/CTS mode */ - break; - default: - break; - } - - cmd = g_strdup_printf ("+IFC=%u,%u", flow_control, flow_control); - mm_base_modem_at_command (MM_BASE_MODEM (self), - cmd, - 3, - FALSE, - NULL, - NULL); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_flow_control); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); - g_free (cmd); -} - -/*****************************************************************************/ /* Load current mode (Modem interface) */ static gboolean @@ -854,24 +1171,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -ws46_set_ready (MMIfaceModem *self, +ws46_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + mm_base_modem_at_command_finish (self, res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -881,14 +1197,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint ws46_mode = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) ws46_mode = 12; @@ -916,18 +1229,17 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); g_free (allowed_str); g_free (preferred_str); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); return; } @@ -938,7 +1250,7 @@ 10, FALSE, (GAsyncReadyCallback)ws46_set_ready, - result); + task); g_free (command); } @@ -950,16 +1262,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -969,17 +1278,15 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* CDMA-only modems don't support changing modes, default to parent's */ if (!mm_iface_modem_is_3gpp (self)) { - g_simple_async_result_set_op_res_gpointer (simple, all, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_pointer (task, all, (GDestroyNotify) g_array_unref); + g_object_unref (task); return; } @@ -1020,9 +1327,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -1034,50 +1340,76 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Enabling unsolicited events (3GPP interface) */ static gboolean -modem_3gpp_enable_unsolicited_events_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - /* Ignore errors */ - mm_base_modem_at_sequence_full_finish (MM_BASE_MODEM (self), - res, - NULL, - NULL); - return TRUE; +modem_3gpp_enable_unsolicited_events_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); } -static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { - /* Enable +CIEV only for: signal, service, roam */ - { "AT+CIND=0,1,1,0,0,0,1,0,0", 5, FALSE, NULL }, - /* Telit modems +CMER command supports only =2 */ - { "+CMER=3,0,0,2", 5, FALSE, NULL }, - { NULL } -}; +static void +cind_set_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) { + mm_warn ("Couldn't enable custom +CIND settings: %s", error->message); + g_error_free (error); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} static void -modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) { - mm_base_modem_at_sequence_full ( + GError *error = NULL; + + if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error)) { + mm_warn ("Couldn't enable parent 3GPP unsolicited events: %s", error->message); + g_error_free (error); + } + + /* Our own enable now */ + mm_base_modem_at_command_full ( MM_BASE_MODEM (self), mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)), - unsolicited_enable_sequence, - NULL, /* response_processor_context */ - NULL, /* response_processor_context_free */ - NULL, /* cancellable */ - callback, - user_data); + /* Enable +CIEV only for: signal, service, roam */ + "AT+CIND=0,1,1,0,0,0,1,0,0", + 5, + FALSE, + FALSE, + NULL, /* cancellable */ + (GAsyncReadyCallback)cind_set_ready, + task); +} + +static void +modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Chain up parent's enable */ + iface_modem_3gpp_parent->enable_unsolicited_events ( + self, + (GAsyncReadyCallback)parent_enable_unsolicited_events_ready, + task); } /*****************************************************************************/ @@ -1095,12 +1427,22 @@ MM_BASE_MODEM_PLUGIN, plugin, MM_BASE_MODEM_VENDOR_ID, vendor_id, MM_BASE_MODEM_PRODUCT_ID, product_id, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, TRUE, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, FALSE, NULL); } static void mm_broadband_modem_telit_init (MMBroadbandModemTelit *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + MM_TYPE_BROADBAND_MODEM_TELIT, + MMBroadbandModemTelitPrivate); + + self->priv->csim_lock_support = FEATURE_SUPPORT_UNKNOWN; + self->priv->csim_lock_state = CSIM_LOCK_STATE_UNKNOWN; + self->priv->qss_status = QSS_STATUS_UNKNOWN; + self->priv->parse_qss = TRUE; } static void @@ -1118,23 +1460,29 @@ iface->load_unlock_retries = modem_load_unlock_retries; iface->reset = modem_reset; iface->reset_finish = modem_reset_finish; + iface->modem_after_power_up = modem_after_power_up; + iface->modem_after_power_up_finish = modem_after_power_up_finish; iface->modem_power_down = modem_power_down; iface->modem_power_down_finish = modem_power_down_finish; iface->load_access_technologies = load_access_technologies; iface->load_access_technologies_finish = load_access_technologies_finish; - iface->setup_flow_control = setup_flow_control; - iface->setup_flow_control_finish = setup_flow_control_finish; iface->load_supported_modes = load_supported_modes; iface->load_supported_modes_finish = load_supported_modes_finish; iface->load_current_modes = load_current_modes; iface->load_current_modes_finish = load_current_modes_finish; iface->set_current_modes = set_current_modes; iface->set_current_modes_finish = set_current_modes_finish; + iface->modem_after_sim_unlock = modem_after_sim_unlock; + iface->modem_after_sim_unlock_finish = modem_after_sim_unlock_finish; + iface->setup_sim_hot_swap = modem_setup_sim_hot_swap; + iface->setup_sim_hot_swap_finish = modem_setup_sim_hot_swap_finish; } static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface) { + iface_modem_3gpp_parent = g_type_interface_peek_parent (iface); + iface->enable_unsolicited_events = modem_3gpp_enable_unsolicited_events; iface->enable_unsolicited_events_finish = modem_3gpp_enable_unsolicited_events_finish; } @@ -1142,4 +1490,7 @@ static void mm_broadband_modem_telit_class_init (MMBroadbandModemTelitClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMBroadbandModemTelitPrivate)); } diff -Nru modemmanager-1.6.8/plugins/telit/mm-broadband-modem-telit.h modemmanager-1.10.0/plugins/telit/mm-broadband-modem-telit.h --- modemmanager-1.6.8/plugins/telit/mm-broadband-modem-telit.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-broadband-modem-telit.h 2018-11-15 09:55:53.000000000 +0100 @@ -29,9 +29,11 @@ typedef struct _MMBroadbandModemTelit MMBroadbandModemTelit; typedef struct _MMBroadbandModemTelitClass MMBroadbandModemTelitClass; +typedef struct _MMBroadbandModemTelitPrivate MMBroadbandModemTelitPrivate; struct _MMBroadbandModemTelit { MMBroadbandModem parent; + MMBroadbandModemTelitPrivate *priv; }; struct _MMBroadbandModemTelitClass{ diff -Nru modemmanager-1.6.8/plugins/telit/mm-common-telit.c modemmanager-1.10.0/plugins/telit/mm-common-telit.c --- modemmanager-1.6.8/plugins/telit/mm-common-telit.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-common-telit.c 2019-01-15 15:57:35.000000000 +0100 @@ -34,78 +34,45 @@ MMPortProbe *probe, GError **error) { - GUdevDevice *port; + MMKernelDevice *port; MMDevice *device; MMPortType ptype; MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; + const gchar *subsys; port = mm_port_probe_peek_port (probe); ptype = mm_port_probe_get_port_type (probe); device = mm_port_probe_peek_device (probe); + subsys = mm_port_probe_get_port_subsys (probe); - /* Look for port type hints; just probing can't distinguish which port should - * be the data/primary port on these devices. We have to tag them based on - * what the Windows .INF files say the port layout should be. - * - * If no udev rules are found, AT#PORTCFG (if supported) can be used for - * identifying the port layout - */ - if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_MODEM_PORT)) { - mm_dbg ("telit: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_AUX_PORT)) { - mm_dbg ("telit: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } else if (g_udev_device_get_property_as_boolean (port, TAG_TELIT_NMEA_PORT)) { - mm_dbg ("telit: port '%s/%s' flagged as NMEA", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - ptype = MM_PORT_TYPE_GPS; - } else if (g_object_get_data (G_OBJECT (device), TAG_GETPORTCFG_SUPPORTED) != NULL) { - if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_MODEM_PORT)) == 0) { + /* Just skip custom port identification for subsys different than tty */ + if (!g_str_equal (subsys, "tty")) + goto out; + + /* AT#PORTCFG (if supported) can be used for identifying the port layout */ + if (g_object_get_data (G_OBJECT (device), TAG_GETPORTCFG_SUPPORTED) != NULL) { + if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_MODEM_PORT)) == 0) { mm_dbg ("telit: AT port '%s/%s' flagged as primary", mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe)); pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_AUX_PORT)) == 0) { + } else if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_AUX_PORT)) == 0) { mm_dbg ("telit: AT port '%s/%s' flagged as secondary", mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe)); pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } else if (g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_NMEA_PORT)) == 0) { + } else if (g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), g_object_get_data (G_OBJECT (device), TAG_TELIT_NMEA_PORT)) == 0) { mm_dbg ("telit: port '%s/%s' flagged as NMEA", mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe)); ptype = MM_PORT_TYPE_GPS; } else ptype = MM_PORT_TYPE_IGNORED; - } else { - /* If the port isn't explicitly tagged as primary, secondary, or gps - * port, we will fallback to flagging it as secondary, but only if it - * probed AT successfully. - * - * This is so that we support the case where a single TTY is exposed - * by the modem and no explicit port type hint is specified. - * - * From the modem point of view, only the AT_FLAG_PRIMARY would be - * important, as that is the port that would end up getting used for PPP - * in this case, so having multiple secondary ports, if that ever - * happened, wouldn't be an issue. - */ - if (mm_port_probe_is_at (probe)) - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - else - ptype = MM_PORT_TYPE_IGNORED; } +out: return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + port, ptype, pflags, error); @@ -115,10 +82,7 @@ /* Custom init */ typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; gboolean getportcfg_done; guint getportcfg_retries; } TelitCustomInitContext; @@ -128,10 +92,10 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void telit_custom_init_step (TelitCustomInitContext *ctx); +static void telit_custom_init_step (GTask *task); static gboolean cache_port_mode (MMDevice *device, @@ -212,10 +176,15 @@ static void getportcfg_ready (MMPortSerialAt *port, GAsyncResult *res, - TelitCustomInitContext *ctx) + GTask *task) { const gchar *response; GError *error = NULL; + MMPortProbe *probe; + TelitCustomInitContext *ctx; + + ctx = g_task_get_task_data (task); + probe = g_task_get_source_object (task); response = mm_port_serial_at_command_finish (port, res, &error); if (error) { @@ -232,7 +201,7 @@ } else { MMDevice *device; - device = mm_port_probe_peek_device (ctx->probe); + device = mm_port_probe_peek_device (probe); /* Results are cached in the parent device object */ if (g_object_get_data (G_OBJECT (device), TAG_GETPORTCFG_SUPPORTED) == NULL) { @@ -244,35 +213,34 @@ } /* Port answered to #PORTCFG, so mark it as being AT already */ - mm_port_probe_set_result_at (ctx->probe, TRUE); + mm_port_probe_set_result_at (probe, TRUE); } if (error) g_error_free (error); - telit_custom_init_step (ctx); + telit_custom_init_step (task); } static void -telit_custom_init_context_complete_and_free (TelitCustomInitContext *ctx) +telit_custom_init_context_free (TelitCustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (TelitCustomInitContext, ctx); } static void -telit_custom_init_step (TelitCustomInitContext *ctx) +telit_custom_init_step (GTask *task) { - GUdevDevice *port; + MMKernelDevice *port; + MMPortProbe *probe; + TelitCustomInitContext *ctx; + + ctx = g_task_get_task_data (task); + probe = g_task_get_source_object (task); /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_cancellable_is_cancelled (g_task_get_cancellable (task))) { mm_dbg ("telit: no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); goto out; @@ -281,9 +249,9 @@ /* Try to get a port configuration from the modem: usb interface 00 * is always linked to an AT port */ - port = mm_port_probe_peek_port (ctx->probe); + port = mm_port_probe_peek_port (probe); if (!ctx->getportcfg_done && - g_strcmp0 (g_udev_device_get_property (port, "ID_USB_INTERFACE_NUM"), "00") == 0) { + g_strcmp0 (mm_kernel_device_get_property (port, "ID_USB_INTERFACE_NUM"), "00") == 0) { if (ctx->getportcfg_retries == 0) goto out; @@ -295,15 +263,15 @@ 2, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)getportcfg_ready, - ctx); + task); return; } out: - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - telit_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -313,30 +281,17 @@ GAsyncReadyCallback callback, gpointer user_data) { - MMDevice *device; - GUdevDevice *udevDevice; TelitCustomInitContext *ctx; - - device = mm_port_probe_peek_device (probe); - udevDevice = mm_port_probe_peek_port (probe); + GTask *task; ctx = g_slice_new (TelitCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - telit_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->getportcfg_done = FALSE; ctx->getportcfg_retries = 3; - /* If the device is tagged for supporting #PORTCFG do the custom init */ - if (g_udev_device_get_property_as_boolean (udevDevice, "ID_MM_TELIT_PORTS_TAGGED")) { - telit_custom_init_step (ctx); - return; - } + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_check_cancellable (task, FALSE); + g_task_set_task_data (task, ctx, (GDestroyNotify)telit_custom_init_context_free); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - telit_custom_init_context_complete_and_free (ctx); + telit_custom_init_step (task); } diff -Nru modemmanager-1.6.8/plugins/telit/mm-modem-helpers-telit.c modemmanager-1.10.0/plugins/telit/mm-modem-helpers-telit.c --- modemmanager-1.6.8/plugins/telit/mm-modem-helpers-telit.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-modem-helpers-telit.c 2019-01-15 15:57:35.000000000 +0100 @@ -17,6 +17,7 @@ #include #include #include +#include #include #define _LIBMM_INSIDE_MMCLI @@ -43,21 +44,42 @@ guint i; for (i = 0; i < bands_array->len; i++) { - MMModemBand band = g_array_index(bands_array, MMModemBand, i); + MMModemBand band = g_array_index (bands_array, MMModemBand, i); - if (flag2g != NULL && - band > MM_MODEM_BAND_UNKNOWN && band <= MM_MODEM_BAND_G850) { - mask2g += 1 << band; + if (flag2g != NULL) { + switch (band) { + case MM_MODEM_BAND_EGSM: + case MM_MODEM_BAND_DCS: + case MM_MODEM_BAND_PCS: + case MM_MODEM_BAND_G850: + mask2g += 1 << band; + break; + default: + break; + } } - if (flag3g != NULL && - band >= MM_MODEM_BAND_U2100 && band <= MM_MODEM_BAND_U2600) { - mask3g += 1 << band; + if (flag3g != NULL) { + switch (band) { + case MM_MODEM_BAND_UTRAN_1: + case MM_MODEM_BAND_UTRAN_2: + case MM_MODEM_BAND_UTRAN_3: + case MM_MODEM_BAND_UTRAN_4: + case MM_MODEM_BAND_UTRAN_5: + case MM_MODEM_BAND_UTRAN_6: + case MM_MODEM_BAND_UTRAN_7: + case MM_MODEM_BAND_UTRAN_8: + case MM_MODEM_BAND_UTRAN_9: + mask3g += 1 << band; + break; + default: + break; + } } if (flag4g != NULL && - band >= MM_MODEM_BAND_EUTRAN_I && band <= MM_MODEM_BAND_EUTRAN_XLIV) { - mask4g += 1 << (band - MM_MODEM_BAND_EUTRAN_I); + band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_44) { + mask4g += 1 << (band - MM_MODEM_BAND_EUTRAN_1); found4g = TRUE; } } @@ -78,25 +100,25 @@ /* Get 3G flag */ if (flag3g != NULL) { - if (mask3g == (1 << MM_MODEM_BAND_U2100)) + if (mask3g == (1 << MM_MODEM_BAND_UTRAN_1)) *flag3g = 0; - else if (mask3g == (1 << MM_MODEM_BAND_U1900)) + else if (mask3g == (1 << MM_MODEM_BAND_UTRAN_2)) *flag3g = 1; - else if (mask3g == (1 << MM_MODEM_BAND_U850)) + else if (mask3g == (1 << MM_MODEM_BAND_UTRAN_5)) *flag3g = 2; - else if (mask3g == ((1 << MM_MODEM_BAND_U2100) + - (1 << MM_MODEM_BAND_U1900) + - (1 << MM_MODEM_BAND_U850))) + else if (mask3g == ((1 << MM_MODEM_BAND_UTRAN_1) + + (1 << MM_MODEM_BAND_UTRAN_2) + + (1 << MM_MODEM_BAND_UTRAN_5))) *flag3g = 3; - else if (mask3g == ((1 << MM_MODEM_BAND_U1900) + - (1 << MM_MODEM_BAND_U850))) + else if (mask3g == ((1 << MM_MODEM_BAND_UTRAN_2) + + (1 << MM_MODEM_BAND_UTRAN_5))) *flag3g = 4; - else if (mask3g == (1 << MM_MODEM_BAND_U900)) + else if (mask3g == (1 << MM_MODEM_BAND_UTRAN_8)) *flag3g = 5; - else if (mask3g == ((1 << MM_MODEM_BAND_U2100) + - (1 << MM_MODEM_BAND_U900))) + else if (mask3g == ((1 << MM_MODEM_BAND_UTRAN_1) + + (1 << MM_MODEM_BAND_UTRAN_8))) *flag3g = 6; - else if (mask3g == (1 << MM_MODEM_BAND_U17IV)) + else if (mask3g == (1 << MM_MODEM_BAND_UTRAN_4)) *flag3g = 7; else *flag3g = -1; @@ -111,56 +133,6 @@ } } -/*****************************************************************************/ -/* +CSIM response parser */ - -gint -mm_telit_parse_csim_response (const guint step, - const gchar *response, - GError **error) -{ - GRegex *r = NULL; - GMatchInfo *match_info = NULL; - gchar *retries_hex_str; - guint retries; - - r = g_regex_new ("\\+CSIM:\\s*[0-9]+,\\s*.*63C(.*)\"", G_REGEX_RAW, 0, NULL); - - if (!g_regex_match (r, response, 0, &match_info)) { - g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Could not parse reponse '%s'", response); - g_match_info_free (match_info); - g_regex_unref (r); - return -1; - } - - if (!g_match_info_matches (match_info)) { - g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Could not find matches in response '%s'", response); - g_match_info_free (match_info); - g_regex_unref (r); - return -1; - } - - retries_hex_str = mm_get_string_unquoted_from_match_info (match_info, 1); - g_assert (NULL != retries_hex_str); - - /* convert hex value to uint */ - if (sscanf (retries_hex_str, "%x", &retries) != 1) { - g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Could not get retry value from match '%s'", - retries_hex_str); - g_match_info_free (match_info); - g_regex_unref (r); - return -1; - } - - g_free (retries_hex_str); - g_match_info_free (match_info); - g_regex_unref (r); - - return retries; -} #define SUPP_BAND_RESPONSE_REGEX "#BND:\\s*\\((?P[0-9\\-,]*)\\)(,\\s*\\((?P[0-9\\-,]*)\\))?(,\\s*\\((?P[0-9\\-,]*)\\))?" #define CURR_BAND_RESPONSE_REGEX "#BND:\\s*(?P\\d+)(,\\s*(?P\\d+))?(,\\s*(?P\\d+))?" @@ -170,7 +142,7 @@ * AT#BND=? * #BND: <2G band flags range>,<3G band flags range>[, <4G band flags range>] * - * where "band flags" is a list of numbers definining the supported bands. + * where "band flags" is a list of numbers defining the supported bands. * Note that the one Telit band flag may represent more than one MM band. * * e.g. @@ -204,7 +176,7 @@ * AT#BND? * #BND: <2G band flags>,<3G band flags>[, <4G band flags>] * - * where "band flags" is a number definining the current bands. + * where "band flags" is a number defining the current bands. * Note that the one Telit band flag may represent more than one MM band. * * e.g. @@ -244,11 +216,11 @@ if (!g_regex_match (r, response, 0, &match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Could not parse reponse '%s'", response); + "Could not parse response '%s'", response); goto end; } - if (!g_match_info_matches(match_info)) { + if (!g_match_info_matches (match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Could not find matches in response '%s'", response); goto end; @@ -262,7 +234,7 @@ if (modem_is_3g && !mm_telit_get_3g_mm_bands (match_info, &bands, error)) goto end; - if(modem_is_4g && !mm_telit_get_4g_mm_bands (match_info, &bands, error)) + if (modem_is_4g && !mm_telit_get_4g_mm_bands (match_info, &bands, error)) goto end; *supported_bands = bands; @@ -272,9 +244,7 @@ if (!ret && bands != NULL) g_array_free (bands, TRUE); - if(match_info) - g_match_info_free (match_info); - + g_match_info_free (match_info); g_regex_unref (r); return ret; @@ -325,8 +295,7 @@ } end: - if (match_str != NULL) - g_free (match_str); + g_free (match_str); if (flags != NULL) g_array_free (flags, TRUE); @@ -345,27 +314,27 @@ gboolean ret = TRUE; TelitToMMBandMap map [] = { - { BND_FLAG_0, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_1, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_2, { MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_3, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U1900, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_4, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_5, { MM_MODEM_BAND_U900, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_6, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U900, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_7, { MM_MODEM_BAND_U17IV, MM_MODEM_BAND_UNKNOWN} }, - { BND_FLAG_8, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_9, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U900, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_10, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_U17IV, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_12, { MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN}}, - { BND_FLAG_13, { MM_MODEM_BAND_U1800, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_14, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U900, MM_MODEM_BAND_U17IV, MM_MODEM_BAND_U850, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_15, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U900, MM_MODEM_BAND_U1800, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_16, { MM_MODEM_BAND_U900, MM_MODEM_BAND_U850, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_17, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_U17IV, MM_MODEM_BAND_U850, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_18, { MM_MODEM_BAND_U2100, MM_MODEM_BAND_U1900, MM_MODEM_BAND_U850, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN}}, - { BND_FLAG_19, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN }}, - { BND_FLAG_20, { MM_MODEM_BAND_U850, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN}}, - { BND_FLAG_21, { MM_MODEM_BAND_U1900, MM_MODEM_BAND_U850, MM_MODEM_BAND_U800, MM_MODEM_BAND_UNKNOWN}}, + { BND_FLAG_0, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_1, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_2, { MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_3, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_4, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_5, { MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_6, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_7, { MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UNKNOWN} }, + { BND_FLAG_8, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_9, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_10, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_12, { MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN}}, + { BND_FLAG_13, { MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_14, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_15, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_16, { MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_17, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_18, { MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN}}, + { BND_FLAG_19, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN }}, + { BND_FLAG_20, { MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN}}, + { BND_FLAG_21, { MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UNKNOWN}}, { BND_FLAG_UNKNOWN, {}}, }; @@ -396,8 +365,7 @@ } end: - if (match_str != NULL) - g_free (match_str); + g_free (match_str); if (flags != NULL) g_array_free (flags, TRUE); @@ -406,11 +374,10 @@ } gboolean -mm_telit_get_4g_mm_bands(GMatchInfo *match_info, - GArray **bands, - GError **error) +mm_telit_get_4g_mm_bands (GMatchInfo *match_info, + GArray **bands, + GError **error) { - GArray *flags = NULL; MMModemBand band; gboolean ret = TRUE; gchar *match_str = NULL; @@ -427,7 +394,7 @@ goto end; } - if (strstr(match_str, "-")) { + if (strstr (match_str, "-")) { tokens = g_strsplit (match_str, "-", -1); if (tokens == NULL) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, @@ -437,24 +404,21 @@ goto end; } sscanf (tokens[1], "%d", &value); + g_strfreev (tokens); } else { sscanf (match_str, "%d", &value); } - for (i = 0; value > 0; i++) { if (value % 2 != 0) { - band = MM_MODEM_BAND_EUTRAN_I + i; + band = MM_MODEM_BAND_EUTRAN_1 + i; g_array_append_val (*bands, band); } value = value >> 1; } -end: - if (match_str != NULL) - g_free (match_str); - if (flags != NULL) - g_array_free (flags, TRUE); +end: + g_free (match_str); return ret; } @@ -527,19 +491,19 @@ for (i = 0; tokens[i]; i++) { /* check whether tokens[i] defines a * single band value or a range of bands */ - if (!strstr(tokens[i], "-")) { - sscanf(tokens[i], "%d", &flag); + if (!strstr (tokens[i], "-")) { + sscanf (tokens[i], "%d", &flag); g_array_append_val (*band_flags, flag); } else { gint range_start; gint range_end; - range = g_strsplit(tokens[i], "-", 2); + range = g_strsplit (tokens[i], "-", 2); - sscanf(range[0], "%d", &range_start); - sscanf(range[1], "%d", &range_end); + sscanf (range[0], "%d", &range_start); + sscanf (range[1], "%d", &range_end); - for (flag=range_start; flag <= range_end; flag++) { + for (flag = range_start; flag <= range_end; flag++) { g_array_append_val (*band_flags, flag); } @@ -551,3 +515,33 @@ return TRUE; } + +/*****************************************************************************/ +/* #QSS? response parser */ + +MMTelitQssStatus +mm_telit_parse_qss_query (const gchar *response, + GError **error) +{ + gint qss_status; + gint qss_mode; + + qss_status = QSS_STATUS_UNKNOWN; + if (sscanf (response, "#QSS: %d,%d", &qss_mode, &qss_status) != 2) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Could not parse \"#QSS?\" response: %s", response); + return QSS_STATUS_UNKNOWN; + } + + switch (qss_status) { + case QSS_STATUS_SIM_REMOVED: + case QSS_STATUS_SIM_INSERTED: + case QSS_STATUS_SIM_INSERTED_AND_UNLOCKED: + case QSS_STATUS_SIM_INSERTED_AND_READY: + return (MMTelitQssStatus) qss_status; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown QSS status value given: %d", qss_status); + return QSS_STATUS_UNKNOWN; + } +} diff -Nru modemmanager-1.6.8/plugins/telit/mm-modem-helpers-telit.h modemmanager-1.10.0/plugins/telit/mm-modem-helpers-telit.h --- modemmanager-1.6.8/plugins/telit/mm-modem-helpers-telit.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-modem-helpers-telit.h 2018-11-15 09:55:53.000000000 +0100 @@ -17,6 +17,7 @@ #define MM_MODEM_HELPERS_TELIT_H #include +#include "ModemManager.h" #define MAX_BANDS_LIST_LEN 20 @@ -60,11 +61,6 @@ MMModemBand mm_bands[MAX_BANDS_LIST_LEN]; } TelitToMMBandMap; -/* +CSIM response parser */ -gint mm_telit_parse_csim_response (const guint step, - const gchar *response, - GError **error); - typedef enum { LOAD_SUPPORTED_BANDS, LOAD_CURRENT_BANDS @@ -99,4 +95,24 @@ void mm_telit_get_band_flag (GArray *bands_array, gint *flag_2g, gint *flag_3g, gint *flag_4g); +/* #QSS? response parser */ +typedef enum { /*< underscore_name=mm_telit_qss_status >*/ + QSS_STATUS_UNKNOWN = -1, + QSS_STATUS_SIM_REMOVED, + QSS_STATUS_SIM_INSERTED, + QSS_STATUS_SIM_INSERTED_AND_UNLOCKED, + QSS_STATUS_SIM_INSERTED_AND_READY, +} MMTelitQssStatus; + +MMTelitQssStatus mm_telit_parse_qss_query (const gchar *response, GError **error); + +/* CSIM lock state */ +typedef enum { /*< underscore_name=mm_telit_csim_lock_state >*/ + CSIM_LOCK_STATE_UNKNOWN, + CSIM_LOCK_STATE_UNLOCKED, + CSIM_LOCK_STATE_LOCK_REQUESTED, + CSIM_LOCK_STATE_LOCKED, +} MMTelitCsimLockState; + + #endif /* MM_MODEM_HELPERS_TELIT_H */ diff -Nru modemmanager-1.6.8/plugins/telit/mm-plugin-telit.c modemmanager-1.10.0/plugins/telit/mm-plugin-telit.c --- modemmanager-1.6.8/plugins/telit/mm-plugin-telit.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/mm-plugin-telit.c 2018-11-15 09:55:53.000000000 +0100 @@ -28,6 +28,15 @@ #include "mm-common-telit.h" #include "mm-broadband-modem-telit.h" + +#if defined WITH_QMI +# include "mm-broadband-modem-qmi.h" +#endif + +#if defined WITH_MBIM +# include "mm-broadband-modem-mbim.h" +#endif + G_DEFINE_TYPE (MMPluginTelit, mm_plugin_telit, MM_TYPE_PLUGIN) MM_PLUGIN_DEFINE_MAJOR_VERSION @@ -37,14 +46,36 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_telit_new (sysfs_path, +#if defined WITH_QMI + if (mm_port_probe_list_has_qmi_port (probes)) { + mm_dbg ("QMI-powered Telit modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } +#endif + +#if defined WITH_MBIM + if (mm_port_probe_list_has_mbim_port (probes)) { + mm_dbg ("MBIM-powered Telit modem found..."); + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, + drivers, + mm_plugin_get_name (self), + vendor, + product)); + } +#endif + + return MM_BASE_MODEM (mm_broadband_modem_telit_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -56,14 +87,10 @@ G_MODULE_EXPORT MMPlugin * mm_plugin_create (void) { - static const gchar *subsystems[] = { "tty", NULL }; + static const gchar *subsystems[] = { "tty", "net", "usb", NULL }; /* Vendors: Telit */ static const guint16 vendor_ids[] = { 0x1bc7, 0 }; - /* Only handle TELIT tagged devices here. */ - static const gchar *udev_tags[] = { - "ID_MM_TELIT_TAGGED", - NULL - }; + static const gchar *vendor_strings[] = { "telit", NULL }; /* Custom init for port identification */ static const MMAsyncMethod custom_init = { .async = G_CALLBACK (telit_custom_init), @@ -72,12 +99,14 @@ return MM_PLUGIN ( g_object_new (MM_TYPE_PLUGIN_TELIT, - MM_PLUGIN_NAME, "Telit", - MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, - MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, - MM_PLUGIN_ALLOWED_AT, TRUE, - MM_PLUGIN_ALLOWED_UDEV_TAGS, udev_tags, - MM_PLUGIN_CUSTOM_INIT, &custom_init, + MM_PLUGIN_NAME, "Telit", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, + MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_ALLOWED_QMI, TRUE, + MM_PLUGIN_ALLOWED_MBIM, TRUE, + MM_PLUGIN_CUSTOM_INIT, &custom_init, NULL)); } diff -Nru modemmanager-1.6.8/plugins/telit/tests/test-mm-modem-helpers-telit.c modemmanager-1.10.0/plugins/telit/tests/test-mm-modem-helpers-telit.c --- modemmanager-1.6.8/plugins/telit/tests/test-mm-modem-helpers-telit.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/telit/tests/test-mm-modem-helpers-telit.c 2018-11-15 09:55:53.000000000 +0100 @@ -25,72 +25,6 @@ #include "mm-modem-helpers.h" #include "mm-modem-helpers-telit.h" -typedef struct { - gchar *response; - gint result; -} CSIMResponseTest; - -static CSIMResponseTest valid_csim_response_test_list [] = { - /* The parser expects that 2nd arg contains - * substring "63Cx" where x is an HEX string - * representing the retry value */ - {"+CSIM:8,\"xxxx63C1\"", 1}, - {"+CSIM:8,\"xxxx63CA\"", 10}, - {"+CSIM:8,\"xxxx63CF\"", 15}, - /* The parser accepts spaces */ - {"+CSIM:8,\"xxxx63C1\"", 1}, - {"+CSIM:8, \"xxxx63C1\"", 1}, - {"+CSIM: 8, \"xxxx63C1\"", 1}, - {"+CSIM: 8, \"xxxx63C1\"", 1}, - /* the parser expects an int as first argument (2nd arg's length), - * but does not check if it is correct */ - {"+CSIM: 10, \"63CF\"", 15}, - /* the parser expect a quotation mark at the end - * of the response, but not at the begin */ - {"+CSIM: 10, 63CF\"", 15}, - { NULL, -1} -}; - -static CSIMResponseTest invalid_csim_response_test_list [] = { - /* Test missing final quotation mark */ - {"+CSIM: 8, xxxx63CF", -1}, - /* Negative test for substring "63Cx" */ - {"+CSIM: 4, xxxx73CF\"", -1}, - /* Test missing first argument */ - {"+CSIM:xxxx63CF\"", -1}, - { NULL, -1} -}; - -static void -test_mm_telit_parse_csim_response (void) -{ - const gint step = 1; - guint i; - gint res; - GError* error = NULL; - - /* Test valid responses */ - for (i = 0; valid_csim_response_test_list[i].response != NULL; i++) { - res = mm_telit_parse_csim_response (step, valid_csim_response_test_list[i].response, &error); - - g_assert_no_error (error); - g_assert_cmpint (res, ==, valid_csim_response_test_list[i].result); - } - - /* Test invalid responses */ - for (i = 0; invalid_csim_response_test_list[i].response != NULL; i++) { - res = mm_telit_parse_csim_response (step, invalid_csim_response_test_list[i].response, &error); - - g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); - g_assert_cmpint (res, ==, invalid_csim_response_test_list[i].result); - - if (NULL != error) { - g_error_free (error); - error = NULL; - } - } -} - static void test_mm_bands_contains (void) { GArray* mm_bands; @@ -168,44 +102,44 @@ MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U850, - MM_MODEM_BAND_U900} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_8 } }, { "#BND: (0,3),(0,2,5,6)", TRUE, TRUE, FALSE, 7, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U850, - MM_MODEM_BAND_U900} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_8} }, { "#BND: (0,2),(0,2,5,6)", TRUE, TRUE, FALSE, 6, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U850, - MM_MODEM_BAND_U900} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_8} }, { "#BND: (0,2),(0-4,5,6)", TRUE, TRUE, FALSE, 7, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U1900, - MM_MODEM_BAND_U850, - MM_MODEM_BAND_U900} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_2, + MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_8} }, { "#BND: (0-3),(0,2,5,6),(1-1)", TRUE, TRUE, TRUE, 8, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U850, - MM_MODEM_BAND_U900, - MM_MODEM_BAND_EUTRAN_I} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_8, + MM_MODEM_BAND_EUTRAN_1} }, { "#BND: (0),(0),(1-3)", TRUE, TRUE, TRUE, 5, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_EUTRAN_I, - MM_MODEM_BAND_EUTRAN_II} }, - { "#BND: (0),(0),(1-3)", FALSE, FALSE, TRUE, 2, { MM_MODEM_BAND_EUTRAN_I, - MM_MODEM_BAND_EUTRAN_II} }, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_EUTRAN_1, + MM_MODEM_BAND_EUTRAN_2} }, + { "#BND: (0),(0),(1-3)", FALSE, FALSE, TRUE, 2, { MM_MODEM_BAND_EUTRAN_1, + MM_MODEM_BAND_EUTRAN_2} }, { NULL, FALSE, FALSE, FALSE, 0, {}}, }; @@ -239,7 +173,7 @@ g_assert_cmpint (bands->len, ==, supported_band_mapping_tests[i].mm_bands_len); - g_array_free (bands, FALSE); + g_array_free (bands, TRUE); bands = NULL; } } @@ -252,35 +186,35 @@ }, { "#BND: 0,5", TRUE, TRUE, FALSE, 3, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, - MM_MODEM_BAND_U900 + MM_MODEM_BAND_UTRAN_8 } }, { "#BND: 1,3", TRUE, TRUE, FALSE, 5, { MM_MODEM_BAND_EGSM, MM_MODEM_BAND_PCS, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_U1900, - MM_MODEM_BAND_U850, + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_UTRAN_2, + MM_MODEM_BAND_UTRAN_5, } }, { "#BND: 2,7", TRUE, TRUE, FALSE, 3, { MM_MODEM_BAND_DCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U17IV - }, + MM_MODEM_BAND_UTRAN_4 + } }, { "#BND: 3,0,1", TRUE, TRUE, TRUE, 4, { MM_MODEM_BAND_PCS, MM_MODEM_BAND_G850, - MM_MODEM_BAND_U2100, - MM_MODEM_BAND_EUTRAN_I + MM_MODEM_BAND_UTRAN_1, + MM_MODEM_BAND_EUTRAN_1 } }, { "#BND: 0,0,3", TRUE, FALSE, TRUE, 4, { MM_MODEM_BAND_EGSM, - MM_MODEM_BAND_DCS, - MM_MODEM_BAND_EUTRAN_I, - MM_MODEM_BAND_EUTRAN_II - } + MM_MODEM_BAND_DCS, + MM_MODEM_BAND_EUTRAN_1, + MM_MODEM_BAND_EUTRAN_2 + } }, - { "#BND: 0,0,3", FALSE, FALSE, TRUE, 2, { MM_MODEM_BAND_EUTRAN_I, - MM_MODEM_BAND_EUTRAN_II + { "#BND: 0,0,3", FALSE, FALSE, TRUE, 2, { MM_MODEM_BAND_EUTRAN_1, + MM_MODEM_BAND_EUTRAN_2 } }, { NULL, FALSE, FALSE, FALSE, 0, {}}, @@ -316,7 +250,7 @@ g_assert_cmpint (bands->len, ==, current_band_mapping_tests[i].mm_bands_len); - g_array_free (bands, FALSE); + g_array_free (bands, TRUE); bands = NULL; } } @@ -382,12 +316,12 @@ test_telit_get_3g_bnd_flag (void) { GArray *bands_array; - MMModemBand u2100 = MM_MODEM_BAND_U2100; - MMModemBand u1900 = MM_MODEM_BAND_U1900; - MMModemBand u850 = MM_MODEM_BAND_U850; - MMModemBand u900 = MM_MODEM_BAND_U900; - MMModemBand u17iv = MM_MODEM_BAND_U17IV; - MMModemBand u17ix = MM_MODEM_BAND_U17IX; + MMModemBand u2100 = MM_MODEM_BAND_UTRAN_1; + MMModemBand u1900 = MM_MODEM_BAND_UTRAN_2; + MMModemBand u850 = MM_MODEM_BAND_UTRAN_5; + MMModemBand u900 = MM_MODEM_BAND_UTRAN_8; + MMModemBand u17iv = MM_MODEM_BAND_UTRAN_4; + MMModemBand u17ix = MM_MODEM_BAND_UTRAN_9; gint flag; /* Test flag 0 */ @@ -480,8 +414,8 @@ test_telit_get_4g_bnd_flag (void) { GArray *bands_array; - MMModemBand eutran_i = MM_MODEM_BAND_EUTRAN_I; - MMModemBand eutran_ii = MM_MODEM_BAND_EUTRAN_II; + MMModemBand eutran_i = MM_MODEM_BAND_EUTRAN_1; + MMModemBand eutran_ii = MM_MODEM_BAND_EUTRAN_2; MMModemBand egsm = MM_MODEM_BAND_EGSM; gint flag = -1; @@ -511,14 +445,50 @@ g_array_free (bands_array, TRUE); } +typedef struct { + const char* response; + MMTelitQssStatus expected_qss; + const char *error_message; +} QssParseTest; + +static QssParseTest qss_parse_tests [] = { + {"#QSS: 0,0", QSS_STATUS_SIM_REMOVED, NULL}, + {"#QSS: 1,0", QSS_STATUS_SIM_REMOVED, NULL}, + {"#QSS: 0,1", QSS_STATUS_SIM_INSERTED, NULL}, + {"#QSS: 0,2", QSS_STATUS_SIM_INSERTED_AND_UNLOCKED, NULL}, + {"#QSS: 0,3", QSS_STATUS_SIM_INSERTED_AND_READY, NULL}, + {"#QSS:0,3", QSS_STATUS_SIM_INSERTED_AND_READY, NULL}, + {"#QSS: 0, 3", QSS_STATUS_SIM_INSERTED_AND_READY, NULL}, + {"#QSS: 0", QSS_STATUS_UNKNOWN, "Could not parse \"#QSS?\" response: #QSS: 0"}, + {"QSS:0,1", QSS_STATUS_UNKNOWN, "Could not parse \"#QSS?\" response: QSS:0,1"}, + {"#QSS: 0,5", QSS_STATUS_UNKNOWN, "Unknown QSS status value given: 5"}, +}; + +static void +test_telit_parse_qss_query (void) +{ + MMTelitQssStatus actual_qss_status; + GError *error = NULL; + guint i; + + for (i = 0; i < G_N_ELEMENTS (qss_parse_tests); i++) { + actual_qss_status = mm_telit_parse_qss_query (qss_parse_tests[i].response, &error); + + g_assert_cmpint (actual_qss_status, ==, qss_parse_tests[i].expected_qss); + if (qss_parse_tests[i].error_message) { + g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); + g_assert_cmpstr (error->message, ==, qss_parse_tests[i].error_message); + g_clear_error (&error); + } + } +} + int main (int argc, char **argv) { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); - g_test_add_func ("/MM/telit/csim", test_mm_telit_parse_csim_response); g_test_add_func ("/MM/telit/bands/supported/bands_contains", test_mm_bands_contains); g_test_add_func ("/MM/telit/bands/supported/parse_band_flag", test_parse_band_flag_str); g_test_add_func ("/MM/telit/bands/supported/parse_bands_response", test_parse_supported_bands_response); @@ -526,5 +496,6 @@ g_test_add_func ("/MM/telit/bands/current/set_bands/2g", test_telit_get_2g_bnd_flag); g_test_add_func ("/MM/telit/bands/current/set_bands/3g", test_telit_get_3g_bnd_flag); g_test_add_func ("/MM/telit/bands/current/set_bands/4g", test_telit_get_4g_bnd_flag); + g_test_add_func ("/MM/telit/qss/query", test_telit_parse_qss_query); return g_test_run (); } diff -Nru modemmanager-1.6.8/plugins/tests/test-fixture.c modemmanager-1.10.0/plugins/tests/test-fixture.c --- modemmanager-1.6.8/plugins/tests/test-fixture.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/tests/test-fixture.c 2018-11-15 09:55:53.000000000 +0100 @@ -135,7 +135,7 @@ ready = TRUE; } - g_list_free_full (modems, (GDestroyNotify) g_object_unref); + g_list_free_full (modems, g_object_unref); g_object_unref (manager); if (ready) diff -Nru modemmanager-1.6.8/plugins/tests/test-port-context.c modemmanager-1.10.0/plugins/tests/test-port-context.c --- modemmanager-1.6.8/plugins/tests/test-port-context.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/tests/test-port-context.c 2018-11-15 09:55:53.000000000 +0100 @@ -278,7 +278,9 @@ address = (g_unix_socket_address_new_with_type ( self->name, -1, - G_UNIX_SOCKET_ADDRESS_ABSTRACT)); + (g_str_has_prefix (self->name, "abstract:") ? + G_UNIX_SOCKET_ADDRESS_ABSTRACT : + G_UNIX_SOCKET_ADDRESS_PATH))); if (!g_socket_bind (socket, address, TRUE, &error)) g_error ("Cannot bind socket: %s", error->message); g_object_unref (address); diff -Nru modemmanager-1.6.8/plugins/tests/test-udev-rules.c modemmanager-1.10.0/plugins/tests/test-udev-rules.c --- modemmanager-1.6.8/plugins/tests/test-udev-rules.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/tests/test-udev-rules.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,170 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include +#include +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +/* Define symbol to enable test message traces */ +#undef ENABLE_TEST_MESSAGE_TRACES + +#include "mm-kernel-device-generic-rules.h" +#include "mm-log.h" + +/************************************************************/ + +static void +common_test (const gchar *plugindir) +{ + GArray *rules; + GError *error = NULL; + + rules = mm_kernel_device_generic_rules_load (plugindir, &error); + g_assert_no_error (error); + g_assert (rules); + g_assert (rules->len > 0); + + g_array_unref (rules); +} + +/************************************************************/ + +static void +test_huawei (void) +{ + common_test (TESTUDEVRULESDIR_HUAWEI); +} + +static void +test_mbm (void) +{ + common_test (TESTUDEVRULESDIR_MBM); +} + +static void +test_nokia (void) +{ + common_test (TESTUDEVRULESDIR_NOKIA); +} + +static void +test_zte (void) +{ + common_test (TESTUDEVRULESDIR_ZTE); +} + +static void +test_longcheer (void) +{ + common_test (TESTUDEVRULESDIR_LONGCHEER); +} + +static void +test_simtech (void) +{ + common_test (TESTUDEVRULESDIR_SIMTECH); +} + +static void +test_x22x (void) +{ + common_test (TESTUDEVRULESDIR_X22X); +} + +static void +test_cinterion (void) +{ + common_test (TESTUDEVRULESDIR_CINTERION); +} + +static void +test_dell (void) +{ + common_test (TESTUDEVRULESDIR_DELL); +} + +static void +test_telit (void) +{ + common_test (TESTUDEVRULESDIR_TELIT); +} + +static void +test_mtk (void) +{ + common_test (TESTUDEVRULESDIR_MTK); +} + +static void +test_haier (void) +{ + common_test (TESTUDEVRULESDIR_HAIER); +} + +static void +test_fibocom (void) +{ + common_test (TESTUDEVRULESDIR_FIBOCOM); +} + +/************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/test-udev-rules/huawei", test_huawei); + g_test_add_func ("/MM/test-udev-rules/mbm", test_mbm); + g_test_add_func ("/MM/test-udev-rules/nokia", test_nokia); + g_test_add_func ("/MM/test-udev-rules/zte", test_zte); + g_test_add_func ("/MM/test-udev-rules/longcheer", test_longcheer); + g_test_add_func ("/MM/test-udev-rules/simtech", test_simtech); + g_test_add_func ("/MM/test-udev-rules/x22x", test_x22x); + g_test_add_func ("/MM/test-udev-rules/cinterion", test_cinterion); + g_test_add_func ("/MM/test-udev-rules/dell", test_dell); + g_test_add_func ("/MM/test-udev-rules/telit", test_telit); + g_test_add_func ("/MM/test-udev-rules/mtk", test_mtk); + g_test_add_func ("/MM/test-udev-rules/haier", test_haier); + g_test_add_func ("/MM/test-udev-rules/fibocom", test_fibocom); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/plugins/thuraya/mm-broadband-modem-thuraya.c modemmanager-1.10.0/plugins/thuraya/mm-broadband-modem-thuraya.c --- modemmanager-1.6.8/plugins/thuraya/mm-broadband-modem-thuraya.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/plugins/thuraya/mm-broadband-modem-thuraya.c 2018-11-15 09:55:53.000000000 +0100 @@ -48,63 +48,66 @@ /* Operator Code and Name loading (3GPP interface) */ static gchar * -load_operator_code_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +load_operator_code_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - /* Only "90103" operator code is assumed */ - return g_strdup ("90106"); + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_operator_code (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, g_strdup ("90106"), g_free); + g_object_unref (task); } static gchar * -load_operator_name_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +load_operator_name_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - /* Only "THURAYA" operator name is assumed */ - return g_strdup ("THURAYA"); + return g_task_propagate_pointer (G_TASK (res), error); } static void -load_operator_name_or_code (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_operator_name (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_operator_name_or_code); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, g_strdup ("THURAYA"), g_free); + g_object_unref (task); } /*****************************************************************************/ /* Load supported modes (Modem inteface) */ static GArray * -load_supported_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -load_supported_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - GArray *combinations; - MMModemModeCombination mode; + GTask *task; + GArray *combinations; + MMModemModeCombination mode; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes); + task = g_task_new (self, NULL, callback, user_data); /* Build list of combinations */ combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); @@ -114,9 +117,8 @@ mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); - g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -141,40 +143,39 @@ } static gboolean -modem_messaging_load_supported_storages_finish (MMIfaceModemMessaging *self, - GAsyncResult *res, - GArray **mem1, - GArray **mem2, - GArray **mem3, - GError **error) +modem_messaging_load_supported_storages_finish (MMIfaceModemMessaging *self, + GAsyncResult *res, + GArray **mem1, + GArray **mem2, + GArray **mem3, + GError **error) { SupportedStoragesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = (SupportedStoragesResult *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *mem1 = g_array_ref (result->mem1); *mem2 = g_array_ref (result->mem2); *mem3 = g_array_ref (result->mem3); - + supported_storages_result_free (result); return TRUE; } static void -cpms_format_check_ready (MMBroadbandModem *self, +cpms_format_check_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - const gchar *response; - GError *error = NULL; + const gchar *response; + GError *error = NULL; SupportedStoragesResult *result; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -185,43 +186,32 @@ &result->mem1, &result->mem2, &result->mem3)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse supported storages reply: '%s'", - response); supported_storages_result_free (result); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse supported storages reply: '%s'", + response); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gpointer (simple, - result, - (GDestroyNotify)supported_storages_result_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, result, (GDestroyNotify) supported_storages_result_free); + g_object_unref (task); } static void modem_messaging_load_supported_storages (MMIfaceModemMessaging *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_load_supported_storages); - /* Check support storages */ mm_base_modem_at_command (MM_BASE_MODEM (self), "+CPMS=?", 3, TRUE, (GAsyncReadyCallback)cpms_format_check_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -267,9 +257,9 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface) { /* Fixed operator code and name to be reported */ - iface->load_operator_name = load_operator_name_or_code; + iface->load_operator_name = load_operator_name; iface->load_operator_name_finish = load_operator_name_finish; - iface->load_operator_code = load_operator_name_or_code; + iface->load_operator_code = load_operator_code; iface->load_operator_code_finish = load_operator_code_finish; /* Don't try to scan networks with AT+COPS=?. diff -Nru modemmanager-1.6.8/plugins/thuraya/mm-plugin-thuraya.c modemmanager-1.10.0/plugins/thuraya/mm-plugin-thuraya.c --- modemmanager-1.6.8/plugins/thuraya/mm-plugin-thuraya.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/thuraya/mm-plugin-thuraya.c 2018-11-15 09:55:53.000000000 +0100 @@ -40,14 +40,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_thuraya_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_thuraya_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/thuraya/tests/test-mm-modem-helpers-thuraya.c modemmanager-1.10.0/plugins/thuraya/tests/test-mm-modem-helpers-thuraya.c --- modemmanager-1.6.8/plugins/thuraya/tests/test-mm-modem-helpers-thuraya.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/thuraya/tests/test-mm-modem-helpers-thuraya.c 2018-11-15 09:55:53.000000000 +0100 @@ -118,7 +118,6 @@ GTestSuite *suite; gint result; - g_type_init (); g_test_init (&argc, &argv, NULL); suite = g_test_get_root (); diff -Nru modemmanager-1.6.8/plugins/ublox/77-mm-ublox-port-types.rules modemmanager-1.10.0/plugins/ublox/77-mm-ublox-port-types.rules --- modemmanager-1.6.8/plugins/ublox/77-mm-ublox-port-types.rules 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/77-mm-ublox-port-types.rules 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,62 @@ +# do not edit this file, it will be overwritten on update +ACTION!="add|change|move|bind", GOTO="mm_ublox_port_types_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", GOTO="mm_ublox_port_types" +GOTO="mm_ublox_port_types_end" + +LABEL="mm_ublox_port_types" + +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" + +# Toby-L4 port types +# ttyACM0 (if #2): secondary (ignore) +# ttyACM1 (if #4): debug port (ignore) +# ttyACM2 (if #6): primary +# Wait up to 20s for the +READY URC +# ttyACM3 (if #8): AT port for FOTA (ignore) +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_UBLOX_PORT_READY_DELAY}="20" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" + +# TOBY-L200 +# Wait up to 20s before probing AT ports +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1141", ENV{ID_MM_UBLOX_PORT_READY_DELAY}="20" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1143", ENV{ID_MM_UBLOX_PORT_READY_DELAY}="20" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1146", ENV{ID_MM_UBLOX_PORT_READY_DELAY}="20" + +# TOBY-R2 port types +# ttyACM0 (if #0): primary +# ttyACM1 (if #2): secondary +# ttyACM2 (if #4): tertiary +# ttyACM3 (if #6): GNSS Tunneling (ignore) +# ttyACM4 (if #8): SIM Access Profile (ignore) +# ttyACM5 (if #10): Primary Log for diagnostics (ignore) +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1107", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1107", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1107", ENV{.MM_USBIFNUM}=="0a", ENV{ID_MM_PORT_IGNORE}="1" + +# LARA-R2 port types +# ttyACM0 (if #0): primary +# ttyACM1 (if #2): secondary +# ttyACM2 (if #4): tertiary +# ttyACM3 (if #6): GNSS Tunneling (ignore) +# ttyACM4 (if #8): SIM Access Profile (ignore) +# ttyACM5 (if #10): Primary Log for diagnostics (ignore) +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="110a", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="110a", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="110a", ENV{.MM_USBIFNUM}=="0a", ENV{ID_MM_PORT_IGNORE}="1" + +# LISA-U2 port types +# ttyACM0 (if #0): primary +# ttyACM1 (if #2): secondary +# ttyACM2 (if #4): tertiary +# ttyACM3 (if #6): GNSS Tunneling (ignore) +# ttyACM4 (if #8): Primary Log for diagnostics (ignore) +# ttyACM5 (if #10): Secondary Log for diagnostics (ignore) +# ttyACM6 (if #12): SAP (SIM Access Profile) (ignore) +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1102", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1102", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1102", ENV{.MM_USBIFNUM}=="0a", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="1546", ATTRS{idProduct}=="1102", ENV{.MM_USBIFNUM}=="0c", ENV{ID_MM_PORT_IGNORE}="1" + +LABEL="mm_ublox_port_types_end" diff -Nru modemmanager-1.6.8/plugins/ublox/mm-broadband-bearer-ublox.c modemmanager-1.10.0/plugins/ublox/mm-broadband-bearer-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-broadband-bearer-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-broadband-bearer-ublox.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1011 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-broadband-bearer-ublox.h" +#include "mm-base-modem-at.h" +#include "mm-log.h" +#include "mm-ublox-enums-types.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-ublox.h" + +G_DEFINE_TYPE (MMBroadbandBearerUblox, mm_broadband_bearer_ublox, MM_TYPE_BROADBAND_BEARER) + +enum { + PROP_0, + PROP_USB_PROFILE, + PROP_NETWORKING_MODE, + PROP_LAST +}; + +static GParamSpec *properties[PROP_LAST]; + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_SUPPORTED, + FEATURE_UNSUPPORTED, +} FeatureSupport; + +struct _MMBroadbandBearerUbloxPrivate { + MMUbloxUsbProfile profile; + MMUbloxNetworkingMode mode; + MMUbloxBearerAllowedAuth allowed_auths; + FeatureSupport statistics; + FeatureSupport cedata; +}; + +/*****************************************************************************/ +/* Common connection context and task */ + +typedef struct { + MMBroadbandBearerUblox *self; + MMBroadbandModem *modem; + MMPortSerialAt *primary; + MMPort *data; + guint cid; + gboolean auth_required; + /* For IPv4 settings */ + MMBearerIpConfig *ip_config; +} CommonConnectContext; + +static void +common_connect_context_free (CommonConnectContext *ctx) +{ + if (ctx->ip_config) + g_object_unref (ctx->ip_config); + if (ctx->data) + g_object_unref (ctx->data); + g_object_unref (ctx->self); + g_object_unref (ctx->modem); + g_object_unref (ctx->primary); + g_slice_free (CommonConnectContext, ctx); +} + +static GTask * +common_connect_task_new (MMBroadbandBearerUblox *self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + guint cid, + MMPort *data, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + CommonConnectContext *ctx; + GTask *task; + + ctx = g_slice_new0 (CommonConnectContext); + ctx->self = g_object_ref (self); + ctx->modem = g_object_ref (modem); + ctx->primary = g_object_ref (primary); + ctx->cid = cid; + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify) common_connect_context_free); + + /* We need a net data port */ + if (data) + ctx->data = g_object_ref (data); + else { + ctx->data = mm_base_modem_get_best_data_port (MM_BASE_MODEM (modem), MM_PORT_TYPE_NET); + if (!ctx->data) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); + g_object_unref (task); + return NULL; + } + } + + return task; +} + +/*****************************************************************************/ +/* 3GPP IP config (sub-step of the 3GPP Connection sequence) */ + +static gboolean +get_ip_config_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + MMBearerIpConfig **ipv4_config, + MMBearerIpConfig **ipv6_config, + GError **error) +{ + MMBearerConnectResult *configs; + MMBearerIpConfig *ipv4; + + configs = g_task_propagate_pointer (G_TASK (res), error); + if (!configs) + return FALSE; + + /* Just IPv4 for now */ + ipv4 = mm_bearer_connect_result_peek_ipv4_config (configs); + g_assert (ipv4); + if (ipv4_config) + *ipv4_config = g_object_ref (ipv4); + if (ipv6_config) + *ipv6_config = NULL; + mm_bearer_connect_result_unref (configs); + return TRUE; +} + +static void +complete_get_ip_config_3gpp (GTask *task) +{ + CommonConnectContext *ctx; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + g_assert (mm_bearer_ip_config_get_method (ctx->ip_config) != MM_BEARER_IP_METHOD_UNKNOWN); + g_task_return_pointer (task, + mm_bearer_connect_result_new (ctx->data, ctx->ip_config, NULL), + (GDestroyNotify) mm_bearer_connect_result_unref); + g_object_unref (task); +} + +static void +cgcontrdp_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + CommonConnectContext *ctx; + gchar *local_address = NULL; + gchar *subnet = NULL; + gchar *dns_addresses[3] = { NULL, NULL, NULL }; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response || !mm_3gpp_parse_cgcontrdp_response (response, + NULL, /* cid */ + NULL, /* bearer id */ + NULL, /* apn */ + &local_address, + &subnet, + NULL, /* gateway_address */ + &dns_addresses[0], + &dns_addresses[1], + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("IPv4 address retrieved: %s", local_address); + mm_bearer_ip_config_set_address (ctx->ip_config, local_address); + mm_dbg ("IPv4 subnet retrieved: %s", subnet); + mm_bearer_ip_config_set_prefix (ctx->ip_config, mm_netmask_to_cidr (subnet)); + if (dns_addresses[0]) + mm_dbg ("Primary DNS retrieved: %s", dns_addresses[0]); + if (dns_addresses[1]) + mm_dbg ("Secondary DNS retrieved: %s", dns_addresses[1]); + mm_bearer_ip_config_set_dns (ctx->ip_config, (const gchar **) dns_addresses); + + g_free (local_address); + g_free (subnet); + g_free (dns_addresses[0]); + g_free (dns_addresses[1]); + + mm_dbg ("finished IP settings retrieval for PDP context #%u...", ctx->cid); + + complete_get_ip_config_3gpp (task); +} + +static void +uipaddr_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + gchar *cmd; + GError *error = NULL; + CommonConnectContext *ctx; + gchar *gw_ipv4_address = NULL; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response || !mm_ublox_parse_uipaddr_response (response, + NULL, /* cid */ + NULL, /* if_name */ + &gw_ipv4_address, + NULL, /* ipv4_subnet */ + NULL, /* ipv6_global_address */ + NULL, /* ipv6_link_local_address */ + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("IPv4 gateway address retrieved: %s", gw_ipv4_address); + mm_bearer_ip_config_set_gateway (ctx->ip_config, gw_ipv4_address); + g_free (gw_ipv4_address); + + cmd = g_strdup_printf ("+CGCONTRDP=%u", ctx->cid); + mm_dbg ("gathering IP and DNS information for PDP context #%u...", ctx->cid); + mm_base_modem_at_command (MM_BASE_MODEM (modem), + cmd, + 10, + FALSE, + (GAsyncReadyCallback) cgcontrdp_ready, + task); + g_free (cmd); +} + +static void +get_ip_config_3gpp (MMBroadbandBearer *self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + MMPortSerialAt *secondary, + MMPort *data, + guint cid, + MMBearerIpFamily ip_family, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + CommonConnectContext *ctx; + + if (!(task = common_connect_task_new (MM_BROADBAND_BEARER_UBLOX (self), + MM_BROADBAND_MODEM (modem), + primary, + cid, + data, + NULL, + callback, + user_data))) + return; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + ctx->ip_config = mm_bearer_ip_config_new (); + + /* If we're in BRIDGE mode, we need to ask for static IP addressing details: + * - AT+UIPADDR=[CID] will give us the default gateway address. + * - +CGCONTRDP?[CID] will give us the IP address, subnet and DNS addresses. + */ + if (ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_BRIDGE) { + gchar *cmd; + + mm_bearer_ip_config_set_method (ctx->ip_config, MM_BEARER_IP_METHOD_STATIC); + + cmd = g_strdup_printf ("+UIPADDR=%u", cid); + mm_dbg ("gathering gateway information for PDP context #%u...", cid); + mm_base_modem_at_command (MM_BASE_MODEM (modem), + cmd, + 10, + FALSE, + (GAsyncReadyCallback) uipaddr_ready, + task); + g_free (cmd); + return; + } + + /* If we're in ROUTER networking mode, we just need to request DHCP on the + * network interface. Early return with that result. */ + if (ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_ROUTER) { + mm_bearer_ip_config_set_method (ctx->ip_config, MM_BEARER_IP_METHOD_DHCP); + complete_get_ip_config_3gpp (task); + return; + } + + g_assert_not_reached (); +} + +/*****************************************************************************/ +/* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ + +static MMPort * +dial_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) +{ + return MM_PORT (g_task_propagate_pointer (G_TASK (res), error)); +} + +static void +cedata_activate_ready (MMBaseModem *modem, + GAsyncResult *res, + MMBroadbandBearerUblox *self) +{ + const gchar *response; + GError *error = NULL; + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) { + mm_warn ("ECM data connection attempt failed: %s", error->message); + mm_base_bearer_report_connection_status (MM_BASE_BEARER (self), + MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + g_error_free (error); + } + /* we received a full bearer object reference */ + g_object_unref (self); +} + +static void +cgact_activate_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + CommonConnectContext *ctx; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) + g_task_return_error (task, error); + else + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); +} + +static void +activate_3gpp (GTask *task) +{ + CommonConnectContext *ctx; + gchar *cmd; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + if (ctx->self->priv->profile == MM_UBLOX_USB_PROFILE_ECM && + ctx->self->priv->cedata == FEATURE_SUPPORTED) { + /* SARA-U2xx and LISA-U20x only expose one CDC-ECM interface. Hence, + the fixed 0 as the interface index here. When we see modems with + multiple interfaces, this needs to be revisited. */ + cmd = g_strdup_printf ("+UCEDATA=%u,0", ctx->cid); + mm_dbg ("establishing ECM data connection for PDP context #%u...", ctx->cid); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->modem), + cmd, + 180, + FALSE, + (GAsyncReadyCallback) cedata_activate_ready, + g_object_ref (ctx->self)); + /* We'll mark the task done here since the modem expects the DHCP + discover packet while +UCEDATA runs. If the command fails, we'll + mark the bearer disconnected later in the callback. */ + g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref); + g_object_unref (task); + } else { + cmd = g_strdup_printf ("+CGACT=1,%u", ctx->cid); + mm_dbg ("activating PDP context #%u...", ctx->cid); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->modem), + cmd, + 120, + FALSE, + (GAsyncReadyCallback) cgact_activate_ready, + task); + } + g_free (cmd); +} + +static void +test_cedata_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + CommonConnectContext *ctx; + const gchar *response; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (modem, res, NULL); + if (response) + ctx->self->priv->cedata = FEATURE_SUPPORTED; + else + ctx->self->priv->cedata = FEATURE_UNSUPPORTED; + mm_dbg ("u-blox: +UCEDATA command%s available", + (ctx->self->priv->cedata == FEATURE_SUPPORTED) ? "" : " not"); + + activate_3gpp (task); +} + +static void +test_cedata (GTask *task) +{ + CommonConnectContext *ctx; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + /* We don't need to test for +UCEDATA if we're not using CDC-ECM or if we + have tested before. Instead, we jump right to the activation. */ + if (ctx->self->priv->profile != MM_UBLOX_USB_PROFILE_ECM || + ctx->self->priv->cedata != FEATURE_SUPPORT_UNKNOWN) { + activate_3gpp (task); + return; + } + + mm_dbg ("u-blox: checking availability of +UCEDATA command..."); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->modem), + "+UCEDATA=?", + 3, + TRUE, /* allow_cached */ + (GAsyncReadyCallback) test_cedata_ready, + task); +} + +static void +uauthreq_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) { + CommonConnectContext *ctx; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + /* If authentication required and the +UAUTHREQ failed, abort */ + if (ctx->auth_required) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + /* Otherwise, ignore */ + g_error_free (error); + } + + test_cedata (task); +} + +static void +authenticate_3gpp (GTask *task) +{ + MMBroadbandBearerUblox *self; + CommonConnectContext *ctx; + gchar *cmd = NULL; + MMBearerAllowedAuth allowed_auth; + gint ublox_auth = -1; + + self = g_task_get_source_object (task); + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + + if (!ctx->auth_required) { + mm_dbg ("Not using authentication"); + ublox_auth = 0; + goto out; + } + + if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN || allowed_auth == (MM_BEARER_ALLOWED_AUTH_PAP | MM_BEARER_ALLOWED_AUTH_CHAP)) { + mm_dbg ("Using automatic authentication method"); + if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO) + ublox_auth = 3; + else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_PAP) + ublox_auth = 1; + else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP) + ublox_auth = 2; + else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_NONE) + ublox_auth = 0; + } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) { + mm_dbg ("Using PAP authentication method"); + ublox_auth = 1; + } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_CHAP) { + mm_dbg ("Using CHAP authentication method"); + ublox_auth = 2; + } + +out: + + if (ublox_auth < 0) { + gchar *str; + + str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Cannot use any of the specified authentication methods (%s)", str); + g_object_unref (task); + g_free (str); + return; + } + + if (ublox_auth > 0) { + const gchar *user; + const gchar *password; + gchar *quoted_user; + gchar *quoted_password; + + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + + quoted_user = mm_port_serial_at_quote_string (user); + quoted_password = mm_port_serial_at_quote_string (password); + + cmd = g_strdup_printf ("+UAUTHREQ=%u,%u,%s,%s", + ctx->cid, + ublox_auth, + quoted_user, + quoted_password); + + g_free (quoted_user); + g_free (quoted_password); + } else + cmd = g_strdup_printf ("+UAUTHREQ=%u,0,\"\",\"\"", ctx->cid); + + mm_dbg ("setting up authentication preferences in PDP context #%u...", ctx->cid); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->modem), + cmd, + 10, + FALSE, + (GAsyncReadyCallback) uauthreq_ready, + task); + g_free (cmd); +} + +static void +uauthreq_test_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandBearerUblox *self; + const gchar *response; + GError *error = NULL; + + self = g_task_get_source_object (task); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) + goto out; + + self->priv->allowed_auths = mm_ublox_parse_uauthreq_test (response, &error); +out: + if (error) { + CommonConnectContext *ctx; + + ctx = (CommonConnectContext *) g_task_get_task_data (task); + /* If authentication required and the +UAUTHREQ test failed, abort */ + if (ctx->auth_required) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + /* Otherwise, ignore and jump to test_cedata directly as no auth setup + * is needed */ + g_error_free (error); + test_cedata (task); + return; + } + + authenticate_3gpp (task); +} + +static void +check_supported_authentication_methods (GTask *task) +{ + MMBroadbandBearerUblox *self; + CommonConnectContext *ctx; + const gchar *user; + const gchar *password; + MMBearerAllowedAuth allowed_auth; + + self = g_task_get_source_object (task); + ctx = (CommonConnectContext *) g_task_get_task_data (task); + + user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + + /* Flag whether authentication is required. If it isn't, we won't fail + * connection attempt if the +UAUTHREQ command fails */ + ctx->auth_required = (user && password && allowed_auth != MM_BEARER_ALLOWED_AUTH_NONE); + + /* If we already cached the support, not do it again */ + if (self->priv->allowed_auths != MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN) { + authenticate_3gpp (task); + return; + } + + mm_dbg ("checking supported authentication methods..."); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->modem), + "+UAUTHREQ=?", + 10, + TRUE, /* allow cached */ + (GAsyncReadyCallback) uauthreq_test_ready, + task); +} + +static void +dial_3gpp (MMBroadbandBearer *self, + MMBaseModem *modem, + MMPortSerialAt *primary, + guint cid, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + if (!(task = common_connect_task_new (MM_BROADBAND_BEARER_UBLOX (self), + MM_BROADBAND_MODEM (modem), + primary, + cid, + NULL, /* data, unused */ + cancellable, + callback, + user_data))) + return; + + check_supported_authentication_methods (task); +} + +/*****************************************************************************/ +/* 3GPP disconnection */ + +static gboolean +disconnect_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +cgact_deactivate_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (!response) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +disconnect_3gpp (MMBroadbandBearer *self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + MMPortSerialAt *secondary, + MMPort *data, + guint cid, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + gchar *cmd; + + if (!(task = common_connect_task_new (MM_BROADBAND_BEARER_UBLOX (self), + MM_BROADBAND_MODEM (modem), + primary, + cid, + data, + NULL, + callback, + user_data))) + return; + + cmd = g_strdup_printf ("+CGACT=0,%u", cid); + mm_dbg ("deactivating PDP context #%u...", cid); + mm_base_modem_at_command (MM_BASE_MODEM (modem), + cmd, + 120, + FALSE, + (GAsyncReadyCallback) cgact_deactivate_ready, + task); + g_free (cmd); +} + +/*****************************************************************************/ +/* Reload statistics */ + +typedef struct { + guint64 bytes_rx; + guint64 bytes_tx; +} StatsResult; + +static gboolean +reload_stats_finish (MMBaseBearer *self, + guint64 *bytes_rx, + guint64 *bytes_tx, + GAsyncResult *res, + GError **error) +{ + StatsResult *result; + + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) + return FALSE; + + if (bytes_rx) + *bytes_rx = result->bytes_rx; + if (bytes_tx) + *bytes_tx = result->bytes_tx; + g_free (result); + return TRUE; +} + +static void +ugcntrd_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandBearerUblox *self; + const gchar *response; + GError *error = NULL; + guint tx_bytes = 0; + guint rx_bytes = 0; + guint cid; + + self = MM_BROADBAND_BEARER_UBLOX (g_task_get_source_object (task)); + + cid = mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (self)); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (response) + mm_ublox_parse_ugcntrd_response_for_cid (response, + cid, + &tx_bytes, &rx_bytes, + NULL, NULL, + &error); + + if (error) { + g_prefix_error (&error, "Couldn't load PDP context %u statistics: ", cid); + g_task_return_error (task, error); + } else { + StatsResult *result; + + result = g_new (StatsResult, 1); + result->bytes_rx = rx_bytes; + result->bytes_tx = tx_bytes; + g_task_return_pointer (task, result, g_free); + } + + g_object_unref (task); +} + +static void +run_reload_stats (MMBroadbandBearerUblox *self, + GTask *task) +{ + /* Unsupported? */ + if (self->priv->statistics == FEATURE_UNSUPPORTED) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Loading statistics isn't supported by this device"); + g_object_unref (task); + return; + } + + /* Supported */ + if (self->priv->statistics == FEATURE_SUPPORTED) { + MMBaseModem *modem = NULL; + + g_object_get (MM_BASE_BEARER (self), + MM_BASE_BEARER_MODEM, &modem, + NULL); + mm_base_modem_at_command (MM_BASE_MODEM (modem), + "+UGCNTRD", + 3, + FALSE, + (GAsyncReadyCallback) ugcntrd_ready, + task); + g_object_unref (modem); + return; + } + + g_assert_not_reached (); +} + +static void +ugcntrd_test_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandBearerUblox *self; + + self = MM_BROADBAND_BEARER_UBLOX (g_task_get_source_object (task)); + + if (!mm_base_modem_at_command_finish (modem, res, NULL)) + self->priv->statistics = FEATURE_UNSUPPORTED; + else + self->priv->statistics = FEATURE_SUPPORTED; + + run_reload_stats (self, task); +} + +static void +reload_stats (MMBaseBearer *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + if (MM_BROADBAND_BEARER_UBLOX (self)->priv->statistics == FEATURE_SUPPORT_UNKNOWN) { + MMBaseModem *modem = NULL; + + g_object_get (MM_BASE_BEARER (self), + MM_BASE_BEARER_MODEM, &modem, + NULL); + + mm_base_modem_at_command (MM_BASE_MODEM (modem), + "+UGCNTRD=?", + 3, + FALSE, + (GAsyncReadyCallback) ugcntrd_test_ready, + task); + g_object_unref (modem); + return; + } + + run_reload_stats (MM_BROADBAND_BEARER_UBLOX (self), task); +} + +/*****************************************************************************/ + +MMBaseBearer * +mm_broadband_bearer_ublox_new_finish (GAsyncResult *res, + GError **error) +{ + GObject *source; + GObject *bearer; + + source = g_async_result_get_source_object (res); + bearer = g_async_initable_new_finish (G_ASYNC_INITABLE (source), res, error); + g_object_unref (source); + + if (!bearer) + return NULL; + + /* Only export valid bearers */ + mm_base_bearer_export (MM_BASE_BEARER (bearer)); + + return MM_BASE_BEARER (bearer); +} + +void +mm_broadband_bearer_ublox_new (MMBroadbandModem *modem, + MMUbloxUsbProfile profile, + MMUbloxNetworkingMode mode, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_assert (mode == MM_UBLOX_NETWORKING_MODE_ROUTER || mode == MM_UBLOX_NETWORKING_MODE_BRIDGE); + + g_async_initable_new_async ( + MM_TYPE_BROADBAND_BEARER_UBLOX, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + MM_BASE_BEARER_MODEM, modem, + MM_BASE_BEARER_CONFIG, config, + MM_BROADBAND_BEARER_UBLOX_USB_PROFILE, profile, + MM_BROADBAND_BEARER_UBLOX_NETWORKING_MODE, mode, + NULL); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMBroadbandBearerUblox *self = MM_BROADBAND_BEARER_UBLOX (object); + + switch (prop_id) { + case PROP_USB_PROFILE: + self->priv->profile = g_value_get_enum (value); + break; + case PROP_NETWORKING_MODE: + self->priv->mode = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMBroadbandBearerUblox *self = MM_BROADBAND_BEARER_UBLOX (object); + + switch (prop_id) { + case PROP_USB_PROFILE: + g_value_set_enum (value, self->priv->profile); + break; + case PROP_NETWORKING_MODE: + g_value_set_enum (value, self->priv->mode); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +mm_broadband_bearer_ublox_init (MMBroadbandBearerUblox *self) +{ + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + MM_TYPE_BROADBAND_BEARER_UBLOX, + MMBroadbandBearerUbloxPrivate); + + /* Defaults */ + self->priv->profile = MM_UBLOX_USB_PROFILE_UNKNOWN; + self->priv->mode = MM_UBLOX_NETWORKING_MODE_UNKNOWN; + self->priv->allowed_auths = MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN; + self->priv->statistics = FEATURE_SUPPORT_UNKNOWN; + self->priv->cedata = FEATURE_SUPPORT_UNKNOWN; +} + +static void +mm_broadband_bearer_ublox_class_init (MMBroadbandBearerUbloxClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass); + MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMBroadbandBearerUbloxPrivate)); + + object_class->get_property = get_property; + object_class->set_property = set_property; + + /* Note: the ublox plugin uses the generic AT+CGACT? based check to monitor + * the connection status (i.e. default load_connection_status()) */ + base_bearer_class->reload_stats = reload_stats; + base_bearer_class->reload_stats_finish = reload_stats_finish; + + broadband_bearer_class->disconnect_3gpp = disconnect_3gpp; + broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish; + broadband_bearer_class->dial_3gpp = dial_3gpp; + broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish; + broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp; + broadband_bearer_class->get_ip_config_3gpp_finish = get_ip_config_3gpp_finish; + + properties[PROP_USB_PROFILE] = + g_param_spec_enum (MM_BROADBAND_BEARER_UBLOX_USB_PROFILE, + "USB profile", + "USB profile in use", + MM_TYPE_UBLOX_USB_PROFILE, + MM_UBLOX_USB_PROFILE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_USB_PROFILE, properties[PROP_USB_PROFILE]); + + properties[PROP_NETWORKING_MODE] = + g_param_spec_enum (MM_BROADBAND_BEARER_UBLOX_NETWORKING_MODE, + "Networking mode", + "Networking mode in use", + MM_TYPE_UBLOX_NETWORKING_MODE, + MM_UBLOX_NETWORKING_MODE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_NETWORKING_MODE, properties[PROP_NETWORKING_MODE]); +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-broadband-bearer-ublox.h modemmanager-1.10.0/plugins/ublox/mm-broadband-bearer-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-broadband-bearer-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-broadband-bearer-ublox.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_BEARER_UBLOX_H +#define MM_BROADBAND_BEARER_UBLOX_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-broadband-bearer.h" +#include "mm-modem-helpers-ublox.h" + +#define MM_TYPE_BROADBAND_BEARER_UBLOX (mm_broadband_bearer_ublox_get_type ()) +#define MM_BROADBAND_BEARER_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_BEARER_UBLOX, MMBroadbandBearerUblox)) +#define MM_BROADBAND_BEARER_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_BEARER_UBLOX, MMBroadbandBearerUbloxClass)) +#define MM_IS_BROADBAND_BEARER_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_BEARER_UBLOX)) +#define MM_IS_BROADBAND_BEARER_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_BEARER_UBLOX)) +#define MM_BROADBAND_BEARER_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_BEARER_UBLOX, MMBroadbandBearerUbloxClass)) + +#define MM_BROADBAND_BEARER_UBLOX_USB_PROFILE "broadband-bearer-ublox-usb-profile" +#define MM_BROADBAND_BEARER_UBLOX_NETWORKING_MODE "broadband-bearer-ublox-networking-mode" + +typedef struct _MMBroadbandBearerUblox MMBroadbandBearerUblox; +typedef struct _MMBroadbandBearerUbloxClass MMBroadbandBearerUbloxClass; +typedef struct _MMBroadbandBearerUbloxPrivate MMBroadbandBearerUbloxPrivate; + +struct _MMBroadbandBearerUblox { + MMBroadbandBearer parent; + MMBroadbandBearerUbloxPrivate *priv; +}; + +struct _MMBroadbandBearerUbloxClass { + MMBroadbandBearerClass parent; +}; + +GType mm_broadband_bearer_ublox_get_type (void); + +void mm_broadband_bearer_ublox_new (MMBroadbandModem *modem, + MMUbloxUsbProfile profile, + MMUbloxNetworkingMode mode, + MMBearerProperties *config, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBaseBearer *mm_broadband_bearer_ublox_new_finish (GAsyncResult *res, + GError **error); + +#endif /* MM_BROADBAND_BEARER_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/mm-broadband-modem-ublox.c modemmanager-1.10.0/plugins/ublox/mm-broadband-modem-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-broadband-modem-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-broadband-modem-ublox.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1293 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016-2018 Aleksander Morgado + */ + +#include + +#include +#include +#include +#include +#include + +#include "ModemManager.h" +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-3gpp.h" +#include "mm-iface-modem-voice.h" +#include "mm-base-modem-at.h" +#include "mm-broadband-bearer.h" +#include "mm-broadband-modem-ublox.h" +#include "mm-broadband-bearer-ublox.h" +#include "mm-sim-ublox.h" +#include "mm-modem-helpers-ublox.h" +#include "mm-ublox-enums-types.h" +#include "mm-call-ublox.h" + +static void iface_modem_init (MMIfaceModem *iface); +static void iface_modem_voice_init (MMIfaceModemVoice *iface); + +static MMIfaceModemVoice *iface_modem_voice_parent; + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemUblox, mm_broadband_modem_ublox, MM_TYPE_BROADBAND_MODEM, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_VOICE, iface_modem_voice_init)) + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_SUPPORTED, + FEATURE_UNSUPPORTED, +} FeatureSupport; + +struct _MMBroadbandModemUbloxPrivate { + /* USB profile in use */ + MMUbloxUsbProfile profile; + gboolean profile_checked; + /* Networking mode in use */ + MMUbloxNetworkingMode mode; + gboolean mode_checked; + + /* Flag to specify whether a power operation is ongoing */ + gboolean power_operation_ongoing; + + /* Mode combination to apply if "any" requested */ + MMModemMode any_allowed; + + /* Band management */ + FeatureSupport uact; + + /* Regex to ignore */ + GRegex *pbready_regex; +}; + +/*****************************************************************************/ + +static gboolean +acquire_power_operation (MMBroadbandModemUblox *self, + GError **error) +{ + if (self->priv->power_operation_ongoing) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_RETRY, + "An operation which requires power updates is currently in progress"); + return FALSE; + } + self->priv->power_operation_ongoing = TRUE; + return TRUE; +} + +static void +release_power_operation (MMBroadbandModemUblox *self) +{ + g_assert (self->priv->power_operation_ongoing); + self->priv->power_operation_ongoing = FALSE; +} + +/*****************************************************************************/ +/* Load supported bands (Modem interface) */ + +static GArray * +load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); +} + +static void +uact_test_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self); + const gchar *response; + GError *error = NULL; + GArray *bands = NULL; + GArray *bands_2g = NULL; + GArray *bands_3g = NULL; + GArray *bands_4g = NULL; + + response = mm_base_modem_at_command_finish (_self, res, NULL); + if (!response) { + /* Flag as unsupported */ + self->priv->uact = FEATURE_UNSUPPORTED; + + /* The list of supported tasks we give here must include not only the bands + * allowed in the current AcT, but the whole list of bands allowed in all + * AcTs. This is because the list of supported bands is loaded only once + * during modem initialization. Not ideal, but the current API is like that. + * + * So, we give a predefined list of supported bands and we filter them in the + * same way we filter the allowed AcTs. + */ + bands = mm_ublox_get_supported_bands (mm_iface_modem_get_model (MM_IFACE_MODEM (self)), &error); + goto out; + } + + /* Flag as supported */ + self->priv->uact = FEATURE_SUPPORTED; + + /* Parse UACT=? test response */ + if (!mm_ublox_parse_uact_test (response, &bands_2g, &bands_3g, &bands_4g, &error)) + goto out; + + /* Build a combined array */ + bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); + if (bands_2g) { + bands = g_array_append_vals (bands, bands_2g->data, bands_2g->len); + g_array_unref (bands_2g); + } + if (bands_3g) { + bands = g_array_append_vals (bands, bands_3g->data, bands_3g->len); + g_array_unref (bands_3g); + } + if (bands_4g) { + bands = g_array_append_vals (bands, bands_4g->data, bands_4g->len); + g_array_unref (bands_4g); + } + g_assert (bands->len > 0); + +out: + if (!bands) { + g_assert (error); + g_task_return_error (task, error); + } else + g_task_return_pointer (task, bands, (GDestroyNotify) g_array_unref); + g_object_unref (task); +} + +static void +load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* See if AT+UACT is supported to query bands */ + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+UACT=?", + 3, + TRUE, /* allow cached */ + (GAsyncReadyCallback) uact_test_ready, + task); +} + +/*****************************************************************************/ +/* Load current bands (Modem interface) */ + +static GArray * +load_current_bands_finish (MMIfaceModem *_self, + GAsyncResult *res, + GError **error) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self); + const gchar *response; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response) + return NULL; + + if (self->priv->uact == FEATURE_SUPPORTED) + return mm_ublox_parse_uact_response (response, error); + + return mm_ublox_parse_ubandsel_response (response, error); +} + +static void +load_current_bands (MMIfaceModem *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self); + + g_assert (self->priv->uact != FEATURE_SUPPORT_UNKNOWN); + + if (self->priv->uact == FEATURE_SUPPORTED) { + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+UACT?", + 3, + FALSE, + (GAsyncReadyCallback)callback, + user_data); + return; + } + + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+UBANDSEL?", + 3, + FALSE, + (GAsyncReadyCallback)callback, + user_data); +} + +/*****************************************************************************/ +/* Set allowed modes/bands (Modem interface) */ + +typedef enum { + SET_CURRENT_MODES_BANDS_STEP_FIRST, + SET_CURRENT_MODES_BANDS_STEP_ACQUIRE, + SET_CURRENT_MODES_BANDS_STEP_CURRENT_POWER, + SET_CURRENT_MODES_BANDS_STEP_POWER_DOWN, + SET_CURRENT_MODES_BANDS_STEP_COMMAND, + SET_CURRENT_MODES_BANDS_STEP_RECOVER_CURRENT_POWER, + SET_CURRENT_MODES_BANDS_STEP_RELEASE, + SET_CURRENT_MODES_BANDS_STEP_LAST, +} SetCurrentModesBandsStep; + +typedef struct { + MMBroadbandModemUblox *self; + SetCurrentModesBandsStep step; + gchar *command; + MMModemPowerState initial_state; + GError *saved_error; +} SetCurrentModesBandsContext; + +static void +set_current_modes_bands_context_free (SetCurrentModesBandsContext *ctx) +{ + g_assert (!ctx->saved_error); + g_free (ctx->command); + g_object_unref (ctx->self); + g_slice_free (SetCurrentModesBandsContext, ctx); +} + +static void +set_current_modes_bands_context_new (GTask *task, + MMIfaceModem *self, + gchar *command) +{ + SetCurrentModesBandsContext *ctx; + + ctx = g_slice_new0 (SetCurrentModesBandsContext); + ctx->self = MM_BROADBAND_MODEM_UBLOX (g_object_ref (self)); + ctx->command = command; + ctx->initial_state = MM_MODEM_POWER_STATE_UNKNOWN; + ctx->step = SET_CURRENT_MODES_BANDS_STEP_FIRST; + g_task_set_task_data (task, ctx, (GDestroyNotify) set_current_modes_bands_context_free); +} + +static gboolean +common_set_current_modes_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void set_current_modes_bands_step (GTask *task); + +static void +set_current_modes_bands_recover_power_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesBandsContext *ctx; + + ctx = (SetCurrentModesBandsContext *) g_task_get_task_data (task); + g_assert (ctx); + + /* propagate the error if none already set */ + mm_base_modem_at_command_finish (self, res, ctx->saved_error ? NULL : &ctx->saved_error); + + /* Go to next step (release power operation) regardless of the result */ + ctx->step++; + set_current_modes_bands_step (task); +} + +static void +set_current_modes_bands_command_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesBandsContext *ctx; + + ctx = (SetCurrentModesBandsContext *) g_task_get_task_data (task); + g_assert (ctx); + + mm_base_modem_at_command_finish (self, res, &ctx->saved_error); + + /* Go to next step (recover current power) regardless of the result */ + ctx->step++; + set_current_modes_bands_step (task); +} + +static void +set_current_modes_bands_low_power_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesBandsContext *ctx; + + ctx = (SetCurrentModesBandsContext *) g_task_get_task_data (task); + g_assert (ctx); + + if (!mm_base_modem_at_command_finish (self, res, &ctx->saved_error)) + ctx->step = SET_CURRENT_MODES_BANDS_STEP_RELEASE; + else + ctx->step++; + + set_current_modes_bands_step (task); +} + +static void +set_current_modes_bands_current_power_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesBandsContext *ctx; + const gchar *response; + + ctx = (SetCurrentModesBandsContext *) g_task_get_task_data (task); + g_assert (ctx); + + response = mm_base_modem_at_command_finish (self, res, &ctx->saved_error); + if (!response || !mm_ublox_parse_cfun_response (response, &ctx->initial_state, &ctx->saved_error)) + ctx->step = SET_CURRENT_MODES_BANDS_STEP_RELEASE; + else + ctx->step++; + + set_current_modes_bands_step (task); +} + +static void +set_current_modes_bands_step (GTask *task) +{ + SetCurrentModesBandsContext *ctx; + + ctx = (SetCurrentModesBandsContext *) g_task_get_task_data (task); + g_assert (ctx); + + switch (ctx->step) { + case SET_CURRENT_MODES_BANDS_STEP_FIRST: + ctx->step++; + /* fall down */ + + case SET_CURRENT_MODES_BANDS_STEP_ACQUIRE: + mm_dbg ("acquiring power operation..."); + if (!acquire_power_operation (ctx->self, &ctx->saved_error)) { + ctx->step = SET_CURRENT_MODES_BANDS_STEP_LAST; + set_current_modes_bands_step (task); + return; + } + ctx->step++; + /* fall down */ + + case SET_CURRENT_MODES_BANDS_STEP_CURRENT_POWER: + mm_dbg ("checking current power operation..."); + mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + "+CFUN?", + 3, + FALSE, + (GAsyncReadyCallback) set_current_modes_bands_current_power_ready, + task); + return; + + case SET_CURRENT_MODES_BANDS_STEP_POWER_DOWN: + if (ctx->initial_state != MM_MODEM_POWER_STATE_LOW) { + mm_dbg ("powering down before configuration change..."); + mm_base_modem_at_command ( + MM_BASE_MODEM (ctx->self), + "+CFUN=4", + 3, + FALSE, + (GAsyncReadyCallback) set_current_modes_bands_low_power_ready, + task); + return; + } + ctx->step++; + /* fall down */ + + case SET_CURRENT_MODES_BANDS_STEP_COMMAND: + mm_dbg ("updating configuration..."); + mm_base_modem_at_command ( + MM_BASE_MODEM (ctx->self), + ctx->command, + 3, + FALSE, + (GAsyncReadyCallback) set_current_modes_bands_command_ready, + task); + return; + + case SET_CURRENT_MODES_BANDS_STEP_RECOVER_CURRENT_POWER: + if (ctx->initial_state != MM_MODEM_POWER_STATE_LOW) { + mm_dbg ("recovering power state after configuration change..."); + mm_base_modem_at_command ( + MM_BASE_MODEM (ctx->self), + "+CFUN=1", + 3, + FALSE, + (GAsyncReadyCallback) set_current_modes_bands_recover_power_ready, + task); + return; + } + ctx->step++; + /* fall down */ + + case SET_CURRENT_MODES_BANDS_STEP_RELEASE: + mm_dbg ("releasing power operation..."); + release_power_operation (ctx->self); + ctx->step++; + /* fall down */ + + case SET_CURRENT_MODES_BANDS_STEP_LAST: + if (ctx->saved_error) { + g_task_return_error (task, ctx->saved_error); + ctx->saved_error = NULL; + } else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } +} + +static void +set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + gchar *command; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); + + /* Handle ANY */ + if (allowed == MM_MODEM_MODE_ANY) + allowed = MM_BROADBAND_MODEM_UBLOX (self)->priv->any_allowed; + + /* Build command */ + command = mm_ublox_build_urat_set_command (allowed, preferred, &error); + if (!command) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + set_current_modes_bands_context_new (task, self, command); + set_current_modes_bands_step (task); +} + +static void +set_current_bands (MMIfaceModem *_self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self); + GTask *task; + gchar *command; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); + + /* Build command */ + if (self->priv->uact == FEATURE_SUPPORTED) + command = mm_ublox_build_uact_set_command (bands_array, &error); + else + command = mm_ublox_build_ubandsel_set_command (bands_array, &error); + + if (!command) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + set_current_modes_bands_context_new (task, _self, command); + set_current_modes_bands_step (task); +} + +/*****************************************************************************/ +/* Load current modes (Modem interface) */ + +static gboolean +load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) +{ + const gchar *response; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response) + return FALSE; + + return mm_ublox_parse_urat_read_response (response, allowed, preferred, error); +} + +static void +load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+URAT?", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Load supported modes (Modem interface) */ + +static GArray * +load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + const gchar *response; + GArray *combinations; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response) + return FALSE; + + if (!(combinations = mm_ublox_parse_urat_test_response (response, error))) + return FALSE; + + if (!(combinations = mm_ublox_filter_supported_modes (mm_iface_modem_get_model (self), combinations, error))) + return FALSE; + + /* Decide and store which combination to apply when ANY requested */ + MM_BROADBAND_MODEM_UBLOX (self)->priv->any_allowed = mm_ublox_get_modem_mode_any (combinations); + + /* If 4G supported, explicitly use +CEREG */ + if (MM_BROADBAND_MODEM_UBLOX (self)->priv->any_allowed & MM_MODEM_MODE_4G) + g_object_set (self, MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, TRUE, NULL); + + return combinations; +} + +static void +load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+URAT=?", + 3, + TRUE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Power state loading (Modem interface) */ + +static MMModemPowerState +load_power_state_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + MMModemPowerState state = MM_MODEM_POWER_STATE_UNKNOWN; + const gchar *response; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (response) + mm_ublox_parse_cfun_response (response, &state, error); + return state; +} + +static void +load_power_state (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+CFUN?", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Modem power up/down/off (Modem interface) */ + +static gboolean +common_modem_power_operation_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +power_operation_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + release_power_operation (MM_BROADBAND_MODEM_UBLOX (self)); + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +common_modem_power_operation (MMBroadbandModemUblox *self, + const gchar *command, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); + + /* Fail if there is already an ongoing power management operation */ + if (!acquire_power_operation (self, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Use AT+CFUN=4 for power down, puts device in airplane mode */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + command, + 30, + FALSE, + (GAsyncReadyCallback) power_operation_ready, + task); +} + +static void +modem_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_BROADBAND_MODEM_UBLOX (self), "+CFUN=16", callback, user_data); +} + +static void +modem_power_off (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_BROADBAND_MODEM_UBLOX (self), "+CPWROFF", callback, user_data); +} + +static void +modem_power_down (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_BROADBAND_MODEM_UBLOX (self), "+CFUN=4", callback, user_data); +} + +static void +modem_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_BROADBAND_MODEM_UBLOX (self), "+CFUN=1", callback, user_data); +} + +/*****************************************************************************/ +/* Load unlock retries (Modem interface) */ + +static MMUnlockRetries * +load_unlock_retries_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + const gchar *response; + MMUnlockRetries *retries; + guint pin_attempts = 0; + guint pin2_attempts = 0; + guint puk_attempts = 0; + guint puk2_attempts = 0; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response || !mm_ublox_parse_upincnt_response (response, + &pin_attempts, &pin2_attempts, + &puk_attempts, &puk2_attempts, + error)) + return NULL; + + retries = mm_unlock_retries_new (); + mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN, pin_attempts); + mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk_attempts); + mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN2, pin2_attempts); + mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK2, puk2_attempts); + + return retries; +} + +static void +load_unlock_retries (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+UPINCNT", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Enabling unsolicited events (Voice interface) */ + +static gboolean +modem_voice_enable_unsolicited_events_finish (MMIfaceModemVoice *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +own_voice_enable_unsolicited_events_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + mm_base_modem_at_command_full_finish (self, res, &error); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_voice_enable_unsolicited_events_ready (MMIfaceModemVoice *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!iface_modem_voice_parent->enable_unsolicited_events_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Our own enable now */ + mm_base_modem_at_command_full ( + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), + "+UCALLSTAT=1", + 5, + FALSE, /* allow_cached */ + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback)own_voice_enable_unsolicited_events_ready, + task); +} + +static void +modem_voice_enable_unsolicited_events (MMIfaceModemVoice *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Chain up parent's enable */ + iface_modem_voice_parent->enable_unsolicited_events ( + self, + (GAsyncReadyCallback)parent_voice_enable_unsolicited_events_ready, + task); +} + +/*****************************************************************************/ +/* Disabling unsolicited events (Voice interface) */ + +static gboolean +modem_voice_disable_unsolicited_events_finish (MMIfaceModemVoice *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +own_voice_disable_unsolicited_events_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + mm_base_modem_at_command_full_finish (self, res, &error); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +modem_voice_disable_unsolicited_events (MMIfaceModemVoice *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Note: no parent disable method */ + + mm_base_modem_at_command_full ( + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), + "+UCALLSTAT=0", + 5, + FALSE, /* allow_cached */ + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback)own_voice_disable_unsolicited_events_ready, + task); +} + +/*****************************************************************************/ +/* Create call (Voice interface) */ + +static MMBaseCall * +create_call (MMIfaceModemVoice *self, + MMCallDirection direction, + const gchar *number) +{ + /* New u-blox Call */ + return mm_call_ublox_new (MM_BASE_MODEM (self), direction, number); +} + +/*****************************************************************************/ +/* Create Bearer (Modem interface) */ + +typedef enum { + CREATE_BEARER_STEP_FIRST, + CREATE_BEARER_STEP_CHECK_PROFILE, + CREATE_BEARER_STEP_CHECK_MODE, + CREATE_BEARER_STEP_CREATE_BEARER, + CREATE_BEARER_STEP_LAST, +} CreateBearerStep; + +typedef struct { + MMBroadbandModemUblox *self; + CreateBearerStep step; + MMBearerProperties *properties; + MMBaseBearer *bearer; + gboolean has_net; +} CreateBearerContext; + +static void +create_bearer_context_free (CreateBearerContext *ctx) +{ + if (ctx->bearer) + g_object_unref (ctx->bearer); + g_object_unref (ctx->properties); + g_object_unref (ctx->self); + g_slice_free (CreateBearerContext, ctx); +} + +static MMBaseBearer * +modem_create_bearer_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return MM_BASE_BEARER (g_task_propagate_pointer (G_TASK (res), error)); +} + +static void create_bearer_step (GTask *task); + +static void +broadband_bearer_new_ready (GObject *source, + GAsyncResult *res, + GTask *task) +{ + CreateBearerContext *ctx; + GError *error = NULL; + + ctx = (CreateBearerContext *) g_task_get_task_data (task); + + g_assert (!ctx->bearer); + ctx->bearer = mm_broadband_bearer_new_finish (res, &error); + if (!ctx->bearer) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("u-blox: new generic broadband bearer created at DBus path '%s'", mm_base_bearer_get_path (ctx->bearer)); + ctx->step++; + create_bearer_step (task); +} + +static void +broadband_bearer_ublox_new_ready (GObject *source, + GAsyncResult *res, + GTask *task) +{ + CreateBearerContext *ctx; + GError *error = NULL; + + ctx = (CreateBearerContext *) g_task_get_task_data (task); + + g_assert (!ctx->bearer); + ctx->bearer = mm_broadband_bearer_ublox_new_finish (res, &error); + if (!ctx->bearer) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("u-blox: new u-blox broadband bearer created at DBus path '%s'", mm_base_bearer_get_path (ctx->bearer)); + ctx->step++; + create_bearer_step (task); +} + +static void +mode_check_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + CreateBearerContext *ctx; + + ctx = (CreateBearerContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response) { + mm_dbg ("u-blox: couldn't load current networking mode: %s", error->message); + g_error_free (error); + } else if (!mm_ublox_parse_ubmconf_response (response, &ctx->self->priv->mode, &error)) { + mm_dbg ("u-blox: couldn't parse current networking mode response '%s': %s", response, error->message); + g_error_free (error); + } else { + g_assert (ctx->self->priv->mode != MM_UBLOX_NETWORKING_MODE_UNKNOWN); + mm_dbg ("u-blox: networking mode loaded: %s", mm_ublox_networking_mode_get_string (ctx->self->priv->mode)); + } + + /* If checking networking mode isn't supported, we'll fallback to + * assume the device is in router mode, which is the mode asking for + * less connection setup rules from our side (just request DHCP). + */ + if (ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_UNKNOWN && ctx->has_net) { + mm_dbg ("u-blox: fallback to default networking mode: router"); + ctx->self->priv->mode = MM_UBLOX_NETWORKING_MODE_ROUTER; + } + + ctx->self->priv->mode_checked = TRUE; + + ctx->step++; + create_bearer_step (task); +} + +static void +profile_check_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + CreateBearerContext *ctx; + + ctx = (CreateBearerContext *) g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response) { + mm_dbg ("u-blox: couldn't load current usb profile: %s", error->message); + g_error_free (error); + } else if (!mm_ublox_parse_uusbconf_response (response, &ctx->self->priv->profile, &error)) { + mm_dbg ("u-blox: couldn't parse current usb profile response '%s': %s", response, error->message); + g_error_free (error); + } else { + g_assert (ctx->self->priv->profile != MM_UBLOX_USB_PROFILE_UNKNOWN); + mm_dbg ("u-blox: usb profile loaded: %s", mm_ublox_usb_profile_get_string (ctx->self->priv->profile)); + } + + /* Assume the operation has been performed, even if it may have failed */ + ctx->self->priv->profile_checked = TRUE; + + ctx->step++; + create_bearer_step (task); +} + +static void +create_bearer_step (GTask *task) +{ + CreateBearerContext *ctx; + + ctx = (CreateBearerContext *) g_task_get_task_data (task); + switch (ctx->step) { + case CREATE_BEARER_STEP_FIRST: + ctx->step++; + /* fall down */ + + case CREATE_BEARER_STEP_CHECK_PROFILE: + if (!ctx->self->priv->profile_checked) { + mm_dbg ("u-blox: checking current USB profile..."); + mm_base_modem_at_command ( + MM_BASE_MODEM (ctx->self), + "+UUSBCONF?", + 3, + FALSE, + (GAsyncReadyCallback) profile_check_ready, + task); + return; + } + ctx->step++; + /* fall down */ + + case CREATE_BEARER_STEP_CHECK_MODE: + if (!ctx->self->priv->mode_checked) { + mm_dbg ("u-blox: checking current networking mode..."); + mm_base_modem_at_command ( + MM_BASE_MODEM (ctx->self), + "+UBMCONF?", + 3, + FALSE, + (GAsyncReadyCallback) mode_check_ready, + task); + return; + } + ctx->step++; + /* fall down */ + + case CREATE_BEARER_STEP_CREATE_BEARER: + /* If we have a net interface, we'll create a u-blox bearer, unless for + * any reason we have the back-compatible profile selected. */ + if ((ctx->self->priv->profile != MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE) && ctx->has_net) { + /* whenever there is a net port, we should have loaded a valid networking mode */ + g_assert (ctx->self->priv->mode != MM_UBLOX_NETWORKING_MODE_UNKNOWN); + mm_dbg ("u-blox: creating u-blox broadband bearer (%s profile, %s mode)...", + mm_ublox_usb_profile_get_string (ctx->self->priv->profile), + mm_ublox_networking_mode_get_string (ctx->self->priv->mode)); + mm_broadband_bearer_ublox_new ( + MM_BROADBAND_MODEM (ctx->self), + ctx->self->priv->profile, + ctx->self->priv->mode, + ctx->properties, + NULL, /* cancellable */ + (GAsyncReadyCallback) broadband_bearer_ublox_new_ready, + task); + return; + } + + /* If usb profile is back-compatible already, or if there is no NET port + * available, create default generic bearer */ + mm_dbg ("u-blox: creating generic broadband bearer..."); + mm_broadband_bearer_new (MM_BROADBAND_MODEM (ctx->self), + ctx->properties, + NULL, /* cancellable */ + (GAsyncReadyCallback) broadband_bearer_new_ready, + task); + return; + + case CREATE_BEARER_STEP_LAST: + g_assert (ctx->bearer); + g_task_return_pointer (task, g_object_ref (ctx->bearer), g_object_unref); + g_object_unref (task); + return; + } + + g_assert_not_reached (); +} + +static void +modem_create_bearer (MMIfaceModem *self, + MMBearerProperties *properties, + GAsyncReadyCallback callback, + gpointer user_data) +{ + CreateBearerContext *ctx; + GTask *task; + + ctx = g_slice_new0 (CreateBearerContext); + ctx->step = CREATE_BEARER_STEP_FIRST; + ctx->self = g_object_ref (self); + ctx->properties = g_object_ref (properties); + + /* Flag whether this modem has exposed a network interface */ + ctx->has_net = !!mm_base_modem_peek_best_data_port (MM_BASE_MODEM (self), MM_PORT_TYPE_NET); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify) create_bearer_context_free); + create_bearer_step (task); +} + +/*****************************************************************************/ +/* Create SIM (Modem interface) */ + +static MMBaseSim * +modem_create_sim_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return mm_sim_ublox_new_finish (res, error); +} + +static void +modem_create_sim (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_sim_ublox_new (MM_BASE_MODEM (self), + NULL, /* cancellable */ + callback, + user_data); +} + +/*****************************************************************************/ +/* Setup ports (Broadband modem class) */ + +static void +setup_ports (MMBroadbandModem *_self) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self); + MMPortSerialAt *ports[2]; + guint i; + + /* Call parent's setup ports first always */ + MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_ublox_parent_class)->setup_ports (_self); + + ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); + ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); + + /* Configure AT ports */ + for (i = 0; i < G_N_ELEMENTS (ports); i++) { + if (!ports[i]) + continue; + + g_object_set (ports[i], + MM_PORT_SERIAL_SEND_DELAY, (guint64) 0, + NULL); + + mm_port_serial_at_add_unsolicited_msg_handler ( + ports[i], + self->priv->pbready_regex, + NULL, NULL, NULL); + } +} + +/*****************************************************************************/ + +MMBroadbandModemUblox * +mm_broadband_modem_ublox_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_UBLOX, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + NULL); +} + +static void +mm_broadband_modem_ublox_init (MMBroadbandModemUblox *self) +{ + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + MM_TYPE_BROADBAND_MODEM_UBLOX, + MMBroadbandModemUbloxPrivate); + self->priv->profile = MM_UBLOX_USB_PROFILE_UNKNOWN; + self->priv->mode = MM_UBLOX_NETWORKING_MODE_UNKNOWN; + self->priv->any_allowed = MM_MODEM_MODE_NONE; + self->priv->uact = FEATURE_SUPPORT_UNKNOWN; + + self->priv->pbready_regex = g_regex_new ("\\r\\n\\+PBREADY\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); +} + +static void +iface_modem_init (MMIfaceModem *iface) +{ + iface->create_sim = modem_create_sim; + iface->create_sim_finish = modem_create_sim_finish; + iface->create_bearer = modem_create_bearer; + iface->create_bearer_finish = modem_create_bearer_finish; + iface->load_unlock_retries = load_unlock_retries; + iface->load_unlock_retries_finish = load_unlock_retries_finish; + iface->load_power_state = load_power_state; + iface->load_power_state_finish = load_power_state_finish; + iface->modem_power_up = modem_power_up; + iface->modem_power_up_finish = common_modem_power_operation_finish; + iface->modem_power_down = modem_power_down; + iface->modem_power_down_finish = common_modem_power_operation_finish; + iface->modem_power_off = modem_power_off; + iface->modem_power_off_finish = common_modem_power_operation_finish; + iface->reset = modem_reset; + iface->reset_finish = common_modem_power_operation_finish; + iface->load_supported_modes = load_supported_modes; + iface->load_supported_modes_finish = load_supported_modes_finish; + iface->load_current_modes = load_current_modes; + iface->load_current_modes_finish = load_current_modes_finish; + iface->set_current_modes = set_current_modes; + iface->set_current_modes_finish = common_set_current_modes_bands_finish; + iface->load_supported_bands = load_supported_bands; + iface->load_supported_bands_finish = load_supported_bands_finish; + iface->load_current_bands = load_current_bands; + iface->load_current_bands_finish = load_current_bands_finish; + iface->set_current_bands = set_current_bands; + iface->set_current_bands_finish = common_set_current_modes_bands_finish; +} + +static void +iface_modem_voice_init (MMIfaceModemVoice *iface) +{ + iface_modem_voice_parent = g_type_interface_peek_parent (iface); + + iface->enable_unsolicited_events = modem_voice_enable_unsolicited_events; + iface->enable_unsolicited_events_finish = modem_voice_enable_unsolicited_events_finish; + iface->disable_unsolicited_events = modem_voice_disable_unsolicited_events; + iface->disable_unsolicited_events_finish = modem_voice_disable_unsolicited_events_finish; + + iface->create_call = create_call; +} + +static void +finalize (GObject *object) +{ + MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (object); + + g_regex_unref (self->priv->pbready_regex); + + G_OBJECT_CLASS (mm_broadband_modem_ublox_parent_class)->finalize (object); +} + +static void +mm_broadband_modem_ublox_class_init (MMBroadbandModemUbloxClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMBroadbandModemUbloxPrivate)); + + object_class->finalize = finalize; + + broadband_modem_class->setup_ports = setup_ports; +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-broadband-modem-ublox.h modemmanager-1.10.0/plugins/ublox/mm-broadband-modem-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-broadband-modem-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-broadband-modem-ublox.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,49 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_UBLOX_H +#define MM_BROADBAND_MODEM_UBLOX_H + +#include "mm-broadband-modem.h" + +#define MM_TYPE_BROADBAND_MODEM_UBLOX (mm_broadband_modem_ublox_get_type ()) +#define MM_BROADBAND_MODEM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_UBLOX, MMBroadbandModemUblox)) +#define MM_BROADBAND_MODEM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_UBLOX, MMBroadbandModemUbloxClass)) +#define MM_IS_BROADBAND_MODEM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_UBLOX)) +#define MM_IS_BROADBAND_MODEM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_UBLOX)) +#define MM_BROADBAND_MODEM_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_UBLOX, MMBroadbandModemUbloxClass)) + +typedef struct _MMBroadbandModemUblox MMBroadbandModemUblox; +typedef struct _MMBroadbandModemUbloxClass MMBroadbandModemUbloxClass; +typedef struct _MMBroadbandModemUbloxPrivate MMBroadbandModemUbloxPrivate; + +struct _MMBroadbandModemUblox { + MMBroadbandModem parent; + MMBroadbandModemUbloxPrivate *priv; +}; + +struct _MMBroadbandModemUbloxClass{ + MMBroadbandModemClass parent; +}; + +GType mm_broadband_modem_ublox_get_type (void); + +MMBroadbandModemUblox *mm_broadband_modem_ublox_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/mm-call-ublox.c modemmanager-1.10.0/plugins/ublox/mm-call-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-call-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-call-ublox.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,194 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-base-modem-at.h" +#include "mm-broadband-modem-ublox.h" +#include "mm-call-ublox.h" + +G_DEFINE_TYPE (MMCallUblox, mm_call_ublox, MM_TYPE_BASE_CALL) + +struct _MMCallUbloxPrivate { + GRegex *ucallstat_regex; +}; + +/*****************************************************************************/ +/* In-call unsolicited events */ + +static void +ublox_ucallstat_received (MMPortSerialAt *port, + GMatchInfo *match_info, + MMCallUblox *self) +{ + static const gchar *call_stat_names[] = { + [0] = "active", + [1] = "hold", + [2] = "dialling (MO)", + [3] = "alerting (MO)", + [4] = "ringing (MT)", + [5] = "waiting (MT)", + [6] = "disconnected", + [7] = "connected", + }; + guint id; + guint stat; + + if (!mm_get_uint_from_match_info (match_info, 1, &id)) + return; + + if (!mm_get_uint_from_match_info (match_info, 2, &stat)) + return; + + if (stat < G_N_ELEMENTS (call_stat_names)) + mm_dbg ("u-blox call id '%u' state: '%s'", id, call_stat_names[stat]); + else + mm_dbg ("u-blox call id '%u' state unknown: '%u'", id, stat); + + switch (stat) { + case 0: + /* ringing to active */ + if (mm_gdbus_call_get_state (MM_GDBUS_CALL (self)) == MM_CALL_STATE_RINGING_OUT) + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); + break; + case 1: + /* ignore hold state, we don't support this yet. */ + break; + case 2: + /* ignore dialing state, we already handle this in the parent */ + break; + case 3: + /* dialing to ringing */ + if (mm_gdbus_call_get_state (MM_GDBUS_CALL (self)) == MM_CALL_STATE_DIALING) + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED); + break; + case 4: + /* ignore MT ringing state, we already handle this in the parent */ + break; + case 5: + /* ignore MT waiting state */ + break; + case 6: + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); + break; + case 7: + /* ringing to active */ + if (mm_gdbus_call_get_state (MM_GDBUS_CALL (self)) == MM_CALL_STATE_RINGING_OUT) + mm_base_call_change_state (MM_BASE_CALL (self), MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); + break; + } +} + +static gboolean +common_setup_cleanup_unsolicited_events (MMCallUblox *self, + gboolean enable, + GError **error) +{ + MMBaseModem *modem = NULL; + MMPortSerialAt *port; + + if (G_UNLIKELY (!self->priv->ucallstat_regex)) + self->priv->ucallstat_regex = g_regex_new ("\\r\\n\\+UCALLSTAT:\\s*(\\d+),(\\d+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + + g_object_get (self, + MM_BASE_CALL_MODEM, &modem, + NULL); + + port = mm_base_modem_peek_port_primary (MM_BASE_MODEM (modem)); + if (port) { + mm_dbg ("%s +UCALLSTAT URC handler", enable ? "adding" : "removing"); + mm_port_serial_at_add_unsolicited_msg_handler ( + port, + self->priv->ucallstat_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn)ublox_ucallstat_received : NULL, + enable ? self : NULL, + NULL); + } + + g_object_unref (modem); + return TRUE; +} + +static gboolean +setup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (MM_CALL_UBLOX (self), TRUE, error); +} + +static gboolean +cleanup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (MM_CALL_UBLOX (self), FALSE, error); +} + +/*****************************************************************************/ + +MMBaseCall * +mm_call_ublox_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number) +{ + return MM_BASE_CALL (g_object_new (MM_TYPE_CALL_UBLOX, + MM_BASE_CALL_MODEM, modem, + "direction", direction, + "number", number, + MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE, + MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE, + NULL)); +} + +static void +mm_call_ublox_init (MMCallUblox *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CALL_UBLOX, MMCallUbloxPrivate); +} + +static void +finalize (GObject *object) +{ + MMCallUblox *self = MM_CALL_UBLOX (object); + + if (self->priv->ucallstat_regex) + g_regex_unref (self->priv->ucallstat_regex); + + G_OBJECT_CLASS (mm_call_ublox_parent_class)->finalize (object); +} + +static void +mm_call_ublox_class_init (MMCallUbloxClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMBaseCallClass *base_call_class = MM_BASE_CALL_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMCallUbloxPrivate)); + + object_class->finalize = finalize; + + base_call_class->setup_unsolicited_events = setup_unsolicited_events; + base_call_class->cleanup_unsolicited_events = cleanup_unsolicited_events; +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-call-ublox.h modemmanager-1.10.0/plugins/ublox/mm-call-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-call-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-call-ublox.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,50 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_CALL_UBLOX_H +#define MM_CALL_UBLOX_H + +#include +#include + +#include "mm-base-call.h" + +#define MM_TYPE_CALL_UBLOX (mm_call_ublox_get_type ()) +#define MM_CALL_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_CALL_UBLOX, MMCallUblox)) +#define MM_CALL_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_CALL_UBLOX, MMCallUbloxClass)) +#define MM_IS_CALL_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_CALL_UBLOX)) +#define MM_IS_CALL_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_CALL_UBLOX)) +#define MM_CALL_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_CALL_UBLOX, MMCallUbloxClass)) + +typedef struct _MMCallUblox MMCallUblox; +typedef struct _MMCallUbloxClass MMCallUbloxClass; +typedef struct _MMCallUbloxPrivate MMCallUbloxPrivate; + +struct _MMCallUblox { + MMBaseCall parent; + MMCallUbloxPrivate *priv; +}; + +struct _MMCallUbloxClass { + MMBaseCallClass parent; +}; + +GType mm_call_ublox_get_type (void); + +MMBaseCall *mm_call_ublox_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number); + +#endif /* MM_CALL_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/mm-modem-helpers-ublox.c modemmanager-1.10.0/plugins/ublox/mm-modem-helpers-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-modem-helpers-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-modem-helpers-ublox.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1462 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-ublox.h" + +/*****************************************************************************/ +/* +UPINCNT response parser */ + +gboolean +mm_ublox_parse_upincnt_response (const gchar *response, + guint *out_pin_attempts, + guint *out_pin2_attempts, + guint *out_puk_attempts, + guint *out_puk2_attempts, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint pin_attempts = 0; + guint pin2_attempts = 0; + guint puk_attempts = 0; + guint puk2_attempts = 0; + gboolean success = TRUE; + + g_assert (out_pin_attempts); + g_assert (out_pin2_attempts); + g_assert (out_puk_attempts); + g_assert (out_puk2_attempts); + + /* Response may be e.g.: + * +UPINCNT: 3,3,10,10 + */ + r = g_regex_new ("\\+UPINCNT: (\\d+),(\\d+),(\\d+),(\\d+)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + if (!mm_get_uint_from_match_info (match_info, 1, &pin_attempts)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't parse PIN attempts"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 2, &pin2_attempts)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't parse PIN2 attempts"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 3, &puk_attempts)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't parse PUK attempts"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 4, &puk2_attempts)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't parse PUK2 attempts"); + goto out; + } + success = TRUE; + } + +out: + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (!success) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse +UPINCNT response: '%s'", response); + return FALSE; + } + + *out_pin_attempts = pin_attempts; + *out_pin2_attempts = pin2_attempts; + *out_puk_attempts = puk_attempts; + *out_puk2_attempts = puk2_attempts; + return TRUE; +} + +/*****************************************************************************/ +/* UUSBCONF? response parser */ + +gboolean +mm_ublox_parse_uusbconf_response (const gchar *response, + MMUbloxUsbProfile *out_profile, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + MMUbloxUsbProfile profile = MM_UBLOX_USB_PROFILE_UNKNOWN; + + g_assert (out_profile != NULL); + + /* Response may be e.g.: + * +UUSBCONF: 3,"RNDIS",,"0x1146" + * +UUSBCONF: 2,"ECM",,"0x1143" + * +UUSBCONF: 0,"",,"0x1141" + * + * Note: we don't rely on the PID; assuming future new modules will + * have a different PID but they may keep the profile names. + */ + r = g_regex_new ("\\+UUSBCONF: (\\d+),([^,]*),([^,]*),([^,]*)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + gchar *profile_name; + + profile_name = mm_get_string_unquoted_from_match_info (match_info, 2); + if (profile_name && profile_name[0]) { + if (g_str_equal (profile_name, "RNDIS")) + profile = MM_UBLOX_USB_PROFILE_RNDIS; + else if (g_str_equal (profile_name, "ECM")) + profile = MM_UBLOX_USB_PROFILE_ECM; + else + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unknown USB profile: '%s'", profile_name); + } else + profile = MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE; + g_free (profile_name); + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (profile == MM_UBLOX_USB_PROFILE_UNKNOWN) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse profile response"); + return FALSE; + } + + *out_profile = profile; + return TRUE; +} + +/*****************************************************************************/ +/* UBMCONF? response parser */ + +gboolean +mm_ublox_parse_ubmconf_response (const gchar *response, + MMUbloxNetworkingMode *out_mode, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + MMUbloxNetworkingMode mode = MM_UBLOX_NETWORKING_MODE_UNKNOWN; + + g_assert (out_mode != NULL); + + /* Response may be e.g.: + * +UBMCONF: 1 + * +UBMCONF: 2 + */ + r = g_regex_new ("\\+UBMCONF: (\\d+)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + guint mode_id = 0; + + if (mm_get_uint_from_match_info (match_info, 1, &mode_id)) { + switch (mode_id) { + case 1: + mode = MM_UBLOX_NETWORKING_MODE_ROUTER; + break; + case 2: + mode = MM_UBLOX_NETWORKING_MODE_BRIDGE; + break; + default: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unknown mode id: '%u'", mode_id); + break; + } + } + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (mode == MM_UBLOX_NETWORKING_MODE_UNKNOWN) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse networking mode response"); + return FALSE; + } + + *out_mode = mode; + return TRUE; +} + +/*****************************************************************************/ +/* UIPADDR=N response parser */ + +gboolean +mm_ublox_parse_uipaddr_response (const gchar *response, + guint *out_cid, + gchar **out_if_name, + gchar **out_ipv4_address, + gchar **out_ipv4_subnet, + gchar **out_ipv6_global_address, + gchar **out_ipv6_link_local_address, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint cid = 0; + gchar *if_name = NULL; + gchar *ipv4_address = NULL; + gchar *ipv4_subnet = NULL; + gchar *ipv6_global_address = NULL; + gchar *ipv6_link_local_address = NULL; + + /* Response may be e.g.: + * +UIPADDR: 1,"ccinet0","5.168.120.13","255.255.255.0","","" + * +UIPADDR: 2,"ccinet1","","","2001::2:200:FF:FE00:0/64","FE80::200:FF:FE00:0/64" + * +UIPADDR: 3,"ccinet2","5.10.100.2","255.255.255.0","2001::1:200:FF:FE00:0/64","FE80::200:FF:FE00:0/64" + * + * We assume only ONE line is returned; because we request +UIPADDR with a specific N CID. + */ + r = g_regex_new ("\\+UIPADDR: (\\d+),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +UIPADDR response"); + goto out; + } + + if (out_cid && !mm_get_uint_from_match_info (match_info, 1, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid"); + goto out; + } + + if (out_if_name && !(if_name = mm_get_string_unquoted_from_match_info (match_info, 2))) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing interface name"); + goto out; + } + + /* Remaining strings are optional */ + + if (out_ipv4_address) + ipv4_address = mm_get_string_unquoted_from_match_info (match_info, 3); + + if (out_ipv4_subnet) + ipv4_subnet = mm_get_string_unquoted_from_match_info (match_info, 4); + + if (out_ipv6_global_address) + ipv6_global_address = mm_get_string_unquoted_from_match_info (match_info, 5); + + if (out_ipv6_link_local_address) + ipv6_link_local_address = mm_get_string_unquoted_from_match_info (match_info, 6); + +out: + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_free (if_name); + g_free (ipv4_address); + g_free (ipv4_subnet); + g_free (ipv6_global_address); + g_free (ipv6_link_local_address); + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_cid) + *out_cid = cid; + if (out_if_name) + *out_if_name = if_name; + if (out_ipv4_address) + *out_ipv4_address = ipv4_address; + if (out_ipv4_subnet) + *out_ipv4_subnet = ipv4_subnet; + if (out_ipv6_global_address) + *out_ipv6_global_address = ipv6_global_address; + if (out_ipv6_link_local_address) + *out_ipv6_link_local_address = ipv6_link_local_address; + return TRUE; +} + +/*****************************************************************************/ +/* CFUN? response parser */ + +gboolean +mm_ublox_parse_cfun_response (const gchar *response, + MMModemPowerState *out_state, + GError **error) +{ + guint state; + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return FALSE; + + switch (state) { + case 1: + *out_state = MM_MODEM_POWER_STATE_ON; + return TRUE; + case 0: + /* minimum functionality */ + case 4: + /* airplane mode */ + case 19: + /* minimum functionality with SIM deactivated */ + *out_state = MM_MODEM_POWER_STATE_LOW; + return TRUE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown +CFUN state: %u", state); + return FALSE; + } +} + +/*****************************************************************************/ +/* URAT=? response parser */ + +/* Index of the array is the ublox-specific value */ +static const MMModemMode ublox_combinations[] = { + ( MM_MODEM_MODE_2G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_3G ), + ( MM_MODEM_MODE_3G ), + ( MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_3G | MM_MODEM_MODE_4G ), +}; + +GArray * +mm_ublox_parse_urat_test_response (const gchar *response, + GError **error) +{ + GArray *combinations = NULL; + GArray *selected = NULL; + GArray *preferred = NULL; + gchar **split; + guint split_len; + GError *inner_error = NULL; + guint i; + + /* + * E.g.: + * AT+URAT=? + * +URAT: (0-6),(0,2,3) + */ + response = mm_strip_tag (response, "+URAT:"); + split = mm_split_string_groups (response); + split_len = g_strv_length (split); + if (split_len > 2 || split_len < 1) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unexpected number of groups in +URAT=? response: %u", g_strv_length (split)); + goto out; + } + + /* The selected list must have values */ + selected = mm_parse_uint_list (split[0], &inner_error); + if (inner_error) + goto out; + + if (!selected) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No selected RAT values given in +URAT=? response"); + goto out; + } + + /* For our purposes, the preferred list may be empty */ + preferred = mm_parse_uint_list (split[1], &inner_error); + if (inner_error) + goto out; + + /* Build array of combinations */ + combinations = g_array_new (FALSE, FALSE, sizeof (MMModemModeCombination)); + + for (i = 0; i < selected->len; i++) { + guint selected_value; + MMModemModeCombination combination; + guint j; + + selected_value = g_array_index (selected, guint, i); + if (selected_value >= G_N_ELEMENTS (ublox_combinations)) { + mm_warn ("Unexpected AcT value: %u", selected_value); + continue; + } + + /* Combination without any preferred */ + combination.allowed = ublox_combinations[selected_value]; + combination.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, combination); + + if (mm_count_bits_set (combination.allowed) == 1) + continue; + + if (!preferred) + continue; + + for (j = 0; j < preferred->len; j++) { + guint preferred_value; + + preferred_value = g_array_index (preferred, guint, j); + if (preferred_value >= G_N_ELEMENTS (ublox_combinations)) { + mm_warn ("Unexpected AcT preferred value: %u", preferred_value); + continue; + } + combination.preferred = ublox_combinations[preferred_value]; + if (mm_count_bits_set (combination.preferred) != 1) { + mm_warn ("AcT preferred value should be a single AcT: %u", preferred_value); + continue; + } + if (!(combination.allowed & combination.preferred)) + continue; + g_array_append_val (combinations, combination); + } + } + + if (combinations->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No combinations built from +URAT=? response"); + goto out; + } + +out: + g_strfreev (split); + if (selected) + g_array_unref (selected); + if (preferred) + g_array_unref (preferred); + + if (inner_error) { + if (combinations) + g_array_unref (combinations); + g_propagate_error (error, inner_error); + return NULL; + } + + return combinations; +} + +/*****************************************************************************/ + +static MMModemMode +supported_modes_per_model (const gchar *model) +{ + MMModemMode all = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + + if (model) { + /* Some TOBY-L2/MPCI-L2 devices don't support 2G */ + if (g_str_equal (model, "TOBY-L201") || g_str_equal (model, "TOBY-L220") || g_str_equal (model, "MPCI-L201")) + all &= ~MM_MODEM_MODE_2G; + /* None of the LISA-U or SARA-U devices support 4G */ + else if (g_str_has_prefix (model, "LISA-U") || g_str_has_prefix (model, "SARA-U")) { + all &= ~MM_MODEM_MODE_4G; + /* Some SARA devices don't support 2G */ + if (g_str_equal (model, "SARA-U270-53S") || g_str_equal (model, "SARA-U280")) + all &= ~MM_MODEM_MODE_2G; + } + } + + return all; +} + +GArray * +mm_ublox_filter_supported_modes (const gchar *model, + GArray *combinations, + GError **error) +{ + MMModemModeCombination mode; + GArray *all; + GArray *filtered; + + /* Model not specified? */ + if (!model) + return combinations; + + /* AT+URAT=? lies; we need an extra per-device filtering, thanks u-blox. + * Don't know all PIDs for all devices, so model string based filtering... */ + + mode.allowed = supported_modes_per_model (model); + mode.preferred = MM_MODEM_MODE_NONE; + + /* Nothing filtered? */ + if (mode.allowed == supported_modes_per_model (NULL)) + return combinations; + + all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); + g_array_append_val (all, mode); + filtered = mm_filter_supported_modes (all, combinations); + g_array_unref (all); + g_array_unref (combinations); + + /* Error if nothing left */ + if (filtered->len == 0) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No valid mode combinations built after filtering (model %s)", model); + g_array_unref (filtered); + return NULL; + } + + return filtered; +} + +/*****************************************************************************/ +/* Supported bands loading */ + +typedef struct { + guint ubandsel_value; + MMModemBand bands_2g[2]; + MMModemBand bands_3g[2]; + MMModemBand bands_4g[2]; +} BandConfiguration; + +static const BandConfiguration band_configuration[] = { + { + .ubandsel_value = 700, + .bands_4g = { MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17 } + }, + { + .ubandsel_value = 800, + .bands_3g = { MM_MODEM_BAND_UTRAN_6 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_20 } + }, + { + .ubandsel_value = 850, + .bands_2g = { MM_MODEM_BAND_G850 }, + .bands_3g = { MM_MODEM_BAND_UTRAN_5 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_5 } + }, + { + .ubandsel_value = 900, + .bands_2g = { MM_MODEM_BAND_EGSM }, + .bands_3g = { MM_MODEM_BAND_UTRAN_8 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_8 } + }, + { + .ubandsel_value = 1500, + .bands_3g = { MM_MODEM_BAND_UTRAN_11 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_11 } + }, + { + .ubandsel_value = 1700, + .bands_3g = { MM_MODEM_BAND_UTRAN_4 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_4 } + }, + { + .ubandsel_value = 1800, + .bands_2g = { MM_MODEM_BAND_DCS }, + .bands_3g = { MM_MODEM_BAND_UTRAN_3 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_3 } + }, + { + .ubandsel_value = 1900, + .bands_2g = { MM_MODEM_BAND_PCS }, + .bands_3g = { MM_MODEM_BAND_UTRAN_2 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_2 } + }, + { + .ubandsel_value = 2100, + .bands_3g = { MM_MODEM_BAND_UTRAN_1 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_1 } + }, + { + .ubandsel_value = 2600, + .bands_3g = { MM_MODEM_BAND_UTRAN_7 }, + .bands_4g = { MM_MODEM_BAND_EUTRAN_7 } + }, +}; + +GArray * +mm_ublox_get_supported_bands (const gchar *model, + GError **error) +{ + MMModemMode mode; + GArray *bands; + guint i; + + mode = supported_modes_per_model (model); + + bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); + + for (i = 0; i < G_N_ELEMENTS (band_configuration); i++) { + if ((mode & MM_MODEM_MODE_2G) && band_configuration[i].bands_2g[0]) { + bands = g_array_append_val (bands, band_configuration[i].bands_2g[0]); + if (band_configuration[i].bands_2g[1]) + bands = g_array_append_val (bands, band_configuration[i].bands_2g[1]); + } + if ((mode & MM_MODEM_MODE_3G) && band_configuration[i].bands_3g[0]) { + bands = g_array_append_val (bands, band_configuration[i].bands_3g[0]); + if (band_configuration[i].bands_3g[1]) + bands = g_array_append_val (bands, band_configuration[i].bands_3g[1]); + } + if ((mode & MM_MODEM_MODE_4G) && band_configuration[i].bands_4g[0]) { + bands = g_array_append_val (bands, band_configuration[i].bands_4g[0]); + if (band_configuration[i].bands_4g[1]) + bands = g_array_append_val (bands, band_configuration[i].bands_4g[1]); + } + } + + if (bands->len == 0) { + g_array_unref (bands); + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No valid supported bands loaded"); + return NULL; + } + + return bands; +} + +/*****************************************************************************/ +/* +UBANDSEL? response parser */ + +static void +append_bands (GArray *bands, + guint ubandsel_value) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (band_configuration); i++) + if (ubandsel_value == band_configuration[i].ubandsel_value) + break; + + if (i == G_N_ELEMENTS (band_configuration)) { + mm_warn ("Unknown band configuration value given: %u", ubandsel_value); + return; + } + + /* Note: we don't care if the device doesn't support one of these modes; + * the generic logic will filter out all bands not supported before + * exposing them in the DBus property */ + + if (band_configuration[i].bands_2g[0]) { + g_array_append_val (bands, band_configuration[i].bands_2g[0]); + if (band_configuration[i].bands_2g[1]) + g_array_append_val (bands, band_configuration[i].bands_2g[1]); + } + + if (band_configuration[i].bands_3g[0]) { + g_array_append_val (bands, band_configuration[i].bands_3g[0]); + if (band_configuration[i].bands_3g[1]) + g_array_append_val (bands, band_configuration[i].bands_3g[1]); + } + + if (band_configuration[i].bands_4g[0]) { + g_array_append_val (bands, band_configuration[i].bands_4g[0]); + if (band_configuration[i].bands_4g[1]) + g_array_append_val (bands, band_configuration[i].bands_4g[1]); + } +} + +GArray * +mm_ublox_parse_ubandsel_response (const gchar *response, + GError **error) +{ + GArray *array_values = NULL; + GArray *array = NULL; + gchar *dupstr = NULL; + GError *inner_error = NULL; + guint i; + + if (!g_str_has_prefix (response, "+UBANDSEL")) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse +UBANDSEL response: '%s'", response); + goto out; + } + + /* Response may be e.g.: + * +UBANDSEL: 850,900,1800,1900 + */ + dupstr = g_strchomp (g_strdup (mm_strip_tag (response, "+UBANDSEL:"))); + + array_values = mm_parse_uint_list (dupstr, &inner_error); + if (!array_values) + goto out; + + /* Convert list of ubandsel numbers to MMModemBand values */ + array = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); + for (i = 0; i < array_values->len; i++) + append_bands (array, g_array_index (array_values, guint, i)); + + if (!array->len) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No known band selection values matched in +UBANDSEL response: '%s'", response); + goto out; + } + +out: + if (inner_error) { + g_propagate_error (error, inner_error); + g_clear_pointer (&array, g_array_unref); + } + g_clear_pointer (&array_values, g_array_unref); + g_free (dupstr); + return array; +} + +/*****************************************************************************/ +/* UBANDSEL=X command builder */ + +static gint +ubandsel_num_cmp (const guint *a, const guint *b) +{ + return (*a - *b); +} + +gchar * +mm_ublox_build_ubandsel_set_command (GArray *bands, + GError **error) +{ + GString *command = NULL; + GArray *ubandsel_nums; + guint i; + + if (bands->len == 1 && g_array_index (bands, MMModemBand, 0) == MM_MODEM_BAND_ANY) + return g_strdup ("+UBANDSEL=0"); + + ubandsel_nums = g_array_sized_new (FALSE, FALSE, sizeof (guint), G_N_ELEMENTS (band_configuration)); + for (i = 0; i < G_N_ELEMENTS (band_configuration); i++) { + guint j; + + for (j = 0; j < bands->len; j++) { + MMModemBand band; + + band = g_array_index (bands, MMModemBand, j); + + if (band == band_configuration[i].bands_2g[0] || band == band_configuration[i].bands_2g[1] || + band == band_configuration[i].bands_3g[0] || band == band_configuration[i].bands_3g[1] || + band == band_configuration[i].bands_4g[0] || band == band_configuration[i].bands_4g[1]) { + g_array_append_val (ubandsel_nums, band_configuration[i].ubandsel_value); + break; + } + } + } + + if (ubandsel_nums->len == 0) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Given band combination is unsupported"); + g_array_unref (ubandsel_nums); + return NULL; + } + + if (ubandsel_nums->len > 1) + g_array_sort (ubandsel_nums, (GCompareFunc) ubandsel_num_cmp); + + /* Build command */ + command = g_string_new ("+UBANDSEL="); + for (i = 0; i < ubandsel_nums->len; i++) + g_string_append_printf (command, "%s%u", i == 0 ? "" : ",", g_array_index (ubandsel_nums, guint, i)); + return g_string_free (command, FALSE); +} + +/*****************************************************************************/ +/* Get mode to apply when ANY */ + +MMModemMode +mm_ublox_get_modem_mode_any (const GArray *combinations) +{ + guint i; + MMModemMode any = MM_MODEM_MODE_NONE; + guint any_bits_set = 0; + + for (i = 0; i < combinations->len; i++) { + MMModemModeCombination *combination; + guint bits_set; + + combination = &g_array_index (combinations, MMModemModeCombination, i); + if (combination->preferred != MM_MODEM_MODE_NONE) + continue; + bits_set = mm_count_bits_set (combination->allowed); + if (bits_set > any_bits_set) { + any_bits_set = bits_set; + any = combination->allowed; + } + } + + /* If combinations were processed via mm_ublox_parse_urat_test_response(), + * we're sure that there will be at least one combination with preferred + * 'none', so there must be some valid combination as result */ + g_assert (any != MM_MODEM_MODE_NONE); + return any; +} + +/*****************************************************************************/ +/* UACT common config */ + +typedef struct { + guint num; + MMModemBand band; +} UactBandConfig; + +static const UactBandConfig uact_band_config[] = { + /* GSM bands */ + { .num = 900, .band = MM_MODEM_BAND_EGSM }, + { .num = 1800, .band = MM_MODEM_BAND_DCS }, + { .num = 1900, .band = MM_MODEM_BAND_PCS }, + { .num = 850, .band = MM_MODEM_BAND_G850 }, + { .num = 450, .band = MM_MODEM_BAND_G450 }, + { .num = 480, .band = MM_MODEM_BAND_G480 }, + { .num = 750, .band = MM_MODEM_BAND_G750 }, + { .num = 380, .band = MM_MODEM_BAND_G380 }, + { .num = 410, .band = MM_MODEM_BAND_G410 }, + { .num = 710, .band = MM_MODEM_BAND_G710 }, + { .num = 810, .band = MM_MODEM_BAND_G810 }, + /* UMTS bands */ + { .num = 1, .band = MM_MODEM_BAND_UTRAN_1 }, + { .num = 2, .band = MM_MODEM_BAND_UTRAN_2 }, + { .num = 3, .band = MM_MODEM_BAND_UTRAN_3 }, + { .num = 4, .band = MM_MODEM_BAND_UTRAN_4 }, + { .num = 5, .band = MM_MODEM_BAND_UTRAN_5 }, + { .num = 6, .band = MM_MODEM_BAND_UTRAN_6 }, + { .num = 7, .band = MM_MODEM_BAND_UTRAN_7 }, + { .num = 8, .band = MM_MODEM_BAND_UTRAN_8 }, + { .num = 9, .band = MM_MODEM_BAND_UTRAN_9 }, + { .num = 10, .band = MM_MODEM_BAND_UTRAN_10 }, + { .num = 11, .band = MM_MODEM_BAND_UTRAN_11 }, + { .num = 12, .band = MM_MODEM_BAND_UTRAN_12 }, + { .num = 13, .band = MM_MODEM_BAND_UTRAN_13 }, + { .num = 14, .band = MM_MODEM_BAND_UTRAN_14 }, + { .num = 19, .band = MM_MODEM_BAND_UTRAN_19 }, + { .num = 20, .band = MM_MODEM_BAND_UTRAN_20 }, + { .num = 21, .band = MM_MODEM_BAND_UTRAN_21 }, + { .num = 22, .band = MM_MODEM_BAND_UTRAN_22 }, + { .num = 25, .band = MM_MODEM_BAND_UTRAN_25 }, + /* LTE bands */ + { .num = 101, .band = MM_MODEM_BAND_EUTRAN_1 }, + { .num = 102, .band = MM_MODEM_BAND_EUTRAN_2 }, + { .num = 103, .band = MM_MODEM_BAND_EUTRAN_3 }, + { .num = 104, .band = MM_MODEM_BAND_EUTRAN_4 }, + { .num = 105, .band = MM_MODEM_BAND_EUTRAN_5 }, + { .num = 106, .band = MM_MODEM_BAND_EUTRAN_6 }, + { .num = 107, .band = MM_MODEM_BAND_EUTRAN_7 }, + { .num = 108, .band = MM_MODEM_BAND_EUTRAN_8 }, + { .num = 109, .band = MM_MODEM_BAND_EUTRAN_9 }, + { .num = 110, .band = MM_MODEM_BAND_EUTRAN_10 }, + { .num = 111, .band = MM_MODEM_BAND_EUTRAN_11 }, + { .num = 112, .band = MM_MODEM_BAND_EUTRAN_12 }, + { .num = 113, .band = MM_MODEM_BAND_EUTRAN_13 }, + { .num = 114, .band = MM_MODEM_BAND_EUTRAN_14 }, + { .num = 117, .band = MM_MODEM_BAND_EUTRAN_17 }, + { .num = 118, .band = MM_MODEM_BAND_EUTRAN_18 }, + { .num = 119, .band = MM_MODEM_BAND_EUTRAN_19 }, + { .num = 120, .band = MM_MODEM_BAND_EUTRAN_20 }, + { .num = 121, .band = MM_MODEM_BAND_EUTRAN_21 }, + { .num = 122, .band = MM_MODEM_BAND_EUTRAN_22 }, + { .num = 123, .band = MM_MODEM_BAND_EUTRAN_23 }, + { .num = 124, .band = MM_MODEM_BAND_EUTRAN_24 }, + { .num = 125, .band = MM_MODEM_BAND_EUTRAN_25 }, + { .num = 126, .band = MM_MODEM_BAND_EUTRAN_26 }, + { .num = 127, .band = MM_MODEM_BAND_EUTRAN_27 }, + { .num = 128, .band = MM_MODEM_BAND_EUTRAN_28 }, + { .num = 129, .band = MM_MODEM_BAND_EUTRAN_29 }, + { .num = 130, .band = MM_MODEM_BAND_EUTRAN_30 }, + { .num = 131, .band = MM_MODEM_BAND_EUTRAN_31 }, + { .num = 132, .band = MM_MODEM_BAND_EUTRAN_32 }, + { .num = 133, .band = MM_MODEM_BAND_EUTRAN_33 }, + { .num = 134, .band = MM_MODEM_BAND_EUTRAN_34 }, + { .num = 135, .band = MM_MODEM_BAND_EUTRAN_35 }, + { .num = 136, .band = MM_MODEM_BAND_EUTRAN_36 }, + { .num = 137, .band = MM_MODEM_BAND_EUTRAN_37 }, + { .num = 138, .band = MM_MODEM_BAND_EUTRAN_38 }, + { .num = 139, .band = MM_MODEM_BAND_EUTRAN_39 }, + { .num = 140, .band = MM_MODEM_BAND_EUTRAN_40 }, + { .num = 141, .band = MM_MODEM_BAND_EUTRAN_41 }, + { .num = 142, .band = MM_MODEM_BAND_EUTRAN_42 }, + { .num = 143, .band = MM_MODEM_BAND_EUTRAN_43 }, + { .num = 144, .band = MM_MODEM_BAND_EUTRAN_44 }, + { .num = 145, .band = MM_MODEM_BAND_EUTRAN_45 }, + { .num = 146, .band = MM_MODEM_BAND_EUTRAN_46 }, + { .num = 147, .band = MM_MODEM_BAND_EUTRAN_47 }, + { .num = 148, .band = MM_MODEM_BAND_EUTRAN_48 }, +}; + +static MMModemBand +uact_num_to_band (guint num) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (uact_band_config); i++) { + if (num == uact_band_config[i].num) + return uact_band_config[i].band; + } + return MM_MODEM_BAND_UNKNOWN; +} + +static guint +uact_band_to_num (MMModemBand band) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (uact_band_config); i++) { + if (band == uact_band_config[i].band) + return uact_band_config[i].num; + } + return 0; +} + +/*****************************************************************************/ +/* UACT? response parser */ + +static GArray * +uact_num_array_to_band_array (GArray *nums) +{ + GArray *bands = NULL; + guint i; + + if (!nums) + return NULL; + + bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), nums->len); + for (i = 0; i < nums->len; i++) { + MMModemBand band; + + band = uact_num_to_band (g_array_index (nums, guint, i)); + g_array_append_val (bands, band); + } + + return bands; +} + +GArray * +mm_ublox_parse_uact_response (const gchar *response, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + GArray *nums = NULL; + GArray *bands = NULL; + + /* + * AT+UACT? + * +UACT: ,,,900,1800,1,8,101,103,107,108,120,138 + */ + r = g_regex_new ("\\+UACT: ([^,]*),([^,]*),([^,]*),(.*)(?:\\r\\n)?", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + gchar *bandstr; + + bandstr = mm_get_string_unquoted_from_match_info (match_info, 4); + nums = mm_parse_uint_list (bandstr, &inner_error); + g_free (bandstr); + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return NULL; + } + + /* Convert to MMModemBand values */ + if (nums) { + bands = uact_num_array_to_band_array (nums); + g_array_unref (nums); + } + + return bands; +} + +/*****************************************************************************/ +/* UACT=? response parser */ + +static GArray * +parse_bands_from_string (const gchar *str, + const gchar *group) +{ + GArray *bands = NULL; + GError *inner_error = NULL; + GArray *nums; + + nums = mm_parse_uint_list (str, &inner_error); + if (nums) { + gchar *tmpstr; + + bands = uact_num_array_to_band_array (nums); + tmpstr = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len); + mm_dbg ("modem reports support for %s bands: %s", group, tmpstr); + g_free (tmpstr); + + g_array_unref (nums); + } else if (inner_error) { + mm_warn ("couldn't parse list of supported %s bands: %s", group, inner_error->message); + g_clear_error (&inner_error); + } + + return bands; +} + +gboolean +mm_ublox_parse_uact_test (const gchar *response, + GArray **bands2g_out, + GArray **bands3g_out, + GArray **bands4g_out, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + const gchar *bands2g_str = NULL; + const gchar *bands3g_str = NULL; + const gchar *bands4g_str = NULL; + GArray *bands2g = NULL; + GArray *bands3g = NULL; + GArray *bands4g = NULL; + gchar **split = NULL; + + g_assert (bands2g_out && bands3g_out && bands4g_out); + + /* + * AT+UACT=? + * +UACT: ,,,(900,1800),(1,8),(101,103,107,108,120),(138) + */ + r = g_regex_new ("\\+UACT: ([^,]*),([^,]*),([^,]*),(.*)(?:\\r\\n)?", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (g_match_info_matches (match_info)) { + gchar *aux; + guint n_groups; + + aux = mm_get_string_unquoted_from_match_info (match_info, 4); + split = mm_split_string_groups (aux); + n_groups = g_strv_length (split); + if (n_groups >= 1) + bands2g_str = split[0]; + if (n_groups >= 2) + bands3g_str = split[1]; + if (n_groups >= 3) + bands4g_str = split[2]; + g_free (aux); + } + + if (!bands2g_str && !bands3g_str && !bands4g_str) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "frequency groups not found: %s", response); + goto out; + } + + bands2g = parse_bands_from_string (bands2g_str, "2G"); + bands3g = parse_bands_from_string (bands3g_str, "3G"); + bands4g = parse_bands_from_string (bands4g_str, "4G"); + + if (!bands2g->len && !bands3g->len && !bands4g->len) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "no supported frequencies reported: %s", response); + goto out; + } + + /* success */ + +out: + g_strfreev (split); + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + if (bands2g) + g_array_unref (bands2g); + if (bands3g) + g_array_unref (bands3g); + if (bands4g) + g_array_unref (bands4g); + g_propagate_error (error, inner_error); + return FALSE; + } + + *bands2g_out = bands2g; + *bands3g_out = bands3g; + *bands4g_out = bands4g; + return TRUE; +} + +/*****************************************************************************/ +/* UACT=X command builder */ + +gchar * +mm_ublox_build_uact_set_command (GArray *bands, + GError **error) +{ + GString *command; + + /* Build command */ + command = g_string_new ("+UACT=,,,"); + + if (bands->len == 1 && g_array_index (bands, MMModemBand, 0) == MM_MODEM_BAND_ANY) + g_string_append (command, "0"); + else { + guint i; + + for (i = 0; i < bands->len; i++) { + MMModemBand band; + guint num; + + band = g_array_index (bands, MMModemBand, i); + num = uact_band_to_num (band); + if (!num) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Band unsupported by this plugin: %s", mm_modem_band_get_string (band)); + g_string_free (command, TRUE); + return NULL; + } + + g_string_append_printf (command, "%s%u", i == 0 ? "" : ",", num); + } + } + + return g_string_free (command, FALSE); +} + +/*****************************************************************************/ +/* URAT? response parser */ + +gboolean +mm_ublox_parse_urat_read_response (const gchar *response, + MMModemMode *out_allowed, + MMModemMode *out_preferred, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + MMModemMode allowed = MM_MODEM_MODE_NONE; + MMModemMode preferred = MM_MODEM_MODE_NONE; + gchar *allowed_str = NULL; + gchar *preferred_str = NULL; + + g_assert (out_allowed != NULL && out_preferred != NULL); + + /* Response may be e.g.: + * +URAT: 1,2 + * +URAT: 1 + */ + r = g_regex_new ("\\+URAT: (\\d+)(?:,(\\d+))?(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + guint value = 0; + + /* Selected item is mandatory */ + if (!mm_get_uint_from_match_info (match_info, 1, &value)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't read AcT selected value"); + goto out; + } + if (value >= G_N_ELEMENTS (ublox_combinations)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unexpected AcT selected value: %u", value); + goto out; + } + allowed = ublox_combinations[value]; + allowed_str = mm_modem_mode_build_string_from_mask (allowed); + mm_dbg ("current allowed modes retrieved: %s", allowed_str); + + /* Preferred item is optional */ + if (mm_get_uint_from_match_info (match_info, 2, &value)) { + if (value >= G_N_ELEMENTS (ublox_combinations)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unexpected AcT preferred value: %u", value); + goto out; + } + preferred = ublox_combinations[value]; + preferred_str = mm_modem_mode_build_string_from_mask (preferred); + mm_dbg ("current preferred modes retrieved: %s", preferred_str); + if (mm_count_bits_set (preferred) != 1) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "AcT preferred value should be a single AcT: %s", preferred_str); + goto out; + } + if (!(allowed & preferred)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "AcT preferred value (%s) not a subset of the allowed value (%s)", + preferred_str, allowed_str); + goto out; + } + } + } + +out: + + g_free (allowed_str); + g_free (preferred_str); + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (allowed == MM_MODEM_MODE_NONE) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse +URAT response: %s", response); + return FALSE; + } + + *out_allowed = allowed; + *out_preferred = preferred; + return TRUE; +} + +/*****************************************************************************/ +/* URAT=X command builder */ + +static gboolean +append_rat_value (GString *str, + MMModemMode mode, + GError **error) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (ublox_combinations); i++) { + if (ublox_combinations[i] == mode) { + g_string_append_printf (str, "%u", i); + return TRUE; + } + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No AcT value matches requested mode"); + return FALSE; +} + +gchar * +mm_ublox_build_urat_set_command (MMModemMode allowed, + MMModemMode preferred, + GError **error) +{ + GString *command; + + command = g_string_new ("+URAT="); + if (!append_rat_value (command, allowed, error)) { + g_string_free (command, TRUE); + return NULL; + } + + if (preferred != MM_MODEM_MODE_NONE) { + g_string_append (command, ","); + if (!append_rat_value (command, preferred, error)) { + g_string_free (command, TRUE); + return NULL; + } + } + + return g_string_free (command, FALSE); +} + +/*****************************************************************************/ +/* +UAUTHREQ=? test parser */ + +MMUbloxBearerAllowedAuth +mm_ublox_parse_uauthreq_test (const char *response, + GError **error) +{ + MMUbloxBearerAllowedAuth mask = MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN; + GError *inner_error = NULL; + GArray *allowed_auths = NULL; + gchar **split; + guint split_len; + + /* + * Response may be like: + * AT+UAUTHREQ=? + * +UAUTHREQ: (1-4),(0-2),, + */ + response = mm_strip_tag (response, "+UAUTHREQ:"); + split = mm_split_string_groups (response); + split_len = g_strv_length (split); + if (split_len < 2) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unexpected number of groups in +UAUTHREQ=? response: %u", g_strv_length (split)); + goto out; + } + + allowed_auths = mm_parse_uint_list (split[1], &inner_error); + if (inner_error) + goto out; + + if (allowed_auths) { + guint i; + + for (i = 0; i < allowed_auths->len; i++) { + guint val; + + val = g_array_index (allowed_auths, guint, i); + switch (val) { + case 0: + mask |= MM_UBLOX_BEARER_ALLOWED_AUTH_NONE; + break; + case 1: + mask |= MM_UBLOX_BEARER_ALLOWED_AUTH_PAP; + break; + case 2: + mask |= MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP; + break; + case 3: + mask |= MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO; + break; + default: + mm_warn ("Unexpected +UAUTHREQ value: %u", val); + break; + } + } + } + + if (!mask) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No supported authentication methods in +UAUTHREQ=? response"); + goto out; + } + +out: + g_strfreev (split); + + if (allowed_auths) + g_array_unref (allowed_auths); + + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN; + } + + return mask; +} + +/*****************************************************************************/ +/* +UGCNTRD response parser */ + +gboolean +mm_ublox_parse_ugcntrd_response_for_cid (const gchar *response, + guint in_cid, + guint *out_session_tx_bytes, + guint *out_session_rx_bytes, + guint *out_total_tx_bytes, + guint *out_total_rx_bytes, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info = NULL; + GError *inner_error = NULL; + guint session_tx_bytes = 0; + guint session_rx_bytes = 0; + guint total_tx_bytes = 0; + guint total_rx_bytes = 0; + gboolean matched = FALSE; + + /* Response may be e.g.: + * +UGCNTRD: 31,2704,1819,2724,1839 + * We assume only ONE line is returned. + */ + r = g_regex_new ("\\+UGCNTRD:\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + /* Report invalid CID given */ + if (!in_cid) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Invalid CID given"); + goto out; + } + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + while (!inner_error && g_match_info_matches (match_info)) { + guint cid = 0; + + /* Matched CID? */ + if (!mm_get_uint_from_match_info (match_info, 1, &cid) || cid != in_cid) { + g_match_info_next (match_info, &inner_error); + continue; + } + + if (out_session_tx_bytes && !mm_get_uint_from_match_info (match_info, 2, &session_tx_bytes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing session TX bytes"); + goto out; + } + + if (out_session_rx_bytes && !mm_get_uint_from_match_info (match_info, 3, &session_rx_bytes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing session RX bytes"); + goto out; + } + + if (out_total_tx_bytes && !mm_get_uint_from_match_info (match_info, 4, &total_tx_bytes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing total TX bytes"); + goto out; + } + + if (out_total_rx_bytes && !mm_get_uint_from_match_info (match_info, 5, &total_rx_bytes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing total RX bytes"); + goto out; + } + + matched = TRUE; + break; + } + + if (!matched) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "No statistics found for CID %u", in_cid); + goto out; + } + +out: + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_session_tx_bytes) + *out_session_tx_bytes = session_tx_bytes; + if (out_session_rx_bytes) + *out_session_rx_bytes = session_rx_bytes; + if (out_total_tx_bytes) + *out_total_tx_bytes = total_tx_bytes; + if (out_total_rx_bytes) + *out_total_rx_bytes = total_rx_bytes; + return TRUE; +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-modem-helpers-ublox.h modemmanager-1.10.0/plugins/ublox/mm-modem-helpers-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-modem-helpers-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-modem-helpers-ublox.h 2018-12-17 13:41:16.000000000 +0100 @@ -0,0 +1,175 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#ifndef MM_MODEM_HELPERS_UBLOX_H +#define MM_MODEM_HELPERS_UBLOX_H + +#include +#include + +/*****************************************************************************/ +/* +UPINCNT response parser */ + +gboolean mm_ublox_parse_upincnt_response (const gchar *response, + guint *out_pin_attempts, + guint *out_pin2_attempts, + guint *out_puk_attempts, + guint *out_puk2_attempts, + GError **error); + +/*****************************************************************************/ +/* UUSBCONF? response parser */ + +typedef enum { /*< underscore_name=mm_ublox_usb_profile >*/ + MM_UBLOX_USB_PROFILE_UNKNOWN, + MM_UBLOX_USB_PROFILE_RNDIS, + MM_UBLOX_USB_PROFILE_ECM, + MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE, +} MMUbloxUsbProfile; + +gboolean mm_ublox_parse_uusbconf_response (const gchar *response, + MMUbloxUsbProfile *out_profile, + GError **error); + +/*****************************************************************************/ +/* UBMCONF? response parser */ + +typedef enum { /*< underscore_name=mm_ublox_networking_mode >*/ + MM_UBLOX_NETWORKING_MODE_UNKNOWN, + MM_UBLOX_NETWORKING_MODE_ROUTER, + MM_UBLOX_NETWORKING_MODE_BRIDGE, +} MMUbloxNetworkingMode; + +gboolean mm_ublox_parse_ubmconf_response (const gchar *response, + MMUbloxNetworkingMode *out_mode, + GError **error); + +/*****************************************************************************/ +/* UIPADDR=N response parser */ + +gboolean mm_ublox_parse_uipaddr_response (const gchar *response, + guint *out_cid, + gchar **out_if_name, + gchar **out_ipv4_address, + gchar **out_ipv4_subnet, + gchar **out_ipv6_global_address, + gchar **out_ipv6_link_local_address, + GError **error); + +/*****************************************************************************/ +/* CFUN? response parser */ + +gboolean mm_ublox_parse_cfun_response (const gchar *response, + MMModemPowerState *out_state, + GError **error); + +/*****************************************************************************/ +/* URAT=? response parser */ + +GArray *mm_ublox_parse_urat_test_response (const gchar *response, + GError **error); + +/*****************************************************************************/ +/* Model-based supported modes filtering */ + +GArray *mm_ublox_filter_supported_modes (const gchar *model, + GArray *combinations, + GError **error); + +/*****************************************************************************/ +/* Model-based supported bands loading */ + +GArray *mm_ublox_get_supported_bands (const gchar *model, + GError **error); + +/*****************************************************************************/ +/* UBANDSEL? response parser */ + +GArray *mm_ublox_parse_ubandsel_response (const gchar *response, + GError **error); + +/*****************************************************************************/ +/* UBANDSEL=X command builder */ + +gchar *mm_ublox_build_ubandsel_set_command (GArray *bands, + GError **error); + +/*****************************************************************************/ +/* UACT? response parser */ + +GArray *mm_ublox_parse_uact_response (const gchar *response, + GError **error); + +/*****************************************************************************/ +/* UACT=? test parser */ + +gboolean mm_ublox_parse_uact_test (const gchar *response, + GArray **bands_2g, + GArray **bands_3g, + GArray **bands_4g, + GError **error); + +/*****************************************************************************/ +/* UACT=X command builder */ + +gchar *mm_ublox_build_uact_set_command (GArray *bands, + GError **error); + +/*****************************************************************************/ +/* Get mode to apply when ANY */ + +MMModemMode mm_ublox_get_modem_mode_any (const GArray *combinations); + +/*****************************************************************************/ +/* URAT? response parser */ + +gboolean mm_ublox_parse_urat_read_response (const gchar *response, + MMModemMode *out_allowed, + MMModemMode *out_preferred, + GError **error); + +/*****************************************************************************/ +/* URAT=X command builder */ + +gchar *mm_ublox_build_urat_set_command (MMModemMode allowed, + MMModemMode preferred, + GError **error); + +/*****************************************************************************/ +/* +UAUTHREQ=? test parser */ + +typedef enum { /*< underscore_name=mm_ublox_bearer_allowed_auth >*/ + MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN = 0, + MM_UBLOX_BEARER_ALLOWED_AUTH_NONE = 1 << 0, + MM_UBLOX_BEARER_ALLOWED_AUTH_PAP = 1 << 1, + MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP = 1 << 2, + MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO = 1 << 3, +} MMUbloxBearerAllowedAuth; + +MMUbloxBearerAllowedAuth mm_ublox_parse_uauthreq_test (const char *response, + GError **error); + +/*****************************************************************************/ +/* +UGCNTRD response parser */ + +gboolean mm_ublox_parse_ugcntrd_response_for_cid (const gchar *response, + guint in_cid, + guint *session_tx_bytes, + guint *session_rx_bytes, + guint *total_tx_bytes, + guint *total_rx_bytes, + GError **error); + +#endif /* MM_MODEM_HELPERS_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/mm-plugin-ublox.c modemmanager-1.10.0/plugins/ublox/mm-plugin-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-plugin-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-plugin-ublox.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,280 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-serial-parsers.h" +#include "mm-broadband-modem-ublox.h" +#include "mm-plugin-ublox.h" + +G_DEFINE_TYPE (MMPluginUblox, mm_plugin_ublox, MM_TYPE_PLUGIN) + +MM_PLUGIN_DEFINE_MAJOR_VERSION +MM_PLUGIN_DEFINE_MINOR_VERSION + +/*****************************************************************************/ + +static MMBaseModem * +create_modem (MMPlugin *self, + const gchar *sysfs_path, + const gchar **drivers, + guint16 vendor, + guint16 product, + GList *probes, + GError **error) +{ + return MM_BASE_MODEM (mm_broadband_modem_ublox_new (sysfs_path, + drivers, + mm_plugin_get_name (self), + vendor, + product)); +} + +/*****************************************************************************/ +/* Custom init context */ + +typedef struct { + MMPortSerialAt *port; + GRegex *ready_regex; + guint timeout_id; + gint wait_timeout_secs; +} CustomInitContext; + +static void +custom_init_context_free (CustomInitContext *ctx) +{ + g_assert (!ctx->timeout_id); + g_regex_unref (ctx->ready_regex); + g_object_unref (ctx->port); + g_slice_free (CustomInitContext, ctx); +} + +static gboolean +ublox_custom_init_finish (MMPortProbe *probe, + GAsyncResult *result, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (result), error); +} + +static gboolean +ready_timeout (GTask *task) +{ + CustomInitContext *ctx; + MMPortProbe *probe; + + ctx = g_task_get_task_data (task); + probe = g_task_get_source_object (task); + + ctx->timeout_id = 0; + + mm_port_serial_at_add_unsolicited_msg_handler (ctx->port, ctx->ready_regex, + NULL, NULL, NULL); + + mm_dbg ("(%s/%s) timed out waiting for READY unsolicited message", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe)); + + /* not an error really, we didn't probe anything yet, that's all */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + return G_SOURCE_REMOVE; +} + +static void +ready_received (MMPortSerialAt *port, + GMatchInfo *info, + GTask *task) +{ + CustomInitContext *ctx; + MMPortProbe *probe; + + ctx = g_task_get_task_data (task); + probe = g_task_get_source_object (task); + + g_source_remove (ctx->timeout_id); + ctx->timeout_id = 0; + + mm_dbg ("(%s/%s) READY received: port is AT", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe)); + + /* Flag as an AT port right away */ + mm_port_probe_set_result_at (probe, TRUE); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +wait_for_ready (GTask *task) +{ + CustomInitContext *ctx; + MMPortProbe *probe; + + ctx = g_task_get_task_data (task); + probe = g_task_get_source_object (task); + + mm_dbg ("(%s/%s) waiting for READY unsolicited message...", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe)); + + /* Configure a regex on the TTY, so that we stop the custom init + * as soon as +READY URC is received */ + mm_port_serial_at_add_unsolicited_msg_handler (ctx->port, + ctx->ready_regex, + (MMPortSerialAtUnsolicitedMsgFn) ready_received, + task, + NULL); + + mm_dbg ("(%s/%s) waiting %d seconds for init timeout", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe), + ctx->wait_timeout_secs); + + /* Otherwise, let the custom init timeout in some seconds. */ + ctx->timeout_id = g_timeout_add_seconds (ctx->wait_timeout_secs, (GSourceFunc) ready_timeout, task); +} + +static void +quick_at_ready (MMPortSerialAt *port, + GAsyncResult *res, + GTask *task) +{ + MMPortProbe *probe; + GError *error = NULL; + + probe = g_task_get_source_object (task); + + mm_port_serial_at_command_finish (port, res, &error); + if (error) { + /* On a timeout error, wait for READY URC */ + if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { + wait_for_ready (task); + goto out; + } + /* On an unknown error, make it fatal */ + if (!mm_serial_parser_v1_is_known_error (error)) { + mm_warn ("(%s/%s) custom port initialization logic failed: %s", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe), + error->message); + goto out_complete; + } + } + + mm_dbg ("(%s/%s) port is AT", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe)); + mm_port_probe_set_result_at (probe, TRUE); + +out_complete: + g_task_return_boolean (task, TRUE); + g_object_unref (task); +out: + g_clear_error (&error); +} + +static void +ublox_custom_init (MMPortProbe *probe, + MMPortSerialAt *port, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + CustomInitContext *ctx; + gint wait_timeout_secs; + + task = g_task_new (probe, cancellable, callback, user_data); + + /* If no explicit READY_DELAY configured, we don't need a custom init procedure */ + wait_timeout_secs = mm_kernel_device_get_property_as_int (mm_port_probe_peek_port (probe), "ID_MM_UBLOX_PORT_READY_DELAY"); + if (wait_timeout_secs <= 0) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx = g_slice_new0 (CustomInitContext); + ctx->wait_timeout_secs = wait_timeout_secs; + ctx->port = g_object_ref (port); + ctx->ready_regex = g_regex_new ("\\r\\n\\+AT:\\s*READY\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + g_task_set_task_data (task, ctx, (GDestroyNotify) custom_init_context_free); + + /* If the device hasn't been plugged in right away, we assume it was already + * running for some time. We validate the assumption with a quick AT probe, + * and if it times out, we run the explicit READY wait from scratch (e.g. + * to cope with the case where MM starts after the TTY has been exposed but + * where the device was also just reseted) */ + if (!mm_device_get_hotplugged (mm_port_probe_peek_device (probe))) { + mm_port_serial_at_command (ctx->port, + "AT", + 1, + FALSE, /* raw */ + FALSE, /* allow_cached */ + g_task_get_cancellable (task), + (GAsyncReadyCallback)quick_at_ready, + task); + return; + } + + /* Device hotplugged and has a defined ready delay, wait for READY URC */ + wait_for_ready (task); +} + +/*****************************************************************************/ + +G_MODULE_EXPORT MMPlugin * +mm_plugin_create (void) +{ + static const gchar *subsystems[] = { "tty", "net", NULL }; + static const guint16 vendor_ids[] = { 0x1546, 0 }; + static const gchar *vendor_strings[] = { "u-blox", NULL }; + static const MMAsyncMethod custom_init = { + .async = G_CALLBACK (ublox_custom_init), + .finish = G_CALLBACK (ublox_custom_init_finish), + }; + + return MM_PLUGIN (g_object_new (MM_TYPE_PLUGIN_UBLOX, + MM_PLUGIN_NAME, "u-blox", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, + MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_SEND_DELAY, (guint64) 0, + MM_PLUGIN_CUSTOM_INIT, &custom_init, + NULL)); +} + +static void +mm_plugin_ublox_init (MMPluginUblox *self) +{ +} + +static void +mm_plugin_ublox_class_init (MMPluginUbloxClass *klass) +{ + MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); + + plugin_class->create_modem = create_modem; +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-plugin-ublox.h modemmanager-1.10.0/plugins/ublox/mm-plugin-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-plugin-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-plugin-ublox.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#ifndef MM_PLUGIN_UBLOX_H +#define MM_PLUGIN_UBLOX_H + +#include "mm-plugin.h" + +#define MM_TYPE_PLUGIN_UBLOX (mm_plugin_ublox_get_type ()) +#define MM_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUblox)) +#define MM_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) +#define MM_IS_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_UBLOX)) +#define MM_IS_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_UBLOX)) +#define MM_PLUGIN_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) + +typedef struct { + MMPlugin parent; +} MMPluginUblox; + +typedef struct { + MMPluginClass parent; +} MMPluginUbloxClass; + +GType mm_plugin_ublox_get_type (void); + +G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); + +#endif /* MM_PLUGIN_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/mm-sim-ublox.c modemmanager-1.10.0/plugins/ublox/mm-sim-ublox.c --- modemmanager-1.6.8/plugins/ublox/mm-sim-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-sim-ublox.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,162 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-base-modem-at.h" + +#include "mm-sim-ublox.h" + +G_DEFINE_TYPE (MMSimUblox, mm_sim_ublox, MM_TYPE_BASE_SIM) + +/*****************************************************************************/ +/* SIM identifier loading */ + +static gchar * +load_sim_identifier_finish (MMBaseSim *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +parent_load_sim_identifier_ready (MMSimUblox *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + gchar *simid; + + simid = MM_BASE_SIM_CLASS (mm_sim_ublox_parent_class)->load_sim_identifier_finish (MM_BASE_SIM (self), res, &error); + if (simid) + g_task_return_pointer (task, simid, g_free); + else + g_task_return_error (task, error); + g_object_unref (task); +} + +static void +ccid_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMBaseSim *self; + const gchar *response; + gchar *parsed; + + response = mm_base_modem_at_command_finish (modem, res, NULL); + if (!response) + goto error; + + response = mm_strip_tag (response, "+CCID:"); + if (!response) + goto error; + + parsed = mm_3gpp_parse_iccid (response, NULL); + if (parsed) { + g_task_return_pointer (task, parsed, g_free); + g_object_unref (task); + return; + } + +error: + /* Chain up to parent method to for devices that don't support +CCID properly */ + self = g_task_get_source_object (task); + MM_BASE_SIM_CLASS (mm_sim_ublox_parent_class)->load_sim_identifier (self, + (GAsyncReadyCallback) parent_load_sim_identifier_ready, + task); +} + +static void +load_sim_identifier (MMBaseSim *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBaseModem *modem = NULL; + + g_object_get (self, + MM_BASE_SIM_MODEM, &modem, + NULL); + mm_base_modem_at_command ( + modem, + "+CCID", + 5, + FALSE, + (GAsyncReadyCallback)ccid_ready, + g_task_new (self, NULL, callback, user_data)); + g_object_unref (modem); +} + +/*****************************************************************************/ + +MMBaseSim * +mm_sim_ublox_new_finish (GAsyncResult *res, + GError **error) +{ + GObject *source; + GObject *sim; + + source = g_async_result_get_source_object (res); + sim = g_async_initable_new_finish (G_ASYNC_INITABLE (source), res, error); + g_object_unref (source); + + if (!sim) + return NULL; + + /* Only export valid SIMs */ + mm_base_sim_export (MM_BASE_SIM (sim)); + + return MM_BASE_SIM (sim); +} + +void +mm_sim_ublox_new (MMBaseModem *modem, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (MM_TYPE_SIM_UBLOX, + G_PRIORITY_DEFAULT, + cancellable, + callback, + user_data, + MM_BASE_SIM_MODEM, modem, + NULL); +} + +static void +mm_sim_ublox_init (MMSimUblox *self) +{ +} + +static void +mm_sim_ublox_class_init (MMSimUbloxClass *klass) +{ + MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass); + + base_sim_class->load_sim_identifier = load_sim_identifier; + base_sim_class->load_sim_identifier_finish = load_sim_identifier_finish; +} diff -Nru modemmanager-1.6.8/plugins/ublox/mm-sim-ublox.h modemmanager-1.10.0/plugins/ublox/mm-sim-ublox.h --- modemmanager-1.6.8/plugins/ublox/mm-sim-ublox.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/mm-sim-ublox.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,51 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_SIM_UBLOX_H +#define MM_SIM_UBLOX_H + +#include +#include + +#include "mm-base-sim.h" + +#define MM_TYPE_SIM_UBLOX (mm_sim_ublox_get_type ()) +#define MM_SIM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_UBLOX, MMSimUblox)) +#define MM_SIM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_UBLOX, MMSimUbloxClass)) +#define MM_IS_SIM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_UBLOX)) +#define MM_IS_SIM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_UBLOX)) +#define MM_SIM_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_UBLOX, MMSimUbloxClass)) + +typedef struct _MMSimUblox MMSimUblox; +typedef struct _MMSimUbloxClass MMSimUbloxClass; + +struct _MMSimUblox { + MMBaseSim parent; +}; + +struct _MMSimUbloxClass { + MMBaseSimClass parent; +}; + +GType mm_sim_ublox_get_type (void); + +void mm_sim_ublox_new (MMBaseModem *modem, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBaseSim *mm_sim_ublox_new_finish (GAsyncResult *res, + GError **error); + +#endif /* MM_SIM_UBLOX_H */ diff -Nru modemmanager-1.6.8/plugins/ublox/tests/test-modem-helpers-ublox.c modemmanager-1.10.0/plugins/ublox/tests/test-modem-helpers-ublox.c --- modemmanager-1.6.8/plugins/ublox/tests/test-modem-helpers-ublox.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/ublox/tests/test-modem-helpers-ublox.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1144 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-ublox.h" + +/*****************************************************************************/ +/* Test +UPINCNT responses */ + +typedef struct { + const gchar *str; + guint pin_attempts; + guint pin2_attempts; + guint puk_attempts; + guint puk2_attempts; +} UpinCntResponseTest; + +static const UpinCntResponseTest upincnt_response_tests[] = { + { .str = "+UPINCNT: 3,3,10,10\r\n", + .pin_attempts = 3, + .pin2_attempts = 3, + .puk_attempts = 10, + .puk2_attempts = 10 + }, + { .str = "+UPINCNT: 0,3,5,5\r\n", + .pin_attempts = 0, + .pin2_attempts = 3, + .puk_attempts = 5, + .puk2_attempts = 5 + }, + { .str = "+UPINCNT: 0,0,0,0\r\n", + .pin_attempts = 0, + .pin2_attempts = 0, + .puk_attempts = 0, + .puk2_attempts = 0 + }, +}; + +static void +test_upincnt_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (upincnt_response_tests); i++) { + GError *error = NULL; + gboolean success; + guint pin_attempts = G_MAXUINT; + guint pin2_attempts = G_MAXUINT; + guint puk_attempts = G_MAXUINT; + guint puk2_attempts = G_MAXUINT; + + success = mm_ublox_parse_upincnt_response (upincnt_response_tests[i].str, + &pin_attempts, &pin2_attempts, + &puk_attempts, &puk2_attempts, + &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (upincnt_response_tests[i].pin_attempts, ==, pin_attempts); + g_assert_cmpuint (upincnt_response_tests[i].pin2_attempts, ==, pin2_attempts); + g_assert_cmpuint (upincnt_response_tests[i].puk_attempts, ==, puk_attempts); + g_assert_cmpuint (upincnt_response_tests[i].puk2_attempts, ==, puk2_attempts); + } +} + +/*****************************************************************************/ +/* Test UUSBCONF? responses */ + +typedef struct { + const gchar *str; + MMUbloxUsbProfile profile; +} UusbconfResponseTest; + +static const UusbconfResponseTest uusbconf_response_tests[] = { + { + .str = "+UUSBCONF: 3,\"RNDIS\",,\"0x1146\"\r\n", + .profile = MM_UBLOX_USB_PROFILE_RNDIS + }, + { + .str = "+UUSBCONF: 2,\"ECM\",,\"0x1143\"\r\n", + .profile = MM_UBLOX_USB_PROFILE_ECM + }, + { + .str = "+UUSBCONF: 0,\"\",,\"0x1141\"\r\n", + .profile = MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE + }, +}; + +static void +test_uusbconf_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (uusbconf_response_tests); i++) { + MMUbloxUsbProfile profile = MM_UBLOX_USB_PROFILE_UNKNOWN; + GError *error = NULL; + gboolean success; + + success = mm_ublox_parse_uusbconf_response (uusbconf_response_tests[i].str, &profile, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (uusbconf_response_tests[i].profile, ==, profile); + } +} + +/*****************************************************************************/ +/* Test UBMCONF? responses */ + +typedef struct { + const gchar *str; + MMUbloxNetworkingMode mode; +} UbmconfResponseTest; + +static const UbmconfResponseTest ubmconf_response_tests[] = { + { + .str = "+UBMCONF: 1\r\n", + .mode = MM_UBLOX_NETWORKING_MODE_ROUTER + }, + { + .str = "+UBMCONF: 2\r\n", + .mode = MM_UBLOX_NETWORKING_MODE_BRIDGE + }, +}; + +static void +test_ubmconf_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (ubmconf_response_tests); i++) { + MMUbloxNetworkingMode mode = MM_UBLOX_NETWORKING_MODE_UNKNOWN; + GError *error = NULL; + gboolean success; + + success = mm_ublox_parse_ubmconf_response (ubmconf_response_tests[i].str, &mode, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (ubmconf_response_tests[i].mode, ==, mode); + } +} + +/*****************************************************************************/ +/* Test UIPADDR=N responses */ + +typedef struct { + const gchar *str; + guint cid; + const gchar *if_name; + const gchar *ipv4_address; + const gchar *ipv4_subnet; + const gchar *ipv6_global_address; + const gchar *ipv6_link_local_address; +} UipaddrResponseTest; + +static const UipaddrResponseTest uipaddr_response_tests[] = { + { + .str = "+UIPADDR: 1,\"ccinet0\",\"5.168.120.13\",\"255.255.255.0\",\"\",\"\"", + .cid = 1, + .if_name = "ccinet0", + .ipv4_address = "5.168.120.13", + .ipv4_subnet = "255.255.255.0", + }, + { + .str = "+UIPADDR: 2,\"ccinet1\",\"\",\"\",\"2001::1:200:FF:FE00:0/64\",\"FE80::200:FF:FE00:0/64\"", + .cid = 2, + .if_name = "ccinet1", + .ipv6_global_address = "2001::1:200:FF:FE00:0/64", + .ipv6_link_local_address = "FE80::200:FF:FE00:0/64", + }, + { + .str = "+UIPADDR: 3,\"ccinet2\",\"5.10.100.2\",\"255.255.255.0\",\"2001::1:200:FF:FE00:0/64\",\"FE80::200:FF:FE00:0/64\"", + .cid = 3, + .if_name = "ccinet2", + .ipv4_address = "5.10.100.2", + .ipv4_subnet = "255.255.255.0", + .ipv6_global_address = "2001::1:200:FF:FE00:0/64", + .ipv6_link_local_address = "FE80::200:FF:FE00:0/64", + }, +}; + +static void +test_uipaddr_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (uipaddr_response_tests); i++) { + GError *error = NULL; + gboolean success; + guint cid = G_MAXUINT; + gchar *if_name = NULL; + gchar *ipv4_address = NULL; + gchar *ipv4_subnet = NULL; + gchar *ipv6_global_address = NULL; + gchar *ipv6_link_local_address = NULL; + + success = mm_ublox_parse_uipaddr_response (uipaddr_response_tests[i].str, + &cid, + &if_name, + &ipv4_address, + &ipv4_subnet, + &ipv6_global_address, + &ipv6_link_local_address, + &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (uipaddr_response_tests[i].cid, ==, cid); + g_assert_cmpstr (uipaddr_response_tests[i].if_name, ==, if_name); + g_assert_cmpstr (uipaddr_response_tests[i].ipv4_address, ==, ipv4_address); + g_assert_cmpstr (uipaddr_response_tests[i].ipv4_subnet, ==, ipv4_subnet); + g_assert_cmpstr (uipaddr_response_tests[i].ipv6_global_address, ==, ipv6_global_address); + g_assert_cmpstr (uipaddr_response_tests[i].ipv6_link_local_address, ==, ipv6_link_local_address); + + g_free (if_name); + g_free (ipv4_address); + g_free (ipv4_subnet); + g_free (ipv6_global_address); + g_free (ipv6_link_local_address); + } +} + +/*****************************************************************************/ +/* Test CFUN? response */ + +typedef struct { + const gchar *str; + MMModemPowerState state; +} CfunQueryTest; + +static const CfunQueryTest cfun_query_tests[] = { + { "+CFUN: 1", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 1,0", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 0", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 0,0", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 4", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 4,0", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 19", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 19,0", MM_MODEM_POWER_STATE_LOW }, +}; + +static void +test_cfun_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_tests); i++) { + GError *error = NULL; + gboolean success; + MMModemPowerState state = MM_MODEM_POWER_STATE_UNKNOWN; + + success = mm_ublox_parse_cfun_response (cfun_query_tests[i].str, &state, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_tests[i].state, ==, state); + } +} + +/*****************************************************************************/ +/* Test URAT=? responses and model based filtering */ + +static void +compare_combinations (const gchar *response, + const gchar *model, + const MMModemModeCombination *expected_combinations, + guint n_expected_combinations) +{ + GArray *combinations; + GError *error = NULL; + guint i; + + combinations = mm_ublox_parse_urat_test_response (response, &error); + g_assert_no_error (error); + g_assert (combinations); + + combinations = mm_ublox_filter_supported_modes (model, combinations, &error); + g_assert_no_error (error); + g_assert (combinations); + + g_assert_cmpuint (combinations->len, ==, n_expected_combinations); + + for (i = 0; i < combinations->len; i++) { + MMModemModeCombination combination; + guint j; + gboolean found = FALSE; + + combination = g_array_index (combinations, MMModemModeCombination, i); + for (j = 0; !found && j < n_expected_combinations; j++) + found = (combination.allowed == expected_combinations[j].allowed && + combination.preferred == expected_combinations[j].preferred); + g_assert (found); + } + + g_array_unref (combinations); +} + +static void +test_urat_test_response_2g (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE } + }; + + compare_combinations ("+URAT: 0", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); + compare_combinations ("+URAT: 0,0", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); + compare_combinations ("+URAT: (0)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); + compare_combinations ("+URAT: (0),(0)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +static void +test_urat_test_response_2g3g (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_3G }, + }; + + compare_combinations ("+URAT: (0,1,2),(0,2)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); + compare_combinations ("+URAT: (0-2),(0,2)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +static void +test_urat_test_response_2g3g4g (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_3G }, + + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + }; + + compare_combinations ("+URAT: (0,1,2,3,4,5,6),(0,2,3)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); + compare_combinations ("+URAT: (0-6),(0,2,3)", NULL, expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +static void +test_mode_filtering_toby_l201 (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + }; + + compare_combinations ("+URAT: (0-6),(0,2,3)", "TOBY-L201", expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +static void +test_mode_filtering_lisa_u200 (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_3G }, + }; + + compare_combinations ("+URAT: (0-6),(0,2,3)", "LISA-U200", expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +static void +test_mode_filtering_sara_u280 (void) +{ + static const MMModemModeCombination expected_combinations[] = { + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + }; + + compare_combinations ("+URAT: (0-6),(0,2,3)", "SARA-U280", expected_combinations, G_N_ELEMENTS (expected_combinations)); +} + +/*****************************************************************************/ +/* URAT? response parser and URAT=X command builder */ + +typedef struct { + const gchar *command; + const gchar *response; + MMModemMode allowed; + MMModemMode preferred; +} UratTest; + +static const UratTest urat_tests[] = { + { + .command = "+URAT=1,2", + .response = "+URAT: 1,2\r\n", + .allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G), + .preferred = MM_MODEM_MODE_3G, + }, + { + .command = "+URAT=4,0", + .response = "+URAT: 4,0\r\n", + .allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G), + .preferred = MM_MODEM_MODE_2G, + }, + { + .command = "+URAT=0", + .response = "+URAT: 0\r\n", + .allowed = MM_MODEM_MODE_2G, + .preferred = MM_MODEM_MODE_NONE, + }, + { + .command = "+URAT=6", + .response = "+URAT: 6\r\n", + .allowed = (MM_MODEM_MODE_3G | MM_MODEM_MODE_4G), + .preferred = MM_MODEM_MODE_NONE, + }, +}; + +static void +test_urat_read_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (urat_tests); i++) { + MMModemMode allowed = MM_MODEM_MODE_NONE; + MMModemMode preferred = MM_MODEM_MODE_NONE; + GError *error = NULL; + gboolean success; + + success = mm_ublox_parse_urat_read_response (urat_tests[i].response, + &allowed, &preferred, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (urat_tests[i].allowed, ==, allowed); + g_assert_cmpuint (urat_tests[i].preferred, ==, preferred); + } +} + +static void +test_urat_write_command (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (urat_tests); i++) { + gchar *command; + GError *error = NULL; + + command = mm_ublox_build_urat_set_command (urat_tests[i].allowed, urat_tests[i].preferred, &error); + g_assert_no_error (error); + g_assert_cmpstr (command, ==, urat_tests[i].command); + g_free (command); + } +} + +/*****************************************************************************/ +/* Supported bands */ + +static void +common_compare_bands (GArray *bands, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + gchar *bands_str; + GArray *expected_bands_array; + gchar *expected_bands_str; + + if (!expected_bands || !n_expected_bands) { + g_assert (!bands); + return; + } + + g_assert (bands); + mm_common_bands_garray_sort (bands); + bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len); + g_array_unref (bands); + + expected_bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_expected_bands); + g_array_append_vals (expected_bands_array, expected_bands, n_expected_bands); + mm_common_bands_garray_sort (expected_bands_array); + expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len); + g_array_unref (expected_bands_array); + + g_assert_cmpstr (bands_str, ==, expected_bands_str); + g_free (bands_str); + g_free (expected_bands_str); +} + +static void +common_validate_supported_bands (const gchar *model, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + GError *error = NULL; + GArray *bands; + + bands = mm_ublox_get_supported_bands (model, &error); + g_assert_no_error (error); + g_assert (bands); + + common_compare_bands (bands, expected_bands, n_expected_bands); +} + +static void +test_supported_bands_all (void) +{ + /* All 2G, 3G and 4G bands */ + const MMModemBand expected_bands[] = { + /* 700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17, + /* 800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20, + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, + /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11, + /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4, + /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, + /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2, + /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1, + /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7, + }; + + common_validate_supported_bands (NULL, expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_supported_bands_toby_l201 (void) +{ + /* Only 3G and 4G bands */ + const MMModemBand expected_bands[] = { + /* 700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17, + /* 800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20, + /* 850 */ MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + /* 900 */ MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, + /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11, + /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4, + /* 1800 */ MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, + /* 1900 */ MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2, + /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1, + /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7, + }; + + common_validate_supported_bands ("TOBY-L201", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_supported_bands_lisa_u200 (void) +{ + /* Only 2G and 3G bands */ + const MMModemBand expected_bands[] = { + /* 800 */ MM_MODEM_BAND_UTRAN_6, + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, + /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, + /* 1500 */ MM_MODEM_BAND_UTRAN_11, + /* 1700 */ MM_MODEM_BAND_UTRAN_4, + /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, + /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, + /* 2100 */ MM_MODEM_BAND_UTRAN_1, + /* 2600 */ MM_MODEM_BAND_UTRAN_7, + }; + + common_validate_supported_bands ("LISA-U200", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_supported_bands_sara_u280 (void) +{ + /* Only 3G bands */ + const MMModemBand expected_bands[] = { + /* 800 */ MM_MODEM_BAND_UTRAN_6, + /* 850 */ MM_MODEM_BAND_UTRAN_5, + /* 900 */ MM_MODEM_BAND_UTRAN_8, + /* 1500 */ MM_MODEM_BAND_UTRAN_11, + /* 1700 */ MM_MODEM_BAND_UTRAN_4, + /* 1800 */ MM_MODEM_BAND_UTRAN_3, + /* 1900 */ MM_MODEM_BAND_UTRAN_2, + /* 2100 */ MM_MODEM_BAND_UTRAN_1, + /* 2600 */ MM_MODEM_BAND_UTRAN_7, + }; + + common_validate_supported_bands ("SARA-U280", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +/*****************************************************************************/ +/* Test +UBANDSEL? response parser */ + +static void +common_validate_ubandsel_response (const gchar *str, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + GError *error = NULL; + GArray *bands; + + bands = mm_ublox_parse_ubandsel_response (str, &error); + g_assert_no_error (error); + g_assert (bands); + + common_compare_bands (bands, expected_bands, n_expected_bands); +} + +static void +test_ubandsel_response_four (void) +{ + const MMModemBand expected_bands[] = { + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, + /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, + /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2, + }; + + common_validate_ubandsel_response ("+UBANDSEL: 850,900,1800,1900\r\n", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_ubandsel_response_three (void) +{ + const MMModemBand expected_bands[] = { + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, + /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, + }; + + common_validate_ubandsel_response ("+UBANDSEL: 850,900,1800\r\n", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_ubandsel_response_two (void) +{ + const MMModemBand expected_bands[] = { + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, + }; + + common_validate_ubandsel_response ("+UBANDSEL: 850,900\r\n", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_ubandsel_response_one (void) +{ + const MMModemBand expected_bands[] = { + /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, + }; + + common_validate_ubandsel_response ("+UBANDSEL: 850\r\n", expected_bands, G_N_ELEMENTS (expected_bands)); +} + +/*****************************************************************************/ +/* +UBANDSEL=x command builder */ + +static void +common_validate_ubandsel_request (const MMModemBand *bands, + guint n_bands, + const gchar *expected_request) +{ + GError *error = NULL; + GArray *bands_array; + gchar *request; + + bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands); + g_array_append_vals (bands_array, bands, n_bands); + + request = mm_ublox_build_ubandsel_set_command (bands_array, &error); + g_assert_no_error (error); + g_assert (request); + + g_assert_cmpstr (request, ==, expected_request); + + g_array_unref (bands_array); + g_free (request); +} + +static void +test_ubandsel_request_any (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_ANY + }; + + common_validate_ubandsel_request (bands, G_N_ELEMENTS (bands), "+UBANDSEL=0"); +} + +static void +test_ubandsel_request_2g (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_G850, MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS + }; + + common_validate_ubandsel_request (bands, G_N_ELEMENTS (bands), "+UBANDSEL=850,900,1800,1900"); +} + +static void +test_ubandsel_request_1800 (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3 + }; + + common_validate_ubandsel_request (bands, G_N_ELEMENTS (bands), "+UBANDSEL=1800"); +} + +/*****************************************************************************/ +/* Test +UACT? response parser */ + +static void +common_validate_uact_response (const gchar *str, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + GError *error = NULL; + GArray *bands; + + bands = mm_ublox_parse_uact_response (str, &error); + g_assert_no_error (error); + + common_compare_bands (bands, expected_bands, n_expected_bands); +} + +static void +test_uact_response_empty_list (void) +{ + common_validate_uact_response ("+UACT: ,,,\r\n", NULL, 0); +} + +static void +test_uact_response_2g (void) +{ + const MMModemBand expected_bands[] = { + MM_MODEM_BAND_G850, MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, + }; + + common_validate_uact_response ("+UACT: ,,,900,1800,1900,850\r\n", + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_uact_response_2g3g (void) +{ + const MMModemBand expected_bands[] = { + MM_MODEM_BAND_G850, MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_9, + }; + + common_validate_uact_response ("+UACT: ,,,900,1800,1900,850,1,2,3,4,5,6,7,8,9\r\n", + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_uact_response_2g3g4g (void) +{ + const MMModemBand expected_bands[] = { + MM_MODEM_BAND_G850, MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, + MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_UTRAN_9, + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_6, MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_9, + }; + + common_validate_uact_response ("+UACT: ,,,900,1800,1900,850,1,2,3,4,5,6,7,8,9,101,102,103,104,105,106,107,108,109\r\n", + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +/*****************************************************************************/ +/* Test +UACT=? test parser */ + +static void +common_validate_uact_test (const gchar *str, + const MMModemBand *expected_bands_2g, + guint n_expected_bands_2g, + const MMModemBand *expected_bands_3g, + guint n_expected_bands_3g, + const MMModemBand *expected_bands_4g, + guint n_expected_bands_4g) +{ + GError *error = NULL; + gboolean result; + GArray *bands_2g = NULL; + GArray *bands_3g = NULL; + GArray *bands_4g = NULL; + + result = mm_ublox_parse_uact_test (str, &bands_2g, &bands_3g, &bands_4g, &error); + g_assert_no_error (error); + g_assert (result); + + common_compare_bands (bands_2g, expected_bands_2g, n_expected_bands_2g); + common_compare_bands (bands_3g, expected_bands_3g, n_expected_bands_3g); + common_compare_bands (bands_4g, expected_bands_4g, n_expected_bands_4g); +} + +static void +test_uact_test_2g (void) +{ + const MMModemBand expected_bands_2g[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS + }; + + common_validate_uact_test ("+UACT: ,,,(900,1800)\r\n", + expected_bands_2g, G_N_ELEMENTS (expected_bands_2g), + NULL, 0, + NULL, 0); +} + +static void +test_uact_test_2g3g (void) +{ + const MMModemBand expected_bands_2g[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS + }; + const MMModemBand expected_bands_3g[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8 + }; + + common_validate_uact_test ("+UACT: ,,,(900,1800),(1,8)\r\n", + expected_bands_2g, G_N_ELEMENTS (expected_bands_2g), + expected_bands_3g, G_N_ELEMENTS (expected_bands_3g), + NULL, 0); +} + +static void +test_uact_test_2g3g4g (void) +{ + const MMModemBand expected_bands_2g[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS + }; + const MMModemBand expected_bands_3g[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8 + }; + const MMModemBand expected_bands_4g[] = { + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_20 + }; + + common_validate_uact_test ("+UACT: ,,,(900,1800),(1,8),(101,103,107,108,120)\r\n", + expected_bands_2g, G_N_ELEMENTS (expected_bands_2g), + expected_bands_3g, G_N_ELEMENTS (expected_bands_3g), + expected_bands_4g, G_N_ELEMENTS (expected_bands_4g)); +} + +static void +test_uact_test_2g3g4g_2 (void) +{ + const MMModemBand expected_bands_2g[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS + }; + const MMModemBand expected_bands_3g[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8 + }; + const MMModemBand expected_bands_4g[] = { + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_20 + }; + + common_validate_uact_test ("+UACT: ,,,(900,1800),(1,8),(101,103,107,108,120),(138)\r\n", + expected_bands_2g, G_N_ELEMENTS (expected_bands_2g), + expected_bands_3g, G_N_ELEMENTS (expected_bands_3g), + expected_bands_4g, G_N_ELEMENTS (expected_bands_4g)); +} + +/*****************************************************************************/ +/* +UACT=x command builder */ + +static void +common_validate_uact_request (const MMModemBand *bands, + guint n_bands, + const gchar *expected_request) +{ + GError *error = NULL; + GArray *bands_array; + gchar *request; + + bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands); + g_array_append_vals (bands_array, bands, n_bands); + + request = mm_ublox_build_uact_set_command (bands_array, &error); + g_assert_no_error (error); + g_assert (request); + + g_assert_cmpstr (request, ==, expected_request); + + g_array_unref (bands_array); + g_free (request); +} + +static void +test_uact_request_any (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_ANY + }; + + common_validate_uact_request (bands, G_N_ELEMENTS (bands), "+UACT=,,,0"); +} + +static void +test_uact_request_2g (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, + }; + + common_validate_uact_request (bands, G_N_ELEMENTS (bands), "+UACT=,,,900,1800"); +} + +static void +test_uact_request_3g (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_8, + }; + + common_validate_uact_request (bands, G_N_ELEMENTS (bands), "+UACT=,,,1,8"); +} + +static void +test_uact_request_4g (void) +{ + const MMModemBand bands[] = { + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_20 + }; + + common_validate_uact_request (bands, G_N_ELEMENTS (bands), "+UACT=,,,101,103,107,108,120"); +} + +/*****************************************************************************/ +/* Test +UAUTHREQ=? responses */ + +static void +common_validate_uauthreq_test (const gchar *str, + MMUbloxBearerAllowedAuth expected_allowed_auths) +{ + GError *error = NULL; + MMUbloxBearerAllowedAuth allowed_auths; + + allowed_auths = mm_ublox_parse_uauthreq_test (str, &error); + g_assert_no_error (error); + g_assert_cmpuint (allowed_auths, ==, expected_allowed_auths); +} + +static void +test_uauthreq_tobyl4 (void) +{ + common_validate_uauthreq_test ("+UAUTHREQ: (1-4),(0-2),,", + (MM_UBLOX_BEARER_ALLOWED_AUTH_NONE | + MM_UBLOX_BEARER_ALLOWED_AUTH_PAP | + MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP)); +} + +static void +test_uauthreq_with_auto (void) +{ + common_validate_uauthreq_test ("+UAUTHREQ: (1-4),(0-3),,", + (MM_UBLOX_BEARER_ALLOWED_AUTH_NONE | + MM_UBLOX_BEARER_ALLOWED_AUTH_PAP | + MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP | + MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO)); +} + +static void +test_uauthreq_less_fields (void) +{ + common_validate_uauthreq_test ("+UAUTHREQ: (1-4),(0-2)", + (MM_UBLOX_BEARER_ALLOWED_AUTH_NONE | + MM_UBLOX_BEARER_ALLOWED_AUTH_PAP | + MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP)); +} + +/*****************************************************************************/ +/* Test +UGCNTRD responses */ + +typedef struct { + const gchar *str; + guint cid; + guint session_tx_bytes; + guint session_rx_bytes; + guint total_tx_bytes; + guint total_rx_bytes; +} UgcntrdResponseTest; + +static const UgcntrdResponseTest ugcntrd_response_tests[] = { + { + .str = "+UGCNTRD: 1, 100, 0, 100, 0", + .cid = 1, + .session_tx_bytes = 100, + .session_rx_bytes = 0, + .total_tx_bytes = 100, + .total_rx_bytes = 0 + }, + { + .str = "+UGCNTRD: 31,2704,1819,2724,1839", + .cid = 31, + .session_tx_bytes = 2704, + .session_rx_bytes = 1819, + .total_tx_bytes = 2724, + .total_rx_bytes = 1839 + }, + { + .str = "+UGCNTRD: 1, 100, 0, 100, 0\r\n" + "+UGCNTRD: 31,2704,1819,2724,1839\r\n", + .cid = 1, + .session_tx_bytes = 100, + .session_rx_bytes = 0, + .total_tx_bytes = 100, + .total_rx_bytes = 0 + }, + { + .str = "+UGCNTRD: 1, 100, 0, 100, 0\r\n" + "+UGCNTRD: 31,2704,1819,2724,1839\r\n", + .cid = 31, + .session_tx_bytes = 2704, + .session_rx_bytes = 1819, + .total_tx_bytes = 2724, + .total_rx_bytes = 1839 + } +}; + +static void +test_ugcntrd_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (ugcntrd_response_tests); i++) { + GError *error = NULL; + gboolean success; + guint session_tx_bytes = G_MAXUINT; + guint session_rx_bytes = G_MAXUINT; + guint total_tx_bytes = G_MAXUINT; + guint total_rx_bytes = G_MAXUINT; + + success = mm_ublox_parse_ugcntrd_response_for_cid (ugcntrd_response_tests[i].str, + ugcntrd_response_tests[i].cid, + &session_tx_bytes, + &session_rx_bytes, + &total_tx_bytes, + &total_rx_bytes, + &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (ugcntrd_response_tests[i].session_tx_bytes, ==, session_tx_bytes); + g_assert_cmpuint (ugcntrd_response_tests[i].session_rx_bytes, ==, session_rx_bytes); + g_assert_cmpuint (ugcntrd_response_tests[i].total_tx_bytes, ==, total_tx_bytes); + g_assert_cmpuint (ugcntrd_response_tests[i].total_rx_bytes, ==, total_rx_bytes); + } +} + +/*****************************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/ublox/upincnt/response", test_upincnt_response); + g_test_add_func ("/MM/ublox/uusbconf/response", test_uusbconf_response); + g_test_add_func ("/MM/ublox/ubmconf/response", test_ubmconf_response); + g_test_add_func ("/MM/ublox/uipaddr/response", test_uipaddr_response); + g_test_add_func ("/MM/ublox/cfun/response", test_cfun_response); + g_test_add_func ("/MM/ublox/urat/test/response/2g", test_urat_test_response_2g); + g_test_add_func ("/MM/ublox/urat/test/response/2g3g", test_urat_test_response_2g3g); + g_test_add_func ("/MM/ublox/urat/test/response/2g3g4g", test_urat_test_response_2g3g4g); + g_test_add_func ("/MM/ublox/urat/test/response/toby-l201", test_mode_filtering_toby_l201); + g_test_add_func ("/MM/ublox/urat/test/response/lisa-u200", test_mode_filtering_lisa_u200); + g_test_add_func ("/MM/ublox/urat/test/response/sara-u280", test_mode_filtering_sara_u280); + g_test_add_func ("/MM/ublox/urat/read/response", test_urat_read_response); + g_test_add_func ("/MM/ublox/urat/write/command", test_urat_write_command); + g_test_add_func ("/MM/ublox/supported-bands/all", test_supported_bands_all); + g_test_add_func ("/MM/ublox/supported-bands/toby-l201", test_supported_bands_toby_l201); + g_test_add_func ("/MM/ublox/supported-bands/lisa-u200", test_supported_bands_lisa_u200); + g_test_add_func ("/MM/ublox/supported-bands/sara-u280", test_supported_bands_sara_u280); + g_test_add_func ("/MM/ublox/ubandsel/response/one", test_ubandsel_response_one); + g_test_add_func ("/MM/ublox/ubandsel/response/two", test_ubandsel_response_two); + g_test_add_func ("/MM/ublox/ubandsel/response/three", test_ubandsel_response_three); + g_test_add_func ("/MM/ublox/ubandsel/response/four", test_ubandsel_response_four); + g_test_add_func ("/MM/ublox/ubandsel/request/any", test_ubandsel_request_any); + g_test_add_func ("/MM/ublox/ubandsel/request/2g", test_ubandsel_request_2g); + g_test_add_func ("/MM/ublox/ubandsel/request/1800", test_ubandsel_request_1800); + g_test_add_func ("/MM/ublox/uact/response/empty-list", test_uact_response_empty_list); + g_test_add_func ("/MM/ublox/uact/response/2g", test_uact_response_2g); + g_test_add_func ("/MM/ublox/uact/response/2g3g", test_uact_response_2g3g); + g_test_add_func ("/MM/ublox/uact/response/2g3g4g", test_uact_response_2g3g4g); + g_test_add_func ("/MM/ublox/uact/test/2g", test_uact_test_2g); + g_test_add_func ("/MM/ublox/uact/test/2g3g", test_uact_test_2g3g); + g_test_add_func ("/MM/ublox/uact/test/2g3g4g", test_uact_test_2g3g4g); + g_test_add_func ("/MM/ublox/uact/test/2g3g4g/2", test_uact_test_2g3g4g_2); + g_test_add_func ("/MM/ublox/uact/request/any", test_uact_request_any); + g_test_add_func ("/MM/ublox/uact/request/2g", test_uact_request_2g); + g_test_add_func ("/MM/ublox/uact/request/3g", test_uact_request_3g); + g_test_add_func ("/MM/ublox/uact/request/4g", test_uact_request_4g); + g_test_add_func ("/MM/ublox/uauthreq/test/tobyl4", test_uauthreq_tobyl4); + g_test_add_func ("/MM/ublox/uauthreq/test/with-auto", test_uauthreq_with_auto); + g_test_add_func ("/MM/ublox/uauthreq/test/less-fields", test_uauthreq_less_fields); + g_test_add_func ("/MM/ublox/ugcntrd/response", test_ugcntrd_response); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/plugins/via/mm-broadband-modem-via.c modemmanager-1.10.0/plugins/via/mm-broadband-modem-via.c --- modemmanager-1.6.8/plugins/via/mm-broadband-modem-via.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/via/mm-broadband-modem-via.c 2018-11-15 09:55:53.000000000 +0100 @@ -67,80 +67,74 @@ } SetupRegistrationChecksResults; static gboolean -setup_registration_checks_finish (MMIfaceModemCdma *self, - GAsyncResult *res, - gboolean *skip_qcdm_call_manager_step, - gboolean *skip_qcdm_hdr_step, - gboolean *skip_at_cdma_service_status_step, - gboolean *skip_at_cdma1x_serving_system_step, - gboolean *skip_detailed_registration_state, - GError **error) +setup_registration_checks_finish (MMIfaceModemCdma *self, + GAsyncResult *res, + gboolean *skip_qcdm_call_manager_step, + gboolean *skip_qcdm_hdr_step, + gboolean *skip_at_cdma_service_status_step, + gboolean *skip_at_cdma1x_serving_system_step, + gboolean *skip_detailed_registration_state, + GError **error) { SetupRegistrationChecksResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step; - *skip_qcdm_hdr_step = results->skip_qcdm_hdr_step; - *skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step; + *skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step; + *skip_qcdm_hdr_step = results->skip_qcdm_hdr_step; + *skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step; *skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step; - *skip_detailed_registration_state = results->skip_detailed_registration_state; + *skip_detailed_registration_state = results->skip_detailed_registration_state; + + g_free (results); + return TRUE; } static void parent_setup_registration_checks_ready (MMIfaceModemCdma *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { - GError *error = NULL; - SetupRegistrationChecksResults results = { 0 }; + GError *error = NULL; + SetupRegistrationChecksResults *results; + + results = g_new0 (SetupRegistrationChecksResults, 1); if (!iface_modem_cdma_parent->setup_registration_checks_finish (self, res, - &results.skip_qcdm_call_manager_step, - &results.skip_qcdm_hdr_step, - &results.skip_at_cdma_service_status_step, - &results.skip_at_cdma1x_serving_system_step, - &results.skip_detailed_registration_state, + &results->skip_qcdm_call_manager_step, + &results->skip_qcdm_hdr_step, + &results->skip_at_cdma_service_status_step, + &results->skip_at_cdma1x_serving_system_step, + &results->skip_detailed_registration_state, &error)) { - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { /* Skip +CSS */ - results.skip_at_cdma1x_serving_system_step = TRUE; + results->skip_at_cdma1x_serving_system_step = TRUE; /* Skip +CAD */ - results.skip_at_cdma_service_status_step = TRUE; - + results->skip_at_cdma_service_status_step = TRUE; /* Force to always use the detailed registration checks, as we have * ^SYSINFO for that */ - results.skip_detailed_registration_state = FALSE; - - g_simple_async_result_set_op_res_gpointer (simple, &results, NULL); + results->skip_detailed_registration_state = FALSE; + g_task_return_pointer (task, results, g_free); } - - /* All done. NOTE: complete NOT in idle! */ - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void -setup_registration_checks (MMIfaceModemCdma *self, - GAsyncReadyCallback callback, - gpointer user_data) +setup_registration_checks (MMIfaceModemCdma *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_registration_checks); - /* Run parent's checks first */ - iface_modem_cdma_parent->setup_registration_checks (self, - (GAsyncReadyCallback)parent_setup_registration_checks_ready, - result); + iface_modem_cdma_parent->setup_registration_checks ( + self, + (GAsyncReadyCallback)parent_setup_registration_checks_ready, + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -151,61 +145,48 @@ MMModemCdmaRegistrationState detailed_evdo_state; } DetailedRegistrationStateResults; -typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - DetailedRegistrationStateResults state; -} DetailedRegistrationStateContext; - -static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) -{ - /* Always not in idle! we're passing a struct in stack as result */ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean -get_detailed_registration_state_finish (MMIfaceModemCdma *self, - GAsyncResult *res, - MMModemCdmaRegistrationState *detailed_cdma1x_state, - MMModemCdmaRegistrationState *detailed_evdo_state, - GError **error) +get_detailed_registration_state_finish (MMIfaceModemCdma *self, + GAsyncResult *res, + MMModemCdmaRegistrationState *detailed_cdma1x_state, + MMModemCdmaRegistrationState *detailed_evdo_state, + GError **error) { DetailedRegistrationStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *detailed_cdma1x_state = results->detailed_cdma1x_state; - *detailed_evdo_state = results->detailed_evdo_state; + *detailed_evdo_state = results->detailed_evdo_state; + g_free (results); return TRUE; } static void -sysinfo_ready (MMIfaceModemCdma *self, +sysinfo_ready (MMBaseModem *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) + { - GError *error = NULL; - const gchar *response; - GRegex *r; - GMatchInfo *match_info; + DetailedRegistrationStateResults *ctx; + DetailedRegistrationStateResults *results; + const gchar *response; + GRegex *r; + GMatchInfo *match_info; + MMModemCdmaRegistrationState reg_state; + guint val = 0; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + ctx = g_task_get_task_data (task); - /* If error, leave superclass' reg state alone if AT^SYSINFO isn't supported. */ - if (error) { - g_error_free (error); + /* Set input detailed states as fallback */ + results = g_memdup (ctx, sizeof (*ctx)); - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); - return; - } + /* If error, leave superclass' reg state alone if AT^SYSINFO isn't supported. */ + response = mm_base_modem_at_command_finish (self, res, NULL); + if (!response) + goto out; response = mm_strip_tag (response, "^SYSINFO:"); @@ -215,82 +196,77 @@ g_assert (r != NULL); /* Try to parse the results */ - g_regex_match (r, response, 0, &match_info); - if (g_match_info_get_match_count (match_info) < 6) { mm_warn ("Via: failed to parse ^SYSINFO response: '%s'", response); - } else { - MMModemCdmaRegistrationState reg_state; - guint val = 0; + goto out; + } - /* At this point the generic code already knows we've been registered */ - reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; + /* At this point the generic code already knows we've been registered */ + reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED; - if (mm_get_uint_from_match_info (match_info, 1, &val)) { - if (val == 2) { - /* Service available, check roaming state */ - val = 0; - if (mm_get_uint_from_match_info (match_info, 3, &val)) { - if (val == 0) - reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_HOME; - else if (val == 1) - reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING; - } + if (mm_get_uint_from_match_info (match_info, 1, &val)) { + if (val == 2) { + /* Service available, check roaming state */ + val = 0; + if (mm_get_uint_from_match_info (match_info, 3, &val)) { + if (val == 0) + reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_HOME; + else if (val == 1) + reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING; } } + } - /* Check service type */ - val = 0; - if (mm_get_uint_from_match_info (match_info, 4, &val)) { - if (val == 2) /* CDMA */ - ctx->state.detailed_cdma1x_state = reg_state; - else if (val == 4) /* HDR */ - ctx->state.detailed_evdo_state = reg_state; - else if (val == 8) { /* Hybrid */ - ctx->state.detailed_cdma1x_state = reg_state; - ctx->state.detailed_evdo_state = reg_state; - } - } else { - /* Say we're registered to something even though sysmode parsing failed */ - mm_dbg ("SYSMODE parsing failed: assuming registered at least in CDMA1x"); - ctx->state.detailed_cdma1x_state = reg_state; + /* Check service type */ + val = 0; + if (mm_get_uint_from_match_info (match_info, 4, &val)) { + if (val == 2) /* CDMA */ + results->detailed_cdma1x_state = reg_state; + else if (val == 4) /* HDR */ + results->detailed_evdo_state = reg_state; + else if (val == 8) { /* Hybrid */ + results->detailed_cdma1x_state = reg_state; + results->detailed_evdo_state = reg_state; } + } else { + /* Say we're registered to something even though sysmode parsing failed */ + mm_dbg ("SYSMODE parsing failed: assuming registered at least in CDMA1x"); + results->detailed_cdma1x_state = reg_state; } g_match_info_free (match_info); g_regex_unref (r); - /* NOTE: always complete NOT in idle here */ - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->state, NULL); - detailed_registration_state_context_complete_and_free (ctx); +out: + g_task_return_pointer (task, results, NULL); + g_object_unref (task); } static void -get_detailed_registration_state (MMIfaceModemCdma *self, - MMModemCdmaRegistrationState cdma1x_state, - MMModemCdmaRegistrationState evdo_state, - GAsyncReadyCallback callback, - gpointer user_data) +get_detailed_registration_state (MMIfaceModemCdma *self, + MMModemCdmaRegistrationState cdma1x_state, + MMModemCdmaRegistrationState evdo_state, + GAsyncReadyCallback callback, + gpointer user_data) { - DetailedRegistrationStateContext *ctx; + GTask *task; + DetailedRegistrationStateResults *ctx; /* Setup context */ - ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - get_detailed_registration_state); - ctx->state.detailed_cdma1x_state = cdma1x_state; - ctx->state.detailed_evdo_state = evdo_state; + ctx = g_new0 (DetailedRegistrationStateResults, 1); + ctx->detailed_cdma1x_state = cdma1x_state; + ctx->detailed_evdo_state = evdo_state; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); mm_base_modem_at_command (MM_BASE_MODEM (self), "^SYSINFO", 3, FALSE, (GAsyncReadyCallback)sysinfo_ready, - ctx); + task); } /*****************************************************************************/ @@ -321,7 +297,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; @@ -340,26 +316,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_cdma_setup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_cdma_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_VIA (self), TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -367,33 +341,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_setup_unsolicited_events); - /* Chain up parent's setup */ iface_modem_cdma_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cdma_setup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } static void parent_cdma_cleanup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_cdma_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -401,13 +368,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_cleanup_unsolicited_events); - /* Our own cleanup first */ set_unsolicited_events_handlers (MM_BROADBAND_MODEM_VIA (self), FALSE); @@ -415,7 +375,7 @@ iface_modem_cdma_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cdma_cleanup_unsolicited_events_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -431,7 +391,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/via/mm-plugin-via.c modemmanager-1.10.0/plugins/via/mm-plugin-via.c --- modemmanager-1.6.8/plugins/via/mm-plugin-via.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/via/mm-plugin-via.c 2018-11-15 09:55:53.000000000 +0100 @@ -36,14 +36,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_via_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_via_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/wavecom/mm-broadband-modem-wavecom.c modemmanager-1.10.0/plugins/wavecom/mm-broadband-modem-wavecom.c --- modemmanager-1.6.8/plugins/wavecom/mm-broadband-modem-wavecom.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/wavecom/mm-broadband-modem-wavecom.c 2019-01-15 15:57:35.000000000 +0100 @@ -74,50 +74,45 @@ MMModemBand mm_band; } WavecomBand3G; static const WavecomBand3G bands_3g[] = { - { (1 << 0), MM_MODEM_BAND_U2100 }, - { (1 << 1), MM_MODEM_BAND_U1900 }, - { (1 << 2), MM_MODEM_BAND_U1800 }, - { (1 << 3), MM_MODEM_BAND_U17IV }, - { (1 << 4), MM_MODEM_BAND_U850 }, - { (1 << 5), MM_MODEM_BAND_U800 }, - { (1 << 6), MM_MODEM_BAND_U2600 }, - { (1 << 7), MM_MODEM_BAND_U900 }, - { (1 << 8), MM_MODEM_BAND_U17IX } + { (1 << 0), MM_MODEM_BAND_UTRAN_1 }, + { (1 << 1), MM_MODEM_BAND_UTRAN_2 }, + { (1 << 2), MM_MODEM_BAND_UTRAN_3 }, + { (1 << 3), MM_MODEM_BAND_UTRAN_4 }, + { (1 << 4), MM_MODEM_BAND_UTRAN_5 }, + { (1 << 5), MM_MODEM_BAND_UTRAN_6 }, + { (1 << 6), MM_MODEM_BAND_UTRAN_7 }, + { (1 << 7), MM_MODEM_BAND_UTRAN_8 }, + { (1 << 8), MM_MODEM_BAND_UTRAN_9 } }; /*****************************************************************************/ /* Load supported modes (Modem interface) */ static GArray * -load_supported_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -supported_ms_classes_query_ready (MMBaseModem *self, +supported_ms_classes_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - GArray *all; - GArray *combinations; - GArray *filtered; - const gchar *response; - GError *error = NULL; - MMModemModeCombination mode; - MMModemMode mode_all; + GArray *all; + GArray *combinations; + GArray *filtered; + const gchar *response; + GError *error = NULL; + MMModemModeCombination mode; + MMModemMode mode_all; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -134,13 +129,12 @@ /* If none received, error */ if (mode_all == MM_MODEM_MODE_NONE) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get supported mobile station classes: '%s'", - response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get supported mobile station classes: '%s'", + response); + g_object_unref (task); return; } @@ -186,26 +180,26 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void -load_supported_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command ( MM_BASE_MODEM (self), "+CGCLASS=?", 3, FALSE, (GAsyncReadyCallback)supported_ms_classes_query_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + task); } /*****************************************************************************/ @@ -217,45 +211,45 @@ } LoadCurrentModesResult; static gboolean -load_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - MMModemMode *allowed, - MMModemMode *preferred, - GError **error) +load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) { LoadCurrentModesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - - *allowed = result->allowed; + *allowed = result->allowed; *preferred = result->preferred; + g_free (result); return TRUE; } static void -wwsm_read_ready (MMBaseModem *self, +wwsm_read_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - GRegex *r; - GMatchInfo *match_info = NULL; - LoadCurrentModesResult result; - const gchar *response; - GError *error = NULL; + GRegex *r; + GMatchInfo *match_info = NULL; + LoadCurrentModesResult *result; + const gchar *response; + GError *error = NULL; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - result.allowed = MM_MODEM_MODE_NONE; - result.preferred = MM_MODEM_MODE_NONE; + result = g_new0 (LoadCurrentModesResult, 1); + result->allowed = MM_MODEM_MODE_NONE; + result->preferred = MM_MODEM_MODE_NONE; /* Possible responses: * +WWSM: 0 (2G only) @@ -273,29 +267,29 @@ if (mm_get_uint_from_match_info (match_info, 1, &allowed)) { switch (allowed) { case 0: - result.allowed = MM_MODEM_MODE_2G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_2G; + result->preferred = MM_MODEM_MODE_NONE; break; case 1: - result.allowed = MM_MODEM_MODE_3G; - result.preferred = MM_MODEM_MODE_NONE; + result->allowed = MM_MODEM_MODE_3G; + result->preferred = MM_MODEM_MODE_NONE; break; case 2: { guint preferred = 0; - result.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + result->allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); /* 3, to avoid the comma */ if (mm_get_uint_from_match_info (match_info, 3, &preferred)) { switch (preferred) { case 0: - result.preferred = MM_MODEM_MODE_NONE; + result->preferred = MM_MODEM_MODE_NONE; break; case 1: - result.preferred = MM_MODEM_MODE_2G; + result->preferred = MM_MODEM_MODE_2G; break; case 2: - result.preferred = MM_MODEM_MODE_3G; + result->preferred = MM_MODEM_MODE_3G; break; default: g_warn_if_reached (); @@ -311,36 +305,34 @@ } } - if (result.allowed == MM_MODEM_MODE_NONE) - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unknown wireless data service reply: '%s'", - response); - else - g_simple_async_result_set_op_res_gpointer (simple, &result, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + if (result->allowed == MM_MODEM_MODE_NONE) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unknown wireless data service reply: '%s'", + response); + g_free (result); + } else + g_task_return_pointer (task, result, g_free); + g_object_unref (task); g_regex_unref (r); - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); } static void -current_ms_class_ready (MMBaseModem *self, +current_ms_class_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - LoadCurrentModesResult result; - const gchar *response; - GError *error = NULL; + LoadCurrentModesResult result; + const gchar *response; + GError *error = NULL; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -351,12 +343,12 @@ strlen (WAVECOM_MS_CLASS_A_IDSTR)) == 0) { mm_dbg ("Modem configured as a Class A mobile station"); /* For 3G devices, query WWSM status */ - mm_base_modem_at_command (MM_BASE_MODEM (self), + mm_base_modem_at_command (self, "+WWSM?", 3, FALSE, (GAsyncReadyCallback)wwsm_read_ready, - simple); + task); return; } @@ -384,101 +376,92 @@ } if (result.allowed == MM_MODEM_MODE_NONE) - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unknown mobile station class: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unknown mobile station class: '%s'", + response); else - g_simple_async_result_set_op_res_gpointer (simple, &result, NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -load_current_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CGCLASS?", 3, FALSE, (GAsyncReadyCallback)current_ms_class_ready, - result); + task); } /*****************************************************************************/ /* Set allowed modes (Modem interface) */ typedef struct { - MMBroadbandModemWavecom *self; - GSimpleAsyncResult *result; gchar *cgclass_command; gchar *wwsm_command; } SetCurrentModesContext; static void -set_current_modes_context_complete_and_free (SetCurrentModesContext *ctx) +set_current_modes_context_free (SetCurrentModesContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx->cgclass_command); g_free (ctx->wwsm_command); g_free (ctx); } static gboolean -set_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -wwsm_update_ready (MMBaseModem *self, +wwsm_update_ready (MMBaseModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + mm_base_modem_at_command_finish (self, res, &error); if (error) - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -cgclass_update_ready (MMBaseModem *self, +cgclass_update_ready (MMBaseModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { - GError *error = NULL; + SetCurrentModesContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); - set_current_modes_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!ctx->wwsm_command) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -487,24 +470,23 @@ 3, FALSE, (GAsyncReadyCallback)wwsm_update_ready, - ctx); + task); } static void -set_current_modes (MMIfaceModem *self, - MMModemMode allowed, - MMModemMode preferred, - GAsyncReadyCallback callback, - gpointer user_data) +set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; SetCurrentModesContext *ctx; + task = g_task_new (self, NULL, callback, user_data); + ctx = g_new0 (SetCurrentModesContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + g_task_set_task_data (task, ctx, (GDestroyNotify) set_current_modes_context_free); /* Handle ANY/NONE */ if (allowed == MM_MODEM_MODE_ANY && preferred == MM_MODEM_MODE_NONE) { @@ -545,17 +527,15 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - set_current_modes_context_complete_and_free (ctx); return; } @@ -564,34 +544,29 @@ 3, FALSE, (GAsyncReadyCallback)cgclass_update_ready, - ctx); + task); } /*****************************************************************************/ /* Load supported bands (Modem interface) */ static GArray * -load_supported_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - /* Never fails */ - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -load_supported_bands (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GArray *bands; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_bands); + task = g_task_new (self, NULL, callback, user_data); /* We do assume that we already know if the modem is 2G-only, 3G-only or * 2G+3G. This is checked quite before trying to load supported bands. */ @@ -604,16 +579,15 @@ /* Add 3G-specific bands */ if (mm_iface_modem_is_3g (self)) { bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), 10); - _g_array_insert_enum (bands, 0, MMModemBand, MM_MODEM_BAND_U2100); - _g_array_insert_enum (bands, 1, MMModemBand, MM_MODEM_BAND_U1800); - _g_array_insert_enum (bands, 2, MMModemBand, MM_MODEM_BAND_U17IV); - _g_array_insert_enum (bands, 3, MMModemBand, MM_MODEM_BAND_U800); - _g_array_insert_enum (bands, 4, MMModemBand, MM_MODEM_BAND_U850); - _g_array_insert_enum (bands, 5, MMModemBand, MM_MODEM_BAND_U900); - _g_array_insert_enum (bands, 6, MMModemBand, MM_MODEM_BAND_U900); - _g_array_insert_enum (bands, 7, MMModemBand, MM_MODEM_BAND_U17IX); - _g_array_insert_enum (bands, 8, MMModemBand, MM_MODEM_BAND_U1900); - _g_array_insert_enum (bands, 9, MMModemBand, MM_MODEM_BAND_U2600); + _g_array_insert_enum (bands, 0, MMModemBand, MM_MODEM_BAND_UTRAN_1); + _g_array_insert_enum (bands, 1, MMModemBand, MM_MODEM_BAND_UTRAN_2); + _g_array_insert_enum (bands, 2, MMModemBand, MM_MODEM_BAND_UTRAN_3); + _g_array_insert_enum (bands, 3, MMModemBand, MM_MODEM_BAND_UTRAN_4); + _g_array_insert_enum (bands, 4, MMModemBand, MM_MODEM_BAND_UTRAN_5); + _g_array_insert_enum (bands, 5, MMModemBand, MM_MODEM_BAND_UTRAN_6); + _g_array_insert_enum (bands, 6, MMModemBand, MM_MODEM_BAND_UTRAN_7); + _g_array_insert_enum (bands, 7, MMModemBand, MM_MODEM_BAND_UTRAN_8); + _g_array_insert_enum (bands, 8, MMModemBand, MM_MODEM_BAND_UTRAN_9); } /* Add 2G-specific bands */ else { @@ -624,44 +598,35 @@ _g_array_insert_enum (bands, 3, MMModemBand, MM_MODEM_BAND_G850); } - g_simple_async_result_set_op_res_gpointer (result, - bands, - (GDestroyNotify)g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, bands, (GDestroyNotify) g_array_unref); + g_object_unref (task); } /*****************************************************************************/ /* Load current bands (Modem interface) */ static GArray * -load_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -get_2g_band_ready (MMBroadbandModemWavecom *self, +get_2g_band_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; const gchar *p; - GError *error = NULL; - GArray *bands_array = NULL; + GError *error = NULL; + GArray *bands_array = NULL; response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -683,37 +648,31 @@ } if (!bands_array) - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse current bands reply: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse current bands reply: '%s'", + response); else - g_simple_async_result_set_op_res_gpointer (operation_result, - bands_array, - (GDestroyNotify)g_array_unref); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands_array, (GDestroyNotify)g_array_unref); + g_object_unref (task); } static void -get_3g_band_ready (MMBroadbandModemWavecom *self, +get_3g_band_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; const gchar *p; - GError *error = NULL; - GArray *bands_array = NULL; - guint32 wavecom_band; + GError *error = NULL; + GArray *bands_array = NULL; + guint32 wavecom_band; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -742,18 +701,14 @@ } if (!bands_array) - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse current bands reply: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse current bands reply: '%s'", + response); else - g_simple_async_result_set_op_res_gpointer (operation_result, - bands_array, - (GDestroyNotify)g_array_unref); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_pointer (task, bands_array, (GDestroyNotify)g_array_unref); + g_object_unref (task); } static void @@ -761,12 +716,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_bands); + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_3g (self)) mm_base_modem_at_command (MM_BASE_MODEM (self), @@ -774,54 +726,53 @@ 3, FALSE, (GAsyncReadyCallback)get_3g_band_ready, - result); + task); else mm_base_modem_at_command (MM_BASE_MODEM (self), "AT+WMBS?", 3, FALSE, (GAsyncReadyCallback)get_2g_band_ready, - result); + task); } /*****************************************************************************/ /* Set current_bands (Modem interface) */ static gboolean -set_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -wmbs_set_ready (MMBaseModem *self, +wmbs_set_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) - /* Let the error be critical */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -set_bands_3g (MMIfaceModem *self, - GArray *bands_array, - GSimpleAsyncResult *result) +set_bands_3g (GTask *task, + GArray *bands_array) { - GArray *bands_array_final; - guint wavecom_band = 0; - guint i; - gchar *bands_string; - gchar *cmd; + MMBroadbandModemWavecom *self; + GArray *bands_array_final; + guint wavecom_band = 0; + guint i; + gchar *bands_string; + gchar *cmd; + + self = g_task_get_source_object (task); /* The special case of ANY should be treated separately. */ if (bands_array->len == 1 && @@ -851,13 +802,12 @@ g_array_unref (bands_array_final); if (wavecom_band == 0) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "The given band combination is not supported: '%s'", - bands_string); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "The given band combination is not supported: '%s'", + bands_string); + g_object_unref (task); g_free (bands_string); return; } @@ -869,21 +819,23 @@ 3, FALSE, (GAsyncReadyCallback)wmbs_set_ready, - result); + task); g_free (cmd); g_free (bands_string); } static void -set_bands_2g (MMIfaceModem *self, - GArray *bands_array, - GSimpleAsyncResult *result) -{ - GArray *bands_array_final; - gchar wavecom_band = '\0'; - guint i; - gchar *bands_string; - gchar *cmd; +set_bands_2g (GTask *task, + GArray *bands_array) +{ + MMBroadbandModemWavecom *self; + GArray *bands_array_final; + gchar wavecom_band = '\0'; + guint i; + gchar *bands_string; + gchar *cmd; + + self = g_task_get_source_object (task); /* If the iface properly checked the given list against the supported bands, * it's not possible to get an array longer than 4 here. */ @@ -923,13 +875,12 @@ g_array_unref (bands_array_final); if (wavecom_band == '\0') { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "The given band combination is not supported: '%s'", - bands_string); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "The given band combination is not supported: '%s'", + bands_string); + g_object_unref (task); g_free (bands_string); return; } @@ -941,19 +892,19 @@ 3, FALSE, (GAsyncReadyCallback)wmbs_set_ready, - result); + task); g_free (cmd); g_free (bands_string); } static void -set_current_bands (MMIfaceModem *self, - GArray *bands_array, - GAsyncReadyCallback callback, - gpointer user_data) +set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* The bands that we get here are previously validated by the interface, and * that means that ALL the bands given here were also given in the list of @@ -961,15 +912,12 @@ * will end up being valid, as not all combinations are possible. E.g, * Wavecom modems supporting only 2G have specific combinations allowed. */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_bands); + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_3g (self)) - set_bands_3g (self, bands_array, result); + set_bands_3g (task, bands_array); else - set_bands_2g (self, bands_array, result); + set_bands_2g (task, bands_array); } /*****************************************************************************/ @@ -1050,65 +998,52 @@ /*****************************************************************************/ /* Register in network (3GPP interface) */ -typedef struct { - MMBroadbandModemWavecom *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; - gchar *operator_id; -} RegisterInNetworkContext; - -static void -register_in_network_context_complete_and_free (RegisterInNetworkContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_free (ctx->operator_id); - g_slice_free (RegisterInNetworkContext, ctx); -} - static gboolean -register_in_network_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +register_in_network_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - return !!mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_registration_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - RegisterInNetworkContext *ctx) + GAsyncResult *res, + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->register_in_network_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -run_parent_registration (RegisterInNetworkContext *ctx) +run_parent_registration (GTask *task) { + MMBroadbandModemWavecom *self; + const gchar *operator_id; + + self = g_task_get_source_object (task); + operator_id = g_task_get_task_data (task); + iface_modem_3gpp_parent->register_in_network ( - MM_IFACE_MODEM_3GPP (ctx->self), - ctx->operator_id, - ctx->cancellable, + MM_IFACE_MODEM_3GPP (self), + operator_id, + g_task_get_cancellable (task), (GAsyncReadyCallback)parent_registration_ready, - ctx); + task); } static gboolean parse_network_registration_mode (const gchar *reply, - guint *mode) + guint *mode) { - GRegex *r; + GRegex *r; GMatchInfo *match_info; - gboolean parsed = FALSE; + gboolean parsed = FALSE; g_assert (mode != NULL); @@ -1130,61 +1065,54 @@ } static void -cops_ready (MMBaseModem *self, +cops_ready (MMBaseModem *self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { const gchar *response; - GError *error = NULL; - guint mode; + GError *error = NULL; + guint mode; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!response) { - /* Let the error be critical. */ - g_simple_async_result_take_error (ctx->result, error); - register_in_network_context_complete_and_free (ctx); - return; - } + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response) + goto out; if (!parse_network_registration_mode (response, &mode)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse current network registration mode"); - register_in_network_context_complete_and_free (ctx); - return; + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse current network registration mode: '%s'", + response); + goto out; } - /* If the modem is already configured for automatic registration, don't do - * anything else */ - if (mode == 0) { - mm_dbg ("Device is already in automatic registration mode, not requesting it again"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + /* If the modem is not configured for automatic registration, run parent */ + if (mode != 0) { + run_parent_registration (task); return; } - /* Otherwise, run parent's implementation */ - run_parent_registration (ctx); + mm_dbg ("Device is already in automatic registration mode, not requesting it again"); + +out: + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -register_in_network (MMIfaceModem3gpp *self, - const gchar *operator_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - RegisterInNetworkContext *ctx; - - ctx = g_slice_new0 (RegisterInNetworkContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - register_in_network); - ctx->operator_id = g_strdup (operator_id); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; +register_in_network (MMIfaceModem3gpp *self, + const gchar *operator_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, cancellable, callback, user_data); + + /* Store operator id as task data */ + g_task_set_task_data (task, g_strdup (operator_id), g_free); /* If requesting automatic registration, we first need to query what the * current mode is. We must NOT send +COPS=0 if it already is in 0 mode, @@ -1196,74 +1124,45 @@ 3, FALSE, (GAsyncReadyCallback)cops_ready, - ctx); + task); return; } /* Otherwise, run parent's implementation right away */ - run_parent_registration (ctx); + run_parent_registration (task); } /*****************************************************************************/ /* After SIM unlock (Modem interface) */ static gboolean -modem_after_sim_unlock_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +modem_after_sim_unlock_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } static void -modem_after_sim_unlock (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_after_sim_unlock (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* A short wait is necessary for SIM to become ready, otherwise reloading * facility lock states may fail with a +CME ERROR: 515 error. */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); - - g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, result); -} - -/*****************************************************************************/ -/* Flow control (Modem interface) */ - -static gboolean -setup_flow_control_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); -} - -static void -setup_flow_control (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - /* Wavecom doesn't have XOFF/XON flow control, so we enable RTS/CTS */ - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+IFC=2,2", - 3, - FALSE, - callback, - user_data); + task = g_task_new (self, NULL, callback, user_data); + g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ @@ -1420,8 +1319,6 @@ iface->load_access_technologies_finish = load_access_technologies_finish; iface->modem_after_sim_unlock = modem_after_sim_unlock; iface->modem_after_sim_unlock_finish = modem_after_sim_unlock_finish; - iface->setup_flow_control = setup_flow_control; - iface->setup_flow_control_finish = setup_flow_control_finish; iface->modem_power_up = modem_power_up; iface->modem_power_up_finish = modem_power_up_finish; iface->modem_power_down = modem_power_down; diff -Nru modemmanager-1.6.8/plugins/wavecom/mm-plugin-wavecom.c modemmanager-1.10.0/plugins/wavecom/mm-plugin-wavecom.c --- modemmanager-1.6.8/plugins/wavecom/mm-plugin-wavecom.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/wavecom/mm-plugin-wavecom.c 2018-11-15 09:55:53.000000000 +0100 @@ -40,14 +40,14 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, GList *probes, GError **error) { - return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (uid, drivers, mm_plugin_get_name (self), vendor, diff -Nru modemmanager-1.6.8/plugins/x22x/77-mm-x22x-port-types.rules modemmanager-1.10.0/plugins/x22x/77-mm-x22x-port-types.rules --- modemmanager-1.6.8/plugins/x22x/77-mm-x22x-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/x22x/77-mm-x22x-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -8,9 +8,7 @@ # aux ports that may be either AT-capable or not but cannot be used for PPP. -ACTION!="add|change|move", GOTO="mm_x22x_port_types_end" -SUBSYSTEM!="tty", GOTO="mm_x22x_port_types_end" - +ACTION!="add|change|move|bind", GOTO="mm_x22x_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1bbb", GOTO="mm_x22x_generic_vendorcheck" SUBSYSTEMS=="usb", ATTRS{idVendor}=="0b3c", GOTO="mm_x22x_olivetti_vendorcheck" GOTO="mm_x22x_port_types_end" @@ -21,25 +19,25 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # Alcatel X200 -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_X22X_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0000", ENV{ID_MM_X22X_TAGGED}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_X22X_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="0017", ENV{ID_MM_X22X_TAGGED}="1" # Archos G9 -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_X22X_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_X22X_PORT_TYPE_NMEA}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_X22X_PORT_TYPE_VOICE}="1" -ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="00B7", ENV{ID_MM_X22X_TAGGED}="1" GOTO="mm_x22x_port_types_end" @@ -50,12 +48,12 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" # Olicard 200 -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_X22X_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" -ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_X22X_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" +ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" ATTRS{idVendor}=="0b3c", ATTRS{idProduct}=="c005", ENV{ID_MM_X22X_TAGGED}="1" GOTO="mm_x22x_port_types_end" diff -Nru modemmanager-1.6.8/plugins/x22x/mm-broadband-modem-x22x.c modemmanager-1.10.0/plugins/x22x/mm-broadband-modem-x22x.c --- modemmanager-1.6.8/plugins/x22x/mm-broadband-modem-x22x.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/x22x/mm-broadband-modem-x22x.c 2018-11-15 09:55:53.000000000 +0100 @@ -46,16 +46,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -65,9 +62,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Build list of combinations for 3GPP devices */ @@ -91,9 +87,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -105,10 +100,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -201,24 +193,24 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemX22x *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -228,14 +220,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint syssel = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) syssel = 1; @@ -253,18 +242,16 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -275,7 +262,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } diff -Nru modemmanager-1.6.8/plugins/x22x/mm-plugin-x22x.c modemmanager-1.10.0/plugins/x22x/mm-plugin-x22x.c --- modemmanager-1.6.8/plugins/x22x/mm-plugin-x22x.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/x22x/mm-plugin-x22x.c 2019-01-15 15:57:35.000000000 +0100 @@ -39,40 +39,31 @@ /* Custom init */ typedef struct { - MMPortProbe *probe; MMPortSerialAt *port; - GCancellable *cancellable; - GSimpleAsyncResult *result; guint retries; } X22xCustomInitContext; static void -x22x_custom_init_context_complete_and_free (X22xCustomInitContext *ctx) +x22x_custom_init_context_free (X22xCustomInitContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->port); - g_object_unref (ctx->probe); - g_object_unref (ctx->result); g_slice_free (X22xCustomInitContext, ctx); } static gboolean x22x_custom_init_finish (MMPortProbe *probe, - GAsyncResult *result, - GError **error) + GAsyncResult *result, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } -static void x22x_custom_init_step (X22xCustomInitContext *ctx); +static void x22x_custom_init_step (GTask *task); static void gmr_ready (MMPortSerialAt *port, GAsyncResult *res, - X22xCustomInitContext *ctx) + GTask *task) { const gchar *p; const gchar *response; @@ -80,9 +71,10 @@ response = mm_port_serial_at_command_finish (port, res, &error); if (error) { + g_error_free (error); /* Just retry... */ - x22x_custom_init_step (ctx); - goto out; + x22x_custom_init_step (task); + return; } /* Note the lack of a ':' on the GMR; the X200 doesn't send one */ @@ -93,42 +85,43 @@ * So use that to determine if the device is an X200, which this plugin * does supports. */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Not supported with the X22X plugin"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Not supported with the X22X plugin"); } else { mm_dbg ("(X22X) device is supported by this plugin"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } - - x22x_custom_init_context_complete_and_free (ctx); - -out: - if (error) - g_error_free (error); + g_object_unref (task); } static void -x22x_custom_init_step (X22xCustomInitContext *ctx) +x22x_custom_init_step (GTask *task) { + X22xCustomInitContext *ctx; + GCancellable *cancellable; + + ctx = g_task_get_task_data (task); + cancellable = g_task_get_cancellable (task); + /* If cancelled, end */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { + if (g_cancellable_is_cancelled (cancellable)) { mm_dbg ("(X22X) no need to keep on running custom init in (%s)", mm_port_get_device (MM_PORT (ctx->port))); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - x22x_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } if (ctx->retries == 0) { /* In this case, we need the AT command result to decide whether we can * support this modem or not, so really fail if we didn't get it. */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get device revision information"); - x22x_custom_init_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get device revision information"); + g_object_unref (task); return; } @@ -139,9 +132,9 @@ 3, FALSE, /* raw */ FALSE, /* allow_cached */ - ctx->cancellable, + cancellable, (GAsyncReadyCallback)gmr_ready, - ctx); + task); } static void @@ -153,17 +146,16 @@ { MMDevice *device; X22xCustomInitContext *ctx; + GTask *task; ctx = g_slice_new (X22xCustomInitContext); - ctx->result = g_simple_async_result_new (G_OBJECT (probe), - callback, - user_data, - x22x_custom_init); - ctx->probe = g_object_ref (probe); ctx->port = g_object_ref (port); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; ctx->retries = 3; + task = g_task_new (probe, cancellable, callback, user_data); + g_task_set_check_cancellable (task, FALSE); + g_task_set_task_data (task, ctx, (GDestroyNotify)x22x_custom_init_context_free); + /* TCT/Alcatel in their infinite wisdom assigned the same USB VID/PID to * the x060s (Longcheer firmware) and the x200 (X22X, this plugin) and thus * we can't tell them apart via udev rules. Worse, they both report the @@ -177,19 +169,19 @@ if (mm_device_get_vendor (device) != 0x1bbb || mm_device_get_product (device) != 0x0000) { /* If not exactly this vendor/product, just skip */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - x22x_custom_init_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - x22x_custom_init_step (ctx); + x22x_custom_init_step (task); } /*****************************************************************************/ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -199,7 +191,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered X22X modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -207,59 +199,13 @@ } #endif - return MM_BASE_MODEM (mm_broadband_modem_x22x_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_x22x_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - MMPortType ptype; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; - - port = mm_port_probe_peek_port (probe); - ptype = mm_port_probe_get_port_type (probe); - - if (ptype == MM_PORT_TYPE_AT) { - /* Look for port type hints; just probing can't distinguish which port should - * be the data/primary port on these devices. We have to tag them based on - * what the Windows .INF files say the port layout should be. - */ - if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_MODEM")) { - mm_dbg ("x22x: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_AUX")) { - mm_dbg ("x22x: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } else { - /* If the port was tagged by the udev rules but isn't a primary or secondary, - * then ignore it to guard against race conditions if a device just happens - * to show up with more than two AT-capable ports. - */ - ptype = MM_PORT_TYPE_IGNORED; - } - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), - ptype, - pflags, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -301,5 +247,4 @@ MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff -Nru modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-mbim-xmm.c modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-mbim-xmm.c --- modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-mbim-xmm.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-mbim-xmm.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,134 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include +#include +#include +#include +#include + +#include "ModemManager.h" +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-location.h" +#include "mm-broadband-modem-mbim-xmm.h" +#include "mm-shared-xmm.h" + +static void iface_modem_init (MMIfaceModem *iface); +static void iface_modem_location_init (MMIfaceModemLocation *iface); +static void shared_xmm_init (MMSharedXmm *iface); + +static MMIfaceModemLocation *iface_modem_location_parent; + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemMbimXmm, mm_broadband_modem_mbim_xmm, MM_TYPE_BROADBAND_MODEM_MBIM, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_XMM, shared_xmm_init)) + +/*****************************************************************************/ + +MMBroadbandModemMbimXmm * +mm_broadband_modem_mbim_xmm_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_MBIM_XMM, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, TRUE, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, FALSE, + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, TRUE, + NULL); +} + +static void +mm_broadband_modem_mbim_xmm_init (MMBroadbandModemMbimXmm *self) +{ +} + +static void +iface_modem_init (MMIfaceModem *iface) +{ + iface->load_supported_modes = mm_shared_xmm_load_supported_modes; + iface->load_supported_modes_finish = mm_shared_xmm_load_supported_modes_finish; + iface->load_current_modes = mm_shared_xmm_load_current_modes; + iface->load_current_modes_finish = mm_shared_xmm_load_current_modes_finish; + iface->set_current_modes = mm_shared_xmm_set_current_modes; + iface->set_current_modes_finish = mm_shared_xmm_set_current_modes_finish; + + iface->load_supported_bands = mm_shared_xmm_load_supported_bands; + iface->load_supported_bands_finish = mm_shared_xmm_load_supported_bands_finish; + iface->load_current_bands = mm_shared_xmm_load_current_bands; + iface->load_current_bands_finish = mm_shared_xmm_load_current_bands_finish; + iface->set_current_bands = mm_shared_xmm_set_current_bands; + iface->set_current_bands_finish = mm_shared_xmm_set_current_bands_finish; + + /* power up/down already managed via MBIM */ + iface->modem_power_off = mm_shared_xmm_power_off; + iface->modem_power_off_finish = mm_shared_xmm_power_off_finish; + iface->reset = mm_shared_xmm_reset; + iface->reset_finish = mm_shared_xmm_reset_finish; +} + +static void +iface_modem_location_init (MMIfaceModemLocation *iface) +{ + iface_modem_location_parent = g_type_interface_peek_parent (iface); + + iface->load_capabilities = mm_shared_xmm_location_load_capabilities; + iface->load_capabilities_finish = mm_shared_xmm_location_load_capabilities_finish; + iface->enable_location_gathering = mm_shared_xmm_enable_location_gathering; + iface->enable_location_gathering_finish = mm_shared_xmm_enable_location_gathering_finish; + iface->disable_location_gathering = mm_shared_xmm_disable_location_gathering; + iface->disable_location_gathering_finish = mm_shared_xmm_disable_location_gathering_finish; + iface->load_supl_server = mm_shared_xmm_location_load_supl_server; + iface->load_supl_server_finish = mm_shared_xmm_location_load_supl_server_finish; + iface->set_supl_server = mm_shared_xmm_location_set_supl_server; + iface->set_supl_server_finish = mm_shared_xmm_location_set_supl_server_finish; +} + +static MMBroadbandModemClass * +peek_parent_broadband_modem_class (MMSharedXmm *self) +{ + return MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_mbim_xmm_parent_class); +} + +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedXmm *self) +{ + return iface_modem_location_parent; +} + +static void +shared_xmm_init (MMSharedXmm *iface) +{ + iface->peek_parent_broadband_modem_class = peek_parent_broadband_modem_class; + iface->peek_parent_location_interface = peek_parent_location_interface; +} + +static void +mm_broadband_modem_mbim_xmm_class_init (MMBroadbandModemMbimXmmClass *klass) +{ + MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass); + + broadband_modem_class->setup_ports = mm_shared_xmm_setup_ports; +} diff -Nru modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-mbim-xmm.h modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-mbim-xmm.h --- modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-mbim-xmm.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-mbim-xmm.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_MBIM_XMM_H +#define MM_BROADBAND_MODEM_MBIM_XMM_H + +#include "mm-broadband-modem-mbim.h" + +#define MM_TYPE_BROADBAND_MODEM_MBIM_XMM (mm_broadband_modem_mbim_xmm_get_type ()) +#define MM_BROADBAND_MODEM_MBIM_XMM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_XMM, MMBroadbandModemMbimXmm)) +#define MM_BROADBAND_MODEM_MBIM_XMM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_MBIM_XMM, MMBroadbandModemMbimXmmClass)) +#define MM_IS_BROADBAND_MODEM_MBIM_XMM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_XMM)) +#define MM_IS_BROADBAND_MODEM_MBIM_XMM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_MBIM_XMM)) +#define MM_BROADBAND_MODEM_MBIM_XMM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_MBIM_XMM, MMBroadbandModemMbimXmmClass)) + +typedef struct _MMBroadbandModemMbimXmm MMBroadbandModemMbimXmm; +typedef struct _MMBroadbandModemMbimXmmClass MMBroadbandModemMbimXmmClass; + +struct _MMBroadbandModemMbimXmm { + MMBroadbandModemMbim parent; +}; + +struct _MMBroadbandModemMbimXmmClass{ + MMBroadbandModemMbimClass parent; +}; + +GType mm_broadband_modem_mbim_xmm_get_type (void); + +MMBroadbandModemMbimXmm *mm_broadband_modem_mbim_xmm_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_XMM_H */ diff -Nru modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-xmm.c modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-xmm.c --- modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-xmm.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-xmm.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,149 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include +#include +#include +#include +#include + +#include "ModemManager.h" +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-location.h" +#include "mm-broadband-modem-xmm.h" +#include "mm-shared-xmm.h" + + +static void iface_modem_init (MMIfaceModem *iface); +static void shared_xmm_init (MMSharedXmm *iface); +static void iface_modem_signal_init (MMIfaceModemSignal *iface); +static void iface_modem_location_init (MMIfaceModemLocation *iface); + +static MMIfaceModemLocation *iface_modem_location_parent; + +G_DEFINE_TYPE_EXTENDED (MMBroadbandModemXmm, mm_broadband_modem_xmm, MM_TYPE_BROADBAND_MODEM, 0, + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIGNAL, iface_modem_signal_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_XMM, shared_xmm_init)) + +/*****************************************************************************/ + +MMBroadbandModemXmm * +mm_broadband_modem_xmm_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_XMM, + MM_BASE_MODEM_DEVICE, device, + MM_BASE_MODEM_DRIVERS, drivers, + MM_BASE_MODEM_PLUGIN, plugin, + MM_BASE_MODEM_VENDOR_ID, vendor_id, + MM_BASE_MODEM_PRODUCT_ID, product_id, + NULL); +} + +static void +mm_broadband_modem_xmm_init (MMBroadbandModemXmm *self) +{ +} + +static void +iface_modem_init (MMIfaceModem *iface) +{ + iface->load_supported_modes = mm_shared_xmm_load_supported_modes; + iface->load_supported_modes_finish = mm_shared_xmm_load_supported_modes_finish; + iface->load_current_modes = mm_shared_xmm_load_current_modes; + iface->load_current_modes_finish = mm_shared_xmm_load_current_modes_finish; + iface->set_current_modes = mm_shared_xmm_set_current_modes; + iface->set_current_modes_finish = mm_shared_xmm_set_current_modes_finish; + + iface->load_supported_bands = mm_shared_xmm_load_supported_bands; + iface->load_supported_bands_finish = mm_shared_xmm_load_supported_bands_finish; + iface->load_current_bands = mm_shared_xmm_load_current_bands; + iface->load_current_bands_finish = mm_shared_xmm_load_current_bands_finish; + iface->set_current_bands = mm_shared_xmm_set_current_bands; + iface->set_current_bands_finish = mm_shared_xmm_set_current_bands_finish; + + iface->load_power_state = mm_shared_xmm_load_power_state; + iface->load_power_state_finish = mm_shared_xmm_load_power_state_finish; + iface->modem_power_up = mm_shared_xmm_power_up; + iface->modem_power_up_finish = mm_shared_xmm_power_up_finish; + iface->modem_power_down = mm_shared_xmm_power_down; + iface->modem_power_down_finish = mm_shared_xmm_power_down_finish; + iface->modem_power_off = mm_shared_xmm_power_off; + iface->modem_power_off_finish = mm_shared_xmm_power_off_finish; + iface->reset = mm_shared_xmm_reset; + iface->reset_finish = mm_shared_xmm_reset_finish; +} + + +static void +iface_modem_location_init (MMIfaceModemLocation *iface) +{ + iface_modem_location_parent = g_type_interface_peek_parent (iface); + + iface->load_capabilities = mm_shared_xmm_location_load_capabilities; + iface->load_capabilities_finish = mm_shared_xmm_location_load_capabilities_finish; + iface->enable_location_gathering = mm_shared_xmm_enable_location_gathering; + iface->enable_location_gathering_finish = mm_shared_xmm_enable_location_gathering_finish; + iface->disable_location_gathering = mm_shared_xmm_disable_location_gathering; + iface->disable_location_gathering_finish = mm_shared_xmm_disable_location_gathering_finish; + iface->load_supl_server = mm_shared_xmm_location_load_supl_server; + iface->load_supl_server_finish = mm_shared_xmm_location_load_supl_server_finish; + iface->set_supl_server = mm_shared_xmm_location_set_supl_server; + iface->set_supl_server_finish = mm_shared_xmm_location_set_supl_server_finish; +} + +static MMBroadbandModemClass * +peek_parent_broadband_modem_class (MMSharedXmm *self) +{ + return MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_xmm_parent_class); +} + +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedXmm *self) +{ + return iface_modem_location_parent; +} + +static void +iface_modem_signal_init (MMIfaceModemSignal *iface) +{ + iface->check_support = mm_shared_xmm_signal_check_support; + iface->check_support_finish = mm_shared_xmm_signal_check_support_finish; + iface->load_values = mm_shared_xmm_signal_load_values; + iface->load_values_finish = mm_shared_xmm_signal_load_values_finish; +} + +static void +shared_xmm_init (MMSharedXmm *iface) +{ + iface->peek_parent_broadband_modem_class = peek_parent_broadband_modem_class; + iface->peek_parent_location_interface = peek_parent_location_interface; +} + +static void +mm_broadband_modem_xmm_class_init (MMBroadbandModemXmmClass *klass) +{ + MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass); + + broadband_modem_class->setup_ports = mm_shared_xmm_setup_ports; +} diff -Nru modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-xmm.h modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-xmm.h --- modemmanager-1.6.8/plugins/xmm/mm-broadband-modem-xmm.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-broadband-modem-xmm.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_BROADBAND_MODEM_XMM_H +#define MM_BROADBAND_MODEM_XMM_H + +#include "mm-broadband-modem.h" + +#define MM_TYPE_BROADBAND_MODEM_XMM (mm_broadband_modem_xmm_get_type ()) +#define MM_BROADBAND_MODEM_XMM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_XMM, MMBroadbandModemXmm)) +#define MM_BROADBAND_MODEM_XMM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_XMM, MMBroadbandModemXmmClass)) +#define MM_IS_BROADBAND_MODEM_XMM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_XMM)) +#define MM_IS_BROADBAND_MODEM_XMM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_XMM)) +#define MM_BROADBAND_MODEM_XMM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_XMM, MMBroadbandModemXmmClass)) + +typedef struct _MMBroadbandModemXmm MMBroadbandModemXmm; +typedef struct _MMBroadbandModemXmmClass MMBroadbandModemXmmClass; + +struct _MMBroadbandModemXmm { + MMBroadbandModem parent; +}; + +struct _MMBroadbandModemXmmClass{ + MMBroadbandModemClass parent; +}; + +GType mm_broadband_modem_xmm_get_type (void); + +MMBroadbandModemXmm *mm_broadband_modem_xmm_new (const gchar *device, + const gchar **drivers, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_XMM_H */ diff -Nru modemmanager-1.6.8/plugins/xmm/mm-modem-helpers-xmm.c modemmanager-1.10.0/plugins/xmm/mm-modem-helpers-xmm.c --- modemmanager-1.6.8/plugins/xmm/mm-modem-helpers-xmm.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-modem-helpers-xmm.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1009 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-xmm.h" +#include "mm-signal.h" + +/*****************************************************************************/ +/* XACT common config */ + +typedef struct { + guint num; + MMModemBand band; +} XactBandConfig; + +static const XactBandConfig xact_band_config[] = { + /* GSM bands */ + { .num = 900, .band = MM_MODEM_BAND_EGSM }, + { .num = 1800, .band = MM_MODEM_BAND_DCS }, + { .num = 1900, .band = MM_MODEM_BAND_PCS }, + { .num = 850, .band = MM_MODEM_BAND_G850 }, + { .num = 450, .band = MM_MODEM_BAND_G450 }, + { .num = 480, .band = MM_MODEM_BAND_G480 }, + { .num = 750, .band = MM_MODEM_BAND_G750 }, + { .num = 380, .band = MM_MODEM_BAND_G380 }, + { .num = 410, .band = MM_MODEM_BAND_G410 }, + { .num = 710, .band = MM_MODEM_BAND_G710 }, + { .num = 810, .band = MM_MODEM_BAND_G810 }, + /* UMTS bands */ + { .num = 1, .band = MM_MODEM_BAND_UTRAN_1 }, + { .num = 2, .band = MM_MODEM_BAND_UTRAN_2 }, + { .num = 3, .band = MM_MODEM_BAND_UTRAN_3 }, + { .num = 4, .band = MM_MODEM_BAND_UTRAN_4 }, + { .num = 5, .band = MM_MODEM_BAND_UTRAN_5 }, + { .num = 6, .band = MM_MODEM_BAND_UTRAN_6 }, + { .num = 7, .band = MM_MODEM_BAND_UTRAN_7 }, + { .num = 8, .band = MM_MODEM_BAND_UTRAN_8 }, + { .num = 9, .band = MM_MODEM_BAND_UTRAN_9 }, + { .num = 10, .band = MM_MODEM_BAND_UTRAN_10 }, + { .num = 11, .band = MM_MODEM_BAND_UTRAN_11 }, + { .num = 12, .band = MM_MODEM_BAND_UTRAN_12 }, + { .num = 13, .band = MM_MODEM_BAND_UTRAN_13 }, + { .num = 14, .band = MM_MODEM_BAND_UTRAN_14 }, + { .num = 19, .band = MM_MODEM_BAND_UTRAN_19 }, + { .num = 20, .band = MM_MODEM_BAND_UTRAN_20 }, + { .num = 21, .band = MM_MODEM_BAND_UTRAN_21 }, + { .num = 22, .band = MM_MODEM_BAND_UTRAN_22 }, + { .num = 25, .band = MM_MODEM_BAND_UTRAN_25 }, + /* LTE bands */ + { .num = 101, .band = MM_MODEM_BAND_EUTRAN_1 }, + { .num = 102, .band = MM_MODEM_BAND_EUTRAN_2 }, + { .num = 103, .band = MM_MODEM_BAND_EUTRAN_3 }, + { .num = 104, .band = MM_MODEM_BAND_EUTRAN_4 }, + { .num = 105, .band = MM_MODEM_BAND_EUTRAN_5 }, + { .num = 106, .band = MM_MODEM_BAND_EUTRAN_6 }, + { .num = 107, .band = MM_MODEM_BAND_EUTRAN_7 }, + { .num = 108, .band = MM_MODEM_BAND_EUTRAN_8 }, + { .num = 109, .band = MM_MODEM_BAND_EUTRAN_9 }, + { .num = 110, .band = MM_MODEM_BAND_EUTRAN_10 }, + { .num = 111, .band = MM_MODEM_BAND_EUTRAN_11 }, + { .num = 112, .band = MM_MODEM_BAND_EUTRAN_12 }, + { .num = 113, .band = MM_MODEM_BAND_EUTRAN_13 }, + { .num = 114, .band = MM_MODEM_BAND_EUTRAN_14 }, + { .num = 117, .band = MM_MODEM_BAND_EUTRAN_17 }, + { .num = 118, .band = MM_MODEM_BAND_EUTRAN_18 }, + { .num = 119, .band = MM_MODEM_BAND_EUTRAN_19 }, + { .num = 120, .band = MM_MODEM_BAND_EUTRAN_20 }, + { .num = 121, .band = MM_MODEM_BAND_EUTRAN_21 }, + { .num = 122, .band = MM_MODEM_BAND_EUTRAN_22 }, + { .num = 123, .band = MM_MODEM_BAND_EUTRAN_23 }, + { .num = 124, .band = MM_MODEM_BAND_EUTRAN_24 }, + { .num = 125, .band = MM_MODEM_BAND_EUTRAN_25 }, + { .num = 126, .band = MM_MODEM_BAND_EUTRAN_26 }, + { .num = 127, .band = MM_MODEM_BAND_EUTRAN_27 }, + { .num = 128, .band = MM_MODEM_BAND_EUTRAN_28 }, + { .num = 129, .band = MM_MODEM_BAND_EUTRAN_29 }, + { .num = 130, .band = MM_MODEM_BAND_EUTRAN_30 }, + { .num = 131, .band = MM_MODEM_BAND_EUTRAN_31 }, + { .num = 132, .band = MM_MODEM_BAND_EUTRAN_32 }, + { .num = 133, .band = MM_MODEM_BAND_EUTRAN_33 }, + { .num = 134, .band = MM_MODEM_BAND_EUTRAN_34 }, + { .num = 135, .band = MM_MODEM_BAND_EUTRAN_35 }, + { .num = 136, .band = MM_MODEM_BAND_EUTRAN_36 }, + { .num = 137, .band = MM_MODEM_BAND_EUTRAN_37 }, + { .num = 138, .band = MM_MODEM_BAND_EUTRAN_38 }, + { .num = 139, .band = MM_MODEM_BAND_EUTRAN_39 }, + { .num = 140, .band = MM_MODEM_BAND_EUTRAN_40 }, + { .num = 141, .band = MM_MODEM_BAND_EUTRAN_41 }, + { .num = 142, .band = MM_MODEM_BAND_EUTRAN_42 }, + { .num = 143, .band = MM_MODEM_BAND_EUTRAN_43 }, + { .num = 144, .band = MM_MODEM_BAND_EUTRAN_44 }, + { .num = 145, .band = MM_MODEM_BAND_EUTRAN_45 }, + { .num = 146, .band = MM_MODEM_BAND_EUTRAN_46 }, + { .num = 147, .band = MM_MODEM_BAND_EUTRAN_47 }, + { .num = 148, .band = MM_MODEM_BAND_EUTRAN_48 }, + { .num = 149, .band = MM_MODEM_BAND_EUTRAN_49 }, + { .num = 150, .band = MM_MODEM_BAND_EUTRAN_50 }, + { .num = 151, .band = MM_MODEM_BAND_EUTRAN_51 }, + { .num = 152, .band = MM_MODEM_BAND_EUTRAN_52 }, + { .num = 153, .band = MM_MODEM_BAND_EUTRAN_53 }, + { .num = 154, .band = MM_MODEM_BAND_EUTRAN_54 }, + { .num = 155, .band = MM_MODEM_BAND_EUTRAN_55 }, + { .num = 156, .band = MM_MODEM_BAND_EUTRAN_56 }, + { .num = 157, .band = MM_MODEM_BAND_EUTRAN_57 }, + { .num = 158, .band = MM_MODEM_BAND_EUTRAN_58 }, + { .num = 159, .band = MM_MODEM_BAND_EUTRAN_59 }, + { .num = 160, .band = MM_MODEM_BAND_EUTRAN_60 }, + { .num = 161, .band = MM_MODEM_BAND_EUTRAN_61 }, + { .num = 162, .band = MM_MODEM_BAND_EUTRAN_62 }, + { .num = 163, .band = MM_MODEM_BAND_EUTRAN_63 }, + { .num = 164, .band = MM_MODEM_BAND_EUTRAN_64 }, + { .num = 165, .band = MM_MODEM_BAND_EUTRAN_65 }, + { .num = 166, .band = MM_MODEM_BAND_EUTRAN_66 }, +}; + +#define XACT_NUM_IS_BAND_2G(num) (num > 300) +#define XACT_NUM_IS_BAND_3G(num) (num < 100) +#define XACT_NUM_IS_BAND_4G(num) (num > 100 && num < 300) + +static MMModemBand +xact_num_to_band (guint num) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xact_band_config); i++) { + if (num == xact_band_config[i].num) + return xact_band_config[i].band; + } + return MM_MODEM_BAND_UNKNOWN; +} + +static guint +xact_band_to_num (MMModemBand band) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xact_band_config); i++) { + if (band == xact_band_config[i].band) + return xact_band_config[i].num; + } + return 0; +} + +/*****************************************************************************/ +/* XACT=? response parser */ + +/* Index of the array is the XMM-specific value */ +static const MMModemMode xmm_modes[] = { + ( MM_MODEM_MODE_2G ), + ( MM_MODEM_MODE_3G ), + ( MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_3G ), + ( MM_MODEM_MODE_3G | MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_4G ), + ( MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G ), +}; + +gboolean +mm_xmm_parse_xact_test_response (const gchar *response, + GArray **modes_out, + GArray **bands_out, + GError **error) +{ + GError *inner_error = NULL; + GArray *modes = NULL; + GArray *all_modes = NULL; + GArray *filtered = NULL; + GArray *supported = NULL; + GArray *preferred = NULL; + GArray *bands = NULL; + gchar **split = NULL; + guint i; + + MMModemModeCombination all = { + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE + }; + + g_assert (modes_out && bands_out); + + /* + * AT+XACT=? + * +XACT: (0-6),(0-2),0,1,2,4,5,8,101,102,103,104,105,107,108,111,... + */ + response = mm_strip_tag (response, "+XACT:"); + split = mm_split_string_groups (response); + + if (g_strv_length (split) < 3) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing fields"); + goto out; + } + + /* First group is list of supported modes */ + supported = mm_parse_uint_list (split[0], &inner_error); + if (inner_error) + goto out; + if (!supported) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing modes"); + goto out; + } + + /* Second group is list of possible preferred modes. + * For our purposes, the preferred list may be empty */ + preferred = mm_parse_uint_list (split[1], &inner_error); + if (inner_error) + goto out; + + /* Build array of modes */ + modes = g_array_new (FALSE, FALSE, sizeof (MMModemModeCombination)); + + for (i = 0; i < supported->len; i++) { + guint supported_value; + MMModemModeCombination combination; + guint j; + + supported_value = g_array_index (supported, guint, i); + + if (supported_value >= G_N_ELEMENTS (xmm_modes)) { + mm_warn ("Unexpected AcT supported value: %u", supported_value); + continue; + } + + /* Combination without any preferred */ + combination.allowed = xmm_modes[supported_value]; + combination.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (modes, combination); + + if (mm_count_bits_set (combination.allowed) == 1) + continue; + + if (!preferred) + continue; + + for (j = 0; j < preferred->len; j++) { + guint preferred_value; + + preferred_value = g_array_index (preferred, guint, j); + if (preferred_value >= G_N_ELEMENTS (xmm_modes)) { + mm_warn ("Unexpected AcT preferred value: %u", preferred_value); + continue; + } + combination.preferred = xmm_modes[preferred_value]; + if (mm_count_bits_set (combination.preferred) != 1) { + mm_warn ("AcT preferred value should be a single AcT: %u", preferred_value); + continue; + } + if (!(combination.allowed & combination.preferred)) + continue; + g_array_append_val (modes, combination); + } + } + + if (modes->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No modes list built from +XACT=? response"); + goto out; + } + + /* Build array of bands */ + bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); + + /* + * The next element at index 2 may be '0'. We will just treat that field as + * any other band field as '0' isn't a supported band, we'll just ignore it. + */ + for (i = 2; split[i]; i++) { + MMModemBand band; + guint num; + + if (!mm_get_uint_from_str (split[i], &num)) { + mm_warn ("Unexpected band value: %s", split[i]); + continue; + } + + if (num == 0) + continue; + + band = xact_num_to_band (num); + if (band == MM_MODEM_BAND_UNKNOWN) { + mm_warn ("Unsupported band value: %s", split[i]); + continue; + } + + g_array_append_val (bands, band); + + if (XACT_NUM_IS_BAND_2G (num)) + all.allowed |= MM_MODEM_MODE_2G; + if (XACT_NUM_IS_BAND_3G (num)) + all.allowed |= MM_MODEM_MODE_3G; + if (XACT_NUM_IS_BAND_4G (num)) + all.allowed |= MM_MODEM_MODE_4G; + } + + if (bands->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No bands list built from +XACT=? response"); + goto out; + } + + /* AT+XACT lies about the supported modes, e.g. it may report 2G supported + * for 3G+4G only devices. So, filter out unsupported modes based on the + * supported bands */ + all_modes = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); + g_array_append_val (all_modes, all); + + filtered = mm_filter_supported_modes (all_modes, modes); + if (!filtered || filtered->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Empty supported mode list after frequency band filtering"); + goto out; + } + + /* success */ + +out: + if (modes) + g_array_unref (modes); + if (all_modes) + g_array_unref (all_modes); + if (supported) + g_array_unref (supported); + if (preferred) + g_array_unref (preferred); + g_strfreev (split); + + if (inner_error) { + if (filtered) + g_array_unref (filtered); + if (bands) + g_array_unref (bands); + g_propagate_error (error, inner_error); + return FALSE; + } + + g_assert (filtered); + *modes_out = filtered; + g_assert (bands); + *bands_out = bands; + return TRUE; +} + +/*****************************************************************************/ +/* AT+XACT? response parser */ + +gboolean +mm_xmm_parse_xact_query_response (const gchar *response, + MMModemModeCombination *mode_out, + GArray **bands_out, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + GArray *bands = NULL; + guint i; + + MMModemModeCombination mode = { + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + }; + + /* At least one */ + g_assert (mode_out || bands_out); + + /* + * AT+XACT? + * +XACT: 4,1,2,1,2,4,5,8,101,102,103,104,105,107,108,111,... + * + * Note: the first 3 fields corresponde to allowed and preferred modes. Only the + * first one of those 3 first fields is mandatory, the other two may be empty. + */ + r = g_regex_new ("\\+XACT: (\\d+),([^,]*),([^,]*),(.*)(?:\\r\\n)?", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + if (mode_out) { + guint xmm_mode; + + /* Number at index 1 */ + mm_get_uint_from_match_info (match_info, 1, &xmm_mode); + if (xmm_mode >= G_N_ELEMENTS (xmm_modes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Unsupported XACT AcT value: %u", xmm_mode); + goto out; + } + mode.allowed = xmm_modes[xmm_mode]; + + /* Number at index 2 */ + if (mm_count_bits_set (mode.allowed) > 1 && mm_get_uint_from_match_info (match_info, 2, &xmm_mode)) { + if (xmm_mode >= G_N_ELEMENTS (xmm_modes)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Unsupported XACT preferred AcT value: %u", xmm_mode); + goto out; + } + mode.preferred = xmm_modes[xmm_mode]; + } + + /* Number at index 3: ignored */ + } + + if (bands_out) { + gchar *bandstr; + GArray *nums; + + /* Bands start at index 4 */ + bandstr = mm_get_string_unquoted_from_match_info (match_info, 4); + nums = mm_parse_uint_list (bandstr, &inner_error); + g_free (bandstr); + + if (inner_error) + goto out; + if (!nums) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Invalid XACT? response"); + goto out; + } + + bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), nums->len); + for (i = 0; i < nums->len; i++) { + MMModemBand band; + + band = xact_num_to_band (g_array_index (nums, guint, i)); + if (band != MM_MODEM_BAND_UNKNOWN) + g_array_append_val (bands, band); + } + g_array_unref (nums); + + if (bands->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing current band list"); + goto out; + } + } + } + + /* success */ + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + if (bands) + g_array_unref (bands); + g_propagate_error (error, inner_error); + return FALSE; + } + + if (mode_out) { + g_assert (mode.allowed != MM_MODEM_MODE_NONE); + mode_out->allowed = mode.allowed; + mode_out->preferred = mode.preferred; + } + + if (bands_out) { + g_assert (bands); + *bands_out = bands; + } + + return TRUE; +} + +/*****************************************************************************/ +/* AT+XACT=X command builder */ + +static gboolean +append_rat_value (GString *str, + MMModemMode mode, + GError **error) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xmm_modes); i++) { + if (xmm_modes[i] == mode) { + g_string_append_printf (str, "%u", i); + return TRUE; + } + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No AcT value matches requested mode"); + return FALSE; +} + +gchar * +mm_xmm_build_xact_set_command (const MMModemModeCombination *mode, + const GArray *bands, + GError **error) +{ + GString *command; + + /* At least one required */ + g_assert (mode || bands); + + /* Build command */ + command = g_string_new ("+XACT="); + + /* Mode is optional. If not given, we set all fields as empty */ + if (mode) { + /* Allowed mask */ + if (!append_rat_value (command, mode->allowed, error)) { + g_string_free (command, TRUE); + return NULL; + } + + /* Preferred */ + if (mode->preferred != MM_MODEM_MODE_NONE) { + g_string_append (command, ","); + if (!append_rat_value (command, mode->preferred, error)) { + g_string_free (command, TRUE); + return NULL; + } + /* We never set because that is anyway not part of + * ModemManager's API. In modems with triple GSM/UMTS/LTE mode, the + * is always the highest of the remaining ones. E.g. + * if "2G+3G+4G allowed with 2G preferred", the second preferred one + * would be 4G, not 3G. */ + g_string_append (command, ","); + } else + g_string_append (command, ",,"); + } else + g_string_append (command, ",,"); + + if (bands) { + g_string_append (command, ","); + /* Automatic band selection */ + if (bands->len == 1 && g_array_index (bands, MMModemBand, 0) == MM_MODEM_BAND_ANY) + g_string_append (command, "0"); + else { + guint i; + + for (i = 0; i < bands->len; i++) { + MMModemBand band; + guint num; + + band = g_array_index (bands, MMModemBand, i); + num = xact_band_to_num (band); + if (!num) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Band unsupported by this plugin: %s", mm_modem_band_get_string (band)); + g_string_free (command, TRUE); + return NULL; + } + + g_string_append_printf (command, "%s%u", i == 0 ? "" : ",", num); + } + } + } + + return g_string_free (command, FALSE); +} + +/*****************************************************************************/ +/* Get mode to apply when ANY */ + +MMModemMode +mm_xmm_get_modem_mode_any (const GArray *combinations) +{ + guint i; + MMModemMode any = MM_MODEM_MODE_NONE; + guint any_bits_set = 0; + + for (i = 0; i < combinations->len; i++) { + MMModemModeCombination *combination; + guint bits_set; + + combination = &g_array_index (combinations, MMModemModeCombination, i); + if (combination->preferred != MM_MODEM_MODE_NONE) + continue; + bits_set = mm_count_bits_set (combination->allowed); + if (bits_set > any_bits_set) { + any_bits_set = bits_set; + any = combination->allowed; + } + } + + /* If combinations were processed via mm_xmm_parse_uact_test_response(), + * we're sure that there will be at least one combination with preferred + * 'none', so there must be some valid combination as result */ + g_assert (any != MM_MODEM_MODE_NONE); + return any; +} + +/*****************************************************************************/ +/* +XCESQ? response parser */ + +gboolean +mm_xmm_parse_xcesq_query_response (const gchar *response, + guint *out_rxlev, + guint *out_ber, + guint *out_rscp, + guint *out_ecn0, + guint *out_rsrq, + guint *out_rsrp, + gint *out_rssnr, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint rxlev = 99; + guint ber = 99; + guint rscp = 255; + guint ecn0 = 255; + guint rsrq = 255; + guint rsrp = 255; + gint rssnr = 255; + gboolean success = FALSE; + + g_assert (out_rxlev); + g_assert (out_ber); + g_assert (out_rscp); + g_assert (out_ecn0); + g_assert (out_rsrq); + g_assert (out_rsrp); + g_assert (out_rssnr); + + /* Response may be e.g.: + * +XCESQ: 0,99,99,255,255,24,51,18 + * +XCESQ: 0,99,99,46,31,255,255,255 + * +XCESQ: 0,99,99,255,255,17,45,-2 + */ + r = g_regex_new ("\\+XCESQ: (\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(-?\\d+)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + /* Ignore "n" value */ + if (!mm_get_uint_from_match_info (match_info, 2, &rxlev)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read RXLEV"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 3, &ber)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read BER"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 4, &rscp)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read RSCP"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 5, &ecn0)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read Ec/N0"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 6, &rsrq)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read RSRQ"); + goto out; + } + if (!mm_get_uint_from_match_info (match_info, 7, &rsrp)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read RSRP"); + goto out; + } + if (!mm_get_int_from_match_info (match_info, 8, &rssnr)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't read RSSNR"); + goto out; + } + success = TRUE; + } + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (!success) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse +XCESQ response: %s", response); + return FALSE; + } + + *out_rxlev = rxlev; + *out_ber = ber; + *out_rscp = rscp; + *out_ecn0 = ecn0; + *out_rsrq = rsrq; + *out_rsrp = rsrp; + *out_rssnr = rssnr; + return TRUE; +} + +static gboolean +rssnr_level_to_rssnr (gint rssnr_level, + gdouble *out_rssnr) +{ + if (rssnr_level <= 100 && + rssnr_level >= -100) { + *out_rssnr = rssnr_level / 2.0; + return TRUE; + } + + if (rssnr_level != 255) + mm_warn ("unexpected RSSNR level: %u", rssnr_level); + return FALSE; +} + +/*****************************************************************************/ +/* Get extended signal information */ + +gboolean +mm_xmm_xcesq_response_to_signal_info (const gchar *response, + MMSignal **out_gsm, + MMSignal **out_umts, + MMSignal **out_lte, + GError **error) +{ + guint rxlev = 0; + guint ber = 0; + guint rscp_level = 0; + guint ecn0_level = 0; + guint rsrq_level = 0; + guint rsrp_level = 0; + gint rssnr_level = 0; + gdouble rssi = MM_SIGNAL_UNKNOWN; + gdouble rscp = MM_SIGNAL_UNKNOWN; + gdouble ecio = MM_SIGNAL_UNKNOWN; + gdouble rsrq = MM_SIGNAL_UNKNOWN; + gdouble rsrp = MM_SIGNAL_UNKNOWN; + gdouble rssnr = MM_SIGNAL_UNKNOWN; + MMSignal *gsm = NULL; + MMSignal *umts = NULL; + MMSignal *lte = NULL; + + if (!mm_xmm_parse_xcesq_query_response (response, + &rxlev, &ber, + &rscp_level, &ecn0_level, + &rsrq_level, &rsrp_level, + &rssnr_level, error)) + return FALSE; + + /* GERAN RSSI */ + if (mm_3gpp_rxlev_to_rssi (rxlev, &rssi)) { + gsm = mm_signal_new (); + mm_signal_set_rssi (gsm, rssi); + } + + /* ignore BER */ + + /* UMTS RSCP */ + if (mm_3gpp_rscp_level_to_rscp (rscp_level, &rscp)) { + umts = mm_signal_new (); + mm_signal_set_rscp (umts, rscp); + } + + /* UMTS EcIo (assumed EcN0) */ + if (mm_3gpp_ecn0_level_to_ecio (ecn0_level, &ecio)) { + if (!umts) + umts = mm_signal_new (); + mm_signal_set_ecio (umts, ecio); + } + + /* Calculate RSSI if we have ecio and rscp */ + if (umts && ecio != -G_MAXDOUBLE && rscp != -G_MAXDOUBLE) { + mm_signal_set_rssi (umts, rscp - ecio); + } + + /* LTE RSRQ */ + if (mm_3gpp_rsrq_level_to_rsrq (rsrq_level, &rsrq)) { + lte = mm_signal_new (); + mm_signal_set_rsrq (lte, rsrq); + } + + /* LTE RSRP */ + if (mm_3gpp_rsrp_level_to_rsrp (rsrp_level, &rsrp)) { + if (!lte) + lte = mm_signal_new (); + mm_signal_set_rsrp (lte, rsrp); + } + + /* LTE RSSNR */ + if (rssnr_level_to_rssnr (rssnr_level, &rssnr)) { + if (!lte) + lte = mm_signal_new (); + mm_signal_set_snr (lte, rssnr); + } + + if (!gsm && !umts && !lte) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't build detailed signal info"); + return FALSE; + } + + if (out_gsm) + *out_gsm = gsm; + if (out_umts) + *out_umts = umts; + if (out_lte) + *out_lte = lte; + + return TRUE; +} + +/*****************************************************************************/ +/* AT+XLCSLSR=? response parser */ + +static gboolean +number_group_contains_value (const gchar *group, + const gchar *group_name, + guint value, + GError **error) +{ + GArray *aux; + guint i; + gboolean found; + + aux = mm_parse_uint_list (group, NULL); + if (!aux) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unsupported +XLCSLSR format: invalid %s field format", group_name); + return FALSE; + } + + found = FALSE; + for (i = 0; i < aux->len; i++) { + guint value_i; + + value_i = g_array_index (aux, guint, i); + if (value == value_i) { + found = TRUE; + break; + } + } + + g_array_unref (aux); + return found; +} + +gboolean +mm_xmm_parse_xlcslsr_test_response (const gchar *response, + gboolean *transport_protocol_invalid_supported, + gboolean *transport_protocol_supl_supported, + gboolean *standalone_position_mode_supported, + gboolean *ms_assisted_based_position_mode_supported, + gboolean *loc_response_type_nmea_supported, + gboolean *gnss_type_gps_glonass_supported, + GError **error) +{ + gboolean ret = FALSE; + gchar **groups = NULL; + GError *inner_error = NULL; + + /* + * AT+XLCSLSR=? + * +XLCSLSR:(0-2),(0-3), ,(0,1), ,(0,1),(0 -7200),(0-255),(0-1),(0-2),(1-256),(0,1) + * transport_protocol: 2 (invalid) or 1 (supl) + * pos_mode: 3 (standalone) or 2 (ms assisted/based) + * client_id: + * client_id_type: + * mlc_number: + * mlc_number_type: + * interval: 1 (seconds) + * service_type_id: + * pseudonym_indicator: + * loc_response_type: 1 (NMEA strings) + * nmea_mask: 118 (01110110: GGA,GSA,GSV,RMC,VTG) + * gnss_type: 0 (GPS or GLONASS) + */ + response = mm_strip_tag (response, "+XLCSLSR:"); + groups = mm_split_string_groups (response); + + /* We expect 12 groups */ + if (g_strv_length (groups) < 12) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unsupported +XLCSLSR format: expected 12 fields"); + goto out; + } + + if (transport_protocol_invalid_supported) { + *transport_protocol_invalid_supported = number_group_contains_value (groups[0], + "transport protocol", + 2, /* invalid */ + &inner_error); + if (inner_error) + goto out; + } + + if (transport_protocol_supl_supported) { + *transport_protocol_supl_supported = number_group_contains_value (groups[0], + "transport protocol", + 1, /* supl */ + &inner_error); + if (inner_error) + goto out; + } + + if (standalone_position_mode_supported) { + *standalone_position_mode_supported = number_group_contains_value (groups[1], + "position mode", + 3, /* standalone */ + &inner_error); + if (inner_error) + goto out; + } + + if (ms_assisted_based_position_mode_supported) { + *ms_assisted_based_position_mode_supported = number_group_contains_value (groups[1], + "position mode", + 2, /* ms assisted/based */ + &inner_error); + if (inner_error) + goto out; + } + + if (loc_response_type_nmea_supported) { + *loc_response_type_nmea_supported = number_group_contains_value (groups[9], + "location response type", + 1, /* NMEA */ + &inner_error); + if (inner_error) + goto out; + } + + if (gnss_type_gps_glonass_supported) { + *gnss_type_gps_glonass_supported = number_group_contains_value (groups[11], + "gnss type", + 0, /* GPS/GLONASS */ + &inner_error); + if (inner_error) + goto out; + } + + ret = TRUE; + + out: + g_strfreev (groups); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + return ret; +} + +/*****************************************************************************/ +/* AT+XLCSSLP? response parser */ + +gboolean +mm_xmm_parse_xlcsslp_query_response (const gchar *response, + gchar **supl_address, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + gchar *address = NULL; + guint port = 0; + + /* + * E.g.: + * +XLCSSLP:1,"www.spirent-lcs.com",7275 + */ + + r = g_regex_new ("\\+XLCSSLP:\\s*(\\d+),([^,]*),(\\d+)(?:\\r\\n)?", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (!inner_error && g_match_info_matches (match_info)) { + guint type; + + /* We only support types 0 (IPv4) and 1 (FQDN) */ + mm_get_uint_from_match_info (match_info, 1, &type); + if (type != 0 && type != 1) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unsupported SUPL server address type (%u) in response: %s", type, response); + goto out; + } + + address = mm_get_string_unquoted_from_match_info (match_info, 2); + mm_get_uint_from_match_info (match_info, 3, &port); + if (!port) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid SUPL address port number in response: %s", response); + goto out; + } + } + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (supl_address) + *supl_address = g_strdup_printf ("%s:%u", address, port); + g_free (address); + + return TRUE; +} diff -Nru modemmanager-1.6.8/plugins/xmm/mm-modem-helpers-xmm.h modemmanager-1.10.0/plugins/xmm/mm-modem-helpers-xmm.h --- modemmanager-1.6.8/plugins/xmm/mm-modem-helpers-xmm.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-modem-helpers-xmm.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_MODEM_HELPERS_XMM_H +#define MM_MODEM_HELPERS_XMM_H + +#include +#include + +/* AT+XACT=? response parser */ +gboolean mm_xmm_parse_xact_test_response (const gchar *response, + GArray **modes_out, + GArray **bands_out, + GError **error); + +/* AT+XACT? response parser */ +gboolean mm_xmm_parse_xact_query_response (const gchar *response, + MMModemModeCombination *mode_out, + GArray **bands_out, + GError **error); + +/* AT+XACT=X command builder */ +gchar *mm_xmm_build_xact_set_command (const MMModemModeCombination *mode, + const GArray *bands, + GError **error); + +/* Mode to apply when ANY */ +MMModemMode mm_xmm_get_modem_mode_any (const GArray *combinations); + +gboolean mm_xmm_parse_xcesq_query_response (const gchar *response, + guint *out_rxlev, + guint *out_ber, + guint *out_rscp, + guint *out_ecn0, + guint *out_rsrq, + guint *out_rsrp, + gint *out_rssnr, + GError **error); + +gboolean mm_xmm_xcesq_response_to_signal_info (const gchar *response, + MMSignal **out_gsm, + MMSignal **out_umts, + MMSignal **out_lte, + GError **error); + +/* AT+XLCSLSR=? response parser */ +gboolean mm_xmm_parse_xlcslsr_test_response (const gchar *response, + gboolean *transport_protocol_invalid_supported, + gboolean *transport_protocol_supl_supported, + gboolean *standalone_position_mode_supported, + gboolean *ms_assisted_based_position_mode_supported, + gboolean *loc_response_type_nmea_supported, + gboolean *gnss_type_gps_glonass_supported, + GError **error); + +/* AT+XLCSSLP? response parser */ +gboolean mm_xmm_parse_xlcsslp_query_response (const gchar *response, + gchar **supl_address, + GError **error); + +#endif /* MM_MODEM_HELPERS_XMM_H */ diff -Nru modemmanager-1.6.8/plugins/xmm/mm-shared-xmm.c modemmanager-1.10.0/plugins/xmm/mm-shared-xmm.c --- modemmanager-1.6.8/plugins/xmm/mm-shared-xmm.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-shared-xmm.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1567 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-signal.h" +#include "mm-iface-modem-location.h" +#include "mm-base-modem.h" +#include "mm-base-modem-at.h" +#include "mm-shared-xmm.h" +#include "mm-modem-helpers-xmm.h" + +/*****************************************************************************/ +/* Private data context */ + +#define PRIVATE_TAG "shared-xmm-private-tag" +static GQuark private_quark; + +typedef enum { + GPS_ENGINE_STATE_OFF, + GPS_ENGINE_STATE_STANDALONE, + GPS_ENGINE_STATE_ASSISTED, +} GpsEngineState; + +typedef struct { + /* Broadband modem class support */ + MMBroadbandModemClass *broadband_modem_class_parent; + + /* Modem interface support */ + GArray *supported_modes; + GArray *supported_bands; + MMModemMode allowed_modes; + + /* Location interface support */ + MMIfaceModemLocation *iface_modem_location_parent; + MMModemLocationSource supported_sources; + MMModemLocationSource enabled_sources; + GpsEngineState gps_engine_state; + MMPortSerialAt *gps_port; + GRegex *xlsrstop_regex; + GRegex *nmea_regex; +} Private; + +static void +private_free (Private *priv) +{ + g_clear_object (&priv->gps_port); + if (priv->supported_modes) + g_array_unref (priv->supported_modes); + if (priv->supported_bands) + g_array_unref (priv->supported_bands); + g_regex_unref (priv->xlsrstop_regex); + g_regex_unref (priv->nmea_regex); + g_slice_free (Private, priv); +} + +static Private * +get_private (MMSharedXmm *self) +{ + Private *priv; + + if (G_UNLIKELY (!private_quark)) + private_quark = g_quark_from_static_string (PRIVATE_TAG); + + priv = g_object_get_qdata (G_OBJECT (self), private_quark); + if (!priv) { + priv = g_slice_new0 (Private); + priv->gps_engine_state = GPS_ENGINE_STATE_OFF; + + /* Setup regex for URCs */ + priv->xlsrstop_regex = g_regex_new ("\\r\\n\\+XLSRSTOP:(.*)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + priv->nmea_regex = g_regex_new ("(?:\\r\\n)?(?:\\r\\n)?(\\$G.*)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + + /* Setup parent class' MMBroadbandModemClass */ + g_assert (MM_SHARED_XMM_GET_INTERFACE (self)->peek_parent_broadband_modem_class); + priv->broadband_modem_class_parent = MM_SHARED_XMM_GET_INTERFACE (self)->peek_parent_broadband_modem_class (self); + + /* Setup parent class' MMIfaceModemLocation */ + g_assert (MM_SHARED_XMM_GET_INTERFACE (self)->peek_parent_location_interface); + priv->iface_modem_location_parent = MM_SHARED_XMM_GET_INTERFACE (self)->peek_parent_location_interface (self); + + g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free); + } + + return priv; +} + +/*****************************************************************************/ +/* Supported modes/bands (Modem interface) */ + +GArray * +mm_shared_xmm_load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + Private *priv; + + if (!g_task_propagate_boolean (G_TASK (res), error)) + return NULL; + + priv = get_private (MM_SHARED_XMM (self)); + g_assert (priv->supported_modes); + return g_array_ref (priv->supported_modes); +} + +GArray * +mm_shared_xmm_load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + Private *priv; + + if (!g_task_propagate_boolean (G_TASK (res), error)) + return NULL; + + priv = get_private (MM_SHARED_XMM (self)); + g_assert (priv->supported_bands); + return g_array_ref (priv->supported_bands); +} + +static void +xact_test_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || + !mm_xmm_parse_xact_test_response (response, + &priv->supported_modes, + &priv->supported_bands, + &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +common_load_supported_modes_bands (GTask *task) +{ + mm_base_modem_at_command ( + MM_BASE_MODEM (g_task_get_source_object (task)), + "+XACT=?", + 3, + TRUE, /* allow caching */ + (GAsyncReadyCallback)xact_test_ready, + task); +} + +void +mm_shared_xmm_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + priv = get_private (MM_SHARED_XMM (self)); + + if (!priv->supported_modes) { + common_load_supported_modes_bands (task); + return; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_xmm_load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + priv = get_private (MM_SHARED_XMM (self)); + + if (!priv->supported_bands) { + common_load_supported_modes_bands (task); + return; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Current modes (Modem interface) */ + +gboolean +mm_shared_xmm_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) +{ + MMModemModeCombination *result; + + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) + return FALSE; + + *allowed = result->allowed; + *preferred = result->preferred; + g_free (result); + return TRUE; +} + +static void +xact_query_modes_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + Private *priv; + MMModemModeCombination *result; + + priv = get_private (MM_SHARED_XMM (self)); + result = g_new0 (MMModemModeCombination, 1); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || !mm_xmm_parse_xact_query_response (response, result, NULL, &error)) { + priv->allowed_modes = MM_MODEM_MODE_NONE; + g_free (result); + g_task_return_error (task, error); + } else { + priv->allowed_modes = result->allowed; + g_task_return_pointer (task, result, g_free); + } + g_object_unref (task); +} + +void +mm_shared_xmm_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+XACT?", + 3, + FALSE, + (GAsyncReadyCallback)xact_query_modes_ready, + task); +} + +/*****************************************************************************/ +/* Current bands (Modem interface) */ + +GArray * +mm_shared_xmm_load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); +} + + +static void +xact_query_bands_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + GArray *result = NULL; + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || + !mm_xmm_parse_xact_query_response (response, NULL, &result, &error)) + g_task_return_error (task, error); + else + g_task_return_pointer (task, result, (GDestroyNotify)g_array_unref); + g_object_unref (task); +} + +void +mm_shared_xmm_load_current_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + "+XACT?", + 3, + FALSE, + (GAsyncReadyCallback)xact_query_bands_ready, + task); +} + +/*****************************************************************************/ +/* Set current modes (Modem interface) */ + +gboolean +mm_shared_xmm_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +xact_set_modes_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_xmm_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MMModemModeCombination mode; + gchar *command; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); + + if (allowed != MM_MODEM_MODE_ANY) { + mode.allowed = allowed; + mode.preferred = preferred; + } else { + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + mode.allowed = mm_xmm_get_modem_mode_any (priv->supported_modes); + mode.preferred = MM_MODEM_MODE_NONE; + } + + command = mm_xmm_build_xact_set_command (&mode, NULL, &error); + if (!command) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + command, + 10, + FALSE, + (GAsyncReadyCallback)xact_set_modes_ready, + task); + g_free (command); +} + +/*****************************************************************************/ +/* Set current bands (Modem interface) */ + +gboolean +mm_shared_xmm_set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +xact_set_bands_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static gchar * +validate_and_build_command_set_current_bands (const GArray *bands_array, + const GArray *supported_modes, + MMModemMode allowed_modes, + GError **error) +{ + gboolean band_2g_found = FALSE; + gboolean band_3g_found = FALSE; + gboolean band_4g_found = FALSE; + GArray *unapplied_bands; + GError *inner_error = NULL; + guint i; + + /* ANY applies only to the currently selected modes */ + if (bands_array->len == 1 && g_array_index (bands_array, MMModemBand, 0) == MM_MODEM_BAND_ANY) { + MMModemModeCombination mode; + MMModemMode unapplied; + + /* If we are enabling automatic band selection to a mode combination that does not include + * all supported modes, warn about it because automatic band selection wouldn't be executed + * for the non-selected modes. + * + * This is a known limitation of the modem firmware. + */ + unapplied = mm_xmm_get_modem_mode_any (supported_modes) & ~(allowed_modes); + if (unapplied != MM_MODEM_MODE_NONE) { + gchar *str; + + str = mm_modem_mode_build_string_from_mask (unapplied); + mm_warn ("Automatic band selection not applied to non-current modes %s", str); + g_free (str); + } + + /* Nothing else to validate, go build the command right away */ + + /* We must create the set command with an explicit set of allowed modes. + * We pass NONE as preferred, but that WON'T change the currently selected preferred mode, + * it will be ignored when the command is processed as an empty field will be given */ + mode.allowed = allowed_modes; + mode.preferred = MM_MODEM_MODE_NONE; + return mm_xmm_build_xact_set_command (&mode, bands_array, error); + } + + unapplied_bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); + for (i = 0; i < bands_array->len; i++) { + MMModemBand band; + + band = g_array_index (bands_array, MMModemBand, i); + if (mm_common_band_is_eutran (band)) { + band_4g_found = TRUE; + if (!(allowed_modes & MM_MODEM_MODE_4G)) + g_array_append_val (unapplied_bands, band); + } + if (mm_common_band_is_utran (band)) { + band_3g_found = TRUE; + if (!(allowed_modes & MM_MODEM_MODE_3G)) + g_array_append_val (unapplied_bands, band); + } + if (mm_common_band_is_gsm (band)) { + band_2g_found = TRUE; + if (!(allowed_modes & MM_MODEM_MODE_2G)) + g_array_append_val (unapplied_bands, band); + } + } + + /* If 2G selected, there must be at least one 2G band */ + if ((allowed_modes & MM_MODEM_MODE_2G) && !band_2g_found) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "At least one GSM band is required when 2G mode is allowed"); + goto out; + } + + /* If 3G selected, there must be at least one 3G band */ + if ((allowed_modes & MM_MODEM_MODE_3G) && !band_3g_found) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "At least one UTRAN band is required when 3G mode is allowed"); + goto out; + } + + /* If 4G selected, there must be at least one 4G band */ + if ((allowed_modes & MM_MODEM_MODE_4G) && !band_4g_found) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "At least one E-UTRAN band is required when 4G mode is allowed"); + goto out; + } + + /* Don't try to modify bands for modes that are not enabled */ + if (unapplied_bands->len > 0) { + gchar *str; + + str = mm_common_build_bands_string ((const MMModemBand *)unapplied_bands->data, unapplied_bands->len); + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Cannot update bands for modes not currently allowed: %s", str); + g_free (str); + goto out; + } + +out: + if (unapplied_bands) + g_array_unref (unapplied_bands); + + if (inner_error) { + g_propagate_error (error, inner_error); + return NULL; + } + + return mm_xmm_build_xact_set_command (NULL, bands_array, error); +} + +void +mm_shared_xmm_set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + gchar *command = NULL; + GError *error = NULL; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + + /* Setting bands requires additional validation rules based on the + * currently selected list of allowed modes */ + priv = get_private (MM_SHARED_XMM (self)); + if (priv->allowed_modes == MM_MODEM_MODE_NONE) { + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Cannot set bands if allowed modes are unknown"); + goto out; + } + + command = validate_and_build_command_set_current_bands (bands_array, + priv->supported_modes, + priv->allowed_modes, + &error); + +out: + if (!command) { + g_assert (error); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + command, + 10, + FALSE, + (GAsyncReadyCallback)xact_set_bands_ready, + task); + g_free (command); +} + +/*****************************************************************************/ +/* Power state loading (Modem interface) */ + +MMModemPowerState +mm_shared_xmm_load_power_state_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + guint state; + const gchar *response; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response) + return MM_MODEM_POWER_STATE_UNKNOWN; + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return MM_MODEM_POWER_STATE_UNKNOWN; + + switch (state) { + case 1: + return MM_MODEM_POWER_STATE_ON; + case 4: + return MM_MODEM_POWER_STATE_LOW; + default: + break; + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown +CFUN state: %u", state); + return MM_MODEM_POWER_STATE_UNKNOWN; +} + +void +mm_shared_xmm_load_power_state (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+CFUN?", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Modem power up/down/off (Modem interface) */ + +static gboolean +common_modem_power_operation_finish (MMSharedXmm *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +power_operation_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +common_modem_power_operation (MMSharedXmm *self, + const gchar *command, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + mm_base_modem_at_command (MM_BASE_MODEM (self), + command, + 30, + FALSE, + (GAsyncReadyCallback) power_operation_ready, + task); +} + +gboolean +mm_shared_xmm_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return common_modem_power_operation_finish (MM_SHARED_XMM (self), res, error); +} + +void +mm_shared_xmm_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_SHARED_XMM (self), "+CFUN=16", callback, user_data); +} + +gboolean +mm_shared_xmm_power_off_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return common_modem_power_operation_finish (MM_SHARED_XMM (self), res, error); +} + +void +mm_shared_xmm_power_off (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_SHARED_XMM (self), "+CPWROFF", callback, user_data); +} + +gboolean +mm_shared_xmm_power_down_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return common_modem_power_operation_finish (MM_SHARED_XMM (self), res, error); +} + +void +mm_shared_xmm_power_down (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_SHARED_XMM (self), "+CFUN=4", callback, user_data); +} + +gboolean +mm_shared_xmm_power_up_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return common_modem_power_operation_finish (MM_SHARED_XMM (self), res, error); +} + +void +mm_shared_xmm_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_modem_power_operation (MM_SHARED_XMM (self), "+CFUN=1", callback, user_data); +} + +/*****************************************************************************/ +/* Check support (Signal interface) */ + +gboolean +mm_shared_xmm_signal_check_support_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + GError **error) +{ + return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); +} + +void +mm_shared_xmm_signal_check_support (MMIfaceModemSignal *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+XCESQ=?", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Load extended signal information (Signal interface) */ + +gboolean +mm_shared_xmm_signal_load_values_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + MMSignal **cdma, + MMSignal **evdo, + MMSignal **gsm, + MMSignal **umts, + MMSignal **lte, + GError **error) +{ + const gchar *response; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response || !mm_xmm_xcesq_response_to_signal_info (response, gsm, umts, lte, error)) + return FALSE; + + if (cdma) + *cdma = NULL; + if (evdo) + *evdo = NULL; + + return TRUE; +} + +void +mm_shared_xmm_signal_load_values (MMIfaceModemSignal *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+XCESQ?", + 3, + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ +/* Load capabilities (Location interface) */ + +MMModemLocationSource +mm_shared_xmm_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; +} + +static void +xlcslsr_test_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource sources; + const gchar *response; + GError *error = NULL; + Private *priv; + gboolean transport_protocol_invalid_supported; + gboolean transport_protocol_supl_supported; + gboolean standalone_position_mode_supported; + gboolean ms_assisted_based_position_mode_supported; + gboolean loc_response_type_nmea_supported; + gboolean gnss_type_gps_glonass_supported; + + priv = get_private (MM_SHARED_XMM (self)); + + /* Recover parent sources */ + sources = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || + !mm_xmm_parse_xlcslsr_test_response (response, + &transport_protocol_invalid_supported, + &transport_protocol_supl_supported, + &standalone_position_mode_supported, + &ms_assisted_based_position_mode_supported, + &loc_response_type_nmea_supported, + &gnss_type_gps_glonass_supported, + &error)) { + mm_dbg ("XLCSLSR based GPS control unsupported: %s", error->message); + g_clear_error (&error); + } else if (!transport_protocol_invalid_supported || + !standalone_position_mode_supported || + !loc_response_type_nmea_supported || + !gnss_type_gps_glonass_supported) { + mm_dbg ("XLCSLSR based GPS control unsupported: protocol invalid %s, standalone %s, nmea %s, gps/glonass %s", + transport_protocol_invalid_supported ? "supported" : "unsupported", + standalone_position_mode_supported ? "supported" : "unsupported", + loc_response_type_nmea_supported ? "supported" : "unsupported", + gnss_type_gps_glonass_supported ? "supported" : "unsupported"); + } else { + mm_dbg ("XLCSLSR based GPS control supported"); + priv->supported_sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW); + + if (transport_protocol_supl_supported && ms_assisted_based_position_mode_supported) { + mm_dbg ("XLCSLSR based A-GPS control supported"); + priv->supported_sources |= MM_MODEM_LOCATION_SOURCE_AGPS; + } else { + mm_dbg ("XLCSLSR based A-GPS control unsupported: protocol supl %s, ms assisted/based %s", + transport_protocol_supl_supported ? "supported" : "unsupported", + ms_assisted_based_position_mode_supported ? "supported" : "unsupported"); + } + + sources |= priv->supported_sources; + } + + g_task_return_int (task, sources); + g_object_unref (task); +} + +static void +parent_load_capabilities_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource sources; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + sources = priv->iface_modem_location_parent->load_capabilities_finish (self, res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* If parent already supports GPS sources, we won't do anything else */ + if (sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { + mm_dbg ("No need to run XLCSLSR based location gathering"); + g_task_return_int (task, sources); + g_object_unref (task); + return; + } + + /* Cache sources supported by the parent */ + g_task_set_task_data (task, GUINT_TO_POINTER (sources), NULL); + + mm_base_modem_at_command ( + MM_BASE_MODEM (g_task_get_source_object (task)), + "+XLCSLSR=?", + 3, + TRUE, /* allow caching */ + (GAsyncReadyCallback)xlcslsr_test_ready, + task); +} + +void +mm_shared_xmm_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + task = g_task_new (self, NULL, callback, user_data); + + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->load_capabilities); + g_assert (priv->iface_modem_location_parent->load_capabilities_finish); + + priv->iface_modem_location_parent->load_capabilities (self, + (GAsyncReadyCallback)parent_load_capabilities_ready, + task); +} + +/*****************************************************************************/ +/* GPS engine state selection */ + +static void +nmea_received (MMPortSerialAt *port, + GMatchInfo *info, + MMSharedXmm *self) +{ + gchar *trace; + + trace = g_match_info_fetch (info, 1); + + /* Helper to debug GPS location related issues. Don't depend on a real GPS + * fix for debugging, just use some random values to update */ +#if 0 + { + const gchar *prefix = NULL; + const gchar *lat = NULL; + + /* lat N/S just to test which one is used */ + if (g_str_has_prefix (trace, "$GPGGA")) { + prefix = "GPGGA"; + lat = "S"; + } else if (g_str_has_prefix (trace, "$GNGGA")) { + prefix = "GNGGA"; + lat = "N"; + } + + if (prefix && lat) { + GString *str; + GDateTime *now; + + mm_dbg ("GGA trace detected: '%s'", trace); + g_free (trace); + + now = g_date_time_new_now_utc (); + str = g_string_new (""); + g_string_append_printf (str, + "$%s,%02u%02u%02u,4807.038,%s,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47", + prefix, + g_date_time_get_hour (now), + g_date_time_get_minute (now), + g_date_time_get_second (now), + lat); + mm_iface_modem_location_gps_update (MM_IFACE_MODEM_LOCATION (self), str->str); + g_string_free (str, TRUE); + g_date_time_unref (now); + return; + } + } +#endif + + mm_iface_modem_location_gps_update (MM_IFACE_MODEM_LOCATION (self), trace); + g_free (trace); +} + +static gboolean +gps_engine_state_select_finish (MMSharedXmm *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +xlcslsr_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GpsEngineState state; + const gchar *response; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + response = mm_base_modem_at_command_full_finish (self, res, &error); + if (!response) { + g_clear_object (&priv->gps_port); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + state = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + g_assert (priv->gps_port); + mm_port_serial_at_add_unsolicited_msg_handler (priv->gps_port, + priv->nmea_regex, + (MMPortSerialAtUnsolicitedMsgFn)nmea_received, + self, + NULL); + priv->gps_engine_state = state; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +gps_engine_start (GTask *task) +{ + GpsEngineState state; + MMSharedXmm *self; + Private *priv; + guint transport_protocol = 0; + guint pos_mode = 0; + gchar *cmd; + + self = g_task_get_source_object (task); + priv = get_private (self); + state = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + /* Look for an AT port to use for GPS. Prefer secondary port if there is one, + * otherwise use primary */ + g_assert (!priv->gps_port); + priv->gps_port = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); + if (!priv->gps_port) { + priv->gps_port = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + if (!priv->gps_port) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No valid port found to control GPS"); + g_object_unref (task); + return; + } + } + + switch (state) { + case GPS_ENGINE_STATE_STANDALONE: + transport_protocol = 2; + pos_mode = 3; + break; + case GPS_ENGINE_STATE_ASSISTED: + transport_protocol = 1; + pos_mode = 2; + break; + default: + g_assert_not_reached (); + break; + } + + /* + * AT+XLCSLSR + * transport_protocol: 2 (invalid) or 1 (supl) + * pos_mode: 3 (standalone) or 2 (ms assisted+based) + * client_id: + * client_id_type: + * mlc_number: + * mlc_number_type: + * interval: 1 (seconds) + * service_type_id: + * pseudonym_indicator: + * loc_response_type: 1 (NMEA strings) + * nmea_mask: 118 (01110110: GGA,GSA,GSV,RMC,VTG) + * gnss_type: 0 (GPS or GLONASS) + */ + g_assert (priv->gps_port); + cmd = g_strdup_printf ("AT+XLCSLSR=%u,%u,,,,,1,,,1,118,0", transport_protocol, pos_mode); + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + priv->gps_port, + cmd, + 3, + FALSE, + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback)xlcslsr_ready, + task); + g_free (cmd); +} + +static void +xlsrstop_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GpsEngineState state; + GError *error = NULL; + Private *priv; + + mm_base_modem_at_command_full_finish (self, res, &error); + + priv = get_private (MM_SHARED_XMM (self)); + state = GPOINTER_TO_UINT (g_task_get_task_data (task)); + + g_assert (priv->gps_port); + mm_port_serial_at_add_unsolicited_msg_handler (priv->gps_port, priv->nmea_regex, NULL, NULL, NULL); + g_clear_object (&priv->gps_port); + priv->gps_engine_state = GPS_ENGINE_STATE_OFF; + + /* If already reached requested state, we're done */ + if (state == priv->gps_engine_state) { + /* If we had an error when requesting this specific state, report it */ + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Ignore errors if the stop operation was an intermediate one */ + g_clear_error (&error); + + /* Otherwise, start with new state */ + gps_engine_start (task); +} + +static void +gps_engine_stop (GTask *task) +{ + MMSharedXmm *self; + Private *priv; + + self = g_task_get_source_object (task); + priv = get_private (self); + + g_assert (priv->gps_port); + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + priv->gps_port, + "+XLSRSTOP", + 3, + FALSE, + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback)xlsrstop_ready, + task); +} + +static void +gps_engine_state_select (MMSharedXmm *self, + GpsEngineState state, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (state), NULL); + + priv = get_private (self); + + /* If already in the requested state, we're done */ + if (state == priv->gps_engine_state) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* If states are different we always STOP first */ + if (priv->gps_engine_state != GPS_ENGINE_STATE_OFF) { + gps_engine_stop (task); + return; + } + + /* If GPS already stopped, go on to START right away */ + g_assert (state != GPS_ENGINE_STATE_OFF); + gps_engine_start (task); +} + +static GpsEngineState +gps_engine_state_get_expected (MMModemLocationSource sources) +{ + /* If at lease one of GPS nmea/raw sources enabled, engine started */ + if (sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { + /* If A-GPS is enabled, ASSISTED mode */ + if (sources & MM_MODEM_LOCATION_SOURCE_AGPS) + return GPS_ENGINE_STATE_ASSISTED; + /* Otherwise, STANDALONE */ + return GPS_ENGINE_STATE_STANDALONE; + } + /* If no GPS nmea/raw sources enabled, engine stopped */ + return GPS_ENGINE_STATE_OFF; +} + +/*****************************************************************************/ +/* Disable location gathering (Location interface) */ + +gboolean +mm_shared_xmm_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +disable_gps_engine_state_select_ready (MMSharedXmm *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource source; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + if (!gps_engine_state_select_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + source = GPOINTER_TO_UINT (g_task_get_task_data (task)); + priv->enabled_sources &= ~source; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_disable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + g_assert (priv->iface_modem_location_parent); + if (!priv->iface_modem_location_parent->disable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_xmm_disable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + priv = get_private (MM_SHARED_XMM (self)); + g_assert (priv->iface_modem_location_parent); + + /* Only consider request if it applies to one of the sources we are + * supporting, otherwise run parent disable */ + if (!(priv->supported_sources & source)) { + /* If disabling implemented by the parent, run it. */ + if (priv->iface_modem_location_parent->disable_location_gathering && + priv->iface_modem_location_parent->disable_location_gathering_finish) { + priv->iface_modem_location_parent->disable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_disable_location_gathering_ready, + task); + return; + } + /* Otherwise, we're done */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* We only expect GPS sources here */ + g_assert (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS)); + + /* Update engine based on the expected sources */ + gps_engine_state_select (MM_SHARED_XMM (self), + gps_engine_state_get_expected (priv->enabled_sources & ~source), + (GAsyncReadyCallback) disable_gps_engine_state_select_ready, + task); +} + +/*****************************************************************************/ +/* Enable location gathering (Location interface) */ + +gboolean +mm_shared_xmm_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +enable_gps_engine_state_select_ready (MMSharedXmm *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource source; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + if (!gps_engine_state_select_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + source = GPOINTER_TO_UINT (g_task_get_task_data (task)); + priv->enabled_sources |= source; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_enable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error; + Private *priv; + + priv = get_private (MM_SHARED_XMM (self)); + + g_assert (priv->iface_modem_location_parent); + if (!priv->iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_xmm_enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + priv = get_private (MM_SHARED_XMM (self)); + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->enable_location_gathering); + g_assert (priv->iface_modem_location_parent->enable_location_gathering_finish); + + /* Only consider request if it applies to one of the sources we are + * supporting, otherwise run parent enable */ + if (!(priv->supported_sources & source)) { + priv->iface_modem_location_parent->enable_location_gathering (self, + source, + (GAsyncReadyCallback)parent_enable_location_gathering_ready, + task); + return; + } + + /* We only expect GPS sources here */ + g_assert (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS)); + + /* Update engine based on the expected sources */ + gps_engine_state_select (MM_SHARED_XMM (self), + gps_engine_state_get_expected (priv->enabled_sources | source), + (GAsyncReadyCallback) enable_gps_engine_state_select_ready, + task); +} + +/*****************************************************************************/ +/* Location: Load SUPL server */ + +gchar * +mm_shared_xmm_location_load_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +xlcsslp_query_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + const gchar *response; + GError *error = NULL; + gchar *supl_address; + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response || !mm_xmm_parse_xlcsslp_query_response (response, &supl_address, &error)) + g_task_return_error (task, error); + else + g_task_return_pointer (task, supl_address, g_free); + g_object_unref (task); +} + +void +mm_shared_xmm_location_load_supl_server (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+XLCSSLP?", + 3, + FALSE, + (GAsyncReadyCallback)xlcsslp_query_ready, + task); +} + +/*****************************************************************************/ + +gboolean +mm_shared_xmm_location_set_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +xlcsslp_set_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!mm_base_modem_at_command_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_xmm_location_set_supl_server (MMIfaceModemLocation *self, + const gchar *supl, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + gchar *cmd = NULL; + gchar *fqdn = NULL; + guint32 ip; + guint16 port; + + task = g_task_new (self, NULL, callback, user_data); + + mm_parse_supl_address (supl, &fqdn, &ip, &port, NULL); + g_assert (port); + if (fqdn) + cmd = g_strdup_printf ("+XLCSSLP=1,%s,%u", fqdn, port); + else if (ip) { + struct in_addr a = { .s_addr = ip }; + gchar buf[INET_ADDRSTRLEN + 1] = { 0 }; + + /* we got 'ip' from inet_pton(), so this next step should always succeed */ + g_assert (inet_ntop (AF_INET, &a, buf, sizeof (buf) - 1)); + cmd = g_strdup_printf ("+XLCSSLP=0,%s,%u", buf, port); + } else + g_assert_not_reached (); + + mm_base_modem_at_command (MM_BASE_MODEM (self), + cmd, + 3, + FALSE, + (GAsyncReadyCallback)xlcsslp_set_ready, + task); + g_free (cmd); + g_free (fqdn); +} + +/*****************************************************************************/ + +void +mm_shared_xmm_setup_ports (MMBroadbandModem *self) +{ + Private *priv; + MMPortSerialAt *ports[2]; + guint i; + + priv = get_private (MM_SHARED_XMM (self)); + g_assert (priv->broadband_modem_class_parent); + g_assert (priv->broadband_modem_class_parent->setup_ports); + + /* Parent setup first always */ + priv->broadband_modem_class_parent->setup_ports (self); + + ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); + ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); + + /* Setup primary and secondary ports */ + for (i = 0; i < G_N_ELEMENTS (ports); i++) { + if (!ports[i]) + continue; + + /* After running AT+XLSRSTOP we may get an unsolicited response + * reporting its status, we just ignore it. */ + mm_port_serial_at_add_unsolicited_msg_handler ( + ports[i], + priv->xlsrstop_regex, + NULL, NULL, NULL); + + + + /* make sure GPS is stopped in case it was left enabled */ + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + ports[i], + "+XLSRSTOP", + 3, FALSE, FALSE, NULL, NULL, NULL); + } +} + +/*****************************************************************************/ + +static void +shared_xmm_init (gpointer g_iface) +{ +} + +GType +mm_shared_xmm_get_type (void) +{ + static GType shared_xmm_type = 0; + + if (!G_UNLIKELY (shared_xmm_type)) { + static const GTypeInfo info = { + sizeof (MMSharedXmm), /* class_size */ + shared_xmm_init, /* base_init */ + NULL, /* base_finalize */ + }; + + shared_xmm_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedXmm", &info, 0); + g_type_interface_add_prerequisite (shared_xmm_type, MM_TYPE_IFACE_MODEM); + g_type_interface_add_prerequisite (shared_xmm_type, MM_TYPE_IFACE_MODEM_LOCATION); + } + + return shared_xmm_type; +} diff -Nru modemmanager-1.6.8/plugins/xmm/mm-shared-xmm.h modemmanager-1.10.0/plugins/xmm/mm-shared-xmm.h --- modemmanager-1.6.8/plugins/xmm/mm-shared-xmm.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/mm-shared-xmm.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,183 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_SHARED_XMM_H +#define MM_SHARED_XMM_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-broadband-modem.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-signal.h" +#include "mm-iface-modem-location.h" + +#define MM_TYPE_SHARED_XMM (mm_shared_xmm_get_type ()) +#define MM_SHARED_XMM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_XMM, MMSharedXmm)) +#define MM_IS_SHARED_XMM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_XMM)) +#define MM_SHARED_XMM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_XMM, MMSharedXmm)) + +typedef struct _MMSharedXmm MMSharedXmm; + +struct _MMSharedXmm { + GTypeInterface g_iface; + + /* Peek broadband modem class of the parent class of the object */ + MMBroadbandModemClass * (* peek_parent_broadband_modem_class) (MMSharedXmm *self); + + /* Peek location interface of the parent class of the object */ + MMIfaceModemLocation * (* peek_parent_location_interface) (MMSharedXmm *self); +}; + +GType mm_shared_xmm_get_type (void); + +/* Shared XMM device setup */ + +void mm_shared_xmm_setup_ports (MMBroadbandModem *self); + +/* Shared XMM device management support */ + +void mm_shared_xmm_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_xmm_load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error); +void mm_shared_xmm_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + +void mm_shared_xmm_load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_xmm_load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_load_current_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_xmm_load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + +void mm_shared_xmm_load_power_state (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemPowerState mm_shared_xmm_load_power_state_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_power_up_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_power_down (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_power_down_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_power_off (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_power_off_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + +gboolean mm_shared_xmm_signal_check_support_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + GError **error); + +void mm_shared_xmm_signal_check_support (MMIfaceModemSignal *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_signal_load_values_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + MMSignal **cdma, + MMSignal **evdo, + MMSignal **gsm, + MMSignal **umts, + MMSignal **lte, + GError **error); +void mm_shared_xmm_signal_load_values (MMIfaceModemSignal *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +void mm_shared_xmm_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemLocationSource mm_shared_xmm_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_disable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_location_load_supl_server (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +gchar *mm_shared_xmm_location_load_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_xmm_location_set_supl_server (MMIfaceModemLocation *self, + const gchar *supl, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_xmm_location_set_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + +#endif /* MM_SHARED_XMM_H */ diff -Nru modemmanager-1.6.8/plugins/xmm/tests/test-modem-helpers-xmm.c modemmanager-1.10.0/plugins/xmm/tests/test-modem-helpers-xmm.c --- modemmanager-1.6.8/plugins/xmm/tests/test-modem-helpers-xmm.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/plugins/xmm/tests/test-modem-helpers-xmm.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,799 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include +#include +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-modem-helpers.h" +#include "mm-modem-helpers-xmm.h" + +#define g_assert_cmpfloat_tolerance(val1, val2, tolerance) \ + g_assert_cmpfloat (fabs (val1 - val2), <, tolerance) + +/*****************************************************************************/ +/* Test XACT=? responses */ + +static void +validate_xact_test_response (const gchar *response, + const MMModemModeCombination *expected_modes, + guint n_expected_modes, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + GError *error = NULL; + GArray *modes = NULL; + GArray *bands = NULL; + gboolean ret; + guint i; + + ret = mm_xmm_parse_xact_test_response (response, &modes, &bands, &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert_cmpuint (modes->len, ==, n_expected_modes); + for (i = 0; i < modes->len; i++) { + MMModemModeCombination mode; + guint j; + gboolean found = FALSE; + + mode = g_array_index (modes, MMModemModeCombination, i); + for (j = 0; !found && j < n_expected_modes; j++) + found = (mode.allowed == expected_modes[j].allowed && mode.preferred == expected_modes[j].preferred); + g_assert (found); + } + g_array_unref (modes); + + g_assert_cmpuint (bands->len, ==, n_expected_bands); + for (i = 0; i < bands->len; i++) { + MMModemBand band; + guint j; + gboolean found = FALSE; + + band = g_array_index (bands, MMModemBand, i); + for (j = 0; !found && j < n_expected_bands; j++) + found = (band == expected_bands[j]); + g_assert (found); + } + g_array_unref (bands); +} + +static void +test_xact_test_4g_only (void) +{ + const gchar *response = + "+XACT: " + "(0-6),(0-2),0," + "101,102,103,104,105,107,108,111,112,113,117,118,119,120,121,126,128,129,130,138,139,140,141,166"; + + static const MMModemModeCombination expected_modes[] = { + { MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + }; + + static const MMModemBand expected_bands[] = { + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_13, + MM_MODEM_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_21, + MM_MODEM_BAND_EUTRAN_26, MM_MODEM_BAND_EUTRAN_28, MM_MODEM_BAND_EUTRAN_29, MM_MODEM_BAND_EUTRAN_30, MM_MODEM_BAND_EUTRAN_38, + MM_MODEM_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_66 + }; + + /* NOTE: 2G and 3G modes are reported in XACT but no 2G or 3G frequencies supported */ + validate_xact_test_response (response, + expected_modes, G_N_ELEMENTS (expected_modes), + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_xact_test_3g_4g (void) +{ + const gchar *response = + "+XACT: " + "(0-6),(0-2),0," + "1,2,4,5,8," + "101,102,103,104,105,107,108,111,112,113,117,118,119,120,121,126,128,129,130,138,139,140,141,166"; + + static const MMModemModeCombination expected_modes[] = { + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + }; + + static const MMModemBand expected_bands[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_8, + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_13, + MM_MODEM_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_21, + MM_MODEM_BAND_EUTRAN_26, MM_MODEM_BAND_EUTRAN_28, MM_MODEM_BAND_EUTRAN_29, MM_MODEM_BAND_EUTRAN_30, MM_MODEM_BAND_EUTRAN_38, + MM_MODEM_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_66 + }; + + /* NOTE: 2G modes are reported in XACT but no 2G frequencies supported */ + validate_xact_test_response (response, + expected_modes, G_N_ELEMENTS (expected_modes), + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_xact_test_2g_3g_4g (void) +{ + const gchar *response = + "+XACT: " + "(0-6),(0-2),0," + "900,1800,1900,850," + "1,2,4,5,8," + "101,102,103,104,105,107,108,111,112,113,117,118,119,120,121,126,128,129,130,138,139,140,141,166"; + + static const MMModemModeCombination expected_modes[] = { + { MM_MODEM_MODE_2G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_NONE }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_2G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_3G }, + { MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, MM_MODEM_MODE_4G }, + }; + + static const MMModemBand expected_bands[] = { + MM_MODEM_BAND_EGSM, MM_MODEM_BAND_DCS, MM_MODEM_BAND_PCS, MM_MODEM_BAND_G850, + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_8, + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_13, + MM_MODEM_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_21, + MM_MODEM_BAND_EUTRAN_26, MM_MODEM_BAND_EUTRAN_28, MM_MODEM_BAND_EUTRAN_29, MM_MODEM_BAND_EUTRAN_30, MM_MODEM_BAND_EUTRAN_38, + MM_MODEM_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_66 + }; + + validate_xact_test_response (response, + expected_modes, G_N_ELEMENTS (expected_modes), + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +/*****************************************************************************/ +/* Test XACT? responses */ + +static void +validate_xact_query_response (const gchar *response, + const MMModemModeCombination *expected_mode, + const MMModemBand *expected_bands, + guint n_expected_bands) +{ + GError *error = NULL; + GArray *bands = NULL; + gboolean ret; + guint i; + + MMModemModeCombination mode = { + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + }; + + ret = mm_xmm_parse_xact_query_response (response, &mode, &bands, &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert_cmpuint (mode.allowed, ==, expected_mode->allowed); + g_assert_cmpuint (mode.preferred, ==, expected_mode->preferred); + + g_assert_cmpuint (bands->len, ==, n_expected_bands); + for (i = 0; i < bands->len; i++) { + MMModemBand band; + guint j; + gboolean found = FALSE; + + band = g_array_index (bands, MMModemBand, i); + for (j = 0; !found && j < n_expected_bands; j++) + found = (band == expected_bands[j]); + g_assert (found); + } + g_array_unref (bands); +} + +static void +test_xact_query_3g_only (void) +{ + const gchar *response = + "+XACT: " + "1,1,," + "1,2,4,5,8," + "101,102,103,104,105,107,108,111,112,113,117,118,119,120,121,126,128,129,130,138,139,140,141,166"; + + static const MMModemModeCombination expected_mode = { + .allowed = MM_MODEM_MODE_3G, + .preferred = MM_MODEM_MODE_NONE + }; + + static const MMModemBand expected_bands[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_8, + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_13, + MM_MODEM_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_21, + MM_MODEM_BAND_EUTRAN_26, MM_MODEM_BAND_EUTRAN_28, MM_MODEM_BAND_EUTRAN_29, MM_MODEM_BAND_EUTRAN_30, MM_MODEM_BAND_EUTRAN_38, + MM_MODEM_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_66 + }; + + validate_xact_query_response (response, + &expected_mode, + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +static void +test_xact_query_3g_4g (void) +{ + const gchar *response = + "+XACT: " + "4,1,2," + "1,2,4,5,8," + "101,102,103,104,105,107,108,111,112,113,117,118,119,120,121,126,128,129,130,138,139,140,141,166"; + + static const MMModemModeCombination expected_mode = { + .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_3G + }; + + static const MMModemBand expected_bands[] = { + MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_UTRAN_8, + MM_MODEM_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_5, + MM_MODEM_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_13, + MM_MODEM_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_21, + MM_MODEM_BAND_EUTRAN_26, MM_MODEM_BAND_EUTRAN_28, MM_MODEM_BAND_EUTRAN_29, MM_MODEM_BAND_EUTRAN_30, MM_MODEM_BAND_EUTRAN_38, + MM_MODEM_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_66 + }; + + validate_xact_query_response (response, + &expected_mode, + expected_bands, G_N_ELEMENTS (expected_bands)); +} + +/*****************************************************************************/ + +#define XACT_SET_TEST_MAX_BANDS 6 + +typedef struct { + MMModemMode allowed; + MMModemMode preferred; + MMModemBand bands[XACT_SET_TEST_MAX_BANDS]; + const gchar *expected_command; +} XactSetTest; + +static const XactSetTest set_tests[] = { + { + /* 2G-only, no explicit bands */ + .allowed = MM_MODEM_MODE_2G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=0,," + }, + { + /* 3G-only, no explicit bands */ + .allowed = MM_MODEM_MODE_3G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=1,," + }, + { + /* 4G-only, no explicit bands */ + .allowed = MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=2,," + }, + { + /* 2G+3G, none preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=3,," + }, + { + /* 2G+3G, 2G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, + .preferred = MM_MODEM_MODE_2G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=3,0," + }, + { + /* 2G+3G, 3G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G, + .preferred = MM_MODEM_MODE_3G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=3,1," + }, + { + /* 3G+4G, none preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=4,," + }, + { + /* 3G+4G, 3G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_3G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=4,1," + }, + { + /* 3G+4G, 4G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_4G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=4,2," + }, + { + /* 2G+4G, none preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=5,," + }, + { + /* 2G+4G, 2G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_2G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=5,0," + }, + { + /* 2G+4G, 4G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_4G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=5,2," + }, + { + /* 2G+3G+4G, none preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=6,," + }, + { + /* 2G+3G+4G, 2G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_2G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=6,0," + }, + { + /* 2G+3G+4G, 3G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_3G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=6,1," + }, + { + /* 2G+3G+4G, 4G preferred, no explicit bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_4G, + .bands = { [0] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=6,2," + }, + { + /* 2G bands, no explicit modes */ + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_EGSM, + [1] = MM_MODEM_BAND_DCS, + [2] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=,,,900,1800" + }, + { + /* 3G bands, no explicit modes */ + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_UTRAN_1, + [1] = MM_MODEM_BAND_UTRAN_2, + [2] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=,,,1,2" + }, + { + /* 4G bands, no explicit modes */ + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_EUTRAN_1, + [1] = MM_MODEM_BAND_EUTRAN_2, + [2] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=,,,101,102" + }, + { + /* 2G, 3G and 4G bands, no explicit modes */ + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_EGSM, + [1] = MM_MODEM_BAND_DCS, + [2] = MM_MODEM_BAND_UTRAN_1, + [3] = MM_MODEM_BAND_UTRAN_2, + [4] = MM_MODEM_BAND_EUTRAN_1, + [5] = MM_MODEM_BAND_EUTRAN_2 }, + .expected_command = "+XACT=,,,900,1800,1,2,101,102" + }, + { + /* Auto bands, no explicit modes */ + .allowed = MM_MODEM_MODE_NONE, + .preferred = MM_MODEM_MODE_NONE, + .bands = { [0] = MM_MODEM_BAND_ANY, + [1] = MM_MODEM_BAND_UNKNOWN }, + .expected_command = "+XACT=,,,0" + }, + + { + /* 2G+3G+4G with 4G preferred, and 2G+3G+4G bands */ + .allowed = MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G, + .preferred = MM_MODEM_MODE_4G, + .bands = { [0] = MM_MODEM_BAND_EGSM, + [1] = MM_MODEM_BAND_DCS, + [2] = MM_MODEM_BAND_UTRAN_1, + [3] = MM_MODEM_BAND_UTRAN_2, + [4] = MM_MODEM_BAND_EUTRAN_1, + [5] = MM_MODEM_BAND_EUTRAN_2 }, + .expected_command = "+XACT=6,2,,900,1800,1,2,101,102" + }, +}; + +static void +validate_xact_set_command (const MMModemMode allowed, + const MMModemMode preferred, + const MMModemBand *bands, + guint n_bands, + const gchar *expected_command) +{ + gchar *command; + MMModemModeCombination mode; + GArray *bandsarray = NULL; + GError *error = NULL; + + if (n_bands) + bandsarray = g_array_append_vals (g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands), bands, n_bands); + + mode.allowed = allowed; + mode.preferred = preferred; + + command = mm_xmm_build_xact_set_command ((mode.allowed != MM_MODEM_MODE_NONE) ? &mode : NULL, bandsarray, &error); + g_assert_no_error (error); + g_assert (command); + + g_assert_cmpstr (command, == , expected_command); + + g_free (command); + if (bandsarray) + g_array_unref (bandsarray); +} + +static void +test_xact_set (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (set_tests); i++) { + guint n_bands = 0; + guint j; + + for (j = 0; j < XACT_SET_TEST_MAX_BANDS; j++) { + if (set_tests[i].bands[j] != MM_MODEM_BAND_UNKNOWN) + n_bands++; + } + + validate_xact_set_command (set_tests[i].allowed, + set_tests[i].preferred, + set_tests[i].bands, + n_bands, + set_tests[i].expected_command); + } +} + +/*****************************************************************************/ +/* Test +XCESQ responses */ + +typedef struct { + const gchar *str; + + gboolean gsm_info; + guint rxlev; + gdouble rssi; + guint ber; + + gboolean umts_info; + guint rscp_level; + gdouble rscp; + guint ecn0_level; + gdouble ecio; + + gboolean lte_info; + guint rsrq_level; + gdouble rsrq; + guint rsrp_level; + gdouble rsrp; + gint rssnr_level; + gdouble rssnr; +} XCesqResponseTest; + +static const XCesqResponseTest xcesq_response_tests[] = { + { + .str = "+XCESQ: 0,99,99,255,255,19,46,32", + .gsm_info = FALSE, .rxlev = 99, .ber = 99, + .umts_info = FALSE, .rscp_level = 255, .ecn0_level = 255, + .lte_info = TRUE, .rsrq_level = 19, .rsrq = -10.5, .rsrp_level = 46, .rsrp = -95.0, .rssnr_level = 32, .rssnr = 16.0 + }, + { + .str = "+XCESQ: 0,99,99,255,255,19,46,-32", + .gsm_info = FALSE, .rxlev = 99, .ber = 99, + .umts_info = FALSE, .rscp_level = 255, .ecn0_level = 255, + .lte_info = TRUE, .rsrq_level = 19, .rsrq = -10.5, .rsrp_level = 46, .rsrp = -95.0, .rssnr_level = -32, .rssnr = -16.0 + }, + { + .str = "+XCESQ: 0,99,99,255,255,16,47,28", + .gsm_info = FALSE, .rxlev = 99, .ber = 99, + .umts_info = FALSE, .rscp_level = 255, .ecn0_level = 255, + .lte_info = TRUE, .rsrq_level = 16, .rsrq = -12.0, .rsrp_level = 47, .rsrp = -94.0, .rssnr_level = 28, .rssnr = 14.0 + }, + { + .str = "+XCESQ: 0,99,99,41,29,255,255,255", + .gsm_info = FALSE, .rxlev = 99, .ber = 99, + .umts_info = TRUE, .rscp_level = 41, .rscp = -80.0, .ecn0_level = 29, .ecio = -10.0, + .lte_info = FALSE, .rsrq_level = 255, .rsrp_level = 255, .rssnr_level = 255 + }, + { + .str = "+XCESQ: 0,10,6,255,255,255,255,255", + .gsm_info = TRUE, .rxlev = 10, .rssi = -101.0, .ber = 6, + .umts_info = FALSE, .rscp_level = 255, .ecn0_level = 255, + .lte_info = FALSE, .rsrq_level = 255, .rsrp_level = 255, .rssnr_level = 255 + } +}; + +static void +test_xcesq_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xcesq_response_tests); i++) { + GError *error = NULL; + gboolean success; + guint rxlev = G_MAXUINT; + guint ber = G_MAXUINT; + guint rscp = G_MAXUINT; + guint ecn0 = G_MAXUINT; + guint rsrq = G_MAXUINT; + guint rsrp = G_MAXUINT; + gint rssnr = G_MAXUINT; + + success = mm_xmm_parse_xcesq_query_response (xcesq_response_tests[i].str, + &rxlev, &ber, + &rscp, &ecn0, + &rsrq, &rsrp, + &rssnr, &error); + g_assert_no_error (error); + g_assert (success); + + g_assert_cmpuint (xcesq_response_tests[i].rxlev, ==, rxlev); + g_assert_cmpuint (xcesq_response_tests[i].ber, ==, ber); + g_assert_cmpuint (xcesq_response_tests[i].rscp_level, ==, rscp); + g_assert_cmpuint (xcesq_response_tests[i].ecn0_level, ==, ecn0); + g_assert_cmpuint (xcesq_response_tests[i].rsrq_level, ==, rsrq); + g_assert_cmpuint (xcesq_response_tests[i].rsrp_level, ==, rsrp); + g_assert_cmpuint (xcesq_response_tests[i].rssnr_level, ==, rssnr); + } +} + +static void +test_xcesq_response_to_signal (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xcesq_response_tests); i++) { + GError *error = NULL; + gboolean success; + MMSignal *gsm = NULL; + MMSignal *umts = NULL; + MMSignal *lte = NULL; + + success = mm_xmm_xcesq_response_to_signal_info (xcesq_response_tests[i].str, + &gsm, &umts, <e, + &error); + g_assert_no_error (error); + g_assert (success); + + if (xcesq_response_tests[i].gsm_info) { + g_assert (gsm); + g_assert_cmpfloat_tolerance (mm_signal_get_rssi (gsm), xcesq_response_tests[i].rssi, 0.1); + g_object_unref (gsm); + } else + g_assert (!gsm); + + if (xcesq_response_tests[i].umts_info) { + g_assert (umts); + g_assert_cmpfloat_tolerance (mm_signal_get_rscp (umts), xcesq_response_tests[i].rscp, 0.1); + g_assert_cmpfloat_tolerance (mm_signal_get_ecio (umts), xcesq_response_tests[i].ecio, 0.1); + g_object_unref (umts); + } else + g_assert (!umts); + + if (xcesq_response_tests[i].lte_info) { + g_assert (lte); + g_assert_cmpfloat_tolerance (mm_signal_get_rsrq (lte), xcesq_response_tests[i].rsrq, 0.1); + g_assert_cmpfloat_tolerance (mm_signal_get_rsrp (lte), xcesq_response_tests[i].rsrp, 0.1); + g_assert_cmpfloat_tolerance (mm_signal_get_snr (lte), xcesq_response_tests[i].rssnr, 0.1); + g_object_unref (lte); + } else + g_assert (!lte); + } +} + +/*****************************************************************************/ +/* AT+XLCSLSR=? response parser */ + +typedef struct { + const gchar *response; + gboolean expected_transport_protocol_invalid_supported; + gboolean expected_transport_protocol_supl_supported; + gboolean expected_standalone_position_mode_supported; + gboolean expected_ms_assisted_based_position_mode_supported; + gboolean expected_loc_response_type_nmea_supported; + gboolean expected_gnss_type_gps_glonass_supported; +} XlcslsrTest; + +static XlcslsrTest xlcslsr_tests[] = { + { + "+XLCSLSR:(0-2),(0-3), ,(0-1), ,(0-1),(0-7200),(0-255),(0-1),(0-2),(1-256),(0-1)", + TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, + }, + { + "+XLCSLSR:(0,1,2),(0,1,2,3), ,(0,1), ,(0,1),(0-7200),(0-255),(0,1),(0,1,2),(1-256),(0,1)", + TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, + }, + { + "+XLCSLSR:(0-1),(0-2), ,(0,1), ,(0,1),(0 -7200),(0-255),(0-1),(0),(1-256),(1)", + FALSE, TRUE, FALSE, TRUE, FALSE, FALSE + }, +}; + +static void +test_xlcslsr_test (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xlcslsr_tests); i++) { + GError *error = NULL; + gboolean ret; + gboolean transport_protocol_invalid_supported; + gboolean transport_protocol_supl_supported; + gboolean standalone_position_mode_supported; + gboolean ms_assisted_based_position_mode_supported; + gboolean loc_response_type_nmea_supported; + gboolean gnss_type_gps_glonass_supported; + + ret = mm_xmm_parse_xlcslsr_test_response (xlcslsr_tests[i].response, + &transport_protocol_invalid_supported, + &transport_protocol_supl_supported, + &standalone_position_mode_supported, + &ms_assisted_based_position_mode_supported, + &loc_response_type_nmea_supported, + &gnss_type_gps_glonass_supported, + &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert (transport_protocol_invalid_supported == xlcslsr_tests[i].expected_transport_protocol_invalid_supported); + g_assert (transport_protocol_supl_supported == xlcslsr_tests[i].expected_transport_protocol_supl_supported); + g_assert (standalone_position_mode_supported == xlcslsr_tests[i].expected_standalone_position_mode_supported); + g_assert (ms_assisted_based_position_mode_supported == xlcslsr_tests[i].expected_ms_assisted_based_position_mode_supported); + g_assert (loc_response_type_nmea_supported == xlcslsr_tests[i].expected_loc_response_type_nmea_supported); + g_assert (gnss_type_gps_glonass_supported == xlcslsr_tests[i].expected_gnss_type_gps_glonass_supported); + } +} + +/*****************************************************************************/ +/* AT+XLCSSLP? response parser */ + +typedef struct { + const gchar *response; + const gchar *expected; +} XlcsslpQuery; + +static XlcsslpQuery xlcsslp_queries[] = { + { + "+XLCSSLP:1,\"www.spirent-lcs.com\",7275", + "www.spirent-lcs.com:7275" + }, + { + "+XLCSSLP:0,\"123.123.123.123\",7275", + "123.123.123.123:7275" + }, +}; + +static void +test_xlcsslp_queries (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (xlcsslp_queries); i++) { + GError *error = NULL; + gchar *supl_server = NULL; + gboolean ret; + + ret = mm_xmm_parse_xlcsslp_query_response (xlcsslp_queries[i].response, + &supl_server, + &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert_cmpstr (supl_server, ==, xlcsslp_queries[i].expected); + g_free (supl_server); + } +} + +/*****************************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/xmm/xact/test/4g-only", test_xact_test_4g_only); + g_test_add_func ("/MM/xmm/xact/test/3g-4g", test_xact_test_3g_4g); + g_test_add_func ("/MM/xmm/xact/test/2g-3g-4g", test_xact_test_2g_3g_4g); + + g_test_add_func ("/MM/xmm/xact/query/3g-only", test_xact_query_3g_only); + g_test_add_func ("/MM/xmm/xact/query/3g-4g", test_xact_query_3g_4g); + + g_test_add_func ("/MM/xmm/xact/set", test_xact_set); + + g_test_add_func ("/MM/xmm/xcesq/query_response", test_xcesq_response); + g_test_add_func ("/MM/xmm/xcesq/query_response_to_signal", test_xcesq_response_to_signal); + + g_test_add_func ("/MM/xmm/xlcslsr/test", test_xlcslsr_test); + + g_test_add_func ("/MM/xmm/xlcsslp/query", test_xlcsslp_queries); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/plugins/zte/77-mm-zte-port-types.rules modemmanager-1.10.0/plugins/zte/77-mm-zte-port-types.rules --- modemmanager-1.6.8/plugins/zte/77-mm-zte-port-types.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/zte/77-mm-zte-port-types.rules 2019-01-15 15:57:35.000000000 +0100 @@ -1,195 +1,194 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_zte_port_types_end" +ACTION!="add|change|move|bind", GOTO="mm_zte_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="19d2", GOTO="mm_zte_port_types" GOTO="mm_zte_port_types_end" LABEL="mm_zte_port_types" - SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0003", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0004", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0004", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0004", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0005", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0005", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0006", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0006", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0006", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0006", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0008", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0008", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0008", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0008", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0009", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0009", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0009", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0009", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="000A", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="000A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="000A", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="000A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0012", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0012", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0012", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0012", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0015", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0015", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0015", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0015", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0016", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0016", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0016", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0016", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0017", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0018", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0018", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0018", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0018", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0019", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0019", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0019", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0019", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0021", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0021", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0021", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0021", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0024", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0024", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0024", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0024", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0025", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0025", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0025", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0025", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0030", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0030", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0030", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0030", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0031", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0033", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0037", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0037", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0037", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0037", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0039", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0039", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0039", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0039", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0042", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0042", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0042", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0042", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0043", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0043", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0043", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0043", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0048", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0048", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0048", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0048", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0049", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0049", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0049", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0049", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0052", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0052", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0052", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0052", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0054", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0054", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0054", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0054", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0055", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0055", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0055", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0055", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0057", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0057", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0057", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0057", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0058", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0058", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0058", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0058", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0063", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0063", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0063", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0063", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0064", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0064", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0064", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0064", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0066", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0066", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0066", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0066", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0078", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0078", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0078", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0078", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0082", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0082", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0082", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0082", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0091", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0091", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0091", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0091", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0108", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0108", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0108", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0108", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0117", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0117", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0117", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0117", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0118", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0118", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0118", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0118", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0122", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0122", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0122", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0122", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0123", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0123", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0123", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0123", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0124", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0125", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0125", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0125", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0125", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0126", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0126", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0126", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0126", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0128", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0128", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0128", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0128", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0156", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0156", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0156", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0156", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1007", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1007", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1007", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1007", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1008", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1008", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1008", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1008", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1010", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1254", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1515", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1515", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1515", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1515", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2002", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2002", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2002", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2002", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1" -ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" +ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2003", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" # Icera-based devices that use DHCP, not AT%IPDPADDR ATTRS{product}=="K3805-z", ENV{ID_MM_ZTE_ICERA_DHCP}="1" diff -Nru modemmanager-1.6.8/plugins/zte/mm-broadband-modem-zte.c modemmanager-1.10.0/plugins/zte/mm-broadband-modem-zte.c --- modemmanager-1.6.8/plugins/zte/mm-broadband-modem-zte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/zte/mm-broadband-modem-zte.c 2019-01-15 15:57:35.000000000 +0100 @@ -56,15 +56,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return (MMUnlockRetries *) g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_unlock_retries_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { const gchar *response; GError *error = NULL; @@ -73,9 +71,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) { mm_dbg ("Couldn't query unlock retries: '%s'", error->message); - g_simple_async_result_take_error (operation_result, error); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -86,18 +83,15 @@ retries = mm_unlock_retries_new (); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PIN, pin1); mm_unlock_retries_set (retries, MM_MODEM_LOCK_SIM_PUK, puk1); - g_simple_async_result_set_op_res_gpointer (operation_result, - retries, - (GDestroyNotify)g_object_unref); + g_task_return_pointer (task, retries, g_object_unref); } else { - g_simple_async_result_set_error (operation_result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid unlock retries response: '%s'", - response); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Invalid unlock retries response: '%s'", + response); } - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_object_unref (task); } static void @@ -111,52 +105,41 @@ 3, FALSE, (GAsyncReadyCallback)load_unlock_retries_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_unlock_retries)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* After SIM unlock (Modem interface) */ typedef struct { - MMBroadbandModemZte *self; - GSimpleAsyncResult *result; guint retries; } ModemAfterSimUnlockContext; -static void -modem_after_sim_unlock_context_complete_and_free (ModemAfterSimUnlockContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean modem_after_sim_unlock_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void modem_after_sim_unlock_context_step (ModemAfterSimUnlockContext *ctx); +static void modem_after_sim_unlock_context_step (GTask *task); static gboolean -cpms_timeout_cb (ModemAfterSimUnlockContext *ctx) +cpms_timeout_cb (GTask *task) { + ModemAfterSimUnlockContext *ctx; + + ctx = g_task_get_task_data (task); ctx->retries--; - modem_after_sim_unlock_context_step (ctx); + modem_after_sim_unlock_context_step (task); return G_SOURCE_REMOVE; } static void cpms_try_ready (MMBaseModem *self, GAsyncResult *res, - ModemAfterSimUnlockContext *ctx) + GTask *task) { GError *error = NULL; @@ -165,7 +148,7 @@ MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY)) { /* Retry in 2 seconds */ - g_timeout_add_seconds (2, (GSourceFunc)cpms_timeout_cb, ctx); + g_timeout_add_seconds (2, (GSourceFunc)cpms_timeout_cb, task); g_error_free (error); return; } @@ -174,30 +157,36 @@ g_error_free (error); /* Well, we're done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - modem_after_sim_unlock_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -modem_after_sim_unlock_context_step (ModemAfterSimUnlockContext *ctx) +modem_after_sim_unlock_context_step (GTask *task) { + MMBroadbandModemZte *self; + ModemAfterSimUnlockContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->retries == 0) { /* Well... just return without error */ - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Consumed all attempts to wait for SIM not being busy"); - modem_after_sim_unlock_context_complete_and_free (ctx); + g_object_unref (task); return; } - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "+CPMS?", 3, FALSE, (GAsyncReadyCallback)cpms_try_ready, - ctx); + task); } static void @@ -206,21 +195,20 @@ gpointer user_data) { ModemAfterSimUnlockContext *ctx; + GTask *task; - ctx = g_new0 (ModemAfterSimUnlockContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + ctx = g_new (ModemAfterSimUnlockContext, 1); ctx->retries = 3; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* Attempt to disable floods of "+ZUSIMR:2" unsolicited responses that * eventually fill up the device's buffers and make it crash. Normally * done during probing, but if the device has a PIN enabled it won't * accept the +CPMS? during the probe and we have to do it here. */ - modem_after_sim_unlock_context_step (ctx); + modem_after_sim_unlock_context_step (task); } /*****************************************************************************/ @@ -257,16 +245,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; GArray *all; @@ -276,9 +261,8 @@ all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -323,9 +307,8 @@ g_array_unref (all); g_array_unref (combinations); - g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); } static void @@ -337,10 +320,7 @@ iface_modem_parent->load_supported_modes ( MM_IFACE_MODEM (self), (GAsyncReadyCallback)parent_load_supported_modes_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_supported_modes)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -425,8 +405,7 @@ g_assert_not_reached (); done: - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); if (r) g_regex_unref (r); @@ -454,13 +433,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allowed_mode_update_ready (MMBroadbandModemZte *self, GAsyncResult *res, - GSimpleAsyncResult *operation_result) + GTask *task) { GError *error = NULL; @@ -468,11 +447,10 @@ if (error) /* Let the error be critical. */ - g_simple_async_result_take_error (operation_result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (operation_result, TRUE); - g_simple_async_result_complete (operation_result); - g_object_unref (operation_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -482,15 +460,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; gint cm_mode = -1; gint pref_acq = -1; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); + task = g_task_new (self, NULL, callback, user_data); if (allowed == MM_MODEM_MODE_2G) { cm_mode = 1; @@ -526,18 +501,17 @@ allowed_str = mm_modem_mode_build_string_from_mask (allowed); preferred_str = mm_modem_mode_build_string_from_mask (preferred); - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Requested mode (allowed: '%s', preferred: '%s') not " - "supported by the modem.", - allowed_str, - preferred_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Requested mode (allowed: '%s', preferred: '%s') not " + "supported by the modem.", + allowed_str, + preferred_str); + g_object_unref (task); + g_free (allowed_str); g_free (preferred_str); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); return; } @@ -548,7 +522,7 @@ 3, FALSE, (GAsyncReadyCallback)allowed_mode_update_ready, - result); + task); g_free (command); } @@ -616,28 +590,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ mm_common_zte_set_unsolicited_events_handlers (MM_BROADBAND_MODEM (self), MM_BROADBAND_MODEM_ZTE (self)->priv->unsolicited_setup, TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -645,33 +617,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + task); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -679,12 +647,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own cleanup first */ mm_common_zte_set_unsolicited_events_handlers (MM_BROADBAND_MODEM (self), @@ -695,7 +660,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/zte/mm-broadband-modem-zte-icera.c modemmanager-1.10.0/plugins/zte/mm-broadband-modem-zte-icera.c --- modemmanager-1.6.8/plugins/zte/mm-broadband-modem-zte-icera.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/plugins/zte/mm-broadband-modem-zte-icera.c 2018-11-15 09:55:53.000000000 +0100 @@ -51,28 +51,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->setup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { /* Our own setup now */ mm_common_zte_set_unsolicited_events_handlers (MM_BROADBAND_MODEM (self), MM_BROADBAND_MODEM_ZTE_ICERA (self)->priv->unsolicited_setup, TRUE); - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); + g_task_return_boolean (task, TRUE); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -80,33 +78,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Chain up parent's setup */ iface_modem_3gpp_parent->setup_unsolicited_events ( self, (GAsyncReadyCallback)parent_setup_unsolicited_events_ready, - result); + task); } static void parent_cleanup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!iface_modem_3gpp_parent->cleanup_unsolicited_events_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res), TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -114,12 +108,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); /* Our own cleanup first */ mm_common_zte_set_unsolicited_events_handlers (MM_BROADBAND_MODEM (self), @@ -130,7 +121,7 @@ iface_modem_3gpp_parent->cleanup_unsolicited_events ( self, (GAsyncReadyCallback)parent_cleanup_unsolicited_events_ready, - result); + task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/plugins/zte/mm-common-zte.c modemmanager-1.10.0/plugins/zte/mm-common-zte.c --- modemmanager-1.6.8/plugins/zte/mm-common-zte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/zte/mm-common-zte.c 2018-11-15 09:55:53.000000000 +0100 @@ -106,7 +106,7 @@ ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); /* Enable unsolicited events in given port */ - for (i = 0; i < 2; i++) { + for (i = 0; i < G_N_ELEMENTS (ports); i++) { if (!ports[i]) continue; diff -Nru modemmanager-1.6.8/plugins/zte/mm-plugin-zte.c modemmanager-1.10.0/plugins/zte/mm-plugin-zte.c --- modemmanager-1.6.8/plugins/zte/mm-plugin-zte.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/plugins/zte/mm-plugin-zte.c 2019-01-15 15:57:35.000000000 +0100 @@ -61,7 +61,7 @@ static MMBaseModem * create_modem (MMPlugin *self, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -71,7 +71,7 @@ #if defined WITH_QMI if (mm_port_probe_list_has_qmi_port (probes)) { mm_dbg ("QMI-powered ZTE modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -82,7 +82,7 @@ #if defined WITH_MBIM if (mm_port_probe_list_has_mbim_port (probes)) { mm_dbg ("MBIM-powered ZTE modem found..."); - return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -91,13 +91,13 @@ #endif if (mm_port_probe_list_is_icera (probes)) - return MM_BASE_MODEM (mm_broadband_modem_zte_icera_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_zte_icera_new (uid, drivers, mm_plugin_get_name (self), vendor, product)); - return MM_BASE_MODEM (mm_broadband_modem_zte_new (sysfs_path, + return MM_BASE_MODEM (mm_broadband_modem_zte_new (uid, drivers, mm_plugin_get_name (self), vendor, @@ -110,8 +110,7 @@ MMPortProbe *probe, GError **error) { - GUdevDevice *port; - MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE; + MMKernelDevice *port; MMPortType ptype; port = mm_port_probe_peek_port (probe); @@ -126,22 +125,7 @@ return FALSE; } - if (mm_port_probe_is_at (probe)) { - /* Look for port type hints */ - if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_MODEM")) { - mm_dbg ("ZTE: AT port '%s/%s' flagged as primary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; - } else if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_PORT_TYPE_AUX")) { - mm_dbg ("ZTE: AT port '%s/%s' flagged as secondary", - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe)); - pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; - } - } - - if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) { + if (mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_ZTE_ICERA_DHCP")) { mm_dbg ("ZTE: Icera-based modem will use DHCP"); g_object_set (modem, MM_BROADBAND_MODEM_ICERA_DEFAULT_IP_METHOD, MM_BEARER_IP_METHOD_DHCP, @@ -149,11 +133,9 @@ } return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + port, ptype, - pflags, + MM_PORT_SERIAL_AT_FLAG_NONE, error); } diff -Nru modemmanager-1.6.8/po/boldquot.sed modemmanager-1.10.0/po/boldquot.sed --- modemmanager-1.6.8/po/boldquot.sed 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/boldquot.sed 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/cs.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/cs.gmo differ diff -Nru modemmanager-1.6.8/po/cs.po modemmanager-1.10.0/po/cs.po --- modemmanager-1.6.8/po/cs.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/cs.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,108 @@ +# Czech translation for ModemManager. +# Copyright (C) 2017 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# FIRST AUTHOR , YEAR. +# Marek Černocký , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-10-22 11:32+0200\n" +"PO-Revision-Date: 2017-10-21 15:32+0200\n" +"Last-Translator: Marek Černocký \n" +"Language-Team: čeština \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Ovládat démona pro správu modemů" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "Systémová zásada brání v ovládání Správy modemů." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Odemykat a ovládat mobilní širokopásmové zařízení" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"Systémová zásada brání v odemknutí nebo v ovládání mobilního širokopásmového " +"zařízení." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Přidávat, měnit a mazat kontakty v mobilním zařízení" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"Systémová zásada brání v přidání, změně nebo smazání kontaktů v tomto " +"zařízení." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Odesílat, ukládat, měnit a mazat textové zprávy" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"Systémová zásada brání v odesílání nebo v manipulaci s textovými zprávami na " +"tomto zařízení." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Přijímat příchozí hovory nebo začínat odchozí hovory" + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Systémová zásada brání v hlasových hovorech." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" +"Povolovat sdělování a zobrazování geografické polohy a informací o pozici" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"Systémová zásada brání v povolení sdělování a v zobrazení informací o " +"geografické poloze." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Dotazovat se na informace o síti a na služby a využívat je" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"Systémová zásada brání v dotazování na informace o síti a na služby, nebo " +"brání v jejich využívání." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "" +"Dotazovat se na firmware a spravovat jej na mobilním širokopásmovém zařízení" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"Systémová zásada brání v dotázání na firmware nebo brání v jeho správě na " +"tomto zařízení." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "Správa modemů potřebuje resetovat zařízení" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/de.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/de.gmo differ diff -Nru modemmanager-1.6.8/po/de.po modemmanager-1.10.0/po/de.po --- modemmanager-1.6.8/po/de.po 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/po/de.po 2018-11-15 09:55:53.000000000 +0100 @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ModemManager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-06 21:12+0100\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-08-29 09:24+0200\n" "PO-Revision-Date: 2014-01-06 21:23+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" @@ -18,65 +18,75 @@ "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.4\n" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:1 +#: data/org.freedesktop.ModemManager1.policy.in.in:13 msgid "Control the Modem Manager daemon" msgstr "Den Modem-Manager-Daemon steuern" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:2 +#: data/org.freedesktop.ModemManager1.policy.in.in:14 msgid "System policy prevents controlling the Modem Manager." msgstr "Die Systemrichtlinien verhindern die Steuerung von ModemManager." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:3 +#: data/org.freedesktop.ModemManager1.policy.in.in:22 msgid "Unlock and control a mobile broadband device" msgstr "Ein mobiles Breitbandgerät entsperren und steuern" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:4 +#: data/org.freedesktop.ModemManager1.policy.in.in:23 msgid "" "System policy prevents unlocking or controlling the mobile broadband device." msgstr "" "Die Systemrichtlinien verhindern das Entsperren oder Steuern des mobilen " "Breitbandgerätes." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:5 +#: data/org.freedesktop.ModemManager1.policy.in.in:31 msgid "Add, modify, and delete mobile broadband contacts" msgstr "Kontakte für mobiles Breitband hinzufügen, ändern und löschen" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:6 +#: data/org.freedesktop.ModemManager1.policy.in.in:32 msgid "" "System policy prevents adding, modifying, or deleting this device's contacts." msgstr "" "Die Systemrichtlinien verhindern das Hinzufügen, Ändern oder Löschen der " "Kontakte dieses Gerätes." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:7 +#: data/org.freedesktop.ModemManager1.policy.in.in:40 msgid "Send, save, modify, and delete text messages" msgstr "Textnachrichten senden, speichern, bearbeiten und löschen" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:8 +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +#, fuzzy msgid "" -"System policy prevents sending or maniuplating this device's text messages." +"System policy prevents sending or manipulating this device's text messages." msgstr "" "Die Systemrichtlinien verhindern das Senden oder Bearbeiten der " "Textnachrichten dieses Gerätes." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:9 +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +#, fuzzy +msgid "System policy prevents voice calls." +msgstr "Die Systemrichtlinien verhindern die Steuerung von ModemManager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 msgid "Enable and view geographic location and positioning information" msgstr "" "Informationen zum geografischen Standort und Positionierung aktivieren und " "anzeigen" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:10 +#: data/org.freedesktop.ModemManager1.policy.in.in:59 msgid "" "System policy prevents enabling or viewing geographic location information." msgstr "" "Die Systemrichtlinien verhindern das Aktivieren oder Ändern der " "Informationen zum geografischen Standort." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:11 +#: data/org.freedesktop.ModemManager1.policy.in.in:67 msgid "Query and utilize network information and services" msgstr "Netzwerkinformationen und -dienste abfragen und nutzen" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:12 +#: data/org.freedesktop.ModemManager1.policy.in.in:68 msgid "" "System policy prevents querying or utilizing network information and " "services." @@ -84,12 +94,16 @@ "Die Systemrichtlinien verhindern die Abfrage der Netzwerkinformationen und -" "dienste." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:13 +#: data/org.freedesktop.ModemManager1.policy.in.in:76 msgid "Query and manage firmware on a mobile broadband device" msgstr "Firmware auf mobilen Breitbandgeräten abfragen und verwalten" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:14 +#: data/org.freedesktop.ModemManager1.policy.in.in:77 msgid "System policy prevents querying or managing this device's firmware." msgstr "" "Die Systemrichtlinien verhindern die Abfrage oder Verwaltung der Firmware " "dieses Gerätes." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "" diff -Nru modemmanager-1.6.8/po/en@boldquot.header modemmanager-1.10.0/po/en@boldquot.header --- modemmanager-1.6.8/po/en@boldquot.header 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/en@boldquot.header 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff -Nru modemmanager-1.6.8/po/en@quot.header modemmanager-1.10.0/po/en@quot.header --- modemmanager-1.6.8/po/en@quot.header 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/en@quot.header 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/fr.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/fr.gmo differ diff -Nru modemmanager-1.6.8/po/fr.po modemmanager-1.10.0/po/fr.po --- modemmanager-1.6.8/po/fr.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/fr.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,105 @@ +# ModemManager translation to French. +# Copyright (C) 2018 Listed translators +# This file is distributed under the same license as the ModemManager package. +# Claude Paroz , 2018 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2018-09-13 09:33+0200\n" +"PO-Revision-Date: 2018-08-18 16:17+0200\n" +"Last-Translator: Claude Paroz \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Contrôle le service Modem Manager" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "La politique système empêche le contrôle de Modem Manager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Déverrouiller et contrôler un périphérique mobile à large bande" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"La politique système empêche le verrouillage et le contrôle d’un " +"périphérique mobile à large bande." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Ajouter, modifier et supprimer des contacts de connexions mobiles" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"La politique système empêche l’ajout, la modification ou la suppression des " +"contacts de cet appareil." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Envoyer, enregistrer, modifier et supprimer des messages textuels" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"La politique système empêche l’envoi ou la manipulation des messages " +"textuels ce cet appareil." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" +"Accepter des appels vocaux entrants ou initier des appels vocaux sortants." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "La politique système empêche les appels vocaux." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Activer et voir les informations de position géographique" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"La politique système empêche d’activer ou de voir les informations de " +"position géographique." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Interroger et utiliser les informations et services du réseau" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"La politique système empêche l’interrogation et l’utilisation des " +"informations et des services du réseau." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Interroger et gérer le matériel d’un périphérique mobile à large bande" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"La politique système empêche l’interrogation et la gestion du matériel de ce " +"périphérique." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager a besoin de réinitialiser les périphériques" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/fur.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/fur.gmo differ diff -Nru modemmanager-1.6.8/po/fur.po modemmanager-1.10.0/po/fur.po --- modemmanager-1.6.8/po/fur.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/fur.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,108 @@ +# Friulian translation for ModemManager. +# Copyright (C) 2018 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Fabio Tomat , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2018-06-19 17:58+0200\n" +"PO-Revision-Date: 2018-03-25 17:20+0200\n" +"Last-Translator: Fabio Tomat \n" +"Language-Team: Friulian \n" +"Language: fur\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Controle il demoni di Modem Manager" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "La politiche dal sisteme e impedìs il control di Modem Manager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Sbloche e controle un dispositîf a bande largje mobile" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"La politiche dal sisteme e impedìs di sblocâ o controlâ il dispositîf a " +"bande largje mobile." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Zonte, modifiche e elimine i contats de bande largje mobile" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"La politiche dal sisteme e impedìs di zontâ, modificâ o eliminâ i contats di " +"chest dispositîf." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Invie, salve, modifiche e elimine i messaçs di test" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"La politiche dal sisteme e impedìs di inviâ o manipolâ i messaçs di test di " +"chest dispositîf." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" +"Acete lis clamadis vocâls in jentrade o tacâ clamadis vocâls in jessude." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "La politiche dal sisteme e impedìs lis clamadis vocâls." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" +"Abilite e viôt la posizion gjeografiche e lis informazions su la posizion" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"La politiche dal sisteme e impedìs di abilitâ o viodi lis informazions su la " +"posizion gjeografiche." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Interoghe e dopre lis informazions di rêt e i servizis" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"La politiche dal sisteme e impedìs la interogazion e la utilizazion di " +"informazions di rêt e servizis." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "" +"Interoghe e gjestìs il firmware suntun dispositîf a bande largje mobile" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"La politiche dal sisteme e impedìs di interogâ o gjestî il firmware di chest " +"dispositîf." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager al à bisugne di ristabilî/azerâ i dispositîfs" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/hu.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/hu.gmo differ diff -Nru modemmanager-1.6.8/po/hu.po modemmanager-1.10.0/po/hu.po --- modemmanager-1.6.8/po/hu.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/hu.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,104 @@ +# Hungarian translation for modemmanager +# Copyright (C) 2017. Free Software Foundation, Inc. +# This file is distributed under the same license as the modemmanager package. +# Gabor Kelemen , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: modemmanager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-09-27 21:46+0200\n" +"PO-Revision-Date: 2017-09-26 22:02+0000\n" +"Last-Translator: Gabor Kelemen \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Modemkezelő démon vezérlése" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "A rendszer házirendje nem teszi lehetővé a Modemkezelő vezérlését." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Mobil széles sávú készülék feloldása és vezérlése" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"A rendszer házirendje nem teszi lehetővé a mobil széles sávú készülék " +"feloldását vagy vezérlését." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Névjegyek hozzáadása, módosítása és eltávolítása" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"A rendszer házirendje nem teszi lehetővé ezen az eszközön a névjegyek " +"hozzáadását, módosítását és eltávolítását." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Szöveges üzenetek küldése, mentése, módosítása és törlése" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"A rendszer házirendje nem teszi lehetővé a szöveges üzenetek küldését vagy " +"kezelését." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Bejövő hívások fogadása vagy kimenő hívások indítása." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "A rendszer házirendje nem teszi lehetővé a hívásokat." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" +"Földrajzi helyzetmeghatározás bekapcsolása és az információk megtekintése" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"A rendszer házirendje nem teszi lehetővé a földrajzi helyzetmeghatározás " +"bekapcsolását vagy az információk megtekintését." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Hálózati információk és szolgáltatások lekérdezése és használata" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"A rendszer házirendje nem teszi lehetővé a hálózati információk és " +"szolgáltatások lekérdezését és használatát." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Firmware lekérdezése és kezelése a mobil széles sávú eszközön" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"A rendszer lekérdezése és használata lehetővé a firmware lekérdezését és " +"kezelését az eszközön." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "A Modemkezelőnek alapállapotba kell állítania eszközöket" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/id.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/id.gmo differ diff -Nru modemmanager-1.6.8/po/id.po modemmanager-1.10.0/po/id.po --- modemmanager-1.6.8/po/id.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/id.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,102 @@ +# Indonesian translation for ModemManager. +# Copyright (C) 2018 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Andika Triwidada , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2018-03-04 16:56+0100\n" +"PO-Revision-Date: 2018-03-04 20:31+0700\n" +"Last-Translator: Andika Triwidada \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Kendalikan daemon Manajer Modem" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "Kebijakan sistem mencegah pengendalian Manajer Modem." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Buka kunci dan kendalikan suatu peranti data seluler" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"Kebijakan sistem mencegah membuka kunci atau mengendalikan peranti data " +"seluler." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Tambah, ubah, dan hapus kontak data seluler" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"Kebijakan sistem mencegah menambah, mengubah, atau menghapus kontak-kontak " +"peranti ini." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Kirim, simpan, ubah, dan hapus pesan-pesan teks" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"Kebijakan sistem mencegah pengiriman atau manipulasi pesan-pesan teks " +"peranti ini." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Terima panggilan suara masuk atau mulai pemanggilan suara keluar." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Kebijakan sistem mencegah panggilan suara." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Fungsikan dan tilik lokasi geografis dan informasi posisi" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"Kebijakan sistem mencegah memfungsikan atau menilik informasi lokasi " +"geografis." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Kueri dan manfaatkan layanan dan informasi jaringan" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"Kebijakan sistem mencegah kueri atau pemanfaatan layanan dan informasi " +"jaringan." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Kueri dan kelola firmware pada suatu peranti data seluler" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "Kebijakan sistem mencegah kueri atau pengelolaan firmware peranti ini." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager perlu mereset peranti" diff -Nru modemmanager-1.6.8/po/insert-header.sin modemmanager-1.10.0/po/insert-header.sin --- modemmanager-1.6.8/po/insert-header.sin 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/insert-header.sin 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/it.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/it.gmo differ diff -Nru modemmanager-1.6.8/po/it.po modemmanager-1.10.0/po/it.po --- modemmanager-1.6.8/po/it.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/it.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,107 @@ +# Italian translation for ModemManager. +# Copyright (C) 2018 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Milo Casagrande , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2018-09-13 09:33+0200\n" +"PO-Revision-Date: 2018-09-11 11:25+0200\n" +"Last-Translator: Milo Casagrande \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.1.1\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Controlla il demone di «Modem Manager»" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "La politica di sistema impedisce il controllo di «Modem Manager»" + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Sblocca e controlla un dispositivo mobile a banda larga" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"La politica di sistema impedisce di sbloccare o controllare il dispositivo " +"mobile a banda larga." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Aggiunge, modifica ed elimina contatti mobili a banda larga" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"La politica di sistema impedisce di aggiungere, modificare o eliminare i " +"contatti di questo dispositivo." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Invia, salva, modifica ed elimina messaggi di testo" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"La politica di sistema impedisce di inviare o manipolare i messaggi di testo " +"di questo dispositivo." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Accetta chiamate vocali in arrivo o avvia chiamate vocali." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "La politica di sistema impedisce di effettuare chiamate vocali." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" +"Abilita e visualizza informazioni di geolocalizzazione e posizionamento" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"La politica di sistema impedisce di abilitare o visualizzare informazioni di " +"geolocalizzazione." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Interroga e utilizza informazioni e servizi della rete" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"La politica di sistema impedisce di interrogare o di utilizzare le " +"informazioni e i servizi della rete." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "" +"Interroga e gestisce il firmware su un dispositivo mobile a banda larga" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"La politica di sistema impedisce di interrogare o gestire il firmware di " +"questo dispositivo." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager deve reimpostare i dispositivi" diff -Nru modemmanager-1.6.8/po/LINGUAS modemmanager-1.10.0/po/LINGUAS --- modemmanager-1.6.8/po/LINGUAS 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/po/LINGUAS 2018-11-15 09:55:53.000000000 +0100 @@ -1,2 +1,13 @@ +cs +de +fr +fur +hu +id +it +pl +pt_BR +sk +sv +tr uk -de \ No newline at end of file diff -Nru modemmanager-1.6.8/po/Makefile.in.in modemmanager-1.10.0/po/Makefile.in.in --- modemmanager-1.6.8/po/Makefile.in.in 2017-06-17 10:24:37.000000000 +0200 +++ modemmanager-1.10.0/po/Makefile.in.in 2019-01-17 16:15:36.000000000 +0100 @@ -1,220 +1,482 @@ -# Makefile for program source directory in GNU NLS utilities package. -# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper -# Copyright (C) 2004-2008 Rodney Dawes +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # -# This file may be copied and used freely without restrictions. It may -# be used in projects which are not available under a GNU Public License, -# but which still want to provide support for the GNU gettext functionality. +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. # -# - Modified by Owen Taylor to use GETTEXT_PACKAGE -# instead of PACKAGE and to look for po2tbl in ./ not in intl/ -# -# - Modified by jacob berkman to install -# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize -# -# - Modified by Rodney Dawes for use with intltool -# -# We have the following line for use by intltoolize: -# INTLTOOL_MAKEFILE +# Origin: gettext-0.19.8 +GETTEXT_MACRO_VERSION = 0.19 -GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -SHELL = @SHELL@ +SED = @SED@ +SHELL = /bin/sh +@SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ -top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ -datadir = @datadir@ datarootdir = @datarootdir@ -libdir = @libdir@ +datadir = @datadir@ localedir = @localedir@ -subdir = po -install_sh = @install_sh@ -# Automake >= 1.8 provides @mkdir_p@. -# Until it can be supposed, use the safe fallback: -mkdir_p = $(install_sh) -d +gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ -GMSGFMT = @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = @XGETTEXT@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot - -ALL_LINGUAS = @ALL_LINGUAS@ - -PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +# When building gettext-tools, we prefer to use the built programs +# rather than installed programs. However, we can't do that when we +# are cross compiling. +CROSS_COMPILING = @CROSS_COMPILING@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) - -USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) - -POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) +POTFILES = \ -DISTFILES = Makefile.in.in POTFILES.in $(POFILES) -EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS +CATALOGS = @CATALOGS@ -POTFILES = \ -# This comment gets stripped out +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) -CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) +# Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: -.SUFFIXES: .po .pox .gmo .mo .msg .cat - -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) -INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) -INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; - -.po.pox: - $(MAKE) $(GETTEXT_PACKAGE).pot - $(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: - $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: - $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -o $$file $< - -.po.cat: - sed -f ../intl/po2msg.sed < $< > $*.msg \ - && rm -f $@ && gencat $@ $*.msg + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ all: all-@USE_NLS@ -all-yes: $(CATALOGS) +all-yes: stamp-po all-no: -$(GETTEXT_PACKAGE).pot: $(POTFILES) - $(GENPOT) +# Ensure that the gettext macros and this Makefile.in.in are in sync. +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ + } + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po; \ + rm -f $(DOMAIN).1po; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(POFILESDEPS) + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + -install: install-data +install: install-exec install-data +install-exec: install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi install-data-no: all install-data-yes: all - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $$dir; \ - if test -r $$lang.gmo; then \ - $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ - echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ - else \ - $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ - echo "installing $(srcdir)/$$lang.gmo as" \ - "$$dir/$(GETTEXT_PACKAGE).mo"; \ - fi; \ - if test -r $$lang.gmo.m; then \ - $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ - echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ - else \ - if test -r $(srcdir)/$$lang.gmo.m ; then \ - $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ - $$dir/$(GETTEXT_PACKAGE).mo.m; \ - echo "installing $(srcdir)/$$lang.gmo.m as" \ - "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ - else \ - true; \ + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ - fi; \ + done; \ done -# Empty stubs to satisfy archaic automake needs -dvi info ctags tags CTAGS TAGS ID: +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done # Define this as empty until I found a useful application. -install-exec installcheck: +installcheck: -uninstall: - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ - rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ done -check: all $(GETTEXT_PACKAGE).pot - rm -f missing notexist - srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m - if [ -r missing -o -r notexist ]; then \ - exit 1; \ - fi +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: - rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp - rm -f .intltool-merge-cache + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o clean: mostlyclean distclean: clean - rm -f Makefile Makefile.in POTFILES stamp-it - rm -f *.mo *.msg *.cat *.cat.m *.gmo + rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f Makefile.in.in + rm -f stamp-po $(GMOFILES) -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: $(DISTFILES) +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ - extra_dists="$(EXTRA_DISTFILES)"; \ - for file in $$extra_dists; do \ - test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ - test -f $$file || file="$(srcdir)/$$file"; \ - ln $$file $(distdir) 2> /dev/null \ - || cp -p $$file $(distdir); \ + if test -f $$file; then \ + cp -p $$file $(distdir) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ done update-po: Makefile - $(MAKE) $(GETTEXT_PACKAGE).pot + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - echo "$$lang:"; \ - result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ - if $$result; then \ - if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "msgmerge for $$lang.gmo failed!"; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ fi; \ - done - -Makefile POTFILES: stamp-it - @if test ! -f $@; then \ - rm -f stamp-it; \ - $(MAKE) stamp-it; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ fi -stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ - $(SHELL) ./config.status + && @SHELL@ ./config.status $(subdir)/$@.in po-directories + +force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru modemmanager-1.6.8/po/Makevars modemmanager-1.10.0/po/Makevars --- modemmanager-1.6.8/po/Makevars 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/Makevars 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,78 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = The ModemManager developers. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = modemmanager-devel@lists.freedesktop.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = --quiet + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = no diff -Nru modemmanager-1.6.8/po/ModemManager.pot modemmanager-1.10.0/po/ModemManager.pot --- modemmanager-1.6.8/po/ModemManager.pot 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/ModemManager.pot 2019-01-17 16:15:56.000000000 +0100 @@ -0,0 +1,92 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR The ModemManager developers. +# This file is distributed under the same license as the ModemManager package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ModemManager 1.10.0\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2019-01-17 16:15+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/pl.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/pl.gmo differ diff -Nru modemmanager-1.6.8/po/pl.po modemmanager-1.10.0/po/pl.po --- modemmanager-1.6.8/po/pl.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/pl.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,109 @@ +# Polish translation for ModemManager. +# Copyright © 2017 the ModemManager authors. +# This file is distributed under the same license as the ModemManager package. +# Piotr Drąg , 2017. +# Aviary.pl , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-09-07 13:12+0200\n" +"PO-Revision-Date: 2017-09-06 19:15+0200\n" +"Last-Translator: Piotr Drąg \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Sterowanie usługą ModemManager" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "Ustawienia systemu uniemożliwiają sterowanie usługą ModemManager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Odblokowanie i sterowanie urządzeniem komórkowym" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"Ustawienia systemu uniemożliwiają odblokowanie lub sterowanie urządzeniem " +"komórkowym." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Dodawanie, modyfikowanie i usuwanie kontaktów urządzenia komórkowego" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"Ustawienia systemu uniemożliwiają dodawanie, modyfikowanie lub usuwanie " +"kontaktów tego urządzenia." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Wysyłanie, zapisywanie, modyfikowanie i usuwanie wiadomości SMS" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"Ustawienia systemu uniemożliwiają wysyłanie lub manipulowanie wiadomościami " +"SMS tego urządzenia." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Przyjmowanie połączeń przychodzących lub dzwonienie" + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Ustawienia systemu uniemożliwiają dzwonienie." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "" +"Włączanie i wyświetlanie informacji o położeniu geograficznym " +"i pozycjonowaniu" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie informacji " +"o położeniu geograficznym." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Odpytywanie i używanie informacji i usług sieciowych" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"Ustawienia systemu uniemożliwiają odpytywanie lub używanie informacji " +"i usług sieciowych." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "" +"Odpytywanie i zarządzanie oprogramowaniem sprzętowym urządzenia komórkowego" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"Ustawienia systemu uniemożliwiają odpytywanie lub zarządzanie " +"oprogramowaniem sprzętowym tego urządzenia." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "Usługa ModemManager musi ponownie uruchomić urządzenia" diff -Nru modemmanager-1.6.8/po/POTFILES.in modemmanager-1.10.0/po/POTFILES.in --- modemmanager-1.6.8/po/POTFILES.in 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/po/POTFILES.in 2018-11-15 09:55:53.000000000 +0100 @@ -1,4 +1,3 @@ -[encoding: UTF-8] # List of source files containing translatable strings. # Please keep this file sorted alphabetically. data/org.freedesktop.ModemManager1.policy.in.in diff -Nru modemmanager-1.6.8/po/POTFILES.skip modemmanager-1.10.0/po/POTFILES.skip --- modemmanager-1.6.8/po/POTFILES.skip 2017-05-30 17:17:46.000000000 +0200 +++ modemmanager-1.10.0/po/POTFILES.skip 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -data/org.freedesktop.ModemManager1.policy.in -data/tests/org.freedesktop.ModemManager1.service.in -# https://bugs.launchpad.net/intltool/+bug/1117944 -sub/data/org.freedesktop.ModemManager1.policy.in Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/pt_BR.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/pt_BR.gmo differ diff -Nru modemmanager-1.6.8/po/pt_BR.po modemmanager-1.10.0/po/pt_BR.po --- modemmanager-1.6.8/po/pt_BR.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/pt_BR.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,104 @@ +# Brazilian Portuguese translation for ModemManager. +# Copyright (C) 2017 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Rafael Fontenelle , 2017. +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-09-07 13:35+0200\n" +"PO-Revision-Date: 2017-09-05 21:49-0200\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Virtaal 1.0.0-beta1\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Controlar o daemon do ModemManager" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "A política de sistema impede de controlar o ModemManager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Desbloquear e controlar um dispositivo de banda larga móvel" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"A política de sistema impede de desbloquear ou controlar o dispositivo de " +"banda larga móvel." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Adicionar, modificar e excluir contatos de banda larga móvel" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"A política de sistema impede de adicionar, modificar ou excluir os contatos " +"deste dispositivo." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Enviar, salvar, modificar e excluir mensagens de texto" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"A política de sistema impede de enviar ou manipular as mensagens de texto " +"deste dispositivo." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Aceitar chamadas de voz recebidas ou iniciar chamadas de voz de saída." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "A política de sistema impede chamadas de voz." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Habilitar e ver informações de posicionamento e localização geográfica" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"A política de sistema impede de habilitar ou ver informações de localização " +"geográfica." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Consultar ou utilizar serviços e informações de rede." + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"A política de sistema impede de consultar ou utilizar serviços e informações " +"de rede." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Consultar e gerenciar firmware em um dispositivo de banda larga móvel" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"A política de sistema impede de consultar ou gerenciar o firmware do " +"dispositivo." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "O ModemManager precisa reiniciar os dispositivos" diff -Nru modemmanager-1.6.8/po/quot.sed modemmanager-1.10.0/po/quot.sed --- modemmanager-1.6.8/po/quot.sed 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/quot.sed 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff -Nru modemmanager-1.6.8/po/remove-potcdate.sin modemmanager-1.10.0/po/remove-potcdate.sin --- modemmanager-1.6.8/po/remove-potcdate.sin 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/remove-potcdate.sin 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff -Nru modemmanager-1.6.8/po/Rules-quot modemmanager-1.10.0/po/Rules-quot --- modemmanager-1.6.8/po/Rules-quot 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/Rules-quot 2019-01-17 16:15:36.000000000 +0100 @@ -0,0 +1,58 @@ +# This file, Rules-quot, can be copied and used freely without restrictions. +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/sk.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/sk.gmo differ diff -Nru modemmanager-1.6.8/po/sk.po modemmanager-1.10.0/po/sk.po --- modemmanager-1.6.8/po/sk.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/sk.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,108 @@ +# Slovak translation for ModemManager. +# Copyright (C) 2017 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Dušan Kazik , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-09-16 10:32-0700\n" +"PO-Revision-Date: 2017-09-16 08:51+0200\n" +"Last-Translator: Dušan Kazik \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n" +"X-Generator: Poedit 2.0.3\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Ovládanie služby správcu modemov" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "Politika systému zabraňuje ovládaniu správcu modemov." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Odomknutie a ovládanie mobilného širokopásmového zariadenia" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"Politika systému zabraňuje odomknutiu alebo ovládaniu mobilného " +"širokopásmového zariadenia." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "" +"Pridanie, úprava a odstránenie kontaktov mobilného širokopásmového zariadenia" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"Politika systému zabraňuje pridaniu, úprave, alebo odstráneniu kontaktov v " +"tomto zariadení." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Odoslanie, uloženie, úprava a odstránenie textových správ" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"Politika systému zabraňuje odoslaniu, alebo manipulácii textových správ v " +"tomto zariadení." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" +"Prijatie prichádzajúcich hovorov, alebo zahájenie odchádzajúcich hlasových " +"hovorov." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Politika systému zabraňuje hlasovým hovorom." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Povolenie a zobrazenie geografickej polohy a informácií o pozícii" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"Politika systému zabraňuje povoleniu, alebo zobrazeniu informácií o " +"geografickej polohe." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Požadovanie a spracovanie sieťových informácií a služieb" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"Politika systému zabraňuje požadovaniu, alebo spracovaniu sieťových " +"informácií a službám." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Požadovanie a správa firmvéru mobilného širokopásmového zariadenia" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"Politika systému zabraňuje požadovaniu, alebo správe firmvéru tohto " +"zariadenia." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "Služba ModemManager vyžaduje obnovenie zariadení" diff -Nru modemmanager-1.6.8/po/stamp-po modemmanager-1.10.0/po/stamp-po --- modemmanager-1.6.8/po/stamp-po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/stamp-po 2019-01-17 16:15:56.000000000 +0100 @@ -0,0 +1 @@ +timestamp Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/sv.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/sv.gmo differ diff -Nru modemmanager-1.6.8/po/sv.po modemmanager-1.10.0/po/sv.po --- modemmanager-1.6.8/po/sv.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/sv.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,105 @@ +# Swedish translation for ModemManager. +# Copyright (C) 2017 ModemManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the ModemManager package. +# Josef Andersson , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: ModemManager master\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-12-05 10:49+0100\n" +"PO-Revision-Date: 2017-12-04 20:28+0100\n" +"Last-Translator: Josef Andersson \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.0.4\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Kontrollera demonen för Modem Manager" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "En systempolicy förhindrar kontroll av Modem Manager." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Lås upp och kontrollera en mobil bredbandsenhet" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"En systempolicy hindrar upplåsning eller kontroll över den mobila " +"bredbandsenheten." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Lägg till, ändra och ta bort mobila bredbandskontakter" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"En systempolicy förhindrar att lägga till, ändra och ta bort denna enhets " +"kontakter." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Skicka, spara, ändra och ta bort meddelanden" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"En systempolicy förhindrar att skicka eller ändra denna enhets " +"textmeddelanden." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Acceptera inkommande röstsamtal eller påbörja utgående röstsamtal." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "En systempolicy förhindrar röstsamtal." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Aktivera och visa geografisk plats samt positioneringsinformation" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"En systempolicy förhindrar aktivering eller visning av geografisk " +"platsinformation." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Fråga och nyttja nätverksinformation och tjänster" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"En systempolicy förhindrar frågande och nyttjande av nätverksinformation och " +"tjänster." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Fråga och hantera fast programvara för en mobil bredbandsenhet" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"En systempolicy förhindrar att fråga och hantera denna enhets fasta " +"programvara." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager behöver starta om enheter" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/tr.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/tr.gmo differ diff -Nru modemmanager-1.6.8/po/tr.po modemmanager-1.10.0/po/tr.po --- modemmanager-1.6.8/po/tr.po 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/po/tr.po 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,105 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Emin Tufan Çetin , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2018-08-14 11:06+0200\n" +"PO-Revision-Date: 2018-06-23 18:53+0300\n" +"Last-Translator: Emin Tufan Çetin \n" +"Language-Team: Türkçe \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: data/org.freedesktop.ModemManager1.policy.in.in:13 +msgid "Control the Modem Manager daemon" +msgstr "Modem Manager artalan uygulamasını denetle" + +#: data/org.freedesktop.ModemManager1.policy.in.in:14 +msgid "System policy prevents controlling the Modem Manager." +msgstr "Sistem ilkesi Modem Manager'ı denetlemeyi engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:22 +msgid "Unlock and control a mobile broadband device" +msgstr "Mobil geniş bant aygıtının kilidini aç ve denetle" + +#: data/org.freedesktop.ModemManager1.policy.in.in:23 +msgid "" +"System policy prevents unlocking or controlling the mobile broadband device." +msgstr "" +"Sistem ilkesi mobil geniş bant aygıtını denetlemeyi veya kilidini açmayı " +"engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:31 +msgid "Add, modify, and delete mobile broadband contacts" +msgstr "Mobil geniş bant kişileri ekle, düzenle ve sil" + +#: data/org.freedesktop.ModemManager1.policy.in.in:32 +msgid "" +"System policy prevents adding, modifying, or deleting this device's contacts." +msgstr "" +"Sistem ilkesi bu aygıtın kişilerini eklemeyi, düzenlemeyi veya silmeyi " +"engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:40 +msgid "Send, save, modify, and delete text messages" +msgstr "Metin ileti gönder, kaydet, düzenle ve sil" + +#: data/org.freedesktop.ModemManager1.policy.in.in:41 +msgid "" +"System policy prevents sending or manipulating this device's text messages." +msgstr "" +"Sistem ilkesi bu aygıtın metin iletilerini göndermeyi veya işlemeyi " +"engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "Gelen sesli çağrıları kabul et veya giden sesli çağrılar başlat." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Sistem ilkesi sesli çağrıları engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 +msgid "Enable and view geographic location and positioning information" +msgstr "Coğrafi konum ve konumlandırma bilgisini etkinleştir ve gör" + +#: data/org.freedesktop.ModemManager1.policy.in.in:59 +msgid "" +"System policy prevents enabling or viewing geographic location information." +msgstr "" +"Sistem ilkesi coğrafi konum bilgisini etkinleştirmeyi ve göstermeyi " +"engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:67 +msgid "Query and utilize network information and services" +msgstr "Ağ bilgisi ve hizmetleri sorgula ve yararlan" + +#: data/org.freedesktop.ModemManager1.policy.in.in:68 +msgid "" +"System policy prevents querying or utilizing network information and " +"services." +msgstr "" +"Sistem ilkesi ağ bilgisini ve hizmetleri sorgulamayı veya yararlanmayı " +"engelliyor." + +#: data/org.freedesktop.ModemManager1.policy.in.in:76 +msgid "Query and manage firmware on a mobile broadband device" +msgstr "Mobil geniş bant aygıtındaki donanım yazılımını sorgula ve yönet" + +#: data/org.freedesktop.ModemManager1.policy.in.in:77 +msgid "System policy prevents querying or managing this device's firmware." +msgstr "" +"Sistem ilkesi bu aygıtın donanım yazılımını sorgulamayı veya yönetmeyi " +"engelliyor." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager'in aygıtları sıfırlaması gerekiyor" Binary files /tmp/MWxrK5Qgio/modemmanager-1.6.8/po/uk.gmo and /tmp/afxJqk3oQR/modemmanager-1.10.0/po/uk.gmo differ diff -Nru modemmanager-1.6.8/po/uk.po modemmanager-1.10.0/po/uk.po --- modemmanager-1.6.8/po/uk.po 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/po/uk.po 2018-11-15 09:55:53.000000000 +0100 @@ -2,13 +2,13 @@ # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the Modem Manager package. # -# Yuri Chornoivan , 2013. +# Yuri Chornoivan , 2013, 2017. msgid "" msgstr "" "Project-Id-Version: Modem Manager\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-19 18:13+0300\n" -"PO-Revision-Date: 2013-10-19 18:17+0300\n" +"Report-Msgid-Bugs-To: modemmanager-devel@lists.freedesktop.org\n" +"POT-Creation-Date: 2017-11-12 13:40+0100\n" +"PO-Revision-Date: 2017-11-11 18:33+0200\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" @@ -17,67 +17,76 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Lokalize 1.5\n" +"X-Generator: Lokalize 2.0\n" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:1 +#: data/org.freedesktop.ModemManager1.policy.in.in:13 msgid "Control the Modem Manager daemon" msgstr "Керування фоновою службою Modem Manager" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:2 +#: data/org.freedesktop.ModemManager1.policy.in.in:14 msgid "System policy prevents controlling the Modem Manager." msgstr "Правила системи перешкоджають керування Modem Manager." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:3 +#: data/org.freedesktop.ModemManager1.policy.in.in:22 msgid "Unlock and control a mobile broadband device" msgstr "Розблокувати пристрій мобільної широкосмугової мережі і керувати ним" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:4 +#: data/org.freedesktop.ModemManager1.policy.in.in:23 msgid "" "System policy prevents unlocking or controlling the mobile broadband device." msgstr "" "Правила системи забороняють розблокування і керування пристроями " "широкосмугових мобільних мереж." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:5 +#: data/org.freedesktop.ModemManager1.policy.in.in:31 msgid "Add, modify, and delete mobile broadband contacts" msgstr "" "Додати, внести зміни і вилучити контакти пристрою мобільних широкосмугових " "мереж" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:6 +#: data/org.freedesktop.ModemManager1.policy.in.in:32 msgid "" "System policy prevents adding, modifying, or deleting this device's contacts." msgstr "" "Правила системи перешкоджають додаванню, внесенню змін та вилученню записів " "контактів на цьому пристрої." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:7 +#: data/org.freedesktop.ModemManager1.policy.in.in:40 msgid "Send, save, modify, and delete text messages" msgstr "Надіслати, зберегти, внести зміни або вилучити текстові повідомлення" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:8 +#: data/org.freedesktop.ModemManager1.policy.in.in:41 msgid "" -"System policy prevents sending or maniuplating this device's text messages." +"System policy prevents sending or manipulating this device's text messages." msgstr "" "Правила системи забороняють надсилання або керування текстовими " "повідомленнями цього пристрою." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:9 +#: data/org.freedesktop.ModemManager1.policy.in.in:49 +msgid "Accept incoming voice calls or start outgoing voice calls." +msgstr "" +"Приймати вхідні голосові виклики і розпочинати вихідні голосові виклики." + +#: data/org.freedesktop.ModemManager1.policy.in.in:50 +msgid "System policy prevents voice calls." +msgstr "Правила системи перешкоджають голосовим викликам." + +#: data/org.freedesktop.ModemManager1.policy.in.in:58 msgid "Enable and view geographic location and positioning information" msgstr "" "Увімкнути або переглянути дані щодо географічного розташування і позиціювання" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:10 +#: data/org.freedesktop.ModemManager1.policy.in.in:59 msgid "" "System policy prevents enabling or viewing geographic location information." msgstr "" "Правила системи забороняють вмикання або перегляд даних щодо розташування." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:11 +#: data/org.freedesktop.ModemManager1.policy.in.in:67 msgid "Query and utilize network information and services" msgstr "Надіслати запит і використати дані щодо мережі і служби" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:12 +#: data/org.freedesktop.ModemManager1.policy.in.in:68 msgid "" "System policy prevents querying or utilizing network information and " "services." @@ -85,14 +94,18 @@ "Правила системи забороняють надсилання запитів і використання даних щодо " "мережі і служб." -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:13 +#: data/org.freedesktop.ModemManager1.policy.in.in:76 msgid "Query and manage firmware on a mobile broadband device" msgstr "" "Опитування та керування мікропрограмою на пристрої мобільної широкосмугової " "мережі" -#: ../data/org.freedesktop.ModemManager1.policy.in.in.h:14 +#: data/org.freedesktop.ModemManager1.policy.in.in:77 msgid "System policy prevents querying or managing this device's firmware." msgstr "" "Правила системи перешкоджають опитуванню або керування мікропрограмою цього " "пристрою." + +#: src/mm-sleep-monitor.c:114 +msgid "ModemManager needs to reset devices" +msgstr "ModemManager потребує відновлення початкового стану пристроїв" diff -Nru modemmanager-1.6.8/src/77-mm-pcmcia-device-blacklist.rules modemmanager-1.10.0/src/77-mm-pcmcia-device-blacklist.rules --- modemmanager-1.6.8/src/77-mm-pcmcia-device-blacklist.rules 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/77-mm-pcmcia-device-blacklist.rules 2018-11-15 09:55:53.000000000 +0100 @@ -1,6 +1,6 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_pcmcia_device_blacklist_end" +ACTION!="add|change|move|bind", GOTO="mm_pcmcia_device_blacklist_end" SUBSYSTEM!="pcmcia", GOTO="mm_pcmcia_device_blacklist_end" # Gemplus Serial Port smartcard adapter diff -Nru modemmanager-1.6.8/src/77-mm-platform-serial-whitelist.rules modemmanager-1.10.0/src/77-mm-platform-serial-whitelist.rules --- modemmanager-1.6.8/src/77-mm-platform-serial-whitelist.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/77-mm-platform-serial-whitelist.rules 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION!="add|change|move", GOTO="mm_platform_device_whitelist_end" -SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end" - -# Be careful here since many devices connected to platform drivers on PCs -# are legacy devices that won't like probing. But often on embedded -# systems serial ports are provided by platform devices. - -# Allow atmel_usart -DRIVERS=="atmel_usart", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" - -LABEL="mm_platform_device_whitelist_end" diff -Nru modemmanager-1.6.8/src/77-mm-usb-device-blacklist.rules modemmanager-1.10.0/src/77-mm-usb-device-blacklist.rules --- modemmanager-1.6.8/src/77-mm-usb-device-blacklist.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/77-mm-usb-device-blacklist.rules 2018-11-15 09:55:53.000000000 +0100 @@ -1,8 +1,7 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end" +ACTION!="add|change|move|bind", GOTO="mm_usb_device_blacklist_end" SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end" -ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end" # APC UPS devices ATTRS{idVendor}=="051d", ENV{ID_MM_DEVICE_IGNORE}="1" @@ -68,9 +67,6 @@ # Atmel Corp at91sam SAMBA bootloader ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{ID_MM_DEVICE_IGNORE}="1" -# Dangerous Prototypes Bus Pirate v4 -ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fb00", ENV{ID_MM_DEVICE_IGNORE}="1" - # All devices from the Swiss Federal Institute of Technology ATTRS{idVendor}=="0617", ENV{ID_MM_DEVICE_IGNORE}="1" @@ -118,11 +114,14 @@ # Garmin GPS devices DRIVERS=="garmin_gps", ENV{ID_MM_DEVICE_IGNORE}="1" +# Garmin ANT+ stick +ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1009", ENV{ID_MM_DEVICE_IGNORE}="1" + # Cypress M8-based GPS devices, UPSes, and serial converters DRIVERS=="cypress_m8", ENV{ID_MM_DEVICE_IGNORE}="1" -# All devices in the Openmoko vendor ID -ATTRS{idVendor}=="1d50", ENV{ID_MM_DEVICE_IGNORE}="1" +# All devices in the Openmoko vendor ID, except usb hubs +ATTRS{idVendor}=="1d50", ATTRS{bDeviceClass}!="09", ENV{ID_MM_DEVICE_IGNORE}="1" # All devices from 3D Robotics ATTRS{idVendor}=="26ac", ENV{ID_MM_DEVICE_IGNORE}="1" @@ -134,6 +133,9 @@ ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0716", ENV{ID_MM_DEVICE_IGNORE}="1" ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0801", ENV{ID_MM_DEVICE_IGNORE}="1" +# Intel coredump downloader device +ATTRS{idVendor}=="1519", ATTRS{idProduct}=="f000", ENV{ID_MM_DEVICE_IGNORE}="1" + # GW Instek AFG-2225 arbitrary function generator ATTRS{idVendor}=="2184", ATTRS{idProduct}=="001c", ENV{ID_MM_DEVICE_IGNORE}="1" @@ -192,4 +194,18 @@ # Netchip Technology, Inc. Linux-USB Serial Gadget (CDC ACM mode) ATTRS{idVendor}=="0525", ATTRS{idProduct}=="a4a7", ENV{ID_MM_DEVICE_IGNORE}="1" +# Silicon Labs Telegesis ETRX USB Zigbee dongle +ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="000f", ENV{ID_MM_DEVICE_IGNORE}="1" + +# Devices using Microchip's VID +# Dangerous Prototypes Bus Pirate v4 +ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fb00", ENV{ID_MM_DEVICE_IGNORE}="1" +# Pycom Pysense +ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f012", ENV{ID_MM_DEVICE_IGNORE}="1" +# Pycom Pytrack +ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f013", ENV{ID_MM_DEVICE_IGNORE}="1" + +# All devices from Prusa Research +ATTRS{idVendor}=="2c99", ENV{ID_MM_DEVICE_IGNORE}="1" + LABEL="mm_usb_device_blacklist_end" diff -Nru modemmanager-1.6.8/src/77-mm-usb-serial-adapters-greylist.rules modemmanager-1.10.0/src/77-mm-usb-serial-adapters-greylist.rules --- modemmanager-1.6.8/src/77-mm-usb-serial-adapters-greylist.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/77-mm-usb-serial-adapters-greylist.rules 2018-11-15 09:55:53.000000000 +0100 @@ -1,8 +1,7 @@ # do not edit this file, it will be overwritten on update -ACTION!="add|change|move", GOTO="mm_usb_serial_adapters_greylist_end" +ACTION!="add|change|move|bind", GOTO="mm_usb_serial_adapters_greylist_end" SUBSYSTEM!="usb", GOTO="mm_usb_serial_adapters_greylist_end" -ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_serial_adapters_greylist_end" # Belkin F5U183 Serial Adapter ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0103", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1" @@ -13,6 +12,9 @@ # on the vendor Id. ATTRS{idVendor}=="0403", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1" +# Devices using Microchip's VID +ATTRS{idVendor}=="04d8", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1" + # ATEN Intl UC-232A (Prolific) ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1" diff -Nru modemmanager-1.6.8/src/80-mm-candidate.rules modemmanager-1.10.0/src/80-mm-candidate.rules --- modemmanager-1.6.8/src/80-mm-candidate.rules 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/80-mm-candidate.rules 2018-11-15 09:55:53.000000000 +0100 @@ -7,11 +7,11 @@ # that don't have this tag. MM will still get the udev 'add' event for the # device a short while later and then process it as normal. -ACTION!="add|change|move", GOTO="mm_candidate_end" +ACTION!="add|change|move|bind", GOTO="mm_candidate_end" # Opening bound but disconnected Bluetooth RFCOMM ttys would initiate the # connection. Don't do that. -KERNEL=="rfcomm[0-9]*", DEVPATH=="*/virtual/*", GOTO="mm_candidate_end" +KERNEL=="rfcomm*", DEVPATH=="*/virtual/*", GOTO="mm_candidate_end" SUBSYSTEM=="tty", ENV{ID_MM_CANDIDATE}="1" SUBSYSTEM=="net", ENV{ID_MM_CANDIDATE}="1" diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device.c modemmanager-1.10.0/src/kerneldevice/mm-kernel-device.c --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,318 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#include +#include + +#include "mm-log.h" +#include "mm-kernel-device.h" + +G_DEFINE_ABSTRACT_TYPE (MMKernelDevice, mm_kernel_device, G_TYPE_OBJECT) + +/*****************************************************************************/ + +const gchar * +mm_kernel_device_get_subsystem (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_subsystem ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_subsystem (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_name (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_name ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_name (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_driver (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_driver ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_driver (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_sysfs_path ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_sysfs_path (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_physdev_uid (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_uid ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_uid (self) : + NULL); +} + +guint16 +mm_kernel_device_get_physdev_vid (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), 0); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_vid ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_vid (self) : + 0); +} + +guint16 +mm_kernel_device_get_physdev_pid (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), 0); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_pid ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_pid (self) : + 0); +} + +guint16 +mm_kernel_device_get_physdev_revision (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), 0); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_revision ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_revision (self) : + 0); +} + +const gchar * +mm_kernel_device_get_physdev_subsystem (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_subsystem ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_subsystem (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_physdev_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_sysfs_path ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_sysfs_path (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_physdev_manufacturer (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_manufacturer ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_manufacturer (self) : + NULL); +} + +const gchar * +mm_kernel_device_get_physdev_product (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_product ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_physdev_product (self) : + NULL); +} + +gint +mm_kernel_device_get_interface_class (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), -1); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_class ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_class (self) : + -1); +} + +gint +mm_kernel_device_get_interface_subclass (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), -1); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_subclass ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_subclass (self) : + -1); +} + +gint +mm_kernel_device_get_interface_protocol (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), -1); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_protocol ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_protocol (self) : + -1); +} + +const gchar * +mm_kernel_device_get_interface_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_sysfs_path ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_interface_sysfs_path (self) : + NULL); +} + +gboolean +mm_kernel_device_cmp (MMKernelDevice *a, + MMKernelDevice *b) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (a), FALSE); + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (b), FALSE); + + return (MM_KERNEL_DEVICE_GET_CLASS (a)->cmp ? + MM_KERNEL_DEVICE_GET_CLASS (a)->cmp (a, b) : + FALSE); +} + +gboolean +mm_kernel_device_has_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), FALSE); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->has_property ? + MM_KERNEL_DEVICE_GET_CLASS (self)->has_property (self, property) : + FALSE); +} + +const gchar * +mm_kernel_device_get_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_property ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_property (self, property) : + NULL); +} + +gboolean +mm_kernel_device_get_property_as_boolean (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), FALSE); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_boolean ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_boolean (self, property) : + FALSE); +} + +gint +mm_kernel_device_get_property_as_int (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), -1); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_int ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_int (self, property) : + -1); +} + +guint +mm_kernel_device_get_property_as_int_hex (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), 0); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_int_hex ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_property_as_int_hex (self, property) : + 0); +} + +gboolean +mm_kernel_device_has_global_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), FALSE); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->has_global_property ? + MM_KERNEL_DEVICE_GET_CLASS (self)->has_global_property (self, property) : + FALSE); +} + +const gchar * +mm_kernel_device_get_global_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property (self, property) : + NULL); +} + +gboolean +mm_kernel_device_get_global_property_as_boolean (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), FALSE); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_boolean ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_boolean (self, property) : + FALSE); +} + +gint +mm_kernel_device_get_global_property_as_int (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), -1); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_int ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_int (self, property) : + -1); +} + +guint +mm_kernel_device_get_global_property_as_int_hex (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), 0); + + return (MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_int_hex ? + MM_KERNEL_DEVICE_GET_CLASS (self)->get_global_property_as_int_hex (self, property) : + 0); +} + +/*****************************************************************************/ + +static void +mm_kernel_device_init (MMKernelDevice *self) +{ +} + +static void +mm_kernel_device_class_init (MMKernelDeviceClass *klass) +{ +} diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic.c modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic.c --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,1162 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#define _GNU_SOURCE +#include +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include + +#include "mm-kernel-device-generic.h" +#include "mm-kernel-device-generic-rules.h" +#include "mm-log.h" + +#if !defined UDEVRULESDIR +# error UDEVRULESDIR is not defined +#endif + +static void initable_iface_init (GInitableIface *iface); + +G_DEFINE_TYPE_EXTENDED (MMKernelDeviceGeneric, mm_kernel_device_generic, MM_TYPE_KERNEL_DEVICE, 0, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)) + +enum { + PROP_0, + PROP_PROPERTIES, + PROP_RULES, + PROP_LAST +}; + +static GParamSpec *properties[PROP_LAST]; + +struct _MMKernelDeviceGenericPrivate { + /* Input properties */ + MMKernelEventProperties *properties; + /* Rules to apply */ + GArray *rules; + + /* Contents from sysfs */ + gchar *driver; + gchar *sysfs_path; + gchar *interface_sysfs_path; + guint8 interface_class; + guint8 interface_subclass; + guint8 interface_protocol; + guint8 interface_number; + gchar *physdev_sysfs_path; + guint16 physdev_vid; + guint16 physdev_pid; + guint16 physdev_revision; + gchar *physdev_subsystem; + gchar *physdev_manufacturer; + gchar *physdev_product; +}; + +static guint +read_sysfs_property_as_hex (const gchar *path, + const gchar *property) +{ + gchar *aux; + gchar *contents = NULL; + guint val = 0; + + aux = g_strdup_printf ("%s/%s", path, property); + if (g_file_get_contents (aux, &contents, NULL, NULL)) { + g_strdelimit (contents, "\r\n", ' '); + g_strstrip (contents); + mm_get_uint_from_hex_str (contents, &val); + } + g_free (contents); + g_free (aux); + return val; +} + +static gchar * +read_sysfs_property_as_string (const gchar *path, + const gchar *property) +{ + gchar *aux; + gchar *contents = NULL; + + aux = g_strdup_printf ("%s/%s", path, property); + if (g_file_get_contents (aux, &contents, NULL, NULL)) { + g_strdelimit (contents, "\r\n", ' '); + g_strstrip (contents); + } + g_free (aux); + return contents; +} + +/*****************************************************************************/ +/* Load contents */ + +static void +preload_sysfs_path (MMKernelDeviceGeneric *self) +{ + gchar *tmp; + + if (self->priv->sysfs_path) + return; + + /* sysfs can be built directly using subsystem and name; e.g. for subsystem + * usbmisc and name cdc-wdm0: + * $ realpath /sys/class/usbmisc/cdc-wdm0 + * /sys/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.3/4-1.3:1.8/usbmisc/cdc-wdm0 + */ + tmp = g_strdup_printf ("/sys/class/%s/%s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + + self->priv->sysfs_path = realpath (tmp, NULL); + if (!self->priv->sysfs_path || !g_file_test (self->priv->sysfs_path, G_FILE_TEST_EXISTS)) { + mm_warn ("Invalid sysfs path read for %s/%s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + g_clear_pointer (&self->priv->sysfs_path, g_free); + } + + if (self->priv->sysfs_path) { + const gchar *devpath; + + mm_dbg ("(%s/%s) sysfs path: %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->sysfs_path); + devpath = (g_str_has_prefix (self->priv->sysfs_path, "/sys") ? + &self->priv->sysfs_path[4] : + self->priv->sysfs_path); + g_object_set_data_full (G_OBJECT (self), "DEVPATH", g_strdup (devpath), g_free); + } + g_free (tmp); +} + +static void +preload_interface_sysfs_path (MMKernelDeviceGeneric *self) +{ + gchar *dirpath; + gchar *aux; + + if (self->priv->interface_sysfs_path || !self->priv->sysfs_path) + return; + + /* parent sysfs can be built directly using subsystem and name; e.g. for + * subsystem usbmisc and name cdc-wdm0: + * $ realpath /sys/class/usbmisc/cdc-wdm0/device + * /sys/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.3/4-1.3:1.8 + * + * This sysfs path will be equal for all devices exported from within the + * same interface (e.g. a pair of cdc-wdm/wwan devices). + * + * The correct parent dir we want to have is the first one with "usb" subsystem. + */ + aux = g_strdup_printf ("%s/device", self->priv->sysfs_path); + dirpath = realpath (aux, NULL); + g_free (aux); + + while (dirpath) { + gchar *subsystem_filepath; + + /* Directory must exist */ + if (!g_file_test (dirpath, G_FILE_TEST_EXISTS)) + break; + + /* If subsystem file not found, keep looping */ + subsystem_filepath = g_strdup_printf ("%s/subsystem", dirpath); + if (g_file_test (subsystem_filepath, G_FILE_TEST_EXISTS)) { + gchar *canonicalized_subsystem; + gchar *subsystem_name; + + canonicalized_subsystem = realpath (subsystem_filepath, NULL); + g_free (subsystem_filepath); + + subsystem_name = g_path_get_basename (canonicalized_subsystem); + g_free (canonicalized_subsystem); + + if (subsystem_name && g_str_equal (subsystem_name, "usb")) { + self->priv->interface_sysfs_path = dirpath; + g_free (subsystem_name); + break; + } + g_free (subsystem_name); + } else + g_free (subsystem_filepath); + + /* Just in case */ + if (g_str_equal (dirpath, "/")) { + g_free (dirpath); + break; + } + + aux = g_path_get_dirname (dirpath); + g_free (dirpath); + dirpath = aux; + } + + if (self->priv->interface_sysfs_path) + mm_dbg ("(%s/%s) interface sysfs path: %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->interface_sysfs_path); +} + +static void +preload_physdev_sysfs_path (MMKernelDeviceGeneric *self) +{ + /* physdev sysfs is the dirname of the parent sysfs path, e.g.: + * /sys/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.3 + * + * This sysfs path will be equal for all devices exported from the same + * physical device. + */ + if (!self->priv->physdev_sysfs_path && self->priv->interface_sysfs_path) + self->priv->physdev_sysfs_path = g_path_get_dirname (self->priv->interface_sysfs_path); + + if (self->priv->physdev_sysfs_path) + mm_dbg ("(%s/%s) physdev sysfs path: %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_sysfs_path); +} + +static void +preload_driver (MMKernelDeviceGeneric *self) +{ + if (!self->priv->driver && self->priv->interface_sysfs_path) { + gchar *tmp; + gchar *tmp2; + + tmp = g_strdup_printf ("%s/driver", self->priv->interface_sysfs_path); + tmp2 = realpath (tmp, NULL); + if (tmp2 && g_file_test (tmp2, G_FILE_TEST_EXISTS)) + self->priv->driver = g_path_get_basename (tmp2); + g_free (tmp2); + g_free (tmp); + } + + if (self->priv->driver) + mm_dbg ("(%s/%s) driver: %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->driver); +} + +static void +preload_physdev_vid (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_vid && self->priv->physdev_sysfs_path) { + guint val; + + val = read_sysfs_property_as_hex (self->priv->physdev_sysfs_path, "idVendor"); + if (val && val <= G_MAXUINT16) + self->priv->physdev_vid = val; + } + + if (self->priv->physdev_vid) { + mm_dbg ("(%s/%s) vid (ID_VENDOR_ID): 0x%04x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_vid); + g_object_set_data_full (G_OBJECT (self), "ID_VENDOR_ID", g_strdup_printf ("%04x", self->priv->physdev_vid), g_free); + } else + mm_dbg ("(%s/%s) vid: unknown", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + +} + +static void +preload_physdev_pid (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_pid && self->priv->physdev_sysfs_path) { + guint val; + + val = read_sysfs_property_as_hex (self->priv->physdev_sysfs_path, "idProduct"); + if (val && val <= G_MAXUINT16) + self->priv->physdev_pid = val; + } + + if (self->priv->physdev_pid) { + mm_dbg ("(%s/%s) pid (ID_MODEL_ID): 0x%04x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_pid); + g_object_set_data_full (G_OBJECT (self), "ID_MODEL_ID", g_strdup_printf ("%04x", self->priv->physdev_pid), g_free); + } else + mm_dbg ("(%s/%s) pid: unknown", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); +} + +static void +preload_physdev_revision (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_revision && self->priv->physdev_sysfs_path) { + guint val; + + val = read_sysfs_property_as_hex (self->priv->physdev_sysfs_path, "bcdDevice"); + if (val && val <= G_MAXUINT16) + self->priv->physdev_revision = val; + } + + if (self->priv->physdev_revision) { + mm_dbg ("(%s/%s) revision (ID_REVISION): 0x%04x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_revision); + g_object_set_data_full (G_OBJECT (self), "ID_REVISION", g_strdup_printf ("%04x", self->priv->physdev_revision), g_free); + } else + mm_dbg ("(%s/%s) revision: unknown", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); +} + +static void +preload_physdev_subsystem (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_subsystem && self->priv->physdev_sysfs_path) { + gchar *aux; + gchar *subsyspath; + + aux = g_strdup_printf ("%s/subsystem", self->priv->physdev_sysfs_path); + subsyspath = realpath (aux, NULL); + self->priv->physdev_subsystem = g_path_get_dirname (subsyspath); + g_free (subsyspath); + g_free (aux); + } + + mm_dbg ("(%s/%s) subsystem: %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_subsystem ? self->priv->physdev_subsystem : "unknown"); +} + +static void +preload_manufacturer (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_manufacturer) + self->priv->physdev_manufacturer = (self->priv->physdev_sysfs_path ? read_sysfs_property_as_string (self->priv->physdev_sysfs_path, "manufacturer") : NULL); + + if (self->priv->physdev_manufacturer) { + mm_dbg ("(%s/%s) manufacturer (ID_VENDOR): %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_manufacturer); + g_object_set_data_full (G_OBJECT (self), "ID_VENDOR", g_strdup (self->priv->physdev_manufacturer), g_free); + } else + mm_dbg ("(%s/%s) manufacturer: unknown", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); +} + +static void +preload_product (MMKernelDeviceGeneric *self) +{ + if (!self->priv->physdev_product) + self->priv->physdev_product = (self->priv->physdev_sysfs_path ? read_sysfs_property_as_string (self->priv->physdev_sysfs_path, "product") : NULL); + + if (self->priv->physdev_product) { + mm_dbg ("(%s/%s) product (ID_MODEL): %s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->physdev_product); + g_object_set_data_full (G_OBJECT (self), "ID_MODEL", g_strdup (self->priv->physdev_product), g_free); + } else + mm_dbg ("(%s/%s) product: unknown", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + +} + +static void +preload_interface_class (MMKernelDeviceGeneric *self) +{ + self->priv->interface_class = (self->priv->interface_sysfs_path ? read_sysfs_property_as_hex (self->priv->interface_sysfs_path, "bInterfaceClass") : 0x00); + mm_dbg ("(%s/%s) interface class: 0x%02x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->interface_class); +} + +static void +preload_interface_subclass (MMKernelDeviceGeneric *self) +{ + self->priv->interface_subclass = (self->priv->interface_sysfs_path ? read_sysfs_property_as_hex (self->priv->interface_sysfs_path, "bInterfaceSubClass") : 0x00); + mm_dbg ("(%s/%s) interface subclass: 0x%02x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->interface_subclass); +} + +static void +preload_interface_protocol (MMKernelDeviceGeneric *self) +{ + self->priv->interface_protocol = (self->priv->interface_sysfs_path ? read_sysfs_property_as_hex (self->priv->interface_sysfs_path, "bInterfaceProtocol") : 0x00); + mm_dbg ("(%s/%s) interface protocol: 0x%02x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->interface_protocol); +} + +static void +preload_interface_number (MMKernelDeviceGeneric *self) +{ + self->priv->interface_number = (self->priv->interface_sysfs_path ? read_sysfs_property_as_hex (self->priv->interface_sysfs_path, "bInterfaceNumber") : 0x00); + mm_dbg ("(%s/%s) interface number (ID_USB_INTERFACE_NUM): 0x%02x", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + self->priv->interface_number); + g_object_set_data_full (G_OBJECT (self), "ID_USB_INTERFACE_NUM", g_strdup_printf ("%02x", self->priv->interface_number), g_free); +} + +static void +preload_contents (MMKernelDeviceGeneric *self) +{ + preload_sysfs_path (self); + preload_interface_sysfs_path (self); + preload_interface_class (self); + preload_interface_subclass (self); + preload_interface_protocol (self); + preload_interface_number (self); + preload_physdev_sysfs_path (self); + preload_manufacturer (self); + preload_product (self); + preload_driver (self); + preload_physdev_vid (self); + preload_physdev_pid (self); + preload_physdev_revision (self); + preload_physdev_subsystem (self); +} + +/*****************************************************************************/ + +static const gchar * +kernel_device_get_subsystem (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return mm_kernel_event_properties_get_subsystem (MM_KERNEL_DEVICE_GENERIC (self)->priv->properties); +} + +static const gchar * +kernel_device_get_name (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return mm_kernel_event_properties_get_name (MM_KERNEL_DEVICE_GENERIC (self)->priv->properties); +} + +static const gchar * +kernel_device_get_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->sysfs_path; +} + +static gint +kernel_device_get_interface_class (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), -1); + + return (gint) MM_KERNEL_DEVICE_GENERIC (self)->priv->interface_class; +} + +static gint +kernel_device_get_interface_subclass (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), -1); + + return (gint) MM_KERNEL_DEVICE_GENERIC (self)->priv->interface_subclass; +} + +static gint +kernel_device_get_interface_protocol (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), -1); + + return (gint) MM_KERNEL_DEVICE_GENERIC (self)->priv->interface_protocol; +} + +static const gchar * +kernel_device_get_interface_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->interface_sysfs_path; +} + +static const gchar * +kernel_device_get_physdev_uid (MMKernelDevice *self) +{ + const gchar *uid; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + /* Prefer the one coming in the properties, if any */ + if ((uid = mm_kernel_event_properties_get_uid (MM_KERNEL_DEVICE_GENERIC (self)->priv->properties)) != NULL) + return uid; + + /* Try to load from properties set */ + if ((uid = mm_kernel_device_get_property (self, ID_MM_PHYSDEV_UID)) != NULL) + return uid; + + /* Use physical device path, if any */ + if (MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_sysfs_path) + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_sysfs_path; + + /* If there is no physdev sysfs path, e.g. for platform ports, use the device sysfs itself */ + return MM_KERNEL_DEVICE_GENERIC (self)->priv->sysfs_path; +} + +static const gchar * +kernel_device_get_driver (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->driver; +} + +static guint16 +kernel_device_get_physdev_vid (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_vid; +} + +static guint16 +kernel_device_get_physdev_pid (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_pid; +} + +static guint16 +kernel_device_get_physdev_revision (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_revision; +} + +static const gchar * +kernel_device_get_physdev_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_sysfs_path; +} + +static const gchar * +kernel_device_get_physdev_subsystem (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_subsystem; +} + +static const gchar * +kernel_device_get_physdev_manufacturer (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_manufacturer; +} + +static const gchar * +kernel_device_get_physdev_product (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), 0); + + return MM_KERNEL_DEVICE_GENERIC (self)->priv->physdev_product; +} + +static gboolean +kernel_device_cmp (MMKernelDevice *a, + MMKernelDevice *b) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (a), FALSE); + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (b), FALSE); + + return (!g_strcmp0 (mm_kernel_device_get_subsystem (a), mm_kernel_device_get_subsystem (b)) && + !g_strcmp0 (mm_kernel_device_get_name (a), mm_kernel_device_get_name (b))); +} + +/*****************************************************************************/ + +static gboolean +string_match (const gchar *str, + const gchar *original_pattern) +{ + gchar *pattern; + gchar *start; + gboolean open_prefix = FALSE; + gboolean open_suffix = FALSE; + gboolean match; + + pattern = g_strdup (original_pattern); + start = pattern; + + if (start[0] == '*') { + open_prefix = TRUE; + start++; + } + + if (start[strlen (start) - 1] == '*') { + open_suffix = TRUE; + start[strlen (start) - 1] = '\0'; + } + + if (open_suffix && !open_prefix) + match = g_str_has_prefix (str, start); + else if (!open_suffix && open_prefix) + match = g_str_has_suffix (str, start); + else if (open_suffix && open_prefix) + match = !!strstr (str, start); + else + match = g_str_equal (str, start); + + g_free (pattern); + return match; +} + +static gboolean +check_condition (MMKernelDeviceGeneric *self, + MMUdevRuleMatch *match) +{ + gboolean condition_equal; + + condition_equal = (match->type == MM_UDEV_RULE_MATCH_TYPE_EQUAL); + + /* We only apply 'add' rules */ + if (g_str_equal (match->parameter, "ACTION")) + return ((!!strstr (match->value, "add")) == condition_equal); + + /* We look for the subsystem string in the whole sysfs path. + * + * Note that we're not really making a difference between "SUBSYSTEMS" + * (where the whole device tree is checked) and "SUBSYSTEM" (where just one + * single device is checked), because a lot of the MM udev rules are meant + * to just tag the physical device (e.g. with ID_MM_DEVICE_IGNORE) instead + * of the single ports. In our case with the custom parsing, we do tag all + * independent ports. + */ + if (g_str_equal (match->parameter, "SUBSYSTEMS") || g_str_equal (match->parameter, "SUBSYSTEM")) + return ((self->priv->sysfs_path && !!strstr (self->priv->sysfs_path, match->value)) == condition_equal); + + /* Exact DRIVER match? We also include the check for DRIVERS, even if we + * only apply it to this port driver. */ + if (g_str_equal (match->parameter, "DRIVER") || g_str_equal (match->parameter, "DRIVERS")) + return ((!g_strcmp0 (match->value, mm_kernel_device_get_driver (MM_KERNEL_DEVICE (self)))) == condition_equal); + + /* Device name checks */ + if (g_str_equal (match->parameter, "KERNEL")) + return (string_match (mm_kernel_device_get_name (MM_KERNEL_DEVICE (self)), match->value) == condition_equal); + + /* Device sysfs path checks; we allow both a direct match and a prefix patch */ + if (g_str_equal (match->parameter, "DEVPATH")) { + gchar *prefix_match = NULL; + gboolean result = FALSE; + + /* If sysfs path invalid (e.g. path doesn't exist), no match */ + if (!self->priv->sysfs_path) + return FALSE; + + /* If not already doing a prefix match, do an implicit one. This is so that + * we can add properties to the usb_device owning all ports, and then apply + * the property to all ports individually processed here. */ + if (match->value[0] && match->value[strlen (match->value) - 1] != '*') + prefix_match = g_strdup_printf ("%s/*", match->value); + + if (string_match (self->priv->sysfs_path, match->value) == condition_equal) { + result = TRUE; + goto out; + } + + if (prefix_match && string_match (self->priv->sysfs_path, prefix_match) == condition_equal) { + result = TRUE; + goto out; + } + + if (g_str_has_prefix (self->priv->sysfs_path, "/sys")) { + if (string_match (&self->priv->sysfs_path[4], match->value) == condition_equal) { + result = TRUE; + goto out; + } + if (prefix_match && string_match (&self->priv->sysfs_path[4], prefix_match) == condition_equal) { + result = TRUE; + goto out; + } + } + out: + g_free (prefix_match); + return result; + } + + /* Attributes checks */ + if (g_str_has_prefix (match->parameter, "ATTRS")) { + gchar *attribute; + gchar *contents = NULL; + gboolean result = FALSE; + guint val; + + attribute = g_strdup (&match->parameter[5]); + g_strdelimit (attribute, "{}", ' '); + g_strstrip (attribute); + + /* VID/PID directly from our API */ + if (g_str_equal (attribute, "idVendor")) + result = ((mm_get_uint_from_hex_str (match->value, &val)) && + ((mm_kernel_device_get_physdev_vid (MM_KERNEL_DEVICE (self)) == val) == condition_equal)); + else if (g_str_equal (attribute, "idProduct")) + result = ((mm_get_uint_from_hex_str (match->value, &val)) && + ((mm_kernel_device_get_physdev_pid (MM_KERNEL_DEVICE (self)) == val) == condition_equal)); + /* manufacturer in the physdev */ + else if (g_str_equal (attribute, "manufacturer")) + result = ((self->priv->physdev_manufacturer && g_str_equal (self->priv->physdev_manufacturer, match->value)) == condition_equal); + /* product in the physdev */ + else if (g_str_equal (attribute, "product")) + result = ((self->priv->physdev_product && g_str_equal (self->priv->physdev_product, match->value)) == condition_equal); + /* interface class/subclass/protocol/number in the interface */ + else if (g_str_equal (attribute, "bInterfaceClass")) + result = (g_str_equal (match->value, "?*") || ((mm_get_uint_from_hex_str (match->value, &val)) && + ((self->priv->interface_class == val) == condition_equal))); + else if (g_str_equal (attribute, "bInterfaceSubClass")) + result = (g_str_equal (match->value, "?*") || ((mm_get_uint_from_hex_str (match->value, &val)) && + ((self->priv->interface_subclass == val) == condition_equal))); + else if (g_str_equal (attribute, "bInterfaceProtocol")) + result = (g_str_equal (match->value, "?*") || ((mm_get_uint_from_hex_str (match->value, &val)) && + ((self->priv->interface_protocol == val) == condition_equal))); + else if (g_str_equal (attribute, "bInterfaceNumber")) + result = (g_str_equal (match->value, "?*") || ((mm_get_uint_from_hex_str (match->value, &val)) && + ((self->priv->interface_number == val) == condition_equal))); + else + mm_warn ("Unknown attribute: %s", attribute); + + g_free (contents); + g_free (attribute); + return result; + } + + /* Previously set property checks */ + if (g_str_has_prefix (match->parameter, "ENV")) { + gchar *property; + gboolean result = FALSE; + + property = g_strdup (&match->parameter[3]); + g_strdelimit (property, "{}", ' '); + g_strstrip (property); + + result = ((!g_strcmp0 ((const gchar *) g_object_get_data (G_OBJECT (self), property), match->value)) == condition_equal); + + g_free (property); + return result; + } + + mm_warn ("Unknown match condition parameter: %s", match->parameter); + return FALSE; +} + +static guint +check_rule (MMKernelDeviceGeneric *self, + guint rule_i) +{ + MMUdevRule *rule; + gboolean apply = TRUE; + + g_assert (rule_i < self->priv->rules->len); + + rule = &g_array_index (self->priv->rules, MMUdevRule, rule_i); + if (rule->conditions) { + guint condition_i; + + for (condition_i = 0; condition_i < rule->conditions->len; condition_i++) { + MMUdevRuleMatch *match; + + match = &g_array_index (rule->conditions, MMUdevRuleMatch, condition_i); + if (!check_condition (self, match)) { + apply = FALSE; + break; + } + } + } + + if (apply) { + switch (rule->result.type) { + case MM_UDEV_RULE_RESULT_TYPE_PROPERTY: { + gchar *property_value_read = NULL; + + if (g_str_equal (rule->result.content.property.value, "$attr{bInterfaceClass}")) + property_value_read = g_strdup_printf ("%02x", self->priv->interface_class); + else if (g_str_equal (rule->result.content.property.value, "$attr{bInterfaceSubClass}")) + property_value_read = g_strdup_printf ("%02x", self->priv->interface_subclass); + else if (g_str_equal (rule->result.content.property.value, "$attr{bInterfaceProtocol}")) + property_value_read = g_strdup_printf ("%02x", self->priv->interface_protocol); + else if (g_str_equal (rule->result.content.property.value, "$attr{bInterfaceNumber}")) + property_value_read = g_strdup_printf ("%02x", self->priv->interface_number); + + /* add new property */ + mm_dbg ("(%s/%s) property added: %s=%s", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties), + rule->result.content.property.name, + property_value_read ? property_value_read : rule->result.content.property.value); + + if (!property_value_read) + /* NOTE: we keep a reference to the list of rules ourselves, so it isn't + * an issue if we re-use the same string (i.e. without g_strdup-ing it) + * as a property value. */ + g_object_set_data (G_OBJECT (self), + rule->result.content.property.name, + rule->result.content.property.value); + else + g_object_set_data_full (G_OBJECT (self), + rule->result.content.property.name, + property_value_read, + g_free); + break; + } + + case MM_UDEV_RULE_RESULT_TYPE_LABEL: + /* noop */ + break; + + case MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX: + /* Jump to a new index */ + return rule->result.content.index; + + case MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG: + case MM_UDEV_RULE_RESULT_TYPE_UNKNOWN: + g_assert_not_reached (); + } + } + + /* Go to the next rule */ + return rule_i + 1; +} + +static void +preload_properties (MMKernelDeviceGeneric *self) +{ + guint i; + + g_assert (self->priv->rules); + g_assert (self->priv->rules->len > 0); + + /* Start to process rules */ + i = 0; + while (i < self->priv->rules->len) { + guint next_rule; + + next_rule = check_rule (self, i); + i = next_rule; + } +} + +static void +check_preload (MMKernelDeviceGeneric *self) +{ + /* Only preload when properties and rules are set */ + if (!self->priv->properties || !self->priv->rules) + return; + + /* Don't preload on "remove" actions, where we don't have the device any more */ + if (g_strcmp0 (mm_kernel_event_properties_get_action (self->priv->properties), "remove") == 0) + return; + + /* Don't preload for devices in the 'virtual' subsystem */ + if (g_strcmp0 (mm_kernel_event_properties_get_subsystem (self->priv->properties), "virtual") == 0) + return; + + mm_dbg ("(%s/%s) preloading contents and properties...", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + preload_contents (self); + preload_properties (self); +} + +static gboolean +kernel_device_has_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), FALSE); + + return !!g_object_get_data (G_OBJECT (self), property); +} + +static const gchar * +kernel_device_get_property (MMKernelDevice *self, + const gchar *property) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), NULL); + + return g_object_get_data (G_OBJECT (self), property); +} + +static gboolean +kernel_device_get_property_as_boolean (MMKernelDevice *self, + const gchar *property) +{ + const gchar *value; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), FALSE); + + value = g_object_get_data (G_OBJECT (self), property); + return (value && mm_common_get_boolean_from_string (value, NULL)); +} + +static gint +kernel_device_get_property_as_int (MMKernelDevice *self, + const gchar *property) +{ + const gchar *value; + gint aux = 0; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), -1); + + value = g_object_get_data (G_OBJECT (self), property); + return ((value && mm_get_int_from_str (value, &aux)) ? aux : 0); +} + +static guint +kernel_device_get_property_as_int_hex (MMKernelDevice *self, + const gchar *property) +{ + const gchar *value; + guint aux = 0; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_GENERIC (self), G_MAXUINT); + + value = g_object_get_data (G_OBJECT (self), property); + return ((value && mm_get_uint_from_hex_str (value, &aux)) ? aux : 0); +} + +/*****************************************************************************/ + +MMKernelDevice * +mm_kernel_device_generic_new_with_rules (MMKernelEventProperties *properties, + GArray *rules, + GError **error) +{ + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (properties), NULL); + + /* Note: we allow NULL rules, e.g. for virtual devices */ + + return MM_KERNEL_DEVICE (g_initable_new (MM_TYPE_KERNEL_DEVICE_GENERIC, + NULL, + error, + "properties", properties, + "rules", rules, + NULL)); +} + +MMKernelDevice * +mm_kernel_device_generic_new (MMKernelEventProperties *properties, + GError **error) +{ + static GArray *rules = NULL; + + g_return_val_if_fail (MM_IS_KERNEL_EVENT_PROPERTIES (properties), NULL); + + /* We only try to load the default list of rules once */ + if (G_UNLIKELY (!rules)) { + rules = mm_kernel_device_generic_rules_load (UDEVRULESDIR, error); + if (!rules) + return NULL; + } + + return mm_kernel_device_generic_new_with_rules (properties, rules, error); +} + +/*****************************************************************************/ + +static void +mm_kernel_device_generic_init (MMKernelDeviceGeneric *self) +{ + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGenericPrivate); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMKernelDeviceGeneric *self = MM_KERNEL_DEVICE_GENERIC (object); + + switch (prop_id) { + case PROP_PROPERTIES: + g_assert (!self->priv->properties); + self->priv->properties = g_value_dup_object (value); + check_preload (self); + break; + case PROP_RULES: + g_assert (!self->priv->rules); + self->priv->rules = g_value_dup_boxed (value); + check_preload (self); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMKernelDeviceGeneric *self = MM_KERNEL_DEVICE_GENERIC (object); + + switch (prop_id) { + case PROP_PROPERTIES: + g_value_set_object (value, self->priv->properties); + break; + case PROP_RULES: + g_value_set_boxed (value, self->priv->rules); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + MMKernelDeviceGeneric *self = MM_KERNEL_DEVICE_GENERIC (initable); + const gchar *subsystem; + + subsystem = mm_kernel_device_get_subsystem (MM_KERNEL_DEVICE (self)); + if (!subsystem) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "subsystem is mandatory in kernel device"); + return FALSE; + } + + if (!mm_kernel_device_get_name (MM_KERNEL_DEVICE (self))) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "name is mandatory in kernel device"); + return FALSE; + } + + /* sysfs path is mandatory as output, and will only be given if the + * specified device exists; but only if this wasn't a 'remove' event + * and not a virtual device. + */ + if (self->priv->properties && + g_strcmp0 (mm_kernel_event_properties_get_action (self->priv->properties), "remove") && + g_strcmp0 (mm_kernel_event_properties_get_subsystem (self->priv->properties), "virtual") && + !self->priv->sysfs_path) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "device %s/%s not found", + mm_kernel_event_properties_get_subsystem (self->priv->properties), + mm_kernel_event_properties_get_name (self->priv->properties)); + return FALSE; + } + + return TRUE; +} + +static void +dispose (GObject *object) +{ + MMKernelDeviceGeneric *self = MM_KERNEL_DEVICE_GENERIC (object); + + g_clear_pointer (&self->priv->physdev_product, g_free); + g_clear_pointer (&self->priv->physdev_manufacturer, g_free); + g_clear_pointer (&self->priv->physdev_sysfs_path, g_free); + g_clear_pointer (&self->priv->interface_sysfs_path, g_free); + g_clear_pointer (&self->priv->sysfs_path, g_free); + g_clear_pointer (&self->priv->driver, g_free); + g_clear_pointer (&self->priv->rules, g_array_unref); + g_clear_object (&self->priv->properties); + + G_OBJECT_CLASS (mm_kernel_device_generic_parent_class)->dispose (object); +} + +static void +initable_iface_init (GInitableIface *iface) +{ + iface->init = initable_init; +} + +static void +mm_kernel_device_generic_class_init (MMKernelDeviceGenericClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMKernelDeviceClass *kernel_device_class = MM_KERNEL_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMKernelDeviceGenericPrivate)); + + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + kernel_device_class->get_subsystem = kernel_device_get_subsystem; + kernel_device_class->get_name = kernel_device_get_name; + kernel_device_class->get_driver = kernel_device_get_driver; + kernel_device_class->get_sysfs_path = kernel_device_get_sysfs_path; + kernel_device_class->get_physdev_uid = kernel_device_get_physdev_uid; + kernel_device_class->get_physdev_vid = kernel_device_get_physdev_vid; + kernel_device_class->get_physdev_pid = kernel_device_get_physdev_pid; + kernel_device_class->get_physdev_revision = kernel_device_get_physdev_revision; + kernel_device_class->get_physdev_sysfs_path = kernel_device_get_physdev_sysfs_path; + kernel_device_class->get_physdev_subsystem = kernel_device_get_physdev_subsystem; + kernel_device_class->get_physdev_manufacturer = kernel_device_get_physdev_manufacturer; + kernel_device_class->get_physdev_product = kernel_device_get_physdev_product; + kernel_device_class->get_interface_class = kernel_device_get_interface_class; + kernel_device_class->get_interface_subclass = kernel_device_get_interface_subclass; + kernel_device_class->get_interface_protocol = kernel_device_get_interface_protocol; + kernel_device_class->get_interface_sysfs_path = kernel_device_get_interface_sysfs_path; + kernel_device_class->cmp = kernel_device_cmp; + kernel_device_class->has_property = kernel_device_has_property; + kernel_device_class->get_property = kernel_device_get_property; + kernel_device_class->get_property_as_boolean = kernel_device_get_property_as_boolean; + kernel_device_class->get_property_as_int = kernel_device_get_property_as_int; + kernel_device_class->get_property_as_int_hex = kernel_device_get_property_as_int_hex; + + /* Device-wide properties are stored per-port in the generic backend */ + kernel_device_class->has_global_property = kernel_device_has_property; + kernel_device_class->get_global_property = kernel_device_get_property; + kernel_device_class->get_global_property_as_boolean = kernel_device_get_property_as_boolean; + kernel_device_class->get_global_property_as_int = kernel_device_get_property_as_int; + kernel_device_class->get_global_property_as_int_hex = kernel_device_get_property_as_int_hex; + + properties[PROP_PROPERTIES] = + g_param_spec_object ("properties", + "Properties", + "Generic kernel event properties", + MM_TYPE_KERNEL_EVENT_PROPERTIES, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_PROPERTIES, properties[PROP_PROPERTIES]); + + properties[PROP_RULES] = + g_param_spec_boxed ("rules", + "Rules", + "List of rules to apply", + G_TYPE_ARRAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_RULES, properties[PROP_RULES]); +} diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic.h modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic.h --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#ifndef MM_KERNEL_DEVICE_GENERIC_H +#define MM_KERNEL_DEVICE_GENERIC_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-kernel-device.h" + +#define MM_TYPE_KERNEL_DEVICE_GENERIC (mm_kernel_device_generic_get_type ()) +#define MM_KERNEL_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGeneric)) +#define MM_KERNEL_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGenericClass)) +#define MM_IS_KERNEL_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC)) +#define MM_IS_KERNEL_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_KERNEL_DEVICE_GENERIC)) +#define MM_KERNEL_DEVICE_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_KERNEL_DEVICE_GENERIC, MMKernelDeviceGenericClass)) + +typedef struct _MMKernelDeviceGeneric MMKernelDeviceGeneric; +typedef struct _MMKernelDeviceGenericClass MMKernelDeviceGenericClass; +typedef struct _MMKernelDeviceGenericPrivate MMKernelDeviceGenericPrivate; + +struct _MMKernelDeviceGeneric { + MMKernelDevice parent; + MMKernelDeviceGenericPrivate *priv; +}; + +struct _MMKernelDeviceGenericClass { + MMKernelDeviceClass parent; +}; + +GType mm_kernel_device_generic_get_type (void); +MMKernelDevice *mm_kernel_device_generic_new (MMKernelEventProperties *properties, + GError **error); +MMKernelDevice *mm_kernel_device_generic_new_with_rules (MMKernelEventProperties *properties, + GArray *rules, + GError **error); + +#endif /* MM_KERNEL_DEVICE_GENERIC_H */ diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic-rules.c modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic-rules.c --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic-rules.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic-rules.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,446 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include "config.h" + +#include + +#include +#define _LIBMM_INSIDE_MM +#include + +#include "mm-log.h" +#include "mm-kernel-device-generic-rules.h" + +static void +udev_rule_match_clear (MMUdevRuleMatch *rule_match) +{ + g_free (rule_match->parameter); + g_free (rule_match->value); +} + +static void +udev_rule_clear (MMUdevRule *rule) +{ + switch (rule->result.type) { + case MM_UDEV_RULE_RESULT_TYPE_PROPERTY: + g_free (rule->result.content.property.name); + g_free (rule->result.content.property.value); + break; + case MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG: + case MM_UDEV_RULE_RESULT_TYPE_LABEL: + g_free (rule->result.content.tag); + break; + case MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX: + case MM_UDEV_RULE_RESULT_TYPE_UNKNOWN: + break; + } + + if (rule->conditions) + g_array_unref (rule->conditions); +} + +static gboolean +split_item (const gchar *item, + gchar **out_left, + gchar **out_operator, + gchar **out_right, + GError **error) +{ + const gchar *aux; + gchar *left = NULL; + gchar *operator = NULL; + gchar *right = NULL; + GError *inner_error = NULL; + + g_assert (item && out_left && out_operator && out_right); + + /* Get left/operator/right */ + if (((aux = strstr (item, "==")) != NULL) || ((aux = strstr (item, "!=")) != NULL)) { + operator = g_strndup (aux, 2); + right = g_strdup (aux + 2); + } else if ((aux = strstr (item, "=")) != NULL) { + operator = g_strndup (aux, 1); + right = g_strdup (aux + 1); + } else { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule item, missing operator: '%s'", item); + goto out; + } + + left = g_strndup (item, (aux - item)); + g_strstrip (left); + if (!left[0]) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule item, missing left field: '%s'", item); + goto out; + } + + g_strdelimit (right, "\"", ' '); + g_strstrip (right); + if (!right[0]) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule item, missing right field: '%s'", item); + goto out; + } + +out: + if (inner_error) { + g_free (left); + g_free (operator); + g_free (right); + g_propagate_error (error, inner_error); + return FALSE; + } + + *out_left = left; + *out_operator = operator; + *out_right = right; + return TRUE; +} + +static gboolean +load_rule_result (MMUdevRuleResult *rule_result, + const gchar *item, + GError **error) +{ + gchar *left; + gchar *operator; + gchar *right; + GError *inner_error = NULL; + gsize left_len; + + if (!split_item (item, &left, &operator, &right, error)) + return FALSE; + + if (!g_str_equal (operator, "=")) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule result operator: '%s'", item); + goto out; + } + + if (g_str_equal (left, "LABEL")) { + rule_result->type = MM_UDEV_RULE_RESULT_TYPE_LABEL; + rule_result->content.tag = right; + right = NULL; + goto out; + } + + if (g_str_equal (left, "GOTO")) { + rule_result->type = MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG; + rule_result->content.tag = right; + right = NULL; + goto out; + } + + left_len = strlen (left); + if (g_str_has_prefix (left, "ENV{") && left[left_len - 1] == '}') { + rule_result->type = MM_UDEV_RULE_RESULT_TYPE_PROPERTY; + rule_result->content.property.name = g_strndup (left + 4, left_len - 5); + rule_result->content.property.value = right; + right = NULL; + goto out; + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule result parameter: '%s'", item); + +out: + g_free (left); + g_free (operator); + g_free (right); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + return TRUE; +} + +static gboolean +load_rule_match (MMUdevRuleMatch *rule_match, + const gchar *item, + GError **error) +{ + gchar *left; + gchar *operator; + gchar *right; + + if (!split_item (item, &left, &operator, &right, error)) + return FALSE; + + if (g_str_equal (operator, "==")) + rule_match->type = MM_UDEV_RULE_MATCH_TYPE_EQUAL; + else if (g_str_equal (operator, "!=")) + rule_match->type = MM_UDEV_RULE_MATCH_TYPE_NOT_EQUAL; + else { + g_free (left); + g_free (operator); + g_free (right); + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid rule match, wrong match type: '%s'", item); + + return FALSE; + } + + g_free (operator); + rule_match->parameter = left; + rule_match->value = right; + return TRUE; +} + +static gboolean +load_rule_from_line (MMUdevRule *rule, + const gchar *line, + GError **error) +{ + gchar **split; + guint n_items; + GError *inner_error = NULL; + + split = g_strsplit (line, ",", -1); + n_items = g_strv_length (split); + + /* Conditions */ + if (n_items > 1) { + guint i; + + rule->conditions = g_array_sized_new (FALSE, FALSE, sizeof (MMUdevRuleMatch), n_items - 1); + g_array_set_clear_func (rule->conditions, (GDestroyNotify) udev_rule_match_clear); + + /* All items except for the last one are conditions */ + for (i = 0; !inner_error && i < (n_items - 1); i++) { + MMUdevRuleMatch rule_match = { 0 }; + + /* If condition correctly preloaded, add it to the rule */ + if (!load_rule_match (&rule_match, split[i], &inner_error)) + goto out; + g_assert (rule_match.type != MM_UDEV_RULE_MATCH_TYPE_UNKNOWN); + g_assert (rule_match.parameter); + g_assert (rule_match.value); + g_array_append_val (rule->conditions, rule_match); + } + } + + /* Last item, the result */ + if (!load_rule_result (&rule->result, split[n_items - 1], &inner_error)) + goto out; + + g_assert ((rule->result.type == MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG && rule->result.content.tag) || + (rule->result.type == MM_UDEV_RULE_RESULT_TYPE_LABEL && rule->result.content.tag) || + (rule->result.type == MM_UDEV_RULE_RESULT_TYPE_PROPERTY && rule->result.content.property.name && rule->result.content.property.value)); + +out: + g_strfreev (split); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + return TRUE; +} + +static gboolean +process_goto_tags (GArray *rules, + guint first_rule_index, + GError **error) +{ + guint i; + + for (i = first_rule_index; i < rules->len; i++) { + MMUdevRule *rule; + + rule = &g_array_index (rules, MMUdevRule, i); + if (rule->result.type == MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG) { + guint j; + guint label_index = 0; + + for (j = i + 1; j < rules->len; j++) { + MMUdevRule *walker; + + walker = &g_array_index (rules, MMUdevRule, j); + if (walker->result.type == MM_UDEV_RULE_RESULT_TYPE_LABEL && + g_str_equal (rule->result.content.tag, walker->result.content.tag)) { + + if (label_index) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "More than one label '%s' found", rule->result.content.tag); + return FALSE; + } + + label_index = j; + } + } + + if (!label_index) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find label '%s'", rule->result.content.tag); + return FALSE; + } + + rule->result.type = MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX; + g_free (rule->result.content.tag); + rule->result.content.index = label_index; + } + } + + return TRUE; +} + +static gboolean +load_rules_from_file (GArray *rules, + const gchar *path, + GError **error) +{ + GFile *file; + GFileInputStream *fistream; + GDataInputStream *distream = NULL; + GError *inner_error = NULL; + gchar *line; + guint first_rule_index; + + mm_dbg ("[rules] loading rules from: %s", path); + first_rule_index = rules->len; + + file = g_file_new_for_path (path); + fistream = g_file_read (file, NULL, &inner_error); + if (!fistream) + goto out; + + distream = g_data_input_stream_new (G_INPUT_STREAM (fistream)); + + while (((line = g_data_input_stream_read_line_utf8 (distream, NULL, NULL, &inner_error)) != NULL) && !inner_error) { + const gchar *aux; + + aux = line; + while (*aux == ' ') + aux++; + if (*aux != '#' && *aux != '\0') { + MMUdevRule rule = { 0 }; + + if (load_rule_from_line (&rule, aux, &inner_error)) + g_array_append_val (rules, rule); + else + udev_rule_clear (&rule); + } + g_free (line); + } + +out: + + if (distream) + g_object_unref (distream); + if (fistream) + g_object_unref (fistream); + g_object_unref (file); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (first_rule_index < rules->len && !process_goto_tags (rules, first_rule_index, error)) + return FALSE; + + return TRUE; +} + +static GList * +list_rule_files (const gchar *rules_dir_path) +{ + static const gchar *expected_rules_prefix[] = { "77-mm-", "78-mm-", "79-mm-", "80-mm-" }; + GFile *udevrulesdir; + GFileEnumerator *enumerator; + GList *children = NULL; + + udevrulesdir = g_file_new_for_path (rules_dir_path); + enumerator = g_file_enumerate_children (udevrulesdir, + G_FILE_ATTRIBUTE_STANDARD_NAME, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + if (enumerator) { + GFileInfo *info; + + /* If we get any kind of error, assume we need to stop enumerating */ + while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) { + guint i; + + for (i = 0; i < G_N_ELEMENTS (expected_rules_prefix); i++) { + if (g_str_has_prefix (g_file_info_get_name (info), expected_rules_prefix[i])) { + children = g_list_prepend (children, g_build_path (G_DIR_SEPARATOR_S, rules_dir_path, g_file_info_get_name (info), NULL)); + break; + } + } + g_object_unref (info); + } + g_object_unref (enumerator); + } + g_object_unref (udevrulesdir); + + return g_list_sort (children, (GCompareFunc) g_strcmp0); +} + +GArray * +mm_kernel_device_generic_rules_load (const gchar *rules_dir, + GError **error) +{ + GList *rule_files, *l; + GArray *rules; + GError *inner_error = NULL; + + mm_dbg ("[rules] rules directory set to '%s'...", rules_dir); + + rules = g_array_new (FALSE, FALSE, sizeof (MMUdevRule)); + g_array_set_clear_func (rules, (GDestroyNotify) udev_rule_clear); + + /* List rule files in rules dir */ + rule_files = list_rule_files (rules_dir); + if (!rule_files) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No rule files found in '%s'", rules_dir); + goto out; + } + + /* Iterate over rule files */ + for (l = rule_files; l; l = g_list_next (l)) { + if (!load_rules_from_file (rules, (const gchar *)(l->data), &inner_error)) + goto out; + } + + /* Fail if no rules were loaded */ + if (rules->len == 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "No rules loaded"); + goto out; + } + + mm_dbg ("[rules] %u loaded", rules->len); + +out: + if (rule_files) + g_list_free_full (rule_files, g_free); + + if (inner_error) { + g_propagate_error (error, inner_error); + g_array_unref (rules); + return NULL; + } + + return rules; +} diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic-rules.h modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic-rules.h --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-generic-rules.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-generic-rules.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,62 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include + +G_BEGIN_DECLS + +typedef enum { + MM_UDEV_RULE_MATCH_TYPE_UNKNOWN, + MM_UDEV_RULE_MATCH_TYPE_EQUAL, + MM_UDEV_RULE_MATCH_TYPE_NOT_EQUAL, +} MMUdevRuleMatchType; + +typedef struct { + MMUdevRuleMatchType type; + gchar *parameter; + gchar *value; +} MMUdevRuleMatch; + +typedef enum { + MM_UDEV_RULE_RESULT_TYPE_UNKNOWN, + MM_UDEV_RULE_RESULT_TYPE_PROPERTY, + MM_UDEV_RULE_RESULT_TYPE_LABEL, + MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX, + MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG, /* internal use only */ +} MMUdevRuleResultType; + +typedef struct { + gchar *name; + gchar *value; +} MMUdevRuleResultProperty; + +typedef struct { + MMUdevRuleResultType type; + union { + MMUdevRuleResultProperty property; + gchar *tag; + guint index; + } content; +} MMUdevRuleResult; + +typedef struct { + GArray *conditions; + MMUdevRuleResult result; +} MMUdevRule; + +GArray *mm_kernel_device_generic_rules_load (const gchar *rules_dir, + GError **error); + +G_END_DECLS diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device.h modemmanager-1.10.0/src/kerneldevice/mm-kernel-device.h --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#ifndef MM_KERNEL_DEVICE_H +#define MM_KERNEL_DEVICE_H + +#include +#include + +#define MM_TYPE_KERNEL_DEVICE (mm_kernel_device_get_type ()) +#define MM_KERNEL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_KERNEL_DEVICE, MMKernelDevice)) +#define MM_KERNEL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_KERNEL_DEVICE, MMKernelDeviceClass)) +#define MM_IS_KERNEL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_KERNEL_DEVICE)) +#define MM_IS_KERNEL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_KERNEL_DEVICE)) +#define MM_KERNEL_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_KERNEL_DEVICE, MMKernelDeviceClass)) + +typedef struct _MMKernelDevice MMKernelDevice; +typedef struct _MMKernelDeviceClass MMKernelDeviceClass; + +struct _MMKernelDevice { + GObject parent; +}; + +struct _MMKernelDeviceClass { + GObjectClass parent; + + const gchar * (* get_subsystem) (MMKernelDevice *self); + const gchar * (* get_name) (MMKernelDevice *self); + const gchar * (* get_driver) (MMKernelDevice *self); + const gchar * (* get_sysfs_path) (MMKernelDevice *self); + + gint (* get_interface_class) (MMKernelDevice *self); + gint (* get_interface_subclass) (MMKernelDevice *self); + gint (* get_interface_protocol) (MMKernelDevice *self); + const gchar * (* get_interface_sysfs_path) (MMKernelDevice *self); + + const gchar * (* get_physdev_uid) (MMKernelDevice *self); + guint16 (* get_physdev_vid) (MMKernelDevice *self); + guint16 (* get_physdev_pid) (MMKernelDevice *self); + guint16 (* get_physdev_revision) (MMKernelDevice *self); + const gchar * (* get_physdev_sysfs_path) (MMKernelDevice *self); + const gchar * (* get_physdev_subsystem) (MMKernelDevice *self); + const gchar * (* get_physdev_manufacturer) (MMKernelDevice *self); + const gchar * (* get_physdev_product) (MMKernelDevice *self); + + gboolean (* cmp) (MMKernelDevice *a, MMKernelDevice *b); + + gboolean (* has_property) (MMKernelDevice *self, const gchar *property); + const gchar * (* get_property) (MMKernelDevice *self, const gchar *property); + gboolean (* get_property_as_boolean) (MMKernelDevice *self, const gchar *property); + gint (* get_property_as_int) (MMKernelDevice *self, const gchar *property); + guint (* get_property_as_int_hex) (MMKernelDevice *self, const gchar *property); + + gboolean (* has_global_property) (MMKernelDevice *self, const gchar *property); + const gchar * (* get_global_property) (MMKernelDevice *self, const gchar *property); + gboolean (* get_global_property_as_boolean) (MMKernelDevice *self, const gchar *property); + gint (* get_global_property_as_int) (MMKernelDevice *self, const gchar *property); + guint (* get_global_property_as_int_hex) (MMKernelDevice *self, const gchar *property); +}; + +GType mm_kernel_device_get_type (void); + +const gchar *mm_kernel_device_get_subsystem (MMKernelDevice *self); +const gchar *mm_kernel_device_get_name (MMKernelDevice *self); +const gchar *mm_kernel_device_get_driver (MMKernelDevice *self); +const gchar *mm_kernel_device_get_sysfs_path (MMKernelDevice *self); + +gint mm_kernel_device_get_interface_class (MMKernelDevice *self); +gint mm_kernel_device_get_interface_subclass (MMKernelDevice *self); +gint mm_kernel_device_get_interface_protocol (MMKernelDevice *self); +const gchar *mm_kernel_device_get_interface_sysfs_path (MMKernelDevice *self); + +const gchar *mm_kernel_device_get_physdev_uid (MMKernelDevice *self); +guint16 mm_kernel_device_get_physdev_vid (MMKernelDevice *self); +guint16 mm_kernel_device_get_physdev_pid (MMKernelDevice *self); +guint16 mm_kernel_device_get_physdev_revision (MMKernelDevice *self); +const gchar *mm_kernel_device_get_physdev_sysfs_path (MMKernelDevice *self); +const gchar *mm_kernel_device_get_physdev_subsystem (MMKernelDevice *self); +const gchar *mm_kernel_device_get_physdev_manufacturer (MMKernelDevice *self); +const gchar *mm_kernel_device_get_physdev_product (MMKernelDevice *self); + +gboolean mm_kernel_device_cmp (MMKernelDevice *a, MMKernelDevice *b); + +/* Standard properties are usually associated to single ports */ +gboolean mm_kernel_device_has_property (MMKernelDevice *self, const gchar *property); +const gchar *mm_kernel_device_get_property (MMKernelDevice *self, const gchar *property); +gboolean mm_kernel_device_get_property_as_boolean (MMKernelDevice *self, const gchar *property); +gint mm_kernel_device_get_property_as_int (MMKernelDevice *self, const gchar *property); +guint mm_kernel_device_get_property_as_int_hex (MMKernelDevice *self, const gchar *property); + +/* Global properties are usually associated to full devices */ +gboolean mm_kernel_device_has_global_property (MMKernelDevice *self, const gchar *property); +const gchar *mm_kernel_device_get_global_property (MMKernelDevice *self, const gchar *property); +gboolean mm_kernel_device_get_global_property_as_boolean (MMKernelDevice *self, const gchar *property); +gint mm_kernel_device_get_global_property_as_int (MMKernelDevice *self, const gchar *property); +guint mm_kernel_device_get_global_property_as_int_hex (MMKernelDevice *self, const gchar *property); + +#endif /* MM_KERNEL_DEVICE_H */ diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-udev.c modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-udev.c --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-udev.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-udev.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,965 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#include + +#define _LIBMM_INSIDE_MM +#include + +#include + +#include "mm-kernel-device-udev.h" +#include "mm-log.h" + +static void initable_iface_init (GInitableIface *iface); + +G_DEFINE_TYPE_EXTENDED (MMKernelDeviceUdev, mm_kernel_device_udev, MM_TYPE_KERNEL_DEVICE, 0, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)) + +enum { + PROP_0, + PROP_UDEV_DEVICE, + PROP_PROPERTIES, + PROP_LAST +}; + +static GParamSpec *properties[PROP_LAST]; + +struct _MMKernelDeviceUdevPrivate { + GUdevDevice *device; + GUdevDevice *parent; + GUdevDevice *physdev; + guint16 vendor; + guint16 product; + guint16 revision; + + MMKernelEventProperties *properties; +}; + +/*****************************************************************************/ + +static gboolean +get_device_ids (GUdevDevice *device, + guint16 *vendor, + guint16 *product, + guint16 *revision) +{ + GUdevDevice *parent = NULL; + const gchar *vid = NULL, *pid = NULL, *rid = NULL, *parent_subsys; + gboolean success = FALSE; + char *pci_vid = NULL, *pci_pid = NULL; + + g_assert (vendor != NULL && product != NULL); + + parent = g_udev_device_get_parent (device); + if (parent) { + parent_subsys = g_udev_device_get_subsystem (parent); + if (parent_subsys) { + if (g_str_equal (parent_subsys, "bluetooth")) { + /* Bluetooth devices report the VID/PID of the BT adapter here, + * which isn't really what we want. Just return null IDs instead. + */ + success = TRUE; + goto out; + } else if (g_str_equal (parent_subsys, "pcmcia")) { + /* For PCMCIA devices we need to grab the PCMCIA subsystem's + * manfid and cardid, since any IDs on the tty device itself + * may be from PCMCIA controller or something else. + */ + vid = g_udev_device_get_sysfs_attr (parent, "manf_id"); + pid = g_udev_device_get_sysfs_attr (parent, "card_id"); + if (!vid || !pid) + goto out; + } else if (g_str_equal (parent_subsys, "platform")) { + /* Platform devices don't usually have a VID/PID */ + success = TRUE; + goto out; + } else if (g_str_has_prefix (parent_subsys, "usb") && + (!g_strcmp0 (g_udev_device_get_driver (parent), "qmi_wwan") || + !g_strcmp0 (g_udev_device_get_driver (parent), "cdc_mbim"))) { + /* Need to look for vendor/product in the parent of the QMI/MBIM device */ + GUdevDevice *qmi_parent; + + qmi_parent = g_udev_device_get_parent (parent); + if (qmi_parent) { + vid = g_udev_device_get_property (qmi_parent, "ID_VENDOR_ID"); + pid = g_udev_device_get_property (qmi_parent, "ID_MODEL_ID"); + rid = g_udev_device_get_property (qmi_parent, "ID_REVISION"); + g_object_unref (qmi_parent); + } + } else if (g_str_equal (parent_subsys, "pci")) { + const char *pci_id; + + /* We can't always rely on the model + vendor showing up on + * the PCI device's child, so look at the PCI parent. PCI_ID + * has the format "1931:000C". + */ + pci_id = g_udev_device_get_property (parent, "PCI_ID"); + if (pci_id && strlen (pci_id) == 9 && pci_id[4] == ':') { + vid = pci_vid = g_strdup (pci_id); + pci_vid[4] = '\0'; + pid = pci_pid = g_strdup (pci_id + 5); + } + } + } + } + + if (!vid) + vid = g_udev_device_get_property (device, "ID_VENDOR_ID"); + if (!vid) + goto out; + + if (strncmp (vid, "0x", 2) == 0) + vid += 2; + if (strlen (vid) != 4) + goto out; + + if (!pid) + pid = g_udev_device_get_property (device, "ID_MODEL_ID"); + if (!pid) + goto out; + + if (strncmp (pid, "0x", 2) == 0) + pid += 2; + if (strlen (pid) != 4) + goto out; + + *vendor = (guint16) (mm_utils_hex2byte (vid + 2) & 0xFF); + *vendor |= (guint16) ((mm_utils_hex2byte (vid) & 0xFF) << 8); + + *product = (guint16) (mm_utils_hex2byte (pid + 2) & 0xFF); + *product |= (guint16) ((mm_utils_hex2byte (pid) & 0xFF) << 8); + + + /* Revision ID optional, default to 0x0000 if unknown */ + *revision = 0; + if (!rid) + rid = g_udev_device_get_property (device, "ID_REVISION"); + if (rid) { + if (strncmp (rid, "0x", 2) == 0) + rid += 2; + if (strlen (rid) == 4) { + *revision = (guint16) (mm_utils_hex2byte (rid + 2) & 0xFF); + *revision |= (guint16) ((mm_utils_hex2byte (rid) & 0xFF) << 8); + } + } + + success = TRUE; + +out: + if (parent) + g_object_unref (parent); + g_free (pci_vid); + g_free (pci_pid); + return success; +} + +static void +ensure_device_ids (MMKernelDeviceUdev *self) +{ + /* Revision is optional */ + if (self->priv->vendor || self->priv->product) + return; + + if (!self->priv->device) + return; + + if (!get_device_ids (self->priv->device, &self->priv->vendor, &self->priv->product, &self->priv->revision)) + mm_dbg ("(%s/%s) could not get vendor/product id", + g_udev_device_get_subsystem (self->priv->device), + g_udev_device_get_name (self->priv->device)); +} + +/*****************************************************************************/ + +static GUdevDevice * +find_physical_gudevdevice (GUdevDevice *child) +{ + GUdevDevice *iter, *old = NULL; + GUdevDevice *physdev = NULL; + const char *subsys, *type, *name; + guint32 i = 0; + gboolean is_usb = FALSE, is_pcmcia = FALSE; + + g_return_val_if_fail (child != NULL, NULL); + + /* Bluetooth rfcomm devices are "virtual" and don't necessarily have + * parents at all. + */ + name = g_udev_device_get_name (child); + if (name && strncmp (name, "rfcomm", 6) == 0) + return g_object_ref (child); + + iter = g_object_ref (child); + while (iter && i++ < 8) { + subsys = g_udev_device_get_subsystem (iter); + if (subsys) { + if (is_usb || g_str_has_prefix (subsys, "usb")) { + is_usb = TRUE; + type = g_udev_device_get_devtype (iter); + if (type && !strcmp (type, "usb_device")) { + physdev = iter; + break; + } + } else if (is_pcmcia || !strcmp (subsys, "pcmcia")) { + GUdevDevice *pcmcia_parent; + const char *tmp_subsys; + + is_pcmcia = TRUE; + + /* If the parent of this PCMCIA device is no longer part of + * the PCMCIA subsystem, we want to stop since we're looking + * for the base PCMCIA device, not the PCMCIA controller which + * is usually PCI or some other bus type. + */ + pcmcia_parent = g_udev_device_get_parent (iter); + if (pcmcia_parent) { + tmp_subsys = g_udev_device_get_subsystem (pcmcia_parent); + if (tmp_subsys && strcmp (tmp_subsys, "pcmcia")) + physdev = iter; + g_object_unref (pcmcia_parent); + if (physdev) + break; + } + } else if (!strcmp (subsys, "platform") || + !strcmp (subsys, "pci") || + !strcmp (subsys, "pnp") || + !strcmp (subsys, "sdio")) { + /* Take the first parent as the physical device */ + physdev = iter; + break; + } + } + + old = iter; + iter = g_udev_device_get_parent (old); + g_object_unref (old); + } + + return physdev; +} + +static void +ensure_physdev (MMKernelDeviceUdev *self) +{ + if (self->priv->physdev) + return; + if (self->priv->device) + self->priv->physdev = find_physical_gudevdevice (self->priv->device); +} + +/*****************************************************************************/ + +static void +ensure_parent (MMKernelDeviceUdev *self) +{ + if (self->priv->parent) + return; + if (self->priv->device) + self->priv->parent = g_udev_device_get_parent (self->priv->device); +} + +/*****************************************************************************/ + +static const gchar * +kernel_device_get_subsystem (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (self->priv->device) + return g_udev_device_get_subsystem (self->priv->device); + + g_assert (self->priv->properties); + return mm_kernel_event_properties_get_subsystem (self->priv->properties); +} + +static const gchar * +kernel_device_get_name (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (self->priv->device) + return g_udev_device_get_name (self->priv->device); + + g_assert (self->priv->properties); + return mm_kernel_event_properties_get_name (self->priv->properties); +} + +static const gchar * +kernel_device_get_driver (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + const gchar *driver, *subsys, *name; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return NULL; + + driver = g_udev_device_get_driver (self->priv->device); + if (!driver) { + GUdevDevice *parent; + + parent = g_udev_device_get_parent (self->priv->device); + if (parent) + driver = g_udev_device_get_driver (parent); + + /* Check for bluetooth; it's driver is a bunch of levels up so we + * just check for the subsystem of the parent being bluetooth. + */ + if (!driver && parent) { + subsys = g_udev_device_get_subsystem (parent); + if (subsys && !strcmp (subsys, "bluetooth")) + driver = "bluetooth"; + } + + if (parent) + g_object_unref (parent); + } + + /* Newer kernels don't set up the rfcomm port parent in sysfs, + * so we must infer it from the device name. + */ + name = g_udev_device_get_name (self->priv->device); + if (!driver && strncmp (name, "rfcomm", 6) == 0) + driver = "bluetooth"; + + /* Note: may return NULL! */ + return driver; +} + +static const gchar * +kernel_device_get_sysfs_path (MMKernelDevice *self) +{ + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (self), NULL); + + if (!MM_KERNEL_DEVICE_UDEV (self)->priv->device) + return NULL; + + return g_udev_device_get_sysfs_path (MM_KERNEL_DEVICE_UDEV (self)->priv->device); +} + +static const gchar * +kernel_device_get_physdev_uid (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + const gchar *uid = NULL; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + /* Prefer the one coming in the properties, if any */ + if (self->priv->properties) { + if ((uid = mm_kernel_event_properties_get_uid (self->priv->properties)) != NULL) + return uid; + } + + /* Try to load from properties set on the physical device */ + if ((uid = mm_kernel_device_get_global_property (MM_KERNEL_DEVICE (self), ID_MM_PHYSDEV_UID)) != NULL) + return uid; + + /* Use physical device sysfs path, if any */ + if (self->priv->physdev && (uid = g_udev_device_get_sysfs_path (self->priv->physdev)) != NULL) + return uid; + + /* If there is no physical device sysfs path, use the device sysfs itself */ + g_assert (self->priv->device); + return g_udev_device_get_sysfs_path (self->priv->device); +} + +static guint16 +kernel_device_get_physdev_vid (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), 0); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_device_ids (self); + return self->priv->vendor; +} + +static guint16 +kernel_device_get_physdev_pid (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), 0); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_device_ids (self); + return self->priv->product; +} + +static guint16 +kernel_device_get_physdev_revision (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), 0); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_device_ids (self); + return self->priv->revision; +} + +static const gchar * +kernel_device_get_physdev_sysfs_path (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_physdev (self); + if (!self->priv->physdev) + return NULL; + + return g_udev_device_get_sysfs_path (self->priv->physdev); +} + +static const gchar * +kernel_device_get_physdev_subsystem (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_physdev (self); + if (!self->priv->physdev) + return NULL; + + return g_udev_device_get_subsystem (self->priv->physdev); +} + +static const gchar * +kernel_device_get_physdev_manufacturer (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_physdev (self); + if (!self->priv->physdev) + return NULL; + + return g_udev_device_get_sysfs_attr (self->priv->physdev, "manufacturer"); +} + +static const gchar * +kernel_device_get_physdev_product (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_physdev (self); + if (!self->priv->physdev) + return NULL; + + return g_udev_device_get_sysfs_attr (self->priv->physdev, "product"); +} + +static gint +kernel_device_get_interface_class (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), -1); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_parent (self); + return (self->priv->parent ? g_udev_device_get_sysfs_attr_as_int (self->priv->parent, "bInterfaceClass") : -1); +} + +static gint +kernel_device_get_interface_subclass (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), -1); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_parent (self); + return (self->priv->parent ? g_udev_device_get_sysfs_attr_as_int (self->priv->parent, "bInterfaceSubClass") : -1); +} + +static gint +kernel_device_get_interface_protocol (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), -1); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_parent (self); + return (self->priv->parent ? g_udev_device_get_sysfs_attr_as_int (self->priv->parent, "bInterfaceProtocol") : -1); +} + +static const gchar * +kernel_device_get_interface_sysfs_path (MMKernelDevice *_self) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + ensure_parent (self); + return (self->priv->parent ? g_udev_device_get_sysfs_path (self->priv->parent) : NULL); +} + +static gboolean +kernel_device_cmp (MMKernelDevice *_a, + MMKernelDevice *_b) +{ + MMKernelDeviceUdev *a; + MMKernelDeviceUdev *b; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_a), FALSE); + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_b), FALSE); + + a = MM_KERNEL_DEVICE_UDEV (_a); + b = MM_KERNEL_DEVICE_UDEV (_b); + + if (a->priv->device && b->priv->device) { + if (g_udev_device_has_property (a->priv->device, "DEVPATH_OLD") && + g_str_has_suffix (g_udev_device_get_sysfs_path (b->priv->device), + g_udev_device_get_property (a->priv->device, "DEVPATH_OLD"))) + return TRUE; + + if (g_udev_device_has_property (b->priv->device, "DEVPATH_OLD") && + g_str_has_suffix (g_udev_device_get_sysfs_path (a->priv->device), + g_udev_device_get_property (b->priv->device, "DEVPATH_OLD"))) + return TRUE; + + return !g_strcmp0 (g_udev_device_get_sysfs_path (a->priv->device), g_udev_device_get_sysfs_path (b->priv->device)); + } + + return (!g_strcmp0 (mm_kernel_device_get_subsystem (_a), mm_kernel_device_get_subsystem (_b)) && + !g_strcmp0 (mm_kernel_device_get_name (_a), mm_kernel_device_get_name (_b))); +} + +static gboolean +kernel_device_has_property (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), FALSE); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return FALSE; + + return g_udev_device_has_property (self->priv->device, property); +} + +static const gchar * +kernel_device_get_property (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return NULL; + + return g_udev_device_get_property (self->priv->device, property); +} + +static gboolean +kernel_device_get_property_as_boolean (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), FALSE); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return FALSE; + + return g_udev_device_get_property_as_boolean (self->priv->device, property); +} + +static gint +kernel_device_get_property_as_int (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), -1); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return -1; + + return g_udev_device_get_property_as_int (self->priv->device, property); +} + +static guint +kernel_device_get_property_as_int_hex (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + const gchar *s; + guint out = 0; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), G_MAXUINT); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + if (!self->priv->device) + return G_MAXUINT; + + s = g_udev_device_get_property (self->priv->device, property); + return ((s && mm_get_uint_from_hex_str (s, &out)) ? out : 0); +} + +static gboolean +kernel_device_has_global_property (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), FALSE); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + ensure_physdev (self); + if (self->priv->physdev && g_udev_device_has_property (self->priv->physdev, property)) + return TRUE; + + return kernel_device_has_property (_self, property); +} + +static const gchar * +kernel_device_get_global_property (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + const gchar *str; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), NULL); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + ensure_physdev (self); + if (self->priv->physdev && + g_udev_device_has_property (self->priv->physdev, property) && + (str = g_udev_device_get_property (self->priv->physdev, property)) != NULL) + return str; + + return kernel_device_get_property (_self, property); +} + +static gboolean +kernel_device_get_global_property_as_boolean (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), FALSE); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + ensure_physdev (self); + if (self->priv->physdev && + g_udev_device_has_property (self->priv->physdev, property) && + g_udev_device_get_property (self->priv->physdev, property)) + return TRUE; + + return kernel_device_get_property_as_boolean (_self, property); +} + +static gint +kernel_device_get_global_property_as_int (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + gint value; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), -1); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + ensure_physdev (self); + if (self->priv->physdev && + g_udev_device_has_property (self->priv->physdev, property) && + (value = g_udev_device_get_property_as_int (self->priv->physdev, property)) >= 0) + return value; + + return kernel_device_get_property_as_int (_self, property); +} + +static guint +kernel_device_get_global_property_as_int_hex (MMKernelDevice *_self, + const gchar *property) +{ + MMKernelDeviceUdev *self; + const gchar *s; + guint out = 0; + + g_return_val_if_fail (MM_IS_KERNEL_DEVICE_UDEV (_self), G_MAXUINT); + + self = MM_KERNEL_DEVICE_UDEV (_self); + + ensure_physdev (self); + if (self->priv->physdev && + g_udev_device_has_property (self->priv->physdev, property) && + (s = g_udev_device_get_property (self->priv->physdev, property)) != NULL) + return ((s && mm_get_uint_from_hex_str (s, &out)) ? out : 0); + + return kernel_device_get_property_as_int_hex (_self, property); +} + +/*****************************************************************************/ + +MMKernelDevice * +mm_kernel_device_udev_new (GUdevDevice *udev_device) +{ + GError *error = NULL; + MMKernelDevice *self; + + g_return_val_if_fail (G_UDEV_IS_DEVICE (udev_device), NULL); + + self = MM_KERNEL_DEVICE (g_initable_new (MM_TYPE_KERNEL_DEVICE_UDEV, + NULL, + &error, + "udev-device", udev_device, + NULL)); + g_assert_no_error (error); + return self; +} + +/*****************************************************************************/ + +MMKernelDevice * +mm_kernel_device_udev_new_from_properties (MMKernelEventProperties *properties, + GError **error) +{ + return MM_KERNEL_DEVICE (g_initable_new (MM_TYPE_KERNEL_DEVICE_UDEV, + NULL, + error, + "properties", properties, + NULL)); +} + +/*****************************************************************************/ + +static void +mm_kernel_device_udev_init (MMKernelDeviceUdev *self) +{ + /* Initialize private data */ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_KERNEL_DEVICE_UDEV, MMKernelDeviceUdevPrivate); +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMKernelDeviceUdev *self = MM_KERNEL_DEVICE_UDEV (object); + + switch (prop_id) { + case PROP_UDEV_DEVICE: + g_assert (!self->priv->device); + self->priv->device = g_value_dup_object (value); + break; + case PROP_PROPERTIES: + g_assert (!self->priv->properties); + self->priv->properties = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMKernelDeviceUdev *self = MM_KERNEL_DEVICE_UDEV (object); + + switch (prop_id) { + case PROP_UDEV_DEVICE: + g_value_set_object (value, self->priv->device); + break; + case PROP_PROPERTIES: + g_value_set_object (value, self->priv->properties); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + MMKernelDeviceUdev *self = MM_KERNEL_DEVICE_UDEV (initable); + const gchar *subsystem; + const gchar *name; + + /* When created from a GUdevDevice, we're done */ + if (self->priv->device) + return TRUE; + + /* Otherwise, we do need properties with subsystem and name */ + if (!self->priv->properties) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "missing properties in kernel device"); + return FALSE; + } + + subsystem = mm_kernel_event_properties_get_subsystem (self->priv->properties); + if (!subsystem) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "subsystem is mandatory in kernel device"); + return FALSE; + } + + name = mm_kernel_event_properties_get_name (self->priv->properties); + if (!mm_kernel_device_get_name (MM_KERNEL_DEVICE (self))) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "name is mandatory in kernel device"); + return FALSE; + } + + /* On remove events, we don't look for the GUdevDevice */ + if (g_strcmp0 (mm_kernel_event_properties_get_action (self->priv->properties), "remove")) { + GUdevClient *client; + GUdevDevice *device; + + client = g_udev_client_new (NULL); + device = g_udev_client_query_by_subsystem_and_name (client, subsystem, name); + if (!device) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "device %s/%s not found", + subsystem, + name); + g_object_unref (client); + return FALSE; + } + + /* Store device */ + self->priv->device = device; + g_object_unref (client); + } + + return TRUE; +} + +static void +dispose (GObject *object) +{ + MMKernelDeviceUdev *self = MM_KERNEL_DEVICE_UDEV (object); + + g_clear_object (&self->priv->physdev); + g_clear_object (&self->priv->parent); + g_clear_object (&self->priv->device); + g_clear_object (&self->priv->properties); + + G_OBJECT_CLASS (mm_kernel_device_udev_parent_class)->dispose (object); +} + +static void +initable_iface_init (GInitableIface *iface) +{ + iface->init = initable_init; +} + +static void +mm_kernel_device_udev_class_init (MMKernelDeviceUdevClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MMKernelDeviceClass *kernel_device_class = MM_KERNEL_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMKernelDeviceUdevPrivate)); + + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + kernel_device_class->get_subsystem = kernel_device_get_subsystem; + kernel_device_class->get_name = kernel_device_get_name; + kernel_device_class->get_driver = kernel_device_get_driver; + kernel_device_class->get_sysfs_path = kernel_device_get_sysfs_path; + kernel_device_class->get_physdev_uid = kernel_device_get_physdev_uid; + kernel_device_class->get_physdev_vid = kernel_device_get_physdev_vid; + kernel_device_class->get_physdev_pid = kernel_device_get_physdev_pid; + kernel_device_class->get_physdev_revision = kernel_device_get_physdev_revision; + kernel_device_class->get_physdev_sysfs_path = kernel_device_get_physdev_sysfs_path; + kernel_device_class->get_physdev_subsystem = kernel_device_get_physdev_subsystem; + kernel_device_class->get_physdev_manufacturer = kernel_device_get_physdev_manufacturer; + kernel_device_class->get_physdev_product = kernel_device_get_physdev_product; + kernel_device_class->get_interface_class = kernel_device_get_interface_class; + kernel_device_class->get_interface_subclass = kernel_device_get_interface_subclass; + kernel_device_class->get_interface_protocol = kernel_device_get_interface_protocol; + kernel_device_class->get_interface_sysfs_path = kernel_device_get_interface_sysfs_path; + kernel_device_class->cmp = kernel_device_cmp; + kernel_device_class->has_property = kernel_device_has_property; + kernel_device_class->get_property = kernel_device_get_property; + kernel_device_class->get_property_as_boolean = kernel_device_get_property_as_boolean; + kernel_device_class->get_property_as_int = kernel_device_get_property_as_int; + kernel_device_class->get_property_as_int_hex = kernel_device_get_property_as_int_hex; + kernel_device_class->has_global_property = kernel_device_has_global_property; + kernel_device_class->get_global_property = kernel_device_get_global_property; + kernel_device_class->get_global_property_as_boolean = kernel_device_get_global_property_as_boolean; + kernel_device_class->get_global_property_as_int = kernel_device_get_global_property_as_int; + kernel_device_class->get_global_property_as_int_hex = kernel_device_get_global_property_as_int_hex; + + properties[PROP_UDEV_DEVICE] = + g_param_spec_object ("udev-device", + "udev device", + "Device object as reported by GUdev", + G_UDEV_TYPE_DEVICE, + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_UDEV_DEVICE, properties[PROP_UDEV_DEVICE]); + + properties[PROP_PROPERTIES] = + g_param_spec_object ("properties", + "Properties", + "Generic kernel event properties", + MM_TYPE_KERNEL_EVENT_PROPERTIES, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_PROPERTIES, properties[PROP_PROPERTIES]); +} diff -Nru modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-udev.h modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-udev.h --- modemmanager-1.6.8/src/kerneldevice/mm-kernel-device-udev.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/kerneldevice/mm-kernel-device-udev.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,53 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Velocloud, Inc. + */ + +#ifndef MM_KERNEL_DEVICE_UDEV_H +#define MM_KERNEL_DEVICE_UDEV_H + +#include +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include "mm-kernel-device.h" + +#define MM_TYPE_KERNEL_DEVICE_UDEV (mm_kernel_device_udev_get_type ()) +#define MM_KERNEL_DEVICE_UDEV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_KERNEL_DEVICE_UDEV, MMKernelDeviceUdev)) +#define MM_KERNEL_DEVICE_UDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_KERNEL_DEVICE_UDEV, MMKernelDeviceUdevClass)) +#define MM_IS_KERNEL_DEVICE_UDEV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_KERNEL_DEVICE_UDEV)) +#define MM_IS_KERNEL_DEVICE_UDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_KERNEL_DEVICE_UDEV)) +#define MM_KERNEL_DEVICE_UDEV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_KERNEL_DEVICE_UDEV, MMKernelDeviceUdevClass)) + +typedef struct _MMKernelDeviceUdev MMKernelDeviceUdev; +typedef struct _MMKernelDeviceUdevClass MMKernelDeviceUdevClass; +typedef struct _MMKernelDeviceUdevPrivate MMKernelDeviceUdevPrivate; + +struct _MMKernelDeviceUdev { + MMKernelDevice parent; + MMKernelDeviceUdevPrivate *priv; +}; + +struct _MMKernelDeviceUdevClass { + MMKernelDeviceClass parent; +}; + +GType mm_kernel_device_udev_get_type (void); +MMKernelDevice *mm_kernel_device_udev_new (GUdevDevice *udev_device); +MMKernelDevice *mm_kernel_device_udev_new_from_properties (MMKernelEventProperties *properties, + GError **error); + +#endif /* MM_KERNEL_DEVICE_UDEV_H */ diff -Nru modemmanager-1.6.8/src/main.c modemmanager-1.10.0/src/main.c --- modemmanager-1.6.8/src/main.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/main.c 2018-11-15 09:55:53.000000000 +0100 @@ -30,7 +30,7 @@ #include "mm-log.h" #include "mm-context.h" -#if WITH_SUSPEND_RESUME +#if defined WITH_SYSTEMD_SUSPEND_RESUME # include "mm-sleep-monitor.h" #endif @@ -55,7 +55,7 @@ return FALSE; } -#if WITH_SUSPEND_RESUME +#if defined WITH_SYSTEMD_SUSPEND_RESUME static void sleeping_cb (MMSleepMonitor *sleep_monitor) @@ -86,7 +86,9 @@ g_assert (!manager); manager = mm_base_manager_new (connection, mm_context_get_test_plugin_dir (), - !mm_context_get_test_no_auto_scan (), + !mm_context_get_no_auto_scan (), + mm_context_get_filter_policy (), + mm_context_get_initial_kernel_events (), mm_context_get_test_enable (), &error); if (!manager) { @@ -135,16 +137,14 @@ GError *err = NULL; guint name_id; - g_type_init (); - /* Setup application context */ mm_context_init (argc, argv); if (!mm_log_setup (mm_context_get_log_level (), mm_context_get_log_file (), - mm_context_get_timestamps (), - mm_context_get_relative_timestamps (), - mm_context_get_debug (), + mm_context_get_log_journal (), + mm_context_get_log_timestamps (), + mm_context_get_log_relative_timestamps (), &err)) { g_warning ("Failed to set up logging: %s", err->message); g_error_free (err); @@ -166,7 +166,7 @@ name_lost_cb, NULL, NULL); -#if WITH_SUSPEND_RESUME +#if defined WITH_SYSTEMD_SUSPEND_RESUME { MMSleepMonitor *sleep_monitor; diff -Nru modemmanager-1.6.8/src/Makefile.am modemmanager-1.10.0/src/Makefile.am --- modemmanager-1.6.8/src/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/Makefile.am 2019-01-15 15:57:35.000000000 +0100 @@ -22,6 +22,7 @@ -I$(top_srcdir)/libmm-glib \ -I${top_builddir}/libmm-glib/generated \ -I${top_builddir}/libmm-glib/generated/tests \ + -I$(srcdir)/kerneldevice \ $(NULL) AM_LDFLAGS = \ @@ -45,6 +46,11 @@ AM_LDFLAGS += $(POLKIT_LIBS) endif +if WITH_SYSTEMD_JOURNAL +AM_CFLAGS += $(LIBSYSTEMD_CFLAGS) +AM_LDFLAGS += $(LIBSYSTEMD_LIBS) +endif + ################################################################################ # generic udev rules ################################################################################ @@ -53,7 +59,6 @@ udevrules_DATA = \ 77-mm-usb-device-blacklist.rules \ 77-mm-pcmcia-device-blacklist.rules \ - 77-mm-platform-serial-whitelist.rules \ 77-mm-usb-serial-adapters-greylist.rules \ 80-mm-candidate.rules \ $(NULL) @@ -66,6 +71,29 @@ noinst_LTLIBRARIES += libhelpers.la +HELPER_ENUMS_INPUTS = \ + $(srcdir)/mm-sms-part.h \ + $(srcdir)/mm-modem-helpers.h \ + $(NULL) + +HELPER_ENUMS_GENERATED = \ + mm-helper-enums-types.h \ + mm-helper-enums-types.c \ + $(NULL) + +mm-helper-enums-types.h: Makefile.am $(HELPER_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"mm-sms-part.h\"\n#include \"mm-modem-helpers.h\"\n#ifndef __MM_HELPER_ENUMS_TYPES_H__\n#define __MM_HELPER_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_HELPER_ENUMS_TYPES_H__ */\n" \ + $(HELPER_ENUMS_INPUTS) > $@ + +mm-helper-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c mm-helper-enums-types.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"mm-helper-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(HELPER_ENUMS_INPUTS) > $@ + libhelpers_la_SOURCES = \ mm-error-helpers.c \ mm-error-helpers.h \ @@ -81,6 +109,8 @@ mm-sms-part-cdma.c \ $(NULL) +nodist_libhelpers_la_SOURCES = $(HELPER_ENUMS_GENERATED) + if WITH_QMI libhelpers_la_SOURCES += \ mm-modem-helpers-qmi.c \ @@ -95,6 +125,41 @@ $(NULL) endif +# Request to build enum types before anything else +BUILT_SOURCES += $(HELPER_ENUMS_GENERATED) +CLEANFILES += $(HELPER_ENUMS_GENERATED) + + +################################################################################ +# kerneldevice library +################################################################################ + +noinst_LTLIBRARIES += libkerneldevice.la + +libkerneldevice_la_CPPFLAGS = \ + -DUDEVRULESDIR=\"$(udevrulesdir)\" \ + $(NULL) + +libkerneldevice_la_SOURCES = \ + kerneldevice/mm-kernel-device.h \ + kerneldevice/mm-kernel-device.c \ + kerneldevice/mm-kernel-device-generic.h \ + kerneldevice/mm-kernel-device-generic.c \ + kerneldevice/mm-kernel-device-generic-rules.h \ + kerneldevice/mm-kernel-device-generic-rules.c \ + $(NULL) + +if WITH_UDEV +libkerneldevice_la_SOURCES += \ + kerneldevice/mm-kernel-device-udev.h \ + kerneldevice/mm-kernel-device-udev.c \ + $(NULL) +endif + +libkerneldevice_la_LIBADD = \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + ################################################################################ # ports library ################################################################################ @@ -159,6 +224,7 @@ $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(builddir)/libhelpers.la \ + $(builddir)/libkerneldevice.la \ $(NULL) # Request to build enum types before anything else @@ -172,6 +238,7 @@ sbin_PROGRAMS += ModemManager DAEMON_ENUMS_INPUTS = \ + $(srcdir)/mm-filter.h \ $(srcdir)/mm-base-bearer.h \ $(srcdir)/mm-port-probe.h \ $(NULL) @@ -183,7 +250,7 @@ mm-daemon-enums-types.h: Makefile.am $(DAEMON_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#include \"mm-base-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \ + --fhead "#include \"mm-filter.h\"\n#include \"mm-base-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \ --template $(top_srcdir)/build-aux/mm-enums-template.h \ --ftail "#endif /* __MM_DAEMON_ENUMS_TYPES_H__ */\n" \ $(DAEMON_ENUMS_INPUTS) > $@ @@ -206,7 +273,6 @@ $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(top_builddir)/libmm-glib/generated/tests/libmm-test-generated.la \ - $(builddir)/libhelpers.la \ $(builddir)/libport.la \ $(NULL) @@ -223,6 +289,8 @@ mm-auth.c \ mm-auth-provider.h \ mm-auth-provider.c \ + mm-filter.h \ + mm-filter.c \ mm-base-manager.c \ mm-base-manager.h \ mm-device.c \ @@ -291,13 +359,15 @@ endif # Additional suspend/resume support via systemd -if SUSPEND_RESUME_SYSTEMD +if WITH_SYSTEMD_SUSPEND_RESUME ModemManager_SOURCES += mm-sleep-monitor.h mm-sleep-monitor.c endif # Additional QMI support in ModemManager if WITH_QMI ModemManager_SOURCES += \ + mm-shared-qmi.h \ + mm-shared-qmi.c \ mm-sms-qmi.h \ mm-sms-qmi.c \ mm-sim-qmi.h \ diff -Nru modemmanager-1.6.8/src/Makefile.in modemmanager-1.10.0/src/Makefile.in --- modemmanager-1.6.8/src/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/src/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -97,35 +97,44 @@ @WITH_MBIM_TRUE@am__append_4 = $(MBIM_LIBS) @WITH_POLKIT_TRUE@am__append_5 = $(POLKIT_CFLAGS) @WITH_POLKIT_TRUE@am__append_6 = $(POLKIT_LIBS) -@WITH_QMI_TRUE@am__append_7 = \ +@WITH_SYSTEMD_JOURNAL_TRUE@am__append_7 = $(LIBSYSTEMD_CFLAGS) +@WITH_SYSTEMD_JOURNAL_TRUE@am__append_8 = $(LIBSYSTEMD_LIBS) +@WITH_QMI_TRUE@am__append_9 = \ @WITH_QMI_TRUE@ mm-modem-helpers-qmi.c \ @WITH_QMI_TRUE@ mm-modem-helpers-qmi.h \ @WITH_QMI_TRUE@ $(NULL) -@WITH_MBIM_TRUE@am__append_8 = \ +@WITH_MBIM_TRUE@am__append_10 = \ @WITH_MBIM_TRUE@ mm-modem-helpers-mbim.c \ @WITH_MBIM_TRUE@ mm-modem-helpers-mbim.h \ @WITH_MBIM_TRUE@ $(NULL) -@WITH_QMI_TRUE@am__append_9 = \ +@WITH_UDEV_TRUE@am__append_11 = \ +@WITH_UDEV_TRUE@ kerneldevice/mm-kernel-device-udev.h \ +@WITH_UDEV_TRUE@ kerneldevice/mm-kernel-device-udev.c \ +@WITH_UDEV_TRUE@ $(NULL) + +@WITH_QMI_TRUE@am__append_12 = \ @WITH_QMI_TRUE@ mm-port-qmi.c \ @WITH_QMI_TRUE@ mm-port-qmi.h \ @WITH_QMI_TRUE@ $(NULL) -@WITH_MBIM_TRUE@am__append_10 = \ +@WITH_MBIM_TRUE@am__append_13 = \ @WITH_MBIM_TRUE@ mm-port-mbim.c \ @WITH_MBIM_TRUE@ mm-port-mbim.h \ @WITH_MBIM_TRUE@ $(NULL) # Additional Polkit support -@WITH_POLKIT_TRUE@am__append_11 = mm-auth-provider-polkit.h mm-auth-provider-polkit.c +@WITH_POLKIT_TRUE@am__append_14 = mm-auth-provider-polkit.h mm-auth-provider-polkit.c # Additional suspend/resume support via systemd -@SUSPEND_RESUME_SYSTEMD_TRUE@am__append_12 = mm-sleep-monitor.h mm-sleep-monitor.c +@WITH_SYSTEMD_SUSPEND_RESUME_TRUE@am__append_15 = mm-sleep-monitor.h mm-sleep-monitor.c # Additional QMI support in ModemManager -@WITH_QMI_TRUE@am__append_13 = \ +@WITH_QMI_TRUE@am__append_16 = \ +@WITH_QMI_TRUE@ mm-shared-qmi.h \ +@WITH_QMI_TRUE@ mm-shared-qmi.c \ @WITH_QMI_TRUE@ mm-sms-qmi.h \ @WITH_QMI_TRUE@ mm-sms-qmi.c \ @WITH_QMI_TRUE@ mm-sim-qmi.h \ @@ -138,7 +147,7 @@ # Additional MBIM support in ModemManager -@WITH_MBIM_TRUE@am__append_14 = \ +@WITH_MBIM_TRUE@am__append_17 = \ @WITH_MBIM_TRUE@ mm-sms-mbim.h \ @WITH_MBIM_TRUE@ mm-sms-mbim.c \ @WITH_MBIM_TRUE@ mm-sim-mbim.h \ @@ -155,14 +164,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -170,6 +178,8 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(udevrulesdir)" +PROGRAMS = $(sbin_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) libhelpers_la_LIBADD = am__libhelpers_la_SOURCES_DIST = mm-error-helpers.c mm-error-helpers.h \ @@ -183,45 +193,64 @@ am_libhelpers_la_OBJECTS = mm-error-helpers.lo mm-modem-helpers.lo \ mm-charsets.lo mm-sms-part.lo mm-sms-part-3gpp.lo \ mm-sms-part-cdma.lo $(am__objects_1) $(am__objects_2) -libhelpers_la_OBJECTS = $(am_libhelpers_la_OBJECTS) +am__objects_3 = mm-helper-enums-types.lo +nodist_libhelpers_la_OBJECTS = $(am__objects_3) +libhelpers_la_OBJECTS = $(am_libhelpers_la_OBJECTS) \ + $(nodist_libhelpers_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libkerneldevice_la_DEPENDENCIES = \ + $(top_builddir)/libmm-glib/libmm-glib.la +am__libkerneldevice_la_SOURCES_DIST = kerneldevice/mm-kernel-device.h \ + kerneldevice/mm-kernel-device.c \ + kerneldevice/mm-kernel-device-generic.h \ + kerneldevice/mm-kernel-device-generic.c \ + kerneldevice/mm-kernel-device-generic-rules.h \ + kerneldevice/mm-kernel-device-generic-rules.c \ + kerneldevice/mm-kernel-device-udev.h \ + kerneldevice/mm-kernel-device-udev.c +am__dirstamp = $(am__leading_dot)dirstamp +@WITH_UDEV_TRUE@am__objects_4 = kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo +am_libkerneldevice_la_OBJECTS = \ + kerneldevice/libkerneldevice_la-mm-kernel-device.lo \ + kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo \ + kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo \ + $(am__objects_4) +libkerneldevice_la_OBJECTS = $(am_libkerneldevice_la_OBJECTS) libport_la_DEPENDENCIES = $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ - $(builddir)/libhelpers.la + $(builddir)/libhelpers.la $(builddir)/libkerneldevice.la am__libport_la_SOURCES_DIST = mm-port.c mm-port.h mm-port-serial.c \ mm-port-serial.h mm-port-serial-at.c mm-port-serial-at.h \ mm-port-serial-qcdm.c mm-port-serial-qcdm.h \ mm-port-serial-gps.c mm-port-serial-gps.h mm-serial-parsers.c \ mm-serial-parsers.h mm-port-qmi.c mm-port-qmi.h mm-port-mbim.c \ mm-port-mbim.h -@WITH_QMI_TRUE@am__objects_3 = mm-port-qmi.lo -@WITH_MBIM_TRUE@am__objects_4 = mm-port-mbim.lo +@WITH_QMI_TRUE@am__objects_5 = mm-port-qmi.lo +@WITH_MBIM_TRUE@am__objects_6 = mm-port-mbim.lo am_libport_la_OBJECTS = mm-port.lo mm-port-serial.lo \ mm-port-serial-at.lo mm-port-serial-qcdm.lo \ - mm-port-serial-gps.lo mm-serial-parsers.lo $(am__objects_3) \ - $(am__objects_4) -am__objects_5 = mm-port-enums-types.lo -nodist_libport_la_OBJECTS = $(am__objects_5) + mm-port-serial-gps.lo mm-serial-parsers.lo $(am__objects_5) \ + $(am__objects_6) +am__objects_7 = mm-port-enums-types.lo +nodist_libport_la_OBJECTS = $(am__objects_7) libport_la_OBJECTS = $(am_libport_la_OBJECTS) \ $(nodist_libport_la_OBJECTS) -am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(udevrulesdir)" -PROGRAMS = $(sbin_PROGRAMS) am__ModemManager_SOURCES_DIST = main.c mm-context.h mm-context.c \ mm-log.c mm-log.h mm-utils.h mm-private-boxed-types.h \ mm-private-boxed-types.c mm-auth.h mm-auth.c \ - mm-auth-provider.h mm-auth-provider.c mm-base-manager.c \ - mm-base-manager.h mm-device.c mm-device.h mm-plugin-manager.c \ - mm-plugin-manager.h mm-base-sim.h mm-base-sim.c \ - mm-base-bearer.h mm-base-bearer.c mm-broadband-bearer.h \ - mm-broadband-bearer.c mm-bearer-list.h mm-bearer-list.c \ - mm-base-modem-at.h mm-base-modem-at.c mm-base-modem.h \ - mm-base-modem.c mm-base-sms.h mm-base-sms.c mm-base-call.h \ - mm-base-call.c mm-sms-list.h mm-sms-list.c mm-call-list.h \ - mm-call-list.c mm-iface-modem.h mm-iface-modem.c \ - mm-iface-modem-3gpp.h mm-iface-modem-3gpp.c \ + mm-auth-provider.h mm-auth-provider.c mm-filter.h mm-filter.c \ + mm-base-manager.c mm-base-manager.h mm-device.c mm-device.h \ + mm-plugin-manager.c mm-plugin-manager.h mm-base-sim.h \ + mm-base-sim.c mm-base-bearer.h mm-base-bearer.c \ + mm-broadband-bearer.h mm-broadband-bearer.c mm-bearer-list.h \ + mm-bearer-list.c mm-base-modem-at.h mm-base-modem-at.c \ + mm-base-modem.h mm-base-modem.c mm-base-sms.h mm-base-sms.c \ + mm-base-call.h mm-base-call.c mm-sms-list.h mm-sms-list.c \ + mm-call-list.h mm-call-list.c mm-iface-modem.h \ + mm-iface-modem.c mm-iface-modem-3gpp.h mm-iface-modem-3gpp.c \ mm-iface-modem-3gpp-ussd.h mm-iface-modem-3gpp-ussd.c \ mm-iface-modem-cdma.h mm-iface-modem-cdma.c \ mm-iface-modem-simple.h mm-iface-modem-simple.c \ @@ -235,19 +264,21 @@ mm-broadband-modem.c mm-port-probe.h mm-port-probe.c \ mm-port-probe-at.h mm-port-probe-at.c mm-plugin.c mm-plugin.h \ mm-auth-provider-polkit.h mm-auth-provider-polkit.c \ - mm-sleep-monitor.h mm-sleep-monitor.c mm-sms-qmi.h \ - mm-sms-qmi.c mm-sim-qmi.h mm-sim-qmi.c mm-bearer-qmi.h \ - mm-bearer-qmi.c mm-broadband-modem-qmi.h \ - mm-broadband-modem-qmi.c mm-sms-mbim.h mm-sms-mbim.c \ - mm-sim-mbim.h mm-sim-mbim.c mm-bearer-mbim.h mm-bearer-mbim.c \ - mm-broadband-modem-mbim.h mm-broadband-modem-mbim.c -@WITH_POLKIT_TRUE@am__objects_6 = ModemManager-mm-auth-provider-polkit.$(OBJEXT) -@SUSPEND_RESUME_SYSTEMD_TRUE@am__objects_7 = ModemManager-mm-sleep-monitor.$(OBJEXT) -@WITH_QMI_TRUE@am__objects_8 = ModemManager-mm-sms-qmi.$(OBJEXT) \ + mm-sleep-monitor.h mm-sleep-monitor.c mm-shared-qmi.h \ + mm-shared-qmi.c mm-sms-qmi.h mm-sms-qmi.c mm-sim-qmi.h \ + mm-sim-qmi.c mm-bearer-qmi.h mm-bearer-qmi.c \ + mm-broadband-modem-qmi.h mm-broadband-modem-qmi.c \ + mm-sms-mbim.h mm-sms-mbim.c mm-sim-mbim.h mm-sim-mbim.c \ + mm-bearer-mbim.h mm-bearer-mbim.c mm-broadband-modem-mbim.h \ + mm-broadband-modem-mbim.c +@WITH_POLKIT_TRUE@am__objects_8 = ModemManager-mm-auth-provider-polkit.$(OBJEXT) +@WITH_SYSTEMD_SUSPEND_RESUME_TRUE@am__objects_9 = ModemManager-mm-sleep-monitor.$(OBJEXT) +@WITH_QMI_TRUE@am__objects_10 = ModemManager-mm-shared-qmi.$(OBJEXT) \ +@WITH_QMI_TRUE@ ModemManager-mm-sms-qmi.$(OBJEXT) \ @WITH_QMI_TRUE@ ModemManager-mm-sim-qmi.$(OBJEXT) \ @WITH_QMI_TRUE@ ModemManager-mm-bearer-qmi.$(OBJEXT) \ @WITH_QMI_TRUE@ ModemManager-mm-broadband-modem-qmi.$(OBJEXT) -@WITH_MBIM_TRUE@am__objects_9 = ModemManager-mm-sms-mbim.$(OBJEXT) \ +@WITH_MBIM_TRUE@am__objects_11 = ModemManager-mm-sms-mbim.$(OBJEXT) \ @WITH_MBIM_TRUE@ ModemManager-mm-sim-mbim.$(OBJEXT) \ @WITH_MBIM_TRUE@ ModemManager-mm-bearer-mbim.$(OBJEXT) \ @WITH_MBIM_TRUE@ ModemManager-mm-broadband-modem-mbim.$(OBJEXT) @@ -257,6 +288,7 @@ ModemManager-mm-private-boxed-types.$(OBJEXT) \ ModemManager-mm-auth.$(OBJEXT) \ ModemManager-mm-auth-provider.$(OBJEXT) \ + ModemManager-mm-filter.$(OBJEXT) \ ModemManager-mm-base-manager.$(OBJEXT) \ ModemManager-mm-device.$(OBJEXT) \ ModemManager-mm-plugin-manager.$(OBJEXT) \ @@ -285,16 +317,16 @@ ModemManager-mm-broadband-modem.$(OBJEXT) \ ModemManager-mm-port-probe.$(OBJEXT) \ ModemManager-mm-port-probe-at.$(OBJEXT) \ - ModemManager-mm-plugin.$(OBJEXT) $(am__objects_6) \ - $(am__objects_7) $(am__objects_8) $(am__objects_9) -am__objects_10 = ModemManager-mm-daemon-enums-types.$(OBJEXT) -nodist_ModemManager_OBJECTS = $(am__objects_10) + ModemManager-mm-plugin.$(OBJEXT) $(am__objects_8) \ + $(am__objects_9) $(am__objects_10) $(am__objects_11) +am__objects_12 = ModemManager-mm-daemon-enums-types.$(OBJEXT) +nodist_ModemManager_OBJECTS = $(am__objects_12) ModemManager_OBJECTS = $(am_ModemManager_OBJECTS) \ $(nodist_ModemManager_OBJECTS) ModemManager_DEPENDENCIES = $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(top_builddir)/libmm-glib/generated/tests/libmm-test-generated.la \ - $(builddir)/libhelpers.la $(builddir)/libport.la + $(builddir)/libport.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -309,7 +341,73 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/ModemManager-main.Po \ + ./$(DEPDIR)/ModemManager-mm-auth-provider-polkit.Po \ + ./$(DEPDIR)/ModemManager-mm-auth-provider.Po \ + ./$(DEPDIR)/ModemManager-mm-auth.Po \ + ./$(DEPDIR)/ModemManager-mm-base-bearer.Po \ + ./$(DEPDIR)/ModemManager-mm-base-call.Po \ + ./$(DEPDIR)/ModemManager-mm-base-manager.Po \ + ./$(DEPDIR)/ModemManager-mm-base-modem-at.Po \ + ./$(DEPDIR)/ModemManager-mm-base-modem.Po \ + ./$(DEPDIR)/ModemManager-mm-base-sim.Po \ + ./$(DEPDIR)/ModemManager-mm-base-sms.Po \ + ./$(DEPDIR)/ModemManager-mm-bearer-list.Po \ + ./$(DEPDIR)/ModemManager-mm-bearer-mbim.Po \ + ./$(DEPDIR)/ModemManager-mm-bearer-qmi.Po \ + ./$(DEPDIR)/ModemManager-mm-broadband-bearer.Po \ + ./$(DEPDIR)/ModemManager-mm-broadband-modem-mbim.Po \ + ./$(DEPDIR)/ModemManager-mm-broadband-modem-qmi.Po \ + ./$(DEPDIR)/ModemManager-mm-broadband-modem.Po \ + ./$(DEPDIR)/ModemManager-mm-call-list.Po \ + ./$(DEPDIR)/ModemManager-mm-context.Po \ + ./$(DEPDIR)/ModemManager-mm-daemon-enums-types.Po \ + ./$(DEPDIR)/ModemManager-mm-device.Po \ + ./$(DEPDIR)/ModemManager-mm-filter.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp-ussd.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-cdma.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-firmware.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-location.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-messaging.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-oma.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-signal.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-simple.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-time.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem-voice.Po \ + ./$(DEPDIR)/ModemManager-mm-iface-modem.Po \ + ./$(DEPDIR)/ModemManager-mm-log.Po \ + ./$(DEPDIR)/ModemManager-mm-plugin-manager.Po \ + ./$(DEPDIR)/ModemManager-mm-plugin.Po \ + ./$(DEPDIR)/ModemManager-mm-port-probe-at.Po \ + ./$(DEPDIR)/ModemManager-mm-port-probe.Po \ + ./$(DEPDIR)/ModemManager-mm-private-boxed-types.Po \ + ./$(DEPDIR)/ModemManager-mm-shared-qmi.Po \ + ./$(DEPDIR)/ModemManager-mm-sim-mbim.Po \ + ./$(DEPDIR)/ModemManager-mm-sim-qmi.Po \ + ./$(DEPDIR)/ModemManager-mm-sleep-monitor.Po \ + ./$(DEPDIR)/ModemManager-mm-sms-list.Po \ + ./$(DEPDIR)/ModemManager-mm-sms-mbim.Po \ + ./$(DEPDIR)/ModemManager-mm-sms-qmi.Po \ + ./$(DEPDIR)/mm-charsets.Plo ./$(DEPDIR)/mm-error-helpers.Plo \ + ./$(DEPDIR)/mm-helper-enums-types.Plo \ + ./$(DEPDIR)/mm-modem-helpers-mbim.Plo \ + ./$(DEPDIR)/mm-modem-helpers-qmi.Plo \ + ./$(DEPDIR)/mm-modem-helpers.Plo \ + ./$(DEPDIR)/mm-port-enums-types.Plo \ + ./$(DEPDIR)/mm-port-mbim.Plo ./$(DEPDIR)/mm-port-qmi.Plo \ + ./$(DEPDIR)/mm-port-serial-at.Plo \ + ./$(DEPDIR)/mm-port-serial-gps.Plo \ + ./$(DEPDIR)/mm-port-serial-qcdm.Plo \ + ./$(DEPDIR)/mm-port-serial.Plo ./$(DEPDIR)/mm-port.Plo \ + ./$(DEPDIR)/mm-serial-parsers.Plo \ + ./$(DEPDIR)/mm-sms-part-3gpp.Plo \ + ./$(DEPDIR)/mm-sms-part-cdma.Plo ./$(DEPDIR)/mm-sms-part.Plo \ + kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Plo \ + kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Plo \ + kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Plo \ + kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -329,10 +427,12 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libhelpers_la_SOURCES) $(libport_la_SOURCES) \ +SOURCES = $(libhelpers_la_SOURCES) $(nodist_libhelpers_la_SOURCES) \ + $(libkerneldevice_la_SOURCES) $(libport_la_SOURCES) \ $(nodist_libport_la_SOURCES) $(ModemManager_SOURCES) \ $(nodist_ModemManager_SOURCES) DIST_SOURCES = $(am__libhelpers_la_SOURCES_DIST) \ + $(am__libkerneldevice_la_SOURCES_DIST) \ $(am__libport_la_SOURCES_DIST) \ $(am__ModemManager_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ @@ -383,7 +483,7 @@ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -432,7 +532,6 @@ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -485,14 +584,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -613,8 +704,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -641,25 +730,35 @@ ################################################################################ ################################################################################ +# kerneldevice library +################################################################################ + +################################################################################ # ports library ################################################################################ -noinst_LTLIBRARIES = libhelpers.la libport.la +noinst_LTLIBRARIES = libhelpers.la libkerneldevice.la libport.la EXTRA_DIST = $(udevrules_DATA) # Request to build enum types before anything else # Request to build enum types before anything else -BUILT_SOURCES = $(PORT_ENUMS_GENERATED) $(DAEMON_ENUMS_GENERATED) -CLEANFILES = $(PORT_ENUMS_GENERATED) $(DAEMON_ENUMS_GENERATED) + +# Request to build enum types before anything else +BUILT_SOURCES = $(HELPER_ENUMS_GENERATED) $(PORT_ENUMS_GENERATED) \ + $(DAEMON_ENUMS_GENERATED) +CLEANFILES = $(HELPER_ENUMS_GENERATED) $(PORT_ENUMS_GENERATED) \ + $(DAEMON_ENUMS_GENERATED) AM_CFLAGS = $(MM_CFLAGS) $(CODE_COVERAGE_CFLAGS) $(GUDEV_CFLAGS) \ -I$(top_srcdir) -I$(top_srcdir)/include \ -I$(top_builddir)/include -I$(top_srcdir)/libqcdm/src \ -I$(top_srcdir)/libmm-glib \ -I${top_builddir}/libmm-glib/generated \ - -I${top_builddir}/libmm-glib/generated/tests $(NULL) \ - $(am__append_1) $(am__append_3) $(am__append_5) + -I${top_builddir}/libmm-glib/generated/tests \ + -I$(srcdir)/kerneldevice $(NULL) $(am__append_1) \ + $(am__append_3) $(am__append_5) $(am__append_7) AM_LDFLAGS = $(MM_LIBS) $(CODE_COVERAGE_LDFLAGS) $(GUDEV_LIBS) $(NULL) \ - $(am__append_2) $(am__append_4) $(am__append_6) + $(am__append_2) $(am__append_4) $(am__append_6) \ + $(am__append_8) ################################################################################ # generic udev rules @@ -668,16 +767,41 @@ udevrules_DATA = \ 77-mm-usb-device-blacklist.rules \ 77-mm-pcmcia-device-blacklist.rules \ - 77-mm-platform-serial-whitelist.rules \ 77-mm-usb-serial-adapters-greylist.rules \ 80-mm-candidate.rules \ $(NULL) +HELPER_ENUMS_INPUTS = \ + $(srcdir)/mm-sms-part.h \ + $(srcdir)/mm-modem-helpers.h \ + $(NULL) + +HELPER_ENUMS_GENERATED = \ + mm-helper-enums-types.h \ + mm-helper-enums-types.c \ + $(NULL) + libhelpers_la_SOURCES = mm-error-helpers.c mm-error-helpers.h \ mm-modem-helpers.c mm-modem-helpers.h mm-charsets.c \ mm-charsets.h mm-sms-part.h mm-sms-part.c mm-sms-part-3gpp.h \ mm-sms-part-3gpp.c mm-sms-part-cdma.h mm-sms-part-cdma.c \ - $(NULL) $(am__append_7) $(am__append_8) + $(NULL) $(am__append_9) $(am__append_10) +nodist_libhelpers_la_SOURCES = $(HELPER_ENUMS_GENERATED) +libkerneldevice_la_CPPFLAGS = \ + -DUDEVRULESDIR=\"$(udevrulesdir)\" \ + $(NULL) + +libkerneldevice_la_SOURCES = kerneldevice/mm-kernel-device.h \ + kerneldevice/mm-kernel-device.c \ + kerneldevice/mm-kernel-device-generic.h \ + kerneldevice/mm-kernel-device-generic.c \ + kerneldevice/mm-kernel-device-generic-rules.h \ + kerneldevice/mm-kernel-device-generic-rules.c $(NULL) \ + $(am__append_11) +libkerneldevice_la_LIBADD = \ + $(top_builddir)/libmm-glib/libmm-glib.la \ + $(NULL) + PORT_ENUMS_INPUTS = \ $(srcdir)/mm-port.h \ $(srcdir)/mm-port-serial-at.h \ @@ -692,15 +816,17 @@ mm-port-serial.h mm-port-serial-at.c mm-port-serial-at.h \ mm-port-serial-qcdm.c mm-port-serial-qcdm.h \ mm-port-serial-gps.c mm-port-serial-gps.h mm-serial-parsers.c \ - mm-serial-parsers.h $(NULL) $(am__append_9) $(am__append_10) + mm-serial-parsers.h $(NULL) $(am__append_12) $(am__append_13) nodist_libport_la_SOURCES = $(PORT_ENUMS_GENERATED) libport_la_LIBADD = \ $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(builddir)/libhelpers.la \ + $(builddir)/libkerneldevice.la \ $(NULL) DAEMON_ENUMS_INPUTS = \ + $(srcdir)/mm-filter.h \ $(srcdir)/mm-base-bearer.h \ $(srcdir)/mm-port-probe.h \ $(NULL) @@ -718,23 +844,22 @@ $(top_builddir)/libqcdm/src/libqcdm.la \ $(top_builddir)/libmm-glib/libmm-glib.la \ $(top_builddir)/libmm-glib/generated/tests/libmm-test-generated.la \ - $(builddir)/libhelpers.la \ $(builddir)/libport.la \ $(NULL) ModemManager_SOURCES = main.c mm-context.h mm-context.c mm-log.c \ mm-log.h mm-utils.h mm-private-boxed-types.h \ mm-private-boxed-types.c mm-auth.h mm-auth.c \ - mm-auth-provider.h mm-auth-provider.c mm-base-manager.c \ - mm-base-manager.h mm-device.c mm-device.h mm-plugin-manager.c \ - mm-plugin-manager.h mm-base-sim.h mm-base-sim.c \ - mm-base-bearer.h mm-base-bearer.c mm-broadband-bearer.h \ - mm-broadband-bearer.c mm-bearer-list.h mm-bearer-list.c \ - mm-base-modem-at.h mm-base-modem-at.c mm-base-modem.h \ - mm-base-modem.c mm-base-sms.h mm-base-sms.c mm-base-call.h \ - mm-base-call.c mm-sms-list.h mm-sms-list.c mm-call-list.h \ - mm-call-list.c mm-iface-modem.h mm-iface-modem.c \ - mm-iface-modem-3gpp.h mm-iface-modem-3gpp.c \ + mm-auth-provider.h mm-auth-provider.c mm-filter.h mm-filter.c \ + mm-base-manager.c mm-base-manager.h mm-device.c mm-device.h \ + mm-plugin-manager.c mm-plugin-manager.h mm-base-sim.h \ + mm-base-sim.c mm-base-bearer.h mm-base-bearer.c \ + mm-broadband-bearer.h mm-broadband-bearer.c mm-bearer-list.h \ + mm-bearer-list.c mm-base-modem-at.h mm-base-modem-at.c \ + mm-base-modem.h mm-base-modem.c mm-base-sms.h mm-base-sms.c \ + mm-base-call.h mm-base-call.c mm-sms-list.h mm-sms-list.c \ + mm-call-list.h mm-call-list.c mm-iface-modem.h \ + mm-iface-modem.c mm-iface-modem-3gpp.h mm-iface-modem-3gpp.c \ mm-iface-modem-3gpp-ussd.h mm-iface-modem-3gpp-ussd.c \ mm-iface-modem-cdma.h mm-iface-modem-cdma.c \ mm-iface-modem-simple.h mm-iface-modem-simple.c \ @@ -747,8 +872,8 @@ mm-iface-modem-oma.h mm-iface-modem-oma.c mm-broadband-modem.h \ mm-broadband-modem.c mm-port-probe.h mm-port-probe.c \ mm-port-probe-at.h mm-port-probe-at.c mm-plugin.c mm-plugin.h \ - $(NULL) $(am__append_11) $(am__append_12) $(am__append_13) \ - $(am__append_14) + $(NULL) $(am__append_14) $(am__append_15) $(am__append_16) \ + $(am__append_17) nodist_ModemManager_SOURCES = $(DAEMON_ENUMS_GENERATED) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -772,8 +897,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -784,23 +909,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libhelpers.la: $(libhelpers_la_OBJECTS) $(libhelpers_la_DEPENDENCIES) $(EXTRA_libhelpers_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libhelpers_la_OBJECTS) $(libhelpers_la_LIBADD) $(LIBS) - -libport.la: $(libport_la_OBJECTS) $(libport_la_DEPENDENCIES) $(EXTRA_libport_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libport_la_OBJECTS) $(libport_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ @@ -851,79 +959,132 @@ echo " rm -f" $$list; \ rm -f $$list +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libhelpers.la: $(libhelpers_la_OBJECTS) $(libhelpers_la_DEPENDENCIES) $(EXTRA_libhelpers_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libhelpers_la_OBJECTS) $(libhelpers_la_LIBADD) $(LIBS) +kerneldevice/$(am__dirstamp): + @$(MKDIR_P) kerneldevice + @: > kerneldevice/$(am__dirstamp) +kerneldevice/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) kerneldevice/$(DEPDIR) + @: > kerneldevice/$(DEPDIR)/$(am__dirstamp) +kerneldevice/libkerneldevice_la-mm-kernel-device.lo: \ + kerneldevice/$(am__dirstamp) \ + kerneldevice/$(DEPDIR)/$(am__dirstamp) +kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo: \ + kerneldevice/$(am__dirstamp) \ + kerneldevice/$(DEPDIR)/$(am__dirstamp) +kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo: \ + kerneldevice/$(am__dirstamp) \ + kerneldevice/$(DEPDIR)/$(am__dirstamp) +kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo: \ + kerneldevice/$(am__dirstamp) \ + kerneldevice/$(DEPDIR)/$(am__dirstamp) + +libkerneldevice.la: $(libkerneldevice_la_OBJECTS) $(libkerneldevice_la_DEPENDENCIES) $(EXTRA_libkerneldevice_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libkerneldevice_la_OBJECTS) $(libkerneldevice_la_LIBADD) $(LIBS) + +libport.la: $(libport_la_OBJECTS) $(libport_la_DEPENDENCIES) $(EXTRA_libport_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libport_la_OBJECTS) $(libport_la_LIBADD) $(LIBS) + ModemManager$(EXEEXT): $(ModemManager_OBJECTS) $(ModemManager_DEPENDENCIES) $(EXTRA_ModemManager_DEPENDENCIES) @rm -f ModemManager$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ModemManager_OBJECTS) $(ModemManager_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f kerneldevice/*.$(OBJEXT) + -rm -f kerneldevice/*.lo distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth-provider-polkit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth-provider.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-bearer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-call.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-manager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-modem-at.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-modem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-sim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-sms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-mbim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-qmi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-bearer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem-mbim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem-qmi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-call-list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-context.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-daemon-enums-types.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-device.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp-ussd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-cdma.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-firmware.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-location.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-messaging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-oma.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-simple.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-voice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-log.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-plugin-manager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-plugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-port-probe-at.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-port-probe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-private-boxed-types.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sim-mbim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sim-qmi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sleep-monitor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-mbim.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-qmi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-charsets.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-error-helpers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers-mbim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers-qmi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-enums-types.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-mbim.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-qmi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-at.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-gps.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-qcdm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-serial-parsers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part-3gpp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part-cdma.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth-provider-polkit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth-provider.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-auth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-bearer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-call.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-manager.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-modem-at.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-modem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-sim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-base-sms.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-mbim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-bearer-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-bearer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem-mbim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-broadband-modem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-call-list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-context.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-daemon-enums-types.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-device.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp-ussd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-cdma.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-firmware.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-location.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-messaging.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-oma.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem-voice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-iface-modem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-log.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-plugin-manager.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-plugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-port-probe-at.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-port-probe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-private-boxed-types.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-shared-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sim-mbim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sim-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sleep-monitor.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-mbim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModemManager-mm-sms-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-charsets.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-error-helpers.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-helper-enums-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers-mbim.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers-qmi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-modem-helpers.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-enums-types.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-mbim.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-qmi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-at.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-gps.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial-qcdm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port-serial.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-port.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-serial-parsers.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part-3gpp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part-cdma.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm-sms-part.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -949,6 +1110,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +kerneldevice/libkerneldevice_la-mm-kernel-device.lo: kerneldevice/mm-kernel-device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kerneldevice/libkerneldevice_la-mm-kernel-device.lo -MD -MP -MF kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Tpo -c -o kerneldevice/libkerneldevice_la-mm-kernel-device.lo `test -f 'kerneldevice/mm-kernel-device.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Tpo kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kerneldevice/mm-kernel-device.c' object='kerneldevice/libkerneldevice_la-mm-kernel-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kerneldevice/libkerneldevice_la-mm-kernel-device.lo `test -f 'kerneldevice/mm-kernel-device.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device.c + +kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo: kerneldevice/mm-kernel-device-generic.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo -MD -MP -MF kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Tpo -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo `test -f 'kerneldevice/mm-kernel-device-generic.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-generic.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Tpo kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kerneldevice/mm-kernel-device-generic.c' object='kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-generic.lo `test -f 'kerneldevice/mm-kernel-device-generic.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-generic.c + +kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo: kerneldevice/mm-kernel-device-generic-rules.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo -MD -MP -MF kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Tpo -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo `test -f 'kerneldevice/mm-kernel-device-generic-rules.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-generic-rules.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Tpo kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kerneldevice/mm-kernel-device-generic-rules.c' object='kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-generic-rules.lo `test -f 'kerneldevice/mm-kernel-device-generic-rules.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-generic-rules.c + +kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo: kerneldevice/mm-kernel-device-udev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo -MD -MP -MF kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Tpo -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo `test -f 'kerneldevice/mm-kernel-device-udev.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-udev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Tpo kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kerneldevice/mm-kernel-device-udev.c' object='kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkerneldevice_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kerneldevice/libkerneldevice_la-mm-kernel-device-udev.lo `test -f 'kerneldevice/mm-kernel-device-udev.c' || echo '$(srcdir)/'`kerneldevice/mm-kernel-device-udev.c + ModemManager-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-main.o -MD -MP -MF $(DEPDIR)/ModemManager-main.Tpo -c -o ModemManager-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-main.Tpo $(DEPDIR)/ModemManager-main.Po @@ -1033,6 +1222,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-auth-provider.obj `if test -f 'mm-auth-provider.c'; then $(CYGPATH_W) 'mm-auth-provider.c'; else $(CYGPATH_W) '$(srcdir)/mm-auth-provider.c'; fi` +ModemManager-mm-filter.o: mm-filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-filter.o -MD -MP -MF $(DEPDIR)/ModemManager-mm-filter.Tpo -c -o ModemManager-mm-filter.o `test -f 'mm-filter.c' || echo '$(srcdir)/'`mm-filter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-filter.Tpo $(DEPDIR)/ModemManager-mm-filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-filter.c' object='ModemManager-mm-filter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-filter.o `test -f 'mm-filter.c' || echo '$(srcdir)/'`mm-filter.c + +ModemManager-mm-filter.obj: mm-filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-filter.obj -MD -MP -MF $(DEPDIR)/ModemManager-mm-filter.Tpo -c -o ModemManager-mm-filter.obj `if test -f 'mm-filter.c'; then $(CYGPATH_W) 'mm-filter.c'; else $(CYGPATH_W) '$(srcdir)/mm-filter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-filter.Tpo $(DEPDIR)/ModemManager-mm-filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-filter.c' object='ModemManager-mm-filter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-filter.obj `if test -f 'mm-filter.c'; then $(CYGPATH_W) 'mm-filter.c'; else $(CYGPATH_W) '$(srcdir)/mm-filter.c'; fi` + ModemManager-mm-base-manager.o: mm-base-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-base-manager.o -MD -MP -MF $(DEPDIR)/ModemManager-mm-base-manager.Tpo -c -o ModemManager-mm-base-manager.o `test -f 'mm-base-manager.c' || echo '$(srcdir)/'`mm-base-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-base-manager.Tpo $(DEPDIR)/ModemManager-mm-base-manager.Po @@ -1467,6 +1670,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-sleep-monitor.obj `if test -f 'mm-sleep-monitor.c'; then $(CYGPATH_W) 'mm-sleep-monitor.c'; else $(CYGPATH_W) '$(srcdir)/mm-sleep-monitor.c'; fi` +ModemManager-mm-shared-qmi.o: mm-shared-qmi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-shared-qmi.o -MD -MP -MF $(DEPDIR)/ModemManager-mm-shared-qmi.Tpo -c -o ModemManager-mm-shared-qmi.o `test -f 'mm-shared-qmi.c' || echo '$(srcdir)/'`mm-shared-qmi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-shared-qmi.Tpo $(DEPDIR)/ModemManager-mm-shared-qmi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-shared-qmi.c' object='ModemManager-mm-shared-qmi.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-shared-qmi.o `test -f 'mm-shared-qmi.c' || echo '$(srcdir)/'`mm-shared-qmi.c + +ModemManager-mm-shared-qmi.obj: mm-shared-qmi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-shared-qmi.obj -MD -MP -MF $(DEPDIR)/ModemManager-mm-shared-qmi.Tpo -c -o ModemManager-mm-shared-qmi.obj `if test -f 'mm-shared-qmi.c'; then $(CYGPATH_W) 'mm-shared-qmi.c'; else $(CYGPATH_W) '$(srcdir)/mm-shared-qmi.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-shared-qmi.Tpo $(DEPDIR)/ModemManager-mm-shared-qmi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mm-shared-qmi.c' object='ModemManager-mm-shared-qmi.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ModemManager-mm-shared-qmi.obj `if test -f 'mm-shared-qmi.c'; then $(CYGPATH_W) 'mm-shared-qmi.c'; else $(CYGPATH_W) '$(srcdir)/mm-shared-qmi.c'; fi` + ModemManager-mm-sms-qmi.o: mm-sms-qmi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ModemManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ModemManager-mm-sms-qmi.o -MD -MP -MF $(DEPDIR)/ModemManager-mm-sms-qmi.Tpo -c -o ModemManager-mm-sms-qmi.o `test -f 'mm-sms-qmi.c' || echo '$(srcdir)/'`mm-sms-qmi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ModemManager-mm-sms-qmi.Tpo $(DEPDIR)/ModemManager-mm-sms-qmi.Po @@ -1598,6 +1815,7 @@ clean-libtool: -rm -rf .libs _libs + -rm -rf kerneldevice/.libs kerneldevice/_libs install-udevrulesDATA: $(udevrules_DATA) @$(NORMAL_INSTALL) @list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \ @@ -1719,7 +1937,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -1777,7 +1998,7 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(udevrulesdir)"; do \ @@ -1811,6 +2032,8 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f kerneldevice/$(DEPDIR)/$(am__dirstamp) + -rm -f kerneldevice/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1822,7 +2045,76 @@ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/ModemManager-main.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth-provider-polkit.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth-provider.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-bearer.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-call.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-manager.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-modem-at.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-sim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-sms.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-bearer.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-call-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-context.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-daemon-enums-types.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-device.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-filter.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp-ussd.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-cdma.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-firmware.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-location.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-messaging.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-oma.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-signal.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-simple.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-time.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-voice.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-log.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-plugin-manager.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-plugin.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-port-probe-at.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-port-probe.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-private-boxed-types.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-shared-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sim-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sim-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sleep-monitor.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-qmi.Po + -rm -f ./$(DEPDIR)/mm-charsets.Plo + -rm -f ./$(DEPDIR)/mm-error-helpers.Plo + -rm -f ./$(DEPDIR)/mm-helper-enums-types.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers-mbim.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers-qmi.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers.Plo + -rm -f ./$(DEPDIR)/mm-port-enums-types.Plo + -rm -f ./$(DEPDIR)/mm-port-mbim.Plo + -rm -f ./$(DEPDIR)/mm-port-qmi.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-at.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-gps.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-qcdm.Plo + -rm -f ./$(DEPDIR)/mm-port-serial.Plo + -rm -f ./$(DEPDIR)/mm-port.Plo + -rm -f ./$(DEPDIR)/mm-serial-parsers.Plo + -rm -f ./$(DEPDIR)/mm-sms-part-3gpp.Plo + -rm -f ./$(DEPDIR)/mm-sms-part-cdma.Plo + -rm -f ./$(DEPDIR)/mm-sms-part.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -1868,7 +2160,76 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/ModemManager-main.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth-provider-polkit.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth-provider.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-auth.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-bearer.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-call.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-manager.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-modem-at.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-sim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-base-sms.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-bearer-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-bearer.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-broadband-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-call-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-context.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-daemon-enums-types.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-device.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-filter.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp-ussd.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-3gpp.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-cdma.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-firmware.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-location.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-messaging.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-oma.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-signal.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-simple.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-time.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem-voice.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-iface-modem.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-log.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-plugin-manager.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-plugin.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-port-probe-at.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-port-probe.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-private-boxed-types.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-shared-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sim-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sim-qmi.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sleep-monitor.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-list.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-mbim.Po + -rm -f ./$(DEPDIR)/ModemManager-mm-sms-qmi.Po + -rm -f ./$(DEPDIR)/mm-charsets.Plo + -rm -f ./$(DEPDIR)/mm-error-helpers.Plo + -rm -f ./$(DEPDIR)/mm-helper-enums-types.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers-mbim.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers-qmi.Plo + -rm -f ./$(DEPDIR)/mm-modem-helpers.Plo + -rm -f ./$(DEPDIR)/mm-port-enums-types.Plo + -rm -f ./$(DEPDIR)/mm-port-mbim.Plo + -rm -f ./$(DEPDIR)/mm-port-qmi.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-at.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-gps.Plo + -rm -f ./$(DEPDIR)/mm-port-serial-qcdm.Plo + -rm -f ./$(DEPDIR)/mm-port-serial.Plo + -rm -f ./$(DEPDIR)/mm-port.Plo + -rm -f ./$(DEPDIR)/mm-serial-parsers.Plo + -rm -f ./$(DEPDIR)/mm-sms-part-3gpp.Plo + -rm -f ./$(DEPDIR)/mm-sms-part-cdma.Plo + -rm -f ./$(DEPDIR)/mm-sms-part.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic-rules.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-generic.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device-udev.Plo + -rm -f kerneldevice/$(DEPDIR)/libkerneldevice_la-mm-kernel-device.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1890,8 +2251,8 @@ .MAKE: $(am__recursive_targets) all check install install-am \ install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES clean-sbinPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ @@ -1909,6 +2270,19 @@ .PRECIOUS: Makefile +mm-helper-enums-types.h: Makefile.am $(HELPER_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"mm-sms-part.h\"\n#include \"mm-modem-helpers.h\"\n#ifndef __MM_HELPER_ENUMS_TYPES_H__\n#define __MM_HELPER_ENUMS_TYPES_H__\n" \ + --template $(top_srcdir)/build-aux/mm-enums-template.h \ + --ftail "#endif /* __MM_HELPER_ENUMS_TYPES_H__ */\n" \ + $(HELPER_ENUMS_INPUTS) > $@ + +mm-helper-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c mm-helper-enums-types.h + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"mm-helper-enums-types.h\"" \ + --template $(top_srcdir)/build-aux/mm-enums-template.c \ + $(HELPER_ENUMS_INPUTS) > $@ + mm-port-enums-types.h: Makefile.am $(PORT_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ --fhead "#include \"mm-port.h\"\n#include \"mm-port-serial-at.h\"\n#ifndef __MM_PORT_ENUMS_TYPES_H__\n#define __MM_PORT_ENUMS_TYPES_H__\n" \ @@ -1924,7 +2298,7 @@ mm-daemon-enums-types.h: Makefile.am $(DAEMON_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#include \"mm-base-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \ + --fhead "#include \"mm-filter.h\"\n#include \"mm-base-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \ --template $(top_srcdir)/build-aux/mm-enums-template.h \ --ftail "#endif /* __MM_DAEMON_ENUMS_TYPES_H__ */\n" \ $(DAEMON_ENUMS_INPUTS) > $@ diff -Nru modemmanager-1.6.8/src/mm-auth.c modemmanager-1.10.0/src/mm-auth.c --- modemmanager-1.6.8/src/mm-auth.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-auth.c 2018-11-15 09:55:53.000000000 +0100 @@ -21,8 +21,8 @@ #include "mm-auth.h" #include "mm-auth-provider.h" -#ifdef WITH_POLKIT -#include "mm-auth-provider-polkit.h" +#if defined WITH_POLKIT +# include "mm-auth-provider-polkit.h" #endif static MMAuthProvider *authp = NULL; @@ -31,7 +31,7 @@ mm_auth_get_provider (void) { if (!authp) { -#if WITH_POLKIT +#if defined WITH_POLKIT authp = mm_auth_provider_polkit_new (); #else authp = mm_auth_provider_new (); diff -Nru modemmanager-1.6.8/src/mm-auth-provider.c modemmanager-1.10.0/src/mm-auth-provider.c --- modemmanager-1.6.8/src/mm-auth-provider.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-auth-provider.c 2018-11-15 09:55:53.000000000 +0100 @@ -75,15 +75,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* Just create the result and complete it */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - authorize); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, cancellable, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/src/mm-auth-provider-polkit.c modemmanager-1.10.0/src/mm-auth-provider-polkit.c --- modemmanager-1.6.8/src/mm-auth-provider-polkit.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-auth-provider-polkit.c 2018-11-15 09:55:53.000000000 +0100 @@ -41,24 +41,16 @@ /*****************************************************************************/ typedef struct { - MMAuthProvider *self; - GCancellable *cancellable; PolkitSubject *subject; gchar *authorization; GDBusMethodInvocation *invocation; - GSimpleAsyncResult *result; } AuthorizeContext; static void -authorize_context_complete_and_free (AuthorizeContext *ctx) +authorize_context_free (AuthorizeContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->invocation); g_object_unref (ctx->subject); - g_object_unref (ctx->self); g_free (ctx->authorization); g_free (ctx); } @@ -68,54 +60,52 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void check_authorization_ready (PolkitAuthority *authority, GAsyncResult *res, - AuthorizeContext *ctx) + GTask *task) { PolkitAuthorizationResult *pk_result; GError *error = NULL; + AuthorizeContext *ctx; - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "PolicyKit authorization attempt cancelled"); - authorize_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); pk_result = polkit_authority_check_authorization_finish (authority, res, &error); if (!pk_result) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "PolicyKit authorization failed: '%s'", - error->message); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "PolicyKit authorization failed: '%s'", + error->message); g_error_free (error); } else { if (polkit_authorization_result_get_is_authorized (pk_result)) /* Good! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); else if (polkit_authorization_result_get_is_challenge (pk_result)) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNAUTHORIZED, - "PolicyKit authorization failed: challenge needed for '%s'", - ctx->authorization); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNAUTHORIZED, + "PolicyKit authorization failed: challenge needed for '%s'", + ctx->authorization); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNAUTHORIZED, - "PolicyKit authorization failed: not authorized for '%s'", - ctx->authorization); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNAUTHORIZED, + "PolicyKit authorization failed: not authorized for '%s'", + ctx->authorization); g_object_unref (pk_result); } - authorize_context_complete_and_free (ctx); + g_object_unref (task); } static void @@ -128,40 +118,39 @@ { MMAuthProviderPolkit *polkit = MM_AUTH_PROVIDER_POLKIT (self); AuthorizeContext *ctx; + GTask *task; /* When creating the object, we actually allowed errors when looking for the * authority. If that is the case, we'll just forbid any incoming * authentication request */ if (!polkit->priv->authority) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "PolicyKit authorization error: " - "'authority not found'"); + g_task_report_new_error (self, + callback, + user_data, + authorize, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "PolicyKit authorization error: " + "'authority not found'"); return; } ctx = g_new (AuthorizeContext, 1); - ctx->self = g_object_ref (self); ctx->invocation = g_object_ref (invocation); ctx->authorization = g_strdup (authorization); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - authorize); ctx->subject = polkit_system_bus_name_new (g_dbus_method_invocation_get_sender (ctx->invocation)); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)authorize_context_free); + polkit_authority_check_authorization (polkit->priv->authority, ctx->subject, authorization, NULL, /* details */ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)check_authorization_ready, - ctx); + task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/src/mm-base-bearer.c modemmanager-1.10.0/src/mm-base-bearer.c --- modemmanager-1.6.8/src/mm-base-bearer.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-bearer.c 2019-01-15 15:57:35.000000000 +0100 @@ -14,7 +14,7 @@ * Copyright (C) 2009 - 2011 Red Hat, Inc. * Copyright (C) 2011 Google, Inc. * Copyright (C) 2015 Azimut Electronics - * Copyright (C) 2011 - 2015 Aleksander Morgado + * Copyright (C) 2011 - 2016 Aleksander Morgado */ #include @@ -46,12 +46,17 @@ #define BEARER_STATS_UPDATE_TIMEOUT 30 +/* Initial connectivity check after 30s, then each 5s */ +#define BEARER_CONNECTION_MONITOR_INITIAL_TIMEOUT 30 +#define BEARER_CONNECTION_MONITOR_TIMEOUT 5 + G_DEFINE_TYPE (MMBaseBearer, mm_base_bearer, MM_GDBUS_TYPE_BEARER_SKELETON) typedef enum { CONNECTION_FORBIDDEN_REASON_NONE, CONNECTION_FORBIDDEN_REASON_UNREGISTERED, CONNECTION_FORBIDDEN_REASON_ROAMING, + CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY, CONNECTION_FORBIDDEN_REASON_LAST } ConnectionForbiddenReason; @@ -87,6 +92,11 @@ /* handler id for the disconnect + cancel connect request */ gulong disconnect_signal_handler; + /* Connection status monitoring */ + guint connection_monitor_id; + /* Flag to specify whether connection monitoring is supported or not */ + gboolean load_connection_status_unsupported; + /*-- 3GPP specific --*/ guint deferred_3gpp_unregistration_id; /* Reason if 3GPP connection is forbidden */ @@ -108,6 +118,8 @@ guint stats_update_id; /* Timer to measure the duration of the connection */ GTimer *duration_timer; + /* Flag to specify whether reloading stats is supported or not */ + gboolean reload_stats_unsupported; }; /*****************************************************************************/ @@ -115,7 +127,8 @@ static const gchar *connection_forbidden_reason_str [CONNECTION_FORBIDDEN_REASON_LAST] = { "none", "Not registered in the network", - "Registered in roaming network, and roaming not allowed" + "Registered in roaming network, and roaming not allowed", + "Emergency services only", }; /*****************************************************************************/ @@ -136,6 +149,94 @@ /*****************************************************************************/ static void +connection_monitor_stop (MMBaseBearer *self) +{ + if (self->priv->connection_monitor_id) { + g_source_remove (self->priv->connection_monitor_id); + self->priv->connection_monitor_id = 0; + } +} + +static void +load_connection_status_ready (MMBaseBearer *self, + GAsyncResult *res) +{ + GError *error = NULL; + MMBearerConnectionStatus status; + + status = MM_BASE_BEARER_GET_CLASS (self)->load_connection_status_finish (self, res, &error); + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) { + /* Only warn if not reporting an "unsupported" error */ + if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) { + mm_warn ("checking if connected failed: %s", error->message); + g_error_free (error); + return; + } + + /* If we're being told that connection monitoring is unsupported, just + * ignore the error and remove the timeout. */ + mm_dbg ("Connection monitoring is unsupported by the device"); + self->priv->load_connection_status_unsupported = TRUE; + connection_monitor_stop (self); + g_error_free (error); + return; + } + + /* Report connection or disconnection */ + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + mm_dbg ("connection status loaded: %s", mm_bearer_connection_status_get_string (status)); + mm_base_bearer_report_connection_status (self, status); +} + +static gboolean +connection_monitor_cb (MMBaseBearer *self) +{ + /* If the implementation knows how to load connection status, run it */ + MM_BASE_BEARER_GET_CLASS (self)->load_connection_status ( + self, + (GAsyncReadyCallback)load_connection_status_ready, + NULL); + return G_SOURCE_CONTINUE; +} + +static gboolean +initial_connection_monitor_cb (MMBaseBearer *self) +{ + MM_BASE_BEARER_GET_CLASS (self)->load_connection_status ( + self, + (GAsyncReadyCallback)load_connection_status_ready, + NULL); + + /* Add new monitor timeout at a higher rate */ + self->priv->connection_monitor_id = g_timeout_add_seconds (BEARER_CONNECTION_MONITOR_TIMEOUT, + (GSourceFunc) connection_monitor_cb, + self); + + /* Remove the initial connection monitor timeout as we added a new one */ + return G_SOURCE_REMOVE; +} + +static void +connection_monitor_start (MMBaseBearer *self) +{ + /* If not implemented, don't schedule anything */ + if (!MM_BASE_BEARER_GET_CLASS (self)->load_connection_status || + !MM_BASE_BEARER_GET_CLASS (self)->load_connection_status_finish) + return; + + if (self->priv->load_connection_status_unsupported) + return; + + /* Schedule initial check */ + g_assert (!self->priv->connection_monitor_id); + self->priv->connection_monitor_id = g_timeout_add_seconds (BEARER_CONNECTION_MONITOR_INITIAL_TIMEOUT, + (GSourceFunc) initial_connection_monitor_cb, + self); +} + +/*****************************************************************************/ + +static void bearer_update_interface_stats (MMBaseBearer *self) { mm_gdbus_bearer_set_stats ( @@ -170,20 +271,31 @@ reload_stats_ready (MMBaseBearer *self, GAsyncResult *res) { - GError *error = NULL; - guint64 rx_bytes = 0; - guint64 tx_bytes = 0; + GError *error = NULL; + guint64 rx_bytes = 0; + guint64 tx_bytes = 0; if (!MM_BASE_BEARER_GET_CLASS (self)->reload_stats_finish (self, &rx_bytes, &tx_bytes, res, &error)) { - mm_warn ("Reloading stats failed: %s", error->message); + /* If reloading stats fails, warn about it and don't update anything */ + if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) { + mm_warn ("Reloading stats failed: %s", error->message); + g_error_free (error); + return; + } + + /* If we're being told that reloading stats is unsupported, just ignore + * the error and update oly the duration timer. */ + mm_dbg ("Reloading stats is unsupported by the device"); + self->priv->reload_stats_unsupported = TRUE; + rx_bytes = 0; + tx_bytes = 0; g_error_free (error); - return; } /* We only update stats if they were retrieved properly */ mm_bearer_stats_set_duration (self->priv->stats, (guint32) g_timer_elapsed (self->priv->duration_timer, NULL)); - mm_bearer_stats_set_tx_bytes (self->priv->stats, rx_bytes); - mm_bearer_stats_set_rx_bytes (self->priv->stats, tx_bytes); + mm_bearer_stats_set_tx_bytes (self->priv->stats, tx_bytes); + mm_bearer_stats_set_rx_bytes (self->priv->stats, rx_bytes); bearer_update_interface_stats (self); } @@ -191,7 +303,8 @@ stats_update_cb (MMBaseBearer *self) { /* If the implementation knows how to update stat values, run it */ - if (MM_BASE_BEARER_GET_CLASS (self)->reload_stats && + if (!self->priv->reload_stats_unsupported && + MM_BASE_BEARER_GET_CLASS (self)->reload_stats && MM_BASE_BEARER_GET_CLASS (self)->reload_stats_finish) { MM_BASE_BEARER_GET_CLASS (self)->reload_stats ( self, @@ -262,6 +375,8 @@ bearer_reset_interface_status (self); /* Stop statistics */ bearer_stats_stop (self); + /* Stop connection monitoring */ + connection_monitor_stop (self); } } @@ -284,6 +399,9 @@ /* Start statistics */ bearer_stats_start (self); + /* Start connection monitor, if supported */ + connection_monitor_start (self); + /* Update the property value */ self->priv->status = MM_BEARER_STATUS_CONNECTED; g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_STATUS]); @@ -334,15 +452,22 @@ self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_UNREGISTERED; break; case MM_MODEM_3GPP_REGISTRATION_STATE_HOME: + case MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY: + case MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED: case MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING: self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE; break; case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING: + case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY: + case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED: if (mm_bearer_properties_get_allow_roaming (mm_base_bearer_peek_config (self))) self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE; else self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_ROAMING; break; + case MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY: + self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY; + break; } /* If no reason to disconnect, or if it's a mixed CDMA+LTE modem without a CDMA reason, @@ -362,6 +487,14 @@ return; } + /* Modem is registered under emergency services only? */ + if (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY) { + mm_dbg ("Bearer not allowed to connect, emergency services only"); + reset_deferred_unregistration (self); + mm_base_bearer_disconnect_force (self); + return; + } + /* Modem reports being unregistered */ if (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_UNREGISTERED) { /* If there is already a notification pending, just return */ @@ -534,7 +667,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -564,7 +697,7 @@ static void connect_ready (MMBaseBearer *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; gboolean launch_disconnect = FALSE; @@ -583,19 +716,16 @@ launch_disconnect = TRUE; } else bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED); - - g_simple_async_result_take_error (simple, error); } /* Handle cancellations detected after successful connection */ else if (g_cancellable_is_cancelled (self->priv->connect_cancellable)) { mm_dbg ("Connected bearer '%s', but need to disconnect", self->priv->path); mm_bearer_connect_result_unref (result); - g_simple_async_result_set_error ( - simple, + error = g_error_new ( MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Bearer got connected, but had to disconnect after cancellation request"); - launch_disconnect = TRUE; + launch_disconnect = TRUE; } else { mm_dbg ("Connected bearer '%s'", self->priv->path); @@ -607,7 +737,6 @@ mm_bearer_connect_result_peek_ipv4_config (result), mm_bearer_connect_result_peek_ipv6_config (result)); mm_bearer_connect_result_unref (result); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); } if (launch_disconnect) { @@ -619,8 +748,13 @@ } g_clear_object (&self->priv->connect_cancellable); - g_simple_async_result_complete (simple); - g_object_unref (simple); + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } void @@ -628,17 +762,28 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect != NULL); - g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect_finish != NULL); + if (!MM_BASE_BEARER_GET_CLASS (self)->connect) { + g_assert (!MM_BASE_BEARER_GET_CLASS (self)->connect_finish); + g_task_report_new_error ( + self, + callback, + user_data, + mm_base_bearer_connect, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Bearer doesn't allow explicit connection requests"); + return; + } /* If already connecting, return error, don't allow a second request. */ if (self->priv->status == MM_BEARER_STATUS_CONNECTING) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + mm_base_bearer_connect, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, "Bearer already being connected"); @@ -648,10 +793,11 @@ /* If currently disconnecting, return error, previous operation should * finish before allowing to connect again. */ if (self->priv->status == MM_BEARER_STATUS_DISCONNECTING) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + mm_base_bearer_connect, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Bearer currently being disconnected"); @@ -661,10 +807,11 @@ /* Check 3GPP roaming allowance, *only* roaming related here */ if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self->priv->modem)) && self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_ROAMING) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + mm_base_bearer_connect, MM_CORE_ERROR, MM_CORE_ERROR_UNAUTHORIZED, "Not allowed to connect bearer in 3GPP network: '%s'", @@ -675,10 +822,11 @@ /* Check CDMA roaming allowance, *only* roaming related here */ if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self->priv->modem)) && self->priv->reason_cdma == CONNECTION_FORBIDDEN_REASON_ROAMING) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + mm_base_bearer_connect, MM_CORE_ERROR, MM_CORE_ERROR_UNAUTHORIZED, "Not allowed to connect bearer in CDMA network: '%s'", @@ -686,16 +834,12 @@ return; } - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_base_bearer_connect); + task = g_task_new (self, NULL, callback, user_data); /* If already connected, done */ if (self->priv->status == MM_BEARER_STATUS_CONNECTED) { - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -708,7 +852,7 @@ self, self->priv->connect_cancellable, (GAsyncReadyCallback)connect_ready, - result); + task); } typedef struct { @@ -788,35 +932,34 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disconnect_ready (MMBaseBearer *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) { mm_dbg ("Couldn't disconnect bearer '%s'", self->priv->path); bearer_update_status (self, MM_BEARER_STATUS_CONNECTED); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { mm_dbg ("Disconnected bearer '%s'", self->priv->path); bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); } - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void status_changed_complete_disconnect (MMBaseBearer *self, GParamSpec *pspec, - GSimpleAsyncResult *simple) + GTask *task) { /* We may get other states here before DISCONNECTED, like DISCONNECTING or * even CONNECTED. */ @@ -831,9 +974,8 @@ /* Note: interface state is updated when the DISCONNECTED state is set */ - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -841,33 +983,36 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *simple; + GTask *task; - g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect != NULL); - g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish != NULL); + task = g_task_new (self, NULL, callback, user_data); - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_base_bearer_disconnect); + if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect) { + g_assert (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish); + g_task_return_new_error ( + task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Bearer doesn't allow explicit disconnection requests"); + g_object_unref (task); + return; + } /* If already disconnected, done */ if (self->priv->status == MM_BEARER_STATUS_DISCONNECTED) { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* If already disconnecting, return error, don't allow a second request. */ if (self->priv->status == MM_BEARER_STATUS_DISCONNECTING) { - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, "Bearer already being disconnected"); - g_simple_async_result_complete_in_idle (simple); - g_object_unref (simple); + g_object_unref (task); return; } @@ -888,7 +1033,7 @@ g_signal_connect (self, "notify::" MM_BASE_BEARER_STATUS, (GCallback)status_changed_complete_disconnect, - simple); /* takes ownership */ + task); /* takes ownership */ return; } @@ -898,7 +1043,7 @@ MM_BASE_BEARER_GET_CLASS (self)->disconnect ( self, (GAsyncReadyCallback)disconnect_ready, - simple); /* takes ownership */ + task); /* takes ownership */ } typedef struct { @@ -1100,15 +1245,15 @@ report_connection_status (MMBaseBearer *self, MMBearerConnectionStatus status) { - /* The only status expected at this point is DISCONNECTED. - * No other status should have been given to the generic implementation - * of report_connection_status (it would be an error). + /* The only status expected at this point is DISCONNECTED or CONNECTED, + * although here we just process the DISCONNECTED one. */ - g_assert (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + g_assert (status == MM_BEARER_CONNECTION_STATUS_CONNECTED || status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED); /* In the generic bearer implementation we just need to reset the * interface status */ - bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED); + if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) + bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED); } void @@ -1238,15 +1383,16 @@ self->priv->default_ip_family = MM_BEARER_IP_FAMILY_IPV4; /* Set defaults */ - mm_gdbus_bearer_set_interface (MM_GDBUS_BEARER (self), NULL); - mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE); - mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE); - mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), NULL); - mm_gdbus_bearer_set_ip_timeout (MM_GDBUS_BEARER (self), BEARER_IP_TIMEOUT_DEFAULT); - mm_gdbus_bearer_set_ip4_config (MM_GDBUS_BEARER (self), - mm_bearer_ip_config_get_dictionary (NULL)); - mm_gdbus_bearer_set_ip6_config (MM_GDBUS_BEARER (self), - mm_bearer_ip_config_get_dictionary (NULL)); + mm_gdbus_bearer_set_interface (MM_GDBUS_BEARER (self), NULL); + mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE); + mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE); + mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), NULL); + mm_gdbus_bearer_set_ip_timeout (MM_GDBUS_BEARER (self), BEARER_IP_TIMEOUT_DEFAULT); + mm_gdbus_bearer_set_bearer_type (MM_GDBUS_BEARER (self), MM_BEARER_TYPE_DEFAULT); + mm_gdbus_bearer_set_ip4_config (MM_GDBUS_BEARER (self), + mm_bearer_ip_config_get_dictionary (NULL)); + mm_gdbus_bearer_set_ip6_config (MM_GDBUS_BEARER (self), + mm_bearer_ip_config_get_dictionary (NULL)); } static void @@ -1264,6 +1410,7 @@ { MMBaseBearer *self = MM_BASE_BEARER (object); + connection_monitor_stop (self); bearer_stats_stop (self); g_clear_object (&self->priv->stats); diff -Nru modemmanager-1.6.8/src/mm-base-bearer.h modemmanager-1.10.0/src/mm-base-bearer.h --- modemmanager-1.6.8/src/mm-base-bearer.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-bearer.h 2018-11-15 09:55:53.000000000 +0100 @@ -59,7 +59,7 @@ #define MM_BASE_BEARER_MODEM "bearer-modem" #define MM_BASE_BEARER_STATUS "bearer-status" #define MM_BASE_BEARER_CONFIG "bearer-config" -#define MM_BASE_BEARER_DEFAULT_IP_FAMILY "bearer-deafult-ip-family" +#define MM_BASE_BEARER_DEFAULT_IP_FAMILY "bearer-default-ip-family" typedef enum { /*< underscore_name=mm_bearer_status >*/ MM_BEARER_STATUS_DISCONNECTED, @@ -101,6 +101,17 @@ GAsyncResult *res, GError **error); + /* Monitor connection status: + * NOTE: only CONNECTED or DISCONNECTED should be reported here; this method + * is used to poll for connection status once the connection has been + * established */ + void (* load_connection_status) (MMBaseBearer *bearer, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerConnectionStatus (* load_connection_status_finish) (MMBaseBearer *bearer, + GAsyncResult *res, + GError **error); + /* Reload statistics */ void (* reload_stats) (MMBaseBearer *bearer, GAsyncReadyCallback callback, diff -Nru modemmanager-1.6.8/src/mm-base-call.c modemmanager-1.10.0/src/mm-base-call.c --- modemmanager-1.6.8/src/mm-base-call.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-call.c 2019-01-15 15:57:35.000000000 +0100 @@ -40,6 +40,8 @@ PROP_PATH, PROP_CONNECTION, PROP_MODEM, + PROP_SUPPORTS_DIALING_TO_RINGING, + PROP_SUPPORTS_RINGING_TO_ACTIVE, PROP_LAST }; @@ -52,9 +54,140 @@ MMBaseModem *modem; /* The path where the call object is exported */ gchar *path; + /* Features */ + gboolean supports_dialing_to_ringing; + gboolean supports_ringing_to_active; + + guint incoming_timeout; + GRegex *in_call_events; + + /* The port used for audio while call is ongoing, if known */ + MMPort *audio_port; }; /*****************************************************************************/ +/* In-call unsolicited events + * Once a call is started, we may need to detect special URCs to trigger call + * state changes, e.g. "NO CARRIER" when the remote party hangs up. */ + +static void +in_call_event_received (MMPortSerialAt *port, + GMatchInfo *info, + MMBaseCall *self) +{ + gchar *str; + + str = g_match_info_fetch (info, 1); + if (!str) + return; + + if (!strcmp (str, "NO DIALTONE")) + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); + else if (!strcmp (str, "NO CARRIER") || !strcmp (str, "BUSY") || !strcmp (str, "NO ANSWER")) + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); + + g_free (str); +} + +static gboolean +common_setup_cleanup_unsolicited_events (MMBaseCall *self, + gboolean enable, + GError **error) +{ + MMBaseModem *modem = NULL; + MMPortSerialAt *ports[2]; + gint i; + + if (G_UNLIKELY (!self->priv->in_call_events)) + self->priv->in_call_events = g_regex_new ("\\r\\n(NO CARRIER|BUSY|NO ANSWER|NO DIALTONE)\\r\\n$", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + + g_object_get (self, + MM_BASE_CALL_MODEM, &modem, + NULL); + + ports[0] = mm_base_modem_peek_port_primary (modem); + ports[1] = mm_base_modem_peek_port_secondary (modem); + + for (i = 0; i < G_N_ELEMENTS (ports); i++) { + if (!ports[i]) + continue; + + mm_port_serial_at_add_unsolicited_msg_handler (ports[i], + self->priv->in_call_events, + enable ? (MMPortSerialAtUnsolicitedMsgFn) in_call_event_received : NULL, + enable ? self : NULL, + NULL); + } + + g_object_unref (modem); + return TRUE; +} + +static gboolean +setup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (self, TRUE, error); +} + +static gboolean +cleanup_unsolicited_events (MMBaseCall *self, + GError **error) +{ + return common_setup_cleanup_unsolicited_events (self, FALSE, error); +} + +/*****************************************************************************/ +/* Incoming calls are reported via RING URCs. If the caller stops the call + * attempt before it has been answered, the only thing we would see is that the + * URCs are no longer received. So, we will start a timeout whenever a new RING + * URC is received, and we refresh the timeout any time a new URC arrives. If + * the timeout is expired (meaning no URCs were received in the last N seconds) + * then we assume the call attempt is finished and we transition to TERMINATED. + */ + +#define INCOMING_TIMEOUT_SECS 10 + +static gboolean +incoming_timeout_cb (MMBaseCall *self) +{ + self->priv->incoming_timeout = 0; + mm_info ("incoming call timed out: no response"); + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); + return G_SOURCE_REMOVE; +} + +void +mm_base_call_incoming_refresh (MMBaseCall *self) +{ + if (self->priv->incoming_timeout) + g_source_remove (self->priv->incoming_timeout); + self->priv->incoming_timeout = g_timeout_add_seconds (INCOMING_TIMEOUT_SECS, (GSourceFunc)incoming_timeout_cb, self); +} + +/*****************************************************************************/ +/* Update audio settings */ + +static void +update_audio_settings (MMBaseCall *self, + MMPort *audio_port, + MMCallAudioFormat *audio_format) +{ + if (!audio_port && self->priv->audio_port && mm_port_get_connected (self->priv->audio_port)) + mm_port_set_connected (self->priv->audio_port, FALSE); + g_clear_object (&self->priv->audio_port); + + if (audio_port) { + self->priv->audio_port = g_object_ref (audio_port); + mm_port_set_connected (self->priv->audio_port, TRUE); + } + + mm_gdbus_call_set_audio_port (MM_GDBUS_CALL (self), audio_port ? mm_port_get_device (audio_port) : NULL); + mm_gdbus_call_set_audio_format (MM_GDBUS_CALL (self), mm_call_audio_format_get_dictionary (audio_format)); +} + +/*****************************************************************************/ /* Start call (DBus call handling) */ typedef struct { @@ -73,24 +206,83 @@ } static void -handle_start_ready (MMBaseCall *self, - GAsyncResult *res, +call_started (HandleStartContext *ctx) +{ + mm_info ("call is started"); + + /* If dialing to ringing supported, leave it dialing */ + if (!ctx->self->priv->supports_dialing_to_ringing) { + /* If ringing to active supported, set it ringing */ + if (ctx->self->priv->supports_ringing_to_active) + mm_base_call_change_state (ctx->self, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED); + else + /* Otherwise, active right away */ + mm_base_call_change_state (ctx->self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_OUTGOING_STARTED); + } + mm_gdbus_call_complete_start (MM_GDBUS_CALL (ctx->self), ctx->invocation); + handle_start_context_free (ctx); +} + +static void +start_setup_audio_channel_ready (MMBaseCall *self, + GAsyncResult *res, + HandleStartContext *ctx) +{ + MMPort *audio_port = NULL; + MMCallAudioFormat *audio_format = NULL; + GError *error = NULL; + + if (!MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel_finish (self, res, &audio_port, &audio_format, &error)) { + mm_warn ("Couldn't setup audio channel: '%s'", error->message); + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_AUDIO_SETUP_FAILED); + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_start_context_free (ctx); + return; + } + + if (audio_port || audio_format) { + update_audio_settings (self, audio_port, audio_format); + g_clear_object (&audio_port); + g_clear_object (&audio_format); + } + + call_started (ctx); +} + +static void +handle_start_ready (MMBaseCall *self, + GAsyncResult *res, HandleStartContext *ctx) { GError *error = NULL; if (!MM_BASE_CALL_GET_CLASS (self)->start_finish (self, res, &error)) { + mm_warn ("Couldn't start call : '%s'", error->message); + /* Convert errors into call state updates */ + if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_DIALTONE)) + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); + else if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_BUSY) || + g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_ANSWER) || + g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_CARRIER)) + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); + else + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_UNKNOWN); g_dbus_method_invocation_take_error (ctx->invocation, error); - } else { - /* Transition from Unknown->Dialing */ - if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_UNKNOWN ) { - /* Update state */ - mm_base_call_change_state (self, MM_CALL_STATE_DIALING, MM_CALL_STATE_REASON_OUTGOING_STARTED); - } - mm_gdbus_call_complete_start (MM_GDBUS_CALL (ctx->self), ctx->invocation); + handle_start_context_free (ctx); + return; } - handle_start_context_free (ctx); + /* If there is an audio setup method, run it now */ + if (MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel) { + mm_info ("setting up audio channel..."); + MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel (self, + (GAsyncReadyCallback) start_setup_audio_channel_ready, + ctx); + return; + } + + /* Otherwise, we're done */ + call_started (ctx); } static void @@ -119,6 +311,8 @@ return; } + mm_info ("user request to start call"); + /* Check if we do support doing it */ if (!MM_BASE_CALL_GET_CLASS (ctx->self)->start || !MM_BASE_CALL_GET_CLASS (ctx->self)->start_finish) { @@ -130,6 +324,8 @@ return; } + mm_base_call_change_state (ctx->self, MM_CALL_STATE_DIALING, MM_CALL_STATE_REASON_OUTGOING_STARTED); + MM_BASE_CALL_GET_CLASS (ctx->self)->start (ctx->self, (GAsyncReadyCallback)handle_start_ready, ctx); @@ -175,24 +371,70 @@ } static void +call_accepted (HandleAcceptContext *ctx) +{ + mm_info ("call is accepted"); + + if (ctx->self->priv->incoming_timeout) { + g_source_remove (ctx->self->priv->incoming_timeout); + ctx->self->priv->incoming_timeout = 0; + } + mm_base_call_change_state (ctx->self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); + mm_gdbus_call_complete_accept (MM_GDBUS_CALL (ctx->self), ctx->invocation); + handle_accept_context_free (ctx); +} + +static void +accept_setup_audio_channel_ready (MMBaseCall *self, + GAsyncResult *res, + HandleAcceptContext *ctx) +{ + MMPort *audio_port = NULL; + MMCallAudioFormat *audio_format = NULL; + GError *error = NULL; + + if (!MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel_finish (self, res, &audio_port, &audio_format, &error)) { + mm_warn ("Couldn't setup audio channel: '%s'", error->message); + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_AUDIO_SETUP_FAILED); + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_accept_context_free (ctx); + return; + } + + if (audio_port || audio_format) { + update_audio_settings (self, audio_port, audio_format); + g_clear_object (&audio_port); + g_clear_object (&audio_format); + } + + call_accepted (ctx); +} + +static void handle_accept_ready (MMBaseCall *self, - GAsyncResult *res, - HandleAcceptContext *ctx) + GAsyncResult *res, + HandleAcceptContext *ctx) { GError *error = NULL; if (!MM_BASE_CALL_GET_CLASS (self)->accept_finish (self, res, &error)) { + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); g_dbus_method_invocation_take_error (ctx->invocation, error); - } else { - /* Transition from Unknown->Dialing */ - if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_RINGING_IN) { - /* Update state */ - mm_base_call_change_state (self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); - } - mm_gdbus_call_complete_accept (MM_GDBUS_CALL (ctx->self), ctx->invocation); + handle_accept_context_free (ctx); + return; } - handle_accept_context_free (ctx); + /* If there is an audio setup method, run it now */ + if (MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel) { + mm_info ("setting up audio channel..."); + MM_BASE_CALL_GET_CLASS (self)->setup_audio_channel (self, + (GAsyncReadyCallback) accept_setup_audio_channel_ready, + ctx); + return; + } + + /* Otherwise, we're done */ + call_accepted (ctx); } static void @@ -216,11 +458,13 @@ g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "This call was not ringing, cannot accept "); + "This call was not ringing, cannot accept"); handle_accept_context_free (ctx); return; } + mm_info ("user request to accept call"); + /* Check if we do support doing it */ if (!MM_BASE_CALL_GET_CLASS (ctx->self)->accept || !MM_BASE_CALL_GET_CLASS (ctx->self)->accept_finish) { @@ -284,14 +528,15 @@ { GError *error = NULL; - if (!MM_BASE_CALL_GET_CLASS (self)->hangup_finish (self, res, &error)) { + /* we set it as terminated even if we got an error reported */ + mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); + + if (!MM_BASE_CALL_GET_CLASS (self)->hangup_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); - } else { - /* Transition from Unknown->Dialing */ - if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_TERMINATED || - mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_UNKNOWN) { - /* Update state */ - mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); + else { + if (ctx->self->priv->incoming_timeout) { + g_source_remove (ctx->self->priv->incoming_timeout); + ctx->self->priv->incoming_timeout = 0; } mm_gdbus_call_complete_hangup (MM_GDBUS_CALL (ctx->self), ctx->invocation); } @@ -325,13 +570,15 @@ return; } + mm_info ("user request to hangup call"); + /* Check if we do support doing it */ if (!MM_BASE_CALL_GET_CLASS (ctx->self)->hangup || !MM_BASE_CALL_GET_CLASS (ctx->self)->hangup_finish) { g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, - "Hanguping call is not supported by this modem"); + "Hanging up call is not supported by this modem"); handle_hangup_context_free (ctx); return; } @@ -378,7 +625,7 @@ g_object_unref (ctx->invocation); g_object_unref (ctx->modem); g_object_unref (ctx->self); - g_free(ctx->dtmf); + g_free (ctx->dtmf); g_free (ctx); } @@ -451,7 +698,7 @@ ctx->self = g_object_ref (self); ctx->invocation = g_object_ref (invocation); - ctx->dtmf = g_strdup(dtmf); + ctx->dtmf = g_strdup (dtmf); g_object_get (self, MM_BASE_CALL_MODEM, &ctx->modem, NULL); @@ -512,7 +759,6 @@ G_CALLBACK (handle_send_dtmf), NULL); - if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self), self->priv->connection, self->priv->path, @@ -540,376 +786,252 @@ return self->priv->path; } +/* Define the states in which we want to handle in-call events */ +#define MM_CALL_STATE_IS_IN_CALL(state) \ + (state == MM_CALL_STATE_DIALING || \ + state == MM_CALL_STATE_RINGING_IN || \ + state == MM_CALL_STATE_RINGING_OUT || \ + state == MM_CALL_STATE_ACTIVE) + +static void +cleanup_audio_channel_ready (MMBaseCall *self, + GAsyncResult *res) +{ + GError *error = NULL; + + if (!MM_BASE_CALL_GET_CLASS (self)->cleanup_audio_channel_finish (self, res, &error)) { + mm_warn ("audio channel cleanup failed: %s", error->message); + g_error_free (error); + } +} + void -mm_base_call_change_state(MMBaseCall *self, MMCallState new_state, MMCallStateReason reason) +mm_base_call_change_state (MMBaseCall *self, + MMCallState new_state, + MMCallStateReason reason) { - int old_state = mm_gdbus_call_get_state (MM_GDBUS_CALL (self)); + MMCallState old_state; + GError *error = NULL; - g_object_set (self, - "state", new_state, - "state-reason", reason, - NULL); + old_state = mm_gdbus_call_get_state (MM_GDBUS_CALL (self)); - mm_gdbus_call_set_state (MM_GDBUS_CALL (self), new_state); - mm_gdbus_call_set_state_reason(MM_GDBUS_CALL (self), reason); + if (old_state == new_state) + return; - mm_gdbus_call_emit_state_changed(MM_GDBUS_CALL (self), - old_state, - new_state, - reason); + mm_info ("Call state changed: %s -> %s (%s)", + mm_call_state_get_string (old_state), + mm_call_state_get_string (new_state), + mm_call_state_reason_get_string (reason)); + + /* Setup/cleanup unsolicited events based on state transitions to/from ACTIVE */ + if (!MM_CALL_STATE_IS_IN_CALL (old_state) && MM_CALL_STATE_IS_IN_CALL (new_state)) { + mm_dbg ("Setting up in-call unsolicited events..."); + if (MM_BASE_CALL_GET_CLASS (self)->setup_unsolicited_events && + !MM_BASE_CALL_GET_CLASS (self)->setup_unsolicited_events (self, &error)) { + mm_warn ("Couldn't setup in-call unsolicited events: %s", error->message); + g_error_free (error); + } + } else if (MM_CALL_STATE_IS_IN_CALL (old_state) && !MM_CALL_STATE_IS_IN_CALL (new_state)) { + mm_dbg ("Cleaning up in-call unsolicited events..."); + if (MM_BASE_CALL_GET_CLASS (self)->cleanup_unsolicited_events && + !MM_BASE_CALL_GET_CLASS (self)->cleanup_unsolicited_events (self, &error)) { + mm_warn ("Couldn't cleanup in-call unsolicited events: %s", error->message); + g_error_free (error); + } + if (MM_BASE_CALL_GET_CLASS (self)->cleanup_audio_channel) { + mm_info ("cleaning up audio channel..."); + update_audio_settings (self, NULL, NULL); + MM_BASE_CALL_GET_CLASS (self)->cleanup_audio_channel (self, + (GAsyncReadyCallback) cleanup_audio_channel_ready, + NULL); + } + } + + mm_gdbus_call_set_state (MM_GDBUS_CALL (self), new_state); + mm_gdbus_call_set_state_reason (MM_GDBUS_CALL (self), reason); + mm_gdbus_call_emit_state_changed (MM_GDBUS_CALL (self), old_state, new_state, reason); } -void mm_base_call_received_dtmf (MMBaseCall *self, gchar *dtmf) +void +mm_base_call_received_dtmf (MMBaseCall *self, + const gchar *dtmf) { - mm_gdbus_call_emit_dtmf_received(MM_GDBUS_CALL (self), dtmf); + mm_gdbus_call_emit_dtmf_received (MM_GDBUS_CALL (self), dtmf); } /*****************************************************************************/ /* Start the CALL */ -typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallStartContext; - -static void -call_start_context_complete_and_free (CallStartContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean call_start_finish (MMBaseCall *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void call_start_ready (MMBaseModem *modem, GAsyncResult *res, - CallStartContext *ctx) + GTask *task) { GError *error = NULL; const gchar *response = NULL; response = mm_base_modem_at_command_finish (modem, res, &error); - if (error) { - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - /* something is wrong, serial timeout could never occurs */ - } - - if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_DIALTONE)) { - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); - } - - if (g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_BUSY) || - g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_ANSWER) || - g_error_matches (error, MM_CONNECTION_ERROR, MM_CONNECTION_ERROR_NO_CARRIER) ) - { - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); - } - - mm_dbg ("Couldn't start call : '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - call_start_context_complete_and_free (ctx); - return; - } /* check response for error */ - if (response && strlen (response) > 0 ) { - g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Couldn't start the call: " - "Modem response '%s'", response); - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_REFUSED_OR_BUSY); - } else { - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); - } - - if (error) { - g_simple_async_result_take_error (ctx->result, error); - call_start_context_complete_and_free (ctx); - return; - } - - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - call_start_context_complete_and_free (ctx); + if (response && response[0]) + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't start the call: Unhandled response '%s'", response); + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void call_start (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - CallStartContext *ctx; + GTask *task; gchar *cmd; - /* Setup the context */ - ctx = g_new0 (CallStartContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_start); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (self->priv->modem); + task = g_task_new (self, NULL, callback, user_data); - cmd = g_strdup_printf ("ATD%s;", mm_gdbus_call_get_number (MM_GDBUS_CALL (self)) ); - mm_base_modem_at_command (ctx->modem, + cmd = g_strdup_printf ("ATD%s;", mm_gdbus_call_get_number (MM_GDBUS_CALL (self))); + mm_base_modem_at_command (self->priv->modem, cmd, 90, FALSE, (GAsyncReadyCallback)call_start_ready, - ctx); - - /* Update state */ - mm_base_call_change_state(self, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED); + task); g_free (cmd); } /*****************************************************************************/ - -/* Accept the CALL */ - -typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallAcceptContext; - -static void -call_accept_context_complete_and_free (CallAcceptContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); -} +/* Accept the call */ static gboolean -call_accept_finish (MMBaseCall *self, - GAsyncResult *res, - GError **error) +call_accept_finish (MMBaseCall *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -call_accept_ready (MMBaseModem *modem, +call_accept_ready (MMBaseModem *modem, GAsyncResult *res, - CallAcceptContext *ctx) + GTask *task) { - GError *error = NULL; + GError *error = NULL; const gchar *response; response = mm_base_modem_at_command_finish (modem, res, &error); - if (error) { - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - g_simple_async_result_take_error (ctx->result, error); - call_accept_context_complete_and_free (ctx); - return; - } - - mm_dbg ("Couldn't accept call : '%s'", error->message); - g_error_free (error); - return; - } /* check response for error */ - if( response && strlen(response) > 0 ) { + if (response && response[0]) g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Couldn't accept the call: " - "Unhandled response '%s'", response); - - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_ERROR); - } else { + "Couldn't accept the call: Unhandled response '%s'", response); - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); - } - - if (error) { - g_simple_async_result_take_error (ctx->result, error); - call_accept_context_complete_and_free (ctx); - return; - } - - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - call_accept_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -call_accept (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) +call_accept (MMBaseCall *self, + GAsyncReadyCallback callback, + gpointer user_data) { - CallAcceptContext *ctx; - gchar *cmd; - - /* Setup the context */ - ctx = g_new0 (CallAcceptContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_accept); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (self->priv->modem); + GTask *task; - cmd = g_strdup_printf ("ATA"); - mm_base_modem_at_command (ctx->modem, - cmd, + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command (self->priv->modem, + "ATA", 2, FALSE, (GAsyncReadyCallback)call_accept_ready, - ctx); - g_free (cmd); + task); } /*****************************************************************************/ - -/* Hangup the CALL */ - -typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallHangupContext; - -static void -call_hangup_context_complete_and_free (CallHangupContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); -} +/* Hangup the call */ static gboolean -call_hangup_finish (MMBaseCall *self, - GAsyncResult *res, - GError **error) +call_hangup_finish (MMBaseCall *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -call_hangup_ready (MMBaseModem *modem, - GAsyncResult *res, - CallHangupContext *ctx) +call_hangup_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) { GError *error = NULL; - const gchar *response; - response = mm_base_modem_at_command_finish (modem, res, &error); - if (error) { - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - g_simple_async_result_take_error (ctx->result, error); - call_hangup_context_complete_and_free (ctx); - return; - } - - mm_dbg ("Couldn't hangup call : '%s'", error->message); - g_error_free (error); - return; - } - - /* Update state */ - mm_base_call_change_state(ctx->self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); + mm_base_modem_at_command_finish (modem, res, &error); - if (error) { - g_simple_async_result_take_error (ctx->result, error); - call_hangup_context_complete_and_free (ctx); - return; - } - - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - call_hangup_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -call_hangup (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) +call_hangup (MMBaseCall *self, + GAsyncReadyCallback callback, + gpointer user_data) { - CallHangupContext *ctx; - gchar *cmd; - - /* Setup the context */ - ctx = g_new0 (CallHangupContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_hangup); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (self->priv->modem); + GTask *task; - cmd = g_strdup_printf ("+CHUP"); - mm_base_modem_at_command (ctx->modem, - cmd, + task = g_task_new (self, NULL, callback, user_data); + mm_base_modem_at_command (self->priv->modem, + "+CHUP", 2, FALSE, (GAsyncReadyCallback)call_hangup_ready, - ctx); - g_free (cmd); + task); } /*****************************************************************************/ /* Send DTMF tone to call */ -typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallSendDtmfContext; - -static void -call_send_dtmf_context_complete_and_free (CallSendDtmfContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean call_send_dtmf_finish (MMBaseCall *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void call_send_dtmf_ready (MMBaseModem *modem, GAsyncResult *res, - CallSendDtmfContext *ctx) + GTask *task) { GError *error = NULL; - const gchar *response = NULL; - response = mm_base_modem_at_command_finish (modem, res, &error); + mm_base_modem_at_command_finish (modem, res, &error); if (error) { mm_dbg ("Couldn't send_dtmf: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - call_send_dtmf_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - call_send_dtmf_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -918,158 +1040,34 @@ GAsyncReadyCallback callback, gpointer user_data) { - CallSendDtmfContext *ctx; + GTask *task; gchar *cmd; - /* Setup the context */ - ctx = g_new0 (CallSendDtmfContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_send_dtmf); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (self->priv->modem); + task = g_task_new (self, NULL, callback, user_data); cmd = g_strdup_printf ("AT+VTS=%c", dtmf[0]); - mm_base_modem_at_command (ctx->modem, + mm_base_modem_at_command (self->priv->modem, cmd, 3, FALSE, (GAsyncReadyCallback)call_send_dtmf_ready, - ctx); + task); g_free (cmd); } /*****************************************************************************/ -typedef struct { - MMBaseCall *self; - MMBaseModem *modem; - GSimpleAsyncResult *result; -} CallDeleteContext; - -static void -call_delete (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - CallDeleteContext *ctx; - - ctx = g_new0 (CallDeleteContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - call_delete); - ctx->self = g_object_ref (self); - ctx->modem = g_object_ref (self->priv->modem); - - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->modem); - g_object_unref (ctx->self); - g_free (ctx); -} - -static gboolean -call_delete_finish (MMBaseCall *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -/*****************************************************************************/ - -gboolean -mm_base_call_delete_finish (MMBaseCall *self, - GAsyncResult *res, - GError **error) -{ - if (MM_BASE_CALL_GET_CLASS (self)->delete_finish) { - gboolean deleted; - - deleted = MM_BASE_CALL_GET_CLASS (self)->delete_finish (self, res, error); - if (deleted) - /* We do change the state of this call back to UNKNOWN */ - mm_base_call_change_state(self, MM_CALL_STATE_UNKNOWN, MM_CALL_STATE_REASON_UNKNOWN); - - return deleted; - } - - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -void -mm_base_call_delete (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - if (MM_BASE_CALL_GET_CLASS (self)->delete && - MM_BASE_CALL_GET_CLASS (self)->delete_finish) { - MM_BASE_CALL_GET_CLASS (self)->delete (self, callback, user_data); - return; - } - - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Deleting call is not supported by this modem"); -} - -/*****************************************************************************/ MMBaseCall * -mm_base_call_new (MMBaseModem *modem) +mm_base_call_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number) { return MM_BASE_CALL (g_object_new (MM_TYPE_BASE_CALL, - MM_BASE_CALL_MODEM, modem, - NULL)); -} - -MMBaseCall * -mm_base_call_new_from_properties (MMBaseModem *modem, - MMCallProperties *properties, - GError **error) -{ - MMBaseCall *self; - const gchar *number; - MMCallDirection direction; - - g_assert (MM_IS_IFACE_MODEM_VOICE (modem)); - - number = mm_call_properties_get_number (properties); - direction = mm_call_properties_get_direction(properties); - - /* Don't create CALL from properties if either number is missing */ - if ( !number ) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Cannot create call: mandatory parameter 'number' is missing"); - return NULL; - } - - /* if no direction is specified force to outgoing */ - if(direction == MM_CALL_DIRECTION_UNKNOWN ) { - direction = MM_CALL_DIRECTION_OUTGOING; - } - - /* Create a call object as defined by the interface */ - self = mm_iface_modem_voice_create_call (MM_IFACE_MODEM_VOICE (modem)); - g_object_set (self, - "state", mm_call_properties_get_state(properties), - "state-reason", mm_call_properties_get_state_reason(properties), - "direction", direction, - "number", number, - NULL); - - /* Only export once properly created */ - mm_base_call_export (self); - - return self; + MM_BASE_CALL_MODEM, modem, + "direction", direction, + "number", number, + NULL)); } /*****************************************************************************/ @@ -1114,6 +1112,12 @@ G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); } break; + case PROP_SUPPORTS_DIALING_TO_RINGING: + self->priv->supports_dialing_to_ringing = g_value_get_boolean (value); + break; + case PROP_SUPPORTS_RINGING_TO_ACTIVE: + self->priv->supports_ringing_to_active = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1138,6 +1142,12 @@ case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; + case PROP_SUPPORTS_DIALING_TO_RINGING: + g_value_set_boolean (value, self->priv->supports_dialing_to_ringing); + break; + case PROP_SUPPORTS_RINGING_TO_ACTIVE: + g_value_set_boolean (value, self->priv->supports_ringing_to_active); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1149,7 +1159,6 @@ { /* Initialize private data */ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_BASE_CALL, MMBaseCallPrivate); - /* Defaults */ } static void @@ -1157,6 +1166,8 @@ { MMBaseCall *self = MM_BASE_CALL (object); + if (self->priv->in_call_events) + g_regex_unref (self->priv->in_call_events); g_free (self->priv->path); G_OBJECT_CLASS (mm_base_call_parent_class)->finalize (object); @@ -1167,6 +1178,13 @@ { MMBaseCall *self = MM_BASE_CALL (object); + g_clear_object (&self->priv->audio_port); + + if (self->priv->incoming_timeout) { + g_source_remove (self->priv->incoming_timeout); + self->priv->incoming_timeout = 0; + } + if (self->priv->connection) { /* If we arrived here with a valid connection, make sure we unexport * the object */ @@ -1192,16 +1210,16 @@ object_class->finalize = finalize; object_class->dispose = dispose; - klass->start = call_start; - klass->start_finish = call_start_finish; - klass->accept = call_accept; - klass->accept_finish = call_accept_finish; - klass->hangup = call_hangup; - klass->hangup_finish = call_hangup_finish; - klass->delete = call_delete; - klass->delete_finish = call_delete_finish; - klass->send_dtmf = call_send_dtmf; - klass->send_dtmf_finish = call_send_dtmf_finish; + klass->start = call_start; + klass->start_finish = call_start_finish; + klass->accept = call_accept; + klass->accept_finish = call_accept_finish; + klass->hangup = call_hangup; + klass->hangup_finish = call_hangup_finish; + klass->send_dtmf = call_send_dtmf; + klass->send_dtmf_finish = call_send_dtmf_finish; + klass->setup_unsolicited_events = setup_unsolicited_events; + klass->cleanup_unsolicited_events = cleanup_unsolicited_events; properties[PROP_CONNECTION] = @@ -1227,4 +1245,20 @@ MM_TYPE_BASE_MODEM, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]); + + properties[PROP_SUPPORTS_DIALING_TO_RINGING] = + g_param_spec_boolean (MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, + "Dialing to ringing", + "Whether the call implementation reports dialing to ringing state updates", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_SUPPORTS_DIALING_TO_RINGING, properties[PROP_SUPPORTS_DIALING_TO_RINGING]); + + properties[PROP_SUPPORTS_RINGING_TO_ACTIVE] = + g_param_spec_boolean (MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, + "Ringing to active", + "Whether the call implementation reports ringing to active state updates", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_SUPPORTS_RINGING_TO_ACTIVE, properties[PROP_SUPPORTS_RINGING_TO_ACTIVE]); } diff -Nru modemmanager-1.6.8/src/mm-base-call.h modemmanager-1.10.0/src/mm-base-call.h --- modemmanager-1.6.8/src/mm-base-call.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-call.h 2019-01-15 15:57:35.000000000 +0100 @@ -23,6 +23,7 @@ #include #include "mm-base-modem.h" +#include "mm-call-audio-format.h" #define MM_TYPE_BASE_CALL (mm_base_call_get_type ()) #define MM_BASE_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_CALL, MMBaseCall)) @@ -35,9 +36,11 @@ typedef struct _MMBaseCallClass MMBaseCallClass; typedef struct _MMBaseCallPrivate MMBaseCallPrivate; -#define MM_BASE_CALL_PATH "call-path" -#define MM_BASE_CALL_CONNECTION "call-connection" -#define MM_BASE_CALL_MODEM "call-modem" +#define MM_BASE_CALL_PATH "call-path" +#define MM_BASE_CALL_CONNECTION "call-connection" +#define MM_BASE_CALL_MODEM "call-modem" +#define MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING "call-supports-dialing-to-ringing" +#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active" struct _MMBaseCall { MmGdbusCallSkeleton parent; @@ -80,37 +83,47 @@ GAsyncResult *res, GError **error); - /* Delete the call */ - void (* delete) (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (* delete_finish) (MMBaseCall *self, - GAsyncResult *res, - GError **error); + /* Setup/cleanup in-call unsolicited events */ + gboolean (* setup_unsolicited_events) (MMBaseCall *self, + GError **error); + gboolean (* cleanup_unsolicited_events) (MMBaseCall *self, + GError **error); + + /* Setup/cleanup audio channel */ + void (* setup_audio_channel) (MMBaseCall *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* setup_audio_channel_finish) (MMBaseCall *self, + GAsyncResult *res, + MMPort **audio_port, + MMCallAudioFormat **audio_format, + GError **error); + void (* cleanup_audio_channel) (MMBaseCall *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* cleanup_audio_channel_finish) (MMBaseCall *self, + GAsyncResult *res, + GError **error); }; GType mm_base_call_get_type (void); /* This one can be overriden by plugins */ -MMBaseCall *mm_base_call_new (MMBaseModem *modem); -MMBaseCall *mm_base_call_new_from_properties (MMBaseModem *modem, - MMCallProperties *properties, - GError **error); - -void mm_base_call_export (MMBaseCall *self); -void mm_base_call_unexport (MMBaseCall *self); -const gchar *mm_base_call_get_path (MMBaseCall *self); -void mm_base_call_change_state (MMBaseCall *self, - MMCallState new_state, - MMCallStateReason reason); -void mm_base_call_received_dtmf (MMBaseCall *self, - gchar *dtmf); - -void mm_base_call_delete (MMBaseCall *self, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_base_call_delete_finish (MMBaseCall *self, - GAsyncResult *res, - GError **error); +MMBaseCall *mm_base_call_new (MMBaseModem *modem, + MMCallDirection direction, + const gchar *number); + +void mm_base_call_export (MMBaseCall *self); +void mm_base_call_unexport (MMBaseCall *self); +const gchar *mm_base_call_get_path (MMBaseCall *self); + +void mm_base_call_change_state (MMBaseCall *self, + MMCallState new_state, + MMCallStateReason reason); + +void mm_base_call_received_dtmf (MMBaseCall *self, + const gchar *dtmf); + +void mm_base_call_incoming_refresh (MMBaseCall *self); #endif /* MM_BASE_CALL_H */ diff -Nru modemmanager-1.6.8/src/mm-base-manager.c modemmanager-1.10.0/src/mm-base-manager.c --- modemmanager-1.6.8/src/mm-base-manager.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-manager.c 2019-01-15 15:57:35.000000000 +0100 @@ -12,26 +12,38 @@ * * Copyright (C) 2008 - 2009 Novell, Inc. * Copyright (C) 2009 - 2012 Red Hat, Inc. - * Copyright (C) 2011 - 2012 Aleksander Morgado - * Copyright (C) 2011 - 2012 Google, Inc. + * Copyright (C) 2011 - 2012 Google, Inc + * Copyright (C) 2016 Velocloud, Inc. + * Copyright (C) 2011 - 2016 Aleksander Morgado */ +#include + #include #include #include -#include + +#if defined WITH_UDEV +# include "mm-kernel-device-udev.h" +#endif +#include "mm-kernel-device-generic.h" #include +#include + #include #include #include +#include "mm-context.h" #include "mm-base-manager.h" +#include "mm-daemon-enums-types.h" #include "mm-device.h" #include "mm-plugin-manager.h" #include "mm-auth.h" #include "mm-plugin.h" +#include "mm-filter.h" #include "mm-log.h" static void initable_iface_init (GInitableIface *iface); @@ -44,8 +56,10 @@ PROP_0, PROP_CONNECTION, PROP_AUTO_SCAN, + PROP_FILTER_POLICY, PROP_ENABLE_TEST, PROP_PLUGIN_DIR, + PROP_INITIAL_KERNEL_EVENTS, LAST_PROP }; @@ -54,24 +68,35 @@ GDBusConnection *connection; /* Whether auto-scanning is enabled */ gboolean auto_scan; + /* Filter policy (mask of enabled rules) */ + MMFilterRule filter_policy; /* Whether the test interface is enabled */ gboolean enable_test; /* Path to look for plugins */ gchar *plugin_dir; - /* The UDev client */ - GUdevClient *udev; + /* Path to the list of initial kernel events */ + gchar *initial_kernel_events; /* The authorization provider */ MMAuthProvider *authp; GCancellable *authp_cancellable; /* The Plugin Manager object */ MMPluginManager *plugin_manager; + /* The port/device filter */ + MMFilter *filter; /* The container of devices being prepared */ GHashTable *devices; /* The Object Manager server */ GDBusObjectManagerServer *object_manager; + /* The map of inhibited devices */ + GHashTable *inhibited_devices; /* The Test interface support */ MmGdbusTest *test_skeleton; + +#if defined WITH_UDEV + /* The UDev client */ + GUdevClient *udev; +#endif }; /*****************************************************************************/ @@ -94,8 +119,8 @@ } static MMDevice * -find_device_by_port (MMBaseManager *manager, - GUdevDevice *port) +find_device_by_port (MMBaseManager *manager, + MMKernelDevice *port) { GHashTableIter iter; gpointer key, value; @@ -111,18 +136,17 @@ } static MMDevice * -find_device_by_sysfs_path (MMBaseManager *self, - const gchar *sysfs_path) +find_device_by_physdev_uid (MMBaseManager *self, + const gchar *physdev_uid) { - return g_hash_table_lookup (self->priv->devices, - sysfs_path); + return g_hash_table_lookup (self->priv->devices, physdev_uid); } static MMDevice * -find_device_by_udev_device (MMBaseManager *manager, - GUdevDevice *udev_device) +find_device_by_kernel_device (MMBaseManager *manager, + MMKernelDevice *kernel_device) { - return find_device_by_sysfs_path (manager, g_udev_device_get_sysfs_path (udev_device)); + return find_device_by_physdev_uid (manager, mm_kernel_device_get_physdev_uid (kernel_device)); } /*****************************************************************************/ @@ -148,12 +172,18 @@ GError *error = NULL; MMPlugin *plugin; + /* If the device support check fails, either with an error, or afterwards + * when trying to create a modem object, we must remove the MMDevice from + * the tracking table of devices, so that a manual scan request afterwards + * re-scans all ports. */ + /* Receive plugin result from the plugin manager */ plugin = mm_plugin_manager_device_support_check_finish (plugin_manager, res, &error); if (!plugin) { - mm_info ("Couldn't check support for device at '%s': %s", - mm_device_get_path (ctx->device), error->message); + mm_info ("Couldn't check support for device '%s': %s", + mm_device_get_uid (ctx->device), error->message); g_error_free (error); + g_hash_table_remove (ctx->self->priv->devices, mm_device_get_uid (ctx->device)); find_device_support_context_free (ctx); return; } @@ -163,123 +193,94 @@ g_object_unref (plugin); if (!mm_device_create_modem (ctx->device, ctx->self->priv->object_manager, &error)) { - mm_warn ("Couldn't create modem for device at '%s': %s", - mm_device_get_path (ctx->device), error->message); + mm_warn ("Couldn't create modem for device '%s': %s", + mm_device_get_uid (ctx->device), error->message); g_error_free (error); + g_hash_table_remove (ctx->self->priv->devices, mm_device_get_uid (ctx->device)); find_device_support_context_free (ctx); return; } /* Modem now created */ - mm_info ("Modem for device at '%s' successfully created", - mm_device_get_path (ctx->device)); + mm_info ("Modem for device '%s' successfully created", + mm_device_get_uid (ctx->device)); find_device_support_context_free (ctx); } -static GUdevDevice * -find_physical_device (GUdevDevice *child) -{ - GUdevDevice *iter, *old = NULL; - GUdevDevice *physdev = NULL; - const char *subsys, *type, *name; - guint32 i = 0; - gboolean is_usb = FALSE, is_pcmcia = FALSE; - - g_return_val_if_fail (child != NULL, NULL); - - /* Bluetooth rfcomm devices are "virtual" and don't necessarily have - * parents at all. - */ - name = g_udev_device_get_name (child); - if (name && strncmp (name, "rfcomm", 6) == 0) - return g_object_ref (child); - - iter = g_object_ref (child); - while (iter && i++ < 8) { - subsys = g_udev_device_get_subsystem (iter); - if (subsys) { - if (is_usb || g_str_has_prefix (subsys, "usb")) { - is_usb = TRUE; - type = g_udev_device_get_devtype (iter); - if (type && !strcmp (type, "usb_device")) { - physdev = iter; - break; - } - } else if (is_pcmcia || !strcmp (subsys, "pcmcia")) { - GUdevDevice *pcmcia_parent; - const char *tmp_subsys; - - is_pcmcia = TRUE; - - /* If the parent of this PCMCIA device is no longer part of - * the PCMCIA subsystem, we want to stop since we're looking - * for the base PCMCIA device, not the PCMCIA controller which - * is usually PCI or some other bus type. - */ - pcmcia_parent = g_udev_device_get_parent (iter); - if (pcmcia_parent) { - tmp_subsys = g_udev_device_get_subsystem (pcmcia_parent); - if (tmp_subsys && strcmp (tmp_subsys, "pcmcia")) - physdev = iter; - g_object_unref (pcmcia_parent); - if (physdev) - break; - } - } else if (!strcmp (subsys, "platform") || - !strcmp (subsys, "pci") || - !strcmp (subsys, "pnp") || - !strcmp (subsys, "sdio")) { - /* Take the first parent as the physical device */ - physdev = iter; - break; - } - } - - old = iter; - iter = g_udev_device_get_parent (old); - g_object_unref (old); - } - - return physdev; -} +static gboolean is_device_inhibited (MMBaseManager *self, + const gchar *physdev_uid); +static void device_inhibited_track_port (MMBaseManager *self, + const gchar *physdev_uid, + MMKernelDevice *port, + gboolean manual_scan); +static void device_inhibited_untrack_port (MMBaseManager *self, + MMKernelDevice *port); static void -device_removed (MMBaseManager *self, - GUdevDevice *udev_device) +device_removed (MMBaseManager *self, + MMKernelDevice *kernel_device) { MMDevice *device; const gchar *subsys; const gchar *name; - g_return_if_fail (udev_device != NULL); + g_return_if_fail (kernel_device != NULL); - subsys = g_udev_device_get_subsystem (udev_device); - name = g_udev_device_get_name (udev_device); + subsys = mm_kernel_device_get_subsystem (kernel_device); + name = mm_kernel_device_get_name (kernel_device); if (!g_str_has_prefix (subsys, "usb") || (name && g_str_has_prefix (name, "cdc-wdm"))) { /* Handle tty/net/wdm port removal */ - device = find_device_by_port (self, udev_device); + device = find_device_by_port (self, kernel_device); if (device) { - mm_info ("(%s/%s): released by modem %s", - subsys, - name, - g_udev_device_get_sysfs_path (mm_device_peek_udev_device (device))); - mm_device_release_port (device, udev_device); - - /* If port probe list gets empty, remove the device object iself */ - if (!mm_device_peek_port_probe_list (device)) { - mm_dbg ("Removing empty device '%s'", mm_device_get_path (device)); - if (mm_plugin_manager_device_support_check_cancel (self->priv->plugin_manager, device)) - mm_dbg ("Device support check has been cancelled"); - mm_device_remove_modem (device); - g_hash_table_remove (self->priv->devices, mm_device_get_path (device)); + /* The callbacks triggered when the port is released or device support is + * cancelled may end up unreffing the device or removing it from the HT, and + * so in order to make sure the reference is still valid when we call + * support_check_cancel() and g_hash_table_remove(), we hold a full reference + * ourselves. */ + g_object_ref (device); + { + mm_info ("(%s/%s): released by device '%s'", subsys, name, mm_device_get_uid (device)); + mm_device_release_port (device, kernel_device); + + /* If port probe list gets empty, remove the device object iself */ + if (!mm_device_peek_port_probe_list (device)) { + mm_dbg ("Removing empty device '%s'", mm_device_get_uid (device)); + if (mm_plugin_manager_device_support_check_cancel (self->priv->plugin_manager, device)) + mm_dbg ("Device support check has been cancelled"); + + /* The device may have already been removed from the tracking HT, we + * just try to remove it and if it fails, we ignore it */ + mm_device_remove_modem (device); + g_hash_table_remove (self->priv->devices, mm_device_get_uid (device)); + } } + g_object_unref (device); + return; } + /* If the device was inhibited and the port is gone, untrack it. + * This is only needed for ports that were tracked out of device objects. + * In this case we don't rely on the physdev uid, as API-reported + * remove kernel events may not include uid. */ + device_inhibited_untrack_port (self, kernel_device); return; } +#if defined WITH_UDEV + /* When a USB modem is switching its USB configuration, udev may deliver + * the remove events of USB interfaces associated with the old USB + * configuration and the add events of USB interfaces associated with the + * new USB configuration in an interleaved fashion. As we don't want a + * remove event of an USB interface trigger the removal of a MMDevice for + * the special case being handled here, we ignore any remove event with + * DEVTYPE != usb_device. + */ + if (g_strcmp0 (mm_kernel_device_get_property (kernel_device, "DEVTYPE"), "usb_device") != 0) + return; +#endif + /* This case is designed to handle the case where, at least with kernel 2.6.31, unplugging * an in-use ttyACMx device results in udev generating remove events for the usb, but the * ttyACMx device (subsystem tty) is not removed, since it was in-use. So if we have not @@ -288,37 +289,33 @@ * device has been removed. That way, if the device is reinserted later, we'll go through * the process of exporting it. */ - device = find_device_by_udev_device (self, udev_device); + device = find_device_by_kernel_device (self, kernel_device); if (device) { - mm_dbg ("Removing device '%s'", mm_device_get_path (device)); + mm_dbg ("Removing device '%s'", mm_device_get_uid (device)); mm_device_remove_modem (device); - g_hash_table_remove (self->priv->devices, mm_device_get_path (device)); + g_hash_table_remove (self->priv->devices, mm_device_get_uid (device)); return; } - - /* Maybe a plugin is checking whether or not the port is supported. - * TODO: Cancel every possible supports check in this port. */ } static void -device_added (MMBaseManager *manager, - GUdevDevice *port, - gboolean hotplugged, - gboolean manual_scan) +device_added (MMBaseManager *manager, + MMKernelDevice *port, + gboolean hotplugged, + gboolean manual_scan) { - MMDevice *device; - const char *subsys, *name, *physdev_path, *physdev_subsys; - gboolean is_candidate; - GUdevDevice *physdev = NULL; + MMDevice *device; + const gchar *physdev_uid; + const gchar *subsys; + const gchar *name; g_return_if_fail (port != NULL); - subsys = g_udev_device_get_subsystem (port); - name = g_udev_device_get_name (port); + subsys = mm_kernel_device_get_subsystem (port); + name = mm_kernel_device_get_name (port); - /* ignore VTs */ - if (strncmp (name, "tty", 3) == 0 && isdigit (name[3])) - return; + mm_dbg ("(%s/%s): adding device at sysfs path: %s", + subsys, name, mm_kernel_device_get_sysfs_path (port)); /* Ignore devices that aren't completely configured by udev yet. If * ModemManager is started in parallel with udev, explicitly requesting @@ -326,77 +323,54 @@ * applied (a bug in udev/gudev). Since we often need those rules to match * the device to a specific ModemManager driver, we need to ensure that all * rules have been processed before handling a device. - */ - is_candidate = g_udev_device_get_property_as_boolean (port, "ID_MM_CANDIDATE"); - if (!is_candidate) { - /* This could mean that device changed, loosing its ID_MM_CANDIDATE + * + * This udev tag applies to each port in a device. In other words, the flag + * may be set in some ports, but not in others */ + if (!mm_kernel_device_get_property_as_boolean (port, ID_MM_CANDIDATE)) { + /* This could mean that device changed, losing its candidate * flags (such as Bluetooth RFCOMM devices upon disconnect. * Try to forget it. */ - if (hotplugged && !manual_scan) - device_removed (manager, port); + device_removed (manager, port); + mm_dbg ("(%s/%s): port not candidate", subsys, name); return; } - if (find_device_by_port (manager, port)) + /* Get the port's physical device's uid. All ports of the same physical + * device will share the same uid. */ + physdev_uid = mm_kernel_device_get_physdev_uid (port); + g_assert (physdev_uid); + + /* If the device is inhibited, do nothing else */ + if (is_device_inhibited (manager, physdev_uid)) { + /* Note: we will not report as hotplugged an inhibited device port + * because we don't know what was done with the port out of our + * context. */ + device_inhibited_track_port (manager, physdev_uid, port, manual_scan); return; - - /* Find the port's physical device's sysfs path. This is the kernel device - * that "owns" all the ports of the device, like the USB device or the PCI - * device the provides each tty or network port. - */ - physdev = find_physical_device (port); - if (!physdev) { - /* Warn about it, but filter out some common ports that we know don't have - * anything to do with mobile broadband. - */ - if ( strcmp (name, "console") - && strcmp (name, "ptmx") - && strcmp (name, "lo") - && strcmp (name, "tty") - && !strstr (name, "virbr")) - mm_dbg ("(%s/%s): could not get port's parent device", subsys, name); - - goto out; } - /* Is the device blacklisted? */ - if (g_udev_device_get_property_as_boolean (physdev, "ID_MM_DEVICE_IGNORE")) { - mm_dbg ("(%s/%s): port's parent device is blacklisted", subsys, name); - goto out; - } - - /* Is the device in the manual-only greylist? If so, return if this is an - * automatic scan. */ - if (!manual_scan && g_udev_device_get_property_as_boolean (physdev, "ID_MM_DEVICE_MANUAL_SCAN_ONLY")) { - mm_dbg ("(%s/%s): port probed only in manual scan", subsys, name); - goto out; - } - - /* If the physdev is a 'platform' or 'pnp' device that's not whitelisted, ignore it */ - physdev_subsys = g_udev_device_get_subsystem (physdev); - if ( physdev_subsys - && ( g_str_equal (physdev_subsys, "platform") - || g_str_equal (physdev_subsys, "pnp")) - && !g_udev_device_get_property_as_boolean (physdev, "ID_MM_PLATFORM_DRIVER_PROBE")) { - mm_dbg ("(%s/%s): port's parent platform driver is not whitelisted", subsys, name); - goto out; - } + /* Run port filter */ + if (!mm_filter_port (manager->priv->filter, port, manual_scan)) + return; - physdev_path = g_udev_device_get_sysfs_path (physdev); - if (!physdev_path) { - mm_dbg ("(%s/%s): could not get port's parent device sysfs path", subsys, name); - goto out; + /* If already added, ignore new event */ + if (find_device_by_port (manager, port)) { + mm_dbg ("(%s/%s): port already added", subsys, name); + return; } /* See if we already created an object to handle ports in this device */ - device = find_device_by_sysfs_path (manager, physdev_path); + device = find_device_by_physdev_uid (manager, physdev_uid); if (!device) { FindDeviceSupportContext *ctx; + mm_dbg ("(%s/%s): first port in device %s", + subsys, name, physdev_uid); + /* Keep the device listed in the Manager */ - device = mm_device_new (physdev, hotplugged); + device = mm_device_new (physdev_uid, hotplugged, FALSE); g_hash_table_insert (manager->priv->devices, - g_strdup (physdev_path), + g_strdup (physdev_uid), device); /* Launch device support check */ @@ -408,16 +382,77 @@ device, (GAsyncReadyCallback) device_support_check_ready, ctx); - } + } else + mm_dbg ("(%s/%s): additional port in device %s", + subsys, name, physdev_uid); /* Grab the port in the existing device. */ mm_device_grab_port (device, port); +} -out: - if (physdev) - g_object_unref (physdev); +static gboolean +handle_kernel_event (MMBaseManager *self, + MMKernelEventProperties *properties, + GError **error) +{ + MMKernelDevice *kernel_device; + const gchar *action; + const gchar *subsystem; + const gchar *name; + const gchar *uid; + + action = mm_kernel_event_properties_get_action (properties); + if (!action) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Missing mandatory parameter 'action'"); + return FALSE; + } + if (g_strcmp0 (action, "add") != 0 && g_strcmp0 (action, "remove") != 0) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Invalid 'action' parameter given: '%s' (expected 'add' or 'remove')", action); + return FALSE; + } + + subsystem = mm_kernel_event_properties_get_subsystem (properties); + if (!subsystem) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Missing mandatory parameter 'subsystem'"); + return FALSE; + } + + name = mm_kernel_event_properties_get_name (properties); + if (!name) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Missing mandatory parameter 'name'"); + return FALSE; + } + + uid = mm_kernel_event_properties_get_uid (properties); + + mm_dbg ("Kernel event reported:"); + mm_dbg (" action: %s", action); + mm_dbg (" subsystem: %s", subsystem); + mm_dbg (" name: %s", name); + mm_dbg (" uid: %s", uid ? uid : "n/a"); + +#if defined WITH_UDEV + kernel_device = mm_kernel_device_udev_new_from_properties (properties, error); +#else + kernel_device = mm_kernel_device_generic_new (properties, error); +#endif + + if (!kernel_device) + return FALSE; + + if (g_strcmp0 (action, "add") == 0) + device_added (self, kernel_device, TRUE, TRUE); + else if (g_strcmp0 (action, "remove") == 0) + device_removed (self, kernel_device); + else + g_assert_not_reached (); + g_object_unref (kernel_device); + + return TRUE; } +#if defined WITH_UDEV + static void handle_uevent (GUdevClient *client, const char *action, @@ -427,6 +462,7 @@ MMBaseManager *self = MM_BASE_MANAGER (user_data); const gchar *subsys; const gchar *name; + MMKernelDevice *kernel_device; g_return_if_fail (action != NULL); @@ -435,15 +471,19 @@ g_return_if_fail (subsys != NULL); g_return_if_fail (g_str_equal (subsys, "tty") || g_str_equal (subsys, "net") || g_str_has_prefix (subsys, "usb")); + kernel_device = mm_kernel_device_udev_new (device); + /* We only care about tty/net and usb/cdc-wdm devices when adding modem ports, * but for remove, also handle usb parent device remove events */ - name = g_udev_device_get_name (device); + name = mm_kernel_device_get_name (kernel_device); if ( (g_str_equal (action, "add") || g_str_equal (action, "move") || g_str_equal (action, "change")) && (!g_str_has_prefix (subsys, "usb") || (name && g_str_has_prefix (name, "cdc-wdm")))) - device_added (self, device, TRUE, FALSE); + device_added (self, kernel_device, TRUE, FALSE); else if (g_str_equal (action, "remove")) - device_removed (self, device); + device_removed (self, kernel_device); + + g_object_unref (kernel_device); } typedef struct { @@ -455,7 +495,12 @@ static gboolean start_device_added_idle (StartDeviceAdded *ctx) { - device_added (ctx->self, ctx->device, FALSE, ctx->manual_scan); + MMKernelDevice *kernel_device; + + kernel_device = mm_kernel_device_udev_new (ctx->device); + device_added (ctx->self, kernel_device, FALSE, ctx->manual_scan); + g_object_unref (kernel_device); + g_object_unref (ctx->self); g_object_unref (ctx->device); g_slice_free (StartDeviceAdded, ctx); @@ -476,58 +521,120 @@ g_idle_add ((GSourceFunc)start_device_added_idle, ctx); } -void -mm_base_manager_start (MMBaseManager *manager, - gboolean manual_scan) +static void +process_scan (MMBaseManager *self, + gboolean manual_scan) { GList *devices, *iter; - g_return_if_fail (manager != NULL); - g_return_if_fail (MM_IS_BASE_MANAGER (manager)); - - if (!manager->priv->auto_scan && !manual_scan) - return; - - mm_dbg ("Starting %s device scan...", manual_scan ? "manual" : "automatic"); - - devices = g_udev_client_query_by_subsystem (manager->priv->udev, "tty"); + devices = g_udev_client_query_by_subsystem (self->priv->udev, "tty"); for (iter = devices; iter; iter = g_list_next (iter)) { - start_device_added (manager, G_UDEV_DEVICE (iter->data), manual_scan); + start_device_added (self, G_UDEV_DEVICE (iter->data), manual_scan); g_object_unref (G_OBJECT (iter->data)); } g_list_free (devices); - devices = g_udev_client_query_by_subsystem (manager->priv->udev, "net"); + devices = g_udev_client_query_by_subsystem (self->priv->udev, "net"); for (iter = devices; iter; iter = g_list_next (iter)) { - start_device_added (manager, G_UDEV_DEVICE (iter->data), manual_scan); + start_device_added (self, G_UDEV_DEVICE (iter->data), manual_scan); g_object_unref (G_OBJECT (iter->data)); } g_list_free (devices); - devices = g_udev_client_query_by_subsystem (manager->priv->udev, "usb"); + devices = g_udev_client_query_by_subsystem (self->priv->udev, "usb"); for (iter = devices; iter; iter = g_list_next (iter)) { const gchar *name; name = g_udev_device_get_name (G_UDEV_DEVICE (iter->data)); if (name && g_str_has_prefix (name, "cdc-wdm")) - start_device_added (manager, G_UDEV_DEVICE (iter->data), manual_scan); + start_device_added (self, G_UDEV_DEVICE (iter->data), manual_scan); g_object_unref (G_OBJECT (iter->data)); } g_list_free (devices); /* Newer kernels report 'usbmisc' subsystem */ - devices = g_udev_client_query_by_subsystem (manager->priv->udev, "usbmisc"); + devices = g_udev_client_query_by_subsystem (self->priv->udev, "usbmisc"); for (iter = devices; iter; iter = g_list_next (iter)) { const gchar *name; name = g_udev_device_get_name (G_UDEV_DEVICE (iter->data)); if (name && g_str_has_prefix (name, "cdc-wdm")) - start_device_added (manager, G_UDEV_DEVICE (iter->data), manual_scan); + start_device_added (self, G_UDEV_DEVICE (iter->data), manual_scan); g_object_unref (G_OBJECT (iter->data)); } g_list_free (devices); +} + +#endif + +static void +process_initial_kernel_events (MMBaseManager *self) +{ + gchar *contents = NULL; + gchar *line; + GError *error = NULL; + + if (!self->priv->initial_kernel_events) + return; + + if (!g_file_get_contents (self->priv->initial_kernel_events, &contents, NULL, &error)) { + g_warning ("Couldn't load initial kernel events: %s", error->message); + g_error_free (error); + return; + } + + line = contents; + while (line) { + gchar *next; + + next = strchr (line, '\n'); + if (next) { + *next = '\0'; + next++; + } + + /* ignore empty lines */ + if (line[0] != '\0') { + MMKernelEventProperties *properties; + + properties = mm_kernel_event_properties_new_from_string (line, &error); + if (!properties) { + g_warning ("Couldn't parse line '%s' as initial kernel event %s", line, error->message); + g_clear_error (&error); + } else if (!handle_kernel_event (self, properties, &error)) { + g_warning ("Couldn't process line '%s' as initial kernel event %s", line, error->message); + g_clear_error (&error); + } else + g_debug ("Processed initial kernel event:' %s'", line); + g_clear_object (&properties); + } + + line = next; + } + + g_free (contents); +} + +void +mm_base_manager_start (MMBaseManager *self, + gboolean manual_scan) +{ + g_return_if_fail (self != NULL); + g_return_if_fail (MM_IS_BASE_MANAGER (self)); + + if (!self->priv->auto_scan && !manual_scan) { + /* If we have a list of initial kernel events, process it now */ + process_initial_kernel_events (self); + return; + } +#if defined WITH_UDEV + mm_dbg ("Starting %s device scan...", manual_scan ? "manual" : "automatic"); + process_scan (self, manual_scan); mm_dbg ("Finished device scan..."); +#else + mm_dbg ("Unsupported %s device scan...", manual_scan ? "manual" : "automatic"); +#endif } /*****************************************************************************/ @@ -546,7 +653,7 @@ if (device) { g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); mm_device_remove_modem (device); - g_hash_table_remove (self->priv->devices, device); + g_hash_table_remove (self->priv->devices, mm_device_get_uid (device)); } } @@ -646,7 +753,7 @@ if (!mm_auth_provider_authorize_finish (authp, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); - else if (!mm_log_set_level(ctx->level, &error)) + else if (!mm_log_set_level (ctx->level, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); else { mm_info ("logging: level '%s'", ctx->level); @@ -705,11 +812,17 @@ if (!mm_auth_provider_authorize_finish (authp, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); else { +#if defined WITH_UDEV /* Otherwise relaunch device scan */ mm_base_manager_start (MM_BASE_MANAGER (ctx->self), TRUE); mm_gdbus_org_freedesktop_modem_manager1_complete_scan_devices ( MM_GDBUS_ORG_FREEDESKTOP_MODEM_MANAGER1 (ctx->self), ctx->invocation); +#else + g_dbus_method_invocation_return_error_literal ( + ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Cannot request manual scan of devices: unsupported"); +#endif } scan_devices_context_free (ctx); @@ -735,6 +848,410 @@ } /*****************************************************************************/ + +typedef struct { + MMBaseManager *self; + GDBusMethodInvocation *invocation; + GVariant *dictionary; +} ReportKernelEventContext; + +static void +report_kernel_event_context_free (ReportKernelEventContext *ctx) +{ + g_object_unref (ctx->invocation); + g_object_unref (ctx->self); + g_variant_unref (ctx->dictionary); + g_slice_free (ReportKernelEventContext, ctx); +} + +static void +report_kernel_event_auth_ready (MMAuthProvider *authp, + GAsyncResult *res, + ReportKernelEventContext *ctx) +{ + GError *error = NULL; + MMKernelEventProperties *properties = NULL; + + if (!mm_auth_provider_authorize_finish (authp, res, &error)) + goto out; + +#if defined WITH_UDEV + if (ctx->self->priv->auto_scan) { + error = g_error_new_literal (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Cannot report kernel event: " + "udev monitoring already in place"); + goto out; + } +#endif + + properties = mm_kernel_event_properties_new_from_dictionary (ctx->dictionary, &error); + if (!properties) + goto out; + + handle_kernel_event (ctx->self, properties, &error); + +out: + if (error) + g_dbus_method_invocation_take_error (ctx->invocation, error); + else + mm_gdbus_org_freedesktop_modem_manager1_complete_report_kernel_event ( + MM_GDBUS_ORG_FREEDESKTOP_MODEM_MANAGER1 (ctx->self), + ctx->invocation); + + if (properties) + g_object_unref (properties); + report_kernel_event_context_free (ctx); +} + +static gboolean +handle_report_kernel_event (MmGdbusOrgFreedesktopModemManager1 *manager, + GDBusMethodInvocation *invocation, + GVariant *dictionary) +{ + ReportKernelEventContext *ctx; + + ctx = g_slice_new0 (ReportKernelEventContext); + ctx->self = g_object_ref (manager); + ctx->invocation = g_object_ref (invocation); + ctx->dictionary = g_variant_ref (dictionary); + + mm_auth_provider_authorize (ctx->self->priv->authp, + invocation, + MM_AUTHORIZATION_MANAGER_CONTROL, + ctx->self->priv->authp_cancellable, + (GAsyncReadyCallback)report_kernel_event_auth_ready, + ctx); + return TRUE; +} + +/*****************************************************************************/ +/* Inhibit or uninhibit device */ + +typedef struct { + MMKernelDevice *kernel_port; + gboolean manual_scan; +} InhibitedDevicePortInfo; + +static void +inhibited_device_port_info_free (InhibitedDevicePortInfo *port_info) +{ + g_object_unref (port_info->kernel_port); + g_slice_free (InhibitedDevicePortInfo, port_info); +} + +typedef struct { + gchar *sender; + guint name_lost_id; + GList *port_infos; +} InhibitedDeviceInfo; + +static void +inhibited_device_info_free (InhibitedDeviceInfo *info) +{ + g_list_free_full (info->port_infos, (GDestroyNotify)inhibited_device_port_info_free); + g_bus_unwatch_name (info->name_lost_id); + g_free (info->sender); + g_slice_free (InhibitedDeviceInfo, info); +} + +static InhibitedDeviceInfo * +find_inhibited_device_info_by_physdev_uid (MMBaseManager *self, + const gchar *physdev_uid) +{ + return (physdev_uid ? g_hash_table_lookup (self->priv->inhibited_devices, physdev_uid) : NULL); +} + +static gboolean +is_device_inhibited (MMBaseManager *self, + const gchar *physdev_uid) +{ + return !!find_inhibited_device_info_by_physdev_uid (self, physdev_uid); +} + +static void +device_inhibited_untrack_port (MMBaseManager *self, + MMKernelDevice *kernel_port) +{ + GHashTableIter iter; + gchar *uid; + InhibitedDeviceInfo *info; + + g_hash_table_iter_init (&iter, self->priv->inhibited_devices); + while (g_hash_table_iter_next (&iter, (gpointer)&uid, (gpointer)&info)) { + GList *l; + + for (l = info->port_infos; l; l = g_list_next (l)) { + InhibitedDevicePortInfo *port_info; + + port_info = (InhibitedDevicePortInfo *)(l->data); + if (mm_kernel_device_cmp (port_info->kernel_port, kernel_port)) { + mm_dbg ("(%s/%s): released while inhibited", + mm_kernel_device_get_subsystem (kernel_port), + mm_kernel_device_get_name (kernel_port)); + inhibited_device_port_info_free (port_info); + info->port_infos = g_list_delete_link (info->port_infos, l); + return; + } + } + } +} + +static void +device_inhibited_track_port (MMBaseManager *self, + const gchar *physdev_uid, + MMKernelDevice *kernel_port, + gboolean manual_scan) +{ + InhibitedDevicePortInfo *port_info; + InhibitedDeviceInfo *info; + GList *l; + + info = find_inhibited_device_info_by_physdev_uid (self, physdev_uid); + g_assert (info); + + for (l = info->port_infos; l; l = g_list_next (l)) { + /* If device is already tracked, just overwrite the manual scan info */ + port_info = (InhibitedDevicePortInfo *)(l->data); + if (mm_kernel_device_cmp (port_info->kernel_port, kernel_port)) { + port_info->manual_scan = manual_scan; + return; + } + } + + mm_dbg ("(%s/%s): added while inhibited", + mm_kernel_device_get_subsystem (kernel_port), + mm_kernel_device_get_name (kernel_port)); + + port_info = g_slice_new0 (InhibitedDevicePortInfo); + port_info->kernel_port = g_object_ref (kernel_port); + port_info->manual_scan = manual_scan; + info->port_infos = g_list_append (info->port_infos, port_info); +} + +typedef struct { + MMBaseManager *self; + gchar *uid; +} InhibitSenderLostContext; + +static void +inhibit_sender_lost_context_free (InhibitSenderLostContext *lost_ctx) +{ + g_free (lost_ctx->uid); + g_slice_free (InhibitSenderLostContext, lost_ctx); +} + +static void +remove_device_inhibition (MMBaseManager *self, + const gchar *uid) +{ + InhibitedDeviceInfo *info; + MMDevice *device; + GList *port_infos; + + info = find_inhibited_device_info_by_physdev_uid (self, uid); + g_assert (info); + + device = find_device_by_physdev_uid (self, uid); + port_infos = info->port_infos; + info->port_infos = NULL; + g_hash_table_remove (self->priv->inhibited_devices, uid); + + if (port_infos) { + GList *l; + + /* Note that a device can only be inhibited if it had an existing + * modem exposed in the bus. And so, inhibition can only be placed + * AFTER all port probes have finished for a given device. This means + * that we either have a device tracked, or we have a list of port + * infos. Both at the same time should never happen. */ + g_assert (!device); + + /* Report as added all port infos that we had tracked while the + * device was inhibited. We can only report the added port after + * having removed the entry from the inhibited devices tracking + * table. */ + for (l = port_infos; l; l = g_list_next (l)) { + InhibitedDevicePortInfo *port_info; + + port_info = (InhibitedDevicePortInfo *)(l->data); + device_added (self, port_info->kernel_port, FALSE, port_info->manual_scan); + } + g_list_free_full (port_infos, (GDestroyNotify)inhibited_device_port_info_free); + } + /* The device may be totally gone from the system while we were + * keeping the inhibition, so do not error out if not found. */ + else if (device) { + GError *error = NULL; + + /* Uninhibit device, which will create and expose the modem object */ + if (!mm_device_uninhibit (device, self->priv->object_manager, &error)) { + mm_warn ("Couldn't uninhibit device: %s", error->message); + g_error_free (error); + } + } +} + +static void +inhibit_sender_lost (GDBusConnection *connection, + const gchar *sender_name, + InhibitSenderLostContext *lost_ctx) +{ + mm_info ("Device inhibition teardown for uid '%s' (owner disappeared from bus)", lost_ctx->uid); + remove_device_inhibition (lost_ctx->self, lost_ctx->uid); +} + +typedef struct { + MMBaseManager *self; + GDBusMethodInvocation *invocation; + gchar *uid; + gboolean inhibit; +} InhibitDeviceContext; + +static void +inhibit_device_context_free (InhibitDeviceContext *ctx) +{ + g_object_unref (ctx->invocation); + g_object_unref (ctx->self); + g_free (ctx->uid); + g_slice_free (InhibitDeviceContext, ctx); +} + +static void +device_inhibit_ready (MMDevice *device, + GAsyncResult *res, + InhibitDeviceContext *ctx) +{ + InhibitSenderLostContext *lost_ctx; + InhibitedDeviceInfo *info; + GError *error = NULL; + + if (!mm_device_inhibit_finish (device, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + inhibit_device_context_free (ctx); + return; + } + + info = g_slice_new0 (InhibitedDeviceInfo); + info->sender = g_strdup (g_dbus_method_invocation_get_sender (ctx->invocation)); + + /* This context will exist as long as the sender name watcher exists, + * i.e. as long as the associated InhibitDeviceInfo exists. We don't need + * an extra reference of self here because these contexts are stored within + * self, and therefore bound to its lifetime. */ + lost_ctx = g_slice_new0 (InhibitSenderLostContext); + lost_ctx->self = ctx->self; + lost_ctx->uid = g_strdup (ctx->uid); + info->name_lost_id = g_bus_watch_name_on_connection (g_dbus_method_invocation_get_connection (ctx->invocation), + info->sender, + G_BUS_NAME_WATCHER_FLAGS_NONE, + NULL, + (GBusNameVanishedCallback)inhibit_sender_lost, + lost_ctx, + (GDestroyNotify)inhibit_sender_lost_context_free); + + g_hash_table_insert (ctx->self->priv->inhibited_devices, g_strdup (ctx->uid), info); + + mm_info ("Device inhibition setup for uid '%s'", ctx->uid); + + mm_gdbus_org_freedesktop_modem_manager1_complete_inhibit_device ( + MM_GDBUS_ORG_FREEDESKTOP_MODEM_MANAGER1 (ctx->self), + ctx->invocation); + inhibit_device_context_free (ctx); +} + +static void +base_manager_inhibit_device (InhibitDeviceContext *ctx) +{ + MMDevice *device; + + device = find_device_by_physdev_uid (ctx->self, ctx->uid); + if (!device) { + g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "No device found with uid '%s'", ctx->uid); + inhibit_device_context_free (ctx); + return; + } + + if (mm_device_get_inhibited (device)) { + g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, + "Device '%s' is already inhibited", ctx->uid); + inhibit_device_context_free (ctx); + return; + } + + mm_device_inhibit (device, + (GAsyncReadyCallback) device_inhibit_ready, + ctx); +} + +static void +base_manager_uninhibit_device (InhibitDeviceContext *ctx) +{ + InhibitedDeviceInfo *info; + const gchar *sender; + + /* Validate uninhibit request */ + sender = g_dbus_method_invocation_get_sender (ctx->invocation); + info = find_inhibited_device_info_by_physdev_uid (ctx->self, ctx->uid); + if (!info || (g_strcmp0 (info->sender, sender) != 0)) { + g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "No inhibition found for uid '%s'", ctx->uid); + inhibit_device_context_free (ctx); + return; + } + + mm_info ("Device inhibition teardown for uid '%s'", ctx->uid); + remove_device_inhibition (ctx->self, ctx->uid); + + mm_gdbus_org_freedesktop_modem_manager1_complete_inhibit_device ( + MM_GDBUS_ORG_FREEDESKTOP_MODEM_MANAGER1 (ctx->self), + ctx->invocation); + inhibit_device_context_free (ctx); +} + +static void +inhibit_device_auth_ready (MMAuthProvider *authp, + GAsyncResult *res, + InhibitDeviceContext *ctx) +{ + GError *error = NULL; + + if (!mm_auth_provider_authorize_finish (authp, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + inhibit_device_context_free (ctx); + return; + } + + if (ctx->inhibit) + base_manager_inhibit_device (ctx); + else + base_manager_uninhibit_device (ctx); +} + +static gboolean +handle_inhibit_device (MmGdbusOrgFreedesktopModemManager1 *manager, + GDBusMethodInvocation *invocation, + const gchar *uid, + gboolean inhibit) +{ + InhibitDeviceContext *ctx; + + ctx = g_new0 (InhibitDeviceContext, 1); + ctx->self = g_object_ref (manager); + ctx->invocation = g_object_ref (invocation); + ctx->uid = g_strdup (uid); + ctx->inhibit = inhibit; + + mm_auth_provider_authorize (ctx->self->priv->authp, + invocation, + MM_AUTHORIZATION_MANAGER_CONTROL, + ctx->self->priv->authp_cancellable, + (GAsyncReadyCallback)inhibit_device_auth_ready, + ctx); + return TRUE; +} + +/*****************************************************************************/ /* Test profile setup */ static gboolean @@ -747,15 +1264,15 @@ { MMPlugin *plugin; MMDevice *device; - gchar *physdev; + gchar *physdev_uid; GError *error = NULL; mm_info ("Test profile set to: '%s'", id); /* Create device and keep it listed in the Manager */ - physdev = g_strdup_printf ("/virtual/%s", id); - device = mm_device_virtual_new (physdev, TRUE); - g_hash_table_insert (self->priv->devices, physdev, device); + physdev_uid = g_strdup_printf ("/virtual/%s", id); + device = mm_device_new (physdev_uid, TRUE, TRUE); + g_hash_table_insert (self->priv->devices, physdev_uid, device); /* Grab virtual ports */ mm_device_virtual_grab_ports (device, (const gchar **)ports); @@ -767,8 +1284,8 @@ MM_CORE_ERROR_NOT_FOUND, "Requested plugin '%s' not found", plugin_name); - mm_warn ("Couldn't set plugin for virtual device at '%s': %s", - mm_device_get_path (device), + mm_warn ("Couldn't set plugin for virtual device '%s': %s", + mm_device_get_uid (device), error->message); goto out; } @@ -776,20 +1293,20 @@ /* Create modem */ if (!mm_device_create_modem (device, self->priv->object_manager, &error)) { - mm_warn ("Couldn't create modem for virtual device at '%s': %s", - mm_device_get_path (device), + mm_warn ("Couldn't create modem for virtual device '%s': %s", + mm_device_get_uid (device), error->message); goto out; } - mm_info ("Modem for virtual device at '%s' successfully created", - mm_device_get_path (device)); + mm_info ("Modem for virtual device '%s' successfully created", + mm_device_get_uid (device)); out: if (error) { mm_device_remove_modem (device); - g_hash_table_remove (self->priv->devices, mm_device_get_path (device)); + g_hash_table_remove (self->priv->devices, mm_device_get_uid (device)); g_dbus_method_invocation_return_gerror (invocation, error); g_error_free (error); } else @@ -801,21 +1318,26 @@ /*****************************************************************************/ MMBaseManager * -mm_base_manager_new (GDBusConnection *connection, - const gchar *plugin_dir, - gboolean auto_scan, - gboolean enable_test, - GError **error) +mm_base_manager_new (GDBusConnection *connection, + const gchar *plugin_dir, + gboolean auto_scan, + MMFilterRule filter_policy, + const gchar *initial_kernel_events, + gboolean enable_test, + GError **error) { g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); return g_initable_new (MM_TYPE_BASE_MANAGER, NULL, /* cancellable */ error, - MM_BASE_MANAGER_CONNECTION, connection, - MM_BASE_MANAGER_PLUGIN_DIR, plugin_dir, - MM_BASE_MANAGER_AUTO_SCAN, auto_scan, - MM_BASE_MANAGER_ENABLE_TEST, enable_test, + MM_BASE_MANAGER_CONNECTION, connection, + MM_BASE_MANAGER_PLUGIN_DIR, plugin_dir, + MM_BASE_MANAGER_AUTO_SCAN, auto_scan, + MM_BASE_MANAGER_FILTER_POLICY, filter_policy, + MM_BASE_MANAGER_INITIAL_KERNEL_EVENTS, initial_kernel_events, + MM_BASE_MANAGER_ENABLE_TEST, enable_test, + "version", MM_DIST_VERSION, NULL); } @@ -853,6 +1375,9 @@ case PROP_AUTO_SCAN: priv->auto_scan = g_value_get_boolean (value); break; + case PROP_FILTER_POLICY: + priv->filter_policy = g_value_get_flags (value); + break; case PROP_ENABLE_TEST: priv->enable_test = g_value_get_boolean (value); break; @@ -860,6 +1385,10 @@ g_free (priv->plugin_dir); priv->plugin_dir = g_value_dup_string (value); break; + case PROP_INITIAL_KERNEL_EVENTS: + g_free (priv->initial_kernel_events); + priv->initial_kernel_events = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -881,12 +1410,18 @@ case PROP_AUTO_SCAN: g_value_set_boolean (value, priv->auto_scan); break; + case PROP_FILTER_POLICY: + g_value_set_flags (value, priv->filter_policy); + break; case PROP_ENABLE_TEST: g_value_set_boolean (value, priv->enable_test); break; case PROP_PLUGIN_DIR: g_value_set_string (value, priv->plugin_dir); break; + case PROP_INITIAL_KERNEL_EVENTS: + g_value_set_string (value, priv->initial_kernel_events); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -897,7 +1432,6 @@ mm_base_manager_init (MMBaseManager *manager) { MMBaseManagerPrivate *priv; - const gchar *subsys[5] = { "tty", "net", "usb", "usbmisc", NULL }; /* Setup private data */ manager->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, @@ -911,8 +1445,17 @@ /* Setup internal lists of device objects */ priv->devices = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - /* Setup UDev client */ - priv->udev = g_udev_client_new (subsys); + /* Setup internal list of inhibited devices */ + priv->inhibited_devices = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)inhibited_device_info_free); + +#if defined WITH_UDEV + { + const gchar *subsys[5] = { "tty", "net", "usb", "usbmisc", NULL }; + + /* Setup UDev client */ + priv->udev = g_udev_client_new (subsys); + } +#endif /* By default, enable autoscan */ priv->auto_scan = TRUE; @@ -924,13 +1467,11 @@ priv->object_manager = g_dbus_object_manager_server_new (MM_DBUS_PATH); /* Enable processing of input DBus messages */ - g_signal_connect (manager, - "handle-set-logging", - G_CALLBACK (handle_set_logging), - NULL); - g_signal_connect (manager, - "handle-scan-devices", - G_CALLBACK (handle_scan_devices), + g_object_connect (manager, + "signal::handle-set-logging", G_CALLBACK (handle_set_logging), NULL, + "signal::handle-scan-devices", G_CALLBACK (handle_scan_devices), NULL, + "signal::handle-report-kernel-event", G_CALLBACK (handle_report_kernel_event), NULL, + "signal::handle-inhibit-device", G_CALLBACK (handle_inhibit_device), NULL, NULL); } @@ -941,12 +1482,19 @@ { MMBaseManagerPrivate *priv = MM_BASE_MANAGER (initable)->priv; +#if defined WITH_UDEV /* If autoscan enabled, list for udev events */ if (priv->auto_scan) g_signal_connect (priv->udev, "uevent", G_CALLBACK (handle_uevent), initable); +#endif + + /* Create filter */ + priv->filter = mm_filter_new (priv->filter_policy, error); + if (!priv->filter) + return FALSE; /* Create plugin manager */ - priv->plugin_manager = mm_plugin_manager_new (priv->plugin_dir, error); + priv->plugin_manager = mm_plugin_manager_new (priv->plugin_dir, priv->filter, error); if (!priv->plugin_manager) return FALSE; @@ -984,12 +1532,19 @@ { MMBaseManagerPrivate *priv = MM_BASE_MANAGER (object)->priv; + g_free (priv->initial_kernel_events); g_free (priv->plugin_dir); + g_hash_table_destroy (priv->inhibited_devices); g_hash_table_destroy (priv->devices); +#if defined WITH_UDEV if (priv->udev) g_object_unref (priv->udev); +#endif + + if (priv->filter) + g_object_unref (priv->filter); if (priv->plugin_manager) g_object_unref (priv->plugin_manager); @@ -1048,6 +1603,15 @@ TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property ( + object_class, PROP_FILTER_POLICY, + g_param_spec_flags (MM_BASE_MANAGER_FILTER_POLICY, + "Filter policy", + "Mask of rules enabled in the filter", + MM_TYPE_FILTER_RULE, + MM_FILTER_RULE_NONE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (object_class, PROP_ENABLE_TEST, g_param_spec_boolean (MM_BASE_MANAGER_ENABLE_TEST, @@ -1063,4 +1627,12 @@ "Where to look for plugins", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_INITIAL_KERNEL_EVENTS, + g_param_spec_string (MM_BASE_MANAGER_INITIAL_KERNEL_EVENTS, + "Initial kernel events", + "Path to a file with the list of initial kernel events", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); } diff -Nru modemmanager-1.6.8/src/mm-base-manager.h modemmanager-1.10.0/src/mm-base-manager.h --- modemmanager-1.6.8/src/mm-base-manager.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-manager.h 2018-11-15 09:55:53.000000000 +0100 @@ -21,6 +21,7 @@ #include #include +#include "mm-filter.h" #include "mm-gdbus-manager.h" #define MM_TYPE_BASE_MANAGER (mm_base_manager_get_type ()) @@ -30,10 +31,12 @@ #define MM_IS_BASE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MM_TYPE_BASE_MANAGER)) #define MM_BASE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BASE_MANAGER, MMBaseManagerClass)) -#define MM_BASE_MANAGER_CONNECTION "connection" /* Construct-only */ -#define MM_BASE_MANAGER_AUTO_SCAN "auto-scan" /* Construct-only */ -#define MM_BASE_MANAGER_ENABLE_TEST "enable-test" /* Construct-only */ -#define MM_BASE_MANAGER_PLUGIN_DIR "plugin-dir" /* Construct-only */ +#define MM_BASE_MANAGER_CONNECTION "connection" /* Construct-only */ +#define MM_BASE_MANAGER_AUTO_SCAN "auto-scan" /* Construct-only */ +#define MM_BASE_MANAGER_FILTER_POLICY "filter-policy" /* Construct-only */ +#define MM_BASE_MANAGER_ENABLE_TEST "enable-test" /* Construct-only */ +#define MM_BASE_MANAGER_PLUGIN_DIR "plugin-dir" /* Construct-only */ +#define MM_BASE_MANAGER_INITIAL_KERNEL_EVENTS "initial-kernel-events" /* Construct-only */ typedef struct _MMBaseManagerPrivate MMBaseManagerPrivate; @@ -48,11 +51,13 @@ GType mm_base_manager_get_type (void); -MMBaseManager *mm_base_manager_new (GDBusConnection *bus, - const gchar *plugin_dir, - gboolean auto_scan, - gboolean enable_test, - GError **error); +MMBaseManager *mm_base_manager_new (GDBusConnection *bus, + const gchar *plugin_dir, + gboolean auto_scan, + MMFilterRule filter_policy, + const gchar *initial_kernel_events, + gboolean enable_test, + GError **error); void mm_base_manager_start (MMBaseManager *manager, gboolean manual_scan); diff -Nru modemmanager-1.6.8/src/mm-base-modem-at.c modemmanager-1.10.0/src/mm-base-modem-at.c --- modemmanager-1.6.8/src/mm-base-modem-at.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-modem-at.c 2018-11-15 09:55:53.000000000 +0100 @@ -30,7 +30,7 @@ GError *error = NULL; gboolean init_sequence_enabled = FALSE; - /* If no port given, probably the port dissapeared */ + /* If no port given, probably the port disappeared */ if (!port) { g_simple_async_report_error_in_idle ( G_OBJECT (self), diff -Nru modemmanager-1.6.8/src/mm-base-modem.c modemmanager-1.10.0/src/mm-base-modem.c --- modemmanager-1.6.8/src/mm-base-modem.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-modem.c 2019-01-15 15:57:35.000000000 +0100 @@ -21,9 +21,10 @@ #include #include #include -#include #include +#include + #include #include @@ -37,6 +38,10 @@ G_DEFINE_ABSTRACT_TYPE (MMBaseModem, mm_base_modem, MM_GDBUS_TYPE_OBJECT_SKELETON); +/* If we get 10 consecutive timeouts in a serial port, we consider the modem + * invalid and we request re-probing. */ +#define DEFAULT_MAX_TIMEOUTS 10 + enum { PROP_0, PROP_VALID, @@ -47,6 +52,7 @@ PROP_VENDOR_ID, PROP_PRODUCT_ID, PROP_CONNECTION, + PROP_REPROBE, PROP_LAST }; @@ -70,6 +76,7 @@ gboolean hotplugged; gboolean valid; + gboolean reprobe; guint max_timeouts; @@ -88,6 +95,10 @@ MMPortSerialAt *gps_control; MMPortSerialGps *gps; + /* Support for parallel enable/disable operations */ + GList *enable_tasks; + GList *disable_tasks; + #if defined WITH_QMI /* QMI ports */ GList *qmi; @@ -109,36 +120,46 @@ static void serial_port_timed_out_cb (MMPortSerial *port, guint n_consecutive_timeouts, - gpointer user_data) + MMBaseModem *self) { - MMBaseModem *self = (MM_BASE_MODEM (user_data)); - - if (self->priv->max_timeouts > 0 && - n_consecutive_timeouts >= self->priv->max_timeouts) { - mm_warn ("(%s/%s) port timed out %u times, marking modem '%s' as disabled", - mm_port_type_get_string (mm_port_get_port_type (MM_PORT (port))), + /* If reached the maximum number of timeouts, invalidate modem */ + if (n_consecutive_timeouts >= self->priv->max_timeouts) { + mm_err ("(%s/%s) %s port timed out %u consecutive times, marking modem '%s' as invalid", + mm_port_subsys_get_string (mm_port_get_subsys (MM_PORT (port))), mm_port_get_device (MM_PORT (port)), + mm_port_type_get_string (mm_port_get_port_type (MM_PORT (port))), n_consecutive_timeouts, g_dbus_object_get_object_path (G_DBUS_OBJECT (self))); - - /* Only set action to invalidate modem if not already done */ g_cancellable_cancel (self->priv->cancellable); + return; } + + if (n_consecutive_timeouts > 1) + mm_warn ("(%s/%s) %s port timed out %u consecutive times", + mm_port_subsys_get_string (mm_port_get_subsys (MM_PORT (port))), + mm_port_get_device (MM_PORT (port)), + mm_port_type_get_string (mm_port_get_port_type (MM_PORT (port))), + n_consecutive_timeouts); } gboolean -mm_base_modem_grab_port (MMBaseModem *self, - const gchar *subsys, - const gchar *name, - const gchar *parent_path, - MMPortType ptype, - MMPortSerialAtFlag at_pflags, - GError **error) -{ - MMPort *port; - gchar *key; +mm_base_modem_grab_port (MMBaseModem *self, + MMKernelDevice *kernel_device, + MMPortType ptype, + MMPortSerialAtFlag at_pflags, + GError **error) +{ + MMPort *port; + gchar *key; + const gchar *subsys; + const gchar *name; g_return_val_if_fail (MM_IS_BASE_MODEM (self), FALSE); + g_return_val_if_fail (MM_IS_KERNEL_DEVICE (kernel_device), FALSE); + + subsys = mm_kernel_device_get_subsystem (kernel_device); + name = mm_kernel_device_get_name (kernel_device); + g_return_val_if_fail (subsys != NULL, FALSE); g_return_val_if_fail (name != NULL, FALSE); @@ -180,6 +201,8 @@ } /* Serial ports... */ else if (g_str_equal (subsys, "tty")) { + const gchar *flow_control_tag; + if (ptype == MM_PORT_TYPE_QCDM) /* QCDM port */ port = MM_PORT (mm_port_serial_qcdm_new (name)); @@ -192,7 +215,19 @@ mm_serial_parser_v1_parse, mm_serial_parser_v1_new (), mm_serial_parser_v1_destroy); - /* Store flags already */ + /* Prefer plugin-provided flags to the generic ones */ + if (at_pflags == MM_PORT_SERIAL_AT_FLAG_NONE) { + if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_PRIMARY)) { + mm_dbg ("AT port '%s/%s' flagged as primary", subsys, name); + at_pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY; + } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_SECONDARY)) { + mm_dbg ("AT port '%s/%s' flagged as secondary", subsys, name); + at_pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY; + } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_PPP)) { + mm_dbg ("AT port '%s/%s' flagged as PPP", subsys, name); + at_pflags = MM_PORT_SERIAL_AT_FLAG_PPP; + } + } mm_port_serial_at_set_flags (MM_PORT_SERIAL_AT (port), at_pflags); } else if (ptype == MM_PORT_TYPE_GPS) { /* Raw GPS port */ @@ -208,11 +243,35 @@ return FALSE; } - /* For serial ports, enable port timeout checks */ - g_signal_connect (port, - "timed-out", - G_CALLBACK (serial_port_timed_out_cb), - self); + /* For serial ports, enable port timeout checks if requested to do so */ + if (self->priv->max_timeouts > 0) + g_signal_connect (port, + "timed-out", + G_CALLBACK (serial_port_timed_out_cb), + self); + + /* For serial ports, optionally use a specific baudrate and flow control */ + if (mm_kernel_device_has_property (kernel_device, ID_MM_TTY_BAUDRATE)) + g_object_set (port, + MM_PORT_SERIAL_BAUD, mm_kernel_device_get_property_as_int (kernel_device, ID_MM_TTY_BAUDRATE), + NULL); + + flow_control_tag = mm_kernel_device_get_property (kernel_device, ID_MM_TTY_FLOW_CONTROL); + if (flow_control_tag) { + MMFlowControl flow_control; + GError *inner_error = NULL; + + flow_control = mm_flow_control_from_string (flow_control_tag, &inner_error); + if (flow_control == MM_FLOW_CONTROL_UNKNOWN) { + mm_warn ("(%s/%s) unsupported flow control settings in port: %s", + subsys, name, inner_error->message); + g_error_free (inner_error); + } else { + g_object_set (port, + MM_PORT_SERIAL_FLOW_CONTROL, flow_control, + NULL); + } + } } /* Net ports... */ else if (g_str_equal (subsys, "net")) { @@ -272,7 +331,7 @@ } else /* We already filter out before all non-tty, non-net, non-cdc-wdm ports */ - g_assert_not_reached(); + g_assert_not_reached (); mm_dbg ("(%s) type '%s' claimed by %s", name, @@ -283,58 +342,132 @@ * Note: 'key' and 'port' now owned by the HT. */ g_hash_table_insert (self->priv->ports, key, port); - /* Store parent path */ + /* Store kernel device */ g_object_set (port, - MM_PORT_PARENT_PATH, parent_path, + MM_PORT_KERNEL_DEVICE, kernel_device, NULL); return TRUE; } gboolean -mm_base_modem_disable_finish (MMBaseModem *self, - GAsyncResult *res, - GError **error) +mm_base_modem_disable_finish (MMBaseModem *self, + GAsyncResult *res, + GError **error) { - return MM_BASE_MODEM_GET_CLASS (self)->disable_finish (self, res, error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +disable_ready (MMBaseModem *self, + GAsyncResult *res) +{ + GError *error = NULL; + GList *l; + GList *disable_tasks; + + g_assert (self->priv->disable_tasks); + disable_tasks = self->priv->disable_tasks; + self->priv->disable_tasks = NULL; + + MM_BASE_MODEM_GET_CLASS (self)->disable_finish (self, res, &error); + for (l = disable_tasks; l; l = g_list_next (l)) { + if (error) + g_task_return_error (G_TASK (l->data), g_error_copy (error)); + else + g_task_return_boolean (G_TASK (l->data), TRUE); + } + g_clear_error (&error); + + g_list_free_full (disable_tasks, g_object_unref); } void -mm_base_modem_disable (MMBaseModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +mm_base_modem_disable (MMBaseModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; + gboolean run_disable; + g_assert (MM_BASE_MODEM_GET_CLASS (self)->disable != NULL); g_assert (MM_BASE_MODEM_GET_CLASS (self)->disable_finish != NULL); + /* If the list of disable tasks is empty, we need to run */ + run_disable = !self->priv->disable_tasks; + + /* Store task */ + task = g_task_new (self, self->priv->cancellable, callback, user_data); + self->priv->disable_tasks = g_list_append (self->priv->disable_tasks, task); + + if (!run_disable) + return; + MM_BASE_MODEM_GET_CLASS (self)->disable ( self, self->priv->cancellable, - callback, - user_data); + (GAsyncReadyCallback) disable_ready, + NULL); } gboolean -mm_base_modem_enable_finish (MMBaseModem *self, - GAsyncResult *res, - GError **error) +mm_base_modem_enable_finish (MMBaseModem *self, + GAsyncResult *res, + GError **error) { - return MM_BASE_MODEM_GET_CLASS (self)->enable_finish (self, res, error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +enable_ready (MMBaseModem *self, + GAsyncResult *res) +{ + GError *error = NULL; + GList *l; + GList *enable_tasks; + + g_assert (self->priv->enable_tasks); + enable_tasks = self->priv->enable_tasks; + self->priv->enable_tasks = NULL; + + MM_BASE_MODEM_GET_CLASS (self)->enable_finish (self, res, &error); + for (l = enable_tasks; l; l = g_list_next (l)) { + if (error) + g_task_return_error (G_TASK (l->data), g_error_copy (error)); + else + g_task_return_boolean (G_TASK (l->data), TRUE); + } + g_clear_error (&error); + + g_list_free_full (enable_tasks, g_object_unref); } void -mm_base_modem_enable (MMBaseModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +mm_base_modem_enable (MMBaseModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { + GTask *task; + gboolean run_enable; + g_assert (MM_BASE_MODEM_GET_CLASS (self)->enable != NULL); g_assert (MM_BASE_MODEM_GET_CLASS (self)->enable_finish != NULL); + /* If the list of enable tasks is empty, we need to run */ + run_enable = !self->priv->enable_tasks; + + /* Store task */ + task = g_task_new (self, self->priv->cancellable, callback, user_data); + self->priv->enable_tasks = g_list_append (self->priv->enable_tasks, task); + + if (!run_enable) + return; + MM_BASE_MODEM_GET_CLASS (self)->enable ( self, self->priv->cancellable, - callback, - user_data); + (GAsyncReadyCallback) enable_ready, + NULL); } gboolean @@ -392,6 +525,23 @@ } } +void +mm_base_modem_set_reprobe (MMBaseModem *self, + gboolean reprobe) +{ + g_return_if_fail (MM_IS_BASE_MODEM (self)); + + self->priv->reprobe = reprobe; +} + +gboolean +mm_base_modem_get_reprobe (MMBaseModem *self) +{ + g_return_val_if_fail (MM_IS_BASE_MODEM (self), FALSE); + + return self->priv->reprobe; +} + gboolean mm_base_modem_get_valid (MMBaseModem *self) { @@ -534,9 +684,10 @@ { GList *cdc_wdm_qmi_ports, *l; const gchar *net_port_parent_path; + MMPortQmi *found = NULL; g_warn_if_fail (mm_port_get_subsys (data) == MM_PORT_SUBSYS_NET); - net_port_parent_path = mm_port_get_parent_path (data); + net_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (data)); if (!net_port_parent_path) { g_set_error (error, MM_CORE_ERROR, @@ -551,21 +702,25 @@ MM_PORT_SUBSYS_USB, MM_PORT_TYPE_QMI, NULL); - for (l = cdc_wdm_qmi_ports; l; l = g_list_next (l)) { + for (l = cdc_wdm_qmi_ports; l && !found; l = g_list_next (l)) { const gchar *wdm_port_parent_path; g_assert (MM_IS_PORT_QMI (l->data)); - wdm_port_parent_path = mm_port_get_parent_path (MM_PORT (l->data)); + wdm_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (MM_PORT (l->data))); if (wdm_port_parent_path && g_str_equal (wdm_port_parent_path, net_port_parent_path)) - return MM_PORT_QMI (l->data); + found = MM_PORT_QMI (l->data); } - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "Couldn't find associated QMI port for 'net/%s'", - mm_port_get_device (data)); - return NULL; + g_list_free_full (cdc_wdm_qmi_ports, g_object_unref); + + if (!found) + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "Couldn't find associated QMI port for 'net/%s'", + mm_port_get_device (data)); + + return found; } #endif /* WITH_QMI */ @@ -608,9 +763,10 @@ { GList *cdc_wdm_mbim_ports, *l; const gchar *net_port_parent_path; + MMPortMbim *found = NULL; g_warn_if_fail (mm_port_get_subsys (data) == MM_PORT_SUBSYS_NET); - net_port_parent_path = mm_port_get_parent_path (data); + net_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (data)); if (!net_port_parent_path) { g_set_error (error, MM_CORE_ERROR, @@ -625,21 +781,26 @@ MM_PORT_SUBSYS_USB, MM_PORT_TYPE_MBIM, NULL); - for (l = cdc_wdm_mbim_ports; l; l = g_list_next (l)) { + + for (l = cdc_wdm_mbim_ports; l && !found; l = g_list_next (l)) { const gchar *wdm_port_parent_path; g_assert (MM_IS_PORT_MBIM (l->data)); - wdm_port_parent_path = mm_port_get_parent_path (MM_PORT (l->data)); + wdm_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (MM_PORT (l->data))); if (wdm_port_parent_path && g_str_equal (wdm_port_parent_path, net_port_parent_path)) - return MM_PORT_MBIM (l->data); + found = MM_PORT_MBIM (l->data); } - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "Couldn't find associated MBIM port for 'net/%s'", - mm_port_get_device (data)); - return NULL; + g_list_free_full (cdc_wdm_mbim_ports, g_object_unref); + + if (!found) + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "Couldn't find associated MBIM port for 'net/%s'", + mm_port_get_device (data)); + + return found; } #endif /* WITH_MBIM */ @@ -677,13 +838,9 @@ GList * mm_base_modem_get_data_ports (MMBaseModem *self) { - GList *copy; - g_return_val_if_fail (MM_IS_BASE_MODEM (self), NULL); - copy = g_list_copy (self->priv->data); - g_list_foreach (copy, (GFunc)g_object_ref, NULL); - return copy; + return g_list_copy_deep (self->priv->data, (GCopyFunc)g_object_ref, NULL); } GList * @@ -802,6 +959,9 @@ gpointer value; gpointer key; + if (!self->priv->ports) + return NULL; + /* We'll iterate the ht of ports, looking for any port which is matches * the compare function */ g_hash_table_iter_init (&iter, self->priv->ports); @@ -1143,23 +1303,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void authorize_ready (MMAuthProvider *authp, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!mm_auth_provider_authorize_finish (authp, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } void @@ -1169,18 +1328,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_base_modem_authorize); + task = g_task_new (self, self->priv->authp_cancellable, callback, user_data); /* When running in the session bus for tests, default to always allow */ if (mm_context_get_test_session ()) { - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1189,7 +1344,7 @@ authorization, self->priv->authp_cancellable, (GAsyncReadyCallback)authorize_ready, - result); + task); } /*****************************************************************************/ @@ -1281,6 +1436,8 @@ g_str_equal, g_free, g_object_unref); + + self->priv->max_timeouts = DEFAULT_MAX_TIMEOUTS; } static void @@ -1295,6 +1452,9 @@ case PROP_VALID: mm_base_modem_set_valid (self, g_value_get_boolean (value)); break; + case PROP_REPROBE: + mm_base_modem_set_reprobe (self, g_value_get_boolean (value)); + break; case PROP_MAX_TIMEOUTS: self->priv->max_timeouts = g_value_get_uint (value); break; @@ -1338,6 +1498,9 @@ case PROP_VALID: g_value_set_boolean (value, self->priv->valid); break; + case PROP_REPROBE: + g_value_set_boolean (value, self->priv->reprobe); + break; case PROP_MAX_TIMEOUTS: g_value_set_uint (value, self->priv->max_timeouts); break; @@ -1374,6 +1537,9 @@ * mm_auth_provider_cancel_for_owner (self->priv->authp, object); */ + g_assert (!self->priv->enable_tasks); + g_assert (!self->priv->disable_tasks); + mm_dbg ("Modem (%s) '%s' completely disposed", self->priv->plugin, self->priv->device); @@ -1454,7 +1620,7 @@ "Max timeouts", "Maximum number of consecutive timed out commands sent to " "the modem before disabling it. If 0, this feature is disabled.", - 0, G_MAXUINT, 0, + 0, G_MAXUINT, DEFAULT_MAX_TIMEOUTS, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_MAX_TIMEOUTS, properties[PROP_MAX_TIMEOUTS]); @@ -1513,4 +1679,12 @@ G_TYPE_DBUS_CONNECTION, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_CONNECTION, properties[PROP_CONNECTION]); + + properties[PROP_REPROBE] = + g_param_spec_boolean (MM_BASE_MODEM_REPROBE, + "Reprobe", + "Whether the modem needs to be reprobed or not.", + FALSE, + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_REPROBE, properties[PROP_REPROBE]); } diff -Nru modemmanager-1.6.8/src/mm-base-modem.h modemmanager-1.10.0/src/mm-base-modem.h --- modemmanager-1.6.8/src/mm-base-modem.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-modem.h 2018-12-17 17:14:26.000000000 +0100 @@ -30,6 +30,7 @@ #include "mm-auth.h" #include "mm-port.h" +#include "mm-kernel-device.h" #include "mm-port-serial-at.h" #include "mm-port-serial-qcdm.h" #include "mm-port-serial-gps.h" @@ -61,6 +62,7 @@ #define MM_BASE_MODEM_PLUGIN "base-modem-plugin" #define MM_BASE_MODEM_VENDOR_ID "base-modem-vendor-id" #define MM_BASE_MODEM_PRODUCT_ID "base-modem-product-id" +#define MM_BASE_MODEM_REPROBE "base-modem-reprobe" struct _MMBaseModem { MmGdbusObjectSkeleton parent; @@ -103,13 +105,11 @@ GType mm_base_modem_get_type (void); -gboolean mm_base_modem_grab_port (MMBaseModem *self, - const gchar *subsys, - const gchar *name, - const gchar *parent_path, - MMPortType ptype, - MMPortSerialAtFlag at_pflags, - GError **error); +gboolean mm_base_modem_grab_port (MMBaseModem *self, + MMKernelDevice *kernel_device, + MMPortType ptype, + MMPortSerialAtFlag at_pflags, + GError **error); gboolean mm_base_modem_has_at_port (MMBaseModem *self); @@ -166,6 +166,10 @@ gboolean valid); gboolean mm_base_modem_get_valid (MMBaseModem *self); +void mm_base_modem_set_reprobe (MMBaseModem *self, + gboolean reprobe); +gboolean mm_base_modem_get_reprobe (MMBaseModem *self); + const gchar *mm_base_modem_get_device (MMBaseModem *self); const gchar **mm_base_modem_get_drivers (MMBaseModem *self); const gchar *mm_base_modem_get_plugin (MMBaseModem *self); diff -Nru modemmanager-1.6.8/src/mm-base-sim.c modemmanager-1.10.0/src/mm-base-sim.c --- modemmanager-1.6.8/src/mm-base-sim.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-sim.c 2018-11-15 09:55:53.000000000 +0100 @@ -88,23 +88,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void change_pin_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (modem, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -114,13 +114,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - change_pin); + task = g_task_new (self, NULL, callback, user_data); command = g_strdup_printf ("+CPWD=\"SC\",\"%s\",\"%s\"", old_pin, @@ -130,7 +127,7 @@ 3, FALSE, (GAsyncReadyCallback)change_pin_ready, - result); + task); g_free (command); } @@ -260,23 +257,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void enable_pin_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (modem, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -286,13 +283,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_pin); + task = g_task_new (self, NULL, callback, user_data); command = g_strdup_printf ("+CLCK=\"SC\",%d,\"%s\"", enabled ? 1 : 0, @@ -302,7 +296,7 @@ 3, FALSE, (GAsyncReadyCallback)enable_pin_ready, - result); + task); g_free (command); } @@ -432,23 +426,23 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void send_pin_puk_ready (MMBaseModem *modem, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (modem, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void @@ -458,13 +452,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gchar *command; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_send_pin_puk); + task = g_task_new (self, NULL, callback, user_data); command = (puk ? g_strdup_printf ("+CPIN=\"%s\",\"%s\"", puk, pin) : @@ -475,7 +466,7 @@ 3, FALSE, (GAsyncReadyCallback)send_pin_puk_ready, - result); + task); g_free (command); } @@ -502,23 +493,13 @@ /* SEND PIN/PUK (common logic) */ typedef struct { - MMBaseSim *self; - GSimpleAsyncResult *result; GError *save_error; - gulong wait_for_unlock_id; } SendPinPukContext; static void -send_pin_puk_context_complete_and_free (SendPinPukContext *ctx) +send_pin_puk_context_free (SendPinPukContext *ctx) { - if (ctx->wait_for_unlock_id) - g_signal_handler_disconnect (ctx->self->priv->modem, - ctx->wait_for_unlock_id); - if (ctx->save_error) - g_error_free (ctx->save_error); - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); + g_clear_error (&ctx->save_error); g_free (ctx); } @@ -559,7 +540,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } gboolean @@ -567,17 +548,20 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void update_lock_info_ready (MMIfaceModem *modem, GAsyncResult *res, - SendPinPukContext *ctx) + GTask *task) { + SendPinPukContext *ctx; GError *error = NULL; MMModemLock lock; + ctx = g_task_get_task_data (task); + lock = mm_iface_modem_update_lock_info_finish (modem, res, &error); /* Even if we may be SIM-PIN2/PUK2 locked, we don't consider this an error * in the PIN/PUK sending */ @@ -590,29 +574,29 @@ * - Otherwise, build our own error from the lock code. */ if (ctx->save_error) { - g_simple_async_result_take_error (ctx->result, ctx->save_error); - ctx->save_error = NULL; g_clear_error (&error); - } else if (error) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_take_error (ctx->result, - error_for_unlock_check (lock)); - send_pin_puk_context_complete_and_free (ctx); - return; - } + error = ctx->save_error; + ctx->save_error = NULL; + } else if (!error) + error = error_for_unlock_check (lock); + + g_task_return_error (task, error); + } else + g_task_return_boolean (task, TRUE); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - send_pin_puk_context_complete_and_free (ctx); + g_object_unref (task); } static void send_pin_ready (MMBaseSim *self, GAsyncResult *res, - SendPinPukContext *ctx) + GTask *task) { + SendPinPukContext *ctx; MMModemLock known_lock = MM_MODEM_LOCK_UNKNOWN; + ctx = g_task_get_task_data (task); + if (!MM_BASE_SIM_GET_CLASS (self)->send_pin_finish (self, res, &ctx->save_error)) { if (g_error_matches (ctx->save_error, MM_MOBILE_EQUIPMENT_ERROR, @@ -625,21 +609,25 @@ MM_IFACE_MODEM (self->priv->modem), known_lock, (GAsyncReadyCallback)update_lock_info_ready, - ctx); + task); } static void send_puk_ready (MMBaseSim *self, GAsyncResult *res, - SendPinPukContext *ctx) + GTask *task) { + SendPinPukContext *ctx; + + ctx = g_task_get_task_data (task); + MM_BASE_SIM_GET_CLASS (self)->send_puk_finish (self, res, &ctx->save_error); /* Once pin/puk has been sent, recheck lock */ mm_iface_modem_update_lock_info (MM_IFACE_MODEM (self->priv->modem), MM_MODEM_LOCK_UNKNOWN, /* ask */ (GAsyncReadyCallback)update_lock_info_ready, - ctx); + task); } void @@ -649,31 +637,31 @@ gpointer user_data) { SendPinPukContext *ctx; + GTask *task; /* If sending PIN is not implemented, report an error */ if (!MM_BASE_SIM_GET_CLASS (self)->send_pin || !MM_BASE_SIM_GET_CLASS (self)->send_pin_finish) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot send PIN: " - "operation not supported"); + g_task_report_new_error (self, + callback, + user_data, + mm_base_sim_send_pin, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot send PIN: " + "operation not supported"); return; } ctx = g_new0 (SendPinPukContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_base_sim_send_pin); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)send_pin_puk_context_free); MM_BASE_SIM_GET_CLASS (self)->send_pin (self, pin, (GAsyncReadyCallback)send_pin_ready, - ctx); + task); } void @@ -684,32 +672,82 @@ gpointer user_data) { SendPinPukContext *ctx; + GTask *task; /* If sending PIN is not implemented, report an error */ if (!MM_BASE_SIM_GET_CLASS (self)->send_puk || !MM_BASE_SIM_GET_CLASS (self)->send_puk_finish) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot send PUK: " - "operation not supported"); + g_task_report_new_error (self, + callback, + user_data, + mm_base_sim_send_puk, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot send PUK: " + "operation not supported"); return; } ctx = g_new0 (SendPinPukContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_base_sim_send_puk); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)send_pin_puk_context_free); MM_BASE_SIM_GET_CLASS (self)->send_puk (self, puk, new_pin, (GAsyncReadyCallback)send_puk_ready, - ctx); + task); +} + +/*****************************************************************************/ +/* LOAD SIM IDENTIFIER */ + +gchar * +mm_base_sim_load_sim_identifier_finish (MMBaseSim *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_sim_identifier_ready (MMBaseSim *self, + GAsyncResult *res, + GTask *task) +{ + gchar *simid; + GError *error = NULL; + + simid = MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier_finish (self, res, &error); + if (!simid) + g_task_return_error (task, error); + else + g_task_return_pointer (task, simid, g_free); + g_object_unref (task); +} + +void +mm_base_sim_load_sim_identifier (MMBaseSim *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + if (!MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier || + !MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier_finish) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "not implemented"); + g_object_unref (task); + return; + } + + MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier ( + self, + (GAsyncReadyCallback)load_sim_identifier_ready, + task); } /*****************************************************************************/ @@ -920,21 +958,18 @@ static void \ NAME##_command_ready (MMBaseModem *modem, \ GAsyncResult *res, \ - GSimpleAsyncResult *operation_result) \ + GTask *task) \ { \ GError *error = NULL; \ const gchar *response; \ \ response = mm_base_modem_at_command_finish (modem, res, &error); \ if (error) \ - g_simple_async_result_take_error (operation_result, error); \ + g_task_return_error (task, error); \ else \ - g_simple_async_result_set_op_res_gpointer (operation_result, \ - (gpointer)response, \ - NULL); \ + g_task_return_pointer (task, g_strdup (response), g_free); \ \ - g_simple_async_result_complete (operation_result); \ - g_object_unref (operation_result); \ + g_object_unref (task); \ } /*****************************************************************************/ @@ -979,14 +1014,15 @@ GAsyncResult *res, GError **error) { - const gchar *result; + gchar *result; gchar *sim_identifier; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return NULL; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); sim_identifier = parse_iccid (result, error); + g_free (result); if (!sim_identifier) return NULL; @@ -1010,10 +1046,7 @@ 20, FALSE, (GAsyncReadyCallback)load_sim_identifier_command_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_sim_identifier)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1049,14 +1082,15 @@ GAsyncResult *res, GError **error) { - const gchar *result; + gchar *result; gchar *imsi; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return NULL; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); imsi = parse_imsi (result, error); + g_free (result); if (!imsi) return NULL; @@ -1079,10 +1113,7 @@ 3, FALSE, (GAsyncReadyCallback)load_imsi_command_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_imsi)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1158,12 +1189,19 @@ { GError *inner_error = NULL; const gchar *imsi; - const gchar *result; + gchar *result; guint mnc_length; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) + return NULL; + + mnc_length = parse_mnc_length (result, &inner_error); + g_free (result); + if (inner_error) { + g_propagate_error (error, inner_error); return NULL; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + } imsi = mm_gdbus_sim_get_imsi (MM_GDBUS_SIM (self)); if (!imsi) { @@ -1174,12 +1212,6 @@ return NULL; } - mnc_length = parse_mnc_length (result, &inner_error); - if (inner_error) { - g_propagate_error (error, inner_error); - return NULL; - } - /* Build Operator ID */ return g_strndup (imsi, 3 + mnc_length); } @@ -1200,10 +1232,7 @@ 10, FALSE, (GAsyncReadyCallback)load_operator_identifier_command_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_operator_identifier)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1270,13 +1299,16 @@ GAsyncResult *res, GError **error) { - const gchar *result; + gchar *result; + gchar *spn; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return NULL; - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - return parse_spn (result, error); + spn = parse_spn (result, error); + g_free (result); + return spn; } STR_REPLY_READY_FN (load_operator_name) @@ -1295,16 +1327,13 @@ 10, FALSE, (GAsyncReadyCallback)load_operator_name_command_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_operator_name)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ typedef struct _InitAsyncContext InitAsyncContext; -static void interface_initialization_step (InitAsyncContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -1316,23 +1345,10 @@ } InitializationStep; struct _InitAsyncContext { - GSimpleAsyncResult *result; - GCancellable *cancellable; - MMBaseSim *self; InitializationStep step; guint sim_identifier_tries; }; -static void -init_async_context_free (InitAsyncContext *ctx) -{ - g_object_unref (ctx->self); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_free (ctx); -} - MMBaseSim * mm_base_sim_new_finish (GAsyncResult *res, GError **error) @@ -1358,18 +1374,20 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } static void -load_sim_identifier_ready (MMBaseSim *self, - GAsyncResult *res, - InitAsyncContext *ctx) +init_load_sim_identifier_ready (MMBaseSim *self, + GAsyncResult *res, + GTask *task) { + InitAsyncContext *ctx; GError *error = NULL; gchar *simid; - simid = MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish (self, res, &error); + ctx = g_task_get_task_data (task); + simid = MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier_finish (self, res, &error); if (!simid) { /* TODO: make the retries gobi-specific? */ @@ -1379,7 +1397,7 @@ */ if (++ctx->sim_identifier_tries < 2) { g_clear_error (&error); - interface_initialization_step (ctx); + interface_initialization_step (task); return; } @@ -1393,20 +1411,21 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } #undef STR_REPLY_READY_FN #define STR_REPLY_READY_FN(NAME,DISPLAY) \ static void \ - load_##NAME##_ready (MMBaseSim *self, \ - GAsyncResult *res, \ - InitAsyncContext *ctx) \ + init_load_##NAME##_ready (MMBaseSim *self, \ + GAsyncResult *res, \ + GTask *task) \ { \ + InitAsyncContext *ctx; \ GError *error = NULL; \ gchar *val; \ \ - val = MM_BASE_SIM_GET_CLASS (ctx->self)->load_##NAME##_finish (self, res, &error); \ + val = MM_BASE_SIM_GET_CLASS (self)->load_##NAME##_finish (self, res, &error); \ mm_gdbus_sim_set_##NAME (MM_GDBUS_SIM (self), val); \ g_free (val); \ \ @@ -1416,8 +1435,9 @@ } \ \ /* Go on to next step */ \ + ctx = g_task_get_task_data (task); \ ctx->step++; \ - interface_initialization_step (ctx); \ + interface_initialization_step (task); \ } STR_REPLY_READY_FN (imsi, "IMSI") @@ -1425,18 +1445,19 @@ STR_REPLY_READY_FN (operator_name, "Operator name") static void -interface_initialization_step (InitAsyncContext *ctx) +interface_initialization_step (GTask *task) { - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - g_simple_async_result_complete_in_idle (ctx->result); - init_async_context_free (ctx); + MMBaseSim *self; + InitAsyncContext *ctx; + + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case INITIALIZATION_STEP_FIRST: /* Fall down to next step */ @@ -1446,13 +1467,13 @@ /* SIM ID is meant to be loaded only once during the whole * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ - if (mm_gdbus_sim_get_sim_identifier (MM_GDBUS_SIM (ctx->self)) == NULL && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish) { - MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier ( - ctx->self, - (GAsyncReadyCallback)load_sim_identifier_ready, - ctx); + if (mm_gdbus_sim_get_sim_identifier (MM_GDBUS_SIM (self)) == NULL && + MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier && + MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier_finish) { + MM_BASE_SIM_GET_CLASS (self)->load_sim_identifier ( + self, + (GAsyncReadyCallback)init_load_sim_identifier_ready, + task); return; } /* Fall down to next step */ @@ -1462,13 +1483,13 @@ /* IMSI is meant to be loaded only once during the whole * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ - if (mm_gdbus_sim_get_imsi (MM_GDBUS_SIM (ctx->self)) == NULL && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi_finish) { - MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi ( - ctx->self, - (GAsyncReadyCallback)load_imsi_ready, - ctx); + if (mm_gdbus_sim_get_imsi (MM_GDBUS_SIM (self)) == NULL && + MM_BASE_SIM_GET_CLASS (self)->load_imsi && + MM_BASE_SIM_GET_CLASS (self)->load_imsi_finish) { + MM_BASE_SIM_GET_CLASS (self)->load_imsi ( + self, + (GAsyncReadyCallback)init_load_imsi_ready, + task); return; } /* Fall down to next step */ @@ -1478,13 +1499,13 @@ /* Operator ID is meant to be loaded only once during the whole * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ - if (mm_gdbus_sim_get_operator_identifier (MM_GDBUS_SIM (ctx->self)) == NULL && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier_finish) { - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier ( - ctx->self, - (GAsyncReadyCallback)load_operator_identifier_ready, - ctx); + if (mm_gdbus_sim_get_operator_identifier (MM_GDBUS_SIM (self)) == NULL && + MM_BASE_SIM_GET_CLASS (self)->load_operator_identifier && + MM_BASE_SIM_GET_CLASS (self)->load_operator_identifier_finish) { + MM_BASE_SIM_GET_CLASS (self)->load_operator_identifier ( + self, + (GAsyncReadyCallback)init_load_operator_identifier_ready, + task); return; } /* Fall down to next step */ @@ -1494,13 +1515,13 @@ /* Operator Name is meant to be loaded only once during the whole * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ - if (mm_gdbus_sim_get_operator_name (MM_GDBUS_SIM (ctx->self)) == NULL && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name && - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name_finish) { - MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name ( - ctx->self, - (GAsyncReadyCallback)load_operator_name_ready, - ctx); + if (mm_gdbus_sim_get_operator_name (MM_GDBUS_SIM (self)) == NULL && + MM_BASE_SIM_GET_CLASS (self)->load_operator_name && + MM_BASE_SIM_GET_CLASS (self)->load_operator_name_finish) { + MM_BASE_SIM_GET_CLASS (self)->load_operator_name ( + self, + (GAsyncReadyCallback)init_load_operator_name_ready, + task); return; } /* Fall down to next step */ @@ -1508,13 +1529,11 @@ case INITIALIZATION_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - g_simple_async_result_complete_in_idle (ctx->result); - init_async_context_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - g_assert_not_reached (); } @@ -1525,21 +1544,20 @@ gpointer user_data) { + MMBaseSim *self; InitAsyncContext *ctx; + GTask *task; + + self = MM_BASE_SIM (initable); ctx = g_new (InitAsyncContext, 1); - ctx->self = g_object_ref (initable); - ctx->result = g_simple_async_result_new (G_OBJECT (initable), - callback, - user_data, - common_init_async); - ctx->cancellable = (cancellable ? - g_object_ref (cancellable) : - NULL); ctx->step = INITIALIZATION_STEP_FIRST; ctx->sim_identifier_tries = 0; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + interface_initialization_step (task); } static void diff -Nru modemmanager-1.6.8/src/mm-base-sim.h modemmanager-1.10.0/src/mm-base-sim.h --- modemmanager-1.6.8/src/mm-base-sim.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-sim.h 2018-11-15 09:55:53.000000000 +0100 @@ -129,40 +129,47 @@ GType mm_base_sim_get_type (void); -void mm_base_sim_new (MMBaseModem *modem, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -MMBaseSim *mm_base_sim_new_finish (GAsyncResult *res, - GError **error); - -void mm_base_sim_initialize (MMBaseSim *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_base_sim_initialize_finish (MMBaseSim *self, - GAsyncResult *result, - GError **error); - -void mm_base_sim_send_pin (MMBaseSim *self, - const gchar *pin, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_base_sim_send_pin_finish (MMBaseSim *self, - GAsyncResult *res, - GError **error); - -void mm_base_sim_send_puk (MMBaseSim *self, - const gchar *puk, - const gchar *new_pin, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_base_sim_send_puk_finish (MMBaseSim *self, - GAsyncResult *res, - GError **error); - -void mm_base_sim_export (MMBaseSim *self); - -const gchar *mm_base_sim_get_path (MMBaseSim *sim); +void mm_base_sim_new (MMBaseModem *modem, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +MMBaseSim *mm_base_sim_new_finish (GAsyncResult *res, + GError **error); + +void mm_base_sim_initialize (MMBaseSim *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_base_sim_initialize_finish (MMBaseSim *self, + GAsyncResult *result, + GError **error); + +void mm_base_sim_send_pin (MMBaseSim *self, + const gchar *pin, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_base_sim_send_pin_finish (MMBaseSim *self, + GAsyncResult *res, + GError **error); + +void mm_base_sim_send_puk (MMBaseSim *self, + const gchar *puk, + const gchar *new_pin, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_base_sim_send_puk_finish (MMBaseSim *self, + GAsyncResult *res, + GError **error); + +void mm_base_sim_export (MMBaseSim *self); + +const gchar *mm_base_sim_get_path (MMBaseSim *sim); + +void mm_base_sim_load_sim_identifier (MMBaseSim *self, + GAsyncReadyCallback callback, + gpointer user_data); +gchar *mm_base_sim_load_sim_identifier_finish (MMBaseSim *self, + GAsyncResult *res, + GError **error); #endif /* MM_BASE_SIM_H */ diff -Nru modemmanager-1.6.8/src/mm-base-sms.c modemmanager-1.10.0/src/mm-base-sms.c --- modemmanager-1.6.8/src/mm-base-sms.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-sms.c 2019-01-15 15:57:35.000000000 +0100 @@ -215,10 +215,8 @@ } /* Free array (not contents, which were taken for the part) */ - if (split_text) - g_free (split_text); - if (split_data) - g_free (split_data); + g_free (split_text); + g_free (split_data); /* Set additional multipart specific properties */ if (n_parts > 1) { @@ -830,9 +828,7 @@ /* Store the SMS */ typedef struct { - MMBaseSms *self; MMBaseModem *modem; - GSimpleAsyncResult *result; MMSmsStorage storage; gboolean need_unlock; gboolean use_pdu_mode; @@ -841,15 +837,12 @@ } SmsStoreContext; static void -sms_store_context_complete_and_free (SmsStoreContext *ctx) +sms_store_context_free (SmsStoreContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); /* Unlock mem2 storage if we had the lock */ if (ctx->need_unlock) mm_broadband_modem_unlock_sms_storages (MM_BROADBAND_MODEM (ctx->modem), FALSE, TRUE); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx->msg_data); g_free (ctx); } @@ -859,16 +852,17 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void sms_store_next_part (SmsStoreContext *ctx); +static void sms_store_next_part (GTask *task); static void store_msg_data_ready (MMBaseModem *modem, GAsyncResult *res, - SmsStoreContext *ctx) + GTask *task) { + SmsStoreContext *ctx; const gchar *response; GError *error = NULL; gint rv; @@ -876,72 +870,76 @@ response = mm_base_modem_at_command_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Read the new part index from the reply */ rv = sscanf (response, "+CMGW: %d", &idx); if (rv != 1 || idx < 0) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't read index of already stored part: " - "%d fields parsed", - rv); - sms_store_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't read index of already stored part: " + "%d fields parsed", + rv); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Set the index in the part we hold */ mm_sms_part_set_index ((MMSmsPart *)ctx->current->data, (guint)idx); ctx->current = g_list_next (ctx->current); - sms_store_next_part (ctx); + sms_store_next_part (task); } static void store_ready (MMBaseModem *modem, GAsyncResult *res, - SmsStoreContext *ctx) + GTask *task) { - const gchar *response; + SmsStoreContext *ctx; GError *error = NULL; - response = mm_base_modem_at_command_finish (modem, res, &error); + mm_base_modem_at_command_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Send the actual message data */ mm_base_modem_at_command_raw (ctx->modem, ctx->msg_data, 10, FALSE, (GAsyncReadyCallback)store_msg_data_ready, - ctx); + task); } static void -sms_store_next_part (SmsStoreContext *ctx) +sms_store_next_part (GTask *task) { + SmsStoreContext *ctx; gchar *cmd; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!ctx->current) { /* Done we are */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_store_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - if (ctx->msg_data) { - g_free (ctx->msg_data); - ctx->msg_data = NULL; - } + g_clear_pointer (&ctx->msg_data, g_free); if (!sms_get_store_or_send_command ((MMSmsPart *)ctx->current->data, ctx->use_pdu_mode, @@ -949,8 +947,8 @@ &cmd, &ctx->msg_data, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -962,30 +960,35 @@ 10, FALSE, (GAsyncReadyCallback)store_ready, - ctx); + task); g_free (cmd); } static void store_lock_sms_storages_ready (MMBroadbandModem *modem, GAsyncResult *res, - SmsStoreContext *ctx) + GTask *task) { + MMBaseSms *self; + SmsStoreContext *ctx; GError *error = NULL; if (!mm_broadband_modem_lock_sms_storages_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* We are now locked. Whatever result we have here, we need to make sure * we unlock the storages before finishing. */ ctx->need_unlock = TRUE; /* Go on to store the parts */ - ctx->current = ctx->self->priv->parts; - sms_store_next_part (ctx); + ctx->current = self->priv->parts; + sms_store_next_part (task); } static void @@ -995,14 +998,10 @@ gpointer user_data) { SmsStoreContext *ctx; + GTask *task; /* Setup the context */ ctx = g_new0 (SmsStoreContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_store); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (self->priv->modem); ctx->storage = storage; @@ -1011,6 +1010,9 @@ MM_IFACE_MODEM_MESSAGING_SMS_PDU_MODE, &ctx->use_pdu_mode, NULL); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_store_context_free); + /* First, lock storage to use */ g_assert (MM_IS_BROADBAND_MODEM (self->priv->modem)); mm_broadband_modem_lock_sms_storages ( @@ -1018,16 +1020,14 @@ MM_SMS_STORAGE_UNKNOWN, /* none required for mem1 */ ctx->storage, (GAsyncReadyCallback)store_lock_sms_storages_ready, - ctx); + task); } /*****************************************************************************/ /* Send the SMS */ typedef struct { - MMBaseSms *self; MMBaseModem *modem; - GSimpleAsyncResult *result; gboolean need_unlock; gboolean from_storage; gboolean use_pdu_mode; @@ -1036,15 +1036,12 @@ } SmsSendContext; static void -sms_send_context_complete_and_free (SmsSendContext *ctx) +sms_send_context_free (SmsSendContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); /* Unlock mem2 storage if we had the lock */ if (ctx->need_unlock) mm_broadband_modem_unlock_sms_storages (MM_BROADBAND_MODEM (ctx->modem), FALSE, TRUE); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx->msg_data); g_free (ctx); } @@ -1054,10 +1051,10 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void sms_send_next_part (SmsSendContext *ctx); +static void sms_send_next_part (GTask *task); static gint read_message_reference_from_reply (const gchar *response, @@ -1087,70 +1084,79 @@ static void send_generic_msg_data_ready (MMBaseModem *modem, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; GError *error = NULL; const gchar *response; gint message_reference; response = mm_base_modem_at_command_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } message_reference = read_message_reference_from_reply (response, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + mm_sms_part_set_message_reference ((MMSmsPart *)ctx->current->data, (guint)message_reference); ctx->current = g_list_next (ctx->current); - sms_send_next_part (ctx); + sms_send_next_part (task); } static void send_generic_ready (MMBaseModem *modem, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; GError *error = NULL; mm_base_modem_at_command_finish (modem, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Send the actual message data */ mm_base_modem_at_command_raw (ctx->modem, ctx->msg_data, 10, FALSE, (GAsyncReadyCallback)send_generic_msg_data_ready, - ctx); + task); } static void send_from_storage_ready (MMBaseModem *modem, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; GError *error = NULL; const gchar *response; gint message_reference; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (modem, res, &error); if (error) { if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1159,14 +1165,14 @@ g_error_free (error); ctx->from_storage = FALSE; - sms_send_next_part (ctx); + sms_send_next_part (task); return; } message_reference = read_message_reference_from_reply (response, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1174,19 +1180,22 @@ (guint)message_reference); ctx->current = g_list_next (ctx->current); - sms_send_next_part (ctx); + sms_send_next_part (task); } static void -sms_send_next_part (SmsSendContext *ctx) +sms_send_next_part (GTask *task) { + SmsSendContext *ctx; GError *error = NULL; gchar *cmd; + ctx = g_task_get_task_data (task); + if (!ctx->current) { /* Done we are */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_send_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1199,17 +1208,14 @@ 30, FALSE, (GAsyncReadyCallback)send_from_storage_ready, - ctx); + task); g_free (cmd); return; } /* Generic send */ - if (ctx->msg_data) { - g_free (ctx->msg_data); - ctx->msg_data = NULL; - } + g_clear_pointer (&ctx->msg_data, g_free); if (!sms_get_store_or_send_command ((MMSmsPart *)ctx->current->data, ctx->use_pdu_mode, @@ -1217,8 +1223,8 @@ &cmd, &ctx->msg_data, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1229,30 +1235,35 @@ 30, FALSE, (GAsyncReadyCallback)send_generic_ready, - ctx); + task); g_free (cmd); } static void send_lock_sms_storages_ready (MMBroadbandModem *modem, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + MMBaseSms *self; + SmsSendContext *ctx; GError *error = NULL; if (!mm_broadband_modem_lock_sms_storages_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* We are now locked. Whatever result we have here, we need to make sure * we unlock the storages before finishing. */ ctx->need_unlock = TRUE; /* Go on to send the parts */ - ctx->current = ctx->self->priv->parts; - sms_send_next_part (ctx); + ctx->current = self->priv->parts; + sms_send_next_part (task); } static void @@ -1261,16 +1272,15 @@ gpointer user_data) { SmsSendContext *ctx; + GTask *task; /* Setup the context */ ctx = g_new0 (SmsSendContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_send); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (self->priv->modem); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_send_context_free); + /* If the SMS is STORED, try to send from storage */ ctx->from_storage = (mm_base_sms_get_storage (self) != MM_SMS_STORAGE_UNKNOWN); if (ctx->from_storage) { @@ -1281,7 +1291,7 @@ MM_SMS_STORAGE_UNKNOWN, /* none required for mem1 */ mm_base_sms_get_storage (self), (GAsyncReadyCallback)send_lock_sms_storages_ready, - ctx); + task); return; } @@ -1290,30 +1300,25 @@ MM_IFACE_MODEM_MESSAGING_SMS_PDU_MODE, &ctx->use_pdu_mode, NULL); ctx->current = self->priv->parts; - sms_send_next_part (ctx); + sms_send_next_part (task); } /*****************************************************************************/ typedef struct { - MMBaseSms *self; MMBaseModem *modem; - GSimpleAsyncResult *result; gboolean need_unlock; GList *current; guint n_failed; } SmsDeletePartsContext; static void -sms_delete_parts_context_complete_and_free (SmsDeletePartsContext *ctx) +sms_delete_parts_context_free (SmsDeletePartsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); /* Unlock mem1 storage if we had the lock */ if (ctx->need_unlock) mm_broadband_modem_unlock_sms_storages (MM_BROADBAND_MODEM (ctx->modem), TRUE, FALSE); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_free (ctx); } @@ -1322,18 +1327,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void delete_next_part (SmsDeletePartsContext *ctx); +static void delete_next_part (GTask *task); static void delete_part_ready (MMBaseModem *modem, GAsyncResult *res, - SmsDeletePartsContext *ctx) + GTask *task) { + SmsDeletePartsContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_finish (modem, res, &error); if (error) { ctx->n_failed++; @@ -1347,14 +1355,17 @@ mm_sms_part_set_index ((MMSmsPart *)ctx->current->data, SMS_PART_INVALID_INDEX); ctx->current = g_list_next (ctx->current); - delete_next_part (ctx); + delete_next_part (task); } static void -delete_next_part (SmsDeletePartsContext *ctx) +delete_next_part (GTask *task) { + SmsDeletePartsContext *ctx; gchar *cmd; + ctx = g_task_get_task_data (task); + /* Skip non-stored parts */ while (ctx->current && mm_sms_part_get_index ((MMSmsPart *)ctx->current->data) == SMS_PART_INVALID_INDEX) @@ -1363,15 +1374,15 @@ /* If all removed, we're done */ if (!ctx->current) { if (ctx->n_failed > 0) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't delete %u parts from this SMS", - ctx->n_failed); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't delete %u parts from this SMS", + ctx->n_failed); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - sms_delete_parts_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -1382,30 +1393,35 @@ 10, FALSE, (GAsyncReadyCallback)delete_part_ready, - ctx); + task); g_free (cmd); } static void delete_lock_sms_storages_ready (MMBroadbandModem *modem, GAsyncResult *res, - SmsDeletePartsContext *ctx) + GTask *task) { + MMBaseSms *self; + SmsDeletePartsContext *ctx; GError *error = NULL; if (!mm_broadband_modem_lock_sms_storages_finish (modem, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_delete_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* We are now locked. Whatever result we have here, we need to make sure * we unlock the storages before finishing. */ ctx->need_unlock = TRUE; /* Go on deleting parts */ - ctx->current = ctx->self->priv->parts; - delete_next_part (ctx); + ctx->current = self->priv->parts; + delete_next_part (task); } static void @@ -1414,19 +1430,18 @@ gpointer user_data) { SmsDeletePartsContext *ctx; + GTask *task; ctx = g_new0 (SmsDeletePartsContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_delete); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (self->priv->modem); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_delete_parts_context_free); + if (mm_base_sms_get_storage (self) == MM_SMS_STORAGE_UNKNOWN) { mm_dbg ("Not removing parts from non-stored SMS"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_delete_parts_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1436,7 +1451,7 @@ mm_base_sms_get_storage (self), MM_SMS_STORAGE_UNKNOWN, /* none required for mem2 */ (GAsyncReadyCallback)delete_lock_sms_storages_ready, - ctx); + task); } /*****************************************************************************/ @@ -1458,13 +1473,13 @@ return deleted; } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void mm_base_sms_delete (MMBaseSms *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { if (MM_BASE_SMS_GET_CLASS (self)->delete && MM_BASE_SMS_GET_CLASS (self)->delete_finish) { @@ -1472,12 +1487,13 @@ return; } - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Deleting SMS is not supported by this modem"); + g_task_report_new_error (self, + callback, + user_data, + mm_base_sms_delete, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Deleting SMS is not supported by this modem"); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/src/mm-base-sms.h modemmanager-1.10.0/src/mm-base-sms.h --- modemmanager-1.6.8/src/mm-base-sms.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-base-sms.h 2018-11-15 09:55:53.000000000 +0100 @@ -81,7 +81,7 @@ GType mm_base_sms_get_type (void); -/* This one can be overriden by plugins */ +/* This one can be overridden by plugins */ MMBaseSms *mm_base_sms_new (MMBaseModem *modem); MMBaseSms *mm_base_sms_new_from_properties (MMBaseModem *modem, MMSmsProperties *properties, diff -Nru modemmanager-1.6.8/src/mm-bearer-list.c modemmanager-1.10.0/src/mm-bearer-list.c --- modemmanager-1.6.8/src/mm-bearer-list.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-bearer-list.c 2018-11-15 09:55:53.000000000 +0100 @@ -177,19 +177,16 @@ /*****************************************************************************/ typedef struct { - GSimpleAsyncResult *result; GList *pending; MMBaseBearer *current; } DisconnectAllContext; static void -disconnect_all_context_complete_and_free (DisconnectAllContext *ctx) +disconnect_all_context_free (DisconnectAllContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); if (ctx->current) g_object_unref (ctx->current); - g_list_free_full (ctx->pending, (GDestroyNotify) g_object_unref); + g_list_free_full (ctx->pending, g_object_unref); g_free (ctx); } @@ -198,37 +195,40 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void disconnect_next_bearer (DisconnectAllContext *ctx); +static void disconnect_next_bearer (GTask *task); static void disconnect_ready (MMBaseBearer *bearer, GAsyncResult *res, - DisconnectAllContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_base_bearer_disconnect_finish (bearer, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - disconnect_all_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - disconnect_next_bearer (ctx); + disconnect_next_bearer (task); } static void -disconnect_next_bearer (DisconnectAllContext *ctx) +disconnect_next_bearer (GTask *task) { + DisconnectAllContext *ctx; + + ctx = g_task_get_task_data (task); if (ctx->current) g_clear_object (&ctx->current); /* No more bearers? all done! */ if (!ctx->pending) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_all_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -237,7 +237,7 @@ mm_base_bearer_disconnect (ctx->current, (GAsyncReadyCallback)disconnect_ready, - ctx); + task); } void @@ -246,17 +246,20 @@ gpointer user_data) { DisconnectAllContext *ctx; + GTask *task; ctx = g_new0 (DisconnectAllContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_bearer_list_disconnect_all_bearers); /* Get a copy of the list */ - ctx->pending = g_list_copy (self->priv->bearers); - g_list_foreach (ctx->pending, (GFunc) g_object_ref, NULL); + ctx->pending = g_list_copy_deep (self->priv->bearers, + (GCopyFunc)g_object_ref, + NULL); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, + ctx, + (GDestroyNotify)disconnect_all_context_free); - disconnect_next_bearer (ctx); + disconnect_next_bearer (task); } /*****************************************************************************/ @@ -339,7 +342,7 @@ MMBearerList *self = MM_BEARER_LIST (object); if (self->priv->bearers) { - g_list_free_full (self->priv->bearers, (GDestroyNotify) g_object_unref); + g_list_free_full (self->priv->bearers, g_object_unref); self->priv->bearers = NULL; } diff -Nru modemmanager-1.6.8/src/mm-bearer-mbim.c modemmanager-1.10.0/src/mm-bearer-mbim.c --- modemmanager-1.6.8/src/mm-bearer-mbim.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-bearer-mbim.c 2019-01-15 15:57:35.000000000 +0100 @@ -70,12 +70,13 @@ port = mm_base_modem_peek_port_mbim (modem); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek MBIM port"); + g_task_report_new_error (self, + callback, + user_data, + peek_ports, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek MBIM port"); g_object_unref (modem); return FALSE; } @@ -89,12 +90,13 @@ /* Grab a data port */ port = mm_base_modem_peek_best_data_port (modem, MM_PORT_TYPE_NET); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No valid data port found to launch connection"); + g_task_report_new_error (self, + callback, + user_data, + peek_ports, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No valid data port found to launch connection"); g_object_unref (modem); return FALSE; } @@ -114,21 +116,6 @@ guint64 tx_bytes; } ReloadStatsResult; -typedef struct { - MMBearerMbim *self; - GSimpleAsyncResult *result; - ReloadStatsResult stats; -} ReloadStatsContext; - -static void -reload_stats_context_complete_and_free (ReloadStatsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (ReloadStatsContext, ctx); -} - static gboolean reload_stats_finish (MMBaseBearer *bearer, guint64 *rx_bytes, @@ -138,21 +125,23 @@ { ReloadStatsResult *stats; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + stats = g_task_propagate_pointer (G_TASK (res), error); + if (!stats) return FALSE; - stats = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); if (rx_bytes) *rx_bytes = stats->rx_bytes; if (tx_bytes) *tx_bytes = stats->tx_bytes; + + g_free (stats); return TRUE; } static void packet_statistics_query_ready (MbimDevice *device, GAsyncResult *res, - ReloadStatsContext *ctx) + GTask *task) { GError *error = NULL; MbimMessage *response; @@ -174,14 +163,22 @@ NULL, /* out_discards */ &error)) { /* Store results */ - ctx->stats.rx_bytes = in_octets; - ctx->stats.tx_bytes = out_octets; - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->stats, NULL); + ReloadStatsResult *stats; + + stats = g_new (ReloadStatsResult, 1); + stats->rx_bytes = in_octets; + stats->tx_bytes = out_octets; + g_task_return_pointer (task, stats, g_free); + } else if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_OPERATION_NOT_ALLOWED)) { + g_clear_error (&error); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "operation not allowed"); } else - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); - reload_stats_context_complete_and_free (ctx); - mbim_message_unref (response); + g_object_unref (task); + + if (response) + mbim_message_unref (response); } static void @@ -190,26 +187,20 @@ gpointer user_data) { MbimDevice *device; - ReloadStatsContext *ctx; MbimMessage *message; + GTask *task; if (!peek_ports (self, &device, NULL, callback, user_data)) return; - ctx = g_slice_new0 (ReloadStatsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - reload_stats); - + task = g_task_new (self, NULL, callback, user_data); message = (mbim_message_packet_statistics_query_new (NULL)); mbim_device_command (device, message, 5, NULL, (GAsyncReadyCallback)packet_statistics_query_ready, - ctx); + task); mbim_message_unref (message); } @@ -220,16 +211,15 @@ CONNECT_STEP_FIRST, CONNECT_STEP_PACKET_SERVICE, CONNECT_STEP_PROVISIONED_CONTEXTS, + CONNECT_STEP_CHECK_DISCONNECTED, + CONNECT_STEP_ENSURE_DISCONNECTED, CONNECT_STEP_CONNECT, CONNECT_STEP_IP_CONFIGURATION, CONNECT_STEP_LAST } ConnectStep; typedef struct { - MMBearerMbim *self; MbimDevice *device; - GSimpleAsyncResult *result; - GCancellable *cancellable; MMBearerProperties *properties; ConnectStep step; MMPort *data; @@ -238,17 +228,13 @@ } ConnectContext; static void -connect_context_complete_and_free (ConnectContext *ctx) +connect_context_free (ConnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); if (ctx->connect_result) mm_bearer_connect_result_unref (ctx->connect_result); g_object_unref (ctx->data); - g_object_unref (ctx->cancellable); g_object_unref (ctx->properties); g_object_unref (ctx->device); - g_object_unref (ctx->self); g_slice_free (ConnectContext, ctx); } @@ -257,19 +243,17 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } -static void connect_context_step (ConnectContext *ctx); +static void connect_context_step (GTask *task); static void ip_configuration_query_ready (MbimDevice *device, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; MbimMessage *response; MbimIPConfigurationAvailableFlag ipv4configurationavailable; @@ -287,6 +271,8 @@ guint32 ipv4mtu; guint32 ipv6mtu; + ctx = g_task_get_task_data (task); + response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -319,7 +305,7 @@ mm_dbg ("IPv4 configuration available: '%s'", str); g_free (str); - if (ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS) { + if ((ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS) && ipv4addresscount) { guint i; mm_dbg (" IP addresses (%u)", ipv4addresscount); @@ -332,7 +318,7 @@ } } - if (ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_GATEWAY) { + if ((ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_GATEWAY) && ipv4gateway) { addr = g_inet_address_new_from_bytes ((guint8 *)ipv4gateway, G_SOCKET_FAMILY_IPV4); str = g_inet_address_to_string (addr); mm_dbg (" Gateway: '%s'", str); @@ -340,7 +326,7 @@ g_object_unref (addr); } - if (ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) { + if ((ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) && ipv4dnsservercount) { guint i; mm_dbg (" DNS addresses (%u)", ipv4dnsservercount); @@ -355,7 +341,7 @@ } } - if (ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU) { + if ((ipv4configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU) && ipv4mtu) { mm_dbg (" MTU: '%u'", ipv4mtu); } @@ -365,7 +351,7 @@ mm_dbg ("IPv6 configuration available: '%s'", str); g_free (str); - if (ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS) { + if ((ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS) && ipv6addresscount) { guint i; mm_dbg (" IP addresses (%u)", ipv6addresscount); @@ -378,7 +364,7 @@ } } - if (ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_GATEWAY) { + if ((ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_GATEWAY) && ipv6gateway) { addr = g_inet_address_new_from_bytes ((guint8 *)ipv6gateway, G_SOCKET_FAMILY_IPV6); str = g_inet_address_to_string (addr); mm_dbg (" Gateway: '%s'", str); @@ -386,7 +372,7 @@ g_object_unref (addr); } - if (ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) { + if ((ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) && ipv6dnsservercount) { guint i; mm_dbg (" DNS addresses (%u)", ipv6dnsservercount); @@ -401,7 +387,7 @@ } } - if (ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU) { + if ((ipv6configurationavailable & MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU) && ipv6mtu) { mm_dbg (" MTU: '%u'", ipv6mtu); } @@ -562,27 +548,30 @@ mbim_message_unref (response); if (error) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void connect_set_ready (MbimDevice *device, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; MbimMessage *response; guint32 session_id; MbimActivationState activation_state; guint32 nw_error; + ctx = g_task_get_task_data (task); + response = mbim_device_command_finish (device, res, &error); if (response && (mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || @@ -626,26 +615,96 @@ mbim_message_unref (response); if (error) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); +} + +static void +ensure_disconnected_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + ConnectContext *ctx; + MbimMessage *response; + + ctx = g_task_get_task_data (task); + + /* Ignore all errors, just go on */ + response = mbim_device_command_finish (device, res, NULL); + if (response) + mbim_message_unref (response); + + /* Keep on */ + ctx->step++; + connect_context_step (task); +} + +static void +check_disconnected_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + ConnectContext *ctx; + GError *error = NULL; + MbimMessage *response; + guint32 session_id; + MbimActivationState activation_state; + + ctx = g_task_get_task_data (task); + + response = mbim_device_command_finish (device, res, &error); + if (response && + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && + mbim_message_connect_response_parse ( + response, + &session_id, + &activation_state, + NULL, /* voice_call_state */ + NULL, /* ip_type */ + NULL, /* context_type */ + NULL, /* nw_error */ + &error)) { + mm_dbg ("Session ID '%u': %s", session_id, mbim_activation_state_get_string (activation_state)); + } else + activation_state = MBIM_ACTIVATION_STATE_UNKNOWN; + + if (response) + mbim_message_unref (response); + + /* Some modem (e.g. Huawei ME936) reports MBIM_ACTIVATION_STATE_UNKNOWN + * when being queried for the activation state before an IP session has + * been activated once. Here we expect a modem would at least tell the + * truth when the session has been activated, so we proceed to deactivate + * the session only the modem indicates the session has been activated or + * is being activated. + */ + if (activation_state == MBIM_ACTIVATION_STATE_ACTIVATED || activation_state == MBIM_ACTIVATION_STATE_ACTIVATING) + ctx->step = CONNECT_STEP_ENSURE_DISCONNECTED; + else + ctx->step = CONNECT_STEP_CONNECT; + + connect_context_step (task); } static void provisioned_contexts_query_ready (MbimDevice *device, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; MbimMessage *response; guint32 provisioned_contexts_count; MbimProvisionedContextElement **provisioned_contexts; + ctx = g_task_get_task_data (task); + response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -683,14 +742,15 @@ /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void packet_service_set_ready (MbimDevice *device, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; MbimMessage *response; guint32 nw_error; @@ -699,6 +759,8 @@ guint64 uplink_speed; guint64 downlink_speed; + ctx = g_task_get_task_data (task); + response = mbim_device_command_finish (device, res, &error); if (response && (mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || @@ -748,32 +810,33 @@ g_error_free (error); } else { /* All other errors are fatal */ - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } } /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void -connect_context_step (ConnectContext *ctx) +connect_context_step (GTask *task) { + MMBearerMbim *self; + ConnectContext *ctx; MbimMessage *message; /* If cancelled, complete */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - connect_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case CONNECT_STEP_FIRST: /* Fall down */ @@ -787,8 +850,8 @@ MBIM_PACKET_SERVICE_ACTION_ATTACH, &error)); if (!message) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -797,7 +860,7 @@ 30, NULL, (GAsyncReadyCallback)packet_service_set_ready, - ctx); + task); mbim_message_unref (message); return; } @@ -810,10 +873,67 @@ 10, NULL, (GAsyncReadyCallback)provisioned_contexts_query_ready, - ctx); + task); mbim_message_unref (message); return; + case CONNECT_STEP_CHECK_DISCONNECTED: { + GError *error = NULL; + + message = (mbim_message_connect_query_new ( + self->priv->session_id, + MBIM_ACTIVATION_STATE_UNKNOWN, + MBIM_VOICE_CALL_STATE_NONE, + MBIM_CONTEXT_IP_TYPE_DEFAULT, + mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET), + 0, + &error)); + if (!message) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mbim_device_command (ctx->device, + message, + 10, + NULL, + (GAsyncReadyCallback)check_disconnected_ready, + task); + mbim_message_unref (message); + return; + } + + case CONNECT_STEP_ENSURE_DISCONNECTED: { + GError *error = NULL; + + message = (mbim_message_connect_set_new ( + self->priv->session_id, + MBIM_ACTIVATION_COMMAND_DEACTIVATE, + "", + "", + "", + MBIM_COMPRESSION_NONE, + MBIM_AUTH_PROTOCOL_NONE, + MBIM_CONTEXT_IP_TYPE_DEFAULT, + mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET), + &error)); + if (!message) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mbim_device_command (ctx->device, + message, + 60, + NULL, + (GAsyncReadyCallback)ensure_disconnected_ready, + task); + mbim_message_unref (message); + return; + } + case CONNECT_STEP_CONNECT: { const gchar *apn; const gchar *user; @@ -832,30 +952,12 @@ auth = MBIM_AUTH_PROTOCOL_NONE; } else { MMBearerAllowedAuth bearer_auth; - bearer_auth = mm_bearer_properties_get_allowed_auth (ctx->properties); - if (bearer_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) { - mm_dbg ("Using default (PAP) authentication method"); - auth = MBIM_AUTH_PROTOCOL_PAP; - } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_PAP) { - auth = MBIM_AUTH_PROTOCOL_PAP; - } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_CHAP) { - auth = MBIM_AUTH_PROTOCOL_CHAP; - } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_MSCHAPV2) { - auth = MBIM_AUTH_PROTOCOL_MSCHAPV2; - } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_NONE) { - auth = MBIM_AUTH_PROTOCOL_NONE; - } else { - gchar *str; - str = mm_bearer_allowed_auth_build_string_from_mask (bearer_auth); - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot use any of the specified authentication methods (%s)", - str); - g_free (str); - connect_context_complete_and_free (ctx); + bearer_auth = mm_bearer_properties_get_allowed_auth (ctx->properties); + auth = mm_bearer_allowed_auth_to_mbim_auth_protocol (bearer_auth, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); return; } } @@ -865,42 +967,22 @@ ip_family == MM_BEARER_IP_FAMILY_ANY) { gchar * str; - ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (ctx->self)); + ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (self)); str = mm_bearer_ip_family_build_string_from_mask (ip_family); mm_dbg ("No specific IP family requested, defaulting to %s", str); g_free (str); } - if (ip_family == MM_BEARER_IP_FAMILY_IPV4) - ctx->ip_type = MBIM_CONTEXT_IP_TYPE_IPV4; - else if (ip_family == MM_BEARER_IP_FAMILY_IPV6) - ctx->ip_type = MBIM_CONTEXT_IP_TYPE_IPV6; - else if (ip_family == MM_BEARER_IP_FAMILY_IPV4V6) - ctx->ip_type = MBIM_CONTEXT_IP_TYPE_IPV4V6; - else if (ip_family == (MM_BEARER_IP_FAMILY_IPV4 | MM_BEARER_IP_FAMILY_IPV6)) - ctx->ip_type = MBIM_CONTEXT_IP_TYPE_IPV4_AND_IPV6; - else if (ip_family == MM_BEARER_IP_FAMILY_NONE || - ip_family == MM_BEARER_IP_FAMILY_ANY) - /* A valid default IP family should have been specified */ - g_assert_not_reached (); - else { - gchar * str; - - str = mm_bearer_ip_family_build_string_from_mask (ip_family); - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Unsupported IP type configuration: '%s'", - str); - g_free (str); - connect_context_complete_and_free (ctx); + ctx->ip_type = mm_bearer_ip_family_to_mbim_context_ip_type (ip_family, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); return; } mm_dbg ("Launching %s connection with APN '%s'...", mbim_context_ip_type_get_string (ctx->ip_type), apn); message = (mbim_message_connect_set_new ( - ctx->self->priv->session_id, + self->priv->session_id, MBIM_ACTIVATION_COMMAND_ACTIVATE, apn ? apn : "", user ? user : "", @@ -911,8 +993,8 @@ mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET), &error)); if (!message) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -921,7 +1003,7 @@ 60, NULL, (GAsyncReadyCallback)connect_set_ready, - ctx); + task); mbim_message_unref (message); return; } @@ -931,7 +1013,7 @@ mm_dbg ("Querying IP configuration..."); message = (mbim_message_ip_configuration_query_new ( - ctx->self->priv->session_id, + self->priv->session_id, MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_NONE, /* ipv4configurationavailable */ MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_NONE, /* ipv6configurationavailable */ 0, /* ipv4addresscount */ @@ -948,8 +1030,8 @@ 0, /* ipv6mtu */ &error)); if (!message) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -958,7 +1040,7 @@ 60, NULL, (GAsyncReadyCallback)ip_configuration_query_ready, - ctx); + task); mbim_message_unref (message); return; } @@ -968,15 +1050,15 @@ mm_port_set_connected (MM_PORT (ctx->data), TRUE); /* Keep the data port */ - g_assert (ctx->self->priv->data == NULL); - ctx->self->priv->data = g_object_ref (ctx->data); + g_assert (self->priv->data == NULL); + self->priv->data = g_object_ref (ctx->data); /* Set operation result */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, + g_task_return_pointer ( + task, mm_bearer_connect_result_ref (ctx->connect_result), (GDestroyNotify)mm_bearer_connect_result_unref); - connect_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -994,6 +1076,7 @@ MbimDevice *device; MMBaseModem *modem = NULL; const gchar *apn; + GTask *task; if (!peek_ports (self, &device, &data, callback, user_data)) return; @@ -1008,10 +1091,11 @@ /* Is this a 3GPP only modem and no APN was given? If so, error */ if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + _connect, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "3GPP connection logic requires APN setting"); @@ -1026,22 +1110,19 @@ mm_port_get_device (data)); ctx = g_slice_new0 (ConnectContext); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device);; ctx->data = g_object_ref (data); - ctx->cancellable = g_object_ref (cancellable); ctx->step = CONNECT_STEP_FIRST; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - _connect); g_object_get (self, MM_BASE_BEARER_CONFIG, &ctx->properties, NULL); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)connect_context_free); + /* Run! */ - connect_context_step (ctx); + connect_context_step (task); } /*****************************************************************************/ @@ -1054,20 +1135,15 @@ } DisconnectStep; typedef struct { - MMBearerMbim *self; MbimDevice *device; - GSimpleAsyncResult *result; MMPort *data; DisconnectStep step; } DisconnectContext; static void -disconnect_context_complete_and_free (DisconnectContext *ctx) +disconnect_context_free (DisconnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->data); - g_object_unref (ctx->self); g_slice_free (DisconnectContext, ctx); } @@ -1076,7 +1152,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -1088,82 +1164,105 @@ } } -static void disconnect_context_step (DisconnectContext *ctx); +static void disconnect_context_step (GTask *task); static void disconnect_set_ready (MbimDevice *device, GAsyncResult *res, - DisconnectContext *ctx) + GTask *task) { + DisconnectContext *ctx; GError *error = NULL; MbimMessage *response; guint32 session_id; MbimActivationState activation_state; guint32 nw_error; + GError *inner_error = NULL; + gboolean result = FALSE, parsed_result = FALSE; + + ctx = g_task_get_task_data (task); response = mbim_device_command_finish (device, res, &error); - if (response) { - GError *inner_error = NULL; - gboolean result = FALSE, parsed_result = FALSE; + if (!response) + goto out; - result = mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); - /* Parse the response only for the cases we need to */ - if (result || - g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) || - g_error_matches (error, MBIM_STATUS_ERROR, - MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED)) { - parsed_result = mbim_message_connect_response_parse ( - response, - &session_id, - &activation_state, - NULL, /* voice_call_state */ - NULL, /* ip_type */ - NULL, /* context_type */ - &nw_error, - &inner_error); - } - - /* Now handle different response / error cases */ - if (result && parsed_result) { - mm_dbg ("Session ID '%u': %s", - session_id, - mbim_activation_state_get_string (activation_state)); - } else if (g_error_matches (error, - MBIM_STATUS_ERROR, - MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED)) { - mm_dbg ("Session ID '%u' already disconnected.", session_id); - g_clear_error (&error); - g_clear_error (&inner_error); - } else if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE)) { - if (nw_error) { - g_error_free (error); - error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error); - } - } /* else: For other errors, give precedence to error over nw_error */ + result = mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + /* Parse the response only for the cases we need to */ + if (result || + g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) || + g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED)) { + parsed_result = mbim_message_connect_response_parse ( + response, + &session_id, + &activation_state, + NULL, /* voice_call_state */ + NULL, /* ip_type */ + NULL, /* context_type */ + &nw_error, + &inner_error); + } + + /* Now handle different response / error cases */ + + if (result && parsed_result) { + g_assert (!error); + g_assert (!inner_error); + mm_dbg ("Session ID '%u': %s", session_id, mbim_activation_state_get_string (activation_state)); + /* success */ + goto out; + } + + if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED)) { + if (parsed_result) + mm_dbg ("Context not activated: session ID '%u' already disconnected", session_id); + else + mm_dbg ("Context not activated: already disconnected"); - /* Give precedence to original error over parsing error */ - if (!error && inner_error) - error = g_error_copy (inner_error); + g_clear_error (&error); g_clear_error (&inner_error); + /* success */ + goto out; } + if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) && parsed_result && nw_error != 0) { + g_assert (!inner_error); + g_error_free (error); + error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error); + /* error out with nw_error error */ + goto out; + } + + /* Give precedence to original error over parsing error */ + if (!error && inner_error) + error = g_error_copy (inner_error); + g_clear_error (&inner_error); + +out: + if (response) mbim_message_unref (response); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Keep on */ ctx->step++; - disconnect_context_step (ctx); + disconnect_context_step (task); } static void -disconnect_context_step (DisconnectContext *ctx) +disconnect_context_step (GTask *task) { + MMBearerMbim *self; + DisconnectContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISCONNECT_STEP_FIRST: /* Fall down */ @@ -1174,7 +1273,7 @@ GError *error = NULL; message = (mbim_message_connect_set_new ( - ctx->self->priv->session_id, + self->priv->session_id, MBIM_ACTIVATION_COMMAND_DEACTIVATE, "", "", @@ -1185,27 +1284,27 @@ mbim_uuid_from_context_type (MBIM_CONTEXT_TYPE_INTERNET), &error)); if (!message) { - g_simple_async_result_take_error (ctx->result, error); - disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } mbim_device_command (ctx->device, message, - 30, + 60, NULL, (GAsyncReadyCallback)disconnect_set_ready, - ctx); + task); mbim_message_unref (message); return; } case DISCONNECT_STEP_LAST: /* Port is disconnected; update the state */ - reset_bearer_connection (ctx->self); + reset_bearer_connection (self); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } } @@ -1218,12 +1317,14 @@ MMBearerMbim *self = MM_BEARER_MBIM (_self); MbimDevice *device; DisconnectContext *ctx; + GTask *task; if (!self->priv->data) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + disconnect, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't disconnect MBIM bearer: this bearer is not connected"); @@ -1238,17 +1339,15 @@ mm_port_get_device (self->priv->data)); ctx = g_slice_new0 (DisconnectContext); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device); ctx->data = g_object_ref (self->priv->data); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect); ctx->step = DISCONNECT_STEP_FIRST; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disconnect_context_free); + /* Run! */ - disconnect_context_step (ctx); + disconnect_context_step (task); } /*****************************************************************************/ @@ -1375,6 +1474,8 @@ base_bearer_class->report_connection_status = report_connection_status; base_bearer_class->reload_stats = reload_stats; base_bearer_class->reload_stats_finish = reload_stats_finish; + base_bearer_class->load_connection_status = NULL; + base_bearer_class->load_connection_status_finish = NULL; properties[PROP_SESSION_ID] = g_param_spec_uint (MM_BEARER_MBIM_SESSION_ID, diff -Nru modemmanager-1.6.8/src/mm-bearer-qmi.c modemmanager-1.10.0/src/mm-bearer-qmi.c --- modemmanager-1.6.8/src/mm-bearer-qmi.c 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/src/mm-bearer-qmi.c 2018-11-15 09:55:53.000000000 +0100 @@ -69,8 +69,6 @@ } ReloadStatsResult; typedef struct { - MMBearerQmi *self; - GSimpleAsyncResult *result; QmiMessageWdsGetPacketStatisticsInput *input; ReloadStatsContextStep step; ReloadStatsResult stats; @@ -85,52 +83,54 @@ { ReloadStatsResult *stats; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + stats = g_task_propagate_pointer (G_TASK (res), error); + if (!stats) return FALSE; - stats = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); if (rx_bytes) *rx_bytes = stats->rx_bytes; if (tx_bytes) *tx_bytes = stats->tx_bytes; + + g_free (stats); return TRUE; } static void -reload_stats_context_complete_and_free (ReloadStatsContext *ctx) +reload_stats_context_free (ReloadStatsContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); qmi_message_wds_get_packet_statistics_input_unref (ctx->input); g_slice_free (ReloadStatsContext, ctx); } -static void reload_stats_context_step (ReloadStatsContext *ctx); +static void reload_stats_context_step (GTask *task); static void get_packet_statistics_ready (QmiClientWds *client, GAsyncResult *res, - ReloadStatsContext *ctx) + GTask *task) { + ReloadStatsContext *ctx; GError *error = NULL; QmiMessageWdsGetPacketStatisticsOutput *output; guint64 tx_bytes_ok = 0; guint64 rx_bytes_ok = 0; + ctx = g_task_get_task_data (task); + output = qmi_client_wds_get_packet_statistics_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - reload_stats_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_wds_get_packet_statistics_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get packet statistics: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_wds_get_packet_statistics_output_unref (output); - reload_stats_context_complete_and_free (ctx); return; } @@ -143,43 +143,51 @@ /* Go on */ ctx->step++; - reload_stats_context_step (ctx); + reload_stats_context_step (task); } static void -reload_stats_context_step (ReloadStatsContext *ctx) +reload_stats_context_step (GTask *task) { + MMBearerQmi *self; + ReloadStatsContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case RELOAD_STATS_CONTEXT_STEP_FIRST: /* Fall through */ ctx->step++; case RELOAD_STATS_CONTEXT_STEP_IPV4: - if (ctx->self->priv->client_ipv4) { - qmi_client_wds_get_packet_statistics (QMI_CLIENT_WDS (ctx->self->priv->client_ipv4), + if (self->priv->client_ipv4) { + qmi_client_wds_get_packet_statistics (QMI_CLIENT_WDS (self->priv->client_ipv4), ctx->input, 10, NULL, (GAsyncReadyCallback)get_packet_statistics_ready, - ctx); + task); return; } ctx->step++; /* Fall through */ case RELOAD_STATS_CONTEXT_STEP_IPV6: - if (ctx->self->priv->client_ipv6) { - qmi_client_wds_get_packet_statistics (QMI_CLIENT_WDS (ctx->self->priv->client_ipv6), + if (self->priv->client_ipv6) { + qmi_client_wds_get_packet_statistics (QMI_CLIENT_WDS (self->priv->client_ipv6), ctx->input, 10, NULL, (GAsyncReadyCallback)get_packet_statistics_ready, - ctx); + task); return; } ctx->step++; /* Fall through */ case RELOAD_STATS_CONTEXT_STEP_LAST: - g_simple_async_result_set_op_res_gpointer (ctx->result, &ctx->stats, NULL); - reload_stats_context_complete_and_free (ctx); + g_task_return_pointer (task, + g_memdup (&ctx->stats, sizeof (ctx->stats)), + g_free); + g_object_unref (task); return; } } @@ -190,13 +198,9 @@ gpointer user_data) { ReloadStatsContext *ctx; + GTask *task; ctx = g_slice_new0 (ReloadStatsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - reload_stats); ctx->input = qmi_message_wds_get_packet_statistics_input_new (); qmi_message_wds_get_packet_statistics_input_set_mask ( ctx->input, @@ -205,7 +209,167 @@ NULL); ctx->step = RELOAD_STATS_CONTEXT_STEP_FIRST; - reload_stats_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)reload_stats_context_free); + + reload_stats_context_step (task); +} + +/*****************************************************************************/ +/* Connection status polling */ + +typedef enum { + CONNECTION_STATUS_CONTEXT_STEP_FIRST, + CONNECTION_STATUS_CONTEXT_STEP_IPV4, + CONNECTION_STATUS_CONTEXT_STEP_IPV6, + CONNECTION_STATUS_CONTEXT_STEP_LAST, +} ConnectionStatusContextStep; + +typedef struct { + ConnectionStatusContextStep step; +} ConnectionStatusContext; + +static MMBearerConnectionStatus +load_connection_status_finish (MMBaseBearer *self, + GAsyncResult *res, + GError **error) +{ + gint val; + + val = g_task_propagate_int (G_TASK (res), error); + if (val < 0) + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + + return (MMBearerConnectionStatus) val; +} + +static void connection_status_context_step (GTask *task); + +static void +get_packet_service_status_ready (QmiClientWds *client, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + QmiMessageWdsGetPacketServiceStatusOutput *output; + QmiWdsConnectionStatus status = QMI_WDS_CONNECTION_STATUS_UNKNOWN; + ConnectionStatusContext *ctx; + + output = qmi_client_wds_get_packet_service_status_finish (client, res, &error); + if (!output) + goto out; + + if (!qmi_message_wds_get_packet_service_status_output_get_result (output, &error)) + goto out; + + qmi_message_wds_get_packet_service_status_output_get_connection_status ( + output, + &status, + NULL); + + out: + if (output) + qmi_message_wds_get_packet_service_status_output_unref (output); + + /* An error checking status is reported right away */ + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Report disconnection right away */ + if (status != QMI_WDS_CONNECTION_STATUS_CONNECTED) { + g_task_return_int (task, MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + g_object_unref (task); + return; + } + + /* we're reported as connected, go on to next check if any */ + ctx = g_task_get_task_data (task); + ctx->step++; + connection_status_context_step (task); +} + +static void +connection_status_context_step (GTask *task) +{ + MMBearerQmi *self; + ConnectionStatusContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + switch (ctx->step) { + case CONNECTION_STATUS_CONTEXT_STEP_FIRST: + /* Connection status polling is an optional feature that must be + * enabled explicitly via udev tags. If not set, out as unsupported */ + if (self->priv->data && + !mm_kernel_device_get_global_property_as_boolean (mm_port_peek_kernel_device (self->priv->data), + "ID_MM_QMI_CONNECTION_STATUS_POLLING_ENABLE")) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Connection status polling not required"); + g_object_unref (task); + return; + } + /* If no clients ready on start, assume disconnected */ + if (!self->priv->client_ipv4 && !self->priv->client_ipv6) { + g_task_return_int (task, MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + g_object_unref (task); + return; + } + ctx->step++; + /* fall down to next step */ + + case CONNECTION_STATUS_CONTEXT_STEP_IPV4: + if (self->priv->client_ipv4) { + qmi_client_wds_get_packet_service_status (self->priv->client_ipv4, + NULL, + 10, + NULL, + (GAsyncReadyCallback)get_packet_service_status_ready, + task); + return; + } + ctx->step++; + /* fall down to next step */ + + case CONNECTION_STATUS_CONTEXT_STEP_IPV6: + if (self->priv->client_ipv6) { + qmi_client_wds_get_packet_service_status (self->priv->client_ipv6, + NULL, + 10, + NULL, + (GAsyncReadyCallback)get_packet_service_status_ready, + task); + return; + } + ctx->step++; + /* fall down to next step */ + + case CONNECTION_STATUS_CONTEXT_STEP_LAST: + /* All available clients are connected */ + g_task_return_int (task, MM_BEARER_CONNECTION_STATUS_CONNECTED); + g_object_unref (task); + return; + } +} + +static void +load_connection_status (MMBaseBearer *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + ConnectionStatusContext *ctx; + + ctx = g_new (ConnectionStatusContext, 1); + ctx->step = CONNECTION_STATUS_CONTEXT_STEP_FIRST; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + connection_status_context_step (task); } /*****************************************************************************/ @@ -216,11 +380,15 @@ gboolean enable, guint *indication_id); -#if QMI_CHECK_VERSION (1,18,0) +static void setup_event_report_unsolicited_events (MMBearerQmi *self, + QmiClientWds *client, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + static void cleanup_event_report_unsolicited_events (MMBearerQmi *self, QmiClientWds *client, guint *indication_id); -#endif typedef enum { CONNECT_STEP_FIRST, @@ -243,8 +411,6 @@ typedef struct { MMBearerQmi *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; ConnectStep step; MMPort *data; MMPortQmi *qmi; @@ -277,10 +443,8 @@ } ConnectContext; static void -connect_context_complete_and_free (ConnectContext *ctx) +connect_context_free (ConnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_free (ctx->apn); g_free (ctx->user); g_free (ctx->password); @@ -291,29 +455,22 @@ FALSE, &ctx->packet_service_status_ipv4_indication_id); } - -#if QMI_CHECK_VERSION (1,18,0) if (ctx->event_report_ipv4_indication_id) { cleanup_event_report_unsolicited_events (ctx->self, ctx->client_ipv4, &ctx->event_report_ipv4_indication_id); } -#endif - if (ctx->packet_service_status_ipv6_indication_id) { common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self, ctx->client_ipv6, FALSE, &ctx->packet_service_status_ipv6_indication_id); } - -#if QMI_CHECK_VERSION (1,18,0) if (ctx->event_report_ipv6_indication_id) { cleanup_event_report_unsolicited_events (ctx->self, ctx->client_ipv6, &ctx->event_report_ipv6_indication_id); } -#endif g_clear_error (&ctx->error_ipv4); g_clear_error (&ctx->error_ipv6); @@ -323,7 +480,6 @@ g_clear_object (&ctx->ipv6_config); g_object_unref (ctx->data); g_object_unref (ctx->qmi); - g_object_unref (ctx->cancellable); g_object_unref (ctx->self); g_slice_free (ConnectContext, ctx); } @@ -333,22 +489,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } -static void connect_context_step (ConnectContext *ctx); +static void connect_context_step (GTask *task); static void start_network_ready (QmiClientWds *client, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; QmiMessageWdsStartNetworkOutput *output; + ctx = g_task_get_task_data (task); g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (!(ctx->running_ipv4 && ctx->running_ipv6)); @@ -419,7 +574,7 @@ /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static QmiMessageWdsStartNetworkInput * @@ -441,7 +596,7 @@ /* Need to add auth info? */ if (has_user || has_password || ctx->auth != QMI_WDS_AUTHENTICATION_NONE) { - /* We define a valid auth preference if we have either user or password, or a explicit + /* We define a valid auth preference if we have either user or password, or an explicit * request for one to be set. If no explicit one was given, default to PAP. */ qmi_message_wds_start_network_input_set_authentication_preference ( input, @@ -663,11 +818,13 @@ static void get_current_settings_ready (QmiClientWds *client, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; QmiMessageWdsGetCurrentSettingsOutput *output; + ctx = g_task_get_task_data (task); g_assert (ctx->running_ipv4 || ctx->running_ipv6); output = qmi_client_wds_get_current_settings_finish (client, res, &error); @@ -724,15 +881,17 @@ /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void -get_current_settings (ConnectContext *ctx, QmiClientWds *client) +get_current_settings (GTask *task, QmiClientWds *client) { + ConnectContext *ctx; QmiMessageWdsGetCurrentSettingsInput *input; QmiWdsGetCurrentSettingsRequestedSettings requested; + ctx = g_task_get_task_data (task); g_assert (ctx->running_ipv4 || ctx->running_ipv6); requested = QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DNS_ADDRESS | @@ -748,20 +907,22 @@ qmi_client_wds_get_current_settings (client, input, 10, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)get_current_settings_ready, - ctx); + task); qmi_message_wds_get_current_settings_input_unref (input); } static void set_ip_family_ready (QmiClientWds *client, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; QmiMessageWdsSetIpFamilyOutput *output; + ctx = g_task_get_task_data (task); g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (!(ctx->running_ipv4 && ctx->running_ipv6)); @@ -783,7 +944,7 @@ /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void @@ -854,8 +1015,6 @@ } } -#if QMI_CHECK_VERSION (1,18,0) - static void event_report_indication_cb (QmiClientWds *client, QmiIndicationWdsEventReportOutput *output, @@ -890,37 +1049,43 @@ static void connect_enable_indications_ipv4_ready (QmiClientWds *client, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; + + ctx = g_task_get_task_data (task); g_assert (ctx->event_report_ipv4_indication_id == 0); ctx->event_report_ipv4_indication_id = connect_enable_indications_ready (client, res, ctx->self, &ctx->error_ipv4); - if (!ctx->event_report_ipv4_indication_id) { + + if (!ctx->event_report_ipv4_indication_id) ctx->step = CONNECT_STEP_LAST; - return; - } + else + ctx->step++; - ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void connect_enable_indications_ipv6_ready (QmiClientWds *client, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; + + ctx = g_task_get_task_data (task); g_assert (ctx->event_report_ipv6_indication_id == 0); ctx->event_report_ipv6_indication_id = connect_enable_indications_ready (client, res, ctx->self, &ctx->error_ipv6); - if (!ctx->event_report_ipv6_indication_id) { + + if (!ctx->event_report_ipv6_indication_id) ctx->step = CONNECT_STEP_LAST; - return; - } + else + ctx->step++; - ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static QmiMessageWdsSetEventReportInput * @@ -984,21 +1149,21 @@ qmi_message_wds_set_event_report_input_unref (input); } -#endif /* QMI_CHECK_VERSION (1,18,0) */ - static void qmi_port_allocate_client_ready (MMPortQmi *qmi, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); g_assert (ctx->running_ipv4 || ctx->running_ipv6); g_assert (!(ctx->running_ipv4 && ctx->running_ipv6)); if (!mm_port_qmi_allocate_client_finish (qmi, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1013,40 +1178,44 @@ /* Keep on */ ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void qmi_port_open_ready (MMPortQmi *qmi, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { + ConnectContext *ctx; GError *error = NULL; if (!mm_port_qmi_open_finish (qmi, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Keep on */ + ctx = g_task_get_task_data (task); ctx->step++; - connect_context_step (ctx); + connect_context_step (task); } static void -connect_context_step (ConnectContext *ctx) +connect_context_step (GTask *task) { + ConnectContext *ctx; + GCancellable *cancellable; + /* If cancelled, complete */ - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - connect_context_complete_and_free (ctx); + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + cancellable = g_task_get_cancellable (task); + switch (ctx->step) { case CONNECT_STEP_FIRST: @@ -1059,9 +1228,9 @@ if (!mm_port_qmi_is_open (ctx->qmi)) { mm_port_qmi_open (ctx->qmi, TRUE, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)qmi_port_open_ready, - ctx); + task); return; } @@ -1087,7 +1256,7 @@ /* If no IPv4 setup needed, jump to IPv6 */ if (!ctx->ipv4) { ctx->step = CONNECT_STEP_IPV6; - connect_context_step (ctx); + connect_context_step (task); return; } @@ -1109,9 +1278,9 @@ mm_port_qmi_allocate_client (ctx->qmi, QMI_SERVICE_WDS, MM_PORT_QMI_FLAG_WDS_IPV4, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)qmi_port_allocate_client_ready, - ctx); + task); return; } @@ -1132,9 +1301,9 @@ qmi_client_wds_set_ip_family (ctx->client_ipv4, input, 10, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)set_ip_family_ready, - ctx); + task); qmi_message_wds_set_ip_family_input_unref (input); return; } @@ -1149,14 +1318,11 @@ ctx->client_ipv4, TRUE, &ctx->packet_service_status_ipv4_indication_id); - -#if QMI_CHECK_VERSION (1,18,0) setup_event_report_unsolicited_events (ctx->self, ctx->client_ipv4, - ctx->cancellable, + cancellable, (GAsyncReadyCallback) connect_enable_indications_ipv4_ready, - ctx); -#endif + task); return; case CONNECT_STEP_START_NETWORK_IPV4: { @@ -1167,9 +1333,9 @@ qmi_client_wds_start_network (ctx->client_ipv4, input, 45, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)start_network_ready, - ctx); + task); qmi_message_wds_start_network_input_unref (input); return; } @@ -1178,7 +1344,7 @@ /* Retrieve and print IP configuration */ if (ctx->packet_data_handle_ipv4) { mm_dbg ("Getting IPv4 configuration..."); - get_current_settings (ctx, ctx->client_ipv4); + get_current_settings (task, ctx->client_ipv4); return; } /* Fall through */ @@ -1189,7 +1355,7 @@ /* If no IPv6 setup needed, jump to last */ if (!ctx->ipv6) { ctx->step = CONNECT_STEP_LAST; - connect_context_step (ctx); + connect_context_step (task); return; } @@ -1211,9 +1377,9 @@ mm_port_qmi_allocate_client (ctx->qmi, QMI_SERVICE_WDS, MM_PORT_QMI_FLAG_WDS_IPV6, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)qmi_port_allocate_client_ready, - ctx); + task); return; } @@ -1236,9 +1402,9 @@ qmi_client_wds_set_ip_family (ctx->client_ipv6, input, 10, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)set_ip_family_ready, - ctx); + task); qmi_message_wds_set_ip_family_input_unref (input); return; } @@ -1253,13 +1419,11 @@ ctx->client_ipv6, TRUE, &ctx->packet_service_status_ipv6_indication_id); -#if QMI_CHECK_VERSION (1,18,0) setup_event_report_unsolicited_events (ctx->self, ctx->client_ipv6, - ctx->cancellable, + cancellable, (GAsyncReadyCallback) connect_enable_indications_ipv6_ready, - ctx); -#endif + task); return; case CONNECT_STEP_START_NETWORK_IPV6: { @@ -1270,9 +1434,9 @@ qmi_client_wds_start_network (ctx->client_ipv6, input, 45, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)start_network_ready, - ctx); + task); qmi_message_wds_start_network_input_unref (input); return; } @@ -1281,7 +1445,7 @@ /* Retrieve and print IP configuration */ if (ctx->packet_data_handle_ipv6) { mm_dbg ("Getting IPv6 configuration..."); - get_current_settings (ctx, ctx->client_ipv6); + get_current_settings (task, ctx->client_ipv6); return; } /* Fall through */ @@ -1321,8 +1485,8 @@ } /* Set operation result */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, + g_task_return_pointer ( + task, mm_bearer_connect_result_new (ctx->data, ctx->ipv4_config, ctx->ipv6_config), (GDestroyNotify)mm_bearer_connect_result_unref); } else { @@ -1337,10 +1501,10 @@ ctx->error_ipv6 = NULL; } - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } - connect_context_complete_and_free (ctx); + g_object_unref (task); return; } } @@ -1358,6 +1522,7 @@ MMPortQmi *qmi; GError *error = NULL; const gchar *apn; + GTask *task; g_object_get (self, MM_BASE_BEARER_MODEM, &modem, @@ -1367,10 +1532,11 @@ /* Grab a data port */ data = mm_base_modem_get_best_data_port (modem, MM_PORT_TYPE_NET); if (!data) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + _connect, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, "No valid data port found to launch connection"); @@ -1381,10 +1547,11 @@ /* Each data port has a single QMI port associated */ qmi = mm_base_modem_get_port_qmi_for_data (modem, data, &error); if (!qmi) { - g_simple_async_report_take_gerror_in_idle ( - G_OBJECT (self), + g_task_report_error ( + self, callback, user_data, + _connect, error); g_object_unref (data); g_object_unref (modem); @@ -1396,10 +1563,11 @@ /* Is this a 3GPP only modem and no APN was given? If so, error */ if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + _connect, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "3GPP connection logic requires APN setting"); @@ -1409,10 +1577,11 @@ /* Is this a 3GPP2 only modem and APN was given? If so, error */ if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (modem)) && apn) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + _connect, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "3GPP2 doesn't support APN setting"); @@ -1432,18 +1601,16 @@ ctx->self = g_object_ref (self); ctx->qmi = qmi; ctx->data = data; - ctx->cancellable = g_object_ref (cancellable); ctx->step = CONNECT_STEP_FIRST; ctx->ip_method = MM_BEARER_IP_METHOD_UNKNOWN; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - connect); g_object_get (self, MM_BASE_BEARER_CONFIG, &properties, NULL); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)connect_context_free); + if (properties) { MMBearerAllowedAuth auth; MMBearerIpFamily ip_family; @@ -1478,14 +1645,14 @@ gchar *str; str = mm_bearer_ip_family_build_string_from_mask (ip_family); - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Unsupported IP type requested: '%s'", str); + g_object_unref (task); g_free (str); - connect_context_complete_and_free (ctx); return; } @@ -1504,20 +1671,20 @@ gchar *str; str = mm_bearer_allowed_auth_build_string_from_mask (auth); - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "Cannot use any of the specified authentication methods (%s)", str); + g_object_unref (task); g_free (str); - connect_context_complete_and_free (ctx); return; } } /* Run! */ - connect_context_step (ctx); + connect_context_step (task); } /*****************************************************************************/ @@ -1531,8 +1698,6 @@ } DisconnectStep; typedef struct { - MMBearerQmi *self; - GSimpleAsyncResult *result; MMPort *data; DisconnectStep step; @@ -1548,10 +1713,8 @@ } DisconnectContext; static void -disconnect_context_complete_and_free (DisconnectContext *ctx) +disconnect_context_free (DisconnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); if (ctx->error_ipv4) g_error_free (ctx->error_ipv4); if (ctx->error_ipv6) @@ -1561,7 +1724,6 @@ if (ctx->client_ipv6) g_object_unref (ctx->client_ipv6); g_object_unref (ctx->data); - g_object_unref (ctx->self); g_slice_free (DisconnectContext, ctx); } @@ -1570,7 +1732,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -1579,11 +1741,33 @@ gboolean reset_ipv6) { if (reset_ipv4) { + if (self->priv->client_ipv4) { + if (self->priv->packet_service_status_ipv4_indication_id) + common_setup_cleanup_packet_service_status_unsolicited_events (self, + self->priv->client_ipv4, + FALSE, + &self->priv->packet_service_status_ipv4_indication_id); + if (self->priv->event_report_ipv4_indication_id) + cleanup_event_report_unsolicited_events (self, + self->priv->client_ipv4, + &self->priv->event_report_ipv4_indication_id); + } self->priv->packet_data_handle_ipv4 = 0; g_clear_object (&self->priv->client_ipv4); } if (reset_ipv6) { + if (self->priv->client_ipv6) { + if (self->priv->packet_service_status_ipv6_indication_id) + common_setup_cleanup_packet_service_status_unsolicited_events (self, + self->priv->client_ipv6, + FALSE, + &self->priv->packet_service_status_ipv6_indication_id); + if (self->priv->event_report_ipv6_indication_id) + cleanup_event_report_unsolicited_events (self, + self->priv->client_ipv6, + &self->priv->event_report_ipv6_indication_id); + } self->priv->packet_data_handle_ipv6 = 0; g_clear_object (&self->priv->client_ipv6); } @@ -1598,16 +1782,21 @@ } } -static void disconnect_context_step (DisconnectContext *ctx); +static void disconnect_context_step (GTask *task); static void stop_network_ready (QmiClientWds *client, GAsyncResult *res, - DisconnectContext *ctx) + GTask *task) { + MMBearerQmi *self; + DisconnectContext *ctx; GError *error = NULL; QmiMessageWdsStopNetworkOutput *output; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_wds_stop_network_finish (client, res, &error); if (output && !qmi_message_wds_stop_network_output_get_result (output, &error)) { @@ -1627,7 +1816,7 @@ ctx->error_ipv6 = error; } else { /* Clear internal status */ - reset_bearer_connection (ctx->self, + reset_bearer_connection (self, ctx->running_ipv4, ctx->running_ipv6); } @@ -1637,12 +1826,18 @@ /* Keep on */ ctx->step++; - disconnect_context_step (ctx); + disconnect_context_step (task); } static void -disconnect_context_step (DisconnectContext *ctx) +disconnect_context_step (GTask *task) { + MMBearerQmi *self; + DisconnectContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISCONNECT_STEP_FIRST: /* Fall down */ @@ -1652,16 +1847,13 @@ if (ctx->packet_data_handle_ipv4) { QmiMessageWdsStopNetworkInput *input; - common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self, + common_setup_cleanup_packet_service_status_unsolicited_events (self, ctx->client_ipv4, FALSE, - &ctx->self->priv->packet_service_status_ipv4_indication_id); - -#if QMI_CHECK_VERSION (1,18,0) - cleanup_event_report_unsolicited_events (ctx->self, + &self->priv->packet_service_status_ipv4_indication_id); + cleanup_event_report_unsolicited_events (self, ctx->client_ipv4, - &ctx->self->priv->event_report_ipv4_indication_id); -#endif + &self->priv->event_report_ipv4_indication_id); input = qmi_message_wds_stop_network_input_new (); qmi_message_wds_stop_network_input_set_packet_data_handle (input, ctx->packet_data_handle_ipv4, NULL); @@ -1673,7 +1865,7 @@ 30, NULL, (GAsyncReadyCallback)stop_network_ready, - ctx); + task); return; } @@ -1684,16 +1876,13 @@ if (ctx->packet_data_handle_ipv6) { QmiMessageWdsStopNetworkInput *input; - common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self, + common_setup_cleanup_packet_service_status_unsolicited_events (self, ctx->client_ipv6, FALSE, - &ctx->self->priv->packet_service_status_ipv6_indication_id); - -#if QMI_CHECK_VERSION (1,18,0) - cleanup_event_report_unsolicited_events (ctx->self, + &self->priv->packet_service_status_ipv6_indication_id); + cleanup_event_report_unsolicited_events (self, ctx->client_ipv6, - &ctx->self->priv->event_report_ipv6_indication_id); -#endif + &self->priv->event_report_ipv6_indication_id); input = qmi_message_wds_stop_network_input_new (); qmi_message_wds_stop_network_input_set_packet_data_handle (input, ctx->packet_data_handle_ipv6, NULL); @@ -1705,7 +1894,7 @@ 30, NULL, (GAsyncReadyCallback)stop_network_ready, - ctx); + task); return; } @@ -1714,7 +1903,7 @@ case DISCONNECT_STEP_LAST: if (!ctx->error_ipv4 && !ctx->error_ipv6) - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); else { GError *error; @@ -1727,10 +1916,10 @@ ctx->error_ipv6 = NULL; } - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } - disconnect_context_complete_and_free (ctx); + g_object_unref (task); return; } } @@ -1742,14 +1931,16 @@ { MMBearerQmi *self = MM_BEARER_QMI (_self); DisconnectContext *ctx; + GTask *task; if ((!self->priv->packet_data_handle_ipv4 && !self->priv->packet_data_handle_ipv6) || (!self->priv->client_ipv4 && !self->priv->client_ipv6) || !self->priv->data) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + disconnect, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't disconnect QMI bearer: this bearer is not connected"); @@ -1757,20 +1948,18 @@ } ctx = g_slice_new0 (DisconnectContext); - ctx->self = g_object_ref (self); ctx->data = g_object_ref (self->priv->data); ctx->client_ipv4 = self->priv->client_ipv4 ? g_object_ref (self->priv->client_ipv4) : NULL; ctx->packet_data_handle_ipv4 = self->priv->packet_data_handle_ipv4; ctx->client_ipv6 = self->priv->client_ipv6 ? g_object_ref (self->priv->client_ipv6) : NULL; ctx->packet_data_handle_ipv6 = self->priv->packet_data_handle_ipv6; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect); ctx->step = DISCONNECT_STEP_FIRST; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disconnect_context_free); + /* Run! */ - disconnect_context_step (ctx); + disconnect_context_step (task); } /*****************************************************************************/ @@ -1829,26 +2018,22 @@ FALSE, &self->priv->packet_service_status_ipv4_indication_id); } -#if QMI_CHECK_VERSION (1,18,0) if (self->priv->event_report_ipv4_indication_id) { cleanup_event_report_unsolicited_events (self, self->priv->client_ipv4, &self->priv->event_report_ipv4_indication_id); } -#endif if (self->priv->packet_service_status_ipv6_indication_id) { common_setup_cleanup_packet_service_status_unsolicited_events (self, self->priv->client_ipv6, FALSE, &self->priv->packet_service_status_ipv6_indication_id); } -#if QMI_CHECK_VERSION (1,18,0) if (self->priv->event_report_ipv6_indication_id) { cleanup_event_report_unsolicited_events (self, self->priv->client_ipv6, &self->priv->event_report_ipv6_indication_id); } -#endif g_clear_object (&self->priv->data); g_clear_object (&self->priv->client_ipv4); @@ -1875,4 +2060,6 @@ base_bearer_class->report_connection_status = report_connection_status; base_bearer_class->reload_stats = reload_stats; base_bearer_class->reload_stats_finish = reload_stats_finish; + base_bearer_class->load_connection_status = load_connection_status; + base_bearer_class->load_connection_status_finish = load_connection_status_finish; } diff -Nru modemmanager-1.6.8/src/mm-broadband-bearer.c modemmanager-1.10.0/src/mm-broadband-bearer.c --- modemmanager-1.6.8/src/mm-broadband-bearer.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-bearer.c 2019-01-15 15:57:35.000000000 +0100 @@ -35,6 +35,7 @@ #include "mm-log.h" #include "mm-modem-helpers.h" #include "mm-port-enums-types.h" +#include "mm-helper-enums-types.h" static void async_initable_iface_init (GAsyncInitableIface *iface); @@ -48,6 +49,14 @@ CONNECTION_TYPE_CDMA, } ConnectionType; +enum { + PROP_0, + PROP_FLOW_CONTROL, + PROP_LAST +}; + +static GParamSpec *properties[PROP_LAST]; + struct _MMBroadbandBearerPrivate { /*-- Common stuff --*/ /* Data port used when modem is connected */ @@ -55,6 +64,9 @@ /* Current connection type */ ConnectionType connection_type; + /* PPP specific */ + MMFlowControl flow_control; + /*-- 3GPP specific --*/ /* CID of the PDP context */ guint cid; @@ -69,23 +81,37 @@ } /*****************************************************************************/ + +static MMBearerIpFamily +select_bearer_ip_family (MMBroadbandBearer *self) +{ + MMBearerIpFamily ip_family; + + ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); + if (ip_family == MM_BEARER_IP_FAMILY_NONE || ip_family == MM_BEARER_IP_FAMILY_ANY) { + gchar *default_family; + + ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (self)); + default_family = mm_bearer_ip_family_build_string_from_mask (ip_family); + mm_dbg ("No specific IP family requested, defaulting to %s", default_family); + g_free (default_family); + } + + return ip_family; +} + +/*****************************************************************************/ /* Detailed connect context, used in both CDMA and 3GPP sequences */ typedef struct { - MMBroadbandBearer *self; MMBaseModem *modem; MMPortSerialAt *primary; MMPortSerialAt *secondary; - GCancellable *cancellable; - GSimpleAsyncResult *result; MMPort *data; gboolean close_data_on_exit; /* 3GPP-specific */ - guint cid; - guint max_cid; - gboolean use_existing_cid; MMBearerIpFamily ip_family; } DetailedConnectContext; @@ -94,18 +120,12 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -detailed_connect_context_complete_and_free (DetailedConnectContext *ctx) +detailed_connect_context_free (DetailedConnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->primary); if (ctx->secondary) g_object_unref (ctx->secondary); @@ -114,74 +134,24 @@ mm_port_serial_close (MM_PORT_SERIAL (ctx->data)); g_object_unref (ctx->data); } - g_object_unref (ctx->self); g_object_unref (ctx->modem); g_slice_free (DetailedConnectContext, ctx); } -static gboolean -detailed_connect_context_set_error_if_cancelled (DetailedConnectContext *ctx, - GError **error) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Connection setup operation has been cancelled"); - return TRUE; -} - -static gboolean -detailed_connect_context_complete_and_free_if_cancelled (DetailedConnectContext *ctx) -{ - GError *error = NULL; - - if (!detailed_connect_context_set_error_if_cancelled (ctx, &error)) - return FALSE; - - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); - return TRUE; -} - static DetailedConnectContext * detailed_connect_context_new (MMBroadbandBearer *self, MMBroadbandModem *modem, MMPortSerialAt *primary, - MMPortSerialAt *secondary, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) + MMPortSerialAt *secondary) { DetailedConnectContext *ctx; ctx = g_slice_new0 (DetailedConnectContext); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); ctx->primary = g_object_ref (primary); ctx->secondary = (secondary ? g_object_ref (secondary) : NULL); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - detailed_connect_context_new); - - ctx->ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); - if (ctx->ip_family == MM_BEARER_IP_FAMILY_NONE || - ctx->ip_family == MM_BEARER_IP_FAMILY_ANY) { - gchar *default_family; - - ctx->ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (self)); - default_family = mm_bearer_ip_family_build_string_from_mask (ctx->ip_family); - mm_dbg ("No specific IP family requested, defaulting to %s", default_family); - g_free (default_family); - } + ctx->ip_family = select_bearer_ip_family (self); - /* NOTE: - * We don't currently support cancelling AT commands, so we'll just check - * whether the operation is to be cancelled at each step. */ - ctx->cancellable = g_object_ref (cancellable); return ctx; } @@ -230,8 +200,10 @@ static void dial_cdma_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { + MMBroadbandBearer *self; + DetailedConnectContext *ctx; GError *error = NULL; MMBearerIpConfig *config; @@ -241,11 +213,28 @@ mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { mm_warn ("Couldn't connect: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + /* Configure flow control to use while connected */ + if (self->priv->flow_control != MM_FLOW_CONTROL_NONE) { + gchar *flow_control_str; + + flow_control_str = mm_flow_control_build_string_from_mask (self->priv->flow_control); + mm_dbg ("[%s] Setting flow control: %s", mm_port_get_device (ctx->data), flow_control_str); + g_free (flow_control_str); + + if (!mm_port_serial_set_flow_control (MM_PORT_SERIAL (ctx->data), self->priv->flow_control, &error)) { + mm_warn ("Couldn't set flow control settings: %s", error->message); + g_clear_error (&error); + } + } + /* The ATD command has succeeded, and therefore the TTY is in data mode now. * Instead of waiting for setting the port as connected later in * connect_succeeded(), we do it right away so that we stop our polling. */ @@ -260,70 +249,64 @@ mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_PPP); /* Assume only IPv4 is given */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, + g_task_return_pointer ( + task, mm_bearer_connect_result_new (ctx->data, config, NULL), (GDestroyNotify)mm_bearer_connect_result_unref); - detailed_connect_context_complete_and_free (ctx); + g_object_unref (task); g_object_unref (config); } static void -cdma_connect_context_dial (DetailedConnectContext *ctx) +cdma_connect_context_dial (GTask *task) { - gchar *command; - const gchar *number; - - number = mm_bearer_properties_get_number (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + MMBroadbandBearer *self; + DetailedConnectContext *ctx; - /* If a number was given when creating the bearer, use that one. - * Otherwise, use the default one, #777 - */ - if (number) - command = g_strconcat ("DT", number, NULL); - else - command = g_strdup ("DT#777"); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); mm_base_modem_at_command_full (ctx->modem, MM_PORT_SERIAL_AT (ctx->data), - command, + "DT#777", 90, FALSE, FALSE, NULL, (GAsyncReadyCallback)dial_cdma_ready, - ctx); - g_free (command); + task); } static void set_rm_protocol_ready (MMBaseModem *self, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { GError *error = NULL; /* If cancelled, complete */ - if (detailed_connect_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } mm_base_modem_at_command_full_finish (self, res, &error); if (error) { mm_warn ("Couldn't set RM protocol: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Nothing else needed, go on with dialing */ - cdma_connect_context_dial (ctx); + cdma_connect_context_dial (task); } static void current_rm_protocol_ready (MMBaseModem *self, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { const gchar *result; GError *error = NULL; @@ -331,14 +314,16 @@ MMModemCdmaRmProtocol current_rm; /* If cancelled, complete */ - if (detailed_connect_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } result = mm_base_modem_at_command_full_finish (self, res, &error); if (error) { mm_warn ("Couldn't query current RM protocol: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -349,12 +334,13 @@ mm_warn ("Couldn't parse RM protocol reply (%s): '%s'", result, error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (current_rm != mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (self)))) { + DetailedConnectContext *ctx; guint new_index; gchar *command; @@ -366,11 +352,12 @@ if (error) { mm_warn ("Cannot set RM protocol: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); command = g_strdup_printf ("+CRM=%u", new_index); mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -380,13 +367,13 @@ FALSE, NULL, (GAsyncReadyCallback)set_rm_protocol_ready, - ctx); + task); g_free (command); return; } /* Nothing else needed, go on with dialing */ - cdma_connect_context_dial (ctx); + cdma_connect_context_dial (task); } static void @@ -399,24 +386,22 @@ gpointer user_data) { DetailedConnectContext *ctx; + GTask *task; GError *error = NULL; g_assert (primary != NULL); - ctx = detailed_connect_context_new (self, - modem, - primary, - NULL, - cancellable, - callback, - user_data); + ctx = detailed_connect_context_new (self, modem, primary, NULL); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_connect_context_free); /* Grab dial port. This gets a reference to the dial port and OPENs it. * If we fail, we'll need to close it ourselves. */ ctx->data = (MMPort *)common_get_at_data_port (ctx->modem, &error); if (!ctx->data) { - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } ctx->close_data_on_exit = TRUE; @@ -434,121 +419,95 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)current_rm_protocol_ready, - ctx); + task); return; } /* Nothing else needed, go on with dialing */ - cdma_connect_context_dial (ctx); + cdma_connect_context_dial (task); } /*****************************************************************************/ /* 3GPP Dialing (sub-step of the 3GPP Connection sequence) */ typedef struct { - MMBroadbandBearer *self; MMBaseModem *modem; MMPortSerialAt *primary; - GCancellable *cancellable; - GSimpleAsyncResult *result; GError *saved_error; - MMPortSerialAt *dial_port; gboolean close_dial_port_on_exit; } Dial3gppContext; static void -dial_3gpp_context_complete_and_free (Dial3gppContext *ctx) +dial_3gpp_context_free (Dial3gppContext *ctx) { if (ctx->saved_error) g_error_free (ctx->saved_error); if (ctx->dial_port) g_object_unref (ctx->dial_port); - g_object_unref (ctx->cancellable); - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->primary); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (Dial3gppContext, ctx); } -static gboolean -dial_3gpp_context_set_error_if_cancelled (Dial3gppContext *ctx, - GError **error) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Dial operation has been cancelled"); - return TRUE; -} - -static gboolean -dial_3gpp_context_complete_and_free_if_cancelled (Dial3gppContext *ctx) -{ - GError *error = NULL; - - if (!dial_3gpp_context_set_error_if_cancelled (ctx, &error)) - return FALSE; - - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); - return TRUE; -} - static MMPort * dial_3gpp_finish (MMBroadbandBearer *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_PORT (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return g_task_propagate_pointer (G_TASK (res), error); } static void extended_error_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + Dial3gppContext *ctx; const gchar *result; + GError *error = NULL; + + ctx = g_task_get_task_data (task); /* Close the dialling port as we got an error */ mm_port_serial_close (MM_PORT_SERIAL (ctx->dial_port)); /* If cancelled, complete */ - if (dial_3gpp_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } result = mm_base_modem_at_command_full_finish (modem, res, NULL); if (result && g_str_has_prefix (result, "+CEER: ") && strlen (result) > 7) { - g_simple_async_result_set_error (ctx->result, - ctx->saved_error->domain, - ctx->saved_error->code, - "%s", &result[7]); + error = g_error_new (ctx->saved_error->domain, + ctx->saved_error->code, + "%s", + &result[7]); g_error_free (ctx->saved_error); } else - g_simple_async_result_take_error (ctx->result, - ctx->saved_error); + g_propagate_error (&error, ctx->saved_error); ctx->saved_error = NULL; /* Done with errors */ - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); } static void atd_ready (MMBaseModem *modem, GAsyncResult *res, - Dial3gppContext *ctx) + GTask *task) { + MMBroadbandBearer *self; + Dial3gppContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* DO NOT check for cancellable here. If we got here without errors, the * bearer is really connected and therefore we need to reflect that in * the state machine. */ @@ -564,19 +523,34 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)extended_error_ready, - ctx); + task); return; } + /* Configure flow control to use while connected */ + if (self->priv->flow_control != MM_FLOW_CONTROL_NONE) { + gchar *flow_control_str; + GError *error = NULL; + + flow_control_str = mm_flow_control_build_string_from_mask (self->priv->flow_control); + mm_dbg ("[%s] Setting flow control: %s", mm_port_get_device (MM_PORT (ctx->dial_port)), flow_control_str); + g_free (flow_control_str); + + if (!mm_port_serial_set_flow_control (MM_PORT_SERIAL (ctx->dial_port), self->priv->flow_control, &error)) { + mm_warn ("Couldn't set flow control settings: %s", error->message); + g_clear_error (&error); + } + } + /* The ATD command has succeeded, and therefore the TTY is in data mode now. * Instead of waiting for setting the port as connected later in * connect_succeeded(), we do it right away so that we stop our polling. */ mm_port_set_connected (MM_PORT (ctx->dial_port), TRUE); - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_object_ref (ctx->dial_port), - (GDestroyNotify)g_object_unref); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_pointer (task, + g_object_ref (ctx->dial_port), + g_object_unref); + g_object_unref (task); } static void @@ -590,26 +564,24 @@ { gchar *command; Dial3gppContext *ctx; + GTask *task; GError *error = NULL; g_assert (primary != NULL); ctx = g_slice_new0 (Dial3gppContext); - ctx->self = g_object_ref (self); ctx->modem = g_object_ref (modem); ctx->primary = g_object_ref (primary); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - dial_3gpp); - ctx->cancellable = g_object_ref (cancellable); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)dial_3gpp_context_free); /* Grab dial port. This gets a reference to the dial port and OPENs it. * If we fail, we'll need to close it ourselves. */ ctx->dial_port = common_get_at_data_port (ctx->modem, &error); if (!ctx->dial_port) { - g_simple_async_result_take_error (ctx->result, error); - dial_3gpp_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -623,224 +595,112 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)atd_ready, - ctx); + task); g_free (command); } /*****************************************************************************/ -/* 3GPP CONNECT - * - * 3GPP connection procedure of a bearer involves several steps: - * 1) Get data port from the modem. Default implementation will have only - * one single possible data port, but plugins may have more. - * 2) Decide which PDP context to use - * 2.1) Look for an already existing PDP context with the same APN. - * 2.2) If none found with the same APN, try to find a PDP context without any - * predefined APN. - * 2.3) If none found, look for the highest available CID, and use that one. - * 3) Activate PDP context. - * 4) Initiate call. - */ +/* 3GPP cid selection (sub-step of the 3GPP Connection sequence) */ -static void -get_ip_config_3gpp_ready (MMBroadbandModem *modem, - GAsyncResult *res, - DetailedConnectContext *ctx) -{ - MMBearerIpConfig *ipv4_config = NULL; - MMBearerIpConfig *ipv6_config = NULL; - GError *error = NULL; - - if (!MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp_finish (ctx->self, - res, - &ipv4_config, - &ipv6_config, - &error)) { - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); - return; - } - - /* Keep port open during connection */ - if (MM_IS_PORT_SERIAL_AT (ctx->data)) - ctx->close_data_on_exit = FALSE; - - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - mm_bearer_connect_result_new (ctx->data, ipv4_config, ipv6_config), - (GDestroyNotify)mm_bearer_connect_result_unref); - detailed_connect_context_complete_and_free (ctx); - - if (ipv4_config) - g_object_unref (ipv4_config); - if (ipv6_config) - g_object_unref (ipv6_config); -} +typedef struct { + MMBroadbandBearer *self; + MMBaseModem *modem; + MMPortSerialAt *primary; + GCancellable *cancellable; + guint cid; + guint max_cid; + gboolean use_existing_cid; + MMBearerIpFamily ip_family; +} CidSelection3gppContext; static void -dial_3gpp_ready (MMBroadbandModem *modem, - GAsyncResult *res, - DetailedConnectContext *ctx) +cid_selection_3gpp_context_free (CidSelection3gppContext *ctx) { - MMBearerIpMethod ip_method = MM_BEARER_IP_METHOD_UNKNOWN; - MMBearerIpConfig *ipv4_config = NULL; - MMBearerIpConfig *ipv6_config = NULL; - GError *error = NULL; - - ctx->data = MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->dial_3gpp_finish (ctx->self, res, &error); - if (!ctx->data) { - /* Clear CID when it failed to connect. */ - ctx->self->priv->cid = 0; - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); - return; - } - - /* If the dialling operation used an AT port, it is assumed to have an extra - * open() count. */ - if (MM_IS_PORT_SERIAL_AT (ctx->data)) - ctx->close_data_on_exit = TRUE; - - if (MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp && - MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp_finish) { - /* Launch specific IP config retrieval */ - MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->get_ip_config_3gpp ( - ctx->self, - MM_BROADBAND_MODEM (ctx->modem), - ctx->primary, - ctx->secondary, - ctx->data, - ctx->cid, - ctx->ip_family, - (GAsyncReadyCallback)get_ip_config_3gpp_ready, - ctx); - return; - } - - /* Yuhu! */ - - /* Keep port open during connection */ - if (MM_IS_PORT_SERIAL_AT (ctx->data)) - ctx->close_data_on_exit = FALSE; - - /* If no specific IP retrieval requested, set the default implementation - * (PPP if data port is AT, DHCP otherwise) */ - ip_method = MM_IS_PORT_SERIAL_AT (ctx->data) ? - MM_BEARER_IP_METHOD_PPP : - MM_BEARER_IP_METHOD_DHCP; - - if (ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4 || - ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4V6) { - ipv4_config = mm_bearer_ip_config_new (); - mm_bearer_ip_config_set_method (ipv4_config, ip_method); - } - if (ctx->ip_family & MM_BEARER_IP_FAMILY_IPV6 || - ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4V6) { - ipv6_config = mm_bearer_ip_config_new (); - mm_bearer_ip_config_set_method (ipv6_config, ip_method); - } - g_assert (ipv4_config || ipv6_config); - - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - mm_bearer_connect_result_new (ctx->data, ipv4_config, ipv6_config), - (GDestroyNotify)mm_bearer_connect_result_unref); - detailed_connect_context_complete_and_free (ctx); - - g_clear_object (&ipv4_config); - g_clear_object (&ipv6_config); + g_object_unref (ctx->self); + g_object_unref (ctx->modem); + g_object_unref (ctx->primary); + g_object_unref (ctx->cancellable); + g_slice_free (CidSelection3gppContext, ctx); } -static void -start_3gpp_dial (DetailedConnectContext *ctx) +static guint +cid_selection_3gpp_finish (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error) { - /* Keep CID around after initializing the PDP context in order to - * handle corresponding unsolicited PDP activation responses. */ - ctx->self->priv->cid = ctx->cid; - MM_BROADBAND_BEARER_GET_CLASS (ctx->self)->dial_3gpp (ctx->self, - ctx->modem, - ctx->primary, - ctx->cid, - ctx->cancellable, - (GAsyncReadyCallback)dial_3gpp_ready, - ctx); + gssize cid; + + /* We return 0 as an invalid CID, not -1 */ + cid = g_task_propagate_int (G_TASK (res), error); + return (guint) (cid < 0 ? 0 : cid); } static void -initialize_pdp_context_ready (MMBaseModem *modem, +initialize_pdp_context_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { - GError *error = NULL; - - /* If cancelled, complete */ - if (detailed_connect_context_complete_and_free_if_cancelled (ctx)) - return; + CidSelection3gppContext *ctx; + GError *error = NULL; + ctx = (CidSelection3gppContext *) g_task_get_task_data (task); mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { - mm_warn ("Couldn't initialize PDP context with our APN: '%s'", - error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); - return; - } - - start_3gpp_dial (ctx); + mm_warn ("Couldn't initialize PDP context with our APN: '%s'", error->message); + g_task_return_error (task, error); + } else + g_task_return_int (task, (gssize) ctx->cid); + g_object_unref (task); } static void -find_cid_ready (MMBaseModem *modem, +find_cid_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedConnectContext *ctx) + GTask *task) { - GVariant *result; - gchar *apn, *command; - GError *error = NULL; - const gchar *pdp_type; + gchar *apn; + gchar *command; + GError *error = NULL; + const gchar *pdp_type; + CidSelection3gppContext *ctx; - result = mm_base_modem_at_sequence_full_finish (modem, res, NULL, &error); - if (!result) { + ctx = (CidSelection3gppContext *) g_task_get_task_data (task); + + mm_base_modem_at_sequence_full_finish (modem, res, NULL, &error); + if (error) { mm_warn ("Couldn't find best CID to use: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - detailed_connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - /* If cancelled, complete. Normally, we would get the cancellation error - * already when finishing the sequence, but we may still get cancelled - * between last command result parsing in the sequence and the ready(). */ - if (detailed_connect_context_complete_and_free_if_cancelled (ctx)) - return; - + /* Validate requested PDP type */ pdp_type = mm_3gpp_get_pdp_type_from_ip_family (ctx->ip_family); if (!pdp_type) { gchar * str; str = mm_bearer_ip_family_build_string_from_mask (ctx->ip_family); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Unsupported IP type requested: '%s'", - str); + g_task_return_new_error (task, + MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Unsupported IP type requested: '%s'", str); + g_object_unref (task); g_free (str); - detailed_connect_context_complete_and_free (ctx); return; } - ctx->cid = g_variant_get_uint32 (result); + + /* If no error reported, we must have a valid CID to be used */ + g_assert (ctx->cid != 0); /* If there's already a PDP context defined, just use it */ if (ctx->use_existing_cid) { - start_3gpp_dial (ctx); + g_task_return_int (task, (gssize) ctx->cid); + g_object_unref (task); return; } /* Otherwise, initialize a new PDP context with our APN */ apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)))); - command = g_strdup_printf ("+CGDCONT=%u,\"%s\",%s", - ctx->cid, - pdp_type, - apn); + command = g_strdup_printf ("+CGDCONT=%u,\"%s\",%s", ctx->cid, pdp_type, apn); g_free (apn); mm_base_modem_at_command_full (ctx->modem, ctx->primary, @@ -849,33 +709,36 @@ FALSE, FALSE, /* raw */ NULL, /* cancellable */ - (GAsyncReadyCallback)initialize_pdp_context_ready, - ctx); + (GAsyncReadyCallback) initialize_pdp_context_ready, + task); g_free (command); } static gboolean -parse_cid_range (MMBaseModem *modem, - DetailedConnectContext *ctx, - const gchar *command, - const gchar *response, - gboolean last_command, - const GError *error, - GVariant **result, - GError **result_error) +parse_cid_range (MMBaseModem *modem, + CidSelection3gppContext *ctx, + const gchar *command, + const gchar *response, + gboolean last_command, + const GError *error, + GVariant **result, + GError **result_error) { GError *inner_error = NULL; - GList *formats, *l; - guint cid; + GList *formats, *l; + guint cid; /* If cancelled, set result error */ - if (detailed_connect_context_set_error_if_cancelled (ctx, result_error)) + if (g_cancellable_is_cancelled (ctx->cancellable)) { + g_set_error (result_error, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, + "Connection setup operation has been cancelled"); return FALSE; + } if (error) { mm_dbg ("Unexpected +CGDCONT error: '%s'", error->message); mm_dbg ("Defaulting to CID=1"); - *result = g_variant_new_uint32 (1); + ctx->cid = 1; return TRUE; } @@ -884,7 +747,7 @@ mm_dbg ("Error parsing +CGDCONT test response: '%s'", inner_error->message); mm_dbg ("Defaulting to CID=1"); g_error_free (inner_error); - *result = g_variant_new_uint32 (1); + ctx->cid = 1; return TRUE; } @@ -894,10 +757,17 @@ /* Found exact PDP type? */ if (format->pdp_type == ctx->ip_family) { - if (ctx->max_cid < format->max_cid) + gchar *ip_family_str; + + ip_family_str = mm_bearer_ip_family_build_string_from_mask (format->pdp_type); + if (ctx->max_cid < format->max_cid) { cid = ctx->max_cid + 1; - else + mm_dbg ("Using empty CID %u with PDP type '%s'", cid, ip_family_str); + } else { cid = ctx->max_cid; + mm_dbg ("Re-using CID %u (max) with PDP type '%s'", cid, ip_family_str); + } + g_free (ip_family_str); break; } } @@ -907,22 +777,21 @@ if (cid == 0) { mm_dbg ("Defaulting to CID=1"); cid = 1; - } else - mm_dbg ("Using CID %u", cid); + } - *result = g_variant_new_uint32 (cid); + ctx->cid = cid; return TRUE; } static gboolean -parse_pdp_list (MMBaseModem *modem, - DetailedConnectContext *ctx, - const gchar *command, - const gchar *response, - gboolean last_command, - const GError *error, - GVariant **result, - GError **result_error) +parse_pdp_list (MMBaseModem *modem, + CidSelection3gppContext *ctx, + const gchar *command, + const gchar *response, + gboolean last_command, + const GError *error, + GVariant **result, + GError **result_error) { GError *inner_error = NULL; GList *pdp_list; @@ -930,10 +799,11 @@ guint cid; /* If cancelled, set result error */ - if (detailed_connect_context_set_error_if_cancelled (ctx, result_error)) + if (g_cancellable_is_cancelled (ctx->cancellable)) { + g_set_error (result_error, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, + "Connection setup operation has been cancelled"); return FALSE; - - ctx->max_cid = 0; + } /* Some Android phones don't support querying existing PDP contexts, * but will accept setting the APN. So if CGDCONT? isn't supported, @@ -984,28 +854,30 @@ MM3gppPdpContext *pdp = l->data; if (pdp->pdp_type == ctx->ip_family) { + const gchar *apn; + + apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + + /* First requested, then existing */ + if (mm_3gpp_cmp_apn_name (apn, pdp->apn)) { + gchar *ip_family_str; + + /* Found a PDP context with the same APN and PDP type, we'll use it. */ + ip_family_str = mm_bearer_ip_family_build_string_from_mask (pdp->pdp_type); + mm_dbg ("Found PDP context with CID %u and PDP type %s for APN '%s'", + pdp->cid, ip_family_str, apn ? apn : ""); + cid = pdp->cid; + ctx->use_existing_cid = TRUE; + g_free (ip_family_str); + /* In this case, stop searching */ + break; + } + /* PDP with no APN set? we may use that one if not exact match found */ if (!pdp->apn || !pdp->apn[0]) { mm_dbg ("Found PDP context with CID %u and no APN", pdp->cid); cid = pdp->cid; - } else { - const gchar *apn; - - apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); - if (apn && !g_ascii_strcasecmp (pdp->apn, apn)) { - gchar *ip_family_str; - - /* Found a PDP context with the same CID and PDP type, we'll use it. */ - ip_family_str = mm_bearer_ip_family_build_string_from_mask (pdp->pdp_type); - mm_dbg ("Found PDP context with CID %u and PDP type %s for APN '%s'", - pdp->cid, ip_family_str, pdp->apn); - cid = pdp->cid; - ctx->use_existing_cid = TRUE; - g_free (ip_family_str); - /* In this case, stop searching */ - break; - } } } @@ -1015,7 +887,7 @@ mm_3gpp_pdp_context_list_free (pdp_list); if (cid > 0) { - *result = g_variant_new_uint32 (cid); + ctx->cid = cid; return TRUE; } @@ -1023,31 +895,31 @@ } static const MMBaseModemAtCommand find_cid_sequence[] = { - { "+CGDCONT?", 3, FALSE, (MMBaseModemAtResponseProcessor)parse_pdp_list }, - { "+CGDCONT=?", 3, TRUE, (MMBaseModemAtResponseProcessor)parse_cid_range }, + { "+CGDCONT?", 3, FALSE, (MMBaseModemAtResponseProcessor) parse_pdp_list }, + { "+CGDCONT=?", 3, TRUE, (MMBaseModemAtResponseProcessor) parse_cid_range }, { NULL } }; static void -connect_3gpp (MMBroadbandBearer *self, - MMBroadbandModem *modem, - MMPortSerialAt *primary, - MMPortSerialAt *secondary, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - DetailedConnectContext *ctx; - - g_assert (primary != NULL); +cid_selection_3gpp (MMBroadbandBearer *self, + MMBaseModem *modem, + MMPortSerialAt *primary, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + CidSelection3gppContext *ctx; + + ctx = g_slice_new0 (CidSelection3gppContext); + ctx->self = g_object_ref (self); + ctx->modem = g_object_ref (modem); + ctx->primary = g_object_ref (primary); + ctx->cancellable = g_object_ref (cancellable); + ctx->ip_family = select_bearer_ip_family (self); - ctx = detailed_connect_context_new (self, - modem, - primary, - secondary, - cancellable, - callback, - user_data); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify) cid_selection_3gpp_context_free); mm_dbg ("Looking for best CID..."); mm_base_modem_at_sequence_full (ctx->modem, @@ -1056,94 +928,269 @@ ctx, /* also passed as response processor context */ NULL, /* response_processor_context_free */ NULL, /* cancellable */ - (GAsyncReadyCallback)find_cid_ready, - ctx); + (GAsyncReadyCallback) find_cid_ready, + task); } /*****************************************************************************/ -/* CONNECT */ +/* 3GPP CONNECT + * + * 3GPP connection procedure of a bearer involves several steps: + * 1) Get data port from the modem. Default implementation will have only + * one single possible data port, but plugins may have more. + * 2) Decide which PDP context to use + * 2.1) Look for an already existing PDP context with the same APN. + * 2.2) If none found with the same APN, try to find a PDP context without any + * predefined APN. + * 2.3) If none found, look for the highest available CID, and use that one. + * 3) Activate PDP context. + * 4) Initiate call. + */ -typedef struct { - MMBroadbandBearer *self; - GSimpleAsyncResult *result; -} ConnectContext; +static void +get_ip_config_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) +{ + DetailedConnectContext *ctx; + MMBearerIpConfig *ipv4_config = NULL; + MMBearerIpConfig *ipv6_config = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + if (!MM_BROADBAND_BEARER_GET_CLASS (self)->get_ip_config_3gpp_finish (self, + res, + &ipv4_config, + &ipv6_config, + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Keep port open during connection */ + if (MM_IS_PORT_SERIAL_AT (ctx->data)) + ctx->close_data_on_exit = FALSE; + + g_task_return_pointer ( + task, + mm_bearer_connect_result_new (ctx->data, ipv4_config, ipv6_config), + (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); + + if (ipv4_config) + g_object_unref (ipv4_config); + if (ipv6_config) + g_object_unref (ipv6_config); +} static void -connect_context_complete_and_free (ConnectContext *ctx) +dial_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (ConnectContext, ctx); + DetailedConnectContext *ctx; + MMBearerIpMethod ip_method = MM_BEARER_IP_METHOD_UNKNOWN; + MMBearerIpConfig *ipv4_config = NULL; + MMBearerIpConfig *ipv6_config = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + ctx->data = MM_BROADBAND_BEARER_GET_CLASS (self)->dial_3gpp_finish (self, res, &error); + if (!ctx->data) { + /* Clear CID when it failed to connect. */ + self->priv->cid = 0; + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* If the dialling operation used an AT port, it is assumed to have an extra + * open() count. */ + if (MM_IS_PORT_SERIAL_AT (ctx->data)) + ctx->close_data_on_exit = TRUE; + + if (MM_BROADBAND_BEARER_GET_CLASS (self)->get_ip_config_3gpp && + MM_BROADBAND_BEARER_GET_CLASS (self)->get_ip_config_3gpp_finish) { + /* Launch specific IP config retrieval */ + MM_BROADBAND_BEARER_GET_CLASS (self)->get_ip_config_3gpp ( + self, + MM_BROADBAND_MODEM (ctx->modem), + ctx->primary, + ctx->secondary, + ctx->data, + self->priv->cid, + ctx->ip_family, + (GAsyncReadyCallback)get_ip_config_3gpp_ready, + task); + return; + } + + /* Yuhu! */ + + /* Keep port open during connection */ + if (MM_IS_PORT_SERIAL_AT (ctx->data)) + ctx->close_data_on_exit = FALSE; + + /* If no specific IP retrieval requested, set the default implementation + * (PPP if data port is AT, DHCP otherwise) */ + ip_method = MM_IS_PORT_SERIAL_AT (ctx->data) ? + MM_BEARER_IP_METHOD_PPP : + MM_BEARER_IP_METHOD_DHCP; + + if (ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4 || + ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4V6) { + ipv4_config = mm_bearer_ip_config_new (); + mm_bearer_ip_config_set_method (ipv4_config, ip_method); + } + if (ctx->ip_family & MM_BEARER_IP_FAMILY_IPV6 || + ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4V6) { + ipv6_config = mm_bearer_ip_config_new (); + mm_bearer_ip_config_set_method (ipv6_config, ip_method); + } + g_assert (ipv4_config || ipv6_config); + + g_task_return_pointer ( + task, + mm_bearer_connect_result_new (ctx->data, ipv4_config, ipv6_config), + (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); + + g_clear_object (&ipv4_config); + g_clear_object (&ipv6_config); } +static void +cid_selection_3gpp_ready (MMBroadbandBearer *self, + GAsyncResult *res, + GTask *task) +{ + DetailedConnectContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + /* Keep CID around after initializing the PDP context in order to + * handle corresponding unsolicited PDP activation responses. */ + self->priv->cid = MM_BROADBAND_BEARER_GET_CLASS (self)->cid_selection_3gpp_finish (self, res, &error); + if (!self->priv->cid) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + MM_BROADBAND_BEARER_GET_CLASS (self)->dial_3gpp (self, + ctx->modem, + ctx->primary, + self->priv->cid, + g_task_get_cancellable (task), + (GAsyncReadyCallback) dial_3gpp_ready, + task); +} + +static void +connect_3gpp (MMBroadbandBearer *self, + MMBroadbandModem *modem, + MMPortSerialAt *primary, + MMPortSerialAt *secondary, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + DetailedConnectContext *ctx; + GTask *task; + + g_assert (primary != NULL); + + /* Clear CID on every connection attempt */ + self->priv->cid = 0; + + ctx = detailed_connect_context_new (self, modem, primary, secondary); + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_connect_context_free); + + MM_BROADBAND_BEARER_GET_CLASS (self)->cid_selection_3gpp (self, + ctx->modem, + ctx->primary, + cancellable, + (GAsyncReadyCallback)cid_selection_3gpp_ready, + task); +} + +/*****************************************************************************/ +/* CONNECT */ + static MMBearerConnectResult * connect_finish (MMBaseBearer *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return mm_bearer_connect_result_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void -connect_succeeded (ConnectContext *ctx, +connect_succeeded (GTask *task, ConnectionType connection_type, MMBearerConnectResult *result) { + MMBroadbandBearer *self; + + self = g_task_get_source_object (task); + /* Keep connected port and type of connection */ - ctx->self->priv->port = g_object_ref (mm_bearer_connect_result_peek_data (result)); - ctx->self->priv->connection_type = connection_type; + self->priv->port = g_object_ref (mm_bearer_connect_result_peek_data (result)); + self->priv->connection_type = connection_type; /* Port is connected; update the state. For ATD based connections, the port * may already be set as connected, but no big deal. */ - mm_port_set_connected (ctx->self->priv->port, TRUE); + mm_port_set_connected (self->priv->port, TRUE); /* Set operation result */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - result, - (GDestroyNotify)mm_bearer_connect_result_unref); - connect_context_complete_and_free (ctx); + g_task_return_pointer (task, + result, + (GDestroyNotify)mm_bearer_connect_result_unref); + g_object_unref (task); } static void connect_cdma_ready (MMBroadbandBearer *self, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { MMBearerConnectResult *result; GError *error = NULL; result = MM_BROADBAND_BEARER_GET_CLASS (self)->connect_cdma_finish (self, res, &error); if (!result) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* take result */ - connect_succeeded (ctx, CONNECTION_TYPE_CDMA, result); + connect_succeeded (task, CONNECTION_TYPE_CDMA, result); } static void connect_3gpp_ready (MMBroadbandBearer *self, GAsyncResult *res, - ConnectContext *ctx) + GTask *task) { MMBearerConnectResult *result; GError *error = NULL; result = MM_BROADBAND_BEARER_GET_CLASS (self)->connect_3gpp_finish (self, res, &error); if (!result) { - g_simple_async_result_take_error (ctx->result, error); - connect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* take result */ - connect_succeeded (ctx, CONNECTION_TYPE_3GPP, result); + connect_succeeded (task, CONNECTION_TYPE_3GPP, result); } static void @@ -1154,15 +1201,16 @@ { MMBaseModem *modem = NULL; MMPortSerialAt *primary; - ConnectContext *ctx; const gchar *apn; + GTask *task; /* Don't try to connect if already connected */ if (MM_BROADBAND_BEARER (self)->priv->port) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + connect, MM_CORE_ERROR, MM_CORE_ERROR_CONNECTED, "Couldn't connect: this bearer is already connected"); @@ -1178,10 +1226,11 @@ /* We will launch the ATD call in the primary port... */ primary = mm_base_modem_peek_port_primary (modem); if (!primary) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + connect, MM_CORE_ERROR, MM_CORE_ERROR_CONNECTED, "Couldn't connect: couldn't get primary port"); @@ -1191,10 +1240,11 @@ /* ...only if not already connected */ if (mm_port_get_connected (MM_PORT (primary))) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + connect, MM_CORE_ERROR, MM_CORE_ERROR_CONNECTED, "Couldn't connect: primary AT port is already connected"); @@ -1226,10 +1276,11 @@ /* Is this a 3GPP only modem and no APN was given? If so, error */ if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + connect, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "3GPP connection logic requires APN setting"); @@ -1239,10 +1290,11 @@ /* Is this a 3GPP2 only modem and APN was given? If so, error */ if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (modem)) && apn) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + connect, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "3GPP2 doesn't support APN setting"); @@ -1251,12 +1303,7 @@ } /* In this context, we only keep the stuff we'll need later */ - ctx = g_slice_new0 (ConnectContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - connect); + task = g_task_new (self, cancellable, callback, user_data); /* If the modem has 3GPP capabilities and an APN, launch 3GPP-based connection */ if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (modem)) && apn) { @@ -1268,7 +1315,7 @@ mm_base_modem_peek_port_secondary (modem), cancellable, (GAsyncReadyCallback) connect_3gpp_ready, - ctx); + task); g_object_unref (modem); return; } @@ -1283,7 +1330,7 @@ mm_base_modem_peek_port_secondary (modem), cancellable, (GAsyncReadyCallback) connect_cdma_ready, - ctx); + task); g_object_unref (modem); return; } @@ -1295,12 +1342,10 @@ /* Detailed disconnect context, used in both CDMA and 3GPP sequences */ typedef struct { - MMBroadbandBearer *self; MMBaseModem *modem; MMPortSerialAt *primary; MMPortSerialAt *secondary; MMPort *data; - GSimpleAsyncResult *result; /* 3GPP-specific */ gchar *cgact_command; @@ -1312,46 +1357,35 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -detailed_disconnect_context_complete_and_free (DetailedDisconnectContext *ctx) +detailed_disconnect_context_free (DetailedDisconnectContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->cgact_command) - g_free (ctx->cgact_command); - g_object_unref (ctx->result); + g_free (ctx->cgact_command); g_object_unref (ctx->data); g_object_unref (ctx->primary); if (ctx->secondary) g_object_unref (ctx->secondary); - g_object_unref (ctx->self); g_object_unref (ctx->modem); g_free (ctx); } static DetailedDisconnectContext * -detailed_disconnect_context_new (MMBroadbandBearer *self, - MMBroadbandModem *modem, +detailed_disconnect_context_new (MMBroadbandModem *modem, MMPortSerialAt *primary, MMPortSerialAt *secondary, - MMPort *data, - GAsyncReadyCallback callback, - gpointer user_data) + MMPort *data) { DetailedDisconnectContext *ctx; ctx = g_new0 (DetailedDisconnectContext, 1); - ctx->self = g_object_ref (self); ctx->modem = MM_BASE_MODEM (g_object_ref (modem)); ctx->primary = g_object_ref (primary); ctx->secondary = (secondary ? g_object_ref (secondary) : NULL); ctx->data = g_object_ref (data); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - detailed_disconnect_context_new); + return ctx; } @@ -1361,7 +1395,7 @@ static void data_flash_cdma_ready (MMPortSerial *data, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { GError *error = NULL; @@ -1385,8 +1419,8 @@ MM_SERIAL_ERROR, MM_SERIAL_ERROR_FLASH_FAILED)) { /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1394,31 +1428,39 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + /* Run init port sequence in the data port */ + mm_port_serial_at_run_init_sequence (MM_PORT_SERIAL_AT (data)); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void data_reopen_cdma_ready (MMPortSerial *data, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { + DetailedDisconnectContext *ctx; GError *error = NULL; + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, TRUE, NULL); + if (!mm_port_serial_reopen_finish (data, res, &error)) { /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Just flash the data port */ mm_dbg ("Flashing data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_flash (MM_PORT_SERIAL (ctx->data), 1000, TRUE, (GAsyncReadyCallback)data_flash_cdma_ready, - ctx); + task); } static void @@ -1431,26 +1473,28 @@ gpointer user_data) { DetailedDisconnectContext *ctx; + GTask *task; g_assert (primary != NULL); /* Generic CDMA plays only with SERIAL data ports */ g_assert (MM_IS_PORT_SERIAL (data)); - ctx = detailed_disconnect_context_new (self, - modem, - primary, - secondary, - data, - callback, - user_data); + ctx = detailed_disconnect_context_new (modem, primary, secondary, data); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_disconnect_context_free); + + /* We don't want to run init sequence right away during the reopen, as we're + * going to flash afterwards. */ + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, FALSE, NULL); /* Fully reopen the port before flashing */ mm_dbg ("Reopening data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_reopen (MM_PORT_SERIAL (ctx->data), 1000, (GAsyncReadyCallback)data_reopen_cdma_ready, - ctx); + task); } /*****************************************************************************/ @@ -1459,7 +1503,7 @@ static void cgact_data_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { GError *error = NULL; @@ -1471,17 +1515,20 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void data_flash_3gpp_ready (MMPortSerial *data, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { + DetailedDisconnectContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_port_serial_flash_finish (data, res, &error); /* We kept the serial port open during connection, now we close that open @@ -1502,8 +1549,8 @@ MM_SERIAL_ERROR, MM_SERIAL_ERROR_FLASH_FAILED)) { /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1511,12 +1558,15 @@ g_error_free (error); } + /* Run init port sequence in the data port */ + mm_port_serial_at_run_init_sequence (MM_PORT_SERIAL_AT (data)); + /* Don't bother doing the CGACT again if it was already done on the * primary or secondary port */ if (ctx->cgact_sent) { mm_dbg ("PDP disconnection already sent"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1538,50 +1588,66 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)cgact_data_ready, - ctx); + task); } static void data_reopen_3gpp_ready (MMPortSerial *data, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { + DetailedDisconnectContext *ctx; GError *error = NULL; + g_object_set (data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, TRUE, NULL); + if (!mm_port_serial_reopen_finish (data, res, &error)) { /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - detailed_disconnect_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Just flash the data port */ mm_dbg ("Flashing data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_flash (MM_PORT_SERIAL (ctx->data), 1000, TRUE, (GAsyncReadyCallback)data_flash_3gpp_ready, - ctx); + task); } static void -data_reopen_3gpp (DetailedDisconnectContext *ctx) +data_reopen_3gpp (GTask *task) { + DetailedDisconnectContext *ctx; + + ctx = g_task_get_task_data (task); + + /* We don't want to run init sequence right away during the reopen, as we're + * going to flash afterwards. */ + g_object_set (ctx->data, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, FALSE, NULL); + /* Fully reopen the port before flashing */ mm_dbg ("Reopening data port (%s)...", mm_port_get_device (MM_PORT (ctx->data))); mm_port_serial_reopen (MM_PORT_SERIAL (ctx->data), 1000, (GAsyncReadyCallback)data_reopen_3gpp_ready, - ctx); + task); } static void cgact_ready (MMBaseModem *modem, GAsyncResult *res, - DetailedDisconnectContext *ctx) + GTask *task) { + DetailedDisconnectContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_full_finish (modem, res, &error); if (!error) ctx->cgact_sent = TRUE; @@ -1590,7 +1656,7 @@ g_error_free (error); } - data_reopen_3gpp (ctx); + data_reopen_3gpp (task); } static void @@ -1604,25 +1670,23 @@ gpointer user_data) { DetailedDisconnectContext *ctx; + GTask *task; g_assert (primary != NULL); /* Generic 3GPP plays only with SERIAL data ports */ g_assert (MM_IS_PORT_SERIAL (data)); - ctx = detailed_disconnect_context_new (self, - modem, - primary, - secondary, - data, - callback, - user_data); + ctx = detailed_disconnect_context_new (modem, primary, secondary, data); /* If no specific CID was used, disable all PDP contexts */ ctx->cgact_command = (cid > 0 ? g_strdup_printf ("+CGACT=0,%d", cid) : g_strdup_printf ("+CGACT=0")); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_disconnect_context_free); + /* If the primary port is NOT connected (doesn't have to be the data port), * we'll send CGACT there */ if (!mm_port_get_connected (MM_PORT (ctx->primary))) { @@ -1635,7 +1699,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)cgact_ready, - ctx); + task); return; } @@ -1654,39 +1718,23 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)cgact_ready, - ctx); + task); return; } /* If no secondary port, go on to reopen & flash the data/primary port */ - data_reopen_3gpp (ctx); + data_reopen_3gpp (task); } /*****************************************************************************/ /* DISCONNECT */ -typedef struct { - MMBroadbandBearer *self; - GSimpleAsyncResult *result; - MMPort *data; -} DisconnectContext; - -static void -disconnect_context_complete_and_free (DisconnectContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->data); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean disconnect_finish (MMBaseBearer *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -1706,56 +1754,47 @@ } static void -disconnect_succeeded (DisconnectContext *ctx) -{ - /* Cleanup all connection related data */ - reset_bearer_connection (ctx->self); - - /* Set operation result */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disconnect_context_complete_and_free (ctx); -} - -static void -disconnect_failed (DisconnectContext *ctx, - GError *error) -{ - g_simple_async_result_take_error (ctx->result, error); - disconnect_context_complete_and_free (ctx); -} - -static void disconnect_cdma_ready (MMBroadbandBearer *self, GAsyncResult *res, - DisconnectContext *ctx) + GTask *task) { GError *error = NULL; if (!MM_BROADBAND_BEARER_GET_CLASS (self)->disconnect_cdma_finish (self, res, &error)) - disconnect_failed (ctx, error); - else - disconnect_succeeded (ctx); + g_task_return_error (task, error); + else { + /* Cleanup all connection related data */ + reset_bearer_connection (self); + + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); } static void disconnect_3gpp_ready (MMBroadbandBearer *self, GAsyncResult *res, - DisconnectContext *ctx) + GTask *task) { GError *error = NULL; if (!MM_BROADBAND_BEARER_GET_CLASS (self)->disconnect_3gpp_finish (self, res, &error)) - disconnect_failed (ctx, error); + g_task_return_error (task, error); else { /* Clear CID if we got any set */ - if (ctx->self->priv->cid) - ctx->self->priv->cid = 0; - disconnect_succeeded (ctx); + if (self->priv->cid) + self->priv->cid = 0; + + /* Cleanup all connection related data */ + reset_bearer_connection (self); + + g_task_return_boolean (task, TRUE); } + g_object_unref (task); } static void @@ -1765,13 +1804,14 @@ { MMPortSerialAt *primary; MMBaseModem *modem = NULL; - DisconnectContext *ctx; + GTask *task; if (!MM_BROADBAND_BEARER (self)->priv->port) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + disconnect, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't disconnect: this bearer is not connected"); @@ -1786,10 +1826,11 @@ /* We need the primary port to disconnect... */ primary = mm_base_modem_peek_port_primary (modem); if (!primary) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + disconnect, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't disconnect: couldn't get primary port"); @@ -1797,14 +1838,7 @@ return; } - /* In this context, we only keep the stuff we'll need later */ - ctx = g_new0 (DisconnectContext, 1); - ctx->self = g_object_ref (self); - ctx->data = g_object_ref (MM_BROADBAND_BEARER (self)->priv->port); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disconnect); + task = g_task_new (self, NULL, callback , user_data); switch (MM_BROADBAND_BEARER (self)->priv->connection_type) { case CONNECTION_TYPE_3GPP: @@ -1816,7 +1850,7 @@ MM_BROADBAND_BEARER (self)->priv->port, MM_BROADBAND_BEARER (self)->priv->cid, (GAsyncReadyCallback) disconnect_3gpp_ready, - ctx); + task); break; case CONNECTION_TYPE_CDMA: @@ -1827,7 +1861,7 @@ mm_base_modem_peek_port_secondary (modem), MM_BROADBAND_BEARER (self)->priv->port, (GAsyncReadyCallback) disconnect_cdma_ready, - ctx); + task); break; case CONNECTION_TYPE_NONE: @@ -1838,6 +1872,127 @@ } /*****************************************************************************/ +/* Connection status monitoring */ + +static MMBearerConnectionStatus +load_connection_status_finish (MMBaseBearer *bearer, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_CONNECTION_STATUS_UNKNOWN; + } + return (MMBearerConnectionStatus)value; +} + +static void +cgact_periodic_query_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandBearer *self; + const gchar *response; + GError *error = NULL; + GList *pdp_active_list = NULL; + GList *l; + MMBearerConnectionStatus status = MM_BEARER_CONNECTION_STATUS_UNKNOWN; + + self = MM_BROADBAND_BEARER (g_task_get_source_object (task)); + + response = mm_base_modem_at_command_finish (modem, res, &error); + if (response) + pdp_active_list = mm_3gpp_parse_cgact_read_response (response, &error); + + if (error) { + g_assert (!pdp_active_list); + g_prefix_error (&error, "Couldn't check current list of active PDP contexts: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + for (l = pdp_active_list; l; l = g_list_next (l)) { + MM3gppPdpContextActive *pdp_active; + + /* We look for he just assume the first active PDP context found is the one we're + * looking for. */ + pdp_active = (MM3gppPdpContextActive *)(l->data); + if (pdp_active->cid == self->priv->cid) { + status = (pdp_active->active ? MM_BEARER_CONNECTION_STATUS_CONNECTED : MM_BEARER_CONNECTION_STATUS_DISCONNECTED); + break; + } + } + mm_3gpp_pdp_context_active_list_free (pdp_active_list); + + /* PDP context not found? This shouldn't happen, error out */ + if (status == MM_BEARER_CONNECTION_STATUS_UNKNOWN) + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "PDP context not found in the known contexts list"); + else + g_task_return_int (task, (gssize) status); + g_object_unref (task); +} + +static void +load_connection_status (MMBaseBearer *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MMBaseModem *modem = NULL; + MMPortSerialAt *port; + + task = g_task_new (self, NULL, callback, user_data); + + g_object_get (MM_BASE_BEARER (self), + MM_BASE_BEARER_MODEM, &modem, + NULL); + + /* No connection status checks on CDMA-only */ + if (MM_BROADBAND_BEARER (self)->priv->connection_type == CONNECTION_TYPE_CDMA) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't load connection status: unsupported in CDMA"); + g_object_unref (task); + goto out; + } + + /* If CID not defined, error out */ + if (!MM_BROADBAND_BEARER (self)->priv->cid) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't load connection status: cid not defined"); + g_object_unref (task); + goto out; + } + + /* If no control port available, error out */ + port = mm_base_modem_peek_best_at_port (modem, NULL); + if (!port) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Couldn't load connection status: no control port available"); + g_object_unref (task); + goto out; + } + + mm_base_modem_at_command_full (MM_BASE_MODEM (modem), + port, + "+CGACT?", + 3, + FALSE, /* allow cached */ + FALSE, /* raw */ + NULL, /* cancellable */ + (GAsyncReadyCallback) cgact_periodic_query_ready, + task); + +out: + g_clear_object (&modem); +} + +/*****************************************************************************/ static void report_connection_status (MMBaseBearer *self, @@ -1856,7 +2011,7 @@ /*****************************************************************************/ typedef struct _InitAsyncContext InitAsyncContext; -static void interface_initialization_step (InitAsyncContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -1865,28 +2020,19 @@ } InitializationStep; struct _InitAsyncContext { - MMBroadbandBearer *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; MMBaseModem *modem; InitializationStep step; MMPortSerialAt *port; }; static void -init_async_context_free (InitAsyncContext *ctx, - gboolean close_port) +init_async_context_free (InitAsyncContext *ctx) { if (ctx->port) { - if (close_port) - mm_port_serial_close (MM_PORT_SERIAL (ctx->port)); + mm_port_serial_close (MM_PORT_SERIAL (ctx->port)); g_object_unref (ctx->port); } - g_object_unref (ctx->self); g_object_unref (ctx->modem); - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_free (ctx); } @@ -1915,22 +2061,26 @@ GAsyncResult *result, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error); + return g_task_propagate_boolean (G_TASK (result), error); } static void crm_range_ready (MMBaseModem *modem, GAsyncResult *res, - InitAsyncContext *ctx) + GTask *task) { + MMBroadbandModem *self; + InitAsyncContext *ctx; GError *error = NULL; const gchar *response; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_full_finish (modem, res, &error); if (error) { /* We should possibly take this error as fatal. If we were told to use a * specific Rm protocol, we must be able to check if it is supported. */ - g_simple_async_result_take_error (ctx->result, error); } else { MMModemCdmaRmProtocol min = MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN; MMModemCdmaRmProtocol max = MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN; @@ -1940,13 +2090,14 @@ &error)) { MMModemCdmaRmProtocol current; - current = mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); + current = mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (self))); /* Check if value within the range */ if (current >= min && current <= max) { /* Fine, go on with next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); + return; } g_assert (error == NULL); @@ -1955,18 +2106,22 @@ "Requested RM protocol '%s' is not supported", mm_modem_cdma_rm_protocol_get_string (current)); } - /* Failed, set as fatal as well */ - g_simple_async_result_take_error (ctx->result, error); } - g_simple_async_result_complete (ctx->result); - init_async_context_free (ctx, TRUE); + g_task_return_error (task, error); + g_object_unref (task); } static void -interface_initialization_step (InitAsyncContext *ctx) +interface_initialization_step (GTask *task) { + MMBroadbandModem *self; + InitAsyncContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case INITIALIZATION_STEP_FIRST: /* Fall down to next step */ @@ -1977,7 +2132,7 @@ * supported. */ if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->modem)) && mm_bearer_properties_get_rm_protocol ( - mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))) != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) { + mm_base_bearer_peek_config (MM_BASE_BEARER (self))) != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) { mm_base_modem_at_command_full (ctx->modem, ctx->port, "+CRM=?", @@ -1986,7 +2141,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)crm_range_ready, - ctx); + task); return; } @@ -1995,9 +2150,8 @@ case INITIALIZATION_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - g_simple_async_result_complete_in_idle (ctx->result); - init_async_context_free (ctx, TRUE); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -2012,41 +2166,38 @@ gpointer user_data) { InitAsyncContext *ctx; + GTask *task; GError *error = NULL; ctx = g_new0 (InitAsyncContext, 1); - ctx->self = g_object_ref (initable); - ctx->result = g_simple_async_result_new (G_OBJECT (initable), - callback, - user_data, - initable_init_async); - ctx->cancellable = (cancellable ? - g_object_ref (cancellable) : - NULL); - g_object_get (initable, MM_BASE_BEARER_MODEM, &ctx->modem, NULL); + task = g_task_new (MM_BROADBAND_BEARER (initable), + cancellable, + callback, + user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)init_async_context_free); + ctx->port = mm_base_modem_get_port_primary (ctx->modem); if (!ctx->port) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get primary port"); - g_simple_async_result_complete_in_idle (ctx->result); - init_async_context_free (ctx, FALSE); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get primary port"); + g_object_unref (task); return; } if (!mm_port_serial_open (MM_PORT_SERIAL (ctx->port), &error)) { - g_simple_async_result_take_error (ctx->result, error); - g_simple_async_result_complete_in_idle (ctx->result); - init_async_context_free (ctx, FALSE); + g_clear_object (&ctx->port); + g_task_return_error (task, error); + g_object_unref (task); return; } - interface_initialization_step (ctx); + interface_initialization_step (task); } void @@ -2056,18 +2207,62 @@ GAsyncReadyCallback callback, gpointer user_data) { + MMFlowControl flow_control; + + /* Inherit flow control from modem object directly */ + g_object_get (modem, + MM_BROADBAND_MODEM_FLOW_CONTROL, &flow_control, + NULL); + g_async_initable_new_async ( MM_TYPE_BROADBAND_BEARER, G_PRIORITY_DEFAULT, cancellable, callback, user_data, - MM_BASE_BEARER_MODEM, modem, - MM_BASE_BEARER_CONFIG, properties, + MM_BASE_BEARER_MODEM, modem, + MM_BASE_BEARER_CONFIG, properties, + MM_BROADBAND_BEARER_FLOW_CONTROL, flow_control, NULL); } static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMBroadbandBearer *self = MM_BROADBAND_BEARER (object); + + switch (prop_id) { + case PROP_FLOW_CONTROL: + self->priv->flow_control = g_value_get_flags (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMBroadbandBearer *self = MM_BROADBAND_BEARER (object); + + switch (prop_id) { + case PROP_FLOW_CONTROL: + g_value_set_flags (value, self->priv->flow_control); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void mm_broadband_bearer_init (MMBroadbandBearer *self) { /* Initialize private data */ @@ -2077,6 +2272,7 @@ /* Set defaults */ self->priv->connection_type = CONNECTION_TYPE_NONE; + self->priv->flow_control = MM_FLOW_CONTROL_NONE; } static void @@ -2104,19 +2300,24 @@ g_type_class_add_private (object_class, sizeof (MMBroadbandBearerPrivate)); - /* Virtual methods */ - object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->dispose = dispose; base_bearer_class->connect = connect; base_bearer_class->connect_finish = connect_finish; base_bearer_class->disconnect = disconnect; base_bearer_class->disconnect_finish = disconnect_finish; base_bearer_class->report_connection_status = report_connection_status; + base_bearer_class->load_connection_status = load_connection_status; + base_bearer_class->load_connection_status_finish = load_connection_status_finish; klass->connect_3gpp = connect_3gpp; klass->connect_3gpp_finish = detailed_connect_finish; klass->dial_3gpp = dial_3gpp; klass->dial_3gpp_finish = dial_3gpp_finish; + klass->cid_selection_3gpp = cid_selection_3gpp; + klass->cid_selection_3gpp_finish = cid_selection_3gpp_finish; klass->connect_cdma = connect_cdma; klass->connect_cdma_finish = detailed_connect_finish; @@ -2125,4 +2326,13 @@ klass->disconnect_3gpp_finish = detailed_disconnect_finish; klass->disconnect_cdma = disconnect_cdma; klass->disconnect_cdma_finish = detailed_disconnect_finish; + + properties[PROP_FLOW_CONTROL] = + g_param_spec_flags (MM_BROADBAND_BEARER_FLOW_CONTROL, + "Flow control", + "Flow control settings to use during connection", + MM_TYPE_FLOW_CONTROL, + MM_FLOW_CONTROL_NONE, + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_FLOW_CONTROL, properties[PROP_FLOW_CONTROL]); } diff -Nru modemmanager-1.6.8/src/mm-broadband-bearer.h modemmanager-1.10.0/src/mm-broadband-bearer.h --- modemmanager-1.6.8/src/mm-broadband-bearer.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-bearer.h 2018-11-15 09:55:53.000000000 +0100 @@ -25,6 +25,7 @@ #define _LIBMM_INSIDE_MM #include +#include "mm-modem-helpers.h" #include "mm-base-bearer.h" #include "mm-broadband-modem.h" @@ -39,6 +40,8 @@ typedef struct _MMBroadbandBearerClass MMBroadbandBearerClass; typedef struct _MMBroadbandBearerPrivate MMBroadbandBearerPrivate; +#define MM_BROADBAND_BEARER_FLOW_CONTROL "broadband-bearer-flow-control" + struct _MMBroadbandBearer { MMBaseBearer parent; MMBroadbandBearerPrivate *priv; @@ -47,7 +50,7 @@ struct _MMBroadbandBearerClass { MMBaseBearerClass parent; - /* Full 3GPP connection sequence */ + /* Full 3GPP connection sequence (cid selection, dial, get ip config) */ void (* connect_3gpp) (MMBroadbandBearer *self, MMBroadbandModem *modem, MMPortSerialAt *primary, @@ -59,6 +62,17 @@ GAsyncResult *res, GError **error); + /* CID selection sub-part of 3GPP connection */ + void (* cid_selection_3gpp) (MMBroadbandBearer *self, + MMBaseModem *modem, + MMPortSerialAt *primary, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + guint (* cid_selection_3gpp_finish) (MMBroadbandBearer *self, + GAsyncResult *res, + GError **error); + /* Dialing sub-part of 3GPP connection */ void (* dial_3gpp) (MMBroadbandBearer *self, MMBaseModem *modem, diff -Nru modemmanager-1.6.8/src/mm-broadband-modem.c modemmanager-1.10.0/src/mm-broadband-modem.c --- modemmanager-1.6.8/src/mm-broadband-modem.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-modem.c 2019-01-15 15:57:35.000000000 +0100 @@ -53,6 +53,9 @@ #include "mm-port-serial-qcdm.h" #include "libqcdm/src/errors.h" #include "libqcdm/src/commands.h" +#include "libqcdm/src/logs.h" +#include "libqcdm/src/log-items.h" +#include "mm-helper-enums-types.h" static void iface_modem_init (MMIfaceModem *iface); static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface); @@ -103,6 +106,7 @@ PROP_MODEM_3GPP_PS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS, + PROP_MODEM_3GPP_INITIAL_EPS_BEARER, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, PROP_MODEM_CDMA_EVDO_REGISTRATION_STATE, PROP_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED, @@ -112,9 +116,15 @@ PROP_MODEM_MESSAGING_SMS_DEFAULT_STORAGE, PROP_MODEM_VOICE_CALL_LIST, PROP_MODEM_SIMPLE_STATUS, + PROP_MODEM_SIM_HOT_SWAP_SUPPORTED, + PROP_MODEM_SIM_HOT_SWAP_CONFIGURED, + PROP_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, + PROP_FLOW_CONTROL, PROP_LAST }; +static GParamSpec *properties[PROP_LAST]; + /* When CIND is supported, invalid indicators are marked with this value */ #define CIND_INDICATOR_INVALID 255 #define CIND_INDICATOR_IS_VALID(u) (u != CIND_INDICATOR_INVALID) @@ -124,7 +134,11 @@ struct _MMBroadbandModemPrivate { /* Broadband modem specific implementation */ PortsContext *enabled_ports_ctx; + PortsContext *sim_hot_swap_ports_ctx; gboolean modem_init_run; + gboolean sim_hot_swap_supported; + gboolean sim_hot_swap_configured; + gboolean periodic_signal_check_disabled; /*<--- Modem interface --->*/ /* Properties */ @@ -141,6 +155,12 @@ guint modem_cind_max_signal_quality; guint modem_cind_indicator_roaming; guint modem_cind_indicator_service; + MM3gppCmerMode modem_cmer_enable_mode; + MM3gppCmerMode modem_cmer_disable_mode; + MM3gppCmerInd modem_cmer_ind; + gboolean modem_cgerep_support_checked; + gboolean modem_cgerep_supported; + MMFlowControl flow_control; /*<--- Modem 3GPP interface --->*/ /* Properties */ @@ -152,13 +172,14 @@ /* Implementation helpers */ GPtrArray *modem_3gpp_registration_regex; MMModem3gppFacility modem_3gpp_ignored_facility_locks; + MMBaseBearer *modem_3gpp_initial_eps_bearer; /*<--- Modem 3GPP USSD interface --->*/ /* Properties */ GObject *modem_3gpp_ussd_dbus_skeleton; /* Implementation helpers */ gboolean use_unencoded_ussd; - GSimpleAsyncResult *pending_ussd_action; + GTask *pending_ussd_action; /*<--- Modem CDMA interface --->*/ /* Properties */ @@ -172,6 +193,7 @@ gboolean checked_sprint_support; gboolean has_spservice; gboolean has_speri; + gint evdo_pilot_rssi; /*<--- Modem Simple interface --->*/ /* Properties */ @@ -249,34 +271,23 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void broadband_bearer_new_ready (GObject *source, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBaseBearer *bearer = NULL; GError *error = NULL; bearer = mm_broadband_bearer_new_finish (res, &error); if (!bearer) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, - bearer, - (GDestroyNotify)g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } static void @@ -285,13 +296,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - /* Set a new ref to the bearer object as result */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); /* We just create a MMBroadbandBearer */ mm_dbg ("Creating Broadband bearer in broadband modem"); @@ -299,7 +306,7 @@ properties, NULL, /* cancellable */ (GAsyncReadyCallback)broadband_bearer_new_ready, - result); + task); } /*****************************************************************************/ @@ -329,22 +336,17 @@ /* Capabilities loading (Modem interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMModemCapability caps; MMPortSerialQcdm *qcdm_port; } LoadCapabilitiesContext; static void -load_capabilities_context_complete_and_free (LoadCapabilitiesContext *ctx) +load_capabilities_context_free (LoadCapabilitiesContext *ctx) { - g_simple_async_result_complete (ctx->result); if (ctx->qcdm_port) { mm_port_serial_close (MM_PORT_SERIAL (ctx->qcdm_port)); g_object_unref (ctx->qcdm_port); } - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (LoadCapabilitiesContext, ctx); } @@ -353,28 +355,29 @@ GAsyncResult *res, GError **error) { - MMModemCapability caps; - gchar *caps_str; + GError *inner_error = NULL; + gssize value; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return MM_MODEM_CAPABILITY_NONE; - - caps = (MMModemCapability) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - caps_str = mm_modem_capability_build_string_from_mask (caps); - mm_dbg ("loaded current capabilities: %s", caps_str); - g_free (caps_str); - return caps; + } + return (MMModemCapability)value; } static void current_capabilities_ws46_test_ready (MMBaseModem *self, GAsyncResult *res, - LoadCapabilitiesContext *ctx) + GTask *task) { + LoadCapabilitiesContext *ctx; const gchar *response; GArray *modes; guint i; + ctx = g_task_get_task_data (task); + /* Completely ignore errors in AT+WS46=? */ response = mm_base_modem_at_command_finish (self, res, NULL); if (!response) @@ -409,11 +412,8 @@ g_array_unref (modes); out: - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (ctx->caps), - NULL); - load_capabilities_context_complete_and_free (ctx); + g_task_return_int (task, ctx->caps); + g_object_unref (task); } typedef struct { @@ -487,8 +487,18 @@ GVariant **result, GError **result_error) { - if (!response) + if (!response) { + if (error && + (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED) || + g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE) || + g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY) || + g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG))) { + /* At least, it's a GSM modem */ + *result = g_variant_new_uint32 (MM_MODEM_CAPABILITY_GSM_UMTS); + return TRUE; + } return FALSE; + } if (strcasestr (response, "SIM PIN") || strcasestr (response, "SIM PUK") || @@ -549,23 +559,25 @@ static void capabilities_sequence_ready (MMBaseModem *self, GAsyncResult *res, - LoadCapabilitiesContext *ctx) + GTask *task) { + LoadCapabilitiesContext *ctx; GError *error = NULL; GVariant *result; + ctx = g_task_get_task_data (task); + result = mm_base_modem_at_sequence_finish (self, res, NULL, &error); if (!result) { if (error) - g_simple_async_result_take_error (ctx->result, error); - else { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s", - "Failed to determine modem capabilities."); - } - load_capabilities_context_complete_and_free (ctx); + g_task_return_error (task, error); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "%s", + "Failed to determine modem capabilities."); + g_object_unref (task); return; } @@ -586,47 +598,51 @@ if (ctx->caps & MM_MODEM_CAPABILITY_GSM_UMTS && !(ctx->caps & MM_MODEM_CAPABILITY_LTE)) { mm_base_modem_at_command ( - MM_BASE_MODEM (ctx->self), + self, "+WS46=?", 3, TRUE, /* allow caching, it's a test command */ (GAsyncReadyCallback)current_capabilities_ws46_test_ready, - ctx); + task); return; } /* Otherwise, just set the already retrieved capabilities */ - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (ctx->caps), - NULL); - load_capabilities_context_complete_and_free (ctx); + g_task_return_int (task, ctx->caps); + g_object_unref (task); } static void -load_current_capabilities_at (LoadCapabilitiesContext *ctx) +load_current_capabilities_at (GTask *task) { + MMBroadbandModem *self; + + self = g_task_get_source_object (task); + /* Launch sequence, we will expect a "u" GVariant */ mm_base_modem_at_sequence ( - MM_BASE_MODEM (ctx->self), + MM_BASE_MODEM (self), capabilities, NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)capabilities_sequence_ready, - ctx); + task); } static void mode_pref_qcdm_ready (MMPortSerialQcdm *port, GAsyncResult *res, - LoadCapabilitiesContext *ctx) + GTask *task) { + LoadCapabilitiesContext *ctx; QcdmResult *result; gint err = QCDM_SUCCESS; - u_int8_t pref = 0; + uint8_t pref = 0; GError *error = NULL; GByteArray *response; + ctx = g_task_get_task_data (task); + response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { /* Fall back to AT checking */ @@ -681,25 +697,27 @@ } if (ctx->caps != MM_MODEM_CAPABILITY_NONE) { - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (ctx->caps), - NULL); - load_capabilities_context_complete_and_free (ctx); + g_task_return_int (task, ctx->caps); + g_object_unref (task); return; } at_caps: - load_current_capabilities_at (ctx); + load_current_capabilities_at (task); } static void -load_current_capabilities_qcdm (LoadCapabilitiesContext *ctx) +load_current_capabilities_qcdm (GTask *task) { + MMBroadbandModem *self; + LoadCapabilitiesContext *ctx; GByteArray *cmd; GError *error = NULL; - ctx->qcdm_port = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (ctx->self)); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + ctx->qcdm_port = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); g_assert (ctx->qcdm_port); if (!mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm_port), &error)) { @@ -707,7 +725,7 @@ error->message); g_error_free (error); ctx->qcdm_port = NULL; - load_current_capabilities_at (ctx); + load_current_capabilities_at (task); return; } @@ -722,7 +740,7 @@ 3, NULL, (GAsyncReadyCallback)mode_pref_qcdm_ready, - ctx); + task); g_byte_array_unref (cmd); } @@ -732,20 +750,19 @@ gpointer user_data) { LoadCapabilitiesContext *ctx; + GTask *task; mm_dbg ("loading current capabilities..."); ctx = g_slice_new0 (LoadCapabilitiesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_capabilities); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_capabilities_context_free); if (mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self))) - load_current_capabilities_qcdm (ctx); + load_current_capabilities_qcdm (task); else - load_current_capabilities_at (ctx); + load_current_capabilities_at (task); } /*****************************************************************************/ @@ -900,7 +917,7 @@ /* Modems put all sorts of things into the GSN response; sanitize it */ if (mm_parse_gsn (equip_id, &imei, &meid, &esn)) { - g_free (equip_id); + g_clear_pointer (&equip_id, g_free); if (imei) equip_id = g_strdup (imei); @@ -908,11 +925,12 @@ equip_id = g_strdup (meid); else if (esn) equip_id = g_strdup (esn); + else + g_assert_not_reached (); + g_free (esn); g_free (meid); g_free (imei); - - g_assert (equip_id); } else { /* Leave whatever the modem returned alone */ } @@ -1036,17 +1054,12 @@ /* Load own numbers (Modem interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMPortSerialQcdm *qcdm; } OwnNumbersContext; static void -own_numbers_context_complete_and_free (OwnNumbersContext *ctx) +own_numbers_context_free (OwnNumbersContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); if (ctx->qcdm) { mm_port_serial_close (MM_PORT_SERIAL (ctx->qcdm)); g_object_unref (ctx->qcdm); @@ -1059,16 +1072,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void mdn_qcdm_ready (MMPortSerialQcdm *port, GAsyncResult *res, - OwnNumbersContext *ctx) + GTask *task) { QcdmResult *result; gint err = QCDM_SUCCESS; @@ -1078,8 +1088,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - own_numbers_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1089,12 +1099,12 @@ &err); g_byte_array_unref (response); if (!result) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse NV MDN command result: %d", - err); - own_numbers_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse NV MDN command result: %d", + err); + g_object_unref (task); return; } @@ -1113,37 +1123,40 @@ valid = g_ascii_isdigit (*p++) || (*p == '+'); if (valid) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_strdupv ((gchar **) numbers), - NULL); + g_task_return_pointer (task, + g_strdupv ((gchar **) numbers), + (GDestroyNotify)g_strfreev); } else { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s", - "MDN from NV memory appears invalid"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "%s", + "MDN from NV memory appears invalid"); } } else { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s", - "Failed retrieve MDN"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "%s", + "Failed retrieve MDN"); } + g_object_unref (task); qcdm_result_unref (result); - own_numbers_context_complete_and_free (ctx); } static void modem_load_own_numbers_done (MMIfaceModem *self, GAsyncResult *res, - OwnNumbersContext *ctx) + GTask *task) { + OwnNumbersContext *ctx; const gchar *result; GError *error = NULL; GStrv numbers; + ctx = g_task_get_task_data (task); + result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!result) { /* try QCDM */ @@ -1161,20 +1174,16 @@ 3, NULL, (GAsyncReadyCallback)mdn_qcdm_ready, - ctx); + task); g_byte_array_unref (mdn); return; } + g_task_return_error (task, error); } else { - numbers = mm_3gpp_parse_cnum_exec_response (result, &error); - if (numbers) - g_simple_async_result_set_op_res_gpointer (ctx->result, numbers, NULL); + numbers = mm_3gpp_parse_cnum_exec_response (result); + g_task_return_pointer (task, numbers, (GDestroyNotify)g_strfreev); } - - if (error) - g_simple_async_result_take_error (ctx->result, error); - - own_numbers_context_complete_and_free (ctx); + g_object_unref (task); } static void @@ -1184,13 +1193,9 @@ { OwnNumbersContext *ctx; GError *error = NULL; + GTask *task; ctx = g_new0 (OwnNumbersContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_own_numbers); ctx->qcdm = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); if (ctx->qcdm) { if (mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm), &error)) { @@ -1203,13 +1208,16 @@ } } + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)own_numbers_context_free); + mm_dbg ("loading own numbers..."); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CNUM", 3, FALSE, (GAsyncReadyCallback)modem_load_own_numbers_done, - ctx); + task); } /*****************************************************************************/ @@ -1246,17 +1254,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCK_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemLock) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCK_UNKNOWN; + } + return (MMModemLock)value; } static void cpin_query_ready (MMIfaceModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemLock lock = MM_MODEM_LOCK_UNKNOWN; @@ -1265,9 +1277,8 @@ result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1295,11 +1306,8 @@ } } - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (lock), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, lock); + g_object_unref (task); } static void @@ -1307,21 +1315,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_required); + task = g_task_new (self, NULL, callback, user_data); /* CDMA-only modems don't need this */ if (mm_iface_modem_is_cdma_only (self)) { mm_dbg ("Skipping unlock check in CDMA-only modem..."); - g_simple_async_result_set_op_res_gpointer (result, - GUINT_TO_POINTER (MM_MODEM_LOCK_NONE), - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, MM_MODEM_LOCK_NONE); + g_object_unref (task); return; } @@ -1331,80 +1333,191 @@ 3, FALSE, (GAsyncReadyCallback)cpin_query_ready, - result); + task); } /*****************************************************************************/ /* Supported modes loading (Modem interface) */ typedef struct { - GSimpleAsyncResult *result; + MMUnlockRetries *retries; + guint i; +} LoadUnlockRetriesContext; + +typedef struct { + MMModemLock lock; + const gchar *command; +} UnlockRetriesMap; + +static const UnlockRetriesMap unlock_retries_map [] = { + { MM_MODEM_LOCK_SIM_PIN, "+CSIM=10,\"0020000100\"" }, + { MM_MODEM_LOCK_SIM_PUK, "+CSIM=10,\"002C000100\"" }, + { MM_MODEM_LOCK_SIM_PIN2, "+CSIM=10,\"0020008100\"" }, + { MM_MODEM_LOCK_SIM_PUK2, "+CSIM=10,\"002C008100\"" }, +}; + +static void +load_unlock_retries_context_free (LoadUnlockRetriesContext *ctx) +{ + g_object_unref (ctx->retries); + g_slice_free (LoadUnlockRetriesContext, ctx); +} + +static MMUnlockRetries * +load_unlock_retries_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void load_unlock_retries_context_step (GTask *task); + +static void +csim_ready (MMBaseModem *self, + GAsyncResult *res, + GTask *task) +{ + LoadUnlockRetriesContext *ctx; + const gchar *response; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (self, res, &error); + if (!response) { + mm_dbg ("Couldn't load retry count for lock '%s': %s", + mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock), + error->message); + g_error_free (error); + } else { + gint val; + GError *error = NULL; + + val = mm_parse_csim_response (response, &error); + if (val < 0) { + mm_warn ("Parse error in step %d: %s.", ctx->i, error->message); + mm_dbg ("Couldn't parse retry count value for lock '%s'", + mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock)); + } else + mm_unlock_retries_set (ctx->retries, unlock_retries_map[ctx->i].lock, val); + } + + /* Go to next lock value */ + ctx->i++; + load_unlock_retries_context_step (task); +} + +static void +load_unlock_retries_context_step (GTask *task) +{ MMBroadbandModem *self; + LoadUnlockRetriesContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + if (ctx->i == G_N_ELEMENTS (unlock_retries_map)) { + g_task_return_pointer (task, g_object_ref (ctx->retries), g_object_unref); + g_object_unref (task); + return; + } + + mm_base_modem_at_command ( + MM_BASE_MODEM (self), + unlock_retries_map[ctx->i].command, + 3, + FALSE, + (GAsyncReadyCallback)csim_ready, + task); +} + +static void +load_unlock_retries (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + LoadUnlockRetriesContext *ctx; + + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_slice_new0 (LoadUnlockRetriesContext); + ctx->retries = mm_unlock_retries_new (); + ctx->i = 0; + g_task_set_task_data (task, ctx, (GDestroyNotify)load_unlock_retries_context_free); + + load_unlock_retries_context_step (task); +} + +/*****************************************************************************/ +/* Supported modes loading (Modem interface) */ + +typedef struct { MMModemMode mode; gboolean run_cnti; gboolean run_ws46; gboolean run_gcap; } LoadSupportedModesContext; -static void -load_supported_modes_context_complete_and_free (LoadSupportedModesContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadSupportedModesContext, ctx); -} - static GArray * modem_load_supported_modes_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { + GError *inner_error = NULL; + gssize value; GArray *modes; MMModemModeCombination mode; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return NULL; + } /* Build a mask with all supported modes */ modes = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); - mode.allowed = (MMModemMode) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + mode.allowed = (MMModemMode) value; mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (modes, mode); return modes; } -static void load_supported_modes_step (LoadSupportedModesContext *ctx); +static void load_supported_modes_step (GTask *task); static void -supported_modes_gcap_ready (MMBaseModem *self, +supported_modes_gcap_ready (MMBaseModem *_self, GAsyncResult *res, - LoadSupportedModesContext *ctx) + GTask *task) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + LoadSupportedModesContext *ctx; const gchar *response; GError *error = NULL; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + ctx = g_task_get_task_data (task); + + response = mm_base_modem_at_command_finish (_self, res, &error); if (!error) { MMModemMode mode = MM_MODEM_MODE_NONE; if (strstr (response, "IS")) { /* IS-856 is the EV-DO family */ if (strstr (response, "856")) { - if (!ctx->self->priv->modem_cdma_evdo_network_supported) { - ctx->self->priv->modem_cdma_evdo_network_supported = TRUE; - g_object_notify (G_OBJECT (ctx->self), MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED); + if (!self->priv->modem_cdma_evdo_network_supported) { + self->priv->modem_cdma_evdo_network_supported = TRUE; + g_object_notify (G_OBJECT (self), MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED); } mm_dbg ("Device allows (CDMA) 3G network mode"); mode |= MM_MODEM_MODE_3G; } /* IS-707 is the 1xRTT family, which we consider as 2G */ if (strstr (response, "707")) { - if (!ctx->self->priv->modem_cdma_cdma1x_network_supported) { - ctx->self->priv->modem_cdma_cdma1x_network_supported = TRUE; - g_object_notify (G_OBJECT (ctx->self), MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED); + if (!self->priv->modem_cdma_cdma1x_network_supported) { + self->priv->modem_cdma_cdma1x_network_supported = TRUE; + g_object_notify (G_OBJECT (self), MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED); } mm_dbg ("Device allows (CDMA) 2G network mode"); mode |= MM_MODEM_MODE_2G; @@ -1429,11 +1542,11 @@ g_error_free (error); /* Use defaults */ - if (ctx->self->priv->modem_cdma_cdma1x_network_supported) { + if (self->priv->modem_cdma_cdma1x_network_supported) { mm_dbg ("Assuming device allows (CDMA) 2G network mode"); ctx->mode |= MM_MODEM_MODE_2G; } - if (ctx->self->priv->modem_cdma_evdo_network_supported) { + if (self->priv->modem_cdma_evdo_network_supported) { mm_dbg ("Assuming device allows (CDMA) 3G network mode"); ctx->mode |= MM_MODEM_MODE_3G; } @@ -1441,19 +1554,22 @@ /* Now keep on with the loading, we're probably finishing now */ ctx->run_gcap = FALSE; - load_supported_modes_step (ctx); + load_supported_modes_step (task); } static void supported_modes_ws46_test_ready (MMBroadbandModem *self, GAsyncResult *res, - LoadSupportedModesContext *ctx) + GTask *task) { + LoadSupportedModesContext *ctx; const gchar *response; GArray *modes; GError *error = NULL; guint i; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { mm_dbg ("Generic query of supported 3GPP networks with WS46=? failed: '%s'", error->message); @@ -1486,17 +1602,20 @@ out: /* Now keep on with the loading, we may need CDMA-specific checks */ ctx->run_ws46 = FALSE; - load_supported_modes_step (ctx); + load_supported_modes_step (task); } static void supported_modes_cnti_ready (MMBroadbandModem *self, GAsyncResult *res, - LoadSupportedModesContext *ctx) + GTask *task) { + LoadSupportedModesContext *ctx; const gchar *response; GError *error = NULL; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!error) { MMModemMode mode = MM_MODEM_MODE_NONE; @@ -1538,57 +1657,62 @@ /* Now keep on with the loading */ ctx->run_cnti = FALSE; - load_supported_modes_step (ctx); + load_supported_modes_step (task); } static void -load_supported_modes_step (LoadSupportedModesContext *ctx) +load_supported_modes_step (GTask *task) { + MMBroadbandModem *self; + LoadSupportedModesContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->run_cnti) { mm_base_modem_at_command ( - MM_BASE_MODEM (ctx->self), + MM_BASE_MODEM (self), "*CNTI=2", 3, FALSE, (GAsyncReadyCallback)supported_modes_cnti_ready, - ctx); + task); return; } if (ctx->run_ws46) { mm_base_modem_at_command ( - MM_BASE_MODEM (ctx->self), + MM_BASE_MODEM (self), "+WS46=?", 3, TRUE, /* allow caching, it's a test command */ (GAsyncReadyCallback)supported_modes_ws46_test_ready, - ctx); + task); return; } if (ctx->run_gcap) { mm_base_modem_at_command ( - MM_BASE_MODEM (ctx->self), + MM_BASE_MODEM (self), "+GCAP", 3, TRUE, /* allow caching */ (GAsyncReadyCallback)supported_modes_gcap_ready, - ctx); + task); return; } /* All done. * If no mode found, error */ if (ctx->mode == MM_MODEM_MODE_NONE) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't retrieve supported modes"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't retrieve supported modes"); else - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (ctx->mode), - NULL); - load_supported_modes_context_complete_and_free (ctx); + g_task_return_int (task, ctx->mode); + + g_object_unref (task); } static void @@ -1597,28 +1721,27 @@ gpointer user_data) { LoadSupportedModesContext *ctx; + GTask *task; mm_dbg ("loading supported modes..."); - ctx = g_slice_new0 (LoadSupportedModesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_modes); + ctx = g_new0 (LoadSupportedModesContext, 1); ctx->mode = MM_MODEM_MODE_NONE; - if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) { + if (mm_iface_modem_is_3gpp (self)) { /* Run +WS46=? and *CNTI=2 */ ctx->run_ws46 = TRUE; ctx->run_cnti = TRUE; } - if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) { + if (mm_iface_modem_is_cdma (self)) { /* Run +GCAP in order to know if the modem is CDMA1x only or CDMA1x/EV-DO */ ctx->run_gcap = TRUE; } - load_supported_modes_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + load_supported_modes_step (task); } /*****************************************************************************/ @@ -1629,17 +1752,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_BEARER_IP_FAMILY_NONE; + GError *inner_error = NULL; + gssize value; - return (MMBearerIpFamily) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_IP_FAMILY_NONE; + } + return (MMBearerIpFamily)value; } static void supported_ip_families_cgdcont_test_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -1657,12 +1784,11 @@ } if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (mask), NULL); + g_task_return_int (task, mask); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1670,21 +1796,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; mm_dbg ("loading supported IP families..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_ip_families); + task = g_task_new (self, NULL, callback, user_data); - if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_BEARER_IP_FAMILY_IPV4), - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (mm_iface_modem_is_cdma_only (self)) { + g_task_return_int (task, MM_BEARER_IP_FAMILY_IPV4); + g_object_unref (task); return; } @@ -1695,26 +1814,64 @@ 3, TRUE, /* allow caching, it's a test command */ (GAsyncReadyCallback)supported_ip_families_cgdcont_test_ready, - result); + task); } /*****************************************************************************/ /* Signal quality loading (Modem interface) */ +static void +qcdm_evdo_pilot_sets_log_handle (MMPortSerialQcdm *port, + GByteArray *log_buffer, + gpointer user_data) +{ + MMBroadbandModem *self = MM_BROADBAND_MODEM (user_data); + QcdmResult *result; + uint32_t num_active = 0; + uint32_t pilot_pn = 0; + uint32_t pilot_energy = 0; + int32_t rssi_dbm = 0; + + result = qcdm_log_item_evdo_pilot_sets_v2_new ((const char *) log_buffer->data, + log_buffer->len, + NULL); + if (!result) + return; + + if (!qcdm_log_item_evdo_pilot_sets_v2_get_num (result, + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_ACTIVE, + &num_active)) { + qcdm_result_unref (result); + return; + } + + if (num_active > 0 && + qcdm_log_item_evdo_pilot_sets_v2_get_pilot (result, + QCDM_LOG_ITEM_EVDO_PILOT_SETS_V2_TYPE_ACTIVE, + 0, + &pilot_pn, + &pilot_energy, + &rssi_dbm)) { + mm_dbg ("EVDO active pilot RSSI: %ddBm", rssi_dbm); + self->priv->evdo_pilot_rssi = rssi_dbm; + } + + qcdm_result_unref (result); +} + typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - MMPortSerial *port; + MMPortSerial *at_port; + MMPortSerial *qcdm_port; } SignalQualityContext; static void -signal_quality_context_complete_and_free (SignalQualityContext *ctx) +signal_quality_context_free (SignalQualityContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - if (ctx->port) - g_object_unref (ctx->port); + g_clear_object (&ctx->at_port); + if (ctx->qcdm_port) { + mm_port_serial_close (ctx->qcdm_port); + g_object_unref (ctx->qcdm_port); + } g_free (ctx); } @@ -1723,17 +1880,31 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + gssize value; + + value = g_task_propagate_int (G_TASK (res), error); + return value < 0 ? 0 : value; +} + +static guint +signal_quality_evdo_pilot_sets (MMBroadbandModem *self) +{ + gint dbm; + + if (self->priv->modem_cdma_evdo_registration_state == MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) + return 0; + + if (self->priv->evdo_pilot_rssi >= 0) return 0; - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + dbm = CLAMP (self->priv->evdo_pilot_rssi, -113, -51); + return 100 - ((dbm + 51) * 100 / (-113 + 51)); } static void signal_quality_csq_ready (MMBroadbandModem *self, GAsyncResult *res, - SignalQualityContext *ctx) + GTask *task) { GError *error = NULL; GVariant *result; @@ -1741,8 +1912,8 @@ result = mm_base_modem_at_sequence_full_finish (MM_BASE_MODEM (self), res, NULL, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1755,25 +1926,26 @@ result_str = mm_strip_tag (result_str, "+CSQ:"); if (sscanf (result_str, "%d, %d", &quality, &ber)) { if (quality == 99) { - /* 99 means unknown, no service, etc */ - quality = 0; + /* 99 can mean unknown, no service, etc. But the modem may + * also only report CDMA 1x quality in CSQ, so try EVDO via + * QCDM log messages too. + */ + quality = signal_quality_evdo_pilot_sets (self); } else { /* Normalize the quality */ quality = CLAMP (quality, 0, 31) * 100 / 31; } - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (quality), - NULL); - signal_quality_context_complete_and_free (ctx); + g_task_return_int (task, quality); + g_object_unref (task); return; } } - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Could not parse signal quality results"); - signal_quality_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Could not parse signal quality results"); + g_object_unref (task); } /* Some modems want +CSQ, others want +CSQ?, and some of both types @@ -1787,17 +1959,23 @@ }; static void -signal_quality_csq (SignalQualityContext *ctx) +signal_quality_csq (GTask *task) { + MMBroadbandModem *self; + SignalQualityContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (ctx->self), - MM_PORT_SERIAL_AT (ctx->port), + MM_BASE_MODEM (self), + MM_PORT_SERIAL_AT (ctx->at_port), signal_quality_csq_sequence, NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ NULL, /* cancellable */ (GAsyncReadyCallback)signal_quality_csq_ready, - ctx); + task); } static guint @@ -1824,13 +2002,16 @@ static void signal_quality_cind_ready (MMBroadbandModem *self, GAsyncResult *res, - SignalQualityContext *ctx) + GTask *task) { + SignalQualityContext *ctx; GError *error = NULL; const gchar *result; GByteArray *indicators; guint quality = 0; + ctx = g_task_get_task_data (task); + result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { g_clear_error (&error); @@ -1840,7 +2021,7 @@ indicators = mm_3gpp_parse_cind_read_response (result, &error); if (!indicators) { mm_dbg ("(%s) Could not parse CIND signal quality results: %s", - mm_port_get_device (MM_PORT (ctx->port)), + mm_port_get_device (MM_PORT (ctx->at_port)), error->message); g_clear_error (&error); goto try_csq; @@ -1849,7 +2030,7 @@ if (indicators->len < self->priv->modem_cind_indicator_signal_quality) { mm_dbg ("(%s) Could not parse CIND signal quality results; signal " "index (%u) outside received range (0-%u)", - mm_port_get_device (MM_PORT (ctx->port)), + mm_port_get_device (MM_PORT (ctx->at_port)), self->priv->modem_cind_indicator_signal_quality, indicators->len); } else { @@ -1864,10 +2045,8 @@ if (quality > 0) { /* +CIND success */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (quality), - NULL); - signal_quality_context_complete_and_free (ctx); + g_task_return_int (task, quality); + g_object_unref (task); return; } @@ -1877,27 +2056,33 @@ * report zero even though they have signal. So if we get zero signal * from +CIND, try CSQ too. (bgo #636040) */ - signal_quality_csq (ctx); + signal_quality_csq (task); } static void -signal_quality_cind (SignalQualityContext *ctx) +signal_quality_cind (GTask *task) { - mm_base_modem_at_command_full (MM_BASE_MODEM (ctx->self), - MM_PORT_SERIAL_AT (ctx->port), + MMBroadbandModem *self; + SignalQualityContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + mm_base_modem_at_command_full (MM_BASE_MODEM (self), + MM_PORT_SERIAL_AT (ctx->at_port), "+CIND?", - 3, + 5, FALSE, FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)signal_quality_cind_ready, - ctx); + task); } static void signal_quality_qcdm_ready (MMPortSerialQcdm *port, GAsyncResult *res, - SignalQualityContext *ctx) + GTask *task) { QcdmResult *result; guint32 num = 0, quality = 0, i; @@ -1908,8 +2093,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1919,12 +2104,12 @@ &err); g_byte_array_unref (response); if (!result) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse pilot sets command result: %d", - err); - signal_quality_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse pilot sets command result: %d", + err); + g_object_unref (task); return; } @@ -1955,69 +2140,89 @@ quality = (guint32) (100 - (best_db * 100 / (WORST_ECIO - BEST_ECIO))); } - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (quality), - NULL); - signal_quality_context_complete_and_free (ctx); + g_task_return_int (task, quality); + g_object_unref (task); } static void -signal_quality_qcdm (SignalQualityContext *ctx) +signal_quality_qcdm (GTask *task) { + MMBroadbandModem *self; + SignalQualityContext *ctx; GByteArray *pilot_sets; + guint quality; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + /* If EVDO is active try that signal strength first */ + quality = signal_quality_evdo_pilot_sets (self); + if (quality > 0) { + g_task_return_int (task, quality); + g_object_unref (task); + return; + } /* Use CDMA1x pilot EC/IO if we can */ pilot_sets = g_byte_array_sized_new (25); pilot_sets->len = qcdm_cmd_pilot_sets_new ((char *) pilot_sets->data, 25); g_assert (pilot_sets->len); - mm_port_serial_qcdm_command (MM_PORT_SERIAL_QCDM (ctx->port), + mm_port_serial_qcdm_command (MM_PORT_SERIAL_QCDM (ctx->qcdm_port), pilot_sets, 3, NULL, (GAsyncReadyCallback)signal_quality_qcdm_ready, - ctx); + task); g_byte_array_unref (pilot_sets); } static void -modem_load_signal_quality (MMIfaceModem *self, +modem_load_signal_quality (MMIfaceModem *_self, GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); SignalQualityContext *ctx; GError *error = NULL; + GTask *task; mm_dbg ("loading signal quality..."); ctx = g_new0 (SignalQualityContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_signal_quality); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)signal_quality_context_free); /* Check whether we can get a non-connected AT port */ - ctx->port = (MMPortSerial *)mm_base_modem_get_best_at_port (MM_BASE_MODEM (self), &error); - if (ctx->port) { - if (MM_BROADBAND_MODEM (self)->priv->modem_cind_supported && - CIND_INDICATOR_IS_VALID (MM_BROADBAND_MODEM (self)->priv->modem_cind_indicator_signal_quality)) - signal_quality_cind (ctx); + ctx->at_port = (MMPortSerial *)mm_base_modem_get_best_at_port (MM_BASE_MODEM (self), &error); + if (ctx->at_port) { + if (self->priv->modem_cind_supported && + CIND_INDICATOR_IS_VALID (self->priv->modem_cind_indicator_signal_quality)) + signal_quality_cind (task); else - signal_quality_csq (ctx); + signal_quality_csq (task); return; } /* If no best AT port available (all connected), try with QCDM ports */ - ctx->port = (MMPortSerial *)mm_base_modem_get_port_qcdm (MM_BASE_MODEM (self)); - if (ctx->port) { - g_error_free (error); - signal_quality_qcdm (ctx); - return; + ctx->qcdm_port = (MMPortSerial *)mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); + if (ctx->qcdm_port) { + g_clear_error (&error); + + /* Need to open QCDM port as it may be closed/blocked */ + if (mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm_port), &error)) { + g_object_ref (ctx->qcdm_port); + signal_quality_qcdm (task); + return; + } + + ctx->qcdm_port = NULL; + mm_dbg ("Couldn't open QCDM port: %s", error->message); } /* Return the error we got when getting best AT port */ - g_simple_async_result_take_error (ctx->result, error); - signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); } /*****************************************************************************/ @@ -2037,20 +2242,17 @@ { AccessTechAndMask *tech; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + tech = g_task_propagate_pointer (G_TASK (res), error); + if (!tech) return FALSE; - tech = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - g_assert (tech); - *access_technologies = tech->access_technologies; *mask = tech->mask; + g_free (tech); return TRUE; } typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMPortSerialQcdm *port; guint32 opmode; @@ -2065,19 +2267,22 @@ } AccessTechContext; static void -access_tech_context_complete_and_free (AccessTechContext *ctx, - GError *error, /* takes ownership */ - gboolean idle) +access_tech_context_free (AccessTechContext *ctx) +{ + if (ctx->port) { + mm_port_serial_close (MM_PORT_SERIAL (ctx->port)); + g_object_unref (ctx->port); + } + g_free (ctx); +} + +static AccessTechAndMask * +access_tech_and_mask_new (AccessTechContext *ctx) { AccessTechAndMask *tech; MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; guint mask = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; - if (error) { - g_simple_async_result_take_error (ctx->result, error); - goto done; - } - if (ctx->fallback_mask) { mm_dbg ("Fallback access technology: 0x%08x", ctx->fallback_act); act = ctx->fallback_act; @@ -2132,30 +2337,18 @@ } done: - if (error == NULL) { - tech = g_new0 (AccessTechAndMask, 1); - tech->access_technologies = act; - tech->mask = mask; - g_simple_async_result_set_op_res_gpointer (ctx->result, tech, g_free); - } - - if (idle) - g_simple_async_result_complete_in_idle (ctx->result); - else - g_simple_async_result_complete (ctx->result); - - g_object_unref (ctx->result); - g_object_unref (ctx->self); - if (ctx->port) - g_object_unref (ctx->port); - g_free (ctx); + tech = g_new0 (AccessTechAndMask, 1); + tech->access_technologies = act; + tech->mask = mask; + return tech; } static void access_tech_qcdm_wcdma_ready (MMPortSerialQcdm *port, GAsyncResult *res, - AccessTechContext *ctx) + GTask *task) { + AccessTechContext *ctx; QcdmResult *result; gint err = QCDM_SUCCESS; guint8 l1; @@ -2164,10 +2357,13 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Parse the response */ result = qcdm_cmd_wcdma_subsys_state_info_result ((const gchar *) response->data, response->len, @@ -2184,14 +2380,16 @@ ctx->wcdma_open = TRUE; } - access_tech_context_complete_and_free (ctx, NULL, FALSE); + g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free); + g_object_unref (task); } static void access_tech_qcdm_gsm_ready (MMPortSerialQcdm *port, GAsyncResult *res, - AccessTechContext *ctx) + GTask *task) { + AccessTechContext *ctx; GByteArray *cmd; QcdmResult *result; gint err = QCDM_SUCCESS; @@ -2202,7 +2400,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -2212,14 +2411,17 @@ &err); g_byte_array_unref (response); if (!result) { - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse GSM subsys command result: %d", - err); - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse GSM subsys command result: %d", + err); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + qcdm_result_get_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_OP_MODE, &opmode); qcdm_result_get_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_SYS_MODE, &sysmode); qcdm_result_unref (result); @@ -2237,15 +2439,16 @@ 3, NULL, (GAsyncReadyCallback)access_tech_qcdm_wcdma_ready, - ctx); + task); g_byte_array_unref (cmd); } static void access_tech_qcdm_hdr_ready (MMPortSerialQcdm *port, GAsyncResult *res, - AccessTechContext *ctx) + GTask *task) { + AccessTechContext *ctx; QcdmResult *result; gint err = QCDM_SUCCESS; guint8 session = 0; @@ -2255,10 +2458,13 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Parse the response */ result = qcdm_cmd_hdr_subsys_state_info_result ((const gchar *) response->data, response->len, @@ -2275,14 +2481,16 @@ ctx->evdo_open = TRUE; } - access_tech_context_complete_and_free (ctx, NULL, FALSE); + g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free); + g_object_unref (task); } static void access_tech_qcdm_cdma_ready (MMPortSerialQcdm *port, GAsyncResult *res, - AccessTechContext *ctx) + GTask *task) { + AccessTechContext *ctx; GByteArray *cmd; QcdmResult *result; gint err = QCDM_SUCCESS; @@ -2292,7 +2500,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -2302,14 +2511,17 @@ &err); g_byte_array_unref (response); if (!result) { - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse CM subsys command result: %d", - err); - access_tech_context_complete_and_free (ctx, error, FALSE); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse CM subsys command result: %d", + err); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + qcdm_result_get_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_OPERATING_MODE, &ctx->opmode); qcdm_result_get_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SYSTEM_MODE, &ctx->sysmode); qcdm_result_get_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_HYBRID_PREF, &hybrid); @@ -2327,7 +2539,7 @@ 3, NULL, (GAsyncReadyCallback)access_tech_qcdm_hdr_ready, - ctx); + task); g_byte_array_unref (cmd); } @@ -2363,6 +2575,7 @@ gpointer user_data) { AccessTechContext *ctx; + GTask *task; GByteArray *cmd; GError *error = NULL; @@ -2371,66 +2584,75 @@ * registration state */ ctx = g_new0 (AccessTechContext, 1); - ctx->self = g_object_ref (self); - ctx->port = mm_base_modem_get_port_qcdm (MM_BASE_MODEM (self)); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_access_technologies); - - if (!ctx->port) { - if (mm_iface_modem_is_cdma (self)) { - /* If we don't have a QCDM port but the modem is CDMA-only, then - * guess access technologies from the registration information. + ctx->port = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)access_tech_context_free); + + if (ctx->port) { + /* Need to open QCDM port as it may be closed/blocked */ + if (mm_port_serial_open (MM_PORT_SERIAL (ctx->port), &error)) { + g_object_ref (ctx->port); + + mm_dbg ("loading access technologies via QCDM..."); + + /* FIXME: we may want to run both the CDMA and 3GPP in sequence to ensure + * that a multi-mode device that's in CDMA-mode but still has 3GPP capabilities + * will get the correct access tech, since the 3GPP check is run first. */ - access_tech_from_cdma_registration_state (MM_BROADBAND_MODEM (self), ctx); - } else { - error = g_error_new_literal (MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot get 3GPP access technology without a QCDM port"); - } - access_tech_context_complete_and_free (ctx, error, TRUE); - return; - } - mm_dbg ("loading access technologies via QCDM..."); + if (mm_iface_modem_is_3gpp (self)) { + cmd = g_byte_array_sized_new (50); + cmd->len = qcdm_cmd_gsm_subsys_state_info_new ((char *) cmd->data, 50); + g_assert (cmd->len); + + mm_port_serial_qcdm_command (ctx->port, + cmd, + 3, + NULL, + (GAsyncReadyCallback)access_tech_qcdm_gsm_ready, + task); + g_byte_array_unref (cmd); + return; + } + + if (mm_iface_modem_is_cdma (self)) { + cmd = g_byte_array_sized_new (50); + cmd->len = qcdm_cmd_cm_subsys_state_info_new ((char *) cmd->data, 50); + g_assert (cmd->len); + + mm_port_serial_qcdm_command (ctx->port, + cmd, + 3, + NULL, + (GAsyncReadyCallback)access_tech_qcdm_cdma_ready, + task); + g_byte_array_unref (cmd); + return; + } - /* FIXME: we may want to run both the CDMA and 3GPP in sequence to ensure - * that a multi-mode device that's in CDMA-mode but still has 3GPP capabilities - * will get the correct access tech, since the 3GPP check is run first. - */ + g_assert_not_reached (); + } - if (mm_iface_modem_is_3gpp (self)) { - cmd = g_byte_array_sized_new (50); - cmd->len = qcdm_cmd_gsm_subsys_state_info_new ((char *) cmd->data, 50); - g_assert (cmd->len); - - mm_port_serial_qcdm_command (ctx->port, - cmd, - 3, - NULL, - (GAsyncReadyCallback)access_tech_qcdm_gsm_ready, - ctx); - g_byte_array_unref (cmd); - return; + ctx->port = NULL; + mm_dbg ("Couldn't open QCDM port: %s", error->message); + g_clear_error (&error); } + /* Fall back if we don't have a QCDM port or it couldn't be opened */ if (mm_iface_modem_is_cdma (self)) { - cmd = g_byte_array_sized_new (50); - cmd->len = qcdm_cmd_cm_subsys_state_info_new ((char *) cmd->data, 50); - g_assert (cmd->len); - - mm_port_serial_qcdm_command (ctx->port, - cmd, - 3, - NULL, - (GAsyncReadyCallback)access_tech_qcdm_cdma_ready, - ctx); - g_byte_array_unref (cmd); - return; + /* If we don't have a QCDM port but the modem is CDMA-only, then + * guess access technologies from the registration information. + */ + access_tech_from_cdma_registration_state (MM_BROADBAND_MODEM (self), ctx); + g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free); + } else { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot get 3GPP access technology without a QCDM port"); } - - g_assert_not_reached (); + g_object_unref (task); } /*****************************************************************************/ @@ -2441,7 +2663,270 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +bearer_report_disconnected (MMBaseBearer *bearer, + gpointer user_data) +{ + guint cid; + + cid = GPOINTER_TO_UINT (user_data); + + /* If we're told to disconnect a single context and this is not the + * bearer associated to that context, ignore operation */ + if (cid > 0 && + MM_IS_BROADBAND_BEARER (bearer) && + mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (bearer)) != cid) + return; + + /* If already disconnected, ignore operation */ + if (mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_DISCONNECTED) + return; + + mm_info ("Bearer %s: explicitly disconnected", mm_base_bearer_get_path (bearer)); + mm_base_bearer_report_connection_status (bearer, MM_BEARER_CONNECTION_STATUS_DISCONNECTED); +} + +static void +bearer_list_report_disconnections (MMBroadbandModem *self, + guint cid) +{ + MMBearerList *list = NULL; + + g_object_get (self, + MM_IFACE_MODEM_BEARER_LIST, &list, + NULL); + + /* If empty bearer list, nothing else to do */ + if (!list) + return; + + mm_bearer_list_foreach (list, (MMBearerListForeachFunc)bearer_report_disconnected, GUINT_TO_POINTER (cid)); + g_object_unref (list); +} + +static void +cgev_process_detach (MMBroadbandModem *self, + MM3gppCgev type) +{ + switch (type) { + case MM_3GPP_CGEV_NW_DETACH: + mm_info ("network forced PS detach: all contexts have been deactivated"); + bearer_list_report_disconnections (self, 0); + break; + case MM_3GPP_CGEV_ME_DETACH: + mm_info ("mobile equipment forced PS detach: all contexts have been deactivated"); + bearer_list_report_disconnections (self, 0); + break; + default: + g_assert_not_reached (); + } +} + +static void +cgev_process_primary (MMBroadbandModem *self, + MM3gppCgev type, + const gchar *str) +{ + GError *error = NULL; + guint cid = 0; + + if (!mm_3gpp_parse_cgev_indication_primary (str, type, &cid, &error)) { + mm_warn ("couldn't parse cid info from +CGEV indication '%s': %s", str, error->message); + g_error_free (error); + return; + } + + switch (type) { + case MM_3GPP_CGEV_NW_ACT_PRIMARY: + mm_info ("network request to activate context (cid %u)", cid); + break; + case MM_3GPP_CGEV_ME_ACT_PRIMARY: + mm_info ("mobile equipment request to activate context (cid %u)", cid); + break; + case MM_3GPP_CGEV_NW_DEACT_PRIMARY: + mm_info ("network request to deactivate context (cid %u)", cid); + bearer_list_report_disconnections (self, cid); + break; + case MM_3GPP_CGEV_ME_DEACT_PRIMARY: + mm_info ("mobile equipment request to deactivate context (cid %u)", cid); + bearer_list_report_disconnections (self, cid); + break; + default: + g_assert_not_reached (); + break; + } +} + +static void +cgev_process_secondary (MMBroadbandModem *self, + MM3gppCgev type, + const gchar *str) +{ + GError *error = NULL; + guint p_cid = 0; + guint cid = 0; + + if (!mm_3gpp_parse_cgev_indication_secondary (str, type, &p_cid, &cid, NULL, &error)) { + mm_warn ("couldn't parse p_cid/cid info from +CGEV indication '%s': %s", str, error->message); + g_error_free (error); + return; + } + + switch (type) { + case MM_3GPP_CGEV_NW_ACT_SECONDARY: + mm_info ("network request to activate secondary context (cid %u, primary cid %u)", cid, p_cid); + break; + case MM_3GPP_CGEV_ME_ACT_SECONDARY: + mm_info ("mobile equipment request to activate secondary context (cid %u, primary cid %u)", cid, p_cid); + break; + case MM_3GPP_CGEV_NW_DEACT_SECONDARY: + mm_info ("network request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid); + bearer_list_report_disconnections (self, cid); + break; + case MM_3GPP_CGEV_ME_DEACT_SECONDARY: + mm_info ("mobile equipment request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid); + bearer_list_report_disconnections (self, cid); + break; + default: + g_assert_not_reached (); + break; + } +} + +static void +cgev_process_pdp (MMBroadbandModem *self, + MM3gppCgev type, + const gchar *str) +{ + GError *error = NULL; + gchar *pdp_type = NULL; + gchar *pdp_addr = NULL; + guint cid = 0; + + if (!mm_3gpp_parse_cgev_indication_pdp (str, type, &pdp_type, &pdp_addr, &cid, &error)) { + mm_warn ("couldn't parse PDP info from +CGEV indication '%s': %s", str, error->message); + g_error_free (error); + return; + } + + switch (type) { + case MM_3GPP_CGEV_REJECT: + mm_info ("network request to activate context (type %s, address %s) has been automatically rejected", pdp_type, pdp_addr); + break; + case MM_3GPP_CGEV_NW_REACT: + /* NOTE: we don't currently notify about automatic reconnections like this one */ + if (cid) + mm_info ("network request to reactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid); + else + mm_info ("network request to reactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr); + break; + case MM_3GPP_CGEV_NW_DEACT_PDP: + if (cid) { + mm_info ("network request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid); + bearer_list_report_disconnections (self, cid); + } else + mm_info ("network request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr); + break; + case MM_3GPP_CGEV_ME_DEACT_PDP: + if (cid) { + mm_info ("mobile equipment request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid); + bearer_list_report_disconnections (self, cid); + } else + mm_info ("mobile equipment request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr); + break; + default: + g_assert_not_reached (); + break; + } + + g_free (pdp_addr); + g_free (pdp_type); +} + +static void +cgev_received (MMPortSerialAt *port, + GMatchInfo *info, + MMBroadbandModem *self) +{ + gchar *str; + MM3gppCgev type; + + str = mm_get_string_unquoted_from_match_info (info, 1); + if (!str) + return; + + type = mm_3gpp_parse_cgev_indication_action (str); + + switch (type) { + case MM_3GPP_CGEV_NW_DETACH: + case MM_3GPP_CGEV_ME_DETACH: + cgev_process_detach (self, type); + break; + case MM_3GPP_CGEV_NW_ACT_PRIMARY: + case MM_3GPP_CGEV_ME_ACT_PRIMARY: + case MM_3GPP_CGEV_NW_DEACT_PRIMARY: + case MM_3GPP_CGEV_ME_DEACT_PRIMARY: + cgev_process_primary (self, type, str); + break; + case MM_3GPP_CGEV_NW_ACT_SECONDARY: + case MM_3GPP_CGEV_ME_ACT_SECONDARY: + case MM_3GPP_CGEV_NW_DEACT_SECONDARY: + case MM_3GPP_CGEV_ME_DEACT_SECONDARY: + cgev_process_secondary (self, type, str); + break; + case MM_3GPP_CGEV_NW_DEACT_PDP: + case MM_3GPP_CGEV_ME_DEACT_PDP: + case MM_3GPP_CGEV_REJECT: + case MM_3GPP_CGEV_NW_REACT: + cgev_process_pdp (self, type, str); + break; + case MM_3GPP_CGEV_NW_CLASS: + case MM_3GPP_CGEV_ME_CLASS: + case MM_3GPP_CGEV_NW_MODIFY: + case MM_3GPP_CGEV_ME_MODIFY: + /* ignore */ + break; + default: + mm_dbg ("unhandled +CGEV indication: %s", str); + break; + } + + g_free (str); +} + +static void +set_cgev_unsolicited_events_handlers (MMBroadbandModem *self, + gboolean enable) +{ + MMPortSerialAt *ports[2]; + GRegex *cgev_regex; + guint i; + + cgev_regex = mm_3gpp_cgev_regex_get (); + ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); + ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); + + /* Enable unsolicited events in given port */ + for (i = 0; i < 2; i++) { + if (!ports[i]) + continue; + + /* Set/unset unsolicited CGEV event handler */ + mm_dbg ("(%s) %s 3GPP +CGEV unsolicited events handlers", + mm_port_get_device (MM_PORT (ports[i])), + enable ? "Setting" : "Removing"); + mm_port_serial_at_add_unsolicited_msg_handler ( + ports[i], + cgev_regex, + enable ? (MMPortSerialAtUnsolicitedMsgFn) cgev_received : NULL, + enable ? self : NULL, + NULL); + } + + g_regex_unref (cgev_regex); } static void @@ -2483,8 +2968,8 @@ } static void -set_unsolicited_events_handlers (MMBroadbandModem *self, - gboolean enable) +set_ciev_unsolicited_events_handlers (MMBroadbandModem *self, + gboolean enable) { MMPortSerialAt *ports[2]; GRegex *ciev_regex; @@ -2500,7 +2985,7 @@ continue; /* Set/unset unsolicited CIEV event handler */ - mm_dbg ("(%s) %s 3GPP unsolicited events handlers", + mm_dbg ("(%s) %s 3GPP +CIEV unsolicited events handlers", mm_port_get_device (MM_PORT (ports[i])), enable ? "Setting" : "Removing"); mm_port_serial_at_add_unsolicited_msg_handler ( @@ -2515,9 +3000,111 @@ } static void +support_checked_setup_unsolicited_events (GTask *task) +{ + MMBroadbandModem *self; + + self = g_task_get_source_object (task); + + if (self->priv->modem_cind_supported) + set_ciev_unsolicited_events_handlers (self, TRUE); + + if (self->priv->modem_cgerep_supported) + set_cgev_unsolicited_events_handlers (self, TRUE); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void check_and_setup_3gpp_urc_support (GTask *task); + +static void +cgerep_format_check_ready (MMBroadbandModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + const gchar *result; + + result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + if (!result) { + mm_dbg ("+CGEREP check failed, marking packet domain event reporting as unsupported: '%s'", error->message); + g_error_free (error); + goto out; + } + + mm_dbg ("Modem supports packet domain event reporting"); + self->priv->modem_cgerep_supported = TRUE; + +out: + /* go on with remaining checks */ + check_and_setup_3gpp_urc_support (task); +} + +static void +cmer_format_check_ready (MMBroadbandModem *self, + GAsyncResult *res, + GTask *task) +{ + MM3gppCmerMode supported_modes = MM_3GPP_CMER_MODE_NONE; + MM3gppCmerInd supported_inds = MM_3GPP_CMER_IND_NONE; + GError *error = NULL; + const gchar *result; + gchar *aux; + + result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + if (error || !mm_3gpp_parse_cmer_test_response (result, &supported_modes, &supported_inds, &error)) { + mm_dbg ("+CMER check failed, marking indications as unsupported: '%s'", error->message); + g_error_free (error); + goto out; + } + + aux = mm_3gpp_cmer_mode_build_string_from_mask (supported_modes); + mm_dbg ("Supported +CMER modes: %s", aux); + g_free (aux); + + aux = mm_3gpp_cmer_ind_build_string_from_mask (supported_inds); + mm_dbg ("Supported +CMER indication settings: %s", aux); + g_free (aux); + + /* Flag +CMER supported values */ + + if (supported_modes & MM_3GPP_CMER_MODE_FORWARD_URCS) + self->priv->modem_cmer_enable_mode = MM_3GPP_CMER_MODE_FORWARD_URCS; + else if (supported_modes & MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED) + self->priv->modem_cmer_enable_mode = MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED; + else if (supported_modes & MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED) + self->priv->modem_cmer_enable_mode = MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED; + + aux = mm_3gpp_cmer_mode_build_string_from_mask (self->priv->modem_cmer_enable_mode); + mm_dbg ("+CMER enable mode: %s", aux); + g_free (aux); + + if (supported_modes & MM_3GPP_CMER_MODE_DISCARD_URCS) + self->priv->modem_cmer_disable_mode = MM_3GPP_CMER_MODE_DISCARD_URCS; + + aux = mm_3gpp_cmer_mode_build_string_from_mask (self->priv->modem_cmer_disable_mode); + mm_dbg ("+CMER disable mode: %s", aux); + g_free (aux); + + if (supported_inds & MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND) + self->priv->modem_cmer_ind = MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND; + else if (supported_inds & MM_3GPP_CMER_IND_ENABLE_ALL) + self->priv->modem_cmer_ind = MM_3GPP_CMER_IND_ENABLE_ALL; + + aux = mm_3gpp_cmer_ind_build_string_from_mask (self->priv->modem_cmer_ind); + mm_dbg ("+CMER indication setting: %s", aux); + g_free (aux); + +out: + /* go on with remaining checks */ + check_and_setup_3gpp_urc_support (task); +} + +static void cind_format_check_ready (MMBroadbandModem *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) + GAsyncResult *res, + GTask *task) { GHashTable *indicators = NULL; GError *error = NULL; @@ -2528,11 +3115,10 @@ if (error || !(indicators = mm_3gpp_parse_cind_test_response (result, &error))) { /* unsupported indications */ - mm_dbg ("Marking indications as unsupported: '%s'", error->message); + mm_dbg ("+CIND check failed, marking indications as unsupported: '%s'", error->message); g_error_free (error); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + /* go on with remaining checks */ + check_and_setup_3gpp_urc_support (task); return; } @@ -2575,28 +3161,23 @@ g_hash_table_destroy (indicators); - /* Now, keep on setting up the ports */ - set_unsolicited_events_handlers (self, TRUE); - - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + /* Check +CMER required format */ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+CMER=?", + 3, + TRUE, + (GAsyncReadyCallback)cmer_format_check_ready, + task); } static void -modem_3gpp_setup_unsolicited_events (MMIfaceModem3gpp *_self, - GAsyncReadyCallback callback, - gpointer user_data) +check_and_setup_3gpp_urc_support (GTask *task) { - MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); - GSimpleAsyncResult *result; + MMBroadbandModem *self; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_events); + self = g_task_get_source_object (task); - /* Load supported indicators */ + /* Check support for +CIEV indications, managed with +CIND/+CMER */ if (!self->priv->modem_cind_support_checked) { mm_dbg ("Checking indicator support..."); self->priv->modem_cind_support_checked = TRUE; @@ -2605,60 +3186,81 @@ 3, TRUE, (GAsyncReadyCallback)cind_format_check_ready, - result); + task); return; } - /* If supported, go on */ - if (self->priv->modem_cind_supported) - set_unsolicited_events_handlers (self, TRUE); + /* Check support for +CGEV indications, managed with +CGEREP */ + if (!self->priv->modem_cgerep_support_checked) { + mm_dbg ("Checking packet domain event reporting..."); + self->priv->modem_cgerep_support_checked = TRUE; + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+CGEREP=?", + 3, + TRUE, + (GAsyncReadyCallback)cgerep_format_check_ready, + task); + return; + } - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + support_checked_setup_unsolicited_events (task); } static void -modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *_self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_setup_unsolicited_events (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + check_and_setup_3gpp_urc_support (task); +} + +static void +modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *_self, + GAsyncReadyCallback callback, + gpointer user_data) { MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); - /* If supported, go on */ if (self->priv->modem_cind_support_checked && self->priv->modem_cind_supported) - set_unsolicited_events_handlers (self, FALSE); + set_ciev_unsolicited_events_handlers (self, FALSE); + + if (self->priv->modem_cgerep_supported) + set_cgev_unsolicited_events_handlers (self, FALSE); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ /* Enabling/disabling unsolicited events (3GPP interface) */ typedef struct { - MMBroadbandModem *self; - gchar *command; - gboolean enable; - GSimpleAsyncResult *result; - gboolean cmer_primary_done; - gboolean cmer_secondary_done; + gboolean enable; + MMPortSerialAt *primary; + MMPortSerialAt *secondary; + gchar *cmer_command; + gboolean cmer_primary_done; + gboolean cmer_secondary_done; + gchar *cgerep_command; + gboolean cgerep_primary_done; + gboolean cgerep_secondary_done; } UnsolicitedEventsContext; static void -unsolicited_events_context_complete_and_free (UnsolicitedEventsContext *ctx) +unsolicited_events_context_free (UnsolicitedEventsContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx->command); + if (ctx->secondary) + g_object_unref (ctx->secondary); + if (ctx->primary) + g_object_unref (ctx->primary); + g_free (ctx->cgerep_command); + g_free (ctx->cmer_command); g_free (ctx); } @@ -2667,64 +3269,89 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void run_unsolicited_events_setup (UnsolicitedEventsContext *ctx); +static void run_unsolicited_events_setup (GTask *task); static void unsolicited_events_setup_ready (MMBroadbandModem *self, - GAsyncResult *res, - UnsolicitedEventsContext *ctx) + GAsyncResult *res, + GTask *task) { - GError *error = NULL; + UnsolicitedEventsContext *ctx; + GError *error = NULL; - mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!error) { - /* Run on next port, if any */ - run_unsolicited_events_setup (ctx); - return; + ctx = g_task_get_task_data (task); + + if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) { + mm_dbg ("Couldn't %s event reporting: '%s'", + ctx->enable ? "enable" : "disable", + error->message); + g_error_free (error); } - mm_dbg ("Couldn't %s event reporting: '%s'", - ctx->enable ? "enable" : "disable", - error->message); - g_error_free (error); - /* Consider this operation complete, ignoring errors */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - unsolicited_events_context_complete_and_free (ctx); + /* Continue on next port/command */ + run_unsolicited_events_setup (task); } static void -run_unsolicited_events_setup (UnsolicitedEventsContext *ctx) +run_unsolicited_events_setup (GTask *task) { - MMPortSerialAt *port = NULL; + MMBroadbandModem *self; + UnsolicitedEventsContext *ctx; + MMPortSerialAt *port = NULL; + const gchar *command = NULL; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); - if (!ctx->cmer_primary_done) { + /* CMER on primary port */ + if (!ctx->cmer_primary_done && ctx->cmer_command && ctx->primary) { + mm_dbg ("Enabling +CIND event reporting in primary port..."); ctx->cmer_primary_done = TRUE; - port = mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)); - } else if (!ctx->cmer_secondary_done) { + command = ctx->cmer_command; + port = ctx->primary; + } + /* CMER on secondary port */ + else if (!ctx->cmer_secondary_done && ctx->cmer_command && ctx->secondary) { + mm_dbg ("Enabling +CIND event reporting in secondary port..."); ctx->cmer_secondary_done = TRUE; - port = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (ctx->self)); + command = ctx->cmer_command; + port = ctx->secondary; + } + /* CGEREP on primary port */ + else if (!ctx->cgerep_primary_done && ctx->cgerep_command && ctx->primary) { + mm_dbg ("Enabling +CGEV event reporting in primary port..."); + ctx->cgerep_primary_done = TRUE; + command = ctx->cgerep_command; + port = ctx->primary; + } + /* CGEREP on secondary port */ + else if (!ctx->cgerep_secondary_done && ctx->cgerep_command && ctx->secondary) { + mm_dbg ("Enabling +CGEV event reporting in secondary port..."); + ctx->cgerep_secondary_done = TRUE; + port = ctx->secondary; + command = ctx->cgerep_command; } /* Enable unsolicited events in given port */ - if (port) { - mm_base_modem_at_command_full (MM_BASE_MODEM (ctx->self), + if (port && command) { + mm_base_modem_at_command_full (MM_BASE_MODEM (self), port, - ctx->command, + command, 3, FALSE, FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_events_setup_ready, - ctx); + task); return; } - /* If no more ports, we're fully done now */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - unsolicited_events_context_complete_and_free (ctx); + /* Fully done now */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -2732,30 +3359,25 @@ GAsyncReadyCallback callback, gpointer user_data) { - MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); - GSimpleAsyncResult *result; + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + GTask *task; + UnsolicitedEventsContext *ctx; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_enable_unsolicited_events); - - /* If supported, go on */ - if (self->priv->modem_cind_support_checked && self->priv->modem_cind_supported) { - UnsolicitedEventsContext *ctx; + task = g_task_new (self, NULL, callback, user_data); - ctx = g_new0 (UnsolicitedEventsContext, 1); - ctx->self = g_object_ref (self); - ctx->enable = TRUE; - ctx->command = g_strdup ("+CMER=3,0,0,1"); - ctx->result = result; - run_unsolicited_events_setup (ctx); - return; - } + ctx = g_new0 (UnsolicitedEventsContext, 1); + ctx->enable = TRUE; + ctx->primary = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + ctx->secondary = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); + g_task_set_task_data (task, ctx, (GDestroyNotify)unsolicited_events_context_free); + + if (self->priv->modem_cind_support_checked && self->priv->modem_cind_supported) + ctx->cmer_command = mm_3gpp_build_cmer_set_request (self->priv->modem_cmer_enable_mode, self->priv->modem_cmer_ind); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (self->priv->modem_cgerep_support_checked && self->priv->modem_cgerep_supported) + ctx->cgerep_command = g_strdup ("+CGEREP=2"); + + run_unsolicited_events_setup (task); } static void @@ -2763,36 +3385,30 @@ GAsyncReadyCallback callback, gpointer user_data) { - MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); - GSimpleAsyncResult *result; + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + GTask *task; + UnsolicitedEventsContext *ctx; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_disable_unsolicited_events); - - /* If supported, go on */ - if (self->priv->modem_cind_support_checked && self->priv->modem_cind_supported) { - UnsolicitedEventsContext *ctx; + task = g_task_new (self, NULL, callback, user_data); - ctx = g_new0 (UnsolicitedEventsContext, 1); - ctx->self = g_object_ref (self); - ctx->command = g_strdup ("+CMER=0"); - ctx->result = result; - run_unsolicited_events_setup (ctx); - return; - } + ctx = g_new0 (UnsolicitedEventsContext, 1); + ctx->primary = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + ctx->secondary = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); + g_task_set_task_data (task, ctx, (GDestroyNotify)unsolicited_events_context_free); + + if (self->priv->modem_cind_support_checked && self->priv->modem_cind_supported) + ctx->cmer_command = mm_3gpp_build_cmer_set_request (self->priv->modem_cmer_disable_mode, MM_3GPP_CMER_IND_NONE); + + if (self->priv->modem_cgerep_support_checked && self->priv->modem_cgerep_supported) + ctx->cgerep_command = g_strdup ("+CGEREP=0"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + run_unsolicited_events_setup (task); } /*****************************************************************************/ /* Setting modem charset (Modem interface) */ typedef struct { - GSimpleAsyncResult *result; MMModemCharset charset; /* Commands to try in the sequence: * First one with quotes @@ -2804,7 +3420,6 @@ static void setup_charset_context_free (SetupCharsetContext *ctx) { - g_object_unref (ctx->result); g_free (ctx->charset_commands[0].command); g_free (ctx->charset_commands[1].command); g_free (ctx); @@ -2815,23 +3430,23 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return FALSE; - - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static void current_charset_query_ready (MMBroadbandModem *self, GAsyncResult *res, - SetupCharsetContext *ctx) + GTask *task) { + SetupCharsetContext *ctx; GError *error = NULL; const gchar *response; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (!response) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else { MMModemCharset current; const gchar *p; @@ -2844,35 +3459,33 @@ current = mm_modem_charset_from_string (p); if (ctx->charset != current) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Modem failed to change character set to %s", - mm_modem_charset_to_string (ctx->charset)); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Modem failed to change character set to %s", + mm_modem_charset_to_string (ctx->charset)); else { /* We'll keep track ourselves of the current charset. * TODO: Make this a property so that plugins can also store it. */ self->priv->modem_current_charset = current; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } } - g_simple_async_result_complete (ctx->result); - setup_charset_context_free (ctx); + g_object_unref (task); } static void charset_change_ready (MMBroadbandModem *self, GAsyncResult *res, - SetupCharsetContext *ctx) + GTask *task) { GError *error = NULL; mm_base_modem_at_sequence_finish (MM_BASE_MODEM (self), res, NULL, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - g_simple_async_result_complete (ctx->result); - setup_charset_context_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -2882,7 +3495,7 @@ 3, FALSE, (GAsyncReadyCallback)current_charset_query_ready, - ctx); + task); } static void @@ -2893,6 +3506,7 @@ { SetupCharsetContext *ctx; const gchar *charset_str; + GTask *task; /* NOTE: we already notified that CDMA-only modems couldn't load supported * charsets, so we'll never get here in such a case */ @@ -2901,22 +3515,19 @@ /* Build charset string to use */ charset_str = mm_modem_charset_to_string (charset); if (!charset_str) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled character set 0x%X", - charset); + g_task_report_new_error (self, + callback, + user_data, + modem_setup_charset, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled character set 0x%X", + charset); return; } /* Setup context, including commands to try */ ctx = g_new0 (SetupCharsetContext, 1); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_setup_charset); ctx->charset = charset; /* First try, with quotes */ ctx->charset_commands[0].command = g_strdup_printf ("+CSCS=\"%s\"", charset_str); @@ -2932,6 +3543,9 @@ ctx->charset_commands[1].allow_cached = FALSE; ctx->charset_commands[1].response_processor = mm_base_modem_response_processor_no_result; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)setup_charset_context_free); + /* Launch sequence */ mm_base_modem_at_sequence ( MM_BASE_MODEM (self), @@ -2939,7 +3553,7 @@ NULL, /* response_processor_context */ NULL, /* response_processor_context_free */ (GAsyncReadyCallback)charset_change_ready, - ctx); + task); } /*****************************************************************************/ @@ -2950,38 +3564,39 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_CHARSET_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_CHARSET_UNKNOWN; + } + return (MMModemCharset)value; } static void cscs_format_check_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMModemCharset charsets = MM_MODEM_CHARSET_UNKNOWN; const gchar *response; GError *error = NULL; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (self, res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else if (!mm_3gpp_parse_cscs_test_response (response, &charsets)) - g_simple_async_result_set_error ( - simple, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Failed to parse the supported character " - "sets response"); + "Failed to parse the supported character sets response"); else - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (charsets), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, charsets); + + g_object_unref (task); } static void @@ -2989,21 +3604,15 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_charsets); + task = g_task_new (self, NULL, callback, user_data); /* CDMA-only modems don't need this */ if (mm_iface_modem_is_cdma_only (self)) { mm_dbg ("Skipping supported charset loading in CDMA-only modem..."); - g_simple_async_result_set_op_res_gpointer (result, - GUINT_TO_POINTER (MM_MODEM_CHARSET_UNKNOWN), - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, MM_MODEM_CHARSET_UNKNOWN); + g_object_unref (task); return; } @@ -3012,19 +3621,125 @@ 3, TRUE, (GAsyncReadyCallback)cscs_format_check_ready, - result); + task); } /*****************************************************************************/ /* configuring flow control (Modem interface) */ static gboolean -modem_setup_flow_control_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +modem_setup_flow_control_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - /* Completely ignore errors */ - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +ifc_test_ready (MMBaseModem *_self, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModem *self; + GError *error = NULL; + const gchar *response; + const gchar *cmd; + MMFlowControl flow_control_supported; + MMFlowControl flow_control_selected = MM_FLOW_CONTROL_UNKNOWN; + MMFlowControl flow_control_requested; + gchar *flow_control_supported_str = NULL; + gchar *flow_control_selected_str = NULL; + MMPortSerialAt *port; + + self = MM_BROADBAND_MODEM (_self); + + /* Completely ignore errors in AT+IFC=? */ + response = mm_base_modem_at_command_finish (_self, res, &error); + if (!response) + goto out; + + /* Parse response */ + flow_control_supported = mm_parse_ifc_test_response (response, &error); + if (flow_control_supported == MM_FLOW_CONTROL_UNKNOWN) + goto out; + flow_control_supported_str = mm_flow_control_build_string_from_mask (flow_control_supported); + + port = mm_base_modem_peek_best_at_port (_self, &error); + if (!port) + goto out; + + flow_control_requested = mm_port_serial_get_flow_control (MM_PORT_SERIAL (port)); + if (flow_control_requested != MM_FLOW_CONTROL_UNKNOWN) { + gchar *flow_control_requested_str; + + flow_control_requested_str = mm_flow_control_build_string_from_mask (flow_control_requested); + + /* If flow control settings requested via udev tag are not supported by + * the modem, we trigger a fatal error */ + if (!(flow_control_supported & flow_control_requested)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Explicitly requested flow control settings (%s) are not supported by the device (%s)", + flow_control_requested_str, flow_control_supported_str); + g_object_unref (task); + g_free (flow_control_requested_str); + g_free (flow_control_supported_str); + return; + } + + mm_dbg ("Flow control settings explicitly requested (%s)", flow_control_requested_str); + flow_control_selected = flow_control_requested; + flow_control_selected_str = flow_control_requested_str; + } else { + /* If flow control is not set explicitly by udev tags, + * we prefer the methods in this order: + * RTS/CTS + * XON/XOFF + * None. + */ + if (flow_control_supported & MM_FLOW_CONTROL_RTS_CTS) + flow_control_selected = MM_FLOW_CONTROL_RTS_CTS; + else if (flow_control_supported & MM_FLOW_CONTROL_XON_XOFF) + flow_control_selected = MM_FLOW_CONTROL_XON_XOFF; + else if (flow_control_supported & MM_FLOW_CONTROL_NONE) + flow_control_selected = MM_FLOW_CONTROL_NONE; + else + g_assert_not_reached (); + flow_control_selected_str = mm_flow_control_build_string_from_mask (flow_control_selected); + mm_dbg ("Flow control settings automatically selected (%s)", flow_control_selected_str); + } + + /* Select flow control for all connections */ + self->priv->flow_control = flow_control_selected; + g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FLOW_CONTROL]); + + /* Set flow control settings and ignore result */ + switch (flow_control_selected) { + case MM_FLOW_CONTROL_RTS_CTS: + cmd = "+IFC=2,2"; + break; + case MM_FLOW_CONTROL_XON_XOFF: + cmd = "+IFC=1,1"; + break; + case MM_FLOW_CONTROL_NONE: + cmd = "+IFC=0,0"; + break; + default: + g_assert_not_reached (); + } + mm_base_modem_at_command (_self, cmd, 3, FALSE, NULL, NULL); + +out: + g_free (flow_control_supported_str); + g_free (flow_control_selected_str); + + /* Ignore errors */ + if (error) { + mm_dbg ("couldn't load supported flow control methods: %s", error->message); + g_error_free (error); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -3032,107 +3747,70 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); - /* By default, try to set XOFF/XON flow control */ + /* Query supported flow control methods */ mm_base_modem_at_command (MM_BASE_MODEM (self), - "+IFC=1,1", + "+IFC=?", 3, - FALSE, - NULL, - NULL); - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_setup_flow_control); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + TRUE, + (GAsyncReadyCallback)ifc_test_ready, + task); } /*****************************************************************************/ /* Power state loading (Modem interface) */ static MMModemPowerState -load_power_state_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +modem_load_power_state_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_POWER_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemPowerState)GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_POWER_STATE_UNKNOWN; + } + return (MMModemPowerState)value; } static void cfun_query_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *result; - guint state; + MMModemPowerState state; GError *error = NULL; - result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (!result) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - /* Parse power state reply */ - result = mm_strip_tag (result, "+CFUN:"); - if (!mm_get_uint_from_str (result, &state)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse +CFUN? response '%s'", - result); - } else { - switch (state) { - case 0: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_OFF), NULL); - break; - case 1: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_ON), NULL); - break; - case 4: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_LOW), NULL); - break; - default: - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled power state: '%u'", - state); - break; - } - } + result = mm_base_modem_at_command_finish (self, res, &error); + if (!result || !mm_3gpp_parse_cfun_query_generic_response (result, &state, &error)) + g_task_return_error (task, error); + else + g_task_return_int (task, state);; - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void -load_power_state (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_load_power_state (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_power_state); + task = g_task_new (self, NULL, callback, user_data); /* CDMA-only modems don't need this */ if (mm_iface_modem_is_cdma_only (self)) { mm_dbg ("Assuming full power state in CDMA-only modem..."); - g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_ON), NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, MM_MODEM_POWER_STATE_ON); + g_object_unref (task); return; } @@ -3142,7 +3820,7 @@ 3, FALSE, (GAsyncReadyCallback)cfun_query_ready, - result); + task); } /*****************************************************************************/ @@ -3164,7 +3842,7 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* CDMA-only modems don't need this */ if (mm_iface_modem_is_cdma_only (self)) @@ -3177,13 +3855,135 @@ NULL, NULL); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_up); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Reprobing the modem if the SIM changed across a power-off or power-down */ + +typedef struct { + MMBaseSim *sim; + guint retries; +} SimSwapContext; + +static gboolean load_sim_identifier (GTask *task); + +static void +sim_swap_context_free (SimSwapContext *ctx) +{ + g_clear_object (&ctx->sim); + g_slice_free (SimSwapContext, ctx); +} + +static gboolean +modem_check_for_sim_swap_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +load_sim_identifier_ready (MMBaseSim *sim, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModem *self; + SimSwapContext *ctx; + const gchar *cached_simid; + gchar *current_simid; + GError *error = NULL; + + self = MM_BROADBAND_MODEM (g_task_get_source_object (task)); + ctx = g_task_get_task_data (task); + cached_simid = mm_gdbus_sim_get_sim_identifier (MM_GDBUS_SIM (sim)); + current_simid = MM_BASE_SIM_GET_CLASS (sim)->load_sim_identifier_finish (sim, res, &error); + + if (error) { + if (g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) { + g_task_return_error (task, error); + goto out; + } + + if (ctx->retries > 0) { + mm_warn ("could not load SIM identifier: %s (%d retries left)", + error->message, ctx->retries); + --ctx->retries; + g_clear_error (&error); + g_timeout_add_seconds (1, (GSourceFunc) load_sim_identifier, task); + return; + } + + mm_warn ("could not load SIM identifier: %s", error->message); + g_task_return_error (task, error); + goto out; + } + + if (g_strcmp0 (current_simid, cached_simid) != 0) { + mm_info ("sim identifier has changed: possible SIM swap during power down/low"); + mm_broadband_modem_update_sim_hot_swap_detected (self); + } + + g_task_return_boolean (task, TRUE); + +out: + g_free (current_simid); + g_object_unref (task); +} + +static gboolean +load_sim_identifier (GTask *task) +{ + SimSwapContext *ctx = g_task_get_task_data (task); + + MM_BASE_SIM_GET_CLASS (ctx->sim)->load_sim_identifier ( + ctx->sim, + (GAsyncReadyCallback)load_sim_identifier_ready, + task); + + return G_SOURCE_REMOVE; +} + +static void +modem_check_for_sim_swap (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + SimSwapContext *ctx; + + mm_dbg ("Checking if SIM was swapped..."); + + task = g_task_new (self, NULL, callback, user_data); + ctx = g_slice_new0 (SimSwapContext); + ctx->retries = 3; + g_task_set_task_data (task, ctx, (GDestroyNotify)sim_swap_context_free); + + g_object_get (self, + MM_IFACE_MODEM_SIM, &ctx->sim, + NULL); + if (!ctx->sim) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "could not acquire sim object"); + g_object_unref (task); + return; + } + + if (!MM_BASE_SIM_GET_CLASS (ctx->sim)->load_sim_identifier || + !MM_BASE_SIM_GET_CLASS (ctx->sim)->load_sim_identifier_finish) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "sim identifier could not be loaded"); + g_object_unref (task); + return; + } + + load_sim_identifier (task); } /*****************************************************************************/ @@ -3252,44 +4052,40 @@ /* Facility locks status loading (3GPP interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; guint current; MMModem3gppFacility facilities; MMModem3gppFacility locks; } LoadEnabledFacilityLocksContext; -static void get_next_facility_lock_status (LoadEnabledFacilityLocksContext *ctx); - -static void -load_enabled_facility_locks_context_complete_and_free (LoadEnabledFacilityLocksContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} +static void get_next_facility_lock_status (GTask *task); static MMModem3gppFacility modem_3gpp_load_enabled_facility_locks_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_3GPP_FACILITY_NONE; + GError *inner_error = NULL; + gssize value; - return ((MMModem3gppFacility) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_3GPP_FACILITY_NONE; + } + return (MMModem3gppFacility)value; } static void clck_single_query_ready (MMBaseModem *self, GAsyncResult *res, - LoadEnabledFacilityLocksContext *ctx) + GTask *task) { + LoadEnabledFacilityLocksContext *ctx; const gchar *response; gboolean enabled = FALSE; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (self, res, NULL); if (response && mm_3gpp_parse_clck_write_response (response, &enabled) && @@ -3302,14 +4098,19 @@ /* And go on with the next one */ ctx->current++; - get_next_facility_lock_status (ctx); + get_next_facility_lock_status (task); } static void -get_next_facility_lock_status (LoadEnabledFacilityLocksContext *ctx) +get_next_facility_lock_status (GTask *task) { + MMBroadbandModem *self; + LoadEnabledFacilityLocksContext *ctx; guint i; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + for (i = ctx->current; i < sizeof (MMModem3gppFacility) * 8; i++) { guint32 facility = 1u << i; @@ -3323,46 +4124,47 @@ /* Query current */ cmd = g_strdup_printf ("+CLCK=\"%s\",2", mm_3gpp_facility_to_acronym (facility)); - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), cmd, 3, FALSE, (GAsyncReadyCallback)clck_single_query_ready, - ctx); + task); g_free (cmd); return; } } /* No more facilities to query, all done */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (ctx->locks), - NULL); - load_enabled_facility_locks_context_complete_and_free (ctx); + g_task_return_int (task, ctx->locks); + g_object_unref (task); } static void clck_test_ready (MMBaseModem *self, GAsyncResult *res, - LoadEnabledFacilityLocksContext *ctx) + GTask *task) { + LoadEnabledFacilityLocksContext *ctx; const gchar *response; GError *error = NULL; response = mm_base_modem_at_command_finish (self, res, &error); if (!response) { - g_simple_async_result_take_error (ctx->result, error); - load_enabled_facility_locks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + if (!mm_3gpp_parse_clck_test_response (response, &ctx->facilities)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse list of available lock facilities: '%s'", - response); - load_enabled_facility_locks_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse list of available lock facilities: '%s'", + response); + g_object_unref (task); return; } @@ -3378,7 +4180,7 @@ } /* Go on... */ - get_next_facility_lock_status (ctx); + get_next_facility_lock_status (task); } static void @@ -3387,24 +4189,23 @@ gpointer user_data) { LoadEnabledFacilityLocksContext *ctx; + GTask *task; ctx = g_new (LoadEnabledFacilityLocksContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_enabled_facility_locks); ctx->facilities = MM_MODEM_3GPP_FACILITY_NONE; ctx->locks = MM_MODEM_3GPP_FACILITY_NONE; ctx->current = 0; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + mm_dbg ("loading enabled facility locks..."); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CLCK=?", 3, TRUE, (GAsyncReadyCallback)clck_test_ready, - ctx); + task); } /*****************************************************************************/ @@ -3416,16 +4217,23 @@ GError **error) { const gchar *result; - gchar *operator_code; + gchar *operator_code = NULL; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); if (!result) return NULL; - operator_code = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_UNKNOWN); + if (!mm_3gpp_parse_cops_read_response (result, + NULL, /* mode */ + NULL, /* format */ + &operator_code, + NULL, /* act */ + error)) + return NULL; + + mm_3gpp_normalize_operator (&operator_code, MM_BROADBAND_MODEM (self)->priv->modem_current_charset); if (operator_code) mm_dbg ("loaded Operator Code: %s", operator_code); - return operator_code; } @@ -3435,12 +4243,8 @@ gpointer user_data) { mm_dbg ("loading Operator Code..."); - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+COPS=3,2;+COPS?", - 3, - FALSE, - callback, - user_data); + mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS=3,2", 3, FALSE, NULL, NULL); + mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS?", 3, FALSE, callback, user_data); } /*****************************************************************************/ @@ -3452,16 +4256,23 @@ GError **error) { const gchar *result; - gchar *operator_name; + gchar *operator_name = NULL; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); if (!result) return NULL; - operator_name = mm_3gpp_parse_operator (result, MM_BROADBAND_MODEM (self)->priv->modem_current_charset); + if (!mm_3gpp_parse_cops_read_response (result, + NULL, /* mode */ + NULL, /* format */ + &operator_name, + NULL, /* act */ + error)) + return NULL; + + mm_3gpp_normalize_operator (&operator_name, MM_BROADBAND_MODEM (self)->priv->modem_current_charset); if (operator_name) mm_dbg ("loaded Operator Name: %s", operator_name); - return operator_name; } @@ -3471,8 +4282,36 @@ gpointer user_data) { mm_dbg ("loading Operator Name..."); + mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS=3,0", 3, FALSE, NULL, NULL); + mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS?", 3, FALSE, callback, user_data); +} + +/*****************************************************************************/ +/* UE mode of operation for EPS loading (3GPP interface) */ + +static MMModem3gppEpsUeModeOperation +modem_3gpp_load_eps_ue_mode_operation_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + MMModem3gppEpsUeModeOperation mode; + const gchar *result; + + result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!result || !mm_3gpp_parse_cemode_query_response (result, &mode, error)) + return MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN; + + return mode; +} + +static void +modem_3gpp_load_eps_ue_mode_operation (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_dbg ("loading UE mode of operation for EPS..."); mm_base_modem_at_command (MM_BASE_MODEM (self), - "+COPS=3,0;+COPS?", + "+CEMODE?", 3, FALSE, callback, @@ -3480,39 +4319,33 @@ } /*****************************************************************************/ -/* Subscription State Loading (3GPP interface) */ +/* UE mode of operation for EPS settin (3GPP interface) */ -static MMModem3gppSubscriptionState -modem_3gpp_load_subscription_state_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +static gboolean +modem_3gpp_set_eps_ue_mode_operation_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN; - - return (MMModem3gppSubscriptionState) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); } static void -modem_3gpp_load_subscription_state (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_set_eps_ue_mode_operation (MMIfaceModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_subscription_state); - - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN), - NULL); + gchar *cmd; - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + mm_dbg ("updating UE mode of operation for EPS..."); + cmd = mm_3gpp_build_cemode_set_request (mode); + mm_base_modem_at_command (MM_BASE_MODEM (self), + cmd, + 3, + FALSE, + callback, + user_data); + g_free (cmd); } /*****************************************************************************/ @@ -3523,7 +4356,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -3532,7 +4365,7 @@ MMBroadbandModem *self) { MMModem3gppRegistrationState state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; - gulong lac = 0, cell_id = 0; + gulong lac = 0, tac = 0, cell_id = 0; MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; gboolean cgreg = FALSE; gboolean cereg = FALSE; @@ -3552,13 +4385,24 @@ return; } - /* Report new registration state */ + /* Report new registration state and fix LAC/TAC. + * According to 3GPP TS 27.007: + * - If CREG reports 7 (LTE) then the field contains TAC + * - CEREG always reports TAC + */ if (cgreg) mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), state); - else if (cereg) + else if (cereg) { + tac = lac; + lac = 0; mm_iface_modem_3gpp_update_eps_registration_state (MM_IFACE_MODEM_3GPP (self), state); - else + } else { + if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) { + tac = lac; + lac = 0; + } mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), state); + } /* Only update access technologies from CREG/CGREG response if the modem * doesn't have custom commands for access technology loading, otherwise @@ -3569,7 +4413,7 @@ MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies == NULL) mm_iface_modem_3gpp_update_access_technologies (MM_IFACE_MODEM_3GPP (self), act); - mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cell_id); + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cell_id); } static void @@ -3577,16 +4421,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MMPortSerialAt *ports[2]; GPtrArray *array; guint i; guint j; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_setup_unsolicited_registration_events); + GTask *task; ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); @@ -3610,9 +4449,9 @@ } mm_3gpp_creg_regex_destroy (array); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -3623,7 +4462,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -3631,16 +4470,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MMPortSerialAt *ports[2]; GPtrArray *array; guint i; guint j; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_cleanup_unsolicited_registration_events); + GTask *task; ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self)); @@ -3665,9 +4499,9 @@ } mm_3gpp_creg_regex_destroy (array); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -3748,8 +4582,6 @@ /* Registration checks (3GPP interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; gboolean cs_supported; gboolean ps_supported; gboolean eps_supported; @@ -3765,17 +4597,14 @@ } RunRegistrationChecksContext; static void -run_registration_checks_context_complete_and_free (RunRegistrationChecksContext *ctx) +run_registration_checks_context_free (RunRegistrationChecksContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->cs_error) g_error_free (ctx->cs_error); if (ctx->ps_error) g_error_free (ctx->ps_error); if (ctx->eps_error) g_error_free (ctx->eps_error); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -3784,19 +4613,20 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void run_registration_checks_context_step (RunRegistrationChecksContext *ctx); +static void run_registration_checks_context_step (GTask *task); static void registration_status_check_ready (MMBroadbandModem *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; const gchar *response; GError *error = NULL; - GMatchInfo *match_info; + GMatchInfo *match_info = NULL; guint i; gboolean parsed; gboolean cgreg; @@ -3804,8 +4634,11 @@ MMModem3gppRegistrationState state; MMModemAccessTechnology act; gulong lac; + gulong tac; gulong cid; + ctx = g_task_get_task_data (task); + /* Only one must be running */ g_assert ((ctx->running_cs ? 1 : 0) + (ctx->running_ps ? 1 : 0) + @@ -3821,7 +4654,7 @@ else ctx->eps_error = error; - run_registration_checks_context_step (ctx); + run_registration_checks_context_step (task); return; } @@ -3830,7 +4663,7 @@ */ if (!response[0]) { /* Done */ - run_registration_checks_context_step (ctx); + run_registration_checks_context_step (task); return; } @@ -3860,7 +4693,7 @@ else ctx->eps_error = error; - run_registration_checks_context_step (ctx); + run_registration_checks_context_step (task); return; } @@ -3868,6 +4701,7 @@ cereg = FALSE; state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + tac = 0; lac = 0; cid = 0; parsed = mm_3gpp_parse_creg_response (match_info, @@ -3892,11 +4726,15 @@ ctx->ps_error = error; else ctx->eps_error = error; - run_registration_checks_context_step (ctx); + run_registration_checks_context_step (task); return; } - /* Report new registration state */ + /* Report new registration state and fix LAC/TAC. + * According to 3GPP TS 27.007: + * - If CREG reports 7 (LTE) then the field contains TAC + * - CEREG always reports TAC + */ if (cgreg) { if (ctx->running_cs) mm_dbg ("Got PS registration state when checking CS registration state"); @@ -3904,12 +4742,18 @@ mm_dbg ("Got PS registration state when checking EPS registration state"); mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), state); } else if (cereg) { + tac = lac; + lac = 0; if (ctx->running_cs) mm_dbg ("Got EPS registration state when checking CS registration state"); else if (ctx->running_ps) mm_dbg ("Got EPS registration state when checking PS registration state"); mm_iface_modem_3gpp_update_eps_registration_state (MM_IFACE_MODEM_3GPP (self), state); } else { + if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) { + tac = lac; + lac = 0; + } if (ctx->running_ps) mm_dbg ("Got CS registration state when checking PS registration state"); else if (ctx->running_eps) @@ -3918,14 +4762,21 @@ } mm_iface_modem_3gpp_update_access_technologies (MM_IFACE_MODEM_3GPP (self), act); - mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cid); + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid); - run_registration_checks_context_step (ctx); + run_registration_checks_context_step (task); } static void -run_registration_checks_context_step (RunRegistrationChecksContext *ctx) +run_registration_checks_context_step (GTask *task) { + MMBroadbandModem *self; + RunRegistrationChecksContext *ctx; + GError *error = NULL; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + ctx->running_cs = FALSE; ctx->running_ps = FALSE; ctx->running_eps = FALSE; @@ -3934,12 +4785,12 @@ ctx->running_cs = TRUE; ctx->run_cs = FALSE; /* Check current CS-registration state. */ - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "+CREG?", 10, FALSE, (GAsyncReadyCallback)registration_status_check_ready, - ctx); + task); return; } @@ -3947,12 +4798,12 @@ ctx->running_ps = TRUE; ctx->run_ps = FALSE; /* Check current PS-registration state. */ - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "+CGREG?", 10, FALSE, (GAsyncReadyCallback)registration_status_check_ready, - ctx); + task); return; } @@ -3960,12 +4811,12 @@ ctx->running_eps = TRUE; ctx->run_eps = FALSE; /* Check current EPS-registration state. */ - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), "+CEREG?", 10, FALSE, (GAsyncReadyCallback)registration_status_check_ready, - ctx); + task); return; } @@ -3976,20 +4827,23 @@ (!ctx->eps_supported || ctx->eps_error)) { /* Prefer the EPS, and then PS error if any */ if (ctx->eps_error) { - g_simple_async_result_set_from_error (ctx->result, ctx->eps_error); + g_propagate_error (&error, ctx->eps_error); ctx->eps_error = NULL; } else if (ctx->ps_error) { - g_simple_async_result_set_from_error (ctx->result, ctx->ps_error); + g_propagate_error (&error, ctx->ps_error); ctx->ps_error = NULL; } else if (ctx->cs_error) { - g_simple_async_result_set_from_error (ctx->result, ctx->cs_error); + g_propagate_error (&error, ctx->cs_error); ctx->cs_error = NULL; } else g_assert_not_reached (); - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + } - run_registration_checks_context_complete_and_free (ctx); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -4001,13 +4855,9 @@ gpointer user_data) { RunRegistrationChecksContext *ctx; + GTask *task; ctx = g_new0 (RunRegistrationChecksContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_run_registration_checks); ctx->cs_supported = cs_supported; ctx->ps_supported = ps_supported; ctx->eps_supported = eps_supported; @@ -4015,15 +4865,38 @@ ctx->run_ps = ps_supported; ctx->run_eps = eps_supported; - run_registration_checks_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)run_registration_checks_context_free); + + run_registration_checks_context_step (task); +} + +/*****************************************************************************/ +/* Create initial EPS bearer object */ + +static MMBaseBearer * +modem_3gpp_create_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *config) +{ + MMBaseBearer *bearer; + + /* NOTE: by default we create a bearer object that is CONNECTED but which doesn't + * have an associated data interface already set. This is so that upper layers don't + * attempt connection through this bearer object. */ + bearer = g_object_new (MM_TYPE_BASE_BEARER, + MM_BASE_BEARER_MODEM, MM_BASE_MODEM (self), + MM_BASE_BEARER_CONFIG, config, + "bearer-type", MM_BEARER_TYPE_DEFAULT_ATTACH, + "connected", TRUE, + NULL); + mm_base_bearer_export (bearer); + return bearer; } /*****************************************************************************/ /* Enable/Disable unsolicited registration events (3GPP interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; gboolean enable; /* TRUE for enabling, FALSE for disabling */ gboolean run_cs; gboolean run_ps; @@ -4039,43 +4912,40 @@ } UnsolicitedRegistrationEventsContext; static void -unsolicited_registration_events_context_complete_and_free (UnsolicitedRegistrationEventsContext *ctx) +unsolicited_registration_events_context_free (UnsolicitedRegistrationEventsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->cs_error) g_error_free (ctx->cs_error); if (ctx->ps_error) g_error_free (ctx->ps_error); if (ctx->eps_error) g_error_free (ctx->eps_error); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } -static UnsolicitedRegistrationEventsContext * -unsolicited_registration_events_context_new (MMBroadbandModem *self, - gboolean enable, - gboolean cs_supported, - gboolean ps_supported, - gboolean eps_supported, - GAsyncReadyCallback callback, - gpointer user_data) +static GTask * +unsolicited_registration_events_task_new (MMBroadbandModem *self, + gboolean enable, + gboolean cs_supported, + gboolean ps_supported, + gboolean eps_supported, + GAsyncReadyCallback callback, + gpointer user_data) { UnsolicitedRegistrationEventsContext *ctx; + GTask *task; ctx = g_new0 (UnsolicitedRegistrationEventsContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - unsolicited_registration_events_context_new); ctx->enable = enable; ctx->run_cs = cs_supported; ctx->run_ps = ps_supported; ctx->run_eps = eps_supported; - return ctx; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, + ctx, + (GDestroyNotify)unsolicited_registration_events_context_free); + return task; } static gboolean @@ -4083,7 +4953,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean @@ -4147,17 +5017,20 @@ { NULL } }; -static void unsolicited_registration_events_context_step (UnsolicitedRegistrationEventsContext *ctx); +static void unsolicited_registration_events_context_step (GTask *task); static void unsolicited_registration_events_sequence_ready (MMBroadbandModem *self, GAsyncResult *res, - UnsolicitedRegistrationEventsContext *ctx) + GTask *task) { + UnsolicitedRegistrationEventsContext *ctx; GError *error = NULL; GVariant *command; MMPortSerialAt *secondary; + ctx = g_task_get_task_data (task); + /* Only one must be running */ g_assert ((ctx->running_cs ? 1 : 0) + (ctx->running_ps ? 1 : 0) + @@ -4199,7 +5072,7 @@ } /* Done with primary and secondary, keep on */ - unsolicited_registration_events_context_step (ctx); + unsolicited_registration_events_context_step (task); return; } @@ -4240,7 +5113,7 @@ FALSE, /* raw */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_registration_events_sequence_ready, - ctx); + task); return; } @@ -4260,17 +5133,24 @@ NULL, /* response processor context free */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_registration_events_sequence_ready, - ctx); + task); return; } /* We're done */ - unsolicited_registration_events_context_step (ctx); + unsolicited_registration_events_context_step (task); } static void -unsolicited_registration_events_context_step (UnsolicitedRegistrationEventsContext *ctx) +unsolicited_registration_events_context_step (GTask *task) { + MMBroadbandModem *self; + UnsolicitedRegistrationEventsContext *ctx; + GError *error = NULL; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + ctx->running_cs = FALSE; ctx->running_ps = FALSE; ctx->running_eps = FALSE; @@ -4280,14 +5160,14 @@ ctx->running_cs = TRUE; ctx->run_cs = FALSE; mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)), + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), ctx->enable ? cs_registration_sequence : cs_unregistration_sequence, NULL, /* response processor context */ NULL, /* response processor context free */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_registration_events_sequence_ready, - ctx); + task); return; } @@ -4295,14 +5175,14 @@ ctx->running_ps = TRUE; ctx->run_ps = FALSE; mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)), + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), ctx->enable ? ps_registration_sequence : ps_unregistration_sequence, NULL, /* response processor context */ NULL, /* response processor context free */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_registration_events_sequence_ready, - ctx); + task); return; } @@ -4310,14 +5190,14 @@ ctx->running_eps = TRUE; ctx->run_eps = FALSE; mm_base_modem_at_sequence_full ( - MM_BASE_MODEM (ctx->self), - mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self)), + MM_BASE_MODEM (self), + mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)), ctx->enable ? eps_registration_sequence : eps_unregistration_sequence, NULL, /* response processor context */ NULL, /* response processor context free */ NULL, /* cancellable */ (GAsyncReadyCallback)unsolicited_registration_events_sequence_ready, - ctx); + task); return; } @@ -4325,17 +5205,21 @@ * If we have any error reported, we'll propagate it. EPS errors take * precedence over PS errors and PS errors take precedence over CS errors. */ if (ctx->eps_error) { - g_simple_async_result_take_error (ctx->result, ctx->eps_error); + g_propagate_error (&error, ctx->eps_error); ctx->eps_error = NULL; } else if (ctx->ps_error) { - g_simple_async_result_take_error (ctx->result, ctx->ps_error); + g_propagate_error (&error, ctx->ps_error); ctx->ps_error = NULL; } else if (ctx->cs_error) { - g_simple_async_result_take_error (ctx->result, ctx->cs_error); + g_propagate_error (&error, ctx->cs_error); ctx->cs_error = NULL; - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - unsolicited_registration_events_context_complete_and_free (ctx); + } + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -4347,13 +5231,13 @@ gpointer user_data) { unsolicited_registration_events_context_step ( - unsolicited_registration_events_context_new (MM_BROADBAND_MODEM (self), - FALSE, - cs_supported, - ps_supported, - eps_supported, - callback, - user_data)); + unsolicited_registration_events_task_new (MM_BROADBAND_MODEM (self), + FALSE, + cs_supported, + ps_supported, + eps_supported, + callback, + user_data)); } static void @@ -4365,190 +5249,172 @@ gpointer user_data) { unsolicited_registration_events_context_step ( - unsolicited_registration_events_context_new (MM_BROADBAND_MODEM (self), - TRUE, - cs_supported, - ps_supported, - eps_supported, - callback, - user_data)); + unsolicited_registration_events_task_new (MM_BROADBAND_MODEM (self), + TRUE, + cs_supported, + ps_supported, + eps_supported, + callback, + user_data)); } /*****************************************************************************/ /* Cancel USSD (3GPP/USSD interface) */ static gboolean -modem_3gpp_ussd_cancel_finish (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error) +modem_3gpp_ussd_cancel_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cancel_command_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); - if (error) - g_simple_async_result_take_error (simple, error); - else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); - /* Complete the pending action, if any */ + /* Complete the pending action, regardless of the CUSD result */ if (self->priv->pending_ussd_action) { - g_simple_async_result_set_error (self->priv->pending_ussd_action, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "USSD session was cancelled"); - g_simple_async_result_complete_in_idle (self->priv->pending_ussd_action); - g_object_unref (self->priv->pending_ussd_action); + GTask *task; + + task = self->priv->pending_ussd_action; self->priv->pending_ussd_action = NULL; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, + "USSD session was cancelled"); + g_object_unref (task); } mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void modem_3gpp_ussd_cancel (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_ussd_cancel); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CUSD=2", 10, TRUE, (GAsyncReadyCallback)cancel_command_ready, - result); + task); } /*****************************************************************************/ /* Send command (3GPP/USSD interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - gchar *command; - gboolean current_is_unencoded; - gboolean encoded_used; - gboolean unencoded_used; + gchar *command; + gboolean current_is_unencoded; + gboolean encoded_used; + gboolean unencoded_used; } Modem3gppUssdSendContext; static void -modem_3gpp_ussd_send_context_complete_and_free (Modem3gppUssdSendContext *ctx) +modem_3gpp_ussd_send_context_free (Modem3gppUssdSendContext *ctx) { - /* We check for result, as we may have already set it in - * priv->pending_ussd_request */ - if (ctx->result) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - } - g_object_unref (ctx->self); g_free (ctx->command); g_slice_free (Modem3gppUssdSendContext, ctx); } -static const gchar * -modem_3gpp_ussd_send_finish (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error) +static gchar * +modem_3gpp_ussd_send_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - /* We can return the string as constant because it is owned by the async - * result, which will be valid during the whole call of its callback, which - * is when we're actually calling finish() */ - return (const gchar *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } -static void modem_3gpp_ussd_context_step (Modem3gppUssdSendContext *ctx); +static void modem_3gpp_ussd_context_step (MMBroadbandModem *self); static void cusd_process_string (MMBroadbandModem *self, const gchar *str); static void -ussd_send_command_ready (MMBroadbandModem *self, - GAsyncResult *res, - Modem3gppUssdSendContext *ctx) +ussd_send_command_ready (MMBaseModem *_self, + GAsyncResult *res) { - GError *error = NULL; - const gchar *reply; + MMBroadbandModem *self; + Modem3gppUssdSendContext *ctx; + GError *error = NULL; + const gchar *response; - g_assert (ctx->result == NULL); + self = MM_BROADBAND_MODEM (_self); - reply = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + response = mm_base_modem_at_command_finish (_self, res, &error); if (error) { /* Some immediate error happened when sending the USSD request */ mm_dbg ("Error sending USSD request: '%s'", error->message); g_error_free (error); if (self->priv->pending_ussd_action) { - /* Recover result */ - ctx->result = self->priv->pending_ussd_action; - self->priv->pending_ussd_action = NULL; - modem_3gpp_ussd_context_step (ctx); + modem_3gpp_ussd_context_step (self); return; } + } - /* So the USSD action was completed already... */ - mm_dbg ("USSD action already completed via URCs"); - modem_3gpp_ussd_send_context_complete_and_free (ctx); + if (!self->priv->pending_ussd_action) { + mm_dbg ("USSD operation finished already via URCs"); return; } /* Cache the hint for the next time we send something */ - if (!ctx->self->priv->use_unencoded_ussd && - ctx->current_is_unencoded) { + ctx = g_task_get_task_data (self->priv->pending_ussd_action); + if (!self->priv->use_unencoded_ussd && ctx->current_is_unencoded) { mm_dbg ("Will assume we want unencoded USSD commands"); - ctx->self->priv->use_unencoded_ussd = TRUE; - } else if (ctx->self->priv->use_unencoded_ussd && - !ctx->current_is_unencoded) { + self->priv->use_unencoded_ussd = TRUE; + } else if (self->priv->use_unencoded_ussd && !ctx->current_is_unencoded) { mm_dbg ("Will assume we want encoded USSD commands"); - ctx->self->priv->use_unencoded_ussd = FALSE; + self->priv->use_unencoded_ussd = FALSE; } - if (!self->priv->pending_ussd_action) - mm_dbg ("USSD operation finished already via URCs"); - else if (reply && reply[0]) { - reply = mm_strip_tag (reply, "+CUSD:"); - cusd_process_string (ctx->self, reply); + if (response && response[0]) { + response = mm_strip_tag (response, "+CUSD:"); + cusd_process_string (self, response); } - - modem_3gpp_ussd_send_context_complete_and_free (ctx); } static void -modem_3gpp_ussd_context_send_encoded (Modem3gppUssdSendContext *ctx) +modem_3gpp_ussd_context_send_encoded (MMBroadbandModem *self) { - gchar *at_command = NULL; - GError *error = NULL; - guint scheme = 0; - gchar *encoded; + Modem3gppUssdSendContext *ctx; + gchar *at_command = NULL; + GError *error = NULL; + guint scheme = 0; + gchar *encoded; + + g_assert (self->priv->pending_ussd_action); + ctx = g_task_get_task_data (self->priv->pending_ussd_action); /* Encode USSD command */ - encoded = mm_iface_modem_3gpp_ussd_encode (MM_IFACE_MODEM_3GPP_USSD (ctx->self), - ctx->command, - &scheme, - &error); + encoded = mm_iface_modem_3gpp_ussd_encode (MM_IFACE_MODEM_3GPP_USSD (self), ctx->command, &scheme, &error); if (!encoded) { - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self), - MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); - g_simple_async_result_take_error (ctx->result, error); - modem_3gpp_ussd_send_context_complete_and_free (ctx); + GTask *task; + + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; + + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); + + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -4558,25 +5424,23 @@ at_command = g_strdup_printf ("+CUSD=1,\"%s\",%d", encoded, scheme); g_free (encoded); - /* Cache the action, as it may be completed via URCs. - * There shouldn't be any previous action pending. */ - g_warn_if_fail (ctx->self->priv->pending_ussd_action == NULL); - ctx->self->priv->pending_ussd_action = ctx->result; - ctx->result = NULL; - - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), at_command, 10, FALSE, (GAsyncReadyCallback)ussd_send_command_ready, - ctx); + NULL); g_free (at_command); } static void -modem_3gpp_ussd_context_send_unencoded (Modem3gppUssdSendContext *ctx) +modem_3gpp_ussd_context_send_unencoded (MMBroadbandModem *self) { - gchar *at_command = NULL; + Modem3gppUssdSendContext *ctx; + gchar *at_command = NULL; + + g_assert (self->priv->pending_ussd_action); + ctx = g_task_get_task_data (self->priv->pending_ussd_action); /* Build AT command with action unencoded */ ctx->unencoded_used = TRUE; @@ -4585,76 +5449,86 @@ ctx->command, MM_MODEM_GSM_USSD_SCHEME_7BIT); - /* Cache the action, as it may be completed via URCs. - * There shouldn't be any previous action pending. */ - g_warn_if_fail (ctx->self->priv->pending_ussd_action == NULL); - ctx->self->priv->pending_ussd_action = ctx->result; - ctx->result = NULL; - - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), at_command, 10, FALSE, (GAsyncReadyCallback)ussd_send_command_ready, - ctx); + NULL); g_free (at_command); } static void -modem_3gpp_ussd_context_step (Modem3gppUssdSendContext *ctx) +modem_3gpp_ussd_context_step (MMBroadbandModem *self) { - if (ctx->encoded_used && - ctx->unencoded_used) { - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self), + Modem3gppUssdSendContext *ctx; + + g_assert (self->priv->pending_ussd_action); + ctx = g_task_get_task_data (self->priv->pending_ussd_action); + + if (ctx->encoded_used && ctx->unencoded_used) { + GTask *task; + + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; + + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Sending USSD command failed"); - modem_3gpp_ussd_send_context_complete_and_free (ctx); + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Sending USSD command failed"); + g_object_unref (task); return; } - if (ctx->self->priv->use_unencoded_ussd) { + if (self->priv->use_unencoded_ussd) { if (!ctx->unencoded_used) - modem_3gpp_ussd_context_send_unencoded (ctx); + modem_3gpp_ussd_context_send_unencoded (self); else if (!ctx->encoded_used) - modem_3gpp_ussd_context_send_encoded (ctx); + modem_3gpp_ussd_context_send_encoded (self); else g_assert_not_reached (); } else { if (!ctx->encoded_used) - modem_3gpp_ussd_context_send_encoded (ctx); + modem_3gpp_ussd_context_send_encoded (self); else if (!ctx->unencoded_used) - modem_3gpp_ussd_context_send_unencoded (ctx); + modem_3gpp_ussd_context_send_unencoded (self); else g_assert_not_reached (); } } static void -modem_3gpp_ussd_send (MMIfaceModem3gppUssd *self, - const gchar *command, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_ussd_send (MMIfaceModem3gppUssd *_self, + const gchar *command, + GAsyncReadyCallback callback, + gpointer user_data) { + MMBroadbandModem *self; + GTask *task; Modem3gppUssdSendContext *ctx; + self = MM_BROADBAND_MODEM (_self); + + task = g_task_new (self, NULL, callback, user_data); ctx = g_slice_new0 (Modem3gppUssdSendContext); - /* We're going to steal the string result in finish() so we must have a - * callback specified. */ - g_assert (callback != NULL); - ctx->self = g_object_ref (self); ctx->command = g_strdup (command); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_ussd_send); + g_task_set_task_data (task, ctx, (GDestroyNotify) modem_3gpp_ussd_send_context_free); - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), - MM_MODEM_3GPP_USSD_SESSION_STATE_ACTIVE); + /* Fail if there is an ongoing operation already */ + if (self->priv->pending_ussd_action) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, + "there is already an ongoing USSD operation"); + g_object_unref (task); + return; + } - modem_3gpp_ussd_context_step (ctx); + /* Cache the action, as it may be completed via URCs */ + self->priv->pending_ussd_action = task; + + mm_iface_modem_3gpp_ussd_update_state (_self, MM_MODEM_3GPP_USSD_SESSION_STATE_ACTIVE); + + modem_3gpp_ussd_context_step (self); } /*****************************************************************************/ @@ -4672,11 +5546,17 @@ ussd_command = g_byte_array_new (); - /* encode to the current charset */ + /* Encode to the current charset (as per AT+CSCS, which is what most modems + * (except for Huawei it seems) will ask for. */ if (mm_modem_charset_byte_array_append (ussd_command, command, FALSE, broadband->priv->modem_current_charset)) { + /* The scheme value does NOT represent the encoding used to encode the string + * we're giving. This scheme reflects the encoding that the modem should use when + * sending the data out to the network. We're hardcoding this to GSM-7 because + * USSD commands fit well in GSM-7, unlike USSD responses that may contain code + * points that may only be encoded in UCS-2. */ *scheme = MM_MODEM_GSM_USSD_SCHEME_7BIT; /* convert to hex representation */ hex = mm_utils_bin2hexstr (ussd_command->data, ussd_command->len); @@ -4694,19 +5574,20 @@ { MMBroadbandModem *broadband = MM_BROADBAND_MODEM (self); - return mm_modem_charset_hex_to_utf8 (reply, - broadband->priv->modem_current_charset); + /* Decode from current charset (as per AT+CSCS, which is what most modems + * (except for Huawei it seems) will ask for. */ + return mm_modem_charset_hex_to_utf8 (reply, broadband->priv->modem_current_charset); } /*****************************************************************************/ /* Setup/Cleanup unsolicited result codes (3GPP/USSD interface) */ static gboolean -modem_3gpp_ussd_setup_cleanup_unsolicited_result_codes_finish (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error) +modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gchar * @@ -4756,120 +5637,100 @@ static void cusd_process_string (MMBroadbandModem *self, - const gchar *str) + const gchar *str) { - MMModem3gppUssdSessionState ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE; + MMModem3gppUssdSessionState ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE; + GError *error = NULL; + gint status; + GTask *task; + gchar *converted = NULL; + + /* If there is a pending action, it is ALWAYS completed here */ + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; if (!str || !isdigit (*str)) { - if (self->priv->pending_ussd_action) - g_simple_async_result_set_error (self->priv->pending_ussd_action, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Invalid USSD response received: '%s'", - str ? str : "(none)"); - else - mm_warn ("Received invalid USSD network-initiated request: '%s'", - str ? str : "(none)"); - } else { - gint status; + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid USSD message received: '%s'", str ? str : "(none)"); + goto out; + } - status = g_ascii_digit_value (*str); - switch (status) { - case 0: /* no further action required */ { - gchar *converted; - GError *error = NULL; - - converted = decode_ussd_response (self, str, &error); - if (self->priv->pending_ussd_action) { - /* Response to the user's request */ - if (error) - g_simple_async_result_take_error (self->priv->pending_ussd_action, error); - else - g_simple_async_result_set_op_res_gpointer (self->priv->pending_ussd_action, - converted, - g_free); - } else { - if (error) { - mm_warn ("Invalid network initiated USSD notification: %s", - error->message); - g_error_free (error); - } else { - /* Network-initiated USSD-Notify */ - mm_iface_modem_3gpp_ussd_update_network_notification ( - MM_IFACE_MODEM_3GPP_USSD (self), - converted); - g_free (converted); - } - } + status = g_ascii_digit_value (*str); + switch (status) { + case 0: + /* no further action required */ + converted = decode_ussd_response (self, str, &error); + if (!converted) break; - } - case 1: /* further action required */ { - gchar *converted; - GError *error = NULL; - - ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_USER_RESPONSE; - converted = decode_ussd_response (self, str, &error); - if (self->priv->pending_ussd_action) { - if (error) - g_simple_async_result_take_error (self->priv->pending_ussd_action, error); - else - g_simple_async_result_set_op_res_gpointer (self->priv->pending_ussd_action, - converted, - g_free); - } else { - if (error) { - mm_warn ("Invalid network initiated USSD request: %s", - error->message); - g_error_free (error); - } else { - /* Network-initiated USSD-Request */ - mm_iface_modem_3gpp_ussd_update_network_request ( - MM_IFACE_MODEM_3GPP_USSD (self), - converted); - g_free (converted); - } - } + /* Response to the user's request? */ + if (task) break; - } - case 2: - if (self->priv->pending_ussd_action) - g_simple_async_result_set_error (self->priv->pending_ussd_action, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "USSD terminated by network."); - break; + /* Network-initiated USSD-Notify */ + mm_iface_modem_3gpp_ussd_update_network_notification (MM_IFACE_MODEM_3GPP_USSD (self), converted); + g_clear_pointer (&converted, g_free); + break; + + case 1: + /* further action required */ + ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_USER_RESPONSE; - case 4: - if (self->priv->pending_ussd_action) - g_simple_async_result_set_error (self->priv->pending_ussd_action, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Operation not supported."); + converted = decode_ussd_response (self, str, &error); + if (!converted) break; - default: - if (self->priv->pending_ussd_action) - g_simple_async_result_set_error (self->priv->pending_ussd_action, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled USSD reply: %s (%d)", - str, - status); + /* Response to the user's request? */ + if (task) break; - } + + /* Network-initiated USSD-Request */ + mm_iface_modem_3gpp_ussd_update_network_request (MM_IFACE_MODEM_3GPP_USSD (self), converted); + g_clear_pointer (&converted, g_free); + break; + + case 2: + /* Response to the user's request? */ + if (task) + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "USSD terminated by network"); + break; + + case 4: + /* Response to the user's request? */ + if (task) + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Operation not supported"); + break; + + default: + /* Response to the user's request? */ + if (task) + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unhandled USSD reply: %s (%d)", str, status); + break; } - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), - ussd_state); +out: + + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), ussd_state); /* Complete the pending action */ - if (self->priv->pending_ussd_action) { - g_simple_async_result_complete_in_idle (self->priv->pending_ussd_action); - g_object_unref (self->priv->pending_ussd_action); - self->priv->pending_ussd_action = NULL; + if (task) { + if (error) + g_task_return_error (task, error); + else if (converted) + g_task_return_pointer (task, converted, g_free); + else + g_assert_not_reached (); + return; } + + /* If no pending task, just report the error */ + if (error) { + mm_warn ("Invalid USSD message: %s", error->message); + g_error_free (error); + } + + g_assert (!converted); } static void @@ -4891,15 +5752,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MMPortSerialAt *ports[2]; GRegex *cusd_regex; guint i; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_unsolicited_events_handlers); + GTask *task; cusd_regex = mm_3gpp_cusd_regex_get (); ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); @@ -4922,23 +5778,24 @@ } g_regex_unref (cusd_regex); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -modem_3gpp_ussd_setup_unsolicited_result_codes (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_ussd_setup_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) { set_unsolicited_result_code_handlers (self, TRUE, callback, user_data); } static void -modem_3gpp_ussd_cleanup_unsolicited_result_codes (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_ussd_cleanup_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) { set_unsolicited_result_code_handlers (self, FALSE, callback, user_data); } @@ -4947,71 +5804,63 @@ /* Enable/Disable URCs (3GPP/USSD interface) */ static gboolean -modem_3gpp_ussd_enable_disable_unsolicited_result_codes_finish (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error) +modem_3gpp_ussd_enable_disable_unsolicited_events_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void urc_enable_disable_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -modem_3gpp_ussd_disable_unsolicited_result_codes (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_ussd_disable_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_ussd_disable_unsolicited_result_codes); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CUSD=0", 3, TRUE, (GAsyncReadyCallback)urc_enable_disable_ready, - result); + task); } static void -modem_3gpp_ussd_enable_unsolicited_result_codes (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_ussd_enable_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_ussd_enable_unsolicited_result_codes); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CUSD=1", 3, TRUE, (GAsyncReadyCallback)urc_enable_disable_ready, - result); + task); } /*****************************************************************************/ @@ -5022,27 +5871,25 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cusd_format_check_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -5050,12 +5897,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_ussd_check_support); + task = g_task_new (self, NULL, callback, user_data); /* Check USSD support */ mm_base_modem_at_command (MM_BASE_MODEM (self), @@ -5063,7 +5907,7 @@ 3, TRUE, (GAsyncReadyCallback)cusd_format_check_ready, - result); + task); } /*****************************************************************************/ @@ -5074,28 +5918,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cnmi_format_check_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* CNMI command is supported; assume we have full messaging capabilities */ - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -5103,22 +5945,18 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_check_support); + task = g_task_new (self, NULL, callback, user_data); /* We assume that CDMA-only modems don't have messaging capabilities */ if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { - g_simple_async_result_set_error ( - result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "CDMA-only modems don't have messaging capabilities"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); return; } @@ -5128,7 +5966,7 @@ 3, TRUE, (GAsyncReadyCallback)cnmi_format_check_ready, - result); + task); } /*****************************************************************************/ @@ -5162,21 +6000,21 @@ { SupportedStoragesResult *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - result = (SupportedStoragesResult *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *mem1 = g_array_ref (result->mem1); *mem2 = g_array_ref (result->mem2); *mem3 = g_array_ref (result->mem3); - + supported_storages_result_free (result); return TRUE; } static void cpms_format_check_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -5184,9 +6022,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -5197,22 +6034,20 @@ &result->mem1, &result->mem2, &result->mem3)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse supported storages reply: '%s'", - response); supported_storages_result_free (result); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse supported storages reply: '%s'", + response); + g_object_unref (task); return; } - g_simple_async_result_set_op_res_gpointer (simple, - result, - (GDestroyNotify)supported_storages_result_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, + result, + (GDestroyNotify)supported_storages_result_free); + g_object_unref (task); } static void @@ -5220,12 +6055,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_load_supported_storages); + task = g_task_new (self, NULL, callback, user_data); /* Check support storages */ mm_base_modem_at_command (MM_BASE_MODEM (self), @@ -5233,7 +6065,7 @@ 3, TRUE, (GAsyncReadyCallback)cpms_format_check_ready, - result); + task); } /*****************************************************************************/ @@ -5244,13 +6076,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cpms_query_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { const gchar *response; GError *error = NULL; @@ -5259,9 +6091,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -5270,20 +6101,26 @@ &mem1, &mem2, &error)) { - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { + gchar *aux; + self->priv->current_sms_mem1_storage = mem1; self->priv->current_sms_mem2_storage = mem2; mm_dbg ("Current storages initialized:"); - mm_dbg (" mem1 (list/read/delete) storages: '%s'", - mm_common_build_sms_storages_string (&mem1, 1)); - mm_dbg (" mem2 (write/send) storages: '%s'", - mm_common_build_sms_storages_string (&mem2, 1)); - } - g_simple_async_result_complete (simple); - g_object_unref (simple); + aux = mm_common_build_sms_storages_string (&mem1, 1); + mm_dbg (" mem1 (list/read/delete) storages: '%s'", aux); + g_free (aux); + + aux = mm_common_build_sms_storages_string (&mem2, 1); + mm_dbg (" mem2 (write/send) storages: '%s'", aux); + g_free (aux); + + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); } static void @@ -5291,12 +6128,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_init_current_storages); + task = g_task_new (self, NULL, callback, user_data); /* Check support storages */ mm_base_modem_at_command (MM_BASE_MODEM (self), @@ -5304,7 +6138,7 @@ 3, TRUE, (GAsyncReadyCallback)cpms_query_ready, - result); + task); } /*****************************************************************************/ @@ -5350,12 +6184,10 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } typedef struct { - GSimpleAsyncResult *result; - MMBroadbandModem *self; MMSmsStorage previous_mem1; gboolean mem1_locked; MMSmsStorage previous_mem2; @@ -5363,38 +6195,33 @@ } LockSmsStoragesContext; static void -lock_sms_storages_context_complete_and_free (LockSmsStoragesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LockSmsStoragesContext, ctx); -} - -static void -lock_storages_cpms_set_ready (MMBaseModem *self, +lock_storages_cpms_set_ready (MMBaseModem *_self, GAsyncResult *res, - LockSmsStoragesContext *ctx) + GTask *task) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + LockSmsStoragesContext *ctx; GError *error = NULL; - mm_base_modem_at_command_finish (self, res, &error); + ctx = g_task_get_task_data (task); + + mm_base_modem_at_command_finish (_self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); /* Reset previous storages and set unlocked */ if (ctx->mem1_locked) { - ctx->self->priv->current_sms_mem1_storage = ctx->previous_mem1; - ctx->self->priv->mem1_storage_locked = FALSE; + self->priv->current_sms_mem1_storage = ctx->previous_mem1; + self->priv->mem1_storage_locked = FALSE; } if (ctx->mem2_locked) { - ctx->self->priv->current_sms_mem2_storage = ctx->previous_mem2; - ctx->self->priv->mem2_storage_locked = FALSE; + self->priv->current_sms_mem2_storage = ctx->previous_mem2; + self->priv->mem2_storage_locked = FALSE; } + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - lock_sms_storages_context_complete_and_free (ctx); + g_object_unref (task); } void @@ -5405,6 +6232,7 @@ gpointer user_data) { LockSmsStoragesContext *ctx; + GTask *task; gchar *cmd = NULL; gchar *mem1_str = NULL; gchar *mem2_str = NULL; @@ -5413,10 +6241,11 @@ * error */ if ((mem1 != MM_SMS_STORAGE_UNKNOWN && self->priv->mem1_storage_locked) || (mem2 != MM_SMS_STORAGE_UNKNOWN && self->priv->mem2_storage_locked)) { - g_simple_async_report_error_in_idle ( - G_OBJECT (self), + g_task_report_new_error ( + self, callback, user_data, + mm_broadband_modem_lock_sms_storages, MM_CORE_ERROR, MM_CORE_ERROR_RETRY, "SMS storage currently locked, try again later"); @@ -5427,12 +6256,10 @@ g_assert (mem1 != MM_SMS_STORAGE_UNKNOWN || mem2 != MM_SMS_STORAGE_UNKNOWN); - ctx = g_slice_new0 (LockSmsStoragesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_broadband_modem_lock_sms_storages); + ctx = g_new0 (LockSmsStoragesContext, 1); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); /* Some modems may not support empty string parameters, then if mem1 is * UNKNOWN, and current sms mem1 storage has a valid value, we send again @@ -5450,11 +6277,11 @@ mm_dbg ("Given sms mem1 storage is unknown. Using current sms mem1 storage value '%s' instead", mm_sms_storage_get_string (self->priv->current_sms_mem1_storage)); } else { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY, - "Cannot lock mem2 storage alone when current mem1 storage is unknown"); - lock_sms_storages_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY, + "Cannot lock mem2 storage alone when current mem1 storage is unknown"); + g_object_unref (task); return; } mem1_str = g_ascii_strup (mm_sms_storage_get_string (self->priv->current_sms_mem1_storage), -1); @@ -5486,7 +6313,7 @@ 3, FALSE, (GAsyncReadyCallback)lock_storages_cpms_set_ready, - ctx); + task); g_free (mem1_str); g_free (mem2_str); g_free (cmd); @@ -5500,23 +6327,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cpms_set_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -5527,18 +6353,19 @@ { MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); gchar *cmd; - GSimpleAsyncResult *result; gchar *mem1_str; gchar *mem_str; + GTask *task; /* We provide the current sms storage for mem1 if not UNKNOWN */ if (self->priv->current_sms_mem1_storage == MM_SMS_STORAGE_UNKNOWN) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Cannot set default storage when current mem1 storage is unknown"); + g_task_report_new_error (self, + callback, + user_data, + modem_messaging_set_default_storage, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot set default storage when current mem1 storage is unknown"); return; } @@ -5550,17 +6377,14 @@ cmd = g_strdup_printf ("+CPMS=\"%s\",\"%s\",\"%s\"", mem1_str, mem_str, mem_str); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_set_default_storage); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), cmd, 3, FALSE, (GAsyncReadyCallback)cpms_set_ready, - result); + task); g_free (mem1_str); g_free (mem_str); g_free (cmd); @@ -5574,13 +6398,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void cmgf_set_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -5594,14 +6418,13 @@ mm_dbg ("Successfully set preferred SMS mode: '%s'", self->priv->modem_messaging_sms_pdu_mode ? "PDU" : "text"); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void set_preferred_sms_format (MMBroadbandModem *self, - GSimpleAsyncResult *result) + GTask *task) { gchar *cmd; @@ -5612,14 +6435,14 @@ 3, TRUE, (GAsyncReadyCallback)cmgf_set_ready, - result); + task); g_free (cmd); } static void cmgf_format_check_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *response; @@ -5650,7 +6473,7 @@ self->priv->sms_supported_modes_checked = TRUE; - set_preferred_sms_format (self, simple); + set_preferred_sms_format (self, task); } static void @@ -5658,17 +6481,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_setup_sms_format); + task = g_task_new (self, NULL, callback, user_data); /* If we already checked for supported SMS types, go on to select the * preferred format. */ if (MM_BROADBAND_MODEM (self)->priv->sms_supported_modes_checked) { - set_preferred_sms_format (MM_BROADBAND_MODEM (self), result); + set_preferred_sms_format (MM_BROADBAND_MODEM (self), task); return; } @@ -5678,7 +6498,7 @@ 3, TRUE, (GAsyncReadyCallback)cmgf_format_check_ready, - result); + task); } /*****************************************************************************/ @@ -5689,29 +6509,19 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; guint idx; } SmsPartContext; static void -sms_part_context_complete_and_free (SmsPartContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - -static void sms_part_ready (MMBroadbandModem *self, GAsyncResult *res, - SmsPartContext *ctx) + GTask *task) { + SmsPartContext *ctx; MMSmsPart *part; MM3gppPduInfo *info; const gchar *response; @@ -5726,17 +6536,19 @@ * passed to the async operation, so just log the error here. */ mm_warn ("Couldn't retrieve SMS part: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - sms_part_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + info = mm_3gpp_parse_cmgr_read_response (response, ctx->idx, &error); if (!info) { mm_warn ("Couldn't parse SMS part: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - sms_part_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -5755,36 +6567,38 @@ /* All done */ mm_3gpp_pdu_info_free (info); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_part_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void indication_lock_storages_ready (MMBroadbandModem *self, GAsyncResult *res, - SmsPartContext *ctx) + GTask *task) { + SmsPartContext *ctx; gchar *command; GError *error = NULL; if (!mm_broadband_modem_lock_sms_storages_finish (self, res, &error)) { /* TODO: we should either make this lock() never fail, by automatically * retrying after some time, or otherwise retry here. */ - g_simple_async_result_take_error (ctx->result, error); - sms_part_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Storage now set and locked */ /* Retrieve the message */ + ctx = g_task_get_task_data (task); command = g_strdup_printf ("+CMGR=%d", ctx->idx); - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), + mm_base_modem_at_command (MM_BASE_MODEM (self), command, 10, FALSE, (GAsyncReadyCallback)sms_part_ready, - ctx); + task); g_free (command); } @@ -5794,6 +6608,7 @@ MMBroadbandModem *self) { SmsPartContext *ctx; + GTask *task; guint idx = 0; MMSmsStorage storage; gchar *str; @@ -5819,17 +6634,18 @@ return; } - ctx = g_new0 (SmsPartContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), NULL, NULL, cmti_received); + ctx = g_new (SmsPartContext, 1); ctx->idx = idx; + task = g_task_new (self, NULL, NULL, NULL); + g_task_set_task_data (task, ctx, g_free); + /* First, request to set the proper storage to read from */ - mm_broadband_modem_lock_sms_storages (ctx->self, + mm_broadband_modem_lock_sms_storages (self, storage, MM_SMS_STORAGE_UNKNOWN, (GAsyncReadyCallback)indication_lock_storages_ready, - ctx); + task); } static void @@ -5871,16 +6687,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MMPortSerialAt *ports[2]; GRegex *cmti_regex; GRegex *cds_regex; guint i; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_messaging_unsolicited_events_handlers); + GTask *task; cmti_regex = mm_3gpp_cmti_regex_get (); cds_regex = mm_3gpp_cds_regex_get (); @@ -5912,9 +6723,10 @@ g_regex_unref (cmti_regex); g_regex_unref (cds_regex); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -5941,7 +6753,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean @@ -5985,7 +6797,7 @@ static void modem_messaging_enable_unsolicited_events_secondary_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *final_result) + GTask *task) { GError *inner_error = NULL; MMPortSerialAt *secondary; @@ -6004,14 +6816,14 @@ mm_dbg ("(%s) Messaging unsolicited events enabled on secondary", mm_port_get_device (MM_PORT (secondary))); - g_simple_async_result_complete (final_result); - g_object_unref (final_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void modem_messaging_enable_unsolicited_events_primary_ready (MMBaseModem *self, GAsyncResult *res, - GSimpleAsyncResult *final_result) + GTask *task) { GError *inner_error = NULL; MMPortSerialAt *primary; @@ -6022,9 +6834,8 @@ mm_base_modem_at_sequence_full_finish (MM_BASE_MODEM (self), res, NULL, &inner_error); if (inner_error) { - g_simple_async_result_take_error (final_result, inner_error); - g_simple_async_result_complete (final_result); - g_object_unref (final_result); + g_task_return_error (task, inner_error); + g_object_unref (task); return; } @@ -6043,12 +6854,12 @@ NULL, /* response_processor_context_free */ NULL, (GAsyncReadyCallback)modem_messaging_enable_unsolicited_events_secondary_ready, - final_result); + task); return; } - g_simple_async_result_complete (final_result); - g_object_unref (final_result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -6056,14 +6867,10 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; MMPortSerialAt *primary; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_enable_unsolicited_events); - + task = g_task_new (self, NULL, callback, user_data); primary = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self)); /* Enable unsolicited events for primary port */ @@ -6077,33 +6884,22 @@ NULL, /* response_processor_context_free */ NULL, (GAsyncReadyCallback)modem_messaging_enable_unsolicited_events_primary_ready, - result); + task); } /*****************************************************************************/ /* Load initial list of SMS parts (Messaging interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMSmsStorage list_storage; } ListPartsContext; -static void -list_parts_context_complete_and_free (ListPartsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean modem_messaging_load_initial_sms_parts_finish (MMIfaceModemMessaging *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static MMSmsState @@ -6139,8 +6935,9 @@ static void sms_text_part_list_ready (MMBroadbandModem *self, GAsyncResult *res, - ListPartsContext *ctx) + GTask *task) { + ListPartsContext *ctx; GRegex *r; GMatchInfo *match_info = NULL; const gchar *response; @@ -6148,8 +6945,8 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6159,16 +6956,18 @@ g_assert (r); if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, NULL)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Couldn't parse SMS list response"); - list_parts_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Couldn't parse SMS list response"); + g_object_unref (task); g_match_info_free (match_info); g_regex_unref (r); return; } + ctx = g_task_get_task_data (task); + while (g_match_info_matches (match_info)) { MMSmsPart *part; guint matches, idx; @@ -6243,8 +7042,8 @@ g_regex_unref (r); /* We consider all done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - list_parts_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static MMSmsState @@ -6267,8 +7066,9 @@ static void sms_pdu_part_list_ready (MMBroadbandModem *self, GAsyncResult *res, - ListPartsContext *ctx) + GTask *task) { + ListPartsContext *ctx; const gchar *response; GError *error = NULL; GList *info_list; @@ -6279,18 +7079,20 @@ response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } info_list = mm_3gpp_parse_pdu_cmgl_response (response, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - list_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + for (l = info_list; l; l = g_list_next (l)) { MM3gppPduInfo *info = l->data; MMSmsPart *part; @@ -6312,22 +7114,22 @@ mm_3gpp_pdu_info_list_free (info_list); /* We consider all done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - list_parts_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void list_parts_lock_storages_ready (MMBroadbandModem *self, GAsyncResult *res, - ListPartsContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_broadband_modem_lock_sms_storages_finish (self, res, &error)) { /* TODO: we should either make this lock() never fail, by automatically * retrying after some time, or otherwise retry here. */ - g_simple_async_result_take_error (ctx->result, error); - list_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6344,7 +7146,7 @@ (GAsyncReadyCallback) (MM_BROADBAND_MODEM (self)->priv->modem_messaging_sms_pdu_mode ? sms_pdu_part_list_ready : sms_text_part_list_ready), - ctx); + task); } static void @@ -6354,24 +7156,23 @@ gpointer user_data) { ListPartsContext *ctx; + GTask *task; - ctx = g_new0 (ListPartsContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_load_initial_sms_parts); + ctx = g_new (ListPartsContext, 1); ctx->list_storage = storage; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + mm_dbg ("Listing SMS parts in storage '%s'", mm_sms_storage_get_string (storage)); /* First, request to set the proper storage to read from */ - mm_broadband_modem_lock_sms_storages (ctx->self, + mm_broadband_modem_lock_sms_storages (MM_BROADBAND_MODEM (self), storage, MM_SMS_STORAGE_UNKNOWN, (GAsyncReadyCallback)list_parts_lock_storages_ready, - ctx); + task); } /*****************************************************************************/ @@ -6391,28 +7192,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void ath_format_check_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } /* ATH command is supported; assume we have full voice capabilities */ - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -6420,12 +7219,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_voice_check_support); + task = g_task_new (self, NULL, callback, user_data); /* We assume that all modems have voice capabilities, but ... */ @@ -6435,7 +7231,7 @@ 3, TRUE, (GAsyncReadyCallback)ath_format_check_ready, - result); + task); } /*****************************************************************************/ @@ -6446,7 +7242,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -6455,7 +7251,7 @@ MMBroadbandModem *self) { mm_dbg ("Ringing"); - mm_iface_modem_voice_create_incoming_call (MM_IFACE_MODEM_VOICE (self)); + mm_iface_modem_voice_report_incoming_call (MM_IFACE_MODEM_VOICE (self), NULL); } static void @@ -6463,7 +7259,6 @@ GMatchInfo *info, MMBroadbandModem *self) { - /* The match info gives us in which storage the index applies */ gchar *str; /* We could have "VOICE" or "DATA". Now consider only "VOICE" */ @@ -6472,7 +7267,7 @@ mm_dbg ("Ringing (%s)", str); g_free (str); - mm_iface_modem_voice_create_incoming_call (MM_IFACE_MODEM_VOICE (self)); + mm_iface_modem_voice_report_incoming_call (MM_IFACE_MODEM_VOICE (self), NULL); } static void @@ -6480,24 +7275,11 @@ GMatchInfo *info, MMBroadbandModem *self) { - /* The match info gives us in which storage the index applies */ gchar *str; str = mm_get_string_unquoted_from_match_info (info, 1); - - if (str) { - guint validity = 0; - guint type = 0; - - mm_get_uint_from_match_info (info, 2, &type); - mm_get_uint_from_match_info (info, 3, &validity); - - mm_dbg ("Caller ID received: number '%s', type '%d', validity '%d'", str, type, validity); - - mm_iface_modem_voice_update_incoming_call_number (MM_IFACE_MODEM_VOICE (self), str, type, validity); - - g_free (str); - } + mm_iface_modem_voice_report_incoming_call (MM_IFACE_MODEM_VOICE (self), str); + g_free (str); } static void @@ -6506,17 +7288,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MMPortSerialAt *ports[2]; GRegex *cring_regex; GRegex *ring_regex; GRegex *clip_regex; guint i; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_voice_unsolicited_events_handlers); + GTask *task; cring_regex = mm_voice_cring_regex_get (); ring_regex = mm_voice_ring_regex_get (); @@ -6556,9 +7333,10 @@ g_regex_unref (clip_regex); g_regex_unref (cring_regex); g_regex_unref (ring_regex); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -6646,9 +7424,11 @@ /* Create CALL (Voice interface) */ static MMBaseCall * -modem_voice_create_call (MMIfaceModemVoice *self) +modem_voice_create_call (MMIfaceModemVoice *self, + MMCallDirection direction, + const gchar *number) { - return mm_base_call_new (MM_BASE_MODEM (self)); + return mm_base_call_new (MM_BASE_MODEM (self), direction, number); } /*****************************************************************************/ @@ -6723,6 +7503,168 @@ } /*****************************************************************************/ +/* Setup/Cleanup unsolicited events (CDMA interface) */ + +typedef struct { + gboolean setup; + MMPortSerialQcdm *qcdm; + gboolean close_port; +} CdmaUnsolicitedEventsContext; + +static void +cdma_unsolicited_events_context_free (CdmaUnsolicitedEventsContext *ctx) +{ + if (ctx->qcdm && ctx->close_port) + mm_port_serial_close (MM_PORT_SERIAL (ctx->qcdm)); + g_clear_object (&ctx->qcdm); + + g_free (ctx); +} + +static void +logcmd_qcdm_ready (MMPortSerialQcdm *port, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModem *self; + CdmaUnsolicitedEventsContext *ctx; + QcdmResult *result; + gint err = QCDM_SUCCESS; + GByteArray *response; + GError *error = NULL; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + response = mm_port_serial_qcdm_command_finish (port, res, &error); + if (error) { + ctx->close_port = TRUE; + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Parse the response */ + result = qcdm_cmd_log_config_set_mask_result ((const gchar *) response->data, + response->len, + &err); + g_byte_array_unref (response); + if (!result) { + ctx->close_port = TRUE; + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse Log Config Set Mask command result: %d", + err); + g_object_unref (task); + return; + } + + mm_port_serial_qcdm_add_unsolicited_msg_handler (port, + DM_LOG_ITEM_EVDO_PILOT_SETS_V2, + ctx->setup ? qcdm_evdo_pilot_sets_log_handle : NULL, + self, + NULL); + + qcdm_result_unref (result); + + /* Balance the mm_port_seral_open() from modem_cdma_setup_cleanup_unsolicited_events(). + * We want to close it in either case: + * (a) we're cleaning up and setup opened the port + * (b) if it was unexpectedly closed before cleanup and thus cleanup opened it + * + * Setup should leave the port open to allow log messages to be received + * and sent to handlers. + */ + ctx->close_port = ctx->setup ? FALSE : TRUE; + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +modem_cdma_setup_cleanup_unsolicited_events (MMBroadbandModem *self, + gboolean setup, + GAsyncReadyCallback callback, + gpointer user_data) +{ + CdmaUnsolicitedEventsContext *ctx; + GTask *task; + GByteArray *logcmd; + uint16_t log_items[] = { DM_LOG_ITEM_EVDO_PILOT_SETS_V2, 0 }; + GError *error = NULL; + + ctx = g_new0 (CdmaUnsolicitedEventsContext, 1); + ctx->setup = TRUE; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)cdma_unsolicited_events_context_free); + + ctx->qcdm = mm_base_modem_get_port_qcdm (MM_BASE_MODEM (self)); + if (!ctx->qcdm) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Setup must open the QCDM port and keep it open to receive unsolicited + * events. Cleanup expects the port to already be opened from setup, but + * if not we still want to open it and try to disable log messages. + */ + if (setup || !mm_port_serial_is_open (MM_PORT_SERIAL (ctx->qcdm))) { + if (!mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm), &error)) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + } + + logcmd = g_byte_array_sized_new (512); + logcmd->len = qcdm_cmd_log_config_set_mask_new ((char *) logcmd->data, + 512, + 0x01, /* Equipment ID */ + setup ? log_items : NULL); + assert (logcmd->len); + + mm_port_serial_qcdm_command (ctx->qcdm, + logcmd, + 5, + NULL, + (GAsyncReadyCallback)logcmd_qcdm_ready, + task); + g_byte_array_unref (logcmd); +} + +static gboolean +modem_cdma_setup_cleanup_unsolicited_events_finish (MMIfaceModemCdma *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_cdma_setup_unsolicited_events (MMIfaceModemCdma *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + modem_cdma_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM (self), + TRUE, + callback, + user_data); +} + +static void +modem_cdma_cleanup_unsolicited_events (MMIfaceModemCdma *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + modem_cdma_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM (self), + FALSE, + callback, + user_data); +} + +/*****************************************************************************/ /* HDR state check (CDMA interface) */ typedef struct { @@ -6731,20 +7673,11 @@ guint8 almp_state; } HdrStateResults; -typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - MMPortSerialQcdm *qcdm; -} HdrStateContext; - static void -hdr_state_context_complete_and_free (HdrStateContext *ctx) +hdr_state_cleanup_port (MMPortSerial *port) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->qcdm); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); + mm_port_serial_close (port); + g_object_unref (port); } static gboolean @@ -6757,20 +7690,22 @@ { HdrStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *hybrid_mode = results->hybrid_mode; *session_state = results->session_state; *almp_state = results->almp_state; + g_free (results); + return TRUE; } static void hdr_subsys_state_info_ready (MMPortSerialQcdm *port, GAsyncResult *res, - HdrStateContext *ctx) + GTask *task) { QcdmResult *result; HdrStateResults *results; @@ -6780,8 +7715,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - g_simple_async_result_set_from_error (ctx->result, error); - hdr_state_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6791,12 +7726,12 @@ &err); g_byte_array_unref (response); if (!result) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse HDR subsys state info command result: %d", - err); - hdr_state_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse HDR subsys state info command result: %d", + err); + g_object_unref (task); return; } @@ -6809,8 +7744,8 @@ qcdm_result_get_u8 (result, QCDM_CMD_HDR_SUBSYS_STATE_INFO_ITEM_ALMP_STATE, &results->almp_state); qcdm_result_unref (result); - g_simple_async_result_set_op_res_gpointer (ctx->result, results, (GDestroyNotify)g_free); - hdr_state_context_complete_and_free (ctx); + g_task_return_pointer (task, results, g_free); + g_object_unref (task); } static void @@ -6819,40 +7754,43 @@ gpointer user_data) { MMPortSerialQcdm *qcdm; - HdrStateContext *ctx; + GTask *task; GByteArray *hdrstate; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); qcdm = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); if (!qcdm) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot get HDR state without a QCDM port"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot get HDR state without a QCDM port"); + g_object_unref (task); return; } - /* Setup context */ - ctx = g_new0 (HdrStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_hdr_state); - ctx->qcdm = g_object_ref (qcdm); + if (!mm_port_serial_open (MM_PORT_SERIAL (qcdm), &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + g_task_set_task_data (task, + g_object_ref (qcdm), + (GDestroyNotify) hdr_state_cleanup_port); /* Setup command */ hdrstate = g_byte_array_sized_new (25); hdrstate->len = qcdm_cmd_hdr_subsys_state_info_new ((gchar *) hdrstate->data, 25); g_assert (hdrstate->len); - mm_port_serial_qcdm_command (ctx->qcdm, + mm_port_serial_qcdm_command (qcdm, hdrstate, 3, NULL, (GAsyncReadyCallback)hdr_subsys_state_info_ready, - ctx); + task); g_byte_array_unref (hdrstate); } @@ -6871,13 +7809,10 @@ } CallManagerStateContext; static void -call_manager_state_context_complete_and_free (CallManagerStateContext *ctx) +cm_state_cleanup_port (MMPortSerial *port) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->qcdm); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); + mm_port_serial_close (port); + g_object_unref (port); } static gboolean @@ -6887,21 +7822,23 @@ guint *operating_mode, GError **error) { - CallManagerStateResults *results; + CallManagerStateResults *result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *system_mode = results->system_mode; - *operating_mode = results->operating_mode; + *system_mode = result->system_mode; + *operating_mode = result->operating_mode; + g_free (result); + return TRUE; } static void cm_subsys_state_info_ready (MMPortSerialQcdm *port, GAsyncResult *res, - CallManagerStateContext *ctx) + GTask *task) { QcdmResult *result; CallManagerStateResults *results; @@ -6911,8 +7848,8 @@ response = mm_port_serial_qcdm_command_finish (port, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - call_manager_state_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6922,12 +7859,12 @@ &err); g_byte_array_unref (response); if (!result) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse CM subsys state info command result: %d", - err); - call_manager_state_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse CM subsys state info command result: %d", + err); + g_object_unref (task); return; } @@ -6937,8 +7874,8 @@ qcdm_result_get_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SYSTEM_MODE, &results->system_mode); qcdm_result_unref (result); - g_simple_async_result_set_op_res_gpointer (ctx->result, results, (GDestroyNotify)g_free); - call_manager_state_context_complete_and_free (ctx); + g_task_return_pointer (task, results, g_free); + g_object_unref (task); } static void @@ -6947,40 +7884,43 @@ gpointer user_data) { MMPortSerialQcdm *qcdm; - CallManagerStateContext *ctx; + GTask *task; GByteArray *cmstate; + GError *error = NULL; + + task = g_task_new (self, NULL, callback, user_data); qcdm = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); if (!qcdm) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot get call manager state without a QCDM port"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot get call manager state without a QCDM port"); + g_object_unref (task); return; } - /* Setup context */ - ctx = g_new0 (CallManagerStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_call_manager_state); - ctx->qcdm = g_object_ref (qcdm); + if (!mm_port_serial_open (MM_PORT_SERIAL (qcdm), &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + g_task_set_task_data (task, + g_object_ref (qcdm), + (GDestroyNotify) cm_state_cleanup_port); /* Setup command */ cmstate = g_byte_array_sized_new (25); cmstate->len = qcdm_cmd_cm_subsys_state_info_new ((gchar *) cmstate->data, 25); g_assert (cmstate->len); - mm_port_serial_qcdm_command (ctx->qcdm, + mm_port_serial_qcdm_command (qcdm, cmstate, 3, NULL, (GAsyncReadyCallback)cm_subsys_state_info_ready, - ctx); + task); g_byte_array_unref (cmstate); } @@ -6994,21 +7934,30 @@ guint band; } Cdma1xServingSystemResults; -typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - MMPortSerialQcdm *qcdm; -} Cdma1xServingSystemContext; +static void +cdma1x_serving_system_state_cleanup_port (MMPortSerial *port) +{ + mm_port_serial_close (port); + g_object_unref (port); +} static void -cdma1x_serving_system_context_complete_and_free (Cdma1xServingSystemContext *ctx) +cdma1x_serving_system_complete_and_free (GTask *task, + guint sid, + guint nid, + guint class, + guint band) { - g_simple_async_result_complete (ctx->result); - if (ctx->qcdm) - g_object_unref (ctx->qcdm); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); + Cdma1xServingSystemResults *results; + + results = g_new0 (Cdma1xServingSystemResults, 1); + results->sid = sid; + results->band = band; + results->class = class; + results->nid = nid; + + g_task_return_pointer (task, results, g_free); + g_object_unref (task); } static GError * @@ -7032,21 +7981,23 @@ { Cdma1xServingSystemResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = (Cdma1xServingSystemResults *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *sid = results->sid; *nid = results->nid; *class = results->class; *band = results->band; + g_free (results); + return TRUE; } static void css_query_ready (MMIfaceModemCdma *self, GAsyncResult *res, - Cdma1xServingSystemContext *ctx) + GTask *task) { GError *error = NULL; const gchar *result; @@ -7057,12 +8008,11 @@ gboolean class_ok = FALSE; gboolean band_ok = FALSE; gboolean success = FALSE; - Cdma1xServingSystemResults *results; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - cdma1x_serving_system_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -7083,15 +8033,7 @@ /* Format is ",," */ r = g_regex_new ("\\s*([^,]*?)\\s*,\\s*([^,]*?)\\s*,\\s*(\\d+)", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); - if (!r) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Could not parse Serving System results (regex creation failed)."); - cdma1x_serving_system_context_complete_and_free (ctx); - return; - } + g_assert (r); g_regex_match (r, result, 0, &match_info); if (g_match_info_get_match_count (match_info) >= 3) { @@ -7124,12 +8066,11 @@ } if (!success) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Could not parse Serving System results"); - cdma1x_serving_system_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Could not parse Serving System results"); + g_object_unref (task); return; } @@ -7153,29 +8094,31 @@ /* 99999 means unknown/no service */ if (sid == MM_MODEM_CDMA_SID_UNKNOWN) { - g_simple_async_result_take_error (ctx->result, - cdma1x_serving_system_no_service_error ()); - cdma1x_serving_system_context_complete_and_free (ctx); + g_task_return_error (task, cdma1x_serving_system_no_service_error ()); + g_object_unref (task); return; } - results = g_new0 (Cdma1xServingSystemResults, 1); - results->sid = sid; - results->band = band; - results->class = class; /* No means to get NID with AT commands right now */ - results->nid = MM_MODEM_CDMA_NID_UNKNOWN; + cdma1x_serving_system_complete_and_free (task, sid, MM_MODEM_CDMA_NID_UNKNOWN, class, band); +} - g_simple_async_result_set_op_res_gpointer (ctx->result, results, (GDestroyNotify)g_free); - cdma1x_serving_system_context_complete_and_free (ctx); +static void +serving_system_query_css (GTask *task) +{ + mm_base_modem_at_command (MM_BASE_MODEM (g_task_get_source_object (task)), + "+CSS?", + 3, + FALSE, + (GAsyncReadyCallback)css_query_ready, + task); } static void qcdm_cdma_status_ready (MMPortSerialQcdm *port, GAsyncResult *res, - Cdma1xServingSystemContext *ctx) + GTask *task) { - Cdma1xServingSystemResults *results; QcdmResult *result = NULL; guint32 sid = MM_MODEM_CDMA_SID_UNKNOWN; guint32 nid = MM_MODEM_CDMA_NID_UNKNOWN; @@ -7185,23 +8128,25 @@ GByteArray *response; response = mm_port_serial_qcdm_command_finish (port, res, &error); - if (error || - (result = qcdm_cmd_cdma_status_result ((const gchar *) response->data, - response->len, - &err)) == NULL) { + if (error) { + mm_dbg ("Failed to get cdma status: %s", error->message); + g_clear_error (&error); + + /* Fall back to AT+CSS */ + serving_system_query_css (task); + return; + } + + result = qcdm_cmd_cdma_status_result ((const gchar *) response->data, + response->len, + &err); + if (!result) { if (err != QCDM_SUCCESS) mm_dbg ("Failed to parse cdma status command result: %d", err); - /* If there was some error, fall back to use +CSS like we did before QCDM */ - mm_base_modem_at_command (MM_BASE_MODEM (ctx->self), - "+CSS?", - 3, - FALSE, - (GAsyncReadyCallback)css_query_ready, - ctx); - if (error) - g_error_free (error); - if (response) - g_byte_array_unref (response); + g_byte_array_unref (response); + + /* Fall back to AT+CSS */ + serving_system_query_css (task); return; } @@ -7222,16 +8167,11 @@ mm_dbg ("CDMA 1x Status SID: %d", sid); mm_dbg ("CDMA 1x Status NID: %d", nid); - results = g_new0 (Cdma1xServingSystemResults, 1); - results->sid = sid; - results->nid = nid; - if (sid != MM_MODEM_CDMA_SID_UNKNOWN) { - results->band = 'Z'; - results->class = 0; - } - - g_simple_async_result_set_op_res_gpointer (ctx->result, results, (GDestroyNotify)g_free); - cdma1x_serving_system_context_complete_and_free (ctx); + cdma1x_serving_system_complete_and_free (task, + sid, + nid, + 0, + (sid == MM_MODEM_CDMA_SID_UNKNOWN) ? 0 : 'Z'); } static void @@ -7239,41 +8179,44 @@ GAsyncReadyCallback callback, gpointer user_data) { - Cdma1xServingSystemContext *ctx; + GError *error = NULL; + GByteArray *cdma_status; + GTask *task; + MMPortSerialQcdm *qcdm; - /* Setup context */ - ctx = g_new0 (Cdma1xServingSystemContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_cdma1x_serving_system); - ctx->qcdm = mm_base_modem_get_port_qcdm (MM_BASE_MODEM (self)); + task = g_task_new (self, NULL, callback, user_data); - if (ctx->qcdm) { - GByteArray *cdma_status; + qcdm = mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); + if (!qcdm) { + /* Fall back to AT+CSS */ + serving_system_query_css (task); + return; + } - /* Setup command */ - cdma_status = g_byte_array_sized_new (25); - cdma_status->len = qcdm_cmd_cdma_status_new ((char *) cdma_status->data, 25); - g_assert (cdma_status->len); - mm_port_serial_qcdm_command (ctx->qcdm, - cdma_status, - 3, - NULL, - (GAsyncReadyCallback)qcdm_cdma_status_ready, - ctx); - g_byte_array_unref (cdma_status); + if (!mm_port_serial_open (MM_PORT_SERIAL (qcdm), &error)) { + mm_dbg ("Failed to open QCDM port for serving-system request: %s", error->message); + g_error_free (error); + + /* Fall back to AT+CSS */ + serving_system_query_css (task); return; } - /* Try with AT if we don't have QCDM */ - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+CSS?", - 3, - FALSE, - (GAsyncReadyCallback)css_query_ready, - ctx); + g_task_set_task_data (task, + g_object_ref (qcdm), + (GDestroyNotify) cdma1x_serving_system_state_cleanup_port); + + /* Setup command */ + cdma_status = g_byte_array_sized_new (25); + cdma_status->len = qcdm_cmd_cdma_status_new ((char *) cdma_status->data, 25); + g_assert (cdma_status->len); + mm_port_serial_qcdm_command (qcdm, + cdma_status, + 3, + NULL, + (GAsyncReadyCallback) qcdm_cdma_status_ready, + task); + g_byte_array_unref (cdma_status); } /*****************************************************************************/ @@ -7285,42 +8228,46 @@ gboolean *has_cdma_service, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + GError *inner_error = NULL; + gboolean value; + + value = g_task_propagate_boolean (G_TASK (res), error); + if (inner_error) { + g_propagate_error (error, inner_error); return FALSE; + } - *has_cdma_service = g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + *has_cdma_service = value; return TRUE; } static void cad_query_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; const gchar *result; result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { guint cad; /* Strip any leading command tag and spaces */ result = mm_strip_tag (result, "+CAD:"); if (!mm_get_uint_from_str (result, &cad)) - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse +CAD response '%s'", - result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse +CAD response '%s'", + result); else /* 1 == CDMA service */ - g_simple_async_result_set_op_res_gboolean (simple, (cad == 1)); + g_task_return_boolean (task, (cad == 1)); } - - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -7328,19 +8275,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_service_status); + task = g_task_new (self, NULL, callback, user_data); mm_base_modem_at_command (MM_BASE_MODEM (self), "+CAD?", 3, FALSE, (GAsyncReadyCallback)cad_query_ready, - result); + task); } /*****************************************************************************/ @@ -7352,32 +8296,27 @@ } DetailedRegistrationStateResults; typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMPortSerialAt *port; MMModemCdmaRegistrationState cdma1x_state; MMModemCdmaRegistrationState evdo_state; - GError *error; } DetailedRegistrationStateContext; -static void -detailed_registration_state_context_complete_and_free (DetailedRegistrationStateContext *ctx) +static DetailedRegistrationStateResults * +detailed_registration_state_result_new (DetailedRegistrationStateContext *ctx) { - if (ctx->error) - g_simple_async_result_take_error (ctx->result, ctx->error); - else { - DetailedRegistrationStateResults *results; + DetailedRegistrationStateResults *results; - results = g_new (DetailedRegistrationStateResults, 1); - results->detailed_cdma1x_state = ctx->cdma1x_state; - results->detailed_evdo_state = ctx->evdo_state; - g_simple_async_result_set_op_res_gpointer (ctx->result, results, g_free); - } + results = g_new (DetailedRegistrationStateResults, 1); + results->detailed_cdma1x_state = ctx->cdma1x_state; + results->detailed_evdo_state = ctx->evdo_state; + + return results; +} - g_simple_async_result_complete (ctx->result); +static void +detailed_registration_state_context_free (DetailedRegistrationStateContext *ctx) +{ g_object_unref (ctx->port); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -7390,29 +8329,36 @@ { DetailedRegistrationStateResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *detailed_cdma1x_state = results->detailed_cdma1x_state; *detailed_evdo_state = results->detailed_evdo_state; + g_free (results); return TRUE; } static void speri_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateContext *ctx; gboolean roaming = FALSE; const gchar *response; GError *error = NULL; + ctx = g_task_get_task_data (task); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { /* silently discard SPERI errors */ g_error_free (error); - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, + detailed_registration_state_result_new (ctx), + g_free); + g_object_unref (task); return; } @@ -7421,7 +8367,10 @@ if (!response || !mm_cdma_parse_eri (response, &roaming, NULL, NULL)) { mm_warn ("Couldn't parse SPERI response '%s'", response); - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, + detailed_registration_state_result_new (ctx), + g_free); + g_object_unref (task); return; } @@ -7441,21 +8390,27 @@ ctx->evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_HOME; } - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_pointer (task, + detailed_registration_state_result_new (ctx), + g_free); + g_object_unref (task); } static void spservice_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DetailedRegistrationStateContext *ctx) + GTask *task) { + DetailedRegistrationStateContext *ctx; + GError *error = NULL; const gchar *response; MMModemCdmaRegistrationState cdma1x_state; MMModemCdmaRegistrationState evdo_state; - response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &ctx->error); - if (ctx->error) { - detailed_registration_state_context_complete_and_free (ctx); + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -7465,21 +8420,27 @@ if (!mm_cdma_parse_spservice_read_response (response, &cdma1x_state, &evdo_state)) { - ctx->error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse SPSERVICE response '%s'", - response); - detailed_registration_state_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse SPSERVICE response '%s'", + response); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Store new intermediate results */ ctx->cdma1x_state = cdma1x_state; ctx->evdo_state = evdo_state; /* If SPERI not supported, we're done */ - if (!ctx->self->priv->has_speri) { - detailed_registration_state_context_complete_and_free (ctx); + if (!MM_BROADBAND_MODEM (self)->priv->has_speri) { + g_task_return_pointer (task, + detailed_registration_state_result_new (ctx), + g_free); + g_object_unref (task); return; } @@ -7489,7 +8450,7 @@ 3, FALSE, (GAsyncReadyCallback)speri_ready, - ctx); + task); } static void @@ -7502,30 +8463,30 @@ MMPortSerialAt *port; GError *error = NULL; DetailedRegistrationStateContext *ctx; + GTask *task; /* The default implementation to get detailed registration state * requires the use of an AT port; so if we cannot get any, just * return the error */ port = mm_base_modem_peek_best_at_port (MM_BASE_MODEM (self), &error); if (!port) { - g_simple_async_report_take_gerror_in_idle (G_OBJECT (self), - callback, - user_data, - error); + g_task_report_error (self, + callback, + user_data, + modem_cdma_get_detailed_registration_state, + error); return; } /* Setup context */ ctx = g_new0 (DetailedRegistrationStateContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_get_detailed_registration_state); ctx->port = g_object_ref (port); ctx->cdma1x_state = cdma1x_state; ctx->evdo_state = evdo_state; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)detailed_registration_state_context_free); + /* NOTE: If we get this generic implementation of getting detailed * registration state called, we DO know that we have Sprint commands * supported, we checked it in setup_registration_checks() */ @@ -7534,7 +8495,7 @@ 3, FALSE, (GAsyncReadyCallback)spservice_ready, - ctx); + task); } /*****************************************************************************/ @@ -7549,58 +8510,47 @@ } SetupRegistrationChecksResults; typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - GError *error; gboolean has_qcdm_port; gboolean has_sprint_commands; } SetupRegistrationChecksContext; -static void -setup_registration_checks_context_complete_and_free (SetupRegistrationChecksContext *ctx) +static SetupRegistrationChecksResults * +setup_registration_checks_results_new (MMBroadbandModem *self, + SetupRegistrationChecksContext *ctx) { - if (ctx->error) - g_simple_async_result_take_error (ctx->result, ctx->error); - else { - SetupRegistrationChecksResults *results; + SetupRegistrationChecksResults *results; - results = g_new0 (SetupRegistrationChecksResults, 1); + results = g_new0 (SetupRegistrationChecksResults, 1); - /* Skip QCDM steps if no QCDM port */ - if (!ctx->has_qcdm_port) { - mm_dbg ("Will skip all QCDM-based registration checks"); - results->skip_qcdm_call_manager_step = TRUE; - results->skip_qcdm_hdr_step = TRUE; - } - - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_detailed_registration_state == - modem_cdma_get_detailed_registration_state) { - /* Skip CDMA1x Serving System check if we have Sprint specific - * commands AND if the default detailed registration checker - * is the generic one. Implementations knowing that their - * CSS response is undesired, should either setup NULL callbacks - * for the specific step, or subclass this setup and return - * FALSE themselves. */ - if (ctx->has_sprint_commands) { - mm_dbg ("Will skip CDMA1x Serving System check, " - "we do have Sprint commands"); - results->skip_at_cdma1x_serving_system_step = TRUE; - } else { - /* If there aren't Sprint specific commands, and the detailed - * registration state getter wasn't subclassed, skip the step */ - mm_dbg ("Will skip generic detailed registration check, we " - "don't have Sprint commands"); - results->skip_detailed_registration_state = TRUE; - } + /* Skip QCDM steps if no QCDM port */ + if (!ctx->has_qcdm_port) { + mm_dbg ("Will skip all QCDM-based registration checks"); + results->skip_qcdm_call_manager_step = TRUE; + results->skip_qcdm_hdr_step = TRUE; + } + + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_detailed_registration_state == + modem_cdma_get_detailed_registration_state) { + /* Skip CDMA1x Serving System check if we have Sprint specific + * commands AND if the default detailed registration checker + * is the generic one. Implementations knowing that their + * CSS response is undesired, should either setup NULL callbacks + * for the specific step, or subclass this setup and return + * FALSE themselves. */ + if (ctx->has_sprint_commands) { + mm_dbg ("Will skip CDMA1x Serving System check, " + "we do have Sprint commands"); + results->skip_at_cdma1x_serving_system_step = TRUE; + } else { + /* If there aren't Sprint specific commands, and the detailed + * registration state getter wasn't subclassed, skip the step */ + mm_dbg ("Will skip generic detailed registration check, we " + "don't have Sprint commands"); + results->skip_detailed_registration_state = TRUE; } - - g_simple_async_result_set_op_res_gpointer (ctx->result, results, g_free); } - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); + return results; } static gboolean @@ -7615,86 +8565,104 @@ { SetupRegistrationChecksResults *results; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + results = g_task_propagate_pointer (G_TASK (res), error); + if (!results) return FALSE; - results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step; *skip_qcdm_hdr_step = results->skip_qcdm_hdr_step; *skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step; *skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step; *skip_detailed_registration_state = results->skip_detailed_registration_state; + g_free (results); return TRUE; } static void -speri_check_ready (MMIfaceModemCdma *self, +speri_check_ready (MMIfaceModemCdma *_self, GAsyncResult *res, - SetupRegistrationChecksContext *ctx) + GTask *task) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + SetupRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) g_error_free (error); else /* We DO have SPERI */ - ctx->self->priv->has_speri = TRUE; + self->priv->has_speri = TRUE; /* All done */ - ctx->self->priv->checked_sprint_support = TRUE; - setup_registration_checks_context_complete_and_free (ctx); + self->priv->checked_sprint_support = TRUE; + g_task_return_pointer (task, + setup_registration_checks_results_new (self, ctx), + g_free); + g_object_unref (task); } static void -spservice_check_ready (MMIfaceModemCdma *self, +spservice_check_ready (MMIfaceModemCdma *_self, GAsyncResult *res, - SetupRegistrationChecksContext *ctx) + GTask *task) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); + SetupRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error); if (error) { g_error_free (error); - ctx->self->priv->checked_sprint_support = TRUE; - setup_registration_checks_context_complete_and_free (ctx); + self->priv->checked_sprint_support = TRUE; + g_task_return_pointer (task, + setup_registration_checks_results_new (self, ctx), + g_free); + g_object_unref (task); return; } /* We DO have SPSERVICE, look for SPERI */ ctx->has_sprint_commands = TRUE; - ctx->self->priv->has_spservice = TRUE; + self->priv->has_spservice = TRUE; mm_base_modem_at_command (MM_BASE_MODEM (self), "$SPERI?", 3, FALSE, (GAsyncReadyCallback)speri_check_ready, - ctx); + task); } static void -modem_cdma_setup_registration_checks (MMIfaceModemCdma *self, +modem_cdma_setup_registration_checks (MMIfaceModemCdma *_self, GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); SetupRegistrationChecksContext *ctx; + GTask *task; ctx = g_new0 (SetupRegistrationChecksContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_setup_registration_checks); /* Check if we have a QCDM port */ ctx->has_qcdm_port = !!mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + /* If we have cached results of Sprint command checking, use them */ - if (ctx->self->priv->checked_sprint_support) { - ctx->has_sprint_commands = ctx->self->priv->has_spservice; + if (self->priv->checked_sprint_support) { + ctx->has_sprint_commands = self->priv->has_spservice; /* Completes in idle */ - setup_registration_checks_context_complete_and_free (ctx); + g_task_return_pointer (task, + setup_registration_checks_results_new (self, ctx), + g_free); + g_object_unref (task); return; } @@ -7704,7 +8672,7 @@ 3, FALSE, (GAsyncReadyCallback)spservice_check_ready, - ctx); + task); } /*****************************************************************************/ @@ -7712,14 +8680,13 @@ typedef struct { MMBroadbandModem *self; - GSimpleAsyncResult *result; GCancellable *cancellable; GTimer *timer; guint max_registration_time; } RegisterInCdmaNetworkContext; static void -register_in_cdma_network_context_complete_and_free (RegisterInCdmaNetworkContext *ctx) +register_in_cdma_network_context_free (RegisterInCdmaNetworkContext *ctx) { /* If our cancellable reference is still around, clear it */ if (ctx->self->priv->modem_cdma_pending_registration_cancellable == @@ -7730,8 +8697,6 @@ if (ctx->timer) g_timer_destroy (ctx->timer); - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->cancellable); g_object_unref (ctx->self); g_free (ctx); @@ -7742,7 +8707,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } #undef REG_IS_IDLE @@ -7757,26 +8722,29 @@ static void run_cdma_registration_checks_ready (MMBroadbandModem *self, GAsyncResult *res, - RegisterInCdmaNetworkContext *ctx); + GTask *task); static gboolean -run_cdma_registration_checks_again (RegisterInCdmaNetworkContext *ctx) +run_cdma_registration_checks_again (GTask *task) { /* Get fresh registration state */ mm_iface_modem_cdma_run_registration_checks ( - MM_IFACE_MODEM_CDMA (ctx->self), + MM_IFACE_MODEM_CDMA (g_task_get_source_object (task)), (GAsyncReadyCallback)run_cdma_registration_checks_ready, - ctx); + task); return G_SOURCE_REMOVE; } static void run_cdma_registration_checks_ready (MMBroadbandModem *self, GAsyncResult *res, - RegisterInCdmaNetworkContext *ctx) + GTask *task) { + RegisterInCdmaNetworkContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + mm_iface_modem_cdma_run_registration_checks_finish (MM_IFACE_MODEM_CDMA (self), res, &error); if (error) { @@ -7793,8 +8761,8 @@ MM_IFACE_MODEM_CDMA (self), MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); - g_simple_async_result_take_error (ctx->result, error); - register_in_cdma_network_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -7805,8 +8773,8 @@ "(CDMA1x: '%s', EV-DO: '%s')", REG_IS_DONE (self->priv->modem_cdma_cdma1x_registration_state) ? "yes" : "no", REG_IS_DONE (self->priv->modem_cdma_evdo_registration_state) ? "yes" : "no"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_cdma_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -7824,10 +8792,9 @@ mm_iface_modem_cdma_update_access_technologies ( MM_IFACE_MODEM_CDMA (self), MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); - g_simple_async_result_take_error ( - ctx->result, - mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT)); - register_in_cdma_network_context_complete_and_free (ctx); + error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -7835,7 +8802,7 @@ mm_dbg ("Modem not yet registered in a CDMA network... will recheck soon"); g_timeout_add_seconds (3, (GSourceFunc)run_cdma_registration_checks_again, - ctx); + task); } static void @@ -7846,6 +8813,7 @@ { MMBroadbandModem *broadband = MM_BROADBAND_MODEM (self); RegisterInCdmaNetworkContext *ctx; + GTask *task; /* (Try to) cancel previous registration request */ if (broadband->priv->modem_cdma_pending_registration_cancellable) { @@ -7856,10 +8824,6 @@ ctx = g_new0 (RegisterInCdmaNetworkContext, 1); ctx->self = g_object_ref (self); ctx->max_registration_time = max_registration_time; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_register_in_network); ctx->cancellable = g_cancellable_new (); /* Keep an accessible reference to the cancellable, so that we can cancel @@ -7869,10 +8833,14 @@ /* Get fresh registration state */ ctx->timer = g_timer_new (); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)register_in_cdma_network_context_free); + mm_iface_modem_cdma_run_registration_checks ( - MM_IFACE_MODEM_CDMA (self), + self, (GAsyncReadyCallback)run_cdma_registration_checks_ready, - ctx); + task); } /*****************************************************************************/ @@ -7883,11 +8851,15 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCATION_SOURCE_NONE; + GError *inner_error = NULL; + gssize value; - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; } static void @@ -7895,27 +8867,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_location_load_capabilities); + task = g_task_new (self, NULL, callback, user_data); /* Default location capabilities supported by the generic broadband * implementation are only LAC-CI in 3GPP-enabled modems. And even this, * will only be true if the modem supports CREG/CGREG=2 */ if (!mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) - g_simple_async_result_set_op_res_gpointer (result, - GUINT_TO_POINTER (MM_MODEM_LOCATION_SOURCE_NONE), - NULL); + g_task_return_int (task, MM_MODEM_LOCATION_SOURCE_NONE); else - g_simple_async_result_set_op_res_gpointer (result, - GUINT_TO_POINTER (MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI), - NULL); + g_task_return_int (task, MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ @@ -7926,7 +8890,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -7935,12 +8899,7 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_location_gathering); + GTask *task; /* 3GPP modems need to re-run registration checks when enabling the 3GPP * location source, so that we get up to date LAC/CI location information. @@ -7957,9 +8916,9 @@ } /* Done we are */ - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -8116,7 +9075,7 @@ mm_base_modem_at_command (MM_BASE_MODEM (self), "+CESQ", 3, - TRUE, + FALSE, callback, user_data); } @@ -8284,34 +9243,12 @@ return TRUE; } -typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; - PortsContext *ports; -} InitializationStartedContext; - -static void -initialization_started_context_complete_and_free (InitializationStartedContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - ports_context_unref (ctx->ports); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - static gpointer initialization_started_finish (MMBroadbandModem *self, GAsyncResult *res, GError **error) { - gpointer ref; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - ref = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - return ref ? ports_context_ref (ref) : NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static gboolean @@ -8359,26 +9296,21 @@ gpointer user_data) { GError *error = NULL; - InitializationStartedContext *ctx; + GTask *task; + PortsContext *ctx; - ctx = g_new0 (InitializationStartedContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - initialization_started); - ctx->ports = g_new0 (PortsContext, 1); - ctx->ports->ref_count = 1; + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_new0 (PortsContext, 1); + ctx->ref_count = 1; - if (!open_ports_initialization (self, ctx->ports, &error)) { + if (!open_ports_initialization (self, ctx, &error)) { + ports_context_unref (ctx); g_prefix_error (&error, "Couldn't open ports during modem initialization: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gpointer (ctx->result, - ports_context_ref (ctx->ports), - (GDestroyNotify)ports_context_unref); - - initialization_started_context_complete_and_free (ctx); + g_task_return_pointer (task, ctx, (GDestroyNotify)ports_context_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -8392,6 +9324,7 @@ ports_context_unref (self->priv->enabled_ports_ctx); self->priv->enabled_ports_ctx = NULL; } + return TRUE; } @@ -8431,19 +9364,14 @@ /* Enabling started */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; PortsContext *ports; gboolean modem_init_required; } EnablingStartedContext; static void -enabling_started_context_complete_and_free (EnablingStartedContext *ctx) +enabling_started_context_free (EnablingStartedContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); ports_context_unref (ctx->ports); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (EnablingStartedContext, ctx); } @@ -8452,12 +9380,18 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -enabling_after_modem_init_timeout (EnablingStartedContext *ctx) +enabling_after_modem_init_timeout (GTask *task) { + MMBroadbandModem *self; + EnablingStartedContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Reset init sequence enabled flags and run them explicitly */ g_object_set (ctx->ports->primary, MM_PORT_SERIAL_AT_INIT_SEQUENCE_ENABLED, TRUE, @@ -8471,59 +9405,64 @@ } /* Store enabled ports context and complete */ - ctx->self->priv->enabled_ports_ctx = ports_context_ref (ctx->ports); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_started_context_complete_and_free (ctx); + self->priv->enabled_ports_ctx = ports_context_ref (ctx->ports); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } static void enabling_modem_init_ready (MMBroadbandModem *self, GAsyncResult *res, - EnablingStartedContext *ctx) + GTask *task) { GError *error = NULL; - if (!MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_modem_init_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - enabling_started_context_complete_and_free (ctx); + if (!MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* Specify that the modem init was run once */ - ctx->self->priv->modem_init_run = TRUE; + self->priv->modem_init_run = TRUE; /* After the modem init sequence, give a 500ms period for the modem to settle */ mm_dbg ("Giving some time to settle the modem..."); - g_timeout_add (500, (GSourceFunc)enabling_after_modem_init_timeout, ctx); + g_timeout_add (500, (GSourceFunc)enabling_after_modem_init_timeout, task); } static void enabling_flash_done (MMPortSerial *port, GAsyncResult *res, - EnablingStartedContext *ctx) + GTask *task) { + MMBroadbandModem *self; + EnablingStartedContext *ctx; GError *error = NULL; if (!mm_port_serial_flash_finish (port, res, &error)) { g_prefix_error (&error, "Primary port flashing failed: "); - g_simple_async_result_take_error (ctx->result, error); - enabling_started_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->modem_init_required) { mm_dbg ("Running modem initialization sequence..."); - MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_modem_init (ctx->self, - (GAsyncReadyCallback)enabling_modem_init_ready, - ctx); + MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init (self, + (GAsyncReadyCallback)enabling_modem_init_ready, + task); return; } /* Store enabled ports context and complete */ - ctx->self->priv->enabled_ports_ctx = ports_context_ref (ctx->ports); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_started_context_complete_and_free (ctx); + self->priv->enabled_ports_ctx = ports_context_ref (ctx->ports); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static gboolean @@ -8591,35 +9530,34 @@ { GError *error = NULL; EnablingStartedContext *ctx; + GTask *task; ctx = g_slice_new0 (EnablingStartedContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enabling_started); ctx->ports = g_new0 (PortsContext, 1); ctx->ports->ref_count = 1; /* Skip modem initialization if the device was hotplugged OR if we already * did it (i.e. don't reinitialize if the modem got disabled and enabled * again) */ - if (ctx->self->priv->modem_init_run) + if (self->priv->modem_init_run) mm_dbg ("Skipping modem initialization: not first enabling"); - else if (mm_base_modem_get_hotplugged (MM_BASE_MODEM (ctx->self))) { - ctx->self->priv->modem_init_run = TRUE; + else if (mm_base_modem_get_hotplugged (MM_BASE_MODEM (self))) { + self->priv->modem_init_run = TRUE; mm_dbg ("Skipping modem initialization: device hotplugged"); - } else if (!MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_modem_init || - !MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_modem_init_finish) + } else if (!MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init || + !MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init_finish) mm_dbg ("Skipping modem initialization: not required"); else ctx->modem_init_required = TRUE; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_started_context_free); + /* Enabling */ if (!open_ports_enabling (self, ctx->ports, ctx->modem_init_required, &error)) { g_prefix_error (&error, "Couldn't open ports during modem enabling: "); - g_simple_async_result_take_error (ctx->result, error); - enabling_started_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -8629,7 +9567,7 @@ 100, FALSE, (GAsyncReadyCallback)enabling_flash_done, - ctx); + task); } /*****************************************************************************/ @@ -8709,22 +9647,18 @@ typedef struct { MMBroadbandModem *self; - GCancellable *cancellable; - GSimpleAsyncResult *result; DisablingStep step; MMModemState previous_state; gboolean disabled; } DisablingContext; -static void disabling_step (DisablingContext *ctx); +static void disabling_step (GTask *task); static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { GError *error = NULL; - g_simple_async_result_complete_in_idle (ctx->result); - if (MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->disabling_stopped && !MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->disabling_stopped (ctx->self, &error)) { mm_warn ("Error when stopping the disabling sequence: %s", error->message); @@ -8742,33 +9676,16 @@ MM_MODEM_STATE_CHANGE_REASON_UNKNOWN); } - g_object_unref (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); g_object_unref (ctx->self); g_free (ctx); } static gboolean -disabling_context_complete_and_free_if_cancelled (DisablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Disabling cancelled"); - disabling_context_complete_and_free (ctx); - return TRUE; -} - -static gboolean disable_finish (MMBaseModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } #undef INTERFACE_DISABLE_READY_FN @@ -8776,16 +9693,17 @@ static void \ NAME##_disable_ready (MMBroadbandModem *self, \ GAsyncResult *result, \ - DisablingContext *ctx) \ + GTask *task) \ { \ + DisablingContext *ctx; \ GError *error = NULL; \ \ if (!mm_##NAME##_disable_finish (TYPE (self), \ result, \ &error)) { \ if (FATAL_ERRORS) { \ - g_simple_async_result_take_error (ctx->result, error); \ - disabling_context_complete_and_free (ctx); \ + g_task_return_error (task, error); \ + g_object_unref (task); \ return; \ } \ \ @@ -8796,8 +9714,9 @@ } \ \ /* Go on to next step */ \ + ctx = g_task_get_task_data (task); \ ctx->step++; \ - disabling_step (ctx); \ + disabling_step (task); \ } INTERFACE_DISABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE) @@ -8814,32 +9733,37 @@ static void bearer_list_disconnect_all_bearers_ready (MMBearerList *list, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; if (!mm_bearer_list_disconnect_all_bearers_finish (list, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - disabling_step (ctx); + disabling_step (task); } static void disabling_wait_for_final_state_ready (MMIfaceModem *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->previous_state = mm_iface_modem_wait_for_final_state_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -8852,8 +9776,8 @@ * Note that we do consider here UNKNOWN and FAILED status on purpose, * as the MMManager will try to disable every modem before removing * it. */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; default: break; @@ -8866,15 +9790,20 @@ MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED); ctx->step++; - disabling_step (ctx); + disabling_step (task); } static void -disabling_step (DisablingContext *ctx) +disabling_step (GTask *task) { + DisablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (disabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + ctx = g_task_get_task_data (task); switch (ctx->step) { case DISABLING_STEP_FIRST: @@ -8885,7 +9814,7 @@ mm_iface_modem_wait_for_final_state (MM_IFACE_MODEM (ctx->self), MM_MODEM_STATE_UNKNOWN, /* just any */ (GAsyncReadyCallback)disabling_wait_for_final_state_ready, - ctx); + task); return; case DISABLING_STEP_DISCONNECT_BEARERS: @@ -8893,7 +9822,7 @@ mm_bearer_list_disconnect_all_bearers ( ctx->self->priv->modem_bearer_list, (GAsyncReadyCallback)bearer_list_disconnect_all_bearers_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8913,7 +9842,7 @@ /* Disabling the Modem Signal interface */ mm_iface_modem_signal_disable (MM_IFACE_MODEM_SIGNAL (ctx->self), (GAsyncReadyCallback)iface_modem_signal_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8925,7 +9854,7 @@ /* Disabling the Modem Oma interface */ mm_iface_modem_oma_disable (MM_IFACE_MODEM_OMA (ctx->self), (GAsyncReadyCallback)iface_modem_oma_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8937,7 +9866,7 @@ /* Disabling the Modem Time interface */ mm_iface_modem_time_disable (MM_IFACE_MODEM_TIME (ctx->self), (GAsyncReadyCallback)iface_modem_time_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8949,7 +9878,7 @@ /* Disabling the Modem Messaging interface */ mm_iface_modem_messaging_disable (MM_IFACE_MODEM_MESSAGING (ctx->self), (GAsyncReadyCallback)iface_modem_messaging_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8961,7 +9890,7 @@ /* Disabling the Modem Voice interface */ mm_iface_modem_voice_disable (MM_IFACE_MODEM_VOICE (ctx->self), (GAsyncReadyCallback)iface_modem_voice_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8973,7 +9902,7 @@ /* Disabling the Modem Location interface */ mm_iface_modem_location_disable (MM_IFACE_MODEM_LOCATION (ctx->self), (GAsyncReadyCallback)iface_modem_location_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -8989,7 +9918,7 @@ /* Disabling the Modem CDMA interface */ mm_iface_modem_cdma_disable (MM_IFACE_MODEM_CDMA (ctx->self), (GAsyncReadyCallback)iface_modem_cdma_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9001,7 +9930,7 @@ /* Disabling the Modem 3GPP USSD interface */ mm_iface_modem_3gpp_ussd_disable (MM_IFACE_MODEM_3GPP_USSD (ctx->self), (GAsyncReadyCallback)iface_modem_3gpp_ussd_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9013,7 +9942,7 @@ /* Disabling the Modem 3GPP interface */ mm_iface_modem_3gpp_disable (MM_IFACE_MODEM_3GPP (ctx->self), (GAsyncReadyCallback)iface_modem_3gpp_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9026,7 +9955,7 @@ /* Disabling the Modem interface */ mm_iface_modem_disable (MM_IFACE_MODEM (ctx->self), (GAsyncReadyCallback)iface_modem_disable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9035,8 +9964,8 @@ case DISABLING_STEP_LAST: ctx->disabled = TRUE; /* All disabled without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9050,14 +9979,16 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, disable); - ctx->cancellable = (cancellable ? g_object_ref (cancellable) : NULL); ctx->step = DISABLING_STEP_FIRST; - disabling_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + disabling_step (task); } /*****************************************************************************/ @@ -9084,21 +10015,16 @@ typedef struct { MMBroadbandModem *self; - GCancellable *cancellable; - GSimpleAsyncResult *result; EnablingStep step; MMModemState previous_state; gboolean enabled; } EnablingContext; -static void enabling_step (EnablingContext *ctx); +static void enabling_step (GTask *task); static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - if (ctx->enabled) mm_iface_modem_update_state (MM_IFACE_MODEM (ctx->self), MM_MODEM_STATE_ENABLED, @@ -9110,34 +10036,16 @@ MM_MODEM_STATE_CHANGE_REASON_UNKNOWN); } - g_object_unref (ctx->cancellable); g_object_unref (ctx->self); g_free (ctx); } static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - -static gboolean enable_finish (MMBaseModem *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return FALSE; - - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } #undef INTERFACE_ENABLE_READY_FN @@ -9145,16 +10053,17 @@ static void \ NAME##_enable_ready (MMBroadbandModem *self, \ GAsyncResult *result, \ - EnablingContext *ctx) \ + GTask *task) \ { \ + EnablingContext *ctx; \ GError *error = NULL; \ \ if (!mm_##NAME##_enable_finish (TYPE (self), \ result, \ &error)) { \ if (FATAL_ERRORS) { \ - g_simple_async_result_take_error (ctx->result, error); \ - enabling_context_complete_and_free (ctx); \ + g_task_return_error (task, error); \ + g_object_unref (task); \ return; \ } \ \ @@ -9164,8 +10073,9 @@ } \ \ /* Go on to next step */ \ + ctx = g_task_get_task_data (task); \ ctx->step++; \ - enabling_step (ctx); \ + enabling_step (task); \ } INTERFACE_ENABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE) @@ -9182,39 +10092,44 @@ static void enabling_started_ready (MMBroadbandModem *self, GAsyncResult *result, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; if (!MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_started_finish (self, result, &error)) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - enabling_step (ctx); + enabling_step (task); } static void enabling_wait_for_final_state_ready (MMIfaceModem *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->previous_state = mm_iface_modem_wait_for_final_state_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (ctx->previous_state >= MM_MODEM_STATE_ENABLED) { /* Just return success, don't relaunch enabling */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9225,15 +10140,21 @@ MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED); ctx->step++; - enabling_step (ctx); + enabling_step (task); } static void -enabling_step (EnablingContext *ctx) +enabling_step (GTask *task) { + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -9244,7 +10165,7 @@ mm_iface_modem_wait_for_final_state (MM_IFACE_MODEM (ctx->self), MM_MODEM_STATE_UNKNOWN, /* just any */ (GAsyncReadyCallback)enabling_wait_for_final_state_ready, - ctx); + task); return; case ENABLING_STEP_STARTED: @@ -9252,7 +10173,7 @@ MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_started_finish) { MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->enabling_started (ctx->self, (GAsyncReadyCallback)enabling_started_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9262,9 +10183,9 @@ g_assert (ctx->self->priv->modem_dbus_skeleton != NULL); /* Enabling the Modem interface */ mm_iface_modem_enable (MM_IFACE_MODEM (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_enable_ready, - ctx); + task); return; case ENABLING_STEP_IFACE_3GPP: @@ -9272,9 +10193,9 @@ mm_dbg ("Modem has 3GPP capabilities, enabling the Modem 3GPP interface..."); /* Enabling the Modem 3GPP interface */ mm_iface_modem_3gpp_enable (MM_IFACE_MODEM_3GPP (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_3gpp_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9285,7 +10206,7 @@ mm_dbg ("Modem has 3GPP/USSD capabilities, enabling the Modem 3GPP/USSD interface..."); mm_iface_modem_3gpp_ussd_enable (MM_IFACE_MODEM_3GPP_USSD (ctx->self), (GAsyncReadyCallback)iface_modem_3gpp_ussd_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9296,9 +10217,9 @@ mm_dbg ("Modem has CDMA capabilities, enabling the Modem CDMA interface..."); /* Enabling the Modem CDMA interface */ mm_iface_modem_cdma_enable (MM_IFACE_MODEM_CDMA (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_cdma_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9313,9 +10234,9 @@ mm_dbg ("Modem has location capabilities, enabling the Location interface..."); /* Enabling the Modem Location interface */ mm_iface_modem_location_enable (MM_IFACE_MODEM_LOCATION (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_location_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9326,9 +10247,9 @@ mm_dbg ("Modem has messaging capabilities, enabling the Messaging interface..."); /* Enabling the Modem Messaging interface */ mm_iface_modem_messaging_enable (MM_IFACE_MODEM_MESSAGING (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_messaging_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9339,9 +10260,9 @@ mm_dbg ("Modem has voice capabilities, enabling the Voice interface..."); /* Enabling the Modem Voice interface */ mm_iface_modem_voice_enable (MM_IFACE_MODEM_VOICE (ctx->self), - ctx->cancellable, - (GAsyncReadyCallback)iface_modem_voice_enable_ready, - ctx); + g_task_get_cancellable (task), + (GAsyncReadyCallback)iface_modem_voice_enable_ready, + task); return; } /* Fall down to next step */ @@ -9352,9 +10273,9 @@ mm_dbg ("Modem has time capabilities, enabling the Time interface..."); /* Enabling the Modem Time interface */ mm_iface_modem_time_enable (MM_IFACE_MODEM_TIME (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_time_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9365,9 +10286,9 @@ mm_dbg ("Modem has extended signal reporting capabilities, enabling the Signal interface..."); /* Enabling the Modem Signal interface */ mm_iface_modem_signal_enable (MM_IFACE_MODEM_SIGNAL (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_signal_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9378,9 +10299,9 @@ mm_dbg ("Modem has OMA capabilities, enabling the OMA interface..."); /* Enabling the Modem Oma interface */ mm_iface_modem_oma_enable (MM_IFACE_MODEM_OMA (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_oma_enable_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9407,8 +10328,8 @@ schedule_initial_registration_checks (ctx->self); /* All enabled without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9421,9 +10342,9 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, enable); + task = g_task_new (self, cancellable, callback, user_data); /* Check state before launching modem enabling */ switch (MM_BROADBAND_MODEM (self)->priv->modem_state) { @@ -9433,47 +10354,36 @@ break; case MM_MODEM_STATE_FAILED: - case MM_MODEM_STATE_INITIALIZING: - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot enable modem: " - "device not fully initialized yet"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Cannot enable modem: initialization failed"); break; case MM_MODEM_STATE_LOCKED: - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot enable modem: device locked"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Cannot enable modem: device locked"); break; - case MM_MODEM_STATE_DISABLED: { + case MM_MODEM_STATE_INITIALIZING: + case MM_MODEM_STATE_DISABLED: + case MM_MODEM_STATE_DISABLING: { EnablingContext *ctx; ctx = g_new0 (EnablingContext, 1); ctx->self = g_object_ref (self); - ctx->result = result; - ctx->cancellable = g_object_ref (cancellable); ctx->step = ENABLING_STEP_FIRST; - enabling_step (ctx); + + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + enabling_step (task); return; } - case MM_MODEM_STATE_DISABLING: - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot enable modem: " - "currently being disabled"); - break; - case MM_MODEM_STATE_ENABLING: - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "Cannot enable modem: " - "already being enabled"); + g_assert_not_reached (); break; case MM_MODEM_STATE_ENABLED: @@ -9483,12 +10393,11 @@ case MM_MODEM_STATE_CONNECTING: case MM_MODEM_STATE_CONNECTED: /* Just return success, don't relaunch enabling */ - g_simple_async_result_set_op_res_gboolean (result, TRUE); + g_task_return_boolean (task, TRUE); break; } - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ @@ -9510,27 +10419,24 @@ INITIALIZE_STEP_IFACE_SIGNAL, INITIALIZE_STEP_IFACE_OMA, INITIALIZE_STEP_IFACE_FIRMWARE, + INITIALIZE_STEP_SIM_HOT_SWAP, INITIALIZE_STEP_IFACE_SIMPLE, INITIALIZE_STEP_LAST, } InitializeStep; typedef struct { MMBroadbandModem *self; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializeStep step; gpointer ports_ctx; } InitializeContext; -static void initialize_step (InitializeContext *ctx); +static void initialize_step (GTask *task); static void -initialize_context_complete_and_free (InitializeContext *ctx) +initialize_context_free (InitializeContext *ctx) { GError *error = NULL; - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->ports_ctx && MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped && !MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped (ctx->self, ctx->ports_ctx, &error)) { @@ -9538,45 +10444,29 @@ g_error_free (error); } - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->self); g_free (ctx); } static gboolean -initialize_context_complete_and_free_if_cancelled (InitializeContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Initialization cancelled"); - initialize_context_complete_and_free (ctx); - return TRUE; -} - -static gboolean initialize_finish (MMBaseModem *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return FALSE; - - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static void initialization_started_ready (MMBroadbandModem *self, GAsyncResult *result, - InitializeContext *ctx) + GTask *task) { + InitializeContext *ctx; GError *error = NULL; gpointer ports_ctx; + ctx = g_task_get_task_data (task); + /* May return NULL without error */ ports_ctx = MM_BROADBAND_MODEM_GET_CLASS (self)->initialization_started_finish (self, result, &error); if (error) { @@ -9588,7 +10478,7 @@ /* Just jump to the last step */ ctx->step = INITIALIZE_STEP_LAST; - initialize_step (ctx); + initialize_step (task); return; } @@ -9597,16 +10487,19 @@ /* Go on to next step */ ctx->step++; - initialize_step (ctx); + initialize_step (task); } static void iface_modem_initialize_ready (MMBroadbandModem *self, GAsyncResult *result, - InitializeContext *ctx) + GTask *task) { + InitializeContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + /* If the modem interface fails to get initialized, we will move the modem * to a FAILED state. Note that in this case we still export the interface. */ if (!mm_iface_modem_initialize_finish (MM_IFACE_MODEM (self), result, &error)) { @@ -9634,7 +10527,7 @@ /* Jump to the firmware step. We allow firmware switching even in failed * state */ ctx->step = INITIALIZE_STEP_IFACE_FIRMWARE; - initialize_step (ctx); + initialize_step (task); return; } @@ -9649,13 +10542,13 @@ /* Jump to the Firmware interface. We do allow modems to export * both the Firmware and Simple interfaces when locked. */ ctx->step = INITIALIZE_STEP_IFACE_FIRMWARE; - initialize_step (ctx); + initialize_step (task); return; } /* Go on to next step */ ctx->step++; - initialize_step (ctx); + initialize_step (task); } #undef INTERFACE_INIT_READY_FN @@ -9663,10 +10556,13 @@ static void \ NAME##_initialize_ready (MMBroadbandModem *self, \ GAsyncResult *result, \ - InitializeContext *ctx) \ + GTask *task) \ { \ + InitializeContext *ctx; \ GError *error = NULL; \ \ + ctx = g_task_get_task_data (task); \ + \ if (!mm_##NAME##_initialize_finish (TYPE (self), result, &error)) { \ if (FATAL_ERRORS) { \ mm_warn ("Couldn't initialize interface: '%s'", \ @@ -9679,7 +10575,7 @@ \ /* Just jump to the last step */ \ ctx->step = INITIALIZE_STEP_LAST; \ - initialize_step (ctx); \ + initialize_step (task); \ return; \ } \ \ @@ -9695,7 +10591,7 @@ \ /* Go on to next step */ \ ctx->step++; \ - initialize_step (ctx); \ + initialize_step (task); \ } INTERFACE_INIT_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE) @@ -9710,11 +10606,17 @@ INTERFACE_INIT_READY_FN (iface_modem_firmware, MM_IFACE_MODEM_FIRMWARE, FALSE) static void -initialize_step (InitializeContext *ctx) +initialize_step (GTask *task) { + InitializeContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialize_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZE_STEP_FIRST: @@ -9732,7 +10634,7 @@ MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_started_finish) { MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_started (ctx->self, (GAsyncReadyCallback)initialization_started_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9750,18 +10652,18 @@ case INITIALIZE_STEP_IFACE_MODEM: /* Initialize the Modem interface */ mm_iface_modem_initialize (MM_IFACE_MODEM (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_3GPP: if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) { /* Initialize the 3GPP interface */ mm_iface_modem_3gpp_initialize (MM_IFACE_MODEM_3GPP (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_3gpp_initialize_ready, - ctx); + task); return; } @@ -9773,7 +10675,7 @@ /* Initialize the 3GPP/USSD interface */ mm_iface_modem_3gpp_ussd_initialize (MM_IFACE_MODEM_3GPP_USSD (ctx->self), (GAsyncReadyCallback)iface_modem_3gpp_ussd_initialize_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9783,9 +10685,9 @@ if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->self))) { /* Initialize the CDMA interface */ mm_iface_modem_cdma_initialize (MM_IFACE_MODEM_CDMA (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_cdma_initialize_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -9798,59 +10700,100 @@ case INITIALIZE_STEP_IFACE_LOCATION: /* Initialize the Location interface */ mm_iface_modem_location_initialize (MM_IFACE_MODEM_LOCATION (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_location_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_MESSAGING: /* Initialize the Messaging interface */ mm_iface_modem_messaging_initialize (MM_IFACE_MODEM_MESSAGING (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_messaging_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_VOICE: /* Initialize the Voice interface */ mm_iface_modem_voice_initialize (MM_IFACE_MODEM_VOICE (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_voice_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_TIME: /* Initialize the Time interface */ mm_iface_modem_time_initialize (MM_IFACE_MODEM_TIME (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_time_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_SIGNAL: /* Initialize the Signal interface */ mm_iface_modem_signal_initialize (MM_IFACE_MODEM_SIGNAL (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_signal_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_OMA: /* Initialize the Oma interface */ mm_iface_modem_oma_initialize (MM_IFACE_MODEM_OMA (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_oma_initialize_ready, - ctx); + task); return; case INITIALIZE_STEP_IFACE_FIRMWARE: /* Initialize the Firmware interface */ mm_iface_modem_firmware_initialize (MM_IFACE_MODEM_FIRMWARE (ctx->self), - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)iface_modem_firmware_initialize_ready, - ctx); + task); return; + case INITIALIZE_STEP_SIM_HOT_SWAP: + /* Create the SIM hot swap ports context only if not already done before + * (we may be re-running the initialization step after SIM-PIN unlock) */ + if (!ctx->self->priv->sim_hot_swap_ports_ctx) { + gboolean is_sim_hot_swap_supported = FALSE; + gboolean is_sim_hot_swap_configured = FALSE; + + g_object_get (ctx->self, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, &is_sim_hot_swap_supported, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, &is_sim_hot_swap_configured, + NULL); + + if (is_sim_hot_swap_supported) { + + if (!is_sim_hot_swap_configured) { + mm_warn ("SIM hot swap supported but not configured. Skipping opening ports"); + } else { + PortsContext *ports; + GError *error = NULL; + + mm_dbg ("Creating ports context for SIM hot swap"); + + ports = g_new0 (PortsContext, 1); + ports->ref_count = 1; + + if (!open_ports_enabling (ctx->self, ports, FALSE, &error)) { + mm_warn ("Couldn't open ports during Modem SIM hot swap enabling: %s", error? error->message : "unknown reason"); + g_error_free (error); + } else { + ctx->self->priv->sim_hot_swap_ports_ctx = ports_context_ref (ports); + } + + ports_context_unref (ports); + } + } + } else + mm_dbg ("Ports context for SIM hot swap already available"); + + /* Fall down to next step */ + ctx->step++; + case INITIALIZE_STEP_IFACE_SIMPLE: if (ctx->self->priv->modem_state != MM_MODEM_STATE_FAILED) mm_iface_modem_simple_initialize (MM_IFACE_MODEM_SIMPLE (ctx->self)); @@ -9859,23 +10802,51 @@ case INITIALIZE_STEP_LAST: if (ctx->self->priv->modem_state == MM_MODEM_STATE_FAILED) { - + GError *error; if (!ctx->self->priv->modem_dbus_skeleton) { /* Error setting up ports. Abort without even exporting the * Modem interface */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_ABORTED, - "Modem is unusable, " - "cannot fully initialize"); + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_ABORTED, + "Modem is unusable, " + "cannot fully initialize"); } else { /* Fatal SIM, firmware, or modem failure :-( */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Modem is unusable, " - "cannot fully initialize"); + gboolean is_sim_hot_swap_supported = FALSE; + gboolean is_sim_hot_swap_configured = FALSE; + + MMModemStateFailedReason reason = + mm_gdbus_modem_get_state_failed_reason ( + (MmGdbusModem*)ctx->self->priv->modem_dbus_skeleton); + + g_object_get (ctx->self, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, &is_sim_hot_swap_supported, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, &is_sim_hot_swap_configured, + NULL); + + if (reason == MM_MODEM_STATE_FAILED_REASON_SIM_MISSING) { + if (!is_sim_hot_swap_supported) { + mm_dbg ("SIM is missing, but this modem does not support SIM hot swap."); + } else if (!is_sim_hot_swap_configured) { + mm_warn ("SIM is missing, but SIM hot swap could not be configured."); + } else if (!ctx->self->priv->sim_hot_swap_ports_ctx) { + mm_err ("SIM is missing and SIM hot swap is configured, but ports are not opened."); + } else { + mm_dbg ("SIM is missing, but SIM hot swap is enabled. Waiting for SIM..."); + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Modem is unusable due to SIM missing, " + "cannot fully initialize, waiting for SIM insertion."); + goto sim_hot_swap_enabled; + } + } + + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Modem is unusable, " + "cannot fully initialize"); +sim_hot_swap_enabled: /* Ensure we only leave the Modem, OMA, and Firmware interfaces * around. A failure could be caused by firmware issues, which * a firmware update, switch, or provisioning could fix. @@ -9884,23 +10855,26 @@ mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (ctx->self)); mm_iface_modem_cdma_shutdown (MM_IFACE_MODEM_CDMA (ctx->self)); mm_iface_modem_location_shutdown (MM_IFACE_MODEM_LOCATION (ctx->self)); + mm_iface_modem_signal_shutdown (MM_IFACE_MODEM_SIGNAL (ctx->self)); mm_iface_modem_messaging_shutdown (MM_IFACE_MODEM_MESSAGING (ctx->self)); mm_iface_modem_voice_shutdown (MM_IFACE_MODEM_VOICE (ctx->self)); mm_iface_modem_time_shutdown (MM_IFACE_MODEM_TIME (ctx->self)); mm_iface_modem_simple_shutdown (MM_IFACE_MODEM_SIMPLE (ctx->self)); } - initialize_context_complete_and_free (ctx); + + g_task_return_error (task, error); + g_object_unref (task); return; } if (ctx->self->priv->modem_state == MM_MODEM_STATE_LOCKED) { /* We're locked :-/ */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Modem is currently locked, " - "cannot fully initialize"); - initialize_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Modem is currently locked, " + "cannot fully initialize"); + g_object_unref (task); return; } @@ -9910,8 +10884,8 @@ MM_MODEM_STATE_DISABLED, MM_MODEM_STATE_CHANGE_REASON_UNKNOWN); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialize_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9924,19 +10898,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, initialize); + task = g_task_new (self, cancellable, callback, user_data); /* Check state before launching modem initialization */ switch (MM_BROADBAND_MODEM (self)->priv->modem_state) { case MM_MODEM_STATE_FAILED: /* NOTE: this will only happen if we ever support hot-plugging SIMs */ - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot initialize modem: " - "device is unusable"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "Cannot initialize modem: " + "device is unusable"); break; case MM_MODEM_STATE_UNKNOWN: @@ -9945,25 +10919,25 @@ ctx = g_new0 (InitializeContext, 1); ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = result; ctx->step = INITIALIZE_STEP_FIRST; + g_task_set_task_data (task, ctx, (GDestroyNotify)initialize_context_free); + /* Set as being initialized, even if we were locked before */ mm_iface_modem_update_state (MM_IFACE_MODEM (self), MM_MODEM_STATE_INITIALIZING, MM_MODEM_STATE_CHANGE_REASON_UNKNOWN); - initialize_step (ctx); + initialize_step (task); return; } case MM_MODEM_STATE_INITIALIZING: - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "Cannot initialize modem: " - "already being initialized"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "Cannot initialize modem: " + "already being initialized"); break; case MM_MODEM_STATE_DISABLED: @@ -9976,12 +10950,11 @@ case MM_MODEM_STATE_CONNECTING: case MM_MODEM_STATE_CONNECTED: /* Just return success, don't relaunch initialization */ - g_simple_async_result_set_op_res_gboolean (result, TRUE); + g_task_return_boolean (task, TRUE); break; } - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ @@ -10026,13 +10999,45 @@ ati, ati1, mm_gdbus_modem_get_equipment_identifier ( - MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)), + MM_GDBUS_MODEM (self->priv->modem_dbus_skeleton)), mm_gdbus_modem_get_revision ( - MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)), + MM_GDBUS_MODEM (self->priv->modem_dbus_skeleton)), mm_gdbus_modem_get_model ( - MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)), + MM_GDBUS_MODEM (self->priv->modem_dbus_skeleton)), mm_gdbus_modem_get_manufacturer ( - MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)))); + MM_GDBUS_MODEM (self->priv->modem_dbus_skeleton)))); +} + + +/*****************************************************************************/ +static void +after_hotswap_event_disable_ready (MMBaseModem *self, + GAsyncResult *res, + gpointer user_data) +{ + GError *error = NULL; + mm_base_modem_disable_finish (self, res, &error); + if (error) { + mm_err ("Disable modem error: %s", error->message); + g_error_free (error); + } else { + mm_base_modem_set_valid (self, FALSE); + } +} + +void +mm_broadband_modem_update_sim_hot_swap_detected (MMBroadbandModem *self) +{ + if (self->priv->sim_hot_swap_ports_ctx) { + mm_dbg ("Releasing SIM hot swap ports context"); + ports_context_unref (self->priv->sim_hot_swap_ports_ctx); + self->priv->sim_hot_swap_ports_ctx = NULL; + } + + mm_base_modem_set_reprobe (MM_BASE_MODEM (self), TRUE); + mm_base_modem_disable (MM_BASE_MODEM (self), + (GAsyncReadyCallback) after_hotswap_event_disable_ready, + NULL); } /*****************************************************************************/ @@ -10136,6 +11141,10 @@ case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: self->priv->modem_3gpp_ignored_facility_locks = g_value_get_flags (value); break; + case PROP_MODEM_3GPP_INITIAL_EPS_BEARER: + g_clear_object (&self->priv->modem_3gpp_initial_eps_bearer); + self->priv->modem_3gpp_initial_eps_bearer = g_value_dup_object (value); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: self->priv->modem_cdma_cdma1x_registration_state = g_value_get_enum (value); break; @@ -10166,6 +11175,18 @@ g_clear_object (&self->priv->modem_simple_status); self->priv->modem_simple_status = g_value_dup_object (value); break; + case PROP_MODEM_SIM_HOT_SWAP_SUPPORTED: + self->priv->sim_hot_swap_supported = g_value_get_boolean (value); + break; + case PROP_MODEM_SIM_HOT_SWAP_CONFIGURED: + self->priv->sim_hot_swap_configured = g_value_get_boolean (value); + break; + case PROP_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED: + self->priv->periodic_signal_check_disabled = g_value_get_boolean (value); + break; + case PROP_FLOW_CONTROL: + self->priv->flow_control = g_value_get_flags (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -10241,6 +11262,9 @@ case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: g_value_set_flags (value, self->priv->modem_3gpp_ignored_facility_locks); break; + case PROP_MODEM_3GPP_INITIAL_EPS_BEARER: + g_value_set_object (value, self->priv->modem_3gpp_initial_eps_bearer); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: g_value_set_enum (value, self->priv->modem_cdma_cdma1x_registration_state); break; @@ -10268,6 +11292,18 @@ case PROP_MODEM_SIMPLE_STATUS: g_value_set_object (value, self->priv->modem_simple_status); break; + case PROP_MODEM_SIM_HOT_SWAP_SUPPORTED: + g_value_set_boolean (value, self->priv->sim_hot_swap_supported); + break; + case PROP_MODEM_SIM_HOT_SWAP_CONFIGURED: + g_value_set_boolean (value, self->priv->sim_hot_swap_configured); + break; + case PROP_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED: + g_value_set_boolean (value, self->priv->periodic_signal_check_disabled); + break; + case PROP_FLOW_CONTROL: + g_value_set_flags (value, self->priv->flow_control); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -10296,6 +11332,12 @@ self->priv->modem_messaging_sms_default_storage = MM_SMS_STORAGE_UNKNOWN; self->priv->current_sms_mem1_storage = MM_SMS_STORAGE_UNKNOWN; self->priv->current_sms_mem2_storage = MM_SMS_STORAGE_UNKNOWN; + self->priv->sim_hot_swap_supported = FALSE; + self->priv->periodic_signal_check_disabled = FALSE; + self->priv->modem_cmer_enable_mode = MM_3GPP_CMER_MODE_NONE; + self->priv->modem_cmer_disable_mode = MM_3GPP_CMER_MODE_NONE; + self->priv->modem_cmer_ind = MM_3GPP_CMER_IND_NONE; + self->priv->flow_control = MM_FLOW_CONTROL_NONE; } static void @@ -10306,6 +11348,9 @@ if (self->priv->enabled_ports_ctx) ports_context_unref (self->priv->enabled_ports_ctx); + if (self->priv->sim_hot_swap_ports_ctx) + ports_context_unref (self->priv->sim_hot_swap_ports_ctx); + if (self->priv->modem_3gpp_registration_regex) mm_3gpp_creg_regex_destroy (self->priv->modem_3gpp_registration_regex); @@ -10342,6 +11387,11 @@ g_clear_object (&self->priv->modem_location_dbus_skeleton); } + if (self->priv->modem_signal_dbus_skeleton) { + mm_iface_modem_signal_shutdown (MM_IFACE_MODEM_SIGNAL (object)); + g_clear_object (&self->priv->modem_signal_dbus_skeleton); + } + if (self->priv->modem_messaging_dbus_skeleton) { mm_iface_modem_messaging_shutdown (MM_IFACE_MODEM_MESSAGING (object)); g_clear_object (&self->priv->modem_messaging_dbus_skeleton); @@ -10362,6 +11412,7 @@ g_clear_object (&self->priv->modem_simple_dbus_skeleton); } + g_clear_object (&self->priv->modem_3gpp_initial_eps_bearer); g_clear_object (&self->priv->modem_sim); g_clear_object (&self->priv->modem_bearer_list); g_clear_object (&self->priv->modem_messaging_sms_list); @@ -10391,18 +11442,22 @@ iface->load_own_numbers_finish = modem_load_own_numbers_finish; iface->load_unlock_required = modem_load_unlock_required; iface->load_unlock_required_finish = modem_load_unlock_required_finish; + iface->load_unlock_retries = load_unlock_retries; + iface->load_unlock_retries_finish = load_unlock_retries_finish; iface->create_sim = modem_create_sim; iface->create_sim_finish = modem_create_sim_finish; iface->load_supported_modes = modem_load_supported_modes; iface->load_supported_modes_finish = modem_load_supported_modes_finish; - iface->load_power_state = load_power_state; - iface->load_power_state_finish = load_power_state_finish; + iface->load_power_state = modem_load_power_state; + iface->load_power_state_finish = modem_load_power_state_finish; iface->load_supported_ip_families = modem_load_supported_ip_families; iface->load_supported_ip_families_finish = modem_load_supported_ip_families_finish; /* Enabling steps */ iface->modem_power_up = modem_power_up; iface->modem_power_up_finish = modem_power_up_finish; + iface->check_for_sim_swap = modem_check_for_sim_swap; + iface->check_for_sim_swap_finish = modem_check_for_sim_swap_finish; iface->setup_flow_control = modem_setup_flow_control; iface->setup_flow_control_finish = modem_setup_flow_control_finish; iface->load_supported_charsets = modem_load_supported_charsets; @@ -10430,6 +11485,8 @@ iface->load_imei_finish = modem_3gpp_load_imei_finish; iface->load_enabled_facility_locks = modem_3gpp_load_enabled_facility_locks; iface->load_enabled_facility_locks_finish = modem_3gpp_load_enabled_facility_locks_finish; + iface->load_eps_ue_mode_operation = modem_3gpp_load_eps_ue_mode_operation; + iface->load_eps_ue_mode_operation_finish = modem_3gpp_load_eps_ue_mode_operation_finish; /* Enabling steps */ iface->setup_unsolicited_events = modem_3gpp_setup_unsolicited_events; @@ -10456,14 +11513,15 @@ iface->load_operator_code_finish = modem_3gpp_load_operator_code_finish; iface->load_operator_name = modem_3gpp_load_operator_name; iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish; - iface->load_subscription_state = modem_3gpp_load_subscription_state; - iface->load_subscription_state_finish = modem_3gpp_load_subscription_state_finish; iface->run_registration_checks = modem_3gpp_run_registration_checks; iface->run_registration_checks_finish = modem_3gpp_run_registration_checks_finish; iface->register_in_network = modem_3gpp_register_in_network; iface->register_in_network_finish = modem_3gpp_register_in_network_finish; iface->scan_networks = modem_3gpp_scan_networks; iface->scan_networks_finish = modem_3gpp_scan_networks_finish; + iface->set_eps_ue_mode_operation = modem_3gpp_set_eps_ue_mode_operation; + iface->set_eps_ue_mode_operation_finish = modem_3gpp_set_eps_ue_mode_operation_finish; + iface->create_initial_eps_bearer = modem_3gpp_create_initial_eps_bearer; } static void @@ -10474,16 +11532,16 @@ iface->check_support_finish = modem_3gpp_ussd_check_support_finish; /* Enabling steps */ - iface->setup_unsolicited_result_codes = modem_3gpp_ussd_setup_unsolicited_result_codes; - iface->setup_unsolicited_result_codes_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_result_codes_finish; - iface->enable_unsolicited_result_codes = modem_3gpp_ussd_enable_unsolicited_result_codes; - iface->enable_unsolicited_result_codes_finish = modem_3gpp_ussd_enable_disable_unsolicited_result_codes_finish; + iface->setup_unsolicited_events = modem_3gpp_ussd_setup_unsolicited_events; + iface->setup_unsolicited_events_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish; + iface->enable_unsolicited_events = modem_3gpp_ussd_enable_unsolicited_events; + iface->enable_unsolicited_events_finish = modem_3gpp_ussd_enable_disable_unsolicited_events_finish; /* Disabling steps */ - iface->cleanup_unsolicited_result_codes_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_result_codes_finish; - iface->cleanup_unsolicited_result_codes = modem_3gpp_ussd_cleanup_unsolicited_result_codes; - iface->disable_unsolicited_result_codes = modem_3gpp_ussd_disable_unsolicited_result_codes; - iface->disable_unsolicited_result_codes_finish = modem_3gpp_ussd_enable_disable_unsolicited_result_codes_finish; + iface->cleanup_unsolicited_events_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish; + iface->cleanup_unsolicited_events = modem_3gpp_ussd_cleanup_unsolicited_events; + iface->disable_unsolicited_events = modem_3gpp_ussd_disable_unsolicited_events; + iface->disable_unsolicited_events_finish = modem_3gpp_ussd_enable_disable_unsolicited_events_finish; /* Additional actions */ iface->encode = modem_3gpp_ussd_encode; @@ -10504,6 +11562,10 @@ iface->load_meid_finish = modem_cdma_load_meid_finish; /* Registration check steps */ + iface->setup_unsolicited_events = modem_cdma_setup_unsolicited_events; + iface->setup_unsolicited_events_finish = modem_cdma_setup_cleanup_unsolicited_events_finish; + iface->cleanup_unsolicited_events = modem_cdma_cleanup_unsolicited_events; + iface->cleanup_unsolicited_events_finish = modem_cdma_setup_cleanup_unsolicited_events_finish; iface->setup_registration_checks = modem_cdma_setup_registration_checks; iface->setup_registration_checks_finish = modem_cdma_setup_registration_checks_finish; iface->get_call_manager_state = modem_cdma_get_call_manager_state; @@ -10716,6 +11778,10 @@ MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS); g_object_class_override_property (object_class, + PROP_MODEM_3GPP_INITIAL_EPS_BEARER, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER); + + g_object_class_override_property (object_class, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, MM_IFACE_MODEM_CDMA_CDMA1X_REGISTRATION_STATE); @@ -10750,4 +11816,25 @@ g_object_class_override_property (object_class, PROP_MODEM_SIMPLE_STATUS, MM_IFACE_MODEM_SIMPLE_STATUS); + + g_object_class_override_property (object_class, + PROP_MODEM_SIM_HOT_SWAP_SUPPORTED, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED); + + g_object_class_override_property (object_class, + PROP_MODEM_SIM_HOT_SWAP_CONFIGURED, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED); + + g_object_class_override_property (object_class, + PROP_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED); + + properties[PROP_FLOW_CONTROL] = + g_param_spec_flags (MM_BROADBAND_MODEM_FLOW_CONTROL, + "Flow control", + "Flow control settings to use in the connected TTY", + MM_TYPE_FLOW_CONTROL, + MM_FLOW_CONTROL_NONE, + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_FLOW_CONTROL, properties[PROP_FLOW_CONTROL]); } diff -Nru modemmanager-1.6.8/src/mm-broadband-modem.h modemmanager-1.10.0/src/mm-broadband-modem.h --- modemmanager-1.6.8/src/mm-broadband-modem.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-modem.h 2018-11-15 09:55:53.000000000 +0100 @@ -24,6 +24,7 @@ #include +#include "mm-modem-helpers.h" #include "mm-charsets.h" #include "mm-base-modem.h" @@ -38,6 +39,8 @@ typedef struct _MMBroadbandModemClass MMBroadbandModemClass; typedef struct _MMBroadbandModemPrivate MMBroadbandModemPrivate; +#define MM_BROADBAND_MODEM_FLOW_CONTROL "broadband-modem-flow-control" + struct _MMBroadbandModem { MMBaseModem parent; MMBroadbandModemPrivate *priv; @@ -127,5 +130,7 @@ void mm_broadband_modem_unlock_sms_storages (MMBroadbandModem *self, gboolean mem1, gboolean mem2); +/* Helper to update SIM hot swap */ +void mm_broadband_modem_update_sim_hot_swap_detected (MMBroadbandModem *self); #endif /* MM_BROADBAND_MODEM_H */ diff -Nru modemmanager-1.6.8/src/mm-broadband-modem-mbim.c modemmanager-1.10.0/src/mm-broadband-modem-mbim.c --- modemmanager-1.6.8/src/mm-broadband-modem-mbim.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-modem-mbim.c 2019-01-15 15:57:35.000000000 +0100 @@ -35,24 +35,43 @@ #include "mm-bearer-list.h" #include "mm-iface-modem.h" #include "mm-iface-modem-3gpp.h" +#include "mm-iface-modem-3gpp-ussd.h" +#include "mm-iface-modem-location.h" #include "mm-iface-modem-messaging.h" #include "mm-iface-modem-signal.h" #include "mm-sms-part-3gpp.h" -#if defined WITH_QMI +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED # include +# include "mm-shared-qmi.h" #endif static void iface_modem_init (MMIfaceModem *iface); static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface); +static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface); +static void iface_modem_location_init (MMIfaceModemLocation *iface); static void iface_modem_messaging_init (MMIfaceModemMessaging *iface); static void iface_modem_signal_init (MMIfaceModemSignal *iface); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED +static void shared_qmi_init (MMSharedQmi *iface); +#endif + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED +static MMIfaceModemLocation *iface_modem_location_parent; +#endif +static MMIfaceModemSignal *iface_modem_signal_parent; G_DEFINE_TYPE_EXTENDED (MMBroadbandModemMbim, mm_broadband_modem_mbim, MM_TYPE_BROADBAND_MODEM, 0, G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP_USSD, iface_modem_3gpp_ussd_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_MESSAGING, iface_modem_messaging_init) - G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIGNAL, iface_modem_signal_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIGNAL, iface_modem_signal_init) +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_QMI, shared_qmi_init) +#endif +) typedef enum { PROCESS_NOTIFICATION_FLAG_NONE = 0, @@ -62,6 +81,9 @@ PROCESS_NOTIFICATION_FLAG_CONNECT = 1 << 3, PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO = 1 << 4, PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE = 1 << 5, + PROCESS_NOTIFICATION_FLAG_PCO = 1 << 6, + PROCESS_NOTIFICATION_FLAG_USSD = 1 << 7, + PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS = 1 << 8, } ProcessNotificationFlag; struct _MMBroadbandModemMbimPrivate { @@ -72,19 +94,42 @@ guint caps_max_sessions; gchar *caps_device_id; gchar *caps_firmware_info; + gchar *caps_hardware_info; + + /* Supported features */ + gboolean is_pco_supported; + gboolean is_lte_attach_status_supported; + gboolean is_ussd_supported; + gboolean is_atds_location_supported; + gboolean is_atds_signal_supported; /* Process unsolicited notifications */ guint notification_id; ProcessNotificationFlag setup_flags; ProcessNotificationFlag enable_flags; + GList *pco_list; + /* 3GPP registration helpers */ gchar *current_operator_id; gchar *current_operator_name; + /* USSD helpers */ + GTask *pending_ussd_action; + /* Access technology updates */ MbimDataClass available_data_classes; MbimDataClass highest_available_data_class; + + MbimSubscriberReadyState last_ready_state; + + /* For notifying when the mbim-proxy connection is dead */ + gulong mbim_device_removed_id; + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + /* Flag when QMI-based capability/mode switching is in use */ + gboolean qmi_capability_and_mode_switching; +#endif }; /*****************************************************************************/ @@ -99,12 +144,13 @@ port = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek MBIM port"); + g_task_report_new_error (self, + callback, + user_data, + peek_device, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek MBIM port"); return FALSE; } @@ -112,21 +158,65 @@ return TRUE; } +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +static QmiClient * +shared_qmi_peek_client (MMSharedQmi *self, + QmiService service, + MMPortQmiFlag flag, + GError **error) +{ + MMPortMbim *port; + QmiClient *client; + + g_assert (flag == MM_PORT_QMI_FLAG_DEFAULT); + + port = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); + if (!port) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek MBIM port"); + return NULL; + } + + if (!mm_port_mbim_supports_qmi (port)) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Unsupported"); + return NULL; + } + + client = mm_port_mbim_peek_qmi_client (port, service); + if (!client) + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek client for service '%s'", + qmi_service_get_string (service)); + + return client; +} + +#endif + /*****************************************************************************/ -/* Current Capabilities loading (Modem interface) */ +/* Current capabilities (Modem interface) */ typedef struct { - MMBroadbandModemMbim *self; - GSimpleAsyncResult *result; -} LoadCapabilitiesContext; +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + MMModemCapability current_qmi; +#endif + MbimDevice *device; + MMModemCapability current_mbim; +} LoadCurrentCapabilitiesContext; static void -load_capabilities_context_complete_and_free (LoadCapabilitiesContext *ctx) +load_current_capabilities_context_free (LoadCurrentCapabilitiesContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadCapabilitiesContext, ctx); + g_object_unref (ctx->device); + g_free (ctx); } static MMModemCapability @@ -134,101 +224,271 @@ GAsyncResult *res, GError **error) { - MMModemCapability caps; - gchar *caps_str; + GError *inner_error = NULL; + gssize value; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return MM_MODEM_CAPABILITY_NONE; + } + return (MMModemCapability)value; +} - caps = ((MMModemCapability) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res)))); - caps_str = mm_modem_capability_build_string_from_mask (caps); - mm_dbg ("loaded modem capabilities: %s", caps_str); - g_free (caps_str); - return caps; +static void +complete_current_capabilities (GTask *task) +{ + MMBroadbandModemMbim *self; + LoadCurrentCapabilitiesContext *ctx; + MMModemCapability result = 0; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + /* Warn if the MBIM loaded capabilities isn't a subset of the QMI loaded ones */ + if (ctx->current_qmi && ctx->current_mbim) { + gchar *mbim_caps_str; + gchar *qmi_caps_str; + + mbim_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_mbim), 1); + qmi_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_qmi), 1); + + if ((ctx->current_mbim & ctx->current_qmi) != ctx->current_mbim) + mm_warn ("MBIM reported current capabilities (%s) not found in QMI-over-MBIM reported ones (%s)", + mbim_caps_str, qmi_caps_str); + else + mm_dbg ("MBIM reported current capabilities (%s) is a subset of the QMI-over-MBIM reported ones (%s)", + mbim_caps_str, qmi_caps_str); + g_free (mbim_caps_str); + g_free (qmi_caps_str); + + result = ctx->current_qmi; + self->priv->qmi_capability_and_mode_switching = TRUE; + } else if (ctx->current_qmi) { + result = ctx->current_qmi; + self->priv->qmi_capability_and_mode_switching = TRUE; + } else + result = ctx->current_mbim; + + /* If current capabilities loading is done via QMI, we can safely assume that all the other + * capability and mode related operations are going to be done via QMI as well, so that we + * don't mix both logics */ + if (self->priv->qmi_capability_and_mode_switching) + mm_info ("QMI-based capability and mode switching support enabled"); +#else + result = ctx->current_mbim; +#endif + + g_task_return_int (task, (gint) result); + g_object_unref (task); } static void device_caps_query_ready (MbimDevice *device, GAsyncResult *res, - LoadCapabilitiesContext *ctx) + GTask *task) { - MMModemCapability mask; - MbimMessage *response; - GError *error = NULL; + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + LoadCurrentCapabilitiesContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); response = mbim_device_command_finish (device, res, &error); - if (response && - mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && - mbim_message_device_caps_response_parse ( + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_device_caps_response_parse ( response, NULL, /* device_type */ - &ctx->self->priv->caps_cellular_class, + &self->priv->caps_cellular_class, NULL, /* voice_class */ NULL, /* sim_class */ - &ctx->self->priv->caps_data_class, - &ctx->self->priv->caps_sms, + &self->priv->caps_data_class, + &self->priv->caps_sms, NULL, /* ctrl_caps */ - &ctx->self->priv->caps_max_sessions, + &self->priv->caps_max_sessions, NULL, /* custom_data_class */ - &ctx->self->priv->caps_device_id, - &ctx->self->priv->caps_firmware_info, - NULL, /* hardware_info */ + &self->priv->caps_device_id, + &self->priv->caps_firmware_info, + &self->priv->caps_hardware_info, &error)) { - /* Build mask of modem capabilities */ - mask = 0; - if (ctx->self->priv->caps_cellular_class & MBIM_CELLULAR_CLASS_GSM) - mask |= MM_MODEM_CAPABILITY_GSM_UMTS; - -#if 0 /* Disable until we add MBIM CDMA support */ - if (ctx->self->priv->caps_cellular_class & MBIM_CELLULAR_CLASS_CDMA) - mask |= MM_MODEM_CAPABILITY_CDMA_EVDO; -#endif + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } - if (ctx->self->priv->caps_data_class & MBIM_DATA_CLASS_LTE) - mask |= MM_MODEM_CAPABILITY_LTE; - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (mask), - NULL); - } else - g_simple_async_result_take_error (ctx->result, error); + ctx->current_mbim = mm_modem_capability_from_mbim_device_caps (self->priv->caps_cellular_class, + self->priv->caps_data_class); + complete_current_capabilities (task); +out: if (response) mbim_message_unref (response); - load_capabilities_context_complete_and_free (ctx); } static void -modem_load_current_capabilities (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +load_current_capabilities_mbim (GTask *task) { - LoadCapabilitiesContext *ctx; - MbimDevice *device; - MbimMessage *message; - - if (!peek_device (self, &device, callback, user_data)) - return; + MbimMessage *message; + LoadCurrentCapabilitiesContext *ctx; - ctx = g_slice_new (LoadCapabilitiesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_capabilities); + ctx = g_task_get_task_data (task); mm_dbg ("loading current capabilities..."); message = mbim_message_device_caps_query_new (NULL); - mbim_device_command (device, + mbim_device_command (ctx->device, message, 10, NULL, (GAsyncReadyCallback)device_caps_query_ready, - ctx); + task); mbim_message_unref (message); } +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +static void +qmi_load_current_capabilities_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + LoadCurrentCapabilitiesContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + ctx->current_qmi = mm_shared_qmi_load_current_capabilities_finish (self, res, &error); + if (!ctx->current_qmi) { + mm_dbg ("Couldn't load currrent capabilities using QMI over MBIM: %s", error->message); + g_clear_error (&error); + } + + load_current_capabilities_mbim (task); +} + +#endif + +static void +modem_load_current_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MbimDevice *device; + GTask *task; + LoadCurrentCapabilitiesContext *ctx; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + ctx = g_new0 (LoadCurrentCapabilitiesContext, 1); + ctx->device = g_object_ref (device); + g_task_set_task_data (task, ctx, (GDestroyNotify) load_current_capabilities_context_free); + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + mm_shared_qmi_load_current_capabilities (self, + (GAsyncReadyCallback)qmi_load_current_capabilities_ready, + task); +#else + load_current_capabilities_mbim (task); +#endif +} + +/*****************************************************************************/ +/* Supported Capabilities loading (Modem interface) */ + +static GArray * +modem_load_supported_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_load_supported_capabilities_finish (self, res, error); +#endif + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_supported_capabilities_mbim (GTask *task) +{ + MMBroadbandModemMbim *self; + MMModemCapability current; + GArray *supported = NULL; + + self = g_task_get_source_object (task); + + /* Current capabilities should have been cached already, just assume them */ + current = mm_modem_capability_from_mbim_device_caps (self->priv->caps_cellular_class, self->priv->caps_data_class); + if (current != 0) { + supported = g_array_sized_new (FALSE, FALSE, sizeof (MMModemCapability), 1); + g_array_append_val (supported, current); + } + + if (!supported) + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't load supported capabilities: no previously catched current capabilities"); + else + g_task_return_pointer (task, supported, (GDestroyNotify) g_array_unref); + g_object_unref (task); +} + +static void +modem_load_supported_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_load_supported_capabilities (self, callback, user_data); + return; + } +#endif + + task = g_task_new (self, NULL, callback, user_data); + load_supported_capabilities_mbim (task); +} + +/*****************************************************************************/ +/* Capabilities switching (Modem interface) */ + +static gboolean +modem_set_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_set_current_capabilities_finish (self, res, error); +#endif + g_assert (error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_set_current_capabilities (MMIfaceModem *self, + MMModemCapability capabilities, + GAsyncReadyCallback callback, + gpointer user_data) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_set_current_capabilities (self, capabilities, callback, user_data); + return; + } +#endif + + g_task_report_new_error (self, callback, user_data, + modem_set_current_capabilities, + MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Capability switching is not supported"); +} + /*****************************************************************************/ /* Manufacturer loading (Modem interface) */ @@ -237,7 +497,7 @@ GAsyncResult *res, GError **error) { - return g_strdup (mm_base_modem_get_plugin (MM_BASE_MODEM (self))); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -245,14 +505,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; + gchar *manufacturer = NULL; + MMPortMbim *port; + + port = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); + if (port) { + manufacturer = g_strdup (mm_kernel_device_get_physdev_manufacturer ( + mm_port_peek_kernel_device (MM_PORT (port)))); + } - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_manufacturer); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (!manufacturer) + manufacturer = g_strdup (mm_base_modem_get_plugin (MM_BASE_MODEM (self))); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, manufacturer, g_free); + g_object_unref (task); } /*****************************************************************************/ @@ -263,10 +531,7 @@ GAsyncResult *res, GError **error) { - return g_strdup_printf ("MBIM [%04X:%04X]", - (mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)) & 0xFFFF), - (mm_base_modem_get_product_id (MM_BASE_MODEM (self)) & 0xFFFF)); - + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -274,14 +539,24 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + gchar *model = NULL; + GTask *task; + MMPortMbim *port; + + port = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); + if (port) { + model = g_strdup (mm_kernel_device_get_physdev_product ( + mm_port_peek_kernel_device (MM_PORT (port)))); + } - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_model); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (!model) + model = g_strdup_printf ("MBIM [%04X:%04X]", + (mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)) & 0xFFFF), + (mm_base_modem_get_product_id (MM_BASE_MODEM (self)) & 0xFFFF)); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, model, g_free); + g_object_unref (task); } /*****************************************************************************/ @@ -292,30 +567,60 @@ GAsyncResult *res, GError **error) { - if (MM_BROADBAND_MODEM_MBIM (self)->priv->caps_firmware_info) - return g_strdup (MM_BROADBAND_MODEM_MBIM (self)->priv->caps_firmware_info); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Firmware revision information not given in device capabilities"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_load_revision (MMIfaceModem *self, +modem_load_revision (MMIfaceModem *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->caps_firmware_info) + g_task_return_pointer (task, + g_strdup (self->priv->caps_firmware_info), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Firmware revision information not given in device capabilities"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Hardware Revision loading (Modem interface) */ + +static gchar * +modem_load_hardware_revision_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +modem_load_hardware_revision (MMIfaceModem *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; - /* Just complete */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_revision); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->caps_hardware_info) + g_task_return_pointer (task, + g_strdup (self->priv->caps_hardware_info), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Hardware revision information not given in device capabilities"); + g_object_unref (task); } /*****************************************************************************/ @@ -326,30 +631,28 @@ GAsyncResult *res, GError **error) { - if (MM_BROADBAND_MODEM_MBIM (self)->priv->caps_device_id) - return g_strdup (MM_BROADBAND_MODEM_MBIM (self)->priv->caps_device_id); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device ID not given in device capabilities"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_load_equipment_identifier (MMIfaceModem *self, +modem_load_equipment_identifier (MMIfaceModem *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; - /* Just complete */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_equipment_identifier); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->caps_device_id) + g_task_return_pointer (task, + g_strdup (self->priv->caps_device_id), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device ID not given in device capabilities"); + g_object_unref (task); } /*****************************************************************************/ @@ -360,13 +663,7 @@ GAsyncResult *res, GError **error) { - gchar *device_identifier; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - device_identifier = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - return device_identifier; + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -374,22 +671,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; gchar *device_identifier; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_device_identifier); + GTask *task; /* Just use dummy ATI/ATI1 replies, all the other internal info should be * enough for uniqueness */ device_identifier = mm_broadband_modem_create_device_identifier (MM_BROADBAND_MODEM (self), "", ""); - g_simple_async_result_set_op_res_gpointer (result, - device_identifier, - (GDestroyNotify)g_free); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, device_identifier, g_free); + g_object_unref (task); } /*****************************************************************************/ @@ -400,34 +691,29 @@ GAsyncResult *res, GError **error) { - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_load_supported_modes_finish (self, res, error); +#endif + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_load_supported_modes (MMIfaceModem *_self, - GAsyncReadyCallback callback, - gpointer user_data) +load_supported_modes_mbim (GTask *task) { - MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); - GArray *combinations; - MMModemModeCombination mode; - GSimpleAsyncResult *result; - MMModemMode all; - - /* Just complete */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_modes); + MMBroadbandModemMbim *self; + MMModemModeCombination mode; + MMModemMode all; + GArray *supported; + self = g_task_get_source_object (task); if (self->priv->caps_data_class == 0) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Data class not given in device capabilities"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Data class not given in device capabilities"); + g_object_unref (task); return; } @@ -457,14 +743,103 @@ all |= MM_MODEM_MODE_4G; /* Build a mask with all supported modes */ - combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); + supported = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); mode.allowed = all; mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); + g_array_append_val (supported, mode); - g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, supported, (GDestroyNotify) g_array_unref); + g_object_unref (task); +} + +static void +modem_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_load_supported_modes (self, callback, user_data); + return; + } +#endif + + task = g_task_new (self, NULL, callback, user_data); + load_supported_modes_mbim (task); +} + +/*****************************************************************************/ +/* Current modes loading (Modem interface) */ + +static gboolean +modem_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_load_current_modes_finish (self, res, allowed, preferred, error); +#endif + g_assert (error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_load_current_modes (self, callback, user_data); + return; + } +#endif + + g_task_report_new_error (self, callback, user_data, + modem_set_current_capabilities, + MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Current mode loading is not supported"); +} + +/*****************************************************************************/ +/* Current modes switching (Modem interface) */ + +static gboolean +modem_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_set_current_modes_finish (self, res, error); +#endif + g_assert (error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_set_current_modes (self, allowed, preferred, callback, user_data); + return; + } +#endif + + g_task_report_new_error (self, callback, user_data, + modem_set_current_capabilities, + MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Capability switching is not supported"); } /*****************************************************************************/ @@ -475,11 +850,15 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_BEARER_IP_FAMILY_NONE; + GError *inner_error = NULL; + gssize value; - return (MMBearerIpFamily) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_IP_FAMILY_NONE; + } + return (MMBearerIpFamily)value; } static void @@ -487,41 +866,29 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_ip_families); + GTask *task; + task = g_task_new (self, NULL, callback, user_data); /* Assume IPv4 + IPv6 + IPv4v6 supported */ - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_BEARER_IP_FAMILY_IPV4 | - MM_BEARER_IP_FAMILY_IPV6 | - MM_BEARER_IP_FAMILY_IPV4V6), - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, + MM_BEARER_IP_FAMILY_IPV4 | + MM_BEARER_IP_FAMILY_IPV6 | + MM_BEARER_IP_FAMILY_IPV4V6); + g_object_unref (task); } /*****************************************************************************/ /* Unlock required loading (Modem interface) */ typedef struct { - MMBroadbandModemMbim *self; - GSimpleAsyncResult *result; guint n_ready_status_checks; MbimDevice *device; } LoadUnlockRequiredContext; static void -load_unlock_required_context_complete_and_free (LoadUnlockRequiredContext *ctx) +load_unlock_required_context_free (LoadUnlockRequiredContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->device); - g_object_unref (ctx->self); g_slice_free (LoadUnlockRequiredContext, ctx); } @@ -530,16 +897,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCK_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemLock) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCK_UNKNOWN; + } + return (MMModemLock)value; } static void pin_query_ready (MbimDevice *device, GAsyncResult *res, - LoadUnlockRequiredContext *ctx) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -561,36 +933,39 @@ unlock_required = MM_MODEM_LOCK_NONE; else unlock_required = mm_modem_lock_from_mbim_pin_type (pin_type); - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (unlock_required), - NULL); + + g_task_return_int (task, unlock_required); } /* VZ20M reports an error when SIM-PIN is required... */ else if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_PIN_REQUIRED)) { g_error_free (error); - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (MBIM_PIN_TYPE_PIN1), - NULL); + g_task_return_int (task, MBIM_PIN_TYPE_PIN1); } else - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + + g_object_unref (task); if (response) mbim_message_unref (response); - load_unlock_required_context_complete_and_free (ctx); } -static gboolean wait_for_sim_ready (LoadUnlockRequiredContext *ctx); +static gboolean wait_for_sim_ready (GTask *task); static void unlock_required_subscriber_ready_state_ready (MbimDevice *device, GAsyncResult *res, - LoadUnlockRequiredContext *ctx) + GTask *task) { + LoadUnlockRequiredContext *ctx; + MMBroadbandModemMbim *self; MbimMessage *response; GError *error = NULL; MbimSubscriberReadyState ready_state = MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED; + ctx = g_task_get_task_data (task); + self = g_task_get_source_object (task); + response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -624,10 +999,12 @@ } } + self->priv->last_ready_state = ready_state; + /* Fatal errors are reported right away */ if (error) { - g_simple_async_result_take_error (ctx->result, error); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); } /* Need to retry? */ else if (ready_state == MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED || @@ -635,18 +1012,18 @@ if (--ctx->n_ready_status_checks == 0) { /* All retries consumed, issue error */ if (ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED) - g_simple_async_result_take_error ( - ctx->result, + g_task_return_error ( + task, mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED)); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Error waiting for SIM to get initialized"); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Error waiting for SIM to get initialized"); + g_object_unref (task); } else { /* Retry */ - g_timeout_add_seconds (1, (GSourceFunc)wait_for_sim_ready, ctx); + g_timeout_add_seconds (1, (GSourceFunc)wait_for_sim_ready, task); } } /* Initialized but locked? */ @@ -660,15 +1037,13 @@ 10, NULL, (GAsyncReadyCallback)pin_query_ready, - ctx); + task); mbim_message_unref (message); } /* Initialized but locked? */ else if (ready_state == MBIM_SUBSCRIBER_READY_STATE_INITIALIZED) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (MM_MODEM_LOCK_NONE), - NULL); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } else g_assert_not_reached (); @@ -677,17 +1052,19 @@ } static gboolean -wait_for_sim_ready (LoadUnlockRequiredContext *ctx) +wait_for_sim_ready (GTask *task) { + LoadUnlockRequiredContext *ctx; MbimMessage *message; + ctx = g_task_get_task_data (task); message = mbim_message_subscriber_ready_status_query_new (NULL); mbim_device_command (ctx->device, message, 10, NULL, (GAsyncReadyCallback)unlock_required_subscriber_ready_state_ready, - ctx); + task); mbim_message_unref (message); return G_SOURCE_REMOVE; } @@ -699,20 +1076,19 @@ { LoadUnlockRequiredContext *ctx; MbimDevice *device; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; ctx = g_slice_new (LoadUnlockRequiredContext); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_required); ctx->n_ready_status_checks = 10; - wait_for_sim_ready (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_unlock_required_context_free); + + wait_for_sim_ready (task); } /*****************************************************************************/ @@ -723,16 +1099,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return MM_UNLOCK_RETRIES (g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + return g_task_propagate_pointer (G_TASK (res), error); } static void pin_query_unlock_retries_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -748,24 +1121,58 @@ NULL, &remaining_attempts, &error)) { + MMIfaceModem *self; + MMModemLock lock; MMUnlockRetries *retries; + self = g_task_get_source_object (task); + lock = mm_modem_lock_from_mbim_pin_type (pin_type); retries = mm_unlock_retries_new (); + + /* If PIN1 is disabled and we have tried to enable it with a wrong PIN, + * the modem would have indicated the number of remaining attempts for + * PIN1 (unless PUK1 is engaged) in the response to the failed + * MBIM_CID_PIN set operation. Thus, MMSimMbim would have updated + * MMIfaceModem's MMUnlockRetries with information about PIN1. + * + * However, a MBIM_CID_PIN query may be issued (e.g. MMBaseSim calls + * mm_iface_modem_update_lock_info()) after the MBIM_CID_PIN set + * operation to query the number of remaining attempts for a PIN type. + * Unfortunately, we can't specify a particular PIN type in a + * MBIM_CID_PIN query. The modem may not reply with information about + * PIN1 if PIN1 is disabled. When that happens, we would like to + * preserve our knowledge about the number of remaining attempts for + * PIN1. Here we thus carry over any existing information on PIN1 from + * MMIfaceModem's MMUnlockRetries if the MBIM_CID_PIN query reports + * something other than PIN1. */ + if (lock != MM_MODEM_LOCK_SIM_PIN) { + MMUnlockRetries *previous_retries; + guint previous_sim_pin_retries; + + previous_retries = mm_iface_modem_get_unlock_retries (self); + previous_sim_pin_retries = mm_unlock_retries_get (previous_retries, + MM_MODEM_LOCK_SIM_PIN); + if (previous_sim_pin_retries != MM_UNLOCK_RETRIES_UNKNOWN) { + mm_unlock_retries_set (retries, + MM_MODEM_LOCK_SIM_PIN, + previous_sim_pin_retries); + } + g_object_unref (previous_retries); + } + /* According to the MBIM specification, RemainingAttempts is set to * 0xffffffff if the device does not support this information. */ - if (remaining_attempts != G_MAXUINT32) { - mm_unlock_retries_set (retries, - mm_modem_lock_from_mbim_pin_type (pin_type), - remaining_attempts); - } - g_simple_async_result_set_op_res_gpointer (simple, retries, g_object_unref); + if (remaining_attempts != G_MAXUINT32) + mm_unlock_retries_set (retries, lock, remaining_attempts); + + g_task_return_pointer (task, retries, g_object_unref); } else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -773,17 +1180,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_retries); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_pin_query_new (NULL); mbim_device_command (device, @@ -791,7 +1195,7 @@ 10, NULL, (GAsyncReadyCallback)pin_query_unlock_retries_ready, - result); + task); mbim_message_unref (message); } @@ -803,16 +1207,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void own_numbers_subscriber_ready_state_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -830,14 +1231,14 @@ NULL, /* telephone_numbers_count */ &telephone_numbers, &error)) { - g_simple_async_result_set_op_res_gpointer (simple, telephone_numbers, NULL); + g_task_return_pointer (task, telephone_numbers, (GDestroyNotify)g_strfreev); } else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -845,17 +1246,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_own_numbers); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_subscriber_ready_status_query_new (NULL); mbim_device_command (device, @@ -863,7 +1261,7 @@ 10, NULL, (GAsyncReadyCallback)own_numbers_subscriber_ready_state_ready, - result); + task); mbim_message_unref (message); } @@ -875,16 +1273,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_POWER_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemPowerState) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_POWER_STATE_UNKNOWN; + } + return (MMModemPowerState)value; } static void radio_state_query_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -906,16 +1309,13 @@ state = MM_MODEM_POWER_STATE_LOW; else state = MM_MODEM_POWER_STATE_ON; - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (state), - NULL); + g_task_return_int (task, state); } else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -923,17 +1323,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_power_state); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_radio_state_query_new (NULL); mbim_device_command (device, @@ -941,7 +1338,7 @@ 10, NULL, (GAsyncReadyCallback)radio_state_query_ready, - result); + task); mbim_message_unref (message); } @@ -951,114 +1348,68 @@ typedef enum { POWER_UP_CONTEXT_STEP_FIRST, #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED - POWER_UP_CONTEXT_STEP_QMI_DEVICE_NEW, - POWER_UP_CONTEXT_STEP_QMI_DEVICE_OPEN, - POWER_UP_CONTEXT_STEP_ALLOCATE_QMI_CLIENT_DMS, POWER_UP_CONTEXT_STEP_FCC_AUTH, - POWER_UP_CONTEXT_STEP_RELEASE_QMI_CLIENT_DMS, POWER_UP_CONTEXT_STEP_RETRY, #endif POWER_UP_CONTEXT_STEP_LAST, } PowerUpContextStep; typedef struct { - MMBroadbandModemMbim *self; - MbimDevice *device; - GSimpleAsyncResult *result; - PowerUpContextStep step; + MbimDevice *device; + PowerUpContextStep step; #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED - QmiDevice *qmi_device; - QmiClient *qmi_client; - GError *saved_error; + QmiClient *qmi_client_dms; + GError *saved_error; #endif } PowerUpContext; static void -power_up_context_complete_and_free (PowerUpContext *ctx) +power_up_context_free (PowerUpContext *ctx) { #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED - if (ctx->qmi_device) { - if (ctx->qmi_client) { - qmi_device_release_client (ctx->qmi_device, - ctx->qmi_client, - QMI_DEVICE_RELEASE_CLIENT_FLAGS_RELEASE_CID, - 3, NULL, NULL, NULL); - g_object_unref (ctx->qmi_client); - } - g_object_unref (ctx->qmi_device); - } + g_clear_object (&ctx->qmi_client_dms); if (ctx->saved_error) g_error_free (ctx->saved_error); #endif - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->device); - g_object_unref (ctx->self); g_slice_free (PowerUpContext, ctx); } static gboolean -power_up_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) +power_up_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void power_up_context_step (PowerUpContext *ctx); +static void power_up_context_step (GTask *task); #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED static void -release_qmi_client_dms_ready (QmiDevice *dev, - GAsyncResult *res, - PowerUpContext *ctx) -{ - GError *error = NULL; - - /* Non-fatal error */ - if (!qmi_device_release_client_finish (dev, res, &error)) { - mm_dbg ("error: couldn't release client: %s", error->message); - g_error_free (error); - } - - ctx->step++; - power_up_context_step (ctx); -} - -static void -set_radio_state_release_qmi_client_dms (PowerUpContext *ctx) -{ - qmi_device_release_client (ctx->qmi_device, - ctx->qmi_client, - QMI_DEVICE_RELEASE_CLIENT_FLAGS_RELEASE_CID, - 10, - NULL, - (GAsyncReadyCallback)release_qmi_client_dms_ready, - ctx); -} - -static void -set_fcc_authentication_ready (QmiClientDms *client, - GAsyncResult *res, - PowerUpContext *ctx) +set_fcc_authentication_ready (QmiClientDms *qmi_client_dms, + GAsyncResult *res, + GTask *task) { + PowerUpContext *ctx; QmiMessageDmsSetFccAuthenticationOutput *output; - GError *error = NULL; + GError *error = NULL; - output = qmi_client_dms_set_fcc_authentication_finish (client, res, &error); + ctx = g_task_get_task_data (task); + output = qmi_client_dms_set_fcc_authentication_finish (qmi_client_dms, res, &error); if (!output || !qmi_message_dms_set_fcc_authentication_output_get_result (output, &error)) { mm_dbg ("error: couldn't set FCC auth: %s", error->message); g_error_free (error); g_assert (ctx->saved_error); - g_simple_async_result_take_error (ctx->result, ctx->saved_error); + g_task_return_error (task, ctx->saved_error); ctx->saved_error = NULL; - power_up_context_complete_and_free (ctx); + g_object_unref (task); goto out; } ctx->step++; - power_up_context_step (ctx); + power_up_context_step (task); out: if (output) @@ -1066,132 +1417,35 @@ } static void -set_radio_state_fcc_auth (PowerUpContext *ctx) +set_radio_state_fcc_auth (GTask *task) { - qmi_client_dms_set_fcc_authentication (QMI_CLIENT_DMS (ctx->qmi_client), + PowerUpContext *ctx; + + ctx = g_task_get_task_data (task); + g_assert (ctx->qmi_client_dms); + + qmi_client_dms_set_fcc_authentication (QMI_CLIENT_DMS (ctx->qmi_client_dms), NULL, 10, NULL, /* cancellable */ (GAsyncReadyCallback)set_fcc_authentication_ready, - ctx); -} - -static void -qmi_client_dms_ready (QmiDevice *dev, - GAsyncResult *res, - PowerUpContext *ctx) -{ - GError *error = NULL; - - ctx->qmi_client = qmi_device_allocate_client_finish (dev, res, &error); - if (!ctx->qmi_client) { - mm_dbg ("error: couldn't create DMS client: %s", error->message); - g_error_free (error); - g_assert (ctx->saved_error); - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - power_up_context_complete_and_free (ctx); - return; - } - - ctx->step++; - power_up_context_step (ctx); -} - -static void -set_radio_state_allocate_qmi_client_dms (PowerUpContext *ctx) -{ - g_assert (ctx->qmi_device); - qmi_device_allocate_client (ctx->qmi_device, - QMI_SERVICE_DMS, - QMI_CID_NONE, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback) qmi_client_dms_ready, - ctx); -} - -static void -device_open_ready (QmiDevice *dev, - GAsyncResult *res, - PowerUpContext *ctx) -{ - GError *error = NULL; - - if (!qmi_device_open_finish (dev, res, &error)) { - mm_dbg ("error: couldn't open QmiDevice: %s", error->message); - g_error_free (error); - g_assert (ctx->saved_error); - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - power_up_context_complete_and_free (ctx); - return; - } - - ctx->step++; - power_up_context_step (ctx); -} - -static void -set_radio_state_qmi_device_open (PowerUpContext *ctx) -{ - /* Open the device */ - g_assert (ctx->qmi_device); - qmi_device_open (ctx->qmi_device, - (QMI_DEVICE_OPEN_FLAGS_PROXY | QMI_DEVICE_OPEN_FLAGS_MBIM), - 15, - NULL, /* cancellable */ - (GAsyncReadyCallback)device_open_ready, - ctx); -} - -static void -qmi_device_new_ready (GObject *unused, - GAsyncResult *res, - PowerUpContext *ctx) -{ - GError *error = NULL; - - ctx->qmi_device = qmi_device_new_finish (res, &error); - if (!ctx->qmi_device) { - mm_dbg ("error: couldn't create QmiDevice: %s", error->message); - g_error_free (error); - g_assert (ctx->saved_error); - g_simple_async_result_take_error (ctx->result, ctx->saved_error); - ctx->saved_error = NULL; - power_up_context_complete_and_free (ctx); - return; - } - - ctx->step++; - power_up_context_step (ctx); -} - -static void -set_radio_state_qmi_device_new (PowerUpContext *ctx) -{ - GFile *file; - - file = mbim_device_get_file (ctx->device); - qmi_device_new (file, - NULL, /* cancellable */ - (GAsyncReadyCallback) qmi_device_new_ready, - ctx); - g_object_unref (file); + task); } #endif static void -radio_state_set_up_ready (MbimDevice *device, - GAsyncResult *res, - PowerUpContext *ctx) +radio_state_set_up_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) { + PowerUpContext *ctx; MbimMessage *response; GError *error = NULL; MbimRadioSwitchState hardware_radio_state; MbimRadioSwitchState software_radio_state; + ctx = g_task_get_task_data (task); response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -1216,83 +1470,73 @@ /* Nice! we're done, quick exit */ if (!error) { ctx->step = POWER_UP_CONTEXT_STEP_LAST; - power_up_context_step (ctx); + power_up_context_step (task); return; } #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED - /* Only the first attempt isn't fatal */ - if (ctx->step == POWER_UP_CONTEXT_STEP_FIRST) { + /* Only the first attempt isn't fatal, if we have a QMI DMS client */ + if ((ctx->step == POWER_UP_CONTEXT_STEP_FIRST) && ctx->qmi_client_dms) { /* Warn and keep, will retry */ mm_warn ("%s", error->message); g_assert (!ctx->saved_error); ctx->saved_error = error; ctx->step++; - power_up_context_step (ctx); + power_up_context_step (task); return; } #endif /* Fatal */ - g_simple_async_result_take_error (ctx->result, error); - power_up_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); } static void -set_radio_state_up (PowerUpContext *ctx) +set_radio_state_up (GTask *task) { + PowerUpContext *ctx; MbimMessage *message; + ctx = g_task_get_task_data (task); message = mbim_message_radio_state_set_new (MBIM_RADIO_SWITCH_STATE_ON, NULL); mbim_device_command (ctx->device, message, 20, NULL, (GAsyncReadyCallback)radio_state_set_up_ready, - ctx); + task); mbim_message_unref (message); } static void -power_up_context_step (PowerUpContext *ctx) +power_up_context_step (GTask *task) { + PowerUpContext *ctx; + + ctx = g_task_get_task_data (task); + switch (ctx->step) { case POWER_UP_CONTEXT_STEP_FIRST: - set_radio_state_up (ctx); + set_radio_state_up (task); return; #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED - case POWER_UP_CONTEXT_STEP_QMI_DEVICE_NEW: - set_radio_state_qmi_device_new (ctx); - return; - - case POWER_UP_CONTEXT_STEP_QMI_DEVICE_OPEN: - set_radio_state_qmi_device_open (ctx); - return; - - case POWER_UP_CONTEXT_STEP_ALLOCATE_QMI_CLIENT_DMS: - set_radio_state_allocate_qmi_client_dms (ctx); - return; - case POWER_UP_CONTEXT_STEP_FCC_AUTH: - set_radio_state_fcc_auth (ctx); - return; - - case POWER_UP_CONTEXT_STEP_RELEASE_QMI_CLIENT_DMS: - set_radio_state_release_qmi_client_dms (ctx); + set_radio_state_fcc_auth (task); return; case POWER_UP_CONTEXT_STEP_RETRY: - set_radio_state_up (ctx); + set_radio_state_up (task); return; #endif case POWER_UP_CONTEXT_STEP_LAST: /* Good! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - power_up_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; default: @@ -1301,25 +1545,34 @@ } static void -modem_power_up (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +modem_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { PowerUpContext *ctx; - MbimDevice *device; + MbimDevice *device; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; ctx = g_slice_new0 (PowerUpContext); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device); ctx->step = POWER_UP_CONTEXT_STEP_FIRST; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_up); - power_up_context_step (ctx); + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + ctx->qmi_client_dms = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (ctx->qmi_client_dms) + g_object_ref (ctx->qmi_client_dms); +#endif + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)power_up_context_free); + + power_up_context_step (task); } /*****************************************************************************/ @@ -1330,13 +1583,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -radio_state_set_down_ready (MbimDevice *device, - GAsyncResult *res, - GSimpleAsyncResult *simple) +radio_state_set_down_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -1348,11 +1601,10 @@ } if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -1360,24 +1612,95 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *simple; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_power_down); + task = g_task_new (self, NULL, callback, user_data); + message = mbim_message_radio_state_set_new (MBIM_RADIO_SWITCH_STATE_OFF, NULL); mbim_device_command (device, message, 20, NULL, (GAsyncReadyCallback)radio_state_set_down_ready, - simple); + task); + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Signal quality loading (Modem interface) */ + +static guint +modem_load_signal_quality_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + gssize value; + + value = g_task_propagate_int (G_TASK (res), error); + return value < 0 ? 0 : value; +} + +static void +signal_state_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MbimMessage *response; + GError *error = NULL; + guint32 rssi; + + response = mbim_device_command_finish (device, res, &error); + if (response && + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && + mbim_message_signal_state_response_parse ( + response, + &rssi, + NULL, /* error_rate */ + NULL, /* signal_strength_interval */ + NULL, /* rssi_threshold */ + NULL, /* error_rate_threshold */ + &error)) { + guint32 quality; + + /* Normalize the quality. 99 means unknown, we default it to 0 */ + quality = CLAMP (rssi == 99 ? 0 : rssi, 0, 31) * 100 / 31; + + g_task_return_int (task, quality); + } else + g_task_return_error (task, error); + + g_object_unref (task); + + if (response) + mbim_message_unref (response); +} + +static void +modem_load_signal_quality (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MbimDevice *device; + MbimMessage *message; + GTask *task; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + message = mbim_message_signal_state_query_new (NULL); + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)signal_state_query_ready, + task); mbim_message_unref (message); } @@ -1389,12 +1712,7 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } typedef struct { @@ -1449,43 +1767,36 @@ } static void -modem_create_bearer (MMIfaceModem *self, +modem_create_bearer (MMIfaceModem *_self, MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); MMBaseBearer *bearer; - GSimpleAsyncResult *result; + GTask *task; gint session_id; - /* Set a new ref to the bearer object as result */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + task = g_task_new (self, NULL, callback, user_data); /* Find a new session ID */ - session_id = find_next_bearer_session_id (MM_BROADBAND_MODEM_MBIM (self)); + session_id = find_next_bearer_session_id (self); if (session_id < 0) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Not enough session IDs"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Not enough session IDs"); + g_object_unref (task); return; } /* We just create a MMBearerMbim */ mm_dbg ("Creating MBIM bearer in MBIM modem"); - bearer = mm_bearer_mbim_new (MM_BROADBAND_MODEM_MBIM (self), + bearer = mm_bearer_mbim_new (self, properties, (guint)session_id); - - g_simple_async_result_set_op_res_gpointer (result, bearer, g_object_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -1519,13 +1830,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_enabling_started_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -1539,9 +1850,8 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -1549,54 +1859,46 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enabling_started); + task = g_task_new (self, NULL, callback, user_data); MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_mbim_parent_class)->enabling_started ( self, (GAsyncReadyCallback)parent_enabling_started_ready, - result); + task); } /*****************************************************************************/ /* First initialization step */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMPortMbim *mbim; +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + QmiService qmi_services[32]; + guint qmi_service_index; +#endif } InitializationStartedContext; static void -initialization_started_context_complete_and_free (InitializationStartedContext *ctx) +initialization_started_context_free (InitializationStartedContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->mbim) g_object_unref (ctx->mbim); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (InitializationStartedContext, ctx); } static gpointer -initialization_started_finish (MMBroadbandModem *self, - GAsyncResult *res, - GError **error) +initialization_started_finish (MMBroadbandModem *self, + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - /* Just parent's pointer passed here */ - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_initialization_started_ready (MMBroadbandModem *self, - GAsyncResult *res, - InitializationStartedContext *ctx) + GAsyncResult *res, + GTask *task) { gpointer parent_ctx; GError *error = NULL; @@ -1612,72 +1914,296 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gpointer (ctx->result, parent_ctx, NULL); - initialization_started_context_complete_and_free (ctx); + /* Just parent's pointer passed here */ + g_task_return_pointer (task, parent_ctx, NULL); + g_object_unref (task); } static void -parent_initialization_started (InitializationStartedContext *ctx) +parent_initialization_started (GTask *task) { + MMBroadbandModem *self; + + self = g_task_get_source_object (task); MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_mbim_parent_class)->initialization_started ( - ctx->self, + self, (GAsyncReadyCallback)parent_initialization_started_ready, - ctx); + task); } +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +static void allocate_next_qmi_client (GTask *task); + static void -mbim_port_open_ready (MMPortMbim *mbim, +mbim_port_allocate_qmi_client_ready (MMPortMbim *mbim, + GAsyncResult *res, + GTask *task) +{ + InitializationStartedContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + if (!mm_port_mbim_allocate_qmi_client_finish (mbim, res, &error)) { + mm_dbg ("Couldn't allocate QMI client for service '%s': %s", + qmi_service_get_string (ctx->qmi_services[ctx->qmi_service_index]), + error->message); + g_error_free (error); + } + + ctx->qmi_service_index++; + allocate_next_qmi_client (task); +} + +static void +allocate_next_qmi_client (GTask *task) +{ + InitializationStartedContext *ctx; + MMBroadbandModemMbim *self; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + if (ctx->qmi_services[ctx->qmi_service_index] == QMI_SERVICE_UNKNOWN) { + parent_initialization_started (task); + return; + } + + /* Otherwise, allocate next client */ + mm_port_mbim_allocate_qmi_client (ctx->mbim, + ctx->qmi_services[ctx->qmi_service_index], + NULL, + (GAsyncReadyCallback)mbim_port_allocate_qmi_client_ready, + task); +} + +#endif + +static void +query_device_services_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + MbimDeviceServiceElement **device_services; + guint32 device_services_count; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (response && + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && + mbim_message_device_services_response_parse ( + response, + &device_services_count, + NULL, /* max_dss_sessions */ + &device_services, + &error)) { + guint32 i; + + for (i = 0; i < device_services_count; i++) { + MbimService service; + guint32 j; + + service = mbim_uuid_to_service (&device_services[i]->device_service_id); + + switch (service) { + case MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS: + for (j = 0; j < device_services[i]->cids_count; j++) { + if (device_services[i]->cids[j] == MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO) { + mm_dbg ("PCO is supported"); + self->priv->is_pco_supported = TRUE; + } else if (device_services[i]->cids[j] == MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS) { + mm_dbg ("LTE attach status is supported"); + self->priv->is_lte_attach_status_supported = TRUE; + } + } + break; + case MBIM_SERVICE_USSD: + for (j = 0; j < device_services[i]->cids_count; j++) { + if (device_services[i]->cids[j] == MBIM_CID_USSD) { + mm_dbg ("USSD is supported"); + self->priv->is_ussd_supported = TRUE; + break; + } + } + break; + case MBIM_SERVICE_ATDS: + for (j = 0; j < device_services[i]->cids_count; j++) { + if (device_services[i]->cids[j] == MBIM_CID_ATDS_LOCATION) { + mm_dbg ("ATDS location is supported"); + self->priv->is_atds_location_supported = TRUE; + } else if (device_services[i]->cids[j] == MBIM_CID_ATDS_SIGNAL) { + mm_dbg ("ATDS signal is supported"); + self->priv->is_atds_signal_supported = TRUE; + } + } + break; + default: + break; + } + } + mbim_device_service_element_array_free (device_services); + } else { + /* Ignore error */ + mm_warn ("Couldn't query device services: %s", error->message); + g_error_free (error); + } + + if (response) + mbim_message_unref (response); + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + allocate_next_qmi_client (task); +#else + parent_initialization_started (task); +#endif +} + +static void +query_device_services (GTask *task) +{ + InitializationStartedContext *ctx; + MbimMessage *message; + MbimDevice *device; + + ctx = g_task_get_task_data (task); + device = mm_port_mbim_peek_device (ctx->mbim); + g_assert (device); + + mm_dbg ("querying device services..."); + message = mbim_message_device_services_query_new (NULL); + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)query_device_services_ready, + task); + mbim_message_unref (message); +} + +static void +mbim_device_removed_cb (MbimDevice *device, + MMBroadbandModemMbim *self) +{ + /* We have to do a full re-probe here because simply reopening the device + * and restarting mbim-proxy will leave us without MBIM notifications. */ + mm_info ("Connection to mbim-proxy for %s lost, reprobing", + mbim_device_get_path_display (device)); + + g_signal_handler_disconnect (device, + self->priv->mbim_device_removed_id); + self->priv->mbim_device_removed_id = 0; + + mm_base_modem_set_reprobe (MM_BASE_MODEM (self), TRUE); + mm_base_modem_set_valid (MM_BASE_MODEM (self), FALSE); +} + +static void +track_mbim_device_removed (MMBroadbandModemMbim *self, + MMPortMbim *mbim) +{ + MbimDevice *device; + + device = mm_port_mbim_peek_device (mbim); + g_assert (device); + + /* Register removal handler so we can handle mbim-proxy crashes */ + self->priv->mbim_device_removed_id = g_signal_connect ( + device, + MBIM_DEVICE_SIGNAL_REMOVED, + G_CALLBACK (mbim_device_removed_cb), + self); +} + +static void +untrack_mbim_device_removed (MMBroadbandModemMbim *self, + MMPortMbim *mbim) +{ + MbimDevice *device; + + if (self->priv->mbim_device_removed_id == 0) + return; + + device = mm_port_mbim_peek_device (mbim); + if (!device) + return; + + g_signal_handler_disconnect (device, self->priv->mbim_device_removed_id); + self->priv->mbim_device_removed_id = 0; +} + +static void +mbim_port_open_ready (MMPortMbim *mbim, GAsyncResult *res, - InitializationStartedContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_port_mbim_open_finish (mbim, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - initialization_started_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - /* Done we are, launch parent's callback */ - parent_initialization_started (ctx); + /* Make sure we know if mbim-proxy dies on us, and then do the parent's + * initialization */ + track_mbim_device_removed (MM_BROADBAND_MODEM_MBIM (g_task_get_source_object (task)), mbim); + query_device_services (task); } static void -initialization_started (MMBroadbandModem *self, - GAsyncReadyCallback callback, - gpointer user_data) +initialization_started (MMBroadbandModem *self, + GAsyncReadyCallback callback, + gpointer user_data) { InitializationStartedContext *ctx; + GTask *task; ctx = g_slice_new0 (InitializationStartedContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - initialization_started); ctx->mbim = mm_base_modem_get_port_mbim (MM_BASE_MODEM (self)); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_started_context_free); + /* This may happen if we unplug the modem unexpectedly */ if (!ctx->mbim) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot initialize: MBIM port went missing"); - initialization_started_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot initialize: MBIM port went missing"); + g_object_unref (task); return; } if (mm_port_mbim_is_open (ctx->mbim)) { - /* Nothing to be done, just launch parent's callback */ - parent_initialization_started (ctx); + /* Nothing to be done, just connect to a signal and launch parent's + * callback */ + track_mbim_device_removed (MM_BROADBAND_MODEM_MBIM (self), ctx->mbim); + query_device_services (task); return; } +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + /* Setup services to open */ + ctx->qmi_services[0] = QMI_SERVICE_DMS; + ctx->qmi_services[1] = QMI_SERVICE_NAS; + ctx->qmi_services[2] = QMI_SERVICE_PDS; + ctx->qmi_services[3] = QMI_SERVICE_LOC; + ctx->qmi_services[4] = QMI_SERVICE_UNKNOWN; +#endif + /* Now open our MBIM port */ mm_port_mbim_open (ctx->mbim, +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + TRUE, /* With QMI over MBIM support if available */ +#endif NULL, (GAsyncReadyCallback)mbim_port_open_ready, - ctx); + task); } /*****************************************************************************/ @@ -1688,10 +2214,7 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -1700,24 +2223,19 @@ gpointer user_data) { MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_imei); + GTask *task; + task = g_task_new (self, NULL, callback, user_data); if (self->priv->caps_device_id) - g_simple_async_result_set_op_res_gpointer (result, - self->priv->caps_device_id, - NULL); + g_task_return_pointer (task, + g_strdup (self->priv->caps_device_id), + g_free); else - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device doesn't report a valid IMEI"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device doesn't report a valid IMEI"); + g_object_unref (task); } /*****************************************************************************/ @@ -1728,17 +2246,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_3GPP_FACILITY_NONE; + GError *inner_error = NULL; + gssize value; - return ((MMModem3gppFacility) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_3GPP_FACILITY_NONE; + } + return (MMModem3gppFacility)value; } static void pin_list_query_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -1801,16 +2323,14 @@ mask |= MM_MODEM_3GPP_FACILITY_CORP_PERS; mbim_pin_desc_free (pin_desc_corporate_pin); - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (mask), - NULL); + g_task_return_int (task, mask); } else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -1818,17 +2338,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_enabled_facility_locks); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_pin_list_query_new (NULL); mbim_device_command (device, @@ -1836,7 +2353,407 @@ 10, NULL, (GAsyncReadyCallback)pin_list_query_ready, - result); + task); + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Initial EPS bearer info loading */ + +static MMBearerProperties * +modem_3gpp_load_initial_eps_bearer_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return MM_BEARER_PROPERTIES (g_task_propagate_pointer (G_TASK (res), error)); +} + +static MMBearerProperties * +common_process_lte_attach_status (MMBroadbandModemMbim *self, + MbimLteAttachStatus *status, + GError **error) +{ + MMBearerProperties *properties; + MMBearerIpFamily ip_family; + MMBearerAllowedAuth auth; + + /* Remove LTE attach bearer info */ + if (status->lte_attach_state == MBIM_LTE_ATTACH_STATE_DETACHED) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, "Not attached to LTE"); + return NULL; + } + + properties = mm_bearer_properties_new (); + if (status->access_string) + mm_bearer_properties_set_apn (properties, status->access_string); + if (status->user_name) + mm_bearer_properties_set_user (properties, status->user_name); + if (status->password) + mm_bearer_properties_set_password (properties, status->password); + + ip_family = mm_bearer_ip_family_from_mbim_context_ip_type (status->ip_type); + if (ip_family != MM_BEARER_IP_FAMILY_NONE) + mm_bearer_properties_set_ip_type (properties, ip_family); + + auth = mm_bearer_allowed_auth_from_mbim_auth_protocol (status->auth_protocol); + if (auth != MM_BEARER_ALLOWED_AUTH_UNKNOWN) + mm_bearer_properties_set_allowed_auth (properties, auth); + + /* note: we don't expose compression settings */ + + return properties; +} + +static void +lte_attach_status_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + MbimLteAttachStatus *status = NULL; + MMBearerProperties *properties; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_ms_basic_connect_extensions_lte_attach_status_response_parse ( + response, + &status, + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + properties = common_process_lte_attach_status (self, status, &error); + mbim_lte_attach_status_free (status); + + g_assert (properties || error); + if (properties) + g_task_return_pointer (task, properties, g_object_unref); + else + g_task_return_error (task, error); + g_object_unref (task); + + out: + if (response) + mbim_message_unref (response); +} + +static void +modem_3gpp_load_initial_eps_bearer (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MbimDevice *device; + MbimMessage *message; + GTask *task; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + message = mbim_message_ms_basic_connect_extensions_lte_attach_status_query_new (NULL); + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)lte_attach_status_query_ready, + task); + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Initial EPS bearer settings loading */ + +static MMBearerProperties * +modem_3gpp_load_initial_eps_bearer_settings_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return MM_BEARER_PROPERTIES (g_task_propagate_pointer (G_TASK (res), error)); +} + +static MMBearerProperties * +common_process_lte_attach_configuration (MMBroadbandModemMbim *self, + MbimLteAttachConfiguration *config, + GError **error) +{ + MMBearerProperties *properties; + MMBearerIpFamily ip_family = MM_BEARER_IP_FAMILY_NONE; + MMBearerAllowedAuth auth; + + properties = mm_bearer_properties_new (); + if (config->access_string) + mm_bearer_properties_set_apn (properties, config->access_string); + if (config->user_name) + mm_bearer_properties_set_user (properties, config->user_name); + if (config->password) + mm_bearer_properties_set_password (properties, config->password); + + ip_family = mm_bearer_ip_family_from_mbim_context_ip_type (config->ip_type); + if (ip_family != MM_BEARER_IP_FAMILY_NONE) + mm_bearer_properties_set_ip_type (properties, ip_family); + + auth = mm_bearer_allowed_auth_from_mbim_auth_protocol (config->auth_protocol); + if (auth != MM_BEARER_ALLOWED_AUTH_UNKNOWN) + mm_bearer_properties_set_allowed_auth (properties, auth); + + /* note: we don't expose compression settings or the configuration source details */ + + return properties; +} + +static void +lte_attach_configuration_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + MMBearerProperties *properties = NULL; + guint32 n_configurations = 0; + MbimLteAttachConfiguration **configurations = NULL; + guint i; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_ms_basic_connect_extensions_lte_attach_configuration_response_parse ( + response, + &n_configurations, + &configurations, + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + /* We should always receive 3 configurations but the MBIM API doesn't force + * that so we'll just assume we don't get always the same fixed number */ + for (i = 0; i < n_configurations; i++) { + /* We only support configuring the HOME settings */ + if (configurations[i]->roaming != MBIM_LTE_ATTACH_CONTEXT_ROAMING_CONTROL_HOME) + continue; + properties = common_process_lte_attach_configuration (self, configurations[i], &error); + break; + } + mbim_lte_attach_configuration_array_free (configurations); + + if (!properties && !error) + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "Couldn't find home network LTE attach settings"); + + g_assert (properties || error); + if (properties) + g_task_return_pointer (task, properties, g_object_unref); + else + g_task_return_error (task, error); + g_object_unref (task); + + out: + if (response) + mbim_message_unref (response); +} + +static void +modem_3gpp_load_initial_eps_bearer_settings (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MbimDevice *device; + MbimMessage *message; + GTask *task; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + message = mbim_message_ms_basic_connect_extensions_lte_attach_configuration_query_new (NULL); + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)lte_attach_configuration_query_ready, + task); + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Set initial EPS bearer settings + * + * The logic to set the EPS bearer settings requires us to first load the current + * settings from the module, because we are only going to change the settings + * associated to the HOME slot, we will leave untouched the PARTNER and NON-PARTNER + * slots. + */ + +static gboolean +modem_3gpp_set_initial_eps_bearer_settings_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +set_lte_attach_configuration_set_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + if (response) + mbim_message_unref (response); +} + +static void +before_set_lte_attach_configuration_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *request; + MbimMessage *response; + GError *error = NULL; + MMBearerProperties *config; + guint32 n_configurations = 0; + MbimLteAttachConfiguration **configurations = NULL; + guint i; + + self = g_task_get_source_object (task); + config = g_task_get_task_data (task); + + response = mbim_device_command_finish (device, res, &error); + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_ms_basic_connect_extensions_lte_attach_configuration_response_parse ( + response, + &n_configurations, + &configurations, + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + /* We should always receive 3 configurations but the MBIM API doesn't force + * that so we'll just assume we don't get always the same fixed number */ + for (i = 0; i < n_configurations; i++) { + MMBearerIpFamily ip_family; + MMBearerAllowedAuth auth; + + /* We only support configuring the HOME settings */ + if (configurations[i]->roaming != MBIM_LTE_ATTACH_CONTEXT_ROAMING_CONTROL_HOME) + continue; + + ip_family = mm_bearer_properties_get_ip_type (config); + if (ip_family == MM_BEARER_IP_FAMILY_NONE || ip_family == MM_BEARER_IP_FAMILY_ANY) + configurations[i]->ip_type = MBIM_CONTEXT_IP_TYPE_DEFAULT; + else { + configurations[i]->ip_type = mm_bearer_ip_family_to_mbim_context_ip_type (ip_family, &error); + if (error) { + configurations[i]->ip_type = MBIM_CONTEXT_IP_TYPE_DEFAULT; + mm_warn ("unexpected IP type settings requested: %s", error->message); + g_clear_error (&error); + } + } + + auth = mm_bearer_properties_get_allowed_auth (config); + if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) + configurations[i]->auth_protocol = MBIM_AUTH_PROTOCOL_NONE; + else { + configurations[i]->auth_protocol = mm_bearer_allowed_auth_to_mbim_auth_protocol (auth, &error); + if (error) { + configurations[i]->auth_protocol = MBIM_AUTH_PROTOCOL_NONE; + mm_warn ("unexpected auth settings requested: %s", error->message); + g_clear_error (&error); + } + } + + g_clear_pointer (&(configurations[i]->access_string), g_free); + configurations[i]->access_string = g_strdup (mm_bearer_properties_get_apn (config)); + + g_clear_pointer (&(configurations[i]->user_name), g_free); + configurations[i]->user_name = g_strdup (mm_bearer_properties_get_user (config)); + + g_clear_pointer (&(configurations[i]->password), g_free); + configurations[i]->password = g_strdup (mm_bearer_properties_get_user (config)); + + configurations[i]->source = MBIM_CONTEXT_SOURCE_USER; + configurations[i]->compression = MBIM_COMPRESSION_NONE; + break; + } + + request = mbim_message_ms_basic_connect_extensions_lte_attach_configuration_set_new ( + MBIM_LTE_ATTACH_CONTEXT_OPERATION_DEFAULT, + n_configurations, + (const MbimLteAttachConfiguration *const *)configurations, + &error); + if (!request) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + mbim_device_command (device, + request, + 10, + NULL, + (GAsyncReadyCallback)set_lte_attach_configuration_set_ready, + task); + mbim_message_unref (request); + + out: + if (configurations) + mbim_lte_attach_configuration_array_free (configurations); + + if (response) + mbim_message_unref (response); +} + +static void +modem_3gpp_set_initial_eps_bearer_settings (MMIfaceModem3gpp *self, + MMBearerProperties *config, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MbimDevice *device; + MbimMessage *message; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, g_object_ref (config), g_object_unref); + + message = mbim_message_ms_basic_connect_extensions_lte_attach_configuration_query_new (NULL); + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)before_set_lte_attach_configuration_query_ready, + task); mbim_message_unref (message); } @@ -1908,14 +2825,8 @@ self->priv->current_operator_name = operator_name_take; } } else { - if (self->priv->current_operator_id) { - g_free (self->priv->current_operator_id); - self->priv->current_operator_id = NULL; - } - if (self->priv->current_operator_name) { - g_free (self->priv->current_operator_name); - self->priv->current_operator_name = NULL; - } + g_clear_pointer (&self->priv->current_operator_id, g_free); + g_clear_pointer (&self->priv->current_operator_name, g_free); g_free (operator_id_take); g_free (operator_name_take); } @@ -2038,8 +2949,16 @@ if (ready_state == MBIM_SUBSCRIBER_READY_STATE_INITIALIZED) mm_iface_modem_update_own_numbers (MM_IFACE_MODEM (self), telephone_numbers); - /* TODO: handle SIM removal using MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED */ + if ((self->priv->last_ready_state != MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED && + ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED) || + (self->priv->last_ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED && + ready_state != MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED)) { + /* SIM has been removed or reinserted, re-probe to ensure correct interfaces are exposed */ + mm_dbg ("SIM hot swap detected"); + mm_broadband_modem_update_sim_hot_swap_detected (MM_BROADBAND_MODEM (self)); + } + self->priv->last_ready_state = ready_state; g_strfreev (telephone_numbers); } @@ -2063,8 +2982,8 @@ } str = mbim_data_class_build_string_from_mask (highest_available_data_class); - mm_dbg("Packet service state: '%s', data class: '%s'", - mbim_packet_service_state_get_string(packet_service_state), str); + mm_dbg ("Packet service state: '%s', data class: '%s'", + mbim_packet_service_state_get_string (packet_service_state), str); g_free (str); if (packet_service_state == MBIM_PACKET_SERVICE_STATE_ATTACHED) { @@ -2080,8 +2999,8 @@ const MbimSmsPduReadRecord *pdu); static void -sms_notification_read_sms (MMBroadbandModemMbim *self, - MbimMessage *notification) +sms_notification_read_flash_sms (MMBroadbandModemMbim *self, + MbimMessage *notification) { MbimSmsFormat format; guint32 messages_count; @@ -2176,8 +3095,8 @@ } static void -sms_notification_read_alert_sms (MMBroadbandModemMbim *self, - guint32 index) +sms_notification_read_stored_sms (MMBroadbandModemMbim *self, + guint32 index) { MMPortMbim *port; MbimDevice *device; @@ -2190,7 +3109,7 @@ if (!device) return; - mm_dbg ("Reading flash SMS at index '%u'", index); + mm_dbg ("Reading new SMS at index '%u'", index); message = mbim_message_sms_read_query_new (MBIM_SMS_FORMAT_PDU, MBIM_SMS_FLAG_INDEX, index, @@ -2210,24 +3129,24 @@ { switch (mbim_message_indicate_status_get_cid (notification)) { case MBIM_CID_SMS_READ: + /* New flash/alert message? */ if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ) - sms_notification_read_sms (self, notification); + sms_notification_read_flash_sms (self, notification); break; case MBIM_CID_SMS_MESSAGE_STORE_STATUS: { MbimSmsStatusFlag flag; guint32 index; - /* New flash/alert message? */ if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ && mbim_message_sms_message_store_status_notification_parse ( notification, &flag, &index, NULL)) { - mm_dbg ("Received flash message: '%s'", mbim_sms_status_flag_get_string (flag)); + mm_dbg ("Received SMS store status update: '%s'", mbim_sms_status_flag_get_string (flag)); if (flag == MBIM_SMS_STATUS_FLAG_NEW_MESSAGE) - sms_notification_read_alert_sms (self, index); + sms_notification_read_stored_sms (self, index); } break; } @@ -2239,6 +3158,110 @@ } static void +ms_basic_connect_extensions_notification_pco (MMBroadbandModemMbim *self, + MbimMessage *notification) +{ + MbimPcoValue *pco_value; + GError *error = NULL; + gchar *pco_data_hex; + MMPco *pco; + + if (!mbim_message_ms_basic_connect_extensions_pco_notification_parse ( + notification, + &pco_value, + &error)) { + mm_warn ("Couldn't parse PCO notification: %s", error->message); + g_error_free (error); + return; + } + + pco_data_hex = mm_utils_bin2hexstr (pco_value->pco_data_buffer, + pco_value->pco_data_size); + mm_dbg ("Received PCO: session ID=%u type=%s size=%u data=%s", + pco_value->session_id, + mbim_pco_type_get_string (pco_value->pco_data_type), + pco_value->pco_data_size, + pco_data_hex); + g_free (pco_data_hex); + + pco = mm_pco_new (); + mm_pco_set_session_id (pco, pco_value->session_id); + mm_pco_set_complete (pco, + pco_value->pco_data_type == MBIM_PCO_TYPE_COMPLETE); + mm_pco_set_data (pco, + pco_value->pco_data_buffer, + pco_value->pco_data_size); + + self->priv->pco_list = mm_pco_list_add (self->priv->pco_list, pco); + mm_iface_modem_3gpp_update_pco_list (MM_IFACE_MODEM_3GPP (self), + self->priv->pco_list); + g_object_unref (pco); + mbim_pco_value_free (pco_value); +} + +static void +ms_basic_connect_extensions_notification_lte_attach_status (MMBroadbandModemMbim *self, + MbimMessage *notification) +{ + GError *error = NULL; + MbimLteAttachStatus *status; + MMBearerProperties *properties; + + if (!mbim_message_ms_basic_connect_extensions_lte_attach_status_notification_parse ( + notification, + &status, + &error)) { + mm_warn ("Couldn't parse LTE attach status notification: %s", error->message); + g_error_free (error); + return; + } + + properties = common_process_lte_attach_status (self, status, NULL); + mm_iface_modem_3gpp_update_initial_eps_bearer (MM_IFACE_MODEM_3GPP (self), properties); + g_clear_object (&properties); + + mbim_lte_attach_status_free (status); +} + +static void +ms_basic_connect_extensions_notification (MMBroadbandModemMbim *self, + MbimMessage *notification) +{ + switch (mbim_message_indicate_status_get_cid (notification)) { + case MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO: + if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_PCO) + ms_basic_connect_extensions_notification_pco (self, notification); + break; + case MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS: + if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS) + ms_basic_connect_extensions_notification_lte_attach_status (self, notification); + break; + default: + /* Ignore */ + break; + } +} + +static void +process_ussd_notification (MMBroadbandModemMbim *self, + MbimMessage *notification); + +static void +ussd_notification (MMBroadbandModemMbim *self, + MbimMessage *notification) +{ + if (mbim_message_indicate_status_get_cid (notification) != MBIM_CID_USSD) { + mm_warn ("unexpected USSD notification (cid %u)", mbim_message_indicate_status_get_cid (notification)); + return; + } + + if (!(self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_USSD)) + return; + + process_ussd_notification (self, notification); +} + +static void device_notification_cb (MbimDevice *device, MbimMessage *notification, MMBroadbandModemMbim *self) @@ -2255,47 +3278,39 @@ case MBIM_SERVICE_BASIC_CONNECT: basic_connect_notification (self, notification); break; + case MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS: + ms_basic_connect_extensions_notification (self, notification); + break; case MBIM_SERVICE_SMS: sms_notification (self, notification); break; + case MBIM_SERVICE_USSD: + ussd_notification (self, notification); + break; default: /* Ignore */ break; } } -static gboolean -common_setup_cleanup_unsolicited_events_finish (MMBroadbandModemMbim *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - static void -common_setup_cleanup_unsolicited_events (MMBroadbandModemMbim *self, - gboolean setup, - GAsyncReadyCallback callback, - gpointer user_data) +common_setup_cleanup_unsolicited_events_sync (MMBroadbandModemMbim *self, + MbimDevice *device, + gboolean setup) { - MbimDevice *device; - GSimpleAsyncResult *result; - - if (!peek_device (self, &device, callback, user_data)) + if (!device) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_setup_cleanup_unsolicited_events); - - mm_dbg ("Supported notifications: signal (%s), registration (%s), sms (%s), connect (%s), subscriber (%s), packet (%s)", + mm_dbg ("Supported notifications: signal (%s), registration (%s), sms (%s), connect (%s), subscriber (%s), packet (%s), pco (%s), ussd (%s), lte attach status (%s)", self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY ? "yes" : "no", self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES ? "yes" : "no", self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ ? "yes" : "no", self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_CONNECT ? "yes" : "no", self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO ? "yes" : "no", - self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE ? "yes" : "no"); + self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE ? "yes" : "no", + self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_PCO ? "yes" : "no", + self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_USSD ? "yes" : "no", + self->priv->setup_flags & MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS ? "yes" : "no"); if (setup) { /* Don't re-enable it if already there */ @@ -2314,9 +3329,33 @@ self->priv->notification_id = 0; } } +} - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); +static gboolean +common_setup_cleanup_unsolicited_events_finish (MMBroadbandModemMbim *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +common_setup_cleanup_unsolicited_events (MMBroadbandModemMbim *self, + gboolean setup, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + MbimDevice *device; + + if (!peek_device (self, &device, callback, user_data)) + return; + + common_setup_cleanup_unsolicited_events_sync (self, device, setup); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -2331,48 +3370,70 @@ } static void -cleanup_unsolicited_events_3gpp (MMIfaceModem3gpp *self, +cleanup_unsolicited_events_3gpp (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_CONNECT; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), FALSE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + gboolean is_sim_hot_swap_configured = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, &is_sim_hot_swap_configured, + NULL); + + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_CONNECT; + if (is_sim_hot_swap_configured) + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; + if (self->priv->is_pco_supported) + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_PCO; + if (self->priv->is_lte_attach_status_supported) + self->priv->setup_flags &= PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS; + common_setup_cleanup_unsolicited_events (self, FALSE, callback, user_data); } static void -setup_unsolicited_events_3gpp (MMIfaceModem3gpp *self, +setup_unsolicited_events_3gpp (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_CONNECT; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), TRUE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_CONNECT; + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; + if (self->priv->is_pco_supported) + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_PCO; + if (self->priv->is_lte_attach_status_supported) + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS; + common_setup_cleanup_unsolicited_events (self, TRUE, callback, user_data); } /*****************************************************************************/ /* Cleanup/Setup unsolicited registration events */ static void -cleanup_unsolicited_registration_events (MMIfaceModem3gpp *self, +cleanup_unsolicited_registration_events (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), FALSE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; + common_setup_cleanup_unsolicited_events (self, FALSE, callback, user_data); } static void -setup_unsolicited_registration_events (MMIfaceModem3gpp *self, +setup_unsolicited_registration_events (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), TRUE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; + common_setup_cleanup_unsolicited_events (self, TRUE, callback, user_data); } /*****************************************************************************/ @@ -2383,30 +3444,28 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void subscribe_list_set_ready_cb (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; response = mbim_device_command_finish (device, res, &error); - if (response) + if (response) { mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + mbim_message_unref (response); + } if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - - if (response) - mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -2416,27 +3475,25 @@ { MbimMessage *request; MbimDevice *device; - GSimpleAsyncResult *result; MbimEventEntry **entries; guint n_entries = 0; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_enable_disable_unsolicited_events); - - mm_dbg ("Enabled notifications: signal (%s), registration (%s), sms (%s), connect (%s), subscriber (%s), packet (%s)", + mm_dbg ("Enabled notifications: signal (%s), registration (%s), sms (%s), connect (%s), subscriber (%s), packet (%s), pco (%s), ussd (%s), lte attach status (%s)", self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY ? "yes" : "no", self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES ? "yes" : "no", self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ ? "yes" : "no", self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_CONNECT ? "yes" : "no", self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO ? "yes" : "no", - self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE ? "yes" : "no"); + self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE ? "yes" : "no", + self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PCO ? "yes" : "no", + self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_USSD ? "yes" : "no", + self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS ? "yes" : "no"); - entries = g_new0 (MbimEventEntry *, 3); + entries = g_new0 (MbimEventEntry *, 5); /* Basic connect service */ if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY || @@ -2461,6 +3518,20 @@ n_entries++; } + /* Basic connect extensions service */ + if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PCO || + self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS) { + entries[n_entries] = g_new (MbimEventEntry, 1); + memcpy (&(entries[n_entries]->device_service_id), MBIM_UUID_MS_BASIC_CONNECT_EXTENSIONS, sizeof (MbimUuid)); + entries[n_entries]->cids_count = 0; + entries[n_entries]->cids = g_new0 (guint32, 2); + if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_PCO) + entries[n_entries]->cids[entries[n_entries]->cids_count++] = MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_PCO; + if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS) + entries[n_entries]->cids[entries[n_entries]->cids_count++] = MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS; + n_entries++; + } + /* SMS service */ if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ) { entries[n_entries] = g_new (MbimEventEntry, 1); @@ -2472,6 +3543,18 @@ n_entries++; } + /* USSD service */ + if (self->priv->enable_flags & PROCESS_NOTIFICATION_FLAG_USSD) { + entries[n_entries] = g_new (MbimEventEntry, 1); + memcpy (&(entries[n_entries]->device_service_id), MBIM_UUID_USSD, sizeof (MbimUuid)); + entries[n_entries]->cids_count = 1; + entries[n_entries]->cids = g_new0 (guint32, 1); + entries[n_entries]->cids[0] = MBIM_CID_USSD; + n_entries++; + } + + task = g_task_new (self, NULL, callback, user_data); + request = (mbim_message_device_service_subscribe_list_set_new ( n_entries, (const MbimEventEntry *const *)entries, @@ -2481,7 +3564,7 @@ 10, NULL, (GAsyncReadyCallback)subscribe_list_set_ready_cb, - result); + task); mbim_message_unref (request); mbim_event_entry_array_free (entries); } @@ -2498,28 +3581,98 @@ } static void -modem_3gpp_disable_unsolicited_registration_events (MMIfaceModem3gpp *self, +modem_3gpp_disable_unsolicited_registration_events (MMIfaceModem3gpp *_self, gboolean cs_supported, gboolean ps_supported, gboolean eps_supported, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; + common_enable_disable_unsolicited_events (self, callback, user_data); } static void -modem_3gpp_enable_unsolicited_registration_events (MMIfaceModem3gpp *self, +modem_3gpp_enable_unsolicited_registration_events (MMIfaceModem3gpp *_self, gboolean cs_supported, gboolean ps_supported, gboolean eps_supported, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_REGISTRATION_UPDATES; + common_enable_disable_unsolicited_events (self, callback, user_data); +} + +/*****************************************************************************/ +/* Setup SIM hot swap */ + +static gboolean +modem_setup_sim_hot_swap_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +enable_subscriber_info_unsolicited_events_ready (MMBroadbandModemMbim *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!common_enable_disable_unsolicited_events_finish (self, res, &error)) { + mm_dbg ("Failed to enable subscriber info events: %s", error->message); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +setup_subscriber_info_unsolicited_events_ready (MMBroadbandModemMbim *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!common_setup_cleanup_unsolicited_events_finish (self, res, &error)) { + mm_dbg ("Failed to set up subscriber info events: %s", error->message); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + common_enable_disable_unsolicited_events (self, + (GAsyncReadyCallback)enable_subscriber_info_unsolicited_events_ready, + task); +} + +static void +modem_setup_sim_hot_swap (MMIfaceModem *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + common_setup_cleanup_unsolicited_events (self, + TRUE, + (GAsyncReadyCallback)setup_subscriber_info_unsolicited_events_ready, + task); } /*****************************************************************************/ @@ -2534,130 +3687,168 @@ } static void -modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *self, +modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_CONNECT; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + gboolean is_sim_hot_swap_configured = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, &is_sim_hot_swap_configured, + NULL); + + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_CONNECT; + if (is_sim_hot_swap_configured) + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; + if (self->priv->is_pco_supported) + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_PCO; + if (self->priv->is_lte_attach_status_supported) + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS; + common_enable_disable_unsolicited_events (self, callback, user_data); } static void -modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, +modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_CONNECT; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SIGNAL_QUALITY; + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_CONNECT; + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO; + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_PACKET_SERVICE; + if (self->priv->is_pco_supported) + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_PCO; + if (self->priv->is_lte_attach_status_supported) + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_LTE_ATTACH_STATUS; + common_enable_disable_unsolicited_events (self, callback, user_data); } /*****************************************************************************/ /* Load operator name (3GPP interface) */ static gchar * -modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *_self, +modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); - - if (self->priv->current_operator_name) - return g_strdup (self->priv->current_operator_name); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Current operator name is still unknown"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_3gpp_load_operator_name (MMIfaceModem3gpp *self, +modem_3gpp_load_operator_name (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; - /* Just finish the async operation */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_operator_name); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->current_operator_name) + g_task_return_pointer (task, + g_strdup (self->priv->current_operator_name), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Current operator name is still unknown"); + g_object_unref (task); } /*****************************************************************************/ /* Load operator code (3GPP interface) */ static gchar * -modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *_self, +modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); - - if (self->priv->current_operator_id) - return g_strdup (self->priv->current_operator_id); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Current operator MCC/MNC is still unknown"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_3gpp_load_operator_code (MMIfaceModem3gpp *self, +modem_3gpp_load_operator_code (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + GTask *task; - /* Just finish the async operation */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_operator_code); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->current_operator_id) + g_task_return_pointer (task, + g_strdup (self->priv->current_operator_id), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Current operator MCC/MNC is still unknown"); + g_object_unref (task); } /*****************************************************************************/ /* Registration checks (3GPP interface) */ static gboolean -modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) +modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -register_state_query_ready (MbimDevice *device, +atds_location_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + guint32 lac; + guint32 tac; + guint32 cid; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_atds_location_response_parse (response, &lac, &tac, &cid, &error)) { + g_task_return_error (task, error); + } else { + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); + + if (response) + mbim_message_unref (response); +} + +static void +register_state_query_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { - MbimMessage *response; - GError *error = NULL; - MbimRegisterState register_state; - MbimDataClass available_data_classes; - gchar *provider_id; - gchar *provider_name; + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + MbimRegisterState register_state; + MbimDataClass available_data_classes; + gchar *provider_id; + gchar *provider_name; response = mbim_device_command_finish (device, res, &error); - if (response && - mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && - mbim_message_register_state_response_parse ( + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_register_state_response_parse ( response, NULL, /* nw_error */ ®ister_state, @@ -2668,46 +3859,58 @@ &provider_name, NULL, /* roaming_text */ NULL, /* registration_flag */ - NULL)) { - MMBroadbandModemMbim *self; + &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } - self = MM_BROADBAND_MODEM_MBIM (g_async_result_get_source_object (G_ASYNC_RESULT (simple))); - update_registration_info (self, - register_state, - available_data_classes, - provider_id, - provider_name); - g_object_unref (self); + self = g_task_get_source_object (task); + update_registration_info (self, + register_state, + available_data_classes, + provider_id, + provider_name); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } else - g_simple_async_result_take_error (simple, error); + if (self->priv->is_atds_location_supported) { + MbimMessage *message; + message = mbim_message_atds_location_query_new (NULL); + + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)atds_location_query_ready, + task); + mbim_message_unref (message); + goto out; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + out: if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void -modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self, - gboolean cs_supported, - gboolean ps_supported, - gboolean eps_supported, - GAsyncReadyCallback callback, - gpointer user_data) +modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self, + gboolean cs_supported, + gboolean ps_supported, + gboolean eps_supported, + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; - MbimDevice *device; + MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_run_registration_checks); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_register_state_query_new (NULL); mbim_device_command (device, @@ -2715,7 +3918,7 @@ 10, NULL, (GAsyncReadyCallback)register_state_query_ready, - result); + task); mbim_message_unref (message); } @@ -2726,13 +3929,18 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) + return mm_shared_qmi_3gpp_register_in_network_finish (self, res, error); +#endif + + return g_task_propagate_boolean (G_TASK (res), error); } static void register_state_set_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -2757,15 +3965,14 @@ error = mm_mobile_equipment_error_from_mbim_nw_error (nw_error); } - if (error) - g_simple_async_result_take_error (simple, error); - else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -2775,17 +3982,25 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + /* data_class set to 0 in the MBIM register state set message ends up + * selecting some "auto" mode that would overwrite whatever capabilities + * and modes we had set. So, if we're using QMI-based capability and + * mode switching, also use QMI-based network registration. */ + if (MM_BROADBAND_MODEM_MBIM (self)->priv->qmi_capability_and_mode_switching) { + mm_shared_qmi_3gpp_register_in_network (self, operator_id, cancellable, callback, user_data); + return; + } +#endif if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_register_in_network); + task = g_task_new (self, NULL, callback, user_data); if (operator_id && operator_id[0]) message = (mbim_message_register_state_set_new ( @@ -2804,7 +4019,7 @@ 60, NULL, (GAsyncReadyCallback)register_state_set_ready, - result); + task); mbim_message_unref (message); } @@ -2816,43 +4031,40 @@ GAsyncResult *res, GError **error) { + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +visible_providers_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ MbimMessage *response; MbimProvider **providers; guint n_providers; - GList *info_list = NULL; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; + GError *error = NULL; - response = (MbimMessage *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - if (mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, error) && + response = mbim_device_command_finish (device, res, &error); + if (response && + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && mbim_message_visible_providers_response_parse (response, &n_providers, &providers, - error)) { + &error)) { + GList *info_list; + info_list = mm_3gpp_network_info_list_from_mbim_providers ((const MbimProvider *const *)providers, n_providers); mbim_provider_array_free (providers); - } - return info_list; -} -static void -visible_providers_query_ready (MbimDevice *device, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - MbimMessage *response; - GError *error = NULL; + g_task_return_pointer (task, info_list, (GDestroyNotify)mm_3gpp_network_info_list_free); + } else + g_task_return_error (task, error); - response = mbim_device_command_finish (device, res, &error); - if (response) - g_simple_async_result_set_op_res_gpointer (simple, response, (GDestroyNotify)mbim_message_unref); - else - g_simple_async_result_take_error (simple, error); + g_object_unref (task); - g_simple_async_result_complete (simple); - g_object_unref (simple); + if (response) + mbim_message_unref (response); } static void @@ -2860,17 +4072,14 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_scan_networks); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("scanning networks..."); message = mbim_message_visible_providers_query_new (MBIM_VISIBLE_PROVIDERS_ACTION_FULL_SCAN, NULL); @@ -2879,7 +4088,800 @@ 300, NULL, (GAsyncReadyCallback)visible_providers_query_ready, - result); + task); + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Check support (Signal interface) */ + +static gboolean +modem_signal_check_support_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +parent_signal_check_support_ready (MMIfaceModemSignal *self, + GAsyncResult *res, + GTask *task) +{ + gboolean parent_supported; + + parent_supported = iface_modem_signal_parent->check_support_finish (self, res, NULL); + g_task_return_boolean (task, parent_supported); + g_object_unref (task); +} + +static void +modem_signal_check_support (MMIfaceModemSignal *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* If ATDS signal is supported, we support the Signal interface */ + if (MM_BROADBAND_MODEM_MBIM (self)->priv->is_atds_signal_supported) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Otherwise, check if the parent CESQ-based implementation works */ + g_assert (iface_modem_signal_parent->check_support && iface_modem_signal_parent->check_support_finish); + iface_modem_signal_parent->check_support (self, + (GAsyncReadyCallback)parent_signal_check_support_ready, + task); +} + +/*****************************************************************************/ +/* Load extended signal information (Signal interface) */ + +typedef struct { + MMSignal *gsm; + MMSignal *umts; + MMSignal *lte; +} SignalLoadValuesResult; + +static void +signal_load_values_result_free (SignalLoadValuesResult *result) +{ + g_clear_object (&result->gsm); + g_clear_object (&result->umts); + g_clear_object (&result->lte); + g_slice_free (SignalLoadValuesResult, result); +} + +static gboolean +modem_signal_load_values_finish (MMIfaceModemSignal *self, + GAsyncResult *res, + MMSignal **cdma, + MMSignal **evdo, + MMSignal **gsm, + MMSignal **umts, + MMSignal **lte, + GError **error) +{ + SignalLoadValuesResult *result; + + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) + return FALSE; + + if (gsm && result->gsm) { + *gsm = result->gsm; + result->gsm = NULL; + } + + if (umts && result->umts) { + *umts = result->umts; + result->umts = NULL; + } + + if (lte && result->lte) { + *lte = result->lte; + result->lte = NULL; + } + + signal_load_values_result_free (result); + + /* No 3GPP2 support */ + if (cdma) + *cdma = NULL; + if (evdo) + *evdo = NULL; + return TRUE; +} + +static void +atds_signal_query_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MbimMessage *response; + SignalLoadValuesResult *result; + GError *error = NULL; + guint32 rssi; + guint32 error_rate; + guint32 rscp; + guint32 ecno; + guint32 rsrq; + guint32 rsrp; + guint32 snr; + + response = mbim_device_command_finish (device, res, &error); + if (!response || + !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) || + !mbim_message_atds_signal_response_parse (response, &rssi, &error_rate, &rscp, &ecno, &rsrq, &rsrp, &snr, &error)) { + g_task_return_error (task, error); + goto out; + } + + result = g_slice_new0 (SignalLoadValuesResult); + + if (rscp <= 96) { + result->umts = mm_signal_new (); + mm_signal_set_rscp (result->umts, -120.0 + rscp); + } + + if (ecno <= 49) { + if (!result->umts) + result->umts = mm_signal_new (); + mm_signal_set_ecio (result->umts, -24.0 + ((float) ecno / 2)); + } + + if (rsrq <= 34) { + result->lte = mm_signal_new (); + mm_signal_set_rsrq (result->lte, -19.5 + ((float) rsrq / 2)); + } + + if (rsrp <= 97) { + if (!result->lte) + result->lte = mm_signal_new (); + mm_signal_set_rsrp (result->lte, -140.0 + rsrp); + } + + if (snr <= 35) { + if (!result->lte) + result->lte = mm_signal_new (); + mm_signal_set_snr (result->lte, -5.0 + snr); + } + + /* RSSI may be given for all 2G, 3G or 4G so we detect to which one applies */ + if (rssi <= 31) { + gdouble value; + + value = -113.0 + (2 * rssi); + if (result->lte) + mm_signal_set_rssi (result->lte, value); + else if (result->umts) + mm_signal_set_rssi (result->umts, value); + else { + result->gsm = mm_signal_new (); + mm_signal_set_rssi (result->gsm, value); + } + } + + if (!result->gsm && !result->umts && !result->lte) { + signal_load_values_result_free (result); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No signal details given"); + goto out; + } + + g_task_return_pointer (task, result, (GDestroyNotify) signal_load_values_result_free); + +out: + if (response) + mbim_message_unref (response); + g_object_unref (task); +} + +static void +parent_signal_load_values_ready (MMIfaceModemSignal *self, + GAsyncResult *res, + GTask *task) +{ + SignalLoadValuesResult *result; + GError *error = NULL; + + result = g_slice_new0 (SignalLoadValuesResult); + if (!iface_modem_signal_parent->load_values_finish (self, res, + NULL, NULL, + &result->gsm, &result->umts, &result->lte, + &error)) { + signal_load_values_result_free (result); + g_task_return_error (task, error); + } else if (!result->gsm && !result->umts && !result->lte) { + signal_load_values_result_free (result); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No signal details given"); + } else + g_task_return_pointer (task, result, (GDestroyNotify) signal_load_values_result_free); + g_object_unref (task); +} + +static void +modem_signal_load_values (MMIfaceModemSignal *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MbimDevice *device; + MbimMessage *message; + GTask *task; + + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + if (MM_BROADBAND_MODEM_MBIM (self)->priv->is_atds_signal_supported) { + message = mbim_message_atds_signal_query_new (NULL); + mbim_device_command (device, + message, + 5, + NULL, + (GAsyncReadyCallback)atds_signal_query_ready, + task); + mbim_message_unref (message); + return; + } + + /* Fallback to parent CESQ based implementation */ + g_assert (iface_modem_signal_parent->load_values && iface_modem_signal_parent->load_values_finish); + iface_modem_signal_parent->load_values (self, + NULL, + (GAsyncReadyCallback)parent_signal_load_values_ready, + task); +} + +/*****************************************************************************/ +/* Check if USSD supported (3GPP/USSD interface) */ + +static gboolean +modem_3gpp_ussd_check_support_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +modem_3gpp_ussd_check_support (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, MM_BROADBAND_MODEM_MBIM (self)->priv->is_ussd_supported); + g_object_unref (task); +} + +/*****************************************************************************/ +/* USSD encoding/deconding helpers + * + * Note: we don't care about subclassing the ussd_encode/decode methods in the + * interface, as we're going to use this methods just here. + */ + +static GByteArray * +ussd_encode (const gchar *command, + guint32 *scheme, + GError **error) +{ + GByteArray *array; + + if (mm_charset_can_convert_to (command, MM_MODEM_CHARSET_GSM)) { + guint8 *gsm; + guint8 *packed; + guint32 len = 0; + guint32 packed_len = 0; + + *scheme = MM_MODEM_GSM_USSD_SCHEME_7BIT; + gsm = mm_charset_utf8_to_unpacked_gsm (command, &len); + if (!gsm) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Failed to encode USSD command in GSM7 charset"); + return NULL; + } + packed = mm_charset_gsm_pack (gsm, len, 0, &packed_len); + g_free (gsm); + + array = g_byte_array_new_take (packed, packed_len); + } else { + *scheme = MM_MODEM_GSM_USSD_SCHEME_UCS2; + array = g_byte_array_sized_new (strlen (command) * 2); + if (!mm_modem_charset_byte_array_append (array, command, FALSE, MM_MODEM_CHARSET_UCS2)) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Failed to encode USSD command in UCS2 charset"); + g_byte_array_unref (array); + return NULL; + } + } + + if (array->len > 160) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Failed to encode USSD command: encoded data too long (%u > 160)", array->len); + g_byte_array_unref (array); + return NULL; + } + + return array; +} + +static gchar * +ussd_decode (guint32 scheme, + GByteArray *data, + GError **error) +{ + gchar *decoded = NULL; + + if (scheme == MM_MODEM_GSM_USSD_SCHEME_7BIT) { + guint8 *unpacked; + guint32 unpacked_len; + + unpacked = mm_charset_gsm_unpack ((const guint8 *)data->data, (data->len * 8) / 7, 0, &unpacked_len); + decoded = (gchar *) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len); + if (!decoded) + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Error decoding USSD command in 0x%04x scheme (GSM7 charset)", + scheme); + } else if (scheme == MM_MODEM_GSM_USSD_SCHEME_UCS2) { + decoded = mm_modem_charset_byte_array_to_utf8 (data, MM_MODEM_CHARSET_UCS2); + if (!decoded) + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Error decoding USSD command in 0x%04x scheme (UCS2 charset)", + scheme); + } else + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Failed to decode USSD command in unsupported 0x%04x scheme", scheme); + + return decoded; +} + +/*****************************************************************************/ +/* USSD notifications */ + +static void +process_ussd_message (MMBroadbandModemMbim *self, + MbimUssdResponse ussd_response, + MbimUssdSessionState ussd_session_state, + guint32 scheme, + guint32 data_size, + const guint8 *data) +{ + GTask *task = NULL; + MMModem3gppUssdSessionState ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE; + GByteArray *bytearray = NULL; + gchar *converted = NULL; + GError *error = NULL; + + /* Steal task and balance out received reference */ + if (self->priv->pending_ussd_action) { + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; + } + + if (data_size) + bytearray = g_byte_array_append (g_byte_array_new (), data, data_size); + + switch (ussd_response) { + case MBIM_USSD_RESPONSE_NO_ACTION_REQUIRED: + /* no further action required */ + converted = ussd_decode (scheme, bytearray, &error); + if (!converted) + break; + + /* Response to the user's request? */ + if (task) + break; + + /* Network-initiated USSD-Notify */ + mm_iface_modem_3gpp_ussd_update_network_notification (MM_IFACE_MODEM_3GPP_USSD (self), converted); + g_clear_pointer (&converted, g_free); + break; + + case MBIM_USSD_RESPONSE_ACTION_REQUIRED: + /* further action required */ + ussd_state = MM_MODEM_3GPP_USSD_SESSION_STATE_USER_RESPONSE; + + converted = ussd_decode (scheme, bytearray, &error); + if (!converted) + break; + /* Response to the user's request? */ + if (task) + break; + + /* Network-initiated USSD-Request */ + mm_iface_modem_3gpp_ussd_update_network_request (MM_IFACE_MODEM_3GPP_USSD (self), converted); + g_clear_pointer (&converted, g_free); + break; + + case MBIM_USSD_RESPONSE_TERMINATED_BY_NETWORK: + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "USSD terminated by network"); + break; + + case MBIM_USSD_RESPONSE_OTHER_LOCAL_CLIENT: + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Another ongoing USSD operation is in progress"); + break; + + case MBIM_USSD_RESPONSE_OPERATION_NOT_SUPPORTED: + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Operation not supported"); + break; + + case MBIM_USSD_RESPONSE_NETWORK_TIMEOUT: + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Network timeout"); + break; + + default: + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Unknown USSD response (%u)", ussd_response); + break; + } + + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), ussd_state); + + if (bytearray) + g_byte_array_unref (bytearray); + + /* Complete the pending action */ + if (task) { + if (error) + g_task_return_error (task, error); + else if (converted) + g_task_return_pointer (task, converted, g_free); + else + g_assert_not_reached (); + return; + } + + /* If no pending task, just report the error */ + if (error) { + mm_dbg ("Network reported USSD message: %s", error->message); + g_error_free (error); + } + + g_assert (!converted); +} + +static void +process_ussd_notification (MMBroadbandModemMbim *self, + MbimMessage *notification) +{ + MbimUssdResponse ussd_response; + MbimUssdSessionState ussd_session_state; + guint32 scheme; + guint32 data_size; + const guint8 *data; + + if (mbim_message_ussd_notification_parse (notification, + &ussd_response, + &ussd_session_state, + &scheme, + &data_size, + &data, + NULL)) { + mm_dbg ("Received USSD indication: %s, session state: %s, scheme: 0x%x, data size: %u bytes", + mbim_ussd_response_get_string (ussd_response), + mbim_ussd_session_state_get_string (ussd_session_state), + scheme, + data_size); + process_ussd_message (self, ussd_response, ussd_session_state, scheme, data_size, data); + } +} + +/*****************************************************************************/ +/* Setup/Cleanup unsolicited result codes (3GPP/USSD interface) */ + +static gboolean +modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +common_setup_flag_ussd_ready (MMBroadbandModemMbim *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!common_setup_cleanup_unsolicited_events_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +common_setup_cleanup_unsolicited_ussd_events (MMBroadbandModemMbim *self, + gboolean setup, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GINT_TO_POINTER (setup), NULL); + + if (setup) + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_USSD; + else + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_USSD; + common_setup_cleanup_unsolicited_events (self, setup, (GAsyncReadyCallback)common_setup_flag_ussd_ready, task); +} + +static void +modem_3gpp_ussd_cleanup_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_setup_cleanup_unsolicited_ussd_events (MM_BROADBAND_MODEM_MBIM (self), FALSE, callback, user_data); +} + +static void +modem_3gpp_ussd_setup_unsolicited_events (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + common_setup_cleanup_unsolicited_ussd_events (MM_BROADBAND_MODEM_MBIM (self), TRUE, callback, user_data); +} + +/*****************************************************************************/ +/* Enable/Disable URCs (3GPP/USSD interface) */ + +static gboolean +modem_3gpp_ussd_enable_disable_unsolicited_events_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) +{ + return common_enable_disable_unsolicited_events_finish (MM_BROADBAND_MODEM_MBIM (self), res, error); +} + +static void +modem_3gpp_ussd_disable_unsolicited_events (MMIfaceModem3gppUssd *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_USSD; + common_enable_disable_unsolicited_events (self, callback, user_data); +} + +static void +modem_3gpp_ussd_enable_unsolicited_events (MMIfaceModem3gppUssd *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_USSD; + common_enable_disable_unsolicited_events (self, callback, user_data); +} + +/*****************************************************************************/ +/* Send command (3GPP/USSD interface) */ + +static gchar * +modem_3gpp_ussd_send_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +ussd_send_ready (MbimDevice *device, + GAsyncResult *res, + MMBroadbandModemMbim *self) +{ + MbimMessage *response; + GError *error = NULL; + MbimUssdResponse ussd_response; + MbimUssdSessionState ussd_session_state; + guint32 scheme; + guint32 data_size; + const guint8 *data; + + /* Note: if there is a cached task, it is ALWAYS completed here */ + + response = mbim_device_command_finish (device, res, &error); + if (response && + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && + mbim_message_ussd_response_parse (response, + &ussd_response, + &ussd_session_state, + &scheme, + &data_size, + &data, + &error)) { + mm_dbg ("Received USSD response: %s, session state: %s, scheme: 0x%x, data size: %u bytes", + mbim_ussd_response_get_string (ussd_response), + mbim_ussd_session_state_get_string (ussd_session_state), + scheme, + data_size); + process_ussd_message (self, ussd_response, ussd_session_state, scheme, data_size, data); + } else { + /* Report error in the cached task, if any */ + if (self->priv->pending_ussd_action) { + GTask *task; + + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; + g_task_return_error (task, error); + g_object_unref (task); + } else { + mm_dbg ("Failed to parse USSD response: %s", error->message); + g_clear_error (&error); + } + } + + if (response) + mbim_message_unref (response); + + /* Balance out received reference */ + g_object_unref (self); +} + +static void +modem_3gpp_ussd_send (MMIfaceModem3gppUssd *_self, + const gchar *command, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self; + MbimDevice *device; + GTask *task; + MbimUssdAction action; + MbimMessage *message; + GByteArray *encoded; + guint32 scheme = 0; + GError *error = NULL; + + self = MM_BROADBAND_MODEM_MBIM (_self); + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + /* Fail if there is an ongoing operation already */ + if (self->priv->pending_ussd_action) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, + "there is already an ongoing USSD operation"); + g_object_unref (task); + return; + } + + switch (mm_iface_modem_3gpp_ussd_get_state (MM_IFACE_MODEM_3GPP_USSD (self))) { + case MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE: + action = MBIM_USSD_ACTION_INITIATE; + break; + case MM_MODEM_3GPP_USSD_SESSION_STATE_USER_RESPONSE: + action = MBIM_USSD_ACTION_CONTINUE; + break; + default: + g_assert_not_reached (); + return; + } + + encoded = ussd_encode (command, &scheme, &error); + if (!encoded) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + message = mbim_message_ussd_set_new (action, scheme, encoded->len, encoded->data, &error); + if (!message) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Cache the action, as it may be completed via URCs */ + self->priv->pending_ussd_action = task; + mm_iface_modem_3gpp_ussd_update_state (_self, MM_MODEM_3GPP_USSD_SESSION_STATE_ACTIVE); + + mbim_device_command (device, + message, + 100, + NULL, + (GAsyncReadyCallback)ussd_send_ready, + g_object_ref (self)); /* Full reference! */ + mbim_message_unref (message); +} + +/*****************************************************************************/ +/* Cancel USSD (3GPP/USSD interface) */ + +static gboolean +modem_3gpp_ussd_cancel_finish (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +ussd_cancel_ready (MbimDevice *device, + GAsyncResult *res, + GTask *task) +{ + MMBroadbandModemMbim *self; + MbimMessage *response; + GError *error = NULL; + + self = g_task_get_source_object (task); + + response = mbim_device_command_finish (device, res, &error); + if (response) + mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + /* Complete the pending action, regardless of the operation result */ + if (self->priv->pending_ussd_action) { + GTask *task; + + task = self->priv->pending_ussd_action; + self->priv->pending_ussd_action = NULL; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, + "USSD session was cancelled"); + g_object_unref (task); + } + + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), + MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); + + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + if (response) + mbim_message_unref (response); +} + +static void +modem_3gpp_ussd_cancel (MMIfaceModem3gppUssd *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMBroadbandModemMbim *self; + MbimDevice *device; + GTask *task; + MbimMessage *message; + GError *error = NULL; + + self = MM_BROADBAND_MODEM_MBIM (_self); + if (!peek_device (self, &device, callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + message = mbim_message_ussd_set_new (MBIM_USSD_ACTION_CANCEL, 0, 0, NULL, &error); + if (!message) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + mbim_device_command (device, + message, + 10, + NULL, + (GAsyncReadyCallback)ussd_cancel_ready, + task); mbim_message_unref (message); } @@ -2891,8 +4893,7 @@ GAsyncResult *res, GError **error) { - /* no error expected here */ - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -2901,25 +4902,20 @@ gpointer user_data) { MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_check_support); + task = g_task_new (self, NULL, callback, user_data); /* We only handle 3GPP messaging (PDU based) currently */ if (self->priv->caps_sms & MBIM_SMS_CAPS_PDU_RECEIVE && self->priv->caps_sms & MBIM_SMS_CAPS_PDU_SEND) { mm_dbg ("Messaging capabilities supported"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); + g_task_return_boolean (task, TRUE); } else { mm_dbg ("Messaging capabilities not supported by this modem"); - g_simple_async_result_set_op_res_gboolean (result, FALSE); + g_task_return_boolean (task, FALSE); } - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ @@ -2948,40 +4944,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_load_supported_storages); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ /* Load initial SMS parts */ -typedef struct { - MMBroadbandModemMbim *self; - GSimpleAsyncResult *result; -} LoadInitialSmsPartsContext; - -static void -load_initial_sms_parts_context_complete_and_free (LoadInitialSmsPartsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadInitialSmsPartsContext, ctx); -} - static gboolean load_initial_sms_parts_finish (MMIfaceModemMessaging *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -3013,13 +4991,16 @@ static void sms_read_query_ready (MbimDevice *device, GAsyncResult *res, - LoadInitialSmsPartsContext *ctx) + GTask *task) { + MMBroadbandModemMbim *self; MbimMessage *response; GError *error = NULL; guint32 messages_count; MbimSmsPduReadRecord **pdu_messages; + self = g_task_get_source_object (task); + response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -3033,15 +5014,16 @@ guint i; for (i = 0; i < messages_count; i++) - add_sms_part (ctx->self, pdu_messages[i]); + add_sms_part (self, pdu_messages[i]); mbim_sms_pdu_read_record_array_free (pdu_messages); + g_task_return_boolean (task, TRUE); } else - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + + g_object_unref (task); if (response) mbim_message_unref (response); - - load_initial_sms_parts_context_complete_and_free (ctx); } static void @@ -3050,21 +5032,16 @@ GAsyncReadyCallback callback, gpointer user_data) { - LoadInitialSmsPartsContext *ctx; MbimDevice *device; MbimMessage *message; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; g_assert (storage == MM_SMS_STORAGE_MT); - ctx = g_slice_new0 (LoadInitialSmsPartsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_initial_sms_parts); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("loading SMS parts..."); message = mbim_message_sms_read_query_new (MBIM_SMS_FORMAT_PDU, @@ -3076,7 +5053,7 @@ 10, NULL, (GAsyncReadyCallback)sms_read_query_ready, - ctx); + task); mbim_message_unref (message); } @@ -3092,21 +5069,25 @@ } static void -cleanup_unsolicited_events_messaging (MMIfaceModemMessaging *self, +cleanup_unsolicited_events_messaging (MMIfaceModemMessaging *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SMS_READ; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), FALSE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->setup_flags &= ~PROCESS_NOTIFICATION_FLAG_SMS_READ; + common_setup_cleanup_unsolicited_events (self, FALSE, callback, user_data); } static void -setup_unsolicited_events_messaging (MMIfaceModemMessaging *self, +setup_unsolicited_events_messaging (MMIfaceModemMessaging *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SMS_READ; - common_setup_cleanup_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), TRUE, callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->setup_flags |= PROCESS_NOTIFICATION_FLAG_SMS_READ; + common_setup_cleanup_unsolicited_events (self, TRUE, callback, user_data); } /*****************************************************************************/ @@ -3121,21 +5102,25 @@ } static void -disable_unsolicited_events_messaging (MMIfaceModemMessaging *self, +disable_unsolicited_events_messaging (MMIfaceModemMessaging *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SMS_READ; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SMS_READ; + common_enable_disable_unsolicited_events (self, callback, user_data); } static void -enable_unsolicited_events_messaging (MMIfaceModemMessaging *self, +enable_unsolicited_events_messaging (MMIfaceModemMessaging *_self, GAsyncReadyCallback callback, gpointer user_data) { - MM_BROADBAND_MODEM_MBIM (self)->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SMS_READ; - common_enable_disable_unsolicited_events (MM_BROADBAND_MODEM_MBIM (self), callback, user_data); + MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self); + + self->priv->enable_flags |= PROCESS_NOTIFICATION_FLAG_SMS_READ; + common_enable_disable_unsolicited_events (self, callback, user_data); } /*****************************************************************************/ @@ -3162,6 +5147,9 @@ MM_BASE_MODEM_PLUGIN, plugin, MM_BASE_MODEM_VENDOR_ID, vendor_id, MM_BASE_MODEM_PRODUCT_ID, product_id, + MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, TRUE, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, FALSE, + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, TRUE, NULL); } @@ -3177,19 +5165,27 @@ static void finalize (GObject *object) { - MMPortMbim *mbim; MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (object); + MMPortMbim *mbim; + + mbim = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); + if (mbim) { + /* Explicitly remove notification handler */ + self->priv->setup_flags = PROCESS_NOTIFICATION_FLAG_NONE; + common_setup_cleanup_unsolicited_events_sync (self, mm_port_mbim_peek_device (mbim), FALSE); + /* Disconnect signal handler for mbim-proxy disappearing, if it exists */ + untrack_mbim_device_removed (self, mbim); + /* If we did open the MBIM port during initialization, close it now */ + if (mm_port_mbim_is_open (mbim)) + mm_port_mbim_close (mbim, NULL, NULL); + } g_free (self->priv->caps_device_id); g_free (self->priv->caps_firmware_info); + g_free (self->priv->caps_hardware_info); g_free (self->priv->current_operator_id); g_free (self->priv->current_operator_name); - - mbim = mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self)); - /* If we did open the MBIM port during initialization, close it now */ - if (mbim && mm_port_mbim_is_open (mbim)) { - mm_port_mbim_close (mbim, NULL, NULL); - } + mm_pco_list_free (self->priv->pco_list); G_OBJECT_CLASS (mm_broadband_modem_mbim_parent_class)->finalize (object); } @@ -3198,20 +5194,30 @@ iface_modem_init (MMIfaceModem *iface) { /* Initialization steps */ + iface->load_supported_capabilities = modem_load_supported_capabilities; + iface->load_supported_capabilities_finish = modem_load_supported_capabilities_finish; iface->load_current_capabilities = modem_load_current_capabilities; iface->load_current_capabilities_finish = modem_load_current_capabilities_finish; + iface->set_current_capabilities = modem_set_current_capabilities; + iface->set_current_capabilities_finish = modem_set_current_capabilities_finish; iface->load_manufacturer = modem_load_manufacturer; iface->load_manufacturer_finish = modem_load_manufacturer_finish; iface->load_model = modem_load_model; iface->load_model_finish = modem_load_model_finish; iface->load_revision = modem_load_revision; iface->load_revision_finish = modem_load_revision_finish; + iface->load_hardware_revision = modem_load_hardware_revision; + iface->load_hardware_revision_finish = modem_load_hardware_revision_finish; iface->load_equipment_identifier = modem_load_equipment_identifier; iface->load_equipment_identifier_finish = modem_load_equipment_identifier_finish; iface->load_device_identifier = modem_load_device_identifier; iface->load_device_identifier_finish = modem_load_device_identifier_finish; iface->load_supported_modes = modem_load_supported_modes; iface->load_supported_modes_finish = modem_load_supported_modes_finish; + iface->load_current_modes = modem_load_current_modes; + iface->load_current_modes_finish = modem_load_current_modes_finish; + iface->set_current_modes = modem_set_current_modes; + iface->set_current_modes_finish = modem_set_current_modes_finish; iface->load_unlock_required = modem_load_unlock_required; iface->load_unlock_required_finish = modem_load_unlock_required_finish; iface->load_unlock_retries = modem_load_unlock_retries; @@ -3227,6 +5233,19 @@ iface->load_supported_ip_families = modem_load_supported_ip_families; iface->load_supported_ip_families_finish = modem_load_supported_ip_families_finish; +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + iface->load_supported_bands = mm_shared_qmi_load_supported_bands; + iface->load_supported_bands_finish = mm_shared_qmi_load_supported_bands_finish; + iface->load_current_bands = mm_shared_qmi_load_current_bands; + iface->load_current_bands_finish = mm_shared_qmi_load_current_bands_finish; + iface->set_current_bands = mm_shared_qmi_set_current_bands; + iface->set_current_bands_finish = mm_shared_qmi_set_current_bands_finish; +#endif + + /* Additional actions */ + iface->load_signal_quality = modem_load_signal_quality; + iface->load_signal_quality_finish = modem_load_signal_quality_finish; + /* Unneeded things */ iface->modem_after_power_up = NULL; iface->modem_after_power_up_finish = NULL; @@ -3236,8 +5255,6 @@ iface->setup_flow_control_finish = NULL; iface->setup_charset = NULL; iface->setup_charset_finish = NULL; - iface->load_signal_quality = NULL; - iface->load_signal_quality_finish = NULL; iface->load_access_technologies = NULL; iface->load_access_technologies_finish = NULL; @@ -3248,6 +5265,18 @@ /* Create MBIM-specific bearer */ iface->create_bearer = modem_create_bearer; iface->create_bearer_finish = modem_create_bearer_finish; + + /* SIM hot swapping */ + iface->setup_sim_hot_swap = modem_setup_sim_hot_swap; + iface->setup_sim_hot_swap_finish = modem_setup_sim_hot_swap_finish; + + /* Other actions */ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + iface->reset = mm_shared_qmi_reset; + iface->reset_finish = mm_shared_qmi_reset_finish; + iface->factory_reset = mm_shared_qmi_factory_reset; + iface->factory_reset_finish = mm_shared_qmi_factory_reset_finish; +#endif } static void @@ -3279,6 +5308,12 @@ iface->load_operator_code_finish = modem_3gpp_load_operator_code_finish; iface->load_operator_name = modem_3gpp_load_operator_name; iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish; + iface->load_initial_eps_bearer = modem_3gpp_load_initial_eps_bearer; + iface->load_initial_eps_bearer_finish = modem_3gpp_load_initial_eps_bearer_finish; + iface->load_initial_eps_bearer_settings = modem_3gpp_load_initial_eps_bearer_settings; + iface->load_initial_eps_bearer_settings_finish = modem_3gpp_load_initial_eps_bearer_settings_finish; + iface->set_initial_eps_bearer_settings = modem_3gpp_set_initial_eps_bearer_settings; + iface->set_initial_eps_bearer_settings_finish = modem_3gpp_set_initial_eps_bearer_settings_finish; iface->run_registration_checks = modem_3gpp_run_registration_checks; iface->run_registration_checks_finish = modem_3gpp_run_registration_checks_finish; iface->register_in_network = modem_3gpp_register_in_network; @@ -3288,6 +5323,62 @@ } static void +iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface) +{ + /* Initialization steps */ + iface->check_support = modem_3gpp_ussd_check_support; + iface->check_support_finish = modem_3gpp_ussd_check_support_finish; + + /* Enabling steps */ + iface->setup_unsolicited_events = modem_3gpp_ussd_setup_unsolicited_events; + iface->setup_unsolicited_events_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish; + iface->enable_unsolicited_events = modem_3gpp_ussd_enable_unsolicited_events; + iface->enable_unsolicited_events_finish = modem_3gpp_ussd_enable_disable_unsolicited_events_finish; + + /* Disabling steps */ + iface->cleanup_unsolicited_events_finish = modem_3gpp_ussd_setup_cleanup_unsolicited_events_finish; + iface->cleanup_unsolicited_events = modem_3gpp_ussd_cleanup_unsolicited_events; + iface->disable_unsolicited_events = modem_3gpp_ussd_disable_unsolicited_events; + iface->disable_unsolicited_events_finish = modem_3gpp_ussd_enable_disable_unsolicited_events_finish; + + /* Additional actions */ + iface->send = modem_3gpp_ussd_send; + iface->send_finish = modem_3gpp_ussd_send_finish; + iface->cancel = modem_3gpp_ussd_cancel; + iface->cancel_finish = modem_3gpp_ussd_cancel_finish; +} + +static void +iface_modem_location_init (MMIfaceModemLocation *iface) +{ +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + iface_modem_location_parent = g_type_interface_peek_parent (iface); + + iface->load_capabilities = mm_shared_qmi_location_load_capabilities; + iface->load_capabilities_finish = mm_shared_qmi_location_load_capabilities_finish; + iface->enable_location_gathering = mm_shared_qmi_enable_location_gathering; + iface->enable_location_gathering_finish = mm_shared_qmi_enable_location_gathering_finish; + iface->disable_location_gathering = mm_shared_qmi_disable_location_gathering; + iface->disable_location_gathering_finish = mm_shared_qmi_disable_location_gathering_finish; + iface->load_supl_server = mm_shared_qmi_location_load_supl_server; + iface->load_supl_server_finish = mm_shared_qmi_location_load_supl_server_finish; + iface->set_supl_server = mm_shared_qmi_location_set_supl_server; + iface->set_supl_server_finish = mm_shared_qmi_location_set_supl_server_finish; + iface->load_supported_assistance_data = mm_shared_qmi_location_load_supported_assistance_data; + iface->load_supported_assistance_data_finish = mm_shared_qmi_location_load_supported_assistance_data_finish; + iface->inject_assistance_data = mm_shared_qmi_location_inject_assistance_data; + iface->inject_assistance_data_finish = mm_shared_qmi_location_inject_assistance_data_finish; + iface->load_assistance_data_servers = mm_shared_qmi_location_load_assistance_data_servers; + iface->load_assistance_data_servers_finish = mm_shared_qmi_location_load_assistance_data_servers_finish; +#else + iface->load_capabilities = NULL; + iface->load_capabilities_finish = NULL; + iface->enable_location_gathering = NULL; + iface->enable_location_gathering_finish = NULL; +#endif +} + +static void iface_modem_messaging_init (MMIfaceModemMessaging *iface) { iface->check_support = messaging_check_support; @@ -3298,6 +5389,8 @@ iface->setup_sms_format_finish = NULL; iface->set_default_storage = NULL; iface->set_default_storage_finish = NULL; + iface->init_current_storages = NULL; + iface->init_current_storages_finish = NULL; iface->load_initial_sms_parts = load_initial_sms_parts; iface->load_initial_sms_parts_finish = load_initial_sms_parts_finish; iface->setup_unsolicited_events = setup_unsolicited_events_messaging; @@ -3314,12 +5407,31 @@ static void iface_modem_signal_init (MMIfaceModemSignal *iface) { - iface->check_support = NULL; - iface->check_support_finish = NULL; - iface->load_values = NULL; - iface->load_values_finish = NULL; + iface_modem_signal_parent = g_type_interface_peek_parent (iface); + + iface->check_support = modem_signal_check_support; + iface->check_support_finish = modem_signal_check_support_finish; + iface->load_values = modem_signal_load_values; + iface->load_values_finish = modem_signal_load_values_finish; } +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedQmi *self) +{ + return iface_modem_location_parent; +} + +static void +shared_qmi_init (MMSharedQmi *iface) +{ + iface->peek_client = shared_qmi_peek_client; + iface->peek_parent_location_interface = peek_parent_location_interface; +} + +#endif + static void mm_broadband_modem_mbim_class_init (MMBroadbandModemMbimClass *klass) { diff -Nru modemmanager-1.6.8/src/mm-broadband-modem-qmi.c modemmanager-1.10.0/src/mm-broadband-modem-qmi.c --- modemmanager-1.6.8/src/mm-broadband-modem-qmi.c 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/src/mm-broadband-modem-qmi.c 2019-01-15 15:57:35.000000000 +0100 @@ -39,6 +39,7 @@ #include "mm-iface-modem-firmware.h" #include "mm-iface-modem-signal.h" #include "mm-iface-modem-oma.h" +#include "mm-shared-qmi.h" #include "mm-sim-qmi.h" #include "mm-bearer-qmi.h" #include "mm-sms-qmi.h" @@ -54,9 +55,10 @@ static void iface_modem_oma_init (MMIfaceModemOma *iface); static void iface_modem_firmware_init (MMIfaceModemFirmware *iface); static void iface_modem_signal_init (MMIfaceModemSignal *iface); +static void shared_qmi_init (MMSharedQmi *iface); +static MMIfaceModemLocation *iface_modem_location_parent; static MMIfaceModemMessaging *iface_modem_messaging_parent; -static MMIfaceModemLocation *iface_modem_location_parent; G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQmi, mm_broadband_modem_qmi, MM_TYPE_BROADBAND_MODEM, 0, G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init) @@ -67,7 +69,8 @@ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_LOCATION, iface_modem_location_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIGNAL, iface_modem_signal_init) G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_OMA, iface_modem_oma_init) - G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_FIRMWARE, iface_modem_firmware_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_SHARED_QMI, shared_qmi_init)) struct _MMBroadbandModemQmiPrivate { /* Cached device IDs, retrieved by the modem interface when loading device @@ -76,9 +79,6 @@ gchar *meid; gchar *esn; - /* Cached supported radio interfaces; in order to load supported modes */ - GArray *supported_radio_interfaces; - /* Cached supported frequency bands; in order to handle ANY */ GArray *supported_bands; @@ -106,7 +106,7 @@ /* CDMA activation helpers */ MMModemCdmaActivationState activation_state; guint activation_event_report_indication_id; - gpointer activation_ctx; + GTask *activation_task; /* Messaging helpers */ gboolean messaging_fallback_at; @@ -116,7 +116,6 @@ /* Location helpers */ MMModemLocationSource enabled_sources; - guint location_event_report_indication_id; /* Oma helpers */ gboolean oma_unsolicited_events_enabled; @@ -124,16 +123,21 @@ guint oma_event_report_indication_id; /* Firmware helpers */ + gboolean firmware_list_preloaded; GList *firmware_list; MMFirmwareProperties *current_firmware; + + /* For notifying when the qmi-proxy connection is dead */ + guint qmi_device_removed_id; }; /*****************************************************************************/ static QmiClient * -peek_qmi_client (MMBroadbandModemQmi *self, - QmiService service, - GError **error) +shared_qmi_peek_client (MMSharedQmi *self, + QmiService service, + MMPortQmiFlag flag, + GError **error) { MMPortQmi *port; QmiClient *client; @@ -147,9 +151,7 @@ return NULL; } - client = mm_port_qmi_peek_client (port, - service, - MM_PORT_QMI_FLAG_DEFAULT); + client = mm_port_qmi_peek_client (port, service, flag); if (!client) g_set_error (error, MM_CORE_ERROR, @@ -160,136 +162,6 @@ return client; } -static gboolean -ensure_qmi_client (MMBroadbandModemQmi *self, - QmiService service, - QmiClient **o_client, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GError *error = NULL; - QmiClient *client; - - client = peek_qmi_client (self, service, &error); - if (!client) { - g_simple_async_report_take_gerror_in_idle ( - G_OBJECT (self), - callback, - user_data, - error); - return FALSE; - } - - *o_client = client; - return TRUE; -} - -/*****************************************************************************/ -/* Power cycle */ - -static gboolean -power_cycle_finish (MMBroadbandModemQmi *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -power_cycle_set_operating_mode_reset_ready (QmiClientDms *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageDmsSetOperatingModeOutput *output; - GError *error = NULL; - - output = qmi_client_dms_set_operating_mode_finish (client, res, &error); - if (!output || - !qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { - g_simple_async_result_take_error (simple, error); - } else { - mm_info ("Modem is being rebooted now"); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } - - if (output) - qmi_message_dms_set_operating_mode_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -power_cycle_set_operating_mode_offline_ready (QmiClientDms *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageDmsSetOperatingModeInput *input; - QmiMessageDmsSetOperatingModeOutput *output; - GError *error = NULL; - - output = qmi_client_dms_set_operating_mode_finish (client, res, &error); - if (!output) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - if (!qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - qmi_message_dms_set_operating_mode_output_unref (output); - return; - } - - qmi_message_dms_set_operating_mode_output_unref (output); - - /* Now, go into reset mode. This will fully reboot the modem, and the current - * modem object should get disposed. */ - input = qmi_message_dms_set_operating_mode_input_new (); - qmi_message_dms_set_operating_mode_input_set_mode (input, QMI_DMS_OPERATING_MODE_RESET, NULL); - qmi_client_dms_set_operating_mode (client, - input, - 20, - NULL, - (GAsyncReadyCallback)power_cycle_set_operating_mode_reset_ready, - simple); - qmi_message_dms_set_operating_mode_input_unref (input); -} - -static void -power_cycle (MMBroadbandModemQmi *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - QmiMessageDmsSetOperatingModeInput *input; - GSimpleAsyncResult *simple; - QmiClient *client; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) - return; - - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - power_cycle); - - /* Now, go into offline mode */ - input = qmi_message_dms_set_operating_mode_input_new (); - qmi_message_dms_set_operating_mode_input_set_mode (input, QMI_DMS_OPERATING_MODE_OFFLINE, NULL); - qmi_client_dms_set_operating_mode (QMI_CLIENT_DMS (client), - input, - 20, - NULL, - (GAsyncReadyCallback)power_cycle_set_operating_mode_offline_ready, - simple); - qmi_message_dms_set_operating_mode_input_unref (input); -} - /*****************************************************************************/ /* Create Bearer (Modem interface) */ @@ -298,12 +170,7 @@ GAsyncResult *res, GError **error) { - MMBaseBearer *bearer; - - bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer)); - - return g_object_ref (bearer); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -313,619 +180,14 @@ gpointer user_data) { MMBaseBearer *bearer; - GSimpleAsyncResult *result; - /* Set a new ref to the bearer object as result */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_create_bearer); + GTask *task; /* We just create a MMBearerQmi */ bearer = mm_bearer_qmi_new (MM_BROADBAND_MODEM_QMI (self), properties); - g_simple_async_result_set_op_res_gpointer (result, bearer, g_object_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); -} - -/*****************************************************************************/ -/* Current Capabilities loading (Modem interface) */ - -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *nas_client; - QmiClientDms *dms_client; - GSimpleAsyncResult *result; - gboolean run_get_system_selection_preference; - gboolean run_get_technology_preference; - - MMQmiCapabilitiesContext capabilities_context; -} LoadCurrentCapabilitiesContext; - -static MMModemCapability -modem_load_current_capabilities_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_CAPABILITY_NONE; - - return ((MMModemCapability) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res)))); -} - -static void -load_current_capabilities_context_complete_and_free (LoadCurrentCapabilitiesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->nas_client); - g_object_unref (ctx->dms_client); - g_object_unref (ctx->self); - g_slice_free (LoadCurrentCapabilitiesContext, ctx); -} - -static void load_current_capabilities_context_step (LoadCurrentCapabilitiesContext *ctx); - -static void -load_current_capabilities_get_capabilities_ready (QmiClientDms *client, - GAsyncResult *res, - LoadCurrentCapabilitiesContext *ctx) -{ - QmiMessageDmsGetCapabilitiesOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_dms_get_capabilities_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - } else if (!qmi_message_dms_get_capabilities_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get Capabilities: "); - g_simple_async_result_take_error (ctx->result, error); - } else { - guint i; - GArray *radio_interface_list; - - qmi_message_dms_get_capabilities_output_get_info ( - output, - NULL, /* info_max_tx_channel_rate */ - NULL, /* info_max_rx_channel_rate */ - NULL, /* info_data_service_capability */ - NULL, /* info_sim_capability */ - &radio_interface_list, - NULL); - - for (i = 0; i < radio_interface_list->len; i++) { - ctx->capabilities_context.dms_capabilities |= - mm_modem_capability_from_qmi_radio_interface (g_array_index (radio_interface_list, - QmiDmsRadioInterface, - i)); - } - } - - if (output) - qmi_message_dms_get_capabilities_output_unref (output); - - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (mm_modem_capability_from_qmi_capabilities_context (&ctx->capabilities_context)), - NULL); - load_current_capabilities_context_complete_and_free (ctx); -} - -static void -load_current_capabilities_get_technology_preference_ready (QmiClientNas *client, - GAsyncResult *res, - LoadCurrentCapabilitiesContext *ctx) -{ - QmiMessageNasGetTechnologyPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_get_technology_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_get_technology_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't get technology preference: %s", error->message); - g_error_free (error); - } else { - qmi_message_nas_get_technology_preference_output_get_active ( - output, - &ctx->capabilities_context.nas_tp_mask, - NULL, /* duration */ - NULL); - } - - if (output) - qmi_message_nas_get_technology_preference_output_unref (output); - - /* Mark as TP already run */ - ctx->run_get_technology_preference = FALSE; - load_current_capabilities_context_step (ctx); -} - -static void -load_current_capabilities_get_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - LoadCurrentCapabilitiesContext *ctx) -{ - QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't get system selection preference: %s", error->message); - g_error_free (error); - } else { - qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( - output, - &ctx->capabilities_context.nas_ssp_mode_preference_mask, - NULL); - } - - if (output) - qmi_message_nas_get_system_selection_preference_output_unref (output); - - /* Mark as SSP already run */ - ctx->run_get_system_selection_preference = FALSE; - load_current_capabilities_context_step (ctx); -} - -static void -load_current_capabilities_context_step (LoadCurrentCapabilitiesContext *ctx) -{ - if (ctx->run_get_system_selection_preference) { - qmi_client_nas_get_system_selection_preference ( - ctx->nas_client, - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)load_current_capabilities_get_system_selection_preference_ready, - ctx); - return; - } - - if (ctx->run_get_technology_preference) { - qmi_client_nas_get_technology_preference ( - ctx->nas_client, - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)load_current_capabilities_get_technology_preference_ready, - ctx); - return; - } - - qmi_client_dms_get_capabilities ( - ctx->dms_client, - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)load_current_capabilities_get_capabilities_ready, - ctx); -} - -static void -modem_load_current_capabilities (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LoadCurrentCapabilitiesContext *ctx; - QmiClient *nas_client = NULL; - QmiClient *dms_client = NULL; - - /* Best way to get current capabilities (ie, enabled radios) is - * Get System Selection Preference's "mode preference" TLV, but that's - * only supported by NAS >= 1.1, meaning older Gobi devices don't - * implement it. - * - * On these devices, the DMS Get Capabilities call appears to report - * currently enabled radios, but this does not take the user's - * technology preference into account. - * - * So in the absence of System Selection Preference, we check the - * Technology Preference first, and if that is "AUTO" we fall back to - * Get Capabilities. - */ - - mm_dbg ("loading current capabilities..."); - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &nas_client, - callback, user_data)) - return; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &dms_client, - callback, user_data)) - return; - - ctx = g_slice_new0 (LoadCurrentCapabilitiesContext); - ctx->self = g_object_ref (self); - ctx->nas_client = g_object_ref (nas_client); - ctx->dms_client = g_object_ref (dms_client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_capabilities); - - /* System selection preference introduced in NAS 1.1 */ - ctx->run_get_system_selection_preference = qmi_client_check_version (nas_client, 1, 1); - ctx->run_get_technology_preference = TRUE; - - load_current_capabilities_context_step (ctx); -} - -/*****************************************************************************/ -/* Supported capabilities loading (Modem interface) */ - -typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; -} LoadSupportedCapabilitiesContext; - -static void -load_supported_capabilities_context_complete_and_free (LoadSupportedCapabilitiesContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadSupportedCapabilitiesContext, ctx); -} - -static GArray * -modem_load_supported_capabilities_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); -} - -static void -dms_get_capabilities_ready (QmiClientDms *client, - GAsyncResult *res, - LoadSupportedCapabilitiesContext *ctx) -{ - QmiMessageDmsGetCapabilitiesOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_dms_get_capabilities_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - } else if (!qmi_message_dms_get_capabilities_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get supported capabilities: "); - g_simple_async_result_take_error (ctx->result, error); - } else { - guint i; - MMModemCapability mask = MM_MODEM_CAPABILITY_NONE; - MMModemCapability single; - GArray *radio_interface_list; - GArray *supported_combinations; - GArray *filtered_combinations; - - qmi_message_dms_get_capabilities_output_get_info ( - output, - NULL, /* info_max_tx_channel_rate */ - NULL, /* info_max_rx_channel_rate */ - NULL, /* info_data_service_capability */ - NULL, /* info_sim_capability */ - &radio_interface_list, - NULL); - - for (i = 0; i < radio_interface_list->len; i++) { - mask |= mm_modem_capability_from_qmi_radio_interface (g_array_index (radio_interface_list, - QmiDmsRadioInterface, - i)); - } - - /* Cache supported radio interfaces */ - if (ctx->self->priv->supported_radio_interfaces) - g_array_unref (ctx->self->priv->supported_radio_interfaces); - ctx->self->priv->supported_radio_interfaces = g_array_ref (radio_interface_list); - - supported_combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemCapability), 7); - - /* Add all possible supported capability combinations, we will filter - * them out afterwards */ - - /* GSM/UMTS */ - single = MM_MODEM_CAPABILITY_GSM_UMTS; - g_array_append_val (supported_combinations, single); - /* CDMA/EVDO */ - single = MM_MODEM_CAPABILITY_CDMA_EVDO; - g_array_append_val (supported_combinations, single); - /* LTE only */ - single = MM_MODEM_CAPABILITY_LTE; - g_array_append_val (supported_combinations, single); - /* GSM/UMTS + CDMA/EVDO */ - single = (MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_GSM_UMTS); - g_array_append_val (supported_combinations, single); - /* GSM/UMTS + LTE */ - single = (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_LTE); - g_array_append_val (supported_combinations, single); - /* CDMA/EVDO + LTE */ - single = (MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE); - g_array_append_val (supported_combinations, single); - /* GSM/UMTS + CDMA/EVDO + LTE */ - single = (MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_LTE); - g_array_append_val (supported_combinations, single); - - /* Now filter out based on the real capabilities of the modem */ - filtered_combinations = mm_filter_supported_capabilities (mask, - supported_combinations); - g_array_unref (supported_combinations); - - g_simple_async_result_set_op_res_gpointer (ctx->result, - filtered_combinations, - (GDestroyNotify) g_array_unref); - } - - if (output) - qmi_message_dms_get_capabilities_output_unref (output); - - load_supported_capabilities_context_complete_and_free (ctx); -} - -static void -modem_load_supported_capabilities (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LoadSupportedCapabilitiesContext *ctx; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) - return; - - ctx = g_slice_new (LoadSupportedCapabilitiesContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_capabilities); - - mm_dbg ("loading supported capabilities..."); - qmi_client_dms_get_capabilities (QMI_CLIENT_DMS (client), - NULL, - 5, - NULL, - (GAsyncReadyCallback)dms_get_capabilities_ready, - ctx); -} - -/*****************************************************************************/ -/* Current capabilities setting (Modem interface) */ - -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *client; - GSimpleAsyncResult *result; - MMModemCapability capabilities; - gboolean run_set_system_selection_preference; - gboolean run_set_technology_preference; -} SetCurrentCapabilitiesContext; - -static void -set_current_capabilities_context_complete_and_free (SetCurrentCapabilitiesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (SetCurrentCapabilitiesContext, ctx); -} - -static gboolean -set_current_capabilities_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -capabilities_power_cycle_ready (MMBroadbandModemQmi *self, - GAsyncResult *res, - SetCurrentCapabilitiesContext *ctx) -{ - GError *error = NULL; - - if (!power_cycle_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_capabilities_context_complete_and_free (ctx); -} - -static void -capabilities_power_cycle (SetCurrentCapabilitiesContext *ctx) -{ - /* Power cycle the modem */ - power_cycle (ctx->self, - (GAsyncReadyCallback)capabilities_power_cycle_ready, - ctx); -} - -static void set_current_capabilities_context_step (SetCurrentCapabilitiesContext *ctx); - -static void -capabilities_set_technology_preference_ready (QmiClientNas *client, - GAsyncResult *res, - SetCurrentCapabilitiesContext *ctx) -{ - QmiMessageNasSetTechnologyPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_set_technology_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_set_technology_preference_output_get_result (output, &error) && - !g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - mm_dbg ("Couldn't set technology preference: %s", error->message); - g_error_free (error); - qmi_message_nas_set_technology_preference_output_unref (output); - } else { - if (error) - g_error_free (error); - /* Good! now reboot the modem */ - capabilities_power_cycle (ctx); - qmi_message_nas_set_technology_preference_output_unref (output); - return; - } - - ctx->run_set_technology_preference = FALSE; - set_current_capabilities_context_step (ctx); -} - -static void -capabilities_set_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - SetCurrentCapabilitiesContext *ctx) -{ - QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't set system selection preference: %s", error->message); - g_error_free (error); - qmi_message_nas_set_system_selection_preference_output_unref (output); - } else { - /* Good! now reboot the modem */ - capabilities_power_cycle (ctx); - qmi_message_nas_set_system_selection_preference_output_unref (output); - return; - } - - /* Try with the deprecated command */ - ctx->run_set_system_selection_preference = FALSE; - set_current_capabilities_context_step (ctx); -} - -static void -set_current_capabilities_context_step (SetCurrentCapabilitiesContext *ctx) -{ - if (ctx->run_set_system_selection_preference) { - QmiMessageNasSetSystemSelectionPreferenceInput *input; - QmiNasRatModePreference pref; - - pref = mm_modem_capability_to_qmi_rat_mode_preference (ctx->capabilities); - if (!pref) { - gchar *str; - - str = mm_modem_capability_build_string_from_mask (ctx->capabilities); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled capabilities setting: '%s'", - str); - g_free (str); - set_current_capabilities_context_complete_and_free (ctx); - return; - } - - input = qmi_message_nas_set_system_selection_preference_input_new (); - qmi_message_nas_set_system_selection_preference_input_set_mode_preference (input, pref, NULL); - qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); - - qmi_client_nas_set_system_selection_preference ( - ctx->client, - input, - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)capabilities_set_system_selection_preference_ready, - ctx); - qmi_message_nas_set_system_selection_preference_input_unref (input); - return; - } - - if (ctx->run_set_technology_preference) { - QmiMessageNasSetTechnologyPreferenceInput *input; - QmiNasRadioTechnologyPreference pref; - - pref = mm_modem_capability_to_qmi_radio_technology_preference (ctx->capabilities); - if (!pref) { - gchar *str; - - str = mm_modem_capability_build_string_from_mask (ctx->capabilities); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled capabilities setting: '%s'", - str); - g_free (str); - set_current_capabilities_context_complete_and_free (ctx); - return; - } - - input = qmi_message_nas_set_technology_preference_input_new (); - qmi_message_nas_set_technology_preference_input_set_current (input, pref, QMI_NAS_PREFERENCE_DURATION_PERMANENT, NULL); - - qmi_client_nas_set_technology_preference ( - ctx->client, - input, - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)capabilities_set_technology_preference_ready, - ctx); - qmi_message_nas_set_technology_preference_input_unref (input); - return; - } - - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Setting capabilities is not supported by this device"); - set_current_capabilities_context_complete_and_free (ctx); -} - -static void -set_current_capabilities (MMIfaceModem *self, - MMModemCapability capabilities, - GAsyncReadyCallback callback, - gpointer user_data) -{ - SetCurrentCapabilitiesContext *ctx; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - ctx = g_slice_new0 (SetCurrentCapabilitiesContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_capabilities); - ctx->capabilities = capabilities; - - /* System selection preference introduced in NAS 1.1 */ - ctx->run_set_system_selection_preference = qmi_client_check_version (client, 1, 1); - - /* Technology preference introduced in NAS 1.0, so always available */ - ctx->run_set_technology_preference = TRUE; - - set_current_capabilities_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } /*****************************************************************************/ @@ -936,20 +198,13 @@ GAsyncResult *res, GError **error) { - gchar *manufacturer; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - manufacturer = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded manufacturer: %s", manufacturer); - return manufacturer; + return g_task_propagate_pointer (G_TASK (res), error); } static void dms_get_manufacturer_ready (QmiClientDms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageDmsGetManufacturerOutput *output = NULL; GError *error = NULL; @@ -957,24 +212,21 @@ output = qmi_client_dms_get_manufacturer_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_dms_get_manufacturer_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get Manufacturer: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { const gchar *str; qmi_message_dms_get_manufacturer_output_get_manufacturer (output, &str, NULL); - g_simple_async_result_set_op_res_gpointer (simple, - g_strdup (str), - (GDestroyNotify)g_free); + g_task_return_pointer (task, g_strdup (str), g_free); } if (output) qmi_message_dms_get_manufacturer_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -982,26 +234,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_manufacturer); - mm_dbg ("loading manufacturer..."); qmi_client_dms_get_manufacturer (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_manufacturer_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1012,20 +258,13 @@ GAsyncResult *res, GError **error) { - gchar *model; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - model = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded model: %s", model); - return model; + return g_task_propagate_pointer (G_TASK (res), error); } static void dms_get_model_ready (QmiClientDms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageDmsGetModelOutput *output = NULL; GError *error = NULL; @@ -1033,24 +272,21 @@ output = qmi_client_dms_get_model_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_dms_get_model_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get Model: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { const gchar *str; qmi_message_dms_get_model_output_get_model (output, &str, NULL); - g_simple_async_result_set_op_res_gpointer (simple, - g_strdup (str), - (GDestroyNotify)g_free); + g_task_return_pointer (task, g_strdup (str), g_free); } if (output) qmi_message_dms_get_model_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1058,26 +294,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_model); - mm_dbg ("loading model..."); qmi_client_dms_get_model (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_model_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1088,20 +318,13 @@ GAsyncResult *res, GError **error) { - gchar *revision; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - revision = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded revision: %s", revision); - return revision; + return g_task_propagate_pointer (G_TASK (res), error); } static void dms_get_revision_ready (QmiClientDms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageDmsGetRevisionOutput *output = NULL; GError *error = NULL; @@ -1109,24 +332,21 @@ output = qmi_client_dms_get_revision_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_dms_get_revision_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get Revision: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { const gchar *str; qmi_message_dms_get_revision_output_get_revision (output, &str, NULL); - g_simple_async_result_set_op_res_gpointer (simple, - g_strdup (str), - (GDestroyNotify)g_free); + g_task_return_pointer (task, g_strdup (str), g_free); } if (output) qmi_message_dms_get_revision_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1134,67 +354,99 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_revision); - mm_dbg ("loading revision..."); qmi_client_dms_get_revision (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_revision_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ -/* Equipment Identifier loading (Modem interface) */ +/* Hardware Revision loading (Modem interface) */ -typedef struct { - MMBroadbandModemQmi *self; - QmiClient *client; - GSimpleAsyncResult *result; -} LoadEquipmentIdentifierContext; +static gchar * +modem_load_hardware_revision_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} static void -load_equipment_identifier_context_complete_and_free (LoadEquipmentIdentifierContext *ctx) +dms_get_hardware_revision_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_free (ctx); + QmiMessageDmsGetHardwareRevisionOutput *output = NULL; + GError *error = NULL; + + output = qmi_client_dms_get_hardware_revision_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + } else if (!qmi_message_dms_get_hardware_revision_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't get Hardware Revision: "); + g_task_return_error (task, error); + } else { + const gchar *str; + + qmi_message_dms_get_hardware_revision_output_get_revision (output, &str, NULL); + g_task_return_pointer (task, g_strdup (str), g_free); + } + + if (output) + qmi_message_dms_get_hardware_revision_output_unref (output); + + g_object_unref (task); +} + +static void +modem_load_hardware_revision (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiClient *client = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) + return; + + mm_dbg ("loading hardware revision..."); + qmi_client_dms_get_hardware_revision (QMI_CLIENT_DMS (client), + NULL, + 5, + NULL, + (GAsyncReadyCallback)dms_get_hardware_revision_ready, + g_task_new (self, NULL, callback, user_data)); } +/*****************************************************************************/ +/* Equipment Identifier loading (Modem interface) */ + static gchar * modem_load_equipment_identifier_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - gchar *equipment_identifier; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - equipment_identifier = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded equipment identifier: %s", equipment_identifier); - return equipment_identifier; + return g_task_propagate_pointer (G_TASK (res), error); } static void dms_get_ids_ready (QmiClientDms *client, GAsyncResult *res, - LoadEquipmentIdentifierContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageDmsGetIdsOutput *output = NULL; GError *error = NULL; const gchar *str; @@ -1203,19 +455,21 @@ output = qmi_client_dms_get_ids_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - load_equipment_identifier_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_get_ids_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get IDs: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_dms_get_ids_output_unref (output); - load_equipment_identifier_context_complete_and_free (ctx); return; } + self = g_task_get_source_object (task); + /* In order: * If we have a IMEI, use it... * Otherwise, if we have a ESN, use it... @@ -1225,47 +479,45 @@ if (qmi_message_dms_get_ids_output_get_imei (output, &str, NULL) && str[0] != '\0') { - g_free (ctx->self->priv->imei); - ctx->self->priv->imei = g_strdup (str); + g_free (self->priv->imei); + self->priv->imei = g_strdup (str); } if (qmi_message_dms_get_ids_output_get_esn (output, &str, NULL) && str[0] != '\0') { - g_free (ctx->self->priv->esn); + g_clear_pointer (&self->priv->esn, g_free); len = strlen (str); if (len == 7) - ctx->self->priv->esn = g_strdup_printf ("0%s", str); /* zero-pad to 8 chars */ + self->priv->esn = g_strdup_printf ("0%s", str); /* zero-pad to 8 chars */ else if (len == 8) - ctx->self->priv->esn = g_strdup (str); + self->priv->esn = g_strdup (str); else mm_dbg ("Invalid ESN reported: '%s' (unexpected length)", str); } if (qmi_message_dms_get_ids_output_get_meid (output, &str, NULL) && str[0] != '\0') { - g_free (ctx->self->priv->meid); + g_clear_pointer (&self->priv->meid, g_free); len = strlen (str); if (len == 14) - ctx->self->priv->meid = g_strdup (str); + self->priv->meid = g_strdup (str); else mm_dbg ("Invalid MEID reported: '%s' (unexpected length)", str); } - if (ctx->self->priv->imei) - str = ctx->self->priv->imei; - else if (ctx->self->priv->esn) - str = ctx->self->priv->esn; - else if (ctx->self->priv->meid) - str = ctx->self->priv->meid; + if (self->priv->imei) + str = self->priv->imei; + else if (self->priv->esn) + str = self->priv->esn; + else if (self->priv->meid) + str = self->priv->meid; else str = "unknown"; - g_simple_async_result_set_op_res_gpointer (ctx->result, - g_strdup (str), - (GDestroyNotify)g_free); + g_task_return_pointer (task, g_strdup (str), g_free); + g_object_unref (task); qmi_message_dms_get_ids_output_unref (output); - load_equipment_identifier_context_complete_and_free (ctx); } static void @@ -1273,29 +525,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - LoadEquipmentIdentifierContext *ctx; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - ctx = g_new (LoadEquipmentIdentifierContext, 1); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_equipment_identifier); - mm_dbg ("loading equipment identifier..."); qmi_client_dms_get_ids (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_ids_ready, - ctx); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1306,14 +549,7 @@ GAsyncResult *res, GError **error) { - gchar *device_identifier; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - device_identifier = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded device identifier: %s", device_identifier); - return device_identifier; + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -1321,23 +557,18 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; gchar *device_identifier; + GTask *task; mm_dbg ("loading device identifier..."); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_device_identifier); /* Just use dummy ATI/ATI1 replies, all the other internal info should be * enough for uniqueness */ device_identifier = mm_broadband_modem_create_device_identifier (MM_BROADBAND_MODEM (self), "", ""); - g_simple_async_result_set_op_res_gpointer (result, - device_identifier, - (GDestroyNotify)g_free); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, device_identifier, g_free); + g_object_unref (task); } /*****************************************************************************/ @@ -1348,21 +579,13 @@ GAsyncResult *res, GError **error) { - gchar **own_numbers; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - own_numbers = g_new0 (gchar *, 2); - own_numbers[0] = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded own numbers: %s", own_numbers[0]); - return own_numbers; + return g_task_propagate_pointer (G_TASK (res), error); } static void dms_get_msisdn_ready (QmiClientDms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageDmsGetMsisdnOutput *output = NULL; GError *error = NULL; @@ -1370,24 +593,24 @@ output = qmi_client_dms_get_msisdn_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_dms_get_msisdn_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get MSISDN: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { const gchar *str = NULL; + GStrv numbers; qmi_message_dms_get_msisdn_output_get_msisdn (output, &str, NULL); - g_simple_async_result_set_op_res_gpointer (simple, - g_strdup (str), - (GDestroyNotify)g_free); + numbers = g_new0 (gchar *, 2); + numbers[0] = g_strdup (str); + g_task_return_pointer (task, numbers, (GDestroyNotify)g_strfreev); } if (output) qmi_message_dms_get_msisdn_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -1395,26 +618,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_own_numbers); - mm_dbg ("loading own numbers..."); qmi_client_dms_get_msisdn (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_msisdn_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -1428,35 +645,28 @@ } LoadUnlockRequiredStep; typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; LoadUnlockRequiredStep step; QmiClient *dms; QmiClient *uim; } LoadUnlockRequiredContext; -static void -load_unlock_required_context_complete_and_free (LoadUnlockRequiredContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (LoadUnlockRequiredContext, ctx); -} - static MMModemLock modem_load_unlock_required_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCK_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemLock) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCK_UNKNOWN; + } + return (MMModemLock)value; } -static void load_unlock_required_context_step (LoadUnlockRequiredContext *ctx); +static void load_unlock_required_context_step (GTask *task); /* Used also when loading unlock retries left */ static gboolean @@ -1691,7 +901,7 @@ static void unlock_required_uim_get_card_status_ready (QmiClientUim *client, GAsyncResult *res, - LoadUnlockRequiredContext *ctx) + GTask *task) { QmiMessageUimGetCardStatusOutput *output; GError *error = NULL; @@ -1700,8 +910,8 @@ output = qmi_client_uim_get_card_status_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1710,19 +920,21 @@ NULL, NULL, NULL, NULL, &error)) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (lock), NULL); + g_task_return_int (task, lock); + g_object_unref (task); qmi_message_uim_get_card_status_output_unref (output); - load_unlock_required_context_complete_and_free (ctx); } static void dms_uim_get_pin_status_ready (QmiClientDms *client, GAsyncResult *res, - LoadUnlockRequiredContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + LoadUnlockRequiredContext *ctx; QmiMessageDmsUimGetPinStatusOutput *output; GError *error = NULL; MMModemLock lock = MM_MODEM_LOCK_UNKNOWN; @@ -1731,11 +943,14 @@ output = qmi_client_dms_uim_get_pin_status_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (!qmi_message_dms_uim_get_pin_status_output_get_result (output, &error)) { /* We get InvalidQmiCommand on newer devices which don't like the legacy way */ if (g_error_matches (error, @@ -1747,9 +962,9 @@ g_error_free (error); qmi_message_dms_uim_get_pin_status_output_unref (output); /* Flag that the command is unsupported, and try with the new way */ - ctx->self->priv->dms_uim_deprecated = TRUE; + self->priv->dms_uim_deprecated = TRUE; ctx->step++; - load_unlock_required_context_step (ctx); + load_unlock_required_context_step (task); return; } @@ -1760,22 +975,22 @@ g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_UIM_UNINITIALIZED)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY, - "Couldn't get PIN status (retry): %s", - error->message); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY, + "Couldn't get PIN status (retry): %s", + error->message); + g_object_unref (task); g_error_free (error); qmi_message_dms_uim_get_pin_status_output_unref (output); - load_unlock_required_context_complete_and_free (ctx); return; } /* Other errors, just propagate them */ g_prefix_error (&error, "Couldn't get PIN status: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_dms_uim_get_pin_status_output_unref (output); - load_unlock_required_context_complete_and_free (ctx); return; } @@ -1805,17 +1020,21 @@ } /* We're done! */ - g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (lock), NULL); - qmi_message_dms_uim_get_pin_status_output_unref (output); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_int (task, lock); + g_object_unref (task); } static void -load_unlock_required_context_step (LoadUnlockRequiredContext *ctx) +load_unlock_required_context_step (GTask *task) { + MMBroadbandModemQmi *self; + LoadUnlockRequiredContext *ctx; GError *error = NULL; QmiClient *client; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case LOAD_UNLOCK_REQUIRED_STEP_FIRST: ctx->step++; @@ -1823,22 +1042,25 @@ case LOAD_UNLOCK_REQUIRED_STEP_CDMA: /* CDMA-only modems don't need this */ - if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (ctx->self))) { + if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { mm_dbg ("Skipping unlock check in CDMA-only modem..."); - g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (MM_MODEM_LOCK_NONE), NULL); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_int (task, MM_MODEM_LOCK_NONE); + g_object_unref (task); return; } ctx->step++; /* Go on to next step */ case LOAD_UNLOCK_REQUIRED_STEP_DMS: - if (!ctx->self->priv->dms_uim_deprecated) { + if (!self->priv->dms_uim_deprecated) { /* Failure to get DMS client is hard really */ - client = peek_qmi_client (ctx->self, QMI_SERVICE_DMS, &error); + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, + MM_PORT_QMI_FLAG_DEFAULT, + &error); if (!client) { - g_simple_async_result_take_error (ctx->result, error); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1848,7 +1070,7 @@ 5, NULL, (GAsyncReadyCallback) dms_uim_get_pin_status_ready, - ctx); + task); return; } ctx->step++; @@ -1856,10 +1078,13 @@ case LOAD_UNLOCK_REQUIRED_STEP_UIM: /* Failure to get UIM client at this point is hard as well */ - client = peek_qmi_client (ctx->self, QMI_SERVICE_UIM, &error); + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_UIM, + MM_PORT_QMI_FLAG_DEFAULT, + &error); if (!client) { - g_simple_async_result_take_error (ctx->result, error); - load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -1869,7 +1094,7 @@ 5, NULL, (GAsyncReadyCallback) unlock_required_uim_get_card_status_ready, - ctx); + task); return; } } @@ -1880,16 +1105,15 @@ gpointer user_data) { LoadUnlockRequiredContext *ctx; + GTask *task; - ctx = g_slice_new0 (LoadUnlockRequiredContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_unlock_required); + ctx = g_new0 (LoadUnlockRequiredContext, 1); ctx->step = LOAD_UNLOCK_REQUIRED_STEP_FIRST; - load_unlock_required_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); + + load_unlock_required_context_step (task); } /*****************************************************************************/ @@ -1953,7 +1177,10 @@ QmiClient *client; GError *error = NULL; - client = peek_qmi_client (self, QMI_SERVICE_UIM, &error); + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_UIM, + MM_PORT_QMI_FLAG_DEFAULT, + &error); if (!client) { g_task_return_error (task, error); g_object_unref (task); @@ -2042,7 +1269,10 @@ { QmiClient *client; - client = peek_qmi_client (self, QMI_SERVICE_DMS, NULL); + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); if (!client) { /* Very unlikely that this will ever happen, but anyway, try with * UIM service instead */ @@ -2077,507 +1307,6 @@ } /*****************************************************************************/ -/* Load supported bands (Modem interface) */ - -static GArray * -modem_load_supported_bands_finish (MMIfaceModem *_self, - GAsyncResult *res, - GError **error) -{ - MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - if (self->priv->supported_bands) - g_array_unref (self->priv->supported_bands); - - /* Cache the supported bands value */ - self->priv->supported_bands = g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); - - return g_array_ref (self->priv->supported_bands); -} - -static void -dms_get_band_capabilities_ready (QmiClientDms *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageDmsGetBandCapabilitiesOutput *output; - GError *error = NULL; - - output = qmi_client_dms_get_band_capabilities_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_dms_get_band_capabilities_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get band capabilities: "); - g_simple_async_result_take_error (simple, error); - } else { - GArray *mm_bands; - QmiDmsBandCapability qmi_bands = 0; - QmiDmsLteBandCapability qmi_lte_bands = 0; - - qmi_message_dms_get_band_capabilities_output_get_band_capability ( - output, - &qmi_bands, - NULL); - qmi_message_dms_get_band_capabilities_output_get_lte_band_capability ( - output, - &qmi_lte_bands, - NULL); - - mm_bands = mm_modem_bands_from_qmi_band_capabilities (qmi_bands, qmi_lte_bands); - - if (mm_bands->len == 0) { - g_array_unref (mm_bands); - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse the list of supported bands"); - } else { - g_simple_async_result_set_op_res_gpointer (simple, - mm_bands, - (GDestroyNotify)g_array_unref); - } - } - - if (output) - qmi_message_dms_get_band_capabilities_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -modem_load_supported_bands (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) - return; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_bands); - - mm_dbg ("loading band capabilities..."); - qmi_client_dms_get_band_capabilities (QMI_CLIENT_DMS (client), - NULL, - 5, - NULL, - (GAsyncReadyCallback)dms_get_band_capabilities_ready, - result); -} - -/*****************************************************************************/ -/* Load current bands (Modem interface) */ - -static GArray * -modem_load_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); -} - -#if defined WITH_NEWEST_QMI_COMMANDS - -static void -nas_get_rf_band_information_ready (QmiClientNas *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageNasGetRfBandInformationOutput *output; - GError *error = NULL; - - output = qmi_client_nas_get_rf_band_information_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_nas_get_rf_band_information_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get current band information: "); - g_simple_async_result_take_error (simple, error); - } else { - GArray *mm_bands; - GArray *info_array = NULL; - - qmi_message_nas_get_rf_band_information_output_get_list (output, &info_array, NULL); - - mm_bands = mm_modem_bands_from_qmi_rf_band_information_array (info_array); - - if (mm_bands->len == 0) { - g_array_unref (mm_bands); - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse the list of current bands"); - } else { - g_simple_async_result_set_op_res_gpointer (simple, - mm_bands, - (GDestroyNotify)g_array_unref); - } - } - - if (output) - qmi_message_nas_get_rf_band_information_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -#endif /* WITH_NEWEST_QMI_COMMANDS */ - -static void -load_bands_get_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get system selection preference: "); - g_simple_async_result_take_error (simple, error); - } else { - GArray *mm_bands; - QmiNasBandPreference band_preference_mask = 0; - QmiNasLteBandPreference lte_band_preference_mask = 0; - - qmi_message_nas_get_system_selection_preference_output_get_band_preference ( - output, - &band_preference_mask, - NULL); - - qmi_message_nas_get_system_selection_preference_output_get_lte_band_preference ( - output, - <e_band_preference_mask, - NULL); - - mm_bands = mm_modem_bands_from_qmi_band_preference (band_preference_mask, - lte_band_preference_mask); - - if (mm_bands->len == 0) { - g_array_unref (mm_bands); - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't parse the list of current bands"); - } else { - gchar *str; - - str = qmi_nas_band_preference_build_string_from_mask (band_preference_mask); - mm_dbg ("Bands reported in system selection preference: '%s'", str); - g_free (str); - - g_simple_async_result_set_op_res_gpointer (simple, - mm_bands, - (GDestroyNotify)g_array_unref); - } - } - - if (output) - qmi_message_nas_get_system_selection_preference_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -modem_load_current_bands (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_current_bands); - - mm_dbg ("loading current bands..."); - -#if defined WITH_NEWEST_QMI_COMMANDS - /* Introduced in NAS 1.19 */ - if (qmi_client_check_version (client, 1, 19)) { - qmi_client_nas_get_rf_band_information (QMI_CLIENT_NAS (client), - NULL, - 5, - NULL, - (GAsyncReadyCallback)nas_get_rf_band_information_ready, - result); - return; - } -#endif - - qmi_client_nas_get_system_selection_preference ( - QMI_CLIENT_NAS (client), - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)load_bands_get_system_selection_preference_ready, - result); -} - -/*****************************************************************************/ -/* Set current bands (Modem interface) */ - -static gboolean -set_current_bands_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -bands_set_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set system selection preference: "); - g_simple_async_result_take_error (simple, error); - - } else - /* Good! TODO: do we really need to wait for the indication? */ - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - - if (output) - qmi_message_nas_set_system_selection_preference_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -set_current_bands (MMIfaceModem *_self, - GArray *bands_array, - GAsyncReadyCallback callback, - gpointer user_data) -{ - MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - QmiMessageNasSetSystemSelectionPreferenceInput *input; - GSimpleAsyncResult *result; - QmiClient *client = NULL; - QmiNasBandPreference qmi_bands = 0; - QmiNasLteBandPreference qmi_lte_bands = 0; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_bands); - - /* Handle ANY separately */ - if (bands_array->len == 1 && - g_array_index (bands_array, MMModemBand, 0) == MM_MODEM_BAND_ANY) { - if (!self->priv->supported_bands) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot handle 'ANY' if supported bands are unknown"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); - return; - } - - mm_modem_bands_to_qmi_band_preference (self->priv->supported_bands, - &qmi_bands, - &qmi_lte_bands); - } else - mm_modem_bands_to_qmi_band_preference (bands_array, - &qmi_bands, - &qmi_lte_bands); - - input = qmi_message_nas_set_system_selection_preference_input_new (); - qmi_message_nas_set_system_selection_preference_input_set_band_preference (input, qmi_bands, NULL); - if (mm_iface_modem_is_3gpp_lte (_self)) - qmi_message_nas_set_system_selection_preference_input_set_lte_band_preference (input, qmi_lte_bands, NULL); - - qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); - - qmi_client_nas_set_system_selection_preference ( - QMI_CLIENT_NAS (client), - input, - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)bands_set_system_selection_preference_ready, - result); - qmi_message_nas_set_system_selection_preference_input_unref (input); -} - -/*****************************************************************************/ -/* Load supported modes (Modem interface) */ - -static GArray * -modem_load_supported_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); -} - -static void -modem_load_supported_modes (MMIfaceModem *_self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; - GArray *combinations; - MMModemModeCombination mode; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_modes); - - if (!self->priv->supported_radio_interfaces) { - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot load supported modes, no radio interface list"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); - return; - } - - /* Build combinations - * - * (1) If current capabilities [GSM/UMTS]: - * [2G only] - * [3G only] - * [2G + 3G] - * [2G + 3G] 2G preferred - * [2G + 3G] 3G preferred - * - * (2) If current capabilities [CDMA/EVDO]: - * [2G only] - * [3G only] - * - * (3) If current capabilities [LTE]: - * [4G only] - * - * (4) If current capabilities [GSM/UMTS + CDMA/EVDO]: - * [2G only] - * [3G only] - * [2G + 3G] - * [2G + 3G] 2G preferred - * [2G + 3G] 3G preferred - * - * (5) If current capabilities [GSM/UMTS + LTE]: - * [2G + 3G + 4G] - * - * (6) If current capabilities [CDMA/EVDO + LTE]: - * [2G + 3G + 4G] - * - * (7) If current capabilities [GSM/UMTS + CDMA/EVDO + LTE]: - * [2G + 3G + 4G] - */ - - combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 5); - - /* LTE only, don't allow further mode switching */ - if (mm_iface_modem_is_3gpp_lte_only (_self)) { - /* 4G only */ - mode.allowed = MM_MODEM_MODE_4G; - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); - } - /* LTE and others, only allow to have all, no further preference */ - else if (mm_iface_modem_is_3gpp_lte (_self)) { - /* 2G, 3G and 4G */ - mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); - } - /* Non-LTE modem, include allowed and preferred combinations */ - else { - MMModemMode mask_all; - guint i; - GArray *all; - GArray *filtered; - - - /* Build all, based on the supported radio interfaces */ - mask_all = MM_MODEM_MODE_NONE; - for (i = 0; i < self->priv->supported_radio_interfaces->len; i++) - mask_all |= mm_modem_mode_from_qmi_radio_interface (g_array_index (self->priv->supported_radio_interfaces, - QmiDmsRadioInterface, - i)); - - - /* 2G only */ - mode.allowed = MM_MODEM_MODE_2G; - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); - /* 3G only */ - mode.allowed = MM_MODEM_MODE_3G; - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); - /* 2G and 3G */ - mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - mode.preferred = MM_MODEM_MODE_NONE; - g_array_append_val (combinations, mode); - /* 2G and 3G, 2G preferred */ - mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - mode.preferred = MM_MODEM_MODE_2G; - g_array_append_val (combinations, mode); - /* 2G and 3G, 3G preferred */ - mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); - mode.preferred = MM_MODEM_MODE_3G; - g_array_append_val (combinations, mode); - - /* Filter out those unsupported modes */ - mode.allowed = mask_all; - mode.preferred = MM_MODEM_MODE_NONE; - all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); - g_array_append_val (all, mode); - filtered = mm_filter_supported_modes (all, combinations); - g_array_unref (all); - g_array_unref (combinations); - combinations = filtered; - } - - g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); -} - -/*****************************************************************************/ /* Load supported IP families (Modem interface) */ static MMBearerIpFamily @@ -2585,11 +1314,15 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_BEARER_IP_FAMILY_NONE; + GError *inner_error = NULL; + gssize value; - return (MMBearerIpFamily) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_BEARER_IP_FAMILY_NONE; + } + return (MMBearerIpFamily)value; } static void @@ -2597,28 +1330,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_load_supported_ip_families); + GTask *task; + task = g_task_new (self, NULL, callback, user_data); if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) /* CDMA-only: IPv4 */ - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_BEARER_IP_FAMILY_IPV4), - NULL); + g_task_return_int (task, MM_BEARER_IP_FAMILY_IPV4); else /* Assume IPv4 + IPv6 supported */ - g_simple_async_result_set_op_res_gpointer ( - result, - GUINT_TO_POINTER (MM_BEARER_IP_FAMILY_IPV4 | MM_BEARER_IP_FAMILY_IPV6 | MM_BEARER_IP_FAMILY_IPV4V6), - NULL); - - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, + MM_BEARER_IP_FAMILY_IPV4 | + MM_BEARER_IP_FAMILY_IPV6 | + MM_BEARER_IP_FAMILY_IPV4V6); + g_object_unref (task); } /*****************************************************************************/ @@ -2644,32 +1368,20 @@ return TRUE; } -typedef struct { - MMBroadbandModemQmi *self; - QmiClient *client; - GSimpleAsyncResult *result; -} LoadSignalQualityContext; - -static void -load_signal_quality_context_complete_and_free (LoadSignalQualityContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_free (ctx); -} - static guint load_signal_quality_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return 0; + GError *inner_error = NULL; + gssize value; - return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return 0; + } + return value; } #if defined WITH_NEWEST_QMI_COMMANDS @@ -2771,8 +1483,9 @@ static void get_signal_info_ready (QmiClientNas *client, GAsyncResult *res, - LoadSignalQualityContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageNasGetSignalInfoOutput *output; GError *error = NULL; guint8 quality = 0; @@ -2780,42 +1493,41 @@ output = qmi_client_nas_get_signal_info_finish (client, res, &error); if (!output) { - g_simple_async_result_take_error (ctx->result, error); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_nas_get_signal_info_output_get_result (output, &error)) { qmi_message_nas_get_signal_info_output_unref (output); - g_simple_async_result_take_error (ctx->result, error); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - if (!signal_info_get_quality (ctx->self, output, &quality, &act)) { + self = g_task_get_source_object (task); + + if (!signal_info_get_quality (self, output, &quality, &act)) { qmi_message_nas_get_signal_info_output_unref (output); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Signal info reported invalid signal strength."); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Signal info reported invalid signal strength."); + g_object_unref (task); return; } /* We update the access technologies directly here when loading signal * quality. It goes a bit out of context, but we can do it nicely */ mm_iface_modem_update_access_technologies ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM (self), act, (MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK | MM_IFACE_MODEM_CDMA_ALL_ACCESS_TECHNOLOGIES_MASK)); - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (quality), - NULL); + g_task_return_int (task, quality); + g_object_unref (task); qmi_message_nas_get_signal_info_output_unref (output); - load_signal_quality_context_complete_and_free (ctx); } #endif /* WITH_NEWEST_QMI_COMMANDS */ @@ -2880,8 +1592,9 @@ static void get_signal_strength_ready (QmiClientNas *client, GAsyncResult *res, - LoadSignalQualityContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageNasGetSignalStrengthOutput *output; GError *error = NULL; guint8 quality = 0; @@ -2889,42 +1602,41 @@ output = qmi_client_nas_get_signal_strength_finish (client, res, &error); if (!output) { - g_simple_async_result_take_error (ctx->result, error); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_nas_get_signal_strength_output_get_result (output, &error)) { qmi_message_nas_get_signal_strength_output_unref (output); - g_simple_async_result_take_error (ctx->result, error); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - if (!signal_strength_get_quality_and_access_tech (ctx->self, output, &quality, &act)) { + self = g_task_get_source_object (task); + + if (!signal_strength_get_quality_and_access_tech (self, output, &quality, &act)) { qmi_message_nas_get_signal_strength_output_unref (output); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "GetSignalStrength signal strength invalid."); - load_signal_quality_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "GetSignalStrength signal strength invalid."); + g_object_unref (task); return; } /* We update the access technologies directly here when loading signal * quality. It goes a bit out of context, but we can do it nicely */ mm_iface_modem_update_access_technologies ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM (self), act, (MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK | MM_IFACE_MODEM_CDMA_ALL_ACCESS_TECHNOLOGIES_MASK)); - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (quality), - NULL); + g_task_return_int (task, quality); + g_object_unref (task); qmi_message_nas_get_signal_strength_output_unref (output); - load_signal_quality_context_complete_and_free (ctx); } static void @@ -2932,43 +1644,37 @@ GAsyncReadyCallback callback, gpointer user_data) { - LoadSignalQualityContext *ctx; QmiClient *client = NULL; + GTask *task; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - ctx = g_new0 (LoadSignalQualityContext, 1); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_signal_quality); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("loading signal quality..."); #if defined WITH_NEWEST_QMI_COMMANDS /* Signal info introduced in NAS 1.8 */ - if (qmi_client_check_version (ctx->client, 1, 8)) { - qmi_client_nas_get_signal_info (QMI_CLIENT_NAS (ctx->client), + if (qmi_client_check_version (client, 1, 8)) { + qmi_client_nas_get_signal_info (QMI_CLIENT_NAS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_signal_info_ready, - ctx); + task); return; } #endif /* WITH_NEWEST_QMI_COMMANDS */ - qmi_client_nas_get_signal_strength (QMI_CLIENT_NAS (ctx->client), + qmi_client_nas_get_signal_strength (QMI_CLIENT_NAS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_signal_strength_ready, - ctx); + task); } /*****************************************************************************/ @@ -2982,20 +1688,15 @@ } SetOperatingModeStep; typedef struct { - MMBroadbandModemQmi *self; QmiClientDms *client; - GSimpleAsyncResult *result; QmiMessageDmsSetOperatingModeInput *input; SetOperatingModeStep step; } SetOperatingModeContext; static void -set_operating_mode_context_complete_and_free (SetOperatingModeContext *ctx) +set_operating_mode_context_free (SetOperatingModeContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); - g_object_unref (ctx->self); qmi_message_dms_set_operating_mode_input_unref (ctx->input); g_slice_free (SetOperatingModeContext, ctx); } @@ -3005,19 +1706,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void set_operating_mode_context_step (SetOperatingModeContext *ctx); +static void set_operating_mode_context_step (GTask *task); static void dms_set_fcc_authentication_ready (QmiClientDms *client, GAsyncResult *res, - SetOperatingModeContext *ctx) + GTask *task) { + SetOperatingModeContext *ctx; QmiMessageDmsSetFccAuthenticationOutput *output = NULL; GError *error = NULL; + ctx = g_task_get_task_data (task); + output = qmi_client_dms_set_fcc_authentication_finish (client, res, &error); if (!output || !qmi_message_dms_set_fcc_authentication_output_get_result (output, &error)) { /* No hard errors */ @@ -3030,17 +1734,20 @@ /* Retry Set Operating Mode */ ctx->step++; - set_operating_mode_context_step (ctx); + set_operating_mode_context_step (task); } static void dms_set_operating_mode_ready (QmiClientDms *client, GAsyncResult *res, - SetOperatingModeContext *ctx) + GTask *task) { + SetOperatingModeContext *ctx; QmiMessageDmsSetOperatingModeOutput *output = NULL; GError *error = NULL; + ctx = g_task_get_task_data (task); + output = qmi_client_dms_set_operating_mode_finish (client, res, &error); if (!output) { /* If unsupported, just go out without errors */ @@ -3048,13 +1755,13 @@ mm_dbg ("Device doesn't support operating mode setting. Ignoring power update."); g_error_free (error); ctx->step = SET_OPERATING_MODE_STEP_LAST; - set_operating_mode_context_step (ctx); + set_operating_mode_context_step (task); return; } g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - set_operating_mode_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -3065,7 +1772,7 @@ * Some new devices, like the Dell DW5770, will return an internal error when * trying to bring the power mode to online. * - * Other devices, like some rebranded EM7455 modules, will return a "invalid + * Other devices, like some rebranded EM7455 modules, will return an "invalid * transition" instead when trying to bring the power mode to online. * * We can avoid this by sending the magic "DMS Set FCC Auth" message before @@ -3079,26 +1786,32 @@ g_error_free (error); /* Go on to FCC auth */ ctx->step++; - set_operating_mode_context_step (ctx); + set_operating_mode_context_step (task); qmi_message_dms_set_operating_mode_output_unref (output); return; } g_prefix_error (&error, "Couldn't set operating mode: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_dms_set_operating_mode_output_unref (output); - set_operating_mode_context_complete_and_free (ctx); return; } + qmi_message_dms_set_operating_mode_output_unref (output); + /* Good! we're done, go to last step */ ctx->step = SET_OPERATING_MODE_STEP_LAST; - set_operating_mode_context_step (ctx); + set_operating_mode_context_step (task); } static void -set_operating_mode_context_step (SetOperatingModeContext *ctx) +set_operating_mode_context_step (GTask *task) { + SetOperatingModeContext *ctx; + + ctx = g_task_get_task_data (task); + switch (ctx->step) { case SET_OPERATING_MODE_STEP_FIRST: mm_dbg ("Setting device operating mode..."); @@ -3107,7 +1820,7 @@ 20, NULL, (GAsyncReadyCallback)dms_set_operating_mode_ready, - ctx); + task); return; case SET_OPERATING_MODE_STEP_FCC_AUTH: mm_dbg ("Setting FCC auth..."); @@ -3116,7 +1829,7 @@ 5, NULL, (GAsyncReadyCallback)dms_set_fcc_authentication_ready, - ctx); + task); return; case SET_OPERATING_MODE_STEP_RETRY: mm_dbg ("Setting device operating mode (retry)..."); @@ -3125,12 +1838,12 @@ 20, NULL, (GAsyncReadyCallback)dms_set_operating_mode_ready, - ctx); + task); return; case SET_OPERATING_MODE_STEP_LAST: /* Good! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_operating_mode_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; default: g_assert_not_reached (); @@ -3144,26 +1857,27 @@ gpointer user_data) { SetOperatingModeContext *ctx; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; /* Setup context */ ctx = g_slice_new0 (SetOperatingModeContext); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_power_up_down_off); ctx->input = qmi_message_dms_set_operating_mode_input_new (); qmi_message_dms_set_operating_mode_input_set_mode (ctx->input, mode, NULL); ctx->step = SET_OPERATING_MODE_STEP_FIRST; - set_operating_mode_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, + ctx, + (GDestroyNotify)set_operating_mode_context_free); + + set_operating_mode_context_step (task); } static void @@ -3207,16 +1921,21 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_POWER_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemPowerState)GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_POWER_STATE_UNKNOWN; + } + return (MMModemPowerState)value; } static void dms_get_operating_mode_ready (QmiClientDms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageDmsGetOperatingModeOutput *output = NULL; GError *error = NULL; @@ -3224,10 +1943,10 @@ output = qmi_client_dms_get_operating_mode_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_dms_get_operating_mode_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get operating mode: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { QmiDmsOperatingMode mode = QMI_DMS_OPERATING_MODE_UNKNOWN; @@ -3235,23 +1954,23 @@ switch (mode) { case QMI_DMS_OPERATING_MODE_ONLINE: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_ON), NULL); + g_task_return_int (task, MM_MODEM_POWER_STATE_ON); break; case QMI_DMS_OPERATING_MODE_LOW_POWER: case QMI_DMS_OPERATING_MODE_PERSISTENT_LOW_POWER: case QMI_DMS_OPERATING_MODE_MODE_ONLY_LOW_POWER: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_LOW), NULL); + g_task_return_int (task, MM_MODEM_POWER_STATE_LOW); break; case QMI_DMS_OPERATING_MODE_OFFLINE: - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER (MM_MODEM_POWER_STATE_OFF), NULL); + g_task_return_int (task, MM_MODEM_POWER_STATE_OFF); break; default: - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled power state: '%s' (%u)", - qmi_dms_operating_mode_get_string (mode), - mode); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled power state: '%s' (%u)", + qmi_dms_operating_mode_get_string (mode), + mode); break; } } @@ -3259,8 +1978,7 @@ if (output) qmi_message_dms_get_operating_mode_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -3268,26 +1986,20 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_power_state); - mm_dbg ("Getting device operating mode..."); qmi_client_dms_get_operating_mode (QMI_CLIENT_DMS (client), NULL, 5, NULL, (GAsyncReadyCallback)dms_get_operating_mode_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -3315,606 +2027,6 @@ } /*****************************************************************************/ -/* Reset (Modem interface) */ - -static gboolean -modem_reset_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - - -static void -modem_reset_power_cycle_ready (MMBroadbandModemQmi *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - GError *error = NULL; - - if (!power_cycle_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); - else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - - -static void -modem_reset (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_reset); - - /* Power cycle the modem */ - power_cycle (MM_BROADBAND_MODEM_QMI (self), - (GAsyncReadyCallback)modem_reset_power_cycle_ready, - result); -} - -/*****************************************************************************/ -/* Factory reset (Modem interface) */ - -static gboolean -modem_factory_reset_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -dms_restore_factory_defaults_ready (QmiClientDms *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessageDmsRestoreFactoryDefaultsOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_dms_restore_factory_defaults_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_dms_restore_factory_defaults_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't restore factory defaults: "); - g_simple_async_result_take_error (simple, error); - } else { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } - - if (output) - qmi_message_dms_restore_factory_defaults_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -modem_factory_reset (MMIfaceModem *self, - const gchar *code, - GAsyncReadyCallback callback, - gpointer user_data) -{ - QmiMessageDmsRestoreFactoryDefaultsInput *input; - GSimpleAsyncResult *result; - QmiClient *client = NULL; - GError *error = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) - return; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_factory_reset); - - input = qmi_message_dms_restore_factory_defaults_input_new (); - if (!qmi_message_dms_restore_factory_defaults_input_set_service_programming_code ( - input, - code, - &error)) { - qmi_message_dms_restore_factory_defaults_input_unref (input); - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); - return; - } - - mm_dbg ("performing a factory reset..."); - qmi_client_dms_restore_factory_defaults (QMI_CLIENT_DMS (client), - input, - 10, - NULL, - (GAsyncReadyCallback)dms_restore_factory_defaults_ready, - result); -} - -/*****************************************************************************/ -/* Load current modes (Modem interface) */ - -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *client; - GSimpleAsyncResult *result; - gboolean run_get_system_selection_preference; - gboolean run_get_technology_preference; -} LoadCurrentModesContext; - -typedef struct { - MMModemMode allowed; - MMModemMode preferred; -} LoadCurrentModesResult; - -static void -load_current_modes_context_complete_and_free (LoadCurrentModesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_free (ctx); -} - -static gboolean -load_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - MMModemMode *allowed, - MMModemMode *preferred, - GError **error) -{ - LoadCurrentModesResult *result; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return FALSE; - - result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - *allowed = result->allowed; - *preferred = result->preferred; - return TRUE; -} - -static void load_current_modes_context_step (LoadCurrentModesContext *ctx); - -static void -get_technology_preference_ready (QmiClientNas *client, - GAsyncResult *res, - LoadCurrentModesContext *ctx) -{ - LoadCurrentModesResult *result = NULL; - QmiMessageNasGetTechnologyPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_get_technology_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_get_technology_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't get technology preference: %s", error->message); - g_error_free (error); - } else { - MMModemMode allowed; - QmiNasRadioTechnologyPreference preference_mask; - - qmi_message_nas_get_technology_preference_output_get_active ( - output, - &preference_mask, - NULL, /* duration */ - NULL); - allowed = mm_modem_mode_from_qmi_radio_technology_preference (preference_mask); - if (allowed == MM_MODEM_MODE_NONE) { - gchar *str; - - str = qmi_nas_radio_technology_preference_build_string_from_mask (preference_mask); - mm_dbg ("Unsupported modes reported: '%s'", str); - g_free (str); - } else { - /* We got a valid value from here */ - result = g_new (LoadCurrentModesResult, 1); - result->allowed = allowed; - result->preferred = MM_MODEM_MODE_NONE; - } - } - - if (output) - qmi_message_nas_get_technology_preference_output_unref (output); - - if (!result) { - ctx->run_get_technology_preference = FALSE; - load_current_modes_context_step (ctx); - return; - } - - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - result, - (GDestroyNotify)g_free); - load_current_modes_context_complete_and_free (ctx); -} - -static void -current_modes_get_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - LoadCurrentModesContext *ctx) -{ - LoadCurrentModesResult *result = NULL; - QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - QmiNasRatModePreference mode_preference_mask = 0; - - output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't get system selection preference: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( - output, - &mode_preference_mask, - NULL)) { - mm_dbg ("Mode preference not reported in system selection preference"); - } else { - MMModemMode allowed; - - allowed = mm_modem_mode_from_qmi_rat_mode_preference (mode_preference_mask); - if (allowed == MM_MODEM_MODE_NONE) { - gchar *str; - - str = qmi_nas_rat_mode_preference_build_string_from_mask (mode_preference_mask); - mm_dbg ("Unsupported modes reported: '%s'", str); - g_free (str); - } else { - QmiNasGsmWcdmaAcquisitionOrderPreference gsm_or_wcdma; - - /* We got a valid value from here */ - result = g_new (LoadCurrentModesResult, 1); - result->allowed = allowed; - result->preferred = MM_MODEM_MODE_NONE; - - if ((mode_preference_mask & QMI_NAS_RAT_MODE_PREFERENCE_GSM) && - (mode_preference_mask & QMI_NAS_RAT_MODE_PREFERENCE_UMTS) && - qmi_message_nas_get_system_selection_preference_output_get_gsm_wcdma_acquisition_order_preference ( - output, - &gsm_or_wcdma, - NULL)) { - result->preferred = mm_modem_mode_from_qmi_gsm_wcdma_acquisition_order_preference (gsm_or_wcdma); - } - } - } - - if (output) - qmi_message_nas_get_system_selection_preference_output_unref (output); - - if (!result) { - /* Try with the deprecated command */ - ctx->run_get_system_selection_preference = FALSE; - load_current_modes_context_step (ctx); - return; - } - - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - result, - (GDestroyNotify)g_free); - load_current_modes_context_complete_and_free (ctx); -} - -static void -load_current_modes_context_step (LoadCurrentModesContext *ctx) -{ - if (ctx->run_get_system_selection_preference) { - qmi_client_nas_get_system_selection_preference ( - ctx->client, - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)current_modes_get_system_selection_preference_ready, - ctx); - return; - } - - if (ctx->run_get_technology_preference) { - qmi_client_nas_get_technology_preference ( - ctx->client, - NULL, /* no input */ - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)get_technology_preference_ready, - ctx); - return; - } - - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Loading current modes is not supported by this device"); - load_current_modes_context_complete_and_free (ctx); -} - -static void -load_current_modes (MMIfaceModem *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - LoadCurrentModesContext *ctx; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - ctx = g_new0 (LoadCurrentModesContext, 1); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_current_modes); - - /* System selection preference introduced in NAS 1.1 */ - ctx->run_get_system_selection_preference = qmi_client_check_version (client, 1, 1); - - /* Technology preference introduced in NAS 1.0, so always available */ - ctx->run_get_technology_preference = TRUE; - - load_current_modes_context_step (ctx); -} - -/*****************************************************************************/ -/* Set allowed modes (Modem interface) */ - -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *client; - GSimpleAsyncResult *result; - MMModemMode allowed; - MMModemMode preferred; - gboolean run_set_system_selection_preference; - gboolean run_set_technology_preference; -} SetCurrentModesContext; - -static void -set_current_modes_context_complete_and_free (SetCurrentModesContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (SetCurrentModesContext, ctx); -} - -static gboolean -set_current_modes_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void set_current_modes_context_step (SetCurrentModesContext *ctx); - -static void -set_technology_preference_ready (QmiClientNas *client, - GAsyncResult *res, - SetCurrentModesContext *ctx) -{ - QmiMessageNasSetTechnologyPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_set_technology_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_set_technology_preference_output_get_result (output, &error) && - !g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - mm_dbg ("Couldn't set technology preference: %s", error->message); - g_error_free (error); - qmi_message_nas_set_technology_preference_output_unref (output); - } else { - if (error) - g_error_free (error); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_modes_context_complete_and_free (ctx); - qmi_message_nas_set_technology_preference_output_unref (output); - return; - } - - ctx->run_set_technology_preference = FALSE; - set_current_modes_context_step (ctx); -} - -static void -allowed_modes_set_system_selection_preference_ready (QmiClientNas *client, - GAsyncResult *res, - SetCurrentModesContext *ctx) -{ - QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); - if (!output) { - mm_dbg ("QMI operation failed: %s", error->message); - g_error_free (error); - } else if (!qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) { - mm_dbg ("Couldn't set system selection preference: %s", error->message); - g_error_free (error); - qmi_message_nas_set_system_selection_preference_output_unref (output); - } else { - /* Good! TODO: do we really need to wait for the indication? */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_modes_context_complete_and_free (ctx); - qmi_message_nas_set_system_selection_preference_output_unref (output); - return; - } - - /* Try with the deprecated command */ - ctx->run_set_system_selection_preference = FALSE; - set_current_modes_context_step (ctx); -} - -static void -set_current_modes_context_step (SetCurrentModesContext *ctx) -{ - if (ctx->run_set_system_selection_preference) { - QmiMessageNasSetSystemSelectionPreferenceInput *input; - QmiNasRatModePreference pref; - - pref = mm_modem_mode_to_qmi_rat_mode_preference (ctx->allowed, - mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->self)), - mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))); - if (!pref) { - gchar *str; - - str = mm_modem_mode_build_string_from_mask (ctx->allowed); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled allowed mode setting: '%s'", - str); - g_free (str); - set_current_modes_context_complete_and_free (ctx); - return; - } - - input = qmi_message_nas_set_system_selection_preference_input_new (); - qmi_message_nas_set_system_selection_preference_input_set_mode_preference (input, pref, NULL); - - /* Only set acquisition order preference if both 2G and 3G given as allowed */ - if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self)) && - ctx->allowed & MM_MODEM_MODE_2G && - ctx->allowed & MM_MODEM_MODE_3G) { - QmiNasGsmWcdmaAcquisitionOrderPreference order; - - order = mm_modem_mode_to_qmi_gsm_wcdma_acquisition_order_preference (ctx->preferred); - qmi_message_nas_set_system_selection_preference_input_set_gsm_wcdma_acquisition_order_preference (input, order, NULL); - } - - qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); - - qmi_client_nas_set_system_selection_preference ( - ctx->client, - input, - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)allowed_modes_set_system_selection_preference_ready, - ctx); - qmi_message_nas_set_system_selection_preference_input_unref (input); - return; - } - - if (ctx->run_set_technology_preference) { - QmiMessageNasSetTechnologyPreferenceInput *input; - QmiNasRadioTechnologyPreference pref; - - if (ctx->preferred != MM_MODEM_MODE_NONE) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot set specific preferred mode"); - set_current_modes_context_complete_and_free (ctx); - return; - } - - pref = mm_modem_mode_to_qmi_radio_technology_preference (ctx->allowed, - mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->self))); - if (!pref) { - gchar *str; - - str = mm_modem_mode_build_string_from_mask (ctx->allowed); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unhandled allowed mode setting: '%s'", - str); - g_free (str); - set_current_modes_context_complete_and_free (ctx); - return; - } - - input = qmi_message_nas_set_technology_preference_input_new (); - qmi_message_nas_set_technology_preference_input_set_current (input, pref, QMI_NAS_PREFERENCE_DURATION_PERMANENT, NULL); - - qmi_client_nas_set_technology_preference ( - ctx->client, - input, - 5, - NULL, /* cancellable */ - (GAsyncReadyCallback)set_technology_preference_ready, - ctx); - qmi_message_nas_set_technology_preference_input_unref (input); - return; - } - - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Setting allowed modes is not supported by this device"); - set_current_modes_context_complete_and_free (ctx); -} - -static void -set_current_modes (MMIfaceModem *self, - MMModemMode allowed, - MMModemMode preferred, - GAsyncReadyCallback callback, - gpointer user_data) -{ - SetCurrentModesContext *ctx; - QmiClient *client = NULL; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - ctx = g_slice_new0 (SetCurrentModesContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - set_current_modes); - - if (allowed == MM_MODEM_MODE_ANY && ctx->preferred == MM_MODEM_MODE_NONE) { - ctx->allowed = MM_MODEM_MODE_NONE; - if (mm_iface_modem_is_2g (self)) - ctx->allowed |= MM_MODEM_MODE_2G; - if (mm_iface_modem_is_3g (self)) - ctx->allowed |= MM_MODEM_MODE_3G; - if (mm_iface_modem_is_4g (self)) - ctx->allowed |= MM_MODEM_MODE_4G; - ctx->preferred = MM_MODEM_MODE_NONE; - } else { - ctx->allowed = allowed; - ctx->preferred = preferred; - } - - /* System selection preference introduced in NAS 1.1 */ - ctx->run_set_system_selection_preference = qmi_client_check_version (client, 1, 1); - - /* Technology preference introduced in NAS 1.0, so always available */ - ctx->run_set_technology_preference = TRUE; - - set_current_modes_context_step (ctx); -} - -/*****************************************************************************/ /* IMEI loading (3GPP interface) */ static gchar * @@ -3922,14 +2034,7 @@ GAsyncResult *res, GError **error) { - gchar *imei; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - imei = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded IMEI: %s", imei); - return imei; + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -3938,47 +2043,36 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_imei); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->imei) - g_simple_async_result_set_op_res_gpointer (result, - self->priv->imei, - NULL); + g_task_return_pointer (task, g_strdup (self->priv->imei), g_free); else - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device doesn't report a valid IMEI"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device doesn't report a valid IMEI"); + g_object_unref (task); } /*****************************************************************************/ /* Facility locks status loading (3GPP interface) */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; QmiClient *client; guint current; MMModem3gppFacility facilities; MMModem3gppFacility locks; } LoadEnabledFacilityLocksContext; -static void get_next_facility_lock_status (LoadEnabledFacilityLocksContext *ctx); +static void get_next_facility_lock_status (GTask *task); static void -load_enabled_facility_locks_context_complete_and_free (LoadEnabledFacilityLocksContext *ctx) +load_enabled_facility_locks_context_free (LoadEnabledFacilityLocksContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); - g_object_unref (ctx->self); g_free (ctx); } @@ -3987,21 +2081,28 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_3GPP_FACILITY_NONE; + GError *inner_error = NULL; + gssize value; - return ((MMModem3gppFacility) GPOINTER_TO_UINT ( - g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_3GPP_FACILITY_NONE; + } + return (MMModem3gppFacility)value; } static void get_sim_lock_status_via_pin_status_ready (QmiClientDms *client, GAsyncResult *res, - LoadEnabledFacilityLocksContext *ctx) + GTask *task) { + LoadEnabledFacilityLocksContext *ctx; QmiMessageDmsUimGetPinStatusOutput *output; gboolean enabled; + ctx = g_task_get_task_data (task); + output = qmi_client_dms_uim_get_pin_status_finish (client, res, NULL); if (!output || !qmi_message_dms_uim_get_pin_status_output_get_result (output, NULL)) { @@ -4034,17 +2135,19 @@ } /* No more facilities to query, all done */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (ctx->locks), - NULL); - load_enabled_facility_locks_context_complete_and_free (ctx); + g_task_return_int (task, ctx->locks); + g_object_unref (task); } /* the SIM lock cannot be queried with the qmi_get_ck_status function, * therefore using the PIN status */ static void -get_sim_lock_status_via_pin_status (LoadEnabledFacilityLocksContext *ctx) +get_sim_lock_status_via_pin_status (GTask *task) { + LoadEnabledFacilityLocksContext *ctx; + + ctx = g_task_get_task_data (task); + mm_dbg ("Retrieving PIN status to check for enabled PIN"); /* if the SIM is locked or not can only be queried by locking at * the PIN status */ @@ -4053,17 +2156,19 @@ 5, NULL, (GAsyncReadyCallback)get_sim_lock_status_via_pin_status_ready, - ctx); + task); } static void dms_uim_get_ck_status_ready (QmiClientDms *client, GAsyncResult *res, - LoadEnabledFacilityLocksContext *ctx) + GTask *task) { + LoadEnabledFacilityLocksContext *ctx; gchar *facility_str; QmiMessageDmsUimGetCkStatusOutput *output; + ctx = g_task_get_task_data (task); facility_str = mm_modem_3gpp_facility_build_string_from_mask (1 << ctx->current); output = qmi_client_dms_uim_get_ck_status_finish (client, res, NULL); if (!output || @@ -4099,14 +2204,17 @@ /* And go on with the next one */ ctx->current++; - get_next_facility_lock_status (ctx); + get_next_facility_lock_status (task); } static void -get_next_facility_lock_status (LoadEnabledFacilityLocksContext *ctx) +get_next_facility_lock_status (GTask *task) { + LoadEnabledFacilityLocksContext *ctx; guint i; + ctx = g_task_get_task_data (task); + for (i = ctx->current; i < sizeof (MMModem3gppFacility) * 8; i++) { guint32 facility = 1 << i; @@ -4128,13 +2236,13 @@ 5, NULL, (GAsyncReadyCallback)dms_uim_get_ck_status_ready, - ctx); + task); qmi_message_dms_uim_get_ck_status_input_unref (input); return; } } - get_sim_lock_status_via_pin_status (ctx); + get_sim_lock_status_via_pin_status (task); } static void @@ -4143,20 +2251,17 @@ gpointer user_data) { LoadEnabledFacilityLocksContext *ctx; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; ctx = g_new (LoadEnabledFacilityLocksContext, 1); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_enabled_facility_locks); + /* Set initial list of facilities to query */ ctx->facilities = (MM_MODEM_3GPP_FACILITY_PH_SIM | MM_MODEM_3GPP_FACILITY_NET_PERS | @@ -4166,7 +2271,10 @@ ctx->locks = MM_MODEM_3GPP_FACILITY_NONE; ctx->current = 0; - get_next_facility_lock_status (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_enabled_facility_locks_context_free); + + get_next_facility_lock_status (task); } /*****************************************************************************/ @@ -4177,11 +2285,7 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - /* We return the GList as it is */ - return (GList *) g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static MMModem3gppNetworkAvailability @@ -4253,7 +2357,7 @@ static void nas_network_scan_ready (QmiClientNas *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageNasNetworkScanOutput *output = NULL; GError *error = NULL; @@ -4261,10 +2365,10 @@ output = qmi_client_nas_network_scan_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_nas_network_scan_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't scan networks: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else { GList *scan_result = NULL; GArray *info_array = NULL; @@ -4298,16 +2402,13 @@ g_free (rat_array_used_flags); } - /* We *require* a callback in the async method, as we're not setting a - * GDestroyNotify callback */ - g_simple_async_result_set_op_res_gpointer (simple, scan_result, NULL); + g_task_return_pointer (task, scan_result, (GDestroyNotify)mm_3gpp_network_info_list_free); } if (output) qmi_message_nas_network_scan_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -4315,7 +2416,6 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; QmiClient *client = NULL; /* We will pass the GList in the GSimpleAsyncResult, so we must @@ -4323,232 +2423,95 @@ * passed to the caller and deallocated afterwards */ g_assert (callback != NULL); - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_scan_networks); - mm_dbg ("Scanning networks..."); qmi_client_nas_network_scan (QMI_CLIENT_NAS (client), NULL, 300, NULL, (GAsyncReadyCallback)nas_network_scan_ready, - result); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Load operator name (3GPP interface) */ static gchar * -modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *_self, +modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - - if (self->priv->current_operator_description) - return g_strdup (self->priv->current_operator_description); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Current operator description is still unknown"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_3gpp_load_operator_name (MMIfaceModem3gpp *self, +modem_3gpp_load_operator_name (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); - /* Just finish the async operation */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_operator_name); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (self->priv->current_operator_description) + g_task_return_pointer (task, + g_strdup (self->priv->current_operator_description), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Current operator description is still unknown"); + g_object_unref (task); } /*****************************************************************************/ /* Load operator code (3GPP interface) */ static gchar * -modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *_self, +modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - - if (self->priv->current_operator_id) - return g_strdup (self->priv->current_operator_id); - - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Current operator MCC/MNC is still unknown"); - return NULL; + return g_task_propagate_pointer (G_TASK (res), error); } static void -modem_3gpp_load_operator_code (MMIfaceModem3gpp *self, +modem_3gpp_load_operator_code (MMIfaceModem3gpp *_self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - /* Just finish the async operation */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_load_operator_code); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); -} - -/*****************************************************************************/ -/* Register in network (3GPP interface) */ - -static gboolean -modem_3gpp_register_in_network_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -initiate_network_register_ready (QmiClientNas *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - GError *error = NULL; - QmiMessageNasInitiateNetworkRegisterOutput *output; - - output = qmi_client_nas_initiate_network_register_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - } else if (!qmi_message_nas_initiate_network_register_output_get_result (output, &error)) { - /* NOFX is not an error, they actually play pretty well */ - if (g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - g_error_free (error); - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } else { - g_prefix_error (&error, "Couldn't initiate network register: "); - g_simple_async_result_take_error (simple, error); - } - } else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - - if (output) - qmi_message_nas_initiate_network_register_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -modem_3gpp_register_in_network (MMIfaceModem3gpp *self, - const gchar *operator_id, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - guint16 mcc = 0; - guint16 mnc = 0; - QmiClient *client = NULL; - QmiMessageNasInitiateNetworkRegisterInput *input; - GError *error = NULL; - - /* Parse input MCC/MNC */ - if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) { - g_assert (error != NULL); - g_simple_async_report_take_gerror_in_idle (G_OBJECT (self), - callback, - user_data, - error); - return; - } - - /* Get NAS client */ - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) - return; - - input = qmi_message_nas_initiate_network_register_input_new (); - - if (mcc) { - /* If the user sent a specific network to use, lock it in. */ - qmi_message_nas_initiate_network_register_input_set_action ( - input, - QMI_NAS_NETWORK_REGISTER_TYPE_MANUAL, - NULL); - qmi_message_nas_initiate_network_register_input_set_manual_registration_info_3gpp ( - input, - mcc, - mnc, - QMI_NAS_RADIO_INTERFACE_UNKNOWN, - NULL); - } else { - /* Otherwise, automatic registration */ - qmi_message_nas_initiate_network_register_input_set_action ( - input, - QMI_NAS_NETWORK_REGISTER_TYPE_AUTOMATIC, - NULL); - } + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GTask *task; - qmi_client_nas_initiate_network_register ( - QMI_CLIENT_NAS (client), - input, - 120, - cancellable, - (GAsyncReadyCallback)initiate_network_register_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_register_in_network)); + task = g_task_new (self, NULL, callback, user_data); - qmi_message_nas_initiate_network_register_input_unref (input); + if (self->priv->current_operator_id) + g_task_return_pointer (task, + g_strdup (self->priv->current_operator_id), + g_free); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Current operator MCC/MNC is still unknown"); + g_object_unref (task); } /*****************************************************************************/ /* Registration checks (3GPP interface) */ -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *client; - GSimpleAsyncResult *result; -} Run3gppRegistrationChecksContext; - -static void -run_3gpp_registration_checks_context_complete_and_free (Run3gppRegistrationChecksContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -4568,6 +2531,7 @@ const gchar *description; gboolean has_pcs_digit; guint16 lac; + guint16 tac; guint32 cid; MMModemAccessTechnology mm_access_technologies; MMModem3gppRegistrationState mm_cs_registration_state; @@ -4630,7 +2594,7 @@ mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), reg_state_3gpp); mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), reg_state_3gpp); mm_iface_modem_3gpp_update_access_technologies (MM_IFACE_MODEM_3GPP (self), MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); - mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), 0, 0); + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), 0, 0, 0); return; } @@ -4683,8 +2647,10 @@ mcc, mnc); - g_free (self->priv->current_operator_description); - self->priv->current_operator_description = g_strdup (description); + g_clear_pointer (&self->priv->current_operator_description, g_free); + /* Some Telit modems apparently sometimes report non-UTF8 characters */ + if (g_utf8_validate (description, -1, NULL)) + self->priv->current_operator_description = g_strdup (description); } /* If MNC comes with PCS digit, we must make sure the additional @@ -4714,19 +2680,25 @@ /* Report new registration states */ mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), mm_cs_registration_state); mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), mm_ps_registration_state); + if (mm_access_technologies & MM_MODEM_ACCESS_TECHNOLOGY_LTE) + mm_iface_modem_3gpp_update_eps_registration_state (MM_IFACE_MODEM_3GPP (self), mm_ps_registration_state); - /* Get 3GPP location LAC and CI */ + /* Get 3GPP location LAC/TAC and CI */ lac = 0; + tac = 0; cid = 0; - if ((response_output && - qmi_message_nas_get_serving_system_output_get_lac_3gpp (response_output, &lac, NULL) && - qmi_message_nas_get_serving_system_output_get_cid_3gpp (response_output, &cid, NULL)) || - (indication_output && - qmi_indication_nas_serving_system_output_get_lac_3gpp (indication_output, &lac, NULL) && - qmi_indication_nas_serving_system_output_get_cid_3gpp (indication_output, &cid, NULL))) { - /* Only update info in the interface if we get something */ - mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cid); - } + if (response_output) { + qmi_message_nas_get_serving_system_output_get_lac_3gpp (response_output, &lac, NULL); + qmi_message_nas_get_serving_system_output_get_lte_tac (response_output, &tac, NULL); + qmi_message_nas_get_serving_system_output_get_cid_3gpp (response_output, &cid, NULL); + } else if (indication_output) { + qmi_indication_nas_serving_system_output_get_lac_3gpp (indication_output, &lac, NULL); + qmi_indication_nas_serving_system_output_get_lte_tac (indication_output, &tac, NULL); + qmi_indication_nas_serving_system_output_get_cid_3gpp (indication_output, &cid, NULL); + } + /* Only update info in the interface if we get something */ + if (cid && (lac || tac)) + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid); /* Note: don't update access technologies with the ones retrieved here; they * are not really the 'current' access technologies */ @@ -4735,32 +2707,35 @@ static void get_serving_system_3gpp_ready (QmiClientNas *client, GAsyncResult *res, - Run3gppRegistrationChecksContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageNasGetServingSystemOutput *output; GError *error = NULL; output = qmi_client_nas_get_serving_system_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - run_3gpp_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_nas_get_serving_system_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get serving system: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_nas_get_serving_system_output_unref (output); - run_3gpp_registration_checks_context_complete_and_free (ctx); return; } - common_process_serving_system_3gpp (ctx->self, output, NULL); + self = g_task_get_source_object (task); + + common_process_serving_system_3gpp (self, output, NULL); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); + g_object_unref (task); qmi_message_nas_get_serving_system_output_unref (output); - run_3gpp_registration_checks_context_complete_and_free (ctx); } #if defined WITH_NEWEST_QMI_COMMANDS @@ -4775,6 +2750,8 @@ gboolean forbidden, gboolean lac_valid, guint16 lac, + gboolean tac_valid, + guint16 tac, gboolean cid_valid, guint32 cid, gboolean network_id_valid, @@ -4783,6 +2760,7 @@ MMModem3gppRegistrationState *mm_cs_registration_state, MMModem3gppRegistrationState *mm_ps_registration_state, guint16 *mm_lac, + guint16 *mm_tac, guint32 *mm_cid, gchar **mm_operator_id) { @@ -4823,6 +2801,8 @@ /* If we're registered either at home or roaming, try to get LAC/CID */ if (lac_valid) *mm_lac = lac; + if (tac_valid) + *mm_tac = tac; if (cid_valid) *mm_cid = cid; } @@ -4937,11 +2917,13 @@ roaming_status_valid, roaming_status, forbidden_valid, forbidden, lac_valid, lac, + FALSE, 0, cid_valid, cid, network_id_valid, mcc, mnc, mm_cs_registration_state, mm_ps_registration_state, mm_lac, + NULL, mm_cid, mm_operator_id)) { mm_dbg ("No GSM service registered"); @@ -5044,11 +3026,13 @@ roaming_status_valid, roaming_status, forbidden_valid, forbidden, lac_valid, lac, + FALSE, 0, cid_valid, cid, network_id_valid, mcc, mnc, mm_cs_registration_state, mm_ps_registration_state, mm_lac, + NULL, mm_cid, mm_operator_id)) { mm_dbg ("No WCDMA service registered"); @@ -5064,6 +3048,7 @@ MMModem3gppRegistrationState *mm_cs_registration_state, MMModem3gppRegistrationState *mm_ps_registration_state, guint16 *mm_lac, + guint16 *mm_tac, guint32 *mm_cid, gchar **mm_operator_id) { @@ -5076,6 +3061,8 @@ gboolean forbidden; gboolean lac_valid; guint16 lac; + gboolean tac_valid; + guint16 tac; gboolean cid_valid; guint32 cid; gboolean network_id_valid; @@ -5088,6 +3075,7 @@ *mm_ps_registration_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; *mm_cs_registration_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; *mm_lac = 0; + *mm_tac = 0; *mm_cid = 0; g_free (*mm_operator_id); *mm_operator_id = NULL; @@ -5109,7 +3097,7 @@ &cid_valid, &cid, NULL, NULL, NULL, /* registration_reject_info */ &network_id_valid, &mcc, &mnc, - NULL, NULL, /* tac */ + &tac_valid, &tac, NULL)) { mm_dbg ("No LTE service reported"); /* No GSM service */ @@ -5132,7 +3120,7 @@ &cid_valid, &cid, NULL, NULL, NULL, /* registration_reject_info */ &network_id_valid, &mcc, &mnc, - NULL, NULL, /* tac */ + &tac_valid, &tac, NULL)) { mm_dbg ("No LTE service reported"); /* No GSM service */ @@ -5145,11 +3133,13 @@ roaming_status_valid, roaming_status, forbidden_valid, forbidden, lac_valid, lac, + tac_valid, tac, cid_valid, cid, network_id_valid, mcc, mnc, mm_cs_registration_state, mm_ps_registration_state, mm_lac, + mm_tac, mm_cid, mm_operator_id)) { mm_dbg ("No LTE service registered"); @@ -5167,12 +3157,15 @@ MMModem3gppRegistrationState cs_registration_state; MMModem3gppRegistrationState ps_registration_state; guint16 lac; + guint16 tac; guint32 cid; gchar *operator_id; + gboolean has_lte_info; ps_registration_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; cs_registration_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; lac = 0; + tac = 0; cid = 0; operator_id = NULL; @@ -5180,12 +3173,14 @@ * LTE > WCDMA > GSM * The first one giving results will be the one reported. */ - if (!process_lte_info (response_output, indication_output, - &cs_registration_state, - &ps_registration_state, - &lac, - &cid, - &operator_id) && + has_lte_info = process_lte_info (response_output, indication_output, + &cs_registration_state, + &ps_registration_state, + &lac, + &tac, + &cid, + &operator_id); + if (!has_lte_info && !process_wcdma_info (response_output, indication_output, &cs_registration_state, &ps_registration_state, @@ -5210,38 +3205,43 @@ /* Report new registration states */ mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), cs_registration_state); mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), ps_registration_state); - mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, cid); + if (has_lte_info) + mm_iface_modem_3gpp_update_eps_registration_state (MM_IFACE_MODEM_3GPP (self), ps_registration_state); + mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid); } static void get_system_info_ready (QmiClientNas *client, GAsyncResult *res, - Run3gppRegistrationChecksContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageNasGetSystemInfoOutput *output; GError *error = NULL; output = qmi_client_nas_get_system_info_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - run_3gpp_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_nas_get_system_info_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get system info: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); qmi_message_nas_get_system_info_output_unref (output); - run_3gpp_registration_checks_context_complete_and_free (ctx); + g_object_unref (task); return; } - common_process_system_info_3gpp (ctx->self, output, NULL); + self = g_task_get_source_object (task); + + common_process_system_info_3gpp (self, output, NULL); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); + g_object_unref (task); qmi_message_nas_get_system_info_output_unref (output); - run_3gpp_registration_checks_context_complete_and_free (ctx); } #endif /* WITH_NEWEST_QMI_COMMANDS */ @@ -5254,81 +3254,70 @@ GAsyncReadyCallback callback, gpointer user_data) { - Run3gppRegistrationChecksContext *ctx; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - ctx = g_new0 (Run3gppRegistrationChecksContext, 1); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_3gpp_run_registration_checks); + task = g_task_new (self, NULL, callback, user_data); #if defined WITH_NEWEST_QMI_COMMANDS /* System Info was added in NAS 1.8 */ if (qmi_client_check_version (client, 1, 8)) { - qmi_client_nas_get_system_info (ctx->client, + qmi_client_nas_get_system_info (QMI_CLIENT_NAS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_system_info_ready, - ctx); + task); return; } #endif /* WITH_NEWEST_QMI_COMMANDS */ - qmi_client_nas_get_serving_system (ctx->client, + qmi_client_nas_get_serving_system (QMI_CLIENT_NAS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_serving_system_3gpp_ready, - ctx); + task); } /*****************************************************************************/ /* Enable/Disable unsolicited registration events (3GPP interface) */ typedef struct { - MMBroadbandModemQmi *self; QmiClientNas *client; - GSimpleAsyncResult *result; gboolean enable; /* TRUE for enabling, FALSE for disabling */ } UnsolicitedRegistrationEventsContext; static void -unsolicited_registration_events_context_complete_and_free (UnsolicitedRegistrationEventsContext *ctx) +unsolicited_registration_events_context_free (UnsolicitedRegistrationEventsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); - g_object_unref (ctx->self); g_free (ctx); } -static UnsolicitedRegistrationEventsContext * -unsolicited_registration_events_context_new (MMBroadbandModemQmi *self, - QmiClient *client, - gboolean enable, - GAsyncReadyCallback callback, - gpointer user_data) +static GTask * +unsolicited_registration_events_task_new (MMBroadbandModemQmi *self, + QmiClient *client, + gboolean enable, + GAsyncReadyCallback callback, + gpointer user_data) { UnsolicitedRegistrationEventsContext *ctx; + GTask *task; ctx = g_new0 (UnsolicitedRegistrationEventsContext, 1); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - unsolicited_registration_events_context_new); ctx->enable = enable; - return ctx; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)unsolicited_registration_events_context_free); + + return task; } static gboolean @@ -5336,17 +3325,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void ri_serving_system_or_system_info_ready (QmiClientNas *client, GAsyncResult *res, - UnsolicitedRegistrationEventsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + UnsolicitedRegistrationEventsContext *ctx; QmiMessageNasRegisterIndicationsOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_nas_register_indications_finish (client, res, &error); if (!output) { mm_dbg ("QMI operation failed: '%s'", error->message); @@ -5360,16 +3354,18 @@ qmi_message_nas_register_indications_output_unref (output); /* Just ignore errors for now */ - ctx->self->priv->unsolicited_registration_events_enabled = ctx->enable; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - unsolicited_registration_events_context_complete_and_free (ctx); + self->priv->unsolicited_registration_events_enabled = ctx->enable; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -common_enable_disable_unsolicited_registration_events_serving_system (UnsolicitedRegistrationEventsContext *ctx) +common_enable_disable_unsolicited_registration_events_serving_system (GTask *task) { + UnsolicitedRegistrationEventsContext *ctx; QmiMessageNasRegisterIndicationsInput *input; + ctx = g_task_get_task_data (task); input = qmi_message_nas_register_indications_input_new (); qmi_message_nas_register_indications_input_set_serving_system_events (input, ctx->enable, NULL); qmi_client_nas_register_indications ( @@ -5378,16 +3374,18 @@ 5, NULL, (GAsyncReadyCallback)ri_serving_system_or_system_info_ready, - ctx); + task); qmi_message_nas_register_indications_input_unref (input); } #if defined WITH_NEWEST_QMI_COMMANDS static void -common_enable_disable_unsolicited_registration_events_system_info (UnsolicitedRegistrationEventsContext *ctx) +common_enable_disable_unsolicited_registration_events_system_info (GTask *task) { + UnsolicitedRegistrationEventsContext *ctx; QmiMessageNasRegisterIndicationsInput *input; + ctx = g_task_get_task_data (task); input = qmi_message_nas_register_indications_input_new (); qmi_message_nas_register_indications_input_set_system_info (input, ctx->enable, NULL); qmi_client_nas_register_indications ( @@ -5396,37 +3394,38 @@ 5, NULL, (GAsyncReadyCallback)ri_serving_system_or_system_info_ready, - ctx); + task); qmi_message_nas_register_indications_input_unref (input); } #endif /* WITH_NEWEST_QMI_COMMANDS */ static void -modem_3gpp_disable_unsolicited_registration_events (MMIfaceModem3gpp *self, +modem_3gpp_disable_unsolicited_registration_events (MMIfaceModem3gpp *_self, gboolean cs_supported, gboolean ps_supported, gboolean eps_supported, GAsyncReadyCallback callback, gpointer user_data) { - UnsolicitedRegistrationEventsContext *ctx; + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - ctx = unsolicited_registration_events_context_new (MM_BROADBAND_MODEM_QMI (self), - client, - FALSE, - callback, - user_data); + task = unsolicited_registration_events_task_new (self, + client, + FALSE, + callback, + user_data); #if defined WITH_NEWEST_QMI_COMMANDS /* System Info was added in NAS 1.8 */ if (qmi_client_check_version (client, 1, 8)) { - common_enable_disable_unsolicited_registration_events_system_info (ctx); + common_enable_disable_unsolicited_registration_events_system_info (task); return; } #endif /* WITH_NEWEST_QMI_COMMANDS */ @@ -5434,80 +3433,65 @@ /* Ability to explicitly enable/disable serving system indications was * added in NAS 1.2 */ if (qmi_client_check_version (client, 1, 2)) { - common_enable_disable_unsolicited_registration_events_serving_system (ctx); + common_enable_disable_unsolicited_registration_events_serving_system (task); return; } /* Devices with NAS < 1.2 will just always issue serving system indications */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device doesn't allow disabling registration events"); - ctx->self->priv->unsolicited_registration_events_enabled = FALSE; - unsolicited_registration_events_context_complete_and_free (ctx); + self->priv->unsolicited_registration_events_enabled = FALSE; + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device doesn't allow disabling registration events"); + g_object_unref (task); } static void -modem_3gpp_enable_unsolicited_registration_events (MMIfaceModem3gpp *self, +modem_3gpp_enable_unsolicited_registration_events (MMIfaceModem3gpp *_self, gboolean cs_supported, gboolean ps_supported, gboolean eps_supported, GAsyncReadyCallback callback, gpointer user_data) { - UnsolicitedRegistrationEventsContext *ctx; + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - ctx = unsolicited_registration_events_context_new (MM_BROADBAND_MODEM_QMI (self), - client, - TRUE, - callback, - user_data); + task = unsolicited_registration_events_task_new (self, + client, + TRUE, + callback, + user_data); /* Ability to explicitly enable/disable serving system indications was * added in NAS 1.2 */ if (qmi_client_check_version (client, 1, 2)) { - common_enable_disable_unsolicited_registration_events_serving_system (ctx); + common_enable_disable_unsolicited_registration_events_serving_system (task); return; } /* Devices with NAS < 1.2 will just always issue serving system indications */ mm_dbg ("Assuming serving system indications are always enabled"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - ctx->self->priv->unsolicited_registration_events_enabled = TRUE; - unsolicited_registration_events_context_complete_and_free (ctx); + self->priv->unsolicited_registration_events_enabled = TRUE; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ /* Registration checks (CDMA interface) */ -typedef struct { - MMBroadbandModemQmi *self; - QmiClientNas *client; - GSimpleAsyncResult *result; -} RunCdmaRegistrationChecksContext; - -static void -run_cdma_registration_checks_context_complete_and_free (RunCdmaRegistrationChecksContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (RunCdmaRegistrationChecksContext, ctx); -} - static gboolean modem_cdma_run_registration_checks_finish (MMIfaceModemCdma *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -5692,32 +3676,35 @@ static void get_serving_system_cdma_ready (QmiClientNas *client, GAsyncResult *res, - RunCdmaRegistrationChecksContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageNasGetServingSystemOutput *output; GError *error = NULL; output = qmi_client_nas_get_serving_system_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - run_cdma_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_nas_get_serving_system_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get serving system: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_nas_get_serving_system_output_unref (output); - run_cdma_registration_checks_context_complete_and_free (ctx); return; } - common_process_serving_system_cdma (ctx->self, output, NULL); + self = g_task_get_source_object (task); + + common_process_serving_system_cdma (self, output, NULL); qmi_message_nas_get_serving_system_output_unref (output); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - run_cdma_registration_checks_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -5727,65 +3714,43 @@ GAsyncReadyCallback callback, gpointer user_data) { - RunCdmaRegistrationChecksContext *ctx; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - /* Setup context */ - ctx = g_slice_new0 (RunCdmaRegistrationChecksContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_run_registration_checks); - /* TODO: Run Get System Info in NAS >= 1.8 */ - qmi_client_nas_get_serving_system (ctx->client, + qmi_client_nas_get_serving_system (QMI_CLIENT_NAS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_serving_system_cdma_ready, - ctx); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ /* Load initial activation state (CDMA interface) */ -typedef struct { - MMBroadbandModemQmi *self; - QmiClientDms *client; - GSimpleAsyncResult *result; -} LoadActivationStateContext; - -static void -load_activation_state_context_complete_and_free (LoadActivationStateContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (LoadActivationStateContext, ctx); -} - static MMModemCdmaActivationState modem_cdma_load_activation_state_finish (MMIfaceModemCdma *_self, GAsyncResult *res, GError **error) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GError *inner_error = NULL; + gssize value; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return MM_MODEM_CDMA_ACTIVATION_STATE_UNKNOWN; + } /* Cache the value and also return it */ - self->priv->activation_state = - (MMModemCdmaActivationState) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + self->priv->activation_state = (MMModemCdmaActivationState)value; return self->priv->activation_state; } @@ -5793,7 +3758,7 @@ static void get_activation_state_ready (QmiClientDms *client, GAsyncResult *res, - LoadActivationStateContext *ctx) + GTask *task) { QmiDmsActivationState state = QMI_DMS_ACTIVATION_STATE_NOT_ACTIVATED; QmiMessageDmsGetActivationStateOutput *output; @@ -5802,27 +3767,25 @@ output = qmi_client_dms_get_activation_state_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - load_activation_state_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_get_activation_state_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't get activation state: "); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_dms_get_activation_state_output_unref (output); - load_activation_state_context_complete_and_free (ctx); return; } qmi_message_dms_get_activation_state_output_get_info (output, &state, NULL); qmi_message_dms_get_activation_state_output_unref (output); - g_simple_async_result_set_op_res_gpointer ( - ctx->result, - GUINT_TO_POINTER (mm_modem_cdma_activation_state_from_qmi_activation_state (state)), - NULL); - load_activation_state_context_complete_and_free (ctx); + g_task_return_int (task, + mm_modem_cdma_activation_state_from_qmi_activation_state (state)); + g_object_unref (task); } static void @@ -5830,29 +3793,19 @@ GAsyncReadyCallback callback, gpointer user_data) { - LoadActivationStateContext *ctx; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - /* Setup context */ - ctx = g_slice_new0 (LoadActivationStateContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_load_activation_state); - - qmi_client_dms_get_activation_state (ctx->client, + qmi_client_dms_get_activation_state (QMI_CLIENT_DMS (client), NULL, 10, NULL, (GAsyncReadyCallback)get_activation_state_ready, - ctx); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -5865,14 +3818,13 @@ CDMA_ACTIVATION_STEP_ENABLE_INDICATIONS, CDMA_ACTIVATION_STEP_REQUEST_ACTIVATION, CDMA_ACTIVATION_STEP_WAIT_UNTIL_FINISHED, - CDMA_ACTIVATION_STEP_POWER_CYCLE, + CDMA_ACTIVATION_STEP_RESET, CDMA_ACTIVATION_STEP_LAST } CdmaActivationStep; typedef struct { MMBroadbandModemQmi *self; QmiClientDms *client; - GSimpleAsyncResult *result; CdmaActivationStep step; /* OTA activation... */ QmiMessageDmsActivateAutomaticInput *input_automatic; @@ -5886,10 +3838,10 @@ } CdmaActivationContext; static void -cdma_activation_context_complete_and_free (CdmaActivationContext *ctx) +cdma_activation_context_free (CdmaActivationContext *ctx) { - /* Cleanup the activation context from the private info */ - ctx->self->priv->activation_ctx = NULL; + /* Cleanup the activation task from the private info */ + ctx->self->priv->activation_task = NULL; for (ctx->segment_i = 0; ctx->segment_i < ctx->n_segments; ctx->segment_i++) g_array_unref (ctx->segments[ctx->segment_i]); @@ -5899,8 +3851,6 @@ qmi_message_dms_activate_automatic_input_unref (ctx->input_automatic); if (ctx->input_manual) qmi_message_dms_activate_manual_input_unref (ctx->input_manual); - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); g_object_unref (ctx->self); g_slice_free (CdmaActivationContext, ctx); @@ -5911,7 +3861,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean @@ -5919,10 +3869,10 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void cdma_activation_context_step (CdmaActivationContext *ctx); +static void cdma_activation_context_step (GTask *task); static void cdma_activation_disable_indications (CdmaActivationContext *ctx) @@ -5942,40 +3892,45 @@ } static void -activation_power_cycle_ready (MMBroadbandModemQmi *self, - GAsyncResult *res, - CdmaActivationContext *ctx) +activation_reset_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) { + CdmaActivationContext *ctx; GError *error = NULL; - if (!power_cycle_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - cdma_activation_context_complete_and_free (ctx); + if (!mm_shared_qmi_reset_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* And go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); } static gboolean -retry_msisdn_check_cb (CdmaActivationContext *ctx) +retry_msisdn_check_cb (GTask *task) { - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); return G_SOURCE_REMOVE; } static void activate_manual_get_msisdn_ready (QmiClientDms *client, GAsyncResult *res, - CdmaActivationContext *ctx) + GTask *task) { + CdmaActivationContext *ctx; QmiMessageDmsGetMsisdnOutput *output = NULL; GError *error = NULL; const gchar *current_mdn = NULL; const gchar *expected_mdn = NULL; + ctx = g_task_get_task_data (task); + qmi_message_dms_activate_manual_input_get_info (ctx->input_manual, NULL, /* spc */ NULL, /* sid */ @@ -5992,7 +3947,7 @@ qmi_message_dms_get_msisdn_output_unref (output); /* And go on to next step */ ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); return; } @@ -6002,16 +3957,16 @@ if (ctx->n_mdn_check_retries < MAX_MDN_CHECK_RETRIES) { /* Retry after some time */ mm_dbg ("MDN not yet updated, retrying..."); - g_timeout_add (1, (GSourceFunc) retry_msisdn_check_cb, ctx); + g_timeout_add (1, (GSourceFunc) retry_msisdn_check_cb, task); return; } /* Well, all retries consumed already, return error */ - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "MDN was not correctly set during manual activation"); - cdma_activation_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "MDN was not correctly set during manual activation"); + g_object_unref (task); } static void @@ -6052,24 +4007,26 @@ /* Now, if we have a FINAL state, finish the ongoing activation state request */ if (new != MM_MODEM_CDMA_ACTIVATION_STATE_ACTIVATING) { + GTask *task; CdmaActivationContext *ctx; - g_assert (self->priv->activation_ctx != NULL); - ctx = (CdmaActivationContext *)self->priv->activation_ctx; + g_assert (self->priv->activation_task != NULL); + task = self->priv->activation_task; + ctx = g_task_get_task_data (task); /* Disable further indications. */ cdma_activation_disable_indications (ctx); /* If there is any error, finish the async method */ if (error) { - g_simple_async_result_take_error (ctx->result, error); - cdma_activation_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Otherwise, go on to next step */ ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); return; } @@ -6079,26 +4036,29 @@ static void activate_automatic_ready (QmiClientDms *client, GAsyncResult *res, - CdmaActivationContext *ctx) + GTask *task) { + CdmaActivationContext *ctx; QmiMessageDmsActivateAutomaticOutput *output; GError *error = NULL; + ctx = g_task_get_task_data (task); + output = qmi_client_dms_activate_automatic_finish (client, res, &error); if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); cdma_activation_disable_indications (ctx); - cdma_activation_context_complete_and_free (ctx); + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_activate_automatic_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't request OTA activation: "); - g_simple_async_result_take_error (ctx->result, error); qmi_message_dms_activate_automatic_output_unref (output); cdma_activation_disable_indications (ctx); - cdma_activation_context_complete_and_free (ctx); + g_prefix_error (&error, "Couldn't request OTA activation: "); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6106,30 +4066,33 @@ /* Keep on */ ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); } static void activate_manual_ready (QmiClientDms *client, GAsyncResult *res, - CdmaActivationContext *ctx) + GTask *task) { + CdmaActivationContext *ctx; QmiMessageDmsActivateManualOutput *output; GError *error = NULL; + ctx = g_task_get_task_data (task); + output = qmi_client_dms_activate_manual_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - cdma_activation_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_activate_manual_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't request manual activation: "); - g_simple_async_result_take_error (ctx->result, error); qmi_message_dms_activate_manual_output_unref (output); - cdma_activation_context_complete_and_free (ctx); + g_prefix_error (&error, "Couldn't request manual activation: "); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6140,40 +4103,43 @@ ctx->segment_i++; if (ctx->segment_i < ctx->n_segments) { /* There's a pending segment */ - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); return; } } /* No more segments to send, go on */ ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); } static void ser_activation_state_ready (QmiClientDms *client, GAsyncResult *res, - CdmaActivationContext *ctx) + GTask *task) { + CdmaActivationContext *ctx; QmiMessageDmsSetEventReportOutput *output; GError *error = NULL; + ctx = g_task_get_task_data (task); + /* We cannot ignore errors, we NEED the indications to finish the * activation request properly */ output = qmi_client_dms_set_event_report_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - cdma_activation_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_set_event_report_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set event report: "); - g_simple_async_result_take_error (ctx->result, error); qmi_message_dms_set_event_report_output_unref (output); - cdma_activation_context_complete_and_free (ctx); + g_prefix_error (&error, "Couldn't set event report: "); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -6189,12 +4155,16 @@ /* Keep on */ ctx->step++; - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); } static void -cdma_activation_context_step (CdmaActivationContext *ctx) +cdma_activation_context_step (GTask *task) { + CdmaActivationContext *ctx; + + ctx = g_task_get_task_data (task); + switch (ctx->step) { case CDMA_ACTIVATION_STEP_FIRST: ctx->step++; @@ -6215,7 +4185,7 @@ 5, NULL, (GAsyncReadyCallback)ser_activation_state_ready, - ctx); + task); qmi_message_dms_set_event_report_input_unref (input); return; } @@ -6236,7 +4206,7 @@ 10, NULL, (GAsyncReadyCallback)activate_automatic_ready, - ctx); + task); return; } @@ -6260,7 +4230,7 @@ 10, NULL, (GAsyncReadyCallback)activate_manual_ready, - ctx); + task); return; case CDMA_ACTIVATION_STEP_WAIT_UNTIL_FINISHED: @@ -6280,20 +4250,20 @@ 5, NULL, (GAsyncReadyCallback)activate_manual_get_msisdn_ready, - ctx); + task); return; - case CDMA_ACTIVATION_STEP_POWER_CYCLE: + case CDMA_ACTIVATION_STEP_RESET: mm_info ("Activation step [4/5]: power-cycling..."); - power_cycle (ctx->self, - (GAsyncReadyCallback)activation_power_cycle_ready, - ctx); + mm_shared_qmi_reset (MM_IFACE_MODEM (ctx->self), + (GAsyncReadyCallback)activation_reset_ready, + task); return; case CDMA_ACTIVATION_STEP_LAST: mm_info ("Activation step [5/5]: finished"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - cdma_activation_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; default: @@ -6308,29 +4278,24 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; CdmaActivationContext *ctx; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_activate); + task = g_task_new (self, NULL, callback, user_data); /* Fail if we have already an activation ongoing */ - if (self->priv->activation_ctx) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "An activation operation is already in progress"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (self->priv->activation_task) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "An activation operation is already in progress"); + g_object_unref (task); return; } @@ -6338,17 +4303,18 @@ ctx = g_slice_new0 (CdmaActivationContext); ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = result; ctx->step = CDMA_ACTIVATION_STEP_FIRST; /* Build base input bundle for the Automatic activation */ ctx->input_automatic = qmi_message_dms_activate_automatic_input_new (); qmi_message_dms_activate_automatic_input_set_activation_code (ctx->input_automatic, carrier_code, NULL); - /* We keep the activation context in the private data, so that we don't + g_task_set_task_data (task, ctx, (GDestroyNotify)cdma_activation_context_free); + + /* We keep the activation task in the private data, so that we don't * allow multiple activation requests at the same time. */ - self->priv->activation_ctx = ctx; - cdma_activation_context_step (ctx); + self->priv->activation_task = task; + cdma_activation_context_step (task); } static void @@ -6358,29 +4324,24 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; CdmaActivationContext *ctx; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_activate_manual); + task = g_task_new (self, NULL, callback, user_data); /* Fail if we have already an activation ongoing */ - if (self->priv->activation_ctx) { - g_simple_async_result_set_error ( - result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "An activation operation is already in progress"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (self->priv->activation_task) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "An activation operation is already in progress"); + g_object_unref (task); return; } @@ -6388,11 +4349,12 @@ ctx = g_slice_new0 (CdmaActivationContext); ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = result; - /* We keep the activation context in the private data, so that we don't + g_task_set_task_data (task, ctx, (GDestroyNotify)cdma_activation_context_free); + + /* We keep the activation task in the private data, so that we don't * allow multiple activation requests at the same time. */ - self->priv->activation_ctx = ctx; + self->priv->activation_task = task; /* Build base input bundle for the Manual activation */ ctx->input_manual = qmi_message_dms_activate_manual_input_new (); @@ -6459,7 +4421,7 @@ #undef MAX_PRL_SEGMENT_SIZE } - cdma_activation_context_step (ctx); + cdma_activation_context_step (task); } /*****************************************************************************/ @@ -6471,7 +4433,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } #if defined WITH_NEWEST_QMI_COMMANDS @@ -6502,25 +4464,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_setup_cleanup_unsolicited_registration_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->unsolicited_registration_events_setup) { mm_dbg ("Unsolicited registration events already %s; skipping", enable ? "setup" : "cleanup"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -6561,9 +4519,8 @@ } } - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -6607,14 +4564,7 @@ GAsyncResult *res, GError **error) { - gchar *meid; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - meid = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded MEID: %s", meid); - return meid; + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -6623,24 +4573,18 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_load_meid); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->meid) - g_simple_async_result_set_op_res_gpointer (result, - self->priv->meid, - NULL); + g_task_return_pointer (task, g_strdup (self->priv->meid), g_free); else - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device doesn't report a valid MEID"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device doesn't report a valid MEID"); + g_object_unref (task); } /*****************************************************************************/ @@ -6651,14 +4595,7 @@ GAsyncResult *res, GError **error) { - gchar *esn; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - esn = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); - mm_dbg ("loaded ESN: %s", esn); - return esn; + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -6667,24 +4604,18 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_cdma_load_esn); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->esn) - g_simple_async_result_set_op_res_gpointer (result, - self->priv->esn, - NULL); + g_task_return_pointer (task, g_strdup (self->priv->esn), g_free); else - g_simple_async_result_set_error (result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Device doesn't report a valid ESN"); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Device doesn't report a valid ESN"); + g_object_unref (task); } /*****************************************************************************/ @@ -6699,19 +4630,14 @@ */ typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; QmiClientNas *client; gboolean enable; } EnableUnsolicitedEventsContext; static void -enable_unsolicited_events_context_complete_and_free (EnableUnsolicitedEventsContext *ctx) +enable_unsolicited_events_context_free (EnableUnsolicitedEventsContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); - g_object_unref (ctx->self); g_free (ctx); } @@ -6720,17 +4646,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void ser_signal_strength_ready (QmiClientNas *client, GAsyncResult *res, - EnableUnsolicitedEventsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + EnableUnsolicitedEventsContext *ctx; QmiMessageNasSetEventReportOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_nas_set_event_report_finish (client, res, &error); if (!output) { mm_dbg ("QMI operation failed: '%s'", error->message); @@ -6744,20 +4675,23 @@ qmi_message_nas_set_event_report_output_unref (output); /* Just ignore errors for now */ - ctx->self->priv->unsolicited_events_enabled = ctx->enable; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_unsolicited_events_context_complete_and_free (ctx); + self->priv->unsolicited_events_enabled = ctx->enable; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -common_enable_disable_unsolicited_events_signal_strength (EnableUnsolicitedEventsContext *ctx) +common_enable_disable_unsolicited_events_signal_strength (GTask *task) { + EnableUnsolicitedEventsContext *ctx; + /* The device doesn't really like to have many threshold values, so don't * grow this array without checking first */ static const gint8 thresholds_data[] = { -80, -40, 0, 40, 80 }; QmiMessageNasSetEventReportInput *input; GArray *thresholds; + ctx = g_task_get_task_data (task); input = qmi_message_nas_set_event_report_input_new (); /* Prepare thresholds, separated 20 each */ @@ -6779,7 +4713,7 @@ 5, NULL, (GAsyncReadyCallback)ser_signal_strength_ready, - ctx); + task); qmi_message_nas_set_event_report_input_unref (input); } @@ -6788,11 +4722,16 @@ static void ri_signal_info_ready (QmiClientNas *client, GAsyncResult *res, - EnableUnsolicitedEventsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + EnableUnsolicitedEventsContext *ctx; QmiMessageNasRegisterIndicationsOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_nas_register_indications_finish (client, res, &error); if (!output) { mm_dbg ("QMI operation failed: '%s'", error->message); @@ -6806,16 +4745,18 @@ qmi_message_nas_register_indications_output_unref (output); /* Just ignore errors for now */ - ctx->self->priv->unsolicited_events_enabled = ctx->enable; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_unsolicited_events_context_complete_and_free (ctx); + self->priv->unsolicited_events_enabled = ctx->enable; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -common_enable_disable_unsolicited_events_signal_info (EnableUnsolicitedEventsContext *ctx) +common_enable_disable_unsolicited_events_signal_info (GTask *task) { + EnableUnsolicitedEventsContext *ctx; QmiMessageNasRegisterIndicationsInput *input; + ctx = g_task_get_task_data (task); input = qmi_message_nas_register_indications_input_new (); qmi_message_nas_register_indications_input_set_signal_info (input, ctx->enable, NULL); qmi_client_nas_register_indications ( @@ -6824,14 +4765,14 @@ 5, NULL, (GAsyncReadyCallback)ri_signal_info_ready, - ctx); + task); qmi_message_nas_register_indications_input_unref (input); } static void config_signal_info_ready (QmiClientNas *client, GAsyncResult *res, - EnableUnsolicitedEventsContext *ctx) + GTask *task) { QmiMessageNasConfigSignalInfoOutput *output = NULL; GError *error = NULL; @@ -6849,21 +4790,24 @@ qmi_message_nas_config_signal_info_output_unref (output); /* Keep on */ - common_enable_disable_unsolicited_events_signal_info (ctx); + common_enable_disable_unsolicited_events_signal_info (task); } static void -common_enable_disable_unsolicited_events_signal_info_config (EnableUnsolicitedEventsContext *ctx) +common_enable_disable_unsolicited_events_signal_info_config (GTask *task) { + EnableUnsolicitedEventsContext *ctx; /* RSSI values go between -105 and -60 for 3GPP technologies, * and from -105 to -90 in 3GPP2 technologies (approx). */ static const gint8 thresholds_data[] = { -100, -97, -95, -92, -90, -85, -80, -75, -70, -65 }; QmiMessageNasConfigSignalInfoInput *input; GArray *thresholds; + ctx = g_task_get_task_data (task); + /* Signal info config only to be run when enabling */ if (!ctx->enable) { - common_enable_disable_unsolicited_events_signal_info (ctx); + common_enable_disable_unsolicited_events_signal_info (task); return; } @@ -6884,7 +4828,7 @@ 5, NULL, (GAsyncReadyCallback)config_signal_info_ready, - ctx); + task); qmi_message_nas_config_signal_info_input_unref (input); } @@ -6897,43 +4841,38 @@ gpointer user_data) { EnableUnsolicitedEventsContext *ctx; - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_enable_disable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->unsolicited_events_enabled) { mm_dbg ("Unsolicited events already %s; skipping", enable ? "enabled" : "disabled"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } ctx = g_new0 (EnableUnsolicitedEventsContext, 1); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->enable = enable; - ctx->result = result; + + g_task_set_task_data (task, ctx, (GDestroyNotify)enable_unsolicited_events_context_free); #if defined WITH_NEWEST_QMI_COMMANDS /* Signal info introduced in NAS 1.8 */ if (qmi_client_check_version (client, 1, 8)) { - common_enable_disable_unsolicited_events_signal_info_config (ctx); + common_enable_disable_unsolicited_events_signal_info_config (task); return; } #endif /* WITH_NEWEST_QMI_COMMANDS */ - common_enable_disable_unsolicited_events_signal_strength (ctx); + common_enable_disable_unsolicited_events_signal_strength (task); } /*****************************************************************************/ @@ -7010,7 +4949,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -7094,25 +5033,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_enable_disable_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->unsolicited_events_setup) { mm_dbg ("Unsolicited events already %s; skipping", enable ? "setup" : "cleanup"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -7152,9 +5087,8 @@ } #endif /* WITH_NEWEST_QMI_COMMANDS */ - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -7231,22 +5165,20 @@ GAsyncResult *res, GError **error) { - /* no error expected here */ - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_messaging_check_support_ready (MMIfaceModemMessaging *_self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); self->priv->messaging_fallback_at = iface_modem_messaging_parent->check_support_finish (_self, res, NULL); - g_simple_async_result_set_op_res_gboolean (simple, self->priv->messaging_fallback_at); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, self->priv->messaging_fallback_at); + g_object_unref (task); } static void @@ -7254,29 +5186,26 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - MMPortQmi *port; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_check_support); + task = g_task_new (self, NULL, callback, user_data); - port = mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)); /* If we have support for the WMS client, messaging is supported */ - if (!port || !mm_port_qmi_peek_client (port, QMI_SERVICE_WMS, MM_PORT_QMI_FLAG_DEFAULT)) { + if (!mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_WMS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL)) { /* Try to fallback to AT support */ iface_modem_messaging_parent->check_support ( self, (GAsyncReadyCallback)parent_messaging_check_support_ready, - result); + task); return; } mm_dbg ("Messaging capabilities supported"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -7298,6 +5227,8 @@ return iface_modem_messaging_parent->load_supported_storages_finish (_self, res, mem1, mem2, mem3, error); } + g_assert (g_task_propagate_boolean (G_TASK (res), NULL)); + *mem1 = g_array_sized_new (FALSE, FALSE, sizeof (MMSmsStorage), 2); /* Add SM storage only if not CDMA-only */ if (!mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { @@ -7317,7 +5248,7 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; /* Handle fallback */ if (self->priv->messaging_fallback_at) { @@ -7325,13 +5256,9 @@ return; } - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_load_supported_storages); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -7349,7 +5276,7 @@ return iface_modem_messaging_parent->setup_sms_format_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -7358,7 +5285,7 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; /* Handle fallback */ if (self->priv->messaging_fallback_at) { @@ -7366,13 +5293,9 @@ } /* noop */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_messaging_setup_sms_format); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -7390,13 +5313,13 @@ return iface_modem_messaging_parent->set_default_storage_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error);; } static void wms_set_routes_ready (QmiClientWms *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageWmsSetRoutesOutput *output = NULL; GError *error = NULL; @@ -7404,19 +5327,17 @@ output = qmi_client_wms_set_routes_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else if (!qmi_message_wms_set_routes_output_get_result (output, &error)) { g_prefix_error (&error, "Couldn't set routes: "); - g_simple_async_result_take_error (simple, error); - } else { - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - } + g_task_return_error (task, error); + } else + g_task_return_boolean (task, TRUE); + + g_object_unref (task); if (output) qmi_message_wms_set_routes_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -7426,7 +5347,6 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; QmiClient *client = NULL; QmiMessageWmsSetRoutesInput *input; GArray *routes_array; @@ -7438,16 +5358,11 @@ return; } - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_WMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_WMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_set_default_storage); - /* Build routes array and add it as input * Just worry about Class 0 and Class 1 messages for now */ input = qmi_message_wms_set_routes_input_new (); @@ -7467,7 +5382,7 @@ 5, NULL, (GAsyncReadyCallback)wms_set_routes_ready, - result); + g_task_new (self, NULL, callback, user_data)); qmi_message_wms_set_routes_input_unref (input); g_array_unref (routes_array); @@ -7496,8 +5411,6 @@ } LoadInitialSmsPartsStep; typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; QmiClientWms *client; MMSmsStorage storage; LoadInitialSmsPartsStep step; @@ -7508,16 +5421,12 @@ } LoadInitialSmsPartsContext; static void -load_initial_sms_parts_context_complete_and_free (LoadInitialSmsPartsContext *ctx) +load_initial_sms_parts_context_free (LoadInitialSmsPartsContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->message_array) g_array_unref (ctx->message_array); g_object_unref (ctx->client); - g_object_unref (ctx->self); g_slice_free (LoadInitialSmsPartsContext, ctx); } @@ -7533,10 +5442,10 @@ return iface_modem_messaging_parent->load_initial_sms_parts_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error);; } -static void read_next_sms_part (LoadInitialSmsPartsContext *ctx); +static void read_next_sms_part (GTask *task); static void add_new_read_sms_part (MMIfaceModemMessaging *self, @@ -7588,11 +5497,16 @@ static void wms_raw_read_ready (QmiClientWms *client, GAsyncResult *res, - LoadInitialSmsPartsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + LoadInitialSmsPartsContext *ctx; QmiMessageWmsRawReadOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Ignore errors, just keep on with the next messages */ output = qmi_client_wms_raw_read_finish (client, res, &error); @@ -7618,7 +5532,7 @@ &format, &data, NULL); - add_new_read_sms_part (MM_IFACE_MODEM_MESSAGING (ctx->self), + add_new_read_sms_part (MM_IFACE_MODEM_MESSAGING (self), mm_sms_storage_to_qmi_storage_type (ctx->storage), message->memory_index, tag, @@ -7631,17 +5545,20 @@ /* Keep on reading parts */ ctx->i++; - read_next_sms_part (ctx); + read_next_sms_part (task); } -static void load_initial_sms_parts_step (LoadInitialSmsPartsContext *ctx); +static void load_initial_sms_parts_step (GTask *task); static void -read_next_sms_part (LoadInitialSmsPartsContext *ctx) +read_next_sms_part (GTask *task) { + LoadInitialSmsPartsContext *ctx; QmiMessageWmsListMessagesOutputMessageListElement *message; QmiMessageWmsRawReadInput *input; + ctx = g_task_get_task_data (task); + if (ctx->i >= ctx->message_array->len || !ctx->message_array) { /* If we just listed all SMS, we're done. Otherwise go to next tag. */ @@ -7651,7 +5568,7 @@ ctx->step = LOAD_INITIAL_SMS_PARTS_STEP_CDMA_LAST; else ctx->step++; - load_initial_sms_parts_step (ctx); + load_initial_sms_parts_step (task); return; } @@ -7685,24 +5602,27 @@ 3, NULL, (GAsyncReadyCallback)wms_raw_read_ready, - ctx); + task); qmi_message_wms_raw_read_input_unref (input); } static void wms_list_messages_ready (QmiClientWms *client, GAsyncResult *res, - LoadInitialSmsPartsContext *ctx) + GTask *task) { + LoadInitialSmsPartsContext *ctx; QmiMessageWmsListMessagesOutput *output = NULL; GError *error = NULL; GArray *message_array; + ctx = g_task_get_task_data (task); + output = qmi_client_wms_list_messages_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - load_initial_sms_parts_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -7711,7 +5631,7 @@ mm_dbg ("Couldn't read SMS messages: %s", error->message); g_error_free (error); ctx->step++; - load_initial_sms_parts_step (ctx); + load_initial_sms_parts_step (task); qmi_message_wms_list_messages_output_unref (output); return; } @@ -7730,25 +5650,30 @@ /* Start reading parts */ ctx->i = 0; - read_next_sms_part (ctx); + read_next_sms_part (task); } static void -load_initial_sms_parts_step (LoadInitialSmsPartsContext *ctx) +load_initial_sms_parts_step (GTask *task) { + MMBroadbandModemQmi *self; + LoadInitialSmsPartsContext *ctx; QmiMessageWmsListMessagesInput *input; gint mode = -1; gint tag_type = -1; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case LOAD_INITIAL_SMS_PARTS_STEP_FIRST: ctx->step++; /* Fall down */ case LOAD_INITIAL_SMS_PARTS_STEP_3GPP_FIRST: /* If modem doesn't have 3GPP caps, skip 3GPP SMS */ - if (!mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) { + if (!mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) { ctx->step = LOAD_INITIAL_SMS_PARTS_STEP_3GPP_LAST; - load_initial_sms_parts_step (ctx); + load_initial_sms_parts_step (task); return; } ctx->step++; @@ -7787,9 +5712,9 @@ /* Fall down */ case LOAD_INITIAL_SMS_PARTS_STEP_CDMA_FIRST: /* If modem doesn't have CDMA caps, skip CDMA SMS */ - if (!mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->self))) { + if (!mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) { ctx->step = LOAD_INITIAL_SMS_PARTS_STEP_CDMA_LAST; - load_initial_sms_parts_step (ctx); + load_initial_sms_parts_step (task); return; } ctx->step++; @@ -7828,8 +5753,8 @@ /* Fall down */ case LOAD_INITIAL_SMS_PARTS_STEP_LAST: /* All steps done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - load_initial_sms_parts_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -7854,7 +5779,7 @@ 5, NULL, (GAsyncReadyCallback)wms_list_messages_ready, - ctx); + task); qmi_message_wms_list_messages_input_unref (input); } @@ -7866,6 +5791,7 @@ { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); LoadInitialSmsPartsContext *ctx; + GTask *task; QmiClient *client = NULL; /* Handle fallback */ @@ -7873,22 +5799,20 @@ return iface_modem_messaging_parent->load_initial_sms_parts (_self, storage, callback, user_data); } - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_WMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_WMS, &client, + callback, user_data)) return; ctx = g_slice_new0 (LoadInitialSmsPartsContext); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); ctx->storage = storage; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - load_initial_sms_parts); ctx->step = LOAD_INITIAL_SMS_PARTS_STEP_FIRST; - load_initial_sms_parts_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_initial_sms_parts_context_free); + + load_initial_sms_parts_step (task); } /*****************************************************************************/ @@ -8016,7 +5940,7 @@ return iface_modem_messaging_parent->cleanup_unsolicited_events_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean @@ -8031,7 +5955,7 @@ return iface_modem_messaging_parent->setup_unsolicited_events_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -8040,25 +5964,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_WMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_WMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_setup_cleanup_messaging_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->messaging_unsolicited_events_setup) { mm_dbg ("Messaging unsolicited events already %s; skipping", enable ? "setup" : "cleanup"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -8079,9 +5999,8 @@ self->priv->messaging_event_report_indication_id = 0; } - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -8124,22 +6043,9 @@ /* Enable/Disable unsolicited events (Messaging interface) */ typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; - QmiClientWms *client; gboolean enable; } EnableMessagingUnsolicitedEventsContext; -static void -enable_messaging_unsolicited_events_context_complete_and_free (EnableMessagingUnsolicitedEventsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_free (ctx); -} - static gboolean messaging_disable_unsolicited_events_finish (MMIfaceModemMessaging *_self, GAsyncResult *res, @@ -8152,7 +6058,7 @@ return iface_modem_messaging_parent->disable_unsolicited_events_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean @@ -8167,17 +6073,22 @@ return iface_modem_messaging_parent->enable_unsolicited_events_finish (_self, res, error); } - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void ser_messaging_indicator_ready (QmiClientWms *client, GAsyncResult *res, - EnableMessagingUnsolicitedEventsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + EnableMessagingUnsolicitedEventsContext *ctx; QmiMessageWmsSetEventReportOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_wms_set_event_report_finish (client, res, &error); if (!output) { mm_dbg ("QMI operation failed: '%s'", error->message); @@ -8191,9 +6102,9 @@ qmi_message_wms_set_event_report_output_unref (output); /* Just ignore errors for now */ - ctx->self->priv->messaging_unsolicited_events_enabled = ctx->enable; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_messaging_unsolicited_events_context_complete_and_free (ctx); + self->priv->messaging_unsolicited_events_enabled = ctx->enable; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -8203,34 +6114,29 @@ gpointer user_data) { EnableMessagingUnsolicitedEventsContext *ctx; - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; QmiMessageWmsSetEventReportInput *input; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_WMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_WMS, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_enable_disable_messaging_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->messaging_unsolicited_events_enabled) { mm_dbg ("Messaging unsolicited events already %s; skipping", enable ? "enabled" : "disabled"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - ctx = g_new0 (EnableMessagingUnsolicitedEventsContext, 1); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); + ctx = g_new (EnableMessagingUnsolicitedEventsContext, 1); ctx->enable = enable; - ctx->result = result; + + g_task_set_task_data (task, ctx, g_free); input = qmi_message_wms_set_event_report_input_new (); @@ -8239,12 +6145,12 @@ ctx->enable, NULL); qmi_client_wms_set_event_report ( - ctx->client, + QMI_CLIENT_WMS (client), input, 5, NULL, (GAsyncReadyCallback)ser_messaging_indicator_ready, - ctx); + task); qmi_message_wms_set_event_report_input_unref (input); } @@ -8260,15 +6166,11 @@ /* Generic implementation doesn't actually have a method to disable * unsolicited messaging events */ if (!iface_modem_messaging_parent->disable_unsolicited_events) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - messaging_disable_unsolicited_events); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -8319,904 +6221,147 @@ /* Location capabilities loading (Location interface) */ static MMModemLocationSource -location_load_capabilities_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) +location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); return MM_MODEM_LOCATION_SOURCE_NONE; - - return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( - G_SIMPLE_ASYNC_RESULT (res))); + } + return (MMModemLocationSource)value; } static void -parent_load_capabilities_ready (MMIfaceModemLocation *self, - GAsyncResult *res, - GSimpleAsyncResult *simple) +shared_qmi_location_load_capabilities_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) { MMModemLocationSource sources; GError *error = NULL; - MMPortQmi *port; - sources = iface_modem_location_parent->load_capabilities_finish (self, res, &error); + sources = mm_shared_qmi_location_load_capabilities_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_error (task, error); + g_object_unref (task); return; } - port = mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)); - - /* Now our own checks */ - - /* If we have support for the PDS client, GPS and A-GPS location is supported */ - if (port && mm_port_qmi_peek_client (port, - QMI_SERVICE_PDS, - MM_PORT_QMI_FLAG_DEFAULT)) - sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW | - MM_MODEM_LOCATION_SOURCE_AGPS); - /* If the modem is CDMA, we have support for CDMA BS location */ if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) sources |= MM_MODEM_LOCATION_SOURCE_CDMA_BS; + /* If the modem is 3GPP, we have support for 3GPP LAC/CI location */ + if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + sources |= MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI; + /* So we're done, complete */ - g_simple_async_result_set_op_res_gpointer (simple, - GUINT_TO_POINTER (sources), - NULL); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_int (task, sources); + g_object_unref (task); } static void location_load_capabilities (MMIfaceModemLocation *self, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_load_capabilities); + task = g_task_new (self, NULL, callback, user_data); - /* Chain up parent's setup */ - iface_modem_location_parent->load_capabilities ( + /* Chain up shared QMI setup, which takes care of running the PARENT + * setup as well as processing GPS-related checks. */ + mm_shared_qmi_location_load_capabilities ( self, - (GAsyncReadyCallback)parent_load_capabilities_ready, - result); -} - -/*****************************************************************************/ -/* Load SUPL server */ - -static gchar * -location_load_supl_server_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); -} - -static void -get_agps_config_ready (QmiClientPds *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessagePdsGetAgpsConfigOutput *output = NULL; - GError *error = NULL; - guint32 ip; - guint32 port; - GArray *url; - gchar *str; - - output = qmi_client_pds_get_agps_config_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - if (!qmi_message_pds_get_agps_config_output_get_result (output, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - str = NULL; - - /* Prefer IP/PORT to URL */ - if (qmi_message_pds_get_agps_config_output_get_location_server_address ( - output, - &ip, - &port, - NULL) && - ip != 0 && - port != 0) { - struct in_addr a = { .s_addr = ip }; - gchar buf[INET_ADDRSTRLEN + 1]; - - memset (buf, 0, sizeof (buf)); - - if (!inet_ntop (AF_INET, &a, buf, sizeof (buf) - 1)) { - g_simple_async_result_set_error (simple, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot convert numeric IP address to string"); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - str = g_strdup_printf ("%s:%u", buf, port); - } - - if (!str && - qmi_message_pds_get_agps_config_output_get_location_server_url ( - output, - &url, - NULL) && - url->len > 0) { - str = g_convert (url->data, url->len, "UTF-8", "UTF-16BE", NULL, NULL, NULL); - } - - if (!str) - str = g_strdup (""); - - qmi_message_pds_get_agps_config_output_unref (output); - - g_simple_async_result_set_op_res_gpointer (simple, str, g_free); - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static void -location_load_supl_server (MMIfaceModemLocation *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - QmiClient *client = NULL; - GSimpleAsyncResult *simple; - QmiMessagePdsGetAgpsConfigInput *input; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_PDS, &client, - callback, user_data)) { - return; - } - - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_load_supl_server); - - input = qmi_message_pds_get_agps_config_input_new (); - - /* For multimode devices, prefer UMTS by default */ - if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) - qmi_message_pds_get_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_UMTS, NULL); - else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) - qmi_message_pds_get_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_CDMA, NULL); - - qmi_client_pds_get_agps_config ( - QMI_CLIENT_PDS (client), - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)get_agps_config_ready, - simple); - qmi_message_pds_get_agps_config_input_unref (input); -} - -/*****************************************************************************/ -/* Set SUPL server */ - -static gboolean -location_set_supl_server_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -set_agps_config_ready (QmiClientPds *client, - GAsyncResult *res, - GSimpleAsyncResult *simple) -{ - QmiMessagePdsSetAgpsConfigOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_agps_config_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - if (!qmi_message_pds_set_agps_config_output_get_result (output, &error)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - qmi_message_pds_set_agps_config_output_unref (output); - - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); -} - -static gboolean -parse_as_ip_port (const gchar *supl, - guint32 *out_ip, - guint32 *out_port) -{ - gboolean valid = FALSE; - gchar **split; - guint port; - guint32 ip; - - split = g_strsplit (supl, ":", -1); - if (g_strv_length (split) != 2) - goto out; - - if (!mm_get_uint_from_str (split[1], &port)) - goto out; - if (port == 0 || port > G_MAXUINT16) - goto out; - if (inet_pton (AF_INET, split[0], &ip) <= 0) - goto out; - - *out_ip = ip; - *out_port = port; - valid = TRUE; - -out: - g_strfreev (split); - return valid; -} - -static gboolean -parse_as_url (const gchar *supl, - GArray **out_url) -{ - gchar *utf16; - gsize utf16_len; - - utf16 = g_convert (supl, -1, "UTF-16BE", "UTF-8", NULL, &utf16_len, NULL); - *out_url = g_array_append_vals (g_array_sized_new (FALSE, FALSE, sizeof (guint8), utf16_len), - utf16, - utf16_len); - g_free (utf16); - return TRUE; -} - -static void -location_set_supl_server (MMIfaceModemLocation *self, - const gchar *supl, - GAsyncReadyCallback callback, - gpointer user_data) -{ - QmiClient *client = NULL; - GSimpleAsyncResult *simple; - QmiMessagePdsSetAgpsConfigInput *input; - guint32 ip; - guint32 port; - GArray *url; - - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_PDS, &client, - callback, user_data)) { - return; - } - - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - location_set_supl_server); - - input = qmi_message_pds_set_agps_config_input_new (); - - /* For multimode devices, prefer UMTS by default */ - if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) - qmi_message_pds_set_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_UMTS, NULL); - else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) - qmi_message_pds_set_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_CDMA, NULL); - - if (parse_as_ip_port (supl, &ip, &port)) - qmi_message_pds_set_agps_config_input_set_location_server_address (input, ip, port, NULL); - else if (parse_as_url (supl, &url)) { - qmi_message_pds_set_agps_config_input_set_location_server_url (input, url, NULL); - g_array_unref (url); - } else - g_assert_not_reached (); - - qmi_client_pds_set_agps_config ( - QMI_CLIENT_PDS (client), - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)set_agps_config_ready, - simple); - qmi_message_pds_set_agps_config_input_unref (input); + (GAsyncReadyCallback)shared_qmi_location_load_capabilities_ready, + task); } /*****************************************************************************/ /* Disable location gathering (Location interface) */ -typedef struct { - MMBroadbandModemQmi *self; - QmiClientPds *client; - GSimpleAsyncResult *result; - MMModemLocationSource source; - /* Default tracking session (for A-GPS disabling) */ - QmiPdsOperatingMode session_operation; - guint8 data_timeout; - guint32 interval; - guint32 accuracy_threshold; -} DisableLocationGatheringContext; - -static void -disable_location_gathering_context_complete_and_free (DisableLocationGatheringContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - if (ctx->client) - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (DisableLocationGatheringContext, ctx); -} - static gboolean -disable_location_gathering_finish (MMIfaceModemLocation *self, - GAsyncResult *res, - GError **error) +disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -gps_service_state_stop_ready (QmiClientPds *client, - GAsyncResult *res, - DisableLocationGatheringContext *ctx) +shared_qmi_disable_location_gathering_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) { - QmiMessagePdsSetGpsServiceStateOutput *output = NULL; GError *error = NULL; - output = qmi_client_pds_set_gps_service_state_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_gps_service_state_output_get_result (output, &error)) { - if (!g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - g_prefix_error (&error, "Couldn't set GPS service state: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_gps_service_state_output_unref (output); - return; - } - - g_error_free (error); - } - - qmi_message_pds_set_gps_service_state_output_unref (output); - - g_assert (ctx->self->priv->location_event_report_indication_id != 0); - g_signal_handler_disconnect (client, ctx->self->priv->location_event_report_indication_id); - ctx->self->priv->location_event_report_indication_id = 0; - - mm_dbg ("GPS stopped"); - ctx->self->priv->enabled_sources &= ~ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disable_location_gathering_context_complete_and_free (ctx); -} - -static void -set_default_tracking_session_stop_ready (QmiClientPds *client, - GAsyncResult *res, - DisableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetDefaultTrackingSessionOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_default_tracking_session_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_default_tracking_session_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set default tracking session: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_default_tracking_session_output_unref (output); - return; - } - - qmi_message_pds_set_default_tracking_session_output_unref (output); - - /* Done */ - mm_dbg ("A-GPS disabled"); - ctx->self->priv->enabled_sources &= ~ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disable_location_gathering_context_complete_and_free (ctx); -} - -static void -get_default_tracking_session_stop_ready (QmiClientPds *client, - GAsyncResult *res, - DisableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetDefaultTrackingSessionInput *input; - QmiMessagePdsGetDefaultTrackingSessionOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_get_default_tracking_session_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_get_default_tracking_session_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get default tracking session: "); - g_simple_async_result_take_error (ctx->result, error); - disable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_get_default_tracking_session_output_unref (output); - return; - } - - qmi_message_pds_get_default_tracking_session_output_get_info ( - output, - &ctx->session_operation, - &ctx->data_timeout, - &ctx->interval, - &ctx->accuracy_threshold, - NULL); - - qmi_message_pds_get_default_tracking_session_output_unref (output); - - if (ctx->session_operation == QMI_PDS_OPERATING_MODE_STANDALONE) { - /* Done */ - mm_dbg ("A-GPS already disabled"); - ctx->self->priv->enabled_sources &= ~ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disable_location_gathering_context_complete_and_free (ctx); - return; - } - - input = qmi_message_pds_set_default_tracking_session_input_new (); - qmi_message_pds_set_default_tracking_session_input_set_info ( - input, - QMI_PDS_OPERATING_MODE_STANDALONE, - ctx->data_timeout, - ctx->interval, - ctx->accuracy_threshold, - NULL); - qmi_client_pds_set_default_tracking_session ( - ctx->client, - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)set_default_tracking_session_stop_ready, - ctx); - qmi_message_pds_set_default_tracking_session_input_unref (input); + if (!mm_shared_qmi_disable_location_gathering_finish (self, res, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -disable_location_gathering (MMIfaceModemLocation *self, +disable_location_gathering (MMIfaceModemLocation *_self, MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data) + GAsyncReadyCallback callback, + gpointer user_data) { - DisableLocationGatheringContext *ctx; - QmiClient *client = NULL; - GSimpleAsyncResult *result; + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - disable_location_gathering); + task = g_task_new (self, NULL, callback, user_data); /* Nothing to be done to disable 3GPP or CDMA locations */ - if (source == MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI || - source == MM_MODEM_LOCATION_SOURCE_CDMA_BS) { - /* Just mark it as disabled */ - MM_BROADBAND_MODEM_QMI (self)->priv->enabled_sources &= ~source; - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); - return; - } - - /* Setup context and client */ - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_PDS, &client, - callback, user_data)) { - g_object_unref (result); - return; - } - ctx = g_slice_new0 (DisableLocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = result; - ctx->source = source; + if (source == MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI || source == MM_MODEM_LOCATION_SOURCE_CDMA_BS) + self->priv->enabled_sources &= ~source; - /* Disable A-GPS? */ - if (source == MM_MODEM_LOCATION_SOURCE_AGPS) { - qmi_client_pds_get_default_tracking_session ( - ctx->client, - NULL, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)get_default_tracking_session_stop_ready, - ctx); - return; - } - - /* Only stop GPS engine if no GPS-related sources enabled */ - if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { - MMModemLocationSource tmp; - - /* If no more GPS sources enabled, stop GPS */ - tmp = ctx->self->priv->enabled_sources; - tmp &= ~source; - if (!(tmp & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW))) { - QmiMessagePdsSetGpsServiceStateInput *input; - - input = qmi_message_pds_set_gps_service_state_input_new (); - qmi_message_pds_set_gps_service_state_input_set_state (input, FALSE, NULL); - qmi_client_pds_set_gps_service_state ( - ctx->client, - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)gps_service_state_stop_ready, - ctx); - qmi_message_pds_set_gps_service_state_input_unref (input); - return; - } - - /* Otherwise, we have more GPS sources enabled, we shouldn't stop GPS, just - * return */ - ctx->self->priv->enabled_sources &= ~source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disable_location_gathering_context_complete_and_free (ctx); - return; - } - - /* The QMI implementation has a fixed set of capabilities supported. Arriving - * here means we tried to disable one which wasn't set as supported, which should - * not happen */ - g_assert_not_reached (); + mm_shared_qmi_disable_location_gathering ( + _self, + source, + (GAsyncReadyCallback) shared_qmi_disable_location_gathering_ready, + task); } /*****************************************************************************/ /* Enable location gathering (Location interface) */ -static void -location_event_report_indication_cb (QmiClientPds *client, - QmiIndicationPdsEventReportOutput *output, - MMBroadbandModemQmi *self) -{ - QmiPdsPositionSessionStatus session_status; - const gchar *nmea; - - if (qmi_indication_pds_event_report_output_get_position_session_status ( - output, - &session_status, - NULL)) { - mm_dbg ("[GPS] session status changed: '%s'", - qmi_pds_position_session_status_get_string (session_status)); - } - - if (qmi_indication_pds_event_report_output_get_nmea_position ( - output, - &nmea, - NULL)) { - mm_dbg ("[NMEA] %s", nmea); - mm_iface_modem_location_gps_update (MM_IFACE_MODEM_LOCATION (self), nmea); - } -} - -typedef struct { - MMBroadbandModemQmi *self; - QmiClientPds *client; - GSimpleAsyncResult *result; - MMModemLocationSource source; - /* Default tracking session (for A-GPS enabling) */ - QmiPdsOperatingMode session_operation; - guint8 data_timeout; - guint32 interval; - guint32 accuracy_threshold; -} EnableLocationGatheringContext; - -static void -enable_location_gathering_context_complete_and_free (EnableLocationGatheringContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - if (ctx->client) - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (EnableLocationGatheringContext, ctx); -} - static gboolean enable_location_gathering_finish (MMIfaceModemLocation *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -ser_location_ready (QmiClientPds *client, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) +shared_qmi_enable_location_gathering_ready (MMIfaceModemLocation *_self, + GAsyncResult *res, + GTask *task) { - QmiMessagePdsSetEventReportOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_event_report_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_event_report_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set event report: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_event_report_output_unref (output); - return; - } - - qmi_message_pds_set_event_report_output_unref (output); + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); + MMModemLocationSource source; + GError *error = NULL; - mm_dbg ("Adding location event report indication handling"); - g_assert (ctx->self->priv->location_event_report_indication_id == 0); - ctx->self->priv->location_event_report_indication_id = - g_signal_connect (client, - "event-report", - G_CALLBACK (location_event_report_indication_cb), - ctx->self); - - /* Done */ - mm_dbg ("GPS started"); - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); -} - -static void -auto_tracking_state_start_ready (QmiClientPds *client, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetEventReportInput *input; - QmiMessagePdsSetAutoTrackingStateOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_auto_tracking_state_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_auto_tracking_state_output_get_result (output, &error)) { - if (!g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - g_prefix_error (&error, "Couldn't set auto-tracking state: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_auto_tracking_state_output_unref (output); - return; - } - g_error_free (error); - } - - qmi_message_pds_set_auto_tracking_state_output_unref (output); - - /* Only gather standard NMEA traces */ - input = qmi_message_pds_set_event_report_input_new (); - qmi_message_pds_set_event_report_input_set_nmea_position_reporting (input, TRUE, NULL); - qmi_client_pds_set_event_report ( - ctx->client, - input, - 5, - NULL, - (GAsyncReadyCallback)ser_location_ready, - ctx); - qmi_message_pds_set_event_report_input_unref (input); -} - -static void -gps_service_state_start_ready (QmiClientPds *client, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetAutoTrackingStateInput *input; - QmiMessagePdsSetGpsServiceStateOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_gps_service_state_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_gps_service_state_output_get_result (output, &error)) { - if (!g_error_matches (error, - QMI_PROTOCOL_ERROR, - QMI_PROTOCOL_ERROR_NO_EFFECT)) { - g_prefix_error (&error, "Couldn't set GPS service state: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_gps_service_state_output_unref (output); - return; - } - g_error_free (error); - } - - qmi_message_pds_set_gps_service_state_output_unref (output); - - /* Enable auto-tracking for a continuous fix */ - input = qmi_message_pds_set_auto_tracking_state_input_new (); - qmi_message_pds_set_auto_tracking_state_input_set_state (input, TRUE, NULL); - qmi_client_pds_set_auto_tracking_state ( - ctx->client, - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)auto_tracking_state_start_ready, - ctx); - qmi_message_pds_set_auto_tracking_state_input_unref (input); -} - -static void -set_default_tracking_session_start_ready (QmiClientPds *client, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetDefaultTrackingSessionOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_set_default_tracking_session_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_set_default_tracking_session_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't set default tracking session: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_set_default_tracking_session_output_unref (output); - return; - } - - qmi_message_pds_set_default_tracking_session_output_unref (output); - - /* Done */ - mm_dbg ("A-GPS enabled"); - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); -} - -static void -get_default_tracking_session_start_ready (QmiClientPds *client, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) -{ - QmiMessagePdsSetDefaultTrackingSessionInput *input; - QmiMessagePdsGetDefaultTrackingSessionOutput *output = NULL; - GError *error = NULL; - - output = qmi_client_pds_get_default_tracking_session_finish (client, res, &error); - if (!output) { - g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - if (!qmi_message_pds_get_default_tracking_session_output_get_result (output, &error)) { - g_prefix_error (&error, "Couldn't get default tracking session: "); - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - qmi_message_pds_get_default_tracking_session_output_unref (output); + if (!mm_shared_qmi_enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); return; } - qmi_message_pds_get_default_tracking_session_output_get_info ( - output, - &ctx->session_operation, - &ctx->data_timeout, - &ctx->interval, - &ctx->accuracy_threshold, - NULL); - - qmi_message_pds_get_default_tracking_session_output_unref (output); - - if (ctx->session_operation == QMI_PDS_OPERATING_MODE_MS_ASSISTED) { - /* Done */ - mm_dbg ("A-GPS already enabled"); - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - input = qmi_message_pds_set_default_tracking_session_input_new (); - qmi_message_pds_set_default_tracking_session_input_set_info ( - input, - QMI_PDS_OPERATING_MODE_MS_ASSISTED, - ctx->data_timeout, - ctx->interval, - ctx->accuracy_threshold, - NULL); - qmi_client_pds_set_default_tracking_session ( - ctx->client, - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)set_default_tracking_session_start_ready, - ctx); - qmi_message_pds_set_default_tracking_session_input_unref (input); -} - -static void -parent_enable_location_gathering_ready (MMIfaceModemLocation *self, - GAsyncResult *res, - EnableLocationGatheringContext *ctx) -{ - GError *error = NULL; - QmiClient *client; - - if (!iface_modem_location_parent->enable_location_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } + source = (MMModemLocationSource) GPOINTER_TO_UINT (g_task_get_task_data (task)); /* Nothing else needed in the QMI side for LAC/CI */ - if (ctx->source == MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI) { - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); + if (source == MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI && + mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) { + self->priv->enabled_sources |= source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9224,94 +6369,38 @@ * location source, so that we get up to date BS location information. * Note that we don't care for when the registration checks get finished. */ - if (ctx->source == MM_MODEM_LOCATION_SOURCE_CDMA_BS && - mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->self))) { + if (source == MM_MODEM_LOCATION_SOURCE_CDMA_BS && + mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) { /* Reload registration to get LAC/CI */ - mm_iface_modem_cdma_run_registration_checks (MM_IFACE_MODEM_CDMA (ctx->self), NULL, NULL); + mm_iface_modem_cdma_run_registration_checks (MM_IFACE_MODEM_CDMA (self), NULL, NULL); /* Just mark it as enabled */ - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - - /* Setup context and client */ - client = peek_qmi_client (ctx->self, QMI_SERVICE_PDS, &error); - if (!client) { - g_simple_async_result_take_error (ctx->result, error); - enable_location_gathering_context_complete_and_free (ctx); - return; - } - ctx->client = g_object_ref (client); - - /* Enabling A-GPS? */ - if (ctx->source == MM_MODEM_LOCATION_SOURCE_AGPS) { - qmi_client_pds_get_default_tracking_session ( - ctx->client, - NULL, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)get_default_tracking_session_start_ready, - ctx); - return; - } - - /* NMEA and RAW are both enabled in the same way */ - if (ctx->source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW)) { - /* Only start GPS engine if not done already */ - if (!(ctx->self->priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | - MM_MODEM_LOCATION_SOURCE_GPS_RAW))) { - QmiMessagePdsSetGpsServiceStateInput *input; - - input = qmi_message_pds_set_gps_service_state_input_new (); - qmi_message_pds_set_gps_service_state_input_set_state (input, TRUE, NULL); - qmi_client_pds_set_gps_service_state ( - ctx->client, - input, - 10, - NULL, /* cancellable */ - (GAsyncReadyCallback)gps_service_state_start_ready, - ctx); - qmi_message_pds_set_gps_service_state_input_unref (input); - return; - } - - /* GPS already started, we're done */ - ctx->self->priv->enabled_sources |= ctx->source; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_location_gathering_context_complete_and_free (ctx); + self->priv->enabled_sources |= source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - /* The QMI implementation has a fixed set of capabilities supported. Arriving - * here means we tried to enable one which wasn't set as supported, which should - * not happen */ - g_assert_not_reached (); + /* Otherwise, we're done */ + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -enable_location_gathering (MMIfaceModemLocation *self, - MMModemLocationSource source, - GAsyncReadyCallback callback, - gpointer user_data) +enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) { - EnableLocationGatheringContext *ctx; + GTask *task; - ctx = g_slice_new0 (EnableLocationGatheringContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enable_location_gathering); - /* Store source to enable, there will be only one! */ - ctx->source = source; - - /* Chain up parent's gathering enable */ - iface_modem_location_parent->enable_location_gathering ( - MM_IFACE_MODEM_LOCATION (ctx->self), - ctx->source, - (GAsyncReadyCallback)parent_enable_location_gathering_ready, - ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + mm_shared_qmi_enable_location_gathering ( + self, + source, + (GAsyncReadyCallback)shared_qmi_enable_location_gathering_ready, + task); } /*****************************************************************************/ @@ -9322,8 +6411,7 @@ GAsyncResult *res, GError **error) { - /* no error expected here */ - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -9331,26 +6419,23 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - MMPortQmi *port; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_check_support); + task = g_task_new (self, NULL, callback, user_data); - port = mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)); /* If we have support for the OMA client, OMA is supported */ - if (!port || !mm_port_qmi_peek_client (port, QMI_SERVICE_OMA, MM_PORT_QMI_FLAG_DEFAULT)) { + if (!mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, + MM_PORT_QMI_FLAG_DEFAULT, + NULL)) { mm_dbg ("OMA capabilities not supported"); - g_simple_async_result_set_op_res_gboolean (result, FALSE); + g_task_return_boolean (task, FALSE); } else { mm_dbg ("OMA capabilities supported"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); + g_task_return_boolean (task, TRUE); } - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ @@ -9361,23 +6446,28 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_OMA_FEATURE_NONE; + GError *inner_error = NULL; + gssize value; - return (MMOmaFeature) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_OMA_FEATURE_NONE; + } + return (MMOmaFeature)value; } static void oma_get_feature_setting_ready (QmiClientOma *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageOmaGetFeatureSettingOutput *output = NULL; GError *error = NULL; output = qmi_client_oma_get_feature_setting_finish (client, res, &error); if (!output || !qmi_message_oma_get_feature_setting_output_get_result (output, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else { MMOmaFeature features = MM_OMA_FEATURE_NONE; gboolean enabled; @@ -9403,14 +6493,13 @@ enabled) features |= MM_OMA_FEATURE_HANDS_FREE_ACTIVATION; - g_simple_async_result_set_op_res_gpointer (simple, GUINT_TO_POINTER ((guint)features), NULL); + g_task_return_int (task, features); } if (output) qmi_message_oma_get_feature_setting_output_unref (output); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_object_unref (task); } static void @@ -9420,9 +6509,9 @@ { QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; qmi_client_oma_get_feature_setting ( @@ -9431,10 +6520,7 @@ 5, NULL, (GAsyncReadyCallback)oma_get_feature_setting_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_load_features)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -9445,28 +6531,27 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void oma_set_feature_setting_ready (QmiClientOma *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageOmaSetFeatureSettingOutput *output; GError *error = NULL; output = qmi_client_oma_set_feature_setting_finish (client, res, &error); if (!output || !qmi_message_oma_set_feature_setting_output_get_result (output, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); if (output) qmi_message_oma_set_feature_setting_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -9478,9 +6563,9 @@ QmiClient *client = NULL; QmiMessageOmaSetFeatureSettingInput *input; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; input = qmi_message_oma_set_feature_setting_input_new (); @@ -9503,10 +6588,7 @@ 5, NULL, (GAsyncReadyCallback)oma_set_feature_setting_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_setup)); + g_task_new (self, NULL, callback, user_data)); qmi_message_oma_set_feature_setting_input_unref (input); } @@ -9519,28 +6601,27 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void oma_start_session_ready (QmiClientOma *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageOmaStartSessionOutput *output; GError *error = NULL; output = qmi_client_oma_start_session_finish (client, res, &error); if (!output || !qmi_message_oma_start_session_output_get_result (output, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); if (output) qmi_message_oma_start_session_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -9552,9 +6633,9 @@ QmiClient *client = NULL; QmiMessageOmaStartSessionInput *input; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; /* It's already checked in mm-iface-modem-oma; so just assert if this is not ok */ @@ -9574,10 +6655,7 @@ 5, NULL, (GAsyncReadyCallback)oma_start_session_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_start_client_initiated_session)); + g_task_new (self, NULL, callback, user_data)); qmi_message_oma_start_session_input_unref (input); } @@ -9590,28 +6668,26 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void oma_send_selection_ready (QmiClientOma *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageOmaSendSelectionOutput *output; GError *error = NULL; output = qmi_client_oma_send_selection_finish (client, res, &error); if (!output || !qmi_message_oma_send_selection_output_get_result (output, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); + g_object_unref (task); if (output) qmi_message_oma_send_selection_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -9624,9 +6700,9 @@ QmiClient *client = NULL; QmiMessageOmaSendSelectionInput *input; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; input = qmi_message_oma_send_selection_input_new (); @@ -9642,10 +6718,7 @@ 5, NULL, (GAsyncReadyCallback)oma_send_selection_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_accept_network_initiated_session)); + g_task_new (self, NULL, callback, user_data)); qmi_message_oma_send_selection_input_unref (input); } @@ -9658,28 +6731,27 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void oma_cancel_session_ready (QmiClientOma *client, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { QmiMessageOmaCancelSessionOutput *output; GError *error = NULL; output = qmi_client_oma_cancel_session_finish (client, res, &error); if (!output || !qmi_message_oma_cancel_session_output_get_result (output, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); if (output) qmi_message_oma_cancel_session_output_unref (output); - - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -9689,9 +6761,9 @@ { QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; qmi_client_oma_cancel_session ( @@ -9700,10 +6772,7 @@ 5, NULL, (GAsyncReadyCallback)oma_cancel_session_ready, - g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - oma_cancel_session)); + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ @@ -9761,7 +6830,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -9770,25 +6839,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_setup_cleanup_oma_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->oma_unsolicited_events_setup) { mm_dbg ("OMA unsolicited events already %s; skipping", enable ? "setup" : "cleanup"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -9809,9 +6874,8 @@ self->priv->oma_event_report_indication_id = 0; } - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -9840,38 +6904,30 @@ /* Enable/Disable unsolicited events (OMA interface) */ typedef struct { - MMBroadbandModemQmi *self; - GSimpleAsyncResult *result; - QmiClientOma *client; gboolean enable; } EnableOmaUnsolicitedEventsContext; -static void -enable_oma_unsolicited_events_context_complete_and_free (EnableOmaUnsolicitedEventsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->client); - g_object_unref (ctx->self); - g_slice_free (EnableOmaUnsolicitedEventsContext, ctx); -} - static gboolean common_oma_enable_disable_unsolicited_events_finish (MMIfaceModemOma *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void ser_oma_indicator_ready (QmiClientOma *client, GAsyncResult *res, - EnableOmaUnsolicitedEventsContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + EnableOmaUnsolicitedEventsContext *ctx; QmiMessageOmaSetEventReportOutput *output = NULL; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + output = qmi_client_oma_set_event_report_finish (client, res, &error); if (!output) { mm_dbg ("QMI operation failed: '%s'", error->message); @@ -9885,9 +6941,9 @@ qmi_message_oma_set_event_report_output_unref (output); /* Just ignore errors for now */ - ctx->self->priv->oma_unsolicited_events_enabled = ctx->enable; - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enable_oma_unsolicited_events_context_complete_and_free (ctx); + self->priv->oma_unsolicited_events_enabled = ctx->enable; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -9897,34 +6953,29 @@ gpointer user_data) { EnableOmaUnsolicitedEventsContext *ctx; - GSimpleAsyncResult *result; + GTask *task; QmiClient *client = NULL; QmiMessageOmaSetEventReportInput *input; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_OMA, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_OMA, &client, + callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - common_enable_disable_oma_unsolicited_events); + task = g_task_new (self, NULL, callback, user_data); if (enable == self->priv->oma_unsolicited_events_enabled) { mm_dbg ("OMA unsolicited events already %s; skipping", enable ? "enabled" : "disabled"); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - ctx = g_slice_new0 (EnableOmaUnsolicitedEventsContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); + ctx = g_new (EnableOmaUnsolicitedEventsContext, 1); ctx->enable = enable; - ctx->result = result; + + g_task_set_task_data (task, ctx, g_free); input = qmi_message_oma_set_event_report_input_new (); qmi_message_oma_set_event_report_input_set_session_state_reporting ( @@ -9936,12 +6987,12 @@ ctx->enable, NULL); qmi_client_oma_set_event_report ( - ctx->client, + QMI_CLIENT_OMA (client), input, 5, NULL, (GAsyncReadyCallback)ser_oma_indicator_ready, - ctx); + task); qmi_message_oma_set_event_report_input_unref (input); } @@ -9971,10 +7022,10 @@ /* Check firmware support (Firmware interface) */ typedef struct { - gchar *build_id; - GArray *modem_unique_id; - GArray *pri_unique_id; - gboolean current; + gchar *build_id; + GArray *modem_unique_id; + GArray *pri_unique_id; + gboolean current; } FirmwarePair; static void @@ -9987,44 +7038,42 @@ } typedef struct { - MMBroadbandModemQmi *self; QmiClientDms *client; - GSimpleAsyncResult *result; GList *pairs; GList *l; -} FirmwareCheckSupportContext; +} FirmwareListPreloadContext; static void -firmware_check_support_context_complete_and_free (FirmwareCheckSupportContext *ctx) +firmware_list_preload_context_free (FirmwareListPreloadContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); g_list_free_full (ctx->pairs, (GDestroyNotify)firmware_pair_free); - g_object_unref (ctx->self); g_object_unref (ctx->client); - g_slice_free (FirmwareCheckSupportContext, ctx); + g_slice_free (FirmwareListPreloadContext, ctx); } static gboolean -firmware_check_support_finish (MMIfaceModemFirmware *self, - GAsyncResult *res, - GError **error) +firmware_list_preload_finish (MMBroadbandModemQmi *self, + GAsyncResult *res, + GError **error) { - /* Never fails, just says TRUE or FALSE */ - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } -static void get_next_image_info (FirmwareCheckSupportContext *ctx); +static void get_next_image_info (GTask *task); static void get_pri_image_info_ready (QmiClientDms *client, GAsyncResult *res, - FirmwareCheckSupportContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; + FirmwareListPreloadContext *ctx; QmiMessageDmsGetStoredImageInfoOutput *output; GError *error = NULL; FirmwarePair *current; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); current = (FirmwarePair *)ctx->l->data; output = qmi_client_dms_get_stored_image_info_finish (client, res, &error); @@ -10090,45 +7139,52 @@ } /* Add firmware image to our internal list */ - ctx->self->priv->firmware_list = g_list_append (ctx->self->priv->firmware_list, - firmware); + self->priv->firmware_list = g_list_append (self->priv->firmware_list, + firmware); /* If this is is also the current image running, keep it */ if (current->current) { - if (ctx->self->priv->current_firmware) + if (self->priv->current_firmware) mm_warn ("A current firmware is already set (%s), not setting '%s' as current", - mm_firmware_properties_get_unique_id (ctx->self->priv->current_firmware), + mm_firmware_properties_get_unique_id (self->priv->current_firmware), current->build_id); else - ctx->self->priv->current_firmware = g_object_ref (firmware); + self->priv->current_firmware = g_object_ref (firmware); } + } + if (output) qmi_message_dms_get_stored_image_info_output_unref (output); - } /* Go on to the next one */ ctx->l = g_list_next (ctx->l); - get_next_image_info (ctx); + get_next_image_info (task); } static void -get_next_image_info (FirmwareCheckSupportContext *ctx) +get_next_image_info (GTask *task) { + MMBroadbandModemQmi *self; + FirmwareListPreloadContext *ctx; QmiMessageDmsGetStoredImageInfoInputImage image_id; QmiMessageDmsGetStoredImageInfoInput *input; FirmwarePair *current; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (!ctx->l) { /* We're done */ - if (!ctx->self->priv->firmware_list) { + if (!self->priv->firmware_list) { mm_warn ("No valid firmware images listed. " "Assuming firmware unsupported."); - g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE); + g_task_return_boolean (task, FALSE); } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - firmware_check_support_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); return; } @@ -10145,7 +7201,7 @@ 10, NULL, (GAsyncReadyCallback)get_pri_image_info_ready, - ctx); + task); qmi_message_dms_get_stored_image_info_input_unref (input); } @@ -10174,8 +7230,9 @@ static void list_stored_images_ready (QmiClientDms *client, GAsyncResult *res, - FirmwareCheckSupportContext *ctx) + GTask *task) { + FirmwareListPreloadContext *ctx; GArray *array; gint pri_id; gint modem_id; @@ -10189,8 +7246,8 @@ if (!output || !qmi_message_dms_list_stored_images_output_get_result (output, NULL)) { /* Assume firmware unsupported */ - g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE); - firmware_check_support_context_complete_and_free (ctx); + g_task_return_boolean (task, FALSE); + g_object_unref (task); if (output) qmi_message_dms_list_stored_images_output_unref (output); return; @@ -10230,16 +7287,17 @@ } if (pri_id < 0 || modem_id < 0) { - mm_warn ("We need both PRI (%s) and MODEM (%s) images. " - "Assuming firmware unsupported.", - pri_id < 0 ? "not found" : "found", - modem_id < 0 ? "not found" : "found"); - g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE); - firmware_check_support_context_complete_and_free (ctx); + mm_dbg ("We need both PRI (%s) and MODEM (%s) images", + pri_id < 0 ? "not found" : "found", + modem_id < 0 ? "not found" : "found"); + g_task_return_boolean (task, FALSE); + g_object_unref (task); qmi_message_dms_list_stored_images_output_unref (output); return; } + ctx = g_task_get_task_data (task); + /* Loop PRI images and try to find a pairing MODEM image with same boot ID */ image_pri = &g_array_index (array, QmiMessageDmsListStoredImagesOutputListImage, @@ -10280,10 +7338,9 @@ } if (!ctx->pairs) { - mm_warn ("No valid PRI+MODEM pairs found. " - "Assuming firmware unsupported."); - g_simple_async_result_set_op_res_gboolean (ctx->result, FALSE); - firmware_check_support_context_complete_and_free (ctx); + mm_dbg ("No valid PRI+MODEM pairs found"); + g_task_return_boolean (task, FALSE); + g_object_unref (task); qmi_message_dms_list_stored_images_output_unref (output); return; } @@ -10292,29 +7349,28 @@ qmi_message_dms_list_stored_images_output_unref (output); ctx->l = ctx->pairs; - get_next_image_info (ctx); + get_next_image_info (task); } static void -firmware_check_support (MMIfaceModemFirmware *self, - GAsyncReadyCallback callback, - gpointer user_data) +firmware_list_preload (MMBroadbandModemQmi *self, + GAsyncReadyCallback callback, + gpointer user_data) { - FirmwareCheckSupportContext *ctx; - QmiClient *client = NULL; + FirmwareListPreloadContext *ctx; + GTask *task; + QmiClient *client = NULL; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; - ctx = g_slice_new0 (FirmwareCheckSupportContext); - ctx->self = g_object_ref (self); + ctx = g_slice_new0 (FirmwareListPreloadContext); ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - firmware_check_support); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)firmware_list_preload_context_free); mm_dbg ("loading firmware images..."); qmi_client_dms_list_stored_images (QMI_CLIENT_DMS (client), @@ -10322,18 +7378,57 @@ 10, NULL, (GAsyncReadyCallback)list_stored_images_ready, - ctx); + task); } /*****************************************************************************/ /* Load firmware list (Firmware interface) */ +static void +firmware_list_free (GList *firmware_list) +{ + g_list_free_full (firmware_list, g_object_unref); +} + static GList * firmware_load_list_finish (MMIfaceModemFirmware *self, GAsyncResult *res, GError **error) { - return (GList *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +firmware_load_list_preloaded (GTask *task) +{ + MMBroadbandModemQmi *self; + GList *dup; + + self = g_task_get_source_object (task); + g_assert (self->priv->firmware_list_preloaded); + + dup = g_list_copy_deep (self->priv->firmware_list, (GCopyFunc)g_object_ref, NULL); + if (dup) + g_task_return_pointer (task, dup, (GDestroyNotify)firmware_list_free); + else + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "firmware list unknown"); + g_object_unref (task); +} + +static void +firmware_list_preload_ready (MMBroadbandModemQmi *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + if (!firmware_list_preload_finish (self, res, &error)) { + mm_dbg ("firmware list loading failed: %s", error ? error->message : "unsupported"); + g_clear_error (&error); + } + + firmware_load_list_preloaded (task); } static void @@ -10342,21 +7437,20 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; - GList *dup; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - firmware_load_list); - - /* We'll return the new list of new references we create here */ - dup = g_list_copy (self->priv->firmware_list); - g_list_foreach (dup, (GFunc)g_object_ref, NULL); - - g_simple_async_result_set_op_res_gpointer (result, dup, NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + if (self->priv->firmware_list_preloaded) { + firmware_load_list_preloaded (task); + return; + } + + self->priv->firmware_list_preloaded = TRUE; + firmware_list_preload (self, + (GAsyncReadyCallback)firmware_list_preload_ready, + task); } /*****************************************************************************/ @@ -10367,7 +7461,7 @@ GAsyncResult *res, GError **error) { - return (MMFirmwareProperties *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void @@ -10376,39 +7470,29 @@ gpointer user_data) { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - firmware_load_current); - - /* We'll return the reference we create here */ - g_simple_async_result_set_op_res_gpointer ( - result, - self->priv->current_firmware ? g_object_ref (self->priv->current_firmware) : NULL, - NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + if (self->priv->current_firmware) + g_task_return_pointer (task, + g_object_ref (self->priv->current_firmware), + g_object_unref); + else + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND, + "current firmware unknown"); + g_object_unref (task); } /*****************************************************************************/ /* Change current firmware (Firmware interface) */ typedef struct { - MMBroadbandModemQmi *self; - QmiClientDms *client; - GSimpleAsyncResult *result; MMFirmwareProperties *firmware; } FirmwareChangeCurrentContext; static void -firmware_change_current_context_complete_and_free (FirmwareChangeCurrentContext *ctx) +firmware_change_current_context_free (FirmwareChangeCurrentContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->client); if (ctx->firmware) g_object_unref (ctx->firmware); g_slice_free (FirmwareChangeCurrentContext, ctx); @@ -10419,51 +7503,55 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -firmware_power_cycle_ready (MMBroadbandModemQmi *self, - GAsyncResult *res, - FirmwareChangeCurrentContext *ctx) +firmware_reset_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) { GError *error = NULL; - if (!power_cycle_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + if (!mm_shared_qmi_reset_finish (self, res, &error)) + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - firmware_change_current_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + + g_object_unref (task); } static void firmware_select_stored_image_ready (QmiClientDms *client, GAsyncResult *res, - FirmwareChangeCurrentContext *ctx) + GTask *task) { + MMBroadbandModemQmi *self; QmiMessageDmsSetFirmwarePreferenceOutput *output; GError *error = NULL; output = qmi_client_dms_set_firmware_preference_finish (client, res, &error); if (!output) { - g_simple_async_result_take_error (ctx->result, error); - firmware_change_current_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_dms_set_firmware_preference_output_get_result (output, &error)) { - g_simple_async_result_take_error (ctx->result, error); - firmware_change_current_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); qmi_message_dms_set_firmware_preference_output_unref (output); return; } + self = g_task_get_source_object (task); + qmi_message_dms_set_firmware_preference_output_unref (output); /* Now, go into offline mode */ - power_cycle (ctx->self, - (GAsyncReadyCallback)firmware_power_cycle_ready, - ctx); + mm_shared_qmi_reset (MM_IFACE_MODEM (self), + (GAsyncReadyCallback)firmware_reset_ready, + task); } static MMFirmwareProperties * @@ -10508,13 +7596,15 @@ } static void -firmware_change_current (MMIfaceModemFirmware *self, +firmware_change_current (MMIfaceModemFirmware *_self, const gchar *unique_id, GAsyncReadyCallback callback, gpointer user_data) { + MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (_self); QmiMessageDmsSetFirmwarePreferenceInput *input; FirmwareChangeCurrentContext *ctx; + GTask *task; QmiClient *client = NULL; GArray *array; QmiMessageDmsSetFirmwarePreferenceInputListImage modem_image_id; @@ -10522,43 +7612,40 @@ guint8 *tmp; gsize tmp_len; - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_DMS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) return; ctx = g_slice_new0 (FirmwareChangeCurrentContext); - ctx->self = g_object_ref (self); - ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - firmware_change_current); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)firmware_change_current_context_free); /* Look for the firmware image with the requested unique ID */ - ctx->firmware = find_firmware_properties_by_unique_id (ctx->self, unique_id); + ctx->firmware = find_firmware_properties_by_unique_id (self, unique_id); if (!ctx->firmware) { guint n = 0; /* Ok, let's look at the PRI info */ - ctx->firmware = find_firmware_properties_by_gobi_pri_info_substring (ctx->self, unique_id, &n); + ctx->firmware = find_firmware_properties_by_gobi_pri_info_substring (self, unique_id, &n); if (n > 1) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "Multiple firmware images (%u) found matching '%s' as PRI info substring", - n, unique_id); - firmware_change_current_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "Multiple firmware images (%u) found matching '%s' as PRI info substring", + n, unique_id); + g_object_unref (task); return; } if (n == 0) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "Firmware with unique ID '%s' wasn't found", - unique_id); - firmware_change_current_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "Firmware with unique ID '%s' wasn't found", + unique_id); + g_object_unref (task); return; } @@ -10566,13 +7653,13 @@ } /* If we're already in the requested firmware, we're done */ - if (ctx->self->priv->current_firmware && - g_str_equal (mm_firmware_properties_get_unique_id (ctx->self->priv->current_firmware), + if (self->priv->current_firmware && + g_str_equal (mm_firmware_properties_get_unique_id (self->priv->current_firmware), mm_firmware_properties_get_unique_id (ctx->firmware))) { mm_dbg ("Modem is already running firmware image '%s'", - mm_firmware_properties_get_unique_id (ctx->self->priv->current_firmware)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - firmware_change_current_context_complete_and_free (ctx); + mm_firmware_properties_get_unique_id (self->priv->current_firmware)); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -10607,12 +7694,12 @@ input = qmi_message_dms_set_firmware_preference_input_new (); qmi_message_dms_set_firmware_preference_input_set_list (input, array, NULL); qmi_client_dms_set_firmware_preference ( - ctx->client, + QMI_CLIENT_DMS (client), input, 10, NULL, (GAsyncReadyCallback)firmware_select_stored_image_ready, - ctx); + task); g_array_unref (modem_image_id.unique_id); g_array_unref (pri_image_id.unique_id); qmi_message_dms_set_firmware_preference_input_unref (input); @@ -10627,7 +7714,7 @@ GError **error) { - return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_boolean (G_TASK (res), error); } static void @@ -10635,25 +7722,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - MMPortQmi *port; - gboolean supported = FALSE; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - signal_check_support); + GTask *task; - port = mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)); + task = g_task_new (self, NULL, callback, user_data); /* If NAS service is available, assume either signal info or signal strength are supported */ - if (port) - supported = !!mm_port_qmi_peek_client (port, QMI_SERVICE_NAS, MM_PORT_QMI_FLAG_DEFAULT); - - mm_dbg ("Extended signal capabilities %ssupported", supported ? "" : "not "); - g_simple_async_result_set_op_res_gboolean (result, supported); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + if (!mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL)) { + mm_dbg ("Extended signal capabilities not supported"); + g_task_return_boolean (task, FALSE); + } else { + mm_dbg ("Extended signal capabilities supported"); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); } /*****************************************************************************/ @@ -10675,9 +7759,7 @@ } SignalLoadValuesResult; typedef struct { - MMBroadbandModemQmi *self; QmiClientNas *client; - GSimpleAsyncResult *result; SignalLoadValuesStep step; SignalLoadValuesResult *values_result; } SignalLoadValuesContext; @@ -10699,13 +7781,10 @@ } static void -signal_load_values_context_complete_and_free (SignalLoadValuesContext *ctx) +signal_load_values_context_free (SignalLoadValuesContext *ctx) { - g_simple_async_result_complete (ctx->result); if (ctx->values_result) signal_load_values_result_free (ctx->values_result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (SignalLoadValuesContext, ctx); } @@ -10740,26 +7819,27 @@ { SignalLoadValuesResult *values_result; - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + values_result = g_task_propagate_pointer (G_TASK (res), error); + if (!values_result) return FALSE; - values_result = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); *cdma = values_result->cdma ? g_object_ref (values_result->cdma) : NULL; *evdo = values_result->evdo ? g_object_ref (values_result->evdo) : NULL; *gsm = values_result->gsm ? g_object_ref (values_result->gsm) : NULL; *umts = values_result->umts ? g_object_ref (values_result->umts) : NULL; *lte = values_result->lte ? g_object_ref (values_result->lte) : NULL; - + signal_load_values_result_free (values_result); return TRUE; } -static void signal_load_values_context_step (SignalLoadValuesContext *ctx); +static void signal_load_values_context_step (GTask *task); static void signal_load_values_get_signal_strength_ready (QmiClientNas *client, GAsyncResult *res, - SignalLoadValuesContext *ctx) + GTask *task) { + SignalLoadValuesContext *ctx; QmiMessageNasGetSignalStrengthOutput *output; GArray *array; gint32 aux_int32; @@ -10768,11 +7848,12 @@ QmiNasRadioInterface radio_interface; QmiNasEvdoSinrLevel sinr; + ctx = g_task_get_task_data (task); output = qmi_client_nas_get_signal_strength_finish (client, res, NULL); if (!output || !qmi_message_nas_get_signal_strength_output_get_result (output, NULL)) { /* No hard errors, go on to next step */ ctx->step++; - signal_load_values_context_step (ctx); + signal_load_values_context_step (task); if (output) qmi_message_nas_get_signal_strength_output_unref (output); return; @@ -10892,14 +7973,15 @@ /* Go on */ ctx->step++; - signal_load_values_context_step (ctx); + signal_load_values_context_step (task); } static void signal_load_values_get_signal_info_ready (QmiClientNas *client, GAsyncResult *res, - SignalLoadValuesContext *ctx) + GTask *task) { + SignalLoadValuesContext *ctx; QmiMessageNasGetSignalInfoOutput *output; gint8 rssi; gint16 ecio; @@ -10909,11 +7991,12 @@ gint16 rsrp; gint16 snr; + ctx = g_task_get_task_data (task); output = qmi_client_nas_get_signal_info_finish (client, res, NULL); if (!output || !qmi_message_nas_get_signal_info_output_get_result (output, NULL)) { /* No hard errors, go on to next step */ ctx->step++; - signal_load_values_context_step (ctx); + signal_load_values_context_step (task); if (output) qmi_message_nas_get_signal_info_output_unref (output); return; @@ -10982,12 +8065,13 @@ /* Keep on */ ctx->step++; - signal_load_values_context_step (ctx); + signal_load_values_context_step (task); } static void -signal_load_values_context_step (SignalLoadValuesContext *ctx) +signal_load_values_context_step (GTask *task) { + SignalLoadValuesContext *ctx; #define VALUES_RESULT_LOADED(ctx) \ (ctx->values_result && \ @@ -10997,6 +8081,8 @@ ctx->values_result->umts || \ ctx->values_result->lte)) + ctx = g_task_get_task_data (task); + switch (ctx->step) { case SIGNAL_LOAD_VALUES_STEP_SIGNAL_FIRST: ctx->step++; @@ -11009,7 +8095,7 @@ 5, NULL, (GAsyncReadyCallback)signal_load_values_get_signal_info_ready, - ctx); + task); return; } ctx->step++; @@ -11036,7 +8122,7 @@ 5, NULL, (GAsyncReadyCallback)signal_load_values_get_signal_strength_ready, - ctx); + task); qmi_message_nas_get_signal_strength_input_unref (input); return; } @@ -11046,17 +8132,22 @@ case SIGNAL_LOAD_VALUES_STEP_SIGNAL_LAST: /* If any result is set, succeed */ if (VALUES_RESULT_LOADED (ctx)) { - g_simple_async_result_set_op_res_gpointer (ctx->result, - ctx->values_result, - (GDestroyNotify)signal_load_values_result_free); + SignalLoadValuesResult *values_result; + + /* Steal results from context in order to return them */ + values_result = ctx->values_result; ctx->values_result = NULL; + + g_task_return_pointer (task, + values_result, + (GDestroyNotify)signal_load_values_result_free); } else { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "No way to load extended signal information"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "No way to load extended signal information"); } - signal_load_values_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -11072,25 +8163,26 @@ gpointer user_data) { SignalLoadValuesContext *ctx; + GTask *task; QmiClient *client = NULL; mm_dbg ("loading extended signal information..."); - if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self), - QMI_SERVICE_NAS, &client, - callback, user_data)) + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) return; ctx = g_slice_new0 (SignalLoadValuesContext); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - signal_load_values); ctx->step = SIGNAL_LOAD_VALUES_STEP_SIGNAL_FIRST; - signal_load_values_context_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, + ctx, + (GDestroyNotify)signal_load_values_context_free); + + signal_load_values_context_step (task); } /*****************************************************************************/ @@ -11101,13 +8193,13 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void parent_enabling_started_ready (MMBroadbandModem *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; @@ -11121,9 +8213,8 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -11131,37 +8222,30 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - enabling_started); MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_qmi_parent_class)->enabling_started ( self, (GAsyncReadyCallback)parent_enabling_started_ready, - result); + task); } /*****************************************************************************/ /* First initialization step */ typedef struct { - MMBroadbandModem *self; - GSimpleAsyncResult *result; MMPortQmi *qmi; QmiService services[32]; guint service_index; } InitializationStartedContext; static void -initialization_started_context_complete_and_free (InitializationStartedContext *ctx) +initialization_started_context_free (InitializationStartedContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->qmi) g_object_unref (ctx->qmi); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -11170,17 +8254,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - /* Just parent's pointer passed here */ - return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return g_task_propagate_pointer (G_TASK (res), error); } static void parent_initialization_started_ready (MMBroadbandModem *self, GAsyncResult *res, - InitializationStartedContext *ctx) + GTask *task) { gpointer parent_ctx; GError *error = NULL; @@ -11196,28 +8276,83 @@ g_error_free (error); } - g_simple_async_result_set_op_res_gpointer (ctx->result, parent_ctx, NULL); - initialization_started_context_complete_and_free (ctx); + /* Just parent's pointer passed here */ + g_task_return_pointer (task, parent_ctx, NULL); + g_object_unref (task); } static void -parent_initialization_started (InitializationStartedContext *ctx) +parent_initialization_started (GTask *task) { + MMBroadbandModem *self; + + self = g_task_get_source_object (task); MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_qmi_parent_class)->initialization_started ( - ctx->self, + self, (GAsyncReadyCallback)parent_initialization_started_ready, - ctx); + task); +} + +static void +qmi_device_removed_cb (QmiDevice *device, + MMBroadbandModemQmi *self) +{ + /* Reprobe the modem here so we can get notifications back. */ + mm_info ("Connection to qmi-proxy for %s lost, reprobing", + qmi_device_get_path_display (device)); + + g_signal_handler_disconnect (device, self->priv->qmi_device_removed_id); + self->priv->qmi_device_removed_id = 0; + + mm_base_modem_set_reprobe (MM_BASE_MODEM (self), TRUE); + mm_base_modem_set_valid (MM_BASE_MODEM (self), FALSE); +} + +static void +track_qmi_device_removed (MMBroadbandModemQmi *self, + MMPortQmi* qmi) +{ + QmiDevice *device; + + device = mm_port_qmi_peek_device (qmi); + g_assert (device); + + self->priv->qmi_device_removed_id = g_signal_connect ( + device, + QMI_DEVICE_SIGNAL_REMOVED, + G_CALLBACK (qmi_device_removed_cb), + self); +} + +static void +untrack_qmi_device_removed (MMBroadbandModemQmi *self, + MMPortQmi* qmi) +{ + QmiDevice *device; + + if (self->priv->qmi_device_removed_id == 0) + return; + + device = mm_port_qmi_peek_device (qmi); + if (!device) + return; + + g_signal_handler_disconnect (device, self->priv->qmi_device_removed_id); + self->priv->qmi_device_removed_id = 0; } -static void allocate_next_client (InitializationStartedContext *ctx); +static void allocate_next_client (GTask *task); static void qmi_port_allocate_client_ready (MMPortQmi *qmi, GAsyncResult *res, - InitializationStartedContext *ctx) + GTask *task) { + InitializationStartedContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_port_qmi_allocate_client_finish (qmi, res, &error)) { mm_dbg ("Couldn't allocate client for service '%s': %s", qmi_service_get_string (ctx->services[ctx->service_index]), @@ -11226,15 +8361,22 @@ } ctx->service_index++; - allocate_next_client (ctx); + allocate_next_client (task); } static void -allocate_next_client (InitializationStartedContext *ctx) +allocate_next_client (GTask *task) { + InitializationStartedContext *ctx; + MMBroadbandModemQmi *self; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + if (ctx->services[ctx->service_index] == QMI_SERVICE_UNKNOWN) { - /* Done we are, launch parent's callback */ - parent_initialization_started (ctx); + /* Done we are, track device removal and launch parent's callback */ + track_qmi_device_removed (self, ctx->qmi); + parent_initialization_started (task); return; } @@ -11244,33 +8386,36 @@ MM_PORT_QMI_FLAG_DEFAULT, NULL, (GAsyncReadyCallback)qmi_port_allocate_client_ready, - ctx); + task); } static void qmi_port_open_ready_no_data_format (MMPortQmi *qmi, GAsyncResult *res, - InitializationStartedContext *ctx) + GTask *task) { GError *error = NULL; if (!mm_port_qmi_open_finish (qmi, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - initialization_started_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - allocate_next_client (ctx); + allocate_next_client (task); } static void qmi_port_open_ready (MMPortQmi *qmi, GAsyncResult *res, - InitializationStartedContext *ctx) + GTask *task) { + InitializationStartedContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_port_qmi_open_finish (qmi, res, &error)) { /* Really, really old devices (Gobi 1K, 2008-era firmware) may not * support SetDataFormat, so if we get an error opening the port @@ -11281,11 +8426,11 @@ FALSE, NULL, (GAsyncReadyCallback)qmi_port_open_ready_no_data_format, - ctx); + task); return; } - allocate_next_client (ctx); + allocate_next_client (task); } static void @@ -11294,28 +8439,29 @@ gpointer user_data) { InitializationStartedContext *ctx; + GTask *task; ctx = g_new0 (InitializationStartedContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - initialization_started); ctx->qmi = mm_base_modem_get_port_qmi (MM_BASE_MODEM (self)); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_started_context_free); + /* This may happen if we unplug the modem unexpectedly */ if (!ctx->qmi) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot initialize: QMI port went missing"); - initialization_started_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot initialize: QMI port went missing"); + g_object_unref (task); return; } if (mm_port_qmi_is_open (ctx->qmi)) { - /* Nothing to be done, just launch parent's callback */ - parent_initialization_started (ctx); + /* Nothing to be done, just track device removal and launch parent's + * callback */ + track_qmi_device_removed (MM_BROADBAND_MODEM_QMI (self), ctx->qmi); + parent_initialization_started (task); return; } @@ -11326,14 +8472,15 @@ ctx->services[3] = QMI_SERVICE_PDS; ctx->services[4] = QMI_SERVICE_OMA; ctx->services[5] = QMI_SERVICE_UIM; - ctx->services[6] = QMI_SERVICE_UNKNOWN; + ctx->services[6] = QMI_SERVICE_LOC; + ctx->services[7] = QMI_SERVICE_UNKNOWN; /* Now open our QMI port */ mm_port_qmi_open (ctx->qmi, TRUE, NULL, (GAsyncReadyCallback)qmi_port_open_ready, - ctx); + task); } /*****************************************************************************/ @@ -11370,10 +8517,12 @@ MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (object); qmi = mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)); - /* If we did open the QMI port during initialization, close it now */ - if (qmi && - mm_port_qmi_is_open (qmi)) { - mm_port_qmi_close (qmi); + if (qmi) { + /* Disconnect signal handler for qmi-proxy disappearing, if it exists */ + untrack_qmi_device_removed (self, qmi); + /* If we did open the QMI port during initialization, close it now */ + if (mm_port_qmi_is_open (qmi)) + mm_port_qmi_close (qmi); } g_free (self->priv->imei); @@ -11383,8 +8532,6 @@ g_free (self->priv->current_operator_description); if (self->priv->supported_bands) g_array_unref (self->priv->supported_bands); - if (self->priv->supported_radio_interfaces) - g_array_unref (self->priv->supported_radio_interfaces); G_OBJECT_CLASS (mm_broadband_modem_qmi_parent_class)->finalize (object); } @@ -11394,7 +8541,7 @@ { MMBroadbandModemQmi *self = MM_BROADBAND_MODEM_QMI (object); - g_list_free_full (self->priv->firmware_list, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->firmware_list, g_object_unref); self->priv->firmware_list = NULL; g_clear_object (&self->priv->current_firmware); @@ -11406,18 +8553,20 @@ iface_modem_init (MMIfaceModem *iface) { /* Initialization steps */ - iface->load_current_capabilities = modem_load_current_capabilities; - iface->load_current_capabilities_finish = modem_load_current_capabilities_finish; - iface->load_supported_capabilities = modem_load_supported_capabilities; - iface->load_supported_capabilities_finish = modem_load_supported_capabilities_finish; - iface->set_current_capabilities = set_current_capabilities; - iface->set_current_capabilities_finish = set_current_capabilities_finish; + iface->load_current_capabilities = mm_shared_qmi_load_current_capabilities; + iface->load_current_capabilities_finish = mm_shared_qmi_load_current_capabilities_finish; + iface->load_supported_capabilities = mm_shared_qmi_load_supported_capabilities; + iface->load_supported_capabilities_finish = mm_shared_qmi_load_supported_capabilities_finish; + iface->set_current_capabilities = mm_shared_qmi_set_current_capabilities; + iface->set_current_capabilities_finish = mm_shared_qmi_set_current_capabilities_finish; iface->load_manufacturer = modem_load_manufacturer; iface->load_manufacturer_finish = modem_load_manufacturer_finish; iface->load_model = modem_load_model; iface->load_model_finish = modem_load_model_finish; iface->load_revision = modem_load_revision; iface->load_revision_finish = modem_load_revision_finish; + iface->load_hardware_revision = modem_load_hardware_revision; + iface->load_hardware_revision_finish = modem_load_hardware_revision_finish; iface->load_equipment_identifier = modem_load_equipment_identifier; iface->load_equipment_identifier_finish = modem_load_equipment_identifier_finish; iface->load_device_identifier = modem_load_device_identifier; @@ -11428,10 +8577,10 @@ iface->load_unlock_required_finish = modem_load_unlock_required_finish; iface->load_unlock_retries = modem_load_unlock_retries; iface->load_unlock_retries_finish = modem_load_unlock_retries_finish; - iface->load_supported_bands = modem_load_supported_bands; - iface->load_supported_bands_finish = modem_load_supported_bands_finish; - iface->load_supported_modes = modem_load_supported_modes; - iface->load_supported_modes_finish = modem_load_supported_modes_finish; + iface->load_supported_bands = mm_shared_qmi_load_supported_bands; + iface->load_supported_bands_finish = mm_shared_qmi_load_supported_bands_finish; + iface->load_supported_modes = mm_shared_qmi_load_supported_modes; + iface->load_supported_modes_finish = mm_shared_qmi_load_supported_modes_finish; iface->load_power_state = load_power_state; iface->load_power_state_finish = load_power_state_finish; iface->load_supported_ip_families = modem_load_supported_ip_families; @@ -11452,16 +8601,16 @@ iface->load_supported_charsets_finish = NULL; iface->setup_charset = NULL; iface->setup_charset_finish = NULL; - iface->load_current_modes = load_current_modes; - iface->load_current_modes_finish = load_current_modes_finish; - iface->set_current_modes = set_current_modes; - iface->set_current_modes_finish = set_current_modes_finish; + iface->load_current_modes = mm_shared_qmi_load_current_modes; + iface->load_current_modes_finish = mm_shared_qmi_load_current_modes_finish; + iface->set_current_modes = mm_shared_qmi_set_current_modes; + iface->set_current_modes_finish = mm_shared_qmi_set_current_modes_finish; iface->load_signal_quality = load_signal_quality; iface->load_signal_quality_finish = load_signal_quality_finish; - iface->load_current_bands = modem_load_current_bands; - iface->load_current_bands_finish = modem_load_current_bands_finish; - iface->set_current_bands = set_current_bands; - iface->set_current_bands_finish = set_current_bands_finish; + iface->load_current_bands = mm_shared_qmi_load_current_bands; + iface->load_current_bands_finish = mm_shared_qmi_load_current_bands_finish; + iface->set_current_bands = mm_shared_qmi_set_current_bands; + iface->set_current_bands_finish = mm_shared_qmi_set_current_bands_finish; /* Don't try to load access technologies, as we would be using parent's * generic method (QCDM based). Access technologies are already reported via @@ -11478,10 +8627,10 @@ iface->create_bearer_finish = modem_create_bearer_finish; /* Other actions */ - iface->reset = modem_reset; - iface->reset_finish = modem_reset_finish; - iface->factory_reset = modem_factory_reset; - iface->factory_reset_finish = modem_factory_reset_finish; + iface->reset = mm_shared_qmi_reset; + iface->reset_finish = mm_shared_qmi_reset_finish; + iface->factory_reset = mm_shared_qmi_factory_reset; + iface->factory_reset_finish = mm_shared_qmi_factory_reset_finish; } static void @@ -11514,8 +8663,8 @@ /* Other actions */ iface->scan_networks = modem_3gpp_scan_networks; iface->scan_networks_finish = modem_3gpp_scan_networks_finish; - iface->register_in_network = modem_3gpp_register_in_network; - iface->register_in_network_finish = modem_3gpp_register_in_network_finish; + iface->register_in_network = mm_shared_qmi_3gpp_register_in_network; + iface->register_in_network_finish = mm_shared_qmi_3gpp_register_in_network_finish; iface->run_registration_checks = modem_3gpp_run_registration_checks; iface->run_registration_checks_finish = modem_3gpp_run_registration_checks_finish; iface->load_operator_code = modem_3gpp_load_operator_code; @@ -11594,14 +8743,21 @@ iface->load_capabilities = location_load_capabilities; iface->load_capabilities_finish = location_load_capabilities_finish; - iface->load_supl_server = location_load_supl_server; - iface->load_supl_server_finish = location_load_supl_server_finish; - iface->set_supl_server = location_set_supl_server; - iface->set_supl_server_finish = location_set_supl_server_finish; iface->enable_location_gathering = enable_location_gathering; iface->enable_location_gathering_finish = enable_location_gathering_finish; iface->disable_location_gathering = disable_location_gathering; iface->disable_location_gathering_finish = disable_location_gathering_finish; + + iface->load_supl_server = mm_shared_qmi_location_load_supl_server; + iface->load_supl_server_finish = mm_shared_qmi_location_load_supl_server_finish; + iface->set_supl_server = mm_shared_qmi_location_set_supl_server; + iface->set_supl_server_finish = mm_shared_qmi_location_set_supl_server_finish; + iface->load_supported_assistance_data = mm_shared_qmi_location_load_supported_assistance_data; + iface->load_supported_assistance_data_finish = mm_shared_qmi_location_load_supported_assistance_data_finish; + iface->inject_assistance_data = mm_shared_qmi_location_inject_assistance_data; + iface->inject_assistance_data_finish = mm_shared_qmi_location_inject_assistance_data_finish; + iface->load_assistance_data_servers = mm_shared_qmi_location_load_assistance_data_servers; + iface->load_assistance_data_servers_finish = mm_shared_qmi_location_load_assistance_data_servers_finish; } static void @@ -11641,8 +8797,6 @@ static void iface_modem_firmware_init (MMIfaceModemFirmware *iface) { - iface->check_support = firmware_check_support; - iface->check_support_finish = firmware_check_support_finish; iface->load_list = firmware_load_list; iface->load_list_finish = firmware_load_list_finish; iface->load_current = firmware_load_current; @@ -11651,6 +8805,19 @@ iface->change_current_finish = firmware_change_current_finish; } +static MMIfaceModemLocation * +peek_parent_location_interface (MMSharedQmi *self) +{ + return iface_modem_location_parent; +} + +static void +shared_qmi_init (MMSharedQmi *iface) +{ + iface->peek_client = shared_qmi_peek_client; + iface->peek_parent_location_interface = peek_parent_location_interface; +} + static void mm_broadband_modem_qmi_class_init (MMBroadbandModemQmiClass *klass) { diff -Nru modemmanager-1.6.8/src/mm-call-list.c modemmanager-1.10.0/src/mm-call-list.c --- modemmanager-1.6.8/src/mm-call-list.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-call-list.c 2019-01-15 15:57:35.000000000 +0100 @@ -29,7 +29,7 @@ #include "mm-base-call.h" #include "mm-log.h" -G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT); +G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT) enum { PROP_0, @@ -67,8 +67,7 @@ GList *l; guint i; - path_list = g_new0 (gchar *, - 1 + g_list_length (self->priv->list)); + path_list = g_new0 (gchar *, 1 + g_list_length (self->priv->list)); for (i = 0, l = self->priv->list; l; l = g_list_next (l)) { const gchar *path; @@ -84,160 +83,34 @@ /*****************************************************************************/ -MMBaseCall* mm_call_list_get_new_incoming(MMCallList *self) +MMBaseCall * +mm_call_list_get_first_ringing_in_call (MMCallList *self) { - MMBaseCall *call = NULL; GList *l; - guint i; - - for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { - - MMCallState state; - MMCallStateReason reason; - MMCallDirection direct; - - g_object_get (MM_BASE_CALL (l->data), - "state" , &state, - "state-reason", &reason, - "direction" , &direct, - NULL); - - if( direct == MM_CALL_DIRECTION_INCOMING && - state == MM_CALL_STATE_RINGING_IN && - reason == MM_CALL_STATE_REASON_INCOMING_NEW ) { - - call = MM_BASE_CALL (l->data); - break; - } - } - - return call; -} - -MMBaseCall* mm_call_list_get_first_ringing_call(MMCallList *self) -{ - MMBaseCall *call = NULL; - GList *l; - guint i; - for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { + for (l = self->priv->list; l; l = g_list_next (l)) { + MMBaseCall *call; + MMCallState state; + MMCallDirection direction; - MMCallState state; + call = MM_BASE_CALL (l->data); - g_object_get (MM_BASE_CALL (l->data), - "state" , &state, + g_object_get (call, + "state", &state, + "direction", &direction, NULL); - if( state == MM_CALL_STATE_RINGING_IN || - state == MM_CALL_STATE_RINGING_OUT ) { - - call = MM_BASE_CALL (l->data); - break; + if (direction == MM_CALL_DIRECTION_INCOMING && + state == MM_CALL_STATE_RINGING_IN) { + return call; } } - return call; -} - -MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self) -{ - MMBaseCall *call = NULL; - GList *l; - guint i; - - for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { - - MMCallState state; - MMCallDirection direct; - - g_object_get (MM_BASE_CALL (l->data), - "state" , &state, - "direction" , &direct, - NULL); - - if( direct == MM_CALL_DIRECTION_OUTGOING && - state == MM_CALL_STATE_DIALING ) { - - call = MM_BASE_CALL (l->data); - break; - } - } - - return call; -} - -MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self) -{ - MMBaseCall *call = NULL; - GList *l; - guint i; - - for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { - - MMCallState state; - - g_object_get (MM_BASE_CALL (l->data), - "state" , &state, - NULL); - - if( state != MM_CALL_STATE_TERMINATED ) { - call = MM_BASE_CALL (l->data); - break; - } - } - - return call; -} - -gboolean mm_call_list_send_dtmf_to_active_calls(MMCallList *self, gchar *dtmf) -{ - gboolean signaled = FALSE; - GList *l; - guint i; - - for (i = 0, l = self->priv->list; l; l = g_list_next (l)) { - - MMCallState state; - - g_object_get (MM_BASE_CALL (l->data), - "state" , &state, - NULL); - - if( state == MM_CALL_STATE_ACTIVE ) { - signaled = TRUE; - mm_base_call_received_dtmf(MM_BASE_CALL (l->data), dtmf); - } - } - - return signaled; + return NULL; } /*****************************************************************************/ -typedef struct { - MMCallList *self; - GSimpleAsyncResult *result; - gchar *path; -} DeleteCallContext; - -static void -delete_call_context_complete_and_free (DeleteCallContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx->path); - g_free (ctx); -} - -gboolean -mm_call_list_delete_call_finish (MMCallList *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - static guint cmp_call_by_path (MMBaseCall *call, const gchar *path) @@ -245,78 +118,34 @@ return g_strcmp0 (mm_base_call_get_path (call), path); } -static void -delete_ready (MMBaseCall *call, - GAsyncResult *res, - DeleteCallContext *ctx) -{ - GError *error = NULL; - GList *l; - - if (!mm_base_call_delete_finish (call, res, &error)) { - /* We report the error */ - g_simple_async_result_take_error (ctx->result, error); - delete_call_context_complete_and_free (ctx); - return; - } - - /* The CALL was properly deleted, we now remove it from our list */ - l = g_list_find_custom (ctx->self->priv->list, - ctx->path, - (GCompareFunc)cmp_call_by_path); - if (l) { - g_object_unref (MM_BASE_CALL (l->data)); - ctx->self->priv->list = g_list_delete_link (ctx->self->priv->list, l); - } - - /* We don't need to unref the CALL any more, but we can use the - * reference we got in the method, which is the one kept alive - * during the async operation. */ - mm_base_call_unexport (call); - - g_signal_emit (ctx->self, - signals[SIGNAL_CALL_DELETED], 0, - ctx->path); - - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - delete_call_context_complete_and_free (ctx); -} - -void -mm_call_list_delete_call (MMCallList *self, - const gchar *call_path, - GAsyncReadyCallback callback, - gpointer user_data) +gboolean +mm_call_list_delete_call (MMCallList *self, + const gchar *call_path, + GError **error) { - DeleteCallContext *ctx; - GList *l; + GList *l; + MMBaseCall *call; l = g_list_find_custom (self->priv->list, (gpointer)call_path, (GCompareFunc)cmp_call_by_path); if (!l) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No CALL found with path '%s'", - call_path); - return; + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No call found with path '%s'", + call_path); + return FALSE; } - /* Delete all CALL parts */ - ctx = g_new0 (DeleteCallContext, 1); - ctx->self = g_object_ref (self); - ctx->path = g_strdup (call_path); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_call_list_delete_call); - - mm_base_call_delete (MM_BASE_CALL (l->data), - (GAsyncReadyCallback)delete_ready, - ctx); + call = MM_BASE_CALL (l->data); + mm_base_call_unexport (call); + g_signal_emit (self, signals[SIGNAL_CALL_DELETED], 0, call_path); + + g_object_unref (call); + self->priv->list = g_list_delete_link (self->priv->list, l); + + return TRUE; } /*****************************************************************************/ @@ -337,9 +166,9 @@ mm_call_list_new (MMBaseModem *modem) { /* Create the object */ - return g_object_new (MM_TYPE_CALL_LIST, - MM_CALL_LIST_MODEM, modem, - NULL); + return g_object_new (MM_TYPE_CALL_LIST, + MM_CALL_LIST_MODEM, modem, + NULL); } static void @@ -394,7 +223,7 @@ MMCallList *self = MM_CALL_LIST (object); g_clear_object (&self->priv->modem); - g_list_free_full (self->priv->list, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->list, g_object_unref); self->priv->list = NULL; G_OBJECT_CLASS (mm_call_list_parent_class)->dispose (object); diff -Nru modemmanager-1.6.8/src/mm-call-list.h modemmanager-1.10.0/src/mm-call-list.h --- modemmanager-1.6.8/src/mm-call-list.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-call-list.h 2019-01-15 15:57:35.000000000 +0100 @@ -47,10 +47,10 @@ GObjectClass parent; /* Signals */ - void (*call_added) (MMCallList *self, + void (* call_added) (MMCallList *self, const gchar *call_path, - gboolean received); - void (*call_deleted) (MMCallList *self, + gboolean received); + void (* call_deleted) (MMCallList *self, const gchar *call_path); }; @@ -64,19 +64,10 @@ void mm_call_list_add_call (MMCallList *self, MMBaseCall *call); -void mm_call_list_delete_call (MMCallList *self, - const gchar *call_path, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean mm_call_list_delete_call_finish (MMCallList *self, - GAsyncResult *res, - GError **error); - -MMBaseCall* mm_call_list_get_new_incoming (MMCallList *self); -MMBaseCall* mm_call_list_get_first_ringing_call (MMCallList *self); -MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self); -MMBaseCall* mm_call_list_get_first_non_terminated_call (MMCallList *self); -gboolean mm_call_list_send_dtmf_to_active_calls (MMCallList *self, - gchar *dtmf); +gboolean mm_call_list_delete_call (MMCallList *self, + const gchar *call_path, + GError **error); + +MMBaseCall *mm_call_list_get_first_ringing_in_call (MMCallList *self); #endif /* MM_CALL_LIST_H */ diff -Nru modemmanager-1.6.8/src/mm-charsets.c modemmanager-1.10.0/src/mm-charsets.c --- modemmanager-1.6.8/src/mm-charsets.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-charsets.c 2019-01-15 15:57:35.000000000 +0100 @@ -148,6 +148,31 @@ return TRUE; } +gchar * +mm_modem_charset_byte_array_to_utf8 (GByteArray *array, + MMModemCharset charset) +{ + char *converted; + const char *iconv_from; + GError *error = NULL; + + g_return_val_if_fail (array != NULL, NULL); + g_return_val_if_fail (charset != MM_MODEM_CHARSET_UNKNOWN, NULL); + + iconv_from = charset_iconv_from (charset); + g_return_val_if_fail (iconv_from != NULL, FALSE); + + converted = g_convert ((const gchar *)array->data, array->len, + "UTF-8//TRANSLIT", iconv_from, + NULL, NULL, &error); + if (!converted || error) { + g_clear_error (&error); + converted = NULL; + } + + return converted; +} + char * mm_modem_charset_hex_to_utf8 (const char *src, MMModemCharset charset) { @@ -463,43 +488,37 @@ } static gboolean -gsm_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +gsm_is_subset (gunichar c, const char *utf8, gsize ulen) { guint8 gsm; - *out_clen = 1; if (utf8_to_gsm_def_char (utf8, ulen, &gsm)) return TRUE; - if (utf8_to_gsm_ext_char (utf8, ulen, &gsm)) { - *out_clen = 2; + if (utf8_to_gsm_ext_char (utf8, ulen, &gsm)) return TRUE; - } return FALSE; } static gboolean -ira_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +ira_is_subset (gunichar c, const char *utf8, gsize ulen) { - *out_clen = 1; return (ulen == 1); } static gboolean -ucs2_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +ucs2_is_subset (gunichar c, const char *utf8, gsize ulen) { - *out_clen = 2; return (c <= 0xFFFF); } static gboolean -iso88591_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +iso88591_is_subset (gunichar c, const char *utf8, gsize ulen) { - *out_clen = 1; return (c <= 0xFF); } static gboolean -pccp437_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +pccp437_is_subset (gunichar c, const char *utf8, gsize ulen) { static const gunichar t[] = { 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, @@ -520,8 +539,6 @@ }; int i; - *out_clen = 1; - if (c <= 0x7F) return TRUE; for (i = 0; i < sizeof (t) / sizeof (t[0]); i++) { @@ -532,7 +549,7 @@ } static gboolean -pcdn_is_subset (gunichar c, const char *utf8, gsize ulen, guint *out_clen) +pcdn_is_subset (gunichar c, const char *utf8, gsize ulen) { static const gunichar t[] = { 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, @@ -553,8 +570,6 @@ }; int i; - *out_clen = 1; - if (c <= 0x7F) return TRUE; for (i = 0; i < sizeof (t) / sizeof (t[0]); i++) { @@ -566,7 +581,7 @@ typedef struct { MMModemCharset cs; - gboolean (*func) (gunichar c, const char *utf8, gsize ulen, guint *out_clen); + gboolean (*func) (gunichar c, const char *utf8, gsize ulen); guint charsize; } SubsetEntry; @@ -581,66 +596,58 @@ }; /** - * mm_charset_get_encoded_len: + * mm_charset_can_covert_to: + * @utf8: UTF-8 valid string. + * @charset: the #MMModemCharset to validate the conversion from @utf8. * - * @utf8: UTF-8 valid string - * @charset: the #MMModemCharset to check the length of @utf8 in - * @out_unsupported: on return, number of characters of @utf8 that are not fully - * representable in @charset - * - * Returns: the size in bytes of the string if converted from UTF-8 into @charset. - **/ -guint -mm_charset_get_encoded_len (const char *utf8, - MMModemCharset charset, - guint *out_unsupported) + * Returns: %TRUE if the conversion is possible without errors, %FALSE otherwise. + */ +gboolean +mm_charset_can_convert_to (const char *utf8, + MMModemCharset charset) { - const char *p = utf8, *next; - guint len = 0, unsupported = 0; + const char *p = utf8; SubsetEntry *e; - g_return_val_if_fail (charset != MM_MODEM_CHARSET_UNKNOWN, 0); - g_return_val_if_fail (utf8 != NULL, 0); + g_return_val_if_fail (charset != MM_MODEM_CHARSET_UNKNOWN, FALSE); + g_return_val_if_fail (utf8 != NULL, FALSE); if (charset == MM_MODEM_CHARSET_UTF8) - return strlen (utf8); + return TRUE; /* Find the charset in our subset table */ for (e = &subset_table[0]; e->cs != charset && e->cs != MM_MODEM_CHARSET_UNKNOWN; e++); - g_return_val_if_fail (e->cs != MM_MODEM_CHARSET_UNKNOWN, 0); + g_return_val_if_fail (e->cs != MM_MODEM_CHARSET_UNKNOWN, FALSE); while (*p) { gunichar c; const char *end; - guint clen = 0; c = g_utf8_get_char_validated (p, -1); g_return_val_if_fail (c != (gunichar) -1, 0); - end = next = g_utf8_find_next_char (p, NULL); + end = g_utf8_find_next_char (p, NULL); if (end == NULL) { - /* Find the end... */ + /* Find the string terminating NULL */ end = p; - while (*end++); + while (*++end); } - if (!e->func (c, p, (end - p), &clen)) - unsupported++; - len += clen; - p = next; + if (!e->func (c, p, (end - p))) + return FALSE; + + p = end; } - if (out_unsupported) - *out_unsupported = unsupported; - return len; + return TRUE; } guint8 * -gsm_unpack (const guint8 *gsm, - guint32 num_septets, - guint8 start_offset, /* in _bits_ */ - guint32 *out_unpacked_len) +mm_charset_gsm_unpack (const guint8 *gsm, + guint32 num_septets, + guint8 start_offset, /* in _bits_ */ + guint32 *out_unpacked_len) { GByteArray *unpacked; int i; @@ -673,10 +680,10 @@ } guint8 * -gsm_pack (const guint8 *src, - guint32 src_len, - guint8 start_offset, - guint32 *out_packed_len) +mm_charset_gsm_pack (const guint8 *src, + guint32 src_len, + guint8 start_offset, + guint32 *out_packed_len) { guint8 *packed; guint octet = 0, lshift, plen; diff -Nru modemmanager-1.6.8/src/mm-charsets.h modemmanager-1.10.0/src/mm-charsets.h --- modemmanager-1.6.8/src/mm-charsets.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-charsets.h 2019-01-15 15:57:35.000000000 +0100 @@ -43,6 +43,11 @@ gboolean quoted, MMModemCharset charset); +/* Take a string encoded in the given charset in binary form, and + * convert it to UTF-8. */ +gchar *mm_modem_charset_byte_array_to_utf8 (GByteArray *array, + MMModemCharset charset); + /* Take a string in hex representation ("00430052" or "A4BE11" for example) * and convert it from the given character set to UTF-8. */ @@ -57,20 +62,19 @@ guint8 *mm_charset_gsm_unpacked_to_utf8 (const guint8 *gsm, guint32 len); -/* Returns the size in bytes required to hold the UTF-8 string in the given charset */ -guint mm_charset_get_encoded_len (const char *utf8, - MMModemCharset charset, - guint *out_unsupported); - -guint8 *gsm_unpack (const guint8 *gsm, - guint32 num_septets, - guint8 start_offset, /* in bits */ - guint32 *out_unpacked_len); - -guint8 *gsm_pack (const guint8 *src, - guint32 src_len, - guint8 start_offset, /* in bits */ - guint32 *out_packed_len); +/* Checks whether conversion to the given charset may be done without errors */ +gboolean mm_charset_can_convert_to (const char *utf8, + MMModemCharset charset); + +guint8 *mm_charset_gsm_unpack (const guint8 *gsm, + guint32 num_septets, + guint8 start_offset, /* in bits */ + guint32 *out_unpacked_len); + +guint8 *mm_charset_gsm_pack (const guint8 *src, + guint32 src_len, + guint8 start_offset, /* in bits */ + guint32 *out_packed_len); gchar *mm_charset_take_and_convert_to_utf8 (gchar *str, MMModemCharset charset); diff -Nru modemmanager-1.6.8/src/mm-context.c modemmanager-1.10.0/src/mm-context.c --- modemmanager-1.6.8/src/mm-context.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-context.c 2019-01-15 15:57:35.000000000 +0100 @@ -13,27 +13,98 @@ * Copyright (C) 2012 Aleksander Morgado */ +#include #include +#include +#define _LIBMM_INSIDE_MM +#include + #include "mm-context.h" /*****************************************************************************/ /* Application context */ -static gboolean version_flag; -static gboolean debug; -static const gchar *log_level; -static const gchar *log_file; -static gboolean show_ts; -static gboolean rel_ts; +#if defined WITH_UDEV +# define NO_AUTO_SCAN_OPTION_FLAG 0 +# define NO_AUTO_SCAN_DEFAULT FALSE +#else +/* Keep the option when udev disabled, just so that the unit test setup can + * unconditionally use --no-auto-scan */ +# define NO_AUTO_SCAN_OPTION_FLAG G_OPTION_FLAG_HIDDEN +# define NO_AUTO_SCAN_DEFAULT TRUE +#endif + +static gboolean help_flag; +static gboolean version_flag; +static gboolean debug; +static MMFilterRule filter_policy = MM_FILTER_POLICY_DEFAULT; +static gboolean no_auto_scan = NO_AUTO_SCAN_DEFAULT; +static const gchar *initial_kernel_events; + +static gboolean +filter_policy_option_arg (const gchar *option_name, + const gchar *value, + gpointer data, + GError **error) +{ + if (!g_ascii_strcasecmp (value, "default")) { + filter_policy = MM_FILTER_POLICY_DEFAULT; + return TRUE; + } + + if (!g_ascii_strcasecmp (value, "whitelist-only")) { + filter_policy = MM_FILTER_POLICY_WHITELIST_ONLY; + return TRUE; + } + + if (!g_ascii_strcasecmp (value, "strict")) { + filter_policy = MM_FILTER_POLICY_STRICT; + return TRUE; + } + + if (!g_ascii_strcasecmp (value, "paranoid")) { + filter_policy = MM_FILTER_POLICY_PARANOID; + return TRUE; + } + + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid filter policy value given: %s", + value); + return FALSE; +} static const GOptionEntry entries[] = { - { "version", 'V', 0, G_OPTION_ARG_NONE, &version_flag, "Print version", NULL }, - { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Run with extended debugging capabilities", NULL }, - { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of ERR, WARN, INFO, DEBUG", "[LEVEL]" }, - { "log-file", 0, 0, G_OPTION_ARG_FILENAME, &log_file, "Path to log file", "[PATH]" }, - { "timestamps", 0, 0, G_OPTION_ARG_NONE, &show_ts, "Show timestamps in log output", NULL }, - { "relative-timestamps", 0, 0, G_OPTION_ARG_NONE, &rel_ts, "Use relative timestamps (from MM start)", NULL }, + { + "filter-policy", 0, 0, G_OPTION_ARG_CALLBACK, filter_policy_option_arg, + "Filter policy: one of DEFAULT, WHITELIST-ONLY, STRICT, PARANOID", + "[POLICY]" + }, + { + "no-auto-scan", 0, NO_AUTO_SCAN_OPTION_FLAG, G_OPTION_ARG_NONE, &no_auto_scan, + "Don't auto-scan looking for devices", + NULL + }, + { + "initial-kernel-events", 0, 0, G_OPTION_ARG_FILENAME, &initial_kernel_events, + "Path to initial kernel events file", + "[PATH]" + }, + { + "debug", 0, 0, G_OPTION_ARG_NONE, &debug, + "Run with extended debugging capabilities", + NULL + }, + { + "version", 'V', 0, G_OPTION_ARG_NONE, &version_flag, + "Print version", + NULL + }, + { + "help", 'h', 0, G_OPTION_ARG_NONE, &help_flag, + "Show help", + NULL + }, { NULL } }; @@ -44,6 +115,78 @@ } const gchar * +mm_context_get_initial_kernel_events (void) +{ + return initial_kernel_events; +} + +gboolean +mm_context_get_no_auto_scan (void) +{ + return no_auto_scan; +} + +MMFilterRule +mm_context_get_filter_policy (void) +{ + return filter_policy; +} + +/*****************************************************************************/ +/* Log context */ + +static const gchar *log_level; +static const gchar *log_file; +static gboolean log_journal; +static gboolean log_show_ts; +static gboolean log_rel_ts; + +static const GOptionEntry log_entries[] = { + { + "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, + "Log level: one of ERR, WARN, INFO, DEBUG", + "[LEVEL]" + }, + { + "log-file", 0, 0, G_OPTION_ARG_FILENAME, &log_file, + "Path to log file", + "[PATH]" + }, +#if defined WITH_SYSTEMD_JOURNAL + { + "log-journal", 0, 0, G_OPTION_ARG_NONE, &log_journal, + "Log to systemd journal", + NULL + }, +#endif + { + "log-timestamps", 0, 0, G_OPTION_ARG_NONE, &log_show_ts, + "Show timestamps in log output", + NULL + }, + { + "log-relative-timestamps", 0, 0, G_OPTION_ARG_NONE, &log_rel_ts, + "Use relative timestamps (from MM start)", + NULL + }, + { NULL } +}; + +static GOptionGroup * +log_get_option_group (void) +{ + GOptionGroup *group; + + group = g_option_group_new ("log", + "Logging options", + "Show logging options", + NULL, + NULL); + g_option_group_add_entries (group, log_entries); + return group; +} + +const gchar * mm_context_get_log_level (void) { return log_level; @@ -56,30 +199,46 @@ } gboolean -mm_context_get_timestamps (void) +mm_context_get_log_journal (void) { - return show_ts; + return log_journal; } gboolean -mm_context_get_relative_timestamps (void) +mm_context_get_log_timestamps (void) { - return rel_ts; + return log_show_ts; +} + +gboolean +mm_context_get_log_relative_timestamps (void) +{ + return log_rel_ts; } /*****************************************************************************/ /* Test context */ -static gboolean test_session; -static gboolean test_no_auto_scan; -static gboolean test_enable; -static gchar *test_plugin_dir; +static gboolean test_session; +static gboolean test_enable; +static gchar *test_plugin_dir; static const GOptionEntry test_entries[] = { - { "test-session", 0, 0, G_OPTION_ARG_NONE, &test_session, "Run in session DBus", NULL }, - { "test-no-auto-scan", 0, 0, G_OPTION_ARG_NONE, &test_no_auto_scan, "Don't auto-scan looking for devices", NULL }, - { "test-enable", 0, 0, G_OPTION_ARG_NONE, &test_enable, "Enable the Test interface in the daemon", NULL }, - { "test-plugin-dir", 0, 0, G_OPTION_ARG_FILENAME, &test_plugin_dir, "Path to look for plugins", "[PATH]" }, + { + "test-session", 0, 0, G_OPTION_ARG_NONE, &test_session, + "Run in session DBus", + NULL + }, + { + "test-enable", 0, 0, G_OPTION_ARG_NONE, &test_enable, + "Enable the Test interface in the daemon", + NULL + }, + { + "test-plugin-dir", 0, 0, G_OPTION_ARG_FILENAME, &test_plugin_dir, + "Path to look for plugins", + "[PATH]" + }, { NULL } }; @@ -104,12 +263,6 @@ } gboolean -mm_context_get_test_no_auto_scan (void) -{ - return test_no_auto_scan; -} - -gboolean mm_context_get_test_enable (void) { return test_enable; @@ -128,12 +281,22 @@ { g_print ("\n" "ModemManager " MM_DIST_VERSION "\n" - "Copyright (2008 - 2016) The ModemManager authors\n" + "Copyright (C) 2008-2019 The ModemManager authors\n" "License GPLv2+: GNU GPL version 2 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n"); - exit (EXIT_SUCCESS); +} + +static void +print_help (GOptionContext *context) +{ + gchar *str; + + /* Always print --help-all */ + str = g_option_context_get_help (context, FALSE, NULL); + g_print ("%s", str); + g_free (str); } void @@ -144,26 +307,44 @@ GOptionContext *ctx; ctx = g_option_context_new (NULL); - g_option_context_set_summary (ctx, "DBus system service to communicate with modems."); + g_option_context_set_summary (ctx, "DBus system service to control mobile broadband modems."); g_option_context_add_main_entries (ctx, entries, NULL); + g_option_context_add_group (ctx, log_get_option_group ()); g_option_context_add_group (ctx, test_get_option_group ()); + g_option_context_set_help_enabled (ctx, FALSE); if (!g_option_context_parse (ctx, &argc, &argv, &error)) { - g_warning ("%s\n", error->message); + g_warning ("error: %s", error->message); g_error_free (error); exit (1); } + if (version_flag) { + print_version (); + g_option_context_free (ctx); + exit (EXIT_SUCCESS); + } + + if (help_flag) { + print_help (ctx); + g_option_context_free (ctx); + exit (EXIT_SUCCESS); + } + g_option_context_free (ctx); /* Additional setup to be done on debug mode */ if (debug) { log_level = "DEBUG"; - if (!show_ts && !rel_ts) - show_ts = TRUE; + if (!log_show_ts && !log_rel_ts) + log_show_ts = TRUE; } - /* If just version requested, print and exit */ - if (version_flag) - print_version (); + /* Initial kernel events processing may only be used if autoscan is disabled */ +#if defined WITH_UDEV + if (!no_auto_scan && initial_kernel_events) { + g_warning ("error: --initial-kernel-events must be used only if --no-auto-scan is also used"); + exit (1); + } +#endif } diff -Nru modemmanager-1.6.8/src/mm-context.h modemmanager-1.10.0/src/mm-context.h --- modemmanager-1.6.8/src/mm-context.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-context.h 2018-11-15 09:55:53.000000000 +0100 @@ -19,23 +19,32 @@ #include #include +#include "mm-filter.h" + #if !defined(MM_DIST_VERSION) # define MM_DIST_VERSION VERSION #endif -void mm_context_init (gint argc, +void mm_context_init (gint argc, gchar **argv); -gboolean mm_context_get_debug (void); -const gchar *mm_context_get_log_level (void); -const gchar *mm_context_get_log_file (void); -gboolean mm_context_get_timestamps (void); -gboolean mm_context_get_relative_timestamps (void); +gboolean mm_context_get_debug (void); +const gchar *mm_context_get_initial_kernel_events (void); +gboolean mm_context_get_no_auto_scan (void); + +/* Filter support */ +MMFilterRule mm_context_get_filter_policy (void); + +/* Logging support */ +const gchar *mm_context_get_log_level (void); +const gchar *mm_context_get_log_file (void); +gboolean mm_context_get_log_journal (void); +gboolean mm_context_get_log_timestamps (void); +gboolean mm_context_get_log_relative_timestamps (void); /* Testing support */ -gboolean mm_context_get_test_session (void); -gboolean mm_context_get_test_no_auto_scan (void); -gboolean mm_context_get_test_enable (void); -const gchar *mm_context_get_test_plugin_dir (void); +gboolean mm_context_get_test_session (void); +gboolean mm_context_get_test_enable (void); +const gchar *mm_context_get_test_plugin_dir (void); #endif /* MM_CONTEXT_H */ diff -Nru modemmanager-1.6.8/src/mm-device.c modemmanager-1.10.0/src/mm-device.c --- modemmanager-1.6.8/src/mm-device.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-device.c 2019-01-15 15:57:35.000000000 +0100 @@ -31,12 +31,12 @@ enum { PROP_0, - PROP_PATH, - PROP_UDEV_DEVICE, + PROP_UID, PROP_PLUGIN, PROP_MODEM, PROP_HOTPLUGGED, PROP_VIRTUAL, + PROP_INHIBITED, PROP_LAST }; @@ -53,11 +53,10 @@ /* Whether the device is real or virtual */ gboolean virtual; - /* Device path */ - gchar *path; + /* Unique id */ + gchar *uid; - /* Parent UDev device */ - GUdevDevice *udev_device; + /* If USB, device vid/pid */ guint16 vendor; guint16 product; @@ -81,6 +80,9 @@ /* Whether the device was hot-plugged. */ gboolean hotplugged; + /* Whether the device is inhibited. */ + gboolean inhibited; + /* Virtual ports */ gchar **virtual_ports; }; @@ -88,22 +90,16 @@ /*****************************************************************************/ static MMPortProbe * -device_find_probe_with_device (MMDevice *self, - GUdevDevice *udev_port, - gboolean lookup_ignored) +device_find_probe_with_device (MMDevice *self, + MMKernelDevice *kernel_port, + gboolean lookup_ignored) { GList *l; for (l = self->priv->port_probes; l; l = g_list_next (l)) { MMPortProbe *probe = MM_PORT_PROBE (l->data); - if ( g_udev_device_has_property (udev_port, "DEVPATH_OLD") - && g_str_has_suffix (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), - g_udev_device_get_property (udev_port, "DEVPATH_OLD"))) - return probe; - - if (g_str_equal (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), - g_udev_device_get_sysfs_path (udev_port))) + if (mm_kernel_device_cmp (mm_port_probe_peek_port (probe), kernel_port)) return probe; } @@ -113,13 +109,7 @@ for (l = self->priv->ignored_port_probes; l; l = g_list_next (l)) { MMPortProbe *probe = MM_PORT_PROBE (l->data); - if ( g_udev_device_has_property (udev_port, "DEVPATH_OLD") - && g_str_has_suffix (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), - g_udev_device_get_property (udev_port, "DEVPATH_OLD"))) - return probe; - - if (g_str_equal (g_udev_device_get_sysfs_path (mm_port_probe_peek_port (probe)), - g_udev_device_get_sysfs_path (udev_port))) + if (mm_kernel_device_cmp (mm_port_probe_peek_port (probe), kernel_port)) return probe; } @@ -127,164 +117,21 @@ } gboolean -mm_device_owns_port (MMDevice *self, - GUdevDevice *udev_port) +mm_device_owns_port (MMDevice *self, + MMKernelDevice *kernel_port) { - return !!device_find_probe_with_device (self, udev_port, TRUE); -} - -static gboolean -get_device_ids (GUdevDevice *device, - guint16 *vendor, - guint16 *product) -{ - GUdevDevice *parent = NULL; - const gchar *vid = NULL, *pid = NULL, *parent_subsys; - gboolean success = FALSE; - char *pci_vid = NULL, *pci_pid = NULL; - - parent = g_udev_device_get_parent (device); - if (parent) { - parent_subsys = g_udev_device_get_subsystem (parent); - if (parent_subsys) { - if (g_str_equal (parent_subsys, "bluetooth")) { - /* Bluetooth devices report the VID/PID of the BT adapter here, - * which isn't really what we want. Just return null IDs instead. - */ - success = TRUE; - goto out; - } else if (g_str_equal (parent_subsys, "pcmcia")) { - /* For PCMCIA devices we need to grab the PCMCIA subsystem's - * manfid and cardid, since any IDs on the tty device itself - * may be from PCMCIA controller or something else. - */ - vid = g_udev_device_get_sysfs_attr (parent, "manf_id"); - pid = g_udev_device_get_sysfs_attr (parent, "card_id"); - if (!vid || !pid) - goto out; - } else if (g_str_equal (parent_subsys, "platform")) { - /* Platform devices don't usually have a VID/PID */ - success = TRUE; - goto out; - } else if (g_str_has_prefix (parent_subsys, "usb") && - (!g_strcmp0 (g_udev_device_get_driver (parent), "qmi_wwan") || - !g_strcmp0 (g_udev_device_get_driver (parent), "cdc_mbim"))) { - /* Need to look for vendor/product in the parent of the QMI/MBIM device */ - GUdevDevice *qmi_parent; - - qmi_parent = g_udev_device_get_parent (parent); - if (qmi_parent) { - vid = g_udev_device_get_property (qmi_parent, "ID_VENDOR_ID"); - pid = g_udev_device_get_property (qmi_parent, "ID_MODEL_ID"); - g_object_unref (qmi_parent); - } - } else if (g_str_equal (parent_subsys, "pci")) { - const char *pci_id; - - /* We can't always rely on the model + vendor showing up on - * the PCI device's child, so look at the PCI parent. PCI_ID - * has the format "1931:000C". - */ - pci_id = g_udev_device_get_property (parent, "PCI_ID"); - if (pci_id && strlen (pci_id) == 9 && pci_id[4] == ':') { - vid = pci_vid = g_strdup (pci_id); - pci_vid[4] = '\0'; - pid = pci_pid = g_strdup (pci_id + 5); - } - } - } - } - - if (!vid) - vid = g_udev_device_get_property (device, "ID_VENDOR_ID"); - if (!vid) - goto out; - - if (strncmp (vid, "0x", 2) == 0) - vid += 2; - if (strlen (vid) != 4) - goto out; - - if (vendor) { - *vendor = (guint16) (mm_utils_hex2byte (vid + 2) & 0xFF); - *vendor |= (guint16) ((mm_utils_hex2byte (vid) & 0xFF) << 8); - } - - if (!pid) - pid = g_udev_device_get_property (device, "ID_MODEL_ID"); - if (!pid) { - *vendor = 0; - goto out; - } - - if (strncmp (pid, "0x", 2) == 0) - pid += 2; - if (strlen (pid) != 4) { - *vendor = 0; - goto out; - } - - if (product) { - *product = (guint16) (mm_utils_hex2byte (pid + 2) & 0xFF); - *product |= (guint16) ((mm_utils_hex2byte (pid) & 0xFF) << 8); - } - - success = TRUE; - -out: - if (parent) - g_object_unref (parent); - g_free (pci_vid); - g_free (pci_pid); - return success; -} - -const gchar * -mm_device_utils_get_port_driver (GUdevDevice *udev_port) -{ - const gchar *driver, *subsys; - const char *name = g_udev_device_get_name (udev_port); - - driver = g_udev_device_get_driver (udev_port); - if (!driver) { - GUdevDevice *parent; - - parent = g_udev_device_get_parent (udev_port); - if (parent) - driver = g_udev_device_get_driver (parent); - - /* Check for bluetooth; it's driver is a bunch of levels up so we - * just check for the subsystem of the parent being bluetooth. - */ - if (!driver && parent) { - subsys = g_udev_device_get_subsystem (parent); - if (subsys && !strcmp (subsys, "bluetooth")) - driver = "bluetooth"; - } - - if (parent) - g_object_unref (parent); - } - - /* Newer kernels don't set up the rfcomm port parent in sysfs, - * so we must infer it from the device name. - */ - if (!driver && strncmp (name, "rfcomm", 6) == 0) - driver = "bluetooth"; - - /* Note: may return NULL! */ - return driver; + return !!device_find_probe_with_device (self, kernel_port, TRUE); } static void -add_port_driver (MMDevice *self, - GUdevDevice *udev_port) +add_port_driver (MMDevice *self, + MMKernelDevice *kernel_port) { const gchar *driver; guint n_items; guint i; - driver = mm_device_utils_get_port_driver (udev_port); + driver = mm_kernel_device_get_driver (kernel_port); if (!driver) return; @@ -302,51 +149,46 @@ if (!driver) return; - self->priv->drivers = g_realloc (self->priv->drivers, - (n_items + 2) * sizeof (gchar *)); + self->priv->drivers = g_realloc (self->priv->drivers, (n_items + 2) * sizeof (gchar *)); self->priv->drivers[n_items] = g_strdup (driver); self->priv->drivers[n_items + 1] = NULL; } void -mm_device_grab_port (MMDevice *self, - GUdevDevice *udev_port) +mm_device_grab_port (MMDevice *self, + MMKernelDevice *kernel_port) { MMPortProbe *probe; - if (mm_device_owns_port (self, udev_port)) + if (mm_device_owns_port (self, kernel_port)) return; /* Get the vendor/product IDs out of the first one that gives us * some valid value (it seems we may get NULL reported for VID in QMI * ports, e.g. Huawei E367) */ if (!self->priv->vendor && !self->priv->product) { - if (!get_device_ids (udev_port, - &self->priv->vendor, - &self->priv->product)) { - mm_dbg ("(%s) could not get vendor/product ID", - self->priv->path); - } + self->priv->vendor = mm_kernel_device_get_physdev_vid (kernel_port); + self->priv->product = mm_kernel_device_get_physdev_pid (kernel_port); } /* Add new port driver */ - add_port_driver (self, udev_port); + add_port_driver (self, kernel_port); /* Create and store new port probe */ - probe = mm_port_probe_new (self, udev_port); + probe = mm_port_probe_new (self, kernel_port); self->priv->port_probes = g_list_prepend (self->priv->port_probes, probe); /* Notify about the grabbed port */ - g_signal_emit (self, signals[SIGNAL_PORT_GRABBED], 0, udev_port); + g_signal_emit (self, signals[SIGNAL_PORT_GRABBED], 0, kernel_port); } void -mm_device_release_port (MMDevice *self, - GUdevDevice *udev_port) +mm_device_release_port (MMDevice *self, + MMKernelDevice *kernel_port) { MMPortProbe *probe; - probe = device_find_probe_with_device (self, udev_port, TRUE); + probe = device_find_probe_with_device (self, kernel_port, TRUE); if (probe) { /* Found, remove from lists and destroy probe */ if (g_list_find (self->priv->port_probes, probe)) @@ -361,17 +203,18 @@ } void -mm_device_ignore_port (MMDevice *self, - GUdevDevice *udev_port) +mm_device_ignore_port (MMDevice *self, + MMKernelDevice *kernel_port) { MMPortProbe *probe; - probe = device_find_probe_with_device (self, udev_port, FALSE); + probe = device_find_probe_with_device (self, kernel_port, FALSE); if (probe) { /* Found, remove from list and add to the ignored list */ - mm_dbg ("Fully ignoring port '%s/%s' from now on", - g_udev_device_get_subsystem (udev_port), - g_udev_device_get_name (udev_port)); + mm_dbg ("[device %s] fully ignoring port '%s/%s' from now on", + self->priv->uid, + mm_kernel_device_get_subsystem (kernel_port), + mm_kernel_device_get_name (kernel_port)); self->priv->port_probes = g_list_remove (self->priv->port_probes, probe); self->priv->ignored_port_probes = g_list_prepend (self->priv->ignored_port_probes, probe); } @@ -393,10 +236,7 @@ g_object_set (self->priv->modem, MM_BASE_MODEM_CONNECTION, NULL, NULL); - - mm_dbg ("Unexported modem '%s' from path '%s'", - g_udev_device_get_sysfs_path (self->priv->udev_device), - path); + mm_dbg ("[device %s] unexported modem from path '%s'", self->priv->uid, path); g_free (path); } } @@ -415,8 +255,7 @@ /* If modem not yet valid (not fully initialized), don't export it */ if (!mm_base_modem_get_valid (self->priv->modem)) { - mm_dbg ("Modem '%s' not yet fully initialized", - g_udev_device_get_sysfs_path (self->priv->udev_device)); + mm_dbg ("[device %s] modem not yet fully initialized", self->priv->uid); return; } @@ -426,8 +265,7 @@ NULL); if (path) { g_free (path); - mm_dbg ("Modem '%s' already exported", - g_udev_device_get_sysfs_path (self->priv->udev_device)); + mm_dbg ("[device %s] modem already exported", self->priv->uid); return; } @@ -446,21 +284,14 @@ g_dbus_object_manager_server_export (self->priv->object_manager, G_DBUS_OBJECT_SKELETON (self->priv->modem)); - mm_dbg ("Exported modem '%s' at path '%s'", - (self->priv->virtual ? - self->priv->path : - g_udev_device_get_sysfs_path (self->priv->udev_device)), - path); - - /* Once connected, dump additional debug info about the modem */ - mm_dbg ("(%s): '%s' modem, VID 0x%04X PID 0x%04X (%s)", - path, - mm_base_modem_get_plugin (self->priv->modem), + mm_dbg ("[device %s] exported modem at path '%s'", self->priv->uid, path); + mm_dbg ("[device %s] plugin: %s", self->priv->uid, mm_base_modem_get_plugin (self->priv->modem)); + mm_dbg ("[device %s] vid:pid: 0x%04X:0x%04X", + self->priv->uid, (mm_base_modem_get_vendor_id (self->priv->modem) & 0xFFFF), - (mm_base_modem_get_product_id (self->priv->modem) & 0xFFFF), - (self->priv->virtual ? - "virtual" : - g_udev_device_get_subsystem (self->priv->udev_device))); + (mm_base_modem_get_product_id (self->priv->modem) & 0xFFFF)); + if (self->priv->virtual) + mm_dbg ("[device %s] virtual", self->priv->uid); g_free (path); } @@ -502,8 +333,27 @@ MMDevice *self) { if (!mm_base_modem_get_valid (modem)) { + GDBusObjectManagerServer *object_manager; + + object_manager = g_object_ref (self->priv->object_manager); + /* Modem no longer valid */ mm_device_remove_modem (self); + + if (mm_base_modem_get_reprobe (modem)) { + GError *error = NULL; + + if (!mm_device_create_modem (self, object_manager, &error)) { + mm_warn ("Could not recreate modem for device '%s': %s", + self->priv->uid, + error ? error->message : "unknown"); + g_error_free (error); + } else { + mm_dbg ("Modem recreated for device '%s'", self->priv->uid); + } + } + + g_object_unref (object_manager); } else { /* Modem now valid, export it, but only if we really have it around. * It may happen that the initialization sequence fails because the @@ -512,7 +362,7 @@ if (self->priv->modem) export_modem (self); else - mm_dbg ("Not exporting modem; no longer available"); + mm_dbg ("[device %s] not exporting modem; no longer available", self->priv->uid); } } @@ -524,6 +374,12 @@ g_assert (self->priv->modem == NULL); g_assert (self->priv->object_manager == NULL); + if (self->priv->inhibited) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Device is inhibited"); + return FALSE; + } + if (!self->priv->virtual) { if (!self->priv->port_probes) { g_set_error (error, @@ -533,7 +389,8 @@ return FALSE; } - mm_info ("Creating modem with plugin '%s' and '%u' ports", + mm_info ("[device %s] creating modem with plugin '%s' and '%u' ports", + self->priv->uid, mm_plugin_get_name (self->priv->plugin), g_list_length (self->priv->port_probes)); } else { @@ -545,7 +402,8 @@ return FALSE; } - mm_info ("Creating virtual modem with plugin '%s' and '%u' ports", + mm_info ("[device %s] creating virtual modem with plugin '%s' and '%u' ports", + self->priv->uid, mm_plugin_get_name (self->priv->plugin), g_strv_length (self->priv->virtual_ports)); } @@ -568,9 +426,9 @@ /*****************************************************************************/ const gchar * -mm_device_get_path (MMDevice *self) +mm_device_get_uid (MMDevice *self) { - return self->priv->path; + return self->priv->uid; } const gchar ** @@ -591,20 +449,6 @@ return self->priv->product; } -GUdevDevice * -mm_device_peek_udev_device (MMDevice *self) -{ - g_return_val_if_fail (self->priv->udev_device != NULL, NULL); - return self->priv->udev_device; -} - -GUdevDevice * -mm_device_get_udev_device (MMDevice *self) -{ - g_return_val_if_fail (self->priv->udev_device != NULL, NULL); - return G_UDEV_DEVICE (g_object_ref (self->priv->udev_device)); -} - void mm_device_set_plugin (MMDevice *self, GObject *plugin) @@ -647,22 +491,22 @@ } GObject * -mm_device_peek_port_probe (MMDevice *self, - GUdevDevice *udev_port) +mm_device_peek_port_probe (MMDevice *self, + MMKernelDevice *kernel_port) { MMPortProbe *probe; - probe = device_find_probe_with_device (self, udev_port, FALSE); + probe = device_find_probe_with_device (self, kernel_port, FALSE); return (probe ? G_OBJECT (probe) : NULL); } GObject * -mm_device_get_port_probe (MMDevice *self, - GUdevDevice *udev_port) +mm_device_get_port_probe (MMDevice *self, + MMKernelDevice *kernel_port) { MMPortProbe *probe; - probe = device_find_probe_with_device (self, udev_port, FALSE); + probe = device_find_probe_with_device (self, kernel_port, FALSE); return (probe ? g_object_ref (probe) : NULL); } @@ -675,11 +519,9 @@ GList * mm_device_get_port_probe_list (MMDevice *self) { - GList *copy; - - copy = g_list_copy (self->priv->port_probes); - g_list_foreach (copy, (GFunc)g_object_ref, NULL); - return copy; + return g_list_copy_deep (self->priv->port_probes, + (GCopyFunc)g_object_ref, + NULL); } gboolean @@ -688,6 +530,85 @@ return self->priv->hotplugged; } +gboolean +mm_device_get_inhibited (MMDevice *self) +{ + return self->priv->inhibited; +} + +/*****************************************************************************/ + +gboolean +mm_device_inhibit_finish (MMDevice *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +inhibit_disable_ready (MMBaseModem *modem, + GAsyncResult *res, + GTask *task) +{ + MMDevice *self; + GError *error = NULL; + + self = g_task_get_source_object (task); + + if (!mm_base_modem_disable_finish (modem, res, &error)) + g_task_return_error (task, error); + else { + g_cancellable_cancel (mm_base_modem_peek_cancellable (modem)); + mm_device_remove_modem (self); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); +} + +void +mm_device_inhibit (MMDevice *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* We want to allow inhibiting only devices that are currently + * exported in the bus, because otherwise we may be inhibiting + * in the middle of port probing and that may lead to some ports + * tracked inside the device object during inhibition and some + * other ports tracked in the base manager. So, if the device + * does not have a valid modem created and exposed, do not allow + * the inhibition. */ + if (!self->priv->modem || !g_dbus_object_get_object_path (G_DBUS_OBJECT (self->priv->modem))) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, + "Modem not exported in the bus"); + g_object_unref (task); + return; + } + + /* Flag as inhibited right away */ + g_assert (!self->priv->inhibited); + self->priv->inhibited = TRUE; + + /* Make sure modem is disabled while inhibited */ + mm_base_modem_disable (self->priv->modem, + (GAsyncReadyCallback)inhibit_disable_ready, + task); +} + +gboolean +mm_device_uninhibit (MMDevice *self, + GDBusObjectManagerServer *object_manager, + GError **error) +{ + g_assert (self->priv->inhibited); + self->priv->inhibited = FALSE; + return mm_device_create_modem (self, object_manager, error); +} + /*****************************************************************************/ void @@ -723,28 +644,16 @@ /*****************************************************************************/ MMDevice * -mm_device_new (GUdevDevice *udev_device, - gboolean hotplugged) +mm_device_new (const gchar *uid, + gboolean hotplugged, + gboolean virtual) { - g_return_val_if_fail (udev_device != NULL, NULL); + g_return_val_if_fail (uid != NULL, NULL); return MM_DEVICE (g_object_new (MM_TYPE_DEVICE, - MM_DEVICE_UDEV_DEVICE, udev_device, - MM_DEVICE_PATH, g_udev_device_get_sysfs_path (udev_device), + MM_DEVICE_UID, uid, MM_DEVICE_HOTPLUGGED, hotplugged, - NULL)); -} - -MMDevice * -mm_device_virtual_new (const gchar *path, - gboolean hotplugged) -{ - g_return_val_if_fail (path != NULL, NULL); - - return MM_DEVICE (g_object_new (MM_TYPE_DEVICE, - MM_DEVICE_PATH, path, - MM_DEVICE_HOTPLUGGED, hotplugged, - MM_DEVICE_VIRTUAL, TRUE, + MM_DEVICE_VIRTUAL, virtual, NULL)); } @@ -752,9 +661,7 @@ mm_device_init (MMDevice *self) { /* Initialize private data */ - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - MM_TYPE_DEVICE, - MMDevicePrivate); + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_DEVICE, MMDevicePrivate); } static void @@ -766,13 +673,9 @@ MMDevice *self = MM_DEVICE (object); switch (prop_id) { - case PROP_PATH: + case PROP_UID: /* construct only */ - self->priv->path = g_value_dup_string (value); - break; - case PROP_UDEV_DEVICE: - /* construct only */ - self->priv->udev_device = g_value_dup_object (value); + self->priv->uid = g_value_dup_string (value); break; case PROP_PLUGIN: g_clear_object (&(self->priv->plugin)); @@ -788,6 +691,9 @@ case PROP_VIRTUAL: self->priv->virtual = g_value_get_boolean (value); break; + case PROP_INHIBITED: + self->priv->inhibited = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -803,8 +709,8 @@ MMDevice *self = MM_DEVICE (object); switch (prop_id) { - case PROP_UDEV_DEVICE: - g_value_set_object (value, self->priv->udev_device); + case PROP_UID: + g_value_set_string (value, self->priv->uid); break; case PROP_PLUGIN: g_value_set_object (value, self->priv->plugin); @@ -818,6 +724,9 @@ case PROP_VIRTUAL: g_value_set_boolean (value, self->priv->virtual); break; + case PROP_INHIBITED: + g_value_set_boolean (value, self->priv->inhibited); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -829,11 +738,10 @@ { MMDevice *self = MM_DEVICE (object); - g_clear_object (&(self->priv->udev_device)); g_clear_object (&(self->priv->plugin)); - g_list_free_full (self->priv->port_probes, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->port_probes, g_object_unref); self->priv->port_probes = NULL; - g_list_free_full (self->priv->ignored_port_probes, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->ignored_port_probes, g_object_unref); self->priv->ignored_port_probes = NULL; clear_modem (self); @@ -846,7 +754,7 @@ { MMDevice *self = MM_DEVICE (object); - g_free (self->priv->path); + g_free (self->priv->uid); g_strfreev (self->priv->drivers); g_strfreev (self->priv->virtual_ports); @@ -863,24 +771,16 @@ /* Virtual methods */ object_class->get_property = get_property; object_class->set_property = set_property; - object_class->finalize = finalize; - object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->dispose = dispose; - properties[PROP_PATH] = - g_param_spec_string (MM_DEVICE_PATH, - "Path", - "Device path", + properties[PROP_UID] = + g_param_spec_string (MM_DEVICE_UID, + "Unique ID", + "Unique device id, e.g. the physical device sysfs path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); - g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]); - - properties[PROP_UDEV_DEVICE] = - g_param_spec_object (MM_DEVICE_UDEV_DEVICE, - "UDev Device", - "UDev device object", - G_UDEV_TYPE_DEVICE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); - g_object_class_install_property (object_class, PROP_UDEV_DEVICE, properties[PROP_UDEV_DEVICE]); + g_object_class_install_property (object_class, PROP_UID, properties[PROP_UID]); properties[PROP_PLUGIN] = g_param_spec_object (MM_DEVICE_PLUGIN, @@ -914,6 +814,14 @@ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_VIRTUAL, properties[PROP_VIRTUAL]); + properties[PROP_INHIBITED] = + g_param_spec_boolean (MM_DEVICE_INHIBITED, + "Inhibited", + "Whether the modem is inhibited", + FALSE, + G_PARAM_READWRITE); + g_object_class_install_property (object_class, PROP_INHIBITED, properties[PROP_INHIBITED]); + signals[SIGNAL_PORT_GRABBED] = g_signal_new (MM_DEVICE_PORT_GRABBED, G_OBJECT_CLASS_TYPE (object_class), @@ -921,7 +829,7 @@ G_STRUCT_OFFSET (MMDeviceClass, port_grabbed), NULL, NULL, g_cclosure_marshal_generic, - G_TYPE_NONE, 1, G_UDEV_TYPE_DEVICE); + G_TYPE_NONE, 1, MM_TYPE_KERNEL_DEVICE); signals[SIGNAL_PORT_RELEASED] = g_signal_new (MM_DEVICE_PORT_RELEASED, @@ -930,5 +838,5 @@ G_STRUCT_OFFSET (MMDeviceClass, port_released), NULL, NULL, g_cclosure_marshal_generic, - G_TYPE_NONE, 1, G_UDEV_TYPE_DEVICE); + G_TYPE_NONE, 1, MM_TYPE_KERNEL_DEVICE); } diff -Nru modemmanager-1.6.8/src/mm-device.h modemmanager-1.10.0/src/mm-device.h --- modemmanager-1.6.8/src/mm-device.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-device.h 2019-01-15 15:57:35.000000000 +0100 @@ -19,8 +19,7 @@ #include #include -#include - +#include "mm-kernel-device.h" #include "mm-base-modem.h" #define MM_TYPE_DEVICE (mm_device_get_type ()) @@ -34,12 +33,12 @@ typedef struct _MMDeviceClass MMDeviceClass; typedef struct _MMDevicePrivate MMDevicePrivate; -#define MM_DEVICE_PATH "path" -#define MM_DEVICE_UDEV_DEVICE "udev-device" -#define MM_DEVICE_PLUGIN "plugin" -#define MM_DEVICE_MODEM "modem" -#define MM_DEVICE_HOTPLUGGED "hotplugged" -#define MM_DEVICE_VIRTUAL "virtual" +#define MM_DEVICE_UID "uid" +#define MM_DEVICE_PLUGIN "plugin" +#define MM_DEVICE_MODEM "modem" +#define MM_DEVICE_HOTPLUGGED "hotplugged" +#define MM_DEVICE_VIRTUAL "virtual" +#define MM_DEVICE_INHIBITED "inhibited" #define MM_DEVICE_PORT_GRABBED "port-grabbed" #define MM_DEVICE_PORT_RELEASED "port-released" @@ -53,62 +52,66 @@ GObjectClass parent; /* signals */ - void (* port_grabbed) (MMDevice *self, - GUdevDevice *port); - void (* port_released) (MMDevice *self, - GUdevDevice *port); + void (* port_grabbed) (MMDevice *self, + MMKernelDevice *port); + void (* port_released) (MMDevice *self, + MMKernelDevice *port); }; GType mm_device_get_type (void); -MMDevice *mm_device_new (GUdevDevice *udev_device, - gboolean hotplugged); - -void mm_device_grab_port (MMDevice *self, - GUdevDevice *udev_port); -void mm_device_release_port (MMDevice *self, - GUdevDevice *udev_port); -gboolean mm_device_owns_port (MMDevice *self, - GUdevDevice *udev_port); -void mm_device_ignore_port (MMDevice *self, - GUdevDevice *udev_port); +MMDevice *mm_device_new (const gchar *uid, + gboolean hotplugged, + gboolean virtual); + +void mm_device_grab_port (MMDevice *self, + MMKernelDevice *kernel_port); +void mm_device_release_port (MMDevice *self, + MMKernelDevice *kernel_port); +gboolean mm_device_owns_port (MMDevice *self, + MMKernelDevice *kernel_port); +void mm_device_ignore_port (MMDevice *self, + MMKernelDevice *kernel_port); gboolean mm_device_create_modem (MMDevice *self, GDBusObjectManagerServer *object_manager, GError **error); -void mm_device_remove_modem (MMDevice *self); - -const gchar *mm_device_get_path (MMDevice *self); -const gchar **mm_device_get_drivers (MMDevice *self); -guint16 mm_device_get_vendor (MMDevice *self); -guint16 mm_device_get_product (MMDevice *self); -GUdevDevice *mm_device_peek_udev_device (MMDevice *self); -GUdevDevice *mm_device_get_udev_device (MMDevice *self); -void mm_device_set_plugin (MMDevice *self, - GObject *plugin); -GObject *mm_device_peek_plugin (MMDevice *self); -GObject *mm_device_get_plugin (MMDevice *self); -MMBaseModem *mm_device_peek_modem (MMDevice *self); -MMBaseModem *mm_device_get_modem (MMDevice *self); - -GObject *mm_device_peek_port_probe (MMDevice *self, - GUdevDevice *udev_port); -GObject *mm_device_get_port_probe (MMDevice *self, - GUdevDevice *udev_port); -GList *mm_device_peek_port_probe_list (MMDevice *self); -GList *mm_device_get_port_probe_list (MMDevice *self); - -const gchar *mm_device_utils_get_port_driver (GUdevDevice *udev_port); - -gboolean mm_device_get_hotplugged (MMDevice *self); +void mm_device_remove_modem (MMDevice *self); +void mm_device_inhibit (MMDevice *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_device_inhibit_finish (MMDevice *self, + GAsyncResult *res, + GError **error); +gboolean mm_device_uninhibit (MMDevice *self, + GDBusObjectManagerServer *object_manager, + GError **error); + + +const gchar *mm_device_get_uid (MMDevice *self); +const gchar **mm_device_get_drivers (MMDevice *self); +guint16 mm_device_get_vendor (MMDevice *self); +guint16 mm_device_get_product (MMDevice *self); +void mm_device_set_plugin (MMDevice *self, + GObject *plugin); +GObject *mm_device_peek_plugin (MMDevice *self); +GObject *mm_device_get_plugin (MMDevice *self); +MMBaseModem *mm_device_peek_modem (MMDevice *self); +MMBaseModem *mm_device_get_modem (MMDevice *self); +GObject *mm_device_peek_port_probe (MMDevice *self, + MMKernelDevice *kernel_port); +GObject *mm_device_get_port_probe (MMDevice *self, + MMKernelDevice *kernel_port); +GList *mm_device_peek_port_probe_list (MMDevice *self); +GList *mm_device_get_port_probe_list (MMDevice *self); +gboolean mm_device_get_hotplugged (MMDevice *self); +gboolean mm_device_get_inhibited (MMDevice *self); /* For testing purposes */ -MMDevice *mm_device_virtual_new (const gchar *path, - gboolean hotplugged); -void mm_device_virtual_grab_ports (MMDevice *self, +void mm_device_virtual_grab_ports (MMDevice *self, const gchar **ports); -const gchar **mm_device_virtual_peek_ports (MMDevice *self); -gboolean mm_device_is_virtual (MMDevice *self); +const gchar **mm_device_virtual_peek_ports (MMDevice *self); +gboolean mm_device_is_virtual (MMDevice *self); #endif /* MM_DEVICE_H */ diff -Nru modemmanager-1.6.8/src/mm-filter.c modemmanager-1.10.0/src/mm-filter.c --- modemmanager-1.6.8/src/mm-filter.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/mm-filter.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,374 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Aleksander Morgado + */ + +#include +#include + +#include +#include + +#include "mm-daemon-enums-types.h" +#include "mm-filter.h" +#include "mm-log.h" + +#define FILTER_PORT_MAYBE_FORBIDDEN "maybe-forbidden" + +G_DEFINE_TYPE (MMFilter, mm_filter, G_TYPE_OBJECT) + +enum { + PROP_0, + PROP_ENABLED_RULES, + LAST_PROP +}; + +struct _MMFilterPrivate { + MMFilterRule enabled_rules; +}; + +/*****************************************************************************/ + +gboolean +mm_filter_port (MMFilter *self, + MMKernelDevice *port, + gboolean manual_scan) +{ + const gchar *subsystem; + const gchar *name; + + subsystem = mm_kernel_device_get_subsystem (port); + name = mm_kernel_device_get_name (port); + + /* If the device is explicitly whitelisted, we process every port. Also + * allow specifying this flag per-port instead of for the full device, e.g. + * for platform tty ports where there's only one port anyway. */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_EXPLICIT_WHITELIST) && + (mm_kernel_device_get_global_property_as_boolean (port, ID_MM_DEVICE_PROCESS) || + mm_kernel_device_get_property_as_boolean (port, ID_MM_DEVICE_PROCESS))) { + mm_dbg ("[filter] (%s/%s) port allowed: device is whitelisted", subsystem, name); + return TRUE; + } + + /* If this is a virtual device, don't allow it */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_VIRTUAL) && + (!mm_kernel_device_get_physdev_sysfs_path (port))) { + mm_dbg ("[filter] (%s/%s) port filtered: virtual device", subsystem, name); + return FALSE; + } + + /* If this is a net device, we always allow it */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_NET) && + (g_strcmp0 (subsystem, "net") == 0)) { + mm_dbg ("[filter] (%s/%s) port allowed: net device", subsystem, name); + return TRUE; + } + + /* If this is a cdc-wdm device, we always allow it */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_CDC_WDM) && + (g_strcmp0 (subsystem, "usb") == 0 || g_strcmp0 (subsystem, "usbmisc") == 0) && + (name && g_str_has_prefix (name, "cdc-wdm"))) { + mm_dbg ("[filter] (%s/%s) port allowed: cdc-wdm device", subsystem, name); + return TRUE; + } + + /* If this is a tty device, we may allow it */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY) && + (g_strcmp0 (subsystem, "tty") == 0)) { + const gchar *physdev_subsystem; + const gchar *driver; + + /* Blacklist rules first */ + + /* Ignore blacklisted tty devices. */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_BLACKLIST) && + (mm_kernel_device_get_global_property_as_boolean (port, ID_MM_DEVICE_IGNORE))) { + mm_dbg ("[filter] (%s/%s): port filtered: device is blacklisted", subsystem, name); + return FALSE; + } + + /* Is the device in the manual-only greylist? If so, return if this is an + * automatic scan. */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY) && + (!manual_scan && mm_kernel_device_get_global_property_as_boolean (port, ID_MM_DEVICE_MANUAL_SCAN_ONLY))) { + mm_dbg ("[filter] (%s/%s): port filtered: device probed only in manual scan", subsystem, name); + return FALSE; + } + + /* Mixed blacklist/whitelist rules */ + + /* If the physdev is a 'platform' or 'pnp' device that's not whitelisted, ignore it */ + physdev_subsystem = mm_kernel_device_get_physdev_subsystem (port); + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_PLATFORM_DRIVER) && + (!g_strcmp0 (physdev_subsystem, "platform") || + !g_strcmp0 (physdev_subsystem, "pci") || + !g_strcmp0 (physdev_subsystem, "pnp") || + !g_strcmp0 (physdev_subsystem, "sdio"))) { + if (!mm_kernel_device_get_global_property_as_boolean (port, ID_MM_PLATFORM_DRIVER_PROBE)) { + mm_dbg ("[filter] (%s/%s): port filtered: port's parent platform driver is not whitelisted", subsystem, name); + return FALSE; + } + mm_dbg ("[filter] (%s/%s): port allowed: port's parent platform driver is whitelisted", subsystem, name); + return TRUE; + } + + /* Default allowed? */ + if (self->priv->enabled_rules & MM_FILTER_RULE_TTY_DEFAULT_ALLOWED) { + mm_dbg ("[filter] (%s/%s) port allowed", subsystem, name); + return TRUE; + } + + /* Whitelist rules last */ + + /* If the TTY kernel driver is one expected modem kernel driver, allow it */ + driver = mm_kernel_device_get_driver (port); + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_DRIVER) && + (!g_strcmp0 (driver, "option1") || + !g_strcmp0 (driver, "qcserial") || + !g_strcmp0 (driver, "qcaux") || + !g_strcmp0 (driver, "nozomi") || + !g_strcmp0 (driver, "sierra"))) { + mm_dbg ("[filter] (%s/%s): port allowed: modem-specific kernel driver detected", subsystem, name); + return TRUE; + } + + /* + * If the TTY kernel driver is cdc-acm and the interface is class=2/subclass=2/protocol=[1-6], allow it. + * + * Class definitions for Communication Devices 1.2 + * Communications Interface Class Control Protocol Codes: + * 00h | USB specification | No class specific protocol required + * 01h | ITU-T V.250 | AT Commands: V.250 etc + * 02h | PCCA-101 | AT Commands defined by PCCA-101 + * 03h | PCCA-101 | AT Commands defined by PCCA-101 & Annex O + * 04h | GSM 7.07 | AT Commands defined by GSM 07.07 + * 05h | 3GPP 27.07 | AT Commands defined by 3GPP 27.007 + * 06h | C-S0017-0 | AT Commands defined by TIA for CDMA + * 07h | USB EEM | Ethernet Emulation Model + * 08h-FDh | | RESERVED (future use) + * FEh | | External Protocol: Commands defined by Command Set Functional Descriptor + * FFh | USB Specification | Vendor-specific + */ + if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_ACM_INTERFACE) && + (!g_strcmp0 (driver, "cdc_acm")) && + (mm_kernel_device_get_interface_class (port) == 2) && + (mm_kernel_device_get_interface_subclass (port) == 2) && + (mm_kernel_device_get_interface_protocol (port) >= 1) && (mm_kernel_device_get_interface_protocol (port) <= 6)) { + mm_dbg ("[filter] (%s/%s): port allowed: cdc-acm interface reported AT-capable", subsystem, name); + return TRUE; + } + + /* Default forbidden? flag the port as maybe-forbidden, and go on */ + if (self->priv->enabled_rules & MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN) { + g_object_set_data (G_OBJECT (port), FILTER_PORT_MAYBE_FORBIDDEN, GUINT_TO_POINTER (TRUE)); + return TRUE; + } + + g_assert_not_reached (); + } + + /* Otherwise forbidden */ + mm_dbg ("[filter] (%s/%s) port filtered: forbidden port type", subsystem, name); + return FALSE; +} + +/*****************************************************************************/ + +gboolean +mm_filter_device_and_port (MMFilter *self, + MMDevice *device, + MMKernelDevice *port) +{ + const gchar *subsystem; + const gchar *name; + + /* If it wasn't flagged as maybe forbidden, there's nothing to do */ + if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (port), FILTER_PORT_MAYBE_FORBIDDEN))) + return TRUE; + + subsystem = mm_kernel_device_get_subsystem (port); + name = mm_kernel_device_get_name (port); + + /* Check whether this device holds a NET port in addition to this TTY */ + if (self->priv->enabled_rules & MM_FILTER_RULE_TTY_WITH_NET) { + GList *l; + + for (l = mm_device_peek_port_probe_list (device); l; l = g_list_next (l)) { + if (!g_strcmp0 (mm_port_probe_get_port_subsys (MM_PORT_PROBE (l->data)), "net")) { + mm_dbg ("[filter] (%s/%s): port allowed: device also exports a net interface (%s)", + subsystem, name, mm_port_probe_get_port_name (MM_PORT_PROBE (l->data))); + return TRUE; + } + } + } + + mm_dbg ("[filter] (%s/%s) port filtered: forbidden", subsystem, name); + return FALSE; +} + +/*****************************************************************************/ +/* Use filter rule names as environment variables to control them on startup: + * - MM_FILTER_RULE_XXX=1 to explicitly enable the rule. + * - MM_FILTER_RULE_XXX=0 to explicitly disable the rule. + */ + +static MMFilterRule +filter_rule_env_process (MMFilterRule enabled_rules) +{ + MMFilterRule updated_rules = enabled_rules; + GFlagsClass *flags_class; + guint i; + + flags_class = g_type_class_ref (MM_TYPE_FILTER_RULE); + + for (i = 0; (1 << i) & MM_FILTER_RULE_ALL; i++) { + GFlagsValue *flags_value; + const gchar *env_value; + + flags_value = g_flags_get_first_value (flags_class, (1 << i)); + g_assert (flags_value); + + env_value = g_getenv (flags_value->value_name); + if (!env_value) + continue; + + if (g_str_equal (env_value, "0")) + updated_rules &= ~(1 << i); + else if (g_str_equal (env_value, "1")) + updated_rules |= (1 << i); + } + + g_type_class_unref (flags_class); + + return updated_rules; +} + +/*****************************************************************************/ + +/* If TTY rule enabled, either DEFAULT_ALLOWED or DEFAULT_FORBIDDEN must be set. */ +#define VALIDATE_RULE_TTY(rules) (!(rules & MM_FILTER_RULE_TTY) || \ + ((rules & (MM_FILTER_RULE_TTY_DEFAULT_ALLOWED | MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN)) && \ + ((rules & (MM_FILTER_RULE_TTY_DEFAULT_ALLOWED | MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN)) != \ + (MM_FILTER_RULE_TTY_DEFAULT_ALLOWED | MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN)))) + +MMFilter * +mm_filter_new (MMFilterRule enabled_rules, + GError **error) +{ + MMFilter *self; + MMFilterRule updated_rules; + + /* The input enabled rules are coming from predefined filter profiles. */ + g_assert (VALIDATE_RULE_TTY (enabled_rules)); + updated_rules = filter_rule_env_process (enabled_rules); + if (!VALIDATE_RULE_TTY (updated_rules)) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid rules after processing envvars"); + return NULL; + } + + self = g_object_new (MM_TYPE_FILTER, + MM_FILTER_ENABLED_RULES, updated_rules, + NULL); + +#define RULE_ENABLED_STR(flag) ((self->priv->enabled_rules & flag) ? "yes" : "no") + + mm_dbg ("[filter] created"); + mm_dbg ("[filter] explicit whitelist: %s", RULE_ENABLED_STR (MM_FILTER_RULE_EXPLICIT_WHITELIST)); + mm_dbg ("[filter] virtual devices forbidden: %s", RULE_ENABLED_STR (MM_FILTER_RULE_VIRTUAL)); + mm_dbg ("[filter] net devices allowed: %s", RULE_ENABLED_STR (MM_FILTER_RULE_NET)); + mm_dbg ("[filter] cdc-wdm devices allowed: %s", RULE_ENABLED_STR (MM_FILTER_RULE_CDC_WDM)); + if (self->priv->enabled_rules & MM_FILTER_RULE_TTY) { + mm_dbg ("[filter] tty devices:"); + mm_dbg ("[filter] blacklist applied: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_BLACKLIST)); + mm_dbg ("[filter] manual scan only applied: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY)); + mm_dbg ("[filter] platform driver check: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_PLATFORM_DRIVER)); + mm_dbg ("[filter] driver check: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_DRIVER)); + mm_dbg ("[filter] cdc-acm interface check: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_ACM_INTERFACE)); + mm_dbg ("[filter] with net check: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_WITH_NET)); + if (self->priv->enabled_rules & MM_FILTER_RULE_TTY_DEFAULT_ALLOWED) + mm_dbg ("[filter] default: allowed"); + else if (self->priv->enabled_rules & MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN) + mm_dbg ("[filter] default: forbidden"); + else + g_assert_not_reached (); + } else + mm_dbg ("[filter] tty devices: no"); + +#undef RULE_ENABLED_STR + + return self; +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MMFilter *self = MM_FILTER (object); + + switch (prop_id) { + case PROP_ENABLED_RULES: + self->priv->enabled_rules = g_value_get_flags (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MMFilter *self = MM_FILTER (object); + + switch (prop_id) { + case PROP_ENABLED_RULES: + g_value_set_flags (value, self->priv->enabled_rules); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +mm_filter_init (MMFilter *self) +{ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_FILTER, MMFilterPrivate); +} + +static void +mm_filter_class_init (MMFilterClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (MMFilterPrivate)); + + /* Virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + + g_object_class_install_property ( + object_class, PROP_ENABLED_RULES, + g_param_spec_flags (MM_FILTER_ENABLED_RULES, + "Enabled rules", + "Mask of rules enabled in the filter", + MM_TYPE_FILTER_RULE, + MM_FILTER_RULE_NONE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} diff -Nru modemmanager-1.6.8/src/mm-filter.h modemmanager-1.10.0/src/mm-filter.h --- modemmanager-1.6.8/src/mm-filter.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/mm-filter.h 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,137 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2017 Aleksander Morgado + */ + +#ifndef MM_FILTER_H +#define MM_FILTER_H + +#include +#include + +#include "mm-device.h" +#include "mm-kernel-device.h" + +#define MM_TYPE_FILTER (mm_filter_get_type ()) +#define MM_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_FILTER, MMFilter)) +#define MM_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_FILTER, MMFilterClass)) +#define MM_IS_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_FILTER)) +#define MM_IS_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MM_TYPE_FILTER)) +#define MM_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_FILTER, MMFilterClass)) + +#define MM_FILTER_ENABLED_RULES "enabled-rules" /* construct-only */ + +typedef struct _MMFilterPrivate MMFilterPrivate; + +typedef struct { + GObject parent; + MMFilterPrivate *priv; +} MMFilter; + +typedef struct { + GObjectClass parent; +} MMFilterClass; + +GType mm_filter_get_type (void); + +typedef enum { /*< underscore_name=mm_filter_rule >*/ + MM_FILTER_RULE_NONE = 0, + MM_FILTER_RULE_EXPLICIT_WHITELIST = 1 << 0, + MM_FILTER_RULE_VIRTUAL = 1 << 1, + MM_FILTER_RULE_NET = 1 << 2, + MM_FILTER_RULE_CDC_WDM = 1 << 3, + MM_FILTER_RULE_TTY = 1 << 4, + MM_FILTER_RULE_TTY_BLACKLIST = 1 << 5, + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY = 1 << 6, + MM_FILTER_RULE_TTY_PLATFORM_DRIVER = 1 << 7, + MM_FILTER_RULE_TTY_DEFAULT_ALLOWED = 1 << 8, + MM_FILTER_RULE_TTY_DRIVER = 1 << 9, + MM_FILTER_RULE_TTY_ACM_INTERFACE = 1 << 10, + MM_FILTER_RULE_TTY_WITH_NET = 1 << 11, + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN = 1 << 12, +} MMFilterRule; + +#define MM_FILTER_RULE_ALL \ + (MM_FILTER_RULE_EXPLICIT_WHITELIST | \ + MM_FILTER_RULE_VIRTUAL | \ + MM_FILTER_RULE_NET | \ + MM_FILTER_RULE_CDC_WDM | \ + MM_FILTER_RULE_TTY | \ + MM_FILTER_RULE_TTY_BLACKLIST | \ + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY | \ + MM_FILTER_RULE_TTY_PLATFORM_DRIVER | \ + MM_FILTER_RULE_TTY_DEFAULT_ALLOWED | \ + MM_FILTER_RULE_TTY_DRIVER | \ + MM_FILTER_RULE_TTY_ACM_INTERFACE | \ + MM_FILTER_RULE_TTY_WITH_NET | \ + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN) + +/* This is the default ModemManager policy that tries to automatically probe + * device ports unless they're blacklisted in some way or another. */ +#define MM_FILTER_POLICY_DEFAULT \ + (MM_FILTER_RULE_EXPLICIT_WHITELIST | \ + MM_FILTER_RULE_VIRTUAL | \ + MM_FILTER_RULE_NET | \ + MM_FILTER_RULE_CDC_WDM | \ + MM_FILTER_RULE_TTY | \ + MM_FILTER_RULE_TTY_BLACKLIST | \ + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY | \ + MM_FILTER_RULE_TTY_PLATFORM_DRIVER | \ + MM_FILTER_RULE_TTY_DEFAULT_ALLOWED) + +/* This is a stricter policy which will only automatically probe device ports + * if they are allowed by any of the automatic whitelist rules. */ +#define MM_FILTER_POLICY_STRICT \ + (MM_FILTER_RULE_EXPLICIT_WHITELIST | \ + MM_FILTER_RULE_VIRTUAL | \ + MM_FILTER_RULE_NET | \ + MM_FILTER_RULE_CDC_WDM | \ + MM_FILTER_RULE_TTY | \ + MM_FILTER_RULE_TTY_PLATFORM_DRIVER | \ + MM_FILTER_RULE_TTY_DRIVER | \ + MM_FILTER_RULE_TTY_ACM_INTERFACE | \ + MM_FILTER_RULE_TTY_WITH_NET | \ + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN) + +/* This is equivalent to the strict policy, but also applying the device + * blacklists explicitly */ +#define MM_FILTER_POLICY_PARANOID \ + (MM_FILTER_RULE_EXPLICIT_WHITELIST | \ + MM_FILTER_RULE_VIRTUAL | \ + MM_FILTER_RULE_NET | \ + MM_FILTER_RULE_CDC_WDM | \ + MM_FILTER_RULE_TTY | \ + MM_FILTER_RULE_TTY_BLACKLIST | \ + MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY | \ + MM_FILTER_RULE_TTY_PLATFORM_DRIVER | \ + MM_FILTER_RULE_TTY_DRIVER | \ + MM_FILTER_RULE_TTY_ACM_INTERFACE | \ + MM_FILTER_RULE_TTY_WITH_NET | \ + MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN) + +/* This policy only allows using device ports explicitly whitelisted via + * udev rules. i.e. ModemManager won't do any kind of automatic probing. */ +#define MM_FILTER_POLICY_WHITELIST_ONLY MM_FILTER_RULE_EXPLICIT_WHITELIST + +MMFilter *mm_filter_new (MMFilterRule enabled_rules, + GError **error); + +gboolean mm_filter_port (MMFilter *self, + MMKernelDevice *port, + gboolean manual_scan); + +gboolean mm_filter_device_and_port (MMFilter *self, + MMDevice *device, + MMKernelDevice *port); + +#endif /* MM_FILTER_H */ diff -Nru modemmanager-1.6.8/src/mm-iface-modem-3gpp.c modemmanager-1.10.0/src/mm-iface-modem-3gpp.c --- modemmanager-1.6.8/src/mm-iface-modem-3gpp.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-3gpp.c 2019-01-15 15:57:35.000000000 +0100 @@ -64,10 +64,6 @@ status, MM_SIMPLE_PROPERTY_3GPP_OPERATOR_NAME, G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - g_object_bind_property (skeleton, "subscription-state", - status, MM_SIMPLE_PROPERTY_3GPP_SUBSCRIPTION_STATE, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - g_object_unref (skeleton); } @@ -119,6 +115,17 @@ return ctx; } +static gboolean +reg_state_is_registered (MMModem3gppRegistrationState state) +{ + return state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || + state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING || + state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY || + state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY || + state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED || + state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED; +} + static MMModem3gppRegistrationState get_consolidated_reg_state (RegistrationStateContext *ctx) { @@ -137,12 +144,11 @@ ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) return ctx->eps; - if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) - return ctx->cs; - if (ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) - return ctx->ps; - if (ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) - return ctx->eps; + /* Searching? */ + if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING || + ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING || + ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) + return MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING; /* If one state is DENIED and the others are UNKNOWN, use DENIED */ if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED && @@ -158,7 +164,41 @@ ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) return ctx->eps; - return ctx->cs; + /* Emergency services? */ + if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY || + ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY || + ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY) + return MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY; + + /* Support for additional registration states reported when on LTE. + * + * For example, we may see the modem registered in LTE (EPS==HOME), and we + * may get "SMS only" reported for CS. + * + * We give these states a very low priority w.r.t. the other ones as they + * are really likely never used (i.e. we would get as consolidated the LTE + * registration state, not the CS fall back state). + * + * We also warn in that case, because ideally we should always report the + * LTE registration state first, not this one. + */ + if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY || + ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY || + ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED || + ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) { + mm_warn ("3GPP CSFB registration state is consolidated: %s", + mm_modem_3gpp_registration_state_get_string (ctx->cs)); + return ctx->cs; + } + + /* Idle? */ + if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE || + ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE || + ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE) + return MM_MODEM_3GPP_REGISTRATION_STATE_IDLE; + + /* Just unknown at this point */ + return MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; } /*****************************************************************************/ @@ -166,7 +206,6 @@ typedef struct { MMIfaceModem3gpp *self; MmGdbusModem3gpp *skeleton; - GSimpleAsyncResult *result; GCancellable *cancellable; gchar *operator_id; GTimer *timer; @@ -174,11 +213,8 @@ } RegisterInNetworkContext; static void -register_in_network_context_complete_and_free (RegisterInNetworkContext *ctx) +register_in_network_context_free (RegisterInNetworkContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - if (ctx->timer) g_timer_destroy (ctx->timer); @@ -201,16 +237,21 @@ } static void -register_in_network_context_failed (RegisterInNetworkContext *ctx, - GError *error) +register_in_network_context_complete_failed (GTask *task, + GError *error) { + RegisterInNetworkContext *ctx; + + ctx = g_task_get_task_data (task); + mm_iface_modem_3gpp_update_cs_registration_state (ctx->self, MM_MODEM_3GPP_REGISTRATION_STATE_IDLE); mm_iface_modem_3gpp_update_ps_registration_state (ctx->self, MM_MODEM_3GPP_REGISTRATION_STATE_IDLE); mm_iface_modem_3gpp_update_eps_registration_state (ctx->self, MM_MODEM_3GPP_REGISTRATION_STATE_IDLE); mm_iface_modem_3gpp_update_access_technologies (ctx->self, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); - mm_iface_modem_3gpp_update_location (ctx->self, 0, 0); + mm_iface_modem_3gpp_update_location (ctx->self, 0, 0, 0); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); + g_object_unref (task); } gboolean @@ -218,38 +259,44 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void run_registration_checks_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - RegisterInNetworkContext *ctx); + GTask *task); static gboolean -run_registration_checks_again (RegisterInNetworkContext *ctx) +run_registration_checks_again (GTask *task) { + RegisterInNetworkContext *ctx; + + ctx = g_task_get_task_data (task); + /* Get fresh registration state */ mm_iface_modem_3gpp_run_registration_checks ( ctx->self, (GAsyncReadyCallback)run_registration_checks_ready, - ctx); + task); return G_SOURCE_REMOVE; } static void run_registration_checks_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { + RegisterInNetworkContext *ctx; GError *error = NULL; RegistrationStateContext *registration_state_context; MMModem3gppRegistrationState current_registration_state; + ctx = g_task_get_task_data (task); + mm_iface_modem_3gpp_run_registration_checks_finish (MM_IFACE_MODEM_3GPP (self), res, &error); if (error) { mm_dbg ("3GPP registration check failed: '%s'", error->message); - register_in_network_context_failed (ctx, error); - register_in_network_context_complete_and_free (ctx); + register_in_network_context_complete_failed (task, error); return; } @@ -260,31 +307,31 @@ * finished */ if (current_registration_state == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) { mm_dbg ("Registration denied"); - register_in_network_context_failed ( - ctx, + register_in_network_context_complete_failed ( + task, mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED)); - register_in_network_context_complete_and_free (ctx); return; } /* If we got registered, end registration checks */ - if (current_registration_state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || - current_registration_state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) { - /* Request immediate access tech update */ - mm_iface_modem_refresh_access_technologies (MM_IFACE_MODEM (ctx->self)); + if (reg_state_is_registered (current_registration_state)) { + /* Request immediate access tech and signal update: we may have changed + * from home to roaming or viceversa, both registered states, so there + * wouldn't be an explicit refresh triggered from the modem interface as + * the modem never got un-registered during the sequence. */ + mm_iface_modem_refresh_signal (MM_IFACE_MODEM (ctx->self)); mm_dbg ("Modem is currently registered in a 3GPP network"); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Don't spend too much time waiting to get registered */ if (g_timer_elapsed (ctx->timer, NULL) > ctx->max_registration_time) { mm_dbg ("3GPP registration check timed out"); - register_in_network_context_failed ( - ctx, + register_in_network_context_complete_failed ( + task, mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT)); - register_in_network_context_complete_and_free (ctx); return; } @@ -295,20 +342,19 @@ * well. */ mm_dbg ("Modem not yet registered in a 3GPP network... will recheck soon"); - g_timeout_add_seconds (3, (GSourceFunc)run_registration_checks_again, ctx); + g_timeout_add_seconds (3, (GSourceFunc)run_registration_checks_again, task); } static void register_in_network_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { GError *error = NULL; if (!MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->register_in_network_finish (self, res, &error)) { /* Propagate error when trying to lock to network */ - register_in_network_context_failed (ctx, error); - register_in_network_context_complete_and_free (ctx); + register_in_network_context_complete_failed (task, error); return; } @@ -317,7 +363,7 @@ mm_iface_modem_3gpp_run_registration_checks ( self, (GAsyncReadyCallback)run_registration_checks_ready, - ctx); + task); } void @@ -331,32 +377,33 @@ const gchar *current_operator_code; RegistrationStateContext *registration_state_context; GError *error = NULL; + GTask *task; ctx = g_slice_new0 (RegisterInNetworkContext); ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_register_in_network); ctx->operator_id = (operator_id && operator_id[0]) ? g_strdup (operator_id) : NULL; ctx->max_registration_time = max_registration_time; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)register_in_network_context_free); + g_object_get (self, MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - register_in_network_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } /* Validate input MCC/MNC */ if (ctx->operator_id && !mm_3gpp_parse_operator_id (ctx->operator_id, NULL, NULL, &error)) { g_assert (error != NULL); - g_simple_async_result_take_error (ctx->result, error); - register_in_network_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -379,8 +426,8 @@ registration_state_context->manual_registration = TRUE; mm_dbg ("Already registered in selected network '%s'...", current_operator_code); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -391,15 +438,17 @@ } /* Automatic registration requested? */ else { + MMModem3gppRegistrationState reg_state = mm_gdbus_modem3gpp_get_registration_state (ctx->skeleton); + /* If the modem is already registered and the last time it was asked * automatic registration, we're done */ - if (current_operator_code && + if ((current_operator_code || reg_state_is_registered (reg_state)) && !registration_state_context->manual_registration) { mm_dbg ("Already registered in network '%s'," " automatic registration not launched...", current_operator_code); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -421,7 +470,7 @@ ctx->operator_id, ctx->cancellable, (GAsyncReadyCallback)register_in_network_ready, - ctx); + task); } typedef struct { @@ -729,6 +778,298 @@ /*****************************************************************************/ +typedef struct { + MmGdbusModem3gpp *skeleton; + GDBusMethodInvocation *invocation; + MMIfaceModem3gpp *self; + MMModem3gppEpsUeModeOperation mode; +} HandleSetEpsUeModeOperationContext; + +static void +handle_set_eps_ue_mode_operation_context_free (HandleSetEpsUeModeOperationContext *ctx) +{ + g_object_unref (ctx->skeleton); + g_object_unref (ctx->invocation); + g_object_unref (ctx->self); + g_slice_free (HandleSetEpsUeModeOperationContext, ctx); +} + +static void +after_set_load_eps_ue_mode_operation_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + HandleSetEpsUeModeOperationContext *ctx) +{ + MMModem3gppEpsUeModeOperation uemode; + GError *error = NULL; + + uemode = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation_finish (self, res, &error); + if (error) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + if (uemode != ctx->mode) { + g_dbus_method_invocation_return_error_literal (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "UE mode of operation for EPS wasn't updated"); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + mm_gdbus_modem3gpp_set_eps_ue_mode_operation (ctx->skeleton, uemode); + mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation (ctx->skeleton, ctx->invocation); + handle_set_eps_ue_mode_operation_context_free (ctx); +} + +static void +handle_set_eps_ue_mode_operation_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + HandleSetEpsUeModeOperationContext *ctx) +{ + GError *error = NULL; + + if (!MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_eps_ue_mode_operation_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation ( + self, + (GAsyncReadyCallback)after_set_load_eps_ue_mode_operation_ready, + ctx); + return; + } + + /* Assume we're ok */ + mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation (ctx->skeleton, ctx->invocation); + handle_set_eps_ue_mode_operation_context_free (ctx); +} + +static void +handle_set_eps_ue_mode_operation_auth_ready (MMBaseModem *self, + GAsyncResult *res, + HandleSetEpsUeModeOperationContext *ctx) +{ + GError *error = NULL; + + if (!mm_base_modem_authorize_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + /* Check if we already are in the requested mode */ + if (mm_gdbus_modem3gpp_get_eps_ue_mode_operation (ctx->skeleton) == ctx->mode) { + /* Nothing to do */ + mm_gdbus_modem3gpp_complete_set_eps_ue_mode_operation (ctx->skeleton, ctx->invocation); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + /* If UE mode update is not implemented, report an error */ + if (!MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_eps_ue_mode_operation || + !MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_eps_ue_mode_operation_finish) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot set UE mode of operation for EPS: operation not supported"); + handle_set_eps_ue_mode_operation_context_free (ctx); + return; + } + + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_eps_ue_mode_operation ( + MM_IFACE_MODEM_3GPP (self), + ctx->mode, + (GAsyncReadyCallback)handle_set_eps_ue_mode_operation_ready, + ctx); +} + +static gboolean +handle_set_eps_ue_mode_operation (MmGdbusModem3gpp *skeleton, + GDBusMethodInvocation *invocation, + guint mode, + MMIfaceModem3gpp *self) +{ + HandleSetEpsUeModeOperationContext *ctx; + + ctx = g_slice_new (HandleSetEpsUeModeOperationContext); + ctx->skeleton = g_object_ref (skeleton); + ctx->invocation = g_object_ref (invocation); + ctx->self = g_object_ref (self); + ctx->mode = mode; + + mm_base_modem_authorize (MM_BASE_MODEM (self), + invocation, + MM_AUTHORIZATION_DEVICE_CONTROL, + (GAsyncReadyCallback)handle_set_eps_ue_mode_operation_auth_ready, + ctx); + return TRUE; +} + +/*****************************************************************************/ + +typedef struct { + MmGdbusModem3gpp *skeleton; + GDBusMethodInvocation *invocation; + MMIfaceModem3gpp *self; + GVariant *dictionary; + MMBearerProperties *config; +} HandleSetInitialEpsBearerSettingsContext; + +static void +handle_set_initial_eps_bearer_settings_context_free (HandleSetInitialEpsBearerSettingsContext *ctx) +{ + g_clear_object (&ctx->config); + g_variant_unref (ctx->dictionary); + g_object_unref (ctx->skeleton); + g_object_unref (ctx->invocation); + g_object_unref (ctx->self); + g_slice_free (HandleSetInitialEpsBearerSettingsContext, ctx); +} + +static void +after_set_load_initial_eps_bearer_settings_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + HandleSetInitialEpsBearerSettingsContext *ctx) +{ + GError *error = NULL; + MMBearerProperties *new_config; + + new_config = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish (self, res, &error); + if (error) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_initial_eps_bearer_settings_context_free (ctx); + return; + } + + if (!mm_bearer_properties_cmp (new_config, ctx->config)) { + g_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Initial EPS bearer settings were not updated"); + } else { + GVariant *dictionary; + + dictionary = mm_bearer_properties_get_dictionary (new_config); + mm_gdbus_modem3gpp_set_initial_eps_bearer_settings (ctx->skeleton, dictionary); + if (dictionary) + g_variant_unref (dictionary); + mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings (ctx->skeleton, ctx->invocation); + } + + handle_set_initial_eps_bearer_settings_context_free (ctx); + g_object_unref (new_config); +} + +static void +set_initial_eps_bearer_settings_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + HandleSetInitialEpsBearerSettingsContext *ctx) +{ + GError *error = NULL; + + if (!MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_initial_eps_bearer_settings_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_initial_eps_bearer_settings_context_free (ctx); + return; + } + + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings ( + self, + (GAsyncReadyCallback)after_set_load_initial_eps_bearer_settings_ready, + ctx); + return; + } + + /* Assume we're ok */ + mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings (ctx->skeleton, ctx->invocation); + handle_set_initial_eps_bearer_settings_context_free (ctx); +} + +static void +set_initial_eps_bearer_settings_auth_ready (MMBaseModem *self, + GAsyncResult *res, + HandleSetInitialEpsBearerSettingsContext *ctx) +{ + GError *error = NULL; + MMBearerProperties *old_config = NULL; + GVariant *old_dictionary; + + if (!mm_base_modem_authorize_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_initial_eps_bearer_settings_context_free (ctx); + return; + } + + /* If UE mode update is not implemented, report an error */ + if (!MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_initial_eps_bearer_settings || + !MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_initial_eps_bearer_settings_finish) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot set initial EPS bearer settings: operation not supported"); + handle_set_initial_eps_bearer_settings_context_free (ctx); + return; + } + + ctx->config = mm_bearer_properties_new_from_dictionary (ctx->dictionary, &error); + if (!ctx->config) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_set_initial_eps_bearer_settings_context_free (ctx); + return; + } + + /* If the user doesn't specify explicit auth settings, assume NONE as default */ + if (mm_bearer_properties_get_allowed_auth (ctx->config) == MM_BEARER_ALLOWED_AUTH_UNKNOWN) + mm_bearer_properties_set_allowed_auth (ctx->config, MM_BEARER_ALLOWED_AUTH_NONE); + + old_dictionary = mm_gdbus_modem3gpp_get_initial_eps_bearer_settings (ctx->skeleton); + if (old_dictionary) + old_config = mm_bearer_properties_new_from_dictionary (old_dictionary, NULL); + + if (old_config && mm_bearer_properties_cmp (ctx->config, old_config)) { + mm_gdbus_modem3gpp_complete_set_initial_eps_bearer_settings (ctx->skeleton, ctx->invocation); + handle_set_initial_eps_bearer_settings_context_free (ctx); + } else { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->set_initial_eps_bearer_settings ( + MM_IFACE_MODEM_3GPP (self), + ctx->config, + (GAsyncReadyCallback)set_initial_eps_bearer_settings_ready, + ctx); + } + + g_clear_object (&old_config); +} + +static gboolean +handle_set_initial_eps_bearer_settings (MmGdbusModem3gpp *skeleton, + GDBusMethodInvocation *invocation, + GVariant *dictionary, + MMIfaceModem3gpp *self) +{ + HandleSetInitialEpsBearerSettingsContext *ctx; + + ctx = g_slice_new0 (HandleSetInitialEpsBearerSettingsContext); + ctx->skeleton = g_object_ref (skeleton); + ctx->invocation = g_object_ref (invocation); + ctx->self = g_object_ref (self); + ctx->dictionary = g_variant_ref (dictionary); + + mm_base_modem_authorize (MM_BASE_MODEM (self), + invocation, + MM_AUTHORIZATION_DEVICE_CONTROL, + (GAsyncReadyCallback)set_initial_eps_bearer_settings_auth_ready, + ctx); + return TRUE; +} + +/*****************************************************************************/ + gboolean mm_iface_modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, GAsyncResult *res, @@ -771,22 +1112,16 @@ /*****************************************************************************/ typedef struct { - MMIfaceModem3gpp *self; MmGdbusModem3gpp *skeleton; - GSimpleAsyncResult *result; gboolean operator_code_loaded; gboolean operator_name_loaded; - gboolean subscription_state_loaded; } ReloadCurrentRegistrationInfoContext; static void -reload_current_registration_info_context_complete_and_free (ReloadCurrentRegistrationInfoContext *ctx) +reload_current_registration_info_context_free (ReloadCurrentRegistrationInfoContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); - g_object_unref (ctx->self); g_slice_free (ReloadCurrentRegistrationInfoContext, ctx); } @@ -795,19 +1130,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void reload_current_registration_info_context_step (ReloadCurrentRegistrationInfoContext *ctx); +static void reload_current_registration_info_context_step (GTask *task); static void load_operator_name_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - ReloadCurrentRegistrationInfoContext *ctx) + GTask *task) { + ReloadCurrentRegistrationInfoContext *ctx; GError *error = NULL; gchar *str; + ctx = g_task_get_task_data (task); + str = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_operator_name_finish (self, res, &error); if (error) { mm_warn ("Couldn't load Operator Name: '%s'", error->message); @@ -819,123 +1157,74 @@ g_free (str); ctx->operator_name_loaded = TRUE; - reload_current_registration_info_context_step (ctx); -} - -static gboolean -parse_mcc_mnc (const gchar *mccmnc, - guint *mcc_out, - guint *mnc_out) -{ - guint mccmnc_len; - gchar mcc[4] = { 0, 0, 0, 0 }; - gchar mnc[4] = { 0, 0, 0, 0 }; - - mccmnc_len = (mccmnc ? strlen (mccmnc) : 0); - if (mccmnc_len != 5 && - mccmnc_len != 6) { - mm_dbg ("Unexpected MCC/MNC string '%s'", mccmnc); - return FALSE; - } - - memcpy (mcc, mccmnc, 3); - /* Not all modems report 6-digit MNCs */ - memcpy (mnc, mccmnc + 3, 2); - if (mccmnc_len == 6) - mnc[2] = mccmnc[5]; - - *mcc_out = atoi (mcc); - *mnc_out = atoi (mnc); - - return TRUE; + reload_current_registration_info_context_step (task); } static void load_operator_code_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - ReloadCurrentRegistrationInfoContext *ctx) + GTask *task) { + ReloadCurrentRegistrationInfoContext *ctx; GError *error = NULL; gchar *str; + guint16 mcc = 0; + guint16 mnc = 0; + + ctx = g_task_get_task_data (task); str = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_operator_code_finish (self, res, &error); if (error) { mm_warn ("Couldn't load Operator Code: '%s'", error->message); - g_error_free (error); + } else if (!mm_3gpp_parse_operator_id (str, &mcc, &mnc, &error)) { + mm_dbg ("Unexpected MCC/MNC string '%s': '%s'", str, error->message); + g_clear_pointer (&str, g_free); } + g_clear_error (&error); if (ctx->skeleton) mm_gdbus_modem3gpp_set_operator_code (ctx->skeleton, str); /* If we also implement the location interface, update the 3GPP location */ - if (str && MM_IS_IFACE_MODEM_LOCATION (self)) { - guint mcc = 0; - guint mnc = 0; + if (mcc && MM_IS_IFACE_MODEM_LOCATION (self)) + mm_iface_modem_location_3gpp_update_mcc_mnc (MM_IFACE_MODEM_LOCATION (self), mcc, mnc); - if (parse_mcc_mnc (str, &mcc, &mnc)) - mm_iface_modem_location_3gpp_update_mcc_mnc (MM_IFACE_MODEM_LOCATION (self), mcc, mnc); - } g_free (str); ctx->operator_code_loaded = TRUE; - reload_current_registration_info_context_step (ctx); + reload_current_registration_info_context_step (task); } static void -load_subscription_state_ready (MMIfaceModem3gpp *self, - GAsyncResult *res, - ReloadCurrentRegistrationInfoContext *ctx) +reload_current_registration_info_context_step (GTask *task) { - GError *error = NULL; - MMModem3gppSubscriptionState subscription_state = MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN; - - subscription_state = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state_finish (self, res, &error); - if (error) { - mm_warn ("Couldn't load Subscription State: '%s'", error->message); - g_error_free (error); - } - - if (ctx->skeleton) - mm_gdbus_modem3gpp_set_subscription_state (ctx->skeleton, subscription_state); - - ctx->subscription_state_loaded = TRUE; - reload_current_registration_info_context_step (ctx); -} + MMIfaceModem3gpp *self; + ReloadCurrentRegistrationInfoContext *ctx; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); -static void -reload_current_registration_info_context_step (ReloadCurrentRegistrationInfoContext *ctx) -{ if (!ctx->operator_code_loaded) { /* Launch operator code update */ - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_operator_code ( - ctx->self, + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_operator_code ( + self, (GAsyncReadyCallback)load_operator_code_ready, - ctx); + task); return; } if (!ctx->operator_name_loaded) { /* Launch operator name update */ - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_operator_name ( - ctx->self, + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_operator_name ( + self, (GAsyncReadyCallback)load_operator_name_ready, - ctx); - return; - } - - if (!ctx->subscription_state_loaded) { - /* Launch subscription state update */ - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_subscription_state ( - ctx->self, - (GAsyncReadyCallback)load_subscription_state_ready, - ctx); + task); return; } /* If all are loaded, all done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - reload_current_registration_info_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -944,23 +1233,22 @@ gpointer user_data) { ReloadCurrentRegistrationInfoContext *ctx; + GTask *task; ctx = g_slice_new0 (ReloadCurrentRegistrationInfoContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_reload_current_registration_info); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)reload_current_registration_info_context_free); g_object_get (self, MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - reload_current_registration_info_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } @@ -977,12 +1265,7 @@ if (ctx->operator_name_loaded) mm_gdbus_modem3gpp_set_operator_name (ctx->skeleton, NULL); - ctx->subscription_state_loaded = !(MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state_finish); - if (ctx->subscription_state_loaded) - mm_gdbus_modem3gpp_set_subscription_state (ctx->skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN); - - reload_current_registration_info_context_step (ctx); + reload_current_registration_info_context_step (task); } void @@ -1002,19 +1285,6 @@ mm_iface_modem_location_3gpp_update_mcc_mnc (MM_IFACE_MODEM_LOCATION (self), 0, 0); } -static void -clear_subscription_state (MMIfaceModem3gpp *self) -{ - MmGdbusModem3gpp *skeleton = NULL; - - g_object_get (self, - MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton, - NULL); - if (!skeleton) - return; - mm_gdbus_modem3gpp_set_subscription_state (skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN); -} - /*****************************************************************************/ void @@ -1033,9 +1303,7 @@ /* Even if registration state didn't change, report access technology, * but only if something valid to report */ - if (state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || - state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING || - ctx->reloading_registration_info) { + if (reg_state_is_registered (state) || ctx->reloading_registration_info) { if (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN) mm_iface_modem_update_access_technologies (MM_IFACE_MODEM (self), access_tech, @@ -1049,6 +1317,7 @@ void mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self, gulong location_area_code, + gulong tracking_area_code, gulong cell_id) { MMModem3gppRegistrationState state; @@ -1068,13 +1337,12 @@ * location updates, but only if something valid to report. For the case * where we're registering (loading current registration info after a state * change to registered), we also allow LAC/CID updates. */ - if (ctx->reloading_registration_info || - state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || - state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) { - if (location_area_code > 0 && cell_id > 0) - mm_iface_modem_location_3gpp_update_lac_ci (MM_IFACE_MODEM_LOCATION (self), - location_area_code, - cell_id); + if (reg_state_is_registered (state) || ctx->reloading_registration_info) { + if ((location_area_code > 0 || tracking_area_code > 0) && cell_id > 0) + mm_iface_modem_location_3gpp_update_lac_tac_ci (MM_IFACE_MODEM_LOCATION (self), + location_area_code, + tracking_area_code, + cell_id); } else mm_iface_modem_location_3gpp_clear (MM_IFACE_MODEM_LOCATION (self)); } @@ -1118,14 +1386,6 @@ /* Not registered neither in home nor roaming network */ mm_iface_modem_3gpp_clear_current_operator (self); - /* The subscription state can be computed in two ways: a) via PCO which is - * sent by the carrier during registration or b) by looking at the - * registration reject error code. If b), we want to make sure we - * preserve the subscription state */ - if (old_state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || - old_state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) - clear_subscription_state (self); - /* The property in the interface is bound to the property * in the skeleton, so just updating here is enough */ g_object_set (self, @@ -1160,12 +1420,29 @@ if (new_state == old_state) return; - if (new_state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME || - new_state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) { + if (reg_state_is_registered (new_state)) { + MMModemState modem_state; + /* If already reloading registration info, skip it */ if (ctx->reloading_registration_info) return; + /* If the modem isn't already enabled, this registration state update + * could be due to a previously scheduled initial registration check + * when the modem was being enabled. We need to ignore it as otherwise + * it may cause an incorrect transition of the registration state and + * modem state when the modem is being disabled or still going through + * enable steps */ + modem_state = MM_MODEM_STATE_UNKNOWN; + g_object_get (self, + MM_IFACE_MODEM_STATE, &modem_state, + NULL); + if (modem_state < MM_MODEM_STATE_ENABLED) { + mm_dbg ("Modem %s: 3GPP Registration state change ignored as modem isn't enabled", + g_dbus_object_get_object_path (G_DBUS_OBJECT (self))); + return; + } + mm_info ("Modem %s: 3GPP Registration state changed (%s -> registering)", g_dbus_object_get_object_path (G_DBUS_OBJECT (self)), mm_modem_3gpp_registration_state_get_string (old_state)); @@ -1245,22 +1522,6 @@ update_registration_state (self, get_consolidated_reg_state (ctx), TRUE); } -void -mm_iface_modem_3gpp_update_subscription_state (MMIfaceModem3gpp *self, - MMModem3gppSubscriptionState state) -{ - MmGdbusModem3gpp *skeleton = NULL; - - g_object_get (self, - MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton, - NULL); - if (skeleton) { - mm_dbg ("Setting subscription state to: %s", mm_modem_3gpp_subscription_state_get_string (state)); - mm_gdbus_modem3gpp_set_subscription_state (skeleton, state); - g_object_unref (skeleton); - } -} - /*****************************************************************************/ typedef struct { @@ -1356,11 +1617,84 @@ /*****************************************************************************/ +void +mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self, + const GList *pco_list) +{ + MmGdbusModem3gpp *skeleton = NULL; + GVariantBuilder builder; + GVariant *variant; + const GList *iter; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton, + NULL); + if (!skeleton) + return; + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ubay)")); + for (iter = pco_list; iter; iter = g_list_next (iter)) { + g_variant_builder_add_value (&builder, + mm_pco_to_variant (MM_PCO (iter->data))); + } + variant = g_variant_ref_sink (g_variant_builder_end (&builder)); + mm_gdbus_modem3gpp_set_pco (skeleton, variant); + g_variant_unref (variant); + g_object_unref (skeleton); +} + +/*****************************************************************************/ + +void +mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *properties) +{ + MmGdbusModem3gpp *skeleton = NULL; + MMBaseBearer *old_bearer = NULL; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, &old_bearer, + NULL); + g_assert (skeleton); + + /* skip update? */ + if ((!old_bearer && !properties) || + (old_bearer && properties && mm_bearer_properties_cmp (properties, mm_base_bearer_peek_config (MM_BASE_BEARER (old_bearer))))) + goto out; + + if (properties) { + MMBaseBearer *new_bearer; + + mm_dbg ("updating initial EPS bearer..."); + g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer); + new_bearer = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_initial_eps_bearer (self, properties); + g_object_set (self, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, new_bearer, + NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, mm_base_bearer_get_path (new_bearer)); + g_object_unref (new_bearer); + } else { + mm_dbg ("clearing initial EPS bearer..."); + g_object_set (self, + MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, NULL, + NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, NULL); + } + +out: + g_clear_object (&old_bearer); + g_object_unref (skeleton); +} + +/*****************************************************************************/ + typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, + DISABLING_STEP_INITIAL_EPS_BEARER, DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS, DISABLING_STEP_DISABLE_UNSOLICITED_REGISTRATION_EVENTS, DISABLING_STEP_CLEANUP_UNSOLICITED_REGISTRATION_EVENTS, @@ -1371,18 +1705,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModem3gpp *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModem *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -1393,7 +1722,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } #undef VOID_REPLY_READY_FN @@ -1401,8 +1730,9 @@ static void \ NAME##_ready (MMIfaceModem3gpp *self, \ GAsyncResult *res, \ - DisablingContext *ctx) \ + GTask *task) \ { \ + DisablingContext *ctx; \ GError *error = NULL; \ \ MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->NAME##_finish (self, res, &error); \ @@ -1412,8 +1742,9 @@ } \ \ /* Go on to next step */ \ + ctx = g_task_get_task_data (task); \ ctx->step++; \ - interface_disabling_step (ctx); \ + interface_disabling_step (task); \ } VOID_REPLY_READY_FN (cleanup_unsolicited_events, @@ -1426,16 +1757,27 @@ "disable unsolicited registration events") static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModem3gpp *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; + case DISABLING_STEP_INITIAL_EPS_BEARER: + mm_iface_modem_3gpp_update_initial_eps_bearer (self, NULL); + /* Fall down to next step */ + ctx->step++; + case DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS: /* Disable periodic registration checks, if they were set */ - periodic_registration_check_disable (ctx->self); + periodic_registration_check_disable (self); /* Fall down to next step */ ctx->step++; @@ -1444,21 +1786,21 @@ gboolean ps_supported = FALSE; gboolean eps_supported = FALSE; - g_object_get (ctx->self, + g_object_get (self, MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED, &cs_supported, MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED, &ps_supported, MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &eps_supported, NULL); - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_registration_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_registration_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_registration_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_registration_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_registration_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_registration_events ( + self, cs_supported, ps_supported, eps_supported, (GAsyncReadyCallback)disable_unsolicited_registration_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1466,52 +1808,52 @@ } case DISABLING_STEP_CLEANUP_UNSOLICITED_REGISTRATION_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_registration_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_registration_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_registration_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_registration_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case DISABLING_STEP_REGISTRATION_STATE: - update_registration_state (ctx->self, MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN, FALSE); - mm_iface_modem_3gpp_update_access_technologies (ctx->self, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); - mm_iface_modem_3gpp_update_location (ctx->self, 0, 0); + update_registration_state (self, MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN, FALSE); + mm_iface_modem_3gpp_update_access_technologies (self, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); + mm_iface_modem_3gpp_update_location (self, 0, 0, 0); /* Fall down to next step */ ctx->step++; case DISABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1524,33 +1866,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -1558,58 +1900,41 @@ ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS, ENABLING_STEP_SETUP_UNSOLICITED_REGISTRATION_EVENTS, ENABLING_STEP_ENABLE_UNSOLICITED_REGISTRATION_EVENTS, + ENABLING_STEP_INITIAL_EPS_BEARER, ENABLING_STEP_LAST } EnablingStep; struct _EnablingContext { - MMIfaceModem3gpp *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModem3gpp *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_3gpp_enable_finish (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ @@ -1619,20 +1944,21 @@ /* If we get an error setting up unsolicited events, don't even bother trying to * enable them. */ ctx->step = ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS + 1; - interface_enabling_step (ctx); + interface_enabling_step (task); return; } /* Go on to next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_events_finish (self, res, &error); @@ -1643,17 +1969,21 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void setup_unsolicited_registration_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_registration_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ @@ -1663,22 +1993,23 @@ /* If we get an error setting up unsolicited events, don't even bother trying to * enable them. */ ctx->step = ENABLING_STEP_ENABLE_UNSOLICITED_REGISTRATION_EVENTS + 1; - interface_enabling_step (ctx); + interface_enabling_step (task); /* If error, setup periodic registration checks */ - periodic_registration_check_enable (ctx->self); + periodic_registration_check_enable (self); return; } /* Go on to next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_registration_events_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_registration_events_finish (self, res, &error); @@ -1687,20 +2018,56 @@ mm_dbg ("Enabling unsolicited registration events failed: '%s'", error->message); g_error_free (error); /* If error, setup periodic registration checks */ - periodic_registration_check_enable (ctx->self); + periodic_registration_check_enable (self); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +load_initial_eps_bearer_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) { + MMBearerProperties *properties; + EnablingContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + properties = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_finish (self, res, &error); + if (!properties) { + mm_dbg ("couldn't load initial default bearer properties: '%s'", error->message); + g_error_free (error); + goto out; + } + + mm_iface_modem_3gpp_update_initial_eps_bearer (self, properties); + g_object_unref (properties); + +out: + /* Go on to next step */ + ctx->step++; + interface_enabling_step (task); +} + +static void +interface_enabling_step (GTask *task) +{ + MMIfaceModem3gpp *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -1708,36 +2075,36 @@ ctx->step++; case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case ENABLING_STEP_SETUP_UNSOLICITED_REGISTRATION_EVENTS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_registration_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_registration_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_unsolicited_registration_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_registration_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_registration_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->setup_unsolicited_registration_events ( + self, (GAsyncReadyCallback)setup_unsolicited_registration_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1748,21 +2115,41 @@ gboolean ps_supported = FALSE; gboolean eps_supported = FALSE; - g_object_get (ctx->self, + g_object_get (self, MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED, &cs_supported, MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED, &ps_supported, MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &eps_supported, NULL); - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_registration_events && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_registration_events_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->enable_unsolicited_registration_events ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_registration_events && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_registration_events_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->enable_unsolicited_registration_events ( + self, cs_supported, ps_supported, eps_supported, (GAsyncReadyCallback)enable_unsolicited_registration_events_ready, - ctx); + task); + return; + } + /* Fall down to next step */ + ctx->step++; + } + + case ENABLING_STEP_INITIAL_EPS_BEARER: { + gboolean eps_supported = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &eps_supported, + NULL); + + if (eps_supported && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer ( + self, + (GAsyncReadyCallback)load_initial_eps_bearer_ready, + task); return; } /* Fall down to next step */ @@ -1771,8 +2158,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1786,75 +2173,55 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, INITIALIZATION_STEP_IMEI, INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS, + INITIALIZATION_STEP_EPS_UE_MODE_OPERATION, + INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS, INITIALIZATION_STEP_LAST } InitializationStep; struct _InitializationContext { - MMIfaceModem3gpp *self; MmGdbusModem3gpp *skeleton; - GSimpleAsyncResult *result; - GCancellable *cancellable; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - static void sim_pin_lock_enabled_cb (MMBaseSim *self, gboolean enabled, @@ -1872,13 +2239,70 @@ } static void +load_initial_eps_bearer_settings_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + InitializationContext *ctx; + MMBearerProperties *config; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + config = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish (self, res, &error); + if (!config) { + mm_warn ("couldn't load initial EPS bearer settings: '%s'", error->message); + g_error_free (error); + } else { + GVariant *dictionary; + + dictionary = mm_bearer_properties_get_dictionary (config); + mm_gdbus_modem3gpp_set_initial_eps_bearer_settings (ctx->skeleton, dictionary); + g_object_unref (config); + if (dictionary) + g_variant_unref (dictionary); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); +} + +static void +load_eps_ue_mode_operation_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + InitializationContext *ctx; + MMModem3gppEpsUeModeOperation uemode; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + uemode = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation_finish (self, res, &error); + mm_gdbus_modem3gpp_set_eps_ue_mode_operation (ctx->skeleton, uemode); + + if (error) { + mm_warn ("couldn't load UE mode of operation for EPS: '%s'", error->message); + g_error_free (error); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); +} + +static void load_enabled_facility_locks_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; MMModem3gppFacility facilities; + ctx = g_task_get_task_data (task); + facilities = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_enabled_facility_locks_finish (self, res, &error); mm_gdbus_modem3gpp_set_enabled_facility_locks (ctx->skeleton, facilities); @@ -1904,17 +2328,20 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_imei_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; gchar *imei; + ctx = g_task_get_task_data (task); + imei = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_imei_finish (self, res, &error); mm_gdbus_modem3gpp_set_imei (ctx->skeleton, imei); g_free (imei); @@ -1926,15 +2353,23 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModem3gpp *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -1946,29 +2381,54 @@ * lifetime of the modem. Therefore, if we already have it loaded, * don't try to load it again. */ if (!mm_gdbus_modem3gpp_get_imei (ctx->skeleton) && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_imei && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_imei_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_imei ( - ctx->self, + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_imei && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_imei_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_imei ( + self, (GAsyncReadyCallback)load_imei_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS: - if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks && - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks_finish) { - MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->load_enabled_facility_locks ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_enabled_facility_locks && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_enabled_facility_locks_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_enabled_facility_locks ( + self, (GAsyncReadyCallback)load_enabled_facility_locks_ready, - ctx); + task); + return; + } + /* Fall down to next step */ + ctx->step++; + + case INITIALIZATION_STEP_EPS_UE_MODE_OPERATION: + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation ( + self, + (GAsyncReadyCallback)load_eps_ue_mode_operation_ready, + task); + return; + } + /* Fall down to next step */ + ctx->step++; + + case INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS: + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings ( + self, + (GAsyncReadyCallback)load_initial_eps_bearer_settings_ready, + task); return; } /* Fall down to next step */ ctx->step++; + case INITIALIZATION_STEP_LAST: /* We are done without errors! */ @@ -1976,19 +2436,26 @@ g_signal_connect (ctx->skeleton, "handle-register", G_CALLBACK (handle_register), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-scan", G_CALLBACK (handle_scan), - ctx->self); - + self); + g_signal_connect (ctx->skeleton, + "handle-set-eps-ue-mode-operation", + G_CALLBACK (handle_set_eps_ue_mode_operation), + self); + g_signal_connect (ctx->skeleton, + "handle-set-initial-eps-bearer-settings", + G_CALLBACK (handle_set_initial_eps_bearer_settings), + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem3gpp (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem3gpp (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM3GPP (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -2000,7 +2467,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -2011,6 +2478,7 @@ { MmGdbusModem3gpp *skeleton = NULL; InitializationContext *ctx; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -2025,6 +2493,8 @@ mm_gdbus_modem3gpp_set_operator_name (skeleton, NULL); mm_gdbus_modem3gpp_set_enabled_facility_locks (skeleton, MM_MODEM_3GPP_FACILITY_NONE); mm_gdbus_modem3gpp_set_subscription_state (skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN); + mm_gdbus_modem3gpp_set_pco (skeleton, NULL); + mm_gdbus_modem3gpp_set_initial_eps_bearer (skeleton, NULL); /* Bind our RegistrationState property */ g_object_bind_property (self, MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, @@ -2046,17 +2516,14 @@ } ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + /* Perform async initialization here */ - interface_initialization_step (ctx); + interface_initialization_step (task); } void @@ -2138,6 +2605,14 @@ MM_MODEM_3GPP_FACILITY_NONE, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_object (MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER, + "Initial EPS bearer", + "Initial EPS bearer setup during registration", + MM_TYPE_BASE_BEARER, + G_PARAM_READWRITE)); + initialized = TRUE; } diff -Nru modemmanager-1.6.8/src/mm-iface-modem-3gpp.h modemmanager-1.10.0/src/mm-iface-modem-3gpp.h --- modemmanager-1.6.8/src/mm-iface-modem-3gpp.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-3gpp.h 2019-01-15 15:57:35.000000000 +0100 @@ -21,6 +21,7 @@ #define _LIBMM_INSIDE_MM #include +#include "mm-base-bearer.h" #include "mm-port-serial-at.h" #define MM_TYPE_IFACE_MODEM_3GPP (mm_iface_modem_3gpp_get_type ()) @@ -34,6 +35,7 @@ #define MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED "iface-modem-3gpp-ps-network-supported" #define MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED "iface-modem-3gpp-eps-network-supported" #define MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS "iface-modem-3gpp-ignored-facility-locks" +#define MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER "iface-modem-3gpp-initial-eps-bearer" #define MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK \ (MM_MODEM_ACCESS_TECHNOLOGY_GSM | \ @@ -68,6 +70,14 @@ GAsyncResult *res, GError **error); + /* Loading of the UE mode of operation for EPS property */ + void (* load_eps_ue_mode_operation) (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMModem3gppEpsUeModeOperation (* load_eps_ue_mode_operation_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + /* Asynchronous setting up unsolicited events */ void (*setup_unsolicited_events) (MMIfaceModem3gpp *self, GAsyncReadyCallback callback, @@ -137,6 +147,26 @@ GAsyncResult *res, GError **error); + /* Asynchronous initial default EPS bearer loading */ + void (*load_initial_eps_bearer) (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerProperties * (*load_initial_eps_bearer_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous initial default EPS bearer settings loading */ + void (*load_initial_eps_bearer_settings) (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerProperties * (*load_initial_eps_bearer_settings_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + + /* Create initial default EPS bearer object */ + MMBaseBearer * (*create_initial_eps_bearer) (MMIfaceModem3gpp *self, + MMBearerProperties *properties); + /* Run CS/PS/EPS registration state checks.. * Note that no registration state is returned, implementations should call * mm_iface_modem_3gpp_update_registration_state(). */ @@ -176,14 +206,6 @@ GAsyncResult *res, GError **error); - /* Loading of the subscription state property */ - void (*load_subscription_state) (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data); - MMModem3gppSubscriptionState (*load_subscription_state_finish) (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error); - /* Scan current networks, expect a GList of MMModem3gppNetworkInfo */ void (* scan_networks) (MMIfaceModem3gpp *self, GAsyncReadyCallback callback, @@ -191,6 +213,24 @@ GList * (*scan_networks_finish) (MMIfaceModem3gpp *self, GAsyncResult *res, GError **error); + + /* Set UE mode of operation for EPS */ + void (* set_eps_ue_mode_operation) (MMIfaceModem3gpp *self, + MMModem3gppEpsUeModeOperation mode, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* set_eps_ue_mode_operation_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + + /* Set initial EPS bearer settings */ + void (* set_initial_eps_bearer_settings) (MMIfaceModem3gpp *self, + MMBearerProperties *properties, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* set_initial_eps_bearer_settings_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); }; GType mm_iface_modem_3gpp_get_type (void); @@ -240,7 +280,12 @@ MMModemAccessTechnology access_tech); void mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self, gulong location_area_code, + gulong tracking_area_code, gulong cell_id); +void mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self, + const GList *pco_list); +void mm_iface_modem_3gpp_update_initial_eps_bearer (MMIfaceModem3gpp *self, + MMBearerProperties *properties); /* Run all registration checks */ void mm_iface_modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self, diff -Nru modemmanager-1.6.8/src/mm-iface-modem-3gpp-ussd.c modemmanager-1.10.0/src/mm-iface-modem-3gpp-ussd.c --- modemmanager-1.6.8/src/mm-iface-modem-3gpp-ussd.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-3gpp-ussd.c 2019-01-15 15:57:35.000000000 +0100 @@ -194,15 +194,17 @@ HandleRespondContext *ctx) { GError *error = NULL; - const gchar *reply; + gchar *reply; - reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res,&error); + reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res, &error); if (!reply) g_dbus_method_invocation_take_error (ctx->invocation, error); - else + else { mm_gdbus_modem3gpp_ussd_complete_respond (ctx->skeleton, ctx->invocation, reply); + g_free (reply); + } handle_respond_context_free (ctx); } @@ -298,15 +300,17 @@ HandleInitiateContext *ctx) { GError *error = NULL; - const gchar *reply; + gchar *reply; reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res, &error); if (!reply) g_dbus_method_invocation_take_error (ctx->invocation, error); - else + else { mm_gdbus_modem3gpp_ussd_complete_initiate (ctx->skeleton, ctx->invocation, reply); + g_free (reply); + } handle_initiate_context_free (ctx); } @@ -398,6 +402,24 @@ /*****************************************************************************/ +MMModem3gppUssdSessionState +mm_iface_modem_3gpp_ussd_get_state (MMIfaceModem3gppUssd *self) +{ + MmGdbusModem3gppUssd *skeleton = NULL; + MMModem3gppUssdSessionState state; + + g_object_get (self, + MM_IFACE_MODEM_3GPP_USSD_DBUS_SKELETON, &skeleton, + NULL); + + if (!skeleton) + return MM_MODEM_3GPP_USSD_SESSION_STATE_UNKNOWN; + + state = (MMModem3gppUssdSessionState) mm_gdbus_modem3gpp_ussd_get_state (skeleton); + g_object_unref (skeleton); + return state; +} + void mm_iface_modem_3gpp_ussd_update_state (MMIfaceModem3gppUssd *self, MMModem3gppUssdSessionState new_state) @@ -459,28 +481,23 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, - DISABLING_STEP_DISABLE_UNSOLICITED_RESULT_CODES, - DISABLING_STEP_CLEANUP_UNSOLICITED_RESULT_CODES, + DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS, + DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS, DISABLING_STEP_LAST } DisablingStep; struct _DisablingContext { - MMIfaceModem3gppUssd *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModem3gppUssd *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -491,79 +508,85 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -disable_unsolicited_result_codes_ready (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - DisablingContext *ctx) +disable_unsolicited_events_ready (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GTask *task) { + DisablingContext *ctx; GError *error = NULL; - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->disable_unsolicited_result_codes_finish (self, - res, - &error); + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ - mm_dbg ("Couldn't disable unsolicited result codes: '%s'", error->message); + mm_dbg ("Couldn't disable unsolicited USSD events: '%s'", error->message); g_error_free (error); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -cleanup_unsolicited_result_codes_ready (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - DisablingContext *ctx) +cleanup_unsolicited_events_ready (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GTask *task) { + DisablingContext *ctx; GError *error = NULL; - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->cleanup_unsolicited_result_codes_finish (self, - res, - &error); + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ - mm_dbg ("Couldn't cleanup unsolicited result codes: '%s'", error->message); + mm_dbg ("Couldn't cleanup unsolicited USSD events: '%s'", error->message); g_error_free (error); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModem3gppUssd *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; - case DISABLING_STEP_DISABLE_UNSOLICITED_RESULT_CODES: - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->disable_unsolicited_result_codes ( - ctx->self, - (GAsyncReadyCallback)disable_unsolicited_result_codes_ready, - ctx); + case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->disable_unsolicited_events ( + self, + (GAsyncReadyCallback)disable_unsolicited_events_ready, + task); return; - case DISABLING_STEP_CLEANUP_UNSOLICITED_RESULT_CODES: - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->cleanup_unsolicited_result_codes ( - ctx->self, - (GAsyncReadyCallback)cleanup_unsolicited_result_codes_ready, - ctx); + case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, + (GAsyncReadyCallback)cleanup_unsolicited_events_ready, + task); return; case DISABLING_STEP_LAST: /* We are done without errors! */ - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self), + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), MM_MODEM_3GPP_USSD_SESSION_STATE_UNKNOWN); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -576,54 +599,49 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_ussd_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_3GPP_USSD_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, - ENABLING_STEP_SETUP_UNSOLICITED_RESULT_CODES, - ENABLING_STEP_ENABLE_UNSOLICITED_RESULT_CODES, + ENABLING_STEP_SETUP_UNSOLICITED_EVENTS, + ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS, ENABLING_STEP_LAST } EnablingStep; struct _EnablingContext { - MMIfaceModem3gppUssd *self; EnablingStep step; - GSimpleAsyncResult *result; MmGdbusModem3gppUssd *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -634,79 +652,85 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void -setup_unsolicited_result_codes_ready (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - EnablingContext *ctx) +setup_unsolicited_events_ready (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GTask *task) { + EnablingContext *ctx; GError *error = NULL; - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->setup_unsolicited_result_codes_finish (self, - res, - &error); + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ - mm_dbg ("Couldn't setup unsolicited result codes: '%s'", error->message); + mm_dbg ("Couldn't setup unsolicited USSD events: '%s'", error->message); g_error_free (error); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -enable_unsolicited_result_codes_ready (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - EnablingContext *ctx) +enable_unsolicited_events_ready (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GTask *task) { + EnablingContext *ctx; GError *error = NULL; - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->enable_unsolicited_result_codes_finish (self, - res, - &error); + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->enable_unsolicited_events_finish (self, res, &error); if (error) { /* This error shouldn't be treated as critical */ - mm_dbg ("Couldn't enable unsolicited result codes: '%s'", error->message); + mm_dbg ("Couldn't enable unsolicited USSD events: '%s'", error->message); g_error_free (error); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModem3gppUssd *self; + EnablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case ENABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; - case ENABLING_STEP_SETUP_UNSOLICITED_RESULT_CODES: - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->setup_unsolicited_result_codes ( - ctx->self, - (GAsyncReadyCallback)setup_unsolicited_result_codes_ready, - ctx); + case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->setup_unsolicited_events ( + self, + (GAsyncReadyCallback)setup_unsolicited_events_ready, + task); return; - case ENABLING_STEP_ENABLE_UNSOLICITED_RESULT_CODES: - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->enable_unsolicited_result_codes ( - ctx->self, - (GAsyncReadyCallback)enable_unsolicited_result_codes_ready, - ctx); + case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->enable_unsolicited_events ( + self, + (GAsyncReadyCallback)enable_unsolicited_events_ready, + task); return; case ENABLING_STEP_LAST: /* We are done without errors! */ - mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self), + mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self), MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -719,33 +743,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_ussd_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_3GPP_USSD_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -755,18 +779,13 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModem3gppUssd *self; MmGdbusModem3gppUssd *skeleton; - GSimpleAsyncResult *result; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); g_object_unref (ctx->skeleton); g_free (ctx); } @@ -774,8 +793,9 @@ static void check_support_ready (MMIfaceModem3gppUssd *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->check_support_finish (self, @@ -794,13 +814,20 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModem3gppUssd *self; + InitializationContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case INITIALIZATION_STEP_FIRST: /* Setup quarks if we didn't do it before */ @@ -815,23 +842,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -843,13 +870,13 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "USSD not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "USSD not supported"); + g_object_unref (task); return; } @@ -863,22 +890,22 @@ g_signal_connect (ctx->skeleton, "handle-initiate", G_CALLBACK (handle_initiate), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-respond", G_CALLBACK (handle_respond), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-cancel", G_CALLBACK (handle_cancel), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem3gpp_ussd (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem3gpp_ussd (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM3GPP_USSD (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -890,7 +917,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -900,6 +927,7 @@ { InitializationContext *ctx; MmGdbusModem3gppUssd *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -921,15 +949,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_3gpp_ussd_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-3gpp-ussd.h modemmanager-1.10.0/src/mm-iface-modem-3gpp-ussd.h --- modemmanager-1.6.8/src/mm-iface-modem-3gpp-ussd.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-3gpp-ussd.h 2019-01-15 15:57:35.000000000 +0100 @@ -40,44 +40,44 @@ GTypeInterface g_iface; /* Check for USSD support (async) */ - void (* check_support) (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (*check_support_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); - - /* Asynchronous setup of unsolicited result codes */ - void (*setup_unsolicited_result_codes) (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (*setup_unsolicited_result_codes_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); - - /* Asynchronous enabling of unsolicited result codes */ - void (*enable_unsolicited_result_codes) (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (*enable_unsolicited_result_codes_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); - - /* Asynchronous disabling of unsolicited result codes */ - void (*disable_unsolicited_result_codes) (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (*disable_unsolicited_result_codes_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); - - /* Asynchronous cleaning up of unsolicited result codes */ - void (*cleanup_unsolicited_result_codes) (MMIfaceModem3gppUssd *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (*cleanup_unsolicited_result_codes_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); + void (* check_support) (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* check_support_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous setup of unsolicited events */ + void (* setup_unsolicited_events) (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* setup_unsolicited_events_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous enabling of unsolicited events */ + void (* enable_unsolicited_events) (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* enable_unsolicited_events_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous disabling of unsolicited events */ + void (* disable_unsolicited_events) (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* disable_unsolicited_events_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous cleaning up of unsolicited events */ + void (* cleanup_unsolicited_events) (MMIfaceModem3gppUssd *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* cleanup_unsolicited_events_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); /* Encode/Decode */ gchar * (*encode) (MMIfaceModem3gppUssd *self, @@ -93,9 +93,9 @@ const gchar *command, GAsyncReadyCallback callback, gpointer user_data); - const gchar * (* send_finish) (MMIfaceModem3gppUssd *self, - GAsyncResult *res, - GError **error); + gchar * (* send_finish) (MMIfaceModem3gppUssd *self, + GAsyncResult *res, + GError **error); /* Cancel */ void (* cancel) (MMIfaceModem3gppUssd *self, @@ -132,6 +132,8 @@ GAsyncResult *res, GError **error); +MMModem3gppUssdSessionState mm_iface_modem_3gpp_ussd_get_state (MMIfaceModem3gppUssd *self); + /* Property updaters */ void mm_iface_modem_3gpp_ussd_update_state (MMIfaceModem3gppUssd *self, MMModem3gppUssdSessionState new_state); diff -Nru modemmanager-1.6.8/src/mm-iface-modem.c modemmanager-1.10.0/src/mm-iface-modem.c --- modemmanager-1.6.8/src/mm-iface-modem.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem.c 2019-01-15 15:57:35.000000000 +0100 @@ -29,21 +29,20 @@ #include "mm-log.h" #include "mm-context.h" -#define SIGNAL_QUALITY_RECENT_TIMEOUT_SEC 60 -#define SIGNAL_QUALITY_INITIAL_CHECK_TIMEOUT_SEC 3 -#define SIGNAL_QUALITY_CHECK_TIMEOUT_SEC 30 -#define ACCESS_TECHNOLOGIES_CHECK_TIMEOUT_SEC 30 - -#define STATE_UPDATE_CONTEXT_TAG "state-update-context-tag" -#define SIGNAL_QUALITY_UPDATE_CONTEXT_TAG "signal-quality-update-context-tag" -#define SIGNAL_QUALITY_CHECK_CONTEXT_TAG "signal-quality-check-context-tag" -#define ACCESS_TECHNOLOGIES_CHECK_CONTEXT_TAG "access-technologies-check-context-tag" -#define RESTART_INITIALIZE_IDLE_TAG "restart-initialize-tag" +#define SIGNAL_QUALITY_RECENT_TIMEOUT_SEC 60 + +#define SIGNAL_CHECK_INITIAL_RETRIES 5 +#define SIGNAL_CHECK_INITIAL_TIMEOUT_SEC 3 +#define SIGNAL_CHECK_TIMEOUT_SEC 30 + +#define STATE_UPDATE_CONTEXT_TAG "state-update-context-tag" +#define SIGNAL_QUALITY_UPDATE_CONTEXT_TAG "signal-quality-update-context-tag" +#define SIGNAL_CHECK_CONTEXT_TAG "signal-check-context-tag" +#define RESTART_INITIALIZE_IDLE_TAG "restart-initialize-tag" static GQuark state_update_context_quark; static GQuark signal_quality_update_context_quark; -static GQuark signal_quality_check_context_quark; -static GQuark access_technologies_check_context_quark; +static GQuark signal_check_context_quark; static GQuark restart_initialize_idle_quark; /*****************************************************************************/ @@ -90,27 +89,43 @@ state == MM_MODEM_STATE_CONNECTING) typedef struct { - MMIfaceModem *self; MMModemState final_state; - GSimpleAsyncResult *result; gulong state_changed_id; guint state_changed_wait_id; } WaitForFinalStateContext; static void -wait_for_final_state_context_complete_and_free (WaitForFinalStateContext *ctx) +wait_for_final_state_context_complete (GTask *task, + MMModemState state, + GError *error) { - /* The callback associated with 'ctx->result' may update the modem state. + MMIfaceModem *self; + WaitForFinalStateContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + /* The callback associated with 'task' may update the modem state. * Disconnect the signal handler for modem state changes before completing - * 'ctx->result' in order to prevent state_changed from being invoked, which - * invokes wait_for_final_state_context_complete_and_free (ctx) again. */ - g_signal_handler_disconnect (ctx->self, ctx->state_changed_id); - - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_source_remove (ctx->state_changed_wait_id); - g_object_unref (ctx->self); - g_slice_free (WaitForFinalStateContext, ctx); + * 'task' in order to prevent state_changed from being invoked, which + * invokes wait_for_final_state_context_complete again. */ + if (ctx->state_changed_id) { + g_signal_handler_disconnect (self, ctx->state_changed_id); + ctx->state_changed_id = 0; + } + + /* Remove any outstanding timeout on waiting for state change. */ + if (ctx->state_changed_wait_id) { + g_source_remove (ctx->state_changed_wait_id); + ctx->state_changed_wait_id = 0; + } + + if (error) + g_task_return_error (task, error); + else + g_task_return_int (task, state); + + g_object_unref (task); } MMModemState @@ -118,29 +133,35 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_STATE_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemState)GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_STATE_UNKNOWN; + } + return (MMModemState)value; } static gboolean -state_changed_wait_expired (WaitForFinalStateContext *ctx) +state_changed_wait_expired (GTask *task) { - g_simple_async_result_set_error ( - ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY, - "Too much time waiting to get to a final state"); - wait_for_final_state_context_complete_and_free (ctx); + GError *error; + + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_RETRY, + "Too much time waiting to get to a final state"); + wait_for_final_state_context_complete (task, MM_MODEM_STATE_UNKNOWN, error); return G_SOURCE_REMOVE; } static void state_changed (MMIfaceModem *self, GParamSpec *spec, - WaitForFinalStateContext *ctx) + GTask *task) { + WaitForFinalStateContext *ctx; MMModemState state = MM_MODEM_STATE_UNKNOWN; g_object_get (self, @@ -151,6 +172,8 @@ if (MODEM_STATE_IS_INTERMEDIATE (state)) return; + ctx = g_task_get_task_data (task); + /* If we want a specific final state and this is not the one we were * looking for, then skip */ if (ctx->final_state != MM_MODEM_STATE_UNKNOWN && @@ -159,8 +182,7 @@ return; /* Done! */ - g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (state), NULL); - wait_for_final_state_context_complete_and_free (ctx); + wait_for_final_state_context_complete (task, state, NULL); } void @@ -171,12 +193,9 @@ { MMModemState state = MM_MODEM_STATE_UNKNOWN; WaitForFinalStateContext *ctx; - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_wait_for_final_state); + task = g_task_new (self, NULL, callback, user_data); g_object_get (self, MM_IFACE_MODEM_STATE, &state, @@ -187,29 +206,55 @@ /* Is this the state we actually wanted? */ if (final_state == MM_MODEM_STATE_UNKNOWN || (state != MM_MODEM_STATE_UNKNOWN && state == final_state)) { - g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (state), NULL); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_int (task, state); + g_object_unref (task); return; } /* Otherwise, we'll need to wait for the exact one we want */ } - ctx = g_slice_new0 (WaitForFinalStateContext); - ctx->result = result; - ctx->self = g_object_ref (self); + ctx = g_new0 (WaitForFinalStateContext, 1); ctx->final_state = final_state; + g_task_set_task_data (task, ctx, g_free); + /* Want to get notified when modem state changes */ - ctx->state_changed_id = g_signal_connect (ctx->self, + ctx->state_changed_id = g_signal_connect (self, "notify::" MM_IFACE_MODEM_STATE, G_CALLBACK (state_changed), - ctx); + task); /* But we don't want to wait forever */ ctx->state_changed_wait_id = g_timeout_add_seconds (10, (GSourceFunc)state_changed_wait_expired, - ctx); + task); +} + +/*****************************************************************************/ +/* Helper to return an error when the modem is in failed state and so it + * cannot process a given method invocation + */ + +static gboolean +abort_invocation_if_state_not_reached (MMIfaceModem *self, + GDBusMethodInvocation *invocation, + MMModemState minimum_required) +{ + MMModemState state = MM_MODEM_STATE_UNKNOWN; + + g_object_get (self, + MM_IFACE_MODEM_STATE, &state, + NULL); + + if (state >= minimum_required) + return FALSE; + + g_dbus_method_invocation_return_error (invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_WRONG_STATE, + "modem in %s state", + mm_modem_state_get_string (state)); + return TRUE; } /*****************************************************************************/ @@ -218,51 +263,51 @@ #define MAX_RETRIES 6 typedef struct { - MMIfaceModem *self; - GSimpleAsyncResult *result; guint retries; guint pin_check_timeout_id; } InternalLoadUnlockRequiredContext; -static void -internal_load_unlock_required_context_complete_and_free (InternalLoadUnlockRequiredContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (InternalLoadUnlockRequiredContext, ctx); -} - static MMModemLock internal_load_unlock_required_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCK_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemLock) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCK_UNKNOWN; + } + return (MMModemLock)value; } -static void internal_load_unlock_required_context_step (InternalLoadUnlockRequiredContext *ctx); +static void internal_load_unlock_required_context_step (GTask *task); static gboolean -load_unlock_required_again (InternalLoadUnlockRequiredContext *ctx) +load_unlock_required_again (GTask *task) { + InternalLoadUnlockRequiredContext *ctx; + + ctx = g_task_get_task_data (task); ctx->pin_check_timeout_id = 0; /* Retry the step */ - internal_load_unlock_required_context_step (ctx); + internal_load_unlock_required_context_step (task); return G_SOURCE_REMOVE; } static void load_unlock_required_ready (MMIfaceModem *self, GAsyncResult *res, - InternalLoadUnlockRequiredContext *ctx) + GTask *task) { + InternalLoadUnlockRequiredContext *ctx; GError *error = NULL; MMModemLock lock; + ctx = g_task_get_task_data (task); + lock = MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required_finish (self, res, &error); if (error) { mm_dbg ("Couldn't check if unlock required: '%s'", error->message); @@ -281,8 +326,8 @@ g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG)) { - g_simple_async_result_take_error (ctx->result, error); - internal_load_unlock_required_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -294,37 +339,41 @@ g_assert (ctx->pin_check_timeout_id == 0); ctx->pin_check_timeout_id = g_timeout_add_seconds (2, (GSourceFunc)load_unlock_required_again, - ctx); + task); g_error_free (error); return; } /* If reached max retries and still reporting error... default to SIM error */ g_error_free (error); - g_simple_async_result_set_error (ctx->result, - MM_MOBILE_EQUIPMENT_ERROR, - MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE, - "Couldn't get SIM lock status after %u retries", - MAX_RETRIES); - internal_load_unlock_required_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE, + "Couldn't get SIM lock status after %u retries", + MAX_RETRIES); + g_object_unref (task); return; } /* Got the lock value, return it */ - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (lock), - NULL); - internal_load_unlock_required_context_complete_and_free (ctx); + g_task_return_int (task, lock); + g_object_unref (task); } static void -internal_load_unlock_required_context_step (InternalLoadUnlockRequiredContext *ctx) +internal_load_unlock_required_context_step (GTask *task) { + MMIfaceModem *self; + InternalLoadUnlockRequiredContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + g_assert (ctx->pin_check_timeout_id == 0); - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_required ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required ( + self, (GAsyncReadyCallback)load_unlock_required_ready, - ctx); + task); } static void @@ -333,23 +382,22 @@ gpointer user_data) { InternalLoadUnlockRequiredContext *ctx; + GTask *task; - ctx = g_slice_new0 (InternalLoadUnlockRequiredContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - internal_load_unlock_required); + ctx = g_new0 (InternalLoadUnlockRequiredContext, 1); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, g_free); - if (!MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_required || - !MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_required_finish) { + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required || + !MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required_finish) { /* Just assume that no lock is required */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - internal_load_unlock_required_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } - internal_load_unlock_required_context_step (ctx); + internal_load_unlock_required_context_step (task); } /*****************************************************************************/ @@ -455,17 +503,12 @@ } typedef struct { - MMIfaceModem *self; MMBearerList *list; - GSimpleAsyncResult *result; } CreateBearerContext; static void -create_bearer_context_complete_and_free (CreateBearerContext *ctx) +create_bearer_context_free (CreateBearerContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); if (ctx->list) g_object_unref (ctx->list); g_slice_free (CreateBearerContext, ctx); @@ -476,30 +519,30 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void create_bearer_ready (MMIfaceModem *self, GAsyncResult *res, - CreateBearerContext *ctx) + GTask *task) { + CreateBearerContext *ctx; MMBaseBearer *bearer; GError *error = NULL; bearer = MM_IFACE_MODEM_GET_INTERFACE (self)->create_bearer_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - create_bearer_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + if (!mm_bearer_list_add_bearer (ctx->list, bearer, &error)) { - g_simple_async_result_take_error (ctx->result, error); - create_bearer_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_object_unref (bearer); return; } @@ -510,8 +553,8 @@ "notify::" MM_BASE_BEARER_STATUS, (GCallback)bearer_status_changed, self); - g_simple_async_result_set_op_res_gpointer (ctx->result, bearer, g_object_unref); - create_bearer_context_complete_and_free (ctx); + g_task_return_pointer (task, bearer, g_object_unref); + g_object_unref (task); } void @@ -521,34 +564,34 @@ gpointer user_data) { CreateBearerContext *ctx; + GTask *task; ctx = g_slice_new (CreateBearerContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_create_bearer); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)create_bearer_context_free); + g_object_get (self, MM_IFACE_MODEM_BEARER_LIST, &ctx->list, NULL); if (!ctx->list) { - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Cannot add new bearer: bearer list not found"); - create_bearer_context_complete_and_free (ctx); + g_object_unref (task); return; } if (mm_bearer_list_get_count (ctx->list) == mm_bearer_list_get_max (ctx->list)) { - g_simple_async_result_set_error ( - ctx->result, + g_task_return_new_error ( + task, MM_CORE_ERROR, MM_CORE_ERROR_TOO_MANY, "Cannot add new bearer: already reached maximum (%u)", mm_bearer_list_get_count (ctx->list)); - create_bearer_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -556,7 +599,7 @@ self, properties, (GAsyncReadyCallback)create_bearer_ready, - ctx); + task); } typedef struct { @@ -611,6 +654,11 @@ return; } + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_LOCKED)) { + handle_create_bearer_context_free (ctx); + return; + } + properties = mm_bearer_properties_new_from_dictionary (ctx->dictionary, &error); if (!properties) { g_dbus_method_invocation_take_error (ctx->invocation, error); @@ -700,6 +748,11 @@ return; } + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_LOCKED)) { + handle_command_context_free (ctx); + return; + } + /* If we are not in Debug mode, report an error */ if (!mm_context_get_debug ()) { g_dbus_method_invocation_return_error (ctx->invocation, @@ -812,6 +865,11 @@ return; } + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_LOCKED)) { + handle_delete_bearer_context_free (ctx); + return; + } + if (!g_str_has_prefix (ctx->bearer_path, MM_DBUS_BEARER_PREFIX)) { g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, @@ -873,6 +931,9 @@ GStrv paths; MMBearerList *list = NULL; + if (abort_invocation_if_state_not_reached (self, invocation, MM_MODEM_STATE_LOCKED)) + return TRUE; + g_object_get (self, MM_IFACE_MODEM_BEARER_LIST, &list, NULL); @@ -943,152 +1004,6 @@ /*****************************************************************************/ typedef struct { - guint timeout_source; - gboolean running; -} AccessTechnologiesCheckContext; - -static void -access_technologies_check_context_free (AccessTechnologiesCheckContext *ctx) -{ - if (ctx->timeout_source) - g_source_remove (ctx->timeout_source); - g_free (ctx); -} - -static void -access_technologies_check_ready (MMIfaceModem *self, - GAsyncResult *res) -{ - GError *error = NULL; - MMModemAccessTechnology access_technologies = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; - guint mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; - AccessTechnologiesCheckContext *ctx; - - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies_finish ( - self, - res, - &access_technologies, - &mask, - &error)) { - /* Ignore issues when the operation is unsupported, don't even log */ - if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) - mm_dbg ("Couldn't refresh access technologies: '%s'", error->message); - g_error_free (error); - } else - mm_iface_modem_update_access_technologies (self, access_technologies, mask); - - /* Remove the running tag. Note that the context may have been removed by - * mm_iface_modem_shutdown when this function is invoked as a callback of - * load_access_technologies. */ - ctx = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark); - if (ctx) - ctx->running = FALSE; -} - -static gboolean -periodic_access_technologies_check (MMIfaceModem *self) -{ - AccessTechnologiesCheckContext *ctx; - - ctx = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark); - - /* Only launch a new one if not one running already OR if the last one run - * was more than 15s ago. */ - if (!ctx->running) { - ctx->running = TRUE; - MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies ( - self, - (GAsyncReadyCallback)access_technologies_check_ready, - NULL); - } - - return G_SOURCE_CONTINUE; -} - -void -mm_iface_modem_refresh_access_technologies (MMIfaceModem *self) -{ - AccessTechnologiesCheckContext *ctx; - - if (G_UNLIKELY (!access_technologies_check_context_quark)) - access_technologies_check_context_quark = (g_quark_from_static_string ( - ACCESS_TECHNOLOGIES_CHECK_CONTEXT_TAG)); - - ctx = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark); - if (!ctx) - return; - - /* Re-set timeout */ - if (ctx->timeout_source) - g_source_remove (ctx->timeout_source); - ctx->timeout_source = g_timeout_add_seconds (ACCESS_TECHNOLOGIES_CHECK_TIMEOUT_SEC, - (GSourceFunc)periodic_access_technologies_check, - self); - - /* Get first access technology value */ - periodic_access_technologies_check (self); -} - -static void -periodic_access_technologies_check_disable (MMIfaceModem *self) -{ - if (G_UNLIKELY (!access_technologies_check_context_quark)) - access_technologies_check_context_quark = (g_quark_from_static_string ( - ACCESS_TECHNOLOGIES_CHECK_CONTEXT_TAG)); - - /* Clear access technology */ - mm_iface_modem_update_access_technologies (self, - MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, - MM_MODEM_ACCESS_TECHNOLOGY_ANY); - - /* Overwriting the data will free the previous context */ - g_object_set_qdata (G_OBJECT (self), - access_technologies_check_context_quark, - NULL); - - mm_dbg ("Periodic access technology checks disabled"); -} - -static void -periodic_access_technologies_check_enable (MMIfaceModem *self) -{ - AccessTechnologiesCheckContext *ctx; - - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies || - !MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies_finish) { - /* If loading access technology not supported, don't even bother setting up - * a timeout */ - return; - } - - if (G_UNLIKELY (!access_technologies_check_context_quark)) - access_technologies_check_context_quark = (g_quark_from_static_string ( - ACCESS_TECHNOLOGIES_CHECK_CONTEXT_TAG)); - - ctx = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark); - - /* If context is already there, we're already enabled */ - if (ctx) { - periodic_access_technologies_check (self); - return; - } - - /* Create context and keep it as object data */ - mm_dbg ("Periodic access technology checks enabled"); - ctx = g_new0 (AccessTechnologiesCheckContext, 1); - g_object_set_qdata_full (G_OBJECT (self), - access_technologies_check_context_quark, - ctx, - (GDestroyNotify)access_technologies_check_context_free); - - /* Get first and setup timeout */ - mm_iface_modem_refresh_access_technologies (self); -} - -/*****************************************************************************/ - -typedef struct { - time_t last_update; guint recent_timeout_source; } SignalQualityUpdateContext; @@ -1100,20 +1015,6 @@ g_free (ctx); } -static time_t -get_last_signal_quality_update_time (MMIfaceModem *self) -{ - SignalQualityUpdateContext *ctx; - - if (G_UNLIKELY (!signal_quality_update_context_quark)) - signal_quality_update_context_quark = (g_quark_from_static_string ( - SIGNAL_QUALITY_UPDATE_CONTEXT_TAG)); - - ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_update_context_quark); - - return (ctx ? ctx->last_update : 0); -} - static gboolean expire_signal_quality (MMIfaceModem *self) { @@ -1187,9 +1088,6 @@ (GDestroyNotify)signal_quality_update_context_free); } - /* Keep current timestamp */ - ctx->last_update = time (NULL); - /* Note: we always set the new value, even if the signal quality level * is the same, in order to provide an up to date 'recent' flag. * The only exception being if 'expire' is FALSE; in that case we assume @@ -1229,142 +1127,343 @@ } /*****************************************************************************/ +/* Signal info (quality and access technology) polling */ + +typedef enum { + SIGNAL_CHECK_STEP_NONE, + SIGNAL_CHECK_STEP_FIRST, + SIGNAL_CHECK_STEP_SIGNAL_QUALITY, + SIGNAL_CHECK_STEP_ACCESS_TECHNOLOGIES, + SIGNAL_CHECK_STEP_LAST, +} SignalCheckStep; typedef struct { - guint interval; - guint initial_retries; - guint timeout_source; - gboolean running; -} SignalQualityCheckContext; + gboolean enabled; + guint interval; + guint initial_retries; + guint timeout_source; + + /* Values polled in this iteration */ + guint signal_quality; + MMModemAccessTechnology access_technologies; + guint access_technologies_mask; + + /* If both these are unset we'll automatically stop polling */ + gboolean signal_quality_polling_supported; + gboolean access_technology_polling_supported; + + /* Steps triggered when polling active */ + SignalCheckStep running_step; +} SignalCheckContext; static void -signal_quality_check_context_free (SignalQualityCheckContext *ctx) +signal_check_context_free (SignalCheckContext *ctx) { if (ctx->timeout_source) g_source_remove (ctx->timeout_source); - g_free (ctx); + g_slice_free (SignalCheckContext, ctx); } -static gboolean periodic_signal_quality_check (MMIfaceModem *self); +static SignalCheckContext * +get_signal_check_context (MMIfaceModem *self) +{ + SignalCheckContext *ctx; + + if (G_UNLIKELY (!signal_check_context_quark)) + signal_check_context_quark = (g_quark_from_static_string ( + SIGNAL_CHECK_CONTEXT_TAG)); + + ctx = g_object_get_qdata (G_OBJECT (self), signal_check_context_quark); + if (!ctx) { + /* Create context and attach it to the object */ + ctx = g_slice_new0 (SignalCheckContext); + ctx->running_step = SIGNAL_CHECK_STEP_NONE; + + /* Initially assume supported if load_access_technologies() is + * implemented. If the plugin reports an UNSUPPORTED error we'll clear + * this flag and no longer poll. */ + ctx->access_technology_polling_supported = (MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies_finish); + + /* Initially assume supported if load_signal_quality() is + * implemented. If the plugin reports an UNSUPPORTED error we'll clear + * this flag and no longer poll. */ + ctx->signal_quality_polling_supported = (MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality_finish); + + g_object_set_qdata_full (G_OBJECT (self), signal_check_context_quark, + ctx, (GDestroyNotify) signal_check_context_free); + } + + g_assert (ctx); + return ctx; +} + +static void periodic_signal_check_disable (MMIfaceModem *self, + gboolean clear); +static gboolean periodic_signal_check_cb (MMIfaceModem *self); +static void peridic_signal_check_step (MMIfaceModem *self); + +static void +access_technologies_check_ready (MMIfaceModem *self, + GAsyncResult *res) +{ + GError *error = NULL; + SignalCheckContext *ctx; + + ctx = get_signal_check_context (self); + + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies_finish ( + self, + res, + &ctx->access_technologies, + &ctx->access_technologies_mask, + &error)) { + /* Did the plugin report that polling access technology is unsupported? */ + if (g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) { + mm_dbg ("Polling to refresh access technologies is unsupported"); + ctx->access_technology_polling_supported = FALSE; + } else + mm_dbg ("Couldn't refresh access technologies: '%s'", error->message); + g_error_free (error); + } + /* We may have been disabled while this command was running. */ + else if (ctx->enabled) + mm_iface_modem_update_access_technologies (self, ctx->access_technologies, ctx->access_technologies_mask); + + /* Go on */ + ctx->running_step++; + peridic_signal_check_step (self); +} static void signal_quality_check_ready (MMIfaceModem *self, GAsyncResult *res) { - GError *error = NULL; - guint signal_quality; - SignalQualityCheckContext *ctx; + GError *error = NULL; + SignalCheckContext *ctx; + + ctx = get_signal_check_context (self); - signal_quality = MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality_finish (self, - res, - &error); + ctx->signal_quality = MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality_finish (self, res, &error); if (error) { - mm_dbg ("Couldn't refresh signal quality: '%s'", error->message); + /* Did the plugin report that polling signal quality is unsupported? */ + if (g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED)) { + mm_dbg ("Polling to refresh signal quality is unsupported"); + ctx->signal_quality_polling_supported = FALSE; + } else + mm_dbg ("Couldn't refresh signal quality: '%s'", error->message); g_error_free (error); - } else - update_signal_quality (self, signal_quality, TRUE); + } + /* We may have been disabled while this command was running. */ + else if (ctx->enabled) + update_signal_quality (self, ctx->signal_quality, TRUE); + + /* Go on */ + ctx->running_step++; + peridic_signal_check_step (self); +} + +static void +peridic_signal_check_step (MMIfaceModem *self) +{ + gboolean periodic_signal_check_disabled = FALSE; + SignalCheckContext *ctx; - /* Remove the running tag. Note that the context may have been removed by - * mm_iface_modem_shutdown when this function is invoked as a callback of - * load_signal_quality. */ - ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_check_context_quark); - if (ctx) { - if (ctx->interval == SIGNAL_QUALITY_INITIAL_CHECK_TIMEOUT_SEC && - (signal_quality != 0 || --ctx->initial_retries == 0)) { - ctx->interval = SIGNAL_QUALITY_CHECK_TIMEOUT_SEC; - if (ctx->timeout_source) { - mm_dbg ("Periodic signal quality checks rescheduled (interval = %ds)", ctx->interval); - g_source_remove(ctx->timeout_source); - ctx->timeout_source = g_timeout_add_seconds (ctx->interval, - (GSourceFunc)periodic_signal_quality_check, - self); + ctx = get_signal_check_context (self); + + switch (ctx->running_step) { + case SIGNAL_CHECK_STEP_NONE: + g_assert_not_reached (); + + case SIGNAL_CHECK_STEP_FIRST: + /* Fall down to next step */ + ctx->running_step++; + + case SIGNAL_CHECK_STEP_SIGNAL_QUALITY: + if (ctx->enabled && ctx->signal_quality_polling_supported) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality ( + self, (GAsyncReadyCallback)signal_quality_check_ready, NULL); + return; + } + /* Fall down to next step */ + ctx->running_step++; + + case SIGNAL_CHECK_STEP_ACCESS_TECHNOLOGIES: + if (ctx->enabled && ctx->access_technology_polling_supported) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_access_technologies ( + self, (GAsyncReadyCallback)access_technologies_check_ready, NULL); + return; + } + /* Fall down to next step */ + ctx->running_step++; + + case SIGNAL_CHECK_STEP_LAST: + /* Flag as sequence finished */ + ctx->running_step = SIGNAL_CHECK_STEP_NONE; + + /* If we have been disabled while we were running the steps, we don't + * do anything else. */ + if (!ctx->enabled) { + mm_dbg ("Periodic signal checks not rescheduled: disabled"); + return; + } + + /* Schedule when we poll next time. + * Initially we poll at a higher frequency until we get valid signal + * quality and access technology values. As soon as we get them, OR if + * we made too many retries at a high frequency, we fallback to the + * slower polling. */ + if (ctx->interval == SIGNAL_CHECK_INITIAL_TIMEOUT_SEC) { + gboolean signal_quality_ready; + gboolean access_technology_ready; + gboolean initial_check_done; + + /* Signal quality is ready if unsupported or if we got a valid + * value reported */ + signal_quality_ready = (!ctx->signal_quality_polling_supported || (ctx->signal_quality != 0)); + /* Access technology is ready if unsupported or if we got a valid + * value reported */ + access_technology_ready = (!ctx->access_technology_polling_supported || + ((ctx->access_technologies & ctx->access_technologies_mask) != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN)); + + initial_check_done = ((signal_quality_ready && access_technology_ready) || + (--ctx->initial_retries == 0)); + if (initial_check_done) { + /* After the initial check is done, check if periodic signal + * check is disabled. */ + g_object_get (self, + MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, + &periodic_signal_check_disabled, + NULL); + ctx->interval = SIGNAL_CHECK_TIMEOUT_SEC; } } - ctx->running = FALSE; + + /* If both tasks are unsupported, implicitly disable. Do NOT clear the + * values, because if we're told they are unsupported it may be that + * they're really updated via unsolicited messages. */ + if (!ctx->access_technology_polling_supported && + (!ctx->signal_quality_polling_supported || periodic_signal_check_disabled)) { + mm_dbg ("Periodic signal and access technologies checks not supported"); + periodic_signal_check_disable (self, FALSE); + return; + } + + mm_dbg ("Periodic signal quality checks scheduled in %ds", ctx->interval); + g_assert (!ctx->timeout_source); + ctx->timeout_source = g_timeout_add_seconds (ctx->interval, (GSourceFunc) periodic_signal_check_cb, self); + return; } } static gboolean -periodic_signal_quality_check (MMIfaceModem *self) +periodic_signal_check_cb (MMIfaceModem *self) { - SignalQualityCheckContext *ctx; + SignalCheckContext *ctx; - ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_check_context_quark); + ctx = get_signal_check_context (self); + g_assert (ctx->enabled); - /* Only launch a new one if not one running already OR if the last one run - * was more than 15s ago. */ - if (!ctx->running || - (time (NULL) - get_last_signal_quality_update_time (self) > (ctx->interval / 2))) { - ctx->running = TRUE; - MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality ( - self, - (GAsyncReadyCallback)signal_quality_check_ready, - NULL); - } + /* Start the sequence */ + ctx->running_step = SIGNAL_CHECK_STEP_FIRST; + ctx->signal_quality = 0; + ctx->access_technologies = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + ctx->access_technologies_mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY; + peridic_signal_check_step (self); - return G_SOURCE_CONTINUE; + /* Remove the timeout and clear the source id */ + if (ctx->timeout_source) + ctx->timeout_source = 0; + return G_SOURCE_REMOVE; } -static void -periodic_signal_quality_check_disable (MMIfaceModem *self) +void +mm_iface_modem_refresh_signal (MMIfaceModem *self) { - if (G_UNLIKELY (!signal_quality_check_context_quark)) - signal_quality_check_context_quark = (g_quark_from_static_string ( - SIGNAL_QUALITY_CHECK_CONTEXT_TAG)); + SignalCheckContext *ctx; - /* Clear signal quality */ - update_signal_quality (self, 0, FALSE); + /* Don't refresh polling if we're not enabled */ + ctx = get_signal_check_context (self); + if (!ctx->enabled) { + mm_dbg ("Periodic signal check refresh ignored: checks not enabled"); + return; + } + + /* Don't refresh if we're already doing it */ + if (ctx->running_step != SIGNAL_CHECK_STEP_NONE) { + mm_dbg ("Periodic signal check refresh ignored: check already running"); + return; + } - /* Overwriting the data will free the previous context */ - g_object_set_qdata (G_OBJECT (self), - signal_quality_check_context_quark, - NULL); + mm_dbg ("Periodic signal check refresh requested"); - mm_dbg ("Periodic signal quality checks disabled"); + /* Remove the scheduled timeout as we're going to refresh + * right away */ + if (ctx->timeout_source) { + g_source_remove (ctx->timeout_source); + ctx->timeout_source = 0; + } + + /* Reset refresh rate and initial retries when we're asked to refresh signal + * so that we poll at a higher frequency */ + ctx->interval = SIGNAL_CHECK_INITIAL_TIMEOUT_SEC; + ctx->initial_retries = SIGNAL_CHECK_INITIAL_RETRIES; + + /* Start sequence */ + periodic_signal_check_cb (self); } static void -periodic_signal_quality_check_enable (MMIfaceModem *self) +periodic_signal_check_disable (MMIfaceModem *self, + gboolean clear) { - SignalQualityCheckContext *ctx; + SignalCheckContext *ctx; - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality || - !MM_IFACE_MODEM_GET_INTERFACE (self)->load_signal_quality_finish) { - /* If loading signal quality not supported, don't even bother setting up - * a timeout */ + ctx = get_signal_check_context (self); + if (!ctx->enabled) return; + + /* Clear access technology and signal quality */ + if (clear) { + update_signal_quality (self, 0, FALSE); + mm_iface_modem_update_access_technologies (self, + MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, + MM_MODEM_ACCESS_TECHNOLOGY_ANY); } - if (G_UNLIKELY (!signal_quality_check_context_quark)) - signal_quality_check_context_quark = (g_quark_from_static_string ( - SIGNAL_QUALITY_CHECK_CONTEXT_TAG)); + /* Remove scheduled timeout */ + if (ctx->timeout_source) { + g_source_remove (ctx->timeout_source); + ctx->timeout_source = 0; + } - ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_check_context_quark); + ctx->enabled = FALSE; + mm_dbg ("Periodic signal checks disabled"); +} - /* If context is already there, we're already enabled */ - if (ctx) { - periodic_signal_quality_check (self); +static void +periodic_signal_check_enable (MMIfaceModem *self) +{ + SignalCheckContext *ctx; + + ctx = get_signal_check_context (self); + + /* If polling access technology and signal quality not supported, don't even + * bother trying. */ + if (!ctx->signal_quality_polling_supported && !ctx->access_technology_polling_supported) { + mm_dbg ("Not enabling periodic signal checks: unsupported"); return; } - /* Create context and keep it as object data */ - ctx = g_new0 (SignalQualityCheckContext, 1); - /* Schedule the signal quality check using a shorter period, up to 5 - * periods, initially until a non-zero signal quality value is obtained - * and then switch back to the normal period. */ - ctx->interval = SIGNAL_QUALITY_INITIAL_CHECK_TIMEOUT_SEC; - ctx->initial_retries = 5; - mm_dbg ("Periodic signal quality checks enabled (interval = %ds)", ctx->interval); - ctx->timeout_source = g_timeout_add_seconds (ctx->interval, - (GSourceFunc)periodic_signal_quality_check, - self); - g_object_set_qdata_full (G_OBJECT (self), - signal_quality_check_context_quark, - ctx, - (GDestroyNotify)signal_quality_check_context_free); + /* Log and flag as enabled */ + if (!ctx->enabled) { + mm_dbg ("Periodic signal checks enabled"); + ctx->enabled = TRUE; + } - /* Get first signal quality value */ - periodic_signal_quality_check (self); + /* And refresh, which will trigger the first check at high frequency*/ + mm_iface_modem_refresh_signal (self); } /*****************************************************************************/ @@ -1456,18 +1555,12 @@ /* If we go to a registered/connected state (from unregistered), setup * signal quality and access technologies periodic retrieval */ - if (new_state >= MM_MODEM_STATE_REGISTERED && - old_state < MM_MODEM_STATE_REGISTERED) { - periodic_signal_quality_check_enable (self); - periodic_access_technologies_check_enable (self); - } + if (new_state >= MM_MODEM_STATE_REGISTERED && old_state < MM_MODEM_STATE_REGISTERED) + periodic_signal_check_enable (self); /* If we go from a registered/connected state to unregistered, * cleanup signal quality retrieval */ - else if (old_state >= MM_MODEM_STATE_REGISTERED && - new_state < MM_MODEM_STATE_REGISTERED) { - periodic_signal_quality_check_disable (self); - periodic_access_technologies_check_disable (self); - } + else if (old_state >= MM_MODEM_STATE_REGISTERED && new_state < MM_MODEM_STATE_REGISTERED) + periodic_signal_check_disable (self, TRUE); } if (skeleton) @@ -1687,6 +1780,11 @@ return; } + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_LOCKED)) { + handle_enable_context_free (ctx); + return; + } + if (ctx->enable) mm_base_modem_enable (self, (GAsyncReadyCallback)enable_ready, @@ -2007,7 +2105,12 @@ } /*****************************************************************************/ -/* Current capabilities setting */ +/* Current capabilities setting + * + * Setting capabilities allowed also in FAILED state. Just imagine a + * 3GPP+3GPP2 modem in 3GPP-only mode without SIM, we should allow + * changing caps to 3GPP2, which doesn't require SIM + */ typedef struct { MmGdbusModem *skeleton; @@ -2034,8 +2137,12 @@ if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_capabilities_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); - else + else { + /* Capabilities updated: explicitly refresh signal and access technology */ + mm_iface_modem_refresh_signal (self); mm_gdbus_modem_complete_set_current_capabilities (ctx->skeleton, ctx->invocation); + } + handle_set_current_capabilities_context_free (ctx); } @@ -2146,18 +2253,13 @@ /* Current bands setting */ typedef struct { - MMIfaceModem *self; MmGdbusModem *skeleton; - GSimpleAsyncResult *result; GArray *bands_array; } SetCurrentBandsContext; static void -set_current_bands_context_complete_and_free (SetCurrentBandsContext *ctx) +set_current_bands_context_free (SetCurrentBandsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); if (ctx->skeleton) g_object_unref (ctx->skeleton); if (ctx->bands_array) @@ -2170,37 +2272,86 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +set_current_bands_complete_with_defaults (GTask *task) +{ + SetCurrentBandsContext *ctx; + + ctx = g_task_get_task_data (task); + + /* Never show just 'any' in the interface */ + if (ctx->bands_array->len == 1 && g_array_index (ctx->bands_array, MMModemBand, 0) == MM_MODEM_BAND_ANY) { + GArray *supported_bands; + + supported_bands = (mm_common_bands_variant_to_garray (mm_gdbus_modem_get_supported_bands (ctx->skeleton))); + mm_common_bands_garray_sort (supported_bands); + mm_gdbus_modem_set_current_bands (ctx->skeleton, mm_common_bands_garray_to_variant (supported_bands)); + g_array_unref (supported_bands); + } else { + mm_common_bands_garray_sort (ctx->bands_array); + mm_gdbus_modem_set_current_bands (ctx->skeleton, mm_common_bands_garray_to_variant (ctx->bands_array)); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +after_set_load_current_bands_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + GArray *current_bands; + SetCurrentBandsContext *ctx; + + ctx = g_task_get_task_data (task); + + current_bands = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish (self, res, &error); + if (!current_bands) { + /* Errors when getting bands won't be critical */ + mm_warn ("couldn't load current bands: '%s'", error->message); + g_error_free (error); + /* Default to the ones we requested */ + set_current_bands_complete_with_defaults (task); + return; + } + + mm_common_bands_garray_sort (current_bands); + mm_gdbus_modem_set_current_bands (ctx->skeleton, mm_common_bands_garray_to_variant (current_bands)); + g_array_unref (current_bands); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void set_current_bands_ready (MMIfaceModem *self, GAsyncResult *res, - SetCurrentBandsContext *ctx) + GTask *task) { GError *error = NULL; - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_bands_finish (self, res, &error)) - g_simple_async_result_take_error (ctx->result, error); - else { - /* Never show just 'any' in the interface */ - if (ctx->bands_array->len == 1 && - g_array_index (ctx->bands_array, MMModemBand, 0) == MM_MODEM_BAND_ANY) { - GArray *supported_bands; - - supported_bands = (mm_common_bands_variant_to_garray ( - mm_gdbus_modem_get_supported_bands (ctx->skeleton))); - mm_gdbus_modem_set_current_bands (ctx->skeleton, - mm_common_bands_garray_to_variant (supported_bands)); - g_array_unref (supported_bands); - } else - mm_gdbus_modem_set_current_bands (ctx->skeleton, - mm_common_bands_garray_to_variant (ctx->bands_array)); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_bands_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands ( + self, + (GAsyncReadyCallback)after_set_load_current_bands_ready, + task); + return; } - set_current_bands_context_complete_and_free (ctx); + /* Default to the ones we requested */ + set_current_bands_complete_with_defaults (task); } static gboolean @@ -2272,35 +2423,36 @@ GArray *current_bands_array; GError *error = NULL; gchar *bands_string; + GTask *task; /* If setting allowed bands is not implemented, report an error */ if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_bands || !MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_bands_finish) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Setting allowed bands not supported"); + g_task_report_new_error (self, + callback, + user_data, + mm_iface_modem_set_current_bands, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Setting allowed bands not supported"); return; } /* Setup context */ ctx = g_slice_new0 (SetCurrentBandsContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_set_current_bands); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_current_bands_context_free); + g_object_get (self, MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - set_current_bands_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } @@ -2345,8 +2497,8 @@ g_free (bands_string); g_array_unref (supported_bands_array); g_array_unref (current_bands_array); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_bands_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -2366,8 +2518,8 @@ g_free (bands_string); g_array_unref (supported_bands_array); g_array_unref (current_bands_array); - g_simple_async_result_take_error (ctx->result, error); - set_current_bands_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -2376,7 +2528,7 @@ self, ctx->bands_array, (GAsyncReadyCallback)set_current_bands_ready, - ctx); + task); g_array_unref (supported_bands_array); g_array_unref (current_bands_array); @@ -2409,8 +2561,11 @@ if (!mm_iface_modem_set_current_bands_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); - else + else { + /* Bands updated: explicitly refresh signal and access technology */ + mm_iface_modem_refresh_signal (self); mm_gdbus_modem_complete_set_current_bands (ctx->skeleton, ctx->invocation); + } handle_set_current_bands_context_free (ctx); } @@ -2421,7 +2576,6 @@ HandleSetCurrentBandsContext *ctx) { GArray *bands_array; - MMModemState modem_state; GError *error = NULL; if (!mm_base_modem_authorize_finish (self, res, &error)) { @@ -2430,17 +2584,7 @@ return; } - modem_state = MM_MODEM_STATE_UNKNOWN; - g_object_get (self, - MM_IFACE_MODEM_STATE, &modem_state, - NULL); - - if (modem_state < MM_MODEM_STATE_DISABLED) { - g_dbus_method_invocation_return_error (ctx->invocation, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot set current bands: " - "not initialized/unlocked yet"); + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_DISABLED)) { handle_set_current_bands_context_free (ctx); return; } @@ -2479,19 +2623,14 @@ /* Set current modes */ typedef struct { - MMIfaceModem *self; MmGdbusModem *skeleton; - GSimpleAsyncResult *result; MMModemMode allowed; MMModemMode preferred; } SetCurrentModesContext; static void -set_current_modes_context_complete_and_free (SetCurrentModesContext *ctx) +set_current_modes_context_free (SetCurrentModesContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -2502,18 +2641,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void after_set_load_current_modes_ready (MMIfaceModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { + SetCurrentModesContext *ctx; MMModemMode allowed = MM_MODEM_MODE_NONE; MMModemMode preferred = MM_MODEM_MODE_NONE; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes_finish (self, res, &allowed, @@ -2529,39 +2671,43 @@ mm_gdbus_modem_set_current_modes (ctx->skeleton, g_variant_new ("(uu)", allowed, preferred)); /* Done */ - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void set_current_modes_ready (MMIfaceModem *self, GAsyncResult *res, - SetCurrentModesContext *ctx) + GTask *task) { + SetCurrentModesContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_modes_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - set_current_modes_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes ( + self, (GAsyncReadyCallback)after_set_load_current_modes_ready, - ctx); + task); return; } + ctx = g_task_get_task_data (task); + /* Default to the ones we requested */ mm_gdbus_modem_set_current_modes (ctx->skeleton, g_variant_new ("(uu)", ctx->allowed, ctx->preferred)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -2576,37 +2722,38 @@ MMModemMode current_allowed = MM_MODEM_MODE_ANY; MMModemMode current_preferred = MM_MODEM_MODE_NONE; guint i; + GTask *task; /* If setting allowed modes is not implemented, report an error */ if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_modes || !MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_modes_finish) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Setting allowed modes not supported"); + g_task_report_new_error (self, + callback, + user_data, + mm_iface_modem_set_current_modes, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Setting allowed modes not supported"); return; } /* Setup context */ ctx = g_new0 (SetCurrentModesContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_set_current_modes); ctx->allowed = allowed; ctx->preferred = preferred; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_current_modes_context_free); + g_object_get (self, MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - set_current_modes_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } @@ -2616,12 +2763,12 @@ /* Don't allow mode switching if only one item given in the supported list */ if (supported->len == 1) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Cannot change modes: only one combination supported"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot change modes: only one combination supported"); + g_object_unref (task); g_array_unref (supported); - set_current_modes_context_complete_and_free (ctx); return; } @@ -2645,12 +2792,12 @@ } if (!matched) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "The given combination of allowed and preferred modes is not supported"); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "The given combination of allowed and preferred modes is not supported"); + g_object_unref (task); g_array_unref (supported); - set_current_modes_context_complete_and_free (ctx); return; } } @@ -2664,8 +2811,8 @@ ¤t_preferred); if (current_allowed == allowed && current_preferred == preferred) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_current_modes_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -2676,16 +2823,15 @@ preferred_str = mm_modem_mode_build_string_from_mask (preferred); allowed_str = mm_modem_mode_build_string_from_mask (allowed); - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Preferred mode (%s) is not allowed (%s)", - preferred_str, - allowed_str); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Preferred mode (%s) is not allowed (%s)", + preferred_str, + allowed_str); + g_object_unref (task); g_free (preferred_str); g_free (allowed_str); - - set_current_modes_context_complete_and_free (ctx); return; } @@ -2695,7 +2841,7 @@ allowed, preferred, (GAsyncReadyCallback)set_current_modes_ready, - ctx); + task); } typedef struct { @@ -2724,8 +2870,11 @@ if (!mm_iface_modem_set_current_modes_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); - else + else { + /* Modes updated: explicitly refresh signal and access technology */ + mm_iface_modem_refresh_signal (self); mm_gdbus_modem_complete_set_current_modes (ctx->skeleton, ctx->invocation); + } handle_set_current_modes_context_free (ctx); } @@ -2735,7 +2884,6 @@ GAsyncResult *res, HandleSetCurrentModesContext *ctx) { - MMModemState modem_state; GError *error = NULL; if (!mm_base_modem_authorize_finish (self, res, &error)) { @@ -2744,17 +2892,7 @@ return; } - modem_state = MM_MODEM_STATE_UNKNOWN; - g_object_get (self, - MM_IFACE_MODEM_STATE, &modem_state, - NULL); - - if (modem_state < MM_MODEM_STATE_DISABLED) { - g_dbus_method_invocation_return_error (ctx->invocation, - MM_CORE_ERROR, - MM_CORE_ERROR_WRONG_STATE, - "Cannot set current modes: " - "not initialized/unlocked yet"); + if (abort_invocation_if_state_not_reached (ctx->self, ctx->invocation, MM_MODEM_STATE_DISABLED)) { handle_set_current_modes_context_free (ctx); return; } @@ -2870,12 +3008,32 @@ } } -static void -update_unlock_retries (MMIfaceModem *self, - MMUnlockRetries *unlock_retries) +MMUnlockRetries * +mm_iface_modem_get_unlock_retries (MMIfaceModem *self) +{ + MmGdbusModem *skeleton = NULL; + MMUnlockRetries *unlock_retries; + + g_object_get (self, + MM_IFACE_MODEM_DBUS_SKELETON, &skeleton, + NULL); + if (skeleton) { + GVariant *dictionary; + + dictionary = mm_gdbus_modem_get_unlock_retries (skeleton); + unlock_retries = mm_unlock_retries_new_from_dictionary (dictionary); + g_object_unref (skeleton); + } else + unlock_retries = mm_unlock_retries_new (); + + return unlock_retries; +} + +void +mm_iface_modem_update_unlock_retries (MMIfaceModem *self, + MMUnlockRetries *unlock_retries) { MmGdbusModem *skeleton = NULL; - GError *error = NULL; GVariant *previous_dictionary; MMUnlockRetries *previous_unlock_retries; @@ -2888,18 +3046,13 @@ previous_dictionary = mm_gdbus_modem_get_unlock_retries (skeleton); previous_unlock_retries = mm_unlock_retries_new_from_dictionary (previous_dictionary); - if (error) { - mm_warn ("Couldn't build previous unlock retries: '%s'", error->message); - g_error_free (error); - } else { - /* If they are different, update */ - if (!mm_unlock_retries_cmp (unlock_retries, previous_unlock_retries)) { - GVariant *new_dictionary; - - new_dictionary = mm_unlock_retries_get_dictionary (unlock_retries); - mm_gdbus_modem_set_unlock_retries (skeleton, new_dictionary); - g_variant_unref (new_dictionary); - } + /* If they are different, update */ + if (!mm_unlock_retries_cmp (unlock_retries, previous_unlock_retries)) { + GVariant *new_dictionary; + + new_dictionary = mm_unlock_retries_get_dictionary (unlock_retries); + mm_gdbus_modem_set_unlock_retries (skeleton, new_dictionary); + g_variant_unref (new_dictionary); } g_object_unref (previous_unlock_retries); @@ -2909,28 +3062,23 @@ typedef enum { UPDATE_LOCK_INFO_CONTEXT_STEP_FIRST = 0, UPDATE_LOCK_INFO_CONTEXT_STEP_LOCK, - UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES, UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK, + UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES, UPDATE_LOCK_INFO_CONTEXT_STEP_LAST } UpdateLockInfoContextStep; typedef struct { - MMIfaceModem *self; UpdateLockInfoContextStep step; - GSimpleAsyncResult *result; MmGdbusModem *skeleton; MMModemLock lock; GError *saved_error; } UpdateLockInfoContext; static void -update_lock_info_context_complete_and_free (UpdateLockInfoContext *ctx) +update_lock_info_context_free (UpdateLockInfoContext *ctx) { g_assert (ctx->saved_error == NULL); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_slice_free (UpdateLockInfoContext, ctx); @@ -2941,19 +3089,25 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return MM_MODEM_LOCK_UNKNOWN; + GError *inner_error = NULL; + gssize value; - return (MMModemLock) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCK_UNKNOWN; + } + return (MMModemLock)value; } -static void update_lock_info_context_step (UpdateLockInfoContext *ctx); +static void update_lock_info_context_step (GTask *task); static void load_unlock_retries_ready (MMIfaceModem *self, GAsyncResult *res, - UpdateLockInfoContext *ctx) + GTask *task) { + UpdateLockInfoContext *ctx; GError *error = NULL; MMUnlockRetries *unlock_retries; @@ -2963,20 +3117,22 @@ g_error_free (error); } else { /* Update the dictionary in the DBus interface */ - update_unlock_retries (self, unlock_retries); + mm_iface_modem_update_unlock_retries (self, unlock_retries); g_object_unref (unlock_retries); } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); } static void modem_after_sim_unlock_ready (MMIfaceModem *self, GAsyncResult *res, - UpdateLockInfoContext *ctx) + GTask *task) { + UpdateLockInfoContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock_finish (self, res, &error)) { @@ -2985,17 +3141,21 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); } static void internal_load_unlock_required_ready (MMIfaceModem *self, GAsyncResult *res, - UpdateLockInfoContext *ctx) + GTask *task) { + UpdateLockInfoContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->lock = internal_load_unlock_required_finish (self, res, &error); if (error) { /* Treat several SIM related, serial and other core errors as critical @@ -3007,7 +3167,7 @@ MM_CORE_ERROR_CANCELLED)) { ctx->saved_error = error; ctx->step = UPDATE_LOCK_INFO_CONTEXT_STEP_LAST; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); return; } @@ -3024,7 +3184,7 @@ if (!mm_iface_modem_is_cdma (self)) { ctx->saved_error = error; ctx->step = UPDATE_LOCK_INFO_CONTEXT_STEP_LAST; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); return; } @@ -3041,12 +3201,18 @@ /* Go on to next step */ ctx->step++; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); } static void -update_lock_info_context_step (UpdateLockInfoContext *ctx) +update_lock_info_context_step (GTask *task) { + MMIfaceModem *self; + UpdateLockInfoContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case UPDATE_LOCK_INFO_CONTEXT_STEP_FIRST: /* We need the skeleton around */ @@ -3055,7 +3221,7 @@ MM_CORE_ERROR_FAILED, "Couldn't get interface skeleton"); ctx->step = UPDATE_LOCK_INFO_CONTEXT_STEP_LAST; - update_lock_info_context_step (ctx); + update_lock_info_context_step (task); return; } @@ -3067,23 +3233,9 @@ if (ctx->lock == MM_MODEM_LOCK_UNKNOWN) { /* If we're already unlocked, we're done */ internal_load_unlock_required ( - ctx->self, + self, (GAsyncReadyCallback)internal_load_unlock_required_ready, - ctx); - return; - } - - /* Fall down to next step */ - ctx->step++; - - case UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES: - /* Load unlock retries if possible */ - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_retries && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_retries_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_unlock_retries ( - ctx->self, - (GAsyncReadyCallback)load_unlock_retries_ready, - ctx); + task); return; } @@ -3094,17 +3246,17 @@ /* If we get that no lock is required, run the after SIM unlock step * in order to wait for the SIM to get ready. Skip waiting on * CDMA-only modems where we don't support a SIM. */ - if (!mm_iface_modem_is_cdma_only (ctx->self) && + if (!mm_iface_modem_is_cdma_only (self) && (ctx->lock == MM_MODEM_LOCK_NONE || ctx->lock == MM_MODEM_LOCK_SIM_PIN2 || ctx->lock == MM_MODEM_LOCK_SIM_PUK2)) { - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_after_sim_unlock != NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_after_sim_unlock_finish != NULL) { + if (MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock != NULL && + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock_finish != NULL) { mm_dbg ("SIM is ready, running after SIM unlock step..."); - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_after_sim_unlock ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock ( + self, (GAsyncReadyCallback)modem_after_sim_unlock_ready, - ctx); + task); return; } @@ -3115,25 +3267,36 @@ /* Fall down to next step */ ctx->step++; + case UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES: + /* Load unlock retries if possible */ + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_retries && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_retries_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_retries ( + self, + (GAsyncReadyCallback)load_unlock_retries_ready, + task); + return; + } + + /* Fall down to next step */ + ctx->step++; + case UPDATE_LOCK_INFO_CONTEXT_STEP_LAST: if (ctx->saved_error) { /* Return saved error */ - g_simple_async_result_take_error (ctx->result, ctx->saved_error); + g_task_return_error (task, ctx->saved_error); ctx->saved_error = NULL; } else { /* Update lock status and modem status if needed */ - set_lock_status (ctx->self, ctx->skeleton, ctx->lock); - - g_simple_async_result_set_op_res_gpointer (ctx->result, - GUINT_TO_POINTER (ctx->lock), - NULL); + set_lock_status (self, ctx->skeleton, ctx->lock); + g_task_return_int (task, ctx->lock); } - update_lock_info_context_complete_and_free (ctx); + g_object_unref (task); return; default: - g_assert_not_reached(); + g_assert_not_reached (); } } @@ -3144,29 +3307,26 @@ gpointer user_data) { UpdateLockInfoContext *ctx; + GTask *task; ctx = g_slice_new0 (UpdateLockInfoContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_update_lock_info); - g_object_get (ctx->self, + g_object_get (self, MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, NULL); /* If the given lock is known, we will avoid re-asking for it */ ctx->lock = known_lock; - update_lock_info_context_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)update_lock_info_context_free); + + update_lock_info_context_step (task); } /*****************************************************************************/ /* Set power state sequence */ typedef struct { - MMIfaceModem *self; - GSimpleAsyncResult *result; MmGdbusModem *skeleton; MMModemPowerState power_state; MMModemPowerState previous_cached_power_state; @@ -3174,11 +3334,8 @@ } SetPowerStateContext; static void -set_power_state_context_complete_and_free (SetPowerStateContext *ctx) +set_power_state_context_free (SetPowerStateContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_slice_free (SetPowerStateContext, ctx); @@ -3189,38 +3346,41 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void modem_after_power_up_ready (MMIfaceModem *self, GAsyncResult *res, - SetPowerStateContext *ctx) + GTask *task) { GError *error = NULL; MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_power_up_finish (self, res, &error); if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_power_state_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void modem_power_up_ready (MMIfaceModem *self, GAsyncResult *res, - SetPowerStateContext *ctx) + GTask *task) { + SetPowerStateContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_up_finish (self, res, &error); if (error) { /* If the real and cached ones are different, set the real one */ if (ctx->previous_cached_power_state != ctx->previous_real_power_state) mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->previous_real_power_state); - g_simple_async_result_take_error (ctx->result, error); - set_power_state_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -3233,62 +3393,74 @@ MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_power_up ( self, (GAsyncReadyCallback)modem_after_power_up_ready, - ctx); + task); return; } /* Otherwise, we're done */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_power_state_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void modem_power_down_ready (MMIfaceModem *self, GAsyncResult *res, - SetPowerStateContext *ctx) + GTask *task) { + SetPowerStateContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_down_finish (self, res, &error); if (error) { /* If the real and cached ones are different, set the real one */ if (ctx->previous_cached_power_state != ctx->previous_real_power_state) mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->previous_real_power_state); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else { mm_dbg ("Modem set in low-power mode..."); mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->power_state); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } - set_power_state_context_complete_and_free (ctx); + g_object_unref (task); } static void modem_power_off_ready (MMIfaceModem *self, - GAsyncResult *res, - SetPowerStateContext *ctx) + GAsyncResult *res, + GTask *task) { + SetPowerStateContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_off_finish (self, res, &error); if (error) { /* If the real and cached ones are different, set the real one */ if (ctx->previous_cached_power_state != ctx->previous_real_power_state) mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->previous_real_power_state); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else { mm_info ("Modem powered off... may no longer be accessible"); mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->power_state); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); } - set_power_state_context_complete_and_free (ctx); + g_object_unref (task); } static void -set_power_state (SetPowerStateContext *ctx) +set_power_state (GTask *task) { + MMIfaceModem *self; + SetPowerStateContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Already done if we're in the desired power state */ if (ctx->previous_real_power_state == ctx->power_state) { mm_dbg ("No need to change power state: already in '%s' power state", @@ -3296,68 +3468,68 @@ /* If the real and cached ones are different, set the real one */ if (ctx->previous_cached_power_state != ctx->previous_real_power_state) mm_gdbus_modem_set_power_state (ctx->skeleton, ctx->previous_real_power_state); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - set_power_state_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Fully powering off the modem? */ if (ctx->power_state == MM_MODEM_POWER_STATE_OFF) { /* Error if unsupported */ - if (!MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_off || - !MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_off_finish) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Powering off is not supported by this modem"); - set_power_state_context_complete_and_free (ctx); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_off || + !MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_off_finish) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Powering off is not supported by this modem"); + g_object_unref (task); return; } - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_off ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_off ( + MM_IFACE_MODEM (self), (GAsyncReadyCallback)modem_power_off_ready, - ctx); + task); return; } /* Going into low power mode? */ if (ctx->power_state == MM_MODEM_POWER_STATE_LOW) { /* Error if unsupported */ - if (!MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_down || - !MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_down_finish) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Going into low-power mode is not supported by this modem"); - set_power_state_context_complete_and_free (ctx); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_down || + !MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_down_finish) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Going into low-power mode is not supported by this modem"); + g_object_unref (task); return; } - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_down ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_down ( + MM_IFACE_MODEM (self), (GAsyncReadyCallback)modem_power_down_ready, - ctx); + task); return; } /* Going out of low power mode? */ if (ctx->power_state == MM_MODEM_POWER_STATE_ON) { /* Error if unsupported */ - if (!MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_up || - !MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_up_finish) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Going into full-power mode is not supported by this modem"); - set_power_state_context_complete_and_free (ctx); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_up || + !MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_up_finish) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Going into full-power mode is not supported by this modem"); + g_object_unref (task); return; } - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_power_up ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM_GET_INTERFACE (self)->modem_power_up ( + MM_IFACE_MODEM (self), (GAsyncReadyCallback)modem_power_up_ready, - ctx); + task); return; } @@ -3367,10 +3539,13 @@ static void set_power_state_load_ready (MMIfaceModem *self, GAsyncResult *res, - SetPowerStateContext *ctx) + GTask *task) { + SetPowerStateContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->previous_real_power_state = MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state_finish (self, res, &error); if (error) { mm_dbg ("Couldn't reload current power state: %s", error->message); @@ -3380,7 +3555,7 @@ } /* And keep on */ - set_power_state (ctx); + set_power_state (task); } void @@ -3390,23 +3565,23 @@ gpointer user_data) { SetPowerStateContext *ctx; + GTask *task; ctx = g_slice_new0 (SetPowerStateContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_set_power_state); ctx->power_state = power_state; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_power_state_context_free); + + g_object_get (self, MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - set_power_state_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } @@ -3416,19 +3591,19 @@ * as the real power status of the modem may also be changed by rfkill. So, * before updating the current power state, re-check which is the real power * state. */ - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state ( + self, (GAsyncReadyCallback)set_power_state_load_ready, - ctx); + task); return; } /* If there is no way to load power state, just keep on assuming the cached * one is also the real one */ ctx->previous_real_power_state = ctx->previous_cached_power_state; - set_power_state (ctx); + set_power_state (task); } /*****************************************************************************/ @@ -3436,10 +3611,10 @@ gboolean mm_iface_modem_disable_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) + GAsyncResult *res, + GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -3447,27 +3622,24 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; /* Just complete, nothing to do */ - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_disable); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ /* MODEM ENABLING */ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, ENABLING_STEP_SET_POWER_STATE, + ENABLING_STEP_CHECK_FOR_SIM_SWAP, ENABLING_STEP_FLOW_CONTROL, ENABLING_STEP_SUPPORTED_CHARSETS, ENABLING_STEP_CHARSET, @@ -3475,93 +3647,98 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModem *self; EnablingStep step; MMModemCharset supported_charsets; const MMModemCharset *current_charset; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModem *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_enable_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void enabling_set_power_state_ready (MMIfaceModem *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; if (!mm_iface_modem_set_power_state_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); +} + +static void +check_for_sim_swap_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + EnablingContext *ctx; + GError *error = NULL; + + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish (self, res, &error)) { + mm_warn ("Error checking if SIM was swapped: '%s'", error->message); + g_error_free (error); + } + + /* Go on to next step */ + ctx = g_task_get_task_data (task); + ctx->step++; + interface_enabling_step (task); } static void setup_flow_control_ready (MMIfaceModem *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_GET_INTERFACE (self)->setup_flow_control_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void load_supported_charsets_ready (MMIfaceModem *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + ctx->supported_charsets = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_charsets_finish (self, res, &error); if (error) { @@ -3571,16 +3748,19 @@ /* Go on to next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void setup_charset_ready (MMIfaceModem *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->setup_charset_finish (self, res, &error)) { mm_dbg ("couldn't set charset '%s': '%s'", mm_modem_charset_to_string (*ctx->current_charset), @@ -3592,7 +3772,7 @@ /* Done, Go on to next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static const MMModemCharset best_charsets[] = { @@ -3605,11 +3785,19 @@ }; static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModem *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -3617,31 +3805,43 @@ ctx->step++; case ENABLING_STEP_SET_POWER_STATE: - mm_iface_modem_set_power_state (ctx->self, + mm_iface_modem_set_power_state (self, MM_MODEM_POWER_STATE_ON, (GAsyncReadyCallback)enabling_set_power_state_ready, - ctx); + task); return; + case ENABLING_STEP_CHECK_FOR_SIM_SWAP: + if (MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap && + MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap ( + self, + (GAsyncReadyCallback)check_for_sim_swap_ready, + task); + return; + } + /* Fall down to next step */ + ctx->step++; + case ENABLING_STEP_FLOW_CONTROL: - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_flow_control && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_flow_control_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_flow_control ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->setup_flow_control && + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_flow_control_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_flow_control ( + self, (GAsyncReadyCallback)setup_flow_control_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case ENABLING_STEP_SUPPORTED_CHARSETS: - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_charsets && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_charsets_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_charsets ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_charsets && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_charsets_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_charsets ( + self, (GAsyncReadyCallback)load_supported_charsets_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -3650,8 +3850,8 @@ case ENABLING_STEP_CHARSET: /* Only try to set charsets if we were able to load supported ones */ if (ctx->supported_charsets > 0 && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_charset && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_charset_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_charset && + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_charset_finish) { gboolean next_to_try = FALSE; while (!next_to_try) { @@ -3670,19 +3870,19 @@ } if (next_to_try) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->setup_charset ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_charset ( + self, *ctx->current_charset, (GAsyncReadyCallback)setup_charset_ready, - ctx); + task); return; } - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to find a usable modem character set"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to find a usable modem character set"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -3690,8 +3890,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -3705,35 +3905,34 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ /* MODEM INITIALIZATION */ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -3743,12 +3942,14 @@ INITIALIZATION_STEP_MANUFACTURER, INITIALIZATION_STEP_MODEL, INITIALIZATION_STEP_REVISION, + INITIALIZATION_STEP_HARDWARE_REVISION, INITIALIZATION_STEP_EQUIPMENT_ID, INITIALIZATION_STEP_DEVICE_ID, INITIALIZATION_STEP_SUPPORTED_MODES, INITIALIZATION_STEP_SUPPORTED_BANDS, INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES, INITIALIZATION_STEP_POWER_STATE, + INITIALIZATION_STEP_SIM_HOT_SWAP, INITIALIZATION_STEP_UNLOCK_REQUIRED, INITIALIZATION_STEP_SIM, INITIALIZATION_STEP_OWN_NUMBERS, @@ -3758,56 +3959,32 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModem *self; InitializationStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModem *skeleton; GError *fatal_error; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { g_assert (ctx->fatal_error == NULL); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->self); - g_object_unref (ctx->result); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - /* Simply ignore any fatal error encountered as the initialization is cancelled anyway. */ - if (ctx->fatal_error) { - g_error_free (ctx->fatal_error); - ctx->fatal_error = NULL; - } - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - #undef STR_REPLY_READY_FN #define STR_REPLY_READY_FN(NAME,DISPLAY) \ static void \ load_##NAME##_ready (MMIfaceModem *self, \ GAsyncResult *res, \ - InitializationContext *ctx) \ + GTask *task) \ { \ + InitializationContext *ctx; \ GError *error = NULL; \ gchar *val; \ \ + ctx = g_task_get_task_data (task); \ + \ val = MM_IFACE_MODEM_GET_INTERFACE (self)->load_##NAME##_finish (self, res, &error); \ mm_gdbus_modem_set_##NAME (ctx->skeleton, val); \ g_free (val); \ @@ -3819,7 +3996,7 @@ \ /* Go on to next step */ \ ctx->step++; \ - interface_initialization_step (ctx); \ + interface_initialization_step (task); \ } #undef UINT_REPLY_READY_FN @@ -3827,10 +4004,13 @@ static void \ load_##NAME##_ready (MMIfaceModem *self, \ GAsyncResult *res, \ - InitializationContext *ctx) \ + GTask *task) \ { \ + InitializationContext *ctx; \ GError *error = NULL; \ \ + ctx = g_task_get_task_data (task); \ + \ mm_gdbus_modem_set_##NAME ( \ ctx->skeleton, \ MM_IFACE_MODEM_GET_INTERFACE (self)->load_##NAME##_finish (self, res, &error)); \ @@ -3842,16 +4022,19 @@ \ /* Go on to next step */ \ ctx->step++; \ - interface_initialization_step (ctx); \ + interface_initialization_step (task); \ } static void current_capabilities_internal_load_unlock_required_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + internal_load_unlock_required_finish (self, res, &error); if (error) { /* These SIM errors indicate that there is NO valid SIM available. So, @@ -3882,31 +4065,34 @@ /* Keep on */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_current_capabilities_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; MMModemCapability caps; GError *error = NULL; + ctx = g_task_get_task_data (task); + caps = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_capabilities_finish (self, res, &error); if (error) { g_propagate_error (&ctx->fatal_error, error); g_prefix_error (&ctx->fatal_error, "couldn't load current capabilities: "); /* Jump to the last step */ ctx->step = INITIALIZATION_STEP_LAST; - interface_initialization_step (ctx); + interface_initialization_step (task); return; } /* If LTE capability is reported, enable EPS network registration checks */ if (caps & MM_MODEM_CAPABILITY_LTE) { mm_dbg ("Setting EPS network as supported"); - g_object_set (G_OBJECT (ctx->self), + g_object_set (G_OBJECT (self), MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, TRUE, NULL); } @@ -3914,7 +4100,7 @@ /* If LTE capability is the only one reported, disable all other network registration checks */ if (caps == MM_MODEM_CAPABILITY_LTE) { mm_dbg ("Setting CS/PS/CDMA1x/EVDO networks as unsupported"); - g_object_set (G_OBJECT (ctx->self), + g_object_set (G_OBJECT (self), MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED, FALSE, MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED, FALSE, MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED, FALSE, @@ -3933,31 +4119,34 @@ (caps & MM_MODEM_CAPABILITY_GSM_UMTS || caps & MM_MODEM_CAPABILITY_LTE)) { mm_dbg ("Checking if multimode device has a SIM..."); internal_load_unlock_required ( - ctx->self, + self, (GAsyncReadyCallback)current_capabilities_internal_load_unlock_required_ready, - ctx); + task); return; } ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_supported_capabilities_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GArray *supported_capabilities; GError *error = NULL; + ctx = g_task_get_task_data (task); + supported_capabilities = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_capabilities_finish (self, res, &error); if (error) { g_propagate_error (&ctx->fatal_error, error); g_prefix_error (&ctx->fatal_error, "couldn't load supported capabilities: "); /* Jump to the last step */ ctx->step = INITIALIZATION_STEP_LAST; - interface_initialization_step (ctx); + interface_initialization_step (task); return; } @@ -3967,23 +4156,27 @@ g_array_unref (supported_capabilities); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } STR_REPLY_READY_FN (manufacturer, "Manufacturer") STR_REPLY_READY_FN (model, "Model") STR_REPLY_READY_FN (revision, "Revision") +STR_REPLY_READY_FN (hardware_revision, "HardwareRevision") STR_REPLY_READY_FN (equipment_identifier, "Equipment Identifier") STR_REPLY_READY_FN (device_identifier, "Device Identifier") static void load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; GArray *modes_array; + ctx = g_task_get_task_data (task); + modes_array = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_modes_finish (self, res, &error); if (modes_array != NULL) { mm_gdbus_modem_set_supported_modes (ctx->skeleton, @@ -3998,20 +4191,23 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_supported_bands_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; GArray *bands_array; - bands_array = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_bands_finish (self, res, &error); + ctx = g_task_get_task_data (task); + bands_array = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_bands_finish (self, res, &error); if (bands_array) { + mm_common_bands_garray_sort (bands_array); mm_gdbus_modem_set_supported_bands (ctx->skeleton, mm_common_bands_garray_to_variant (bands_array)); g_array_unref (bands_array); @@ -4024,17 +4220,20 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_supported_ip_families_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; MMBearerIpFamily ip_families; + ctx = g_task_get_task_data (task); + ip_families = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families_finish (self, res, &error); if (ip_families != MM_BEARER_IP_FAMILY_NONE) @@ -4047,7 +4246,7 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } UINT_REPLY_READY_FN (power_state, "Power State") @@ -4055,8 +4254,12 @@ static void modem_update_lock_info_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; + + ctx = g_task_get_task_data (task); + /* NOTE: we already propagated the lock state, no need to do it again */ mm_iface_modem_update_lock_info_finish (self, res, &ctx->fatal_error); if (ctx->fatal_error) { @@ -4068,22 +4271,27 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void sim_new_ready (GAsyncInitable *initable, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + MMIfaceModem *self; + InitializationContext *ctx; MMBaseSim *sim; GError *error = NULL; - sim = MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim_finish (ctx->self, res, &error); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + sim = MM_IFACE_MODEM_GET_INTERFACE (self)->create_sim_finish (self, res, &error); if (error) { mm_warn ("couldn't create SIM: '%s'", error->message); - g_simple_async_result_take_error (ctx->result, error); - initialization_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -4094,7 +4302,7 @@ ctx->skeleton, "sim", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - g_object_set (ctx->self, + g_object_set (self, MM_IFACE_MODEM_SIM, sim, NULL); g_object_unref (sim); @@ -4102,16 +4310,19 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void sim_reinit_ready (MMBaseSim *sim, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!mm_base_sim_initialize_finish (sim, res, &error)) { mm_warn ("SIM re-initialization failed: '%s'", error ? error->message : "Unknown error"); @@ -4120,7 +4331,7 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } void @@ -4141,11 +4352,14 @@ static void load_own_numbers_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; GStrv str_list; + ctx = g_task_get_task_data (task); + str_list = MM_IFACE_MODEM_GET_INTERFACE (self)->load_own_numbers_finish (self, res, &error); if (error) { mm_warn ("couldn't load list of Own Numbers: '%s'", error->message); @@ -4159,18 +4373,21 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_current_modes_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; MMModemMode allowed = MM_MODEM_MODE_NONE; MMModemMode preferred = MM_MODEM_MODE_NONE; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes_finish (self, res, &allowed, @@ -4184,17 +4401,20 @@ /* Done, Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_current_bands_ready (MMIfaceModem *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GArray *current_bands; GError *error = NULL; + ctx = g_task_get_task_data (task); + current_bands = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish (self, res, &error); if (!current_bands) { /* Errors when getting current bands won't be critical */ @@ -4213,6 +4433,7 @@ g_array_unref (supported_bands); if (filtered_bands) { + mm_common_bands_garray_sort (filtered_bands); mm_gdbus_modem_set_current_bands (ctx->skeleton, mm_common_bands_garray_to_variant (filtered_bands)); g_array_unref (filtered_bands); @@ -4221,15 +4442,56 @@ /* Done, Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); +} + +/*****************************************************************************/ +/* Setup SIM hot swap (Modem interface) */ +static void +setup_sim_hot_swap_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + InitializationContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap_finish (self, res, &error); + if (error) { + mm_warn ("Iface modem: SIM hot swap setup failed: '%s'", error->message); + g_error_free (error); + } else { + mm_dbg ("Iface modem: SIM hot swap setup succeeded"); + g_object_set (self, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, TRUE, + NULL); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModem *self; + InitializationContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + /* Simply ignore any fatal error encountered as the initialization is cancelled anyway. */ + if (ctx->fatal_error) { + g_error_free (ctx->fatal_error); + ctx->fatal_error = NULL; + } + g_object_unref (task); return; + } switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -4237,7 +4499,7 @@ if (!mm_gdbus_modem_get_device (ctx->skeleton)) { gchar *device; - g_object_get (ctx->self, + g_object_get (self, MM_BASE_MODEM_DEVICE, &device, NULL); mm_gdbus_modem_set_device (ctx->skeleton, device); @@ -4247,7 +4509,7 @@ if (!mm_gdbus_modem_get_drivers (ctx->skeleton)) { gchar **drivers; - g_object_get (ctx->self, + g_object_get (self, MM_BASE_MODEM_DRIVERS, &drivers, NULL); mm_gdbus_modem_set_drivers (ctx->skeleton, (const gchar * const *)drivers); @@ -4257,7 +4519,7 @@ if (!mm_gdbus_modem_get_plugin (ctx->skeleton)) { gchar *plugin; - g_object_get (ctx->self, + g_object_get (self, MM_BASE_MODEM_PLUGIN, &plugin, NULL); mm_gdbus_modem_set_plugin (ctx->skeleton, plugin); @@ -4268,14 +4530,14 @@ MMPort *primary = NULL; #if defined WITH_QMI - primary = MM_PORT (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (ctx->self))); + primary = MM_PORT (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self))); #endif #if defined WITH_MBIM if (!primary) - primary = MM_PORT (mm_base_modem_peek_port_mbim (MM_BASE_MODEM (ctx->self))); + primary = MM_PORT (mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self))); #endif if (!primary) - primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self))); + primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (self))); g_assert (primary != NULL); mm_gdbus_modem_set_primary_port (ctx->skeleton, mm_port_get_device (primary)); @@ -4285,7 +4547,7 @@ MMModemPortInfo *port_infos; guint n_port_infos; - port_infos = mm_base_modem_get_port_infos (MM_BASE_MODEM (ctx->self), &n_port_infos); + port_infos = mm_base_modem_get_port_infos (MM_BASE_MODEM (self), &n_port_infos); mm_gdbus_modem_set_ports (ctx->skeleton, mm_common_ports_array_to_variant (port_infos, n_port_infos)); mm_modem_port_info_array_free (port_infos, n_port_infos); } @@ -4298,12 +4560,12 @@ * reloaded. So if we're asked to re-initialize, if we already have current capabilities loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_current_capabilities (ctx->skeleton) == MM_MODEM_CAPABILITY_NONE && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_capabilities && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_capabilities_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_capabilities ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_capabilities && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_capabilities_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_capabilities ( + self, (GAsyncReadyCallback)load_current_capabilities_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4322,12 +4584,12 @@ g_array_index (supported_capabilities, MMModemCapability, 0) == MM_MODEM_CAPABILITY_NONE) { MMModemCapability current; - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_capabilities && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_capabilities_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_capabilities ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_capabilities && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_capabilities_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_capabilities ( + self, (GAsyncReadyCallback)load_supported_capabilities_ready, - ctx); + task); g_array_unref (supported_capabilities); return; } @@ -4353,7 +4615,7 @@ /* Bearers setup is meant to be loaded only once during the whole * lifetime of the modem. The list may have been created by the object * implementing the interface; if so use it. */ - g_object_get (ctx->self, + g_object_get (self, MM_IFACE_MODEM_BEARER_LIST, &list, NULL); @@ -4362,7 +4624,7 @@ /* The maximum number of available/connected modems is guessed from * the size of the data ports list. */ - n = g_list_length (mm_base_modem_peek_data_ports (MM_BASE_MODEM (ctx->self))); + n = g_list_length (mm_base_modem_peek_data_ports (MM_BASE_MODEM (self))); mm_dbg ("Modem allows up to %u bearers", n); /* Create new default list */ @@ -4370,8 +4632,8 @@ g_signal_connect (list, "notify::" MM_BEARER_LIST_NUM_BEARERS, G_CALLBACK (bearer_list_updated), - ctx->self); - g_object_set (ctx->self, + self); + g_object_set (self, MM_IFACE_MODEM_BEARER_LIST, list, NULL); } @@ -4395,12 +4657,12 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_manufacturer (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_manufacturer && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_manufacturer_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_manufacturer ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_manufacturer && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_manufacturer_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_manufacturer ( + self, (GAsyncReadyCallback)load_manufacturer_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4411,12 +4673,12 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_model (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_model && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_model_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_model ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_model && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_model_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_model ( + self, (GAsyncReadyCallback)load_model_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4427,12 +4689,28 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_revision (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_revision && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_revision_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_revision ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_revision && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_revision_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_revision ( + self, (GAsyncReadyCallback)load_revision_ready, - ctx); + task); + return; + } + /* Fall down to next step */ + ctx->step++; + + case INITIALIZATION_STEP_HARDWARE_REVISION: + /* HardwareRevision is meant to be loaded only once during the whole + * lifetime of the modem. Therefore, if we already have them loaded, + * don't try to load them again. */ + if (mm_gdbus_modem_get_hardware_revision (ctx->skeleton) == NULL && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision ( + self, + (GAsyncReadyCallback)load_hardware_revision_ready, + task); return; } /* Fall down to next step */ @@ -4443,12 +4721,12 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_equipment_identifier (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_equipment_identifier && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_equipment_identifier_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_equipment_identifier ( + self, (GAsyncReadyCallback)load_equipment_identifier_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4459,20 +4737,20 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_device_identifier (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_device_identifier && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_device_identifier_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_device_identifier ( + self, (GAsyncReadyCallback)load_device_identifier_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case INITIALIZATION_STEP_SUPPORTED_MODES: - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_modes != NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_modes_finish != NULL) { + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_modes != NULL && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_modes_finish != NULL) { GArray *supported_modes; MMModemModeCombination *mode = NULL; @@ -4486,10 +4764,10 @@ mode = &g_array_index (supported_modes, MMModemModeCombination, 0); if (supported_modes->len == 0 || (mode && mode->allowed == MM_MODEM_MODE_ANY && mode->preferred == MM_MODEM_MODE_NONE)) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_modes ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_modes ( + self, (GAsyncReadyCallback)load_supported_modes_ready, - ctx); + task); g_array_unref (supported_modes); return; } @@ -4510,12 +4788,12 @@ * don't try to load them again. */ if (supported_bands->len == 0 || g_array_index (supported_bands, MMModemBand, 0) == MM_MODEM_BAND_UNKNOWN) { - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_bands && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_bands_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_bands ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_bands && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_bands_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_bands ( + self, (GAsyncReadyCallback)load_supported_bands_ready, - ctx); + task); g_array_unref (supported_bands); return; } @@ -4534,13 +4812,13 @@ /* Supported ip_families are meant to be loaded only once during the whole * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families != NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families_finish != NULL && + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families != NULL && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families_finish != NULL && mm_gdbus_modem_get_supported_ip_families (ctx->skeleton) == MM_BEARER_IP_FAMILY_NONE) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families ( + self, (GAsyncReadyCallback)load_supported_ip_families_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4550,12 +4828,12 @@ /* Initial power state is meant to be loaded only once. Therefore, if we * already have it loaded, don't try to load it again. */ if (mm_gdbus_modem_get_power_state (ctx->skeleton) == MM_MODEM_POWER_STATE_UNKNOWN) { - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_power_state ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_power_state ( + self, (GAsyncReadyCallback)load_power_state_ready, - ctx); + task); return; } @@ -4565,13 +4843,25 @@ /* Fall down to next step */ ctx->step++; + case INITIALIZATION_STEP_SIM_HOT_SWAP: + if (MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap && + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap ( + MM_IFACE_MODEM (self), + (GAsyncReadyCallback) setup_sim_hot_swap_ready, + task); + return; + } + /* Fall down to next step */ + ctx->step++; + case INITIALIZATION_STEP_UNLOCK_REQUIRED: /* Only check unlock required if we were previously not unlocked */ if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE) { - mm_iface_modem_update_lock_info (ctx->self, + mm_iface_modem_update_lock_info (self, MM_MODEM_LOCK_UNKNOWN, /* ask */ (GAsyncReadyCallback)modem_update_lock_info_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4580,19 +4870,19 @@ case INITIALIZATION_STEP_SIM: /* If the modem doesn't need any SIM (not implemented by plugin, or not * needed in CDMA-only modems) */ - if (!mm_iface_modem_is_cdma_only (ctx->self) && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim_finish) { + if (!mm_iface_modem_is_cdma_only (self) && + MM_IFACE_MODEM_GET_INTERFACE (self)->create_sim && + MM_IFACE_MODEM_GET_INTERFACE (self)->create_sim_finish) { MMBaseSim *sim = NULL; - g_object_get (ctx->self, + g_object_get (self, MM_IFACE_MODEM_SIM, &sim, NULL); if (!sim) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim ( - MM_IFACE_MODEM (ctx->self), + MM_IFACE_MODEM_GET_INTERFACE (self)->create_sim ( + MM_IFACE_MODEM (self), (GAsyncReadyCallback)sim_new_ready, - ctx); + task); return; } @@ -4600,9 +4890,9 @@ * This will try to load any missing property value that couldn't be * retrieved before due to having the SIM locked. */ mm_base_sim_initialize (sim, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)sim_reinit_ready, - ctx); + task); g_object_unref (sim); return; } @@ -4614,12 +4904,12 @@ * lifetime of the modem. Therefore, if we already have them loaded, * don't try to load them again. */ if (mm_gdbus_modem_get_own_numbers (ctx->skeleton) == NULL && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_own_numbers && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_own_numbers_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_own_numbers ( - ctx->self, + MM_IFACE_MODEM_GET_INTERFACE (self)->load_own_numbers && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_own_numbers_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_own_numbers ( + self, (GAsyncReadyCallback)load_own_numbers_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -4648,12 +4938,12 @@ supported_mode = &g_array_index (supported, MMModemModeCombination, 0); mm_gdbus_modem_set_current_modes (ctx->skeleton, g_variant_new ("(uu)", supported_mode->allowed, supported_mode->preferred)); - } else if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_modes ( - ctx->self, + } else if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_modes ( + self, (GAsyncReadyCallback)load_current_modes_ready, - ctx); + task); if (supported) g_array_unref (supported); return; @@ -4676,12 +4966,12 @@ /* Current bands are only meant to be loaded once, so if we have them * loaded already, just skip re-loading */ if (!current || (current->len == 1 && g_array_index (current, MMModemBand, 0) == MM_MODEM_BAND_UNKNOWN)) { - if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_bands && - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_bands_finish) { - MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_current_bands ( - ctx->self, + if (MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands && + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish) { + MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands ( + self, (GAsyncReadyCallback)load_current_bands_ready, - ctx); + task); if (current) g_array_unref (current); return; @@ -4699,77 +4989,34 @@ } case INITIALIZATION_STEP_LAST: - /* Setting capabilities allowed also in FAILED state. Just imagine a - * 3GPP+3GPP2 modem in 3GPP-only mode without SIM, we should allow - * changing caps to 3GPP2, which doesn't require SIM */ - g_signal_connect (ctx->skeleton, - "handle-set-current-capabilities", - G_CALLBACK (handle_set_current_capabilities), - ctx->self); - /* Allow setting the power state to OFF even when the modem is in the - * FAILED state as this operation does not necessarily depend on the - * presence of a SIM. handle_set_power_state_auth_ready already ensures - * that the power state can only be set to OFF when the modem is in the - * FAILED state. */ - g_signal_connect (ctx->skeleton, - "handle-set-power-state", - G_CALLBACK (handle_set_power_state), - ctx->self); - /* Allow the reset and factory reset operation in FAILED state to rescue the modem. - * Also, for a modem that doesn't support SIM hot swapping, a reset is needed to - * force the modem to detect the newly inserted SIM. */ - g_signal_connect (ctx->skeleton, - "handle-reset", - G_CALLBACK (handle_reset), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-factory-reset", - G_CALLBACK (handle_factory_reset), - ctx->self); - - if (ctx->fatal_error) { - g_simple_async_result_take_error (ctx->result, ctx->fatal_error); - ctx->fatal_error = NULL; - } else { - /* We are done without errors! - * Handle method invocations */ - g_signal_connect (ctx->skeleton, - "handle-create-bearer", - G_CALLBACK (handle_create_bearer), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-command", - G_CALLBACK (handle_command), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-delete-bearer", - G_CALLBACK (handle_delete_bearer), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-list-bearers", - G_CALLBACK (handle_list_bearers), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-enable", - G_CALLBACK (handle_enable), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-set-current-bands", - G_CALLBACK (handle_set_current_bands), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-set-current-modes", - G_CALLBACK (handle_set_current_modes), - ctx->self); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - } + /* Setup all method handlers */ + g_object_connect (ctx->skeleton, + "signal::handle-set-current-capabilities", G_CALLBACK (handle_set_current_capabilities), self, + "signal::handle-set-power-state", G_CALLBACK (handle_set_power_state), self, + "signal::handle-reset", G_CALLBACK (handle_reset), self, + "signal::handle-factory-reset", G_CALLBACK (handle_factory_reset), self, + "signal::handle-create-bearer", G_CALLBACK (handle_create_bearer), self, + "signal::handle-command", G_CALLBACK (handle_command), self, + "signal::handle-delete-bearer", G_CALLBACK (handle_delete_bearer), self, + "signal::handle-list-bearers", G_CALLBACK (handle_list_bearers), self, + "signal::handle-enable", G_CALLBACK (handle_enable), self, + "signal::handle-set-current-bands", G_CALLBACK (handle_set_current_bands), self, + "signal::handle-set-current-modes", G_CALLBACK (handle_set_current_modes), self, + NULL); /* Finally, export the new interface, even if we got errors, but only if not * done already */ - if (!mm_gdbus_object_peek_modem (MM_GDBUS_OBJECT (ctx->self))) - mm_gdbus_object_skeleton_set_modem (MM_GDBUS_OBJECT_SKELETON (ctx->self), + if (!mm_gdbus_object_peek_modem (MM_GDBUS_OBJECT (self))) + mm_gdbus_object_skeleton_set_modem (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM (ctx->skeleton)); - initialization_context_complete_and_free (ctx); + + if (ctx->fatal_error) { + g_task_return_error (task, ctx->fatal_error); + ctx->fatal_error = NULL; + } else + g_task_return_boolean (task, TRUE); + + g_object_unref (task); return; } @@ -4781,7 +5028,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -4792,6 +5039,7 @@ { InitializationContext *ctx; MmGdbusModem *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -4839,29 +5087,21 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void mm_iface_modem_shutdown (MMIfaceModem *self) { - /* Remove SignalQualityCheckContext object to make sure any pending - * invocation of periodic_signal_quality_check is cancelled before - * SignalQualityUpdateContext is removed (as signal_quality_check_ready may - * call update_signal_quality). */ - if (G_LIKELY (signal_quality_check_context_quark)) - g_object_set_qdata (G_OBJECT (self), - signal_quality_check_context_quark, - NULL); + /* Make sure signal polling is disabled. No real need to clear values, as + * we're shutting down the interface anyway. */ + periodic_signal_check_disable (self, FALSE); /* Remove SignalQualityUpdateContext object to make sure any pending * invocation of expire_signal_quality is canceled before the DBus skeleton @@ -4871,14 +5111,6 @@ signal_quality_update_context_quark, NULL); - /* Remove AccessTechnologiesCheckContext object to make sure any pending - * invocation of periodic_access_technologies_check is canceled before the - * DBus skeleton is removed. */ - if (G_LIKELY (access_technologies_check_context_quark)) - g_object_set_qdata (G_OBJECT (self), - access_technologies_check_context_quark, - NULL); - /* Remove running restart initialization idle, if any */ if (G_LIKELY (restart_initialize_idle_quark)) g_object_set_qdata (G_OBJECT (self), @@ -5097,6 +5329,24 @@ return model; } +const gchar * +mm_iface_modem_get_revision (MMIfaceModem *self) +{ + const gchar *revision = NULL; + MmGdbusModem *skeleton; + + g_object_get (self, + MM_IFACE_MODEM_DBUS_SKELETON, &skeleton, + NULL); + + if (skeleton) { + revision = mm_gdbus_modem_get_revision (skeleton); + g_object_unref (skeleton); + } + + return revision; +} + /*****************************************************************************/ static void @@ -5141,6 +5391,30 @@ MM_TYPE_BEARER_LIST, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_boolean (MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED, + "Sim Hot Swap Supported", + "Whether the modem supports sim hot swap or not.", + FALSE, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boolean (MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, + "Sim Hot Swap Configured", + "Whether the sim hot swap support is configured correctly.", + FALSE, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boolean (MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, + "Periodic signal check disabled", + "Whether periodic signal check is disabled.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + initialized = TRUE; } diff -Nru modemmanager-1.6.8/src/mm-iface-modem-cdma.c modemmanager-1.10.0/src/mm-iface-modem-cdma.c --- modemmanager-1.6.8/src/mm-iface-modem-cdma.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-cdma.c 2018-11-15 09:55:53.000000000 +0100 @@ -396,22 +396,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void register_in_network_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->register_in_network_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -420,23 +419,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_cdma_register_in_network); MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->register_in_network ( self, max_registration_time, (GAsyncReadyCallback)register_in_network_ready, - result); + task); } /*****************************************************************************/ typedef struct _RunRegistrationChecksContext RunRegistrationChecksContext; -static void registration_check_step (RunRegistrationChecksContext *ctx); +static void registration_check_step (GTask *task); typedef enum { REGISTRATION_CHECK_STEP_FIRST, @@ -456,8 +453,6 @@ } RegistrationCheckStep; struct _RunRegistrationChecksContext { - MMIfaceModemCdma *self; - GSimpleAsyncResult *result; RegistrationCheckStep step; MMModemCdmaRegistrationState cdma1x_state; MMModemCdmaRegistrationState evdo_state; @@ -483,30 +478,24 @@ guint cdma1x_nid; }; -static void -run_registration_checks_context_complete_and_free (RunRegistrationChecksContext *ctx) -{ - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx); -} - gboolean mm_iface_modem_cdma_run_registration_checks_finish (MMIfaceModemCdma *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_registration_checks_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_registration_checks_finish ( self, res, @@ -517,23 +506,26 @@ &ctx->skip_detailed_registration_state, &error)) { /* Make it fatal */ - g_simple_async_result_take_error (ctx->result, error); - run_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void get_call_manager_state_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_call_manager_state_finish ( self, res, @@ -544,29 +536,32 @@ g_error_free (error); /* Fallback to AT-based check */ ctx->step = REGISTRATION_CHECK_STEP_AT_CDMA_SERVICE_STATUS; - registration_check_step (ctx); + registration_check_step (task); return; } /* If no CDMA service, just finish checks */ if (ctx->call_manager_operating_mode != QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE) { ctx->step = REGISTRATION_CHECK_STEP_LAST; - registration_check_step (ctx); + registration_check_step (task); return; } /* Go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void get_hdr_state_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_hdr_state_finish ( self, res, @@ -578,18 +573,22 @@ g_error_free (error); /* Fallback to AT-based check */ ctx->step = REGISTRATION_CHECK_STEP_AT_CDMA_SERVICE_STATUS; - registration_check_step (ctx); + registration_check_step (task); return; } /* Go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void -parse_qcdm_results (RunRegistrationChecksContext *ctx) +parse_qcdm_results (GTask *task) { + RunRegistrationChecksContext *ctx; + + ctx = g_task_get_task_data (task); + mm_dbg ("QCDM CM System Mode: %d", ctx->call_manager_system_mode); mm_dbg ("QCDM HDR Hybrid Mode: %d", ctx->hdr_hybrid_mode); mm_dbg ("QCDM HDR Session State: %d", ctx->hdr_session_state); @@ -623,24 +622,27 @@ /* If no CDMA service, just finish checks */ ctx->step = REGISTRATION_CHECK_STEP_LAST; - registration_check_step (ctx); + registration_check_step (task); } static void get_service_status_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; gboolean has_service = FALSE; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_service_status_finish (self, res, &has_service, &error)) { mm_warn ("Could not get service status: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - run_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -652,16 +654,19 @@ /* If we do have service, go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void get_cdma1x_serving_system_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + /* Note: used for *both* AT and QCDM serving system checks */ if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system_finish ( @@ -677,8 +682,8 @@ MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK)) { mm_warn ("Could not get serving system: %s", error->message); - g_simple_async_result_take_error (ctx->result, error); - run_registration_checks_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -690,12 +695,16 @@ /* Go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void -parse_at_results (RunRegistrationChecksContext *ctx) +parse_at_results (GTask *task) { + RunRegistrationChecksContext *ctx; + + ctx = g_task_get_task_data (task); + /* 99999 means unknown/no service */ if (ctx->cdma1x_sid == MM_MODEM_CDMA_SID_UNKNOWN && ctx->cdma1x_nid == MM_MODEM_CDMA_NID_UNKNOWN) { @@ -709,18 +718,21 @@ ctx->step = REGISTRATION_CHECK_STEP_DETAILED_REGISTRATION_STATE; } - registration_check_step (ctx); + registration_check_step (task); } static void get_detailed_registration_state_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RunRegistrationChecksContext *ctx) + GTask *task) { + RunRegistrationChecksContext *ctx; GError *error = NULL; MMModemCdmaRegistrationState detailed_cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; MMModemCdmaRegistrationState detailed_evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_detailed_registration_state_finish ( self, res, @@ -737,12 +749,18 @@ /* Go on to next step */ ctx->step++; - registration_check_step (ctx); + registration_check_step (task); } static void -registration_check_step (RunRegistrationChecksContext *ctx) +registration_check_step (GTask *task) { + MMIfaceModemCdma *self; + RunRegistrationChecksContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case REGISTRATION_CHECK_STEP_FIRST: /* Fall down to next step */ @@ -753,12 +771,12 @@ * to specify which of the next steps will be completely skipped. Useful * when implementations have a best get_detailed_registration_state() * so that they just need that to be run. */ - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_registration_checks && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_registration_checks_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_registration_checks ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_registration_checks && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_registration_checks_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_registration_checks ( + self, (GAsyncReadyCallback)setup_registration_checks_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -767,31 +785,31 @@ case REGISTRATION_CHECK_STEP_QCDM_CALL_MANAGER_STATE: mm_dbg ("Starting QCDM-based registration checks"); if (!ctx->skip_qcdm_call_manager_step && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_call_manager_state && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_call_manager_state_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_call_manager_state && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_call_manager_state_finish) { /* Start by trying to get the call manager state. */ - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_call_manager_state ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_call_manager_state ( + self, (GAsyncReadyCallback)get_call_manager_state_ready, - ctx); + task); return; } /* Fallback to AT-based check */ mm_dbg (" Skipping all QCDM-based checks and falling back to AT-based checks"); ctx->step = REGISTRATION_CHECK_STEP_AT_CDMA_SERVICE_STATUS; - registration_check_step (ctx); + registration_check_step (task); return; case REGISTRATION_CHECK_STEP_QCDM_HDR_STATE: if (ctx->evdo_supported && !ctx->skip_qcdm_hdr_step && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_hdr_state && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_hdr_state_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_hdr_state && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_hdr_state_finish) { /* Get HDR (EVDO) state. */ - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_hdr_state ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_hdr_state ( + self, (GAsyncReadyCallback)get_hdr_state_ready, - ctx); + task); return; } mm_dbg (" Skipping HDR check"); @@ -802,12 +820,12 @@ /* We only care about SID/NID here; nothing to do with registration * state. */ - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system ( + self, (GAsyncReadyCallback)get_cdma1x_serving_system_ready, - ctx); + task); return; } mm_dbg (" Skipping CDMA1x Serving System check"); @@ -816,7 +834,7 @@ case REGISTRATION_CHECK_STEP_QCDM_LAST: /* When we get all QCDM results, parse them */ - parse_qcdm_results (ctx); + parse_qcdm_results (task); return; case REGISTRATION_CHECK_STEP_AT_CDMA_SERVICE_STATUS: @@ -825,12 +843,12 @@ /* If we don't have means to get service status, just assume we do have * CDMA service and keep on */ if (!ctx->skip_at_cdma_service_status_step && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_service_status && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_service_status_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_service_status ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_service_status && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_service_status_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_service_status ( + self, (GAsyncReadyCallback)get_service_status_ready, - ctx); + task); return; } mm_dbg (" Skipping CDMA service status check, assuming with service"); @@ -849,12 +867,12 @@ * themselves; if they do, they'll set these callbacks to NULL.. */ if (!ctx->skip_at_cdma1x_serving_system_step && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_cdma1x_serving_system ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_cdma1x_serving_system ( + self, (GAsyncReadyCallback)get_cdma1x_serving_system_ready, - ctx); + task); return; } mm_dbg (" Skipping CDMA1x Serving System check"); @@ -863,7 +881,7 @@ case REGISTRATION_CHECK_STEP_AT_LAST: /* When we get all AT results, parse them */ - parse_at_results (ctx); + parse_at_results (task); return; case REGISTRATION_CHECK_STEP_DETAILED_REGISTRATION_STATE: @@ -871,18 +889,18 @@ /* We let classes implementing this interface to look for more detailed * registration info. */ if (!ctx->skip_detailed_registration_state && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_detailed_registration_state && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_detailed_registration_state_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_detailed_registration_state && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_detailed_registration_state_finish) { /* We pass the CDMA1x/EVDO registration states we got up to now. * If the implementation can't improve the detail, it must either * return the values it already got as input, or issue an error, * and we'll assume it couldn't get any better value. */ - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->get_detailed_registration_state ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->get_detailed_registration_state ( + self, ctx->cdma1x_state, ctx->evdo_state, (GAsyncReadyCallback)get_detailed_registration_state_ready, - ctx); + task); return; } mm_dbg (" Skipping detailed registration state check"); @@ -892,15 +910,15 @@ case REGISTRATION_CHECK_STEP_LAST: /* We are done without errors! */ mm_dbg ("All CDMA registration state checks done"); - mm_iface_modem_cdma_update_cdma1x_registration_state (ctx->self, + mm_iface_modem_cdma_update_cdma1x_registration_state (self, ctx->cdma1x_state, ctx->cdma1x_sid, ctx->cdma1x_nid); - mm_iface_modem_cdma_update_evdo_registration_state (ctx->self, + mm_iface_modem_cdma_update_evdo_registration_state (self, ctx->evdo_state); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - run_registration_checks_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -910,16 +928,15 @@ static void custom_run_registration_checks_ready (MMIfaceModemCdma *self, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GError *error = NULL; if (!MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->run_registration_checks_finish (self, res, &error)) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -927,14 +944,11 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; gboolean cdma1x_supported; gboolean evdo_supported; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_cdma_run_registration_checks); + task = g_task_new (self, NULL, callback, user_data); g_object_get (self, MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED, &evdo_supported, @@ -967,13 +981,11 @@ cdma1x_supported, evdo_supported, (GAsyncReadyCallback)custom_run_registration_checks_ready, - result); + task); } else { RunRegistrationChecksContext *ctx; ctx = g_new0 (RunRegistrationChecksContext, 1); - ctx->self = g_object_ref (self); - ctx->result = result; ctx->cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; ctx->evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; ctx->call_manager_system_mode = QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_NO_SERVICE; @@ -983,7 +995,9 @@ ctx->evdo_supported = evdo_supported; ctx->cdma1x_supported = cdma1x_supported; - registration_check_step (ctx); + g_task_set_task_data (task, ctx, g_free); + + registration_check_step (task); } } @@ -1257,7 +1271,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -1268,18 +1282,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemCdma *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemCdma *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -1290,14 +1299,15 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disable_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); @@ -1307,15 +1317,17 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void cleanup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); @@ -1325,42 +1337,49 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemCdma *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; case DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS: - periodic_registration_check_disable (ctx->self); + periodic_registration_check_disable (self); /* Fall down to next step */ ctx->step++; case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1368,8 +1387,8 @@ case DISABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1382,33 +1401,34 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_cdma_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + + g_object_get (self, MM_IFACE_MODEM_CDMA_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -1419,52 +1439,32 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemCdma *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemCdma *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_cdma_enable_finish (MMIfaceModemCdma *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); @@ -1475,15 +1475,17 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModemCdma *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->enable_unsolicited_events_finish (self, res, &error); @@ -1494,16 +1496,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemCdma *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -1511,38 +1522,38 @@ ctx->step++; case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: - if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case ENABLING_STEP_PERIODIC_REGISTRATION_CHECKS: - periodic_registration_check_enable (ctx->self); + periodic_registration_check_enable (self); /* Fall down to next step */ ctx->step++; case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1556,34 +1567,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_cdma_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_CDMA_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -1594,48 +1604,30 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemCdma *self; MmGdbusModemCdma *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - #undef STR_REPLY_READY_FN #define STR_REPLY_READY_FN(NAME,DISPLAY) \ static void \ load_##NAME##_ready (MMIfaceModemCdma *self, \ GAsyncResult *res, \ - InitializationContext *ctx) \ + GTask *task) \ { \ + InitializationContext *ctx; \ GError *error = NULL; \ gchar *val; \ \ + ctx = g_task_get_task_data (task); \ + \ val = MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_##NAME##_finish (self, res, &error); \ mm_gdbus_modem_cdma_set_##NAME (ctx->skeleton, val); \ g_free (val); \ @@ -1647,7 +1639,7 @@ \ /* Go on to next step */ \ ctx->step++; \ - interface_initialization_step (ctx); \ + interface_initialization_step (task); \ } STR_REPLY_READY_FN (meid, "MEID") @@ -1656,11 +1648,14 @@ static void load_activation_state_ready (MMIfaceModemCdma *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; MMModemCdmaActivationState state; + ctx = g_task_get_task_data (task); + state = MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_activation_state_finish (self, res, &error); mm_gdbus_modem_cdma_set_activation_state (ctx->skeleton, state); @@ -1671,15 +1666,23 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemCdma *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -1691,12 +1694,12 @@ * lifetime of the modem. Therefore, if we already have it loaded, * don't try to load it again. */ if (!mm_gdbus_modem_cdma_get_meid (ctx->skeleton) && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_meid && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_meid_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_meid ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_meid && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_meid_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_meid ( + self, (GAsyncReadyCallback)load_meid_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1707,12 +1710,12 @@ * lifetime of the modem. Therefore, if we already have it loaded, * don't try to load it again. */ if (!mm_gdbus_modem_cdma_get_esn (ctx->skeleton) && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_esn && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_esn_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_esn ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_esn && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_esn_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_esn ( + self, (GAsyncReadyCallback)load_esn_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1723,12 +1726,12 @@ * whole lifetime of the modem. Therefore, if we already have it loaded, * don't try to load it again. */ if (mm_gdbus_modem_cdma_get_activation_state (ctx->skeleton) == MM_MODEM_CDMA_ACTIVATION_STATE_UNKNOWN && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_activation_state && - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_activation_state_finish) { - MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->load_activation_state ( - ctx->self, + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_activation_state && + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_activation_state_finish) { + MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->load_activation_state ( + self, (GAsyncReadyCallback)load_activation_state_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1741,18 +1744,18 @@ g_signal_connect (ctx->skeleton, "handle-activate", G_CALLBACK (handle_activate), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-activate-manual", G_CALLBACK (handle_activate_manual), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_cdma (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_cdma (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_CDMA (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1764,7 +1767,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -1775,6 +1778,7 @@ { InitializationContext *ctx; MmGdbusModemCdma *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -1806,16 +1810,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_cdma_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-firmware.c modemmanager-1.10.0/src/mm-iface-modem-firmware.c --- modemmanager-1.6.8/src/mm-iface-modem-firmware.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-firmware.c 2019-01-15 15:57:35.000000000 +0100 @@ -21,12 +21,6 @@ #include "mm-iface-modem-firmware.h" #include "mm-log.h" -#define SUPPORT_CHECKED_TAG "firmware-support-checked-tag" -#define SUPPORTED_TAG "firmware-supported-tag" - -static GQuark support_checked_quark; -static GQuark supported_quark; - /*****************************************************************************/ void @@ -50,7 +44,7 @@ handle_list_context_free (HandleListContext *ctx) { if (ctx->list) - g_list_free_full (ctx->list, (GDestroyNotify)g_object_unref); + g_list_free_full (ctx->list, g_object_unref); if (ctx->current) g_object_unref (ctx->current); g_object_unref (ctx->skeleton); @@ -68,16 +62,20 @@ GList *l; GError *error = NULL; - /* reported current may be NULL and we don't treat it as error */ ctx->current = MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current_finish (self, res, &error); - if (error) { - g_dbus_method_invocation_take_error (ctx->invocation, error); - handle_list_context_free (ctx); - return; + if (!ctx->current) { + /* Not found isn't fatal */ + if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_list_context_free (ctx); + return; + } + mm_dbg ("Couldn't load current firmware image: %s", error->message); + g_clear_error (&error); } /* Build array of dicts */ - g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}")); for (l = ctx->list; l; l = g_list_next (l)) g_variant_builder_add_value ( &builder, @@ -99,10 +97,15 @@ GError *error = NULL; ctx->list = MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list_finish (self, res, &error); - if (error) { - g_dbus_method_invocation_take_error (ctx->invocation, error); - handle_list_context_free (ctx); - return; + if (!ctx->list) { + /* Not found isn't fatal */ + if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_list_context_free (ctx); + return; + } + mm_dbg ("Couldn't load firmware image list: %s", error->message); + g_clear_error (&error); } MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current (MM_IFACE_MODEM_FIRMWARE (self), @@ -123,6 +126,18 @@ return; } + if (!MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list || + !MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list_finish || + !MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current || + !MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current_finish) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot list firmware: operation not supported"); + handle_list_context_free (ctx); + return; + } + MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list (MM_IFACE_MODEM_FIRMWARE (self), (GAsyncReadyCallback)load_list_ready, ctx); @@ -135,11 +150,6 @@ { HandleListContext *ctx; - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list != NULL); - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list_finish != NULL); - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current != NULL); - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current_finish != NULL); - ctx = g_slice_new (HandleListContext); ctx->skeleton = g_object_ref (skeleton); ctx->invocation = g_object_ref (invocation); @@ -201,6 +211,17 @@ return; } + + if (!MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->change_current || + !MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->change_current_finish) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot select firmware: operation not supported"); + handle_select_context_free (ctx); + return; + } + MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->change_current (MM_IFACE_MODEM_FIRMWARE (self), ctx->name, (GAsyncReadyCallback)change_current_ready, @@ -215,9 +236,6 @@ { HandleSelectContext *ctx; - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->change_current != NULL); - g_assert (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->change_current_finish != NULL); - ctx = g_slice_new (HandleSelectContext); ctx->skeleton = g_object_ref (skeleton); ctx->invocation = g_object_ref (invocation); @@ -236,130 +254,175 @@ /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, - INITIALIZATION_STEP_CHECK_SUPPORT, - INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED, + INITIALIZATION_STEP_UPDATE_SETTINGS, INITIALIZATION_STEP_LAST } InitializationStep; struct _InitializationContext { - MMIfaceModemFirmware *self; MmGdbusModemFirmware *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; - InitializationStep step; + InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) +gboolean +mm_iface_modem_firmware_initialize_finish (MMIfaceModemFirmware *self, + GAsyncResult *res, + GError **error) { - if (!g_cancellable_is_cancelled (ctx->cancellable)) + return g_task_propagate_boolean (G_TASK (res), error); +} + +static gboolean +add_generic_version (MMBaseModem *self, + MMFirmwareUpdateSettings *update_settings, + GError **error) +{ + const gchar *revision; + + revision = mm_iface_modem_get_revision (MM_IFACE_MODEM (self)); + if (!revision) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown revision"); return FALSE; + } - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); + mm_firmware_update_settings_set_version (update_settings, revision); + return TRUE; +} + +static gboolean +add_generic_device_ids (MMBaseModem *self, + MMFirmwareUpdateSettings *update_settings, + GError **error) +{ + guint16 vid; + guint16 pid; + guint16 rid; + GPtrArray *ids; + MMPort *primary = NULL; + const gchar *subsystem; + + vid = mm_base_modem_get_vendor_id (self); + pid = mm_base_modem_get_product_id (self); + +#if defined WITH_QMI + primary = MM_PORT (mm_base_modem_peek_port_qmi (self)); +#endif +#if defined WITH_MBIM + if (!primary) + primary = MM_PORT (mm_base_modem_peek_port_mbim (self)); +#endif + if (!primary) + primary = MM_PORT (mm_base_modem_peek_port_primary (self)); + g_assert (primary != NULL); + rid = mm_kernel_device_get_physdev_revision (mm_port_peek_kernel_device (primary)); + + subsystem = mm_kernel_device_get_physdev_subsystem (mm_port_peek_kernel_device (primary)); + if (g_strcmp0 (subsystem, "usb")) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unsupported subsystem: %s", subsystem); + return FALSE; + } + + ids = g_ptr_array_new_with_free_func ((GDestroyNotify)g_free); + g_ptr_array_add (ids, g_strdup_printf ("USB\\VID_%04X&PID_%04X&REV_%04X", vid, pid, rid)); + g_ptr_array_add (ids, g_strdup_printf ("USB\\VID_%04X&PID_%04X", vid, pid)); + g_ptr_array_add (ids, g_strdup_printf ("USB\\VID_%04X", vid)); + g_ptr_array_add (ids, NULL); + + mm_firmware_update_settings_set_device_ids (update_settings, (const gchar **)ids->pdata); + g_ptr_array_unref (ids); return TRUE; } static void -check_support_ready (MMIfaceModemFirmware *self, - GAsyncResult *res, - InitializationContext *ctx) -{ - GError *error = NULL; +load_update_settings_ready (MMIfaceModemFirmware *self, + GAsyncResult *res, + GTask *task) +{ + InitializationContext *ctx; + MMFirmwareUpdateSettings *update_settings; + GError *error = NULL; + GVariant *variant = NULL; + + ctx = g_task_get_task_data (task); + + update_settings = MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_update_settings_finish (self, res, &error); + if (!update_settings) { + mm_dbg ("Couldn't load update settings: '%s'", error->message); + g_error_free (error); + goto out; + } - if (!MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->check_support_finish (self, - res, - &error)) { - if (error) { - /* This error shouldn't be treated as critical */ - mm_dbg ("Firmware support check failed: '%s'", error->message); - g_error_free (error); - } - } else { - /* Firmware is supported! */ - g_object_set_qdata (G_OBJECT (self), - supported_quark, - GUINT_TO_POINTER (TRUE)); + /* If the plugin didn't specify custom device ids, add the default ones ourselves */ + if (!mm_firmware_update_settings_get_device_ids (update_settings) && + !add_generic_device_ids (MM_BASE_MODEM (self), update_settings, &error)) { + mm_warn ("Couldn't build device ids: '%s'", error->message); + g_error_free (error); + g_clear_object (&update_settings); + goto out; + } + + /* If the plugin didn't specify custom version, add the default one ourselves */ + if (!mm_firmware_update_settings_get_version (update_settings) && + !add_generic_version (MM_BASE_MODEM (self), update_settings, &error)) { + mm_warn ("Couldn't set version: '%s'", error->message); + g_error_free (error); + g_clear_object (&update_settings); + goto out; } +out: + if (update_settings) { + variant = mm_firmware_update_settings_get_variant (update_settings); + g_object_unref (update_settings); + } + mm_gdbus_modem_firmware_set_update_settings (ctx->skeleton, variant); + if (variant) + g_variant_unref (variant); + /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemFirmware *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: - /* Setup quarks if we didn't do it before */ - if (G_UNLIKELY (!support_checked_quark)) - support_checked_quark = (g_quark_from_static_string ( - SUPPORT_CHECKED_TAG)); - if (G_UNLIKELY (!supported_quark)) - supported_quark = (g_quark_from_static_string ( - SUPPORTED_TAG)); - - /* Fall down to next step */ - ctx->step++; - - case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), - support_checked_quark))) { - /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), - support_checked_quark, - GUINT_TO_POINTER (TRUE)); - /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), - supported_quark, - GUINT_TO_POINTER (FALSE)); - - if (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, - (GAsyncReadyCallback)check_support_ready, - ctx); - return; - } - - /* If there is no implementation to check support, assume we DON'T - * support it. */ - } /* Fall down to next step */ ctx->step++; - case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), - supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Firmware interface not available"); - initialization_context_complete_and_free (ctx); + case INITIALIZATION_STEP_UPDATE_SETTINGS: + if (MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_update_settings && + MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_update_settings_finish) { + MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_update_settings ( + self, + (GAsyncReadyCallback)load_update_settings_ready, + task); return; } /* Fall down to next step */ @@ -369,43 +432,32 @@ /* We are done without errors! */ /* Handle method invocations */ - g_signal_connect (ctx->skeleton, - "handle-list", - G_CALLBACK (handle_list), - ctx->self); - g_signal_connect (ctx->skeleton, - "handle-select", - G_CALLBACK (handle_select), - ctx->self); + g_object_connect (ctx->skeleton, + "signal::handle-list", G_CALLBACK (handle_list), self, + "signal::handle-select", G_CALLBACK (handle_select), self, + NULL); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_firmware (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_firmware (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_FIRMWARE (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } g_assert_not_reached (); } -gboolean -mm_iface_modem_firmware_initialize_finish (MMIfaceModemFirmware *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - void mm_iface_modem_firmware_initialize (MMIfaceModemFirmware *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { InitializationContext *ctx; - MmGdbusModemFirmware *skeleton = NULL; + MmGdbusModemFirmware *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -419,18 +471,14 @@ } /* Perform async initialization here */ - ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_firmware_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-firmware.h modemmanager-1.10.0/src/mm-iface-modem-firmware.h --- modemmanager-1.6.8/src/mm-iface-modem-firmware.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-firmware.h 2019-01-15 15:57:35.000000000 +0100 @@ -34,13 +34,13 @@ struct _MMIfaceModemFirmware { GTypeInterface g_iface; - /* Check for Firmware support (async) */ - void (* check_support) (MMIfaceModemFirmware *self, - GAsyncReadyCallback callback, - gpointer user_data); - gboolean (* check_support_finish) (MMIfaceModemFirmware *self, - GAsyncResult *res, - GError **error); + /* Get update settings (async) */ + void (* load_update_settings) (MMIfaceModemFirmware *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMFirmwareUpdateSettings * (* load_update_settings_finish) (MMIfaceModemFirmware *self, + GAsyncResult *res, + GError **error); /* Get Firmware list (async) */ void (* load_list) (MMIfaceModemFirmware *self, diff -Nru modemmanager-1.6.8/src/mm-iface-modem.h modemmanager-1.10.0/src/mm-iface-modem.h --- modemmanager-1.6.8/src/mm-iface-modem.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem.h 2019-01-15 15:57:35.000000000 +0100 @@ -32,10 +32,13 @@ #define MM_IS_IFACE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM)) #define MM_IFACE_MODEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM, MMIfaceModem)) -#define MM_IFACE_MODEM_DBUS_SKELETON "iface-modem-dbus-skeleton" -#define MM_IFACE_MODEM_STATE "iface-modem-state" -#define MM_IFACE_MODEM_SIM "iface-modem-sim" -#define MM_IFACE_MODEM_BEARER_LIST "iface-modem-bearer-list" +#define MM_IFACE_MODEM_DBUS_SKELETON "iface-modem-dbus-skeleton" +#define MM_IFACE_MODEM_STATE "iface-modem-state" +#define MM_IFACE_MODEM_SIM "iface-modem-sim" +#define MM_IFACE_MODEM_BEARER_LIST "iface-modem-bearer-list" +#define MM_IFACE_MODEM_SIM_HOT_SWAP_SUPPORTED "iface-modem-sim-hot-swap-supported" +#define MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED "iface-modem-sim-hot-swap-configured" +#define MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED "iface-modem-periodic-signal-check-disabled" typedef struct _MMIfaceModem MMIfaceModem; @@ -82,6 +85,14 @@ GAsyncResult *res, GError **error); + /* Loading of the HardwareRevision property */ + void (*load_hardware_revision) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gchar * (*load_hardware_revision_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + /* Loading of the EquipmentIdentifier property */ void (*load_equipment_identifier) (MMIfaceModem *self, GAsyncReadyCallback callback, @@ -271,6 +282,16 @@ GAsyncResult *res, GError **error); + /* Asynchronous check to see if the SIM was swapped. + * Useful for when the modem changes power states since we might + * not get the relevant notifications from the modem. */ + void (*check_for_sim_swap) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*check_for_sim_swap_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + /* Asynchronous flow control setup */ void (*setup_flow_control) (MMIfaceModem *self, GAsyncReadyCallback callback, @@ -327,6 +348,14 @@ MMBaseBearer * (*create_bearer_finish) (MMIfaceModem *self, GAsyncResult *res, GError **error); + /* Setup SIM hot swap */ + void (*setup_sim_hot_swap) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + + gboolean (*setup_sim_hot_swap_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); }; GType mm_iface_modem_get_type (void); @@ -351,8 +380,9 @@ gboolean mm_iface_modem_is_4g (MMIfaceModem *self); gboolean mm_iface_modem_is_4g_only (MMIfaceModem *self); -/* Helper to query model */ -const gchar *mm_iface_modem_get_model (MMIfaceModem *self); +/* Helpers to query properties */ +const gchar *mm_iface_modem_get_model (MMIfaceModem *self); +const gchar *mm_iface_modem_get_revision (MMIfaceModem *self); /* Initialize Modem interface (async) */ void mm_iface_modem_initialize (MMIfaceModem *self, @@ -404,6 +434,11 @@ GAsyncResult *res, GError **error); +MMUnlockRetries *mm_iface_modem_get_unlock_retries (MMIfaceModem *self); + +void mm_iface_modem_update_unlock_retries (MMIfaceModem *self, + MMUnlockRetries *unlock_retries); + /* Request signal quality check update. * It will not only return the signal quality status, but also set the property * values in the DBus interface. */ @@ -435,13 +470,13 @@ MMModemAccessTechnology access_tech, guint32 mask); -/* Allow requesting to refresh access tech */ -void mm_iface_modem_refresh_access_technologies (MMIfaceModem *self); - /* Allow updating signal quality */ void mm_iface_modem_update_signal_quality (MMIfaceModem *self, guint signal_quality); +/* Allow requesting to refresh signal via polling */ +void mm_iface_modem_refresh_signal (MMIfaceModem *self); + /* Allow setting allowed modes */ void mm_iface_modem_set_current_modes (MMIfaceModem *self, MMModemMode allowed, diff -Nru modemmanager-1.6.8/src/mm-iface-modem-location.c modemmanager-1.10.0/src/mm-iface-modem-location.c --- modemmanager-1.6.8/src/mm-iface-modem-location.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-location.c 2019-01-15 15:57:35.000000000 +0100 @@ -21,6 +21,7 @@ #include "mm-iface-modem.h" #include "mm-iface-modem-location.h" #include "mm-log.h" +#include "mm-modem-helpers.h" #define MM_LOCATION_GPS_REFRESH_TIME_SECS 30 @@ -289,11 +290,12 @@ dbus_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (self)); mm_dbg ("Modem %s: 3GPP location updated " - "(MCC: '%u', MNC: '%u', Location area code: '%lX', Cell ID: '%lX')", + "(MCC: '%u', MNC: '%u', Location area code: '%lX', Tracking area code: '%lX', Cell ID: '%lX')", dbus_path, mm_location_3gpp_get_mobile_country_code (location_3gpp), mm_location_3gpp_get_mobile_network_code (location_3gpp), mm_location_3gpp_get_location_area_code (location_3gpp), + mm_location_3gpp_get_tracking_area_code (location_3gpp), mm_location_3gpp_get_cell_id (location_3gpp)); /* We only update the property if we are supposed to signal @@ -338,9 +340,10 @@ } void -mm_iface_modem_location_3gpp_update_lac_ci (MMIfaceModemLocation *self, - gulong location_area_code, - gulong cell_id) +mm_iface_modem_location_3gpp_update_lac_tac_ci (MMIfaceModemLocation *self, + gulong location_area_code, + gulong tracking_area_code, + gulong cell_id) { MmGdbusModemLocation *skeleton; LocationContext *ctx; @@ -356,10 +359,9 @@ guint changed = 0; g_assert (ctx->location_3gpp != NULL); - changed += mm_location_3gpp_set_location_area_code (ctx->location_3gpp, - location_area_code); - changed += mm_location_3gpp_set_cell_id (ctx->location_3gpp, - cell_id); + changed += mm_location_3gpp_set_location_area_code (ctx->location_3gpp, location_area_code); + changed += mm_location_3gpp_set_tracking_area_code (ctx->location_3gpp, tracking_area_code); + changed += mm_location_3gpp_set_cell_id (ctx->location_3gpp, cell_id); if (changed) notify_3gpp_location_update (self, skeleton, ctx->location_3gpp); } @@ -381,14 +383,8 @@ return; if (mm_gdbus_modem_location_get_enabled (skeleton) & MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI) { - guint changed = 0; - g_assert (ctx->location_3gpp != NULL); - changed += mm_location_3gpp_set_location_area_code (ctx->location_3gpp, 0); - changed += mm_location_3gpp_set_cell_id (ctx->location_3gpp, 0); - changed += mm_location_3gpp_set_mobile_country_code (ctx->location_3gpp, 0); - changed += mm_location_3gpp_set_mobile_network_code (ctx->location_3gpp, 0); - if (changed) + if (mm_location_3gpp_reset (ctx->location_3gpp)) notify_3gpp_location_update (self, skeleton, ctx->location_3gpp); } @@ -524,24 +520,19 @@ /*****************************************************************************/ typedef struct { - MMIfaceModemLocation *self; MmGdbusModemLocation *skeleton; - GSimpleAsyncResult *result; MMModemLocationSource to_enable; MMModemLocationSource to_disable; MMModemLocationSource current; } SetupGatheringContext; -static void setup_gathering_step (SetupGatheringContext *ctx); +static void setup_gathering_step (GTask *task); static void -setup_gathering_context_complete_and_free (SetupGatheringContext *ctx) +setup_gathering_context_free (SetupGatheringContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); - g_object_unref (ctx->self); g_free (ctx); } @@ -550,72 +541,84 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void enable_location_gathering_ready (MMIfaceModemLocation *self, GAsyncResult *res, - SetupGatheringContext *ctx) + GTask *task) { + SetupGatheringContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->enable_location_gathering_finish (self, res, &error)) { gchar *str; - update_location_source_status (ctx->self, ctx->current, FALSE); + update_location_source_status (self, ctx->current, FALSE); str = mm_modem_location_source_build_string_from_mask (ctx->current); g_prefix_error (&error, "Couldn't enable location '%s' gathering: ", str); - g_simple_async_result_take_error (ctx->result, error); - setup_gathering_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_free (str); return; } /* Keep on with next ones... */ ctx->current = ctx->current << 1; - setup_gathering_step (ctx); + setup_gathering_step (task); } static void disable_location_gathering_ready (MMIfaceModemLocation *self, GAsyncResult *res, - SetupGatheringContext *ctx) + GTask *task) { + SetupGatheringContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->disable_location_gathering_finish (self, res, &error)) { gchar *str; /* Back to enabled then */ - update_location_source_status (ctx->self, ctx->current, TRUE); + update_location_source_status (self, ctx->current, TRUE); str = mm_modem_location_source_build_string_from_mask (ctx->current); g_prefix_error (&error, "Couldn't disable location '%s' gathering: ", str); - g_simple_async_result_take_error (ctx->result, error); - setup_gathering_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); g_free (str); return; } /* Keep on with next ones... */ ctx->current = ctx->current << 1; - setup_gathering_step (ctx); + setup_gathering_step (task); } static void -setup_gathering_step (SetupGatheringContext *ctx) +setup_gathering_step (GTask *task) { + MMIfaceModemLocation *self; + SetupGatheringContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Are we done? */ if (ctx->to_enable == MM_MODEM_LOCATION_SOURCE_NONE && ctx->to_disable == MM_MODEM_LOCATION_SOURCE_NONE) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - setup_gathering_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -630,16 +633,16 @@ * specific actions to enable the gathering, so that we are * able to get location updates while the gathering gets * enabled. */ - update_location_source_status (ctx->self, ctx->current, TRUE); + update_location_source_status (self, ctx->current, TRUE); /* Plugins can run custom actions to enable location gathering */ - if (MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->enable_location_gathering && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->enable_location_gathering_finish) { - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->enable_location_gathering ( - MM_IFACE_MODEM_LOCATION (ctx->self), + if (MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->enable_location_gathering && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->enable_location_gathering_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->enable_location_gathering ( + MM_IFACE_MODEM_LOCATION (self), ctx->current, (GAsyncReadyCallback)enable_location_gathering_ready, - ctx); + task); return; } @@ -650,16 +653,16 @@ /* Remove from mask */ ctx->to_disable &= ~ctx->current; - update_location_source_status (ctx->self, ctx->current, FALSE); + update_location_source_status (self, ctx->current, FALSE); /* Plugins can run custom actions to disable location gathering */ - if (MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->disable_location_gathering && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->disable_location_gathering_finish) { - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->disable_location_gathering ( - MM_IFACE_MODEM_LOCATION (ctx->self), + if (MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->disable_location_gathering && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->disable_location_gathering_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->disable_location_gathering ( + MM_IFACE_MODEM_LOCATION (self), ctx->current, (GAsyncReadyCallback)disable_location_gathering_ready, - ctx); + task); return; } @@ -675,7 +678,7 @@ /* We just need to finish now */ g_assert (ctx->to_enable == MM_MODEM_LOCATION_SOURCE_NONE); g_assert (ctx->to_disable == MM_MODEM_LOCATION_SOURCE_NONE); - setup_gathering_step (ctx); + setup_gathering_step (task); } static void @@ -685,25 +688,25 @@ gpointer user_data) { SetupGatheringContext *ctx; + GTask *task; MMModemLocationSource currently_enabled; MMModemLocationSource source; gchar *str; ctx = g_new (SetupGatheringContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - setup_gathering); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)setup_gathering_context_free); + g_object_get (self, MM_IFACE_MODEM_LOCATION_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - setup_gathering_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } @@ -749,11 +752,11 @@ currently_enabled & MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED) || (ctx->to_enable & (MM_MODEM_LOCATION_SOURCE_GPS_RAW | MM_MODEM_LOCATION_SOURCE_GPS_NMEA) && ctx->to_enable & MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Cannot have both unmanaged GPS and raw/nmea GPS enabled at the same time"); - setup_gathering_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot have both unmanaged GPS and raw/nmea GPS enabled at the same time"); + g_object_unref (task); return; } @@ -771,7 +774,7 @@ /* Start enabling/disabling location sources */ ctx->current = MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI; - setup_gathering_step (ctx); + setup_gathering_step (task); } /*****************************************************************************/ @@ -983,6 +986,13 @@ return; } + /* Validate SUPL address string: either FQDN:PORT or IP:PORT */ + if (!mm_parse_supl_address (ctx->supl, NULL, NULL, NULL, &error)) { + g_dbus_method_invocation_return_gerror (ctx->invocation, error); + handle_set_supl_server_context_free (ctx); + return; + } + /* Check if plugin implements it */ if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->set_supl_server || !MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->set_supl_server_finish) { @@ -1026,6 +1036,108 @@ /*****************************************************************************/ typedef struct { + MmGdbusModemLocation *skeleton; + GDBusMethodInvocation *invocation; + MMIfaceModemLocation *self; + GVariant *datav; +} HandleInjectAssistanceDataContext; + +static void +handle_inject_assistance_data_context_free (HandleInjectAssistanceDataContext *ctx) +{ + g_object_unref (ctx->skeleton); + g_object_unref (ctx->invocation); + g_object_unref (ctx->self); + g_variant_unref (ctx->datav); + g_slice_free (HandleInjectAssistanceDataContext, ctx); +} + +static void +inject_assistance_data_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + HandleInjectAssistanceDataContext *ctx) +{ + GError *error = NULL; + + if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->inject_assistance_data_finish (self, res, &error)) + g_dbus_method_invocation_take_error (ctx->invocation, error); + else + mm_gdbus_modem_location_complete_inject_assistance_data (ctx->skeleton, ctx->invocation); + + handle_inject_assistance_data_context_free (ctx); +} + +static void +handle_inject_assistance_data_auth_ready (MMBaseModem *self, + GAsyncResult *res, + HandleInjectAssistanceDataContext *ctx) +{ + GError *error = NULL; + const guint8 *data; + gsize data_size; + + if (!mm_base_modem_authorize_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + handle_inject_assistance_data_context_free (ctx); + return; + } + + /* If the type is NOT supported, set error */ + if (mm_gdbus_modem_location_get_supported_assistance_data (ctx->skeleton) == MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot inject assistance data: ununsupported"); + handle_inject_assistance_data_context_free (ctx); + return; + } + + /* Check if plugin implements it */ + if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->inject_assistance_data || + !MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->inject_assistance_data_finish) { + g_dbus_method_invocation_return_error (ctx->invocation, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Cannot inject assistance data: not implemented"); + handle_inject_assistance_data_context_free (ctx); + return; + } + + data = (const guint8 *) g_variant_get_fixed_array (ctx->datav, &data_size, sizeof (guint8)); + + /* Request to inject assistance data */ + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->inject_assistance_data (ctx->self, + data, + data_size, + (GAsyncReadyCallback)inject_assistance_data_ready, + ctx); +} + +static gboolean +handle_inject_assistance_data (MmGdbusModemLocation *skeleton, + GDBusMethodInvocation *invocation, + GVariant *datav, + MMIfaceModemLocation *self) +{ + HandleInjectAssistanceDataContext *ctx; + + ctx = g_slice_new (HandleInjectAssistanceDataContext); + ctx->skeleton = g_object_ref (skeleton); + ctx->invocation = g_object_ref (invocation); + ctx->self = g_object_ref (self); + ctx->datav = g_variant_ref (datav); + + mm_base_modem_authorize (MM_BASE_MODEM (self), + invocation, + MM_AUTHORIZATION_DEVICE_CONTROL, + (GAsyncReadyCallback)handle_inject_assistance_data_auth_ready, + ctx); + return TRUE; +} + +/*****************************************************************************/ + +typedef struct { MmGdbusModemLocation *skeleton; GDBusMethodInvocation *invocation; MMIfaceModemLocation *self; @@ -1189,7 +1301,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -1198,18 +1310,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemLocation *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemLocation *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -1220,47 +1327,55 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disabling_location_gathering_ready (MMIfaceModemLocation *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; if (!setup_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemLocation *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; case DISABLING_STEP_DISABLE_GATHERING: - setup_gathering (ctx->self, + setup_gathering (self, MM_MODEM_LOCATION_SOURCE_NONE, (GAsyncReadyCallback)disabling_location_gathering_ready, - ctx); + task); return; case DISABLING_STEP_LAST: /* We are done without errors! */ - clear_location_context (ctx->self); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + clear_location_context (self); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1273,33 +1388,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_location_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_LOCATION_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -1308,71 +1423,60 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemLocation *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemLocation *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_location_enable_finish (MMIfaceModemLocation *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void enabling_location_gathering_ready (MMIfaceModemLocation *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; if (!setup_gathering_finish (self, res, &error)) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemLocation *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -1389,17 +1493,17 @@ MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED | MM_MODEM_LOCATION_SOURCE_AGPS); - setup_gathering (ctx->self, + setup_gathering (self, default_sources, (GAsyncReadyCallback)enabling_location_gathering_ready, - ctx); + task); return; } case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1413,85 +1517,117 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_location_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_LOCATION_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, INITIALIZATION_STEP_CAPABILITIES, INITIALIZATION_STEP_VALIDATE_CAPABILITIES, INITIALIZATION_STEP_SUPL_SERVER, + INITIALIZATION_STEP_SUPPORTED_ASSISTANCE_DATA, + INITIALIZATION_STEP_ASSISTANCE_DATA_SERVERS, INITIALIZATION_STEP_GPS_REFRESH_RATE, INITIALIZATION_STEP_LAST } InitializationStep; struct _InitializationContext { - MMIfaceModemLocation *self; MmGdbusModemLocation *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializationStep step; MMModemLocationSource capabilities; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) +static void +load_assistance_data_servers_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) { - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; + GError *error = NULL; + InitializationContext *ctx; + gchar **servers; - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; + ctx = g_task_get_task_data (task); + + servers = MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_assistance_data_servers_finish (self, res, &error); + if (error) { + mm_warn ("couldn't load assistance data servers: '%s'", error->message); + g_error_free (error); + } + + mm_gdbus_modem_location_set_assistance_data_servers (ctx->skeleton, (const gchar *const *)servers); + g_strfreev (servers); + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); +} + +static void +load_supported_assistance_data_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + MMModemLocationAssistanceDataType mask; + InitializationContext *ctx; + + ctx = g_task_get_task_data (task); + + mask = MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supported_assistance_data_finish (self, res, &error); + if (error) { + mm_warn ("couldn't load supported assistance data types: '%s'", error->message); + g_error_free (error); + } + + mm_gdbus_modem_location_set_supported_assistance_data (ctx->skeleton, (guint32) mask); + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); } static void load_supl_server_ready (MMIfaceModemLocation *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { GError *error = NULL; gchar *supl; + InitializationContext *ctx; + + ctx = g_task_get_task_data (task); supl = MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supl_server_finish (self, res, &error); if (error) { @@ -1504,15 +1640,18 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void load_capabilities_ready (MMIfaceModemLocation *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { GError *error = NULL; + InitializationContext *ctx; + + ctx = g_task_get_task_data (task); ctx->capabilities = MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_capabilities_finish (self, res, &error); if (error) { @@ -1524,15 +1663,23 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemLocation *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -1544,12 +1691,12 @@ * the whole lifetime of the modem. Therefore, if we already have it * loaded, don't try to load it again. */ if (!mm_gdbus_modem_location_get_capabilities (ctx->skeleton) && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_capabilities && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_capabilities_finish) { - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_capabilities ( - ctx->self, + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_capabilities && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_capabilities_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_capabilities ( + self, (GAsyncReadyCallback)load_capabilities_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1559,11 +1706,11 @@ /* If the modem doesn't support any location capabilities, we won't export * the interface. We just report an UNSUPPORTED error. */ if (ctx->capabilities == MM_MODEM_LOCATION_SOURCE_NONE) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "The modem doesn't have location capabilities"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "The modem doesn't have location capabilities"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -1572,12 +1719,42 @@ case INITIALIZATION_STEP_SUPL_SERVER: /* If the modem supports A-GPS, load SUPL server */ if (ctx->capabilities & MM_MODEM_LOCATION_SOURCE_AGPS && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_supl_server && - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_supl_server_finish) { - MM_IFACE_MODEM_LOCATION_GET_INTERFACE (ctx->self)->load_supl_server ( - ctx->self, + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supl_server && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supl_server_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supl_server ( + self, (GAsyncReadyCallback)load_supl_server_ready, - ctx); + task); + return; + } + /* Fall down to next step */ + ctx->step++; + + case INITIALIZATION_STEP_SUPPORTED_ASSISTANCE_DATA: + /* If the modem supports any GPS-related technology, check assistance data types supported */ + if ((ctx->capabilities & (MM_MODEM_LOCATION_SOURCE_AGPS | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_GPS_NMEA)) && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supported_assistance_data && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supported_assistance_data_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_supported_assistance_data ( + self, + (GAsyncReadyCallback)load_supported_assistance_data_ready, + task); + return; + } + /* Fall down to next step */ + ctx->step++; + + case INITIALIZATION_STEP_ASSISTANCE_DATA_SERVERS: + /* If any assistance data supported, load servers */ + if ((mm_gdbus_modem_location_get_supported_assistance_data (ctx->skeleton) != MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE) && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_assistance_data_servers && + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_assistance_data_servers_finish) { + MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->load_assistance_data_servers ( + self, + (GAsyncReadyCallback)load_assistance_data_servers_ready, + task); return; } /* Fall down to next step */ @@ -1600,26 +1777,30 @@ g_signal_connect (ctx->skeleton, "handle-setup", G_CALLBACK (handle_setup), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-set-supl-server", G_CALLBACK (handle_set_supl_server), - ctx->self); + self); + g_signal_connect (ctx->skeleton, + "handle-inject-assistance-data", + G_CALLBACK (handle_inject_assistance_data), + self); g_signal_connect (ctx->skeleton, "handle-set-gps-refresh-rate", G_CALLBACK (handle_set_gps_refresh_rate), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-get-location", G_CALLBACK (handle_get_location), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_location (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_location (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_LOCATION (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1631,7 +1812,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -1642,6 +1823,7 @@ { InitializationContext *ctx; MmGdbusModemLocation *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -1652,6 +1834,7 @@ /* Set all initial property defaults */ mm_gdbus_modem_location_set_capabilities (skeleton, MM_MODEM_LOCATION_SOURCE_NONE); + mm_gdbus_modem_location_set_supported_assistance_data (skeleton, MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE); mm_gdbus_modem_location_set_enabled (skeleton, MM_MODEM_LOCATION_SOURCE_NONE); mm_gdbus_modem_location_set_signals_location (skeleton, FALSE); mm_gdbus_modem_location_set_location (skeleton, @@ -1665,17 +1848,14 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); ctx->capabilities = MM_MODEM_LOCATION_SOURCE_NONE; - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_location_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-location.h modemmanager-1.10.0/src/mm-iface-modem-location.h --- modemmanager-1.6.8/src/mm-iface-modem-location.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-location.h 2019-01-15 15:57:35.000000000 +0100 @@ -50,6 +50,22 @@ GAsyncResult *res, GError **error); + /* Loading of the AssistanceDataServers property */ + void (* load_assistance_data_servers) (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); + gchar ** (* load_assistance_data_servers_finish) (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + + /* Loading of the SupportedAssistanceData property */ + void (* load_supported_assistance_data) (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMModemLocationAssistanceDataType (* load_supported_assistance_data_finish) (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + /* Enable location gathering (async) */ void (* enable_location_gathering) (MMIfaceModemLocation *self, MMModemLocationSource source, @@ -76,6 +92,16 @@ gboolean (*set_supl_server_finish) (MMIfaceModemLocation *self, GAsyncResult *res, GError **error); + + /* Inject assistance data (async) */ + void (* inject_assistance_data) (MMIfaceModemLocation *self, + const guint8 *data, + gsize data_size, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*inject_assistance_data_finish) (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); }; GType mm_iface_modem_location_get_type (void); @@ -114,9 +140,10 @@ void mm_iface_modem_location_3gpp_update_mcc_mnc (MMIfaceModemLocation *self, guint mobile_country_code, guint mobile_network_code); -void mm_iface_modem_location_3gpp_update_lac_ci (MMIfaceModemLocation *self, - gulong location_area_code, - gulong cell_id); +void mm_iface_modem_location_3gpp_update_lac_tac_ci (MMIfaceModemLocation *self, + gulong location_area_code, + gulong tracking_area_code, + gulong cell_id); /* Update GPS location */ void mm_iface_modem_location_gps_update (MMIfaceModemLocation *self, diff -Nru modemmanager-1.6.8/src/mm-iface-modem-messaging.c modemmanager-1.10.0/src/mm-iface-modem-messaging.c --- modemmanager-1.6.8/src/mm-iface-modem-messaging.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-messaging.c 2019-01-15 15:57:35.000000000 +0100 @@ -526,7 +526,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -536,18 +536,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemMessaging *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemMessaging *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -558,50 +553,60 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disable_unsolicited_events_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void cleanup_unsolicited_events_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemMessaging *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ @@ -609,12 +614,12 @@ case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -622,12 +627,12 @@ case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -635,13 +640,13 @@ case DISABLING_STEP_LAST: /* Clear SMS list */ - g_object_set (ctx->self, + g_object_set (self, MM_IFACE_MODEM_MESSAGING_SMS_LIST, NULL, NULL); /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -654,33 +659,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_messaging_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -693,81 +698,65 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemMessaging *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemMessaging *skeleton; guint mem1_storage_index; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_messaging_enable_finish (MMIfaceModemMessaging *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_sms_format_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } -static void load_initial_sms_parts_from_storages (EnablingContext *ctx); +static void load_initial_sms_parts_from_storages (GTask *task); static void load_initial_sms_parts_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts_finish (self, res, &error); if (error) { StorageContext *storage_ctx; - storage_ctx = get_storage_context (ctx->self); + storage_ctx = get_storage_context (self); mm_dbg ("Couldn't load SMS parts from storage '%s': '%s'", mm_sms_storage_get_string (g_array_index (storage_ctx->supported_mem1, MMSmsStorage, @@ -778,14 +767,15 @@ /* Go on with the storage iteration */ ctx->mem1_storage_index++; - load_initial_sms_parts_from_storages (ctx); + load_initial_sms_parts_from_storages (task); } static void set_default_storage_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage_finish (self, res, &error)) { @@ -794,17 +784,22 @@ } /* Go on with next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -load_initial_sms_parts_from_storages (EnablingContext *ctx) +load_initial_sms_parts_from_storages (GTask *task) { + MMIfaceModemMessaging *self; + EnablingContext *ctx; gboolean all_loaded = FALSE; StorageContext *storage_ctx; - storage_ctx = get_storage_context (ctx->self); + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + storage_ctx = get_storage_context (self); if (!storage_ctx->supported_mem1 || ctx->mem1_storage_index >= storage_ctx->supported_mem1->len) all_loaded = TRUE; @@ -822,44 +817,46 @@ if (all_loaded) { /* Go on with next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); return; } - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts ( - ctx->self, + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts ( + self, g_array_index (storage_ctx->supported_mem1, MMSmsStorage, ctx->mem1_storage_index), (GAsyncReadyCallback)load_initial_sms_parts_ready, - ctx); - return; + task); } static void setup_unsolicited_events_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; /* Not critical! */ @@ -869,8 +866,9 @@ } /* Go on with next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static MMSmsStorage @@ -898,19 +896,48 @@ return default_storages_preference[i]; } +static MMSmsStorage +get_single_default_sms_storage (MMIfaceModemMessaging *self) +{ + StorageContext *storage_ctx; + + storage_ctx = get_storage_context (self); + + /* If there is one single storage supported for storing and receiving, just + * use that one. */ + if (storage_ctx->supported_mem2 && storage_ctx->supported_mem2->len == 1 && + storage_ctx->supported_mem3 && storage_ctx->supported_mem3->len == 1) { + MMSmsStorage storing_default; + + storing_default = g_array_index (storage_ctx->supported_mem2, MMSmsStorage, 0); + if (storing_default == g_array_index (storage_ctx->supported_mem3, MMSmsStorage, 0)) + return storing_default; + } + + return MM_SMS_STORAGE_UNKNOWN; +} + static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemMessaging *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: { MMSmsList *list; - list = mm_sms_list_new (MM_BASE_MODEM (ctx->self)); - g_object_set (ctx->self, + list = mm_sms_list_new (MM_BASE_MODEM (self)); + g_object_set (self, MM_IFACE_MODEM_MESSAGING_SMS_LIST, list, NULL); @@ -932,49 +959,52 @@ case ENABLING_STEP_SETUP_SMS_FORMAT: /* Allow setting SMS format to use */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format ( + self, (GAsyncReadyCallback)setup_sms_format_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; - case ENABLING_STEP_STORAGE_DEFAULTS: - /* Set storage defaults */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->set_default_storage && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->set_default_storage_finish) { - MMSmsStorage default_storage; - - default_storage = get_best_initial_default_sms_storage (ctx->self); - - /* Already bound to the 'default-storage' property in the skeleton */ - g_object_set (ctx->self, - MM_IFACE_MODEM_MESSAGING_SMS_DEFAULT_STORAGE, default_storage, - NULL); - - if (default_storage != MM_SMS_STORAGE_UNKNOWN) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->set_default_storage ( - ctx->self, - default_storage, - (GAsyncReadyCallback)set_default_storage_ready, - ctx); - return; - } + case ENABLING_STEP_STORAGE_DEFAULTS: { + MMSmsStorage default_storage; + + /* Is there only one single storage supported? if so, we don't care if + * setting default storage is implemented or not. */ + default_storage = get_single_default_sms_storage (self); + if (default_storage == MM_SMS_STORAGE_UNKNOWN) + default_storage = get_best_initial_default_sms_storage (self); + /* Already bound to the 'default-storage' property in the skeleton */ + g_object_set (self, + MM_IFACE_MODEM_MESSAGING_SMS_DEFAULT_STORAGE, default_storage, + NULL); + + if (default_storage == MM_SMS_STORAGE_UNKNOWN) mm_info ("Cannot set default storage, none of the suggested ones supported"); + else if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage ( + self, + default_storage, + (GAsyncReadyCallback)set_default_storage_ready, + task); + return; } + /* Fall down to next step */ ctx->step++; + } case ENABLING_STEP_LOAD_INITIAL_SMS_PARTS: /* Allow loading the initial list of SMS parts */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts_finish) { - load_initial_sms_parts_from_storages (ctx); + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts_finish) { + load_initial_sms_parts_from_storages (task); return; } /* Fall down to next step */ @@ -982,12 +1012,12 @@ case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -995,12 +1025,12 @@ case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1008,8 +1038,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1023,34 +1053,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_messaging_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -1062,38 +1091,17 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemMessaging *self; MmGdbusModemMessaging *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - static void skip_unknown_storages (GArray *mem) { @@ -1112,11 +1120,13 @@ static void load_supported_storages_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; StorageContext *storage_ctx; GError *error = NULL; + ctx = g_task_get_task_data (task); storage_ctx = get_storage_context (self); if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages_finish ( self, @@ -1183,14 +1193,15 @@ /* Go on to next step */ ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void check_support_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support_finish (self, @@ -1209,19 +1220,19 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void init_current_storages_ready (MMIfaceModemMessaging *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { - StorageContext *storage_ctx; + InitializationContext *ctx; GError *error = NULL; - storage_ctx = get_storage_context (self); if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages_finish ( self, res, @@ -1233,16 +1244,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemMessaging *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -1258,23 +1278,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -1285,37 +1305,37 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Messaging not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Messaging not supported"); + g_object_unref (task); return; } /* Fall down to next step */ ctx->step++; case INITIALIZATION_STEP_LOAD_SUPPORTED_STORAGES: - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_supported_storages && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_supported_storages_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_supported_storages ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages ( + self, (GAsyncReadyCallback)load_supported_storages_ready, - ctx); + task); return; } /* Fall down to next step */ ctx->step++; case INITIALIZATION_STEP_INIT_CURRENT_STORAGES: - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->init_current_storages && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->init_current_storages_finish) { - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->init_current_storages ( - ctx->self, + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages_finish) { + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages ( + self, (GAsyncReadyCallback)init_current_storages_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -1328,22 +1348,22 @@ g_signal_connect (ctx->skeleton, "handle-create", G_CALLBACK (handle_create), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-delete", G_CALLBACK (handle_delete), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-list", G_CALLBACK (handle_list), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_messaging (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_messaging (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_MESSAGING (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1355,7 +1375,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -1366,6 +1386,7 @@ { InitializationContext *ctx; MmGdbusModemMessaging *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -1388,16 +1409,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_messaging_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-oma.c modemmanager-1.10.0/src/mm-iface-modem-oma.c --- modemmanager-1.6.8/src/mm-iface-modem-oma.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-oma.c 2018-11-15 09:55:53.000000000 +0100 @@ -645,7 +645,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -655,18 +655,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemOma *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemOma *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -677,50 +672,60 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disable_unsolicited_events_ready (MMIfaceModemOma *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void cleanup_unsolicited_events_ready (MMIfaceModemOma *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemOma *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ @@ -728,12 +733,12 @@ case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -741,12 +746,12 @@ case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -754,8 +759,8 @@ case DISABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -768,33 +773,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_oma_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_OMA_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -805,94 +810,79 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemOma *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemOma *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_oma_enable_finish (MMIfaceModemOma *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void load_features_ready (MMIfaceModemOma *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MMOmaFeature features; features = MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->load_features_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + /* Update in the interface */ mm_gdbus_modem_oma_set_features (ctx->skeleton, features); /* Go on to next step */ ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void setup_unsolicited_events_ready (MMIfaceModemOma *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModemOma *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; /* Not critical! */ @@ -902,16 +892,25 @@ } /* Go on with next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemOma *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: @@ -919,12 +918,12 @@ ctx->step++; case ENABLING_STEP_LOAD_FEATURES: - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->load_features && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->load_features_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->load_features ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->load_features && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->load_features_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->load_features ( + self, (GAsyncReadyCallback)load_features_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -932,12 +931,12 @@ case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -945,12 +944,12 @@ case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -958,8 +957,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -973,34 +972,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_oma_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_OMA_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -1010,43 +1008,23 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemOma *self; MmGdbusModemOma *skeleton; - GSimpleAsyncResult *result; - GCancellable *cancellable; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - static void check_support_ready (MMIfaceModemOma *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->check_support_finish (self, res, &error)) { @@ -1063,16 +1041,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemOma *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -1088,23 +1075,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_OMA_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_OMA_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -1115,13 +1102,13 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "OMA not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "OMA not supported"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -1134,26 +1121,26 @@ g_signal_connect (ctx->skeleton, "handle-setup", G_CALLBACK (handle_setup), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-start-client-initiated-session", G_CALLBACK (handle_start_client_initiated_session), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-accept-network-initiated-session", G_CALLBACK (handle_accept_network_initiated_session), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-cancel-session", G_CALLBACK (handle_cancel_session), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_oma (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_oma (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_OMA (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1165,7 +1152,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -1176,6 +1163,7 @@ { InitializationContext *ctx; MmGdbusModemOma *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -1197,16 +1185,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_oma_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-signal.c modemmanager-1.10.0/src/mm-iface-modem-signal.c --- modemmanager-1.6.8/src/mm-iface-modem-signal.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-signal.c 2018-11-15 09:55:53.000000000 +0100 @@ -113,35 +113,40 @@ mm_gdbus_modem_signal_set_cdma (skeleton, dictionary); g_variant_unref (dictionary); g_object_unref (cdma); - } + } else + mm_gdbus_modem_signal_set_cdma (skeleton, NULL); if (evdo) { dictionary = mm_signal_get_dictionary (evdo); mm_gdbus_modem_signal_set_evdo (skeleton, dictionary); g_variant_unref (dictionary); g_object_unref (evdo); - } + } else + mm_gdbus_modem_signal_set_evdo (skeleton, NULL); if (gsm) { dictionary = mm_signal_get_dictionary (gsm); mm_gdbus_modem_signal_set_gsm (skeleton, dictionary); g_variant_unref (dictionary); g_object_unref (gsm); - } + } else + mm_gdbus_modem_signal_set_gsm (skeleton, NULL); if (umts) { dictionary = mm_signal_get_dictionary (umts); mm_gdbus_modem_signal_set_umts (skeleton, dictionary); g_variant_unref (dictionary); g_object_unref (umts); - } + } else + mm_gdbus_modem_signal_set_umts (skeleton, NULL); if (lte) { dictionary = mm_signal_get_dictionary (lte); mm_gdbus_modem_signal_set_lte (skeleton, dictionary); g_variant_unref (dictionary); g_object_unref (lte); - } + } else + mm_gdbus_modem_signal_set_lte (skeleton, NULL); /* Flush right away */ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (skeleton)); @@ -306,7 +311,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -314,18 +319,13 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_signal_disable); + GTask *task; teardown_refresh_context (self); - g_simple_async_result_set_op_res_gboolean (result, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + task = g_task_new (self, NULL, callback, user_data); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } /*****************************************************************************/ @@ -335,7 +335,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -344,27 +344,23 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_signal_enable); + task = g_task_new (self, cancellable, callback, user_data); if (!setup_refresh_context (self, FALSE, 0, &error)) - g_simple_async_result_take_error (result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (result, TRUE); + g_task_return_boolean (task, TRUE); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_object_unref (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -374,52 +370,31 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemSignal *self; MmGdbusModemSignal *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_slice_free (InitializationContext, ctx); } - gboolean mm_iface_modem_signal_initialize_finish (MMIfaceModemSignal *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static void check_support_ready (MMIfaceModemSignal *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->check_support_finish (self, res, &error)) { @@ -436,16 +411,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemSignal *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -461,23 +445,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -488,13 +472,13 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Extended Signal information not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Extended Signal information not supported"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -507,13 +491,13 @@ g_signal_connect (ctx->skeleton, "handle-setup", G_CALLBACK (handle_setup), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_signal (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_signal (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_SIGNAL (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -528,6 +512,7 @@ { InitializationContext *ctx; MmGdbusModemSignal *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -544,21 +529,21 @@ /* Perform async initialization here */ ctx = g_slice_new0 (InitializationContext); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_signal_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void mm_iface_modem_signal_shutdown (MMIfaceModemSignal *self) { + /* Teardown refresh context */ + teardown_refresh_context (self); + /* Unexport DBus interface and remove the skeleton */ mm_gdbus_object_skeleton_set_modem_signal (MM_GDBUS_OBJECT_SKELETON (self), NULL); g_object_set (self, diff -Nru modemmanager-1.6.8/src/mm-iface-modem-simple.c modemmanager-1.10.0/src/mm-iface-modem-simple.c --- modemmanager-1.6.8/src/mm-iface-modem-simple.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-simple.c 2019-01-15 15:57:35.000000000 +0100 @@ -32,8 +32,6 @@ /* Register in either a CDMA or a 3GPP network (or both) */ typedef struct { - GSimpleAsyncResult *result; - MMIfaceModemSimple *self; gchar *operator_id; guint remaining_tries_cdma; guint remaining_tries_3gpp; @@ -41,12 +39,9 @@ } RegisterInNetworkContext; static void -register_in_network_context_complete_and_free (RegisterInNetworkContext *ctx) +register_in_network_context_free (RegisterInNetworkContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); g_free (ctx->operator_id); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -55,77 +50,87 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void check_next_registration (RegisterInNetworkContext *ctx); +static void check_next_registration (GTask *task); static void register_in_cdma_network_ready (MMIfaceModemCdma *self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { + RegisterInNetworkContext *ctx; + + ctx = g_task_get_task_data (task); ctx->remaining_tries_cdma--; - if (!mm_iface_modem_cdma_register_in_network_finish ( - MM_IFACE_MODEM_CDMA (self), res, NULL)) { + if (!mm_iface_modem_cdma_register_in_network_finish (self, res, NULL)) { /* Retry check */ - check_next_registration (ctx); + check_next_registration (task); return; } /* Registered we are! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void register_in_3gpp_network_ready (MMIfaceModem3gpp *self, GAsyncResult *res, - RegisterInNetworkContext *ctx) + GTask *task) { + RegisterInNetworkContext *ctx; + + ctx = g_task_get_task_data (task); ctx->remaining_tries_3gpp--; - if (!mm_iface_modem_3gpp_register_in_network_finish ( - MM_IFACE_MODEM_3GPP (self), res, NULL)) { + if (!mm_iface_modem_3gpp_register_in_network_finish (self, res, NULL)) { /* Retry check */ - check_next_registration (ctx); + check_next_registration (task); return; } /* Registered we are! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - register_in_network_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -check_next_registration (RegisterInNetworkContext *ctx) +check_next_registration (GTask *task) { + RegisterInNetworkContext *ctx; + MMIfaceModemSimple *self; + + self = MM_IFACE_MODEM_SIMPLE (g_task_get_source_object (task)); + ctx = g_task_get_task_data (task); + if (ctx->remaining_tries_cdma > ctx->remaining_tries_3gpp && ctx->remaining_tries_cdma > 0) { mm_iface_modem_cdma_register_in_network ( - MM_IFACE_MODEM_CDMA (ctx->self), + MM_IFACE_MODEM_CDMA (self), ctx->max_try_time, (GAsyncReadyCallback)register_in_cdma_network_ready, - ctx); + task); return; } if (ctx->remaining_tries_3gpp > 0) { mm_iface_modem_3gpp_register_in_network ( - MM_IFACE_MODEM_3GPP (ctx->self), + MM_IFACE_MODEM_3GPP (self), ctx->operator_id, ctx->max_try_time, (GAsyncReadyCallback)register_in_3gpp_network_ready, - ctx); + task); return; } /* No more tries of anything */ - g_simple_async_result_take_error ( - ctx->result, + g_task_return_error ( + task, mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT)); - register_in_network_context_complete_and_free (ctx); + g_object_unref (task); } static void @@ -135,23 +140,19 @@ gpointer user_data) { RegisterInNetworkContext *ctx; + GTask *task; ctx = g_new0 (RegisterInNetworkContext, 1); - ctx->self = g_object_ref (self); ctx->operator_id = g_strdup (operator_id); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - register_in_3gpp_or_cdma_network); /* 3GPP-only modems... */ - if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (ctx->self))) { + if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (self))) { ctx->max_try_time = 60; ctx->remaining_tries_cdma = 0; ctx->remaining_tries_3gpp = 1; } /* CDMA-only modems... */ - else if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (ctx->self))) { + else if (mm_iface_modem_is_cdma_only (MM_IFACE_MODEM (self))) { ctx->max_try_time = 60; ctx->remaining_tries_cdma = 1; ctx->remaining_tries_3gpp = 0; @@ -163,7 +164,12 @@ ctx->remaining_tries_3gpp = 6; } - check_next_registration (ctx); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, + ctx, + (GDestroyNotify)register_in_network_context_free); + + check_next_registration (task); } /*****************************************************************************/ @@ -676,8 +682,6 @@ mm_dbg (" Password: %s", VALIDATE_UNSPECIFIED (mm_simple_connect_properties_get_password (ctx->properties))); - mm_dbg (" Number: %s", VALIDATE_UNSPECIFIED (mm_simple_connect_properties_get_number (ctx->properties))); - #undef VALIDATE_UNSPECIFIED } @@ -760,7 +764,7 @@ g_free (ctx->bearer_path); if (ctx->current) g_object_unref (ctx->current); - g_list_free_full (ctx->bearers, (GDestroyNotify) g_object_unref); + g_list_free_full (ctx->bearers, g_object_unref); g_free (ctx); } diff -Nru modemmanager-1.6.8/src/mm-iface-modem-time.c modemmanager-1.10.0/src/mm-iface-modem-time.c --- modemmanager-1.6.8/src/mm-iface-modem-time.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-time.c 2018-11-15 09:55:53.000000000 +0100 @@ -21,16 +21,13 @@ #include "mm-iface-modem-time.h" #include "mm-log.h" -#define SUPPORT_CHECKED_TAG "time-support-checked-tag" -#define SUPPORTED_TAG "time-supported-tag" -#define NETWORK_TIMEZONE_CANCELLABLE_TAG "time-network-timezone-cancellable" +#define SUPPORT_CHECKED_TAG "time-support-checked-tag" +#define SUPPORTED_TAG "time-supported-tag" +#define NETWORK_TIMEZONE_CONTEXT_TAG "time-network-timezone-context" static GQuark support_checked_quark; static GQuark supported_quark; -static GQuark network_timezone_cancellable_quark; - -#define TIMEZONE_POLL_INTERVAL_SEC 5 -#define TIMEZONE_POLL_RETRIES 6 +static GQuark network_timezone_context_quark; /*****************************************************************************/ @@ -123,56 +120,36 @@ } /*****************************************************************************/ +/* Network timezone loading */ + +/* + * As soon as we're registered in a network, we try to check timezone + * information up to NETWORK_TIMEZONE_POLL_RETRIES times. As soon as one of + * the retries succeeds, we stop polling as we don't expect the timezone + * information to change while registered in the same network. + */ +#define NETWORK_TIMEZONE_POLL_INTERVAL_SEC 5 +#define NETWORK_TIMEZONE_POLL_RETRIES 6 typedef struct { - MMIfaceModemTime *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; - gulong cancelled_id; gulong state_changed_id; + MMModemState state; guint network_timezone_poll_id; guint network_timezone_poll_retries; -} UpdateNetworkTimezoneContext; - -static gboolean timezone_poll_cb (UpdateNetworkTimezoneContext *ctx); +} NetworkTimezoneContext; static void -update_network_timezone_context_complete_and_free (UpdateNetworkTimezoneContext *ctx) +network_timezone_context_free (NetworkTimezoneContext *ctx) { - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); - g_object_unref (ctx->self); + /* Note: no need to remove signal connection here, we have already done it + * in stop_network_timezone() when the logic is disabled (or will be done + * automatically when the last modem object reference is dropped) */ + if (ctx->network_timezone_poll_id) + g_source_remove (ctx->network_timezone_poll_id); g_free (ctx); } -static gboolean -update_network_timezone_finish (MMIfaceModemTime *self, - GAsyncResult *res, - GError **error) -{ - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -cancelled (GCancellable *cancellable, - UpdateNetworkTimezoneContext *ctx) -{ - /* If waiting to get registered, disconnect signal */ - if (ctx->state_changed_id) - g_signal_handler_disconnect (ctx->self, - ctx->state_changed_id); - - /* If waiting in the timeout loop, remove the timeout */ - else if (ctx->network_timezone_poll_id) - g_source_remove (ctx->network_timezone_poll_id); - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Network timezone loading cancelled"); - update_network_timezone_context_complete_and_free (ctx); -} +static gboolean network_timezone_poll_cb (MMIfaceModemTime *self); static void update_network_timezone_dictionary (MMIfaceModemTime *self, @@ -197,171 +174,164 @@ static void load_network_timezone_ready (MMIfaceModemTime *self, - GAsyncResult *res, - UpdateNetworkTimezoneContext *ctx) + GAsyncResult *res) { GError *error = NULL; MMNetworkTimezone *tz; - if (g_cancellable_is_cancelled (ctx->cancellable)) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Finished network timezone loading, " - "but cancelled meanwhile"); - update_network_timezone_context_complete_and_free (ctx); - return; - } - /* Finish the async operation */ - tz = MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->load_network_timezone_finish (self, - res, - &error); - if (error) { + tz = MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->load_network_timezone_finish (self, res, &error); + if (!tz) { + NetworkTimezoneContext *ctx; + + mm_dbg ("Couldn't load network timezone: %s", error->message); + g_error_free (error); + + /* Note: may be NULL if the polling has been removed while processing the async operation */ + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + if (!ctx) + return; + /* Retry? */ ctx->network_timezone_poll_retries--; - /* Fatal if no more retries, or if specific error is not RETRY */ + /* If no more retries, we don't do anything else */ if (ctx->network_timezone_poll_retries == 0 || - !g_error_matches (error, - MM_CORE_ERROR, - MM_CORE_ERROR_RETRY)) { - g_simple_async_result_take_error (ctx->result, error); - update_network_timezone_context_complete_and_free (ctx); + !g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_RETRY)) { + mm_warn ("Couldn't load network timezone from the current network"); return; } - /* Otherwise, reconnect cancellable and relaunch timeout to query a bit - * later */ - ctx->cancelled_id = g_cancellable_connect (ctx->cancellable, - G_CALLBACK (cancelled), - ctx, - NULL); - ctx->network_timezone_poll_id = g_timeout_add_seconds (TIMEZONE_POLL_INTERVAL_SEC, - (GSourceFunc)timezone_poll_cb, - ctx); - - g_error_free (error); + /* Otherwise, relaunch timeout to query a bit later */ + ctx->network_timezone_poll_id = g_timeout_add_seconds (NETWORK_TIMEZONE_POLL_INTERVAL_SEC, + (GSourceFunc)network_timezone_poll_cb, + self); return; } /* Got final result properly, update the property in the skeleton */ - update_network_timezone_dictionary (ctx->self, tz); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - update_network_timezone_context_complete_and_free (ctx); + update_network_timezone_dictionary (self, tz); g_object_unref (tz); } static gboolean -timezone_poll_cb (UpdateNetworkTimezoneContext *ctx) +network_timezone_poll_cb (MMIfaceModemTime *self) { - ctx->network_timezone_poll_id = 0; + NetworkTimezoneContext *ctx; - /* Before we launch the async loading of the network timezone, - * we disconnect the cancellable signal. We don't want to get - * signaled while waiting to finish this async method, we'll - * check the cancellable afterwards instead. */ - g_cancellable_disconnect (ctx->cancellable, - ctx->cancelled_id); - ctx->cancelled_id = 0; + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + ctx->network_timezone_poll_id = 0; - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->load_network_timezone ( - ctx->self, + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->load_network_timezone ( + self, (GAsyncReadyCallback)load_network_timezone_ready, - ctx); + NULL); return G_SOURCE_REMOVE; } static void -start_timezone_poll (UpdateNetworkTimezoneContext *ctx) +start_network_timezone_poll (MMIfaceModemTime *self) { - /* Setup loop to query current timezone, don't do it right away. - * Note that we're passing the context reference to the loop. */ - ctx->network_timezone_poll_retries = TIMEZONE_POLL_RETRIES; - ctx->network_timezone_poll_id = g_timeout_add_seconds (TIMEZONE_POLL_INTERVAL_SEC, - (GSourceFunc)timezone_poll_cb, - ctx); + NetworkTimezoneContext *ctx; + + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + + mm_dbg ("Network timezone polling started"); + ctx->network_timezone_poll_retries = NETWORK_TIMEZONE_POLL_RETRIES; + ctx->network_timezone_poll_id = g_timeout_add_seconds (NETWORK_TIMEZONE_POLL_INTERVAL_SEC, (GSourceFunc)network_timezone_poll_cb, self); } static void -state_changed (MMIfaceModemTime *self, - GParamSpec *spec, - UpdateNetworkTimezoneContext *ctx) +stop_network_timezone_poll (MMIfaceModemTime *self) { - MMModemState state = MM_MODEM_STATE_UNKNOWN; + NetworkTimezoneContext *ctx; - g_object_get (self, - MM_IFACE_MODEM_STATE, &state, - NULL); + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + + if (ctx->network_timezone_poll_id) { + mm_dbg ("Network timezone polling stopped"); + g_source_remove (ctx->network_timezone_poll_id); + ctx->network_timezone_poll_id = 0; + } +} + +static void +network_timezone_state_changed (MMIfaceModemTime *self) +{ + NetworkTimezoneContext *ctx; + MMModemState old_state; + + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + old_state = ctx->state; - /* We're waiting to get registered */ - if (state < MM_MODEM_STATE_REGISTERED) + g_object_get (self, MM_IFACE_MODEM_STATE, &ctx->state, NULL); + + /* If going from unregistered to registered, start polling */ + if (ctx->state >= MM_MODEM_STATE_REGISTERED && old_state < MM_MODEM_STATE_REGISTERED) { + start_network_timezone_poll (self); return; + } - /* Got registered, disconnect signal */ - if (ctx->state_changed_id) { - g_signal_handler_disconnect (self, - ctx->state_changed_id); - ctx->state_changed_id = 0; + /* If going from registered to unregistered, stop polling */ + if (ctx->state < MM_MODEM_STATE_REGISTERED && old_state >= MM_MODEM_STATE_REGISTERED) { + stop_network_timezone_poll (self); + return; } +} + +static void +stop_network_timezone (MMIfaceModemTime *self) +{ + NetworkTimezoneContext *ctx; - /* Once we know we're registered, start timezone poll */ - start_timezone_poll (ctx); + ctx = (NetworkTimezoneContext *) g_object_get_qdata (G_OBJECT (self), network_timezone_context_quark); + if (ctx) { + /* Remove signal connection and then trigger context free */ + if (ctx->state_changed_id) { + g_signal_handler_disconnect (self, ctx->state_changed_id); + ctx->state_changed_id = 0; + } + g_object_set_qdata (G_OBJECT (self), network_timezone_context_quark, NULL); + } } static void -update_network_timezone (MMIfaceModemTime *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +start_network_timezone (MMIfaceModemTime *self) { - UpdateNetworkTimezoneContext *ctx; - MMModemState state = MM_MODEM_STATE_UNKNOWN; + NetworkTimezoneContext *ctx; /* If loading network timezone not supported, just finish here */ if (!MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->load_network_timezone || !MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->load_network_timezone_finish) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Loading network timezone is not supported"); + mm_dbg ("Loading network timezone is not supported"); return; } - ctx = g_new0 (UpdateNetworkTimezoneContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - update_network_timezone); - - /* Note: we don't expect to get cancelled by any other thread, so no - * need to check if we're cancelled just after connecting to the - * cancelled signal */ - ctx->cancelled_id = g_cancellable_connect (ctx->cancellable, - G_CALLBACK (cancelled), - ctx, - NULL); - - g_object_get (self, - MM_IFACE_MODEM_STATE, &state, - NULL); + if (G_UNLIKELY (!network_timezone_context_quark)) + network_timezone_context_quark = (g_quark_from_static_string (NETWORK_TIMEZONE_CONTEXT_TAG)); - /* Already registered? */ - if (state >= MM_MODEM_STATE_REGISTERED) { - /* Once we know we're registered, start timezone poll */ - start_timezone_poll (ctx); - } else { - /* Want to get notified when modem state changes */ - ctx->state_changed_id = g_signal_connect (ctx->self, - "notify::" MM_IFACE_MODEM_STATE, - G_CALLBACK (state_changed), - ctx); - } + /* Cleanup context properly if it already exists, including the signal handler */ + stop_network_timezone (self); + + ctx = g_new0 (NetworkTimezoneContext, 1); + g_object_set_qdata_full (G_OBJECT (self), + network_timezone_context_quark, + ctx, + (GDestroyNotify)network_timezone_context_free); + + /* Want to get notified when modem state changes to enable/disable + * the polling logic. This signal is connected as long as the network timezone + * logic is enabled. */ + g_object_get (self, MM_IFACE_MODEM_STATE, &ctx->state, NULL); + ctx->state_changed_id = g_signal_connect (self, + "notify::" MM_IFACE_MODEM_STATE, + G_CALLBACK (network_timezone_state_changed), + NULL); + + /* If we're registered already, start timezone poll */ + if (ctx->state >= MM_MODEM_STATE_REGISTERED) + start_network_timezone_poll (self); } /*****************************************************************************/ @@ -387,7 +357,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -398,18 +368,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemTime *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemTime *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -420,83 +385,79 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disable_unsolicited_events_ready (MMIfaceModemTime *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void cleanup_unsolicited_events_ready (MMIfaceModemTime *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemTime *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; - case DISABLING_STEP_CANCEL_NETWORK_TIMEZONE_UPDATE: { - if (G_LIKELY (network_timezone_cancellable_quark)) { - GCancellable *cancellable = NULL; - - cancellable = g_object_get_qdata (G_OBJECT (ctx->self), - network_timezone_cancellable_quark); - - /* If network timezone loading is currently running, abort it */ - if (cancellable) { - g_cancellable_cancel (cancellable); - g_object_set_qdata (G_OBJECT (ctx->self), - network_timezone_cancellable_quark, - NULL); - } - } - + case DISABLING_STEP_CANCEL_NETWORK_TIMEZONE_UPDATE: + /* Stop and cleanup context */ + stop_network_timezone (self); /* Fall down to next step */ ctx->step++; - } case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -504,12 +465,12 @@ case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -517,8 +478,8 @@ case DISABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -531,33 +492,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_time_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_TIME_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -568,91 +529,53 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemTime *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemTime *skeleton; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_time_enable_finish (MMIfaceModemTime *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); -} - -static void -update_network_timezone_ready (MMIfaceModemTime *self, - GAsyncResult *res) -{ - GError *error = NULL; - - if (!update_network_timezone_finish (self, res, &error)) { - if (!g_error_matches (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED)) - mm_dbg ("Couldn't update network timezone: '%s'", error->message); - g_error_free (error); - } - - /* Cleanup our cancellable in the context */ - g_object_set_qdata (G_OBJECT (self), - network_timezone_cancellable_quark, - NULL); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_unsolicited_events_ready (MMIfaceModemTime *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModemTime *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; /* Not critical! */ @@ -662,56 +585,45 @@ } /* Go on with next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemTime *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: /* Fall down to next step */ ctx->step++; - case ENABLING_STEP_SETUP_NETWORK_TIMEZONE_RETRIEVAL: { - GCancellable *cancellable; - - /* We'll create a cancellable which is valid as long as we're updating - * network timezone, and we set it as context */ - cancellable = g_cancellable_new (); - if (G_UNLIKELY (!network_timezone_cancellable_quark)) - network_timezone_cancellable_quark = (g_quark_from_static_string ( - NETWORK_TIMEZONE_CANCELLABLE_TAG)); - g_object_set_qdata_full (G_OBJECT (ctx->self), - network_timezone_cancellable_quark, - cancellable, - (GDestroyNotify)g_object_unref); - - update_network_timezone (ctx->self, - cancellable, - (GAsyncReadyCallback)update_network_timezone_ready, - NULL); - - /* NOTE!!!! We'll leave the timezone network update operation - * running, we don't wait for it to finish */ - + case ENABLING_STEP_SETUP_NETWORK_TIMEZONE_RETRIEVAL: + /* We start it and schedule it to run asynchronously */ + start_network_timezone (self); /* Fall down to next step */ ctx->step++; - } case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -719,12 +631,12 @@ case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -732,8 +644,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -747,34 +659,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_time_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_TIME_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -784,43 +695,23 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemTime *self; MmGdbusModemTime *skeleton; - GSimpleAsyncResult *result; - GCancellable *cancellable; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - static void check_support_ready (MMIfaceModemTime *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->check_support_finish (self, @@ -839,16 +730,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemTime *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -864,23 +764,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_TIME_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_TIME_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -891,13 +791,13 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Time not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Time not supported"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -910,14 +810,14 @@ g_signal_connect (ctx->skeleton, "handle-get-network-time", G_CALLBACK (handle_get_network_time), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_time (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_time (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_TIME (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -929,7 +829,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -940,6 +840,7 @@ { InitializationContext *ctx; MmGdbusModemTime *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -955,16 +856,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_time_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-voice.c modemmanager-1.10.0/src/mm-iface-modem-voice.c --- modemmanager-1.6.8/src/mm-iface-modem-voice.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-voice.c 2019-01-15 15:57:35.000000000 +0100 @@ -38,178 +38,80 @@ /*****************************************************************************/ -MMBaseCall * -mm_iface_modem_voice_create_call (MMIfaceModemVoice *self) +static MMBaseCall * +create_incoming_call (MMIfaceModemVoice *self, + const gchar *number) { g_assert (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->create_call != NULL); - return MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->create_call (self); + return MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->create_call (self, MM_CALL_DIRECTION_INCOMING, number); } -MMBaseCall * -mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self) +static MMBaseCall * +create_outgoing_call_from_properties (MMIfaceModemVoice *self, + MMCallProperties *properties, + GError **error) { - MMBaseCall *call = NULL; - MMCallList *list = NULL; - - g_object_get (MM_BASE_MODEM (self), - MM_IFACE_MODEM_VOICE_CALL_LIST, &list, - NULL); - - if (list) { - call = mm_call_list_get_new_incoming (list); - - if (!call) { - mm_dbg("Incoming call does not exist; create it"); - - call = mm_base_call_new (MM_BASE_MODEM (self)); - g_object_set (call, - "state", MM_CALL_STATE_RINGING_IN, - "state-reason", MM_CALL_STATE_REASON_INCOMING_NEW, - "direction", MM_CALL_DIRECTION_INCOMING, - NULL); - - /* Only export once properly created */ - mm_base_call_export (call); - mm_dbg ("New call exported to DBus"); - - mm_call_list_add_call (list, call); - mm_dbg ("Call added to the list"); - } - - g_object_unref (list); - } - - return call; -} - -gboolean -mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *self, - gchar *number, - guint type, - guint validity) -{ - gboolean updated = FALSE; - MMBaseCall *call = NULL; - MMCallList *list = NULL; + const gchar *number; - g_object_get (MM_BASE_MODEM (self), - MM_IFACE_MODEM_VOICE_CALL_LIST, &list, - NULL); - - if (list) { - call = mm_call_list_get_new_incoming (list); - - if (call) { - g_object_set (call, "number", number, NULL); - mm_gdbus_call_set_number (MM_GDBUS_CALL (call), number); - - /* - * TODO: Maybe also this parameters should be used: - * - type - * - validity - */ - - updated = TRUE; - } else { - mm_dbg ("Incoming call does not exist yet"); - } + /* Don't create CALL from properties if either number is missing */ + number = mm_call_properties_get_number (properties) ; + if (!number) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot create call: mandatory parameter 'number' is missing"); + return NULL; } - return updated; + /* Create a call object as defined by the interface */ + g_assert (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->create_call != NULL); + return MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->create_call (self, MM_CALL_DIRECTION_OUTGOING, number); } -gboolean -mm_iface_modem_voice_call_dialing_to_ringing (MMIfaceModemVoice *self) -{ - gboolean updated = FALSE; - MMBaseCall *call = NULL; - MMCallList *list = NULL; - - g_object_get (MM_BASE_MODEM (self), - MM_IFACE_MODEM_VOICE_CALL_LIST, &list, - NULL); - - if (list) { - call = mm_call_list_get_first_outgoing_dialing_call (list); - - if (call) { - mm_base_call_change_state (call, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED); - updated = TRUE; - } else { - mm_dbg ("Outgoing dialing call does not exist"); - } - } - - return updated; -} +/*****************************************************************************/ -gboolean -mm_iface_modem_voice_call_ringing_to_active (MMIfaceModemVoice *self) +void +mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self, + const gchar *number) { - gboolean updated = FALSE; - MMBaseCall *call = NULL; - MMCallList *list = NULL; + MMBaseCall *call = NULL; + MMCallList *list = NULL; g_object_get (MM_BASE_MODEM (self), MM_IFACE_MODEM_VOICE_CALL_LIST, &list, NULL); - if (list) { - call = mm_call_list_get_first_ringing_call (list); - - if (call) { - mm_base_call_change_state (call, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED); - updated = TRUE; - } else { - mm_dbg ("Ringing call does not exist"); - } + if (!list) { + mm_warn ("Cannot create incoming call: missing call list"); + return; } - return updated; -} + call = mm_call_list_get_first_ringing_in_call (list); -gboolean -mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self) -{ - gboolean updated = FALSE; - MMBaseCall *call = NULL; - MMCallList *list = NULL; - - g_object_get (MM_BASE_MODEM (self), - MM_IFACE_MODEM_VOICE_CALL_LIST, &list, - NULL); - - if (list) { - call = mm_call_list_get_first_non_terminated_call (list); - - if (call) { - mm_base_call_change_state (call, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED); - updated = TRUE; - } else { - mm_dbg ("No call to hangup"); - } + /* If call exists already, refresh its validity and set number if it wasn't set */ + if (call) { + if (number && !mm_gdbus_call_get_number (MM_GDBUS_CALL (call))) + mm_gdbus_call_set_number (MM_GDBUS_CALL (call), number); + mm_base_call_incoming_refresh (call); + g_object_unref (list); + return; } - return updated; -} + mm_dbg ("Creating new incoming call..."); + call = create_incoming_call (self, number); -gboolean -mm_iface_modem_voice_received_dtmf (MMIfaceModemVoice *self, - gchar *dtmf) -{ - gboolean updated = FALSE; - MMCallList *list = NULL; - - g_object_get (MM_BASE_MODEM (self), - MM_IFACE_MODEM_VOICE_CALL_LIST, &list, - NULL); + /* Set the state as ringing in */ + mm_base_call_change_state (call, MM_CALL_STATE_RINGING_IN, MM_CALL_STATE_REASON_INCOMING_NEW); - if (list) { - updated = mm_call_list_send_dtmf_to_active_calls (list, dtmf); - } + /* Start its validity timeout */ + mm_base_call_incoming_refresh (call); - return updated; + /* Only export once properly created */ + mm_base_call_export (call); + mm_call_list_add_call (list, call); + g_object_unref (call); + g_object_unref (list); } /*****************************************************************************/ @@ -232,21 +134,6 @@ } static void -handle_delete_ready (MMCallList *list, - GAsyncResult *res, - HandleDeleteContext *ctx) -{ - GError *error = NULL; - - if (!mm_call_list_delete_call_finish (list, res, &error)) - g_dbus_method_invocation_take_error (ctx->invocation, error); - else - mm_gdbus_modem_voice_complete_delete_call (ctx->skeleton, ctx->invocation); - - handle_delete_context_free (ctx); -} - -static void handle_delete_auth_ready (MMBaseModem *self, GAsyncResult *res, HandleDeleteContext *ctx) @@ -269,7 +156,7 @@ g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, - "Cannot delete CALL: device not yet enabled"); + "Cannot delete call: device not yet enabled"); handle_delete_context_free (ctx); return; } @@ -281,15 +168,17 @@ g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, - "Cannot delete CALL: missing CALL list"); + "Cannot delete call: missing call list"); handle_delete_context_free (ctx); return; } - mm_call_list_delete_call (list, - ctx->path, - (GAsyncReadyCallback)handle_delete_ready, - ctx); + if (!mm_call_list_delete_call (list, ctx->path, &error)) + g_dbus_method_invocation_take_error (ctx->invocation, error); + else + mm_gdbus_modem_voice_complete_delete_call (ctx->skeleton, ctx->invocation); + + handle_delete_context_free (ctx); g_object_unref (list); } @@ -372,9 +261,7 @@ return; } - call = mm_base_call_new_from_properties (MM_BASE_MODEM (self), - properties, - &error); + call = create_outgoing_call_from_properties (MM_IFACE_MODEM_VOICE (self), properties, &error); if (!call) { g_object_unref (properties); g_dbus_method_invocation_take_error (ctx->invocation, error); @@ -396,7 +283,8 @@ return; } - /* Add it to the list */ + /* Only export once properly created */ + mm_base_call_export (call); mm_call_list_add_call (list, call); /* Complete the DBus call */ @@ -489,6 +377,8 @@ paths = mm_call_list_get_paths (list); mm_gdbus_modem_voice_set_calls (skeleton, (const gchar *const *)paths); g_strfreev (paths); + + g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (skeleton)); } static void @@ -514,7 +404,7 @@ /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; -static void interface_disabling_step (DisablingContext *ctx); +static void interface_disabling_step (GTask *task); typedef enum { DISABLING_STEP_FIRST, @@ -524,18 +414,13 @@ } DisablingStep; struct _DisablingContext { - MMIfaceModemVoice *self; DisablingStep step; - GSimpleAsyncResult *result; MmGdbusModemVoice *skeleton; }; static void -disabling_context_complete_and_free (DisablingContext *ctx) +disabling_context_free (DisablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); @@ -546,50 +431,60 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void disable_unsolicited_events_ready (MMIfaceModemVoice *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void cleanup_unsolicited_events_ready (MMIfaceModemVoice *self, GAsyncResult *res, - DisablingContext *ctx) + GTask *task) { + DisablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - disabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_disabling_step (ctx); + interface_disabling_step (task); } static void -interface_disabling_step (DisablingContext *ctx) +interface_disabling_step (GTask *task) { + MMIfaceModemVoice *self; + DisablingContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + switch (ctx->step) { case DISABLING_STEP_FIRST: /* Fall down to next step */ @@ -597,12 +492,12 @@ case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->disable_unsolicited_events && - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) { - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->disable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->disable_unsolicited_events && + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->disable_unsolicited_events_finish) { + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->disable_unsolicited_events ( + self, (GAsyncReadyCallback)disable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -610,12 +505,12 @@ case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS: /* Allow cleaning up unsolicited events */ - if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events && - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) { - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->cleanup_unsolicited_events && + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) { + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->cleanup_unsolicited_events ( + self, (GAsyncReadyCallback)cleanup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -623,13 +518,13 @@ case DISABLING_STEP_LAST: /* Clear CALL list */ - g_object_set (ctx->self, + g_object_set (self, MM_IFACE_MODEM_VOICE_CALL_LIST, NULL, NULL); /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - disabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -642,33 +537,33 @@ gpointer user_data) { DisablingContext *ctx; + GTask *task; ctx = g_new0 (DisablingContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_voice_disable); ctx->step = DISABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)disabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_VOICE_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - disabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_disabling_step (ctx); + interface_disabling_step (task); } /*****************************************************************************/ typedef struct _EnablingContext EnablingContext; -static void interface_enabling_step (EnablingContext *ctx); +static void interface_enabling_step (GTask *task); typedef enum { ENABLING_STEP_FIRST, @@ -678,72 +573,54 @@ } EnablingStep; struct _EnablingContext { - MMIfaceModemVoice *self; EnablingStep step; - GSimpleAsyncResult *result; - GCancellable *cancellable; MmGdbusModemVoice *skeleton; guint mem1_storage_index; }; static void -enabling_context_complete_and_free (EnablingContext *ctx) +enabling_context_free (EnablingContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); if (ctx->skeleton) g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface enabling cancelled"); - enabling_context_complete_and_free (ctx); - return TRUE; -} - gboolean mm_iface_modem_voice_enable_finish (MMIfaceModemVoice *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void setup_unsolicited_events_ready (MMIfaceModemVoice *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error); if (error) { - g_simple_async_result_take_error (ctx->result, error); - enabling_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void enable_unsolicited_events_ready (MMIfaceModemVoice *self, GAsyncResult *res, - EnablingContext *ctx) + GTask *task) { + EnablingContext *ctx; GError *error = NULL; /* Not critical! */ @@ -753,23 +630,32 @@ } /* Go on with next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_enabling_step (ctx); + interface_enabling_step (task); } static void -interface_enabling_step (EnablingContext *ctx) +interface_enabling_step (GTask *task) { + MMIfaceModemVoice *self; + EnablingContext *ctx; + /* Don't run new steps if we're cancelled */ - if (enabling_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case ENABLING_STEP_FIRST: { MMCallList *list; - list = mm_call_list_new (MM_BASE_MODEM (ctx->self)); - g_object_set (ctx->self, + list = mm_call_list_new (MM_BASE_MODEM (self)); + g_object_set (self, MM_IFACE_MODEM_VOICE_CALL_LIST, list, NULL); @@ -791,12 +677,12 @@ case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->setup_unsolicited_events && - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->setup_unsolicited_events_finish) { - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->setup_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->setup_unsolicited_events && + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->setup_unsolicited_events_finish) { + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->setup_unsolicited_events ( + self, (GAsyncReadyCallback)setup_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -804,12 +690,12 @@ case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ - if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->enable_unsolicited_events && - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) { - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->enable_unsolicited_events ( - ctx->self, + if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->enable_unsolicited_events && + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->enable_unsolicited_events_finish) { + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->enable_unsolicited_events ( + self, (GAsyncReadyCallback)enable_unsolicited_events_ready, - ctx); + task); return; } /* Fall down to next step */ @@ -817,8 +703,8 @@ case ENABLING_STEP_LAST: /* We are done without errors! */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - enabling_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -832,34 +718,33 @@ gpointer user_data) { EnablingContext *ctx; + GTask *task; ctx = g_new0 (EnablingContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_voice_enable); ctx->step = ENABLING_STEP_FIRST; - g_object_get (ctx->self, + + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free); + + g_object_get (self, MM_IFACE_MODEM_VOICE_DBUS_SKELETON, &ctx->skeleton, NULL); if (!ctx->skeleton) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - enabling_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't get interface skeleton"); + g_object_unref (task); return; } - interface_enabling_step (ctx); + interface_enabling_step (task); } /*****************************************************************************/ typedef struct _InitializationContext InitializationContext; -static void interface_initialization_step (InitializationContext *ctx); +static void interface_initialization_step (GTask *task); typedef enum { INITIALIZATION_STEP_FIRST, @@ -869,43 +754,23 @@ } InitializationStep; struct _InitializationContext { - MMIfaceModemVoice *self; MmGdbusModemVoice *skeleton; - GCancellable *cancellable; - GSimpleAsyncResult *result; InitializationStep step; }; static void -initialization_context_complete_and_free (InitializationContext *ctx) +initialization_context_free (InitializationContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->self); - g_object_unref (ctx->result); - g_object_unref (ctx->cancellable); g_object_unref (ctx->skeleton); g_free (ctx); } -static gboolean -initialization_context_complete_and_free_if_cancelled (InitializationContext *ctx) -{ - if (!g_cancellable_is_cancelled (ctx->cancellable)) - return FALSE; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Interface initialization cancelled"); - initialization_context_complete_and_free (ctx); - return TRUE; -} - static void check_support_ready (MMIfaceModemVoice *self, GAsyncResult *res, - InitializationContext *ctx) + GTask *task) { + InitializationContext *ctx; GError *error = NULL; if (!MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support_finish (self, @@ -924,16 +789,25 @@ } /* Go on to next step */ + ctx = g_task_get_task_data (task); ctx->step++; - interface_initialization_step (ctx); + interface_initialization_step (task); } static void -interface_initialization_step (InitializationContext *ctx) +interface_initialization_step (GTask *task) { + MMIfaceModemVoice *self; + InitializationContext *ctx; + /* Don't run new steps if we're cancelled */ - if (initialization_context_complete_and_free_if_cancelled (ctx)) + if (g_task_return_error_if_cancelled (task)) { + g_object_unref (task); return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case INITIALIZATION_STEP_FIRST: @@ -949,23 +823,23 @@ ctx->step++; case INITIALIZATION_STEP_CHECK_SUPPORT: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), support_checked_quark))) { /* Set the checked flag so that we don't run it again */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), support_checked_quark, GUINT_TO_POINTER (TRUE)); /* Initially, assume we don't support it */ - g_object_set_qdata (G_OBJECT (ctx->self), + g_object_set_qdata (G_OBJECT (self), supported_quark, GUINT_TO_POINTER (FALSE)); - if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->check_support && - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->check_support_finish) { - MM_IFACE_MODEM_VOICE_GET_INTERFACE (ctx->self)->check_support ( - ctx->self, + if (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support && + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support_finish) { + MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support ( + self, (GAsyncReadyCallback)check_support_ready, - ctx); + task); return; } @@ -976,13 +850,13 @@ ctx->step++; case INITIALIZATION_STEP_FAIL_IF_UNSUPPORTED: - if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (ctx->self), + if (!GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (self), supported_quark))) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Voice not supported"); - initialization_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Voice not supported"); + g_object_unref (task); return; } /* Fall down to next step */ @@ -995,22 +869,22 @@ g_signal_connect (ctx->skeleton, "handle-create-call", G_CALLBACK (handle_create), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-delete-call", G_CALLBACK (handle_delete), - ctx->self); + self); g_signal_connect (ctx->skeleton, "handle-list-calls", G_CALLBACK (handle_list), - ctx->self); + self); /* Finally, export the new interface */ - mm_gdbus_object_skeleton_set_modem_voice (MM_GDBUS_OBJECT_SKELETON (ctx->self), + mm_gdbus_object_skeleton_set_modem_voice (MM_GDBUS_OBJECT_SKELETON (self), MM_GDBUS_MODEM_VOICE (ctx->skeleton)); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - initialization_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -1022,7 +896,7 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void @@ -1033,6 +907,7 @@ { InitializationContext *ctx; MmGdbusModemVoice *skeleton = NULL; + GTask *task; /* Did we already create it? */ g_object_get (self, @@ -1049,16 +924,13 @@ /* Perform async initialization here */ ctx = g_new0 (InitializationContext, 1); - ctx->self = g_object_ref (self); - ctx->cancellable = g_object_ref (cancellable); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_iface_modem_voice_initialize); ctx->step = INITIALIZATION_STEP_FIRST; ctx->skeleton = skeleton; - interface_initialization_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)initialization_context_free); + + interface_initialization_step (task); } void diff -Nru modemmanager-1.6.8/src/mm-iface-modem-voice.h modemmanager-1.10.0/src/mm-iface-modem-voice.h --- modemmanager-1.6.8/src/mm-iface-modem-voice.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-iface-modem-voice.h 2019-01-15 15:57:35.000000000 +0100 @@ -78,7 +78,9 @@ GError **error); /* Create CALL objects */ - MMBaseCall * (* create_call) (MMIfaceModemVoice *self); + MMBaseCall * (* create_call) (MMIfaceModemVoice *self, + MMCallDirection direction, + const gchar *number); }; GType mm_iface_modem_voice_get_type (void); @@ -116,22 +118,8 @@ void mm_iface_modem_voice_bind_simple_status (MMIfaceModemVoice *self, MMSimpleStatus *status); -/* CALL creation */ -MMBaseCall *mm_iface_modem_voice_create_call (MMIfaceModemVoice *self); -MMBaseCall *mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self); -gboolean mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *self, - gchar *number, - guint type, - guint validity); -gboolean mm_iface_modem_voice_call_dialing_to_ringing (MMIfaceModemVoice *self); -gboolean mm_iface_modem_voice_call_ringing_to_active (MMIfaceModemVoice *self); -gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self); -gboolean mm_iface_modem_voice_received_dtmf (MMIfaceModemVoice *self, - gchar *dtmf); - -/* Look for a new valid multipart reference */ -guint8 mm_iface_modem_voice_get_local_multipart_reference (MMIfaceModemVoice *self, - const gchar *number, - GError **error); +/* Incoming call management */ +void mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self, + const gchar *number); #endif /* MM_IFACE_MODEM_VOICE_H */ diff -Nru modemmanager-1.6.8/src/mm-log.c modemmanager-1.10.0/src/mm-log.c --- modemmanager-1.6.8/src/mm-log.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-log.c 2018-11-15 09:55:53.000000000 +0100 @@ -35,6 +35,11 @@ #include #endif +#if defined WITH_SYSTEMD_JOURNAL +#define SD_JOURNAL_SUPPRESS_LOCATION +#include +#endif + #include "mm-log.h" enum { @@ -44,10 +49,16 @@ }; static gboolean ts_flags = TS_FLAG_NONE; -static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR; +static guint32 log_level = MM_LOG_LEVEL_INFO | MM_LOG_LEVEL_WARN | MM_LOG_LEVEL_ERR; static GTimeVal rel_start = { 0, 0 }; static int logfd = -1; -static gboolean func_loc = FALSE; +static gboolean append_log_level_text = TRUE; + +static void (*log_backend) (const char *loc, + const char *func, + int syslog_level, + const char *message, + size_t length); typedef struct { guint32 num; @@ -55,27 +66,139 @@ } LogDesc; static const LogDesc level_descs[] = { - { LOGL_ERR, "ERR" }, - { LOGL_WARN | LOGL_ERR, "WARN" }, - { LOGL_INFO | LOGL_WARN | LOGL_ERR, "INFO" }, - { LOGL_DEBUG | LOGL_INFO | LOGL_WARN | LOGL_ERR, "DEBUG" }, + { MM_LOG_LEVEL_ERR, "ERR" }, + { MM_LOG_LEVEL_WARN | MM_LOG_LEVEL_ERR, "WARN" }, + { MM_LOG_LEVEL_INFO | MM_LOG_LEVEL_WARN | MM_LOG_LEVEL_ERR, "INFO" }, + { MM_LOG_LEVEL_DEBUG | MM_LOG_LEVEL_INFO | MM_LOG_LEVEL_WARN | MM_LOG_LEVEL_ERR, "DEBUG" }, { 0, NULL } }; static GString *msgbuf = NULL; static volatile gsize msgbuf_once = 0; +static int +mm_to_syslog_priority (MMLogLevel level) +{ + switch (level) { + case MM_LOG_LEVEL_DEBUG: + return LOG_DEBUG; + case MM_LOG_LEVEL_WARN: + return LOG_WARNING; + case MM_LOG_LEVEL_INFO: + return LOG_INFO; + case MM_LOG_LEVEL_ERR: + return LOG_ERR; + } + g_assert_not_reached (); + return 0; +} + +static int +glib_to_syslog_priority (GLogLevelFlags level) +{ + switch (level) { + case G_LOG_LEVEL_ERROR: + return LOG_CRIT; + case G_LOG_LEVEL_CRITICAL: + return LOG_ERR; + case G_LOG_LEVEL_WARNING: + return LOG_WARNING; + case G_LOG_LEVEL_MESSAGE: + return LOG_NOTICE; + case G_LOG_LEVEL_DEBUG: + return LOG_DEBUG; + default: + return LOG_INFO; + } +} + +static const char * +log_level_description (MMLogLevel level) +{ + switch (level) { + case MM_LOG_LEVEL_DEBUG: + return ""; + case MM_LOG_LEVEL_WARN: + return " "; + case MM_LOG_LEVEL_INFO: + return " "; + case MM_LOG_LEVEL_ERR: + return ""; + } + g_assert_not_reached (); + return NULL; +} + +static void +log_backend_file (const char *loc, + const char *func, + int syslog_level, + const char *message, + size_t length) +{ + ssize_t ign; + ign = write (logfd, message, length); + if (ign) {} /* whatever; really shut up about unused result */ + + fsync (logfd); /* Make sure output is dumped to disk immediately */ +} + +static void +log_backend_syslog (const char *loc, + const char *func, + int syslog_level, + const char *message, + size_t length) +{ + syslog (syslog_level, "%s", message); +} + +#if defined WITH_SYSTEMD_JOURNAL +static void +log_backend_systemd_journal (const char *loc, + const char *func, + int syslog_level, + const char *message, + size_t length) +{ + const char *line; + size_t file_length; + + if (loc == NULL) { + sd_journal_send ("MESSAGE=%s", message, + "PRIORITY=%d", syslog_level, + NULL); + return; + } + + line = strstr (loc, ":"); + if (line) { + file_length = line - loc; + line++; + } else { + /* This is not supposed to happen but we must be prepared for this */ + line = loc; + file_length = 0; + } + + sd_journal_send ("MESSAGE=%s", message, + "PRIORITY=%d", syslog_level, + "CODE_FUNC=%s", func, + "CODE_FILE=%.*s", file_length, loc, + "CODE_LINE=%s", line, + NULL); +} +#endif + void _mm_log (const char *loc, const char *func, - guint32 level, + MMLogLevel level, const char *fmt, ...) { va_list args; GTimeVal tv; - int syslog_priority = LOG_INFO; - ssize_t ign; if (!(log_level & level)) return; @@ -86,18 +209,8 @@ } else g_string_truncate (msgbuf, 0); - if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) - g_string_append (msgbuf, " "); - else if ((log_level & LOGL_INFO) && (level == LOGL_INFO)) - g_string_append (msgbuf, " "); - else if ((log_level & LOGL_WARN) && (level == LOGL_WARN)) { - g_string_append (msgbuf, " "); - syslog_priority = LOG_WARNING; - } else if ((log_level & LOGL_ERR) && (level == LOGL_ERR)) { - g_string_append (msgbuf, " "); - syslog_priority = LOG_ERR; - } else - return; + if (append_log_level_text) + g_string_append_printf (msgbuf, "%s ", log_level_description (level)); if (ts_flags == TS_FLAG_WALL) { g_get_current_time (&tv); @@ -117,8 +230,9 @@ g_string_append_printf (msgbuf, "[%06ld.%06ld] ", secs, usecs); } - if (func_loc && log_level & LOGL_DEBUG) - g_string_append_printf (msgbuf, "[%s] %s(): ", loc, func); +#if defined MM_LOG_FUNC_LOC + g_string_append_printf (msgbuf, "[%s] %s(): ", loc, func); +#endif va_start (args, fmt); g_string_append_vprintf (msgbuf, fmt, args); @@ -126,14 +240,7 @@ g_string_append_c (msgbuf, '\n'); - if (logfd < 0) - syslog (syslog_priority, "%s", msgbuf->str); - else { - ign = write (logfd, msgbuf->str, msgbuf->len); - if (ign) {} /* whatever; really shut up about unused result */ - - fsync (logfd); /* Make sure output is dumped to disk immediately */ - } + log_backend (loc, func, mm_to_syslog_priority (level), msgbuf->str, msgbuf->len); } static void @@ -142,37 +249,7 @@ const gchar *message, gpointer ignored) { - int syslog_priority; - ssize_t ign; - - switch (level) { - case G_LOG_LEVEL_ERROR: - syslog_priority = LOG_CRIT; - break; - case G_LOG_LEVEL_CRITICAL: - syslog_priority = LOG_ERR; - break; - case G_LOG_LEVEL_WARNING: - syslog_priority = LOG_WARNING; - break; - case G_LOG_LEVEL_MESSAGE: - syslog_priority = LOG_NOTICE; - break; - case G_LOG_LEVEL_DEBUG: - syslog_priority = LOG_DEBUG; - break; - case G_LOG_LEVEL_INFO: - default: - syslog_priority = LOG_INFO; - break; - } - - if (logfd < 0) - syslog (syslog_priority, "%s", message); - else { - ign = write (logfd, message, strlen (message)); - if (ign) {} /* whatever; really shut up about unused result */ - } + log_backend (NULL, NULL, glib_to_syslog_priority (level), message, strlen (message)); } gboolean @@ -194,11 +271,11 @@ "Unknown log level '%s'", level); #if defined WITH_QMI - qmi_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE); + qmi_utils_set_traces_enabled (log_level & MM_LOG_LEVEL_DEBUG ? TRUE : FALSE); #endif #if defined WITH_MBIM - mbim_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE); + mbim_utils_set_traces_enabled (log_level & MM_LOG_LEVEL_DEBUG ? TRUE : FALSE); #endif return found; @@ -207,17 +284,15 @@ gboolean mm_log_setup (const char *level, const char *log_file, + gboolean log_journal, gboolean show_timestamps, gboolean rel_timestamps, - gboolean debug_func_loc, GError **error) { /* levels */ if (level && strlen (level) && !mm_log_set_level (level, error)) return FALSE; - func_loc = debug_func_loc; - if (show_timestamps) ts_flags = TS_FLAG_WALL; else if (rel_timestamps) @@ -226,9 +301,16 @@ /* Grab start time for relative timestamps */ g_get_current_time (&rel_start); - if (log_file == NULL) +#if defined WITH_SYSTEMD_JOURNAL + if (log_journal) { + log_backend = log_backend_systemd_journal; + append_log_level_text = FALSE; + } else +#endif + if (log_file == NULL) { openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PID | LOG_PERROR, LOG_DAEMON); - else { + log_backend = log_backend_syslog; + } else { logfd = open (log_file, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); @@ -238,6 +320,7 @@ errno, strerror (errno)); return FALSE; } + log_backend = log_backend_file; } g_log_set_handler (G_LOG_DOMAIN, diff -Nru modemmanager-1.6.8/src/mm-log.h modemmanager-1.10.0/src/mm-log.h --- modemmanager-1.6.8/src/mm-log.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-log.h 2018-11-15 09:55:53.000000000 +0100 @@ -19,31 +19,31 @@ #include /* Log levels */ -enum { - LOGL_ERR = 0x00000001, - LOGL_WARN = 0x00000002, - LOGL_INFO = 0x00000004, - LOGL_DEBUG = 0x00000008 -}; +typedef enum { + MM_LOG_LEVEL_ERR = 0x00000001, + MM_LOG_LEVEL_WARN = 0x00000002, + MM_LOG_LEVEL_INFO = 0x00000004, + MM_LOG_LEVEL_DEBUG = 0x00000008 +} MMLogLevel; #define mm_err(...) \ - _mm_log (G_STRLOC, G_STRFUNC, LOGL_ERR, ## __VA_ARGS__ ) + _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_ERR, ## __VA_ARGS__ ) #define mm_warn(...) \ - _mm_log (G_STRLOC, G_STRFUNC, LOGL_WARN, ## __VA_ARGS__ ) + _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_WARN, ## __VA_ARGS__ ) #define mm_info(...) \ - _mm_log (G_STRLOC, G_STRFUNC, LOGL_INFO, ## __VA_ARGS__ ) + _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_INFO, ## __VA_ARGS__ ) #define mm_dbg(...) \ - _mm_log (G_STRLOC, G_STRFUNC, LOGL_DEBUG, ## __VA_ARGS__ ) + _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_DEBUG, ## __VA_ARGS__ ) #define mm_log(level, ...) \ _mm_log (G_STRLOC, G_STRFUNC, level, ## __VA_ARGS__ ) void _mm_log (const char *loc, const char *func, - guint32 level, + MMLogLevel level, const char *fmt, ...) __attribute__((__format__ (__printf__, 4, 5))); @@ -51,9 +51,9 @@ gboolean mm_log_setup (const char *level, const char *log_file, + gboolean log_journal, gboolean show_ts, gboolean rel_ts, - gboolean debug_func_loc, GError **error); void mm_log_shutdown (void); diff -Nru modemmanager-1.6.8/src/mm-modem-helpers.c modemmanager-1.10.0/src/mm-modem-helpers.c --- modemmanager-1.6.8/src/mm-modem-helpers.c 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers.c 2019-01-15 15:57:35.000000000 +0100 @@ -30,6 +30,7 @@ #include "mm-sms-part.h" #include "mm-modem-helpers.h" +#include "mm-helper-enums-types.h" #include "mm-log.h" /*****************************************************************************/ @@ -240,6 +241,16 @@ return c; } +guint +mm_find_bit_set (gulong number) +{ + guint c = 0; + + for (c = 0; !(number & 0x1); c++) + number >>= 1; + return c; +} + /*****************************************************************************/ gchar * @@ -485,6 +496,26 @@ /*****************************************************************************/ +static const gchar bcd_chars[] = "0123456789\0\0\0\0\0\0"; + +gchar * +mm_bcd_to_string (const guint8 *bcd, gsize bcd_len) +{ + GString *str; + gsize i; + + g_return_val_if_fail (bcd != NULL, NULL); + + str = g_string_sized_new (bcd_len * 2 + 1); + for (i = 0 ; i < bcd_len; i++) { + str = g_string_append_c (str, bcd_chars[bcd[i] & 0xF]); + str = g_string_append_c (str, bcd_chars[(bcd[i] >> 4) & 0xF]); + } + return g_string_free (str, FALSE); +} + +/*****************************************************************************/ + GRegex * mm_voice_ring_regex_get (void) { @@ -525,6 +556,147 @@ /*************************************************************************/ +static MMFlowControl +flow_control_array_to_mask (GArray *array, + const gchar *item) +{ + MMFlowControl mask = MM_FLOW_CONTROL_UNKNOWN; + guint i; + + for (i = 0; i < array->len; i++) { + guint mode; + + mode = g_array_index (array, guint, i); + switch (mode) { + case 0: + mm_dbg ("%s supports no flow control", item); + mask |= MM_FLOW_CONTROL_NONE; + break; + case 1: + mm_dbg ("%s supports XON/XOFF flow control", item); + mask |= MM_FLOW_CONTROL_XON_XOFF; + break; + case 2: + mm_dbg ("%s supports RTS/CTS flow control", item); + mask |= MM_FLOW_CONTROL_RTS_CTS; + break; + default: + break; + } + } + + return mask; +} + +static MMFlowControl +flow_control_match_info_to_mask (GMatchInfo *match_info, + guint index, + const gchar *item, + GError **error) +{ + MMFlowControl mask = MM_FLOW_CONTROL_UNKNOWN; + gchar *aux = NULL; + GArray *array = NULL; + + if (!(aux = mm_get_string_unquoted_from_match_info (match_info, index))) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Error retrieving list of supported %s flow control methods", item); + goto out; + } + + if (!(array = mm_parse_uint_list (aux, error))) { + g_prefix_error (error, "Error parsing list of supported %s flow control methods: ", item); + goto out; + } + + if ((mask = flow_control_array_to_mask (array, item)) == MM_FLOW_CONTROL_UNKNOWN) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No known %s flow control method given", item); + goto out; + } + +out: + g_clear_pointer (&aux, g_free); + g_clear_pointer (&array, g_array_unref); + + return mask; +} + +MMFlowControl +mm_parse_ifc_test_response (const gchar *response, + GError **error) +{ + GRegex *r; + GError *inner_error = NULL; + GMatchInfo *match_info = NULL; + MMFlowControl te_mask = MM_FLOW_CONTROL_UNKNOWN; + MMFlowControl ta_mask = MM_FLOW_CONTROL_UNKNOWN; + MMFlowControl mask = MM_FLOW_CONTROL_UNKNOWN; + + r = g_regex_new ("(?:\\+IFC:)?\\s*\\((.*)\\),\\((.*)\\)(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response"); + goto out; + } + + /* Parse TE flow control methods */ + if ((te_mask = flow_control_match_info_to_mask (match_info, 1, "TE", &inner_error)) == MM_FLOW_CONTROL_UNKNOWN) + goto out; + + /* Parse TA flow control methods */ + if ((ta_mask = flow_control_match_info_to_mask (match_info, 2, "TA", &inner_error)) == MM_FLOW_CONTROL_UNKNOWN) + goto out; + + /* Only those methods in both TA and TE will be the ones we report */ + mask = te_mask & ta_mask; + +out: + + g_clear_pointer (&match_info, g_match_info_free); + g_regex_unref (r); + + if (inner_error) + g_propagate_error (error, inner_error); + + return mask; +} + +MMFlowControl +mm_flow_control_from_string (const gchar *str, + GError **error) +{ + GFlagsClass *flags_class; + guint value; + guint i; + + flags_class = G_FLAGS_CLASS (g_type_class_ref (MM_TYPE_FLOW_CONTROL)); + + for (i = 0; flags_class->values[i].value_nick; i++) { + if (!g_ascii_strcasecmp (str, flags_class->values[i].value_nick)) { + value = flags_class->values[i].value; + g_type_class_unref (flags_class); + return value; + } + } + + g_type_class_unref (flags_class); + + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Couldn't match '%s' with a valid MMFlowControl value", + str); + return MM_FLOW_CONTROL_UNKNOWN; +} + +/*************************************************************************/ + /* +CREG: (GSM 07.07 CREG=1 unsolicited) */ #define CREG1 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9])" @@ -693,6 +865,17 @@ /*************************************************************************/ GRegex * +mm_3gpp_cgev_regex_get (void) +{ + return g_regex_new ("\\r\\n\\+CGEV:\\s*(.*)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, + 0, + NULL); +} + +/*************************************************************************/ + +GRegex * mm_3gpp_cusd_regex_get (void) { return g_regex_new ("\\r\\n\\+CUSD:\\s*(.*)\\r\\n", @@ -1090,6 +1273,136 @@ /*************************************************************************/ +gboolean +mm_3gpp_parse_cops_read_response (const gchar *response, + guint *out_mode, + guint *out_format, + gchar **out_operator, + MMModemAccessTechnology *out_act, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint mode = 0; + guint format = 0; + gchar *operator = NULL; + guint actval = 0; + MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + + g_assert (out_mode || out_format || out_operator || out_act); + + /* We assume the response to be either: + * +COPS: ,, + * or: + * +COPS: ,,, + */ + r = g_regex_new ("\\+COPS:\\s*(\\d+),(\\d+),([^,]*)(?:,(\\d+))?(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response"); + goto out; + } + + if (out_mode && !mm_get_uint_from_match_info (match_info, 1, &mode)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing mode"); + goto out; + } + + if (out_format && !mm_get_uint_from_match_info (match_info, 2, &format)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing format"); + goto out; + } + + if (out_operator && !(operator = mm_get_string_unquoted_from_match_info (match_info, 3))) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing operator"); + goto out; + } + + /* AcT is optional */ + if (out_act && g_match_info_get_match_count (match_info) >= 5) { + if (!mm_get_uint_from_match_info (match_info, 4, &actval)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing AcT"); + goto out; + } + act = get_mm_access_tech_from_etsi_access_tech (actval); + } + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_free (operator); + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_mode) + *out_mode = mode; + if (out_format) + *out_format = format; + if (out_operator) + *out_operator = operator; + if (out_act) + *out_act = act; + return TRUE; +} + +/*************************************************************************/ +/* Logic to compare two APN names */ + +gboolean +mm_3gpp_cmp_apn_name (const gchar *requested, + const gchar *existing) +{ + size_t requested_len; + size_t existing_len; + + /* If both empty, that's a good match */ + if ((!existing || !existing[0]) && (!requested || !requested[0])) + return TRUE; + + /* Both must be given to compare properly */ + if (!existing || !existing[0] || !requested || !requested[0]) + return FALSE; + + requested_len = strlen (requested); + + /* + * 1) The requested APN should be at least the prefix of the existing one. + */ + if (g_ascii_strncasecmp (existing, requested, requested_len) != 0) + return FALSE; + + /* + * 2) If the existing one is actually the same as the requested one (i.e. + * there are no more different chars in the existing one), we're done. + */ + if (existing[requested_len] == '\0') + return TRUE; + + existing_len = strlen (existing); + + /* 3) Special handling for PDP contexts reported by u-blox modems once the + * contexts have been activated at least once: + * "ac.vodafone.es.MNC001.MCC214.GPRS" should match "ac.vodafone.es" + */ + if ((existing_len > (requested_len + 14)) && + g_ascii_strncasecmp (&existing[requested_len], ".mnc", 4) == 0 && + g_ascii_strncasecmp (&existing[requested_len + 7], ".mcc", 4) == 0) + return TRUE; + + /* No match */ + return FALSE; +} + +/*************************************************************************/ static void mm_3gpp_pdp_context_format_free (MM3gppPdpContextFormat *format) @@ -1259,6 +1572,89 @@ /*************************************************************************/ +static void +mm_3gpp_pdp_context_active_free (MM3gppPdpContextActive *pdp_active) +{ + g_slice_free (MM3gppPdpContextActive, pdp_active); +} + +void +mm_3gpp_pdp_context_active_list_free (GList *pdp_active_list) +{ + g_list_free_full (pdp_active_list, (GDestroyNotify) mm_3gpp_pdp_context_active_free); +} + +gint +mm_3gpp_pdp_context_active_cmp (MM3gppPdpContextActive *a, + MM3gppPdpContextActive *b) +{ + return (a->cid - b->cid); +} + +GList * +mm_3gpp_parse_cgact_read_response (const gchar *reply, + GError **error) +{ + GError *inner_error = NULL; + GRegex *r; + GMatchInfo *match_info; + GList *list; + + if (!reply || !reply[0]) + /* Nothing configured, all done */ + return NULL; + + list = NULL; + r = g_regex_new ("\\+CGACT:\\s*(\\d+),(\\d+)", + G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW, 0, &inner_error); + g_assert (r); + + g_regex_match_full (r, reply, strlen (reply), 0, 0, &match_info, &inner_error); + while (!inner_error && g_match_info_matches (match_info)) { + MM3gppPdpContextActive *pdp_active; + guint cid = 0; + guint aux = 0; + + if (!mm_get_uint_from_match_info (match_info, 1, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse CID from reply: '%s'", + reply); + break; + } + if (!mm_get_uint_from_match_info (match_info, 2, &aux) || (aux != 0 && aux != 1)) { + inner_error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse context status from reply: '%s'", + reply); + break; + } + + pdp_active = g_slice_new0 (MM3gppPdpContextActive); + pdp_active->cid = cid; + pdp_active->active = (gboolean) aux; + list = g_list_prepend (list, pdp_active); + + g_match_info_next (match_info, &inner_error); + } + + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + mm_3gpp_pdp_context_active_list_free (list); + g_propagate_error (error, inner_error); + g_prefix_error (error, "Couldn't properly parse list of active/inactive PDP contexts. "); + return NULL; + } + + list = g_list_sort (list, (GCompareFunc) mm_3gpp_pdp_context_active_cmp); + + return list; +} + +/*************************************************************************/ + static gulong parse_uint (char *str, int base, glong nmin, glong nmax, gboolean *valid) { @@ -1403,7 +1799,7 @@ /* Status */ str = g_match_info_fetch (info, istat); - stat = parse_uint (str, 10, 0, 5, &success); + stat = parse_uint (str, 10, 0, G_MAXUINT, &success); g_free (str); if (!success) { g_set_error_literal (error, @@ -1412,6 +1808,12 @@ return FALSE; } + /* 'roaming (csfb not preferred)' is the last valid state */ + if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) { + mm_warn ("Registration State '%lu' is unknown", stat); + stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; + } + /* Location Area Code */ if (ilac) { /* FIXME: some phones apparently swap the LAC bytes (LG, SonyEricsson, @@ -1438,12 +1840,6 @@ act = -1; } - /* 'roaming' is the last valid state */ - if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) { - mm_warn ("Registration State '%lu' is unknown", stat); - stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; - } - *out_reg_state = (MMModem3gppRegistrationState) stat; if (stat != MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) { /* Don't fill in lac/ci/act if the device's state is unknown */ @@ -1634,6 +2030,253 @@ } /*************************************************************************/ +/* CGCONTRDP=N response parser */ + +static gboolean +split_local_address_and_subnet (const gchar *str, + gchar **local_address, + gchar **subnet) +{ + const gchar *separator; + guint count = 0; + + /* E.g. split: "2.43.2.44.255.255.255.255" + * into: + * local address: "2.43.2.44", + * subnet: "255.255.255.255" + */ + g_assert (str); + g_assert (local_address); + g_assert (subnet); + + separator = str; + while (1) { + separator = strchr (separator, '.'); + if (separator) { + count++; + if (count == 4) { + if (local_address) + *local_address = g_strndup (str, (separator - str)); + if (subnet) + *subnet = g_strdup (++separator); + return TRUE; + } + separator++; + continue; + } + + /* Not even the full IP? report error parsing */ + if (count < 3) + return FALSE; + + if (count == 3) { + if (local_address) + *local_address = g_strdup (str); + if (subnet) + *subnet = NULL; + return TRUE; + } + } +} + +gboolean +mm_3gpp_parse_cgcontrdp_response (const gchar *response, + guint *out_cid, + guint *out_bearer_id, + gchar **out_apn, + gchar **out_local_address, + gchar **out_subnet, + gchar **out_gateway_address, + gchar **out_dns_primary_address, + gchar **out_dns_secondary_address, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint cid = 0; + guint bearer_id = 0; + gchar *apn = NULL; + gchar *local_address_and_subnet = NULL; + gchar *local_address = NULL; + gchar *subnet = NULL; + gchar *gateway_address = NULL; + gchar *dns_primary_address = NULL; + gchar *dns_secondary_address = NULL; + guint field_format_extra_index = 0; + + /* Response may be e.g.: + * +CGCONTRDP: 4,5,"ibox.tim.it.mnc001.mcc222.gprs","2.197.17.49.255.255.255.255","2.197.17.49","10.207.43.46","10.206.56.132","0.0.0.0","0.0.0.0",0 + * + * We assume only ONE line is returned; because we request +CGCONTRDP with + * a specific N CID. Also, we don't parse all fields, we stop after + * secondary DNS. + * + * Only the 3 first parameters (cid, bearer id, apn) are mandatory in the + * response, all the others are optional, but, we'll anyway assume that APN + * may be empty. + * + * The format of the response changed in TS 27.007 v9.4.0, we try to detect + * both formats ('a' if >= v9.4.0, 'b' if < v9.4.0) with a single regex here. + */ + r = g_regex_new ("\\+CGCONTRDP: " + "(\\d+),(\\d+),([^,]*)" /* cid, bearer id, apn */ + "(?:,([^,]*))?" /* (a)ip+mask or (b)ip */ + "(?:,([^,]*))?" /* (a)gateway or (b)mask */ + "(?:,([^,]*))?" /* (a)dns1 or (b)gateway */ + "(?:,([^,]*))?" /* (a)dns2 or (b)dns1 */ + "(?:,([^,]*))?" /* (a)p-cscf primary or (b)dns2 */ + "(?:,(.*))?" /* others, ignored */ + "(?:\\r\\n)?", + 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Couldn't match +CGCONTRDP response"); + goto out; + } + + if (out_cid && !mm_get_uint_from_match_info (match_info, 1, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing cid"); + goto out; + } + + if (out_bearer_id && !mm_get_uint_from_match_info (match_info, 2, &bearer_id)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing bearer id"); + goto out; + } + + /* Remaining strings are optional or empty allowed */ + + if (out_apn) + apn = mm_get_string_unquoted_from_match_info (match_info, 3); + + /* + * The +CGCONTRDP=[cid] response format before version TS 27.007 v9.4.0 had + * the subnet in its own comma-separated field. Try to detect that. + */ + local_address_and_subnet = mm_get_string_unquoted_from_match_info (match_info, 4); + if (local_address_and_subnet && !split_local_address_and_subnet (local_address_and_subnet, &local_address, &subnet)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing local address and subnet"); + goto out; + } + /* If we don't have a subnet in field 4, we're using the old format with subnet in an extra field */ + if (!subnet) { + if (out_subnet) + subnet = mm_get_string_unquoted_from_match_info (match_info, 5); + field_format_extra_index = 1; + } + + if (out_gateway_address) + gateway_address = mm_get_string_unquoted_from_match_info (match_info, 5 + field_format_extra_index); + + if (out_dns_primary_address) + dns_primary_address = mm_get_string_unquoted_from_match_info (match_info, 6 + field_format_extra_index); + + if (out_dns_secondary_address) + dns_secondary_address = mm_get_string_unquoted_from_match_info (match_info, 7 + field_format_extra_index); + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + g_free (local_address_and_subnet); + + if (inner_error) { + g_free (apn); + g_free (local_address); + g_free (subnet); + g_free (gateway_address); + g_free (dns_primary_address); + g_free (dns_secondary_address); + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_cid) + *out_cid = cid; + if (out_bearer_id) + *out_bearer_id = bearer_id; + if (out_apn) + *out_apn = apn; + + /* Local address and subnet may always be retrieved, even if not requested + * by the caller, as we need them to know which +CGCONTRDP=[cid] response is + * being parsed. So make sure we free them if not needed. */ + if (out_local_address) + *out_local_address = local_address; + else + g_free (local_address); + if (out_subnet) + *out_subnet = subnet; + else + g_free (subnet); + + if (out_gateway_address) + *out_gateway_address = gateway_address; + if (out_dns_primary_address) + *out_dns_primary_address = dns_primary_address; + if (out_dns_secondary_address) + *out_dns_secondary_address = dns_secondary_address; + return TRUE; +} + +/*************************************************************************/ + +gboolean +mm_3gpp_parse_cfun_query_response (const gchar *response, + guint *out_state, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info; + GError *inner_error = NULL; + guint state = G_MAXUINT; + + g_assert (out_state != NULL); + + /* Response may be e.g.: + * +CFUN: 1,0 + * ..but we don't care about the second number + */ + r = g_regex_new ("\\+CFUN: (\\d+)(?:,(?:\\d+))?(?:\\r\\n)?", 0, 0, NULL); + g_assert (r != NULL); + + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse +CFUN response: %s", response); + goto out; + } + + if (!mm_get_uint_from_match_info (match_info, 1, &state)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't read power state value"); + goto out; + } + + *out_state = state; + +out: + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + return TRUE; +} + +/*****************************************************************************/ /* +CESQ response parser */ gboolean @@ -1649,12 +2292,12 @@ GRegex *r; GMatchInfo *match_info; GError *inner_error = NULL; - guint rxlev = 0; - guint ber = 0; - guint rscp = 0; - guint ecn0 = 0; - guint rsrq = 0; - guint rsrp = 0; + guint rxlev = 99; + guint ber = 99; + guint rscp = 255; + guint ecn0 = 255; + guint rsrq = 255; + guint rsrp = 255; gboolean success = FALSE; g_assert (out_rxlev); @@ -1700,9 +2343,7 @@ } out: - - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (inner_error) { @@ -1725,9 +2366,9 @@ return TRUE; } -static gboolean -rxlev_to_rssi (guint rxlev, - gdouble *out_rssi) +gboolean +mm_3gpp_rxlev_to_rssi (guint rxlev, + gdouble *out_rssi) { if (rxlev <= 63) { *out_rssi = -111.0 + rxlev; @@ -1739,9 +2380,9 @@ return FALSE; } -static gboolean -rscp_level_to_rscp (guint rscp_level, - gdouble *out_rscp) +gboolean +mm_3gpp_rscp_level_to_rscp (guint rscp_level, + gdouble *out_rscp) { if (rscp_level <= 96) { *out_rscp = -121.0 + rscp_level; @@ -1753,9 +2394,9 @@ return FALSE; } -static gboolean -ecn0_level_to_ecio (guint ecn0_level, - gdouble *out_ecio) +gboolean +mm_3gpp_ecn0_level_to_ecio (guint ecn0_level, + gdouble *out_ecio) { if (ecn0_level <= 49) { *out_ecio = -24.5 + (((gdouble) ecn0_level) * 0.5); @@ -1767,9 +2408,9 @@ return FALSE; } -static gboolean -rsrq_level_to_rsrq (guint rsrq_level, - gdouble *out_rsrq) +gboolean +mm_3gpp_rsrq_level_to_rsrq (guint rsrq_level, + gdouble *out_rsrq) { if (rsrq_level <= 34) { *out_rsrq = -20.0 + (((gdouble) rsrq_level) * 0.5); @@ -1781,9 +2422,9 @@ return FALSE; } -static gboolean -rsrp_level_to_rsrp (guint rsrp_level, - gdouble *out_rsrp) +gboolean +mm_3gpp_rsrp_level_to_rsrp (guint rsrp_level, + gdouble *out_rsrp) { if (rsrp_level <= 97) { *out_rsrp = -141.0 + rsrp_level; @@ -1825,7 +2466,7 @@ return FALSE; /* GERAN RSSI */ - if (rxlev_to_rssi (rxlev, &rssi)) { + if (mm_3gpp_rxlev_to_rssi (rxlev, &rssi)) { gsm = mm_signal_new (); mm_signal_set_rssi (gsm, rssi); } @@ -1833,26 +2474,26 @@ /* ignore BER */ /* UMTS RSCP */ - if (rscp_level_to_rscp (rscp_level, &rscp)) { + if (mm_3gpp_rscp_level_to_rscp (rscp_level, &rscp)) { umts = mm_signal_new (); mm_signal_set_rscp (umts, rscp); } /* UMTS EcIo (assumed EcN0) */ - if (ecn0_level_to_ecio (ecn0_level, &ecio)) { + if (mm_3gpp_ecn0_level_to_ecio (ecn0_level, &ecio)) { if (!umts) umts = mm_signal_new (); mm_signal_set_ecio (umts, ecio); } /* LTE RSRQ */ - if (rsrq_level_to_rsrq (rsrq_level, &rsrq)) { + if (mm_3gpp_rsrq_level_to_rsrq (rsrq_level, &rsrq)) { lte = mm_signal_new (); mm_signal_set_rsrq (lte, rsrq); } /* LTE RSRP */ - if (rsrp_level_to_rsrp (rsrp_level, &rsrp)) { + if (mm_3gpp_rsrp_level_to_rsrp (rsrp_level, &rsrp)) { if (!lte) lte = mm_signal_new (); mm_signal_set_rsrp (lte, rsrp); @@ -1874,6 +2515,78 @@ return TRUE; } +gboolean +mm_3gpp_parse_cfun_query_generic_response (const gchar *response, + MMModemPowerState *out_state, + GError **error) +{ + guint state; + + if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) + return FALSE; + + switch (state) { + case 0: + *out_state = MM_MODEM_POWER_STATE_OFF; + return TRUE; + case 1: + *out_state = MM_MODEM_POWER_STATE_ON; + return TRUE; + case 4: + *out_state = MM_MODEM_POWER_STATE_LOW; + return TRUE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown +CFUN state: %u", state); + return FALSE; + } +} + +static MMModem3gppEpsUeModeOperation cemode_values[] = { + [0] = MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_2, + [1] = MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_1, + [2] = MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_CSPS_2, + [3] = MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_PS_1, +}; + +gchar * +mm_3gpp_build_cemode_set_request (MMModem3gppEpsUeModeOperation mode) +{ + guint i; + + g_return_val_if_fail (mode != MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN, NULL); + + for (i = 0; i < G_N_ELEMENTS (cemode_values); i++) { + if (mode == cemode_values[i]) + return g_strdup_printf ("+CEMODE=%u", i); + } + + g_assert_not_reached (); + return NULL; +} + +gboolean +mm_3gpp_parse_cemode_query_response (const gchar *response, + MMModem3gppEpsUeModeOperation *out_mode, + GError **error) +{ + guint value = 0; + + response = mm_strip_tag (response, "+CEMODE:"); + if (mm_get_uint_from_str (response, &value) && value < G_N_ELEMENTS (cemode_values)) { + if (out_mode) + *out_mode = cemode_values[value]; + return TRUE; + } + + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't parse UE mode of operation: '%s' (value %u)", + response, value); + return FALSE; +} + /*************************************************************************/ static MMSmsStorage @@ -2008,15 +2721,15 @@ r = g_regex_new (CPMS_QUERY_REGEX, G_REGEX_RAW, 0, NULL); - g_assert(r); + g_assert (r); if (!g_regex_match (r, reply, 0, &match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Could not parse CPMS query reponse '%s'", reply); + "Could not parse CPMS query response '%s'", reply); goto end; } - if (!g_match_info_matches(match_info)) { + if (!g_match_info_matches (match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Could not find matches in CPMS query reply '%s'", reply); goto end; @@ -2036,8 +2749,7 @@ if (r != NULL) g_regex_unref (r); - if (match_info != NULL) - g_match_info_free (match_info); + g_match_info_free (match_info); return ret; } @@ -2051,7 +2763,7 @@ gboolean ret = TRUE; gchar *str = NULL; - str = g_match_info_fetch_named(match_info, match_name); + str = g_match_info_fetch_named (match_info, match_name); if (str == NULL || str[0] == '\0') { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Could not find '%s' from CPMS reply", match_name); @@ -2206,8 +2918,7 @@ /*************************************************************************/ GStrv -mm_3gpp_parse_cnum_exec_response (const gchar *reply, - GError **error) +mm_3gpp_parse_cnum_exec_response (const gchar *reply) { GArray *array = NULL; GRegex *r; @@ -2245,6 +2956,119 @@ /*************************************************************************/ +gchar * +mm_3gpp_build_cmer_set_request (MM3gppCmerMode mode, + MM3gppCmerInd ind) +{ + guint mode_val; + guint ind_val; + + if (mode == MM_3GPP_CMER_MODE_DISCARD_URCS) + return g_strdup ("+CMER=0"); + if (mode < MM_3GPP_CMER_MODE_DISCARD_URCS || mode > MM_3GPP_CMER_MODE_FORWARD_URCS) + return NULL; + mode_val = mm_find_bit_set (mode); + + if (ind < MM_3GPP_CMER_IND_DISABLE || ind > MM_3GPP_CMER_IND_ENABLE_ALL) + return NULL; + ind_val = mm_find_bit_set (ind); + + return g_strdup_printf ("+CMER=%u,0,0,%u", mode_val, ind_val); +} + +gboolean +mm_3gpp_parse_cmer_test_response (const gchar *response, + MM3gppCmerMode *out_supported_modes, + MM3gppCmerInd *out_supported_inds, + GError **error) +{ + gchar **split; + GError *inner_error = NULL; + GArray *array_supported_modes = NULL; + GArray *array_supported_inds = NULL; + gchar *aux = NULL; + gboolean ret = FALSE; + MM3gppCmerMode supported_modes = 0; + MM3gppCmerInd supported_inds = 0; + guint i; + + /* + * AT+CMER=? + * +CMER: 1,0,0,(0-1),0 + * + * AT+CMER=? + * +CMER: (0-3),(0),(0),(0-1),(0-1) + * + * AT+CMER=? + * +CMER: (1,2),0,0,(0-1),0 + */ + + split = mm_split_string_groups (mm_strip_tag (response, "+CMER:")); + if (!split) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't split +CMER test response in groups"); + goto out; + } + + /* We want 1st and 4th groups */ + if (g_strv_length (split) < 4) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Missing groups in +CMER test response (%u < 4)", g_strv_length (split)); + goto out; + } + + /* Modes in 1st group */ + if (!(array_supported_modes = mm_parse_uint_list (split[0], &inner_error))) + goto out; + g_clear_pointer (&aux, g_free); + + /* Ind settings in 4th group */ + if (!(array_supported_inds = mm_parse_uint_list (split[3], &inner_error))) + goto out; + g_clear_pointer (&aux, g_free); + + for (i = 0; i < array_supported_modes->len; i++) { + guint mode_val; + + mode_val = g_array_index (array_supported_modes, guint, i); + if (mode_val <= 3) + supported_modes |= (MM3gppCmerMode) (1 << mode_val); + else + mm_dbg ("Unknown +CMER mode reported: %u", mode_val); + } + + for (i = 0; i < array_supported_inds->len; i++) { + guint ind_val; + + ind_val = g_array_index (array_supported_inds, guint, i); + if (ind_val <= 2) + supported_inds |= (MM3gppCmerInd) (1 << ind_val); + else + mm_dbg ("Unknown +CMER ind reported: %u", ind_val); + } + + if (out_supported_modes) + *out_supported_modes = supported_modes; + if (out_supported_inds) + *out_supported_inds = supported_inds; + ret = TRUE; + +out: + + if (array_supported_modes) + g_array_unref (array_supported_modes); + if (array_supported_inds) + g_array_unref (array_supported_inds); + g_clear_pointer (&aux, g_free); + + g_strfreev (split); + + if (inner_error) + g_propagate_error (error, inner_error); + + return ret; +} + +/*************************************************************************/ + struct MM3gppCindResponse { gchar *desc; guint idx; @@ -2259,7 +3083,6 @@ gchar *p; g_return_val_if_fail (desc != NULL, NULL); - g_return_val_if_fail (idx >= 0, NULL); r = g_malloc0 (sizeof (MM3gppCindResponse)); @@ -2453,6 +3276,310 @@ } /*************************************************************************/ +/* +CGEV indication parser + * + * We provide full parsing support, including parameters, for these messages: + * +CGEV: NW DETACH + * +CGEV: ME DETACH + * +CGEV: NW PDN ACT + * +CGEV: ME PDN ACT [,[,]] + * +CGEV: NW ACT , , + * +CGEV: ME ACT , , + * +CGEV: NW DEACT , , [] + * +CGEV: ME DEACT , , [] + * +CGEV: NW PDN DEACT + * +CGEV: ME PDN DEACT + * +CGEV: NW DEACT , , + * +CGEV: ME DEACT , , + * +CGEV: REJECT , + * +CGEV: NW REACT , , [] + * + * We don't provide parameter parsing for these messages: + * +CGEV: NW CLASS + * +CGEV: ME CLASS + * +CGEV: NW MODIFY , , + * +CGEV: ME MODIFY , , + */ + +static gboolean +deact_secondary (const gchar *str) +{ + /* We need to detect the ME/NW DEACT format. + * Either, + * +CGEV: NW DEACT , , [] + * +CGEV: ME DEACT , , [] + * or, + * +CGEV: NW DEACT , , + * +CGEV: ME DEACT , , + */ + str = strstr (str, "DEACT") + 5; + while (*str == ' ') + str++; + + /* We will look for because we know it's NUMERIC */ + return g_ascii_isdigit (*str); +} + +MM3gppCgev +mm_3gpp_parse_cgev_indication_action (const gchar *str) +{ + str = mm_strip_tag (str, "+CGEV:"); + if (g_str_has_prefix (str, "NW DETACH")) + return MM_3GPP_CGEV_NW_DETACH; + if (g_str_has_prefix (str, "ME DETACH")) + return MM_3GPP_CGEV_ME_DETACH; + if (g_str_has_prefix (str, "NW CLASS")) + return MM_3GPP_CGEV_NW_CLASS; + if (g_str_has_prefix (str, "ME CLASS")) + return MM_3GPP_CGEV_ME_CLASS; + if (g_str_has_prefix (str, "NW PDN ACT")) + return MM_3GPP_CGEV_NW_ACT_PRIMARY; + if (g_str_has_prefix (str, "ME PDN ACT")) + return MM_3GPP_CGEV_ME_ACT_PRIMARY; + if (g_str_has_prefix (str, "NW ACT")) + return MM_3GPP_CGEV_NW_ACT_SECONDARY; + if (g_str_has_prefix (str, "ME ACT")) + return MM_3GPP_CGEV_ME_ACT_SECONDARY; + if (g_str_has_prefix (str, "NW DEACT")) + return (deact_secondary (str) ? MM_3GPP_CGEV_NW_DEACT_SECONDARY : MM_3GPP_CGEV_NW_DEACT_PDP); + if (g_str_has_prefix (str, "ME DEACT")) + return (deact_secondary (str) ? MM_3GPP_CGEV_ME_DEACT_SECONDARY : MM_3GPP_CGEV_ME_DEACT_PDP); + if (g_str_has_prefix (str, "NW PDN DEACT")) + return MM_3GPP_CGEV_NW_DEACT_PRIMARY; + if (g_str_has_prefix (str, "ME PDN DEACT")) + return MM_3GPP_CGEV_ME_DEACT_PRIMARY; + if (g_str_has_prefix (str, "NW MODIFY")) + return MM_3GPP_CGEV_NW_MODIFY; + if (g_str_has_prefix (str, "ME MODIFY")) + return MM_3GPP_CGEV_ME_MODIFY; + if (g_str_has_prefix (str, "NW REACT")) + return MM_3GPP_CGEV_NW_REACT; + if (g_str_has_prefix (str, "REJECT")) + return MM_3GPP_CGEV_REJECT; + return MM_3GPP_CGEV_UNKNOWN; +} + +/* + * +CGEV: NW DEACT , , [] + * +CGEV: ME DEACT , , [] + * +CGEV: REJECT , + * +CGEV: NW REACT , , [] + */ +gboolean +mm_3gpp_parse_cgev_indication_pdp (const gchar *str, + MM3gppCgev type, + gchar **out_pdp_type, + gchar **out_pdp_addr, + guint *out_cid, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info = NULL; + GError *inner_error = NULL; + gchar *pdp_type = NULL; + gchar *pdp_addr = NULL; + guint cid = 0; + + g_assert (type == MM_3GPP_CGEV_REJECT || + type == MM_3GPP_CGEV_NW_REACT || + type == MM_3GPP_CGEV_NW_DEACT_PDP || + type == MM_3GPP_CGEV_ME_DEACT_PDP); + + r = g_regex_new ("(?:" + "REJECT|" + "NW REACT|" + "NW DEACT|ME DEACT" + ")\\s*([^,]*),\\s*([^,]*)(?:,\\s*([0-9]+))?", 0, 0, NULL); + + str = mm_strip_tag (str, "+CGEV:"); + g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response"); + goto out; + } + + if (out_pdp_type && !(pdp_type = mm_get_string_unquoted_from_match_info (match_info, 1))) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP type"); + goto out; + } + + if (out_pdp_addr && !(pdp_addr = mm_get_string_unquoted_from_match_info (match_info, 2))) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing PDP addr"); + goto out; + } + + /* CID is optional */ + if (out_cid && + (g_match_info_get_match_count (match_info) >= 4) && + !mm_get_uint_from_match_info (match_info, 3, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing CID"); + goto out; + } + +out: + if (match_info) + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_free (pdp_type); + g_free (pdp_addr); + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_pdp_type) + *out_pdp_type = pdp_type; + if (out_pdp_addr) + *out_pdp_addr = pdp_addr; + if (out_cid) + *out_cid = cid; + return TRUE; +} + +/* + * +CGEV: NW PDN ACT + * +CGEV: ME PDN ACT [,[,]] + * +CGEV: NW PDN DEACT + * +CGEV: ME PDN DEACT + * + * NOTE: the special case of a "ME PDN ACT" notification with the additional + * and fields is telling us that was NOT connected + * but was connected instead, which may happen when trying to + * connect a IPv4v6 context but the modem ended up connecting a IPv4-only or + * IPv6-only context instead. We are right now ignoring this, and assuming the + * that we requested is the one reported as connected. + */ +gboolean +mm_3gpp_parse_cgev_indication_primary (const gchar *str, + MM3gppCgev type, + guint *out_cid, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info = NULL; + GError *inner_error = NULL; + guint cid = 0; + + g_assert ((type == MM_3GPP_CGEV_NW_ACT_PRIMARY) || + (type == MM_3GPP_CGEV_ME_ACT_PRIMARY) || + (type == MM_3GPP_CGEV_NW_DEACT_PRIMARY) || + (type == MM_3GPP_CGEV_ME_DEACT_PRIMARY)); + + r = g_regex_new ("(?:" + "NW PDN ACT|ME PDN ACT|" + "NW PDN DEACT|ME PDN DEACT|" + ")\\s*([0-9]+)", 0, 0, NULL); + + str = mm_strip_tag (str, "+CGEV:"); + g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response"); + goto out; + } + + if (out_cid && !mm_get_uint_from_match_info (match_info, 1, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing CID"); + goto out; + } + +out: + if (match_info) + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_cid) + *out_cid = cid; + return TRUE; +} + +/* + * +CGEV: NW ACT , , + * +CGEV: ME ACT , , + * +CGEV: NW DEACT , , + * +CGEV: ME DEACT , , + */ +gboolean +mm_3gpp_parse_cgev_indication_secondary (const gchar *str, + MM3gppCgev type, + guint *out_p_cid, + guint *out_cid, + guint *out_event_type, + GError **error) +{ + GRegex *r; + GMatchInfo *match_info = NULL; + GError *inner_error = NULL; + guint p_cid = 0; + guint cid = 0; + guint event_type = 0; + + g_assert (type == MM_3GPP_CGEV_NW_ACT_SECONDARY || + type == MM_3GPP_CGEV_ME_ACT_SECONDARY || + type == MM_3GPP_CGEV_NW_DEACT_SECONDARY || + type == MM_3GPP_CGEV_ME_DEACT_SECONDARY); + + r = g_regex_new ("(?:" + "NW ACT|ME ACT|" + "NW DEACT|ME DEACT" + ")\\s*([0-9]+),\\s*([0-9]+),\\s*([0-9]+)", 0, 0, NULL); + + str = mm_strip_tag (str, "+CGEV:"); + g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); + if (inner_error) + goto out; + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't match response"); + goto out; + } + + if (out_p_cid && !mm_get_uint_from_match_info (match_info, 1, &p_cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing primary CID"); + goto out; + } + + if (out_cid && !mm_get_uint_from_match_info (match_info, 2, &cid)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing secondary CID"); + goto out; + } + + if (out_event_type && !mm_get_uint_from_match_info (match_info, 3, &event_type)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Error parsing event type"); + goto out; + } + +out: + if (match_info) + g_match_info_free (match_info); + g_regex_unref (r); + + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + if (out_p_cid) + *out_p_cid = p_cid; + if (out_cid) + *out_cid = cid; + if (out_event_type) + *out_event_type = event_type; + return TRUE; +} + +/*************************************************************************/ void mm_3gpp_pdu_info_free (MM3gppPduInfo *info) @@ -2633,57 +3760,42 @@ /*************************************************************************/ -gchar * -mm_3gpp_parse_operator (const gchar *reply, - MMModemCharset cur_charset) +void +mm_3gpp_normalize_operator (gchar **operator, + MMModemCharset cur_charset) { - gchar *operator = NULL; + g_assert (operator); - if (reply && !strncmp (reply, "+COPS: ", 7)) { - /* Got valid reply */ - GRegex *r; - GMatchInfo *match_info; - - reply += 7; - r = g_regex_new ("(\\d),(\\d),\"(.+)\"", G_REGEX_UNGREEDY, 0, NULL); - if (!r) - return NULL; + if (*operator == NULL) + return; - g_regex_match (r, reply, 0, &match_info); - if (g_match_info_matches (match_info)) - operator = g_match_info_fetch (match_info, 3); + /* Despite +CSCS? may claim supporting UCS2, Some modems (e.g. Huawei) + * always report the operator name in ASCII in a +COPS response. */ + if (cur_charset == MM_MODEM_CHARSET_UCS2) { + gchar *tmp; - g_match_info_free (match_info); - g_regex_unref (r); + tmp = g_strdup (*operator); + /* In this case we're already checking UTF-8 validity */ + tmp = mm_charset_take_and_convert_to_utf8 (tmp, cur_charset); + if (tmp) { + g_clear_pointer (operator, g_free); + *operator = tmp; + goto out; + } } - if (operator) { - /* Some modems (Option & HSO) return the operator name as a hexadecimal - * string of the bytes of the operator name as encoded by the current - * character set. - */ - if (cur_charset == MM_MODEM_CHARSET_UCS2) { - /* In this case we're already checking UTF-8 validity */ - operator = mm_charset_take_and_convert_to_utf8 (operator, MM_MODEM_CHARSET_UCS2); - } - /* Ensure the operator name is valid UTF-8 so that we can send it - * through D-Bus and such. - */ - else if (!g_utf8_validate (operator, -1, NULL)) { - g_free (operator); - return NULL; - } + /* Charset is unknown or there was an error in conversion; try to see + * if the contents we got are valid UTF-8 already. */ + if (!g_utf8_validate (*operator, -1, NULL)) + g_clear_pointer (operator, g_free); - /* Some modems (Novatel LTE) return the operator name as "Unknown" when - * it fails to obtain the operator name. Return NULL in such case. - */ - if (operator && g_ascii_strcasecmp (operator, "unknown") == 0) { - g_free (operator); - return NULL; - } - } +out: - return operator; + /* Some modems (Novatel LTE) return the operator name as "Unknown" when + * it fails to obtain the operator name. Return NULL in such case. + */ + if (*operator && g_ascii_strcasecmp (*operator, "unknown") == 0) + g_clear_pointer (operator, g_free); } /*************************************************************************/ @@ -2720,14 +3832,21 @@ } /*************************************************************************/ - +/* ICCID validation */ +/* + * 89: telecom (2 digits) + * cc: country (2 digits) + * oo: operator (2 digits) + * aaaaaaaaaaaaa: operator-specific account number (13 digits) + * x: checksum (1 digit) + */ char * mm_3gpp_parse_iccid (const char *raw_iccid, GError **error) { gboolean swap; char *buf, *swapped = NULL; gsize len = 0; - int f_pos = -1, i; + int i; g_return_val_if_fail (raw_iccid != NULL, NULL); @@ -2738,13 +3857,20 @@ /* Make sure the buffer is only digits or 'F' */ buf = g_strdup (raw_iccid); for (len = 0; buf[len]; len++) { - if (isdigit (buf[len])) + /* Digit values allowed anywhere */ + if (g_ascii_isdigit (buf[len])) continue; - if (buf[len] == 'F' || buf[len] == 'f') { - buf[len] = 'F'; /* canonicalize the F */ - f_pos = len; + + /* There are operators (e.g. the Chinese CMCC operator) that abuse the + * fact that 4 bits are used to store the BCD encoded numbers, and also + * use the [A-F] range as valid characters for the ICCID. Explicitly + * allow this range in the operator-specific part. */ + if (len >= 6 && g_ascii_isxdigit (buf[len])) { + /* canonicalize hex digit */ + buf[len] = g_ascii_toupper (buf[len]); continue; } + if (buf[len] == '\"') { buf[len] = 0; break; @@ -2752,15 +3878,15 @@ /* Invalid character */ g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "ICCID response contained invalid character '%c'", - buf[len]); + "ICCID response contained invalid character '%c' at index '%zu'", + buf[len], len); goto error; } - /* BCD encoded ICCIDs are 20 digits long */ - if (len != 20) { + /* ICCIDs are 19 or 20 digits long */ + if (len < 19 || len > 20) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Invalid ICCID response size (was %zd, expected 20)", + "Invalid ICCID response size (was %zd, expected 19 or 20)", len); goto error; } @@ -2769,9 +3895,16 @@ * should be '89' for telecommunication purposes according to ISO/IEC 7812. */ if (buf[0] == '8' && buf[1] == '9') { - swap = FALSE; + swap = FALSE; } else if (buf[0] == '9' && buf[1] == '8') { - swap = TRUE; + /* swapped digits are only expected in raw +CRSM responses, which must all + * be 20-bytes long */ + if (len != 20) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Invalid ICCID response size while swap needed (expected 20)"); + goto error; + } + swap = TRUE; } else { /* FIXME: Instead of erroring out, revisit this solution if we find any SIM * that doesn't use '89' as the major industry identifier of the ICCID. @@ -2781,23 +3914,14 @@ goto error; } - /* Ensure if there's an 'F' that it's second-to-last if swap = TRUE, - * otherwise last if swap = FALSE */ - if (f_pos >= 0) { - if ((swap && (f_pos != len - 2)) || (!swap && (f_pos != len - 1))) { - g_set_error_literal (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "Invalid ICCID length (unexpected F position)"); - goto error; - } - } - if (swap) { /* Swap digits in the ICCID response to get the actual ICCID, each * group of 2 digits is reversed. * * 21436587 -> 12345678 */ - swapped = g_malloc0 (25); + g_assert (len == 20); + swapped = g_malloc0 (21); for (i = 0; i < 10; i++) { swapped[i * 2] = buf[(i * 2) + 1]; swapped[(i * 2) + 1] = buf[i * 2]; @@ -3252,7 +4376,7 @@ return 0; } - /* just substracting 1 from the enum value should give us the index */ + /* just subtracting 1 from the enum value should give us the index */ return (protocol - 1); } @@ -3449,8 +4573,11 @@ g_assert (iso8601p || tzp); /* at least one */ - /* Sample reply: +CCLK: "15/03/05,14:14:26-32" */ - r = g_regex_new ("[+]CCLK: \"(\\d+)/(\\d+)/(\\d+),(\\d+):(\\d+):(\\d+)([-+]\\d+)\"", 0, 0, NULL); + /* Sample replies: + * +CCLK: "15/03/05,14:14:26-32" + * +CCLK: 17/07/26,11:42:15+01 + */ + r = g_regex_new ("\\+CCLK:\\s*\"?(\\d+)/(\\d+)/(\\d+),(\\d+):(\\d+):(\\d+)([-+]\\d+)?\"?", 0, 0, NULL); g_assert (r != NULL); if (!g_regex_match_full (r, response, -1, 0, 0, &match_info, &match_error)) { @@ -3458,50 +4585,213 @@ g_propagate_error (error, match_error); g_prefix_error (error, "Could not parse +CCLK results: "); } else { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't match +CCLK reply"); + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't match +CCLK reply: %s", response); } - } else { - /* Remember that g_match_info_get_match_count() includes match #0 */ - g_assert (g_match_info_get_match_count (match_info) >= 8); + goto out; + } + + /* Remember that g_match_info_get_match_count() includes match #0 */ + g_assert (g_match_info_get_match_count (match_info) >= 7); + + /* Parse mandatory date and time fields */ + if (!mm_get_uint_from_match_info (match_info, 1, &year) || + !mm_get_uint_from_match_info (match_info, 2, &month) || + !mm_get_uint_from_match_info (match_info, 3, &day) || + !mm_get_uint_from_match_info (match_info, 4, &hour) || + !mm_get_uint_from_match_info (match_info, 5, &minute) || + !mm_get_uint_from_match_info (match_info, 6, &second)) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse +CCLK reply: %s", response); + goto out; + } - if (mm_get_uint_from_match_info (match_info, 1, &year) && - mm_get_uint_from_match_info (match_info, 2, &month) && - mm_get_uint_from_match_info (match_info, 3, &day) && - mm_get_uint_from_match_info (match_info, 4, &hour) && - mm_get_uint_from_match_info (match_info, 5, &minute) && - mm_get_uint_from_match_info (match_info, 6, &second) && - mm_get_int_from_match_info (match_info, 7, &tz)) { - /* adjust year */ + /* Read optional time zone offset; if not given assume UTC (tz = 0). + * Note that timezone offset is given in 15 minute intervals. + */ + if ((g_match_info_get_match_count (match_info) >= 8) && + (!mm_get_int_from_match_info (match_info, 7, &tz))) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Failed to parse timezone in +CCLK reply: %s", response); + goto out; + } + + /* Adjust year to support YYYY format, as per +CSDF in 3GPP TS 27.007. Also, + * don't assume the reported date is actually the current real one, as some + * devices report an initial date of e.g. January 1st 1980. */ + if (year < 100) { + if (year >= 70) + year += 1900; + else year += 2000; - /* - * tz = timezone offset in 15 minute intervals - */ - if (iso8601p) { - /* Return ISO-8601 format date/time string */ - *iso8601p = mm_new_iso8601_time (year, month, day, hour, - minute, second, - TRUE, (tz * 15)); - } - if (tzp) { - *tzp = mm_network_timezone_new (); - mm_network_timezone_set_offset (*tzp, tz * 15); - } + } - ret = TRUE; - } else { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Failed to parse +CCLK reply"); - } + if (tzp) { + *tzp = mm_network_timezone_new (); + mm_network_timezone_set_offset (*tzp, tz * 15); } - if (match_info) - g_match_info_free (match_info); + if (iso8601p) { + /* Return ISO-8601 format date/time string */ + *iso8601p = mm_new_iso8601_time (year, month, day, hour, + minute, second, + TRUE, (tz * 15)); + } + + ret = TRUE; + + out: + g_match_info_free (match_info); g_regex_unref (r); return ret; } + +/*****************************************************************************/ +/* +CSIM response parser */ +#define MM_MIN_SIM_RETRY_HEX 0x63C0 +#define MM_MAX_SIM_RETRY_HEX 0x63CF + +gint +mm_parse_csim_response (const gchar *response, + GError **error) +{ + GMatchInfo *match_info = NULL; + GRegex *r = NULL; + gchar *str_code = NULL; + gint retries = -1; + guint hex_code; + GError *inner_error = NULL; + + r = g_regex_new ("\\+CSIM:\\s*[0-9]+,\\s*\".*([0-9a-fA-F]{4})\"", G_REGEX_RAW, 0, NULL); + g_regex_match (r, response, 0, &match_info); + + if (!g_match_info_matches (match_info)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Could not recognize +CSIM response '%s'", response); + goto out; + } + + str_code = mm_get_string_unquoted_from_match_info (match_info, 1); + if (str_code == NULL) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Could not find expected string code in response '%s'", response); + goto out; + } + + if (!mm_get_uint_from_hex_str (str_code, &hex_code)) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Could not recognize expected hex code in response '%s'", response); + goto out; + } + + switch (hex_code) { + case 0x6300: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "SIM verification failed"); + goto out; + case 0x6983: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "SIM authentication method blocked"); + goto out; + case 0x6984: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "SIM reference data invalidated"); + goto out; + case 0x6A86: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Incorrect parameters in SIM request"); + goto out; + case 0x6A88: + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "SIM reference data not found"); + goto out; + default: + break; + } + + if (hex_code < MM_MIN_SIM_RETRY_HEX || hex_code > MM_MAX_SIM_RETRY_HEX) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unknown error returned '0x%04x'", hex_code); + goto out; + } + + retries = (gint)(hex_code - MM_MIN_SIM_RETRY_HEX); + +out: + g_regex_unref (r); + g_match_info_free (match_info); + g_free (str_code); + + if (inner_error) { + g_propagate_error (error, inner_error); + return -1; + } + + g_assert (retries >= 0); + return retries; +} + +/*****************************************************************************/ + +gboolean +mm_parse_supl_address (const gchar *supl, + gchar **out_fqdn, + guint32 *out_ip, + guint16 *out_port, + GError **error) +{ + gboolean valid = FALSE; + gchar **split; + guint port; + guint32 ip; + + split = g_strsplit (supl, ":", -1); + if (g_strv_length (split) != 2) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid SUPL address format: expected FQDN:PORT or IP:PORT"); + goto out; + } + + if (!mm_get_uint_from_str (split[1], &port)) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid SUPL port number specified: not a number: %s", split[1]); + goto out; + } + + if (port == 0 || port > G_MAXUINT16) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, + "Invalid SUPL port number specified: out of range: %u", port); + goto out; + } + + /* Port is valid */ + if (out_port) + *out_port = (guint16) port; + + /* Try to parse first item as IP */ + if (inet_pton (AF_INET, split[0], &ip) <= 0) { + /* Otherwise, assume it's a domain name */ + if (out_fqdn) + *out_fqdn = g_strdup (split[0]); + if (out_ip) + *out_ip = 0; + } else { + if (out_ip) + *out_ip = ip; + if (out_fqdn) + *out_fqdn = NULL; + } + + valid = TRUE; + +out: + g_strfreev (split); + return valid; +} diff -Nru modemmanager-1.6.8/src/mm-modem-helpers.h modemmanager-1.10.0/src/mm-modem-helpers.h --- modemmanager-1.6.8/src/mm-modem-helpers.h 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers.h 2019-01-15 15:57:35.000000000 +0100 @@ -57,6 +57,7 @@ GError **error); guint mm_count_bits_set (gulong number); +guint mm_find_bit_set (gulong number); gchar *mm_create_device_identifier (guint vid, guint pid, @@ -87,12 +88,34 @@ GArray *mm_filter_supported_capabilities (MMModemCapability all, const GArray *supported_combinations); +gchar *mm_bcd_to_string (const guint8 *bcd, gsize bcd_len); + /*****************************************************************************/ /* VOICE specific helpers and utilities */ /*****************************************************************************/ -GRegex *mm_voice_ring_regex_get (void); -GRegex *mm_voice_cring_regex_get(void); -GRegex *mm_voice_clip_regex_get (void); +GRegex *mm_voice_ring_regex_get (void); +GRegex *mm_voice_cring_regex_get (void); +GRegex *mm_voice_clip_regex_get (void); + +/*****************************************************************************/ +/* SERIAL specific helpers and utilities */ + +/* AT+IFC=? response parser. + * For simplicity, we'll only consider flow control methods available in both + * TE and TA. */ + +typedef enum { /*< underscore_name=mm_flow_control >*/ + MM_FLOW_CONTROL_UNKNOWN = 0, + MM_FLOW_CONTROL_NONE = 1 << 0, /* IFC=0,0 */ + MM_FLOW_CONTROL_XON_XOFF = 1 << 1, /* IFC=1,1 */ + MM_FLOW_CONTROL_RTS_CTS = 1 << 2, /* IFC=2,2 */ +} MMFlowControl; + +MMFlowControl mm_parse_ifc_test_response (const gchar *response, + GError **error); + +MMFlowControl mm_flow_control_from_string (const gchar *str, + GError **error); /*****************************************************************************/ /* 3GPP specific helpers and utilities */ @@ -102,6 +125,7 @@ GPtrArray *mm_3gpp_creg_regex_get (gboolean solicited); void mm_3gpp_creg_regex_destroy (GPtrArray *array); GRegex *mm_3gpp_ciev_regex_get (void); +GRegex *mm_3gpp_cgev_regex_get (void); GRegex *mm_3gpp_cusd_regex_get (void); GRegex *mm_3gpp_cmti_regex_get (void); GRegex *mm_3gpp_cds_regex_get (void); @@ -122,6 +146,18 @@ GList *mm_3gpp_parse_cops_test_response (const gchar *reply, GError **error); +/* AT+COPS? (current operator) response parser */ +gboolean mm_3gpp_parse_cops_read_response (const gchar *response, + guint *out_mode, + guint *out_format, + gchar **out_operator, + MMModemAccessTechnology *out_act, + GError **error); + +/* Logic to compare two APN names */ +gboolean mm_3gpp_cmp_apn_name (const gchar *requested, + const gchar *existing); + /* AT+CGDCONT=? (PDP context format) test parser */ typedef struct { guint min_cid; @@ -142,6 +178,17 @@ GList *mm_3gpp_parse_cgdcont_read_response (const gchar *reply, GError **error); +/* AT+CGACT? (active PDP context query) response parser */ +typedef struct { + guint cid; + gboolean active; +} MM3gppPdpContextActive; +void mm_3gpp_pdp_context_active_list_free (GList *pdp_active_list); +gint mm_3gpp_pdp_context_active_cmp (MM3gppPdpContextActive *a, + MM3gppPdpContextActive *b); +GList *mm_3gpp_parse_cgact_read_response (const gchar *reply, + GError **error); + /* CREG/CGREG response/unsolicited message parser */ gboolean mm_3gpp_parse_creg_response (GMatchInfo *info, MMModem3gppRegistrationState *out_reg_state, @@ -187,8 +234,31 @@ gboolean *enabled); /* AT+CNUM (Own numbers) response parser */ -GStrv mm_3gpp_parse_cnum_exec_response (const gchar *reply, - GError **error); +GStrv mm_3gpp_parse_cnum_exec_response (const gchar *reply); + +/* AT+CMER=? (Mobile Equipment Event Reporting) response parser */ +typedef enum { /*< underscore_name=mm_3gpp_cmer_mode >*/ + MM_3GPP_CMER_MODE_NONE = 0, + MM_3GPP_CMER_MODE_DISCARD_URCS = 1 << 0, + MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED = 1 << 1, + MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED = 1 << 2, + MM_3GPP_CMER_MODE_FORWARD_URCS = 1 << 3, +} MM3gppCmerMode; +typedef enum { /*< underscore_name=mm_3gpp_cmer_ind >*/ + MM_3GPP_CMER_IND_NONE = 0, + /* no indicator event reporting */ + MM_3GPP_CMER_IND_DISABLE = 1 << 0, + /* Only indicator events that are not caused by +CIND */ + MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND = 1 << 1, + /* All indicator events */ + MM_3GPP_CMER_IND_ENABLE_ALL = 1 << 2, +} MM3gppCmerInd; +gchar *mm_3gpp_build_cmer_set_request (MM3gppCmerMode mode, + MM3gppCmerInd ind); +gboolean mm_3gpp_parse_cmer_test_response (const gchar *reply, + MM3gppCmerMode *supported_modes, + MM3gppCmerInd *supported_inds, + GError **error); /* AT+CIND=? (Supported indicators) response parser */ typedef struct MM3gppCindResponse MM3gppCindResponse; @@ -203,6 +273,47 @@ GByteArray *mm_3gpp_parse_cind_read_response (const gchar *reply, GError **error); +/* +CGEV indication parser */ +typedef enum { + MM_3GPP_CGEV_UNKNOWN, + MM_3GPP_CGEV_NW_DETACH, + MM_3GPP_CGEV_ME_DETACH, + MM_3GPP_CGEV_NW_CLASS, + MM_3GPP_CGEV_ME_CLASS, + MM_3GPP_CGEV_NW_ACT_PRIMARY, + MM_3GPP_CGEV_ME_ACT_PRIMARY, + MM_3GPP_CGEV_NW_ACT_SECONDARY, + MM_3GPP_CGEV_ME_ACT_SECONDARY, + MM_3GPP_CGEV_NW_DEACT_PRIMARY, + MM_3GPP_CGEV_ME_DEACT_PRIMARY, + MM_3GPP_CGEV_NW_DEACT_SECONDARY, + MM_3GPP_CGEV_ME_DEACT_SECONDARY, + MM_3GPP_CGEV_NW_DEACT_PDP, + MM_3GPP_CGEV_ME_DEACT_PDP, + MM_3GPP_CGEV_NW_MODIFY, + MM_3GPP_CGEV_ME_MODIFY, + MM_3GPP_CGEV_REJECT, + MM_3GPP_CGEV_NW_REACT, +} MM3gppCgev; + +MM3gppCgev mm_3gpp_parse_cgev_indication_action (const gchar *str); +gboolean mm_3gpp_parse_cgev_indication_pdp (const gchar *str, + MM3gppCgev type, + gchar **out_pdp_type, + gchar **out_pdp_addr, + guint *out_cid, + GError **error); +gboolean mm_3gpp_parse_cgev_indication_primary (const gchar *str, + MM3gppCgev type, + guint *out_cid, + GError **error); +gboolean mm_3gpp_parse_cgev_indication_secondary (const gchar *str, + MM3gppCgev type, + guint *out_p_cid, + guint *out_cid, + guint *out_event_type, + GError **error); + /* AT+CMGL=4 (list sms parts) response parser */ typedef struct { gint index; @@ -227,6 +338,29 @@ gchar **hex, GError **error); +/* AT+CGCONTRDP=N response parser */ +gboolean mm_3gpp_parse_cgcontrdp_response (const gchar *response, + guint *out_cid, + guint *out_bearer_id, + gchar **out_apn, + gchar **out_local_address, + gchar **out_subnet, + gchar **out_gateway_address, + gchar **out_dns_primary_address, + gchar **out_dns_secondary_address, + GError **error); + +/* CFUN? response parser + * Note: a custom method with values not translated into MMModemPowerState is + * provided, because they may be vendor specific. + */ +gboolean mm_3gpp_parse_cfun_query_response (const gchar *response, + guint *out_state, + GError **error); +gboolean mm_3gpp_parse_cfun_query_generic_response (const gchar *response, + MMModemPowerState *out_state, + GError **error); + /* +CESQ response parser */ gboolean mm_3gpp_parse_cesq_response (const gchar *response, guint *out_rxlev, @@ -243,6 +377,12 @@ MMSignal **out_lte, GError **error); +/* CEMODE? response parser */ +gchar *mm_3gpp_build_cemode_set_request (MMModem3gppEpsUeModeOperation mode); +gboolean mm_3gpp_parse_cemode_query_response (const gchar *response, + MMModem3gppEpsUeModeOperation *out_mode, + GError **error); + /* Additional 3GPP-specific helpers */ MMModem3gppFacility mm_3gpp_acronym_to_facility (const gchar *str); @@ -250,8 +390,8 @@ MMModemAccessTechnology mm_string_to_access_tech (const gchar *string); -gchar *mm_3gpp_parse_operator (const gchar *reply, - MMModemCharset cur_charset); +void mm_3gpp_normalize_operator (gchar **operator, + MMModemCharset cur_charset); gboolean mm_3gpp_parse_operator_id (const gchar *operator_id, guint16 *mcc, @@ -263,6 +403,30 @@ char *mm_3gpp_parse_iccid (const char *raw_iccid, GError **error); +gboolean +mm_3gpp_rscp_level_to_rscp (guint rscp_level, + gdouble *out_rscp); + +gboolean +mm_3gpp_rxlev_to_rssi (guint rxlev, + gdouble *out_rssi); + +gboolean +mm_3gpp_ecn0_level_to_ecio (guint ecn0_level, + gdouble *out_ecio); + +gboolean +mm_3gpp_rsrq_level_to_rsrq (guint rsrq_level, + gdouble *out_rsrq); + +gboolean +mm_3gpp_rsrp_level_to_rsrp (guint rsrp_level, + gdouble *out_rsrp); + +gboolean +mm_3gpp_rssnr_level_to_rssnr (gint rssnr_level, + gdouble *out_rssnr); + /*****************************************************************************/ /* CDMA specific helpers and utilities */ /*****************************************************************************/ @@ -309,4 +473,14 @@ MMNetworkTimezone **tzp, GError **error); +/* +CSIM response parser */ +gint mm_parse_csim_response (const gchar *response, + GError **error); + +gboolean mm_parse_supl_address (const gchar *supl, + gchar **out_fqdn, + guint32 *out_ip, + guint16 *out_port, + GError **error); + #endif /* MM_MODEM_HELPERS_H */ diff -Nru modemmanager-1.6.8/src/mm-modem-helpers-mbim.c modemmanager-1.10.0/src/mm-modem-helpers-mbim.c --- modemmanager-1.6.8/src/mm-modem-helpers-mbim.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers-mbim.c 2019-01-15 15:57:35.000000000 +0100 @@ -21,6 +21,28 @@ /*****************************************************************************/ +MMModemCapability +mm_modem_capability_from_mbim_device_caps (MbimCellularClass caps_cellular_class, + MbimDataClass caps_data_class) +{ + MMModemCapability mask = 0; + + if (caps_cellular_class & MBIM_CELLULAR_CLASS_GSM) + mask |= MM_MODEM_CAPABILITY_GSM_UMTS; + +#if 0 /* Disable until we add MBIM CDMA support */ + if (caps_cellular_class & MBIM_CELLULAR_CLASS_CDMA) + mask |= MM_MODEM_CAPABILITY_CDMA_EVDO; +#endif + + if (caps_data_class & MBIM_DATA_CLASS_LTE) + mask |= MM_MODEM_CAPABILITY_LTE; + + return mask; +} + +/*****************************************************************************/ + MMModemLock mm_modem_lock_from_mbim_pin_type (MbimPinType pin_type) { @@ -239,10 +261,30 @@ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED, "Not authorized for this CSG"); + case MBIM_NW_ERROR_INSUFFICIENT_RESOURCES: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES, + "Insufficient resources"); case MBIM_NW_ERROR_MISSING_OR_UNKNOWN_APN: return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_MISSING_OR_UNKNOWN_APN, "Missing or unknown APN"); + case MBIM_NW_ERROR_UNKNOWN_PDP_ADDRESS_OR_TYPE: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_ADDRESS_OR_TYPE, + "Unknown PDP address or type"); + case MBIM_NW_ERROR_USER_AUTHENTICATION_FAILED: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED, + "User authentication failed"); + case MBIM_NW_ERROR_ACTIVATION_REJECTED_BY_GGSN_OR_GW: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_BY_GGSN_OR_GW, + "Activation rejected by GGSN or GW"); + case MBIM_NW_ERROR_ACTIVATION_REJECTED_UNSPECIFIED: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_UNSPECIFIED, + "Activation rejected; unspecified"); case MBIM_NW_ERROR_SERVICE_OPTION_NOT_SUPPORTED: return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED, @@ -255,6 +297,14 @@ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER, "Service option temporarily out of order"); + case MBIM_NW_ERROR_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED, + "Maximum number of PDP contexts reached"); + case MBIM_NW_ERROR_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN: + return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, + MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUESTED_APN_NOT_SUPPORTED, + "Requested APN not supported"); default: return g_error_new (MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN, @@ -264,6 +314,110 @@ } /*****************************************************************************/ + +MMBearerAllowedAuth +mm_bearer_allowed_auth_from_mbim_auth_protocol (MbimAuthProtocol auth_protocol) +{ + switch (auth_protocol) { + case MBIM_AUTH_PROTOCOL_NONE: + return MM_BEARER_ALLOWED_AUTH_NONE; + case MBIM_AUTH_PROTOCOL_PAP: + return MM_BEARER_ALLOWED_AUTH_PAP; + case MBIM_AUTH_PROTOCOL_CHAP: + return MM_BEARER_ALLOWED_AUTH_CHAP; + case MBIM_AUTH_PROTOCOL_MSCHAPV2: + return MM_BEARER_ALLOWED_AUTH_MSCHAPV2; + default: + return MM_BEARER_ALLOWED_AUTH_UNKNOWN; + } +} + +MbimAuthProtocol +mm_bearer_allowed_auth_to_mbim_auth_protocol (MMBearerAllowedAuth bearer_auth, + GError **error) +{ + gchar *str; + + /* NOTE: the input is a BITMASK, so we try to find a "best match" */ + + if (bearer_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) { + mm_dbg ("Using default (PAP) authentication method"); + return MBIM_AUTH_PROTOCOL_PAP; + } + if (bearer_auth & MM_BEARER_ALLOWED_AUTH_PAP) + return MBIM_AUTH_PROTOCOL_PAP; + if (bearer_auth & MM_BEARER_ALLOWED_AUTH_CHAP) + return MBIM_AUTH_PROTOCOL_CHAP; + if (bearer_auth & MM_BEARER_ALLOWED_AUTH_MSCHAPV2) + return MBIM_AUTH_PROTOCOL_MSCHAPV2; + if (bearer_auth & MM_BEARER_ALLOWED_AUTH_NONE) + return MBIM_AUTH_PROTOCOL_NONE; + + str = mm_bearer_allowed_auth_build_string_from_mask (bearer_auth); + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Unsupported authentication methods (%s)", + str); + g_free (str); + return MBIM_AUTH_PROTOCOL_NONE; +} + +/*****************************************************************************/ + +MMBearerIpFamily +mm_bearer_ip_family_from_mbim_context_ip_type (MbimContextIpType ip_type) +{ + switch (ip_type) { + case MBIM_CONTEXT_IP_TYPE_IPV4: + return MM_BEARER_IP_FAMILY_IPV4; + case MBIM_CONTEXT_IP_TYPE_IPV6: + return MM_BEARER_IP_FAMILY_IPV6; + case MBIM_CONTEXT_IP_TYPE_IPV4V6: + return MM_BEARER_IP_FAMILY_IPV4V6; + case MBIM_CONTEXT_IP_TYPE_IPV4_AND_IPV6: + return MM_BEARER_IP_FAMILY_IPV4 | MM_BEARER_IP_FAMILY_IPV6; + default: + return MM_BEARER_IP_FAMILY_NONE; + } +} + +MbimContextIpType +mm_bearer_ip_family_to_mbim_context_ip_type (MMBearerIpFamily ip_family, + GError **error) +{ + gchar *str; + + /* NOTE: the input is a BITMASK, so we try to find a "best match" */ + + switch ((guint)ip_family) { + case MM_BEARER_IP_FAMILY_IPV4: + return MBIM_CONTEXT_IP_TYPE_IPV4; + case MM_BEARER_IP_FAMILY_IPV6: + return MBIM_CONTEXT_IP_TYPE_IPV6; + case MM_BEARER_IP_FAMILY_IPV4V6: + return MBIM_CONTEXT_IP_TYPE_IPV4V6; + case (MM_BEARER_IP_FAMILY_IPV4 | MM_BEARER_IP_FAMILY_IPV6): + return MBIM_CONTEXT_IP_TYPE_IPV4_AND_IPV6; + case MM_BEARER_IP_FAMILY_NONE: + case MM_BEARER_IP_FAMILY_ANY: + /* A valid default IP family should have been specified */ + g_assert_not_reached (); + default: + break; + } + + str = mm_bearer_ip_family_build_string_from_mask (ip_family); + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_UNSUPPORTED, + "Unsupported IP type configuration: '%s'", + str); + g_free (str); + return MBIM_CONTEXT_IP_TYPE_DEFAULT; +} + +/*****************************************************************************/ MMSmsState mm_sms_state_from_mbim_message_status (MbimSmsStatus status) diff -Nru modemmanager-1.6.8/src/mm-modem-helpers-mbim.h modemmanager-1.10.0/src/mm-modem-helpers-mbim.h --- modemmanager-1.6.8/src/mm-modem-helpers-mbim.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers-mbim.h 2019-01-15 15:57:35.000000000 +0100 @@ -24,6 +24,9 @@ /*****************************************************************************/ /* MBIM/BasicConnect to MM translations */ +MMModemCapability mm_modem_capability_from_mbim_device_caps (MbimCellularClass caps_cellular_class, + MbimDataClass caps_data_class); + MMModemLock mm_modem_lock_from_mbim_pin_type (MbimPinType pin_type); MMModem3gppRegistrationState mm_modem_3gpp_registration_state_from_mbim_register_state (MbimRegisterState state); @@ -36,6 +39,13 @@ GError *mm_mobile_equipment_error_from_mbim_nw_error (MbimNwError nw_error); +MMBearerAllowedAuth mm_bearer_allowed_auth_from_mbim_auth_protocol (MbimAuthProtocol auth_protocol); +MbimAuthProtocol mm_bearer_allowed_auth_to_mbim_auth_protocol (MMBearerAllowedAuth bearer_auth, + GError **error); +MMBearerIpFamily mm_bearer_ip_family_from_mbim_context_ip_type (MbimContextIpType ip_type); +MbimContextIpType mm_bearer_ip_family_to_mbim_context_ip_type (MMBearerIpFamily ip_family, + GError **error); + /*****************************************************************************/ /* MBIM/SMS to MM translations */ diff -Nru modemmanager-1.6.8/src/mm-modem-helpers-qmi.c modemmanager-1.10.0/src/mm-modem-helpers-qmi.c --- modemmanager-1.6.8/src/mm-modem-helpers-qmi.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers-qmi.c 2019-01-15 15:57:35.000000000 +0100 @@ -10,9 +10,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * - * Copyright (C) 2012 Google, Inc. + * Copyright (C) 2012-2018 Google, Inc. + * Copyright (C) 2018 Aleksander Morgado */ +#include + +#include +#include + #include "mm-modem-helpers-qmi.h" #include "mm-enums-types.h" #include "mm-log.h" @@ -161,26 +167,26 @@ /* CDMA bands */ { (QMI_DMS_BAND_CAPABILITY_BC_0_A_SYSTEM | QMI_DMS_BAND_CAPABILITY_BC_0_B_SYSTEM), - MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 + MM_MODEM_BAND_CDMA_BC0 }, - { QMI_DMS_BAND_CAPABILITY_BC_1_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC1_PCS_1900 }, - { QMI_DMS_BAND_CAPABILITY_BC_2, MM_MODEM_BAND_CDMA_BC2_TACS }, - { QMI_DMS_BAND_CAPABILITY_BC_3_A_SYSTEM, MM_MODEM_BAND_CDMA_BC3_JTACS }, - { QMI_DMS_BAND_CAPABILITY_BC_4_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS }, - { QMI_DMS_BAND_CAPABILITY_BC_5_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC5_NMT450 }, - { QMI_DMS_BAND_CAPABILITY_BC_6, MM_MODEM_BAND_CDMA_BC6_IMT2000 }, - { QMI_DMS_BAND_CAPABILITY_BC_7, MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 }, - { QMI_DMS_BAND_CAPABILITY_BC_8, MM_MODEM_BAND_CDMA_BC8_1800 }, - { QMI_DMS_BAND_CAPABILITY_BC_9, MM_MODEM_BAND_CDMA_BC9_900 }, - { QMI_DMS_BAND_CAPABILITY_BC_10, MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 }, - { QMI_DMS_BAND_CAPABILITY_BC_11, MM_MODEM_BAND_CDMA_BC11_PAMR_400 }, - { QMI_DMS_BAND_CAPABILITY_BC_12, MM_MODEM_BAND_CDMA_BC12_PAMR_800 }, - { QMI_DMS_BAND_CAPABILITY_BC_14, MM_MODEM_BAND_CDMA_BC14_PCS2_1900 }, - { QMI_DMS_BAND_CAPABILITY_BC_15, MM_MODEM_BAND_CDMA_BC15_AWS }, - { QMI_DMS_BAND_CAPABILITY_BC_16, MM_MODEM_BAND_CDMA_BC16_US_2500 }, - { QMI_DMS_BAND_CAPABILITY_BC_17, MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 }, - { QMI_DMS_BAND_CAPABILITY_BC_18, MM_MODEM_BAND_CDMA_BC18_US_PS_700 }, - { QMI_DMS_BAND_CAPABILITY_BC_19, MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 }, + { QMI_DMS_BAND_CAPABILITY_BC_1_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC1 }, + { QMI_DMS_BAND_CAPABILITY_BC_2, MM_MODEM_BAND_CDMA_BC2 }, + { QMI_DMS_BAND_CAPABILITY_BC_3_A_SYSTEM, MM_MODEM_BAND_CDMA_BC3 }, + { QMI_DMS_BAND_CAPABILITY_BC_4_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC4 }, + { QMI_DMS_BAND_CAPABILITY_BC_5_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC5 }, + { QMI_DMS_BAND_CAPABILITY_BC_6, MM_MODEM_BAND_CDMA_BC6 }, + { QMI_DMS_BAND_CAPABILITY_BC_7, MM_MODEM_BAND_CDMA_BC7 }, + { QMI_DMS_BAND_CAPABILITY_BC_8, MM_MODEM_BAND_CDMA_BC8 }, + { QMI_DMS_BAND_CAPABILITY_BC_9, MM_MODEM_BAND_CDMA_BC9 }, + { QMI_DMS_BAND_CAPABILITY_BC_10, MM_MODEM_BAND_CDMA_BC10 }, + { QMI_DMS_BAND_CAPABILITY_BC_11, MM_MODEM_BAND_CDMA_BC11 }, + { QMI_DMS_BAND_CAPABILITY_BC_12, MM_MODEM_BAND_CDMA_BC12 }, + { QMI_DMS_BAND_CAPABILITY_BC_14, MM_MODEM_BAND_CDMA_BC14 }, + { QMI_DMS_BAND_CAPABILITY_BC_15, MM_MODEM_BAND_CDMA_BC15 }, + { QMI_DMS_BAND_CAPABILITY_BC_16, MM_MODEM_BAND_CDMA_BC16 }, + { QMI_DMS_BAND_CAPABILITY_BC_17, MM_MODEM_BAND_CDMA_BC17 }, + { QMI_DMS_BAND_CAPABILITY_BC_18, MM_MODEM_BAND_CDMA_BC18 }, + { QMI_DMS_BAND_CAPABILITY_BC_19, MM_MODEM_BAND_CDMA_BC19 }, /* GSM bands */ { QMI_DMS_BAND_CAPABILITY_GSM_DCS_1800, MM_MODEM_BAND_DCS }, @@ -190,32 +196,22 @@ }, { QMI_DMS_BAND_CAPABILITY_GSM_PCS_1900, MM_MODEM_BAND_PCS }, { QMI_DMS_BAND_CAPABILITY_GSM_850, MM_MODEM_BAND_G850 }, + { QMI_DMS_BAND_CAPABILITY_GSM_450, MM_MODEM_BAND_G450 }, + { QMI_DMS_BAND_CAPABILITY_GSM_480, MM_MODEM_BAND_G480 }, + { QMI_DMS_BAND_CAPABILITY_GSM_750, MM_MODEM_BAND_G750 }, /* UMTS/WCDMA bands */ - { QMI_DMS_BAND_CAPABILITY_WCDMA_2100, MM_MODEM_BAND_U2100 }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800, MM_MODEM_BAND_U1800 }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900, MM_MODEM_BAND_U1900 }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US, MM_MODEM_BAND_U17IV }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_800, MM_MODEM_BAND_U800 }, - { - (QMI_DMS_BAND_CAPABILITY_WCDMA_850_US | QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN), - MM_MODEM_BAND_U850 - }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_900, MM_MODEM_BAND_U900 }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN, MM_MODEM_BAND_U17IX }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_2600, MM_MODEM_BAND_U2600 } - - /* NOTE. The following bands were unmatched: - * - * - QMI_DMS_BAND_CAPABILITY_GSM_900_PRIMARY - * - QMI_DMS_BAND_CAPABILITY_GSM_450 - * - QMI_DMS_BAND_CAPABILITY_GSM_480 - * - QMI_DMS_BAND_CAPABILITY_GSM_750 - * - QMI_DMS_BAND_CAPABILITY_GSM_900_RAILWAILS - * - QMI_DMS_BAND_CAPABILITY_WCDMA_1500 - * - MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 - * - MM_MODEM_BAND_U1900 - */ + { QMI_DMS_BAND_CAPABILITY_WCDMA_2100, MM_MODEM_BAND_UTRAN_1 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800, MM_MODEM_BAND_UTRAN_3 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900, MM_MODEM_BAND_UTRAN_2 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US, MM_MODEM_BAND_UTRAN_4 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_800, MM_MODEM_BAND_UTRAN_6 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_850_US, MM_MODEM_BAND_UTRAN_5 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_900, MM_MODEM_BAND_UTRAN_8 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN, MM_MODEM_BAND_UTRAN_9 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_2600, MM_MODEM_BAND_UTRAN_7 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_1500, MM_MODEM_BAND_UTRAN_11 }, + { QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN, MM_MODEM_BAND_UTRAN_19 }, }; static void @@ -258,46 +254,38 @@ } DmsLteBandsMap; static const DmsLteBandsMap dms_lte_bands_map [] = { - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_1, MM_MODEM_BAND_EUTRAN_I }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_2, MM_MODEM_BAND_EUTRAN_II }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_3, MM_MODEM_BAND_EUTRAN_III }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_4, MM_MODEM_BAND_EUTRAN_IV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_5, MM_MODEM_BAND_EUTRAN_V }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_6, MM_MODEM_BAND_EUTRAN_VI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_7, MM_MODEM_BAND_EUTRAN_VII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_8, MM_MODEM_BAND_EUTRAN_VIII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_9, MM_MODEM_BAND_EUTRAN_IX }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_10, MM_MODEM_BAND_EUTRAN_X }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_11, MM_MODEM_BAND_EUTRAN_XI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_12, MM_MODEM_BAND_EUTRAN_XII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_13, MM_MODEM_BAND_EUTRAN_XIII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_14, MM_MODEM_BAND_EUTRAN_XIV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_17, MM_MODEM_BAND_EUTRAN_XVII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_18, MM_MODEM_BAND_EUTRAN_XVIII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_19, MM_MODEM_BAND_EUTRAN_XIX }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_20, MM_MODEM_BAND_EUTRAN_XX }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_21, MM_MODEM_BAND_EUTRAN_XXI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24, MM_MODEM_BAND_EUTRAN_XXIV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25, MM_MODEM_BAND_EUTRAN_XXV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33, MM_MODEM_BAND_EUTRAN_XXXIII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34, MM_MODEM_BAND_EUTRAN_XXXIV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_35, MM_MODEM_BAND_EUTRAN_XXXV }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_36, MM_MODEM_BAND_EUTRAN_XXXVI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_37, MM_MODEM_BAND_EUTRAN_XXXVII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_38, MM_MODEM_BAND_EUTRAN_XXXVIII }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_39, MM_MODEM_BAND_EUTRAN_XXXIX }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_40, MM_MODEM_BAND_EUTRAN_XL }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_41, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_42, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_43, MM_MODEM_BAND_EUTRAN_XLIII } - - /* NOTE. The following bands were unmatched: - * - * - MM_MODEM_BAND_EUTRAN_XXII - * - MM_MODEM_BAND_EUTRAN_XXIII - * - MM_MODEM_BAND_EUTRAN_XXVI - * - MM_MODEM_BAND_EUTRAN_XLIV - */ + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_1, MM_MODEM_BAND_EUTRAN_1 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_2, MM_MODEM_BAND_EUTRAN_2 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_3, MM_MODEM_BAND_EUTRAN_3 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_4, MM_MODEM_BAND_EUTRAN_4 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_5, MM_MODEM_BAND_EUTRAN_5 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_6, MM_MODEM_BAND_EUTRAN_6 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_7, MM_MODEM_BAND_EUTRAN_7 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_8, MM_MODEM_BAND_EUTRAN_8 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_9, MM_MODEM_BAND_EUTRAN_9 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_10, MM_MODEM_BAND_EUTRAN_10 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_11, MM_MODEM_BAND_EUTRAN_11 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_12, MM_MODEM_BAND_EUTRAN_12 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_13, MM_MODEM_BAND_EUTRAN_13 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_14, MM_MODEM_BAND_EUTRAN_14 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_17, MM_MODEM_BAND_EUTRAN_17 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_18, MM_MODEM_BAND_EUTRAN_18 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_19, MM_MODEM_BAND_EUTRAN_19 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_20, MM_MODEM_BAND_EUTRAN_20 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_21, MM_MODEM_BAND_EUTRAN_21 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24, MM_MODEM_BAND_EUTRAN_24 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25, MM_MODEM_BAND_EUTRAN_25 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33, MM_MODEM_BAND_EUTRAN_33 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34, MM_MODEM_BAND_EUTRAN_34 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_35, MM_MODEM_BAND_EUTRAN_35 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_36, MM_MODEM_BAND_EUTRAN_36 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_37, MM_MODEM_BAND_EUTRAN_37 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_38, MM_MODEM_BAND_EUTRAN_38 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_39, MM_MODEM_BAND_EUTRAN_39 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_40, MM_MODEM_BAND_EUTRAN_40 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_41, MM_MODEM_BAND_EUTRAN_41 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_42, MM_MODEM_BAND_EUTRAN_42 }, + { QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_43, MM_MODEM_BAND_EUTRAN_43 } }; static void @@ -316,15 +304,51 @@ } } +static void +dms_add_extended_qmi_lte_bands (GArray *mm_bands, + GArray *extended_qmi_bands) +{ + guint i; + + g_assert (mm_bands != NULL); + + if (!extended_qmi_bands) + return; + + for (i = 0; i < extended_qmi_bands->len; i++) { + guint16 val; + + val = g_array_index (extended_qmi_bands, guint16, i); + + /* MM_MODEM_BAND_EUTRAN_1 = 31, + * ... + * MM_MODEM_BAND_EUTRAN_71 = 101 + */ + if (val < 1 || val > 71) + mm_dbg ("Unexpected LTE band supported by module: EUTRAN %u", val); + else { + MMModemBand band; + + band = (MMModemBand)(val + MM_MODEM_BAND_EUTRAN_1 - 1); + g_array_append_val (mm_bands, band); + } + } +} + GArray * mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands, - QmiDmsLteBandCapability qmi_lte_bands) + QmiDmsLteBandCapability qmi_lte_bands, + GArray *extended_qmi_lte_bands) { GArray *mm_bands; mm_bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); dms_add_qmi_bands (mm_bands, qmi_bands); - dms_add_qmi_lte_bands (mm_bands, qmi_lte_bands); + + if (extended_qmi_lte_bands) + dms_add_extended_qmi_lte_bands (mm_bands, extended_qmi_lte_bands); + else + dms_add_qmi_lte_bands (mm_bands, qmi_lte_bands); return mm_bands; } @@ -340,26 +364,26 @@ /* CDMA bands */ { (QMI_NAS_BAND_PREFERENCE_BC_0_A_SYSTEM | QMI_NAS_BAND_PREFERENCE_BC_0_B_SYSTEM), - MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 + MM_MODEM_BAND_CDMA_BC0 }, - { QMI_NAS_BAND_PREFERENCE_BC_1_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC1_PCS_1900 }, - { QMI_NAS_BAND_PREFERENCE_BC_2, MM_MODEM_BAND_CDMA_BC2_TACS }, - { QMI_NAS_BAND_PREFERENCE_BC_3_A_SYSTEM, MM_MODEM_BAND_CDMA_BC3_JTACS }, - { QMI_NAS_BAND_PREFERENCE_BC_4_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS }, - { QMI_NAS_BAND_PREFERENCE_BC_5_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC5_NMT450 }, - { QMI_NAS_BAND_PREFERENCE_BC_6, MM_MODEM_BAND_CDMA_BC6_IMT2000 }, - { QMI_NAS_BAND_PREFERENCE_BC_7, MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 }, - { QMI_NAS_BAND_PREFERENCE_BC_8, MM_MODEM_BAND_CDMA_BC8_1800 }, - { QMI_NAS_BAND_PREFERENCE_BC_9, MM_MODEM_BAND_CDMA_BC9_900 }, - { QMI_NAS_BAND_PREFERENCE_BC_10, MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 }, - { QMI_NAS_BAND_PREFERENCE_BC_11, MM_MODEM_BAND_CDMA_BC11_PAMR_400 }, - { QMI_NAS_BAND_PREFERENCE_BC_12, MM_MODEM_BAND_CDMA_BC12_PAMR_800 }, - { QMI_NAS_BAND_PREFERENCE_BC_14, MM_MODEM_BAND_CDMA_BC14_PCS2_1900 }, - { QMI_NAS_BAND_PREFERENCE_BC_15, MM_MODEM_BAND_CDMA_BC15_AWS }, - { QMI_NAS_BAND_PREFERENCE_BC_16, MM_MODEM_BAND_CDMA_BC16_US_2500 }, - { QMI_NAS_BAND_PREFERENCE_BC_17, MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 }, - { QMI_NAS_BAND_PREFERENCE_BC_18, MM_MODEM_BAND_CDMA_BC18_US_PS_700 }, - { QMI_NAS_BAND_PREFERENCE_BC_19, MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 }, + { QMI_NAS_BAND_PREFERENCE_BC_1_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC1 }, + { QMI_NAS_BAND_PREFERENCE_BC_2, MM_MODEM_BAND_CDMA_BC2 }, + { QMI_NAS_BAND_PREFERENCE_BC_3_A_SYSTEM, MM_MODEM_BAND_CDMA_BC3 }, + { QMI_NAS_BAND_PREFERENCE_BC_4_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC4 }, + { QMI_NAS_BAND_PREFERENCE_BC_5_ALL_BLOCKS, MM_MODEM_BAND_CDMA_BC5 }, + { QMI_NAS_BAND_PREFERENCE_BC_6, MM_MODEM_BAND_CDMA_BC6 }, + { QMI_NAS_BAND_PREFERENCE_BC_7, MM_MODEM_BAND_CDMA_BC7 }, + { QMI_NAS_BAND_PREFERENCE_BC_8, MM_MODEM_BAND_CDMA_BC8 }, + { QMI_NAS_BAND_PREFERENCE_BC_9, MM_MODEM_BAND_CDMA_BC9 }, + { QMI_NAS_BAND_PREFERENCE_BC_10, MM_MODEM_BAND_CDMA_BC10 }, + { QMI_NAS_BAND_PREFERENCE_BC_11, MM_MODEM_BAND_CDMA_BC11 }, + { QMI_NAS_BAND_PREFERENCE_BC_12, MM_MODEM_BAND_CDMA_BC12 }, + { QMI_NAS_BAND_PREFERENCE_BC_14, MM_MODEM_BAND_CDMA_BC14 }, + { QMI_NAS_BAND_PREFERENCE_BC_15, MM_MODEM_BAND_CDMA_BC15 }, + { QMI_NAS_BAND_PREFERENCE_BC_16, MM_MODEM_BAND_CDMA_BC16 }, + { QMI_NAS_BAND_PREFERENCE_BC_17, MM_MODEM_BAND_CDMA_BC17 }, + { QMI_NAS_BAND_PREFERENCE_BC_18, MM_MODEM_BAND_CDMA_BC18 }, + { QMI_NAS_BAND_PREFERENCE_BC_19, MM_MODEM_BAND_CDMA_BC19 }, /* GSM bands */ { QMI_NAS_BAND_PREFERENCE_GSM_DCS_1800, MM_MODEM_BAND_DCS }, @@ -369,30 +393,22 @@ }, { QMI_NAS_BAND_PREFERENCE_GSM_PCS_1900, MM_MODEM_BAND_PCS }, { QMI_NAS_BAND_PREFERENCE_GSM_850, MM_MODEM_BAND_G850 }, + { QMI_NAS_BAND_PREFERENCE_GSM_450, MM_MODEM_BAND_G450 }, + { QMI_NAS_BAND_PREFERENCE_GSM_480, MM_MODEM_BAND_G480 }, + { QMI_NAS_BAND_PREFERENCE_GSM_750, MM_MODEM_BAND_G750 }, /* UMTS/WCDMA bands */ - { QMI_NAS_BAND_PREFERENCE_WCDMA_2100, MM_MODEM_BAND_U2100 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_DCS_1800, MM_MODEM_BAND_U1800 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_PCS_1900, MM_MODEM_BAND_U1900 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_1700_US, MM_MODEM_BAND_U17IV }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_800, MM_MODEM_BAND_U800 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_850_US, MM_MODEM_BAND_U850 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_900, MM_MODEM_BAND_U900 }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_1700_JAPAN, MM_MODEM_BAND_U17IX }, - { QMI_NAS_BAND_PREFERENCE_WCDMA_2600, MM_MODEM_BAND_U2600 } - - /* NOTE. The following bands were unmatched: - * - * - QMI_NAS_BAND_PREFERENCE_GSM_900_PRIMARY - * - QMI_NAS_BAND_PREFERENCE_GSM_450 - * - QMI_NAS_BAND_PREFERENCE_GSM_480 - * - QMI_NAS_BAND_PREFERENCE_GSM_750 - * - QMI_NAS_BAND_PREFERENCE_GSM_900_RAILWAILS - * - QMI_NAS_BAND_PREFERENCE_WCDMA_1500 - * - QMI_NAS_BAND_PREFERENCE_WCDMA_850_JAPAN - * - MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 - * - MM_MODEM_BAND_U1900 - */ + { QMI_NAS_BAND_PREFERENCE_WCDMA_2100, MM_MODEM_BAND_UTRAN_1 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_DCS_1800, MM_MODEM_BAND_UTRAN_3 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_PCS_1900, MM_MODEM_BAND_UTRAN_2 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_1700_US, MM_MODEM_BAND_UTRAN_4 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_800, MM_MODEM_BAND_UTRAN_6 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_850_US, MM_MODEM_BAND_UTRAN_5 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_900, MM_MODEM_BAND_UTRAN_8 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_1700_JAPAN, MM_MODEM_BAND_UTRAN_9 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_2600, MM_MODEM_BAND_UTRAN_7 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_1500, MM_MODEM_BAND_UTRAN_11 }, + { QMI_NAS_BAND_PREFERENCE_WCDMA_850_JAPAN, MM_MODEM_BAND_UTRAN_19 }, }; static void @@ -435,46 +451,38 @@ } NasLteBandsMap; static const NasLteBandsMap nas_lte_bands_map [] = { - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_1, MM_MODEM_BAND_EUTRAN_I }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_2, MM_MODEM_BAND_EUTRAN_II }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_3, MM_MODEM_BAND_EUTRAN_III }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_4, MM_MODEM_BAND_EUTRAN_IV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_5, MM_MODEM_BAND_EUTRAN_V }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_6, MM_MODEM_BAND_EUTRAN_VI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_7, MM_MODEM_BAND_EUTRAN_VII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_8, MM_MODEM_BAND_EUTRAN_VIII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_9, MM_MODEM_BAND_EUTRAN_IX }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_10, MM_MODEM_BAND_EUTRAN_X }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_11, MM_MODEM_BAND_EUTRAN_XI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_12, MM_MODEM_BAND_EUTRAN_XII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_13, MM_MODEM_BAND_EUTRAN_XIII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_14, MM_MODEM_BAND_EUTRAN_XIV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_17, MM_MODEM_BAND_EUTRAN_XVII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_18, MM_MODEM_BAND_EUTRAN_XVIII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_19, MM_MODEM_BAND_EUTRAN_XIX }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_20, MM_MODEM_BAND_EUTRAN_XX }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_21, MM_MODEM_BAND_EUTRAN_XXI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_24, MM_MODEM_BAND_EUTRAN_XXIV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_25, MM_MODEM_BAND_EUTRAN_XXV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_33, MM_MODEM_BAND_EUTRAN_XXXIII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_34, MM_MODEM_BAND_EUTRAN_XXXIV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_35, MM_MODEM_BAND_EUTRAN_XXXV }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_36, MM_MODEM_BAND_EUTRAN_XXXVI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_37, MM_MODEM_BAND_EUTRAN_XXXVII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_38, MM_MODEM_BAND_EUTRAN_XXXVIII }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_39, MM_MODEM_BAND_EUTRAN_XXXIX }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_40, MM_MODEM_BAND_EUTRAN_XL }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_41, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_42, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_43, MM_MODEM_BAND_EUTRAN_XLIII } - - /* NOTE. The following bands were unmatched: - * - * - MM_MODEM_BAND_EUTRAN_XXII - * - MM_MODEM_BAND_EUTRAN_XXIII - * - MM_MODEM_BAND_EUTRAN_XXVI - * - MM_MODEM_BAND_EUTRAN_XLIV - */ + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_1, MM_MODEM_BAND_EUTRAN_1 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_2, MM_MODEM_BAND_EUTRAN_2 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_3, MM_MODEM_BAND_EUTRAN_3 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_4, MM_MODEM_BAND_EUTRAN_4 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_5, MM_MODEM_BAND_EUTRAN_5 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_6, MM_MODEM_BAND_EUTRAN_6 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_7, MM_MODEM_BAND_EUTRAN_7 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_8, MM_MODEM_BAND_EUTRAN_8 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_9, MM_MODEM_BAND_EUTRAN_9 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_10, MM_MODEM_BAND_EUTRAN_10 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_11, MM_MODEM_BAND_EUTRAN_11 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_12, MM_MODEM_BAND_EUTRAN_12 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_13, MM_MODEM_BAND_EUTRAN_13 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_14, MM_MODEM_BAND_EUTRAN_14 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_17, MM_MODEM_BAND_EUTRAN_17 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_18, MM_MODEM_BAND_EUTRAN_18 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_19, MM_MODEM_BAND_EUTRAN_19 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_20, MM_MODEM_BAND_EUTRAN_20 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_21, MM_MODEM_BAND_EUTRAN_21 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_24, MM_MODEM_BAND_EUTRAN_24 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_25, MM_MODEM_BAND_EUTRAN_25 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_33, MM_MODEM_BAND_EUTRAN_33 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_34, MM_MODEM_BAND_EUTRAN_34 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_35, MM_MODEM_BAND_EUTRAN_35 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_36, MM_MODEM_BAND_EUTRAN_36 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_37, MM_MODEM_BAND_EUTRAN_37 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_38, MM_MODEM_BAND_EUTRAN_38 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_39, MM_MODEM_BAND_EUTRAN_39 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_40, MM_MODEM_BAND_EUTRAN_40 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_41, MM_MODEM_BAND_EUTRAN_41 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_42, MM_MODEM_BAND_EUTRAN_42 }, + { QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_43, MM_MODEM_BAND_EUTRAN_43 } }; static void @@ -493,15 +501,57 @@ } } +static void +nas_add_extended_qmi_lte_bands (GArray *mm_bands, + const guint64 *extended_qmi_lte_bands, + guint extended_qmi_lte_bands_size) +{ + guint i; + + g_assert (mm_bands != NULL); + + for (i = 0; i < extended_qmi_lte_bands_size; i++) { + guint j; + + for (j = 0; j < 64; j++) { + guint val; + + if (!(extended_qmi_lte_bands[i] & (((guint64) 1) << j))) + continue; + + val = 1 + j + (i * 64); + + /* MM_MODEM_BAND_EUTRAN_1 = 31, + * ... + * MM_MODEM_BAND_EUTRAN_71 = 101 + */ + if (val < 1 || val > 71) + mm_dbg ("Unexpected LTE band supported by module: EUTRAN %u", val); + else { + MMModemBand band; + + band = (val + MM_MODEM_BAND_EUTRAN_1 - 1); + g_array_append_val (mm_bands, band); + } + } + } +} + GArray * mm_modem_bands_from_qmi_band_preference (QmiNasBandPreference qmi_bands, - QmiNasLteBandPreference qmi_lte_bands) + QmiNasLteBandPreference qmi_lte_bands, + const guint64 *extended_qmi_lte_bands, + guint extended_qmi_lte_bands_size) { GArray *mm_bands; mm_bands = g_array_new (FALSE, FALSE, sizeof (MMModemBand)); nas_add_qmi_bands (mm_bands, qmi_bands); - nas_add_qmi_lte_bands (mm_bands, qmi_lte_bands); + + if (extended_qmi_lte_bands && extended_qmi_lte_bands_size) + nas_add_extended_qmi_lte_bands (mm_bands, extended_qmi_lte_bands, extended_qmi_lte_bands_size); + else + nas_add_qmi_lte_bands (mm_bands, qmi_lte_bands); return mm_bands; } @@ -509,33 +559,51 @@ void mm_modem_bands_to_qmi_band_preference (GArray *mm_bands, QmiNasBandPreference *qmi_bands, - QmiNasLteBandPreference *qmi_lte_bands) + QmiNasLteBandPreference *qmi_lte_bands, + guint64 *extended_qmi_lte_bands, + guint extended_qmi_lte_bands_size) { guint i; *qmi_bands = 0; *qmi_lte_bands = 0; + memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size * sizeof (guint64)); for (i = 0; i < mm_bands->len; i++) { MMModemBand band; band = g_array_index (mm_bands, MMModemBand, i); - if (band <= MM_MODEM_BAND_EUTRAN_XLIV && - band >= MM_MODEM_BAND_EUTRAN_I) { - /* Add LTE band preference */ - guint j; - - for (j = 0; j < G_N_ELEMENTS (nas_lte_bands_map); j++) { - if (nas_lte_bands_map[j].mm_band == band) { - *qmi_lte_bands |= nas_lte_bands_map[j].qmi_band; - break; + if (band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_71) { + if (extended_qmi_lte_bands && extended_qmi_lte_bands_size) { + /* Add extended LTE band preference */ + guint val; + guint j; + guint k; + + /* it's really (band - MM_MODEM_BAND_EUTRAN_1 +1 -1), because + * we want EUTRAN1 in index 0 */ + val = band - MM_MODEM_BAND_EUTRAN_1; + j = val / 64; + g_assert (j < extended_qmi_lte_bands_size); + k = val % 64; + + extended_qmi_lte_bands[j] |= ((guint64)1 << k); + } else { + /* Add LTE band preference */ + guint j; + + for (j = 0; j < G_N_ELEMENTS (nas_lte_bands_map); j++) { + if (nas_lte_bands_map[j].mm_band == band) { + *qmi_lte_bands |= nas_lte_bands_map[j].qmi_band; + break; + } } - } - if (j == G_N_ELEMENTS (nas_lte_bands_map)) - mm_dbg ("Cannot add the following LTE band: '%s'", - mm_modem_band_get_string (band)); + if (j == G_N_ELEMENTS (nas_lte_bands_map)) + mm_dbg ("Cannot add the following LTE band: '%s'", + mm_modem_band_get_string (band)); + } } else { /* Add non-LTE band preference */ guint j; @@ -563,94 +631,82 @@ static const ActiveBandsMap active_bands_map [] = { /* CDMA bands */ - { QMI_NAS_ACTIVE_BAND_BC_0, MM_MODEM_BAND_CDMA_BC0_CELLULAR_800 }, - { QMI_NAS_ACTIVE_BAND_BC_1, MM_MODEM_BAND_CDMA_BC1_PCS_1900 }, - { QMI_NAS_ACTIVE_BAND_BC_2, MM_MODEM_BAND_CDMA_BC2_TACS }, - { QMI_NAS_ACTIVE_BAND_BC_3, MM_MODEM_BAND_CDMA_BC3_JTACS }, - { QMI_NAS_ACTIVE_BAND_BC_4, MM_MODEM_BAND_CDMA_BC4_KOREAN_PCS }, - { QMI_NAS_ACTIVE_BAND_BC_5, MM_MODEM_BAND_CDMA_BC5_NMT450 }, - { QMI_NAS_ACTIVE_BAND_BC_6, MM_MODEM_BAND_CDMA_BC6_IMT2000 }, - { QMI_NAS_ACTIVE_BAND_BC_7, MM_MODEM_BAND_CDMA_BC7_CELLULAR_700 }, - { QMI_NAS_ACTIVE_BAND_BC_8, MM_MODEM_BAND_CDMA_BC8_1800 }, - { QMI_NAS_ACTIVE_BAND_BC_9, MM_MODEM_BAND_CDMA_BC9_900 }, - { QMI_NAS_ACTIVE_BAND_BC_10, MM_MODEM_BAND_CDMA_BC10_SECONDARY_800 }, - { QMI_NAS_ACTIVE_BAND_BC_11, MM_MODEM_BAND_CDMA_BC11_PAMR_400 }, - { QMI_NAS_ACTIVE_BAND_BC_12, MM_MODEM_BAND_CDMA_BC12_PAMR_800 }, - { QMI_NAS_ACTIVE_BAND_BC_13, MM_MODEM_BAND_CDMA_BC13_IMT2000_2500 }, - { QMI_NAS_ACTIVE_BAND_BC_14, MM_MODEM_BAND_CDMA_BC14_PCS2_1900 }, - { QMI_NAS_ACTIVE_BAND_BC_15, MM_MODEM_BAND_CDMA_BC15_AWS }, - { QMI_NAS_ACTIVE_BAND_BC_16, MM_MODEM_BAND_CDMA_BC16_US_2500 }, - { QMI_NAS_ACTIVE_BAND_BC_17, MM_MODEM_BAND_CDMA_BC17_US_FLO_2500 }, - { QMI_NAS_ACTIVE_BAND_BC_18, MM_MODEM_BAND_CDMA_BC18_US_PS_700 }, - { QMI_NAS_ACTIVE_BAND_BC_19, MM_MODEM_BAND_CDMA_BC19_US_LOWER_700 }, + { QMI_NAS_ACTIVE_BAND_BC_0, MM_MODEM_BAND_CDMA_BC0 }, + { QMI_NAS_ACTIVE_BAND_BC_1, MM_MODEM_BAND_CDMA_BC1 }, + { QMI_NAS_ACTIVE_BAND_BC_2, MM_MODEM_BAND_CDMA_BC2 }, + { QMI_NAS_ACTIVE_BAND_BC_3, MM_MODEM_BAND_CDMA_BC3 }, + { QMI_NAS_ACTIVE_BAND_BC_4, MM_MODEM_BAND_CDMA_BC4 }, + { QMI_NAS_ACTIVE_BAND_BC_5, MM_MODEM_BAND_CDMA_BC5 }, + { QMI_NAS_ACTIVE_BAND_BC_6, MM_MODEM_BAND_CDMA_BC6 }, + { QMI_NAS_ACTIVE_BAND_BC_7, MM_MODEM_BAND_CDMA_BC7 }, + { QMI_NAS_ACTIVE_BAND_BC_8, MM_MODEM_BAND_CDMA_BC8 }, + { QMI_NAS_ACTIVE_BAND_BC_9, MM_MODEM_BAND_CDMA_BC9 }, + { QMI_NAS_ACTIVE_BAND_BC_10, MM_MODEM_BAND_CDMA_BC10 }, + { QMI_NAS_ACTIVE_BAND_BC_11, MM_MODEM_BAND_CDMA_BC11 }, + { QMI_NAS_ACTIVE_BAND_BC_12, MM_MODEM_BAND_CDMA_BC12 }, + { QMI_NAS_ACTIVE_BAND_BC_13, MM_MODEM_BAND_CDMA_BC13 }, + { QMI_NAS_ACTIVE_BAND_BC_14, MM_MODEM_BAND_CDMA_BC14 }, + { QMI_NAS_ACTIVE_BAND_BC_15, MM_MODEM_BAND_CDMA_BC15 }, + { QMI_NAS_ACTIVE_BAND_BC_16, MM_MODEM_BAND_CDMA_BC16 }, + { QMI_NAS_ACTIVE_BAND_BC_17, MM_MODEM_BAND_CDMA_BC17 }, + { QMI_NAS_ACTIVE_BAND_BC_18, MM_MODEM_BAND_CDMA_BC18 }, + { QMI_NAS_ACTIVE_BAND_BC_19, MM_MODEM_BAND_CDMA_BC19 }, /* GSM bands */ - { QMI_NAS_ACTIVE_BAND_GSM_850, MM_MODEM_BAND_G850 }, + { QMI_NAS_ACTIVE_BAND_GSM_850, MM_MODEM_BAND_G850 }, { QMI_NAS_ACTIVE_BAND_GSM_900_EXTENDED, MM_MODEM_BAND_EGSM }, - { QMI_NAS_ACTIVE_BAND_GSM_DCS_1800, MM_MODEM_BAND_DCS }, - { QMI_NAS_ACTIVE_BAND_GSM_PCS_1900, MM_MODEM_BAND_PCS }, + { QMI_NAS_ACTIVE_BAND_GSM_DCS_1800, MM_MODEM_BAND_DCS }, + { QMI_NAS_ACTIVE_BAND_GSM_PCS_1900, MM_MODEM_BAND_PCS }, + { QMI_NAS_ACTIVE_BAND_GSM_450, MM_MODEM_BAND_G450 }, + { QMI_NAS_ACTIVE_BAND_GSM_480, MM_MODEM_BAND_G480 }, + { QMI_NAS_ACTIVE_BAND_GSM_750, MM_MODEM_BAND_G750 }, /* WCDMA bands */ - { QMI_NAS_ACTIVE_BAND_WCDMA_2100, MM_MODEM_BAND_U2100 }, - { QMI_NAS_ACTIVE_BAND_WCDMA_PCS_1900, MM_MODEM_BAND_PCS }, - { QMI_NAS_ACTIVE_BAND_WCDMA_DCS_1800, MM_MODEM_BAND_DCS }, - { QMI_NAS_ACTIVE_BAND_WCDMA_1700_US, MM_MODEM_BAND_U17IV }, - { QMI_NAS_ACTIVE_BAND_WCDMA_850, MM_MODEM_BAND_U850 }, - { QMI_NAS_ACTIVE_BAND_WCDMA_800, MM_MODEM_BAND_U800 }, - { QMI_NAS_ACTIVE_BAND_WCDMA_2600, MM_MODEM_BAND_U2600 }, - { QMI_NAS_ACTIVE_BAND_WCDMA_900, MM_MODEM_BAND_U900 }, - { QMI_NAS_ACTIVE_BAND_WCDMA_1700_JAPAN, MM_MODEM_BAND_U17IX }, - { QMI_NAS_ACTIVE_BAND_WCDMA_850_JAPAN, MM_MODEM_BAND_U850 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_2100, MM_MODEM_BAND_UTRAN_1 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_PCS_1900, MM_MODEM_BAND_UTRAN_2 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_DCS_1800, MM_MODEM_BAND_UTRAN_3 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_1700_US, MM_MODEM_BAND_UTRAN_4 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_850, MM_MODEM_BAND_UTRAN_5 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_800, MM_MODEM_BAND_UTRAN_6 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_2600, MM_MODEM_BAND_UTRAN_7 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_900, MM_MODEM_BAND_UTRAN_8 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_1700_JAPAN, MM_MODEM_BAND_UTRAN_9 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_1500_JAPAN, MM_MODEM_BAND_UTRAN_11 }, + { QMI_NAS_ACTIVE_BAND_WCDMA_850_JAPAN, MM_MODEM_BAND_UTRAN_19 }, /* LTE bands */ - { QMI_NAS_ACTIVE_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_I }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_II }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_III }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_IV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_5, MM_MODEM_BAND_EUTRAN_V }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_6, MM_MODEM_BAND_EUTRAN_VI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_VII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_VIII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_9, MM_MODEM_BAND_EUTRAN_IX }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_10, MM_MODEM_BAND_EUTRAN_X }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_XI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_XII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_XIII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_14, MM_MODEM_BAND_EUTRAN_XIV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_XVII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_XVIII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_XIX }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_XX }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_21, MM_MODEM_BAND_EUTRAN_XXI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_24, MM_MODEM_BAND_EUTRAN_XXIV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_25, MM_MODEM_BAND_EUTRAN_XXV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_33, MM_MODEM_BAND_EUTRAN_XXXIII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_34, MM_MODEM_BAND_EUTRAN_XXXIV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_35, MM_MODEM_BAND_EUTRAN_XXXV }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_36, MM_MODEM_BAND_EUTRAN_XXXVI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_37, MM_MODEM_BAND_EUTRAN_XXXVII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_38, MM_MODEM_BAND_EUTRAN_XXXVIII }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_XXXIX }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_XL }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_42, MM_MODEM_BAND_EUTRAN_XLI }, - { QMI_NAS_ACTIVE_BAND_EUTRAN_43, MM_MODEM_BAND_EUTRAN_XLIII } - - /* NOTE. The following bands were unmatched: - * - * - QMI_NAS_ACTIVE_BAND_GSM_450 - * - QMI_NAS_ACTIVE_BAND_GSM_480 - * - QMI_NAS_ACTIVE_BAND_GSM_750 - * - QMI_NAS_ACTIVE_BAND_GSM_900_PRIMARY - * - QMI_NAS_ACTIVE_BAND_GSM_900_RAILWAYS - * - QMI_NAS_ACTIVE_BAND_WCDMA_1500_JAPAN - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_A - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_B - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_C - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_D - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_E - * - QMI_NAS_ACTIVE_BAND_TDSCDMA_F - */ + { QMI_NAS_ACTIVE_BAND_EUTRAN_1, MM_MODEM_BAND_EUTRAN_1 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_2, MM_MODEM_BAND_EUTRAN_2 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_3, MM_MODEM_BAND_EUTRAN_3 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_4, MM_MODEM_BAND_EUTRAN_4 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_5, MM_MODEM_BAND_EUTRAN_5 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_6, MM_MODEM_BAND_EUTRAN_6 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_7, MM_MODEM_BAND_EUTRAN_7 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_8, MM_MODEM_BAND_EUTRAN_8 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_9, MM_MODEM_BAND_EUTRAN_9 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_10, MM_MODEM_BAND_EUTRAN_10 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_11, MM_MODEM_BAND_EUTRAN_11 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_12, MM_MODEM_BAND_EUTRAN_12 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_13 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_14, MM_MODEM_BAND_EUTRAN_14 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_17, MM_MODEM_BAND_EUTRAN_17 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_18, MM_MODEM_BAND_EUTRAN_18 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_19, MM_MODEM_BAND_EUTRAN_19 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_20, MM_MODEM_BAND_EUTRAN_20 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_21, MM_MODEM_BAND_EUTRAN_21 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_24, MM_MODEM_BAND_EUTRAN_24 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_25, MM_MODEM_BAND_EUTRAN_25 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_33, MM_MODEM_BAND_EUTRAN_33 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_34, MM_MODEM_BAND_EUTRAN_34 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_35, MM_MODEM_BAND_EUTRAN_35 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_36, MM_MODEM_BAND_EUTRAN_36 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_37, MM_MODEM_BAND_EUTRAN_37 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_38, MM_MODEM_BAND_EUTRAN_38 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_39, MM_MODEM_BAND_EUTRAN_39 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_40, MM_MODEM_BAND_EUTRAN_40 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_41, MM_MODEM_BAND_EUTRAN_41 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_42, MM_MODEM_BAND_EUTRAN_42 }, + { QMI_NAS_ACTIVE_BAND_EUTRAN_43, MM_MODEM_BAND_EUTRAN_43 } }; static void @@ -797,6 +853,25 @@ /*****************************************************************************/ MMModemMode +mm_modem_mode_from_qmi_nas_radio_interface (QmiNasRadioInterface iface) +{ + switch (iface) { + case QMI_NAS_RADIO_INTERFACE_CDMA_1X: + case QMI_NAS_RADIO_INTERFACE_GSM: + return MM_MODEM_MODE_2G; + case QMI_NAS_RADIO_INTERFACE_CDMA_1XEVDO: + case QMI_NAS_RADIO_INTERFACE_UMTS: + return MM_MODEM_MODE_3G; + case QMI_NAS_RADIO_INTERFACE_LTE: + return MM_MODEM_MODE_4G; + default: + return MM_MODEM_MODE_NONE; + } +} + +/*****************************************************************************/ + +MMModemMode mm_modem_mode_from_qmi_radio_technology_preference (QmiNasRadioTechnologyPreference qmi) { MMModemMode mode = MM_MODEM_MODE_NONE; @@ -952,6 +1027,94 @@ /*****************************************************************************/ +GArray * +mm_modem_capability_to_qmi_acquisition_order_preference (MMModemCapability caps) +{ + GArray *array; + QmiNasRadioInterface value; + + array = g_array_new (FALSE, FALSE, sizeof (QmiNasRadioInterface)); + + if (caps & MM_MODEM_CAPABILITY_LTE) { + value = QMI_NAS_RADIO_INTERFACE_LTE; + g_array_append_val (array, value); + } + + if (caps & MM_MODEM_CAPABILITY_GSM_UMTS) { + value = QMI_NAS_RADIO_INTERFACE_UMTS; + g_array_append_val (array, value); + value = QMI_NAS_RADIO_INTERFACE_GSM; + g_array_append_val (array, value); + } + + if (caps & MM_MODEM_CAPABILITY_CDMA_EVDO) { + value = QMI_NAS_RADIO_INTERFACE_CDMA_1XEVDO; + g_array_append_val (array, value); + value = QMI_NAS_RADIO_INTERFACE_CDMA_1X; + g_array_append_val (array, value); + } + + return array; +} + +GArray * +mm_modem_mode_to_qmi_acquisition_order_preference (MMModemMode allowed, + MMModemMode preferred, + gboolean is_cdma, + gboolean is_3gpp) +{ + GArray *array; + QmiNasRadioInterface value; + + array = g_array_new (FALSE, FALSE, sizeof (QmiNasRadioInterface)); + + if (allowed & MM_MODEM_MODE_4G) { + value = QMI_NAS_RADIO_INTERFACE_LTE; + if (preferred == MM_MODEM_MODE_4G) + g_array_prepend_val (array, value); + else + g_array_append_val (array, value); + } + + if (allowed & MM_MODEM_MODE_3G) { + if (is_cdma) { + value = QMI_NAS_RADIO_INTERFACE_CDMA_1XEVDO; + if (preferred == MM_MODEM_MODE_3G) + g_array_prepend_val (array, value); + else + g_array_append_val (array, value); + } + if (is_3gpp) { + value = QMI_NAS_RADIO_INTERFACE_UMTS; + if (preferred == MM_MODEM_MODE_3G) + g_array_prepend_val (array, value); + else + g_array_append_val (array, value); + } + } + + if (allowed & MM_MODEM_MODE_2G) { + if (is_cdma) { + value = QMI_NAS_RADIO_INTERFACE_CDMA_1X; + if (preferred == MM_MODEM_MODE_2G) + g_array_prepend_val (array, value); + else + g_array_append_val (array, value); + } + if (is_3gpp) { + value = QMI_NAS_RADIO_INTERFACE_GSM; + if (preferred == MM_MODEM_MODE_2G) + g_array_prepend_val (array, value); + else + g_array_append_val (array, value); + } + } + + return array; +} + +/*****************************************************************************/ + MMModemCapability mm_modem_capability_from_qmi_radio_technology_preference (QmiNasRadioTechnologyPreference qmi) { @@ -1243,6 +1406,15 @@ /*****************************************************************************/ +/** + * The only case where we need to apply some logic to decide what the current + * capabilities are is when we have a multimode CDMA/EVDO+GSM/UMTS device, in + * which case we'll check the SSP and TP current values to decide which + * capabilities are present and which have been disabled. + * + * For all the other cases, the DMS capabilities are exactly the current ones, + * as there would be no capability switching support. + */ MMModemCapability mm_modem_capability_from_qmi_capabilities_context (MMQmiCapabilitiesContext *ctx) { @@ -1252,16 +1424,19 @@ gchar *dms_capabilities_str; gchar *tmp_str; - /* SSP logic to gather capabilities uses the Mode Preference TLV if available, - * and if not available it falls back to using Band Preference TLVs */ + /* If not a multimode device, we're done */ +#define MULTIMODE (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO) + if ((ctx->dms_capabilities & MULTIMODE) != MULTIMODE) + return ctx->dms_capabilities; + + /* We have a multimode CDMA/EVDO+GSM/UMTS device, check SSP and TP */ + + /* SSP logic to gather capabilities uses the Mode Preference TLV if available */ if (ctx->nas_ssp_mode_preference_mask) tmp = mm_modem_capability_from_qmi_rat_mode_preference (ctx->nas_ssp_mode_preference_mask); - /* If no value retrieved from SSP, check TP. We only process TP * values if not 'auto'. */ - if ( tmp == MM_MODEM_CAPABILITY_NONE - && ctx->nas_tp_mask - && ctx->nas_tp_mask != QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO) + else if (ctx->nas_tp_mask && (ctx->nas_tp_mask != QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AUTO)) tmp = mm_modem_capability_from_qmi_radio_technology_preference (ctx->nas_tp_mask); /* Final capabilities are the intersection between the Technology @@ -1397,3 +1572,34 @@ return MM_OMA_SESSION_STATE_FAILED_REASON_UNKNOWN; } } + +gboolean +mm_error_from_qmi_loc_indication_status (QmiLocIndicationStatus status, + GError **error) +{ + switch (status) { + case QMI_LOC_INDICATION_STATUS_SUCCESS: + return TRUE; + case QMI_LOC_INDICATION_STATUS_GENERAL_FAILURE: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "LOC service: general failure"); + return FALSE; + case QMI_LOC_INDICATION_STATUS_UNSUPPORTED: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "LOC service: unsupported"); + return FALSE; + case QMI_LOC_INDICATION_STATUS_INVALID_PARAMETER: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "LOC service: invalid parameter"); + return FALSE; + case QMI_LOC_INDICATION_STATUS_ENGINE_BUSY: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, "LOC service: engine busy"); + return FALSE; + case QMI_LOC_INDICATION_STATUS_PHONE_OFFLINE: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, "LOC service: phone offline"); + return FALSE; + case QMI_LOC_INDICATION_STATUS_TIMEOUT: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, "LOC service: timeout"); + return FALSE; + default: + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "LOC service: unknown failure"); + return FALSE; + } +} diff -Nru modemmanager-1.6.8/src/mm-modem-helpers-qmi.h modemmanager-1.10.0/src/mm-modem-helpers-qmi.h --- modemmanager-1.6.8/src/mm-modem-helpers-qmi.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-modem-helpers-qmi.h 2019-01-15 15:57:35.000000000 +0100 @@ -35,7 +35,8 @@ QmiDmsUimFacility mm_3gpp_facility_to_qmi_uim_facility (MMModem3gppFacility mm); GArray *mm_modem_bands_from_qmi_band_capabilities (QmiDmsBandCapability qmi_bands, - QmiDmsLteBandCapability qmi_lte_bands); + QmiDmsLteBandCapability qmi_lte_bands, + GArray *extended_qmi_lte_bands); /*****************************************************************************/ /* QMI/NAS to MM translations */ @@ -46,6 +47,8 @@ MMModemAccessTechnology mm_modem_access_technology_from_qmi_data_capability (QmiNasDataCapability cap); MMModemAccessTechnology mm_modem_access_technologies_from_qmi_data_capability_array (GArray *data_capabilities); +MMModemMode mm_modem_mode_from_qmi_nas_radio_interface (QmiNasRadioInterface iface); + MMModemMode mm_modem_mode_from_qmi_radio_technology_preference (QmiNasRadioTechnologyPreference qmi); QmiNasRadioTechnologyPreference mm_modem_mode_to_qmi_radio_technology_preference (MMModemMode mode, gboolean is_cdma); @@ -58,6 +61,12 @@ MMModemCapability mm_modem_capability_from_qmi_rat_mode_preference (QmiNasRatModePreference qmi); QmiNasRatModePreference mm_modem_capability_to_qmi_rat_mode_preference (MMModemCapability caps); +GArray *mm_modem_capability_to_qmi_acquisition_order_preference (MMModemCapability caps); +GArray *mm_modem_mode_to_qmi_acquisition_order_preference (MMModemMode allowed, + MMModemMode preferred, + gboolean is_cdma, + gboolean is_3gpp); + MMModemCapability mm_modem_capability_from_qmi_radio_technology_preference (QmiNasRadioTechnologyPreference qmi); QmiNasRadioTechnologyPreference mm_modem_capability_to_qmi_radio_technology_preference (MMModemCapability caps); @@ -69,10 +78,14 @@ GArray *mm_modem_bands_from_qmi_rf_band_information_array (GArray *info_array); GArray *mm_modem_bands_from_qmi_band_preference (QmiNasBandPreference qmi_bands, - QmiNasLteBandPreference qmi_lte_bands); + QmiNasLteBandPreference qmi_lte_bands, + const guint64 *extended_qmi_lte_bands, + guint extended_qmi_lte_bands_size); void mm_modem_bands_to_qmi_band_preference (GArray *mm_bands, QmiNasBandPreference *qmi_bands, - QmiNasLteBandPreference *qmi_lte_bands); + QmiNasLteBandPreference *qmi_lte_bands, + guint64 *extended_qmi_lte_bands, + guint extended_qmi_lte_bands_size); MMModem3gppRegistrationState mm_modem_3gpp_registration_state_from_qmi_registration_state (QmiNasAttachState attach_state, QmiNasRegistrationState registration_state, @@ -106,6 +119,12 @@ MMOmaSessionStateFailedReason mm_oma_session_state_failed_reason_from_qmi_oma_session_failed_reason (QmiOmaSessionFailedReason qmi_session_failed_reason); /*****************************************************************************/ +/* QMI/LOC to MM translations */ + +gboolean mm_error_from_qmi_loc_indication_status (QmiLocIndicationStatus status, + GError **error); + +/*****************************************************************************/ /* Utility to gather current capabilities from various sources */ typedef struct { diff -Nru modemmanager-1.6.8/src/mm-plugin.c modemmanager-1.10.0/src/mm-plugin.c --- modemmanager-1.6.8/src/mm-plugin.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-plugin.c 2019-01-15 15:57:35.000000000 +0100 @@ -23,13 +23,13 @@ #include #include -#include - #include #include #include "mm-plugin.h" #include "mm-device.h" +#include "mm-kernel-device.h" +#include "mm-kernel-device-generic.h" #include "mm-port-serial-at.h" #include "mm-port-serial-qcdm.h" #include "mm-serial-parsers.h" @@ -39,7 +39,7 @@ G_DEFINE_TYPE (MMPlugin, mm_plugin, G_TYPE_OBJECT) -/* Virtual port corresponding to the embeded modem */ +/* Virtual port corresponding to the embedded modem */ static gchar *virtual_port[] = {"smd0", NULL}; #define HAS_POST_PROBING_FILTERS(self) \ @@ -48,6 +48,8 @@ self->priv->forbidden_product_strings || \ self->priv->allowed_icera || \ self->priv->forbidden_icera || \ + self->priv->allowed_xmm || \ + self->priv->forbidden_xmm || \ self->priv->custom_init) @@ -70,6 +72,8 @@ mm_str_pair *forbidden_product_strings; gboolean allowed_icera; gboolean forbidden_icera; + gboolean allowed_xmm; + gboolean forbidden_xmm; /* Probing setup */ gboolean at; @@ -78,6 +82,7 @@ gboolean qmi; gboolean mbim; gboolean icera_probe; + gboolean xmm_probe; MMPortProbeAtCommand *custom_at_probe; guint64 send_delay; gboolean remove_echo; @@ -110,6 +115,9 @@ PROP_ICERA_PROBE, PROP_ALLOWED_ICERA, PROP_FORBIDDEN_ICERA, + PROP_XMM_PROBE, + PROP_ALLOWED_XMM, + PROP_FORBIDDEN_XMM, PROP_CUSTOM_AT_PROBE, PROP_CUSTOM_INIT, PROP_SEND_DELAY, @@ -162,14 +170,14 @@ /* Returns TRUE if the support check request was filtered out */ static gboolean -apply_subsystem_filter (MMPlugin *self, - GUdevDevice *port) +apply_subsystem_filter (MMPlugin *self, + MMKernelDevice *port) { if (self->priv->subsystems) { const gchar *subsys; guint i; - subsys = g_udev_device_get_subsystem (port); + subsys = mm_kernel_device_get_subsystem (port); for (i = 0; self->priv->subsystems[i]; i++) { if (g_str_equal (subsys, self->priv->subsystems[i])) break; @@ -189,11 +197,11 @@ /* Returns TRUE if the support check request was filtered out */ static gboolean -apply_pre_probing_filters (MMPlugin *self, - MMDevice *device, - GUdevDevice *port, - gboolean *need_vendor_probing, - gboolean *need_product_probing) +apply_pre_probing_filters (MMPlugin *self, + MMDevice *device, + MMKernelDevice *port, + gboolean *need_vendor_probing, + gboolean *need_product_probing) { guint16 vendor; guint16 product; @@ -209,7 +217,7 @@ if (apply_subsystem_filter (self, port)) { mm_dbg ("(%s) [%s] filtered by subsystem", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } @@ -232,7 +240,7 @@ const gchar **drivers; /* Detect any modems accessible through the list of virtual ports */ - drivers = (is_virtual_port (g_udev_device_get_name (port)) ? + drivers = (is_virtual_port (mm_kernel_device_get_name (port)) ? virtual_drivers : mm_device_get_drivers (device)); @@ -240,7 +248,7 @@ if (!drivers) { mm_dbg ("(%s) [%s] filtered as couldn't retrieve drivers", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } @@ -261,7 +269,7 @@ if (!found) { mm_dbg ("(%s) [%s] filtered by drivers", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -276,7 +284,7 @@ if (g_str_equal (drivers[j], self->priv->forbidden_drivers[i])) { mm_dbg ("(%s) [%s] filtered by forbidden drivers", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -292,7 +300,7 @@ if (g_str_equal (drivers[j], "qmi_wwan")) { mm_dbg ("(%s) [%s] filtered by implicit QMI driver", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -307,7 +315,7 @@ if (g_str_equal (drivers[j], "cdc_mbim")) { mm_dbg ("(%s) [%s] filtered by implicit MBIM driver", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -369,11 +377,11 @@ ((!self->priv->vendor_strings && !self->priv->product_strings && !self->priv->forbidden_product_strings) || - g_str_equal (g_udev_device_get_subsystem (port), "net") || - g_str_has_prefix (g_udev_device_get_name (port), "cdc-wdm"))) { + g_str_equal (mm_kernel_device_get_subsystem (port), "net") || + g_str_has_prefix (mm_kernel_device_get_name (port), "cdc-wdm"))) { mm_dbg ("(%s) [%s] filtered by vendor/product IDs", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } @@ -385,7 +393,7 @@ product == self->priv->forbidden_product_ids[i].r) { mm_dbg ("(%s) [%s] filtered by forbidden vendor/product IDs", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -417,9 +425,8 @@ * supported. If that is the case, filter by udev tag */ if (self->priv->udev_tags) { for (i = 0; self->priv->udev_tags[i]; i++) { - /* Check if the port was tagged */ - if (g_udev_device_get_property_as_boolean (port, - self->priv->udev_tags[i])) + /* Check if the port or device was tagged */ + if (mm_kernel_device_get_global_property_as_boolean (port, self->priv->udev_tags[i])) break; } @@ -427,7 +434,7 @@ if (!self->priv->udev_tags[i]) { mm_dbg ("(%s) [%s] filtered by udev tags", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); return TRUE; } } @@ -536,8 +543,8 @@ gchar *casefolded_vendor; gchar *casefolded_product; - casefolded_vendor = g_utf8_casefold (self->priv->product_strings[i].l, -1); - casefolded_product = g_utf8_casefold (self->priv->product_strings[i].r, -1); + casefolded_vendor = g_utf8_casefold (self->priv->forbidden_product_strings[i].l, -1); + casefolded_product = g_utf8_casefold (self->priv->forbidden_product_strings[i].r, -1); found = (!!strstr (vendor, casefolded_vendor) && !!strstr (product, casefolded_product)); g_free (casefolded_vendor); @@ -577,6 +584,28 @@ return TRUE; } + /* The plugin may specify that only Xmm-based modems are supported. + * If that is the case, filter by allowed Xmm support */ + if (self->priv->allowed_xmm && + !mm_port_probe_is_xmm (probe)) { + /* Unsupported! */ + mm_dbg ("(%s) [%s] filtered as modem is not XMM", + self->priv->name, + mm_port_probe_get_port_name (probe)); + return TRUE; + } + + /* The plugin may specify that Xmm-based modems are NOT supported. + * If that is the case, filter by forbidden Xmm support */ + if (self->priv->forbidden_xmm && + mm_port_probe_is_xmm (probe)) { + /* Unsupported! */ + mm_dbg ("(%s) [%s] filtered as modem is XMM", + self->priv->name, + mm_port_probe_get_port_name (probe)); + return TRUE; + } + return FALSE; } @@ -667,16 +696,24 @@ GAsyncResult *result, GError **error) { + GError *inner_error = NULL; + gssize value; + g_return_val_if_fail (MM_IS_PLUGIN (self), MM_PLUGIN_SUPPORTS_PORT_UNKNOWN); g_return_val_if_fail (G_IS_TASK (result), MM_PLUGIN_SUPPORTS_PORT_UNKNOWN); - return (MMPluginSupportsResult) g_task_propagate_int (G_TASK (result), error); + value = g_task_propagate_int (G_TASK (result), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_PLUGIN_SUPPORTS_PORT_UNKNOWN; + } + return (MMPluginSupportsResult)value; } void mm_plugin_supports_port (MMPlugin *self, MMDevice *device, - GUdevDevice *port, + MMKernelDevice *port, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -691,7 +728,7 @@ g_return_if_fail (MM_IS_PLUGIN (self)); g_return_if_fail (MM_IS_DEVICE (device)); - g_return_if_fail (G_UDEV_IS_DEVICE (port)); + g_return_if_fail (MM_IS_KERNEL_DEVICE (port)); /* Create new cancellable task */ task = g_task_new (self, cancellable, callback, user_data); @@ -718,16 +755,16 @@ MM_CORE_ERROR_FAILED, "(%s) Missing port probe for port (%s/%s)", self->priv->name, - g_udev_device_get_subsystem (port), - g_udev_device_get_name (port)); + mm_kernel_device_get_subsystem (port), + mm_kernel_device_get_name (port)); g_object_unref (task); return; } /* Before launching any probing, check if the port is a net device. */ - if (g_str_equal (g_udev_device_get_subsystem (port), "net")) { + if (g_str_equal (mm_kernel_device_get_subsystem (port), "net")) { mm_dbg ("(%s) [%s] probing deferred until result suggested", - self->priv->name, g_udev_device_get_name (port)); + self->priv->name, mm_kernel_device_get_name (port)); g_task_return_int (task, MM_PLUGIN_SUPPORTS_PORT_DEFER_UNTIL_SUGGESTED); g_object_unref (task); return; @@ -735,7 +772,7 @@ /* Build flags depending on what probing needed */ probe_run_flags = MM_PORT_PROBE_NONE; - if (!g_str_has_prefix (g_udev_device_get_name (port), "cdc-wdm")) { + if (!g_str_has_prefix (mm_kernel_device_get_name (port), "cdc-wdm")) { /* Serial ports... */ if (self->priv->at) probe_run_flags |= MM_PORT_PROBE_AT; @@ -745,9 +782,9 @@ probe_run_flags |= MM_PORT_PROBE_QCDM; } else { /* cdc-wdm ports... */ - if (self->priv->qmi && !g_strcmp0 (mm_device_utils_get_port_driver (port), "qmi_wwan")) + if (self->priv->qmi && !g_strcmp0 (mm_kernel_device_get_driver (port), "qmi_wwan")) probe_run_flags |= MM_PORT_PROBE_QMI; - else if (self->priv->mbim && !g_strcmp0 (mm_device_utils_get_port_driver (port), "cdc_mbim")) + else if (self->priv->mbim && !g_strcmp0 (mm_kernel_device_get_driver (port), "cdc_mbim")) probe_run_flags |= MM_PORT_PROBE_MBIM; else probe_run_flags |= MM_PORT_PROBE_AT; @@ -761,6 +798,8 @@ probe_run_flags |= MM_PORT_PROBE_AT_PRODUCT; if (self->priv->icera_probe || self->priv->allowed_icera || self->priv->forbidden_icera) probe_run_flags |= MM_PORT_PROBE_AT_ICERA; + if (self->priv->xmm_probe || self->priv->allowed_xmm || self->priv->forbidden_xmm) + probe_run_flags |= MM_PORT_PROBE_AT_XMM; } /* If no explicit probing was required, just request to grab it without probing anything. @@ -780,7 +819,7 @@ mm_dbg ("(%s) [%s] not setting up AT probing tasks: " "modem already has the expected single AT port", self->priv->name, - g_udev_device_get_name (port)); + mm_kernel_device_get_name (port)); /* Assuming it won't be an AT port. We still run the probe anyway, in * case we need to check for other port types (e.g. QCDM) */ @@ -800,7 +839,7 @@ probe_list_str = mm_port_probe_flag_build_string_from_mask (ctx->flags); mm_dbg ("(%s) [%s] probe required: '%s'", self->priv->name, - g_udev_device_get_name (port), + mm_kernel_device_get_name (port), probe_list_str); g_free (probe_list_str); @@ -819,9 +858,9 @@ /*****************************************************************************/ MMPluginSupportsHint -mm_plugin_discard_port_early (MMPlugin *self, - MMDevice *device, - GUdevDevice *port) +mm_plugin_discard_port_early (MMPlugin *self, + MMDevice *device, + MMKernelDevice *port) { gboolean need_vendor_probing = FALSE; gboolean need_product_probing = FALSE; @@ -865,7 +904,7 @@ /* Let the plugin create the modem from the port probe results */ modem = MM_PLUGIN_GET_CLASS (self)->create_modem (MM_PLUGIN (self), - mm_device_get_path (device), + mm_device_get_uid (device), mm_device_get_drivers (device), mm_device_get_vendor (device), mm_device_get_product (device), @@ -904,21 +943,17 @@ mm_port_probe_get_port_subsys (probe), mm_port_probe_get_port_name (probe)); grabbed = mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), MM_PORT_TYPE_IGNORED, MM_PORT_SERIAL_AT_FLAG_NONE, &inner_error); } #if !defined WITH_QMI else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET && - !g_strcmp0 (mm_device_utils_get_port_driver (mm_port_probe_peek_port (probe)), "qmi_wwan")) { + !g_strcmp0 (mm_kernel_device_get_driver (mm_port_probe_peek_port (probe)), "qmi_wwan")) { /* Try to generically grab the port, but flagged as ignored */ grabbed = mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), MM_PORT_TYPE_IGNORED, MM_PORT_SERIAL_AT_FLAG_NONE, &inner_error); @@ -926,12 +961,10 @@ #endif #if !defined WITH_MBIM else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET && - !g_strcmp0 (mm_device_utils_get_port_driver (mm_port_probe_peek_port (probe)), "cdc_mbim")) { + !g_strcmp0 (mm_kernel_device_get_driver (mm_port_probe_peek_port (probe)), "cdc_mbim")) { /* Try to generically grab the port, but flagged as ignored */ grabbed = mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), MM_PORT_TYPE_IGNORED, MM_PORT_SERIAL_AT_FLAG_NONE, &inner_error); @@ -944,9 +977,7 @@ &inner_error); else grabbed = mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_parent_path (probe), + mm_port_probe_peek_port (probe), mm_port_probe_get_port_type (probe), MM_PORT_SERIAL_AT_FLAG_NONE, &inner_error); @@ -962,20 +993,38 @@ guint i; for (i = 0; virtual_ports[i]; i++) { - GError *inner_error = NULL; - - if (!mm_base_modem_grab_port (modem, - "virtual", - virtual_ports[i], - NULL, - MM_PORT_TYPE_AT, - MM_PORT_SERIAL_AT_FLAG_NONE, - &inner_error)) { + GError *inner_error = NULL; + MMKernelDevice *kernel_device; + MMKernelEventProperties *properties; + + properties = mm_kernel_event_properties_new (); + mm_kernel_event_properties_set_action (properties, "add"); + mm_kernel_event_properties_set_subsystem (properties, "virtual"); + mm_kernel_event_properties_set_name (properties, virtual_ports[i]); + + /* Give an empty set of rules, because we don't want them to be + * loaded from the udev rules path (as there may not be any + * installed yet). */ + kernel_device = mm_kernel_device_generic_new_with_rules (properties, NULL, &inner_error); + if (!kernel_device) { + mm_warn ("Could not grab port (virtual/%s): '%s'", + virtual_ports[i], + inner_error ? inner_error->message : "unknown error"); + g_clear_error (&inner_error); + } else if (!mm_base_modem_grab_port (modem, + kernel_device, + MM_PORT_TYPE_AT, + MM_PORT_SERIAL_AT_FLAG_NONE, + &inner_error)) { mm_warn ("Could not grab port (virtual/%s): '%s'", virtual_ports[i], inner_error ? inner_error->message : "unknown error"); g_clear_error (&inner_error); } + + if (kernel_device) + g_object_unref (kernel_device); + g_object_unref (properties); } } @@ -1086,6 +1135,18 @@ /* Construct only */ self->priv->forbidden_icera = g_value_get_boolean (value); break; + case PROP_XMM_PROBE: + /* Construct only */ + self->priv->xmm_probe = g_value_get_boolean (value); + break; + case PROP_ALLOWED_XMM: + /* Construct only */ + self->priv->allowed_xmm = g_value_get_boolean (value); + break; + case PROP_FORBIDDEN_XMM: + /* Construct only */ + self->priv->forbidden_xmm = g_value_get_boolean (value); + break; case PROP_CUSTOM_AT_PROBE: /* Construct only */ self->priv->custom_at_probe = g_value_dup_boxed (value); @@ -1178,6 +1239,15 @@ case PROP_FORBIDDEN_ICERA: g_value_set_boolean (value, self->priv->forbidden_icera); break; + case PROP_XMM_PROBE: + g_value_set_boolean (value, self->priv->xmm_probe); + break; + case PROP_ALLOWED_XMM: + g_value_set_boolean (value, self->priv->allowed_xmm); + break; + case PROP_FORBIDDEN_XMM: + g_value_set_boolean (value, self->priv->forbidden_xmm); + break; case PROP_CUSTOM_AT_PROBE: g_value_set_boxed (value, self->priv->custom_at_probe); break; @@ -1400,6 +1470,30 @@ FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property + (object_class, PROP_XMM_PROBE, + g_param_spec_boolean (MM_PLUGIN_XMM_PROBE, + "XMM probe", + "Request to probe for XMM support.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_ALLOWED_XMM, + g_param_spec_boolean (MM_PLUGIN_ALLOWED_XMM, + "Allowed XMM", + "Whether XMM support is allowed in this plugin.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_FORBIDDEN_XMM, + g_param_spec_boolean (MM_PLUGIN_FORBIDDEN_XMM, + "Allowed XMM", + "Whether XMM support is forbidden in this plugin.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (object_class, PROP_CUSTOM_AT_PROBE, g_param_spec_boxed (MM_PLUGIN_CUSTOM_AT_PROBE, diff -Nru modemmanager-1.6.8/src/mm-plugin.h modemmanager-1.10.0/src/mm-plugin.h --- modemmanager-1.6.8/src/mm-plugin.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-plugin.h 2019-01-15 15:57:35.000000000 +0100 @@ -20,12 +20,12 @@ #include #include -#include #include "mm-base-modem.h" #include "mm-port.h" #include "mm-port-probe.h" #include "mm-device.h" +#include "mm-kernel-device.h" #define MM_PLUGIN_GENERIC_NAME "Generic" #define MM_PLUGIN_MAJOR_VERSION 4 @@ -66,6 +66,9 @@ #define MM_PLUGIN_ICERA_PROBE "icera-probe" #define MM_PLUGIN_ALLOWED_ICERA "allowed-icera" #define MM_PLUGIN_FORBIDDEN_ICERA "forbidden-icera" +#define MM_PLUGIN_XMM_PROBE "xmm-probe" +#define MM_PLUGIN_ALLOWED_XMM "allowed-xmm" +#define MM_PLUGIN_FORBIDDEN_XMM "forbidden-xmm" #define MM_PLUGIN_CUSTOM_INIT "custom-init" #define MM_PLUGIN_CUSTOM_AT_PROBE "custom-at-probe" #define MM_PLUGIN_SEND_DELAY "send-delay" @@ -104,7 +107,7 @@ /* Plugins need to provide a method to create a modem object given * a list of port probes (Mandatory) */ MMBaseModem *(*create_modem) (MMPlugin *plugin, - const gchar *sysfs_path, + const gchar *uid, const gchar **drivers, guint16 vendor, guint16 product, @@ -125,13 +128,13 @@ /* This method will run all pre-probing filters, to see if we can discard this * plugin from the probing logic as soon as possible. */ -MMPluginSupportsHint mm_plugin_discard_port_early (MMPlugin *plugin, - MMDevice *device, - GUdevDevice *port); +MMPluginSupportsHint mm_plugin_discard_port_early (MMPlugin *plugin, + MMDevice *device, + MMKernelDevice *port); void mm_plugin_supports_port (MMPlugin *plugin, MMDevice *device, - GUdevDevice *port, + MMKernelDevice *port, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); diff -Nru modemmanager-1.6.8/src/mm-plugin-manager.c modemmanager-1.10.0/src/mm-plugin-manager.c --- modemmanager-1.6.8/src/mm-plugin-manager.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-plugin-manager.c 2018-11-15 09:55:53.000000000 +0100 @@ -38,12 +38,15 @@ enum { PROP_0, PROP_PLUGIN_DIR, + PROP_FILTER, LAST_PROP }; struct _MMPluginManagerPrivate { /* Path to look for plugins */ gchar *plugin_dir; + /* Device filter */ + MMFilter *filter; /* This list contains all plugins except for the generic one, order is not * important. It is loaded once when the program starts, and the list is NOT @@ -62,7 +65,7 @@ static GList * plugin_manager_build_plugins_list (MMPluginManager *self, MMDevice *device, - GUdevDevice *port) + MMKernelDevice *port) { GList *list = NULL; GList *l; @@ -87,7 +90,7 @@ case MM_PLUGIN_SUPPORTS_HINT_SUPPORTED: /* Really supported, clean existing list and add it alone */ if (list) { - g_list_free_full (list, (GDestroyNotify) g_object_unref); + g_list_free_full (list, g_object_unref); list = NULL; } list = g_list_prepend (list, g_object_ref (l->data)); @@ -95,7 +98,7 @@ supported_found = TRUE; break; default: - g_assert_not_reached(); + g_assert_not_reached (); } } @@ -179,8 +182,8 @@ gchar *name; /* The device where the port is*/ MMDevice *device; - /* The GUDev reported port object */ - GUdevDevice *port; + /* The reported kernel port object */ + MMKernelDevice *port; /* The operation task */ GTask *task; @@ -224,7 +227,7 @@ if (port_context->suggested_plugin) g_object_unref (port_context->suggested_plugin); if (port_context->plugins) - g_list_free_full (port_context->plugins, (GDestroyNotify) g_object_unref); + g_list_free_full (port_context->plugins, g_object_unref); if (port_context->cancellable) g_object_unref (port_context->cancellable); g_free (port_context->name); @@ -255,8 +258,11 @@ { GTask *task; - /* Steal the task from the task */ - g_assert (port_context->task); + /* If already completed, do nothing */ + if (!port_context->task) + return; + + /* Steal the task from the context, we only will complete once */ task = port_context->task; port_context->task = NULL; @@ -540,25 +546,28 @@ mm_dbg ("[plugin manager) task %s: cancellation requested", port_context->name); - /* The port context is cancelled now */ - g_cancellable_cancel (port_context->cancellable); - - /* If the task was deferred, we can cancel and complete it right away */ - if (port_context->defer_id) { - g_source_remove (port_context->defer_id); - port_context->defer_id = 0; - port_context_complete (port_context); - return TRUE; - } + /* Make sure we hold a port context reference while cancelling, as the + * cancellable signal handlers may end up unref-ing our last reference + * otherwise. */ + port_context_ref (port_context); + { + /* The port context is cancelled now */ + g_cancellable_cancel (port_context->cancellable); - /* If the task was deferred until a result is suggested, we can also - * complete it right away */ - if (port_context->defer_until_suggested) { - port_context_complete (port_context); - return TRUE; + /* If the task was deferred, we can cancel and complete it right away */ + if (port_context->defer_id) { + g_source_remove (port_context->defer_id); + port_context->defer_id = 0; + port_context_complete (port_context); + } + /* If the task was deferred until a result is suggested, we can also + * complete it right away */ + else if (port_context->defer_until_suggested) + port_context_complete (port_context); + /* else, the task may be currently checking support with a given plugin */ } + port_context_unref (port_context); - /* The task may be currently checking support with a given plugin */ return TRUE; } @@ -628,7 +637,7 @@ * cancellation error, regardless of what the standard logic does. */ port_context->cancellable = g_cancellable_new (); - /* Create a inner task for the port context. The result we expect is the + /* Create an inner task for the port context. The result we expect is the * best plugin found for the port. */ port_context->task = g_task_new (self, port_context->cancellable, callback, user_data); @@ -642,7 +651,7 @@ port_context_new (MMPluginManager *self, const gchar *parent_name, MMDevice *device, - GUdevDevice *port) + MMKernelDevice *port) { PortContext *port_context; @@ -653,7 +662,7 @@ port_context->timer = g_timer_new (); /* Set context name */ - port_context->name = g_strdup_printf ("%s,%s", parent_name, g_udev_device_get_name (port)); + port_context->name = g_strdup_printf ("%s,%s", parent_name, mm_kernel_device_get_name (port)); return port_context; } @@ -757,8 +766,8 @@ } static PortContext * -device_context_peek_running_port_context (DeviceContext *device_context, - GUdevDevice *port) +device_context_peek_running_port_context (DeviceContext *device_context, + MMKernelDevice *port) { GList *l; @@ -767,15 +776,15 @@ port_context = (PortContext *)(l->data); if ((port_context->port == port) || - (!g_strcmp0 (g_udev_device_get_name (port_context->port), g_udev_device_get_name (port)))) + (!g_strcmp0 (mm_kernel_device_get_name (port_context->port), mm_kernel_device_get_name (port)))) return port_context; } return NULL; } static PortContext * -device_context_peek_waiting_port_context (DeviceContext *device_context, - GUdevDevice *port) +device_context_peek_waiting_port_context (DeviceContext *device_context, + MMKernelDevice *port) { GList *l; @@ -784,7 +793,7 @@ port_context = (PortContext *)(l->data); if ((port_context->port == port) || - (!g_strcmp0 (g_udev_device_get_name (port_context->port), g_udev_device_get_name (port)))) + (!g_strcmp0 (mm_kernel_device_get_name (port_context->port), mm_kernel_device_get_name (port)))) return port_context; } return NULL; @@ -837,7 +846,7 @@ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "not supported by any plugin"); else - g_task_return_pointer (task, g_object_ref (device_context->best_plugin), (GDestroyNotify) g_object_unref); + g_task_return_pointer (task, g_object_ref (device_context->best_plugin), g_object_unref); g_object_unref (task); } @@ -988,7 +997,7 @@ PortContext *port_context = (PortContext *) (l->data); const gchar *portname; - portname = g_udev_device_get_name (port_context->port); + portname = mm_kernel_device_get_name (port_context->port); if (!s) s = g_string_new (portname); else @@ -1102,33 +1111,44 @@ { MMPluginManager *self; GList *l; + GList *tmp; - /* Recover plugin manager */ - self = MM_PLUGIN_MANAGER (device_context->self); + self = device_context->self; device_context->min_wait_time_id = 0; mm_dbg ("[plugin manager] task %s: min wait time elapsed", device_context->name); /* Move list of port contexts out of the wait list */ g_assert (!device_context->port_contexts); - device_context->port_contexts = device_context->wait_port_contexts; + tmp = device_context->wait_port_contexts; device_context->wait_port_contexts = NULL; /* Launch supports check for each port in the Plugin Manager */ - for (l = device_context->port_contexts; l; l = g_list_next (l)) - device_context_run_port_context (device_context, (PortContext *)(l->data)); + for (l = tmp; l; l = g_list_next (l)) { + PortContext *port_context = (PortContext *)(l->data); + + if (!mm_filter_device_and_port (self->priv->filter, port_context->device, port_context->port)) { + /* If port is filtered, unref it right away */ + port_context_unref (port_context); + } else { + /* If port not filtered, store and run it */ + device_context->port_contexts = g_list_append (device_context->port_contexts, port_context); + device_context_run_port_context (device_context, port_context); + } + } + g_list_free (tmp); return G_SOURCE_REMOVE; } static void -device_context_port_released (DeviceContext *device_context, - GUdevDevice *port) +device_context_port_released (DeviceContext *device_context, + MMKernelDevice *port) { PortContext *port_context; mm_dbg ("[plugin manager] task %s: port released: %s", - device_context->name, g_udev_device_get_name (port)); + device_context->name, mm_kernel_device_get_name (port)); /* Check if there's a waiting port context */ port_context = device_context_peek_waiting_port_context (device_context, port); @@ -1150,12 +1170,12 @@ /* This is not something worth warning. If the probing task has already * been finished, it will already be removed from the list */ mm_dbg ("[plugin manager] task %s: port wasn't found: %s", - device_context->name, g_udev_device_get_name (port)); + device_context->name, mm_kernel_device_get_name (port)); } static void -device_context_port_grabbed (DeviceContext *device_context, - GUdevDevice *port) +device_context_port_grabbed (DeviceContext *device_context, + MMKernelDevice *port) { MMPluginManager *self; PortContext *port_context; @@ -1164,7 +1184,7 @@ self = MM_PLUGIN_MANAGER (device_context->self); mm_dbg ("[plugin manager] task %s: port grabbed: %s", - device_context->name, g_udev_device_get_name (port)); + device_context->name, mm_kernel_device_get_name (port)); /* Ignore if for any reason we still have it in the running list */ port_context = device_context_peek_running_port_context (device_context, port); @@ -1288,7 +1308,7 @@ * cancellation error, regardless of what the standard logic does. */ device_context->cancellable = g_cancellable_new (); - /* Create a inner task for the device context. We'll complete this task when + /* Create an inner task for the device context. We'll complete this task when * the last port has been probed. */ device_context->task = g_task_new (self, device_context->cancellable, callback, user_data); } @@ -1355,7 +1375,7 @@ device_context = (DeviceContext *)(l->data); if ((device == device_context->device) || - (! g_strcmp0 (mm_device_get_path (device_context->device), mm_device_get_path (device)))) + (!g_strcmp0 (mm_device_get_uid (device_context->device), mm_device_get_uid (device)))) return device_context; } return NULL; @@ -1401,7 +1421,7 @@ if (!best_plugin) g_task_return_error (common->task, error); else - g_task_return_pointer (common->task, best_plugin, (GDestroyNotify) g_object_unref); + g_task_return_pointer (common->task, best_plugin, g_object_unref); common_async_context_free (common); } @@ -1427,7 +1447,7 @@ if (device_context) { g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS, "Device support check task already available for device '%s'", - mm_device_get_path (device)); + mm_device_get_uid (device)); g_object_unref (task); return; } @@ -1439,7 +1459,7 @@ self->priv->device_contexts = g_list_prepend (self->priv->device_contexts, device_context); mm_dbg ("[plugin manager] task %s: new support task for device: %s", - device_context->name, mm_device_get_path (device_context->device)); + device_context->name, mm_device_get_uid (device_context->device)); /* Run device context */ device_context_run (self, @@ -1618,13 +1638,15 @@ } MMPluginManager * -mm_plugin_manager_new (const gchar *plugin_dir, - GError **error) +mm_plugin_manager_new (const gchar *plugin_dir, + MMFilter *filter, + GError **error) { return g_initable_new (MM_TYPE_PLUGIN_MANAGER, NULL, error, MM_PLUGIN_MANAGER_PLUGIN_DIR, plugin_dir, + MM_PLUGIN_MANAGER_FILTER, filter, NULL); } @@ -1650,6 +1672,9 @@ g_free (priv->plugin_dir); priv->plugin_dir = g_value_dup_string (value); break; + case PROP_FILTER: + priv->filter = g_value_dup_object (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1668,6 +1693,9 @@ case PROP_PLUGIN_DIR: g_value_set_string (value, priv->plugin_dir); break; + case PROP_FILTER: + g_value_set_object (value, priv->filter); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1690,7 +1718,7 @@ /* Cleanup list of plugins */ if (self->priv->plugins) { - g_list_free_full (self->priv->plugins, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->plugins, g_object_unref); self->priv->plugins = NULL; } g_clear_object (&self->priv->generic); @@ -1698,6 +1726,8 @@ g_free (self->priv->plugin_dir); self->priv->plugin_dir = NULL; + g_clear_object (&self->priv->filter); + G_OBJECT_CLASS (mm_plugin_manager_parent_class)->dispose (object); } @@ -1727,4 +1757,11 @@ "Where to look for plugins", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property + (object_class, PROP_FILTER, + g_param_spec_object (MM_PLUGIN_MANAGER_FILTER, + "Filter", + "Device filter", + MM_TYPE_FILTER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); } diff -Nru modemmanager-1.6.8/src/mm-plugin-manager.h modemmanager-1.10.0/src/mm-plugin-manager.h --- modemmanager-1.6.8/src/mm-plugin-manager.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-plugin-manager.h 2018-11-15 09:55:53.000000000 +0100 @@ -22,6 +22,7 @@ #include "mm-device.h" #include "mm-plugin.h" +#include "mm-filter.h" #include "mm-base-modem.h" #define MM_TYPE_PLUGIN_MANAGER (mm_plugin_manager_get_type ()) @@ -32,6 +33,7 @@ #define MM_PLUGIN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MANAGER, MMPluginManagerClass)) #define MM_PLUGIN_MANAGER_PLUGIN_DIR "plugin-dir" /* Construct-only */ +#define MM_PLUGIN_MANAGER_FILTER "filter" /* Construct-only */ typedef struct _MMPluginManager MMPluginManager; typedef struct _MMPluginManagerClass MMPluginManagerClass; @@ -48,6 +50,7 @@ GType mm_plugin_manager_get_type (void); MMPluginManager *mm_plugin_manager_new (const gchar *plugindir, + MMFilter *filter, GError **error); void mm_plugin_manager_device_support_check (MMPluginManager *self, MMDevice *device, diff -Nru modemmanager-1.6.8/src/mm-port.c modemmanager-1.10.0/src/mm-port.c --- modemmanager-1.6.8/src/mm-port.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port.c 2018-11-15 09:55:53.000000000 +0100 @@ -29,8 +29,7 @@ PROP_SUBSYS, PROP_TYPE, PROP_CONNECTED, - PROP_PARENT_PATH, - + PROP_KERNEL_DEVICE, LAST_PROP }; @@ -39,7 +38,7 @@ MMPortSubsys subsys; MMPortType ptype; gboolean connected; - gchar *parent_path; + MMKernelDevice *kernel_device; }; /*****************************************************************************/ @@ -96,12 +95,12 @@ } } -const gchar * -mm_port_get_parent_path (MMPort *self) +MMKernelDevice * +mm_port_peek_kernel_device (MMPort *self) { g_return_val_if_fail (MM_IS_PORT (self), NULL); - return self->priv->parent_path; + return self->priv->kernel_device; } /*****************************************************************************/ @@ -136,9 +135,10 @@ case PROP_CONNECTED: self->priv->connected = g_value_get_boolean (value); break; - case PROP_PARENT_PATH: - g_free (self->priv->parent_path); - self->priv->parent_path = g_value_dup_string (value); + case PROP_KERNEL_DEVICE: + /* Not construct only, but only set once */ + g_assert (!self->priv->kernel_device); + self->priv->kernel_device = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -165,8 +165,8 @@ case PROP_CONNECTED: g_value_set_boolean (value, self->priv->connected); break; - case PROP_PARENT_PATH: - g_value_set_string (value, self->priv->parent_path); + case PROP_KERNEL_DEVICE: + g_value_set_object (value, self->priv->kernel_device); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -180,12 +180,21 @@ MMPort *self = MM_PORT (object); g_free (self->priv->device); - g_free (self->priv->parent_path); G_OBJECT_CLASS (mm_port_parent_class)->finalize (object); } static void +dispose (GObject *object) +{ + MMPort *self = MM_PORT (object); + + g_clear_object (&self->priv->kernel_device); + + G_OBJECT_CLASS (mm_port_parent_class)->dispose (object); +} + +static void mm_port_class_init (MMPortClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -196,6 +205,7 @@ object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; + object_class->dispose = dispose; g_object_class_install_property (object_class, PROP_DEVICE, @@ -234,10 +244,10 @@ G_PARAM_READWRITE)); g_object_class_install_property - (object_class, PROP_PARENT_PATH, - g_param_spec_string (MM_PORT_PARENT_PATH, - "Parent path", - "sysfs path of the parent device", - NULL, + (object_class, PROP_KERNEL_DEVICE, + g_param_spec_object (MM_PORT_KERNEL_DEVICE, + "Kernel device", + "kernel device object", + MM_TYPE_KERNEL_DEVICE, G_PARAM_READWRITE)); } diff -Nru modemmanager-1.6.8/src/mm-port.h modemmanager-1.10.0/src/mm-port.h --- modemmanager-1.6.8/src/mm-port.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port.h 2018-11-15 09:55:53.000000000 +0100 @@ -20,6 +20,8 @@ #include #include +#include "mm-kernel-device.h" + typedef enum { /*< underscore_name=mm_port_subsys >*/ MM_PORT_SUBSYS_UNKNOWN = 0x0, MM_PORT_SUBSYS_TTY, @@ -49,11 +51,11 @@ #define MM_IS_PORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PORT)) #define MM_PORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PORT, MMPortClass)) -#define MM_PORT_DEVICE "device" -#define MM_PORT_SUBSYS "subsys" -#define MM_PORT_TYPE "type" -#define MM_PORT_CONNECTED "connected" -#define MM_PORT_PARENT_PATH "parent-path" +#define MM_PORT_DEVICE "device" +#define MM_PORT_SUBSYS "subsys" +#define MM_PORT_TYPE "type" +#define MM_PORT_CONNECTED "connected" +#define MM_PORT_KERNEL_DEVICE "kernel-device" typedef struct _MMPort MMPort; typedef struct _MMPortClass MMPortClass; @@ -70,11 +72,11 @@ GType mm_port_get_type (void); -const gchar *mm_port_get_device (MMPort *self); -MMPortSubsys mm_port_get_subsys (MMPort *self); -MMPortType mm_port_get_port_type (MMPort *self); -const gchar *mm_port_get_parent_path (MMPort *self); -gboolean mm_port_get_connected (MMPort *self); -void mm_port_set_connected (MMPort *self, gboolean connected); +const gchar *mm_port_get_device (MMPort *self); +MMPortSubsys mm_port_get_subsys (MMPort *self); +MMPortType mm_port_get_port_type (MMPort *self); +gboolean mm_port_get_connected (MMPort *self); +void mm_port_set_connected (MMPort *self, gboolean connected); +MMKernelDevice *mm_port_peek_kernel_device (MMPort *self); #endif /* MM_PORT_H */ diff -Nru modemmanager-1.6.8/src/mm-port-mbim.c modemmanager-1.10.0/src/mm-port-mbim.c --- modemmanager-1.6.8/src/mm-port-mbim.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-mbim.c 2019-01-15 15:57:35.000000000 +0100 @@ -10,12 +10,18 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * - * Copyright (C) 2013 Aleksander Morgado + * Copyright (C) 2013-2018 Aleksander Morgado */ +#include + #include #include +#if defined WITH_QMI +# include +#endif + #include #include @@ -25,135 +31,323 @@ G_DEFINE_TYPE (MMPortMbim, mm_port_mbim, MM_TYPE_PORT) struct _MMPortMbimPrivate { - gboolean in_progress; + gboolean in_progress; MbimDevice *mbim_device; +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + QmiDevice *qmi_device; + GList *qmi_clients; +#endif }; /*****************************************************************************/ -typedef struct { - MMPortMbim *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; -} PortContext; +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +gboolean +mm_port_mbim_supports_qmi (MMPortMbim *self) +{ + return !!self->priv->qmi_device; +} + +QmiClient * +mm_port_mbim_peek_qmi_client (MMPortMbim *self, + QmiService service) +{ + GList *l; + + for (l = self->priv->qmi_clients; l; l = g_list_next (l)) { + QmiClient *qmi_client = QMI_CLIENT (l->data); + + if (qmi_client_get_service (qmi_client) == service) + return qmi_client; + } + + return NULL; +} + +QmiClient * +mm_port_mbim_get_qmi_client (MMPortMbim *self, + QmiService service) +{ + QmiClient *client; + + client = mm_port_mbim_peek_qmi_client (self, service); + return (client ? g_object_ref (client) : NULL); +} + +gboolean +mm_port_mbim_allocate_qmi_client_finish (MMPortMbim *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} static void -port_context_complete_and_free (PortContext *ctx) +allocate_client_ready (QmiDevice *qmi_device, + GAsyncResult *res, + GTask *task) { - g_simple_async_result_complete_in_idle (ctx->result); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_slice_free (PortContext, ctx); -} - -static PortContext * -port_context_new (MMPortMbim *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - PortContext *ctx; - - ctx = g_slice_new0 (PortContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - port_context_new); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; - return ctx; + MMPortMbim *self; + QmiClient *qmi_client; + GError *error = NULL; + + self = g_task_get_source_object (task); + qmi_client = qmi_device_allocate_client_finish (qmi_device, res, &error); + if (!qmi_client) { + g_prefix_error (&error, + "Couldn't create QMI client for service '%s': ", + qmi_service_get_string ((QmiService) GPOINTER_TO_INT (g_task_get_task_data (task)))); + g_task_return_error (task, error); + } else { + /* Store the client in our internal list */ + self->priv->qmi_clients = g_list_prepend (self->priv->qmi_clients, qmi_client); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); +} + +void +mm_port_mbim_allocate_qmi_client (MMPortMbim *self, + QmiService service, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + + task = g_task_new (self, cancellable, callback, user_data); + + if (!mm_port_mbim_is_open (self)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, + "Port is closed"); + g_object_unref (task); + return; + } + + if (!mm_port_mbim_supports_qmi (self)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Port doesn't support QMI over MBIM"); + g_object_unref (task); + return; + } + + if (!!mm_port_mbim_peek_qmi_client (self, service)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_EXISTS, + "Client for service '%s' already allocated", + qmi_service_get_string (service)); + g_object_unref (task); + return; + } + + g_task_set_task_data (task, GINT_TO_POINTER (service), NULL); + qmi_device_allocate_client (self->priv->qmi_device, + service, + QMI_CID_NONE, + 10, + cancellable, + (GAsyncReadyCallback)allocate_client_ready, + task); } +#endif + /*****************************************************************************/ gboolean -mm_port_mbim_open_finish (MMPortMbim *self, - GAsyncResult *res, - GError **error) +mm_port_mbim_open_finish (MMPortMbim *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + +static void +qmi_device_open_ready (QmiDevice *dev, + GAsyncResult *res, + GTask *task) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + GError *error = NULL; + MMPortMbim *self; + + self = g_task_get_source_object (task); + + if (!qmi_device_open_finish (dev, res, &error)) { + mm_dbg ("[%s] error: couldn't open QmiDevice: %s", + mm_port_get_device (MM_PORT (self)), + error->message); + g_error_free (error); + g_clear_object (&self->priv->qmi_device); + /* Ignore error and complete */ + mm_info ("[%s] MBIM device is not QMI capable", + mm_port_get_device (MM_PORT (self))); + } else { + mm_info ("[%s] MBIM device is QMI capable", + mm_port_get_device (MM_PORT (self))); + } + + self->priv->in_progress = FALSE; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -mbim_device_open_ready (MbimDevice *mbim_device, +qmi_device_new_ready (GObject *unused, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + MMPortMbim *self; + + self = g_task_get_source_object (task); + + self->priv->qmi_device = qmi_device_new_finish (res, &error); + if (!self->priv->qmi_device) { + mm_dbg ("[%s] error: couldn't create QmiDevice: %s", + mm_port_get_device (MM_PORT (self)), + error->message); + g_error_free (error); + /* Ignore error and complete */ + mm_info ("[%s] MBIM device is not QMI capable", + mm_port_get_device (MM_PORT (self))); + self->priv->in_progress = FALSE; + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Try to open using QMI over MBIM */ + mm_dbg ("[%s] trying to open QMI over MBIM device...", + mm_port_get_device (MM_PORT (self))); + qmi_device_open (self->priv->qmi_device, + (QMI_DEVICE_OPEN_FLAGS_PROXY | + QMI_DEVICE_OPEN_FLAGS_MBIM | + QMI_DEVICE_OPEN_FLAGS_VERSION_INFO | + QMI_DEVICE_OPEN_FLAGS_EXPECT_INDICATIONS), + 15, + g_task_get_cancellable (task), + (GAsyncReadyCallback)qmi_device_open_ready, + task); +} + +#endif + +static void +mbim_device_open_ready (MbimDevice *mbim_device, GAsyncResult *res, - PortContext *ctx) + GTask *task) { - GError *error = NULL; + GError *error = NULL; + MMPortMbim *self; + + self = g_task_get_source_object (task); - /* Reset the progress flag */ - ctx->self->priv->in_progress = FALSE; if (!mbim_device_open_full_finish (mbim_device, res, &error)) { - g_clear_object (&ctx->self->priv->mbim_device); - g_simple_async_result_take_error (ctx->result, error); - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_clear_object (&self->priv->mbim_device); + self->priv->in_progress = FALSE; + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("[%s] MBIM device is now open", + mm_port_get_device (MM_PORT (self))); + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + { + GFile *file; + + if ((file = G_FILE (g_task_get_task_data (task)))) { + mm_dbg ("[%s] checking if QMI over MBIM is supported", + mm_port_get_device (MM_PORT (self))); + qmi_device_new (file, + g_task_get_cancellable (task), + (GAsyncReadyCallback) qmi_device_new_ready, + task); + return; + } + } +#endif + + self->priv->in_progress = FALSE; + g_task_return_boolean (task, TRUE); + g_object_unref (task); - port_context_complete_and_free (ctx); } static void -mbim_device_new_ready (GObject *unused, +mbim_device_new_ready (GObject *unused, GAsyncResult *res, - PortContext *ctx) + GTask *task) { - GError *error = NULL; + GError *error = NULL; + MMPortMbim *self; - ctx->self->priv->mbim_device = mbim_device_new_finish (res, &error); - if (!ctx->self->priv->mbim_device) { - g_simple_async_result_take_error (ctx->result, error); - port_context_complete_and_free (ctx); + self = g_task_get_source_object (task); + self->priv->mbim_device = mbim_device_new_finish (res, &error); + if (!self->priv->mbim_device) { + g_task_return_error (task, error); + g_object_unref (task); return; } /* Now open the MBIM device */ - mbim_device_open_full (ctx->self->priv->mbim_device, + mbim_device_open_full (self->priv->mbim_device, MBIM_DEVICE_OPEN_FLAGS_PROXY, 30, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback)mbim_device_open_ready, - ctx); + task); } void -mm_port_mbim_open (MMPortMbim *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +mm_port_mbim_open (MMPortMbim *self, +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + gboolean try_qmi_over_mbim, +#endif + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { GFile *file; gchar *fullpath; - PortContext *ctx; + GTask *task; g_return_if_fail (MM_IS_PORT_MBIM (self)); - ctx = port_context_new (self, cancellable, callback, user_data); + task = g_task_new (self, cancellable, callback, user_data); if (self->priv->in_progress) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "MBIM device open/close operation in progress"); - port_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "MBIM device open/close operation in progress"); + g_object_unref (task); return; } if (self->priv->mbim_device) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - port_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } fullpath = g_strdup_printf ("/dev/%s", mm_port_get_device (MM_PORT (self))); file = g_file_new_for_path (fullpath); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + /* If we want to try QMI over MBIM, store the GFile as task data */ + if (try_qmi_over_mbim) + g_task_set_task_data (task, g_object_ref (file), g_object_unref); +#endif + self->priv->in_progress = TRUE; mbim_device_new (file, - ctx->cancellable, + cancellable, (GAsyncReadyCallback)mbim_device_new_ready, - ctx); + task); g_free (fullpath); g_object_unref (file); @@ -176,25 +370,27 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void mbim_device_close_ready (MbimDevice *device, GAsyncResult *res, - PortContext *ctx) + GTask *task) { GError *error = NULL; + MMPortMbim *self; + + self = g_task_get_source_object (task); + self->priv->in_progress = FALSE; + g_clear_object (&self->priv->mbim_device); if (!mbim_device_close_finish (device, res, &error)) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - ctx->self->priv->in_progress = FALSE; - g_clear_object (&ctx->self->priv->mbim_device); - - port_context_complete_and_free (ctx); + g_object_unref (task); } void @@ -202,33 +398,46 @@ GAsyncReadyCallback callback, gpointer user_data) { - PortContext *ctx; + GTask *task; g_return_if_fail (MM_IS_PORT_MBIM (self)); - ctx = port_context_new (self, NULL, callback, user_data); + task = g_task_new (self, NULL, callback, user_data); if (self->priv->in_progress) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "MBIM device open/close operation in progress"); - port_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "MBIM device open/close operation in progress"); + g_object_unref (task); return; } if (!self->priv->mbim_device) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - port_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } self->priv->in_progress = TRUE; + +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + if (self->priv->qmi_device) { + GError *error = NULL; + + if (!qmi_device_close (self->priv->qmi_device, &error)) { + mm_warn ("Couldn't properly close QMI device: %s", error->message); + g_error_free (error); + } + g_clear_object (&self->priv->qmi_device); + } +#endif + mbim_device_close (self->priv->mbim_device, 5, NULL, (GAsyncReadyCallback)mbim_device_close_ready, - ctx); + task); g_clear_object (&self->priv->mbim_device); } @@ -265,6 +474,12 @@ { MMPortMbim *self = MM_PORT_MBIM (object); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + g_list_free_full (self->priv->qmi_clients, g_object_unref); + self->priv->qmi_clients = NULL; + g_clear_object (&self->priv->qmi_device); +#endif + /* Clear device object */ g_clear_object (&self->priv->mbim_device); diff -Nru modemmanager-1.6.8/src/mm-port-mbim.h modemmanager-1.10.0/src/mm-port-mbim.h --- modemmanager-1.6.8/src/mm-port-mbim.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-mbim.h 2019-01-15 15:57:35.000000000 +0100 @@ -16,12 +16,18 @@ #ifndef MM_PORT_MBIM_H #define MM_PORT_MBIM_H +#include + #include #include #include #include +#if defined WITH_QMI +# include +#endif + #include "mm-port.h" #define MM_TYPE_PORT_MBIM (mm_port_mbim_get_type ()) @@ -49,6 +55,9 @@ MMPortMbim *mm_port_mbim_new (const gchar *name); void mm_port_mbim_open (MMPortMbim *self, +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + gboolean try_qmi_over_mbim, +#endif GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -63,6 +72,22 @@ GAsyncResult *res, GError **error); +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED +gboolean mm_port_mbim_supports_qmi (MMPortMbim *self); +QmiClient *mm_port_mbim_peek_qmi_client (MMPortMbim *self, + QmiService service); +QmiClient *mm_port_mbim_get_qmi_client (MMPortMbim *self, + QmiService service); +void mm_port_mbim_allocate_qmi_client (MMPortMbim *self, + QmiService service, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_port_mbim_allocate_qmi_client_finish (MMPortMbim *self, + GAsyncResult *res, + GError **error); +#endif + MbimDevice *mm_port_mbim_peek_device (MMPortMbim *self); #endif /* MM_PORT_MBIM_H */ diff -Nru modemmanager-1.6.8/src/mm-port-probe.c modemmanager-1.10.0/src/mm-port-probe.c --- modemmanager-1.6.8/src/mm-port-probe.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-probe.c 2019-01-15 15:57:35.000000000 +0100 @@ -11,8 +11,8 @@ * GNU General Public License for more details: * * Copyright (C) 2008 - 2009 Novell, Inc. - * Copyright (C) 2009 - 2011 Red Hat, Inc. - * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2009 - 2018 Red Hat, Inc. + * Copyright (C) 2011 - 2018 Aleksander Morgado */ #include "config.h" @@ -22,6 +22,8 @@ #include #include +#include + #include #include "mm-port-probe.h" @@ -52,6 +54,7 @@ * |----> Vendor * |----> Product * |----> Is Icera? + * |----> Is Xmm? * ----> QCDM Serial Open * |----> QCDM? * ----> QMI Device Open @@ -74,8 +77,7 @@ struct _MMPortProbePrivate { /* Properties */ MMDevice *device; - GUdevDevice *port; - GUdevDevice *parent; + MMKernelDevice *port; /* Probing results */ guint32 flags; @@ -84,11 +86,17 @@ gchar *vendor; gchar *product; gboolean is_icera; + gboolean is_xmm; gboolean is_qmi; gboolean is_mbim; /* From udev tags */ gboolean is_ignored; + gboolean is_gps; + gboolean maybe_at_primary; + gboolean maybe_at_secondary; + gboolean maybe_at_ppp; + gboolean maybe_qcdm; /* Current probing task. Only one can be available at a time */ GTask *task; @@ -151,8 +159,8 @@ if (self->priv->is_at) { mm_dbg ("(%s/%s) port is AT-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Also set as not a QCDM/QMI/MBIM port */ self->priv->is_qcdm = FALSE; @@ -161,14 +169,16 @@ self->priv->flags |= (MM_PORT_PROBE_QCDM | MM_PORT_PROBE_QMI | MM_PORT_PROBE_MBIM); } else { mm_dbg ("(%s/%s) port is not AT-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->vendor = NULL; self->priv->product = NULL; self->priv->is_icera = FALSE; + self->priv->is_xmm = FALSE; self->priv->flags |= (MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT | - MM_PORT_PROBE_AT_ICERA); + MM_PORT_PROBE_AT_ICERA | + MM_PORT_PROBE_AT_XMM); } } @@ -178,14 +188,14 @@ { if (at_vendor) { mm_dbg ("(%s/%s) vendor probing finished", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->vendor = g_utf8_casefold (at_vendor, -1); self->priv->flags |= MM_PORT_PROBE_AT_VENDOR; } else { mm_dbg ("(%s/%s) couldn't probe for vendor string", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->vendor = NULL; self->priv->product = NULL; self->priv->flags |= (MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT); @@ -198,14 +208,14 @@ { if (at_product) { mm_dbg ("(%s/%s) product probing finished", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->product = g_utf8_casefold (at_product, -1); self->priv->flags |= MM_PORT_PROBE_AT_PRODUCT; } else { mm_dbg ("(%s/%s) couldn't probe for product string", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->product = NULL; self->priv->flags |= MM_PORT_PROBE_AT_PRODUCT; } @@ -217,20 +227,39 @@ { if (is_icera) { mm_dbg ("(%s/%s) Modem is Icera-based", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->is_icera = TRUE; self->priv->flags |= MM_PORT_PROBE_AT_ICERA; } else { mm_dbg ("(%s/%s) Modem is probably not Icera-based", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); self->priv->is_icera = FALSE; self->priv->flags |= MM_PORT_PROBE_AT_ICERA; } } void +mm_port_probe_set_result_at_xmm (MMPortProbe *self, + gboolean is_xmm) +{ + if (is_xmm) { + mm_dbg ("(%s/%s) Modem is XMM-based", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + self->priv->is_xmm = TRUE; + self->priv->flags |= MM_PORT_PROBE_AT_XMM; + } else { + mm_dbg ("(%s/%s) Modem is probably not XMM-based", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + self->priv->is_xmm = FALSE; + self->priv->flags |= MM_PORT_PROBE_AT_XMM; + } +} + +void mm_port_probe_set_result_qcdm (MMPortProbe *self, gboolean qcdm) { @@ -239,8 +268,8 @@ if (self->priv->is_qcdm) { mm_dbg ("(%s/%s) port is QCDM-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Also set as not an AT/QMI/MBIM port */ self->priv->is_at = FALSE; @@ -249,16 +278,18 @@ self->priv->vendor = NULL; self->priv->product = NULL; self->priv->is_icera = FALSE; + self->priv->is_xmm = FALSE; self->priv->flags |= (MM_PORT_PROBE_AT | MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT | MM_PORT_PROBE_AT_ICERA | + MM_PORT_PROBE_AT_XMM | MM_PORT_PROBE_QMI | MM_PORT_PROBE_MBIM); } else mm_dbg ("(%s/%s) port is not QCDM-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); } void @@ -270,8 +301,8 @@ if (self->priv->is_qmi) { mm_dbg ("(%s/%s) port is QMI-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Also set as not an AT/QCDM/MBIM port */ self->priv->is_at = FALSE; @@ -283,12 +314,13 @@ MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT | MM_PORT_PROBE_AT_ICERA | + MM_PORT_PROBE_AT_XMM | MM_PORT_PROBE_QCDM | MM_PORT_PROBE_MBIM); } else mm_dbg ("(%s/%s) port is not QMI-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); } void @@ -300,8 +332,8 @@ if (self->priv->is_mbim) { mm_dbg ("(%s/%s) port is MBIM-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Also set as not an AT/QCDM/QMI port */ self->priv->is_at = FALSE; @@ -313,12 +345,13 @@ MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT | MM_PORT_PROBE_AT_ICERA | + MM_PORT_PROBE_AT_XMM | MM_PORT_PROBE_QCDM | MM_PORT_PROBE_QMI); } else mm_dbg ("(%s/%s) port is not MBIM-capable", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); } /*****************************************************************************/ @@ -445,8 +478,8 @@ is_qmi = mm_port_qmi_open_finish (port_qmi, res, &error); if (!is_qmi) { mm_dbg ("(%s/%s) error checking QMI support: '%s'", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), error ? error->message : "unknown error"); g_clear_error (&error); } @@ -471,11 +504,11 @@ #if defined WITH_QMI mm_dbg ("(%s/%s) probing QMI...", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Create a port and try to open it */ - ctx->port_qmi = mm_port_qmi_new (g_udev_device_get_name (self->priv->port)); + ctx->port_qmi = mm_port_qmi_new (mm_kernel_device_get_name (self->priv->port)); mm_port_qmi_open (ctx->port_qmi, FALSE, NULL, @@ -521,8 +554,8 @@ is_mbim = mm_port_mbim_open_finish (mbim_port, res, &error); if (!is_mbim) { mm_dbg ("(%s/%s) error checking MBIM support: '%s'", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), error ? error->message : "unknown error"); g_clear_error (&error); } @@ -547,12 +580,15 @@ #if defined WITH_MBIM mm_dbg ("(%s/%s) probing MBIM...", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Create a port and try to open it */ - ctx->mbim_port = mm_port_mbim_new (g_udev_device_get_name (self->priv->port)); + ctx->mbim_port = mm_port_mbim_new (mm_kernel_device_get_name (self->priv->port)); mm_port_mbim_open (ctx->mbim_port, +#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED + FALSE, /* Don't check QMI over MBIM support at this stage */ +#endif NULL, (GAsyncReadyCallback) mbim_port_open_ready, self); @@ -596,6 +632,39 @@ } /***************************************************************/ + +static void +common_serial_port_setup (MMPortProbe *self, + MMPortSerial *serial) +{ + const gchar *flow_control_tag; + + if (mm_kernel_device_has_property (self->priv->port, ID_MM_TTY_BAUDRATE)) + g_object_set (serial, + MM_PORT_SERIAL_BAUD, mm_kernel_device_get_property_as_int (self->priv->port, ID_MM_TTY_BAUDRATE), + NULL); + + flow_control_tag = mm_kernel_device_get_property (self->priv->port, ID_MM_TTY_FLOW_CONTROL); + if (flow_control_tag) { + MMFlowControl flow_control; + GError *error = NULL; + + flow_control = mm_flow_control_from_string (flow_control_tag, &error); + if (flow_control == MM_FLOW_CONTROL_UNKNOWN) { + mm_warn ("(%s/%s) Unsupported flow control settings in port: %s", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), + error->message); + g_error_free (error); + } else { + g_object_set (serial, + MM_PORT_SERIAL_FLOW_CONTROL, flow_control, + NULL); + } + } +} + +/***************************************************************/ /* QCDM */ static void @@ -623,8 +692,8 @@ result = qcdm_cmd_version_info_result ((const gchar *) response->data, response->len, &err); if (!result) { mm_warn ("(%s/%s) failed to parse QCDM version info command result: %d", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), err); retry = TRUE; } else { @@ -687,8 +756,8 @@ return G_SOURCE_REMOVE; mm_dbg ("(%s/%s) probing QCDM...", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* If open, close the AT port */ if (ctx->serial) { @@ -702,25 +771,28 @@ } /* Open the QCDM port */ - ctx->serial = MM_PORT_SERIAL (mm_port_serial_qcdm_new (g_udev_device_get_name (self->priv->port))); + ctx->serial = MM_PORT_SERIAL (mm_port_serial_qcdm_new (mm_kernel_device_get_name (self->priv->port))); if (!ctx->serial) { port_probe_task_return_error (self, g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "(%s/%s) Couldn't create QCDM port", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port))); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port))); return G_SOURCE_REMOVE; } + /* Setup port if needed */ + common_serial_port_setup (self, ctx->serial); + /* Try to open the port */ if (!mm_port_serial_open (ctx->serial, &error)) { port_probe_task_return_error (self, g_error_new (MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, "(%s/%s) Failed to open QCDM port: %s", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), (error ? error->message : "unknown error"))); g_clear_error (&error); return G_SOURCE_REMOVE; @@ -739,9 +811,9 @@ port_probe_task_return_error (self, g_error_new (MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, - "(%s/%s) Failed to create QCDM versin info command", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port))); + "(%s/%s) Failed to create QCDM version info command", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port))); return G_SOURCE_REMOVE; } verinfo->len = len + 1; @@ -816,6 +888,22 @@ } static void +serial_probe_at_xmm_result_processor (MMPortProbe *self, + GVariant *result) +{ + if (result) { + /* If any result given, it must be a string */ + g_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_STRING)); + if (strstr (g_variant_get_string (result, NULL), "XACT:")) { + mm_port_probe_set_result_at_xmm (self, TRUE); + return; + } + } + + mm_port_probe_set_result_at_xmm (self, FALSE); +} + +static void serial_probe_at_icera_result_processor (MMPortProbe *self, GVariant *result) { @@ -899,8 +987,8 @@ /* If AT probing cancelled, end this partial probing */ if (g_cancellable_is_cancelled (ctx->at_probing_cancellable)) { mm_dbg ("(%s/%s) no need to keep on probing the port for AT support", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); ctx->at_result_processor (self, NULL); serial_probe_schedule (self); return; @@ -920,8 +1008,8 @@ g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, "(%s/%s) error while probing AT features: %s", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), result_error->message)); goto out; } @@ -942,8 +1030,8 @@ ctx->source_id = g_idle_add ((GSourceFunc) serial_probe_at, self); else { mm_dbg ("(%s/%s) re-scheduling next command in probing group in %u seconds...", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), ctx->at_commands_wait_secs); ctx->source_id = g_timeout_add_seconds (ctx->at_commands_wait_secs, (GSourceFunc) serial_probe_at, self); } @@ -979,8 +1067,8 @@ /* If AT probing cancelled, end this partial probing */ if (g_cancellable_is_cancelled (ctx->at_probing_cancellable)) { mm_dbg ("(%s/%s) no need to launch probing for AT support", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); ctx->at_result_processor (self, NULL); serial_probe_schedule (self); return G_SOURCE_REMOVE; @@ -1026,6 +1114,11 @@ { NULL } }; +static const MMPortProbeAtCommand xmm_probing[] = { + { "+XACT=?", 3, mm_port_probe_response_processor_string }, + { NULL } +}; + static void at_custom_init_ready (MMPortProbe *self, GAsyncResult *res) @@ -1062,10 +1155,13 @@ return; /* If we got some custom initialization setup requested, go on with it - * first. */ + * first. We completely ignore the custom initialization if the serial port + * that we receive in the context isn't an AT port (e.g. if it was flagged + * as not being an AT port early) */ if (!ctx->at_custom_init_run && ctx->at_custom_init && - ctx->at_custom_init_finish) { + ctx->at_custom_init_finish && + MM_IS_PORT_SERIAL_AT (ctx->serial)) { ctx->at_custom_init (self, MM_PORT_SERIAL_AT (ctx->serial), ctx->at_probing_cancellable, @@ -1112,6 +1208,13 @@ /* By default, wait 2 seconds between ICERA probing retries */ ctx->at_commands_wait_secs = 2; } + /* XMM support check requested and not already done? */ + else if ((ctx->flags & MM_PORT_PROBE_AT_XMM) && + !(self->priv->flags & MM_PORT_PROBE_AT_XMM)) { + /* Prepare AT product probing */ + ctx->at_result_processor = serial_probe_at_xmm_result_processor; + ctx->at_commands = xmm_probing; + } /* If a next AT group detected, go for it */ if (ctx->at_result_processor && @@ -1156,8 +1259,8 @@ ctx = g_task_get_task_data (self->priv->task); mm_dbg ("(%s/%s) serial buffer full", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); /* Don't explicitly close the AT port, just end the AT probing * (or custom init probing) */ mm_port_probe_set_result_at (self, FALSE); @@ -1200,27 +1303,29 @@ gpointer parser; MMPortSubsys subsys = MM_PORT_SUBSYS_TTY; - if (g_str_has_prefix (g_udev_device_get_subsystem (self->priv->port), "usb")) + if (g_str_has_prefix (mm_kernel_device_get_subsystem (self->priv->port), "usb")) subsys = MM_PORT_SUBSYS_USB; - ctx->serial = MM_PORT_SERIAL (mm_port_serial_at_new (g_udev_device_get_name (self->priv->port), subsys)); + ctx->serial = MM_PORT_SERIAL (mm_port_serial_at_new (mm_kernel_device_get_name (self->priv->port), subsys)); if (!ctx->serial) { port_probe_task_return_error (self, g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "(%s/%s) couldn't create AT port", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port))); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port))); return G_SOURCE_REMOVE; } g_object_set (ctx->serial, MM_PORT_SERIAL_SPEW_CONTROL, TRUE, - MM_PORT_SERIAL_SEND_DELAY, (subsys == MM_PORT_SUBSYS_TTY ? ctx->at_send_delay : 0), + MM_PORT_SERIAL_SEND_DELAY, (guint64)(subsys == MM_PORT_SUBSYS_TTY ? ctx->at_send_delay : 0), MM_PORT_SERIAL_AT_REMOVE_ECHO, ctx->at_remove_echo, MM_PORT_SERIAL_AT_SEND_LF, ctx->at_send_lf, NULL); + common_serial_port_setup (self, ctx->serial); + parser = mm_serial_parser_v1_new (); mm_serial_parser_v1_add_filter (parser, serial_parser_filter_cb, @@ -1240,8 +1345,8 @@ g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "(%s/%s) failed to open port after 4 tries", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port))); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port))); g_clear_error (&error); return G_SOURCE_REMOVE; } @@ -1257,8 +1362,8 @@ g_error_new (MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, "(%s/%s) failed to open port: %s", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), (error ? error->message : "unknown error"))); g_clear_error (&error); return G_SOURCE_REMOVE; @@ -1276,10 +1381,12 @@ } static void -at_cancellable_cancel (GCancellable *main_cancellable, - GCancellable *at_cancellable) +at_cancellable_cancel (GCancellable *cancellable, + PortProbeRunContext *ctx) { - g_cancellable_cancel (at_cancellable); + /* Avoid trying to disconnect cancellable on the handler, or we'll deadlock */ + ctx->at_probing_cancellable_linked = 0; + g_cancellable_cancel (ctx->at_probing_cancellable); } gboolean @@ -1297,8 +1404,8 @@ return FALSE; mm_dbg ("(%s/%s) requested to cancel all AT probing", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); g_cancellable_cancel (ctx->at_probing_cancellable); return TRUE; } @@ -1355,12 +1462,37 @@ /* If we're told to completely ignore the port, don't do any probing */ if (self->priv->is_ignored) { mm_dbg ("(%s/%s) port probing finished: skipping for blacklisted port", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); port_probe_task_return_boolean (self, TRUE); return; } + /* If this is a port flagged as a GPS port, don't do any AT or QCDM probing */ + if (self->priv->is_gps) { + mm_dbg ("(%s/%s) GPS port detected", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + mm_port_probe_set_result_at (self, FALSE); + mm_port_probe_set_result_qcdm (self, FALSE); + } + + /* If this is a port flagged as being an AT port, don't do any QCDM probing */ + if (self->priv->maybe_at_primary || self->priv->maybe_at_secondary || self->priv->maybe_at_ppp) { + mm_dbg ("(%s/%s) no QCDM probing in possible AT port", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + mm_port_probe_set_result_qcdm (self, FALSE); + } + + /* If this is a port flagged as being a QCDM port, don't do any AT probing */ + if (self->priv->maybe_qcdm) { + mm_dbg ("(%s/%s) no AT probing in possible QCDM port", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + mm_port_probe_set_result_at (self, FALSE); + } + /* Check if we already have the requested probing results. * We will fix here the 'ctx->flags' so that we only request probing * for the missing things. */ @@ -1372,8 +1504,8 @@ /* All requested probings already available? If so, we're done */ if (!ctx->flags) { mm_dbg ("(%s/%s) port probing finished: no more probings needed", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port)); + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); port_probe_task_return_boolean (self, TRUE); return; } @@ -1381,8 +1513,8 @@ /* Log the probes scheduled to be run */ probe_list_str = mm_port_probe_flag_build_string_from_mask (ctx->flags); mm_dbg ("(%s/%s) launching port probing: '%s'", - g_udev_device_get_subsystem (self->priv->port), - g_udev_device_get_name (self->priv->port), + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port), probe_list_str); g_free (probe_list_str); @@ -1390,14 +1522,15 @@ if (ctx->flags & MM_PORT_PROBE_AT || ctx->flags & MM_PORT_PROBE_AT_VENDOR || ctx->flags & MM_PORT_PROBE_AT_PRODUCT || - ctx->flags & MM_PORT_PROBE_AT_ICERA) { + ctx->flags & MM_PORT_PROBE_AT_ICERA || + ctx->flags & MM_PORT_PROBE_AT_XMM) { ctx->at_probing_cancellable = g_cancellable_new (); /* If the main cancellable is cancelled, so will be the at-probing one */ if (cancellable) ctx->at_probing_cancellable_linked = g_cancellable_connect (cancellable, (GCallback) at_cancellable_cancel, - g_object_ref (ctx->at_probing_cancellable), - (GDestroyNotify) g_object_unref); + ctx, + NULL); ctx->source_id = g_idle_add ((GSourceFunc) serial_open_at, self); return; } @@ -1422,12 +1555,10 @@ mm_port_probe_is_at (MMPortProbe *self) { const gchar *subsys; - const gchar *name; g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); if (g_str_equal (subsys, "net")) return FALSE; @@ -1461,8 +1592,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (g_str_equal (subsys, "net") || (g_str_has_prefix (subsys, "usb") && g_str_has_prefix (name, "cdc-wdm"))) @@ -1481,8 +1612,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (!g_str_has_prefix (subsys, "usb") || !name || !g_str_has_prefix (name, "cdc-wdm")) @@ -1515,8 +1646,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (!g_str_has_prefix (subsys, "usb") || !name || !g_str_has_prefix (name, "cdc-wdm")) @@ -1549,8 +1680,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (g_str_equal (subsys, "net")) return MM_PORT_TYPE_NET; @@ -1577,6 +1708,9 @@ self->priv->is_at) return MM_PORT_TYPE_AT; + if (self->priv->is_gps) + return MM_PORT_TYPE_GPS; + return MM_PORT_TYPE_UNKNOWN; } @@ -1596,7 +1730,7 @@ return MM_DEVICE (g_object_ref (self->priv->device)); } -GUdevDevice * +MMKernelDevice * mm_port_probe_peek_port (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), NULL); @@ -1604,12 +1738,12 @@ return self->priv->port; }; -GUdevDevice * +MMKernelDevice * mm_port_probe_get_port (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), NULL); - return G_UDEV_DEVICE (g_object_ref (self->priv->port)); + return MM_KERNEL_DEVICE (g_object_ref (self->priv->port)); }; const gchar * @@ -1620,8 +1754,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (g_str_equal (subsys, "net") || (g_str_has_prefix (subsys, "usb") && g_str_has_prefix (name, "cdc-wdm"))) @@ -1640,8 +1774,8 @@ g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - subsys = g_udev_device_get_subsystem (self->priv->port); - name = g_udev_device_get_name (self->priv->port); + subsys = mm_kernel_device_get_subsystem (self->priv->port); + name = mm_kernel_device_get_name (self->priv->port); if (g_str_equal (subsys, "net") || (g_str_has_prefix (subsys, "usb") && g_str_has_prefix (name, "cdc-wdm"))) @@ -1657,7 +1791,7 @@ { g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - if (g_str_equal (g_udev_device_get_subsystem (self->priv->port), "net")) + if (g_str_equal (mm_kernel_device_get_subsystem (self->priv->port), "net")) return FALSE; return (self->priv->flags & MM_PORT_PROBE_AT_ICERA ? @@ -1679,42 +1813,60 @@ } gboolean -mm_port_probe_is_ignored (MMPortProbe *self) +mm_port_probe_is_xmm (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); - return self->priv->is_ignored; + if (g_str_equal (mm_kernel_device_get_subsystem (self->priv->port), "net")) + return FALSE; + + return (self->priv->flags & MM_PORT_PROBE_AT_XMM ? + self->priv->is_xmm : + FALSE); } -const gchar * -mm_port_probe_get_port_name (MMPortProbe *self) +gboolean +mm_port_probe_list_is_xmm (GList *probes) { - g_return_val_if_fail (MM_IS_PORT_PROBE (self), NULL); + GList *l; + + for (l = probes; l; l = g_list_next (l)) { + if (mm_port_probe_is_xmm (MM_PORT_PROBE (l->data))) + return TRUE; + } - return g_udev_device_get_name (self->priv->port); + return FALSE; +} + +gboolean +mm_port_probe_is_ignored (MMPortProbe *self) +{ + g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); + + return self->priv->is_ignored; } const gchar * -mm_port_probe_get_port_subsys (MMPortProbe *self) +mm_port_probe_get_port_name (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), NULL); - return g_udev_device_get_subsystem (self->priv->port); + return mm_kernel_device_get_name (self->priv->port); } const gchar * -mm_port_probe_get_parent_path (MMPortProbe *self) +mm_port_probe_get_port_subsys (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), NULL); - return (self->priv->parent ? g_udev_device_get_sysfs_path (self->priv->parent) : NULL); + return mm_kernel_device_get_subsystem (self->priv->port); } /*****************************************************************************/ MMPortProbe * -mm_port_probe_new (MMDevice *device, - GUdevDevice *port) +mm_port_probe_new (MMDevice *device, + MMKernelDevice *port) { return MM_PORT_PROBE (g_object_new (MM_TYPE_PORT_PROBE, MM_PORT_PROBE_DEVICE, device, @@ -1746,8 +1898,12 @@ case PROP_PORT: /* construct only */ self->priv->port = g_value_dup_object (value); - self->priv->parent = g_udev_device_get_parent (self->priv->port); - self->priv->is_ignored = g_udev_device_get_property_as_boolean (self->priv->port, "ID_MM_PORT_IGNORE"); + self->priv->is_ignored = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_IGNORE); + self->priv->is_gps = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_GPS); + self->priv->maybe_at_primary = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_AT_PRIMARY); + self->priv->maybe_at_secondary = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_AT_SECONDARY); + self->priv->maybe_at_ppp = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_AT_PPP); + self->priv->maybe_qcdm = mm_kernel_device_get_property_as_boolean (self->priv->port, ID_MM_PORT_TYPE_QCDM); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -1798,7 +1954,6 @@ /* We didn't get a reference to the device */ self->priv->device = NULL; - g_clear_object (&self->priv->parent); g_clear_object (&self->priv->port); G_OBJECT_CLASS (mm_port_probe_parent_class)->dispose (object); @@ -1828,8 +1983,8 @@ properties[PROP_PORT] = g_param_spec_object (MM_PORT_PROBE_PORT, "Port", - "UDev device object of the port", - G_UDEV_TYPE_DEVICE, + "kernel device object of the port", + MM_TYPE_KERNEL_DEVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_PORT, properties[PROP_PORT]); } diff -Nru modemmanager-1.6.8/src/mm-port-probe.h modemmanager-1.10.0/src/mm-port-probe.h --- modemmanager-1.6.8/src/mm-port-probe.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-probe.h 2019-01-15 15:57:35.000000000 +0100 @@ -10,7 +10,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * - * Copyright (C) 2011 Aleksander Morgado + * Copyright (C) 2009 - 2018 Red Hat, Inc. + * Copyright (C) 2011 - 2018 Aleksander Morgado */ #ifndef MM_PORT_PROBE_H @@ -21,11 +22,11 @@ #include #include #include -#include #include "mm-private-boxed-types.h" #include "mm-port-probe-at.h" #include "mm-port-serial-at.h" +#include "mm-kernel-device.h" #include "mm-device.h" #define MM_TYPE_PORT_PROBE (mm_port_probe_get_type ()) @@ -42,9 +43,10 @@ MM_PORT_PROBE_AT_VENDOR = 1 << 1, MM_PORT_PROBE_AT_PRODUCT = 1 << 2, MM_PORT_PROBE_AT_ICERA = 1 << 3, - MM_PORT_PROBE_QCDM = 1 << 4, - MM_PORT_PROBE_QMI = 1 << 5, - MM_PORT_PROBE_MBIM = 1 << 6 + MM_PORT_PROBE_AT_XMM = 1 << 4, + MM_PORT_PROBE_QCDM = 1 << 5, + MM_PORT_PROBE_QMI = 1 << 6, + MM_PORT_PROBE_MBIM = 1 << 7, } MMPortProbeFlag; typedef struct _MMPortProbe MMPortProbe; @@ -78,16 +80,15 @@ GType mm_port_probe_get_type (void); -MMPortProbe *mm_port_probe_new (MMDevice *device, - GUdevDevice *port); +MMPortProbe *mm_port_probe_new (MMDevice *device, + MMKernelDevice *port); -MMDevice *mm_port_probe_peek_device (MMPortProbe *self); -MMDevice *mm_port_probe_get_device (MMPortProbe *self); -GUdevDevice *mm_port_probe_peek_port (MMPortProbe *self); -GUdevDevice *mm_port_probe_get_port (MMPortProbe *self); -const gchar *mm_port_probe_get_port_name (MMPortProbe *self); -const gchar *mm_port_probe_get_port_subsys (MMPortProbe *self); -const gchar *mm_port_probe_get_parent_path (MMPortProbe *self); +MMDevice *mm_port_probe_peek_device (MMPortProbe *self); +MMDevice *mm_port_probe_get_device (MMPortProbe *self); +MMKernelDevice *mm_port_probe_peek_port (MMPortProbe *self); +MMKernelDevice *mm_port_probe_get_port (MMPortProbe *self); +const gchar *mm_port_probe_get_port_name (MMPortProbe *self); +const gchar *mm_port_probe_get_port_subsys (MMPortProbe *self); /* Probing result setters */ void mm_port_probe_set_result_at (MMPortProbe *self, @@ -98,6 +99,8 @@ const gchar *at_product); void mm_port_probe_set_result_at_icera (MMPortProbe *self, gboolean is_icera); +void mm_port_probe_set_result_at_xmm (MMPortProbe *self, + gboolean is_xmm); void mm_port_probe_set_result_qcdm (MMPortProbe *self, gboolean qcdm); void mm_port_probe_set_result_qmi (MMPortProbe *self, @@ -131,6 +134,7 @@ const gchar *mm_port_probe_get_vendor (MMPortProbe *self); const gchar *mm_port_probe_get_product (MMPortProbe *self); gboolean mm_port_probe_is_icera (MMPortProbe *self); +gboolean mm_port_probe_is_xmm (MMPortProbe *self); gboolean mm_port_probe_is_ignored (MMPortProbe *self); /* Additional helpers */ @@ -138,5 +142,6 @@ gboolean mm_port_probe_list_has_qmi_port (GList *list); gboolean mm_port_probe_list_has_mbim_port (GList *list); gboolean mm_port_probe_list_is_icera (GList *list); +gboolean mm_port_probe_list_is_xmm (GList *list); #endif /* MM_PORT_PROBE_H */ diff -Nru modemmanager-1.6.8/src/mm-port-qmi.c modemmanager-1.10.0/src/mm-port-qmi.c --- modemmanager-1.6.8/src/mm-port-qmi.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-qmi.c 2018-11-15 09:55:53.000000000 +0100 @@ -72,22 +72,27 @@ /*****************************************************************************/ +QmiDevice * +mm_port_qmi_peek_device (MMPortQmi *self) +{ + g_return_val_if_fail (MM_IS_PORT_QMI (self), NULL); + + return self->priv->qmi_device; +} + +/*****************************************************************************/ + typedef struct { - MMPortQmi *self; - GSimpleAsyncResult *result; ServiceInfo *info; } AllocateClientContext; static void -allocate_client_context_complete_and_free (AllocateClientContext *ctx) +allocate_client_context_free (AllocateClientContext *ctx) { - g_simple_async_result_complete (ctx->result); if (ctx->info) { g_assert (ctx->info->client == NULL); g_free (ctx->info); } - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_free (ctx); } @@ -96,30 +101,34 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void allocate_client_ready (QmiDevice *qmi_device, GAsyncResult *res, - AllocateClientContext *ctx) + GTask *task) { + MMPortQmi *self; + AllocateClientContext *ctx; GError *error = NULL; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); ctx->info->client = qmi_device_allocate_client_finish (qmi_device, res, &error); if (!ctx->info->client) { g_prefix_error (&error, "Couldn't create client for service '%s': ", qmi_service_get_string (ctx->info->service)); - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); } else { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); /* Move the service info to our internal list */ - ctx->self->priv->services = g_list_prepend (ctx->self->priv->services, ctx->info); + self->priv->services = g_list_prepend (self->priv->services, ctx->info); ctx->info = NULL; + g_task_return_boolean (task, TRUE); } - allocate_client_context_complete_and_free (ctx); + g_object_unref (task); } void @@ -131,27 +140,30 @@ gpointer user_data) { AllocateClientContext *ctx; + GTask *task; + + task = g_task_new (self, cancellable, callback, user_data); + + if (!mm_port_qmi_is_open (self)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, + "Port is closed"); + g_object_unref (task); + return; + } if (!!mm_port_qmi_peek_client (self, service, flag)) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_EXISTS, - "Client for service '%s' already allocated", - qmi_service_get_string (service)); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_EXISTS, + "Client for service '%s' already allocated", + qmi_service_get_string (service)); + g_object_unref (task); return; } ctx = g_new0 (AllocateClientContext, 1); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_port_qmi_allocate_client); ctx->info = g_new0 (ServiceInfo, 1); ctx->info->service = service; ctx->info->flag = flag; + g_task_set_task_data (task, ctx, (GDestroyNotify)allocate_client_context_free); qmi_device_allocate_client (self->priv->qmi_device, service, @@ -159,7 +171,7 @@ 10, cancellable, (GAsyncReadyCallback)allocate_client_ready, - ctx); + task); } /*****************************************************************************/ @@ -188,9 +200,6 @@ } PortOpenStep; typedef struct { - MMPortQmi *self; - GSimpleAsyncResult *result; - GCancellable *cancellable; QmiDevice *device; QmiClient *wda; GError *error; @@ -201,9 +210,8 @@ } PortOpenContext; static void -port_open_context_complete_and_free (PortOpenContext *ctx) +port_open_context_free (PortOpenContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); if (ctx->wda) { g_assert (ctx->device); qmi_device_release_client (ctx->device, @@ -214,10 +222,6 @@ } if (ctx->device) g_object_unref (ctx->device); - if (ctx->cancellable) - g_object_unref (ctx->cancellable); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (PortOpenContext, ctx); } @@ -226,30 +230,36 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void port_open_context_step (PortOpenContext *ctx); +static void port_open_step (GTask *task); static void qmi_device_open_second_ready (QmiDevice *qmi_device, GAsyncResult *res, - PortOpenContext *ctx) + GTask *task) { + PortOpenContext *ctx; + + ctx = g_task_get_task_data (task); + qmi_device_open_finish (qmi_device, res, &ctx->error); /* In both error and success, we go to last step */ ctx->step = PORT_OPEN_STEP_LAST; - port_open_context_step (ctx); + port_open_step (task); } static void get_data_format_ready (QmiClientWda *client, GAsyncResult *res, - PortOpenContext *ctx) + GTask *task) { + PortOpenContext *ctx; QmiMessageWdaGetDataFormatOutput *output; + ctx = g_task_get_task_data (task); output = qmi_client_wda_get_data_format_finish (client, res, NULL); if (!output || !qmi_message_wda_get_data_format_output_get_result (output, NULL) || @@ -263,33 +273,39 @@ if (output) qmi_message_wda_get_data_format_output_unref (output); - port_open_context_step (ctx); + port_open_step (task); } static void allocate_client_wda_ready (QmiDevice *device, GAsyncResult *res, - PortOpenContext *ctx) + GTask *task) { + PortOpenContext *ctx; + + ctx = g_task_get_task_data (task); ctx->wda = qmi_device_allocate_client_finish (device, res, NULL); if (!ctx->wda) { /* If no WDA supported, then we just fallback to reopening explicitly * requesting 802.3 in the CTL service. */ ctx->step = PORT_OPEN_STEP_OPEN_WITH_DATA_FORMAT; - port_open_context_step (ctx); + port_open_step (task); return; } /* Go on to next step */ ctx->step++; - port_open_context_step (ctx); + port_open_step (task); } static void qmi_device_open_first_ready (QmiDevice *qmi_device, GAsyncResult *res, - PortOpenContext *ctx) + GTask *task) { + PortOpenContext *ctx; + + ctx = g_task_get_task_data (task); if (!qmi_device_open_finish (qmi_device, res, &ctx->error)) /* Error opening the device */ ctx->step = PORT_OPEN_STEP_LAST; @@ -299,14 +315,17 @@ else /* Go on to next step */ ctx->step++; - port_open_context_step (ctx); + port_open_step (task); } static void qmi_device_new_ready (GObject *unused, GAsyncResult *res, - PortOpenContext *ctx) + GTask *task) { + PortOpenContext *ctx; + + ctx = g_task_get_task_data (task); /* Store the device in the context until the operation is fully done, * so that we return IN_PROGRESS errors until we finish this async * operation. */ @@ -317,12 +336,17 @@ else /* Go on to next step */ ctx->step++; - port_open_context_step (ctx); + port_open_step (task); } static void -port_open_context_step (PortOpenContext *ctx) +port_open_step (GTask *task) { + MMPortQmi *self; + PortOpenContext *ctx; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); switch (ctx->step) { case PORT_OPEN_STEP_FIRST: mm_dbg ("Opening QMI device..."); @@ -331,12 +355,12 @@ case PORT_OPEN_STEP_CHECK_OPENING: mm_dbg ("Checking if QMI device already opening..."); - if (ctx->self->priv->opening) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "QMI device already being opened"); - port_open_context_complete_and_free (ctx); + if (self->priv->opening) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "QMI device already being opened"); + g_object_unref (task); return; } ctx->step++; @@ -344,9 +368,9 @@ case PORT_OPEN_STEP_CHECK_ALREADY_OPEN: mm_dbg ("Checking if QMI device already open..."); - if (ctx->self->priv->qmi_device) { - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - port_open_context_complete_and_free (ctx); + if (self->priv->qmi_device) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } ctx->step++; @@ -356,19 +380,19 @@ GFile *file; gchar *fullpath; - fullpath = g_strdup_printf ("/dev/%s", mm_port_get_device (MM_PORT (ctx->self))); + fullpath = g_strdup_printf ("/dev/%s", mm_port_get_device (MM_PORT (self))); file = g_file_new_for_path (fullpath); /* We flag in this point that we're opening. From now on, if we stop * for whatever reason, we should clear this flag. We do this by ensuring * that all callbacks go through the LAST step for completing. */ - ctx->self->priv->opening = TRUE; + self->priv->opening = TRUE; mm_dbg ("Creating QMI device..."); qmi_device_new (file, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) qmi_device_new_ready, - ctx); + task); g_free (fullpath); g_object_unref (file); @@ -382,9 +406,9 @@ (QMI_DEVICE_OPEN_FLAGS_VERSION_INFO | QMI_DEVICE_OPEN_FLAGS_PROXY), 10, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) qmi_device_open_first_ready, - ctx); + task); return; case PORT_OPEN_STEP_GET_KERNEL_DATA_FORMAT: @@ -394,7 +418,7 @@ /* If data format cannot be retrieved, we fallback to 802.3 via CTL */ if (ctx->kernel_data_format == QMI_DEVICE_EXPECTED_DATA_FORMAT_UNKNOWN) { ctx->step = PORT_OPEN_STEP_OPEN_WITH_DATA_FORMAT; - port_open_context_step (ctx); + port_open_step (task); return; } ctx->step++; @@ -407,9 +431,9 @@ QMI_SERVICE_WDA, QMI_CID_NONE, 10, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) allocate_client_wda_ready, - ctx); + task); return; case PORT_OPEN_STEP_GET_WDA_DATA_FORMAT: @@ -419,9 +443,9 @@ qmi_client_wda_get_data_format (QMI_CLIENT_WDA (ctx->wda), NULL, 10, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) get_data_format_ready, - ctx); + task); return; case PORT_OPEN_STEP_CHECK_DATA_FORMAT: @@ -433,17 +457,17 @@ if (ctx->kernel_data_format == QMI_DEVICE_EXPECTED_DATA_FORMAT_802_3 && ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_802_3) { - ctx->self->priv->llp_is_raw_ip = FALSE; + self->priv->llp_is_raw_ip = FALSE; ctx->step = PORT_OPEN_STEP_LAST; - port_open_context_step (ctx); + port_open_step (task); return; } if (ctx->kernel_data_format == QMI_DEVICE_EXPECTED_DATA_FORMAT_RAW_IP && ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP) { - ctx->self->priv->llp_is_raw_ip = TRUE; + self->priv->llp_is_raw_ip = TRUE; ctx->step = PORT_OPEN_STEP_LAST; - port_open_context_step (ctx); + port_open_step (task); return; } @@ -455,10 +479,10 @@ mm_dbg ("Updating kernel data format: %s", qmi_wda_link_layer_protocol_get_string (ctx->llp)); if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_802_3) { ctx->kernel_data_format = QMI_DEVICE_EXPECTED_DATA_FORMAT_802_3; - ctx->self->priv->llp_is_raw_ip = FALSE; + self->priv->llp_is_raw_ip = FALSE; } else if (ctx->llp == QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP) { ctx->kernel_data_format = QMI_DEVICE_EXPECTED_DATA_FORMAT_RAW_IP; - ctx->self->priv->llp_is_raw_ip = TRUE; + self->priv->llp_is_raw_ip = TRUE; } else g_assert_not_reached (); @@ -467,7 +491,7 @@ ctx->kernel_data_format, &ctx->error); ctx->step = PORT_OPEN_STEP_LAST; - port_open_context_step (ctx); + port_open_step (task); return; case PORT_OPEN_STEP_OPEN_WITH_DATA_FORMAT: @@ -476,7 +500,7 @@ if (!qmi_device_close (ctx->device, &ctx->error)) { mm_warn ("Couldn't close QMI device to reopen it"); ctx->step = PORT_OPEN_STEP_LAST; - port_open_context_step (ctx); + port_open_step (task); return; } @@ -487,31 +511,31 @@ QMI_DEVICE_OPEN_FLAGS_NET_802_3 | QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER), 10, - ctx->cancellable, + g_task_get_cancellable (task), (GAsyncReadyCallback) qmi_device_open_second_ready, - ctx); + task); return; case PORT_OPEN_STEP_LAST: mm_dbg ("QMI port open operation finished"); /* Reset opening flag */ - ctx->self->priv->opening = FALSE; + self->priv->opening = FALSE; if (ctx->error) { /* Propagate error */ if (ctx->device) qmi_device_close (ctx->device, NULL); - g_simple_async_result_take_error (ctx->result, ctx->error); + g_task_return_error (task, ctx->error); ctx->error = NULL; } else { /* Store device in private info */ g_assert (ctx->device); - g_assert (!ctx->self->priv->qmi_device); - ctx->self->priv->qmi_device = g_object_ref (ctx->device); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_assert (!self->priv->qmi_device); + self->priv->qmi_device = g_object_ref (ctx->device); + g_task_return_boolean (task, TRUE); } - port_open_context_complete_and_free (ctx); + g_object_unref (task); return; } } @@ -524,22 +548,20 @@ gpointer user_data) { PortOpenContext *ctx; + GTask *task; g_return_if_fail (MM_IS_PORT_QMI (self)); ctx = g_slice_new0 (PortOpenContext); - ctx->self = g_object_ref (self); ctx->step = PORT_OPEN_STEP_FIRST; ctx->set_data_format = set_data_format; ctx->kernel_data_format = QMI_DEVICE_EXPECTED_DATA_FORMAT_UNKNOWN; ctx->llp = QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN; - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_port_qmi_open); - ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; - port_open_context_step (ctx); + task = g_task_new (self, cancellable, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)port_open_context_free); + + port_open_step (task); } gboolean @@ -572,7 +594,7 @@ 3, NULL, NULL, NULL); g_clear_object (&info->client); } - g_list_free_full (self->priv->services, (GDestroyNotify)g_free); + g_list_free_full (self->priv->services, g_free); self->priv->services = NULL; /* Close and release the device */ @@ -616,7 +638,7 @@ if (info->client) g_object_unref (info->client); } - g_list_free_full (self->priv->services, (GDestroyNotify)g_free); + g_list_free_full (self->priv->services, g_free); self->priv->services = NULL; /* Clear device object */ diff -Nru modemmanager-1.6.8/src/mm-port-qmi.h modemmanager-1.10.0/src/mm-port-qmi.h --- modemmanager-1.6.8/src/mm-port-qmi.h 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-qmi.h 2018-11-15 09:55:53.000000000 +0100 @@ -82,6 +82,8 @@ QmiService service, MMPortQmiFlag flag); +QmiDevice *mm_port_qmi_peek_device (MMPortQmi *self); + gboolean mm_port_qmi_llp_is_raw_ip (MMPortQmi *self); #endif /* MM_PORT_QMI_H */ diff -Nru modemmanager-1.6.8/src/mm-port-serial-at.c modemmanager-1.10.0/src/mm-port-serial-at.c --- modemmanager-1.6.8/src/mm-port-serial-at.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-serial-at.c 2018-11-15 09:55:53.000000000 +0100 @@ -157,6 +157,7 @@ /* If we got an error, propagate it without any further response string */ if (inner_error) { + g_string_free (string, TRUE); g_propagate_error (error, inner_error); return MM_PORT_SERIAL_RESPONSE_ERROR; } @@ -207,9 +208,12 @@ if (handler->notify) handler->notify (handler->user_data); } else { + /* The new handler is always PREPENDED, so that e.g. plugins can provide + * more specific matches for URCs that are also handled by the generic + * plugin. */ handler = g_slice_new (MMAtUnsolicitedMsgHandler); - self->priv->unsolicited_msg_handlers = g_slist_append (self->priv->unsolicited_msg_handlers, handler); handler->regex = g_regex_ref (regex); + self->priv->unsolicited_msg_handlers = g_slist_prepend (self->priv->unsolicited_msg_handlers, handler); } handler->callback = callback; diff -Nru modemmanager-1.6.8/src/mm-port-serial.c modemmanager-1.10.0/src/mm-port-serial.c --- modemmanager-1.6.8/src/mm-port-serial.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-serial.c 2019-01-15 15:57:35.000000000 +0100 @@ -35,6 +35,7 @@ #include "mm-port-serial.h" #include "mm-log.h" +#include "mm-helper-enums-types.h" static gboolean port_serial_queue_process (gpointer data); static void port_serial_schedule_queue_process (MMPortSerial *self, @@ -53,10 +54,10 @@ PROP_BITS, PROP_PARITY, PROP_STOPBITS, + PROP_FLOW_CONTROL, PROP_SEND_DELAY, PROP_FD, PROP_SPEW_CONTROL, - PROP_RTS_CTS, PROP_FLASH_OK, LAST_PROP @@ -95,9 +96,9 @@ guint bits; char parity; guint stopbits; + MMFlowControl flow_control; guint64 send_delay; gboolean spew_control; - gboolean rts_cts; gboolean flash_ok; guint queue_id; @@ -110,8 +111,8 @@ guint connected_id; - gpointer flash_ctx; - gpointer reopen_ctx; + GTask *flash_task; + GTask *reopen_task; }; /*****************************************************************************/ @@ -210,95 +211,13 @@ /*****************************************************************************/ -#if 0 -static const char * -baud_to_string (int baud) -{ - const char *speed = NULL; - - switch (baud) { - case B0: - speed = "0"; - break; - case B50: - speed = "50"; - break; - case B75: - speed = "75"; - break; - case B110: - speed = "110"; - break; - case B150: - speed = "150"; - break; - case B300: - speed = "300"; - break; - case B600: - speed = "600"; - break; - case B1200: - speed = "1200"; - break; - case B2400: - speed = "2400"; - break; - case B4800: - speed = "4800"; - break; - case B9600: - speed = "9600"; - break; - case B19200: - speed = "19200"; - break; - case B38400: - speed = "38400"; - break; - case B57600: - speed = "57600"; - break; - case B115200: - speed = "115200"; - break; - case B460800: - speed = "460800"; - break; - default: - break; - } - - return speed; -} - -void -mm_port_serial_print_config (MMPortSerial *port, - const char *detail) -{ - struct termios stbuf; - int err; - - err = tcgetattr (self->priv->fd, &stbuf); - if (err) { - mm_warn ("*** %s (%s): (%s) tcgetattr() error %d", - __func__, detail, mm_port_get_device (MM_PORT (port)), errno); - return; - } - - mm_info ("(%s): (%s) baud rate: %d (%s)", - detail, mm_port_get_device (MM_PORT (port)), - stbuf.c_cflag & CBAUD, - baud_to_string (stbuf.c_cflag & CBAUD)); -} -#endif - -static int -parse_baudrate (guint i) +static gboolean +parse_baudrate (guint baudrate_num, + guint *out_baudrate_speed) { - int speed; + guint speed; - switch (i) { + switch (baudrate_num) { case 0: speed = B0; break; @@ -344,15 +263,22 @@ case 115200: speed = B115200; break; + case 230400: + speed = B230400; + break; case 460800: speed = B460800; break; + case 921600: + speed = B921600; + break; default: - mm_warn ("Invalid baudrate '%d'", i); - speed = B9600; + return FALSE; } - return speed; + if (out_baudrate_speed) + *out_baudrate_speed = speed; + return TRUE; } static int @@ -428,19 +354,123 @@ } static gboolean +internal_tcsetattr (MMPortSerial *self, + gint fd, + const struct termios *options, + GError **error) +{ + guint count; + struct termios other; + +#define MAX_TCSETATTR_RETRIES 4 + + for (count = 0; count < MAX_TCSETATTR_RETRIES; count++) { + /* try to set the new port attributes */ + errno = 0; + if (tcsetattr (fd, TCSANOW, options) == 0) + break; + + /* hard error if not EAGAIN */ + if (errno != EAGAIN) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "couldn't set serial port attributes: %s", g_strerror (errno)); + return FALSE; + } + + /* try a few times if EAGAIN */ + g_usleep (100000); + } + + /* too many retries? */ + if (count == MAX_TCSETATTR_RETRIES) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "couldn't set serial port attributes: too many retries (%u)", count); + return FALSE; + } + + /* tcsetattr() returns 0 if any of the requested attributes could be set, + * so we should double-check that all were set and log if not. Just with + * debug level, as we're ignoring this issue all together anyway. + */ + memset (&other, 0, sizeof (struct termios)); + errno = 0; + if (tcgetattr (fd, &other) != 0) + mm_dbg ("(%s): couldn't get serial port attributes after setting them: %s", + mm_port_get_device (MM_PORT (self)), g_strerror (errno)); + else if (memcmp (options, &other, sizeof (struct termios)) != 0) + mm_dbg ("(%s): port attributes not fully set", + mm_port_get_device (MM_PORT (self))); + +#undef MAX_TCSETATTR_RETRIES + + return TRUE; +} + +static gboolean +set_flow_control_termios (MMPortSerial *self, + MMFlowControl flow_control, + struct termios *options) +{ + gboolean had_xon_xoff; + gboolean had_rts_cts; + tcflag_t iflag_orig, cflag_orig; + + iflag_orig = options->c_iflag; + cflag_orig = options->c_cflag; + + had_xon_xoff = !!(options->c_iflag & (IXON | IXOFF)); + options->c_iflag &= ~(IXON | IXOFF | IXANY); + + had_rts_cts = !!(options->c_cflag & (CRTSCTS)); + options->c_cflag &= ~(CRTSCTS); + + /* setup the requested flags */ + switch (flow_control) { + case MM_FLOW_CONTROL_XON_XOFF: + mm_dbg ("(%s): enabling XON/XOFF flow control", mm_port_get_device (MM_PORT (self))); + options->c_iflag |= (IXON | IXOFF | IXANY); + break; + case MM_FLOW_CONTROL_RTS_CTS: + mm_dbg ("(%s): enabling RTS/CTS flow control", mm_port_get_device (MM_PORT (self))); + options->c_cflag |= (CRTSCTS); + break; + case MM_FLOW_CONTROL_NONE: + case MM_FLOW_CONTROL_UNKNOWN: + if (had_xon_xoff) + mm_dbg ("(%s): disabling XON/XOFF flow control", mm_port_get_device (MM_PORT (self))); + if (had_rts_cts) + mm_dbg ("(%s): disabling RTS/CTS flow control", mm_port_get_device (MM_PORT (self))); + break; + default: + g_assert_not_reached (); + } + + return iflag_orig != options->c_iflag || cflag_orig != options->c_cflag; +} + +static gboolean real_config_fd (MMPortSerial *self, int fd, GError **error) { - struct termios stbuf, other; - int speed; - int bits; - int parity; - int stopbits; + struct termios stbuf; + guint speed; + gint bits; + gint parity; + gint stopbits; /* No setup if not a tty */ if (mm_port_get_subsys (MM_PORT (self)) != MM_PORT_SUBSYS_TTY) return TRUE; - speed = parse_baudrate (self->priv->baud); + mm_dbg ("(%s): setting up baudrate: %u", + mm_port_get_device (MM_PORT (self)), + self->priv->baud); + if (!parse_baudrate (self->priv->baud, &speed) || speed == B0) { + mm_warn ("(%s): baudrate invalid: %u; defaulting to 57600", + mm_port_get_device (MM_PORT (self)), + self->priv->baud); + speed = B57600; + } + bits = parse_bits (self->priv->bits); parity = parse_parity (self->priv->parity); stopbits = parse_stopbits (self->priv->stopbits); @@ -452,21 +482,19 @@ errno); } - stbuf.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY ); + stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | PARENB | PARODD | CRTSCTS); + stbuf.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXOFF | IXANY ); stbuf.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET); stbuf.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHONL); stbuf.c_cc[VMIN] = 1; stbuf.c_cc[VTIME] = 0; stbuf.c_cc[VEOF] = 1; - /* Use software handshaking and ignore parity/framing errors */ - stbuf.c_iflag |= (IXON | IXOFF | IXANY | IGNPAR); + /* Ignore parity/framing errors */ + stbuf.c_iflag |= IGNPAR; - /* Set up port speed and serial attributes; also ignore modem control - * lines since most drivers don't implement RTS/CTS anyway. - */ - stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | PARENB | CRTSCTS); - stbuf.c_cflag |= (bits | CREAD | 0 | parity | stopbits | CLOCAL); + /* Set up port speed and serial attributes and enable receiver in local mode */ + stbuf.c_cflag |= (bits | parity | stopbits | CLOCAL | CREAD); errno = 0; if (cfsetispeed (&stbuf, speed) != 0) { @@ -488,32 +516,21 @@ return FALSE; } - if (tcsetattr (fd, TCSANOW, &stbuf) < 0) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s: failed to set serial port attributes; errno %d", - __func__, errno); - return FALSE; - } + if (self->priv->flow_control != MM_FLOW_CONTROL_UNKNOWN) { + gchar *str; - /* tcsetattr() returns 0 if any of the requested attributes could be set, - * so we should double-check that all were set and log a warning if not. - */ - memset (&other, 0, sizeof (struct termios)); - errno = 0; - if (tcgetattr (fd, &other) != 0) { - mm_warn ("(%s): tcgetattr() error: %d", - mm_port_get_device (MM_PORT (self)), - errno); - } + str = mm_flow_control_build_string_from_mask (self->priv->flow_control); + mm_dbg ("(%s): flow control explicitly requested for device is: %s", + mm_port_get_device (MM_PORT (self)), + str ? str : "unknown"); + g_free (str); + } else + mm_dbg ("(%s): no flow control explicitly requested for device", + mm_port_get_device (MM_PORT (self))); - if (memcmp (&stbuf, &other, sizeof (other)) != 0) { - mm_warn ("(%s): port attributes not fully set", - mm_port_get_device (MM_PORT (self))); - } + set_flow_control_termios (self, self->priv->flow_control, &stbuf); - return TRUE; + return internal_tcsetattr (self, fd, &stbuf, error); } static void @@ -634,7 +651,7 @@ /* Just keep on, will retry... */ written = 0; } else - written = bytes_sent; + written = bytes_sent; ctx->idx += written; } else @@ -850,21 +867,25 @@ /* Setup the cancellable so that we can stop waiting for a response */ if (ctx->cancellable) { + gulong cancellable_id; + self->priv->cancellable = g_object_ref (ctx->cancellable); - self->priv->cancellable_id = (g_cancellable_connect ( - ctx->cancellable, - (GCallback)port_serial_response_wait_cancelled, - self, - NULL)); - if (!self->priv->cancellable_id) { - error = g_error_new (MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Won't wait for the reply"); - /* Note: may complete last operation and unref the MMPortSerial */ - port_serial_got_response (self, NULL, error); - g_error_free (error); + + /* If the GCancellable is already cancelled here, the callback will be + * called right away, and a GError will be propagated as response. In + * this case we need to completely avoid doing anything else with the + * MMPortSerial, as it may already be disposed. + * So, use an intermediate variable to store the cancellable id, and + * just return without further processing if we're already cancelled. + */ + cancellable_id = g_cancellable_connect (ctx->cancellable, + (GCallback)port_serial_response_wait_cancelled, + self, + NULL); + if (!cancellable_id) return G_SOURCE_REMOVE; - } + + self->priv->cancellable_id = cancellable_id; } /* If the command is finished being sent, schedule the timeout */ @@ -1145,7 +1166,7 @@ return FALSE; } - if (self->priv->reopen_ctx) { + if (self->priv->reopen_task) { g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, @@ -1154,6 +1175,15 @@ return FALSE; } + if (mm_port_get_connected (MM_PORT (self))) { + g_set_error (error, + MM_SERIAL_ERROR, + MM_SERIAL_ERROR_OPEN_FAILED, + "Could not open serial device %s: port is connected", + device); + return FALSE; + } + if (self->priv->open_count) { /* Already open */ goto success; @@ -1301,7 +1331,6 @@ mm_warn ("(%s) failed to open serial device", device); if (self->priv->iochannel) { - g_io_channel_shutdown (self->priv->iochannel, FALSE, NULL); g_io_channel_unref (self->priv->iochannel); self->priv->iochannel = NULL; } @@ -1389,7 +1418,9 @@ /* Destroy channel */ if (self->priv->iochannel) { data_watch_enable (self, FALSE); - g_io_channel_shutdown (self->priv->iochannel, TRUE, NULL); + /* unref() without g_io_channel_shutdown() to destroy the channel + * without closing the fd. The close() is called explicitly after. + */ g_io_channel_unref (self->priv->iochannel); self->priv->iochannel = NULL; } @@ -1494,20 +1525,15 @@ /* Reopen */ typedef struct { - MMPortSerial *self; - GSimpleAsyncResult *result; guint initial_open_count; guint reopen_id; } ReopenContext; static void -reopen_context_complete_and_free (ReopenContext *ctx) +reopen_context_free (ReopenContext *ctx) { if (ctx->reopen_id) g_source_remove (ctx->reopen_id); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (ReopenContext, ctx); } @@ -1516,54 +1542,56 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void port_serial_reopen_cancel (MMPortSerial *self) { - ReopenContext *ctx; + GTask *task; - if (!self->priv->reopen_ctx) + if (!self->priv->reopen_task) return; - /* Recover context */ - ctx = (ReopenContext *)self->priv->reopen_ctx; - self->priv->reopen_ctx = NULL; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Reopen cancelled"); - reopen_context_complete_and_free (ctx); + /* Recover task */ + task = self->priv->reopen_task; + self->priv->reopen_task = NULL; + + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_CANCELLED, + "Reopen cancelled"); + g_object_unref (task); } static gboolean reopen_do (MMPortSerial *self) { + GTask *task; ReopenContext *ctx; GError *error = NULL; guint i; - /* Recover context */ - g_assert (self->priv->reopen_ctx != NULL); - ctx = (ReopenContext *)self->priv->reopen_ctx; - self->priv->reopen_ctx = NULL; + /* Recover task */ + g_assert (self->priv->reopen_task != NULL); + task = self->priv->reopen_task; + self->priv->reopen_task = NULL; + ctx = g_task_get_task_data (task); ctx->reopen_id = 0; for (i = 0; i < ctx->initial_open_count; i++) { - if (!mm_port_serial_open (ctx->self, &error)) { + if (!mm_port_serial_open (self, &error)) { g_prefix_error (&error, "Couldn't reopen port (%u): ", i); break; } } if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - reopen_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -1575,35 +1603,34 @@ gpointer user_data) { ReopenContext *ctx; + GTask *task; guint i; g_return_if_fail (MM_IS_PORT_SERIAL (self)); /* Setup context */ ctx = g_slice_new0 (ReopenContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_port_serial_reopen); ctx->initial_open_count = self->priv->open_count; + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)reopen_context_free); + if (self->priv->forced_close) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Serial port has been forced close."); - reopen_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Serial port has been forced close."); + g_object_unref (task); return; } /* If already reopening, halt */ - if (self->priv->reopen_ctx) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "Modem is already being reopened"); - reopen_context_complete_and_free (ctx); + if (self->priv->reopen_task) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "Modem is already being reopened"); + g_object_unref (task); return; } @@ -1620,7 +1647,7 @@ ctx->reopen_id = g_idle_add ((GSourceFunc)reopen_do, self); /* Store context in private info */ - self->priv->reopen_ctx = ctx; + self->priv->reopen_task = task; } static gboolean @@ -1648,15 +1675,11 @@ set_speed (MMPortSerial *self, speed_t speed, GError **error) { struct termios options; - int fd, count = 4; - gboolean success = FALSE; g_assert (self->priv->fd >= 0); - fd = self->priv->fd; - memset (&options, 0, sizeof (struct termios)); - if (tcgetattr (fd, &options) != 0) { + if (tcgetattr (self->priv->fd, &options) != 0) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, @@ -1669,60 +1692,22 @@ cfsetospeed (&options, speed); options.c_cflag |= (CLOCAL | CREAD); - /* Configure flow control as well here */ - if (self->priv->rts_cts) - options.c_cflag |= (CRTSCTS); - - while (count-- > 0) { - if (tcsetattr (fd, TCSANOW, &options) == 0) { - success = TRUE; - break; /* Operation successful */ - } - - /* Try a few times if EAGAIN */ - if (errno == EAGAIN) - g_usleep (100000); - else { - /* If not EAGAIN, hard error */ - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s: tcsetattr() error %d", - __func__, errno); - return FALSE; - } - } - - if (!success) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "%s: tcsetattr() retry timeout", - __func__); - return FALSE; - } - - return TRUE; + return internal_tcsetattr (self, self->priv->fd, &options, error); } /*****************************************************************************/ /* Flash */ typedef struct { - GSimpleAsyncResult *result; - MMPortSerial *self; speed_t current_speed; guint flash_id; } FlashContext; static void -flash_context_complete_and_free (FlashContext *ctx) +flash_context_free (FlashContext *ctx) { if (ctx->flash_id) g_source_remove (ctx->flash_id); - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); g_slice_free (FlashContext, ctx); } @@ -1731,44 +1716,46 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } void mm_port_serial_flash_cancel (MMPortSerial *self) { - FlashContext *ctx; + GTask *task; - if (!self->priv->flash_ctx) + if (!self->priv->flash_task) return; - /* Recover context */ - ctx = (FlashContext *)self->priv->flash_ctx; - self->priv->flash_ctx = NULL; - - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_CANCELLED, - "Flash cancelled"); - flash_context_complete_and_free (ctx); + /* Recover task */ + task = self->priv->flash_task; + self->priv->flash_task = NULL; + + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_CANCELLED, + "Flash cancelled"); + g_object_unref (task); } static gboolean flash_do (MMPortSerial *self) { + GTask *task; FlashContext *ctx; GError *error = NULL; - /* Recover context */ - g_assert (self->priv->flash_ctx != NULL); - ctx = (FlashContext *)self->priv->flash_ctx; - self->priv->flash_ctx = NULL; + /* Recover task */ + g_assert (self->priv->flash_task != NULL); + task = self->priv->flash_task; + self->priv->flash_task = NULL; + ctx = g_task_get_task_data (task); ctx->flash_id = 0; if (self->priv->flash_ok && mm_port_get_subsys (MM_PORT (self)) == MM_PORT_SUBSYS_TTY) { if (ctx->current_speed) { - if (!set_speed (ctx->self, ctx->current_speed, &error)) + if (!set_speed (self, ctx->current_speed, &error)) g_assert (error); } else { error = g_error_new_literal (MM_SERIAL_ERROR, @@ -1778,10 +1765,10 @@ } if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - flash_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -1794,6 +1781,7 @@ gpointer user_data) { FlashContext *ctx; + GTask *task; GError *error = NULL; gboolean success; @@ -1801,33 +1789,31 @@ /* Setup context */ ctx = g_slice_new0 (FlashContext); - ctx->self = g_object_ref (self); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_port_serial_flash); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)flash_context_free); if (!mm_port_serial_is_open (self)) { - g_simple_async_result_set_error (ctx->result, - MM_SERIAL_ERROR, - MM_SERIAL_ERROR_NOT_OPEN, - "The serial port is not open."); - flash_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_SERIAL_ERROR, + MM_SERIAL_ERROR_NOT_OPEN, + "The serial port is not open."); + g_object_unref (task); return; } - if (self->priv->flash_ctx) { - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_IN_PROGRESS, - "Modem is already being flashed."); - flash_context_complete_and_free (ctx); + if (self->priv->flash_task) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_IN_PROGRESS, + "Modem is already being flashed."); + g_object_unref (task); return; } /* Flashing only in TTY */ if (!self->priv->flash_ok || mm_port_get_subsys (MM_PORT (self)) != MM_PORT_SUBSYS_TTY) { - self->priv->flash_ctx = ctx; + self->priv->flash_task = task; ctx->flash_id = g_idle_add ((GSourceFunc)flash_do, self); return; } @@ -1835,26 +1821,76 @@ /* Grab current speed so we can reset it after flashing */ success = get_speed (self, &ctx->current_speed, &error); if (!success && !ignore_errors) { - g_simple_async_result_take_error (ctx->result, error); - flash_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } g_clear_error (&error); success = set_speed (self, B0, &error); if (!success && !ignore_errors) { - g_simple_async_result_take_error (ctx->result, error); - flash_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } g_clear_error (&error); - self->priv->flash_ctx = ctx; + self->priv->flash_task = task; ctx->flash_id = g_timeout_add (flash_time, (GSourceFunc)flash_do, self); } /*****************************************************************************/ +gboolean +mm_port_serial_set_flow_control (MMPortSerial *self, + MMFlowControl flow_control, + GError **error) +{ + struct termios options; + gchar *flow_control_str = NULL; + GError *inner_error = NULL; + + /* retrieve current settings */ + memset (&options, 0, sizeof (struct termios)); + if (tcgetattr (self->priv->fd, &options) != 0) { + inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "couldn't get serial port attributes: %s", g_strerror (errno)); + goto out; + } + + flow_control_str = mm_flow_control_build_string_from_mask (flow_control); + + /* Return if current settings are already what we want */ + if (!set_flow_control_termios (self, flow_control, &options)) { + mm_dbg ("(%s): no need to change flow control settings: already %s", + mm_port_get_device (MM_PORT (self)), flow_control_str); + goto out; + } + + if (!internal_tcsetattr (self, self->priv->fd, &options, &inner_error)) + goto out; + + mm_dbg ("(%s): flow control settings updated to %s", + mm_port_get_device (MM_PORT (self)), flow_control_str); + + out: + g_free (flow_control_str); + if (inner_error) { + g_propagate_error (error, inner_error); + return FALSE; + } + + return TRUE; +} + +MMFlowControl +mm_port_serial_get_flow_control (MMPortSerial *self) +{ + return self->priv->flow_control; +} + +/*****************************************************************************/ + MMPortSerial * mm_port_serial_new (const char *name, MMPortType ptype) { @@ -1919,6 +1955,7 @@ self->priv->bits = 8; self->priv->parity = 'n'; self->priv->stopbits = 1; + self->priv->flow_control = MM_FLOW_CONTROL_UNKNOWN; self->priv->send_delay = 1000; self->priv->queue = g_queue_new (); @@ -1949,15 +1986,15 @@ case PROP_STOPBITS: self->priv->stopbits = g_value_get_uint (value); break; + case PROP_FLOW_CONTROL: + self->priv->flow_control = g_value_get_flags (value); + break; case PROP_SEND_DELAY: self->priv->send_delay = g_value_get_uint64 (value); break; case PROP_SPEW_CONTROL: self->priv->spew_control = g_value_get_boolean (value); break; - case PROP_RTS_CTS: - self->priv->rts_cts = g_value_get_boolean (value); - break; case PROP_FLASH_OK: self->priv->flash_ok = g_value_get_boolean (value); break; @@ -1991,15 +2028,15 @@ case PROP_STOPBITS: g_value_set_uint (value, self->priv->stopbits); break; + case PROP_FLOW_CONTROL: + g_value_set_flags (value, self->priv->flow_control); + break; case PROP_SEND_DELAY: g_value_set_uint64 (value, self->priv->send_delay); break; case PROP_SPEW_CONTROL: g_value_set_boolean (value, self->priv->spew_control); break; - case PROP_RTS_CTS: - g_value_set_boolean (value, self->priv->rts_cts); - break; case PROP_FLASH_OK: g_value_set_boolean (value, self->priv->flash_ok); break; @@ -2092,6 +2129,15 @@ G_PARAM_READWRITE)); g_object_class_install_property + (object_class, PROP_FLOW_CONTROL, + g_param_spec_flags (MM_PORT_SERIAL_FLOW_CONTROL, + "FlowControl", + "Select flow control", + MM_TYPE_FLOW_CONTROL, + MM_FLOW_CONTROL_UNKNOWN, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_SEND_DELAY, g_param_spec_uint64 (MM_PORT_SERIAL_SEND_DELAY, "SendDelay", @@ -2107,14 +2153,6 @@ FALSE, G_PARAM_READWRITE)); - g_object_class_install_property - (object_class, PROP_RTS_CTS, - g_param_spec_boolean (MM_PORT_SERIAL_RTS_CTS, - "RTSCTS", - "Enable RTS/CTS flow control", - FALSE, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_FLASH_OK, g_param_spec_boolean (MM_PORT_SERIAL_FLASH_OK, diff -Nru modemmanager-1.6.8/src/mm-port-serial.h modemmanager-1.10.0/src/mm-port-serial.h --- modemmanager-1.6.8/src/mm-port-serial.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-serial.h 2019-01-15 15:57:35.000000000 +0100 @@ -21,6 +21,7 @@ #include #include +#include "mm-modem-helpers.h" #include "mm-port.h" #define MM_TYPE_PORT_SERIAL (mm_port_serial_get_type ()) @@ -34,8 +35,8 @@ #define MM_PORT_SERIAL_BITS "bits" #define MM_PORT_SERIAL_PARITY "parity" #define MM_PORT_SERIAL_STOPBITS "stopbits" +#define MM_PORT_SERIAL_FLOW_CONTROL "flowcontrol" #define MM_PORT_SERIAL_SEND_DELAY "send-delay" -#define MM_PORT_SERIAL_RTS_CTS "rts-cts" #define MM_PORT_SERIAL_FD "fd" /* Construct-only */ #define MM_PORT_SERIAL_SPEW_CONTROL "spew-control" /* Construct-only */ #define MM_PORT_SERIAL_FLASH_OK "flash-ok" /* Construct-only */ @@ -150,4 +151,9 @@ GAsyncResult *res, GError **error); +gboolean mm_port_serial_set_flow_control (MMPortSerial *self, + MMFlowControl flow_control, + GError **error); + +MMFlowControl mm_port_serial_get_flow_control (MMPortSerial *self); #endif /* MM_PORT_SERIAL_H */ diff -Nru modemmanager-1.6.8/src/mm-port-serial-qcdm.c modemmanager-1.10.0/src/mm-port-serial-qcdm.c --- modemmanager-1.6.8/src/mm-port-serial-qcdm.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-serial-qcdm.c 2018-11-15 09:55:53.000000000 +0100 @@ -26,10 +26,15 @@ #include "libqcdm/src/com.h" #include "libqcdm/src/utils.h" #include "libqcdm/src/errors.h" +#include "libqcdm/src/dm-commands.h" #include "mm-log.h" G_DEFINE_TYPE (MMPortSerialQcdm, mm_port_serial_qcdm, MM_TYPE_PORT_SERIAL) +struct _MMPortSerialQcdmPrivate { + GSList *unsolicited_msg_handlers; +}; + /*****************************************************************************/ static gboolean @@ -60,10 +65,10 @@ } static MMPortSerialResponseType -parse_response (MMPortSerial *port, - GByteArray *response, - GByteArray **parsed_response, - GError **error) +parse_qcdm (GByteArray *response, + gboolean want_log, + GByteArray **parsed_response, + GError **error) { gsize start = 0; gsize used = 0; @@ -111,6 +116,14 @@ return MM_PORT_SERIAL_RESPONSE_NONE; } + if (want_log && unescaped_buffer[0] != DIAG_CMD_LOG) { + /* If we only want log items and this isn't one, don't remove this + * DM packet from the buffer. + */ + g_free (unescaped_buffer); + return MM_PORT_SERIAL_RESPONSE_NONE; + } + /* Successfully decapsulated the DM command. We'll build a new byte array * with the response, and leave the input buffer cleaned up. */ g_assert (unescaped_len <= 1024); @@ -124,6 +137,15 @@ return MM_PORT_SERIAL_RESPONSE_BUFFER; } +static MMPortSerialResponseType +parse_response (MMPortSerial *port, + GByteArray *response, + GByteArray **parsed_response, + GError **error) +{ + return parse_qcdm (response, FALSE, parsed_response, error); +} + /*****************************************************************************/ GByteArray * @@ -131,27 +153,24 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - return g_byte_array_ref ((GByteArray *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void serial_command_ready (MMPortSerial *port, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { GByteArray *response; GError *error = NULL; response = mm_port_serial_command_finish (port, res, &error); if (!response) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gpointer (simple, response, (GDestroyNotify)g_byte_array_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_pointer (task, response, (GDestroyNotify)g_byte_array_unref); + + g_object_unref (task); } void @@ -162,15 +181,12 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *simple; + GTask *task; g_return_if_fail (MM_IS_PORT_SERIAL_QCDM (self)); g_return_if_fail (command != NULL); - simple = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_port_serial_qcdm_command); + task = g_task_new (self, cancellable, callback, user_data); /* 'command' is expected to be already CRC-ed and escaped */ mm_port_serial_command (MM_PORT_SERIAL (self), @@ -179,7 +195,7 @@ FALSE, /* never cached */ cancellable, (GAsyncReadyCallback)serial_command_ready, - simple); + task); } static void @@ -202,6 +218,111 @@ /*****************************************************************************/ +typedef struct { + guint log_code; + MMPortSerialQcdmUnsolicitedMsgFn callback; + gboolean enable; + gpointer user_data; + GDestroyNotify notify; +} MMQcdmUnsolicitedMsgHandler; + +static gint +unsolicited_msg_handler_cmp (MMQcdmUnsolicitedMsgHandler *handler, + gpointer log_code) +{ + return handler->log_code - GPOINTER_TO_UINT (log_code); +} + +void +mm_port_serial_qcdm_add_unsolicited_msg_handler (MMPortSerialQcdm *self, + guint log_code, + MMPortSerialQcdmUnsolicitedMsgFn callback, + gpointer user_data, + GDestroyNotify notify) +{ + GSList *existing; + MMQcdmUnsolicitedMsgHandler *handler; + + g_return_if_fail (MM_IS_PORT_SERIAL_QCDM (self)); + g_return_if_fail (log_code > 0 && log_code <= G_MAXUINT16); + + existing = g_slist_find_custom (self->priv->unsolicited_msg_handlers, + GUINT_TO_POINTER (log_code), + (GCompareFunc)unsolicited_msg_handler_cmp); + if (existing) { + handler = existing->data; + /* We OVERWRITE any existing one, so if any context data existing, free it */ + if (handler->notify) + handler->notify (handler->user_data); + } else { + handler = g_slice_new (MMQcdmUnsolicitedMsgHandler); + self->priv->unsolicited_msg_handlers = g_slist_append (self->priv->unsolicited_msg_handlers, handler); + handler->log_code = log_code; + } + + handler->callback = callback; + handler->enable = TRUE; + handler->user_data = user_data; + handler->notify = notify; +} + +void +mm_port_serial_qcdm_enable_unsolicited_msg_handler (MMPortSerialQcdm *self, + guint log_code, + gboolean enable) +{ + GSList *existing; + MMQcdmUnsolicitedMsgHandler *handler; + + g_return_if_fail (MM_IS_PORT_SERIAL_QCDM (self)); + g_return_if_fail (log_code > 0 && log_code <= G_MAXUINT16); + + existing = g_slist_find_custom (self->priv->unsolicited_msg_handlers, + GUINT_TO_POINTER (log_code), + (GCompareFunc)unsolicited_msg_handler_cmp); + if (existing) { + handler = existing->data; + handler->enable = enable; + } +} + +static void +parse_unsolicited (MMPortSerial *port, GByteArray *response) +{ + MMPortSerialQcdm *self = MM_PORT_SERIAL_QCDM (port); + GByteArray *log_buffer = NULL; + GSList *iter; + + if (parse_qcdm (response, + TRUE, + &log_buffer, + NULL) != MM_PORT_SERIAL_RESPONSE_BUFFER) { + return; + } + + /* These should be guaranteed by parse_qcdm() */ + g_return_if_fail (log_buffer); + g_return_if_fail (log_buffer->len > 0); + g_return_if_fail (log_buffer->data[0] == DIAG_CMD_LOG); + + if (log_buffer->len < sizeof (DMCmdLog)) + return; + + for (iter = self->priv->unsolicited_msg_handlers; iter; iter = iter->next) { + MMQcdmUnsolicitedMsgHandler *handler = (MMQcdmUnsolicitedMsgHandler *) iter->data; + DMCmdLog *log_cmd = (DMCmdLog *) log_buffer->data; + + if (!handler->enable) + continue; + if (handler->log_code != le16toh (log_cmd->log_code)) + continue; + if (handler->callback) + handler->callback (self, log_buffer, handler->user_data); + } +} + +/*****************************************************************************/ + static gboolean config_fd (MMPortSerial *port, int fd, GError **error) { @@ -250,14 +371,39 @@ static void mm_port_serial_qcdm_init (MMPortSerialQcdm *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_PORT_SERIAL_QCDM, MMPortSerialQcdmPrivate); +} + +static void +finalize (GObject *object) +{ + MMPortSerialQcdm *self = MM_PORT_SERIAL_QCDM (object); + + while (self->priv->unsolicited_msg_handlers) { + MMQcdmUnsolicitedMsgHandler *handler = (MMQcdmUnsolicitedMsgHandler *) self->priv->unsolicited_msg_handlers->data; + + if (handler->notify) + handler->notify (handler->user_data); + + g_slice_free (MMQcdmUnsolicitedMsgHandler, handler); + self->priv->unsolicited_msg_handlers = g_slist_delete_link (self->priv->unsolicited_msg_handlers, + self->priv->unsolicited_msg_handlers); + } + + G_OBJECT_CLASS (mm_port_serial_qcdm_parent_class)->finalize (object); } static void mm_port_serial_qcdm_class_init (MMPortSerialQcdmClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); MMPortSerialClass *port_class = MM_PORT_SERIAL_CLASS (klass); + g_type_class_add_private (object_class, sizeof (MMPortSerialQcdmPrivate)); + /* Virtual methods */ + object_class->finalize = finalize; + port_class->parse_unsolicited = parse_unsolicited; port_class->parse_response = parse_response; port_class->config_fd = config_fd; port_class->debug_log = debug_log; diff -Nru modemmanager-1.6.8/src/mm-port-serial-qcdm.h modemmanager-1.10.0/src/mm-port-serial-qcdm.h --- modemmanager-1.6.8/src/mm-port-serial-qcdm.h 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-port-serial-qcdm.h 2018-11-15 09:55:53.000000000 +0100 @@ -31,9 +31,11 @@ typedef struct _MMPortSerialQcdm MMPortSerialQcdm; typedef struct _MMPortSerialQcdmClass MMPortSerialQcdmClass; +typedef struct _MMPortSerialQcdmPrivate MMPortSerialQcdmPrivate; struct _MMPortSerialQcdm { MMPortSerial parent; + MMPortSerialQcdmPrivate *priv; }; struct _MMPortSerialQcdmClass { @@ -55,4 +57,18 @@ GAsyncResult *res, GError **error); +typedef void (*MMPortSerialQcdmUnsolicitedMsgFn) (MMPortSerialQcdm *port, + GByteArray *log_buffer, + gpointer user_data); + +void mm_port_serial_qcdm_add_unsolicited_msg_handler (MMPortSerialQcdm *self, + guint log_code, + MMPortSerialQcdmUnsolicitedMsgFn callback, + gpointer user_data, + GDestroyNotify notify); + +void mm_port_serial_qcdm_enable_unsolicited_msg_handler (MMPortSerialQcdm *self, + guint log_code, + gboolean enable); + #endif /* MM_PORT_SERIAL_QCDM_H */ diff -Nru modemmanager-1.6.8/src/mm-shared-qmi.c modemmanager-1.10.0/src/mm-shared-qmi.c --- modemmanager-1.6.8/src/mm-shared-qmi.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/mm-shared-qmi.c 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,4360 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#include +#include +#include + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include + +#include "mm-log.h" +#include "mm-iface-modem.h" +#include "mm-iface-modem-3gpp.h" +#include "mm-iface-modem-location.h" +#include "mm-shared-qmi.h" +#include "mm-modem-helpers-qmi.h" + +/* Default session id to use in LOC operations */ +#define DEFAULT_LOC_SESSION_ID 0x10 + +/*****************************************************************************/ +/* Private data context */ + +#define PRIVATE_TAG "shared-qmi-private-tag" +static GQuark private_quark; + +typedef enum { + FEATURE_UNKNOWN, + FEATURE_UNSUPPORTED, + FEATURE_SUPPORTED, +} Feature; + +typedef struct { + /* Capabilities & modes helpers */ + MMModemCapability current_capabilities; + GArray *supported_radio_interfaces; + Feature feature_nas_technology_preference; + Feature feature_nas_system_selection_preference; + Feature feature_extended_lte_band_preference; + gboolean disable_4g_only_mode; + GArray *supported_bands; + + /* Location helpers */ + MMIfaceModemLocation *iface_modem_location_parent; + MMModemLocationSource enabled_sources; + QmiClient *pds_client; + gulong pds_location_event_report_indication_id; + QmiClient *loc_client; + gulong loc_location_nmea_indication_id; + gchar **loc_assistance_data_servers; + guint32 loc_assistance_data_max_file_size; + guint32 loc_assistance_data_max_part_size; +} Private; + +static void +private_free (Private *priv) +{ + if (priv->supported_bands) + g_array_unref (priv->supported_bands); + if (priv->supported_radio_interfaces) + g_array_unref (priv->supported_radio_interfaces); + if (priv->pds_location_event_report_indication_id) + g_signal_handler_disconnect (priv->pds_client, priv->pds_location_event_report_indication_id); + if (priv->pds_client) + g_object_unref (priv->pds_client); + if (priv->loc_location_nmea_indication_id) + g_signal_handler_disconnect (priv->loc_client, priv->loc_location_nmea_indication_id); + if (priv->loc_client) + g_object_unref (priv->loc_client); + g_strfreev (priv->loc_assistance_data_servers); + g_slice_free (Private, priv); +} + +static Private * +get_private (MMSharedQmi *self) +{ + Private *priv; + + if (G_UNLIKELY (!private_quark)) + private_quark = g_quark_from_static_string (PRIVATE_TAG); + + priv = g_object_get_qdata (G_OBJECT (self), private_quark); + if (!priv) { + priv = g_slice_new0 (Private); + + priv->feature_nas_technology_preference = FEATURE_UNKNOWN; + priv->feature_nas_system_selection_preference = FEATURE_UNKNOWN; + + /* Setup parent class' MMIfaceModemLocation */ + g_assert (MM_SHARED_QMI_GET_INTERFACE (self)->peek_parent_location_interface); + priv->iface_modem_location_parent = MM_SHARED_QMI_GET_INTERFACE (self)->peek_parent_location_interface (self); + + g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free); + } + + return priv; +} + +/*****************************************************************************/ +/* Register in network (3GPP interface) */ + +gboolean +mm_shared_qmi_3gpp_register_in_network_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +initiate_network_register_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + QmiMessageNasInitiateNetworkRegisterOutput *output; + + output = qmi_client_nas_initiate_network_register_finish (client, res, &error); + if (!output || !qmi_message_nas_initiate_network_register_output_get_result (output, &error)) { + if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_prefix_error (&error, "Couldn't initiate network register: "); + g_task_return_error (task, error); + goto out; + } + g_error_free (error); + } + + g_task_return_boolean (task, TRUE); + +out: + g_object_unref (task); + + if (output) + qmi_message_nas_initiate_network_register_output_unref (output); +} + +void +mm_shared_qmi_3gpp_register_in_network (MMIfaceModem3gpp *self, + const gchar *operator_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + QmiMessageNasInitiateNetworkRegisterInput *input; + guint16 mcc = 0; + guint16 mnc = 0; + QmiClient *client = NULL; + GError *error = NULL; + + /* Get NAS client */ + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + /* Parse input MCC/MNC */ + if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) { + g_assert (error != NULL); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + input = qmi_message_nas_initiate_network_register_input_new (); + + if (mcc) { + /* If the user sent a specific network to use, lock it in. */ + qmi_message_nas_initiate_network_register_input_set_action ( + input, + QMI_NAS_NETWORK_REGISTER_TYPE_MANUAL, + NULL); + qmi_message_nas_initiate_network_register_input_set_manual_registration_info_3gpp ( + input, + mcc, + mnc, + QMI_NAS_RADIO_INTERFACE_UNKNOWN, /* don't change radio interface */ + NULL); + } else { + /* Otherwise, automatic registration */ + qmi_message_nas_initiate_network_register_input_set_action ( + input, + QMI_NAS_NETWORK_REGISTER_TYPE_AUTOMATIC, + NULL); + } + + qmi_client_nas_initiate_network_register ( + QMI_CLIENT_NAS (client), + input, + 120, + cancellable, + (GAsyncReadyCallback)initiate_network_register_ready, + task); + + qmi_message_nas_initiate_network_register_input_unref (input); +} + +/*****************************************************************************/ +/* Current capabilities setting (Modem interface) */ + +typedef enum { + SET_CURRENT_CAPABILITIES_STEP_FIRST, + SET_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE, + SET_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE, + SET_CURRENT_CAPABILITIES_STEP_RESET, + SET_CURRENT_CAPABILITIES_STEP_LAST, +} SetCurrentCapabilitiesStep; + +typedef struct { + QmiClientNas *client; + MMModemCapability capabilities; + gboolean capabilities_updated; + SetCurrentCapabilitiesStep step; +} SetCurrentCapabilitiesContext; + +static void +set_current_capabilities_context_free (SetCurrentCapabilitiesContext *ctx) +{ + g_object_unref (ctx->client); + g_slice_free (SetCurrentCapabilitiesContext, ctx); +} + +gboolean +mm_shared_qmi_set_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void set_current_capabilities_step (GTask *task); + +static void +set_current_capabilities_reset_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + SetCurrentCapabilitiesContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + if (!mm_shared_qmi_reset_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + ctx->step++; + set_current_capabilities_step (task); +} + +static void +set_current_capabilities_set_technology_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + SetCurrentCapabilitiesContext *ctx; + QmiMessageNasSetTechnologyPreferenceOutput *output = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_set_technology_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_set_technology_preference_output_get_result (output, &error)) { + /* A no-effect error here is not a real error */ + if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + /* no effect, just end operation without reset */ + g_clear_error (&error); + ctx->step = SET_CURRENT_CAPABILITIES_STEP_LAST; + set_current_capabilities_step (task); + goto out; + } + + /* success! */ + ctx->step = SET_CURRENT_CAPABILITIES_STEP_RESET; + set_current_capabilities_step (task); + +out: + if (output) + qmi_message_nas_set_technology_preference_output_unref (output); +} + +static void +set_current_capabilities_technology_preference (GTask *task) +{ + SetCurrentCapabilitiesContext *ctx; + QmiMessageNasSetTechnologyPreferenceInput *input; + QmiNasRadioTechnologyPreference pref; + + ctx = g_task_get_task_data (task); + + pref = mm_modem_capability_to_qmi_radio_technology_preference (ctx->capabilities); + if (!pref) { + gchar *str; + + str = mm_modem_capability_build_string_from_mask (ctx->capabilities); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled capabilities setting: '%s'", + str); + g_object_unref (task); + g_free (str); + return; + } + + input = qmi_message_nas_set_technology_preference_input_new (); + qmi_message_nas_set_technology_preference_input_set_current (input, pref, QMI_NAS_PREFERENCE_DURATION_PERMANENT, NULL); + + qmi_client_nas_set_technology_preference ( + ctx->client, + input, + 5, + NULL, + (GAsyncReadyCallback)set_current_capabilities_set_technology_preference_ready, + task); + qmi_message_nas_set_technology_preference_input_unref (input); +} + +static void +set_current_capabilities_set_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + SetCurrentCapabilitiesContext *ctx; + QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + /* success! */ + ctx->step = SET_CURRENT_CAPABILITIES_STEP_RESET; + set_current_capabilities_step (task); + +out: + if (output) + qmi_message_nas_set_system_selection_preference_output_unref (output); +} + +static void +set_current_capabilities_system_selection_preference (GTask *task) +{ + MMSharedQmi *self; + Private *priv; + SetCurrentCapabilitiesContext *ctx; + QmiMessageNasSetSystemSelectionPreferenceInput *input; + QmiNasRatModePreference pref; + + self = g_task_get_source_object (task); + priv = get_private (MM_SHARED_QMI (self)); + ctx = g_task_get_task_data (task); + + pref = mm_modem_capability_to_qmi_rat_mode_preference (ctx->capabilities); + if (!pref) { + gchar *str; + + str = mm_modem_capability_build_string_from_mask (ctx->capabilities); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled capabilities setting: '%s'", + str); + g_object_unref (task); + g_free (str); + return; + } + + input = qmi_message_nas_set_system_selection_preference_input_new (); + qmi_message_nas_set_system_selection_preference_input_set_mode_preference (input, pref, NULL); + qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); + + qmi_client_nas_set_system_selection_preference ( + ctx->client, + input, + 5, + NULL, + (GAsyncReadyCallback)set_current_capabilities_set_system_selection_preference_ready, + task); + qmi_message_nas_set_system_selection_preference_input_unref (input); +} + +static void +set_current_capabilities_step (GTask *task) +{ + MMSharedQmi *self; + Private *priv; + SetCurrentCapabilitiesContext *ctx; + + self = g_task_get_source_object (task); + priv = get_private (MM_SHARED_QMI (self)); + ctx = g_task_get_task_data (task); + + switch (ctx->step) { + case SET_CURRENT_CAPABILITIES_STEP_FIRST: + /* Error out early if both unsupported */ + if ((priv->feature_nas_system_selection_preference != FEATURE_SUPPORTED) && + (priv->feature_nas_technology_preference != FEATURE_SUPPORTED)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Setting capabilities is not supported by this device"); + g_object_unref (task); + return; + } + ctx->step++; + /* fall-through */ + + case SET_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE: + if (priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) { + set_current_capabilities_system_selection_preference (task); + return; + } + ctx->step++; + /* fall-through */ + + case SET_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE: + if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED) { + set_current_capabilities_technology_preference (task); + return; + } + ctx->step++; + /* fall-through */ + + case SET_CURRENT_CAPABILITIES_STEP_RESET: + mm_shared_qmi_reset (MM_IFACE_MODEM (self), + (GAsyncReadyCallback)set_current_capabilities_reset_ready, + task); + return; + + case SET_CURRENT_CAPABILITIES_STEP_LAST: + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } +} + +void +mm_shared_qmi_set_current_capabilities (MMIfaceModem *self, + MMModemCapability capabilities, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + SetCurrentCapabilitiesContext *ctx; + GTask *task; + QmiClient *client = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + priv = get_private (MM_SHARED_QMI (self)); + g_assert (priv->feature_nas_technology_preference != FEATURE_UNKNOWN); + g_assert (priv->feature_nas_system_selection_preference != FEATURE_UNKNOWN); + + ctx = g_slice_new0 (SetCurrentCapabilitiesContext); + ctx->client = g_object_ref (client); + ctx->capabilities = capabilities; + ctx->step = SET_CURRENT_CAPABILITIES_STEP_FIRST; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_current_capabilities_context_free); + + set_current_capabilities_step (task); +} + +/*****************************************************************************/ +/* Current capabilities (Modem interface) */ + +typedef enum { + LOAD_CURRENT_CAPABILITIES_STEP_FIRST, + LOAD_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE, + LOAD_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE, + LOAD_CURRENT_CAPABILITIES_STEP_DMS_GET_CAPABILITIES, + LOAD_CURRENT_CAPABILITIES_STEP_LAST, +} LoadCurrentCapabilitiesStep; + +typedef struct { + QmiClientNas *nas_client; + QmiClientDms *dms_client; + LoadCurrentCapabilitiesStep step; + MMQmiCapabilitiesContext capabilities_context; +} LoadCurrentCapabilitiesContext; + +MMModemCapability +mm_shared_qmi_load_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_CAPABILITY_NONE; + } + return (MMModemCapability)value; +} + +static void +load_current_capabilities_context_free (LoadCurrentCapabilitiesContext *ctx) +{ + g_object_unref (ctx->nas_client); + g_object_unref (ctx->dms_client); + g_slice_free (LoadCurrentCapabilitiesContext, ctx); +} + +static void load_current_capabilities_step (GTask *task); + +static void +load_current_capabilities_get_capabilities_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + LoadCurrentCapabilitiesContext *ctx; + QmiMessageDmsGetCapabilitiesOutput *output = NULL; + GError *error = NULL; + guint i; + GArray *radio_interface_list; + + self = g_task_get_source_object (task); + priv = get_private (self); + ctx = g_task_get_task_data (task); + + output = qmi_client_dms_get_capabilities_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + if (!qmi_message_dms_get_capabilities_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't get Capabilities: "); + goto out; + } + + qmi_message_dms_get_capabilities_output_get_info ( + output, + NULL, /* info_max_tx_channel_rate */ + NULL, /* info_max_rx_channel_rate */ + NULL, /* info_data_service_capability */ + NULL, /* info_sim_capability */ + &radio_interface_list, + NULL); + + /* Cache supported radio interfaces */ + g_assert (!priv->supported_radio_interfaces); + priv->supported_radio_interfaces = g_array_ref (radio_interface_list); + + for (i = 0; i < radio_interface_list->len; i++) + ctx->capabilities_context.dms_capabilities |= + mm_modem_capability_from_qmi_radio_interface (g_array_index (radio_interface_list, QmiDmsRadioInterface, i)); + +out: + if (output) + qmi_message_dms_get_capabilities_output_unref (output); + + /* Failure in DMS Get Capabilities is fatal */ + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + ctx->step++; + load_current_capabilities_step (task); +} + +static void +load_current_capabilities_get_technology_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + LoadCurrentCapabilitiesContext *ctx; + QmiMessageNasGetTechnologyPreferenceOutput *output = NULL; + GError *error = NULL; + + self = g_task_get_source_object (task); + priv = get_private (MM_SHARED_QMI (self)); + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_get_technology_preference_finish (client, res, &error); + if (!output) { + mm_dbg ("QMI operation failed: %s", error->message); + g_error_free (error); + priv->feature_nas_technology_preference = FEATURE_UNSUPPORTED; + } else if (!qmi_message_nas_get_technology_preference_output_get_result (output, &error)) { + mm_dbg ("Couldn't get technology preference: %s", error->message); + g_error_free (error); + priv->feature_nas_technology_preference = FEATURE_SUPPORTED; + } else { + qmi_message_nas_get_technology_preference_output_get_active ( + output, + &ctx->capabilities_context.nas_tp_mask, + NULL, /* duration */ + NULL); + priv->feature_nas_technology_preference = FEATURE_SUPPORTED; + } + + if (output) + qmi_message_nas_get_technology_preference_output_unref (output); + + ctx->step++; + load_current_capabilities_step (task); +} + +static void +load_current_capabilities_get_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + LoadCurrentCapabilitiesContext *ctx; + QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + priv = get_private (MM_SHARED_QMI (self)); + + output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); + if (!output) { + mm_dbg ("QMI operation failed: %s", error->message); + g_error_free (error); + priv->feature_nas_system_selection_preference = FEATURE_UNSUPPORTED; + } else if (!qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { + mm_dbg ("Couldn't get system selection preference: %s", error->message); + g_error_free (error); + priv->feature_nas_system_selection_preference = FEATURE_SUPPORTED; + } else { + qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( + output, + &ctx->capabilities_context.nas_ssp_mode_preference_mask, + NULL); + priv->feature_nas_system_selection_preference = FEATURE_SUPPORTED; + } + + if (output) + qmi_message_nas_get_system_selection_preference_output_unref (output); + + ctx->step++; + load_current_capabilities_step (task); +} + +static void +load_current_capabilities_step (GTask *task) +{ + MMSharedQmi *self; + Private *priv; + LoadCurrentCapabilitiesContext *ctx; + + self = g_task_get_source_object (task); + priv = get_private (MM_SHARED_QMI (self)); + ctx = g_task_get_task_data (task); + + switch (ctx->step) { + case LOAD_CURRENT_CAPABILITIES_STEP_FIRST: + ctx->step++; + /* fall-through */ + + case LOAD_CURRENT_CAPABILITIES_STEP_NAS_SYSTEM_SELECTION_PREFERENCE: + qmi_client_nas_get_system_selection_preference ( + ctx->nas_client, NULL, 5, NULL, + (GAsyncReadyCallback)load_current_capabilities_get_system_selection_preference_ready, + task); + return; + + case LOAD_CURRENT_CAPABILITIES_STEP_NAS_TECHNOLOGY_PREFERENCE: + qmi_client_nas_get_technology_preference ( + ctx->nas_client, NULL, 5, NULL, + (GAsyncReadyCallback)load_current_capabilities_get_technology_preference_ready, + task); + return; + + case LOAD_CURRENT_CAPABILITIES_STEP_DMS_GET_CAPABILITIES: + qmi_client_dms_get_capabilities ( + ctx->dms_client, NULL, 5, NULL, + (GAsyncReadyCallback)load_current_capabilities_get_capabilities_ready, + task); + return; + + case LOAD_CURRENT_CAPABILITIES_STEP_LAST: + g_assert (priv->feature_nas_technology_preference != FEATURE_UNKNOWN); + g_assert (priv->feature_nas_system_selection_preference != FEATURE_UNKNOWN); + priv->current_capabilities = mm_modem_capability_from_qmi_capabilities_context (&ctx->capabilities_context); + g_task_return_int (task, priv->current_capabilities); + g_object_unref (task); + return; + } +} + +void +mm_shared_qmi_load_current_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + LoadCurrentCapabilitiesContext *ctx; + GTask *task; + QmiClient *nas_client = NULL; + QmiClient *dms_client = NULL; + Private *priv; + + /* + * We assume that DMS Get Capabilities reports always the same result, + * that will include all capabilities supported by the device regardless + * of which ones are configured at the moment. E.g. for the Load Supported + * Capabilities we base the logic exclusively on this method's output. + * + * We then consider 3 different cases: + * a) If the device supports NAS System Selection Preference, we use the + * "mode preference" TLV to select currently enabled capabilities. + * b) If the device supports NAS Technology Preference (older devices), + * we use this method to select currently enabled capabilities. + * c) If none of those messages is supported we don't allow swiching + * capabilities. + */ + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &nas_client, + callback, user_data)) + return; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &dms_client, + callback, user_data)) + return; + + /* Current capabilities is the first thing run, and will only be run once per modem, + * so we should here check support for the optional features. */ + priv = get_private (MM_SHARED_QMI (self)); + g_assert (priv->feature_nas_technology_preference == FEATURE_UNKNOWN); + g_assert (priv->feature_nas_system_selection_preference == FEATURE_UNKNOWN); + + ctx = g_slice_new0 (LoadCurrentCapabilitiesContext); + ctx->nas_client = g_object_ref (nas_client); + ctx->dms_client = g_object_ref (dms_client); + ctx->step = LOAD_CURRENT_CAPABILITIES_STEP_FIRST; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_current_capabilities_context_free); + + load_current_capabilities_step (task); +} + +/*****************************************************************************/ +/* Supported capabilities (Modem interface) */ + +GArray * +mm_shared_qmi_load_supported_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +void +mm_shared_qmi_load_supported_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + MMModemCapability mask; + MMModemCapability single; + GArray *supported_combinations; + guint i; + + task = g_task_new (self, NULL, callback, user_data); + + /* List of radio interfaces preloaded in current capabilities */ + priv = get_private (MM_SHARED_QMI (self)); + if (!priv->supported_radio_interfaces) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "cannot load current capabilities without radio interface information"); + g_object_unref (task); + return; + } + + /* Build mask with all supported capabilities */ + mask = MM_MODEM_CAPABILITY_NONE; + for (i = 0; i < priv->supported_radio_interfaces->len; i++) + mask |= mm_modem_capability_from_qmi_radio_interface (g_array_index (priv->supported_radio_interfaces, QmiDmsRadioInterface, i)); + + supported_combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemCapability), 3); + + /* Add all possible supported capability combinations. + * In order to avoid unnecessary modem reboots, we will only implement capabilities + * switching only when switching GSM/UMTS+CDMA/EVDO multimode devices, and only if + * we have support for the commands doing it. + */ + if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED || priv->feature_nas_system_selection_preference == FEATURE_UNKNOWN) { + if (mask == (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO)) { + /* Multimode GSM/UMTS+CDMA/EVDO device switched to GSM/UMTS only */ + single = MM_MODEM_CAPABILITY_GSM_UMTS; + g_array_append_val (supported_combinations, single); + /* Multimode GSM/UMTS+CDMA/EVDO device switched to CDMA/EVDO only */ + single = MM_MODEM_CAPABILITY_CDMA_EVDO; + g_array_append_val (supported_combinations, single); + } else if (mask == (MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE)) { + /* Multimode GSM/UMTS+CDMA/EVDO+LTE device switched to GSM/UMTS+LTE only */ + single = MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_LTE; + g_array_append_val (supported_combinations, single); + /* Multimode GSM/UMTS+CDMA/EVDO+LTE device switched to CDMA/EVDO+LTE only */ + single = MM_MODEM_CAPABILITY_CDMA_EVDO | MM_MODEM_CAPABILITY_LTE; + g_array_append_val (supported_combinations, single); + /* + * Multimode GSM/UMTS+CDMA/EVDO+LTE device switched to LTE only. + * + * This case is required because we use the same methods and operations to + * switch capabilities and modes. For the LTE capability there is a direct + * related 4G mode, and so we cannot select a '4G only' mode in this device + * because we wouldn't be able to know the full list of current capabilities + * if the device was rebooted, as we would only see LTE capability. So, + * handle this special case so that the LTE/4G-only mode can exclusively be + * selected as capability switching in this kind of devices. + */ + priv->disable_4g_only_mode = TRUE; + single = MM_MODEM_CAPABILITY_LTE; + g_array_append_val (supported_combinations, single); + } + } + + /* Add the full mask itself */ + single = mask; + g_array_append_val (supported_combinations, single); + + g_task_return_pointer (task, supported_combinations, (GDestroyNotify) g_array_unref); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Allowed modes setting (Modem interface) */ + +typedef struct { + QmiClientNas *client; + MMModemMode allowed; + MMModemMode preferred; +} SetCurrentModesContext; + +static void +set_current_modes_context_free (SetCurrentModesContext *ctx) +{ + g_object_unref (ctx->client); + g_slice_free (SetCurrentModesContext, ctx); +} + +gboolean +mm_shared_qmi_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +set_current_modes_technology_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesContext *ctx; + QmiMessageNasSetTechnologyPreferenceOutput *output = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_set_technology_preference_finish (client, res, &error); + if (!output || + (!qmi_message_nas_set_technology_preference_output_get_result (output, &error) && + !g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT))) { + g_task_return_error (task, error); + } else { + g_clear_error (&error); + g_task_return_boolean (task, TRUE); + } + g_object_unref (task); + + if (output) + qmi_message_nas_set_technology_preference_output_unref (output); +} + +static void +set_current_modes_technology_preference (GTask *task) +{ + MMIfaceModem *self; + SetCurrentModesContext *ctx; + QmiMessageNasSetTechnologyPreferenceInput *input; + QmiNasRadioTechnologyPreference pref; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + if (ctx->preferred != MM_MODEM_MODE_NONE) { + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot set specific preferred mode"); + g_object_unref (task); + return; + } + + pref = mm_modem_mode_to_qmi_radio_technology_preference (ctx->allowed, mm_iface_modem_is_cdma (self)); + if (!pref) { + gchar *str; + + str = mm_modem_mode_build_string_from_mask (ctx->allowed); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unhandled allowed mode setting: '%s'", + str); + g_object_unref (task); + g_free (str); + return; + } + + input = qmi_message_nas_set_technology_preference_input_new (); + qmi_message_nas_set_technology_preference_input_set_current (input, pref, QMI_NAS_PREFERENCE_DURATION_PERMANENT, NULL); + + qmi_client_nas_set_technology_preference ( + ctx->client, + input, + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)set_current_modes_technology_preference_ready, + task); + qmi_message_nas_set_technology_preference_input_unref (input); +} + +static void +set_current_modes_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + SetCurrentModesContext *ctx; + QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + if (output) + qmi_message_nas_set_system_selection_preference_output_unref (output); +} + +static void +set_current_modes_system_selection_preference (GTask *task) +{ + MMIfaceModem *self; + SetCurrentModesContext *ctx; + QmiMessageNasSetSystemSelectionPreferenceInput *input; + Private *priv; + QmiNasRatModePreference pref; + + self = g_task_get_source_object (task); + priv = get_private (MM_SHARED_QMI (self)); + ctx = g_task_get_task_data (task); + + input = qmi_message_nas_set_system_selection_preference_input_new (); + qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); + + /* Preferred modes */ + + if (ctx->preferred != MM_MODEM_MODE_NONE) { + GArray *array; + + /* Acquisition order array */ + array = mm_modem_mode_to_qmi_acquisition_order_preference (ctx->allowed, + ctx->preferred, + mm_iface_modem_is_cdma (self), + mm_iface_modem_is_3gpp (self)); + g_assert (array); + qmi_message_nas_set_system_selection_preference_input_set_acquisition_order_preference (input, array, NULL); + g_array_unref (array); + + /* Only set GSM/WCDMA acquisition order preference if both 2G and 3G given as allowed */ + if (mm_iface_modem_is_3gpp (self) && ((ctx->allowed & (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G)) == (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G))) { + QmiNasGsmWcdmaAcquisitionOrderPreference order; + + order = mm_modem_mode_to_qmi_gsm_wcdma_acquisition_order_preference (ctx->preferred); + qmi_message_nas_set_system_selection_preference_input_set_gsm_wcdma_acquisition_order_preference (input, order, NULL); + } + } + + /* Allowed modes */ + pref = mm_modem_mode_to_qmi_rat_mode_preference (ctx->allowed, + mm_iface_modem_is_cdma (self), + mm_iface_modem_is_3gpp (self)); + qmi_message_nas_set_system_selection_preference_input_set_mode_preference (input, pref, NULL); + + qmi_client_nas_set_system_selection_preference ( + ctx->client, + input, + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)set_current_modes_system_selection_preference_ready, + task); + qmi_message_nas_set_system_selection_preference_input_unref (input); +} + +void +mm_shared_qmi_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data) +{ + SetCurrentModesContext *ctx; + GTask *task; + QmiClient *client = NULL; + Private *priv; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + ctx = g_slice_new0 (SetCurrentModesContext); + ctx->client = g_object_ref (client); + + if (allowed == MM_MODEM_MODE_ANY && ctx->preferred == MM_MODEM_MODE_NONE) { + ctx->allowed = MM_MODEM_MODE_NONE; + if (mm_iface_modem_is_2g (self)) + ctx->allowed |= MM_MODEM_MODE_2G; + if (mm_iface_modem_is_3g (self)) + ctx->allowed |= MM_MODEM_MODE_3G; + if (mm_iface_modem_is_4g (self)) + ctx->allowed |= MM_MODEM_MODE_4G; + ctx->preferred = MM_MODEM_MODE_NONE; + } else { + ctx->allowed = allowed; + ctx->preferred = preferred; + } + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_current_modes_context_free); + + priv = get_private (MM_SHARED_QMI (self)); + + if (priv->feature_nas_system_selection_preference == FEATURE_SUPPORTED) { + set_current_modes_system_selection_preference (task); + return; + } + + if (priv->feature_nas_technology_preference == FEATURE_SUPPORTED) { + set_current_modes_technology_preference (task); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Setting allowed modes is not supported by this device"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Load current modes (Modem interface) */ + +typedef struct { + QmiClientNas *client; +} LoadCurrentModesContext; + +typedef struct { + MMModemMode allowed; + MMModemMode preferred; +} LoadCurrentModesResult; + +static void +load_current_modes_context_free (LoadCurrentModesContext *ctx) +{ + g_object_unref (ctx->client); + g_free (ctx); +} + +gboolean +mm_shared_qmi_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error) +{ + LoadCurrentModesResult *result; + + result = g_task_propagate_pointer (G_TASK (res), error); + if (!result) + return FALSE; + + *allowed = result->allowed; + *preferred = result->preferred; + g_free (result); + return TRUE; +} + +static void +get_technology_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + LoadCurrentModesContext *ctx; + LoadCurrentModesResult *result = NULL; + QmiMessageNasGetTechnologyPreferenceOutput *output = NULL; + GError *error = NULL; + MMModemMode allowed; + QmiNasRadioTechnologyPreference preference_mask; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_get_technology_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_get_technology_preference_output_get_result (output, &error)) { + g_task_return_error (task, error); + goto out; + } + + qmi_message_nas_get_technology_preference_output_get_active ( + output, + &preference_mask, + NULL, /* duration */ + NULL); + allowed = mm_modem_mode_from_qmi_radio_technology_preference (preference_mask); + if (allowed == MM_MODEM_MODE_NONE) { + gchar *str; + + str = qmi_nas_radio_technology_preference_build_string_from_mask (preference_mask); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unsupported modes reported: '%s'", str); + g_free (str); + goto out; + } + + /* We got a valid value from here */ + result = g_new (LoadCurrentModesResult, 1); + result->allowed = allowed; + result->preferred = MM_MODEM_MODE_NONE; + g_task_return_pointer (task, result, g_free); + +out: + if (output) + qmi_message_nas_get_technology_preference_output_unref (output); + g_object_unref (task); +} + +static void +load_current_modes_technology_preference (GTask *task) +{ + LoadCurrentModesContext *ctx; + + ctx = g_task_get_task_data (task); + + qmi_client_nas_get_technology_preference ( + ctx->client, + NULL, /* no input */ + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)get_technology_preference_ready, + task); +} + +static void +load_current_modes_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + LoadCurrentModesContext *ctx; + LoadCurrentModesResult *result = NULL; + QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + QmiNasRatModePreference mode_preference_mask = 0; + MMModemMode allowed; + + ctx = g_task_get_task_data (task); + + output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { + g_task_return_error (task, error); + goto out; + } + + if (!qmi_message_nas_get_system_selection_preference_output_get_mode_preference ( + output, + &mode_preference_mask, + NULL)) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Mode preference not reported in system selection preference"); + goto out; + } + + allowed = mm_modem_mode_from_qmi_rat_mode_preference (mode_preference_mask); + if (allowed == MM_MODEM_MODE_NONE) { + gchar *str; + + str = qmi_nas_rat_mode_preference_build_string_from_mask (mode_preference_mask); + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Unsupported modes reported: '%s'", str); + g_free (str); + goto out; + } + + /* We got a valid value from here */ + result = g_new (LoadCurrentModesResult, 1); + result->allowed = allowed; + result->preferred = MM_MODEM_MODE_NONE; + + /* For 2G+3G only rely on the GSM/WCDMA acquisition order preference TLV */ + if (mode_preference_mask == (QMI_NAS_RAT_MODE_PREFERENCE_GSM | QMI_NAS_RAT_MODE_PREFERENCE_UMTS)) { + QmiNasGsmWcdmaAcquisitionOrderPreference gsm_or_wcdma; + + if (qmi_message_nas_get_system_selection_preference_output_get_gsm_wcdma_acquisition_order_preference ( + output, + &gsm_or_wcdma, + NULL)) + result->preferred = mm_modem_mode_from_qmi_gsm_wcdma_acquisition_order_preference (gsm_or_wcdma); + } + /* Otherwise, rely on the acquisition order array TLV */ + else { + GArray *array; + + if (qmi_message_nas_get_system_selection_preference_output_get_acquisition_order_preference ( + output, + &array, + NULL) && + array->len > 0) { + guint i; + + /* The array of preference contains the preference of the full list of supported + * access technologies, regardless of whether they're enabled or not. So, look for + * the first one that is flagged as enabled, not just the first one in the array. + */ + for (i = 0; i < array->len; i++) { + MMModemMode mode; + + mode = mm_modem_mode_from_qmi_nas_radio_interface (g_array_index (array, QmiNasRadioInterface, i)); + if (allowed == mode) + break; + if (allowed & mode) { + result->preferred = mode; + break; + } + } + } + } + + g_task_return_pointer (task, result, g_free); + +out: + if (output) + qmi_message_nas_get_system_selection_preference_output_unref (output); + g_object_unref (task); +} + +static void +load_current_modes_system_selection_preference (GTask *task) +{ + LoadCurrentModesContext *ctx; + + ctx = g_task_get_task_data (task); + qmi_client_nas_get_system_selection_preference ( + ctx->client, + NULL, /* no input */ + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)load_current_modes_system_selection_preference_ready, + task); +} + +void +mm_shared_qmi_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + LoadCurrentModesContext *ctx; + GTask *task; + QmiClient *client = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + ctx = g_new0 (LoadCurrentModesContext, 1); + ctx->client = g_object_ref (client); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_current_modes_context_free); + + priv = get_private (MM_SHARED_QMI (self)); + + if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { + load_current_modes_system_selection_preference (task); + return; + } + + if (priv->feature_nas_technology_preference != FEATURE_UNSUPPORTED) { + load_current_modes_technology_preference (task); + return; + } + + /* Default to supported */ + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Loading current modes is not supported by this device"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Supported modes (Modem interface) */ + +GArray * +mm_shared_qmi_load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +void +mm_shared_qmi_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + GArray *combinations; + MMModemModeCombination mode; + Private *priv; + MMModemMode mask_all; + guint i; + GArray *all; + GArray *filtered; + + task = g_task_new (self, NULL, callback, user_data); + + priv = get_private (MM_SHARED_QMI (self)); + g_assert (priv->supported_radio_interfaces); + + /* Build all, based on the supported radio interfaces */ + mask_all = MM_MODEM_MODE_NONE; + for (i = 0; i < priv->supported_radio_interfaces->len; i++) + mask_all |= mm_modem_mode_from_qmi_radio_interface (g_array_index (priv->supported_radio_interfaces, QmiDmsRadioInterface, i)); + mode.allowed = mask_all; + mode.preferred = MM_MODEM_MODE_NONE; + all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); + g_array_append_val (all, mode); + + /* If SSP and TP are not supported, ignore supported mode management */ + if (priv->feature_nas_system_selection_preference == FEATURE_UNSUPPORTED && priv->feature_nas_technology_preference == FEATURE_UNSUPPORTED) { + g_task_return_pointer (task, all, (GDestroyNotify) g_array_unref); + g_object_unref (task); + return; + } + + combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 5); + + /* 2G-only, 3G-only */ + mode.allowed = MM_MODEM_MODE_2G; + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + mode.allowed = MM_MODEM_MODE_3G; + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + + /* 4G-only mode is not possible in multimode GSM/UMTS+CDMA/EVDO+LTE + * devices. This configuration may be selected as "LTE only" capability + * instead. */ + if (!priv->disable_4g_only_mode) { + mode.allowed = MM_MODEM_MODE_4G; + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } + + /* 2G+3G */ + mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { + mode.preferred = MM_MODEM_MODE_3G; + g_array_append_val (combinations, mode); + mode.preferred = MM_MODEM_MODE_2G; + g_array_append_val (combinations, mode); + } else { + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } + + /* 2G+4G */ + mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_4G); + if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { + mode.preferred = MM_MODEM_MODE_4G; + g_array_append_val (combinations, mode); + mode.preferred = MM_MODEM_MODE_2G; + g_array_append_val (combinations, mode); + } else { + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } + + /* 3G+4G */ + mode.allowed = (MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { + mode.preferred = MM_MODEM_MODE_3G; + g_array_append_val (combinations, mode); + mode.preferred = MM_MODEM_MODE_4G; + g_array_append_val (combinations, mode); + } else { + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } + + /* 2G+3G+4G */ + mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G | MM_MODEM_MODE_4G); + if (priv->feature_nas_system_selection_preference != FEATURE_UNSUPPORTED) { + mode.preferred = MM_MODEM_MODE_4G; + g_array_append_val (combinations, mode); + mode.preferred = MM_MODEM_MODE_3G; + g_array_append_val (combinations, mode); + mode.preferred = MM_MODEM_MODE_2G; + g_array_append_val (combinations, mode); + } else { + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + } + + /* Filter out unsupported modes */ + filtered = mm_filter_supported_modes (all, combinations); + g_array_unref (all); + g_array_unref (combinations); + + g_task_return_pointer (task, filtered, (GDestroyNotify) g_array_unref); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Load supported bands (Modem interface) */ + +GArray * +mm_shared_qmi_load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); +} + +static void +dms_get_band_capabilities_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessageDmsGetBandCapabilitiesOutput *output; + GError *error = NULL; + GArray *mm_bands = NULL; + QmiDmsBandCapability qmi_bands = 0; + QmiDmsLteBandCapability qmi_lte_bands = 0; + GArray *extended_qmi_lte_bands = NULL; + + self = g_task_get_source_object (task); + priv = get_private (self); + + output = qmi_client_dms_get_band_capabilities_finish (client, res, &error); + if (!output || !qmi_message_dms_get_band_capabilities_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't get band capabilities: "); + goto out; + } + + qmi_message_dms_get_band_capabilities_output_get_band_capability ( + output, + &qmi_bands, + NULL); + qmi_message_dms_get_band_capabilities_output_get_lte_band_capability ( + output, + &qmi_lte_bands, + NULL); + qmi_message_dms_get_band_capabilities_output_get_extended_lte_band_capability ( + output, + &extended_qmi_lte_bands, + NULL); + + mm_bands = mm_modem_bands_from_qmi_band_capabilities (qmi_bands, qmi_lte_bands, extended_qmi_lte_bands); + if (mm_bands->len == 0) { + g_clear_pointer (&mm_bands, g_array_unref); + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse the list of supported bands"); + goto out; + } + + /* Cache the result */ + g_clear_pointer (&priv->supported_bands, g_array_unref); + priv->supported_bands = g_array_ref (mm_bands); + + out: + if (output) + qmi_message_dms_get_band_capabilities_output_unref (output); + + if (error) + g_task_return_error (task, error); + else if (mm_bands) + g_task_return_pointer (task, mm_bands, (GDestroyNotify)g_array_unref); + else + g_assert_not_reached (); + g_object_unref (task); +} + +void +mm_shared_qmi_load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + QmiClient *client = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + qmi_client_dms_get_band_capabilities (QMI_CLIENT_DMS (client), + NULL, + 5, + NULL, + (GAsyncReadyCallback)dms_get_band_capabilities_ready, + task); +} + +/*****************************************************************************/ +/* Load current bands (Modem interface) */ + +GArray * +mm_shared_qmi_load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return (GArray *) g_task_propagate_pointer (G_TASK (res), error); +} + +static void +load_bands_get_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + GArray *mm_bands = NULL; + QmiNasBandPreference band_preference_mask = 0; + QmiNasLteBandPreference lte_band_preference_mask = 0; + guint64 extended_lte_band_preference[4] = { 0 }; + guint extended_lte_band_preference_size = 0; + + self = g_task_get_source_object (task); + priv = get_private (self); + + output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't get system selection preference: "); + goto out; + } + + qmi_message_nas_get_system_selection_preference_output_get_band_preference ( + output, + &band_preference_mask, + NULL); + + qmi_message_nas_get_system_selection_preference_output_get_lte_band_preference ( + output, + <e_band_preference_mask, + NULL); + + if (qmi_message_nas_get_system_selection_preference_output_get_extended_lte_band_preference ( + output, + &extended_lte_band_preference[0], + &extended_lte_band_preference[1], + &extended_lte_band_preference[2], + &extended_lte_band_preference[3], + NULL)) + extended_lte_band_preference_size = G_N_ELEMENTS (extended_lte_band_preference); + + if (G_UNLIKELY (priv->feature_extended_lte_band_preference == FEATURE_UNKNOWN)) + priv->feature_extended_lte_band_preference = extended_lte_band_preference_size ? FEATURE_SUPPORTED : FEATURE_UNSUPPORTED; + + mm_bands = mm_modem_bands_from_qmi_band_preference (band_preference_mask, + lte_band_preference_mask, + extended_lte_band_preference_size ? extended_lte_band_preference : NULL, + extended_lte_band_preference_size); + + if (mm_bands->len == 0) { + g_clear_pointer (&mm_bands, g_array_unref); + error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't parse the list of current bands"); + } + + out: + + if (output) + qmi_message_nas_get_system_selection_preference_output_unref (output); + + if (error) + g_task_return_error (task, error); + else if (mm_bands) + g_task_return_pointer (task, mm_bands, (GDestroyNotify)g_array_unref); + else + g_assert_not_reached (); + g_object_unref (task); +} + +void +mm_shared_qmi_load_current_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + QmiClient *client = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + qmi_client_nas_get_system_selection_preference ( + QMI_CLIENT_NAS (client), + NULL, /* no input */ + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)load_bands_get_system_selection_preference_ready, + task); +} + +/*****************************************************************************/ +/* Set current bands (Modem interface) */ + +gboolean +mm_shared_qmi_set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +bands_set_system_selection_preference_ready (QmiClientNas *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL; + GError *error = NULL; + + output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error); + if (!output || !qmi_message_nas_set_system_selection_preference_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't set system selection preference: "); + g_task_return_error (task, error); + } else + g_task_return_boolean (task, TRUE); + + if (output) + qmi_message_nas_set_system_selection_preference_output_unref (output); + + g_object_unref (task); +} + +void +mm_shared_qmi_set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiMessageNasSetSystemSelectionPreferenceInput *input; + Private *priv; + GTask *task; + QmiClient *client = NULL; + QmiNasBandPreference qmi_bands = 0; + QmiNasLteBandPreference qmi_lte_bands = 0; + guint64 extended_qmi_lte_bands[4] = { 0 }; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_NAS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + priv = get_private (MM_SHARED_QMI (self)); + + /* Handle ANY separately */ + if (bands_array->len == 1 && g_array_index (bands_array, MMModemBand, 0) == MM_MODEM_BAND_ANY) { + if (!priv->supported_bands) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Cannot handle 'ANY' if supported bands are unknown"); + g_object_unref (task); + return; + } + bands_array = priv->supported_bands; + } + + mm_modem_bands_to_qmi_band_preference (bands_array, + &qmi_bands, + &qmi_lte_bands, + priv->feature_extended_lte_band_preference == FEATURE_SUPPORTED ? extended_qmi_lte_bands : NULL, + G_N_ELEMENTS (extended_qmi_lte_bands)); + + input = qmi_message_nas_set_system_selection_preference_input_new (); + qmi_message_nas_set_system_selection_preference_input_set_band_preference (input, qmi_bands, NULL); + if (mm_iface_modem_is_3gpp_lte (self)) { + if (priv->feature_extended_lte_band_preference == FEATURE_SUPPORTED) + qmi_message_nas_set_system_selection_preference_input_set_extended_lte_band_preference ( + input, + extended_qmi_lte_bands[0], + extended_qmi_lte_bands[1], + extended_qmi_lte_bands[2], + extended_qmi_lte_bands[3], + NULL); + else + qmi_message_nas_set_system_selection_preference_input_set_lte_band_preference (input, qmi_lte_bands, NULL); + } + qmi_message_nas_set_system_selection_preference_input_set_change_duration (input, QMI_NAS_CHANGE_DURATION_PERMANENT, NULL); + + qmi_client_nas_set_system_selection_preference ( + QMI_CLIENT_NAS (client), + input, + 5, + NULL, /* cancellable */ + (GAsyncReadyCallback)bands_set_system_selection_preference_ready, + task); + qmi_message_nas_set_system_selection_preference_input_unref (input); +} + +/*****************************************************************************/ +/* Reset (Modem interface) */ + +gboolean +mm_shared_qmi_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +reset_set_operating_mode_reset_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageDmsSetOperatingModeOutput *output; + GError *error = NULL; + + output = qmi_client_dms_set_operating_mode_finish (client, res, &error); + if (!output || !qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { + g_task_return_error (task, error); + } else { + mm_info ("Modem is being rebooted now"); + g_task_return_boolean (task, TRUE); + } + + if (output) + qmi_message_dms_set_operating_mode_output_unref (output); + + g_object_unref (task); +} + +static void +reset_set_operating_mode_offline_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageDmsSetOperatingModeInput *input; + QmiMessageDmsSetOperatingModeOutput *output; + GError *error = NULL; + + output = qmi_client_dms_set_operating_mode_finish (client, res, &error); + if (!output) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_dms_set_operating_mode_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_dms_set_operating_mode_output_unref (output); + return; + } + + qmi_message_dms_set_operating_mode_output_unref (output); + + /* Now, go into reset mode. This will fully reboot the modem, and the current + * modem object should get disposed. */ + input = qmi_message_dms_set_operating_mode_input_new (); + qmi_message_dms_set_operating_mode_input_set_mode (input, QMI_DMS_OPERATING_MODE_RESET, NULL); + qmi_client_dms_set_operating_mode (client, + input, + 20, + NULL, + (GAsyncReadyCallback)reset_set_operating_mode_reset_ready, + task); + qmi_message_dms_set_operating_mode_input_unref (input); +} + +void +mm_shared_qmi_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiMessageDmsSetOperatingModeInput *input; + GTask *task; + QmiClient *client; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + /* Now, go into offline mode */ + input = qmi_message_dms_set_operating_mode_input_new (); + qmi_message_dms_set_operating_mode_input_set_mode (input, QMI_DMS_OPERATING_MODE_OFFLINE, NULL); + qmi_client_dms_set_operating_mode (QMI_CLIENT_DMS (client), + input, + 20, + NULL, + (GAsyncReadyCallback)reset_set_operating_mode_offline_ready, + task); + qmi_message_dms_set_operating_mode_input_unref (input); +} + +/*****************************************************************************/ +/* Factory reset (Modem interface) */ + +gboolean +mm_shared_qmi_factory_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +dms_restore_factory_defaults_ready (QmiClientDms *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageDmsRestoreFactoryDefaultsOutput *output = NULL; + GError *error = NULL; + + output = qmi_client_dms_restore_factory_defaults_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + } else if (!qmi_message_dms_restore_factory_defaults_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't restore factory defaults: "); + g_task_return_error (task, error); + } else + g_task_return_boolean (task, TRUE); + + if (output) + qmi_message_dms_restore_factory_defaults_output_unref (output); + + g_object_unref (task); +} + +void +mm_shared_qmi_factory_reset (MMIfaceModem *self, + const gchar *code, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiMessageDmsRestoreFactoryDefaultsInput *input; + GTask *task; + QmiClient *client = NULL; + GError *error = NULL; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_DMS, &client, + callback, user_data)) + return; + + task = g_task_new (self, NULL, callback, user_data); + + input = qmi_message_dms_restore_factory_defaults_input_new (); + if (!qmi_message_dms_restore_factory_defaults_input_set_service_programming_code ( + input, + code, + &error)) { + qmi_message_dms_restore_factory_defaults_input_unref (input); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("performing a factory reset..."); + qmi_client_dms_restore_factory_defaults (QMI_CLIENT_DMS (client), + input, + 10, + NULL, + (GAsyncReadyCallback)dms_restore_factory_defaults_ready, + task); +} + +/*****************************************************************************/ +/* Location: Set SUPL server */ + +typedef struct { + QmiClient *client; + gchar *supl; + glong indication_id; + guint timeout_id; +} SetSuplServerContext; + +static void +set_supl_server_context_free (SetSuplServerContext *ctx) +{ + if (ctx->client) { + if (ctx->timeout_id) + g_source_remove (ctx->timeout_id); + if (ctx->indication_id) + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + g_object_unref (ctx->client); + } + g_slice_free (SetSuplServerContext, ctx); +} + +static GArray * +parse_as_utf16_url (const gchar *supl) +{ + GArray *url; + gchar *utf16; + gsize utf16_len; + + utf16 = g_convert (supl, -1, "UTF-16BE", "UTF-8", NULL, &utf16_len, NULL); + url = g_array_append_vals (g_array_sized_new (FALSE, FALSE, sizeof (guint8), utf16_len), + utf16, utf16_len); + g_free (utf16); + return url; +} + +gboolean +mm_shared_qmi_location_set_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +pds_set_agps_config_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessagePdsSetAgpsConfigOutput *output; + GError *error = NULL; + + output = qmi_client_pds_set_agps_config_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_agps_config_output_get_result (output, &error)) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); + + qmi_message_pds_set_agps_config_output_unref (output); +} + +static void +pds_set_supl_server (GTask *task) +{ + MMSharedQmi *self; + SetSuplServerContext *ctx; + QmiMessagePdsSetAgpsConfigInput *input; + guint32 ip; + guint16 port; + GArray *url; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + input = qmi_message_pds_set_agps_config_input_new (); + + /* For multimode devices, prefer UMTS by default */ + if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + qmi_message_pds_set_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_UMTS, NULL); + else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) + qmi_message_pds_set_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_CDMA, NULL); + + if (mm_parse_supl_address (ctx->supl, NULL, &ip, &port, NULL)) + qmi_message_pds_set_agps_config_input_set_location_server_address (input, ip, port, NULL); + else { + url = parse_as_utf16_url (ctx->supl); + qmi_message_pds_set_agps_config_input_set_location_server_url (input, url, NULL); + g_array_unref (url); + } + + qmi_client_pds_set_agps_config ( + QMI_CLIENT_PDS (ctx->client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_set_agps_config_ready, + task); + qmi_message_pds_set_agps_config_input_unref (input); +} + +static gboolean +loc_location_set_server_indication_timed_out (GTask *task) +{ + SetSuplServerContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, + "Failed to receive indication with the server update result"); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void +loc_location_set_server_indication_cb (QmiClientLoc *client, + QmiIndicationLocSetServerOutput *output, + GTask *task) +{ + QmiLocIndicationStatus status; + GError *error = NULL; + + if (!qmi_indication_loc_set_server_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + mm_error_from_qmi_loc_indication_status (status, &error); + +out: + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +loc_set_server_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + SetSuplServerContext *ctx; + QmiMessageLocSetServerOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_set_server_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_set_server_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_set_server_output_unref (output); + return; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "set-server", + G_CALLBACK (loc_location_set_server_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_set_server_indication_timed_out, + task); + + qmi_message_loc_set_server_output_unref (output); +} + +static void +loc_set_supl_server (GTask *task) +{ + MMSharedQmi *self; + SetSuplServerContext *ctx; + QmiMessageLocSetServerInput *input; + guint32 ip; + guint16 port; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + input = qmi_message_loc_set_server_input_new (); + + /* For multimode devices, prefer UMTS by default */ + if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + qmi_message_loc_set_server_input_set_server_type (input, QMI_LOC_SERVER_TYPE_UMTS_SLP, NULL); + else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) + qmi_message_loc_set_server_input_set_server_type (input, QMI_LOC_SERVER_TYPE_CDMA_PDE, NULL); + + if (mm_parse_supl_address (ctx->supl, NULL, &ip, &port, NULL)) + qmi_message_loc_set_server_input_set_ipv4 (input, ip, (guint32) port, NULL); + else + qmi_message_loc_set_server_input_set_url (input, ctx->supl, NULL); + + qmi_client_loc_set_server ( + QMI_CLIENT_LOC (ctx->client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)loc_set_server_ready, + task); + qmi_message_loc_set_server_input_unref (input); +} + +void +mm_shared_qmi_location_set_supl_server (MMIfaceModemLocation *self, + const gchar *supl, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + SetSuplServerContext *ctx; + QmiClient *client = NULL; + + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_slice_new0 (SetSuplServerContext); + ctx->supl = g_strdup (supl); + g_task_set_task_data (task, ctx, (GDestroyNotify)set_supl_server_context_free); + + /* Prefer PDS */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_PDS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + pds_set_supl_server (task); + return; + } + + /* Otherwise LOC */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_LOC, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + loc_set_supl_server (task); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find any PDS/LOC client"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: Load SUPL server */ + +typedef struct { + QmiClient *client; + glong indication_id; + guint timeout_id; +} LoadSuplServerContext; + +static void +load_supl_server_context_free (LoadSuplServerContext *ctx) +{ + if (ctx->client) { + if (ctx->timeout_id) + g_source_remove (ctx->timeout_id); + if (ctx->indication_id) + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + g_object_unref (ctx->client); + } + g_slice_free (LoadSuplServerContext, ctx); +} + +gchar * +mm_shared_qmi_location_load_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +pds_get_agps_config_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessagePdsGetAgpsConfigOutput *output; + GError *error = NULL; + guint32 ip = 0; + guint32 port = 0; + GArray *url = NULL; + gchar *str = NULL; + + output = qmi_client_pds_get_agps_config_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + if (!qmi_message_pds_get_agps_config_output_get_result (output, &error)) + goto out; + + /* Prefer IP/PORT to URL */ + if (qmi_message_pds_get_agps_config_output_get_location_server_address ( + output, + &ip, + &port, + NULL) && + ip != 0 && + port != 0) { + struct in_addr a = { .s_addr = ip }; + gchar buf[INET_ADDRSTRLEN + 1]; + + memset (buf, 0, sizeof (buf)); + + if (!inet_ntop (AF_INET, &a, buf, sizeof (buf) - 1)) { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot convert numeric IP address (%u) to string", ip); + goto out; + } + + str = g_strdup_printf ("%s:%u", buf, port); + goto out; + } + + if (qmi_message_pds_get_agps_config_output_get_location_server_url ( + output, + &url, + NULL) && + url->len > 0) { + str = g_convert (url->data, url->len, "UTF-8", "UTF-16BE", NULL, NULL, NULL); + } + + if (!str) + str = g_strdup (""); + +out: + if (error) + g_task_return_error (task, error); + else { + g_assert (str); + g_task_return_pointer (task, str, g_free); + } + g_object_unref (task); + + if (output) + qmi_message_pds_get_agps_config_output_unref (output); +} + +static void +pds_load_supl_server (GTask *task) +{ + MMSharedQmi *self; + LoadSuplServerContext *ctx; + QmiMessagePdsGetAgpsConfigInput *input; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + input = qmi_message_pds_get_agps_config_input_new (); + + /* For multimode devices, prefer UMTS by default */ + if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + qmi_message_pds_get_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_UMTS, NULL); + else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) + qmi_message_pds_get_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_CDMA, NULL); + + qmi_client_pds_get_agps_config ( + QMI_CLIENT_PDS (ctx->client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_get_agps_config_ready, + task); + qmi_message_pds_get_agps_config_input_unref (input); +} + +static gboolean +loc_location_get_server_indication_timed_out (GTask *task) +{ + LoadSuplServerContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, + "Failed to receive indication with the current server settings"); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void +loc_location_get_server_indication_cb (QmiClientLoc *client, + QmiIndicationLocGetServerOutput *output, + GTask *task) +{ + QmiLocIndicationStatus status; + const gchar *url = NULL; + guint32 ipv4_address = 0; + guint16 ipv4_port = 0; + GError *error = NULL; + gchar *str = NULL; + + if (!qmi_indication_loc_get_server_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + if (!mm_error_from_qmi_loc_indication_status (status, &error)) + goto out; + + /* Prefer IP/PORT to URL */ + + if (qmi_indication_loc_get_server_output_get_ipv4 ( + output, + &ipv4_address, + &ipv4_port, + NULL) && + ipv4_address != 0 && ipv4_port != 0) { + struct in_addr a = { .s_addr = ipv4_address }; + gchar buf[INET_ADDRSTRLEN + 1]; + + memset (buf, 0, sizeof (buf)); + + if (!inet_ntop (AF_INET, &a, buf, sizeof (buf) - 1)) { + error = g_error_new (MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Cannot convert numeric IP address (%u) to string", ipv4_address); + goto out; + } + + str = g_strdup_printf ("%s:%u", buf, ipv4_port); + goto out; + } + + if (qmi_indication_loc_get_server_output_get_url ( + output, + &url, + NULL) && + url && url [0]) { + str = g_strdup (url); + } + + if (!str) + str = g_strdup (""); + +out: + if (error) + g_task_return_error (task, error); + else { + g_assert (str); + g_task_return_pointer (task, str, g_free); + } + g_object_unref (task); + +} + +static void +loc_get_server_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + LoadSuplServerContext *ctx; + QmiMessageLocGetServerOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_get_server_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_get_server_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_get_server_output_unref (output); + return; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "get-server", + G_CALLBACK (loc_location_get_server_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_get_server_indication_timed_out, + task); + + qmi_message_loc_get_server_output_unref (output); +} + +static void +loc_load_supl_server (GTask *task) +{ + MMSharedQmi *self; + LoadSuplServerContext *ctx; + QmiMessageLocGetServerInput *input; + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + input = qmi_message_loc_get_server_input_new (); + + /* For multimode devices, prefer UMTS by default */ + if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + qmi_message_loc_get_server_input_set_server_type (input, QMI_LOC_SERVER_TYPE_UMTS_SLP, NULL); + else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self))) + qmi_message_loc_get_server_input_set_server_type (input, QMI_LOC_SERVER_TYPE_CDMA_PDE, NULL); + + qmi_message_loc_get_server_input_set_server_address_type ( + input, + (QMI_LOC_SERVER_ADDRESS_TYPE_IPV4 | QMI_LOC_SERVER_ADDRESS_TYPE_URL), + NULL); + + qmi_client_loc_get_server ( + QMI_CLIENT_LOC (ctx->client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)loc_get_server_ready, + task); + qmi_message_loc_get_server_input_unref (input); +} + +void +mm_shared_qmi_location_load_supl_server (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiClient *client; + GTask *task; + LoadSuplServerContext *ctx; + + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_slice_new0 (LoadSuplServerContext); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_supl_server_context_free); + + /* Prefer PDS */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_PDS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + pds_load_supl_server (task); + return; + } + + /* Otherwise LOC */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_LOC, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + loc_load_supl_server (task); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find any PDS/LOC client"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: internal helper: stop gps engine */ + +static gboolean +stop_gps_engine_finish (MMSharedQmi *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +pds_gps_service_state_stop_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessagePdsSetGpsServiceStateOutput *output; + GError *error = NULL; + + output = qmi_client_pds_set_gps_service_state_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_gps_service_state_output_get_result (output, &error)) { + if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_prefix_error (&error, "Couldn't set GPS service state: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_set_gps_service_state_output_unref (output); + return; + } + + g_error_free (error); + } + + qmi_message_pds_set_gps_service_state_output_unref (output); + + self = g_task_get_source_object (task); + priv = get_private (self); + + if (priv->pds_client) { + if (priv->pds_location_event_report_indication_id != 0) { + g_signal_handler_disconnect (priv->pds_client, priv->pds_location_event_report_indication_id); + priv->pds_location_event_report_indication_id = 0; + } + g_clear_object (&priv->pds_client); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +loc_stop_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessageLocStopOutput *output; + GError *error = NULL; + + output = qmi_client_loc_stop_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_stop_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't stop GPS engine: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_stop_output_unref (output); + return; + } + + qmi_message_loc_stop_output_unref (output); + + self = g_task_get_source_object (task); + priv = get_private (self); + + if (priv->loc_client) { + if (priv->loc_location_nmea_indication_id != 0) { + g_signal_handler_disconnect (priv->loc_client, priv->loc_location_nmea_indication_id); + priv->loc_location_nmea_indication_id = 0; + } + g_clear_object (&priv->loc_client); + } + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +stop_gps_engine (MMSharedQmi *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + priv = get_private (self); + + task = g_task_new (self, NULL, callback, user_data); + + if (priv->pds_client) { + QmiMessagePdsSetGpsServiceStateInput *input; + + input = qmi_message_pds_set_gps_service_state_input_new (); + qmi_message_pds_set_gps_service_state_input_set_state (input, FALSE, NULL); + qmi_client_pds_set_gps_service_state ( + QMI_CLIENT_PDS (priv->pds_client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_gps_service_state_stop_ready, + task); + qmi_message_pds_set_gps_service_state_input_unref (input); + return; + } + + if (priv->loc_client) { + QmiMessageLocStopInput *input; + + input = qmi_message_loc_stop_input_new (); + qmi_message_loc_stop_input_set_session_id (input, DEFAULT_LOC_SESSION_ID, NULL); + qmi_client_loc_stop (QMI_CLIENT_LOC (priv->loc_client), + input, + 10, + NULL, + (GAsyncReadyCallback) loc_stop_ready, + task); + qmi_message_loc_stop_input_unref (input); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find any PDS/LOC client"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: internal helpers: NMEA indication callbacks */ + +static void +pds_location_event_report_indication_cb (QmiClientPds *client, + QmiIndicationPdsEventReportOutput *output, + MMSharedQmi *self) +{ + QmiPdsPositionSessionStatus session_status; + const gchar *nmea; + + if (qmi_indication_pds_event_report_output_get_position_session_status ( + output, + &session_status, + NULL)) { + mm_dbg ("[GPS] session status changed: '%s'", + qmi_pds_position_session_status_get_string (session_status)); + } + + if (qmi_indication_pds_event_report_output_get_nmea_position ( + output, + &nmea, + NULL)) { + mm_dbg ("[NMEA] %s", nmea); + mm_iface_modem_location_gps_update (MM_IFACE_MODEM_LOCATION (self), nmea); + } +} + +static void +loc_location_nmea_indication_cb (QmiClientLoc *client, + QmiIndicationLocNmeaOutput *output, + MMSharedQmi *self) +{ + const gchar *nmea = NULL; + + qmi_indication_loc_nmea_output_get_nmea_string (output, &nmea, NULL); + if (!nmea) + return; + + mm_dbg ("[NMEA] %s", nmea); + mm_iface_modem_location_gps_update (MM_IFACE_MODEM_LOCATION (self), nmea); +} + +/*****************************************************************************/ +/* Location: internal helper: start gps engine */ + +static gboolean +start_gps_engine_finish (MMSharedQmi *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +pds_ser_location_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessagePdsSetEventReportOutput *output; + GError *error = NULL; + + output = qmi_client_pds_set_event_report_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_event_report_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't set event report: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_set_event_report_output_unref (output); + return; + } + + qmi_message_pds_set_event_report_output_unref (output); + + self = g_task_get_source_object (task); + priv = get_private (self); + + g_assert (!priv->pds_client); + g_assert (priv->pds_location_event_report_indication_id == 0); + priv->pds_client = g_object_ref (client); + priv->pds_location_event_report_indication_id = + g_signal_connect (priv->pds_client, + "event-report", + G_CALLBACK (pds_location_event_report_indication_cb), + self); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +pds_auto_tracking_state_start_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessagePdsSetEventReportInput *input; + QmiMessagePdsSetAutoTrackingStateOutput *output = NULL; + GError *error = NULL; + + output = qmi_client_pds_set_auto_tracking_state_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_auto_tracking_state_output_get_result (output, &error)) { + if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_prefix_error (&error, "Couldn't set auto-tracking state: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_set_auto_tracking_state_output_unref (output); + return; + } + g_error_free (error); + } + + qmi_message_pds_set_auto_tracking_state_output_unref (output); + + /* Only gather standard NMEA traces */ + input = qmi_message_pds_set_event_report_input_new (); + qmi_message_pds_set_event_report_input_set_nmea_position_reporting (input, TRUE, NULL); + qmi_client_pds_set_event_report ( + client, + input, + 5, + NULL, + (GAsyncReadyCallback)pds_ser_location_ready, + task); + qmi_message_pds_set_event_report_input_unref (input); +} + +static void +pds_gps_service_state_start_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessagePdsSetAutoTrackingStateInput *input; + QmiMessagePdsSetGpsServiceStateOutput *output; + GError *error = NULL; + + output = qmi_client_pds_set_gps_service_state_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_gps_service_state_output_get_result (output, &error)) { + if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) { + g_prefix_error (&error, "Couldn't set GPS service state: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_set_gps_service_state_output_unref (output); + return; + } + g_error_free (error); + } + + qmi_message_pds_set_gps_service_state_output_unref (output); + + /* Enable auto-tracking for a continuous fix */ + input = qmi_message_pds_set_auto_tracking_state_input_new (); + qmi_message_pds_set_auto_tracking_state_input_set_state (input, TRUE, NULL); + qmi_client_pds_set_auto_tracking_state ( + client, + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_auto_tracking_state_start_ready, + task); + qmi_message_pds_set_auto_tracking_state_input_unref (input); +} + +static void +loc_register_events_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiMessageLocRegisterEventsOutput *output; + GError *error = NULL; + + output = qmi_client_loc_register_events_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_register_events_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't not register tracking events: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_register_events_output_unref (output); + return; + } + + qmi_message_loc_register_events_output_unref (output); + + self = g_task_get_source_object (task); + priv = get_private (self); + + g_assert (!priv->loc_client); + g_assert (!priv->loc_location_nmea_indication_id); + priv->loc_client = g_object_ref (client); + priv->loc_location_nmea_indication_id = + g_signal_connect (client, + "nmea", + G_CALLBACK (loc_location_nmea_indication_cb), + self); + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +loc_start_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageLocRegisterEventsInput *input; + QmiMessageLocStartOutput *output; + GError *error = NULL; + + output = qmi_client_loc_start_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_start_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't start GPS engine: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_start_output_unref (output); + return; + } + + qmi_message_loc_start_output_unref (output); + + input = qmi_message_loc_register_events_input_new (); + qmi_message_loc_register_events_input_set_event_registration_mask ( + input, QMI_LOC_EVENT_REGISTRATION_FLAG_NMEA, NULL); + qmi_client_loc_register_events (client, + input, + 10, + NULL, + (GAsyncReadyCallback) loc_register_events_ready, + task); + qmi_message_loc_register_events_input_unref (input); +} + +static void +start_gps_engine (MMSharedQmi *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + QmiClient *client; + GTask *task; + + task = g_task_new (self, NULL, callback, user_data); + + /* Prefer PDS */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_PDS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + QmiMessagePdsSetGpsServiceStateInput *input; + + input = qmi_message_pds_set_gps_service_state_input_new (); + qmi_message_pds_set_gps_service_state_input_set_state (input, TRUE, NULL); + qmi_client_pds_set_gps_service_state ( + QMI_CLIENT_PDS (client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_gps_service_state_start_ready, + task); + qmi_message_pds_set_gps_service_state_input_unref (input); + return; + } + + /* Otherwise LOC */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_LOC, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + QmiMessageLocStartInput *input; + + input = qmi_message_loc_start_input_new (); + qmi_message_loc_start_input_set_session_id (input, DEFAULT_LOC_SESSION_ID, NULL); + qmi_message_loc_start_input_set_intermediate_report_state (input, QMI_LOC_INTERMEDIATE_REPORT_STATE_DISABLE, NULL); + qmi_message_loc_start_input_set_minimum_interval_between_position_reports (input, 1000, NULL); + qmi_message_loc_start_input_set_fix_recurrence_type (input, QMI_LOC_FIX_RECURRENCE_TYPE_REQUEST_PERIODIC_FIXES, NULL); + qmi_client_loc_start (QMI_CLIENT_LOC (client), + input, + 10, + NULL, + (GAsyncReadyCallback) loc_start_ready, + task); + qmi_message_loc_start_input_unref (input); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find any PDS/LOC client"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: internal helper: select operation mode (assisted/standalone) */ + +typedef enum { + GPS_OPERATION_MODE_UNKNOWN, + GPS_OPERATION_MODE_STANDALONE, + GPS_OPERATION_MODE_ASSISTED, +} GpsOperationMode; + +typedef struct { + QmiClient *client; + GpsOperationMode mode; + glong indication_id; + guint timeout_id; +} SetGpsOperationModeContext; + +static void +set_gps_operation_mode_context_free (SetGpsOperationModeContext *ctx) +{ + if (ctx->client) { + if (ctx->timeout_id) + g_source_remove (ctx->timeout_id); + if (ctx->indication_id) + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + g_object_unref (ctx->client); + } + g_slice_free (SetGpsOperationModeContext, ctx); +} + +static gboolean +set_gps_operation_mode_finish (MMSharedQmi *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +pds_set_default_tracking_session_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + SetGpsOperationModeContext *ctx; + QmiMessagePdsSetDefaultTrackingSessionOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_pds_set_default_tracking_session_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_set_default_tracking_session_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't set default tracking session: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_set_default_tracking_session_output_unref (output); + return; + } + + qmi_message_pds_set_default_tracking_session_output_unref (output); + + mm_dbg ("A-GPS %s", ctx->mode == GPS_OPERATION_MODE_ASSISTED ? "enabled" : "disabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +pds_get_default_tracking_session_ready (QmiClientPds *client, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self; + SetGpsOperationModeContext *ctx; + QmiMessagePdsSetDefaultTrackingSessionInput *input; + QmiMessagePdsGetDefaultTrackingSessionOutput *output; + GError *error = NULL; + QmiPdsOperatingMode session_operation; + guint8 data_timeout; + guint32 interval; + guint32 accuracy_threshold; + + output = qmi_client_pds_get_default_tracking_session_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_pds_get_default_tracking_session_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't get default tracking session: "); + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_pds_get_default_tracking_session_output_unref (output); + return; + } + + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + + qmi_message_pds_get_default_tracking_session_output_get_info ( + output, + &session_operation, + &data_timeout, + &interval, + &accuracy_threshold, + NULL); + + qmi_message_pds_get_default_tracking_session_output_unref (output); + + if (ctx->mode == GPS_OPERATION_MODE_ASSISTED) { + if (session_operation == QMI_PDS_OPERATING_MODE_MS_ASSISTED) { + mm_dbg ("A-GPS already enabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + mm_dbg ("Need to enable A-GPS"); + session_operation = QMI_PDS_OPERATING_MODE_MS_ASSISTED; + } else if (ctx->mode == GPS_OPERATION_MODE_STANDALONE) { + if (session_operation == QMI_PDS_OPERATING_MODE_STANDALONE) { + mm_dbg ("A-GPS already disabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + mm_dbg ("Need to disable A-GPS"); + session_operation = QMI_PDS_OPERATING_MODE_STANDALONE; + } else + g_assert_not_reached (); + + input = qmi_message_pds_set_default_tracking_session_input_new (); + qmi_message_pds_set_default_tracking_session_input_set_info ( + input, + session_operation, + data_timeout, + interval, + accuracy_threshold, + NULL); + qmi_client_pds_set_default_tracking_session ( + client, + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_set_default_tracking_session_ready, + task); + qmi_message_pds_set_default_tracking_session_input_unref (input); +} + +static gboolean +loc_location_operation_mode_indication_timed_out (GTask *task) +{ + SetGpsOperationModeContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, + "Failed to receive operation mode indication"); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void +loc_location_set_operation_mode_indication_cb (QmiClientLoc *client, + QmiIndicationLocSetOperationModeOutput *output, + GTask *task) +{ + SetGpsOperationModeContext *ctx; + QmiLocIndicationStatus status; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + if (!qmi_indication_loc_set_operation_mode_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!mm_error_from_qmi_loc_indication_status (status, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + mm_dbg ("A-GPS %s", ctx->mode == GPS_OPERATION_MODE_ASSISTED ? "enabled" : "disabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +loc_set_operation_mode_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + SetGpsOperationModeContext *ctx; + QmiMessageLocSetOperationModeOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_set_operation_mode_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_set_operation_mode_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_set_operation_mode_output_unref (output); + return; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "set-operation-mode", + G_CALLBACK (loc_location_set_operation_mode_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_operation_mode_indication_timed_out, + task); + + qmi_message_loc_set_operation_mode_output_unref (output); +} + +static void +loc_location_get_operation_mode_indication_cb (QmiClientLoc *client, + QmiIndicationLocGetOperationModeOutput *output, + GTask *task) +{ + SetGpsOperationModeContext *ctx; + QmiLocIndicationStatus status; + GError *error = NULL; + QmiLocOperationMode mode = QMI_LOC_OPERATION_MODE_DEFAULT; + QmiMessageLocSetOperationModeInput *input; + + ctx = g_task_get_task_data (task); + + if (!qmi_indication_loc_get_operation_mode_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!mm_error_from_qmi_loc_indication_status (status, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + qmi_indication_loc_get_operation_mode_output_get_operation_mode (output, &mode, NULL); + + if (ctx->mode == GPS_OPERATION_MODE_ASSISTED) { + if (mode == QMI_LOC_OPERATION_MODE_MSA) { + mm_dbg ("A-GPS already enabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + mm_dbg ("Need to enable A-GPS"); + mode = QMI_LOC_OPERATION_MODE_MSA; + } else if (ctx->mode == GPS_OPERATION_MODE_STANDALONE) { + if (mode == QMI_LOC_OPERATION_MODE_STANDALONE) { + mm_dbg ("A-GPS already disabled"); + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + mm_dbg ("Need to disable A-GPS"); + mode = QMI_LOC_OPERATION_MODE_STANDALONE; + } else + g_assert_not_reached (); + + if (ctx->timeout_id) { + g_source_remove (ctx->timeout_id); + ctx->timeout_id = 0; + } + + if (ctx->indication_id) { + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + ctx->indication_id = 0; + } + + input = qmi_message_loc_set_operation_mode_input_new (); + qmi_message_loc_set_operation_mode_input_set_operation_mode (input, mode, NULL); + qmi_client_loc_set_operation_mode ( + QMI_CLIENT_LOC (ctx->client), + input, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)loc_set_operation_mode_ready, + task); + qmi_message_loc_set_operation_mode_input_unref (input); +} + +static void +loc_get_operation_mode_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + SetGpsOperationModeContext *ctx; + QmiMessageLocGetOperationModeOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_get_operation_mode_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_get_operation_mode_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_get_operation_mode_output_unref (output); + return; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "get-operation-mode", + G_CALLBACK (loc_location_get_operation_mode_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_operation_mode_indication_timed_out, + task); + + qmi_message_loc_get_operation_mode_output_unref (output); +} + +static void +set_gps_operation_mode (MMSharedQmi *self, + GpsOperationMode mode, + GAsyncReadyCallback callback, + gpointer user_data) +{ + SetGpsOperationModeContext *ctx; + GTask *task; + QmiClient *client; + + task = g_task_new (self, NULL, callback, user_data); + + ctx = g_slice_new0 (SetGpsOperationModeContext); + ctx->mode = mode; + g_task_set_task_data (task, ctx, (GDestroyNotify)set_gps_operation_mode_context_free); + + /* Prefer PDS */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_PDS, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + qmi_client_pds_get_default_tracking_session ( + QMI_CLIENT_PDS (ctx->client), + NULL, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)pds_get_default_tracking_session_ready, + task); + return; + } + + /* Otherwise LOC */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), + QMI_SERVICE_LOC, + MM_PORT_QMI_FLAG_DEFAULT, + NULL); + if (client) { + ctx->client = g_object_ref (client); + qmi_client_loc_get_operation_mode ( + QMI_CLIENT_LOC (ctx->client), + NULL, + 10, + NULL, /* cancellable */ + (GAsyncReadyCallback)loc_get_operation_mode_ready, + task); + return; + } + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't find any PDS/LOC client"); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: disable */ + +gboolean +mm_shared_qmi_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +stop_gps_engine_ready (MMSharedQmi *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource source; + Private *priv; + GError *error = NULL; + + if (!stop_gps_engine_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + source = (MMModemLocationSource) GPOINTER_TO_UINT (g_task_get_task_data (task)); + priv = get_private (self); + + priv->enabled_sources &= ~source; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +set_gps_operation_mode_standalone_ready (MMSharedQmi *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + Private *priv; + + if (!set_gps_operation_mode_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + priv = get_private (self); + + priv->enabled_sources &= ~MM_MODEM_LOCATION_SOURCE_AGPS; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_qmi_disable_location_gathering (MMIfaceModemLocation *_self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMSharedQmi *self; + Private *priv; + GTask *task; + MMModemLocationSource tmp; + + self = MM_SHARED_QMI (_self); + priv = get_private (self); + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + /* NOTE: no parent disable_location_gathering() implementation */ + + if (!(source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS))) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + g_assert (!(priv->pds_client && priv->loc_client)); + + /* Disable A-GPS? */ + if (source == MM_MODEM_LOCATION_SOURCE_AGPS) { + set_gps_operation_mode (self, + GPS_OPERATION_MODE_STANDALONE, + (GAsyncReadyCallback)set_gps_operation_mode_standalone_ready, + task); + return; + } + + /* If no more GPS sources enabled, stop GPS */ + tmp = priv->enabled_sources; + tmp &= ~source; + if (!(tmp & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW))) { + stop_gps_engine (self, + (GAsyncReadyCallback)stop_gps_engine_ready, + task); + return; + } + + /* Otherwise, we have more GPS sources enabled, we shouldn't stop GPS, just + * return */ + priv->enabled_sources &= ~source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: enable */ + +gboolean +mm_shared_qmi_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static void +start_gps_engine_ready (MMSharedQmi *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource source; + Private *priv; + GError *error = NULL; + + if (!start_gps_engine_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + source = (MMModemLocationSource) GPOINTER_TO_UINT (g_task_get_task_data (task)); + priv = get_private (self); + + priv->enabled_sources |= source; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +set_gps_operation_mode_assisted_ready (MMSharedQmi *self, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + Private *priv; + + if (!set_gps_operation_mode_finish (self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + priv = get_private (self); + + priv->enabled_sources |= MM_MODEM_LOCATION_SOURCE_AGPS; + + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +static void +parent_enable_location_gathering_ready (MMIfaceModemLocation *_self, + GAsyncResult *res, + GTask *task) +{ + MMSharedQmi *self = MM_SHARED_QMI (_self); + Private *priv; + MMModemLocationSource source; + GError *error = NULL; + + priv = get_private (self); + + if (!priv->iface_modem_location_parent->enable_location_gathering_finish (_self, res, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + source = (MMModemLocationSource) GPOINTER_TO_UINT (g_task_get_task_data (task)); + + /* We only consider GPS related sources in this shared QMI implementation */ + if (!(source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS))) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + /* Enabling A-GPS? */ + if (source == MM_MODEM_LOCATION_SOURCE_AGPS) { + set_gps_operation_mode (self, + GPS_OPERATION_MODE_ASSISTED, + (GAsyncReadyCallback)set_gps_operation_mode_assisted_ready, + task); + return; + } + + /* Only start GPS engine if not done already */ + if (!(priv->enabled_sources & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | MM_MODEM_LOCATION_SOURCE_GPS_RAW))) { + start_gps_engine (self, + (GAsyncReadyCallback)start_gps_engine_ready, + task); + return; + } + + /* GPS already started, we're done */ + priv->enabled_sources |= source; + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + +void +mm_shared_qmi_enable_location_gathering (MMIfaceModemLocation *self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, GUINT_TO_POINTER (source), NULL); + + priv = get_private (MM_SHARED_QMI (self)); + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->enable_location_gathering); + g_assert (priv->iface_modem_location_parent->enable_location_gathering_finish); + + /* Chain up parent's gathering enable */ + priv->iface_modem_location_parent->enable_location_gathering ( + self, + source, + (GAsyncReadyCallback)parent_enable_location_gathering_ready, + task); +} + +/*****************************************************************************/ +/* Location: load capabilities */ + +MMModemLocationSource +mm_shared_qmi_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_SOURCE_NONE; + } + return (MMModemLocationSource)value; +} + +static void +parent_load_capabilities_ready (MMIfaceModemLocation *self, + GAsyncResult *res, + GTask *task) +{ + MMModemLocationSource sources; + GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_QMI (self)); + + sources = priv->iface_modem_location_parent->load_capabilities_finish (self, res, &error); + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + /* Now our own checks */ + + /* If we have support for the PDS client, GPS and A-GPS location is supported */ + if (mm_shared_qmi_peek_client (MM_SHARED_QMI (self), QMI_SERVICE_PDS, MM_PORT_QMI_FLAG_DEFAULT, NULL)) + sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS); + + /* If we have support for the LOC client, GPS location is supported */ + if (mm_shared_qmi_peek_client (MM_SHARED_QMI (self), QMI_SERVICE_LOC, MM_PORT_QMI_FLAG_DEFAULT, NULL)) + sources |= (MM_MODEM_LOCATION_SOURCE_GPS_NMEA | + MM_MODEM_LOCATION_SOURCE_GPS_RAW | + MM_MODEM_LOCATION_SOURCE_AGPS); + + /* So we're done, complete */ + g_task_return_int (task, sources); + g_object_unref (task); +} + +void +mm_shared_qmi_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + Private *priv; + + task = g_task_new (self, NULL, callback, user_data); + + priv = get_private (MM_SHARED_QMI (self)); + g_assert (priv->iface_modem_location_parent); + g_assert (priv->iface_modem_location_parent->load_capabilities); + g_assert (priv->iface_modem_location_parent->load_capabilities_finish); + + priv->iface_modem_location_parent->load_capabilities (self, + (GAsyncReadyCallback)parent_load_capabilities_ready, + task); +} + +/*****************************************************************************/ +/* Location: load supported assistance data */ + +gchar ** +mm_shared_qmi_location_load_assistance_data_servers_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +void +mm_shared_qmi_location_load_assistance_data_servers (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + Private *priv; + GTask *task; + + priv = get_private (MM_SHARED_QMI (self)); + + task = g_task_new (self, NULL, callback, user_data); + g_task_return_pointer (task, g_strdupv (priv->loc_assistance_data_servers), (GDestroyNotify) g_strfreev); + g_object_unref (task); +} + +/*****************************************************************************/ +/* Location: load supported assistance data */ + +typedef struct { + QmiClientLoc *client; + glong indication_id; + guint timeout_id; +} LoadSupportedAssistanceDataContext; + +static void +load_supported_assistance_data_context_free (LoadSupportedAssistanceDataContext *ctx) +{ + if (ctx->client) { + if (ctx->timeout_id) + g_source_remove (ctx->timeout_id); + if (ctx->indication_id) + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + g_object_unref (ctx->client); + } + g_slice_free (LoadSupportedAssistanceDataContext, ctx); +} + +MMModemLocationAssistanceDataType +mm_shared_qmi_location_load_supported_assistance_data_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + GError *inner_error = NULL; + gssize value; + + value = g_task_propagate_int (G_TASK (res), &inner_error); + if (inner_error) { + g_propagate_error (error, inner_error); + return MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE; + } + return (MMModemLocationAssistanceDataType)value; +} + +static gboolean +loc_location_get_predicted_orbits_data_source_indication_timed_out (GTask *task) +{ + LoadSupportedAssistanceDataContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, + "Failed to receive indication with the predicted orbits data source"); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void +loc_location_get_predicted_orbits_data_source_indication_cb (QmiClientLoc *client, + QmiIndicationLocGetPredictedOrbitsDataSourceOutput *output, + GTask *task) +{ + MMSharedQmi *self; + Private *priv; + QmiLocIndicationStatus status; + GError *error = NULL; + GArray *server_list = NULL; + gboolean supported = FALSE; + + if (!qmi_indication_loc_get_predicted_orbits_data_source_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + if (!mm_error_from_qmi_loc_indication_status (status, &error)) + goto out; + + self = g_task_get_source_object (task); + priv = get_private (self); + + if (qmi_indication_loc_get_predicted_orbits_data_source_output_get_server_list ( + output, + &server_list, + NULL) && + server_list->len > 0) { + guint i; + GPtrArray *tmp; + + tmp = g_ptr_array_sized_new (server_list->len + 1); + for (i = 0; i < server_list->len; i++) { + const gchar *server; + + server = g_array_index (server_list, gchar *, i); + g_ptr_array_add (tmp, g_strdup (server)); + } + g_ptr_array_add (tmp, NULL); + + g_assert (!priv->loc_assistance_data_servers); + priv->loc_assistance_data_servers = (gchar **) g_ptr_array_free (tmp, FALSE); + + supported = TRUE; + } + + if (qmi_indication_loc_get_predicted_orbits_data_source_output_get_allowed_sizes ( + output, + &priv->loc_assistance_data_max_file_size, + &priv->loc_assistance_data_max_part_size, + NULL) && + priv->loc_assistance_data_max_file_size > 0 && + priv->loc_assistance_data_max_part_size > 0) { + supported = TRUE; + } + +out: + if (error) + g_task_return_error (task, error); + else if (!supported) + g_task_return_int (task, MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE); + else + g_task_return_int (task, MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_XTRA); + g_object_unref (task); +} + +static void +loc_location_get_predicted_orbits_data_source_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + LoadSupportedAssistanceDataContext *ctx; + QmiMessageLocGetPredictedOrbitsDataSourceOutput *output; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_get_predicted_orbits_data_source_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + if (!qmi_message_loc_get_predicted_orbits_data_source_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + qmi_message_loc_get_predicted_orbits_data_source_output_unref (output); + return; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "get-predicted-orbits-data-source", + G_CALLBACK (loc_location_get_predicted_orbits_data_source_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_get_predicted_orbits_data_source_indication_timed_out, + task); + + qmi_message_loc_get_predicted_orbits_data_source_output_unref (output); +} + +void +mm_shared_qmi_location_load_supported_assistance_data (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + LoadSupportedAssistanceDataContext *ctx; + GTask *task; + QmiClient *client; + + task = g_task_new (self, NULL, callback, user_data); + + /* If no LOC client, no assistance data right away */ + client = mm_shared_qmi_peek_client (MM_SHARED_QMI (self), QMI_SERVICE_LOC, MM_PORT_QMI_FLAG_DEFAULT, NULL); + if (!client) { + g_task_return_int (task, MM_MODEM_LOCATION_ASSISTANCE_DATA_TYPE_NONE); + g_object_unref (task); + return; + } + + ctx = g_slice_new0 (LoadSupportedAssistanceDataContext); + ctx->client = g_object_ref (client); + g_task_set_task_data (task, ctx, (GDestroyNotify)load_supported_assistance_data_context_free); + + qmi_client_loc_get_predicted_orbits_data_source (ctx->client, + NULL, + 10, + NULL, + (GAsyncReadyCallback)loc_location_get_predicted_orbits_data_source_ready, + task); +} + +/*****************************************************************************/ +/* Location: inject assistance data */ + +#define MAX_BYTES_PER_REQUEST 1024 + +typedef struct { + QmiClientLoc *client; + guint8 *data; + goffset data_size; + gulong total_parts; + guint32 part_size; + glong indication_id; + guint timeout_id; + goffset i; + gulong n_part; +} InjectAssistanceDataContext; + +static void +inject_assistance_data_context_free (InjectAssistanceDataContext *ctx) +{ + if (ctx->client) { + if (ctx->timeout_id) + g_source_remove (ctx->timeout_id); + if (ctx->indication_id) + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + g_object_unref (ctx->client); + } + g_free (ctx->data); + g_slice_free (InjectAssistanceDataContext, ctx); +} + +gboolean +mm_shared_qmi_location_inject_assistance_data_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + +static gboolean +loc_location_inject_data_indication_timed_out (GTask *task) +{ + InjectAssistanceDataContext *ctx; + + ctx = g_task_get_task_data (task); + ctx->timeout_id = 0; + + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_ABORTED, + "Failed to receive indication with the server update result"); + g_object_unref (task); + return G_SOURCE_REMOVE; +} + +static void inject_xtra_data_next (GTask *task); + +static void +loc_location_inject_xtra_data_indication_cb (QmiClientLoc *client, + QmiIndicationLocInjectXtraDataOutput *output, + GTask *task) +{ + InjectAssistanceDataContext *ctx; + QmiLocIndicationStatus status; + GError *error = NULL; + + if (!qmi_indication_loc_inject_xtra_data_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + mm_error_from_qmi_loc_indication_status (status, &error); + +out: + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + ctx = g_task_get_task_data (task); + + g_source_remove (ctx->timeout_id); + ctx->timeout_id = 0; + + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + ctx->indication_id = 0; + + inject_xtra_data_next (task); +} + +static void +inject_xtra_data_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageLocInjectXtraDataOutput *output; + InjectAssistanceDataContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_inject_xtra_data_finish (client, res, &error); + if (!output || !qmi_message_loc_inject_xtra_data_output_get_result (output, &error)) { + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "inject-xtra-data", + G_CALLBACK (loc_location_inject_xtra_data_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_inject_data_indication_timed_out, + task); +out: + if (output) + qmi_message_loc_inject_xtra_data_output_unref (output); +} + +static void +inject_xtra_data_next (GTask *task) +{ + QmiMessageLocInjectXtraDataInput *input; + InjectAssistanceDataContext *ctx; + goffset total_bytes_left; + gsize count; + GArray *data; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->data_size >= ctx->i); + total_bytes_left = ctx->data_size - ctx->i; + if (total_bytes_left == 0) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx->n_part++; + count = (total_bytes_left >= ctx->part_size) ? ctx->part_size : total_bytes_left; + + input = qmi_message_loc_inject_xtra_data_input_new (); + qmi_message_loc_inject_xtra_data_input_set_total_size ( + input, + (guint32)ctx->data_size, + NULL); + qmi_message_loc_inject_xtra_data_input_set_total_parts ( + input, + (guint16)ctx->total_parts, + NULL); + qmi_message_loc_inject_xtra_data_input_set_part_number ( + input, + (guint16)ctx->n_part, + NULL); + data = g_array_append_vals (g_array_sized_new (FALSE, FALSE, sizeof (guint8), count), &(ctx->data[ctx->i]), count); + qmi_message_loc_inject_xtra_data_input_set_part_data ( + input, + data, + NULL); + g_array_unref (data); + + ctx->i += count; + + mm_info ("injecting xtra data: %" G_GSIZE_FORMAT " bytes (%u/%u)", + count, (guint) ctx->n_part, (guint) ctx->total_parts); + qmi_client_loc_inject_xtra_data (ctx->client, + input, + 10, + NULL, + (GAsyncReadyCallback) inject_xtra_data_ready, + task); + + qmi_message_loc_inject_xtra_data_input_unref (input); +} + +static void +inject_xtra_data (GTask *task) +{ + InjectAssistanceDataContext *ctx; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->timeout_id == 0); + g_assert (ctx->indication_id == 0); + + ctx->n_part = 0; + ctx->i = 0; + + inject_xtra_data_next (task); +} + +static void inject_assistance_data_next (GTask *task); + +static void +loc_location_inject_predicted_orbits_data_indication_cb (QmiClientLoc *client, + QmiIndicationLocInjectPredictedOrbitsDataOutput *output, + GTask *task) +{ + InjectAssistanceDataContext *ctx; + QmiLocIndicationStatus status; + GError *error = NULL; + + if (!qmi_indication_loc_inject_predicted_orbits_data_output_get_indication_status (output, &status, &error)) { + g_prefix_error (&error, "QMI operation failed: "); + goto out; + } + + mm_error_from_qmi_loc_indication_status (status, &error); + +out: + if (error) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + ctx = g_task_get_task_data (task); + + g_source_remove (ctx->timeout_id); + ctx->timeout_id = 0; + + g_signal_handler_disconnect (ctx->client, ctx->indication_id); + ctx->indication_id = 0; + + inject_assistance_data_next (task); +} + +static void +inject_predicted_orbits_data_ready (QmiClientLoc *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageLocInjectPredictedOrbitsDataOutput *output; + InjectAssistanceDataContext *ctx; + GError *error = NULL; + + ctx = g_task_get_task_data (task); + + output = qmi_client_loc_inject_predicted_orbits_data_finish (client, res, &error); + if (!output || !qmi_message_loc_inject_predicted_orbits_data_output_get_result (output, &error)) { + /* Try with InjectXtra if InjectPredictedOrbits is unsupported */ + if (g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NOT_SUPPORTED)) { + g_error_free (error); + inject_xtra_data (task); + goto out; + } + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + g_object_unref (task); + goto out; + } + + /* The task ownership is shared between signal and timeout; the one which is + * scheduled first will cancel the other. */ + ctx->indication_id = g_signal_connect (ctx->client, + "inject-predicted-orbits-data", + G_CALLBACK (loc_location_inject_predicted_orbits_data_indication_cb), + task); + ctx->timeout_id = g_timeout_add_seconds (10, + (GSourceFunc)loc_location_inject_data_indication_timed_out, + task); +out: + if (output) + qmi_message_loc_inject_predicted_orbits_data_output_unref (output); +} + +static void +inject_assistance_data_next (GTask *task) +{ + QmiMessageLocInjectPredictedOrbitsDataInput *input; + InjectAssistanceDataContext *ctx; + goffset total_bytes_left; + gsize count; + GArray *data; + + ctx = g_task_get_task_data (task); + + g_assert (ctx->data_size >= ctx->i); + total_bytes_left = ctx->data_size - ctx->i; + if (total_bytes_left == 0) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + + ctx->n_part++; + count = (total_bytes_left >= ctx->part_size) ? ctx->part_size : total_bytes_left; + + input = qmi_message_loc_inject_predicted_orbits_data_input_new (); + qmi_message_loc_inject_predicted_orbits_data_input_set_format_type ( + input, + QMI_LOC_PREDICTED_ORBITS_DATA_FORMAT_XTRA, + NULL); + qmi_message_loc_inject_predicted_orbits_data_input_set_total_size ( + input, + (guint32)ctx->data_size, + NULL); + qmi_message_loc_inject_predicted_orbits_data_input_set_total_parts ( + input, + (guint16)ctx->total_parts, + NULL); + qmi_message_loc_inject_predicted_orbits_data_input_set_part_number ( + input, + (guint16)ctx->n_part, + NULL); + data = g_array_append_vals (g_array_sized_new (FALSE, FALSE, sizeof (guint8), count), &(ctx->data[ctx->i]), count); + qmi_message_loc_inject_predicted_orbits_data_input_set_part_data ( + input, + data, + NULL); + g_array_unref (data); + + ctx->i += count; + + mm_info ("injecting predicted orbits data: %" G_GSIZE_FORMAT " bytes (%u/%u)", + count, (guint) ctx->n_part, (guint) ctx->total_parts); + qmi_client_loc_inject_predicted_orbits_data (ctx->client, + input, + 10, + NULL, + (GAsyncReadyCallback) inject_predicted_orbits_data_ready, + task); + + qmi_message_loc_inject_predicted_orbits_data_input_unref (input); +} + +void +mm_shared_qmi_location_inject_assistance_data (MMIfaceModemLocation *self, + const guint8 *data, + gsize data_size, + GAsyncReadyCallback callback, + gpointer user_data) +{ + InjectAssistanceDataContext *ctx; + QmiClient *client; + GTask *task; + Private *priv; + + if (!mm_shared_qmi_ensure_client (MM_SHARED_QMI (self), + QMI_SERVICE_LOC, &client, + callback, user_data)) + return; + + priv = get_private (MM_SHARED_QMI (self)); + + task = g_task_new (self, NULL, callback, user_data); + ctx = g_slice_new0 (InjectAssistanceDataContext); + ctx->client = g_object_ref (client); + ctx->data = g_memdup (data, data_size); + ctx->data_size = data_size; + ctx->part_size = ((priv->loc_assistance_data_max_part_size > 0) ? priv->loc_assistance_data_max_part_size : MAX_BYTES_PER_REQUEST); + g_task_set_task_data (task, ctx, (GDestroyNotify) inject_assistance_data_context_free); + + if ((ctx->data_size > (G_MAXUINT16 * ctx->part_size)) || + ((priv->loc_assistance_data_max_file_size > 0) && (ctx->data_size > priv->loc_assistance_data_max_file_size))) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_TOO_MANY, + "Assistance data file is too big"); + g_object_unref (task); + return; + } + + ctx->total_parts = (ctx->data_size / ctx->part_size); + if (ctx->data_size % ctx->part_size) + ctx->total_parts++; + g_assert (ctx->total_parts <= G_MAXUINT16); + + mm_dbg ("Injecting gpsOneXTRA data (%" G_GOFFSET_FORMAT " bytes)...", ctx->data_size); + + inject_assistance_data_next (task); +} + +/*****************************************************************************/ + +QmiClient * +mm_shared_qmi_peek_client (MMSharedQmi *self, + QmiService service, + MMPortQmiFlag flag, + GError **error) +{ + g_assert (MM_SHARED_QMI_GET_INTERFACE (self)->peek_client); + return MM_SHARED_QMI_GET_INTERFACE (self)->peek_client (self, service, flag, error); +} + +gboolean +mm_shared_qmi_ensure_client (MMSharedQmi *self, + QmiService service, + QmiClient **o_client, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GError *error = NULL; + QmiClient *client; + + client = mm_shared_qmi_peek_client (self, service, MM_PORT_QMI_FLAG_DEFAULT, &error); + if (!client) { + g_task_report_error (self, callback, user_data, mm_shared_qmi_ensure_client, error); + return FALSE; + } + + *o_client = client; + return TRUE; +} + +static void +shared_qmi_init (gpointer g_iface) +{ +} + +GType +mm_shared_qmi_get_type (void) +{ + static GType shared_qmi_type = 0; + + if (!G_UNLIKELY (shared_qmi_type)) { + static const GTypeInfo info = { + sizeof (MMSharedQmi), /* class_size */ + shared_qmi_init, /* base_init */ + NULL, /* base_finalize */ + }; + + shared_qmi_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedQmi", &info, 0); + g_type_interface_add_prerequisite (shared_qmi_type, MM_TYPE_IFACE_MODEM); + g_type_interface_add_prerequisite (shared_qmi_type, MM_TYPE_IFACE_MODEM_3GPP); + g_type_interface_add_prerequisite (shared_qmi_type, MM_TYPE_IFACE_MODEM_LOCATION); + } + + return shared_qmi_type; +} diff -Nru modemmanager-1.6.8/src/mm-shared-qmi.h modemmanager-1.10.0/src/mm-shared-qmi.h --- modemmanager-1.6.8/src/mm-shared-qmi.h 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/mm-shared-qmi.h 2019-01-15 15:57:35.000000000 +0100 @@ -0,0 +1,207 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2018 Aleksander Morgado + */ + +#ifndef MM_SHARED_QMI_H +#define MM_SHARED_QMI_H + +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +#include + +#include "mm-iface-modem.h" +#include "mm-iface-modem-3gpp.h" +#include "mm-iface-modem-location.h" +#include "mm-port-qmi.h" + +#define MM_TYPE_SHARED_QMI (mm_shared_qmi_get_type ()) +#define MM_SHARED_QMI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_QMI, MMSharedQmi)) +#define MM_IS_SHARED_QMI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_QMI)) +#define MM_SHARED_QMI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_QMI, MMSharedQmi)) + +typedef struct _MMSharedQmi MMSharedQmi; + +struct _MMSharedQmi { + GTypeInterface g_iface; + + QmiClient * (* peek_client) (MMSharedQmi *self, + QmiService service, + MMPortQmiFlag flag, + GError **error); + + /* Peek location interface of the parent class of the object */ + MMIfaceModemLocation * (* peek_parent_location_interface) (MMSharedQmi *self); +}; + +GType mm_shared_qmi_get_type (void); + +QmiClient *mm_shared_qmi_peek_client (MMSharedQmi *self, + QmiService service, + MMPortQmiFlag flag, + GError **error); + +gboolean mm_shared_qmi_ensure_client (MMSharedQmi *self, + QmiService service, + QmiClient **o_client, + GAsyncReadyCallback callback, + gpointer user_data); + +/* Shared QMI 3GPP operations */ + +void mm_shared_qmi_3gpp_register_in_network (MMIfaceModem3gpp *self, + const gchar *operator_id, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_3gpp_register_in_network_finish (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + +/* Shared QMI device management support */ + +void mm_shared_qmi_load_supported_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_supported_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_current_capabilities (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemCapability mm_shared_qmi_load_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_set_current_capabilities (MMIfaceModem *self, + MMModemCapability capabilities, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_set_current_capabilities_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_supported_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_supported_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_current_modes (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_load_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + MMModemMode *allowed, + MMModemMode *preferred, + GError **error); +void mm_shared_qmi_set_current_modes (MMIfaceModem *self, + MMModemMode allowed, + MMModemMode preferred, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_set_current_modes_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_supported_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_supported_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_load_current_bands (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +GArray *mm_shared_qmi_load_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_set_current_bands (MMIfaceModem *self, + GArray *bands_array, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_set_current_bands_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_reset (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_factory_reset (MMIfaceModem *self, + const gchar *code, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_factory_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + +/* Shared QMI location support */ + +void mm_shared_qmi_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemLocationSource mm_shared_qmi_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_enable_location_gathering (MMIfaceModemLocation *_self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_enable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_disable_location_gathering (MMIfaceModemLocation *_self, + MMModemLocationSource source, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_disable_location_gathering_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_location_load_supl_server (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +gchar *mm_shared_qmi_location_load_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_location_set_supl_server (MMIfaceModemLocation *self, + const gchar *supl, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_location_set_supl_server_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_location_load_supported_assistance_data (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +MMModemLocationAssistanceDataType mm_shared_qmi_location_load_supported_assistance_data_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_location_inject_assistance_data (MMIfaceModemLocation *self, + const guint8 *data, + gsize data_size, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_shared_qmi_location_inject_assistance_data_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); +void mm_shared_qmi_location_load_assistance_data_servers (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data); +gchar **mm_shared_qmi_location_load_assistance_data_servers_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error); + +#endif /* MM_SHARED_QMI_H */ diff -Nru modemmanager-1.6.8/src/mm-sim-mbim.c modemmanager-1.10.0/src/mm-sim-mbim.c --- modemmanager-1.6.8/src/mm-sim-mbim.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sim-mbim.c 2018-11-15 09:55:53.000000000 +0100 @@ -25,7 +25,9 @@ #include #include "mm-error-helpers.h" +#include "mm-iface-modem.h" #include "mm-log.h" +#include "mm-modem-helpers-mbim.h" #include "mm-sim-mbim.h" G_DEFINE_TYPE (MMSimMbim, mm_sim_mbim, MM_TYPE_BASE_SIM) @@ -50,12 +52,13 @@ g_object_unref (modem); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek MBIM port"); + g_task_report_new_error (self, + callback, + user_data, + peek_device, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek MBIM port"); return FALSE; } @@ -63,6 +66,29 @@ return TRUE; } +static void +update_modem_unlock_retries (MMSimMbim *self, + MbimPinType pin_type, + guint32 remaining_attempts) +{ + MMBaseModem *modem = NULL; + MMUnlockRetries *unlock_retries; + + g_object_get (G_OBJECT (self), + MM_BASE_SIM_MODEM, &modem, + NULL); + g_assert (MM_IS_BASE_MODEM (modem)); + + unlock_retries = mm_unlock_retries_new (); + mm_unlock_retries_set (unlock_retries, + mm_modem_lock_from_mbim_pin_type (pin_type), + remaining_attempts); + mm_iface_modem_update_unlock_retries (MM_IFACE_MODEM (modem), + unlock_retries); + g_object_unref (unlock_retries); + g_object_unref (modem); +} + /*****************************************************************************/ /* Load SIM identifier */ @@ -71,15 +97,13 @@ GAsyncResult *res, GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return g_strdup ((gchar *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void simid_subscriber_ready_state_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -97,14 +121,13 @@ NULL, /* telephone_numbers_count */ NULL, /* telephone_numbers */ &error)) - g_simple_async_result_set_op_res_gpointer (simple, sim_iccid, (GDestroyNotify)g_free); + g_task_return_pointer (task, sim_iccid, g_free); else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -114,12 +137,12 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, load_sim_identifier); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_subscriber_ready_status_query_new (NULL); mbim_device_command (device, @@ -127,7 +150,7 @@ 10, NULL, (GAsyncReadyCallback)simid_subscriber_ready_state_ready, - result); + task); mbim_message_unref (message); } @@ -136,18 +159,16 @@ static gchar * load_imsi_finish (MMBaseSim *self, - GAsyncResult *res, - GError **error) + GAsyncResult *res, + GError **error) { - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - return g_strdup ((gchar *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); + return g_task_propagate_pointer (G_TASK (res), error); } static void imsi_subscriber_ready_state_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -165,14 +186,13 @@ NULL, /* telephone_numbers_count */ NULL, /* telephone_numbers */ &error)) - g_simple_async_result_set_op_res_gpointer (simple, subscriber_id, (GDestroyNotify)g_free); + g_task_return_pointer (task, subscriber_id, g_free); else - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -182,12 +202,12 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, load_imsi); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_subscriber_ready_status_query_new (NULL); mbim_device_command (device, @@ -195,7 +215,7 @@ 10, NULL, (GAsyncReadyCallback)imsi_subscriber_ready_state_ready, - result); + task); mbim_message_unref (message); } @@ -207,19 +227,13 @@ GAsyncResult *res, GError **error) { - MbimProvider *provider; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - provider = (MbimProvider *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - return g_strdup (provider->provider_id); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_operator_identifier_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -231,15 +245,15 @@ mbim_message_home_provider_response_parse ( response, &provider, - &error)) - g_simple_async_result_set_op_res_gpointer (simple, provider, (GDestroyNotify)mbim_provider_free); - else - g_simple_async_result_take_error (simple, error); + &error)) { + g_task_return_pointer (task, g_strdup (provider->provider_id), g_free); + mbim_provider_free (provider); + } else + g_task_return_error (task, error); + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -249,12 +263,12 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, load_operator_identifier); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_home_provider_query_new (NULL); mbim_device_command (device, @@ -262,7 +276,7 @@ 10, NULL, (GAsyncReadyCallback)load_operator_identifier_ready, - result); + task); mbim_message_unref (message); } @@ -274,19 +288,13 @@ GAsyncResult *res, GError **error) { - MbimProvider *provider; - - if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) - return NULL; - - provider = (MbimProvider *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); - return g_strdup (provider->provider_name); + return g_task_propagate_pointer (G_TASK (res), error); } static void load_operator_name_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { MbimMessage *response; GError *error = NULL; @@ -298,15 +306,15 @@ mbim_message_home_provider_response_parse ( response, &provider, - &error)) - g_simple_async_result_set_op_res_gpointer (simple, provider, (GDestroyNotify)mbim_provider_free); - else - g_simple_async_result_take_error (simple, error); + &error)) { + g_task_return_pointer (task, g_strdup (provider->provider_name), g_free); + mbim_provider_free (provider); + } else + g_task_return_error (task, error); + g_object_unref (task); if (response) mbim_message_unref (response); - g_simple_async_result_complete (simple); - g_object_unref (simple); } static void @@ -316,12 +324,12 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, load_operator_name); + task = g_task_new (self, NULL, callback, user_data); message = mbim_message_home_provider_query_new (NULL); mbim_device_command (device, @@ -329,7 +337,7 @@ 10, NULL, (GAsyncReadyCallback)load_operator_name_ready, - result); + task); mbim_message_unref (message); } @@ -341,48 +349,55 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void pin_set_enter_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + MMSimMbim *self; GError *error = NULL; MbimMessage *response; + gboolean success; MbimPinType pin_type; MbimPinState pin_state; + guint32 remaining_attempts; + + self = g_task_get_source_object (task); response = mbim_device_command_finish (device, res, &error); - if (response && - !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { - /* Sending PIN failed, build a better error to report */ - if (mbim_message_pin_response_parse ( - response, - &pin_type, - &pin_state, - NULL, - NULL)) { - /* Create the errors ourselves */ - if (pin_type == MBIM_PIN_TYPE_PIN1 && pin_state == MBIM_PIN_STATE_LOCKED) { - g_error_free (error); - error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD); - } else if (pin_type == MBIM_PIN_TYPE_PUK1 && pin_state == MBIM_PIN_STATE_LOCKED) { - g_error_free (error); - error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK); + if (response) { + success = mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + if (mbim_message_pin_response_parse (response, + &pin_type, + &pin_state, + &remaining_attempts, + NULL)) { + update_modem_unlock_retries (self, pin_type, remaining_attempts); + + if (!success) { + /* Sending PIN failed, build a better error to report */ + if (pin_type == MBIM_PIN_TYPE_PIN1 && pin_state == MBIM_PIN_STATE_LOCKED) { + g_error_free (error); + error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD); + } else if (pin_type == MBIM_PIN_TYPE_PUK1 && pin_state == MBIM_PIN_STATE_LOCKED) { + g_error_free (error); + error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK); + } } } + + mbim_message_unref (response); } if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); - if (response) - mbim_message_unref (response); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -393,13 +408,13 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, send_pin); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("Sending PIN..."); message = (mbim_message_pin_set_new ( @@ -409,9 +424,8 @@ "", &error)); if (!message) { - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -420,7 +434,7 @@ 10, NULL, (GAsyncReadyCallback)pin_set_enter_ready, - result); + task); mbim_message_unref (message); } @@ -432,49 +446,55 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void puk_set_enter_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + MMSimMbim *self; GError *error = NULL; MbimMessage *response; + gboolean success; MbimPinType pin_type; MbimPinState pin_state; guint32 remaining_attempts; + self = g_task_get_source_object (task); + response = mbim_device_command_finish (device, res, &error); - if (response && - !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { - /* Sending PUK failed, build a better error to report */ - if (mbim_message_pin_response_parse ( - response, - &pin_type, - &pin_state, - &remaining_attempts, - NULL)) { - /* Create the errors ourselves */ - if (pin_type == MBIM_PIN_TYPE_PUK1 && pin_state == MBIM_PIN_STATE_LOCKED) { - g_error_free (error); - if (remaining_attempts == 0) - error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG); - else - error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD); + if (response) { + success = mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + if (mbim_message_pin_response_parse (response, + &pin_type, + &pin_state, + &remaining_attempts, + NULL)) { + update_modem_unlock_retries (self, pin_type, remaining_attempts); + + if (!success) { + /* Sending PUK failed, build a better error to report */ + if (pin_type == MBIM_PIN_TYPE_PUK1 && pin_state == MBIM_PIN_STATE_LOCKED) { + g_error_free (error); + if (remaining_attempts == 0) + error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG); + else + error = mm_mobile_equipment_error_for_code (MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD); + } } } + + mbim_message_unref (response); } if (error) - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); - if (response) - mbim_message_unref (response); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -486,13 +506,13 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, send_puk); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("Sending PUK..."); message = (mbim_message_pin_set_new ( @@ -502,9 +522,8 @@ new_pin, &error)); if (!message) { - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -513,7 +532,7 @@ 10, NULL, (GAsyncReadyCallback)puk_set_enter_ready, - result); + task); mbim_message_unref (message); } @@ -525,20 +544,33 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void pin_set_enable_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + MMSimMbim *self; GError *error = NULL; MbimMessage *response; + MbimPinType pin_type; + guint32 remaining_attempts; + + self = g_task_get_source_object (task); response = mbim_device_command_finish (device, res, &error); if (response) { mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + if (mbim_message_pin_response_parse (response, + &pin_type, + NULL, + &remaining_attempts, + NULL)) + update_modem_unlock_retries (self, pin_type, remaining_attempts); + mbim_message_unref (response); } @@ -550,11 +582,10 @@ "Need to be unlocked to allow enabling/disabling PIN"); } - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -566,13 +597,13 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, send_puk); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("%s PIN ...", enabled ? "Enabling" : "Disabling"); message = (mbim_message_pin_set_new ( @@ -582,9 +613,8 @@ "", &error)); if (!message) { - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -593,7 +623,7 @@ 10, NULL, (GAsyncReadyCallback)pin_set_enable_ready, - result); + task); mbim_message_unref (message); } @@ -605,20 +635,33 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static void pin_set_change_ready (MbimDevice *device, GAsyncResult *res, - GSimpleAsyncResult *simple) + GTask *task) { + MMSimMbim *self; GError *error = NULL; MbimMessage *response; + MbimPinType pin_type; + guint32 remaining_attempts; + + self = g_task_get_source_object (task); response = mbim_device_command_finish (device, res, &error); if (response) { mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error); + + if (mbim_message_pin_response_parse (response, + &pin_type, + NULL, + &remaining_attempts, + NULL)) + update_modem_unlock_retries (self, pin_type, remaining_attempts); + mbim_message_unref (response); } @@ -630,11 +673,10 @@ "Need to be unlocked to allow changing PIN"); } - g_simple_async_result_take_error (simple, error); + g_task_return_error (task, error); } else - g_simple_async_result_set_op_res_gboolean (simple, TRUE); - g_simple_async_result_complete (simple); - g_object_unref (simple); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void @@ -646,13 +688,13 @@ { MbimDevice *device; MbimMessage *message; - GSimpleAsyncResult *result; + GTask *task; GError *error = NULL; if (!peek_device (self, &device, callback, user_data)) return; - result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, send_puk); + task = g_task_new (self, NULL, callback, user_data); mm_dbg ("Changing PIN"); message = (mbim_message_pin_set_new ( @@ -662,9 +704,8 @@ new_pin, &error)); if (!message) { - g_simple_async_result_take_error (result, error); - g_simple_async_result_complete_in_idle (result); - g_object_unref (result); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -673,7 +714,7 @@ 10, NULL, (GAsyncReadyCallback)pin_set_change_ready, - result); + task); mbim_message_unref (message); } diff -Nru modemmanager-1.6.8/src/mm-sim-qmi.c modemmanager-1.10.0/src/mm-sim-qmi.c --- modemmanager-1.6.8/src/mm-sim-qmi.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sim-qmi.c 2019-01-15 15:57:35.000000000 +0100 @@ -91,6 +91,106 @@ /*****************************************************************************/ /* Load SIM ID (ICCID) */ +static GArray * +uim_read_finish (QmiClientUim *client, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_pointer (G_TASK (res), error); +} + +static void +uim_read_ready (QmiClientUim *client, + GAsyncResult *res, + GTask *task) +{ + QmiMessageUimReadTransparentOutput *output; + GError *error = NULL; + + output = qmi_client_uim_read_transparent_finish (client, res, &error); + if (!output) { + g_prefix_error (&error, "QMI operation failed: "); + g_task_return_error (task, error); + } else if (!qmi_message_uim_read_transparent_output_get_result (output, &error)) { + g_prefix_error (&error, "Couldn't read data from UIM: "); + g_task_return_error (task, error); + } else { + GArray *read_result = NULL; + + qmi_message_uim_read_transparent_output_get_read_result (output, &read_result, NULL); + if (read_result) + g_task_return_pointer (task, + g_array_ref (read_result), + (GDestroyNotify) g_array_unref); + else + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Read malformed data from UIM"); + } + + if (output) + qmi_message_uim_read_transparent_output_unref (output); + + g_object_unref (task); +} + +static void +uim_read (MMSimQmi *self, + guint16 file_id, + const guint16 *file_path, + gsize file_path_len, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GTask *task; + QmiClient *client = NULL; + GArray *file_path_bytes; + gsize i; + QmiMessageUimReadTransparentInput *input; + + task = g_task_new (self, NULL, callback, user_data); + + if (!ensure_qmi_client (task, + self, + QMI_SERVICE_UIM, &client)) + return; + + file_path_bytes = g_array_sized_new (FALSE, FALSE, 1, file_path_len * 2); + for (i = 0; i < file_path_len; ++i) { + guint8 byte; + + byte = file_path[i] & 0xFF; + g_array_append_val (file_path_bytes, byte); + byte = (file_path[i] >> 8) & 0xFF; + g_array_append_val (file_path_bytes, byte); + } + + input = qmi_message_uim_read_transparent_input_new (); + qmi_message_uim_read_transparent_input_set_session_information ( + input, + QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING, + "", + NULL); + qmi_message_uim_read_transparent_input_set_file (input, + file_id, + file_path_bytes, + NULL); + qmi_message_uim_read_transparent_input_set_read_information (input, + 0, + 0, + NULL); + g_array_unref (file_path_bytes); + + qmi_client_uim_read_transparent (QMI_CLIENT_UIM (client), + input, + 10, + NULL, + (GAsyncReadyCallback)uim_read_ready, + task); + qmi_message_uim_read_transparent_input_unref (input); +} + static gchar * load_sim_identifier_finish (MMBaseSim *self, GAsyncResult *res, @@ -100,6 +200,44 @@ } static void +uim_get_iccid_ready (QmiClientUim *client, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + GArray *read_result; + gchar *iccid; + + read_result = uim_read_finish (client, res, &error); + if (!read_result) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + iccid = mm_bcd_to_string ((const guint8 *) read_result->data, read_result->len); + g_assert (iccid); + g_task_return_pointer (task, iccid, g_free); + g_object_unref (task); + + g_array_unref (read_result); +} + +static void +uim_get_iccid (MMSimQmi *self, + GTask *task) +{ + static const guint16 file_path[] = { 0x3F00 }; + + uim_read (self, + 0x2FE2, + file_path, + G_N_ELEMENTS (file_path), + (GAsyncReadyCallback)uim_get_iccid_ready, + task); +} + +static void dms_uim_get_iccid_ready (QmiClientDms *client, GAsyncResult *res, GTask *task) @@ -118,7 +256,7 @@ const gchar *str = NULL; qmi_message_dms_uim_get_iccid_output_get_iccid (output, &str, NULL); - g_task_return_pointer (task, g_strdup (str), (GDestroyNotify) g_free); + g_task_return_pointer (task, g_strdup (str), g_free); } if (output) @@ -128,20 +266,16 @@ } static void -load_sim_identifier (MMBaseSim *self, - GAsyncReadyCallback callback, - gpointer user_data) +dms_uim_get_iccid (MMSimQmi *self, + GTask *task) { - GTask *task; QmiClient *client = NULL; - task = g_task_new (self, NULL, callback, user_data); if (!ensure_qmi_client (task, - MM_SIM_QMI (self), + self, QMI_SERVICE_DMS, &client)) return; - mm_dbg ("loading SIM identifier..."); qmi_client_dms_uim_get_iccid (QMI_CLIENT_DMS (client), NULL, 5, @@ -150,6 +284,24 @@ task); } +static void +load_sim_identifier (MMBaseSim *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMSimQmi *self; + GTask *task; + + self = MM_SIM_QMI (_self); + task = g_task_new (self, NULL, callback, user_data); + + mm_dbg ("loading SIM identifier..."); + if (!self->priv->dms_uim_deprecated) + dms_uim_get_iccid (self, task); + else + uim_get_iccid (self, task); +} + /*****************************************************************************/ /* Load IMSI */ @@ -162,6 +314,55 @@ } static void +uim_get_imsi_ready (QmiClientUim *client, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + GArray *read_result; + gchar *imsi; + + read_result = uim_read_finish (client, res, &error); + if (!read_result) { + g_task_return_error (task, error); + g_object_unref (task); + return; + } + + imsi = mm_bcd_to_string ((const guint8 *) read_result->data, read_result->len); + g_assert (imsi); + if (strlen (imsi) < 3) + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "IMSI is malformed"); + else + /* EFimsi contains a length byte, follwed by a nibble for parity, + * and then followed by the actual IMSI in BCD. After converting + * the BCD into a decimal string, we simply skip the first 3 + * decimal digits to obtain the IMSI. */ + g_task_return_pointer (task, g_strdup (imsi + 3), g_free); + g_object_unref (task); + + g_free (imsi); + g_array_unref (read_result); +} + +static void +uim_get_imsi (MMSimQmi *self, + GTask *task) +{ + static const guint16 file_path[] = { 0x3F00, 0x7FFF }; + + uim_read (self, + 0x6F07, + file_path, + G_N_ELEMENTS (file_path), + (GAsyncReadyCallback)uim_get_imsi_ready, + task); +} + +static void dms_uim_get_imsi_ready (QmiClientDms *client, GAsyncResult *res, GTask *task) @@ -180,7 +381,7 @@ const gchar *str = NULL; qmi_message_dms_uim_get_imsi_output_get_imsi (output, &str, NULL); - g_task_return_pointer (task, g_strdup (str), (GDestroyNotify) g_free); + g_task_return_pointer (task, g_strdup (str), g_free); } if (output) @@ -190,20 +391,16 @@ } static void -load_imsi (MMBaseSim *self, - GAsyncReadyCallback callback, - gpointer user_data) +dms_uim_get_imsi (MMSimQmi *self, + GTask *task) { - GTask *task; QmiClient *client = NULL; - task = g_task_new (self, NULL, callback, user_data); if (!ensure_qmi_client (task, - MM_SIM_QMI (self), + self, QMI_SERVICE_DMS, &client)) return; - mm_dbg ("loading IMSI..."); qmi_client_dms_uim_get_imsi (QMI_CLIENT_DMS (client), NULL, 5, @@ -212,6 +409,24 @@ task); } +static void +load_imsi (MMBaseSim *_self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + MMSimQmi *self; + GTask *task; + + self = MM_SIM_QMI (_self); + task = g_task_new (self, NULL, callback, user_data); + + mm_dbg ("loading IMSI..."); + if (!self->priv->dms_uim_deprecated) + dms_uim_get_imsi (self, task); + else + uim_get_imsi (self, task); +} + /*****************************************************************************/ /* Load operator identifier */ @@ -304,7 +519,7 @@ g_string_append_printf (aux, "%.3" G_GUINT16_FORMAT, mnc); else g_string_append_printf (aux, "%.2" G_GUINT16_FORMAT, mnc); - g_task_return_pointer (task, g_string_free (aux, FALSE), (GDestroyNotify) g_free); + g_task_return_pointer (task, g_string_free (aux, FALSE), g_free); g_object_unref (task); } @@ -353,7 +568,7 @@ if (!get_home_network (client, res, NULL, NULL, NULL, &operator_name, &error)) g_task_return_error (task, error); else - g_task_return_pointer (task, operator_name, (GDestroyNotify) g_free); + g_task_return_pointer (task, operator_name, g_free); g_object_unref (task); } @@ -449,7 +664,7 @@ QmiClient *client = NULL; if (!ensure_qmi_client (task, - MM_SIM_QMI (self), + self, QMI_SERVICE_UIM, &client)) return; @@ -480,9 +695,6 @@ { QmiMessageDmsUimVerifyPinOutput *output = NULL; GError *error = NULL; - MMSimQmi *self; - - self = g_task_get_source_object (task); output = qmi_client_dms_uim_verify_pin_finish (client, res, &error); if (!output) { @@ -507,7 +719,7 @@ QmiClient *client = NULL; if (!ensure_qmi_client (NULL, - MM_SIM_QMI (self), + self, QMI_SERVICE_DMS, &client)) { /* Very unlikely that this will ever happen, but anyway, try with * UIM service instead */ @@ -543,7 +755,7 @@ self = MM_SIM_QMI (_self); task = g_task_new (self, NULL, callback, user_data); - g_task_set_task_data (task, g_strdup (pin), (GDestroyNotify) g_free); + g_task_set_task_data (task, g_strdup (pin), g_free); mm_dbg ("Verifying PIN..."); if (!self->priv->dms_uim_deprecated) @@ -608,7 +820,7 @@ UnblockPinContext *ctx; if (!ensure_qmi_client (task, - MM_SIM_QMI (self), + self, QMI_SERVICE_UIM, &client)) return; @@ -642,9 +854,6 @@ { QmiMessageDmsUimUnblockPinOutput *output = NULL; GError *error = NULL; - MMSimQmi *self; - - self = g_task_get_source_object (task); output = qmi_client_dms_uim_unblock_pin_finish (client, res, &error); if (!output) { @@ -670,7 +879,7 @@ UnblockPinContext *ctx; if (!ensure_qmi_client (NULL, - MM_SIM_QMI (self), + self, QMI_SERVICE_DMS, &client)) { /* Very unlikely that this will ever happen, but anyway, try with * UIM service instead */ @@ -778,7 +987,7 @@ ChangePinContext *ctx; if (!ensure_qmi_client (task, - MM_SIM_QMI (self), + self, QMI_SERVICE_UIM, &client)) return; @@ -812,9 +1021,6 @@ { QmiMessageDmsUimChangePinOutput *output = NULL; GError *error = NULL; - MMSimQmi *self; - - self = g_task_get_source_object (task); output = qmi_client_dms_uim_change_pin_finish (client, res, &error); if (!output) { @@ -840,7 +1046,7 @@ ChangePinContext *ctx; if (!ensure_qmi_client (NULL, - MM_SIM_QMI (self), + self, QMI_SERVICE_DMS, &client)) { /* Very unlikely that this will ever happen, but anyway, try with * UIM service instead */ @@ -981,9 +1187,6 @@ { QmiMessageDmsUimSetPinProtectionOutput *output = NULL; GError *error = NULL; - MMSimQmi *self; - - self = g_task_get_source_object (task); output = qmi_client_dms_uim_set_pin_protection_finish (client, res, &error); if (!output) { diff -Nru modemmanager-1.6.8/src/mm-sms-list.c modemmanager-1.10.0/src/mm-sms-list.c --- modemmanager-1.6.8/src/mm-sms-list.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-list.c 2018-11-15 09:55:53.000000000 +0100 @@ -113,28 +113,12 @@ /*****************************************************************************/ -typedef struct { - MMSmsList *self; - GSimpleAsyncResult *result; - gchar *path; -} DeleteSmsContext; - -static void -delete_sms_context_complete_and_free (DeleteSmsContext *ctx) -{ - g_simple_async_result_complete (ctx->result); - g_object_unref (ctx->result); - g_object_unref (ctx->self); - g_free (ctx->path); - g_free (ctx); -} - gboolean mm_sms_list_delete_sms_finish (MMSmsList *self, GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } static guint @@ -147,25 +131,29 @@ static void delete_ready (MMBaseSms *sms, GAsyncResult *res, - DeleteSmsContext *ctx) + GTask *task) { + MMSmsList *self; + const gchar *path; GError *error = NULL; GList *l; if (!mm_base_sms_delete_finish (sms, res, &error)) { /* We report the error */ - g_simple_async_result_take_error (ctx->result, error); - delete_sms_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + path = g_task_get_task_data (task); /* The SMS was properly deleted, we now remove it from our list */ - l = g_list_find_custom (ctx->self->priv->list, - ctx->path, + l = g_list_find_custom (self->priv->list, + path, (GCompareFunc)cmp_sms_by_path); if (l) { g_object_unref (MM_BASE_SMS (l->data)); - ctx->self->priv->list = g_list_delete_link (ctx->self->priv->list, l); + self->priv->list = g_list_delete_link (self->priv->list, l); } /* We don't need to unref the SMS any more, but we can use the @@ -173,12 +161,12 @@ * during the async operation. */ mm_base_sms_unexport (sms); - g_signal_emit (ctx->self, + g_signal_emit (self, signals[SIGNAL_DELETED], 0, - ctx->path); + path); - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - delete_sms_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); } void @@ -187,35 +175,31 @@ GAsyncReadyCallback callback, gpointer user_data) { - DeleteSmsContext *ctx; GList *l; + GTask *task; l = g_list_find_custom (self->priv->list, (gpointer)sms_path, (GCompareFunc)cmp_sms_by_path); if (!l) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_NOT_FOUND, - "No SMS found with path '%s'", - sms_path); + g_task_report_new_error (self, + callback, + user_data, + mm_sms_list_delete_sms, + MM_CORE_ERROR, + MM_CORE_ERROR_NOT_FOUND, + "No SMS found with path '%s'", + sms_path); return; } /* Delete all SMS parts */ - ctx = g_new0 (DeleteSmsContext, 1); - ctx->self = g_object_ref (self); - ctx->path = g_strdup (sms_path); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - mm_sms_list_delete_sms); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, g_strdup (sms_path), g_free); mm_base_sms_delete (MM_BASE_SMS (l->data), (GAsyncReadyCallback)delete_ready, - ctx); + task); } /*****************************************************************************/ @@ -344,11 +328,6 @@ MMSmsStorage storage, GError **error) { - PartIndexAndStorage ctx; - - ctx.part_index = mm_sms_part_get_index (part); - ctx.storage = storage; - /* Ensure we don't have already taken a part with the same index */ if (mm_sms_list_has_part (self, storage, @@ -450,7 +429,7 @@ MMSmsList *self = MM_SMS_LIST (object); g_clear_object (&self->priv->modem); - g_list_free_full (self->priv->list, (GDestroyNotify)g_object_unref); + g_list_free_full (self->priv->list, g_object_unref); self->priv->list = NULL; G_OBJECT_CLASS (mm_sms_list_parent_class)->dispose (object); diff -Nru modemmanager-1.6.8/src/mm-sms-mbim.c modemmanager-1.10.0/src/mm-sms-mbim.c --- modemmanager-1.6.8/src/mm-sms-mbim.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-mbim.c 2018-11-15 09:55:53.000000000 +0100 @@ -53,12 +53,13 @@ port = mm_base_modem_peek_port_mbim (modem); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek MBIM port"); + g_task_report_new_error (self, + callback, + user_data, + peek_device, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek MBIM port"); g_object_unref (modem); return FALSE; } @@ -74,21 +75,16 @@ /* Send the SMS */ typedef struct { - MMBaseSms *self; MMBaseModem *modem; MbimDevice *device; - GSimpleAsyncResult *result; GList *current; } SmsSendContext; static void -sms_send_context_complete_and_free (SmsSendContext *ctx) +sms_send_context_free (SmsSendContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->device); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SmsSendContext, ctx); } @@ -97,20 +93,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void sms_send_next_part (SmsSendContext *ctx); +static void sms_send_next_part (GTask *task); static void sms_send_set_ready (MbimDevice *device, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; MbimMessage *response; GError *error = NULL; guint32 message_reference; + ctx = g_task_get_task_data (task); response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) && @@ -127,19 +125,20 @@ if (error) { g_prefix_error (&error, "Couldn't send SMS part: "); - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on with next part */ ctx->current = g_list_next (ctx->current); - sms_send_next_part (ctx); + sms_send_next_part (task); } static void -sms_send_next_part (SmsSendContext *ctx) +sms_send_next_part (GTask *task) { + SmsSendContext *ctx; MbimMessage *message; guint8 *pdu; guint pdulen = 0; @@ -147,18 +146,19 @@ GError *error = NULL; MbimSmsPduSendRecord send_record; + ctx = g_task_get_task_data (task); if (!ctx->current) { /* Done we are */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_send_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Get PDU */ pdu = mm_sms_part_3gpp_get_submit_pdu ((MMSmsPart *)ctx->current->data, &pdulen, &msgstart, &error); if (!pdu) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -174,7 +174,7 @@ 30, NULL, (GAsyncReadyCallback)sms_send_set_ready, - ctx); + task); mbim_message_unref (message); g_free (pdu); } @@ -186,45 +186,39 @@ { SmsSendContext *ctx; MbimDevice *device; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; /* Setup the context */ ctx = g_slice_new0 (SmsSendContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_send); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device); g_object_get (self, MM_BASE_SMS_MODEM, &ctx->modem, NULL); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_send_context_free); + ctx->current = mm_base_sms_get_parts (self);; - sms_send_next_part (ctx); + sms_send_next_part (task); } /*****************************************************************************/ typedef struct { - MMBaseSms *self; MMBaseModem *modem; MbimDevice *device; - GSimpleAsyncResult *result; GList *current; guint n_failed; } SmsDeletePartsContext; static void -sms_delete_parts_context_complete_and_free (SmsDeletePartsContext *ctx) +sms_delete_parts_context_free (SmsDeletePartsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->device); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SmsDeletePartsContext, ctx); } @@ -233,19 +227,21 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void delete_next_part (SmsDeletePartsContext *ctx); +static void delete_next_part (GTask *task); static void sms_delete_set_ready (MbimDevice *device, GAsyncResult *res, - SmsDeletePartsContext *ctx) + GTask *task) { + SmsDeletePartsContext *ctx; MbimMessage *response; GError *error = NULL; + ctx = g_task_get_task_data (task); response = mbim_device_command_finish (device, res, &error); if (response && mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) @@ -266,14 +262,16 @@ mm_sms_part_set_index ((MMSmsPart *)ctx->current->data, SMS_PART_INVALID_INDEX); ctx->current = g_list_next (ctx->current); - delete_next_part (ctx); + delete_next_part (task); } static void -delete_next_part (SmsDeletePartsContext *ctx) +delete_next_part (GTask *task) { + SmsDeletePartsContext *ctx; MbimMessage *message; + ctx = g_task_get_task_data (task); /* Skip non-stored parts */ while (ctx->current && mm_sms_part_get_index ((MMSmsPart *)ctx->current->data) == SMS_PART_INVALID_INDEX) @@ -282,15 +280,15 @@ /* If all removed, we're done */ if (!ctx->current) { if (ctx->n_failed > 0) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't delete %u parts from this SMS", - ctx->n_failed); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't delete %u parts from this SMS", + ctx->n_failed); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - sms_delete_parts_context_complete_and_free (ctx); + g_object_unref (task); return; } @@ -302,7 +300,7 @@ 10, NULL, (GAsyncReadyCallback)sms_delete_set_ready, - ctx); + task); mbim_message_unref (message); } @@ -314,24 +312,23 @@ { SmsDeletePartsContext *ctx; MbimDevice *device; + GTask *task; if (!peek_device (self, &device, callback, user_data)) return; ctx = g_slice_new0 (SmsDeletePartsContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_delete); - ctx->self = g_object_ref (self); ctx->device = g_object_ref (device); g_object_get (self, MM_BASE_SMS_MODEM, &ctx->modem, NULL); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_delete_parts_context_free); + /* Go on deleting parts */ ctx->current = mm_base_sms_get_parts (self); - delete_next_part (ctx); + delete_next_part (task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/src/mm-sms-part-3gpp.c modemmanager-1.10.0/src/mm-sms-part-3gpp.c --- modemmanager-1.6.8/src/mm-sms-part-3gpp.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-part-3gpp.c 2018-11-15 09:55:53.000000000 +0100 @@ -23,6 +23,7 @@ #define _LIBMM_INSIDE_MM #include +#include "mm-helper-enums-types.h" #include "mm-sms-part-3gpp.h" #include "mm-charsets.h" #include "mm-log.h" @@ -132,10 +133,10 @@ if (addrtype == SMS_NUMBER_TYPE_ALPHA) { guint8 *unpacked; guint32 unpacked_len; - unpacked = gsm_unpack (address, (len * 4) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (address, (len * 4) / 7, 0, &unpacked_len); utf8 = (char *)mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len); - g_free(unpacked); + g_free (unpacked); } else if (addrtype == SMS_NUMBER_TYPE_INTL && addrplan == SMS_NUMBER_PLAN_TELEPHONE) { /* International telphone number, format as "+1234567890" */ @@ -241,17 +242,38 @@ guint32 unpacked_len; if (encoding == MM_SMS_ENCODING_GSM7) { - mm_dbg ("Converting SMS part text from GSM7 to UTF8..."); - unpacked = gsm_unpack ((const guint8 *) text, len, bit_offset, &unpacked_len); + mm_dbg ("Converting SMS part text from GSM-7 to UTF-8..."); + unpacked = mm_charset_gsm_unpack ((const guint8 *) text, len, bit_offset, &unpacked_len); utf8 = (char *) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len); mm_dbg (" Got UTF-8 text: '%s'", utf8); g_free (unpacked); } else if (encoding == MM_SMS_ENCODING_UCS2) { - mm_dbg ("Converting SMS part text from UCS-2BE to UTF8..."); - utf8 = g_convert ((char *) text, len, "UTF8", "UCS-2BE", NULL, NULL, NULL); - mm_dbg (" Got UTF-8 text: '%s'", utf8); + /* Despite 3GPP TS 23.038 specifies that Unicode SMS messages are + * encoded in UCS-2, UTF-16 encoding is commonly used instead on many + * modern platforms to allow encoding code points that fall outside the + * Basic Multilingual Plane (BMP), such as Emoji. Most of the UCS-2 + * code points are identical to their equivalent UTF-16 code points. + * In UTF-16, non-BMP code points are encoded in a pair of surrogate + * code points (i.e. a high surrogate in 0xD800..0xDBFF, followed by a + * low surrogate in 0xDC00..0xDFFF). An isolated surrogate code point + * has no general interpretation in UTF-16, but could be a valid + * (though unmapped) code point in UCS-2. Here we first try to decode + * the SMS message in UTF-16BE, and if that fails, fall back to decode + * in UCS-2BE. + */ + mm_dbg ("Converting SMS part text from UTF-16BE to UTF-8..."); + utf8 = g_convert ((const gchar *) text, len, "UTF8", "UTF16BE", NULL, NULL, NULL); + if (!utf8) { + mm_dbg ("Converting SMS part text from UCS-2BE to UTF8..."); + utf8 = g_convert ((const gchar *) text, len, "UTF8", "UCS-2BE", NULL, NULL, NULL); + } + if (!utf8) { + mm_warn ("Couldn't convert SMS part contents from UTF-16BE/UCS-2BE to UTF-8: not decoding any text"); + utf8 = g_strdup (""); + } else + mm_dbg (" Got UTF-8 text: '%s'", utf8); } else { - g_warn_if_reached (); + mm_warn ("Unexpected encoding '%s': not decoding any text", mm_sms_encoding_get_string (encoding)); utf8 = g_strdup (""); } @@ -523,7 +545,7 @@ break; default: /* Cannot happen as we AND with the 0x18 mask */ - g_assert_not_reached(); + g_assert_not_reached (); } } @@ -580,7 +602,7 @@ PDU_SIZE_CHECK (tp_dcs_offset + 1, "cannot read TP-DCS"); /* Encoding given in the 'alphabet' bits */ - user_data_encoding = sms_encoding_type(pdu[tp_dcs_offset]); + user_data_encoding = sms_encoding_type (pdu[tp_dcs_offset]); switch (user_data_encoding) { case MM_SMS_ENCODING_GSM7: mm_dbg (" user data encoding is GSM7"); @@ -729,7 +751,7 @@ * @address: the phone number to encode * @buf: the buffer to encode @address in * @buflen: the size of @buf - * @is_smsc: if %TRUE encode size as number of octets of address infromation, + * @is_smsc: if %TRUE encode size as number of octets of address information, * otherwise if %FALSE encode size as number of digits of @address * * Returns: the size in bytes of the data added to @buf @@ -956,7 +978,7 @@ *udl_ptr, mm_sms_part_get_concat_sequence (part) ? "with" : "without"); - packed = gsm_pack (unpacked, unlen, shift, &packlen); + packed = mm_charset_gsm_pack (unpacked, unlen, shift, &packlen); g_free (unpacked); if (!packed || packlen == 0) { g_free (packed); @@ -1026,7 +1048,6 @@ mm_sms_part_3gpp_util_split_text (const gchar *text, MMSmsEncoding *encoding) { - guint gsm_unsupported = 0; gchar **out; guint n_chunks; guint i; @@ -1058,10 +1079,7 @@ */ /* Check if we can do GSM encoding */ - mm_charset_get_encoded_len (text, - MM_MODEM_CHARSET_GSM, - &gsm_unsupported); - if (gsm_unsupported > 0) { + if (!mm_charset_can_convert_to (text, MM_MODEM_CHARSET_GSM)) { /* If cannot do it in GSM encoding, do it in UCS-2 */ GByteArray *array; diff -Nru modemmanager-1.6.8/src/mm-sms-part-3gpp.h modemmanager-1.10.0/src/mm-sms-part-3gpp.h --- modemmanager-1.6.8/src/mm-sms-part-3gpp.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-part-3gpp.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ #define MM_SMS_PART_3GPP_H #include -#include +#include #include "mm-sms-part.h" diff -Nru modemmanager-1.6.8/src/mm-sms-part-cdma.c modemmanager-1.10.0/src/mm-sms-part-cdma.c --- modemmanager-1.6.8/src/mm-sms-part-cdma.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-part-cdma.c 2018-11-15 09:55:53.000000000 +0100 @@ -273,8 +273,10 @@ return MM_SMS_DELIVERY_STATE_COMPLETED_RECEIVED; case ERROR_CLASS_TEMPORARY: delivery_state += 0x300; + break; case ERROR_CLASS_PERMANENT: delivery_state += 0x200; + break; default: return MM_SMS_DELIVERY_STATE_UNKNOWN; } @@ -296,7 +298,7 @@ else if (cause_code == 101) /* 101 reserved */ delivery_state += CAUSE_CODE_GENERAL_PROBLEM_OTHER; - else if (cause_code >= 108 && cause_code <= 255) + else if (cause_code >= 108) /* cause_code <= 255 is always true */ /* 108 to 223 reserved, treat as CAUSE_CODE_GENERAL_PROBLEM_OTHER * 224 to 255 reserved for TIA/EIA-41 extension, otherwise treat as CAUSE_CODE_GENERAL_PROBLEM_OTHER */ delivery_state += CAUSE_CODE_GENERAL_PROBLEM_OTHER; @@ -1363,7 +1365,6 @@ guint *num_bits_per_field, Encoding *encoding) { - guint latin_unsupported = 0; guint ascii_unsupported = 0; guint i; guint len; @@ -1389,10 +1390,7 @@ } /* Check if we can do Latin encoding */ - mm_charset_get_encoded_len (text, - MM_MODEM_CHARSET_8859_1, - &latin_unsupported); - if (!latin_unsupported) { + if (mm_charset_can_convert_to (text, MM_MODEM_CHARSET_8859_1)) { *out = g_byte_array_sized_new (len); mm_modem_charset_byte_array_append (*out, text, diff -Nru modemmanager-1.6.8/src/mm-sms-part-cdma.h modemmanager-1.10.0/src/mm-sms-part-cdma.h --- modemmanager-1.6.8/src/mm-sms-part-cdma.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-part-cdma.h 2018-11-15 09:55:53.000000000 +0100 @@ -17,7 +17,7 @@ #define MM_SMS_PART_CDMA_H #include -#include +#include #include "mm-sms-part.h" diff -Nru modemmanager-1.6.8/src/mm-sms-part.h modemmanager-1.10.0/src/mm-sms-part.h --- modemmanager-1.6.8/src/mm-sms-part.h 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-part.h 2018-11-15 09:55:53.000000000 +0100 @@ -18,9 +18,9 @@ #define MM_SMS_PART_H #include -#include +#include -typedef enum { +typedef enum { /*< underscore_name=mm_sms_encoding >*/ MM_SMS_ENCODING_UNKNOWN = 0x0, MM_SMS_ENCODING_GSM7, MM_SMS_ENCODING_8BIT, diff -Nru modemmanager-1.6.8/src/mm-sms-qmi.c modemmanager-1.10.0/src/mm-sms-qmi.c --- modemmanager-1.6.8/src/mm-sms-qmi.c 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/src/mm-sms-qmi.c 2018-11-15 09:55:53.000000000 +0100 @@ -57,12 +57,13 @@ g_object_unref (modem); if (!port) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek QMI port"); + g_task_report_new_error (self, + callback, + user_data, + ensure_qmi_client, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek QMI port"); return FALSE; } @@ -70,13 +71,14 @@ service, MM_PORT_QMI_FLAG_DEFAULT); if (!client) { - g_simple_async_report_error_in_idle (G_OBJECT (self), - callback, - user_data, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't peek client for service '%s'", - qmi_service_get_string (service)); + g_task_report_new_error (self, + callback, + user_data, + ensure_qmi_client, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't peek client for service '%s'", + qmi_service_get_string (service)); return FALSE; } @@ -115,22 +117,17 @@ /* Store the SMS */ typedef struct { - MMBaseSms *self; MMBaseModem *modem; QmiClientWms *client; - GSimpleAsyncResult *result; MMSmsStorage storage; GList *current; } SmsStoreContext; static void -sms_store_context_complete_and_free (SmsStoreContext *ctx) +sms_store_context_free (SmsStoreContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SmsStoreContext, ctx); } @@ -139,16 +136,18 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void sms_store_next_part (SmsStoreContext *ctx); +static void sms_store_next_part (GTask *task); static void store_ready (QmiClientWms *client, GAsyncResult *res, - SmsStoreContext *ctx) + GTask *task) { + MMBaseSms *self; + SmsStoreContext *ctx; QmiMessageWmsRawWriteOutput *output = NULL; GError *error = NULL; GList *parts; @@ -157,19 +156,22 @@ output = qmi_client_wms_raw_write_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } if (!qmi_message_wms_raw_write_output_get_result (output, &error)) { qmi_message_wms_raw_write_output_unref (output); g_prefix_error (&error, "Couldn't write SMS part: "); - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + qmi_message_wms_raw_write_output_get_memory_index ( output, &idx, @@ -177,17 +179,18 @@ qmi_message_wms_raw_write_output_unref (output); /* Set the index in the part we hold */ - parts = mm_base_sms_get_parts (ctx->self); + parts = mm_base_sms_get_parts (self); mm_sms_part_set_index ((MMSmsPart *)parts->data, (guint)idx); /* Go on with next one */ ctx->current = g_list_next (ctx->current); - sms_store_next_part (ctx); + sms_store_next_part (task); } static void -sms_store_next_part (SmsStoreContext *ctx) +sms_store_next_part (GTask *task) { + SmsStoreContext *ctx; QmiMessageWmsRawWriteInput *input; guint8 *pdu = NULL; guint pdulen = 0; @@ -195,10 +198,12 @@ GArray *array; GError *error = NULL; + ctx = g_task_get_task_data (task); + if (!ctx->current) { /* Done we are */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_store_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } @@ -210,16 +215,17 @@ if (!pdu) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unknown or unsupported PDU type in SMS part: %s", - mm_sms_pdu_type_get_string ( - mm_sms_part_get_pdu_type ( - (MMSmsPart *)ctx->current->data))); - sms_store_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unknown or unsupported PDU type in SMS part: %s", + mm_sms_pdu_type_get_string ( + mm_sms_part_get_pdu_type ( + (MMSmsPart *)ctx->current->data))); + + g_object_unref (task); return; } @@ -244,7 +250,7 @@ 5, NULL, (GAsyncReadyCallback)store_ready, - ctx); + task); qmi_message_wms_raw_write_input_unref (input); g_array_unref (array); } @@ -258,6 +264,7 @@ SmsStoreContext *ctx; QmiClient *client = NULL; GError *error = NULL; + GTask *task; /* Ensure WMS client */ if (!ensure_qmi_client (MM_SMS_QMI (self), @@ -267,11 +274,6 @@ /* Setup the context */ ctx = g_slice_new0 (SmsStoreContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_store); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); ctx->storage = storage; g_object_get (self, @@ -280,37 +282,35 @@ ctx->current = mm_base_sms_get_parts (self); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_store_context_free); + /* Check whether we support the given SMS type */ if (!check_sms_type_support (MM_SMS_QMI (self), ctx->modem, (MMSmsPart *)ctx->current->data, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_store_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } /* Go on */ - sms_store_next_part (ctx); + sms_store_next_part (task); } /*****************************************************************************/ /* Send the SMS */ typedef struct { - MMBaseSms *self; MMBaseModem *modem; QmiClientWms *client; - GSimpleAsyncResult *result; gboolean from_storage; GList *current; } SmsSendContext; static void -sms_send_context_complete_and_free (SmsSendContext *ctx) +sms_send_context_free (SmsSendContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SmsSendContext, ctx); } @@ -319,16 +319,17 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void sms_send_next_part (SmsSendContext *ctx); +static void sms_send_next_part (GTask *task); static void send_generic_ready (QmiClientWms *client, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; QmiMessageWmsRawSendOutput *output = NULL; GError *error = NULL; guint16 message_id; @@ -336,8 +337,8 @@ output = qmi_client_wms_raw_send_finish (client, res, &error); if (!output) { g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -359,11 +360,13 @@ qmi_message_wms_raw_send_output_unref (output); g_prefix_error (&error, "Couldn't write SMS part: "); - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } + ctx = g_task_get_task_data (task); + if (qmi_message_wms_raw_send_output_get_message_id (output, &message_id, NULL)) mm_sms_part_set_message_reference ((MMSmsPart *)ctx->current->data, message_id); @@ -372,12 +375,13 @@ /* Go on with next part */ ctx->current = g_list_next (ctx->current); - sms_send_next_part (ctx); + sms_send_next_part (task); } static void -sms_send_generic (SmsSendContext *ctx) +sms_send_generic (GTask *task) { + SmsSendContext *ctx; QmiMessageWmsRawSendInput *input; guint8 *pdu = NULL; guint pdulen = 0; @@ -385,6 +389,8 @@ GArray *array; GError *error = NULL; + ctx = g_task_get_task_data (task); + /* Get PDU */ if (MM_SMS_PART_IS_3GPP ((MMSmsPart *)ctx->current->data)) pdu = mm_sms_part_3gpp_get_submit_pdu ((MMSmsPart *)ctx->current->data, &pdulen, &msgstart, &error); @@ -393,16 +399,16 @@ if (!pdu) { if (error) - g_simple_async_result_take_error (ctx->result, error); + g_task_return_error (task, error); else - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Unknown or unsupported PDU type in SMS part: %s", - mm_sms_pdu_type_get_string ( - mm_sms_part_get_pdu_type ( - (MMSmsPart *)ctx->current->data))); - sms_send_context_complete_and_free (ctx); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unknown or unsupported PDU type in SMS part: %s", + mm_sms_pdu_type_get_string ( + mm_sms_part_get_pdu_type ( + (MMSmsPart *)ctx->current->data))); + g_object_unref (task); return; } @@ -426,7 +432,7 @@ 30, NULL, (GAsyncReadyCallback)send_generic_ready, - ctx); + task); qmi_message_wms_raw_send_input_unref (input); g_array_unref (array); } @@ -434,12 +440,15 @@ static void send_from_storage_ready (QmiClientWms *client, GAsyncResult *res, - SmsSendContext *ctx) + GTask *task) { + SmsSendContext *ctx; QmiMessageWmsSendFromMemoryStorageOutput *output = NULL; GError *error = NULL; guint16 message_id; + ctx = g_task_get_task_data (task); + output = qmi_client_wms_send_from_memory_storage_finish (client, res, &error); if (!output) { if (g_error_matches (error, @@ -449,14 +458,14 @@ error->message); g_error_free (error); ctx->from_storage = FALSE; - sms_send_next_part (ctx); + sms_send_next_part (task); return; } /* Fatal error */ g_prefix_error (&error, "QMI operation failed: "); - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } @@ -468,7 +477,7 @@ error->message); g_error_free (error); ctx->from_storage = FALSE; - sms_send_next_part (ctx); + sms_send_next_part (task); } else { QmiWmsGsmUmtsRpCause rp_cause; QmiWmsGsmUmtsTpCause tp_cause; @@ -506,8 +515,8 @@ } g_prefix_error (&error, "Couldn't write SMS part: "); - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); } qmi_message_wms_send_from_memory_storage_output_unref (output); @@ -522,19 +531,23 @@ /* Go on with next part */ ctx->current = g_list_next (ctx->current); - sms_send_next_part (ctx); + sms_send_next_part (task); } static void -sms_send_from_storage (SmsSendContext *ctx) +sms_send_from_storage (GTask *task) { + MMBaseSms *self; + SmsSendContext *ctx; QmiMessageWmsSendFromMemoryStorageInput *input; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); input = qmi_message_wms_send_from_memory_storage_input_new (); qmi_message_wms_send_from_memory_storage_input_set_information ( input, - mm_sms_storage_to_qmi_storage_type (mm_base_sms_get_storage (ctx->self)), + mm_sms_storage_to_qmi_storage_type (mm_base_sms_get_storage (self)), mm_sms_part_get_index ((MMSmsPart *)ctx->current->data), (MM_SMS_PART_IS_3GPP ((MMSmsPart *)ctx->current->data) ? QMI_WMS_MESSAGE_MODE_GSM_WCDMA : @@ -547,25 +560,29 @@ 30, NULL, (GAsyncReadyCallback)send_from_storage_ready, - ctx); + task); qmi_message_wms_send_from_memory_storage_input_unref (input); } static void -sms_send_next_part (SmsSendContext *ctx) +sms_send_next_part (GTask *task) { + SmsSendContext *ctx; + + ctx = g_task_get_task_data (task); + if (!ctx->current) { /* Done we are */ - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); - sms_send_context_complete_and_free (ctx); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return; } /* Send from storage? */ if (ctx->from_storage) - sms_send_from_storage (ctx); + sms_send_from_storage (task); else - sms_send_generic (ctx); + sms_send_generic (task); } static void @@ -576,6 +593,7 @@ SmsSendContext *ctx; QmiClient *client = NULL; GError *error = NULL; + GTask *task; /* Ensure WMS client */ if (!ensure_qmi_client (MM_SMS_QMI (self), @@ -585,11 +603,6 @@ /* Setup the context */ ctx = g_slice_new0 (SmsSendContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_send); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); g_object_get (self, MM_BASE_SMS_MODEM, &ctx->modem, @@ -600,35 +613,33 @@ ctx->current = mm_base_sms_get_parts (self); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_send_context_free); + /* Check whether we support the given SMS type */ if (!check_sms_type_support (MM_SMS_QMI (self), ctx->modem, (MMSmsPart *)ctx->current->data, &error)) { - g_simple_async_result_take_error (ctx->result, error); - sms_send_context_complete_and_free (ctx); + g_task_return_error (task, error); + g_object_unref (task); return; } - sms_send_next_part (ctx); + sms_send_next_part (task); } /*****************************************************************************/ typedef struct { - MMBaseSms *self; MMBaseModem *modem; QmiClientWms *client; - GSimpleAsyncResult *result; GList *current; guint n_failed; } SmsDeletePartsContext; static void -sms_delete_parts_context_complete_and_free (SmsDeletePartsContext *ctx) +sms_delete_parts_context_free (SmsDeletePartsContext *ctx) { - g_simple_async_result_complete_in_idle (ctx->result); - g_object_unref (ctx->result); g_object_unref (ctx->client); g_object_unref (ctx->modem); - g_object_unref (ctx->self); g_slice_free (SmsDeletePartsContext, ctx); } @@ -637,19 +648,22 @@ GAsyncResult *res, GError **error) { - return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); + return g_task_propagate_boolean (G_TASK (res), error); } -static void delete_next_part (SmsDeletePartsContext *ctx); +static void delete_next_part (GTask *task); static void delete_part_ready (QmiClientWms *client, GAsyncResult *res, - SmsDeletePartsContext *ctx) + GTask *task) { + SmsDeletePartsContext *ctx; QmiMessageWmsDeleteOutput *output = NULL; GError *error = NULL; + ctx = g_task_get_task_data (task); + output = qmi_client_wms_delete_finish (client, res, &error); if (!output) { ctx->n_failed++; @@ -672,14 +686,19 @@ mm_sms_part_set_index ((MMSmsPart *)ctx->current->data, SMS_PART_INVALID_INDEX); ctx->current = g_list_next (ctx->current); - delete_next_part (ctx); + delete_next_part (task); } static void -delete_next_part (SmsDeletePartsContext *ctx) +delete_next_part (GTask *task) { + MMBaseSms *self; + SmsDeletePartsContext *ctx; QmiMessageWmsDeleteInput *input; + self = g_task_get_source_object (task); + ctx = g_task_get_task_data (task); + /* Skip non-stored parts */ while (ctx->current && mm_sms_part_get_index ((MMSmsPart *)ctx->current->data) == SMS_PART_INVALID_INDEX) @@ -688,22 +707,22 @@ /* If all removed, we're done */ if (!ctx->current) { if (ctx->n_failed > 0) - g_simple_async_result_set_error (ctx->result, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't delete %u parts from this SMS", - ctx->n_failed); + g_task_return_new_error (task, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Couldn't delete %u parts from this SMS", + ctx->n_failed); else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + g_task_return_boolean (task, TRUE); - sms_delete_parts_context_complete_and_free (ctx); + g_object_unref (task); return; } input = qmi_message_wms_delete_input_new (); qmi_message_wms_delete_input_set_memory_storage ( input, - mm_sms_storage_to_qmi_storage_type (mm_base_sms_get_storage (ctx->self)), + mm_sms_storage_to_qmi_storage_type (mm_base_sms_get_storage (self)), NULL); qmi_message_wms_delete_input_set_memory_index ( input, @@ -720,7 +739,7 @@ 5, NULL, (GAsyncReadyCallback)delete_part_ready, - ctx); + task); qmi_message_wms_delete_input_unref (input); } @@ -731,6 +750,7 @@ { SmsDeletePartsContext *ctx; QmiClient *client = NULL; + GTask *task; /* Ensure WMS client */ if (!ensure_qmi_client (MM_SMS_QMI (self), @@ -739,19 +759,17 @@ return; ctx = g_slice_new0 (SmsDeletePartsContext); - ctx->result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - sms_delete); - ctx->self = g_object_ref (self); ctx->client = g_object_ref (client); g_object_get (self, MM_BASE_SMS_MODEM, &ctx->modem, NULL); + task = g_task_new (self, NULL, callback, user_data); + g_task_set_task_data (task, ctx, (GDestroyNotify)sms_delete_parts_context_free); + /* Go on deleting parts */ ctx->current = mm_base_sms_get_parts (self); - delete_next_part (ctx); + delete_next_part (task); } /*****************************************************************************/ diff -Nru modemmanager-1.6.8/src/tests/Makefile.am modemmanager-1.10.0/src/tests/Makefile.am --- modemmanager-1.6.8/src/tests/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -16,13 +16,19 @@ -I${top_builddir}/libmm-glib/generated \ -I${top_srcdir}/src/ \ -I${top_builddir}/src/ \ + -I${top_srcdir}/src/kerneldevice \ + -DTESTUDEVRULESDIR=\"${top_srcdir}/src/\" \ + $(NULL) + +LDADD = \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la \ $(NULL) AM_LDFLAGS = \ $(MM_LIBS) \ $(CODE_COVERAGE_LDFLAGS) \ - $(top_builddir)/src/libhelpers.la \ - $(top_builddir)/src/libport.la \ -lutil \ $(NULL) @@ -38,7 +44,7 @@ ################################################################################ # tests -# note: we abuse AM_LDFLAGS to include libhelpers and libport. +# note: we abuse AM_LDFLAGS to include the libraries being tested ################################################################################ noinst_PROGRAMS = \ @@ -48,6 +54,7 @@ test-at-serial-port \ test-sms-part-3gpp \ test-sms-part-cdma \ + test-udev-rules \ $(NULL) if WITH_QMI diff -Nru modemmanager-1.6.8/src/tests/Makefile.in modemmanager-1.10.0/src/tests/Makefile.in --- modemmanager-1.6.8/src/tests/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/src/tests/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -95,7 +95,7 @@ noinst_PROGRAMS = test-modem-helpers$(EXEEXT) test-charsets$(EXEEXT) \ test-qcdm-serial-port$(EXEEXT) test-at-serial-port$(EXEEXT) \ test-sms-part-3gpp$(EXEEXT) test-sms-part-cdma$(EXEEXT) \ - $(am__EXEEXT_1) + test-udev-rules$(EXEEXT) $(am__EXEEXT_1) @WITH_QMI_TRUE@am__append_5 = test-modem-helpers-qmi subdir = src/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -103,14 +103,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -123,6 +122,9 @@ test_at_serial_port_SOURCES = test-at-serial-port.c test_at_serial_port_OBJECTS = test-at-serial-port.$(OBJEXT) test_at_serial_port_LDADD = $(LDADD) +test_at_serial_port_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -130,21 +132,47 @@ test_charsets_SOURCES = test-charsets.c test_charsets_OBJECTS = test-charsets.$(OBJEXT) test_charsets_LDADD = $(LDADD) +test_charsets_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la test_modem_helpers_SOURCES = test-modem-helpers.c test_modem_helpers_OBJECTS = test-modem-helpers.$(OBJEXT) test_modem_helpers_LDADD = $(LDADD) +test_modem_helpers_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la test_modem_helpers_qmi_SOURCES = test-modem-helpers-qmi.c test_modem_helpers_qmi_OBJECTS = test-modem-helpers-qmi.$(OBJEXT) test_modem_helpers_qmi_LDADD = $(LDADD) +test_modem_helpers_qmi_DEPENDENCIES = \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la test_qcdm_serial_port_SOURCES = test-qcdm-serial-port.c test_qcdm_serial_port_OBJECTS = test-qcdm-serial-port.$(OBJEXT) test_qcdm_serial_port_LDADD = $(LDADD) +test_qcdm_serial_port_DEPENDENCIES = \ + $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la test_sms_part_3gpp_SOURCES = test-sms-part-3gpp.c test_sms_part_3gpp_OBJECTS = test-sms-part-3gpp.$(OBJEXT) test_sms_part_3gpp_LDADD = $(LDADD) +test_sms_part_3gpp_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la test_sms_part_cdma_SOURCES = test-sms-part-cdma.c test_sms_part_cdma_OBJECTS = test-sms-part-cdma.$(OBJEXT) test_sms_part_cdma_LDADD = $(LDADD) +test_sms_part_cdma_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la +test_udev_rules_SOURCES = test-udev-rules.c +test_udev_rules_OBJECTS = test-udev-rules.$(OBJEXT) +test_udev_rules_LDADD = $(LDADD) +test_udev_rules_DEPENDENCIES = $(top_builddir)/src/libhelpers.la \ + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -159,7 +187,15 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/test-at-serial-port.Po \ + ./$(DEPDIR)/test-charsets.Po \ + ./$(DEPDIR)/test-modem-helpers-qmi.Po \ + ./$(DEPDIR)/test-modem-helpers.Po \ + ./$(DEPDIR)/test-qcdm-serial-port.Po \ + ./$(DEPDIR)/test-sms-part-3gpp.Po \ + ./$(DEPDIR)/test-sms-part-cdma.Po \ + ./$(DEPDIR)/test-udev-rules.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -181,11 +217,11 @@ am__v_CCLD_1 = SOURCES = test-at-serial-port.c test-charsets.c test-modem-helpers.c \ test-modem-helpers-qmi.c test-qcdm-serial-port.c \ - test-sms-part-3gpp.c test-sms-part-cdma.c + test-sms-part-3gpp.c test-sms-part-cdma.c test-udev-rules.c DIST_SOURCES = test-at-serial-port.c test-charsets.c \ test-modem-helpers.c test-modem-helpers-qmi.c \ test-qcdm-serial-port.c test-sms-part-3gpp.c \ - test-sms-part-cdma.c + test-sms-part-cdma.c test-udev-rules.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -214,7 +250,6 @@ $(top_srcdir)/gtester.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -267,14 +302,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -395,8 +422,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -430,11 +455,17 @@ -I$(top_srcdir)/include -I$(top_builddir)/include \ -I$(top_srcdir)/libqcdm/src -I$(top_srcdir)/libmm-glib \ -I${top_builddir}/libmm-glib/generated -I${top_srcdir}/src/ \ - -I${top_builddir}/src/ $(NULL) $(am__append_1) $(am__append_3) -AM_LDFLAGS = $(MM_LIBS) $(CODE_COVERAGE_LDFLAGS) \ + -I${top_builddir}/src/ -I${top_srcdir}/src/kerneldevice \ + -DTESTUDEVRULESDIR=\"${top_srcdir}/src/\" $(NULL) \ + $(am__append_1) $(am__append_3) +LDADD = \ $(top_builddir)/src/libhelpers.la \ - $(top_builddir)/src/libport.la -lutil $(NULL) $(am__append_2) \ - $(am__append_4) + $(top_builddir)/src/libport.la \ + $(top_builddir)/src/libkerneldevice.la \ + $(NULL) + +AM_LDFLAGS = $(MM_LIBS) $(CODE_COVERAGE_LDFLAGS) -lutil $(NULL) \ + $(am__append_2) $(am__append_4) all: all-am .SUFFIXES: @@ -456,8 +487,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtester.make $(am__empty): @@ -507,19 +538,30 @@ @rm -f test-sms-part-cdma$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_sms_part_cdma_OBJECTS) $(test_sms_part_cdma_LDADD) $(LIBS) +test-udev-rules$(EXEEXT): $(test_udev_rules_OBJECTS) $(test_udev_rules_DEPENDENCIES) $(EXTRA_test_udev_rules_DEPENDENCIES) + @rm -f test-udev-rules$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_udev_rules_OBJECTS) $(test_udev_rules_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-at-serial-port.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-charsets.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-helpers-qmi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-helpers.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-qcdm-serial-port.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sms-part-3gpp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sms-part-cdma.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-at-serial-port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-charsets.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-helpers-qmi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modem-helpers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-qcdm-serial-port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sms-part-3gpp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sms-part-cdma.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-udev-rules.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -603,7 +645,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -674,7 +719,14 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test-at-serial-port.Po + -rm -f ./$(DEPDIR)/test-charsets.Po + -rm -f ./$(DEPDIR)/test-modem-helpers-qmi.Po + -rm -f ./$(DEPDIR)/test-modem-helpers.Po + -rm -f ./$(DEPDIR)/test-qcdm-serial-port.Po + -rm -f ./$(DEPDIR)/test-sms-part-3gpp.Po + -rm -f ./$(DEPDIR)/test-sms-part-cdma.Po + -rm -f ./$(DEPDIR)/test-udev-rules.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -720,7 +772,14 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/test-at-serial-port.Po + -rm -f ./$(DEPDIR)/test-charsets.Po + -rm -f ./$(DEPDIR)/test-modem-helpers-qmi.Po + -rm -f ./$(DEPDIR)/test-modem-helpers.Po + -rm -f ./$(DEPDIR)/test-qcdm-serial-port.Po + -rm -f ./$(DEPDIR)/test-sms-part-3gpp.Po + -rm -f ./$(DEPDIR)/test-sms-part-cdma.Po + -rm -f ./$(DEPDIR)/test-udev-rules.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -741,19 +800,19 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ - clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ + check-local clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru modemmanager-1.6.8/src/tests/test-at-serial-port.c modemmanager-1.10.0/src/tests/test-at-serial-port.c --- modemmanager-1.6.8/src/tests/test-at-serial-port.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-at-serial-port.c 2018-11-15 09:55:53.000000000 +0100 @@ -86,7 +86,6 @@ int main (int argc, char **argv) { - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/ModemManager/AT-serial/echo-removal", at_serial_echo_removal); diff -Nru modemmanager-1.6.8/src/tests/test-charsets.c modemmanager-1.10.0/src/tests/test-charsets.c --- modemmanager-1.6.8/src/tests/test-charsets.c 2017-06-02 13:18:23.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-charsets.c 2018-11-15 09:55:53.000000000 +0100 @@ -15,12 +15,19 @@ #include #include +#include #include "mm-modem-helpers.h" #include "mm-log.h" +#if defined ENABLE_TEST_MESSAGE_TRACES +#define trace(message, ...) g_print (message, ##__VA_ARGS__) +#else +#define trace(...) +#endif + static void -test_def_chars (void *f, gpointer d) +test_gsm7_default_chars (void) { /* Test that a string with all the characters in the GSM 03.38 charset * are converted from UTF-8 to GSM and back to UTF-8 successfully. @@ -44,7 +51,7 @@ } static void -test_esc_chars (void *f, gpointer d) +test_gsm7_extended_chars (void) { /* Test that a string with all the characters in the extended GSM 03.38 * charset are converted from UTF-8 to GSM and back to UTF-8 successfully. @@ -68,7 +75,7 @@ } static void -test_mixed_chars (void *f, gpointer d) +test_gsm7_mixed_chars (void) { /* Test that a string with a mix of GSM 03.38 default and extended characters * is converted from UTF-8 to GSM and back to UTF-8 successfully. @@ -92,14 +99,14 @@ } static void -test_unpack_gsm7 (void *f, gpointer d) +test_gsm7_unpack_basic (void) { static const guint8 gsm[] = { 0xC8, 0xF7, 0x1D, 0x14, 0x96, 0x97, 0x41, 0xF9, 0x77, 0xFD, 0x07 }; static const guint8 expected[] = { 0x48, 0x6f, 0x77, 0x20, 0x61, 0x72, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x3f }; guint8 *unpacked; guint32 unpacked_len = 0; - unpacked = gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (unpacked, expected, unpacked_len), ==, 0); @@ -108,7 +115,7 @@ } static void -test_unpack_gsm7_7_chars (void *f, gpointer d) +test_gsm7_unpack_7_chars (void) { static const guint8 gsm[] = { 0xF1, 0x7B, 0x59, 0x4E, 0xCF, 0xD7, 0x01 }; static const guint8 expected[] = { 0x71, 0x77, 0x65, 0x72, 0x74, 0x79, 0x75}; @@ -120,7 +127,7 @@ * we expect to get the number of characters that were specified. */ - unpacked = gsm_unpack (gsm, 7 , 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, 7 , 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (unpacked, expected, unpacked_len), ==, 0); @@ -129,7 +136,7 @@ } static void -test_unpack_gsm7_all_chars (void *f, gpointer d) +test_gsm7_unpack_all_chars (void) { /* Packed array of all chars in GSM default and extended charset */ static const guint8 gsm[] = { @@ -153,7 +160,7 @@ guint32 unpacked_len = 0; int i; - unpacked = gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, 148); @@ -168,14 +175,14 @@ } static void -test_pack_gsm7 (void *f, gpointer d) +test_gsm7_pack_basic (void) { static const guint8 unpacked[] = { 0x48, 0x6f, 0x77, 0x20, 0x61, 0x72, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x3f }; static const guint8 expected[] = { 0xC8, 0xF7, 0x1D, 0x14, 0x96, 0x97, 0x41, 0xF9, 0x77, 0xFD, 0x07 }; guint8 *packed; guint32 packed_len = 0; - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -184,7 +191,7 @@ } static void -test_pack_gsm7_7_chars (void *f, gpointer d) +test_gsm7_pack_7_chars (void) { static const guint8 unpacked[] = { 0x71, 0x77, 0x65, 0x72, 0x74, 0x79, 0x75 }; static const guint8 expected[] = { 0xF1, 0x7B, 0x59, 0x4E, 0xCF, 0xD7, 0x01 }; @@ -197,7 +204,7 @@ * the intended message to remove it when required. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -205,27 +212,8 @@ g_free (packed); } -#if 0 static void -print_array (const guint8 *array, guint32 len) -{ - int col; - guint8 c; - - g_print ("\n"); - for (c = 0, col = 0; c < len; c++) { - g_print ("0x%02X, ", array[c] & 0xFF); - if (col++ == 11) { - col = 0; - g_print ("\n"); - } - } - g_print ("\n"); -} -#endif - -static void -test_pack_gsm7_all_chars (void *f, gpointer d) +test_gsm7_pack_all_chars (void) { /* Packed array of all chars in GSM default and extended charset */ static const guint8 expected[] = { @@ -255,7 +243,7 @@ for (c = 0; c < sizeof (ext); c++) g_byte_array_append (unpacked, &ext[c], 1); - packed = gsm_pack (unpacked->data, unpacked->len, 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked->data, unpacked->len, 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -265,7 +253,7 @@ } static void -test_pack_gsm7_24_chars (void *f, gpointer d) +test_gsm7_pack_24_chars (void) { static const guint8 unpacked[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, @@ -278,7 +266,7 @@ * are packed into an exact number of bytes. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, 21); @@ -286,7 +274,7 @@ } static void -test_pack_gsm7_last_septet_alone (void *f, gpointer d) +test_gsm7_pack_last_septet_alone (void) { static const guint8 unpacked[] = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x61, 0x6C, @@ -304,7 +292,7 @@ * septet will be in an octet by itself) packs correctly. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); @@ -312,14 +300,14 @@ } static void -test_pack_gsm7_7_chars_offset (void *f, gpointer d) +test_gsm7_pack_7_chars_offset (void) { static const guint8 unpacked[] = { 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x10, 0x2F }; static const guint8 expected[] = { 0x00, 0x5D, 0x66, 0xB3, 0xDF, 0x90, 0x17 }; guint8 *packed; guint32 packed_len = 0; - packed = gsm_pack (unpacked, sizeof (unpacked), 5, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 5, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -328,7 +316,7 @@ } static void -test_take_convert_ucs2_hex_utf8 (void *f, gpointer d) +test_take_convert_ucs2_hex_utf8 (void) { gchar *src, *converted; @@ -340,7 +328,7 @@ } static void -test_take_convert_ucs2_bad_ascii (void *f, gpointer d) +test_take_convert_ucs2_bad_ascii (void) { gchar *src, *converted; @@ -352,7 +340,7 @@ } static void -test_take_convert_ucs2_bad_ascii2 (void *f, gpointer d) +test_take_convert_ucs2_bad_ascii2 (void) { gchar *src, *converted; @@ -362,6 +350,66 @@ g_assert (converted == NULL); } +struct charset_can_convert_to_test_s { + const char *utf8; + gboolean to_gsm; + gboolean to_ira; + gboolean to_8859_1; + gboolean to_ucs2; + gboolean to_pccp437; + gboolean to_pcdn; +}; + +static void +test_charset_can_covert_to (void) +{ + static const struct charset_can_convert_to_test_s charset_can_convert_to_test[] = { + { + .utf8 = "", + .to_gsm = TRUE, .to_ira = TRUE, .to_8859_1 = TRUE, .to_ucs2 = TRUE, .to_pccp437 = TRUE, .to_pcdn = TRUE, + }, + { + .utf8 = " ", + .to_gsm = TRUE, .to_ira = TRUE, .to_8859_1 = TRUE, .to_ucs2 = TRUE, .to_pccp437 = TRUE, .to_pcdn = TRUE, + }, + { + .utf8 = "some basic ascii", + .to_gsm = TRUE, .to_ira = TRUE, .to_8859_1 = TRUE, .to_ucs2 = TRUE, .to_pccp437 = TRUE, .to_pcdn = TRUE, + }, + { + .utf8 = "ホモ・サピエンス 喂人类 katakana, chinese, english: UCS2 takes it all", + .to_gsm = FALSE, .to_ira = FALSE, .to_8859_1 = FALSE, .to_ucs2 = TRUE, .to_pccp437 = FALSE, .to_pcdn = FALSE, + }, + { + .utf8 = "Some from the GSM7 basic set: a % Ψ Ω ñ ö è æ", + .to_gsm = TRUE, .to_ira = FALSE, .to_8859_1 = FALSE, .to_ucs2 = TRUE, .to_pccp437 = FALSE, .to_pcdn = FALSE, + }, + { + .utf8 = "More from the GSM7 extended set: {} [] ~ € |", + .to_gsm = TRUE, .to_ira = FALSE, .to_8859_1 = FALSE, .to_ucs2 = TRUE, .to_pccp437 = FALSE, .to_pcdn = FALSE, + }, + { + .utf8 = "patín cannot be encoded in GSM7 or IRA, but is valid UCS2, ISO-8859-1, CP437 and CP850", + .to_gsm = FALSE, .to_ira = FALSE, .to_8859_1 = TRUE, .to_ucs2 = TRUE, .to_pccp437 = TRUE, .to_pcdn = TRUE, + }, + { + .utf8 = "ècole can be encoded in multiple ways, but not in IRA", + .to_gsm = TRUE, .to_ira = FALSE, .to_8859_1 = TRUE, .to_ucs2 = TRUE, .to_pccp437 = TRUE, .to_pcdn = TRUE, + }, + }; + guint i; + + for (i = 0; i < G_N_ELEMENTS (charset_can_convert_to_test); i++) { + trace ("testing charset conversion: '%s'\n", charset_can_convert_to_test[i].utf8); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_GSM) == charset_can_convert_to_test[i].to_gsm); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_IRA) == charset_can_convert_to_test[i].to_ira); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_8859_1) == charset_can_convert_to_test[i].to_8859_1); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_UCS2) == charset_can_convert_to_test[i].to_ucs2); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_PCCP437) == charset_can_convert_to_test[i].to_pccp437); + g_assert (mm_charset_can_convert_to (charset_can_convert_to_test[i].utf8, MM_MODEM_CHARSET_PCDN) == charset_can_convert_to_test[i].to_pcdn); + } +} + void _mm_log (const char *loc, const char *func, @@ -382,40 +430,30 @@ #endif } -typedef GTestFixtureFunc TCFunc; - -#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) - int main (int argc, char **argv) { - GTestSuite *suite; - gint result; + setlocale (LC_ALL, ""); g_test_init (&argc, &argv, NULL); - suite = g_test_get_root (); - - g_test_suite_add (suite, TESTCASE (test_def_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_esc_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_mixed_chars, NULL)); - - g_test_suite_add (suite, TESTCASE (test_unpack_gsm7, NULL)); - g_test_suite_add (suite, TESTCASE (test_unpack_gsm7_7_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_unpack_gsm7_all_chars, NULL)); - - g_test_suite_add (suite, TESTCASE (test_pack_gsm7, NULL)); - g_test_suite_add (suite, TESTCASE (test_pack_gsm7_7_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_pack_gsm7_all_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_pack_gsm7_24_chars, NULL)); - g_test_suite_add (suite, TESTCASE (test_pack_gsm7_last_septet_alone, NULL)); - - g_test_suite_add (suite, TESTCASE (test_pack_gsm7_7_chars_offset, NULL)); - - g_test_suite_add (suite, TESTCASE (test_take_convert_ucs2_hex_utf8, NULL)); - g_test_suite_add (suite, TESTCASE (test_take_convert_ucs2_bad_ascii, NULL)); - g_test_suite_add (suite, TESTCASE (test_take_convert_ucs2_bad_ascii2, NULL)); + g_test_add_func ("/MM/charsets/gsm7/default-chars", test_gsm7_default_chars); + g_test_add_func ("/MM/charsets/gsm7/extended-chars", test_gsm7_extended_chars); + g_test_add_func ("/MM/charsets/gsm7/mixed-chars", test_gsm7_mixed_chars); + g_test_add_func ("/MM/charsets/gsm7/unpack/basic", test_gsm7_unpack_basic); + g_test_add_func ("/MM/charsets/gsm7/unpack/7-chars", test_gsm7_unpack_7_chars); + g_test_add_func ("/MM/charsets/gsm7/unpack/all-chars", test_gsm7_unpack_all_chars); + g_test_add_func ("/MM/charsets/gsm7/pack/basic", test_gsm7_pack_basic); + g_test_add_func ("/MM/charsets/gsm7/pack/7-chars", test_gsm7_pack_7_chars); + g_test_add_func ("/MM/charsets/gsm7/pack/all-chars", test_gsm7_pack_all_chars); + g_test_add_func ("/MM/charsets/gsm7/pack/24-chars", test_gsm7_pack_24_chars); + g_test_add_func ("/MM/charsets/gsm7/pack/last-septet-alone", test_gsm7_pack_last_septet_alone); + g_test_add_func ("/MM/charsets/gsm7/pack/7-chars-offset", test_gsm7_pack_7_chars_offset); + + g_test_add_func ("/MM/charsets/take-convert/ucs2/hex", test_take_convert_ucs2_hex_utf8); + g_test_add_func ("/MM/charsets/take-convert/ucs2/bad-ascii", test_take_convert_ucs2_bad_ascii); + g_test_add_func ("/MM/charsets/take-convert/ucs2/bad-ascii-2", test_take_convert_ucs2_bad_ascii2); - result = g_test_run (); + g_test_add_func ("/MM/charsets/can-convert-to", test_charset_can_covert_to); - return result; + return g_test_run (); } diff -Nru modemmanager-1.6.8/src/tests/test-modem-helpers.c modemmanager-1.10.0/src/tests/test-modem-helpers.c --- modemmanager-1.6.8/src/tests/test-modem-helpers.c 2017-06-17 10:04:53.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-modem-helpers.c 2019-01-15 15:57:35.000000000 +0100 @@ -33,6 +33,93 @@ g_assert_cmpfloat (fabs (val1 - val2), <, tolerance) /*****************************************************************************/ +/* Test IFC=? responses */ + +static void +test_ifc_response (const gchar *str, + const MMFlowControl expected) +{ + MMFlowControl mask; + GError *error = NULL; + + mask = mm_parse_ifc_test_response (str, &error); + g_assert_no_error (error); + g_assert_cmpuint (mask, ==, expected); +} + +static void +test_ifc_response_all_simple (void) +{ + test_ifc_response ("+IFC (0,1,2),(0,1,2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_all_groups (void) +{ + test_ifc_response ("+IFC (0-2),(0-2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_none_only (void) +{ + test_ifc_response ("+IFC (0),(0)", MM_FLOW_CONTROL_NONE); +} + +static void +test_ifc_response_xon_xoff_only (void) +{ + test_ifc_response ("+IFC (1),(1)", MM_FLOW_CONTROL_XON_XOFF); +} + +static void +test_ifc_response_rts_cts_only (void) +{ + test_ifc_response ("+IFC (2),(2)", MM_FLOW_CONTROL_RTS_CTS); +} + +static void +test_ifc_response_no_xon_xoff (void) +{ + test_ifc_response ("+IFC (0,2),(0,2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_no_xon_xoff_in_ta (void) +{ + test_ifc_response ("+IFC (0,1,2),(0,2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_no_xon_xoff_in_te (void) +{ + test_ifc_response ("+IFC (0,2),(0,1,2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_no_rts_cts_simple (void) +{ + test_ifc_response ("+IFC (0,1),(0,1)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF)); +} + +static void +test_ifc_response_no_rts_cts_groups (void) +{ + test_ifc_response ("+IFC (0-1),(0-1)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF)); +} + +static void +test_ifc_response_all_simple_and_unknown (void) +{ + test_ifc_response ("+IFC (0,1,2,3),(0,1,2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF | MM_FLOW_CONTROL_RTS_CTS)); +} + +static void +test_ifc_response_all_groups_and_unknown (void) +{ + test_ifc_response ("+IFC (0-3),(0-2)", (MM_FLOW_CONTROL_NONE | MM_FLOW_CONTROL_XON_XOFF | MM_FLOW_CONTROL_RTS_CTS)); +} + +/*****************************************************************************/ /* Test WS46=? responses */ static void @@ -819,6 +906,131 @@ } /*****************************************************************************/ +/* Test COPS? responses */ + +typedef struct { + const gchar *str; + guint mode; + guint format; + const gchar *operator; + MMModemAccessTechnology act; +} CopsQueryData; + +static void +test_cops_query_data (const CopsQueryData *item) +{ + gboolean result; + GError *error = NULL; + guint mode = G_MAXUINT; + guint format = G_MAXUINT; + gchar *operator = NULL; + MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN; + + result = mm_3gpp_parse_cops_read_response (item->str, + &mode, + &format, + &operator, + &act, + &error); + g_assert_no_error (error); + g_assert (result); + g_assert_cmpuint (mode, ==, item->mode); + g_assert_cmpuint (format, ==, item->format); + g_assert_cmpstr (operator, ==, item->operator); + g_assert_cmpuint (act, ==, item->act); + + g_free (operator); +} + +static const CopsQueryData cops_query_data[] = { + { + .str = "+COPS: 1,0,\"CHINA MOBILE\"", + .mode = 1, + .format = 0, + .operator = "CHINA MOBILE", + .act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN + }, + { + .str = "+COPS: 1,0,\"CHINA MOBILE\",7", + .mode = 1, + .format = 0, + .operator = "CHINA MOBILE", + .act = MM_MODEM_ACCESS_TECHNOLOGY_LTE + }, + { + .str = "+COPS: 1,2,\"46000\"", + .mode = 1, + .format = 2, + .operator = "46000", + .act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN + }, + { + .str = "+COPS: 1,2,\"46000\",7", + .mode = 1, + .format = 2, + .operator = "46000", + .act = MM_MODEM_ACCESS_TECHNOLOGY_LTE + }, +}; + +static void +test_cops_query (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cops_query_data); i++) + test_cops_query_data (&cops_query_data[i]); +} + +/*****************************************************************************/ + +typedef struct { + const gchar *input; + MMModemCharset charset; + const gchar *normalized; +} NormalizeOperatorTest; + +static const NormalizeOperatorTest normalize_operator_tests[] = { + /* charset unknown */ + { "Verizon", MM_MODEM_CHARSET_UNKNOWN, "Verizon" }, + { "311480", MM_MODEM_CHARSET_UNKNOWN, "311480" }, + /* charset configured as IRA (ASCII) */ + { "Verizon", MM_MODEM_CHARSET_IRA, "Verizon" }, + { "311480", MM_MODEM_CHARSET_IRA, "311480" }, + /* charset configured as GSM7 */ + { "Verizon", MM_MODEM_CHARSET_GSM, "Verizon" }, + { "311480", MM_MODEM_CHARSET_GSM, "311480" }, + /* charset configured as UCS2 */ + { "0056006500720069007A006F006E", MM_MODEM_CHARSET_UCS2, "Verizon" }, + { "003300310031003400380030", MM_MODEM_CHARSET_UCS2, "311480" }, + { "Verizon", MM_MODEM_CHARSET_UCS2, "Verizon" }, + { "311480", MM_MODEM_CHARSET_UCS2, "311480" }, +}; + +static void +common_test_normalize_operator (const NormalizeOperatorTest *t) +{ + gchar *str; + + str = g_strdup (t->input); + mm_3gpp_normalize_operator (&str, t->charset); + if (!t->normalized) + g_assert (!str); + else + g_assert_cmpstr (str, ==, t->normalized); + g_free (str); +} + +static void +test_normalize_operator (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (normalize_operator_tests); i++) + common_test_normalize_operator (&normalize_operator_tests[i]); +} + +/*****************************************************************************/ /* Test CREG/CGREG responses and unsolicited messages */ typedef struct { @@ -1080,6 +1292,28 @@ } static void +test_creg2_ublox_solicited (void *f, gpointer d) +{ + RegTestData *data = (RegTestData *) d; + const gchar *reply = "\r\n+CREG: 2,6,\"8B37\",\"0A265185\",7\r\n"; + /* NOTE: '6' means registered for "SMS only", home network; we just assume UNKNOWN in this case */ + const CregResult result = { MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY, 0x8B37, 0x0A265185, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 8, FALSE, FALSE }; + + test_creg_match ("Ublox Toby-L2 solicited while on LTE", TRUE, reply, data, &result); +} + +static void +test_creg2_ublox_unsolicited (void *f, gpointer d) +{ + RegTestData *data = (RegTestData *) d; + const gchar *reply = "\r\n+CREG: 6,\"8B37\",\"0A265185\",7\r\n"; + /* NOTE: '6' means registered for "SMS only", home network; we just assume UNKNOWN in this case */ + const CregResult result = { MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY, 0x8B37, 0x0A265185, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 6, FALSE, FALSE }; + + test_creg_match ("Ublox Toby-L2 unsolicited while on LTE", FALSE, reply, data, &result); +} + +static void test_cgreg1_solicited (void *f, gpointer d) { RegTestData *data = (RegTestData *) d; @@ -1663,6 +1897,80 @@ } /*****************************************************************************/ +/* Test CMER test responses */ + +static void +test_cmer_response (const gchar *str, + MM3gppCmerMode expected_modes, + MM3gppCmerInd expected_inds) +{ + gboolean ret; + MM3gppCmerMode modes = MM_3GPP_CMER_MODE_NONE; + MM3gppCmerInd inds = MM_3GPP_CMER_IND_NONE; + GError *error = NULL; + + ret = mm_3gpp_parse_cmer_test_response (str, &modes, &inds, &error); + g_assert_no_error (error); + g_assert (ret); + + g_assert_cmpuint (modes, ==, expected_modes); + g_assert_cmpuint (inds, ==, expected_inds); +} + +static void +test_cmer_response_cinterion_pls8 (void) +{ + static const gchar *str = "+CMER: (0-3),(0),(0),(0-1),(0-1)"; + static const MM3gppCmerMode expected_modes = ( \ + MM_3GPP_CMER_MODE_DISCARD_URCS | \ + MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED | \ + MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED | \ + MM_3GPP_CMER_MODE_FORWARD_URCS); + static const MM3gppCmerInd expected_inds = ( \ + MM_3GPP_CMER_IND_DISABLE | \ + MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND); + + test_cmer_response (str, expected_modes, expected_inds); +} + +static void +test_cmer_response_sierra_em7345 (void) +{ + static const gchar *str = "+CMER: 1,0,0,(0-1),0"; + static const MM3gppCmerMode expected_modes = ( \ + MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED); + static const MM3gppCmerInd expected_inds = ( \ + MM_3GPP_CMER_IND_DISABLE | \ + MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND); + + test_cmer_response (str, expected_modes, expected_inds); +} + +static void +test_cmer_response_cinterion_ehs5 (void) +{ + static const gchar *str = "+CMER: (1,2),0,0,(0-1),0"; + static const MM3gppCmerMode expected_modes = ( \ + MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED | \ + MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED); + static const MM3gppCmerInd expected_inds = ( \ + MM_3GPP_CMER_IND_DISABLE | \ + MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND); + + test_cmer_response (str, expected_modes, expected_inds); +} + +static void +test_cmer_request_cinterion_ehs5 (void) +{ + gchar *str; + + str = mm_3gpp_build_cmer_set_request (MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED, MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND); + g_assert_cmpstr (str, ==, "+CMER=2,0,0,1"); + g_free (str); +} + +/*****************************************************************************/ /* Test CIND responses */ typedef struct { @@ -1738,6 +2046,161 @@ } /*****************************************************************************/ +/* Test +CGEV indication parsing */ + +typedef struct { + const gchar *str; + MM3gppCgev expected_type; + const gchar *expected_pdp_type; + const gchar *expected_pdp_addr; + guint expected_cid; + guint expected_parent_cid; + guint expected_event_type; +} CgevIndicationTest; + +static const CgevIndicationTest cgev_indication_tests[] = { + { "+CGEV: REJECT IP, 123.123.123.123", MM_3GPP_CGEV_REJECT, "IP", "123.123.123.123", 0, 0, 0 }, + { "REJECT IP, 123.123.123.123", MM_3GPP_CGEV_REJECT, "IP", "123.123.123.123", 0, 0, 0 }, + + { "+CGEV: NW REACT IP, 123.123.123.123", MM_3GPP_CGEV_NW_REACT, "IP", "123.123.123.123", 0, 0, 0 }, + { "NW REACT IP, 123.123.123.123", MM_3GPP_CGEV_NW_REACT, "IP", "123.123.123.123", 0, 0, 0 }, + { "+CGEV: NW REACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_NW_REACT, "IP", "123.123.123.123", 1, 0, 0 }, + + { "NW DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_NW_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + { "+CGEV: NW DEACT IP, 123.123.123.123", MM_3GPP_CGEV_NW_DEACT_PDP, "IP", "123.123.123.123", 0, 0, 0 }, + { "NW DEACT IP, 123.123.123.123", MM_3GPP_CGEV_NW_DEACT_PDP, "IP", "123.123.123.123", 0, 0, 0 }, + { "+CGEV: NW DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_NW_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + { "NW DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_NW_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + + { "ME DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_ME_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + { "+CGEV: ME DEACT IP, 123.123.123.123", MM_3GPP_CGEV_ME_DEACT_PDP, "IP", "123.123.123.123", 0, 0, 0 }, + { "ME DEACT IP, 123.123.123.123", MM_3GPP_CGEV_ME_DEACT_PDP, "IP", "123.123.123.123", 0, 0, 0 }, + { "+CGEV: ME DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_ME_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + { "ME DEACT IP, 123.123.123.123, 1", MM_3GPP_CGEV_ME_DEACT_PDP, "IP", "123.123.123.123", 1, 0, 0 }, + + { "ME PDN ACT 2", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: ME PDN ACT 2", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + /* with ,[,]] */ + { "ME PDN ACT 2, 3", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: ME PDN ACT 2, 3", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "ME PDN ACT 2, 3, 4", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: ME PDN ACT 2, 3, 4", MM_3GPP_CGEV_ME_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + + { "ME PDN DEACT 2", MM_3GPP_CGEV_ME_DEACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: ME PDN DEACT 2", MM_3GPP_CGEV_ME_DEACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + + { "ME ACT 3, 2, 1", MM_3GPP_CGEV_ME_ACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + { "+CGEV: ME ACT 3, 2, 1", MM_3GPP_CGEV_ME_ACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + + { "ME DEACT 3, 2, 1", MM_3GPP_CGEV_ME_DEACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + { "+CGEV: ME DEACT 3, 2, 1", MM_3GPP_CGEV_ME_DEACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + + { "NW PDN ACT 2", MM_3GPP_CGEV_NW_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: NW PDN ACT 2", MM_3GPP_CGEV_NW_ACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + + { "NW PDN DEACT 2", MM_3GPP_CGEV_NW_DEACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + { "+CGEV: NW PDN DEACT 2", MM_3GPP_CGEV_NW_DEACT_PRIMARY, NULL, NULL, 2, 0, 0 }, + + { "NW ACT 3, 2, 1", MM_3GPP_CGEV_NW_ACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + { "+CGEV: NW ACT 3, 2, 1", MM_3GPP_CGEV_NW_ACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + + { "NW DEACT 3, 2, 1", MM_3GPP_CGEV_NW_DEACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + { "+CGEV: NW DEACT 3, 2, 1", MM_3GPP_CGEV_NW_DEACT_SECONDARY, NULL, NULL, 2, 3, 1 }, + + { "+CGEV: NW DETACH", MM_3GPP_CGEV_NW_DETACH, NULL, NULL, 0, 0, 0 }, + { "NW DETACH", MM_3GPP_CGEV_NW_DETACH, NULL, NULL, 0, 0, 0 }, + { "+CGEV: ME DETACH", MM_3GPP_CGEV_ME_DETACH, NULL, NULL, 0, 0, 0 }, + { "ME DETACH", MM_3GPP_CGEV_ME_DETACH, NULL, NULL, 0, 0, 0 }, + + { "+CGEV: NW CLASS A", MM_3GPP_CGEV_NW_CLASS, NULL, NULL, 0, 0, 0 }, + { "NW CLASS A", MM_3GPP_CGEV_NW_CLASS, NULL, NULL, 0, 0, 0 }, + { "+CGEV: ME CLASS A", MM_3GPP_CGEV_ME_CLASS, NULL, NULL, 0, 0, 0 }, + { "ME CLASS A", MM_3GPP_CGEV_ME_CLASS, NULL, NULL, 0, 0, 0 }, +}; + +static void +test_cgev_indication (const CgevIndicationTest *t) +{ + guint i; + GError *error = NULL; + gboolean ret; + + for (i = 0; i < G_N_ELEMENTS (cgev_indication_tests); i++) { + const CgevIndicationTest *test = &cgev_indication_tests[i]; + MM3gppCgev type; + + type = mm_3gpp_parse_cgev_indication_action (test->str); + g_assert_cmpuint (type, ==, test->expected_type); + + g_print ("[%u] type: %u\n", i, type); + + switch (type) { + case MM_3GPP_CGEV_NW_DETACH: + case MM_3GPP_CGEV_ME_DETACH: + break; + case MM_3GPP_CGEV_NW_ACT_PRIMARY: + case MM_3GPP_CGEV_ME_ACT_PRIMARY: + case MM_3GPP_CGEV_NW_DEACT_PRIMARY: + case MM_3GPP_CGEV_ME_DEACT_PRIMARY: { + guint cid; + + g_print ("[%u] parsing as primary\n", i); + ret = mm_3gpp_parse_cgev_indication_primary (test->str, type, &cid, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpuint (cid, ==, test->expected_cid); + break; + } + case MM_3GPP_CGEV_NW_ACT_SECONDARY: + case MM_3GPP_CGEV_ME_ACT_SECONDARY: + case MM_3GPP_CGEV_NW_DEACT_SECONDARY: + case MM_3GPP_CGEV_ME_DEACT_SECONDARY: { + guint p_cid; + guint cid; + guint event_type; + + g_print ("[%u] parsing as secondary\n", i); + ret = mm_3gpp_parse_cgev_indication_secondary (test->str, type, &p_cid, &cid, &event_type, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpuint (cid, ==, test->expected_cid); + g_assert_cmpuint (p_cid, ==, test->expected_parent_cid); + g_assert_cmpuint (event_type, ==, test->expected_event_type); + break; + } + case MM_3GPP_CGEV_NW_DEACT_PDP: + case MM_3GPP_CGEV_ME_DEACT_PDP: + case MM_3GPP_CGEV_REJECT: + case MM_3GPP_CGEV_NW_REACT: { + gchar *pdp_type; + gchar *pdp_addr; + guint cid; + + g_print ("[%u] parsing as pdp\n", i); + ret = mm_3gpp_parse_cgev_indication_pdp (test->str, type, &pdp_type, &pdp_addr, &cid, &error); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpstr (pdp_type, ==, test->expected_pdp_type); + g_assert_cmpstr (pdp_addr, ==, test->expected_pdp_addr); + g_assert_cmpuint (cid, ==, test->expected_cid); + + g_free (pdp_type); + g_free (pdp_addr); + break; + } + case MM_3GPP_CGEV_NW_CLASS: + case MM_3GPP_CGEV_ME_CLASS: + case MM_3GPP_CGEV_NW_MODIFY: + case MM_3GPP_CGEV_ME_MODIFY: + /* ignore */ + break; + default: + break; + } + } +} + +/*****************************************************************************/ /* Test ICCID parsing */ static void @@ -1783,6 +2246,20 @@ } static void +test_iccid_parse_unquoted_unswapped_19_digit_no_f (void *f, gpointer d) +{ + const char *raw_iccid = "8944200053671052499"; + const char *expected = "8944200053671052499"; + char *parsed; + GError *error = NULL; + + parsed = mm_3gpp_parse_iccid (raw_iccid, &error); + g_assert_no_error (error); + g_assert_cmpstr (parsed, ==, expected); + g_free (parsed); +} + +static void test_iccid_parse_quoted_unswapped_20_digit (void *f, gpointer d) { const char *raw_iccid = "\"89324102234690160476\""; @@ -1797,6 +2274,34 @@ } static void +test_iccid_parse_quoted_unswapped_hex_account (void *f, gpointer d) +{ + const char *raw_iccid = "\"898602F9091830030220\""; + const char *expected = "898602F9091830030220"; + char *parsed; + GError *error = NULL; + + parsed = mm_3gpp_parse_iccid (raw_iccid, &error); + g_assert_no_error (error); + g_assert_cmpstr (parsed, ==, expected); + g_free (parsed); +} + +static void +test_iccid_parse_quoted_unswapped_hex_account_2 (void *f, gpointer d) +{ + const char *raw_iccid = "\"898602C0123456789012\""; + const char *expected = "898602C0123456789012"; + char *parsed; + GError *error = NULL; + + parsed = mm_3gpp_parse_iccid (raw_iccid, &error); + g_assert_no_error (error); + g_assert_cmpstr (parsed, ==, expected); + g_free (parsed); +} + +static void test_iccid_parse_short (void *f, gpointer d) { const char *raw_iccid = "982314203264096"; @@ -1812,7 +2317,7 @@ static void test_iccid_parse_invalid_chars (void *f, gpointer d) { - const char *raw_iccid = "98231420326ab9614067"; + const char *raw_iccid = "98231420326pl9614067"; char *parsed; GError *error = NULL; @@ -1849,6 +2354,48 @@ } /*****************************************************************************/ +/* Test APN cmp */ + +typedef struct { + const gchar *existing; + const gchar *requested; + gboolean match_expected; +} TestApnCmp; + +static const TestApnCmp test_apn_cmp[] = { + { "", "", TRUE }, + { NULL, "", TRUE }, + { "", NULL, TRUE }, + { NULL, NULL, TRUE }, + { "m2m.com.attz", "m2m.com.attz", TRUE }, + { "m2m.com.attz", "M2M.COM.ATTZ", TRUE }, + { "M2M.COM.ATTZ", "m2m.com.attz", TRUE }, + { "m2m.com.attz.mnc170.mcc310.gprs", "m2m.com.attz", TRUE }, + { "ac.vodafone.es.MNC001.MCC214.GPRS", "ac.vodafone.es", TRUE }, + { "", "m2m.com.attz", FALSE }, + { "m2m.com.attz", "", FALSE }, + { "m2m.com.attz", "m2m.com.attz.mnc170.mcc310.gprs", FALSE }, + { "ac.vodafone.es", "ac.vodafone.es.MNC001.MCC214.GPRS", FALSE }, + { "internet.test", "internet", FALSE }, + { "internet.test", "INTERNET", FALSE }, + { "internet.test", "internet.tes", FALSE }, +}; + +static void +test_cmp_apn_name (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (test_apn_cmp); i++) { + g_debug ("Comparing requested '%s' vs existing '%s': %s match", + test_apn_cmp[i].requested, + test_apn_cmp[i].existing, + test_apn_cmp[i].match_expected ? "should" : "shouldn't"); + g_assert (mm_3gpp_cmp_apn_name (test_apn_cmp[i].requested, test_apn_cmp[i].existing) == test_apn_cmp[i].match_expected); + } +} + +/*****************************************************************************/ /* Test CGDCONT test responses */ static void @@ -2047,6 +2594,93 @@ } /*****************************************************************************/ +/* Test CGDCONT read responses */ + +static void +test_cgact_read_results (const gchar *desc, + const gchar *reply, + MM3gppPdpContextActive *expected_results, + guint32 expected_results_len) +{ + GList *l; + GError *error = NULL; + GList *results; + + trace ("\nTesting %s +CGACT response...\n", desc); + + results = mm_3gpp_parse_cgact_read_response (reply, &error); + g_assert_no_error (error); + if (expected_results_len) { + g_assert (results); + g_assert_cmpuint (g_list_length (results), ==, expected_results_len); + } + + for (l = results; l; l = g_list_next (l)) { + MM3gppPdpContextActive *pdp = l->data; + gboolean found = FALSE; + guint i; + + for (i = 0; !found && i < expected_results_len; i++) { + MM3gppPdpContextActive *expected; + + expected = &expected_results[i]; + if (pdp->cid == expected->cid) { + found = TRUE; + g_assert_cmpuint (pdp->active, ==, expected->active); + } + } + + g_assert (found == TRUE); + } + + mm_3gpp_pdp_context_active_list_free (results); +} + +static void +test_cgact_read_response_none (void) +{ + test_cgact_read_results ("none", "", NULL, 0); +} + +static void +test_cgact_read_response_single_inactive (void) +{ + const gchar *reply = "+CGACT: 1,0\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, FALSE }, + }; + + test_cgact_read_results ("single inactive", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +static void +test_cgact_read_response_single_active (void) +{ + const gchar *reply = "+CGACT: 1,1\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, TRUE }, + }; + + test_cgact_read_results ("single active", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +static void +test_cgact_read_response_multiple (void) +{ + const gchar *reply = + "+CGACT: 1,0\r\n" + "+CGACT: 4,1\r\n" + "+CGACT: 5,0\r\n"; + static MM3gppPdpContextActive expected[] = { + { 1, FALSE }, + { 4, TRUE }, + { 5, FALSE }, + }; + + test_cgact_read_results ("multiple", reply, &expected[0], G_N_ELEMENTS (expected)); +} + +/*****************************************************************************/ /* Test CPMS responses */ static gboolean @@ -2242,7 +2876,7 @@ &mem1, &mem2, &error); - g_assert(ret); + g_assert (ret); g_assert_no_error (error); g_assert_cmpuint (cpms_query_test[i].mem1_want, ==, mem1); g_assert_cmpuint (cpms_query_test[i].mem2_want, ==, mem2); @@ -2258,14 +2892,12 @@ const GStrv expected) { GStrv results; - GError *error = NULL; guint i; trace ("\nTesting +CNUM response (%s)...\n", desc); - results = mm_3gpp_parse_cnum_exec_response (reply, &error); + results = mm_3gpp_parse_cnum_exec_response (reply); g_assert (results); - g_assert_no_error (error); g_assert_cmpuint (g_strv_length (results), ==, g_strv_length (expected)); for (i = 0; results[i]; i++) { @@ -2752,6 +3384,13 @@ } CclkTest; static const CclkTest cclk_tests[] = { + { "+CCLK: \"14/08/05,04:00:21\"", TRUE, TRUE, FALSE, + "2014-08-05T04:00:21+00:00", 0 }, + { "+CCLK: \"14/08/05,04:00:21\"", TRUE, FALSE, TRUE, + "2014-08-05T04:00:21+00:00", 0 }, + { "+CCLK: \"14/08/05,04:00:21\"", TRUE, TRUE, TRUE, + "2014-08-05T04:00:21+00:00", 0 }, + { "+CCLK: \"14/08/05,04:00:21+40\"", TRUE, TRUE, FALSE, "2014-08-05T04:00:21+10:00", 600 }, { "+CCLK: \"14/08/05,04:00:21+40\"", TRUE, FALSE, TRUE, @@ -2766,6 +3405,27 @@ { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, TRUE, "2015-02-28T20:30:40-08:00", -480 }, + { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, FALSE, + "2017-07-26T11:42:15+00:15", 15 }, + { "+CCLK: 17/07/26,11:42:15+01", TRUE, FALSE, TRUE, + "2017-07-26T11:42:15+00:15", 15 }, + { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, TRUE, + "2017-07-26T11:42:15+00:15", 15 }, + + { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, FALSE, + "2015-02-28T20:30:40-08:00", -480 }, + { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, FALSE, TRUE, + "2015-02-28T20:30:40-08:00", -480 }, + { "+CCLK: \"15/02/28,20:30:40-32\"", TRUE, TRUE, TRUE, + "2015-02-28T20:30:40-08:00", -480 }, + + { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, FALSE, + "2017-07-26T11:42:15+00:15", 15 }, + { "+CCLK: 17/07/26,11:42:15+01", TRUE, FALSE, TRUE, + "2017-07-26T11:42:15+00:15", 15 }, + { "+CCLK: 17/07/26,11:42:15+01", TRUE, TRUE, TRUE, + "2017-07-26T11:42:15+00:15", 15 }, + { "+CCLK: \"XX/XX/XX,XX:XX:XX+XX\"", FALSE, TRUE, FALSE, NULL, MM_NETWORK_TIMEZONE_OFFSET_UNKNOWN }, @@ -2802,8 +3462,7 @@ g_assert (mm_network_timezone_get_leap_seconds (tz) == MM_NETWORK_TIMEZONE_LEAP_SECONDS_UNKNOWN); } - if (iso8601) - g_free (iso8601); + g_free (iso8601); if (tz) g_object_unref (tz); @@ -2858,7 +3517,203 @@ g_assert_cmpstr (crsm_tests[i].hex, ==, hex); - g_free(hex); + g_free (hex); + } +} + +/*****************************************************************************/ +/* Test CGCONTRDP=N responses */ + +typedef struct { + const gchar *str; + guint cid; + guint bearer_id; + const gchar *apn; + const gchar *local_address; + const gchar *subnet; + const gchar *gateway_address; + const gchar *dns_primary_address; + const gchar *dns_secondary_address; +} CgcontrdpResponseTest; + +static const CgcontrdpResponseTest cgcontrdp_response_tests[] = { + /* Post TS 27.007 v9.4.0 format */ + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49.255.255.255.255\",\"2.197.17.49\",\"10.207.43.46\",\"10.206.56.132\",\"0.0.0.0\",\"0.0.0.0\",0", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + .dns_primary_address = "10.207.43.46", + .dns_secondary_address = "10.206.56.132", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49.255.255.255.255\",\"2.197.17.49\",\"10.207.43.46\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + .dns_primary_address = "10.207.43.46", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49.255.255.255.255\",\"2.197.17.49\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49.255.255.255.255\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + }, + /* Pre TS 27.007 v9.4.0 format */ + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49\",\"255.255.255.255\",\"2.197.17.49\",\"10.207.43.46\",\"10.206.56.132\",\"0.0.0.0\",\"0.0.0.0\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + .dns_primary_address = "10.207.43.46", + .dns_secondary_address = "10.206.56.132", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49\",\"255.255.255.255\",\"2.197.17.49\",\"10.207.43.46\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + .dns_primary_address = "10.207.43.46", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49\",\"255.255.255.255\",\"2.197.17.49\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + .gateway_address = "2.197.17.49", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49\",\"255.255.255.255\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + .subnet = "255.255.255.255", + }, + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\",\"2.197.17.49\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + .local_address = "2.197.17.49", + }, + /* Common */ + { + .str = "+CGCONTRDP: 4,5,\"ibox.tim.it.mnc001.mcc222.gprs\"", + .cid = 4, + .bearer_id = 5, + .apn = "ibox.tim.it.mnc001.mcc222.gprs", + }, + { + .str = "+CGCONTRDP: 4,5,\"\"", + .cid = 4, + .bearer_id = 5, + }, +}; + +static void +test_cgcontrdp_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cgcontrdp_response_tests); i++) { + GError *error = NULL; + gboolean success; + guint cid = G_MAXUINT; + guint bearer_id = G_MAXUINT; + gchar *apn = NULL; + gchar *local_address = NULL; + gchar *subnet = NULL; + gchar *gateway_address = NULL; + gchar *dns_primary_address = NULL; + gchar *dns_secondary_address = NULL; + + success = mm_3gpp_parse_cgcontrdp_response (cgcontrdp_response_tests[i].str, + &cid, + &bearer_id, + &apn, + &local_address, + &subnet, + &gateway_address, + &dns_primary_address, + &dns_secondary_address, + &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cgcontrdp_response_tests[i].cid, ==, cid); + g_assert_cmpuint (cgcontrdp_response_tests[i].bearer_id, ==, bearer_id); + g_assert_cmpstr (cgcontrdp_response_tests[i].apn, ==, apn); + g_assert_cmpstr (cgcontrdp_response_tests[i].local_address, ==, local_address); + g_assert_cmpstr (cgcontrdp_response_tests[i].subnet, ==, subnet); + g_assert_cmpstr (cgcontrdp_response_tests[i].gateway_address, ==, gateway_address); + g_assert_cmpstr (cgcontrdp_response_tests[i].dns_primary_address, ==, dns_primary_address); + g_assert_cmpstr (cgcontrdp_response_tests[i].dns_secondary_address, ==, dns_secondary_address); + + g_free (apn); + g_free (local_address); + g_free (subnet); + g_free (gateway_address); + g_free (dns_primary_address); + g_free (dns_secondary_address); + } +} + +/*****************************************************************************/ +/* Test CFUN? response */ + +typedef struct { + const gchar *str; + guint state; +} CfunQueryTest; + +static const CfunQueryTest cfun_query_tests[] = { + { "+CFUN: 1", 1 }, + { "+CFUN: 1,0", 1 }, + { "+CFUN: 0", 0 }, + { "+CFUN: 0,0", 0 }, + { "+CFUN: 19", 19 }, + { "+CFUN: 19,0", 19 }, +}; + +static void +test_cfun_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_tests); i++) { + GError *error = NULL; + gboolean success; + guint state = G_MAXUINT; + + success = mm_3gpp_parse_cfun_query_response (cfun_query_tests[i].str, &state, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_tests[i].state, ==, state); } } @@ -2982,6 +3837,94 @@ } } +typedef struct { + const gchar *str; + MMModemPowerState state; +} CfunQueryGenericTest; + +static const CfunQueryGenericTest cfun_query_generic_tests[] = { + { "+CFUN: 1", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 1,0", MM_MODEM_POWER_STATE_ON }, + { "+CFUN: 0", MM_MODEM_POWER_STATE_OFF }, + { "+CFUN: 0,0", MM_MODEM_POWER_STATE_OFF }, + { "+CFUN: 4", MM_MODEM_POWER_STATE_LOW }, + { "+CFUN: 4,0", MM_MODEM_POWER_STATE_LOW }, +}; + +static void +test_cfun_generic_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (cfun_query_generic_tests); i++) { + GError *error = NULL; + gboolean success; + MMModemPowerState state = MM_MODEM_POWER_STATE_UNKNOWN; + + success = mm_3gpp_parse_cfun_query_generic_response (cfun_query_generic_tests[i].str, &state, &error); + g_assert_no_error (error); + g_assert (success); + g_assert_cmpuint (cfun_query_generic_tests[i].state, ==, state); + } +} + +typedef struct { + gchar *response; + gint result; + gchar *error_message; +} CSIMResponseTest; + +static CSIMResponseTest csim_response_test_list [] = { + /* The parser expects that 2nd arg contains + * substring "63Cx" where x is an HEX string + * representing the retry value */ + {"+CSIM:8,\"000063C1\"", 1, NULL}, + {"+CSIM:8,\"000063CA\"", 10, NULL}, + {"+CSIM:8,\"000063CF\"", 15, NULL}, + /* The parser accepts spaces */ + {"+CSIM:8, \"000063C1\"", 1, NULL}, + {"+CSIM: 8, \"000063C1\"", 1, NULL}, + {"+CSIM: 8, \"000063C1\"", 1, NULL}, + /* the parser expects an int as first argument (2nd arg's length), + * but does not check if it is correct */ + {"+CSIM: 10, \"63CF\"", 15, NULL}, + /* Valid +CSIM Error codes */ + {"+CSIM: 4, \"6300\"", -1, "SIM verification failed"}, + {"+CSIM: 4, \"6983\"", -1, "SIM authentication method blocked"}, + {"+CSIM: 4, \"6984\"", -1, "SIM reference data invalidated"}, + {"+CSIM: 4, \"6A86\"", -1, "Incorrect parameters in SIM request"}, + {"+CSIM: 4, \"6A88\"", -1, "SIM reference data not found"}, + /* Test error: missing first argument */ + {"+CSIM:000063CF\"", -1, "Could not recognize +CSIM response '+CSIM:000063CF\"'"}, + /* Test error: missing quotation mark */ + {"+CSIM: 8, 000063CF", -1, "Could not recognize +CSIM response '+CSIM: 8, 000063CF'"}, + /* Test generic error */ + {"+CSIM: 4, \"63BF\"", -1, "Unknown error returned '0x63bf'"}, + {"+CSIM: 4, \"63D0\"", -1, "Unknown error returned '0x63d0'"} +}; + +static void +test_csim_response (void) +{ + guint i; + gint res; + GError* error = NULL; + + for (i = 0; i < G_N_ELEMENTS (csim_response_test_list); i++) { + res = mm_parse_csim_response (csim_response_test_list[i].response, &error); + + if (csim_response_test_list[i].error_message == NULL) { + g_assert_no_error (error); + } else { + g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED); + g_assert_cmpstr (error->message, ==, csim_response_test_list[i].error_message); + g_clear_error (&error); + } + + g_assert_cmpint (res, ==, csim_response_test_list[i].result); + } +} + /*****************************************************************************/ typedef struct { @@ -3027,6 +3970,42 @@ /*****************************************************************************/ +typedef struct { + const guint8 bcd[10]; + gsize bcd_len; + const gchar *str; +} BcdToStringTest; + +static const BcdToStringTest bcd_to_string_tests[] = { + { { }, 0, "" }, + { { 0x01 }, 1, "10" }, + { { 0x1F }, 1, "" }, + { { 0xE2 }, 1, "2" }, + { { 0xD3 }, 1, "3" }, + { { 0xC4 }, 1, "4" }, + { { 0xB1, 0x23 }, 2, "1" }, + { { 0x01, 0x23, 0x45, 0x67 }, 4, "10325476" }, + { { 0x01, 0x23, 0x45, 0xA7 }, 4, "1032547" }, + { { 0x01, 0x23, 0x45, 0x67 }, 2, "1032" }, +}; + +static void +test_bcd_to_string (void *f, gpointer d) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (bcd_to_string_tests); i++) { + gchar *str; + + str = mm_bcd_to_string (bcd_to_string_tests[i].bcd, + bcd_to_string_tests[i].bcd_len); + g_assert_cmpstr (str, ==, bcd_to_string_tests[i].str); + g_free (str); + } +} + +/*****************************************************************************/ + void _mm_log (const char *loc, const char *func, @@ -3056,12 +4035,24 @@ gint result; DevidItem *item = &devids[0]; - g_type_init (); g_test_init (&argc, &argv, NULL); suite = g_test_get_root (); reg_data = reg_test_data_new (); + g_test_suite_add (suite, TESTCASE (test_ifc_response_all_simple, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_all_groups, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_none_only, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_xon_xoff_only, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_rts_cts_only, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_no_xon_xoff, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_no_xon_xoff_in_ta, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_no_xon_xoff_in_te, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_no_rts_cts_simple, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_no_rts_cts_groups, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_all_simple_and_unknown, NULL)); + g_test_suite_add (suite, TESTCASE (test_ifc_response_all_groups_and_unknown, NULL)); + g_test_suite_add (suite, TESTCASE (test_ws46_response_generic_2g3g4g, NULL)); g_test_suite_add (suite, TESTCASE (test_ws46_response_generic_2g3g, NULL)); g_test_suite_add (suite, TESTCASE (test_ws46_response_generic_2g3g_v2, NULL)); @@ -3101,6 +4092,10 @@ g_test_suite_add (suite, TESTCASE (test_cops_response_gsm_invalid, NULL)); g_test_suite_add (suite, TESTCASE (test_cops_response_umts_invalid, NULL)); + g_test_suite_add (suite, TESTCASE (test_cops_query, NULL)); + + g_test_suite_add (suite, TESTCASE (test_normalize_operator, NULL)); + g_test_suite_add (suite, TESTCASE (test_creg1_solicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_creg1_unsolicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_creg2_mercury_solicited, reg_data)); @@ -3120,6 +4115,8 @@ g_test_suite_add (suite, TESTCASE (test_creg2_leading_zeros_solicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_creg2_no_leading_zeros_unsolicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_creg2_leading_zeros_unsolicited, reg_data)); + g_test_suite_add (suite, TESTCASE (test_creg2_ublox_solicited, reg_data)); + g_test_suite_add (suite, TESTCASE (test_creg2_ublox_unsolicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_cgreg1_solicited, reg_data)); g_test_suite_add (suite, TESTCASE (test_cgreg1_unsolicited, reg_data)); @@ -3148,13 +4145,24 @@ g_test_suite_add (suite, TESTCASE (test_cscs_buslink_support_response, NULL)); g_test_suite_add (suite, TESTCASE (test_cscs_blackberry_support_response, NULL)); + g_test_suite_add (suite, TESTCASE (test_cmer_response_cinterion_pls8, NULL)); + g_test_suite_add (suite, TESTCASE (test_cmer_response_sierra_em7345, NULL)); + g_test_suite_add (suite, TESTCASE (test_cmer_response_cinterion_ehs5, NULL)); + + g_test_suite_add (suite, TESTCASE (test_cmer_request_cinterion_ehs5, NULL)); + g_test_suite_add (suite, TESTCASE (test_cind_response_linktop_lw273, NULL)); g_test_suite_add (suite, TESTCASE (test_cind_response_moto_v3m, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgev_indication, NULL)); + g_test_suite_add (suite, TESTCASE (test_iccid_parse_quoted_swap_19_digit, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_unquoted_swap_20_digit, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_unquoted_unswapped_19_digit, NULL)); + g_test_suite_add (suite, TESTCASE (test_iccid_parse_unquoted_unswapped_19_digit_no_f, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_quoted_unswapped_20_digit, NULL)); + g_test_suite_add (suite, TESTCASE (test_iccid_parse_quoted_unswapped_hex_account, NULL)); + g_test_suite_add (suite, TESTCASE (test_iccid_parse_quoted_unswapped_hex_account_2, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_short, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_invalid_chars, NULL)); g_test_suite_add (suite, TESTCASE (test_iccid_parse_quoted_invalid_mii, NULL)); @@ -3173,6 +4181,8 @@ g_test_suite_add (suite, TESTCASE (test_cpms_response_empty_fields, NULL)); g_test_suite_add (suite, TESTCASE (test_cpms_query_response, NULL)); + g_test_suite_add (suite, TESTCASE (test_cmp_apn_name, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgdcont_test_response_single, NULL)); g_test_suite_add (suite, TESTCASE (test_cgdcont_test_response_multiple, NULL)); g_test_suite_add (suite, TESTCASE (test_cgdcont_test_response_multiple_and_ignore, NULL)); @@ -3183,6 +4193,11 @@ g_test_suite_add (suite, TESTCASE (test_cgdcont_read_response_nokia, NULL)); g_test_suite_add (suite, TESTCASE (test_cgdcont_read_response_samsung, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgact_read_response_none, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgact_read_response_single_inactive, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgact_read_response_single_active, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgact_read_response_multiple, NULL)); + g_test_suite_add (suite, TESTCASE (test_cnum_response_generic, NULL)); g_test_suite_add (suite, TESTCASE (test_cnum_response_generic_without_detail, NULL)); g_test_suite_add (suite, TESTCASE (test_cnum_response_generic_detail_unquoted, NULL)); @@ -3211,11 +4226,20 @@ g_test_suite_add (suite, TESTCASE (test_crsm_response, NULL)); + g_test_suite_add (suite, TESTCASE (test_cgcontrdp_response, NULL)); + + g_test_suite_add (suite, TESTCASE (test_cfun_response, NULL)); + g_test_suite_add (suite, TESTCASE (test_cfun_generic_response, NULL)); + + g_test_suite_add (suite, TESTCASE (test_csim_response, NULL)); + g_test_suite_add (suite, TESTCASE (test_cesq_response, NULL)); g_test_suite_add (suite, TESTCASE (test_cesq_response_to_signal, NULL)); g_test_suite_add (suite, TESTCASE (test_parse_uint_list, NULL)); + g_test_suite_add (suite, TESTCASE (test_bcd_to_string, NULL)); + result = g_test_run (); reg_test_data_free (reg_data); diff -Nru modemmanager-1.6.8/src/tests/test-modem-helpers-qmi.c modemmanager-1.10.0/src/tests/test-modem-helpers-qmi.c --- modemmanager-1.6.8/src/tests/test-modem-helpers-qmi.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-modem-helpers-qmi.c 2018-11-15 09:55:53.000000000 +0100 @@ -333,7 +333,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/QMI/Current-Capabilities/UML290", test_uml290); diff -Nru modemmanager-1.6.8/src/tests/test-qcdm-serial-port.c modemmanager-1.10.0/src/tests/test-qcdm-serial-port.c --- modemmanager-1.6.8/src/tests/test-qcdm-serial-port.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-qcdm-serial-port.c 2018-11-15 09:55:53.000000000 +0100 @@ -213,9 +213,6 @@ gboolean success; GError *error = NULL; - /* In the child */ - g_type_init (); - loop = g_main_loop_new (NULL, FALSE); port = mm_port_serial_qcdm_new_fd (fd); diff -Nru modemmanager-1.6.8/src/tests/test-sms-part-3gpp.c modemmanager-1.10.0/src/tests/test-sms-part-3gpp.c --- modemmanager-1.6.8/src/tests/test-sms-part-3gpp.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-sms-part-3gpp.c 2018-11-15 09:55:53.000000000 +0100 @@ -865,7 +865,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/SMS/3GPP/PDU-Parser/pdu1", test_pdu1); diff -Nru modemmanager-1.6.8/src/tests/test-sms-part-cdma.c modemmanager-1.10.0/src/tests/test-sms-part-cdma.c --- modemmanager-1.6.8/src/tests/test-sms-part-cdma.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/src/tests/test-sms-part-cdma.c 2018-11-15 09:55:53.000000000 +0100 @@ -529,7 +529,6 @@ { setlocale (LC_ALL, ""); - g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/MM/SMS/CDMA/PDU-Parser/pdu1", test_pdu1); diff -Nru modemmanager-1.6.8/src/tests/test-udev-rules.c modemmanager-1.10.0/src/tests/test-udev-rules.c --- modemmanager-1.6.8/src/tests/test-udev-rules.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/src/tests/test-udev-rules.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,78 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2016 Aleksander Morgado + */ + +#include +#include +#include +#include +#include + +#define _LIBMM_INSIDE_MM +#include + +/* Define symbol to enable test message traces */ +#undef ENABLE_TEST_MESSAGE_TRACES + +#include "mm-kernel-device-generic-rules.h" +#include "mm-log.h" + +/************************************************************/ + +static void +test_load_cleanup_core (void) +{ + GArray *rules; + GError *error = NULL; + + rules = mm_kernel_device_generic_rules_load (TESTUDEVRULESDIR, &error); + g_assert_no_error (error); + g_assert (rules); + g_assert (rules->len > 0); + + g_array_unref (rules); +} + +/************************************************************/ + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ +#if defined ENABLE_TEST_MESSAGE_TRACES + /* Dummy log function */ + va_list args; + gchar *msg; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +#endif +} + +int main (int argc, char **argv) +{ + setlocale (LC_ALL, ""); + + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/MM/test-udev-rules/load-cleanup-core", test_load_cleanup_core); + + return g_test_run (); +} diff -Nru modemmanager-1.6.8/test/lsudev.c modemmanager-1.10.0/test/lsudev.c --- modemmanager-1.6.8/test/lsudev.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/test/lsudev.c 2018-11-15 09:55:53.000000000 +0100 @@ -156,8 +156,6 @@ return 1; } - g_type_init (); - loop = g_main_loop_new (NULL, FALSE); setup_signals (); diff -Nru modemmanager-1.6.8/test/Makefile.am modemmanager-1.10.0/test/Makefile.am --- modemmanager-1.6.8/test/Makefile.am 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/test/Makefile.am 2018-11-15 09:55:53.000000000 +0100 @@ -6,12 +6,16 @@ # lsudev ################################################################################ +if WITH_UDEV + noinst_PROGRAMS += lsudev lsudev_SOURCES = lsudev.c lsudev_CPPFLAGS = $(GUDEV_CFLAGS) lsudev_LDADD = $(GUDEV_LIBS) +endif + ################################################################################ # mmtty ################################################################################ @@ -24,6 +28,7 @@ $(MM_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/kerneldevice \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/libmm-glib \ @@ -33,11 +38,35 @@ mmtty_LDADD = \ $(MM_LIBS) \ - $(top_builddir)/src/libhelpers.la \ $(top_builddir)/src/libport.la \ $(NULL) ################################################################################ +# mmrules +################################################################################ + +noinst_PROGRAMS += mmrules + +mmrules_SOURCES = mmrules.c + +mmrules_CPPFLAGS = \ + $(MM_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/kerneldevice \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/libmm-glib \ + -I$(top_srcdir)/libmm-glib/generated \ + -I$(top_builddir)/libmm-glib/generated + $(NULL) + +mmrules_LDADD = \ + $(MM_LIBS) \ + $(top_builddir)/src/libkerneldevice.la \ + $(NULL) + +################################################################################ # mmcli-test-sms ################################################################################ diff -Nru modemmanager-1.6.8/test/Makefile.in modemmanager-1.10.0/test/Makefile.in --- modemmanager-1.6.8/test/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/test/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -88,21 +88,25 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = lsudev$(EXEEXT) mmtty$(EXEEXT) +noinst_PROGRAMS = $(am__EXEEXT_1) mmtty$(EXEEXT) mmrules$(EXEEXT) + +################################################################################ +# lsudev +################################################################################ +@WITH_UDEV_TRUE@am__append_1 = lsudev subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -110,19 +114,24 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +@WITH_UDEV_TRUE@am__EXEEXT_1 = lsudev$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am_lsudev_OBJECTS = lsudev-lsudev.$(OBJEXT) +am__lsudev_SOURCES_DIST = lsudev.c +@WITH_UDEV_TRUE@am_lsudev_OBJECTS = lsudev-lsudev.$(OBJEXT) lsudev_OBJECTS = $(am_lsudev_OBJECTS) am__DEPENDENCIES_1 = -lsudev_DEPENDENCIES = $(am__DEPENDENCIES_1) +@WITH_UDEV_TRUE@lsudev_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +am_mmrules_OBJECTS = mmrules-mmrules.$(OBJEXT) +mmrules_OBJECTS = $(am_mmrules_OBJECTS) +mmrules_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/libkerneldevice.la am_mmtty_OBJECTS = mmtty-mmtty.$(OBJEXT) mmtty_OBJECTS = $(am_mmtty_OBJECTS) mmtty_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(top_builddir)/src/libhelpers.la \ $(top_builddir)/src/libport.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -138,7 +147,9 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/lsudev-lsudev.Po \ + ./$(DEPDIR)/mmrules-mmrules.Po ./$(DEPDIR)/mmtty-mmtty.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -158,8 +169,9 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(lsudev_SOURCES) $(mmtty_SOURCES) -DIST_SOURCES = $(lsudev_SOURCES) $(mmtty_SOURCES) +SOURCES = $(lsudev_SOURCES) $(mmrules_SOURCES) $(mmtty_SOURCES) +DIST_SOURCES = $(am__lsudev_SOURCES_DIST) $(mmrules_SOURCES) \ + $(mmtty_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -187,7 +199,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -240,14 +251,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -368,8 +371,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -394,14 +395,15 @@ # mmcli-test-sms ################################################################################ EXTRA_DIST = mmcli-test-sms -lsudev_SOURCES = lsudev.c -lsudev_CPPFLAGS = $(GUDEV_CFLAGS) -lsudev_LDADD = $(GUDEV_LIBS) +@WITH_UDEV_TRUE@lsudev_SOURCES = lsudev.c +@WITH_UDEV_TRUE@lsudev_CPPFLAGS = $(GUDEV_CFLAGS) +@WITH_UDEV_TRUE@lsudev_LDADD = $(GUDEV_LIBS) mmtty_SOURCES = mmtty.c mmtty_CPPFLAGS = \ $(MM_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/kerneldevice \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/libmm-glib \ @@ -410,10 +412,26 @@ mmtty_LDADD = \ $(MM_LIBS) \ - $(top_builddir)/src/libhelpers.la \ $(top_builddir)/src/libport.la \ $(NULL) +mmrules_SOURCES = mmrules.c +mmrules_CPPFLAGS = \ + $(MM_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/kerneldevice \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/libmm-glib \ + -I$(top_srcdir)/libmm-glib/generated \ + -I$(top_builddir)/libmm-glib/generated + +mmrules_LDADD = \ + $(MM_LIBS) \ + $(top_builddir)/src/libkerneldevice.la \ + $(NULL) + all: all-am .SUFFIXES: @@ -435,8 +453,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -461,6 +479,10 @@ @rm -f lsudev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lsudev_OBJECTS) $(lsudev_LDADD) $(LIBS) +mmrules$(EXEEXT): $(mmrules_OBJECTS) $(mmrules_DEPENDENCIES) $(EXTRA_mmrules_DEPENDENCIES) + @rm -f mmrules$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmrules_OBJECTS) $(mmrules_LDADD) $(LIBS) + mmtty$(EXEEXT): $(mmtty_OBJECTS) $(mmtty_DEPENDENCIES) $(EXTRA_mmtty_DEPENDENCIES) @rm -f mmtty$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmtty_OBJECTS) $(mmtty_LDADD) $(LIBS) @@ -471,8 +493,15 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsudev-lsudev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmtty-mmtty.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsudev-lsudev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmrules-mmrules.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmtty-mmtty.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -512,6 +541,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lsudev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lsudev-lsudev.obj `if test -f 'lsudev.c'; then $(CYGPATH_W) 'lsudev.c'; else $(CYGPATH_W) '$(srcdir)/lsudev.c'; fi` +mmrules-mmrules.o: mmrules.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrules_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmrules-mmrules.o -MD -MP -MF $(DEPDIR)/mmrules-mmrules.Tpo -c -o mmrules-mmrules.o `test -f 'mmrules.c' || echo '$(srcdir)/'`mmrules.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmrules-mmrules.Tpo $(DEPDIR)/mmrules-mmrules.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmrules.c' object='mmrules-mmrules.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrules_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmrules-mmrules.o `test -f 'mmrules.c' || echo '$(srcdir)/'`mmrules.c + +mmrules-mmrules.obj: mmrules.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrules_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmrules-mmrules.obj -MD -MP -MF $(DEPDIR)/mmrules-mmrules.Tpo -c -o mmrules-mmrules.obj `if test -f 'mmrules.c'; then $(CYGPATH_W) 'mmrules.c'; else $(CYGPATH_W) '$(srcdir)/mmrules.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmrules-mmrules.Tpo $(DEPDIR)/mmrules-mmrules.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmrules.c' object='mmrules-mmrules.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrules_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmrules-mmrules.obj `if test -f 'mmrules.c'; then $(CYGPATH_W) 'mmrules.c'; else $(CYGPATH_W) '$(srcdir)/mmrules.c'; fi` + mmtty-mmtty.o: mmtty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmtty_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmtty-mmtty.o -MD -MP -MF $(DEPDIR)/mmtty-mmtty.Tpo -c -o mmtty-mmtty.o `test -f 'mmtty.c' || echo '$(srcdir)/'`mmtty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmtty-mmtty.Tpo $(DEPDIR)/mmtty-mmtty.Po @@ -584,7 +627,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -654,7 +700,9 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/lsudev-lsudev.Po + -rm -f ./$(DEPDIR)/mmrules-mmrules.Po + -rm -f ./$(DEPDIR)/mmtty-mmtty.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -700,7 +748,9 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/lsudev-lsudev.Po + -rm -f ./$(DEPDIR)/mmrules-mmrules.Po + -rm -f ./$(DEPDIR)/mmtty-mmtty.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -721,9 +771,9 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -738,6 +788,7 @@ .PRECIOUS: Makefile $(NULL) + $(NULL) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru modemmanager-1.6.8/test/mmrules.c modemmanager-1.10.0/test/mmrules.c --- modemmanager-1.6.8/test/mmrules.c 1970-01-01 01:00:00.000000000 +0100 +++ modemmanager-1.10.0/test/mmrules.c 2018-11-15 09:55:53.000000000 +0100 @@ -0,0 +1,171 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2015 Aleksander Morgado + */ + +#include "config.h" + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define PROGRAM_NAME "mmrules" +#define PROGRAM_VERSION PACKAGE_VERSION + +/* Context */ +static gchar *path; +static gboolean verbose_flag; +static gboolean version_flag; + +static GOptionEntry main_entries[] = { + { "path", 'p', 0, G_OPTION_ARG_FILENAME, &path, + "Specify path to udev rules directory", + "[PATH]" + }, + { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_flag, + "Run action with verbose logs", + NULL + }, + { "version", 'V', 0, G_OPTION_ARG_NONE, &version_flag, + "Print version", + NULL + }, + { NULL } +}; + +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ + va_list args; + gchar *msg; + + if (!verbose_flag) + return; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + g_print ("%s\n", msg); + g_free (msg); +} + +static void +print_version_and_exit (void) +{ + g_print ("\n" + PROGRAM_NAME " " PROGRAM_VERSION "\n" + "Copyright (2015) Aleksander Morgado\n" + "License GPLv2+: GNU GPL version 2 or later \n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n" + "\n"); + exit (EXIT_SUCCESS); +} + +static void +print_rule (MMUdevRule *rule) +{ + /* Process conditions */ + if (rule->conditions) { + guint i; + + for (i = 0; i < rule->conditions->len; i++) { + MMUdevRuleMatch *rule_match; + + rule_match = &g_array_index (rule->conditions, MMUdevRuleMatch, i); + switch (rule_match->type) { + case MM_UDEV_RULE_MATCH_TYPE_EQUAL: + g_print (" [condition %u] %s == %s\n", + i, rule_match->parameter, rule_match->value); + break; + case MM_UDEV_RULE_MATCH_TYPE_NOT_EQUAL: + g_print (" [condition %u] %s != %s\n", + i, rule_match->parameter, rule_match->value); + break; + case MM_UDEV_RULE_MATCH_TYPE_UNKNOWN: + g_assert_not_reached (); + } + } + } + + /* Process result */ + switch (rule->result.type) { + case MM_UDEV_RULE_RESULT_TYPE_LABEL: + g_print (" [result] label %s\n", rule->result.content.tag); + break; + case MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX: + g_print (" [result] jump to rule %u\n", rule->result.content.index); + break; + case MM_UDEV_RULE_RESULT_TYPE_PROPERTY: + g_print (" [result] set property %s = %s\n", + rule->result.content.property.name, rule->result.content.property.value); + break; + case MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG: + case MM_UDEV_RULE_RESULT_TYPE_UNKNOWN: + g_assert_not_reached (); + } +} + +int main (int argc, char **argv) +{ + GOptionContext *context; + GArray *rules; + guint i; + GError *error = NULL; + + setlocale (LC_ALL, ""); + + /* Setup option context, process it and destroy it */ + context = g_option_context_new ("- ModemManager udev rules testing"); + g_option_context_add_main_entries (context, main_entries, NULL); + g_option_context_parse (context, &argc, &argv, NULL); + g_option_context_free (context); + + if (version_flag) + print_version_and_exit (); + + /* No device path given? */ + if (!path) { + g_printerr ("error: no path specified\n"); + exit (EXIT_FAILURE); + } + + /* Load rules from directory */ + rules = mm_kernel_device_generic_rules_load (path, &error); + if (!rules) { + g_printerr ("error: couldn't load rules: %s", error->message); + exit (EXIT_FAILURE); + } + + /* Print loaded rules */ + for (i = 0; i < rules->len; i++) { + g_print ("-----------------------------------------\n"); + g_print ("rule [%u]:\n", i); + print_rule (&g_array_index (rules, MMUdevRule, i)); + } + + g_array_unref (rules); + + return EXIT_SUCCESS; +} diff -Nru modemmanager-1.6.8/test/mmtty.c modemmanager-1.10.0/test/mmtty.c --- modemmanager-1.6.8/test/mmtty.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/test/mmtty.c 2018-11-15 09:55:53.000000000 +0100 @@ -259,8 +259,6 @@ setlocale (LC_ALL, ""); - g_type_init (); - /* Setup option context, process it and destroy it */ context = g_option_context_new ("- ModemManager TTY testing"); g_option_context_add_main_entries (context, main_entries, NULL); diff -Nru modemmanager-1.6.8/TODO modemmanager-1.10.0/TODO --- modemmanager-1.6.8/TODO 2017-04-08 12:38:10.000000000 +0200 +++ modemmanager-1.10.0/TODO 2018-11-15 09:55:53.000000000 +0100 @@ -18,7 +18,7 @@ Therefore, looking for ways to mitigate probing time in the specific bad cases is a good way of minimizing this problem. Some ideas: - ** If one AT probing suceeds, don't allow timeouts in remaining ports when + ** If one AT probing succeeds, don't allow timeouts in remaining ports when probing for AT. diff -Nru modemmanager-1.6.8/uml290/Makefile.in modemmanager-1.10.0/uml290/Makefile.in --- modemmanager-1.6.8/uml290/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/uml290/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -95,14 +95,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -133,7 +132,8 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/uml290mode-uml290mode.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -182,7 +182,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -235,14 +234,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -363,8 +354,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -411,8 +400,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -443,7 +432,13 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml290mode-uml290mode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml290mode-uml290mode.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -541,7 +536,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -611,7 +609,7 @@ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/uml290mode-uml290mode.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -657,7 +655,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/uml290mode-uml290mode.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -678,9 +676,9 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff -Nru modemmanager-1.6.8/uml290/uml290mode.c modemmanager-1.10.0/uml290/uml290mode.c --- modemmanager-1.6.8/uml290/uml290mode.c 2017-06-17 09:47:03.000000000 +0200 +++ modemmanager-1.10.0/uml290/uml290mode.c 2018-11-15 09:55:53.000000000 +0100 @@ -44,7 +44,7 @@ int i = 0, z; wmcbool newline = FALSE; char tmp[500]; - u_int32_t flen; + uint32_t flen; flen = snprintf (tmp, sizeof (tmp) - 1, "%s (%zu) ", detail, len); fprintf (stdout, "%s", tmp); @@ -191,7 +191,7 @@ } static int -wmc_set_global_mode (const char *port, u_int8_t mode) +wmc_set_global_mode (const char *port, uint8_t mode) { int fd, err; char buf[1024]; @@ -248,7 +248,7 @@ size_t len; WmcResult *result; size_t reply_len; - u_int8_t mode = 0; + uint8_t mode = 0; const char *smode = NULL; fd = com_setup (port); @@ -414,7 +414,7 @@ } static int -qcdm_set_hdr_pref (const char *port, u_int8_t hdrpref) +qcdm_set_hdr_pref (const char *port, uint8_t hdrpref) { int fd, err; char buf[512]; @@ -472,7 +472,7 @@ size_t len; QcdmResult *result = NULL; size_t reply_len; - u_int8_t pref; + uint8_t pref; const char *spref = NULL; fd = com_setup (port); @@ -538,7 +538,7 @@ } static int -qcdm_set_mode (const char *port, u_int8_t mode) +qcdm_set_mode (const char *port, uint8_t mode) { int fd, err; char buf[512]; @@ -600,8 +600,8 @@ static wmcbool parse_mode (const char *s, - u_int8_t *out_mode, - u_int8_t *out_hdrpref, + uint8_t *out_mode, + uint8_t *out_hdrpref, wmcbool *out_set_evdo) { if (strcasecmp (s, "lte") == 0) { @@ -664,8 +664,8 @@ int main (int argc, char *argv[]) { - u_int8_t mode = WMC_NETWORK_MODE_AUTO; - u_int8_t hdrpref = QCDM_CMD_NV_HDR_REV_PREF_ITEM_REV_PREF_EHRPD; + uint8_t mode = WMC_NETWORK_MODE_AUTO; + uint8_t hdrpref = QCDM_CMD_NV_HDR_REV_PREF_ITEM_REV_PREF_EHRPD; const char *wmcport = argv[1]; const char *dmport = argv[2]; const char *msg = NULL; @@ -719,4 +719,3 @@ return 0; } - diff -Nru modemmanager-1.6.8/vapi/Makefile.in modemmanager-1.10.0/vapi/Makefile.in --- modemmanager-1.6.8/vapi/Makefile.in 2017-06-17 10:24:58.000000000 +0200 +++ modemmanager-1.10.0/vapi/Makefile.in 2019-01-17 16:15:48.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -94,14 +94,13 @@ $(top_srcdir)/m4/compiler_warnings.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/vapigen.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -161,7 +160,6 @@ am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -214,14 +212,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ @@ -342,8 +332,6 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ @@ -395,8 +383,8 @@ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -441,7 +429,10 @@ cscope cscopelist: -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \